ソースを参照

[CODE]: 出入库汇总修改

maxianghua 4 年 前
コミット
e44595b74d

+ 2 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehouseBillsMapper.java

@@ -91,7 +91,8 @@ public interface TWarehouseBillsMapper extends BaseMapper<TWarehouseBills> {
      */
      */
     public List<TWareHouseExcelItems> selectTWarehousebillsItemsList(@Param("fId") Long fid);
     public List<TWareHouseExcelItems> selectTWarehousebillsItemsList(@Param("fId") Long fid);
 
 
-    List<Map<String, Object>> selectInventoryList(TWarehouseBills tWarehousebills);
+    List<Map<String, Object>> selectInventorySJRKList(TWarehouseBills tWarehousebills);
+    List<Map<String, Object>> selectInventorySJCKList(TWarehouseBills tWarehousebills);
 
 
     public List<TWareHouseItemsExcel> selectTWarehousebillsItemList(TWarehouseBills tWarehouseBills);
     public List<TWareHouseItemsExcel> selectTWarehousebillsItemList(TWarehouseBills tWarehouseBills);
 }
 }

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

@@ -231,13 +231,13 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             }
             }
         }
         }
         List<TWarehouseArea> warehouseAreaList = new ArrayList<>();
         List<TWarehouseArea> warehouseAreaList = new ArrayList<>();
-        List<Long> warehouseAreaIdList = StringUtils.integerDeduplication(warehouseAreaId);
+        /*List<Long> warehouseAreaIdList = StringUtils.integerDeduplication(warehouseAreaId);
         for (Long warehouseArea : warehouseAreaIdList) {
         for (Long warehouseArea : warehouseAreaIdList) {
             TWarehouseArea tWarehouseArea = tWarehouseAreaMapper.selectTWarehouseAreaById(warehouseArea);
             TWarehouseArea tWarehouseArea = tWarehouseAreaMapper.selectTWarehouseAreaById(warehouseArea);
             if (StringUtils.isNotNull(tWarehouseArea)) {
             if (StringUtils.isNotNull(tWarehouseArea)) {
                 warehouseAreaList.add(tWarehouseArea);
                 warehouseAreaList.add(tWarehouseArea);
             }
             }
-        }
+        }*/
         List<TGoods> goodsList = new ArrayList<>();
         List<TGoods> goodsList = new ArrayList<>();
         List<Long> goodsIdList = StringUtils.integerDeduplication(goodsId);
         List<Long> goodsIdList = StringUtils.integerDeduplication(goodsId);
         for (Long goods : goodsIdList) {
         for (Long goods : goodsIdList) {
@@ -767,7 +767,11 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 tWarehouseBills.setfLocation(0L);
                 tWarehouseBills.setfLocation(0L);
             }
             }
         }
         }
-        return tWarehouseBillsMapper.selectInventoryList(tWarehouseBills);
+        if(tWarehouseBills.getfBilltype().equals("SJRK")){
+            return tWarehouseBillsMapper.selectInventorySJRKList(tWarehouseBills);
+        }else {
+            return tWarehouseBillsMapper.selectInventorySJCKList(tWarehouseBills);
+        }
     }
     }
 
 
     @Override
     @Override

+ 1 - 1
ruoyi-warehouse/src/main/resources/mapper/basicData/TCorpsMapper.xml

@@ -48,7 +48,7 @@
     <select id="selectTCorpsList" parameterType="TCorps" resultMap="TCorpsResult">
     <select id="selectTCorpsList" parameterType="TCorps" resultMap="TCorpsResult">
         <include refid="selectTCorpsVo"/>
         <include refid="selectTCorpsVo"/>
         <where>
         <where>
