Ver código fonte

添加app缺少字段,修改出库库存总账查询条件

阿伏兔 4 anos atrás
pai
commit
658f687822

+ 52 - 6
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -1345,12 +1345,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());
@@ -1610,6 +1617,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());
@@ -2080,7 +2107,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);
     }
 
@@ -2092,6 +2121,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);
@@ -2229,7 +2259,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);
@@ -2238,6 +2268,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());

+ 2 - 3
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -513,7 +513,6 @@
             <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]}
             </if>
@@ -537,10 +536,10 @@
             <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 = #{fCntrno}</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>

+ 6 - 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,11 +1839,11 @@
             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_billtype = #{fBilltype}
             AND w.f_planqty != f_qty
             AND w.f_billstatus != 6
         <if test="fMblno != null ">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
@@ -1862,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,
@@ -1887,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>