ソースを参照

Merge remote-tracking branch 'origin/master'

lazhaoqian 4 年 前
コミット
2215df4817

+ 3 - 1
ruoyi-fleet/src/main/java/com/ruoyi/orderManagement/finance/service/impl/FTmsaccbillsServiceImpl.java

@@ -102,7 +102,9 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService {
                 }
                 if (ftmsorderbillsfees.getActId() == 1080L || ftmsorderbillsfees.getActId() == 1090L) {
                     Ftmsorderbillscars ftmsorderbillscars = ftmsorderbillscarsMapper.selectftmsorderbillscarsById(ftmsorderbillsfees.getfPid());
-                    map1.put("carLoadDate", DateUtils.dateTime(ftmsorderbillscars.getLoadDate()));
+                    if (StringUtils.isNotNull(ftmsorderbillscars.getLoadDate())) {
+                        map1.put("carLoadDate", DateUtils.dateTime(ftmsorderbillscars.getLoadDate()));
+                    }
                 }
                 // 字典宝
                 SysDictData sysDictData = new SysDictData();

+ 11 - 0
ruoyi-fleet/src/main/java/com/ruoyi/orderPlan/domain/VehicleLedgerExcel.java

@@ -11,6 +11,9 @@ public class VehicleLedgerExcel {
 
     private Long id;
 
+    @Excel(name = "提单号")
+    private String mblno;
+
     @Excel(name = "装卸日期")
     private String mdLoadDate;
 
@@ -113,6 +116,14 @@ public class VehicleLedgerExcel {
      */
     private String invStatus;
 
+    public String getMblno() {
+        return mblno;
+    }
+
+    public void setMblno(String mblno) {
+        this.mblno = mblno;
+    }
+
     public Long getId() {
         return id;
     }

+ 8 - 0
ruoyi-fleet/src/main/java/com/ruoyi/orderPlan/mapper/FtmsorderbillscarsMapper.java

@@ -71,6 +71,14 @@ public interface FtmsorderbillscarsMapper {
     public int deleteftmsorderbillscarsByPId(long id);
 
     /**
+     * 根据主表id删除后续对应信息
+     *
+     * @param id 主表id
+     * @return 结果
+     */
+    public int deleteFollowUpBusinessByCarPId(long id);
+
+    /**
      * 根据原始来源id 查询是否可以撤回计划
      *
      * @param ftmsorderbills 计划id

+ 12 - 7
ruoyi-fleet/src/main/java/com/ruoyi/orderPlan/service/impl/FtmsorderbillsServiceImpl.java

@@ -337,13 +337,10 @@ public class FtmsorderbillsServiceImpl implements IftmsorderbillsService {
         for (Long l : ids) {
             line++;
             Ftmsorderbills ftmsorderbills = ftmsorderbillsMapper.selectftmsorderbillsById(l);
-            if (ftmsorderbills.getBillStatus() == 40) {
-                return AjaxResult.error("所选数据第" + line + "条数据状态已提交不允许删除");
-            }
-            if (ftmsorderbillsMapper.deleteftmsorderbillsById(l) <= 0) {
-                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-                return AjaxResult.error("删除订单失败,若多次失败请联系管理员");
+            if (ftmsorderbills.getBillStatus() > 6) {
+                return AjaxResult.error("所选数据第" + line + "条数据状态已操作调度不允许删除");
             }
+            ftmsorderbillsMapper.deleteftmsorderbillsById(l);
             ftmsorderbillscntrsMapper.deleteftmsorderbillscntrsByPId(l);
             ftmsorderbillsplansMapper.deleteftmsorderbillsplansByPId(l);
         }
@@ -357,8 +354,16 @@ public class FtmsorderbillsServiceImpl implements IftmsorderbillsService {
      * @return 结果
      */
     @Override
+    @Transactional
     public int deleteftmsorderbillsById(Long id) {
-        return ftmsorderbillsMapper.deleteftmsorderbillsById(id);
+        Ftmsorderbills ftmsorderbills = ftmsorderbillsMapper.selectftmsorderbillsById(id);
+        if (ftmsorderbills.getBillStatus() > 6) {
+            return 0;
+        }
+        ftmsorderbillsMapper.deleteftmsorderbillsById(id);
+        ftmsorderbillscntrsMapper.deleteftmsorderbillscntrsByPId(id);
+        ftmsorderbillsplansMapper.deleteftmsorderbillsplansByPId(id);
+        return 1;
     }
 
     /**

+ 7 - 10
ruoyi-fleet/src/main/java/com/ruoyi/orderPlan/service/impl/FtmsorderbillscarsServiceImpl.java

@@ -896,6 +896,7 @@ public class FtmsorderbillscarsServiceImpl implements IftmsorderbillscarsService
             return AjaxResult.error("更新调度数据失败,若多次失败请联系管理员");
         }
         Ftmsorderbills ftmsorderbills = ftmsorderbillsMapper.selectftmsorderbillsById(ftmsorderbillsplans.getOrgId());
+        ftmsorderbillscars.setCorpId(tmsorderbills.getCorpId());
         ftmsorderbillscars.setQtyDr(new BigDecimal(ftmsorderbillscars.getCntrQty()));
         ftmsorderbillscars.setQtyCr(new BigDecimal(ftmsorderbillscars.getCntrQty()));
         BigDecimal amtDr = ftmsorderbillscars.getFreightPriceDr().multiply(ftmsorderbillscars.getQtyDr());
@@ -989,20 +990,18 @@ public class FtmsorderbillscarsServiceImpl implements IftmsorderbillscarsService
         if (tmsorderbillscars.getBillStatus() == 6) {
             return AjaxResult.error("该安排车辆状态已提交,无法删除");
         }
+        if (tmsorderbillscars.getBillStatus() == 7) {
+            return AjaxResult.error("该安排车辆状态费用已确认,无法删除");
+        }
         if (tmsorderbillscars.getOrderStatus() >= 40) {
             return AjaxResult.error("该安排车辆已经执行卸车操作,无法删除");
         }
         // 若允许删除则删掉后续模块
-        ftmsorderbillsfeesMapper.deleteFTmsorderbillsfeesByPId(tmsorderbillscars.getId());
-        ftmsorderbillsattachsMapper.deleteftmsorderbillsattachsByPId(tmsorderbillscars.getId());
         BillnoDel billnoDel = new BillnoDel();
         billnoDel.setBillType("SJLSH");
         billnoDel.setBillNo(tmsorderbillscars.getOrderNo());
         billnoDelMapper.insertBillnoDel(billnoDel);
-        if (ftmsorderbillscarsMapper.deleteftmsorderbillscarsById(tmsorderbillscars.getId()) <= 0) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            return AjaxResult.error("删除车辆信息失败,若多次失败请联系管理员");
-        }
+        ftmsorderbillscarsMapper.deleteFollowUpBusinessByCarPId(tmsorderbillscars.getId());
         map.put("plan", ftmsorderbillsplansMapper.selectftmsorderbillsplansById(ftmsorderbillscars.getpId()));
         map.put("cars", ftmsorderbillscars);
         return AjaxResult.success(map);
@@ -1058,10 +1057,8 @@ public class FtmsorderbillscarsServiceImpl implements IftmsorderbillscarsService
         ftmsorderbillscars.setOrgId(ftmsorderbills.getId());
         ftmsorderbillscars.setMblno(ftmsorderbills.getMblno());
         ftmsorderbillscars.setUpdateBy(loginUser.getUsername());
-        if (ftmsorderbillscarsMapper.updateftmsorderbillscars(ftmsorderbillscars) <= 0) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            return AjaxResult.error("更新车辆数据失败,若多次失败请联系管理员");
-        }
+        ftmsorderbillscars.setCorpId(ftmsorderbills.getCorpId());
+        ftmsorderbillscarsMapper.updateftmsorderbillscars(ftmsorderbillscars);
         map.put("plan", ftmsorderbillsplans);
         map.put("cars", ftmsorderbillscars);
         return AjaxResult.success(map);

+ 2 - 5
ruoyi-fleet/src/main/java/com/ruoyi/orderPlan/service/impl/FtmsorderbillsplansServiceImpl.java

@@ -391,11 +391,8 @@ public class FtmsorderbillsplansServiceImpl implements IftmsorderbillsplansServi
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("该调度安排已派车,无法删除");
             }
-            if (ftmsorderbillsplansMapper.deleteftmsorderbillsplansById(pId) <= 0) {
-                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-                return AjaxResult.error("删除订单数据失败,若多次出现请联系管理员");
-            }
-            ftmsorderbillscarsMapper.deleteftmsorderbillscarsByPId(pId);
+            ftmsorderbillsplansMapper.deleteftmsorderbillsplansById(pId);
+            ftmsorderbillscarsMapper.deleteFollowUpBusinessByCarPId(pId);
             return AjaxResult.success();
         }
         if (ftmsorderbillsplans.getBillStatus() != 6) {

+ 8 - 1
ruoyi-fleet/src/main/resources/mapper/orderPlan/ftmsorderbillscarsMapper.xml

@@ -1320,7 +1320,14 @@
     </delete>
 
     <delete id="deleteftmsorderbillscarsByPId" parameterType="Long">
-        delete from F_TMSORDERBILLSCARS where p_id = #{id}
+        delete from F_TMSORDERBILLSCARS c LEFT JOIN where p_id = #{id}
+    </delete>
+
+    <delete id="deleteFollowUpBusinessByCarPId" parameterType="Long">
+        DELETE f.*, c.*, a.* FROM F_TMSORDERBILLSCARS c
+        LEFT JOIN F_TMSORDERBILLSFEES f ON f.f_pid = c.id
+        LEFT JOIN F_TMSORDERBILLSATTACHS a ON a.p_id = c.id
+        WHERE c.p_id = #{id}
     </delete>
 
     <delete id="deleteftmsorderbillscarsByIds" parameterType="String">

+ 1 - 1
ruoyi-system/src/main/resources/mapper/system/SysTableSetMapper.xml

@@ -23,7 +23,7 @@
     <select id="selectSysTableSetList" parameterType="SysTableSet" resultMap="SysTableSetResult">
         <include refid="selectSysTableSetVo"/>
         <where>
-            <if test="tableName != null  and tableName != ''">and table_name like concat('%', #{tableName}, '%')</if>
+            <if test="tableName != null  and tableName != ''">and table_name = #{tableName}</if>
             <if test="userId != null ">and user_id = #{userId}</if>
             <if test="surface != null ">and surface = #{surface}</if>
             <if test="label != null  and label != ''">and label = #{label}</if>

+ 55 - 7
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -369,7 +369,8 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         // 客户
         tWhgenleg.setfCorpid(warehouseBills.getfCorpid());
         // 提单号
-        if ("HQZY".equals(warehouseBills.getfBilltype()) || "CKDB".equals(warehouseBills.getfBilltype()) || "HWTG".equals(warehouseBills.getfBilltype())) {
+        if ("HQZY".equals(warehouseBills.getfBilltype()) || "CKDB".equals(warehouseBills.getfBilltype()) ||
+                "HWTG".equals(warehouseBills.getfBilltype()) || "SJCK".equals(warehouseBills.getfBilltype())) {
             tWhgenleg.setfMblno(warehousebillsitems.getfMblno());
         } else {
             tWhgenleg.setfMblno(warehouseBills.getfMblno());
@@ -504,6 +505,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             warehouseBills.setCreateBy(loginUser.getUser().getUserName());
             warehouseBills.setfBilltype(billsType);
             warehouseBills.setfBsdeptid(loginUser.getUser().getDeptId());
+            warehouseBills.setfDeptid(loginUser.getUser().getDeptId());
             // 业务编码
             String billNo = billnoSerialServiceImpl.getBillNo(billsType, warehouseBills.getfBsdate());
             warehouseBills.setfBillno(billNo);
@@ -1353,12 +1355,19 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 warehouseBills.setfProductName(warehouseBills.getfProductName() + "/" + goods.getfName());
             }
         }
-        if (StringUtils.isNotNull(tWarehousebillsitems.getfGoodsid())) {
-            TGoods goods = tGoodsMapper.selectTGoodsById(tWarehousebillsitems.getfGoodsid());
-            if (!warehouseBills.getfProductName().contains(goods.getfName())) {
-                warehouseBills.setfProductName(warehouseBills.getfProductName() + "/" + goods.getfName());
+        if (StringUtils.isNotNull(warehouseBills.getfMarks())) {
+            if (!warehouseBills.getfMarks().contains(tWarehousebillsitems.getfMarks())) {
+                warehouseBills.setfMarks(warehouseBills.getfMarks() + "/" + tWarehousebillsitems.getfMarks());
             }
         }
+        if (!"SJRK".equals(warehouseBills.getfBilltype())) {
+            if (!warehouseBills.getfMblno().contains(tWarehousebillsitems.getfMblno())) {
+                warehouseBills.setfMblno(warehouseBills.getfMblno() + "/" + tWarehousebillsitems.getfMblno());
+            }
+        }
+        warehouseBills.setUpdateTime(new Date());
+        warehouseBills.setUpdateBy(SecurityUtils.getUsername());
+        tWarehouseBillsMapper.updateTWarehousebills(warehouseBills);
         if (StringUtils.isNull(tWarehousebillsitems.getfId())) {
             tWarehousebillsitems.setCreateTime(new Date());
             tWarehousebillsitems.setCreateBy(SecurityUtils.getUsername());
@@ -1715,6 +1724,26 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         if (StringUtils.isNull(warehousebillsitems.getfPid())) {
             return AjaxResult.error("未找到主表id信息,请确认");
         }
+        TWarehouseBills warehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(warehousebillsitems.getfPid());
+        if (StringUtils.isNotNull(warehousebillsitems.getfGoodsid())) {
+            TGoods goods = tGoodsMapper.selectTGoodsById(warehousebillsitems.getfGoodsid());
+            if (!warehouseBills.getfProductName().contains(goods.getfName())) {
+                warehouseBills.setfProductName(warehouseBills.getfProductName() + "/" + goods.getfName());
+            }
+        }
+        if (StringUtils.isNotNull(warehouseBills.getfMarks())) {
+            if (!warehouseBills.getfMarks().contains(warehousebillsitems.getfMarks())) {
+                warehouseBills.setfMarks(warehouseBills.getfMarks() + "/" + warehousebillsitems.getfMarks());
+            }
+        }
+        if (!"SJRK".equals(warehouseBills.getfBilltype())) {
+            if (!warehouseBills.getfMblno().contains(warehousebillsitems.getfMblno())) {
+                warehouseBills.setfMblno(warehouseBills.getfMblno() + "/" + warehousebillsitems.getfMblno());
+            }
+        }
+        warehouseBills.setUpdateTime(new Date());
+        warehouseBills.setUpdateBy(SecurityUtils.getUsername());
+        tWarehouseBillsMapper.updateTWarehousebills(warehouseBills);
         warehousebillsitems.setfBillstatus(10L);
         warehousebillsitems.setCreateTime(new Date());
         warehousebillsitems.setCreateBy(SecurityUtils.getUsername());
@@ -2186,7 +2215,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         }
         map.put("attributes", sysDictDataMapper.selectDictDataByType("storage_type"));
         // 查询箱型数据
-        map.put("cntrList", sysDictDataMapper.selectDictDataByType("data_cntrId"));
+        TCntr tCntr = new TCntr();
+        tCntr.setfStatus("T");
+        map.put("cntrList", tCntrMapper.selectTCntrList(tCntr));
         return AjaxResult.success(map);
     }
 
@@ -2198,6 +2229,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
      * @return 结果
      */
     @Override
+    @Transactional
     public AjaxResult warehouseOperationConfirmation(String item, String attachs) {
         LoginUser loginUser = SecurityUtils.getLoginUser();
         TWarehousebillsitems tWarehousebillsitems = JSONArray.parseObject(item, TWarehousebillsitems.class);
@@ -2336,7 +2368,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         if (StringUtils.isNull(warehousebillsitems.getfBillstatus())) {
             return AjaxResult.error("未找到仓库明细状态信息,请确认");
         }
-        if (warehousebillsitems.getfBillstatus() != 20L) {
+        if (warehousebillsitems.getfBillstatus() > 20L) {
             return AjaxResult.error("该仓库明细状态异常,请确认状态信息");
         }
         warehousebillsitems.setfBillstatus(30L);
@@ -2345,6 +2377,22 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         tWarehousebillsitemsMapper.updateTWarehousebillsitems(warehousebillsitems);
         // 更新主表明细状态
         TWarehouseBills warehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(warehousebillsitems.getfPid());
+        if (StringUtils.isNotNull(warehousebillsitems.getfGoodsid())) {
+            TGoods goods = tGoodsMapper.selectTGoodsById(warehousebillsitems.getfGoodsid());
+            if (!warehouseBills.getfProductName().contains(goods.getfName())) {
+                warehouseBills.setfProductName(warehouseBills.getfProductName() + "/" + goods.getfName());
+            }
+        }
+        if (StringUtils.isNotNull(warehouseBills.getfMarks())) {
+            if (!warehouseBills.getfMarks().contains(warehousebillsitems.getfMarks())) {
+                warehouseBills.setfMarks(warehouseBills.getfMarks() + "/" + warehousebillsitems.getfMarks());
+            }
+        }
+        if (!"SJRK".equals(warehouseBills.getfBilltype())) {
+            if (!warehouseBills.getfMblno().contains(warehousebillsitems.getfMblno())) {
+                warehouseBills.setfMblno(warehouseBills.getfMblno() + "/" + warehousebillsitems.getfMblno());
+            }
+        }
         warehouseBills.setfItemsStatus(3L);
         warehouseBills.setUpdateTime(new Date());
         warehouseBills.setUpdateBy(SecurityUtils.getUsername());

+ 91 - 1
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -513,6 +513,95 @@
             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
+            <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>
+                and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}
+            </if>
+            <if test='orgStorageDate != null and orgStorageDate[1] != null and orgStorageDate[1]!= ""'>
+                and leg.f_originalbilldate &lt;= #{orgStorageDate[1]}
+            </if>
+            <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
+            <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
+            <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
+            <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
+            <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
+            <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
+            <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
+            <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
+            <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
+            <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
+            <if test="fOriginalbilldate != null ">and leg.f_originalbilldate = #{fOriginalbilldate}</if>
+            <if test="fMarks != null  and fMarks != ''">and leg.f_marks = #{fMarks}</if>
+            <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
+            <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
+            <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
+            <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
+            <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
+            <if test="fCntrno != null  and fCntrno != ''">and leg.f_cntrno LIKE  concat('%', #{fCntrno}, '%')</if>
+            <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>
+            <if test="fStatus != null  and fStatus != ''">and leg.f_status = #{fStatus}</if>
+            <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
+            <if test="fLocation != null  and fLocation ==1 ">
+                and leg.f_warehouse_locationid = #{fWarehouseLocationid}
+            </if>
+            <if test="fLocation != null  and fLocation ==0 ">
+                and ware.ancestors  LIKE  concat('%', #{fWarehouseLocationid}, '%')
+            </if>
+        </where>
+        ${params.dataScope}
+    </select>
+    <!--<select id="selectInventoryList" parameterType="TWhgenleg" resultType="Map">
+        select
+        leg.f_id AS fId,
+        leg.f_corpid AS fCorpIds,
+        corp.f_name AS fCorpid,
+        ware.f_warehouse_information AS fWarehouseids,
+        area.f_name AS fWarehouseLocationids,
+        leg.f_originalbillno AS fOriginalbillno,
+        leg.f_warehouse_locationid AS fWarehouseLocationid,
+        dict1.dict_label AS fTrademodeid,
+        goods.f_name AS fGoodsids,
+        leg.f_trademodeid AS fTrademodeids,
+        goods.f_packagespecs AS fPackagespecs,
+        leg.f_goodsid AS fGoodsid,
+        SUM(leg.f_volumnD) AS fVolumnD,
+        SUM(leg.f_qtyD) AS fQtyD,
+        leg.f_mblno AS fMblno,
+        SUM(leg.f_grossweightD) AS fGrossweightD,
+        SUM(leg.f_netweightD) AS fNetweightD,
+        SUM(leg.f_volumnC) AS fVolumnC,
+        SUM(leg.f_volumnblc) AS fVolumnblc,
+        SUM(leg.f_qtyC) AS fQtyC,
+        leg.f_business_type AS fBusinessType,
+        SUM(leg.f_grossweightC) AS fGrossweightC,
+        SUM(leg.f_netweightC) AS fNetweightC,
+        SUM(leg.f_qtyblc) AS fQtyblc,
+        leg.f_billingway AS fBillingway,
+        leg.f_chargedate AS fChargedate,
+        SUM(leg.f_grossweightblc) AS fGrossweightblc,
+        SUM(leg.f_netweightblc) AS fNetweightblc,
+        dict.dict_label AS fBusinessTypes,
+        leg.f_marks AS fMarks,
+        DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
+        DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
+        leg.f_cntrno AS fCntrno
+        FROM
+        t_whgenleg leg
+        left join sys_user u on leg.create_by = u.user_name
+        left join sys_dept d on u.dept_id = d.dept_id
+        LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
+        LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
+        LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
+        LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
+        LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
+        LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
+        <where>
+            dict.status = '0'
+            AND dict1.status = '0'
+            AND dict.dict_type = 'storage_type'
+            AND dict1.dict_type = 'data_trademodes'
+            <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
+            <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
+            <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
             <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>
             <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>
                 and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}
@@ -548,8 +637,9 @@
                 and ware.ancestors  LIKE  concat('%', #{fWarehouseLocationid}, '%')
             </if>
         </where>
+        GROUP BY leg.f_corpid, leg.f_mblno, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid
         ${params.dataScope}
-    </select>
+    </select>-->
 
     <select id="selectWhgenlegList" resultType="java.util.Map">
         select

+ 8 - 3
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -1826,6 +1826,7 @@
             w.f_warehouseid fWarehouseid,
             w.f_driver_tel fDriverTel,
             w.f_trademodeid fTrademodeid,
+            w.f_product_name fProductName,
             CASE WHEN w.f_billstatus = '1' THEN '录入'
             WHEN w.f_billstatus = '2' THEN '暂存'
             WHEN w.f_billstatus = '3' THEN '驳回'
@@ -1838,12 +1839,14 @@
             LEFT JOIN t_corps c ON c.f_id = w.f_corpid
             LEFT JOIN t_goods g ON g.f_id = w.f_goodsid
             LEFT JOIN t_warehouse t ON t.f_id = w.f_warehouseid
-            left join sys_user u on w.create_by = u.user_name
+            left join sys_user u on w.create_by = u.user_name or w.f_storekeeper = u.user_name
             left join sys_dept d on w.f_bsdeptid = d.dept_id
         where
             w.f_id != ''
             and w.f_billtype = #{fBilltype}
-            or w.f_storekeeper = u.user_name
+            AND w.f_planqty != f_qty
+            AND w.f_billstatus != 6
+        <if test="fMblno != null ">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
         <if test="fBillstatus != null ">and w.f_billstatus = #{fBillstatus}</if>
         <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
             and w.f_bsdate &gt;= #{timeInterval[0]}
@@ -1860,12 +1863,13 @@
             t.f_id fId,
             t.f_pid fPid,
             c.f_name corpName,
-            w.f_bsdate fBsdate,
+            t.f_bsdate fBsdate,
             g.f_name goodsName,
             t.f_mblno fMblno,
             t.f_warehouse_information fWarehouseInformation,
             t.f_truckno fTruckno,
             t.f_cntrno fCntrno,
+            cntr.f_name cntrtypes,
             t.f_cntrtype fCntrtype,
             t.f_qty fQty,
             t.f_grossweight fGrossweight,
@@ -1885,6 +1889,7 @@
             LEFT JOIN t_warehousebillsitems t ON t.f_pid = w.f_id
             LEFT JOIN t_corps c ON c.f_id = w.f_corpid
             LEFT JOIN t_goods g ON g.f_id = t.f_goodsid
+            LEFT JOIN t_cntr cntr ON cntr.f_id = t.f_cntrtype
         where
             t.f_pid = #{fId}
     </select>

+ 14 - 11
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsitemsMapper.xml

@@ -579,32 +579,35 @@
             t.f_warehouse_information warehouseInformation,
             t.f_warehouselocid fWarehouselocid,
             t.f_truckno truckno,
+            cntr.f_name cntrtypes,
             t.f_cntrtype cntrtype,
             t.f_cntqty cntqty,
             t.f_cntrno cntrno,
             t.f_qty fQty,
+            t.f_originalbilldate fOriginalbilldate,
             t.f_grossweight fGrossweight,
             t.f_netweight fNetweight,
             t.f_driver_tel fDriverTel,
+            t.f_stevedore fStevedore,
         CASE
-                WHEN t.f_billstatus = '10' THEN
-                '计划'
-                WHEN t.f_billstatus = '20' THEN
-                '待入库'
-                WHEN t.f_billstatus = '30' THEN
-                '入库中'
-                WHEN t.f_billstatus = '40' THEN
-                '已入库'
-            END billstatus,
+		    WHEN t.f_billstatus = '10' THEN '计划'
+			WHEN t.f_billstatus = '20' THEN
+			    IF(w.f_billtype = 'SJRK', '待入库', IF(w.f_billtype = 'SJCK','待出库', IF(w.f_billtype = 'CKDB', '待调拨',IF(w.f_billtype = 'HWTG', '待通关', IF(w.f_billtype = 'HQZY', '待转移', '无')))))
+			WHEN t.f_billstatus = '30' THEN
+			    IF(w.f_billtype = 'SJRK', '入库中', IF(w.f_billtype = 'SJCK','出库中', IF(w.f_billtype = 'CKDB', '调拨中',IF(w.f_billtype = 'HWTG', '通关中', IF(w.f_billtype = 'HQZY', '转移中', '无')))))
+		    WHEN t.f_billstatus = '40' THEN
+			    IF(w.f_billtype = 'SJRK', '已入库', IF(w.f_billtype = 'SJCK','已出库', IF(w.f_billtype = 'CKDB', '已调拨',IF(w.f_billtype = 'HWTG', '已通关', IF(w.f_billtype = 'HQZY', '已转移', '无')))))
+	        END billstatus,
             t.remark
         FROM
-            t_warehousebillsitems t
-            LEFT JOIN t_warehousebills w ON w.f_id = t.f_pid
+            t_warehousebills w
+            LEFT JOIN t_warehousebillsitems t ON w.f_id = t.f_pid
             LEFT JOIN sys_dict_data stor ON stor.dict_value = t.f_business_type
             AND stor.dict_type = 'storage_type'
             LEFT JOIN t_goods g ON g.f_id = t.f_goodsid
             LEFT JOIN t_corps fleet ON fleet.f_id = t.f_fleet
             LEFT JOIN t_corps corp ON corp.f_id = w.f_corpid
+            LEFT JOIN t_cntr cntr ON cntr.f_id = t.f_cntrtype
         where
             t.f_id = #{fId}
     </select>