Преглед изворни кода

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-server-mdm

zhoux пре 1 година
родитељ
комит
bdc6ce3fb2

+ 29 - 2
src/main/java/com/dk/mdm/mapper/ivt/OutboundItemMapper.xml

@@ -405,6 +405,8 @@ sys.f_remove_zero(out_qty) as out_qty, out_amt, sys.f_remove_zero(return_qty) as
                tmgs.flg_sub_unit AS "flgSubUnit",
                t.outing_box ,
                t.outing_piece ,
+               t.out_box ,
+               t.out_piece ,
                tmgs.price_standard AS "priceStandard",
                t.pack_box  ,
                 tmgus.unit_name         as "subUnitName",
@@ -414,7 +416,7 @@ sys.f_remove_zero(out_qty) as out_qty, out_amt, sys.f_remove_zero(return_qty) as
                tmgs.sku_code            as "skuCode",
                sys.f_remove_zero(tpoi.item_qty)    as "orderQty",
                sys.f_remove_zero(tpoi.item_qty - tpoi.outing_qty - tpoi.out_qty + t.outing_qty + t.out_qty) as "canOutingQty",
-               tmgb.brand_name AS "brandName",
+               case when t.sku_id is null then tmp.sup_name || '(外协)' else  tmgb.brand_name end AS brandName,
                tmgb.short_name AS "shortName",
                t.price_out,
                sys.f_remove_zero(t.outing_qty + t.out_qty)                                                  as outing_qty,
@@ -433,7 +435,31 @@ 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
                  left join dkic_b.t_mst_supplier as tms on t.sup_id = tms.sup_id
                  left join dkic_b.t_psi_order_item as tpoi on tpoi.item_id = t.from_item_id
@@ -536,7 +562,7 @@ sys.f_remove_zero(out_qty) as out_qty, out_amt, sys.f_remove_zero(return_qty) as
                t.item_index,
                t.sku_id,
                tmgs.sku_images,
-               tmgb.brand_name,
+               case when t.sku_id is null then tmp.sup_name || '(外协)' else  tmgb.brand_name end AS brand_name,
                tmgb.short_name,
                tmgs.sku_code                                                                         as "skuCode",
                case when t.sku_id is null then t.sku_model  else  tmgs.sku_model end                 as "skuModel",
@@ -571,6 +597,7 @@ sys.f_remove_zero(out_qty) as out_qty, out_amt, sys.f_remove_zero(return_qty) as
                  left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
                  left join dkic_b.t_psi_inventory tpi on tpi.inv_id = t.inv_id
                  left join dkic_b.t_psi_outbound_item as tpobi on tpobi.item_id = t.s_out_item_id
+                 Left join dkic_b.t_mst_supplier tmp on t.sup_id = tmp.sup_id
         where t.flg_valid
           and t.out_id = #{id}::uuid
         order by t.item_index

+ 11 - 2
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>
@@ -414,11 +414,20 @@
                tpobi.remarks,
                t.wh_id,
                tmw.wh_name
-                ,(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 tpobi.unit_id = ul.unit_id) as "decimalPlaces"
+               ,tpobi.pack_box
+               ,tpobi.unit_id
+               ,tpobi.sub_unit_id
+               ,ul.unit_name as "unitName"
+               ,u2.unit_name as "subUnitName"
+               ,dkic_b.f_box_piece(u2.unit_name,ul.unit_name,tpobi.outing_box,tpobi.outing_piece) AS "outingBoxPiece"
+               ,dkic_b.f_box_piece(u2.unit_name,ul.unit_name,tpobi.out_box,tpobi.out_piece) AS "outBoxPiece"
         FROM dkic_b.t_psi_outbound_item as tpobi
                  inner join dkic_b.t_psi_order_item as t on t.item_id = tpobi.from_item_id
                  inner join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
                  left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = t.wh_id
+                 LEFT JOIN dkic_b.t_mst_unit AS ul ON tpobi.unit_id = ul.unit_id
+                 LEFT JOIN dkic_b.t_mst_unit AS u2 ON tpobi.sub_unit_id = u2.unit_id
         where tpobi.flg_valid
           and tpobi.out_type = '出库类型-销售出库'
           and tpobi.out_qty > tpobi.return_qty

+ 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;
 
 }

+ 8 - 0
src/main/java/com/dk/mdm/model/response/sale/OrderItemResponse.java

@@ -374,6 +374,14 @@ public class OrderItemResponse extends PageInfo<OrderItemResponse> implements Se
     @ApiModelProperty(value = "辅助单位")
     private String subUnitName;
 
+    @Excel(name = "出库中箱数")
+    @ApiModelProperty(value = "出库中箱数")
+    private String outingBoxPiece;
+
+    @Excel(name = "已出库箱数")
+    @ApiModelProperty(value = "已出库箱数")
+    private String outBoxPiece;
+
     private static final long serialVersionUID = 1L;
 
 }

+ 5 - 0
src/main/java/com/dk/mdm/service/common/CommonService.java

@@ -795,6 +795,11 @@ public class CommonService extends BaseService<Map<String, Object>> {
             map.put("kindType","供应商类别");
             list = commonMapper.getDataKind(map);
         }
+        // 初始款项
+        if (dataSourceCode.equals("initialPayment")) {
+            map.put("kindType", "初始款项");
+            list = commonMapper.getDataKind(map);
+        }
 
         return ResponseResultUtil.success(list);
     }

+ 2 - 1
src/main/java/com/dk/mdm/service/mst/DictionaryDataService.java

@@ -113,7 +113,8 @@ public class DictionaryDataService extends BaseService<DictionaryData> {
             String staffId = authUtils.getStaff().getStaffId();
             moneyAccountService.insert(new MoneyAccountVO().setAccDate(LocalDate.now())
                     .setBalance(new BigDecimal(0)).setInitBalance(new BigDecimal(0))
-                    .setMacName(dictionaryDataVO.getDataValue()).setMacType(dictionaryData.getDataId()).setMakeStaff(staffId).setStaffId(staffId).setOrgId(dictionaryDataVO.getOrgId()));
+                    .setMacName(dictionaryDataVO.getDataValue()).setMacType(dictionaryData.getDataId()).setMakeStaff(staffId).setStaffId(staffId).setOrgId(dictionaryDataVO.getOrgId())
+                    .setFlgNegative(true));
         }
         //新建
         dictionaryDataMapper.insert(dictionaryData);