zxz 1 anno fa
parent
commit
75cb4bba70

+ 10 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CostManagementInfo.java

@@ -90,6 +90,16 @@ public class CostManagementInfo extends BaseModel<CostManagementInfo> {
 
     @TableField(exist = false)
     private String searchMoth;
+    /**
+     * 货权转入重量
+     */
+    @TableField(exist = false)
+    private Double cargoWeight;
+    /**
+     * 待赎回重量
+     */
+    @TableField(exist = false)
+    private Double redemptionWeight;
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 8 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/WarehouseNumView.java

@@ -20,6 +20,14 @@ public class WarehouseNumView {
      * 出库量
      */
     private String outNetWeight;
+    /**
+     * 货权转入重量
+     */
+    private String cargoWeight;
+    /**
+     * 待赎回重量
+     */
+    private String redemptionWeight;
     /**
      * 应余量
      */

+ 25 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CostManagementInfoMapper.xml

@@ -42,7 +42,31 @@
         AND wo.delete_flag = 0
         AND wbi.comp_id = wo.comp_id
         and wo.goods_name = IFNULL( wpsi.goods_name, cgi.goods_name )
-        ) AS cost
+        ) AS cost,
+        (
+        SELECT
+        ifnull(sum( wo.surplus_weight ),0)
+        FROM
+        warehousing_order wo
+        WHERE
+        wo.warehouse_name = wbi.warehouse_name
+        AND wo.delete_flag = 0
+        AND wbi.comp_id = wo.comp_id
+        and wo.goods_name = wpsi.goods_name
+        and wo.in_type = '货转'
+        ) AS cargoWeight,
+        (
+        SELECT
+        ifnull(sum( wo.transfer_out_weight ),0)
+        FROM
+        warehousing_order wo
+        WHERE
+        wo.warehouse_name = wbi.warehouse_name
+        AND wo.delete_flag = 0
+        AND wbi.comp_id = wo.comp_id
+        and wo.goods_name = wpsi.goods_name
+        and wo.redeem_flag = '赎'
+        ) AS redemptionWeight
         FROM
         warehouse_base_info wbi
         LEFT JOIN warehouse_position_info wpi ON wpi.base_id = wbi.id

+ 44 - 20
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml

@@ -595,27 +595,51 @@
     <select id="getReservesWarehouseListByCondition" parameterType="Map"
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseNumView">
         SELECT
-        	wpsi.goods_name AS goodsName,
-        	sum( wpsi.STORAGE ) AS stockNum,
-            (
-            SELECT
-            ROUND( AVG( wo.avg_cost ), 3 )
-            FROM
-            warehousing_order wo
-            WHERE
-            wo.warehouse_name = wbi.warehouse_name
-            AND wo.delete_flag = 0
-            AND wbi.comp_id = wo.comp_id
-            and wo.goods_name = wpsi.goods_name
-            ) AS cost
+        wpsi.goods_name AS goodsName,
+        sum( wpsi.STORAGE ) AS stockNum,
+        (
+        SELECT
+        ROUND( AVG( wo.avg_cost ), 3 )
+        FROM
+        warehousing_order wo
+        WHERE
+        wo.warehouse_name = wbi.warehouse_name
+        AND wo.delete_flag = 0
+        AND wbi.comp_id = wo.comp_id
+        and wo.goods_name = wpsi.goods_name
+        ) AS cost,
+        (
+        SELECT
+        ifnull(sum( wo.surplus_weight ),0)
+        FROM
+        warehousing_order wo
+        WHERE
+        wo.warehouse_name = wbi.warehouse_name
+        AND wo.delete_flag = 0
+        AND wbi.comp_id = wo.comp_id
+        and wo.goods_name = wpsi.goods_name
+        and wo.in_type = '货转'
+        ) AS cargoWeight,
+        (
+        SELECT
+        ifnull(sum( wo.transfer_out_weight ),0)
+        FROM
+        warehousing_order wo
+        WHERE
+        wo.warehouse_name = wbi.warehouse_name
+        AND wo.delete_flag = 0
+        AND wbi.comp_id = wo.comp_id
+        and wo.goods_name = wpsi.goods_name
+        and wo.redeem_flag = '赎'
+        ) AS redemptionWeight
         FROM
-        	warehouse_base_info wbi
-        	LEFT JOIN warehouse_position_info wpi ON wpi.base_id = wbi.id
-        	AND wpi.delete_flag = 0
-        	LEFT JOIN warehouse_position_storage_info wpsi ON wpsi.position_id = wpi.id
-        	AND wpsi.delete_flag = 0
+        warehouse_base_info wbi
+        LEFT JOIN warehouse_position_info wpi ON wpi.base_id = wbi.id
+        AND wpi.delete_flag = 0
+        LEFT JOIN warehouse_position_storage_info wpsi ON wpsi.position_id = wpi.id
+        AND wpsi.delete_flag = 0
         WHERE
-        	wpsi.id IS NOT NULL
+        wpsi.id IS NOT NULL
         <if test="compId != null and compId != ''">
             AND wbi.comp_id= #{compId}
         </if>
@@ -623,7 +647,7 @@
             AND wbi.warehouse_name= #{warehouseName}
         </if>
         GROUP BY
-        	wpsi.goods_name
+        wpsi.goods_name
 
     </select>