Ver Fonte

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/dk/mdm/mapper/ivt/OutboundMapper.xml
dongke há 1 ano atrás
pai
commit
64dc281cb4

+ 1 - 1
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -899,7 +899,7 @@
         SELECT
         series_id AS "seriesId",
         series_code AS "seriesCode",
-        series_name AS "serieName",
+        series_name AS "seriesName",
         flg_valid AS "flgValid"
         FROM dkic_b.t_mst_goods_series
         <where>

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

@@ -227,8 +227,8 @@
         ,tpii.wh_id as "whId"
         ,tmw.wh_name as "whName"
         ,tmgs.sku_code  as "skuCode"
-        ,tmgs.sku_model as "skuModel"
-        ,tmgs.sku_name  as "skuName"
+        ,tpii.sku_model as "skuModel"
+        ,tpii.sku_name  as "skuName"
         ,tmgs.sku_spec  as "skuSpec"
         ,tmgs.price_purchase
         ,tmgs.sku_images

+ 1 - 0
src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml

@@ -815,6 +815,7 @@
         <include refid="Select_Inbound_Join_Table_Into"/>
         <where>
             AND tpi.cp_id = #{cpId}
+            AND tpi.into_type != '入库类型-外协入库'
             <if test="intoTypes != null and intoTypes.size()>0">
                 AND tpi.into_type =any(#{intoTypes,typeHandler=StringListTypeHandler})
             </if>

+ 9 - 4
src/main/java/com/dk/mdm/mapper/ivt/OutboundMapper.xml

@@ -188,6 +188,8 @@
 
         <result column="sku_code" property="skuCode"/>
         <result column="sku_model" property="skuModel"/>
+        <result column="sku_spec" property="skuSpec"/>
+        <result column="pack_box_text" property="packBoxText"/>
         <result column="sku_name" property="skuName"/>
         <result column="brand_name" property="brandName"/>
         <result column="price_purchase" property="pricePurchase"/>
@@ -1074,8 +1076,8 @@
                  left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
                  left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.out_status
                  left join dkic_b.t_mst_dictionary_data tmd on tmd.data_id = t.out_reason
-                 Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_id
                 left join  dkic_b.t_psi_outbound_item  tpoi  on tpoi.out_id = t.out_id
+                Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = tpoi.sup_id
                 left join dkic_b.t_psi_inventory tpi on tpi.inv_id = tpoi.inv_id
                 left join dkic_b.t_mst_unit as tmgu on tpoi.unit_id = tmgu.unit_id
                 left join dkic_b.t_mst_unit as tmgus on tpoi.sub_unit_id = tmgus.unit_id
@@ -1120,8 +1122,9 @@
                     tpoi.s_order_id  AS "list_s_order_id",
                     tpoi.s_order_item_id  AS "list_s_order_item_id",
                         tmgs.sku_code AS list_sku_code,
-        tmgs.sku_model AS list_sku_model,
-        tmgs.sku_name AS list_sku_name,
+        tpoi.sku_model AS list_sku_model,
+        tpoi.sku_name AS list_sku_name,
+        tmgs.sku_spec AS list_sku_spec,
         case when tpoi.sku_id is null then tmp.sup_name || '(外协)' else  tmgb.brand_name end AS list_brand_name,
         tmgb.short_name AS list_short_name,
         tmgs.price_purchase AS list_price_purchase,
@@ -1139,7 +1142,9 @@
                 ,tpoi.outing_piece  as "list_outing_piece"
                 ,tpoi.out_box  as "list_out_box"
                 ,tpoi.out_piece  as "list_out_piece"
-,tmgu.decimal_places as "list_decimal_places"
+                ,case when t.out_status = '出库状态-已出库' then dkic_b.f_box_piece(tmgus.unit_name,tmgu.unit_name,tpoi.out_box,tpoi.out_piece)
+                    else dkic_b.f_box_piece(tmgus.unit_name,tmgu.unit_name,tpoi.outing_box,tpoi.outing_piece) end as "list_pack_box_text"
+                ,tmgu.decimal_places as "list_decimal_places"
     </sql>
 
     <select id="countByCondDetail" resultType="Long">

+ 58 - 36
src/main/java/com/dk/mdm/mapper/report/ReportMapper.xml

@@ -327,6 +327,12 @@
             <if test="staffIdList != null and staffIdList.size() > 0">
                 AND t.staff_id =any(#{staffIdList, typeHandler=uuidListTypeHandler})
             </if>
+            <if test="staffName != null and staffName != ''">
+                AND tms.staff_name LIKE concat('%',my_ex.likequery(#{staffName}),'%')
+            </if>
+            <if test="orgName != null and orgName != ''">
+                AND tmo.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
+            </if>
             <if test="outStatusList != null and outStatusList.size() > 0">
                 AND t.out_status =any(#{outStatusList, typeHandler=StringListTypeHandler})
             </if>
@@ -643,6 +649,12 @@
             <if test="staffIdList != null and staffIdList.size() > 0">
                 AND t.staff_id =any(#{staffIdList, typeHandler=uuidListTypeHandler})
             </if>
+            <if test="staffName != null and staffName != ''">
+                AND tms.staff_name LIKE concat('%',my_ex.likequery(#{staffName}),'%')
+            </if>
+            <if test="orgName != null and orgName != ''">
+                AND tmo.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
+            </if>
             <if test="accDateStart != null and accDateEnd != null">
                 AND t.acc_date &gt;= #{accDateStart}::timestamp with time zone
                 AND t.acc_date &lt; #{accDateEnd}::timestamp with time zone + interval '1 day'
@@ -651,6 +663,13 @@
                 AND t.make_time &gt;= #{makeTimeStart}::timestamp with time zone
                 AND t.make_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'
             </if>
+            <if test="searchText !=null and searchText != ''">
+                AND (
+                t.rp_no   LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                or tmc.cus_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                or tmc.cus_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                )
+            </if>
         </where>
     </sql>
     <!-- 采购明细报表主表 -->
@@ -1038,13 +1057,13 @@
         ,t.out_date as "outDate"
         ,t.remarks
         ,makestaff.staff_name as "makeStaffName"
-        ,tmgs.sku_name as "skuName"
-        ,tmgs.sku_model as "skuModel"
+        ,tpoi.sku_name as "skuName"
+        ,tpoi.sku_model as "skuModel"
         ,tmgs.sku_spec as "skuSpec"
         ,tpi.non_std_code as "nonStdCode"
         ,tmgb.short_name as "shortName"
         ,tmgb.brand_name as "brandName"
-        ,tmw.wh_name as "whName"
+        ,CASE WHEN tpoi.sku_id IS NULL THEN tmsp.sup_name || '(外协)' ELSE tmw.wh_name end as "whName"
         ,tmgc.cat_name as "catName"
         ,series.series_name as "seriesName"
         ,sys.f_remove_zero(tpoi.outing_qty) as "outingQty"
@@ -1068,6 +1087,7 @@
         left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.out_status
         left join sys.t_data_kind tdktype ON tdktype.kind_code = t.out_type
         left join dkic_b.t_psi_outbound_item as tpoi on tpoi.out_id = t.out_id
+        left join dkic_b.t_mst_supplier tmsp on tpoi.sup_id = tmsp.sup_id
         left join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpoi.sku_id
         left join dkic_b.t_mst_goods_brand as tmgb on tmgb.brand_id = tmgs.brand_id
         left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
@@ -1154,45 +1174,47 @@
         count(1) from (
             SELECT 1
             FROM dkic_b.t_psi_outbound as t
-            left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
-            Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_id
-            left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
-            left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
-            left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
-            left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
-            left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.out_status
-            left join sys.t_data_kind tdktype ON tdktype.kind_code = t.out_type
-            left join dkic_b.t_psi_outbound_item as tpoi on tpoi.out_id = t.out_id
-            left join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpoi.sku_id
-            left join dkic_b.t_mst_goods_brand as tmgb on tmgb.brand_id = tmgs.brand_id
-            left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
-            left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
-            left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = tpoi.inv_id
-            left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
+        left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
+        Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_id
+        left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
+        left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
+        left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
+        left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
+        left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.out_status
+        left join sys.t_data_kind tdktype ON tdktype.kind_code = t.out_type
+        left join dkic_b.t_psi_outbound_item as tpoi on tpoi.out_id = t.out_id
+        left join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpoi.sku_id
+        left join dkic_b.t_mst_goods_brand as tmgb on tmgb.brand_id = tmgs.brand_id
+        left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
+        left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
+        left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = tpoi.inv_id
+        left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
+        left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
+        left join dkic_b.t_mst_unit as tmgus on tmgs.sub_unit_id = tmgus.unit_id
             <include refid="Condition_OutboundDetailReport"/>
             union all
             select
             1
             FROM dkic_b.t_psi_inbound as tpi
-            left join dkic_b.t_mst_org tmo on tmo.org_id = tpi.org_id
-            Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = tpi.sup_id
-            left join dkic_b.t_mst_staff tms on tms.staff_id = tpi.staff_id
-            left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = tpi.make_staff
-            left join dkic_b.t_mst_customer tmc on tmc.cus_id = tpi.cus_id
-            left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
-            left join sys.t_data_kind as tdk1 on tdk1.kind_code = tpi.into_status
-            left join sys.t_data_kind tdktype ON tdktype.kind_code = tpi.into_type
-            left join dkic_b.t_psi_inbound_item as tpii on tpii.into_id = tpi.into_id
-            left join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpii.sku_id
-            left join dkic_b.t_mst_goods_brand as tmgb on tmgb.brand_id = tmgs.brand_id
-            left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
-            left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
-            left join dkic_b.t_psi_inventory as tpin on tpin.inv_id = tpii.inv_id
-            left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
-            left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
-            left join dkic_b.t_mst_unit as tmgus on tmgs.sub_unit_id = tmgus.unit_id
+        left join dkic_b.t_mst_org tmo on tmo.org_id = tpi.org_id
+        Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = tpi.sup_id
+        left join dkic_b.t_mst_staff tms on tms.staff_id = tpi.staff_id
+        left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = tpi.make_staff
+        left join dkic_b.t_mst_customer tmc on tmc.cus_id = tpi.cus_id
+        left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
+        left join sys.t_data_kind as tdk1 on tdk1.kind_code = tpi.into_status
+        left join sys.t_data_kind tdktype ON tdktype.kind_code = tpi.into_type
+        left join dkic_b.t_psi_inbound_item as tpii on tpii.into_id = tpi.into_id
+        left join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpii.sku_id
+        left join dkic_b.t_mst_goods_brand as tmgb on tmgb.brand_id = tmgs.brand_id
+        left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
+        left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
+        left join dkic_b.t_psi_inventory as tpin on tpin.inv_id = tpii.inv_id
+        left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
+        left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
+        left join dkic_b.t_mst_unit as tmgus on tmgs.sub_unit_id = tmgus.unit_id
             <include refid="Condition_OutInboundDetailReport"/>
-        )
+        ) t
     </select>
     <!-- 入库明细报表主表 -->
     <select id="getInboundlReport" resultType="java.util.Map">

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

@@ -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

+ 15 - 0
src/main/java/com/dk/mdm/model/pojo/ivt/InboundItem.java

@@ -100,6 +100,21 @@ public class InboundItem extends PageInfo<InboundItem> implements Serializable {
     @TableField(typeHandler = UuidTypeHandler.class)
     private String skuId;
 
+    /**
+     * 商品名称--skuid空的时候要取当前的名称
+     */
+    @Excel(name = "商品名称")
+    @ApiModelProperty(value = "商品名称")
+    private String skuName;
+
+
+    /**
+     * 商品型号--skuid空的时候要取当前的商品型号
+     */
+    @Excel(name = "商品型号")
+    @ApiModelProperty(value = "商品型号")
+    private String skuModel;
+
 
     /**
      * 入库价

+ 15 - 4
src/main/java/com/dk/mdm/model/query/ivt/InboundItemQuery.java

@@ -78,6 +78,21 @@ public class InboundItemQuery extends PageInfo<InboundItemQuery>  {
     @TableField(typeHandler = UuidTypeHandler.class)
     private String skuId;
 
+    /**
+     * 商品名称--skuid空的时候要取当前的名称
+     */
+    @Excel(name = "商品名称")
+    @ApiModelProperty(value = "商品名称")
+    private String skuName;
+
+
+    /**
+     * 商品型号--skuid空的时候要取当前的商品型号
+     */
+    @Excel(name = "商品型号")
+    @ApiModelProperty(value = "商品型号")
+    private String skuModel;
+
 
     /**
      * 入库价
@@ -280,10 +295,6 @@ public class InboundItemQuery extends PageInfo<InboundItemQuery>  {
     @TableField(typeHandler = TimestampTypeHandler.class,exist = false)
     private LocalDate  intoDateEnd;
 
-    @Excel(name = "商品名称")
-    @ApiModelProperty(value = "商品名称")
-    private String skuName;
-
     @ApiModelProperty(value = "入库单号")
     private String intoNo;
 

+ 15 - 14
src/main/java/com/dk/mdm/model/response/ivt/InboundItemResponse.java

@@ -114,6 +114,21 @@ public class InboundItemResponse  {
     @TableField(typeHandler = UuidTypeHandler.class)
     private String skuId;
 
+    /**
+     * 商品名称--skuid空的时候要取当前的名称
+     */
+    @Excel(name = "商品名称")
+    @ApiModelProperty(value = "商品名称")
+    private String skuName;
+
+
+    /**
+     * 商品型号--skuid空的时候要取当前的商品型号
+     */
+    @Excel(name = "商品型号")
+    @ApiModelProperty(value = "商品型号")
+    private String skuModel;
+
 
     /**
      * 入库价
@@ -326,20 +341,6 @@ public class InboundItemResponse  {
     @ApiModelProperty(value = "商品编号")
     private String skuCode;
 
-    /**
-     * 商品名称
-     */
-    @Excel(name = "商品名称")
-    @ApiModelProperty(value = "商品名称")
-    private String skuName;
-
-    /**
-     * 商品型号
-     */
-    @Excel(name = "商品型号")
-    @ApiModelProperty(value = "商品型号")
-    private String skuModel;
-
 
     /**
      * 商品型号

+ 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 - 2
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleOrderService.java

@@ -241,6 +241,9 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
                     inboundItemVO.setWhId(outboundItemVO.getWhId());
                     //企业ID
                     inboundItemVO.setCpId(outboundItemVO.getCpId());
+                    // 商品
+                    inboundItemVO.setSkuModel(outboundItemVO.getSkuModel());
+                    inboundItemVO.setSkuName(outboundItemVO.getSkuName());
                     //实体转换
                     InboundItem inboundItem = inboundItemConvert.convertToPo(inboundItemVO);
                     inboundItemMapper.insert(inboundItem);
@@ -387,7 +390,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
                         .setOutQty(BigDecimal.ZERO)
                         .setOutAmt(BigDecimal.ZERO);
             }
-            //库状态
+            //库状态
             outboundItemVO.setOutStatus(outboundVO.getOutStatus());
             //实体转换
             OutboundItem outboundItem = outboundItemConvert.convertToPo(outboundItemVO);
@@ -417,7 +420,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
                     orderItem.setOutQty(BigDecimal.ZERO);
                     orderItem.setOutAmt(BigDecimal.ZERO);
                 }
-                //库状态
+                //库状态
                 String outStatus = this.setOutStatus(orderItemResponse.getOutingQty().add(orderItem.getOutingQty()),
                         orderItemResponse.getOutQty().add(orderItem.getOutQty()), orderItemResponse.getItemQty());
                 orderItem.setOutStatus(outStatus);

+ 1 - 1
src/main/java/com/dk/mdm/service/report/ReportService.java

@@ -135,7 +135,7 @@ public class ReportService {
             dataList= reportMapper.getOutboundDetailReport(param);
         }
         data.setList(dataList);
-        data.setTotal(reportMapper.getSalesTrackingReportCount(param));
+        data.setTotal(reportMapper.getOutboundDetailReportCount(param));
         data.setPageSize((Integer) param.get("pageSize"));
         data.setCurrentPage((Integer) param.get("currentPage"));
         return ResponseResultUtil.success(data);