浏览代码

销售出库 计量单位相关

changhaoning 1 年之前
父节点
当前提交
e78ea8ed9f

+ 23 - 0
src/main/java/com/dk/mdm/mapper/ivt/OutboundItemMapper.xml

@@ -433,6 +433,29 @@ sys.f_remove_zero(out_qty) as out_qty, out_amt, sys.f_remove_zero(return_qty) as
                t.sup_id,
                tms.sup_name
                ,t.out_status
+               ,t.unit_id
+               ,t.sub_unit_id
+               ,tmgu.unit_name as "unitName"
+               ,tmgus.unit_name as "subUnitName"
+
+               ,case
+                   when t.sub_unit_id ISNULL
+	                then dkic_b.f_box_piece(tmgus.unit_name, tmgu.unit_name, 0,tpoi.item_qty)
+                   else
+                       dkic_b.f_box_piece(tmgus.unit_name, tmgu.unit_name,
+                                          floor((tpoi.item_qty) / T.pack_box)::INT,
+                                          floor((tpoi.item_qty) % T.pack_box)::INT)
+                end AS "boxPiece"
+
+               ,case
+                   when t.sub_unit_id ISNULL
+	                then dkic_b.f_box_piece(tmgus.unit_name, tmgu.unit_name, 0,t.outing_qty)
+                   else
+                       dkic_b.f_box_piece(tmgus.unit_name, tmgu.unit_name,
+                                          floor(t.outing_qty / T.pack_box)::INT,
+                                          floor(t.outing_qty % T.pack_box)::INT)
+                   end AS "unitInfo"
+
         FROM dkic_b.t_psi_outbound_item as t
                  Left join dkic_b.t_mst_supplier tmp on t.sup_id = tmp.sup_id
                  left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = t.wh_id

+ 1 - 1
src/main/java/com/dk/mdm/mapper/sale/OrderItemMapper.xml

@@ -225,7 +225,7 @@
     <select id="selectById" resultMap="BaseResultMapResponse">
         SELECT
         <include refid="Base_Column_List_Response"/>
-        ,(select ul.decimal_places from  dkic_b.t_mst_unit ul where dkic_b.t_psi_order_item.unit_id = ul.unit_id) as "decimalPlaces"
+        ,(select ul.decimal_places from  dkic_b.t_mst_unit ul where t.unit_id = ul.unit_id) as "decimalPlaces"
         FROM dkic_b.t_psi_order_item t
         WHERE t.item_id = #{id}::uuid
     </select>

+ 14 - 0
src/main/java/com/dk/mdm/model/response/ivt/OutboundItemResponse.java

@@ -396,6 +396,20 @@ public class OutboundItemResponse {
     @ApiModelProperty(value = "外协供应商")
     private String supName;
 
+    /**
+     * 包装数量
+     */
+    @Excel(name = "包装数量")
+    @ApiModelProperty(value = "包装数量")
+    private String boxPiece;
+
+    /**
+     * 本次出库包装数量
+     */
+    @Excel(name = "本次出库包装数量")
+    @ApiModelProperty(value = "本次出库包装数量")
+    private String unitInfo;
+
     private static final long serialVersionUID = 1L;
 
 }