Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

dongke 1 год назад
Родитель
Сommit
ee5427794c

+ 11 - 0
src/main/java/com/dk/mdm/controller/common/CommonController.java

@@ -447,6 +447,17 @@ public class CommonController extends BaseController<Map<String, Object>> {
     public ResponseResultVO<List<Map<String, Object>>> getGoodsCategoryNoPage(@RequestBody Map<String, Object> param) {
     public ResponseResultVO<List<Map<String, Object>>> getGoodsCategoryNoPage(@RequestBody Map<String, Object> param) {
         return commonService.getGoodsCategoryNoPage(param);
         return commonService.getGoodsCategoryNoPage(param);
     }
     }
+
+    /**
+     * @desc :  获取商品品牌
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"get_goods_brand_no_page"})
+    public ResponseResultVO<List<Map<String, Object>>> goodsBrandListNoPage(@RequestBody Map<String, Object> param) {
+        return commonService.goodsBrandListNoPage(param);
+    }
     /**
     /**
      * @desc :  商品种类查询
      * @desc :  商品种类查询
      * @author : 王英杰
      * @author : 王英杰

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

@@ -90,6 +90,6 @@ public interface InboundItemMapper extends BaseMapper<InboundItem>{
      * @date   : 2024/5/10 10:39
      * @date   : 2024/5/10 10:39
      * @author : 寇珊珊
      * @author : 寇珊珊
      */
      */
-    int deleteByFromId(@Param("fromId") String fromId);
+    int deleteItemByFromId(@Param("fromId") String fromId);
 }
 }
 
 

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

@@ -607,7 +607,7 @@
 
 
 
 
     <!--根据来源id删除单据-->
     <!--根据来源id删除单据-->
-    <delete id="deleteByFromId">
+    <delete id="deleteItemByFromId">
         DELETE FROM dkic_b.t_psi_inbound_item
         DELETE FROM dkic_b.t_psi_inbound_item
         WHERE from_id = #{fromId}::uuid
         WHERE from_id = #{fromId}::uuid
     </delete>
     </delete>

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

@@ -71,6 +71,10 @@
             <if test="whId != null and whId != ''">
             <if test="whId != null and whId != ''">
                 AND tpi.wh_id = #{whId}::UUID
                 AND tpi.wh_id = #{whId}::UUID
             </if>
             </if>
