Bläddra i källkod

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

zhoux 1 år sedan
förälder
incheckning
cca4ee0d42

+ 4 - 0
src/main/java/com/dk/mdm/mapper/ivt/InventoryMapper.xml

@@ -129,6 +129,10 @@
                 OR  tpi.non_std_code like concat('%', my_ex.likequery(#{searchText}) , '%')
                 )
             </if>
+            <if test="invQtyFlag != null and invQtyFlag = true">
+                and tpi.inv_qty != 0
+
+            </if>
         </where>
     </sql>
 

+ 14 - 1
src/main/java/com/dk/mdm/mapper/ivt/OutboundItemMapper.xml

@@ -101,6 +101,7 @@
         <result column="sku_images" property="skuImages" typeHandler="JsonTypeHandler"/>
         <result column="skuModel" property="skuModel"/>
         <result column="skuName" property="skuName"/>
+        <result column="priceStandard" property="priceStandard"/>
         <result column="brandName" property="brandName"/>
         <result column="brand_name" property="brandName"/>
         <result column="shortName" property="shortName"/>
@@ -122,6 +123,10 @@
         <result column="sub_unit_code" property="subUnitCode"/>
         <result column="sub_unit_name" property="subUnitName"/>
         <result column="pack_box" property="packBox"/>
+        <result column="flgSubUnit" property="flgSubUnit"/>
+        <result column="subUnitName" property="subUnitName"/>
+        <result column="unitName" property="unitName"/>
+
     </resultMap>
 
     <!-- 通用条件列 -->
@@ -371,7 +376,13 @@
                t.item_index,
                t.sku_id,
                tmgs.sku_images,
-
+               tmgs.flg_sub_unit AS "flgSubUnit",
+               t.outing_box AS "outingBox",
+               t.outing_piece AS "outingPiece",
+               tmgs.price_standard AS "priceStandard",
+                tmgs.pack_box AS "packBox",
+                tmgus.unit_name         as "subUnitName",
+                tmgu.unit_name         as "unitName",
                tmgs.sku_code                                                             as "skuCode",
                tmgs.sku_model                                                            as "skuModel",
                tmgs.sku_name                                                             as "skuName",
@@ -395,6 +406,8 @@
                  left join dkic_b.t_psi_order_item as tpoi on tpoi.item_id = t.from_item_id
                  left join dkic_b.t_psi_order as tpo on tpo.order_id = t.from_id
                  left join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
+                 left join dkic_b.t_mst_unit as tmgu on t.unit_id = tmgu.unit_id
+                 left join dkic_b.t_mst_unit as tmgus on t.sub_unit_id = tmgus.unit_id
                  left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = t.inv_id
                  left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
                  left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id

+ 19 - 0
src/main/java/com/dk/mdm/mapper/sale/OrderMapper.xml

@@ -175,6 +175,20 @@
             <result column="org_name" property="orgName"/>
             <result column="staff_name" property="staffName"/>
 
+
+        <result column="cus_code" property="cusCode"/>
+        <result column="cus_name" property="cusName"/>
+        <result column="cus_phone" property="cusPhone"/>
+        <result column="address_area" property="addressArea" typeHandler="JsonTypeHandler"/>
+        <result column="address_name" property="addressName"/>
+        <result column="address_no" property="addressNo"/>
+        <result column="address_gcj02" property="addressGcj02" typeHandler="JsonTypeHandler"/>
+        <result column="address_full" property="addressFull"/>
+        <result column="contact_name" property="contactName"/>
+        <result column="contact_phone" property="contactPhone"/>
+        <result column="cus_from" property="cusFrom" typeHandler="UuidTypeHandler"/>
+        <result column="channel_id" property="channelId" typeHandler="UuidTypeHandler"/>
+
             <collection property="orderItemResponseList" resultMap="itemListMap" columnPrefix="list_"/>
     </resultMap>
     <!--小程序用 关联映射-->
@@ -966,8 +980,13 @@
     <select id="selectByCondDetail" resultMap="BaseResultMapDetailResponse">
         SELECT
         <include refid="Base_Column_List_Detail_Join"/>,
+        tmc.cus_code,tmc.cus_name, tmc.cus_phone, tmc.address_area, tmc.address_name, tmc.address_no,
+        tmc.address_gcj02, tmc.address_full, tmc.contact_name, tmc.contact_phone, tmc.cus_from, tmc.channel_id,
+
+
         <include refid="Base_Column_List_Item_Response_Detail_Join"/>
         FROM dkic_b.t_psi_order as t
+        left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
         left join dkic_b.t_psi_order_item toi on toi.order_id  = t.order_id
         inner join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id  = toi.sku_id
         left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id  = tmgs.brand_id

+ 2 - 0
src/main/java/com/dk/mdm/model/query/ivt/InventoryQuery.java

@@ -150,6 +150,8 @@ public class InventoryQuery extends PageInfo<InventoryQuery>{
 
     @ApiModelProperty(value = "排序")
     private String desc;
+
+    private Boolean invQtyFlag;
     /*
      * 相关属性
      * @TableField(exist = false)

+ 4 - 1
src/main/java/com/dk/mdm/model/response/ivt/OutboundItemResponse.java

@@ -318,6 +318,9 @@ public class OutboundItemResponse {
     @ApiModelProperty(value = "已出库数量")
     private BigDecimal outboundOutQty;
 
+    @ApiModelProperty(value = "标价")
+    private BigDecimal priceStandard;
+
     @ApiModelProperty(value = "可退货数量")
     private BigDecimal canReturnQty;
 
@@ -369,7 +372,7 @@ public class OutboundItemResponse {
     private String subUnitName;
 
 
-
+    private Boolean flgSubUnit;
 
     private static final long serialVersionUID = 1L;
 

+ 2 - 0
src/main/java/com/dk/mdm/model/response/sale/OrderResponse.java

@@ -398,6 +398,8 @@ public class OrderResponse extends PageInfo<OrderResponse> implements Serializab
     @ApiModelProperty(value = "实收金额")
     private BigDecimal amtFactReceipt;
 
+    private String channelId;
+
     private static final long serialVersionUID = 1L;
 
 }

+ 6 - 6
src/main/java/com/dk/mdm/service/ivt/inbound/InboundOtherService.java

@@ -452,9 +452,9 @@ public class InboundOtherService extends BaseService<Inbound> {
         List<InboundItemResponse> inboundItemResponseList = inboundItemMapper.selectByCond(new InboundItemQuery().setIntoId(inboundResponse.getIntoId()));
         //endregion
 
-        //region  自动办理参数为true  已入库编辑
-        //自动办理参数为true
-        if (Constant.FlgHandleSetting.TRUE.getValue().equals(inboundResponse.getFlgHandleSetting())) {
+        //region  已入库作废
+        if (Constant.IntoStatus.YIRUKU.getName().equals(inboundResponse.getIntoStatus())) {
+
             //region   todo  退账 当单据红的账款id不为空说明有账, 要先退账才能进行操作
             if (inboundResponse.getReceivableId() != null) {
 
@@ -502,9 +502,9 @@ public class InboundOtherService extends BaseService<Inbound> {
         }
         //endregion
 
-        //region 自动办理参数false  入库中编辑
-        //自动办理标识为false 并且 自动办理参数为false  入库中
-        if (!inboundResponse.getFlgAutoHandle() && Constant.FlgHandleSetting.FALSE.getValue().equals(inboundResponse.getFlgHandleSetting())) {
+        //region 入库中、待入库作废
+        if (Constant.IntoStatus.RUKUZHONG.getName().equals(inboundResponse.getIntoStatus()) ||
+                Constant.IntoStatus.DAIRUKU.getName().equals(inboundResponse.getIntoStatus())) {
             //region 修改明细
             for (InboundItemResponse inboundItemResponse : inboundItemResponseList) {
                 //赋值

+ 9 - 10
src/main/java/com/dk/mdm/service/ivt/inbound/InboundPurchaseReturnService.java

@@ -501,9 +501,9 @@ public class InboundPurchaseReturnService extends BaseService<Inbound> {
         List<InboundItemResponse> inboundItemResponseList = inboundItemMapper.selectByCond(new InboundItemQuery().setIntoId(inboundResponse.getIntoId()));
         //endregion
 
-        //region  自动办理参数为true  已入库编辑
-        //自动办理参数为true
-        if (Constant.FlgHandleSetting.TRUE.getValue().equals(inboundResponse.getFlgHandleSetting())) {
+        //region  已入库作废
+        if (Constant.IntoStatus.YIRUKU.getName().equals(inboundResponse.getIntoStatus())) {
+
             //region 退账
             if (inboundResponse.getReceivableId() != null) {
                 accountService.reversePayable(inboundResponse.getIntoId(), Constant.InventoryDocCode.INTOBOUND.getTableName());
@@ -553,15 +553,15 @@ public class InboundPurchaseReturnService extends BaseService<Inbound> {
             map.put("delIntoDetail", inboundItemResponseList);
             inventoryService.operatingInventoryInformation(map);
             //endregion
-        }
-        else{
+        } else {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_INTO.getMessage());
         }
         //endregion
 
-        //region 自动办理参数false  入库中编辑
-        //自动办理标识为false 并且 自动办理参数为false  入库中
-        if (!inboundResponse.getFlgAutoHandle() && Constant.FlgHandleSetting.FALSE.getValue().equals(inboundResponse.getFlgHandleSetting())) {
+        //region 入库中、待入库作废
+        if (Constant.IntoStatus.RUKUZHONG.getName().equals(inboundResponse.getIntoStatus()) ||
+                Constant.IntoStatus.DAIRUKU.getName().equals(inboundResponse.getIntoStatus())) {
+
             //region 修改明细
             for (InboundItemResponse inboundItemResponse : inboundItemResponseList) {
                 //赋值
@@ -590,8 +590,7 @@ public class InboundPurchaseReturnService extends BaseService<Inbound> {
             );
             //endregion
 
-        }
-        else{
+        } else {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_INTO.getMessage());
         }
         //endregion

+ 7 - 11
src/main/java/com/dk/mdm/service/ivt/inbound/InboundPurchaseService.java

@@ -700,9 +700,8 @@ public class InboundPurchaseService extends BaseService<Inbound> {
         List<InboundItemResponse> inboundItemResponseList = inboundItemMapper.selectByCond(new InboundItemQuery().setIntoId(inboundResponse.getIntoId()));
         //endregion
 
-        //region  自动办理参数为true  已入库编辑
-        //自动办理参数为true
-        if (Constant.FlgHandleSetting.TRUE.getValue().equals(inboundResponse.getFlgHandleSetting())) {
+        //region  已入库作废
+        if (Constant.IntoStatus.YIRUKU.getName().equals(inboundResponse.getIntoStatus())) {
 
             //region 退账
             if (inboundResponse.getReceivableId() != null) {
@@ -795,16 +794,14 @@ public class InboundPurchaseService extends BaseService<Inbound> {
             map.put("delIntoDetail", inboundItemResponseList);
             inventoryService.operatingInventoryInformation(map);
             //endregion
-        }
-        else{
+        } else {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_INTO.getMessage());
         }
         //endregion
 
-        //region 自动办理参数false  入库中编辑
-        //自动办理标识为false 并且 自动办理参数为false  入库中
-        if (!inboundResponse.getFlgAutoHandle() && Constant.FlgHandleSetting.FALSE.getValue().equals(inboundResponse.getFlgHandleSetting())) {
-
+        //region 入库中、待入库作废
+        if (Constant.IntoStatus.RUKUZHONG.getName().equals(inboundResponse.getIntoStatus()) ||
+                Constant.IntoStatus.DAIRUKU.getName().equals(inboundResponse.getIntoStatus())) {
             //region 修改明细
             for (InboundItemResponse inboundItemResponse : inboundItemResponseList) {
                 //region 编辑明细 赋值
@@ -875,8 +872,7 @@ public class InboundPurchaseService extends BaseService<Inbound> {
             }
 
             //endregion
-        }
-        else{
+        } else {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_INTO.getMessage());
         }
         //endregion

+ 7 - 10
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundOtherService.java

@@ -461,9 +461,8 @@ public class OutboundOtherService extends BaseService<Outbound> {
         List<OutboundItemResponse> outboundItemResponseList = outboundItemMapper.selectByCond(new OutboundItemQuery().setOutId(outboundResponse.getOutId()));
         //endregion
 
-        //region  自动办理参数为true  已出库编辑
-        //自动办理参数为true
-        if (Constant.FlgHandleSetting.TRUE.getValue().equals(outboundResponse.getFlgHandleSetting())) {
+        //region  已出库状态作废
+        if (Constant.OutStatus.YICHUKU.getName().equals(outboundResponse.getOutStatus())) {
 
             //region 修改明细
             for (OutboundItemResponse outboundItemResponse : outboundItemResponseList) {
@@ -501,15 +500,14 @@ public class OutboundOtherService extends BaseService<Outbound> {
             map.put("delOutDetail", outboundItemResponseList);
             inventoryService.operatingInventoryInformation(map);
             //endregion
-        }
-        else{
+        } else {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
         }
         //endregion
 
-        //region 自动办理参数false  出库中编辑
-        //自动办理标识为false 并且 自动办理参数为false  出库中
-        if (!outboundResponse.getFlgAutoHandle() && Constant.FlgHandleSetting.FALSE.getValue().equals(outboundResponse.getFlgHandleSetting())) {
+        //region 出库中、待出库状态作废
+        if (Constant.OutStatus.CHUKUZHONG.getName().equals(outboundResponse.getOutStatus()) ||
+                Constant.OutStatus.DAICHUKU.getName().equals(outboundResponse.getOutStatus())) {
             //region 修改明细
             for (OutboundItemResponse outboundItemResponse : outboundItemResponseList) {
                 //赋值
@@ -537,8 +535,7 @@ public class OutboundOtherService extends BaseService<Outbound> {
                     new UpdateWrapper<Outbound>().lambda().eq(Outbound::getOutId, UUID.fromString(outbound.getOutId()))
             );
             //endregion
-        }
-        else{
+        } else {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
         }
         //endregion

+ 5 - 6
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleOrderService.java

@@ -873,9 +873,8 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
 
         //endregion
 
-        //region  自动办理参数为true  已入库作废
-        //自动办理参数为true
-        if (Constant.FlgHandleSetting.TRUE.getValue().equals(outboundResponse.getFlgHandleSetting())) {
+        //region 已出库状态作废
+        if (Constant.OutStatus.YICHUKU.getName().equals(outboundResponse.getOutStatus())) {
             //region 应收反记账
             if (outboundResponse.getReceivableId() != null) {
                 accountService.reverseReceivable(outboundResponse.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
@@ -979,9 +978,9 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
         }
         //endregion
 
-        //region 自动办理参数false  入库中作废
-        //自动办理标识为false 并且 自动办理参数为false  入库中
-        if (!outboundResponse.getFlgAutoHandle() && Constant.FlgHandleSetting.FALSE.getValue().equals(outboundResponse.getFlgHandleSetting())) {
+        //region 出库中、待出库状态作废
+        if (Constant.OutStatus.CHUKUZHONG.getName().equals(outboundResponse.getOutStatus()) ||
+                Constant.OutStatus.DAICHUKU.getName().equals(outboundResponse.getOutStatus())) {
             //region 修改明细
             for (OutboundItemResponse outboundItemResponse : outboundItemResponseList) {
                 //region 修改明细

+ 5 - 5
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleReturnService.java

@@ -713,9 +713,9 @@ public class OutboundSaleReturnService extends BaseService<Outbound> {
         List<OutboundItemResponse> outboundItemResponseList = outboundItemMapper.selectByCond(new OutboundItemQuery().setOutId(outboundResponse.getOutId()));
         //endregion
 
-        //region  自动办理参数为true  已出库编辑
+        //region   已出库状态作废
         //自动办理参数为true
-        if (Constant.FlgHandleSetting.TRUE.getValue().equals(outboundResponse.getFlgHandleSetting())) {
+        if (Constant.OutStatus.YICHUKU.getName().equals(outboundResponse.getOutStatus())) {
             //region 退账
             if (outboundResponse.getReceivableId() != null) {
                 accountService.reverseReceivable(outboundResponse.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
@@ -770,10 +770,10 @@ public class OutboundSaleReturnService extends BaseService<Outbound> {
         }
         //endregion
 
-        //region 自动办理参数false  出库中编辑
+        //region  出库中、待出库状态作废
         //自动办理标识为false 并且 自动办理参数为false  出库中
-        if (!outboundResponse.getFlgAutoHandle() && Constant.FlgHandleSetting.FALSE.getValue().equals(outboundResponse.getFlgHandleSetting())) {
-
+        if (Constant.OutStatus.CHUKUZHONG.getName().equals(outboundResponse.getOutStatus()) ||
+                Constant.OutStatus.DAICHUKU.getName().equals(outboundResponse.getOutStatus()))  {
             //region  回滚原总单和明细信息(订单,出库单)
             List<OutboundItemVO> outboundItemVOList = outboundItemConvert.convertResListToVOList(outboundItemResponseList);
             this.rollBackTotalAndDetail(outboundItemVOList);