Przeglądaj źródła

1、修改销售出库的问题

zhoux 1 rok temu
rodzic
commit
8a884c4952

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

@@ -100,6 +100,7 @@
         <result column="address_gcj02" property="addressGcj02" typeHandler="JsonTypeHandler"/>
         <result column="addressFull" property="addressFull"/>
         <result column="channel_name" property="channelName"/>
+        <result column="channel_id" property="channelId"/>
         <result column="cus_from_name" property="cusFromName"/>
         <result column="out_reason" property="outReason" typeHandler="UuidTypeHandler"/>
         <result column="out_reason_name" property="outReasonName" />
@@ -443,6 +444,7 @@
                tmc.contact_name,
                tmc.contact_phone,
                tmc.channel_id                                    as sales_channel,
+               tmc.channel_id                                    ,
                tmsc.channel_name                                 as channel_name,
                t.sup_id,
                t.out_status,

+ 4 - 4
src/main/java/com/dk/mdm/mapper/mst/CustomerMapper.xml

@@ -294,12 +294,12 @@
         "outboundAmount",
 
 
-        (SELECT COUNT(1) FROM dkic_b.t_psi_order tpo WHERE tpo.cus_id = tmc.cus_id AND tpo.cp_id =
-        tmc.cp_id AND tpo.flg_valid AND tpo.out_status = '出库状态-待出库' AND tpo.order_status = '订单状态-成交') AS
+        (SELECT COUNT(1) FROM dkic_b.t_psi_outbound tpob WHERE tpob.cus_id = tmc.cus_id AND tpob.cp_id =
+        tmc.cp_id AND tpob.flg_valid AND tpob.out_type = '出库类型-销售出库' AND tpob.out_status = '出库状态-出库中') AS
         "outboundNotQuantity",
 
-        (SELECT sum(tpo.sum_amount) FROM dkic_b.t_psi_order tpo WHERE tpo.cus_id = tmc.cus_id AND tpo.cp_id =
-        tmc.cp_id AND tpo.flg_valid AND tpo.out_status = '出库状态-待出库' AND tpo.order_status = '订单状态-成交') AS
+        (SELECT sum(tpob.outing_amt) FROM dkic_b.t_psi_outbound tpob WHERE tpob.cus_id = tmc.cus_id AND tpob.cp_id =
+        tmc.cp_id AND tpob.flg_valid AND tpob.out_type = '出库类型-销售出库' AND tpob.out_status = '出库状态-出库中') AS
         "outboundNotAmount",
 
 

+ 3 - 0
src/main/java/com/dk/mdm/model/response/ivt/OutboundResponse.java

@@ -344,6 +344,9 @@ public class OutboundResponse extends PageInfo<OutboundResponse> implements Seri
     @ApiModelProperty(value = "销售渠道")
     private String salesChannel;
 
+    @ApiModelProperty(value = "销售渠道")
+    private String channelId;
+
 
 
     private BigDecimal sumOutAmt;

+ 2 - 2
src/main/java/com/dk/mdm/service/ivt/outbound/OutCommon.java

@@ -66,7 +66,7 @@ public class OutCommon {
                     .setAddressNo(outboundVO.getAddressNo()).setAddressGcj02(outboundVO.getAddressGcj02()).setAddressFull(outboundVO.getAddressFull())
                     .setContactName(outboundVO.getContactName()).setContactPhone(outboundVO.getContactPhone()).setCusFrom(outboundVO.getCusFrom())
                     .setChannelId(outboundVO.getSalesChannel()).setOrgId(outboundVO.getOrgId()).setStaffId(outboundVO.getStaffId())
-                    .setFollowStaffs(followStaffs)
+                    .setFollowStaffs(followStaffs).setCusFrom(outboundVO.getCusFrom())
                     .setReportStaff(outboundVO.getMakeStaff()).setSaleStatus(Constant.SaleStatus.CHENGJIAO.getName()).setCpId(outboundVO.getCpId());
             customerMapper.insert(customer);
             outboundVO.setCusId(customer.getCusId());
@@ -88,7 +88,7 @@ public class OutCommon {
                     .setAddressNo(outboundVO.getAddressNo()).setAddressGcj02(outboundVO.getAddressGcj02()).setAddressFull(outboundVO.getAddressFull())
                     .setContactName(outboundVO.getContactName()).setContactPhone(outboundVO.getContactPhone()).setCusFrom(outboundVO.getCusFrom())
                     .setChannelId(outboundVO.getSalesChannel()).setOrgId(outboundVO.getOrgId()).setStaffId(outboundVO.getStaffId())
-                    .setFollowStaffs(followStaffs)
+                    .setFollowStaffs(followStaffs).setCusFrom(outboundVO.getCusFrom())
                     .setSaleStatus(Constant.SaleStatus.CHENGJIAO.getName());
             customerService.updateByUuid(customer);
         }

+ 4 - 0
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleOrderService.java

@@ -494,6 +494,10 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
         //endregion
         //region 大编辑
         else {
+            // region 更新客户信息
+            outboundVO = outCommon.insertCustomer(outboundVO);
+            // endregion
+
             //region 根据id查询   并且明细数量金额  求和
             OutboundResponse outboundResponse = outboundMapper.selectById(outboundVO.getOutId());
             BigDecimal sumQty = outboundVO.getItemList().stream().map(OutboundItemVO::getOutingQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);