-            <if test="fTypeid != null  and fTypeid != ''">and f_typeid = #{fTypeid}</if>
+            <if test="fTypeid != null  and fTypeid != ''">and f_typeid like concat('%', #{fTypeid}, '%') </if>
             <if test="fNo != null  and fNo != ''">and f_no like concat('%', #{fNo}, '%')</if>
             <if test="fNo != null  and fNo != ''">and f_no like concat('%', #{fNo}, '%')</if>
             <if test="fName != null  and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
             <if test="fName != null  and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
             <if test="fCname != null  and fCname != ''">and f_cname like concat('%', #{fCname}, '%')</if>
             <if test="fCname != null  and fCname != ''">and f_cname like concat('%', #{fCname}, '%')</if>

+ 4 - 1
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehouseAgreementMapper.xml

@@ -69,7 +69,9 @@
                 agre.f_enddate AS fEnddate,
                 agre.f_enddate AS fEnddate,
                 agre.f_feetypeid AS fFeetypeid,
                 agre.f_feetypeid AS fFeetypeid,
                 agre.f_billstatus AS fBillstatus,
                 agre.f_billstatus AS fBillstatus,
-                agre.f_status AS fStatus
+                agre.f_status AS fStatus,
+                agre.f_task_type AS fTaskType,
+                agre.f_dc AS fDc
             FROM
             FROM
                 t_warehouse_agreement agre
                 t_warehouse_agreement agre
                 LEFT JOIN t_corps corp ON corp.f_id = agre.f_corpid
                 LEFT JOIN t_corps corp ON corp.f_id = agre.f_corpid
@@ -87,6 +89,7 @@
             <if test="fFreedays != null ">and agre.f_freedays = #{fFreedays}</if>
             <if test="fFreedays != null ">and agre.f_freedays = #{fFreedays}</if>
             <if test="fBegindate != null ">and agre.f_begindate = #{fBegindate}</if>
             <if test="fBegindate != null ">and agre.f_begindate = #{fBegindate}</if>
             <if test="fTaskType != null ">and agre.f_task_type = #{fTaskType}</if>
             <if test="fTaskType != null ">and agre.f_task_type = #{fTaskType}</if>
+            <if test="fDc != null ">and agre.f_dc = #{fDc}</if>
             <if test="fEnddate != null ">and agre.f_enddate = #{fEnddate}</if>
             <if test="fEnddate != null ">and agre.f_enddate = #{fEnddate}</if>
             <if test="fBillstatus != null  and fBillstatus != ''">and agre.f_billstatus = #{fBillstatus}</if>
             <if test="fBillstatus != null  and fBillstatus != ''">and agre.f_billstatus = #{fBillstatus}</if>
             <if test="fStatus != null  and fStatus != ''">and agre.f_status = #{fStatus}</if>
             <if test="fStatus != null  and fStatus != ''">and agre.f_status = #{fStatus}</if>

+ 76 - 6
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -236,11 +236,10 @@
             <if test="fBankcorpid != null ">and bill.f_bankcorpid = #{fBankcorpid}</if>
             <if test="fBankcorpid != null ">and bill.f_bankcorpid = #{fBankcorpid}</if>
             <if test="fBilltype != null  and fBilltype != ''">and bill.f_billtype = #{fBilltype}</if>
             <if test="fBilltype != null  and fBilltype != ''">and bill.f_billtype = #{fBilltype}</if>
             <if test="fBillstatus != null  and fBillstatus != ''">and bill.f_billstatus = #{fBillstatus}</if>
             <if test="fBillstatus != null  and fBillstatus != ''">and bill.f_billstatus = #{fBillstatus}</if>
-            <if test="fBillstatus == null ">and bill.f_billstatus != 6 </if>
             <if test="fItemsStatus != null  and fItemsStatus != ''">and bill.f_items_status = #{fItemsStatus}</if>
             <if test="fItemsStatus != null  and fItemsStatus != ''">and bill.f_items_status = #{fItemsStatus}</if>
             <if test="createBy != null and createBy != ''">and bill.create_by = #{createBy}</if>
             <if test="createBy != null and createBy != ''">and bill.create_by = #{createBy}</if>
         </where>
         </where>
-            ORDER BY bill.f_bsdate  DESC
+            ORDER BY  bill.f_billstatus , bill.f_bsdate  DESC
         ${params.dataScope}
         ${params.dataScope}
     </select>
     </select>
 
 
@@ -287,7 +286,7 @@
             w.f_id = #{fId}
             w.f_id = #{fId}
     </select>
     </select>
 
 
-    <select id="selectInventoryList" parameterType="TWarehousebills"  resultType="java.util.Map">
+    <select id="selectInventorySJRKList" parameterType="TWarehousebills"  resultType="java.util.Map">
         SELECT
         SELECT
             co.f_name AS fName,
             co.f_name AS fName,
             it.f_bsdate AS fBsdate,
             it.f_bsdate AS fBsdate,
@@ -300,7 +299,16 @@
             dicttr.dict_label AS fTrademodeid,
             dicttr.dict_label AS fTrademodeid,
             it.f_qty AS fQty,
             it.f_qty AS fQty,
             it.f_grossweight AS fGrossweight,
             it.f_grossweight AS fGrossweight,
-            it.f_netweight AS fNetweight
+            it.f_netweight AS fNetweight,
+            CASE
+            it.f_billtype
+            WHEN 'SJRK' THEN
+            '入库'
+            WHEN 'SJCK' THEN
+            '出库'
+            WHEN 'CKDB' THEN
+            '调拨'
+            END AS fBilltype
         FROM
         FROM
             t_warehousebills leg
             t_warehousebills leg
                 LEFT JOIN t_warehousebillsitems it ON leg.f_id = it.f_pid
                 LEFT JOIN t_warehousebillsitems it ON leg.f_id = it.f_pid
@@ -314,8 +322,70 @@
             AND dict.dict_type = 'storage_type'
             AND dict.dict_type = 'storage_type'
             AND dicttr.STATUS = '0'
             AND dicttr.STATUS = '0'
             AND dicttr.dict_type = 'data_trademodes'
             AND dicttr.dict_type = 'data_trademodes'
-            AND leg.f_billtype in ('SJRk','SJCK')
-            <if test="fBilltype != null">AND leg.f_billtype = #{fBilltype}</if>
+            AND leg.f_billtype in ('SJRK','CKDB')
+            <if test="fGoodsid != null ">and it.f_goodsid = #{fGoodsid}</if>
+            <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
+            <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
+            <if test="fMblno != null ">and leg.f_mblno = #{fMblno}</if>
+            <if test="fLocation != null  and fLocation ==1 ">
+                and it.f_warehouselocid = #{fWarehouseid}
+            </if>
+            <if test="fLocation != null  and fLocation ==0 ">
+                and ware.ancestors  LIKE  concat('%', #{fWarehouseid}, '%')
+            </if>
+            <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
+                and it.f_bsdate &gt;= #{timeInterval[0]}
+            </if>
+            <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
+                and it.f_bsdate &lt;= #{timeInterval[1]}
+            </if>
+        </where>
+    </select>
+    <select id="selectInventorySJCKList" parameterType="TWarehousebills"  resultType="java.util.Map">
+        SELECT
+        co.f_name AS fName,
+        it.f_bsdate AS fBsdate,
+        leg.f_mblno AS fMblno,
+        it.f_business_type AS fBusinessType,
+        dict.dict_label AS fBusinessTypes,
+        it.f_marks AS fMarks ,
+        goo.f_name AS fGoodsName,
+        dicttr.dict_label AS fTrademodeid,
+        it.f_qty AS fQty,
+        it.f_grossweight AS fGrossweight,
+        it.f_netweight AS fNetweight,
+        CASE
+        it.f_billtype
+        WHEN 'SJRK' THEN
+        '入库'
+        WHEN 'SJCK' THEN
+        '出库'
+        WHEN 'CKDB' THEN
+        '调拨'
+        END AS fBilltype ,
+        CASE
+        it.f_billtype
+        WHEN 'SJRK' THEN
+        it.f_warehouse_information
+        WHEN 'SJCK' THEN
+        it.f_warehouse_information
+        WHEN 'CKDB' THEN
+        it.f_orgwarehouse_information
+        END AS fWarehouseLocationids
+        FROM
+        t_warehousebills leg
+        LEFT JOIN t_warehousebillsitems it ON leg.f_id = it.f_pid
+        LEFT JOIN t_goods goo ON it.f_goodsid = goo.f_id
+        LEFT JOIN t_corps co ON leg.f_corpid = co.f_id
+        LEFT JOIN sys_dict_data dict ON dict.dict_value = it.f_business_type
+        LEFT JOIN t_warehouse ware ON ware.f_id = it.f_warehouselocid
+        LEFT JOIN sys_dict_data dicttr ON dicttr.dict_value = leg.f_trademodeid
+        <where>
+            dict.status = '0'
+            AND dict.dict_type = 'storage_type'
+            AND dicttr.STATUS = '0'
+            AND dicttr.dict_type = 'data_trademodes'
+            AND leg.f_billtype in ('SJCK','CKDB')
             <if test="fGoodsid != null ">and it.f_goodsid = #{fGoodsid}</if>
             <if test="fGoodsid != null ">and it.f_goodsid = #{fGoodsid}</if>
             <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
             <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>