+            <if test="whIds != null and whIds.size()>0">
+                AND tpi.wh_id =
+                any(#{whIds, typeHandler=UuidListTypeHandler})
+            </if>
             <if test="skuId != null and skuId != ''">
             <if test="skuId != null and skuId != ''">
                 AND tpi.sku_id = #{skuId}
                 AND tpi.sku_id = #{skuId}
             </if>
             </if>
@@ -104,6 +108,9 @@
             <if test="categoryId != null and categoryId != ''">
             <if test="categoryId != null and categoryId != ''">
                 AND tmgs.category_id = #{categoryId}::UUID
                 AND tmgs.category_id = #{categoryId}::UUID
             </if>
             </if>
+            <if test="brandId != null and brandId != ''">
+                AND tmgs.brand_id = #{brandId}::UUID
+            </if>
             <if  test="searchText != null">
             <if  test="searchText != null">
                 AND (tmgs.sku_code  like concat('%', my_ex.likequery(#{searchText}) , '%')
                 AND (tmgs.sku_code  like concat('%', my_ex.likequery(#{searchText}) , '%')
                 OR  tmgs.sku_name like concat('%', my_ex.likequery(#{searchText}) , '%')
                 OR  tmgs.sku_name like concat('%', my_ex.likequery(#{searchText}) , '%')

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

@@ -18,6 +18,7 @@ import lombok.experimental.Accessors;
 import java.io.Serializable;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
+import java.util.List;
 
 
 /**
 /**
  *  库存明细
  *  库存明细
@@ -36,6 +37,13 @@ public class InventoryQuery extends PageInfo<InventoryQuery>{
     @ApiModelProperty(value = "库存ID")
     @ApiModelProperty(value = "库存ID")
     @TableField(typeHandler = UuidTypeHandler.class)
     @TableField(typeHandler = UuidTypeHandler.class)
     private String invId;
     private String invId;
+
+    /**
+     * @desc   : 库存IDlist
+     * @date   : 2024/3/2 9:27
+     */
+    @ApiModelProperty(value = "库存ID")
+    private List<String> whIds;
     /**
     /**
      * 商品种类
      * 商品种类
      */
      */
@@ -45,6 +53,15 @@ public class InventoryQuery extends PageInfo<InventoryQuery>{
     private String categoryId;
     private String categoryId;
 
 
     /**
     /**
+     * 商品品牌
+     */
+    @Excel(name = "商品品牌")
+    @ApiModelProperty(value = "商品品牌")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String brandId;
+
+
+    /**
      * 仓库ID
      * 仓库ID
      */
      */
     @ApiModelProperty(value = "仓库ID")
     @ApiModelProperty(value = "仓库ID")

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

@@ -540,6 +540,17 @@ public class CommonService extends BaseService<Map<String, Object>> {
     }
     }
 
 
     /**
     /**
+     * @desc : 获取商品品牌(不带分页分页)
+     * @author : 姜永辉
+     * @date : 2024/3/1 9:20
+     */
+    public ResponseResultVO<List<Map<String, Object>>> goodsBrandListNoPage(Map<String, Object> param) {
+        // 获取公司
+        List<Map<String, Object>> list = commonMapper.getGoodsBrand(param);
+        return ResponseResultUtil.success(list);
+    }
+
+    /**
      * @desc : 获取商品种类(分页)
      * @desc : 获取商品种类(分页)
      * @author : 王英杰
      * @author : 王英杰
      * @date : 2024/3/1 9:20
      * @date : 2024/3/1 9:20

+ 32 - 23
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleOrderService.java

@@ -135,7 +135,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
             for (String str : outboundItemVOMap.keySet()) {
             for (String str : outboundItemVOMap.keySet()) {
                 InboundResponse inboundResponse = inboundMapper.selectByFromId(str);
                 InboundResponse inboundResponse = inboundMapper.selectByFromId(str);
                 // 退账
                 // 退账
-                if (inboundResponse.getReceivableId() != null) {
+                if (inboundResponse != null && inboundResponse.getReceivableId() != null) {
                     accountService.reversePayable(inboundResponse.getIntoId(), Constant.InventoryDocCode.INTOBOUND.getTableName());
                     accountService.reversePayable(inboundResponse.getIntoId(), Constant.InventoryDocCode.INTOBOUND.getTableName());
                 }
                 }
             }
             }
@@ -144,7 +144,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
             //外协入库总单
             //外协入库总单
             inboundMapper.deleteByFromId(outboundItemVOList.get(0).getOutId());
             inboundMapper.deleteByFromId(outboundItemVOList.get(0).getOutId());
             //外协入库明细
             //外协入库明细
-            inboundItemMapper.deleteByFromId(outboundItemVOList.get(0).getOutId());
+            inboundItemMapper.deleteItemByFromId(outboundItemVOList.get(0).getOutId());
         }
         }
 
 
     }
     }
@@ -157,7 +157,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
     @Transactional(rollbackFor = {Exception.class})
     @Transactional(rollbackFor = {Exception.class})
     public void insertOutsideGoodsInto(OutboundVO outboundVO, List<OutboundItemVO> outboundItemVOList) {
     public void insertOutsideGoodsInto(OutboundVO outboundVO, List<OutboundItemVO> outboundItemVOList) {
         if (outboundItemVOList != null && outboundItemVOList.size() > 0) {
         if (outboundItemVOList != null && outboundItemVOList.size() > 0) {
-            Map<String, List<OutboundItemVO>> outboundItemVOMap = outboundItemVOList.stream().collect(Collectors.groupingBy(OutboundItemVO::getSkuId));
+            Map<String, List<OutboundItemVO>> outboundItemVOMap = outboundItemVOList.stream().collect(Collectors.groupingBy(OutboundItemVO::getOutId));
             for (String str : outboundItemVOMap.keySet()) {
             for (String str : outboundItemVOMap.keySet()) {
                 //提取分组后的明细
                 //提取分组后的明细
                 List<OutboundItemVO> outboundItemVOListGroup = outboundItemVOMap.get(str);
                 List<OutboundItemVO> outboundItemVOListGroup = outboundItemVOMap.get(str);
@@ -213,6 +213,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
                     inboundItemVO.setIntoType(inboundVO.getIntoType());
                     inboundItemVO.setIntoType(inboundVO.getIntoType());
                     //入库状态等于已入库 更新合计入库数量/金额 = 入库中数量/入库中金额
                     //入库状态等于已入库 更新合计入库数量/金额 = 入库中数量/入库中金额
                     inboundItemVO
                     inboundItemVO
+                            .setPriceInto(outboundItemVO.getPriceOut())
                             .setIntoQty(outboundItemVO.getOutQty())
                             .setIntoQty(outboundItemVO.getOutQty())
                             .setIntoAmt(outboundItemVO.getOutQty())
                             .setIntoAmt(outboundItemVO.getOutQty())
                             .setIntoingQty(BigDecimal.ZERO)
                             .setIntoingQty(BigDecimal.ZERO)
@@ -451,9 +452,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
             //region 库存
             //region 库存
             //筛选出skuId不为空的 走库存
             //筛选出skuId不为空的 走库存
             List<OutboundItemVO> invList = outboundVO.getItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
             List<OutboundItemVO> invList = outboundVO.getItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
-            Map<String, Object> invMap = new HashMap<>();
-            invMap.put("outDetail", invList);
-            inventoryService.operatingInventoryInformation(invMap);
+            if(invList!=null && invList.size() > 0){
+                Map<String, Object> invMap = new HashMap<>();
+                invMap.put("outDetail", invList);
+                inventoryService.operatingInventoryInformation(invMap);
+            }
+
             //endregion
             //endregion
         }
         }
         //endregion
         //endregion
@@ -696,10 +700,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
                 //筛选出skuId不为空的 走库存
                 //筛选出skuId不为空的 走库存
                 List<OutboundItemVO> invList = outboundVO.getItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
                 List<OutboundItemVO> invList = outboundVO.getItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
                 List<OutboundItemVO> invDelList = outboundVO.getDeleteItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
                 List<OutboundItemVO> invDelList = outboundVO.getDeleteItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
-                Map<String, Object> invMap = new HashMap<>();
-                invMap.put("outDetail", invList);
-                invMap.put("delOutDetail", invDelList);
-                inventoryService.operatingInventoryInformation(invMap);
+                if ((invList != null && invList.size() > 0) || (invDelList != null && invDelList.size() > 0)) {
+                    Map<String, Object> invMap = new HashMap<>();
+                    invMap.put("outDetail", invList);
+                    invMap.put("delOutDetail", invDelList);
+                    inventoryService.operatingInventoryInformation(invMap);
+                }
                 //endregion
                 //endregion
             } else {
             } else {
                 throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
                 throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
@@ -962,9 +968,11 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
             //region  修改库存
             //region  修改库存
             //筛选出skuId不为空的 走库存
             //筛选出skuId不为空的 走库存
             List<OutboundItemResponse> invList = outboundItemResponseList.stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
             List<OutboundItemResponse> invList = outboundItemResponseList.stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
-            Map<String, Object> map = new HashMap<>();
-            map.put("delOutDetail", invList);
-            inventoryService.operatingInventoryInformation(map);
+            if(invList!=null && invList.size()>0) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("delOutDetail", invList);
+                inventoryService.operatingInventoryInformation(map);
+            }
             //endregion
             //endregion
         } else {
         } else {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
@@ -1279,7 +1287,6 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
         accountService.accReceivable(outboundResponse.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
         accountService.accReceivable(outboundResponse.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
         //endregion
         //endregion
 
 
-
         //region 外协品新建外协入库单
         //region 外协品新建外协入库单
         //筛选出skuId为空的 走外协品逻辑
         //筛选出skuId为空的 走外协品逻辑
         List<OutboundItemVO> outsideGoods = outboundVO.getItemList().stream().filter(it -> it.getSkuId() == null).collect(Collectors.toList());
         List<OutboundItemVO> outsideGoods = outboundVO.getItemList().stream().filter(it -> it.getSkuId() == null).collect(Collectors.toList());
@@ -1296,10 +1303,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
         //筛选出skuId不为空的 走库存
         //筛选出skuId不为空的 走库存
         List<OutboundItemVO> invList = outboundVO.getItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
         List<OutboundItemVO> invList = outboundVO.getItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
         List<OutboundItemVO> invDelList = outboundVO.getDeleteItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
         List<OutboundItemVO> invDelList = outboundVO.getDeleteItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
-        Map<String, Object> map = new HashMap<>();
-        map.put("outDetail", invList);
-        map.put("delOutDetail", invDelList);
-        inventoryService.operatingInventoryInformation(map);
+        if ((invList != null && invList.size() > 0) || (invDelList != null && invDelList.size() > 0)) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("outDetail", invList);
+            map.put("delOutDetail", invDelList);
+            inventoryService.operatingInventoryInformation(map);
+        }
         //endregion
         //endregion
         return ResponseResultUtil.success(outboundVO);
         return ResponseResultUtil.success(outboundVO);
     }
     }
@@ -1420,7 +1429,6 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
         }
         }
         //endregion
         //endregion
 
 
-
         //region 外协品新建外协入库单
         //region 外协品新建外协入库单
         //筛选出skuId为空的 走外协品逻辑
         //筛选出skuId为空的 走外协品逻辑
         OutboundVO outsideGoodVO = outboundConvert.convertResToVO(outboundResponse);
         OutboundVO outsideGoodVO = outboundConvert.convertResToVO(outboundResponse);
@@ -1433,11 +1441,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
         //region   调用库存
         //region   调用库存
         //筛选出skuId不为空的 走库存
         //筛选出skuId不为空的 走库存
         List<OutboundItemResponse> invList = outboundItemResponseList.stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
         List<OutboundItemResponse> invList = outboundItemResponseList.stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
-        Map<String, Object> map = new HashMap<>();
-        map.put("delOutDetail", invList);
-        inventoryService.operatingInventoryInformation(map);
+        if(invList!=null && invList.size()>0) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("delOutDetail", invList);
+            inventoryService.operatingInventoryInformation(map);
+        }
         //endregion
         //endregion
-
         return ResponseResultUtil.success();
         return ResponseResultUtil.success();
     }
     }