wangzhuo 2 lat temu
rodzic
commit
e29a451a04

+ 10 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java

@@ -184,6 +184,16 @@ public interface TWhgenlegMapper {
                                                @Param("mode") String mode);
 
     /**
+     * 库存结余净重统计
+     */
+    public Map<String, Object> stockWeightblc(@Param("beginDate") String beginDate,
+                                               @Param("endDate") String endDate,
+                                               @Param("external") String external,
+                                               @Param("warehouseId") Long warehouseId,
+                                               @Param("customerId") Long customerId,
+                                               @Param("mode") String mode);
+
+    /**
      * 库存Teu统计
      */
     public Map<String, Object> stockTeuStatistics(@Param("beginDate") String beginDate,

+ 16 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -9233,6 +9233,8 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         data.put("customerName", customerName);
         // 全部库存
         data.put("stockTotal", stockStatistics(null, null, external, mode));
+        // 结余净重
+        data.put("stockNetweightbl", stockWeightblc(null, null , external, mode));
 
         // 今天
         data.put("inStockTotalToday", inAndOutStockStatistics("SJRK", DateUtils.today(), DateUtils.today(), external, mode));
@@ -9317,6 +9319,20 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         return String.valueOf(statistics.get("quantity"));
     }
 
+    private String stockWeightblc(String beginDate, String endDate, String external, String mode) {
+        if (StringUtils.isNotEmpty(beginDate)) {
+            beginDate += " 00:00:00";
+        }
+        if (StringUtils.isNotEmpty(endDate)) {
+            endDate += " 00:00:00";
+        }
+
+        Map<String, Object> statistics;
+
+        statistics = tWhgenlegMapper.stockWeightblc(beginDate, endDate, external, null, null, mode);
+        return String.valueOf(statistics.get("quantity"));
+    }
+
     /**
      * 出入库列表
      *

+ 76 - 0
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -355,4 +355,80 @@
             f_no = #{fNo} and del_flag = '0' limit 1
         </where>
     </select>
+
+    <select id="queryGoodsAccountByPageV1" resultType="map">
+        SELECT
+            TW.f_no AS warehouseCode,
+            TW.f_name AS warehouseName,
+            TC.f_no AS ownerCode,
+            TC.f_name AS ownerName,
+            TG.f_name AS goodsName,
+            TG.f_packagespecs AS specifications,
+            '' AS producing,
+            '' AS materialQuality,
+            '' AS level,
+            '' AS totalQuantity,
+            '' AS availableQuantity,
+            '' AS quantityUnit,
+            '' AS totalNetWeight,
+            '' AS availableWeight,
+            '' AS weightUnit,
+            '' AS spu
+        FROM t_warehouse TW
+        LEFT JOIN t_whgenleg TWG ON TWG.f_warehouseid = TW.f_id
+        LEFT JOIN t_corps TC ON TC.f_id = TWG.f_corpid
+        LEFT JOIN t_goods TG ON TG.f_id = TWG.f_goodsid
+        <where>
+            del_flag = '0'
+            <if test="ownerName != null  and ownerName != ''"> and TC.f_name like concat('%', #{ownerName}, '%')</if>
+            <if test="goodsName != null  and goodsName != ''"> and TG.f_name like concat('%', #{goodsName}, '%')</if>
+            <if test="specifications != null  and specifications != ''"> and TG.f_packagespecs like concat('%', #{specifications}, '%')</if>
+            <if test="producing != null  and producing != ''"> and '' like concat('%', #{producing}, '%')</if>
+            <if test="materialQuality != null  and materialQuality != ''"> and '' like concat('%', #{materialQuality}, '%')</if>
+            <if test="level != null  and level != ''"> and '' like concat('%', #{level}, '%')</if>
+        </where>
+    </select>
+
+    <select id="queryGoodsAccountDetailByPageV1" resultType="map">
+        SELECT
+            '' AS id,
+            TW.f_no AS warehouseCode,
+            TW.f_name AS warehouseName,
+            '' AS areaName,
+            '' AS areaCode,
+            '' AS slotName,
+            '' AS slotCode,
+            '' AS receiptDoc,
+            '' AS billOfLading,
+            TC.f_no AS ownerCode,
+            TC.f_name AS ownerName,
+            TG.f_name AS goodsName,
+            TG.f_packagespecs AS specifications,
+            '' AS producing,
+            '' AS materialQuality,
+            '' AS level,
+            '' AS totalQuantity,
+            '' AS availableQuantity,
+            '' AS quantityUnit,
+            '' AS totalNetWeight,
+            '' AS availableWeight,
+            '' AS weightUnit,
+            '' AS storesTime,
+            '' AS productionTime,
+            '' AS plateNumber,
+            '' AS batchNo,
+            '' AS warehouseReceiptNo
+        FROM t_warehouse TW
+        LEFT JOIN t_whgenleg TWG ON TWG.f_warehouseid = TW.f_id
+        LEFT JOIN t_corps TC ON TC.f_id = TWG.f_corpid
+        LEFT JOIN t_goods TG ON TG.f_id = TWG.f_goodsid
+        <where>
+            TW.f_no = #{warehouseCode}
+            AND del_flag = '0'
+            <if test="areaName != null  and areaName != ''"> and '' like concat('%', #{areaName}, '%')</if>
+            <if test="areaCode != null  and areaCode != ''"> and '' = #{areaCode}</if>
+            <if test="slotName != null  and slotName != ''"> and '' like concat('%', #{slotName}, '%')</if>
+            <if test="slotCode != null  and slotCode != ''"> and '' = #{slotCode}</if>
+        </where>
+    </select>
 </mapper>

+ 16 - 0
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -1262,6 +1262,22 @@
             <if test="customerId != null"> and f_corpid = #{customerId}</if>
     </select>
 
+    <select id="stockWeightblc" resultType="map">
+        select
+            round(ifnull(sum(f_netweightblc), 0) / 1000) as quantity
+        from t_whgenleg
+        where
+        f_qtyD != 0
+        and f_qtyblc != 0
+        <if test="beginDate != null and beginDate != ''">and f_bsdate &gt;= #{beginDate}</if>
+        <if test="endDate != null and endDate != ''">and f_bsdate &lt;= #{endDate}</if>
+        <if test="external != null and external != ''">
+            and f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
+        </if>
+        <if test="warehouseId != null"> and f_warehouseid = #{warehouseId}</if>
+        <if test="customerId != null"> and f_corpid = #{customerId}</if>
+    </select>
+
     <select id="stockTeuStatistics" resultType="map">
         select
             ifnull(sum(case tb.f_billtype when 'SJRK' then f_cntrcount end * tr.f_teu), 0) -