|
|
@@ -111,7 +111,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
private OutCommon outCommon;
|
|
|
|
|
|
@Autowired
|
|
|
- private InboundMapper inboundMapper;
|
|
|
+ private InboundMapper inboundMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private InboundConvert inboundConvert;
|
|
|
@@ -123,127 +123,132 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
private InboundItemConvert inboundItemConvert;
|
|
|
|
|
|
/**
|
|
|
- * @desc : 删除外协品生产外协入库单
|
|
|
- * @date : 2024/5/10 10:31
|
|
|
+ * @desc : 删除外协品生产外协入库单
|
|
|
+ * @date : 2024/5/10 10:31
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
|
- public void deleteOutsideGoodsInto(OutboundVO outboundVO,List<OutboundItemVO> outboundItemVOList){
|
|
|
- //根据出库单id分组
|
|
|
- Map<String, List<OutboundItemVO>> outboundItemVOMap = outboundItemVOList.stream().collect(Collectors.groupingBy(OutboundItemVO::getOutId));
|
|
|
- for (String str : outboundItemVOMap.keySet()) {
|
|
|
- InboundResponse inboundResponse = inboundMapper.selectByFromId(str);
|
|
|
- // 退账
|
|
|
- if (inboundResponse.getReceivableId() != null) {
|
|
|
- accountService.reversePayable(inboundResponse.getIntoId(), Constant.InventoryDocCode.INTOBOUND.getTableName());
|
|
|
+ public void deleteOutsideGoodsInto(OutboundVO outboundVO, List<OutboundItemVO> outboundItemVOList) {
|
|
|
+ if (outboundItemVOList != null && outboundItemVOList.size() > 0) {
|
|
|
+ //根据出库单id分组
|
|
|
+ Map<String, List<OutboundItemVO>> outboundItemVOMap = outboundItemVOList.stream().collect(Collectors.groupingBy(OutboundItemVO::getOutId));
|
|
|
+ for (String str : outboundItemVOMap.keySet()) {
|
|
|
+ InboundResponse inboundResponse = inboundMapper.selectByFromId(str);
|
|
|
+ // 退账
|
|
|
+ if (inboundResponse.getReceivableId() != null) {
|
|
|
+ accountService.reversePayable(inboundResponse.getIntoId(), Constant.InventoryDocCode.INTOBOUND.getTableName());
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ //删除外协入库单
|
|
|
+ //外协入库总单
|
|
|
+ inboundMapper.deleteByFromId(outboundItemVOList.get(0).getOutId());
|
|
|
+ //外协入库明细
|
|
|
+ inboundItemMapper.deleteByFromId(outboundItemVOList.get(0).getOutId());
|
|
|
}
|
|
|
|
|
|
- //删除外协入库单
|
|
|
- //外协入库总单
|
|
|
- inboundMapper.deleteByFromId(outboundItemVOList.get(0).getOutId());
|
|
|
- //外协入库明细
|
|
|
- inboundItemMapper.deleteByFromId(outboundItemVOList.get(0).getOutId());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 新建外协品生产外协入库单
|
|
|
- * @date : 2024/5/10 10:31
|
|
|
+ * @desc : 新建外协品生产外协入库单
|
|
|
+ * @date : 2024/5/10 10:31
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
|
- public void insertOutsideGoodsInto(OutboundVO outboundVO,List<OutboundItemVO> outboundItemVOList){
|
|
|
- Map<String, List<OutboundItemVO>> outboundItemVOMap = outboundItemVOList.stream().collect(Collectors.groupingBy(OutboundItemVO::getSkuId));
|
|
|
- for (String str : outboundItemVOMap.keySet()) {
|
|
|
- //提取分组后的明细
|
|
|
- List<OutboundItemVO> outboundItemVOListGroup = outboundItemVOMap.get(str);
|
|
|
-
|
|
|
- //region 新建总单
|
|
|
- //已入库金额
|
|
|
- BigDecimal sumIntoAmt = outboundItemVOListGroup.stream().map(OutboundItemVO::getOutAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
- //已入库数量
|
|
|
- BigDecimal sumIntoQty= outboundItemVOListGroup.stream().map(OutboundItemVO::getOutQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
- //总单实体
|
|
|
- InboundVO inboundVO = new InboundVO();
|
|
|
- //获取 id/单号
|
|
|
- Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.OUTSOURCED.getName(), false);
|
|
|
- inboundVO.setIntoId(codeMap.get("outId").toString()).
|
|
|
- setIntoNo(codeMap.get("outNote").toString());
|
|
|
- //入库类型
|
|
|
- inboundVO.setIntoType(Constant.IntoType.OUTSOURCED.getName());
|
|
|
- //已入库
|
|
|
- inboundVO.setIntoStatus(Constant.IntoStatus.YIRUKU.getName());
|
|
|
- //供应商
|
|
|
- inboundVO.setSupId(outboundItemVOListGroup.get(0).getSupId());
|
|
|
- //入库状态等于已入库
|
|
|
- inboundVO.setIntoQty(sumIntoAmt)
|
|
|
- .setIntoAmt(sumIntoQty)
|
|
|
- .setIntoingQty(BigDecimal.ZERO)
|
|
|
- .setIntoingAmt(BigDecimal.ZERO);
|
|
|
- //来源id
|
|
|
- inboundVO.setFromId(outboundItemVOListGroup.get(0).getFromId());
|
|
|
- //来源单号
|
|
|
- inboundVO.setFromNo(outboundVO.getOutNo());
|
|
|
- //部门
|
|
|
- inboundVO.setOrgId(outboundVO.getOrgId());
|
|
|
- //员工
|
|
|
- inboundVO.setStaffId(outboundVO.getStaffId());
|
|
|
- //入库日期
|
|
|
- inboundVO.setIntoDate(LocalDate.now());
|
|
|
- //制单人
|
|
|
- inboundVO.setMakeStaff(outboundVO.getMakeStaff());
|
|
|
- //公司
|
|
|
- inboundVO.setCpId(outboundVO.getCpId());
|
|
|
- //实体转换
|
|
|
- Inbound inbound = inboundConvert.convertToPo(inboundVO);
|
|
|
- inboundMapper.insert(inbound);
|
|
|
- //endregion
|
|
|
-
|
|
|
- //region 明细
|
|
|
- Integer count = 0;
|
|
|
- for (OutboundItemVO outboundItemVO : outboundItemVOListGroup) {
|
|
|
- InboundItemVO inboundItemVO = new InboundItemVO();
|
|
|
- //总单id
|
|
|
- inboundItemVO.setIntoId(inboundVO.getIntoId());
|
|
|
+ public void insertOutsideGoodsInto(OutboundVO outboundVO, List<OutboundItemVO> outboundItemVOList) {
|
|
|
+ if (outboundItemVOList != null && outboundItemVOList.size() > 0) {
|
|
|
+ Map<String, List<OutboundItemVO>> outboundItemVOMap = outboundItemVOList.stream().collect(Collectors.groupingBy(OutboundItemVO::getSkuId));
|
|
|
+ for (String str : outboundItemVOMap.keySet()) {
|
|
|
+ //提取分组后的明细
|
|
|
+ List<OutboundItemVO> outboundItemVOListGroup = outboundItemVOMap.get(str);
|
|
|
+
|
|
|
+ //region 新建总单
|
|
|
+ //已入库金额
|
|
|
+ BigDecimal sumIntoAmt = outboundItemVOListGroup.stream().map(OutboundItemVO::getOutAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //已入库数量
|
|
|
+ BigDecimal sumIntoQty = outboundItemVOListGroup.stream().map(OutboundItemVO::getOutQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //总单实体
|
|
|
+ InboundVO inboundVO = new InboundVO();
|
|
|
+ //获取 id/单号
|
|
|
+ Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.OUTSOURCED.getName(), false);
|
|
|
+ inboundVO.setIntoId(codeMap.get("outId").toString()).
|
|
|
+ setIntoNo(codeMap.get("outNote").toString());
|
|
|
//入库类型
|
|
|
- inboundItemVO.setIntoType(inboundVO.getIntoType());
|
|
|
- //入库状态等于已入库 更新合计入库数量/金额 = 入库中数量/入库中金额
|
|
|
- inboundItemVO
|
|
|
- .setIntoQty(outboundItemVO.getOutQty())
|
|
|
- .setIntoAmt(outboundItemVO.getOutQty())
|
|
|
+ inboundVO.setIntoType(Constant.IntoType.OUTSOURCED.getName());
|
|
|
+ //已入库
|
|
|
+ inboundVO.setIntoStatus(Constant.IntoStatus.YIRUKU.getName());
|
|
|
+ //供应商
|
|
|
+ inboundVO.setSupId(outboundItemVOListGroup.get(0).getSupId());
|
|
|
+ //入库状态等于已入库
|
|
|
+ inboundVO.setIntoQty(sumIntoAmt)
|
|
|
+ .setIntoAmt(sumIntoQty)
|
|
|
.setIntoingQty(BigDecimal.ZERO)
|
|
|
- .setIntoingAmt(BigDecimal.ZERO)
|
|
|
- .setCostPrice(outboundItemVO.getPriceOut())
|
|
|
- .setCostAmt(outboundItemVO.getOutQty().multiply(outboundItemVO.getPriceOut()).setScale(2, BigDecimal.ROUND_HALF_UP))
|
|
|
- ;
|
|
|
- //入库状态
|
|
|
- inboundItemVO.setIntoStatus(inboundVO.getIntoStatus());
|
|
|
- //商品顺序
|
|
|
- inboundItemVO.setItemIndex(count);
|
|
|
- //箱(入库中)
|
|
|
- inboundItemVO.setIntoingBox(outboundItemVO.getOutingBox());
|
|
|
- //片(入库中)
|
|
|
- inboundItemVO.setIntoingPiece(outboundItemVO.getOutingPiece());
|
|
|
- //箱(已入库)
|
|
|
- inboundItemVO.setIntoBox(outboundItemVO.getOutBox());
|
|
|
- //片(已入库)
|
|
|
- inboundItemVO.setIntoPiece(outboundItemVO.getOutPiece());
|
|
|
- //入库仓库
|
|
|
- inboundItemVO.setWhId(outboundItemVO.getWhId());
|
|
|
- //企业ID
|
|
|
- inboundItemVO.setCpId(outboundItemVO.getCpId());
|
|
|
+ .setIntoingAmt(BigDecimal.ZERO);
|
|
|
+ //来源id
|
|
|
+ inboundVO.setFromId(outboundItemVOListGroup.get(0).getFromId());
|
|
|
+ //来源单号
|
|
|
+ inboundVO.setFromNo(outboundVO.getOutNo());
|
|
|
+ //部门
|
|
|
+ inboundVO.setOrgId(outboundVO.getOrgId());
|
|
|
+ //员工
|
|
|
+ inboundVO.setStaffId(outboundVO.getStaffId());
|
|
|
+ //入库日期
|
|
|
+ inboundVO.setIntoDate(LocalDate.now());
|
|
|
+ //制单人
|
|
|
+ inboundVO.setMakeStaff(outboundVO.getMakeStaff());
|
|
|
+ //公司
|
|
|
+ inboundVO.setCpId(outboundVO.getCpId());
|
|
|
//实体转换
|
|
|
- InboundItem inboundItem = inboundItemConvert.convertToPo(inboundItemVO);
|
|
|
- inboundItemMapper.insert(inboundItem);
|
|
|
- //用来填写商品顺序
|
|
|
- count++;
|
|
|
- inboundItemVO.setItemId(inboundItem.getItemId());
|
|
|
- }
|
|
|
- //endregion
|
|
|
+ Inbound inbound = inboundConvert.convertToPo(inboundVO);
|
|
|
+ inboundMapper.insert(inbound);
|
|
|
+ //endregion
|
|
|
|
|
|
- //region 入账
|
|
|
- accountService.accPayable(inboundVO.getIntoId(), Constant.InventoryDocCode.INTOBOUND.getTableName());
|
|
|
- //endregion
|
|
|
+ //region 明细
|
|
|
+ Integer count = 0;
|
|
|
+ for (OutboundItemVO outboundItemVO : outboundItemVOListGroup) {
|
|
|
+ InboundItemVO inboundItemVO = new InboundItemVO();
|
|
|
+ //总单id
|
|
|
+ inboundItemVO.setIntoId(inboundVO.getIntoId());
|
|
|
+ //入库类型
|
|
|
+ inboundItemVO.setIntoType(inboundVO.getIntoType());
|
|
|
+ //入库状态等于已入库 更新合计入库数量/金额 = 入库中数量/入库中金额
|
|
|
+ inboundItemVO
|
|
|
+ .setIntoQty(outboundItemVO.getOutQty())
|
|
|
+ .setIntoAmt(outboundItemVO.getOutQty())
|
|
|
+ .setIntoingQty(BigDecimal.ZERO)
|
|
|
+ .setIntoingAmt(BigDecimal.ZERO)
|
|
|
+ .setCostPrice(outboundItemVO.getPriceOut())
|
|
|
+ .setCostAmt(outboundItemVO.getOutQty().multiply(outboundItemVO.getPriceOut()).setScale(2, BigDecimal.ROUND_HALF_UP))
|
|
|
+ ;
|
|
|
+ //入库状态
|
|
|
+ inboundItemVO.setIntoStatus(inboundVO.getIntoStatus());
|
|
|
+ //商品顺序
|
|
|
+ inboundItemVO.setItemIndex(count);
|
|
|
+ //箱(入库中)
|
|
|
+ inboundItemVO.setIntoingBox(outboundItemVO.getOutingBox());
|
|
|
+ //片(入库中)
|
|
|
+ inboundItemVO.setIntoingPiece(outboundItemVO.getOutingPiece());
|
|
|
+ //箱(已入库)
|
|
|
+ inboundItemVO.setIntoBox(outboundItemVO.getOutBox());
|
|
|
+ //片(已入库)
|
|
|
+ inboundItemVO.setIntoPiece(outboundItemVO.getOutPiece());
|
|
|
+ //入库仓库
|
|
|
+ inboundItemVO.setWhId(outboundItemVO.getWhId());
|
|
|
+ //企业ID
|
|
|
+ inboundItemVO.setCpId(outboundItemVO.getCpId());
|
|
|
+ //实体转换
|
|
|
+ InboundItem inboundItem = inboundItemConvert.convertToPo(inboundItemVO);
|
|
|
+ inboundItemMapper.insert(inboundItem);
|
|
|
+ //用来填写商品顺序
|
|
|
+ count++;
|
|
|
+ inboundItemVO.setItemId(inboundItem.getItemId());
|
|
|
+ }
|
|
|
+ //endregion
|
|
|
+
|
|
|
+ //region 入账
|
|
|
+ accountService.accPayable(inboundVO.getIntoId(), Constant.InventoryDocCode.INTOBOUND.getTableName());
|
|
|
+ //endregion
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -433,21 +438,21 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
//endregion
|
|
|
|
|
|
//region 外协品+库存
|
|
|
- if(Constant.OutStatus.YICHUKU.getName().equals(outboundVO.getOutStatus())){
|
|
|
+ if (Constant.OutStatus.YICHUKU.getName().equals(outboundVO.getOutStatus())) {
|
|
|
//region 外协品新建外协入库单
|
|
|
//筛选出skuId为空的 走外协品逻辑
|
|
|
List<OutboundItemVO> outsideGoods = outboundVO.getItemList().stream().filter(it -> it.getSkuId() == null).collect(Collectors.toList());
|
|
|
//删除外协品生产外协入库单
|
|
|
- this.deleteOutsideGoodsInto(outboundVO,outsideGoods);
|
|
|
+ this.deleteOutsideGoodsInto(outboundVO, outsideGoods);
|
|
|
//新建外协品生产外协入库单
|
|
|
- this.insertOutsideGoodsInto(outboundVO,outsideGoods);
|
|
|
+ this.insertOutsideGoodsInto(outboundVO, outsideGoods);
|
|
|
//endregion
|
|
|
|
|
|
//region 库存
|
|
|
//筛选出skuId不为空的 走库存
|
|
|
List<OutboundItemVO> invList = outboundVO.getItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
|
|
|
Map<String, Object> invMap = new HashMap<>();
|
|
|
- invMap.put("outDetail",invList);
|
|
|
+ invMap.put("outDetail", invList);
|
|
|
inventoryService.operatingInventoryInformation(invMap);
|
|
|
//endregion
|
|
|
}
|
|
|
@@ -476,7 +481,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
for (OutboundItemVO outboundItemVO : outboundVO.getItemList()) {
|
|
|
OutboundItem outboundItem = new OutboundItem();
|
|
|
outboundItem.setItemId(outboundItemVO.getItemId());
|
|
|
- if(outboundItemVO.getRemarks() != null || outboundItemVO.getRemarks()!=" "){
|
|
|
+ if (outboundItemVO.getRemarks() != null || outboundItemVO.getRemarks() != " ") {
|
|
|
outboundItem.setRemarks(outboundItemVO.getRemarks());
|
|
|
outboundItemMapper.update(outboundItem,
|
|
|
new UpdateWrapper<OutboundItem>().lambda()
|
|
|
@@ -523,7 +528,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
outboundItemVO.setOutAmt(outboundItemVO.getOutingAmt());
|
|
|
outboundItemVO.setAddOrEditFlag(false);
|
|
|
//endregion
|
|
|
-
|
|
|
+
|
|
|
OutboundItem outboundItem = new OutboundItem();
|
|
|
outboundItem.setItemId(outboundItemVO.getItemId());
|
|
|
outboundItem.setOutQty(outboundItemVO.getOutingQty());
|
|
|
@@ -679,12 +684,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
//筛选出skuId为空的 走外协品逻辑
|
|
|
List<OutboundItemVO> outsideGoods = outboundVO.getItemList().stream().filter(it -> it.getSkuId() == null).collect(Collectors.toList());
|
|
|
//删除外协品生产外协入库单
|
|
|
- this.deleteOutsideGoodsInto(outboundVO,outsideGoods);
|
|
|
+ this.deleteOutsideGoodsInto(outboundVO, outsideGoods);
|
|
|
//新建外协品生产外协入库单
|
|
|
- this.insertOutsideGoodsInto(outboundVO,outsideGoods);
|
|
|
+ this.insertOutsideGoodsInto(outboundVO, outsideGoods);
|
|
|
List<OutboundItemVO> delOutsideGoods = outboundVO.getDeleteItemList().stream().filter(it -> it.getSkuId() == null).collect(Collectors.toList());
|
|
|
//删除外协品生产外协入库单
|
|
|
- this.deleteOutsideGoodsInto(outboundVO,delOutsideGoods);
|
|
|
+ this.deleteOutsideGoodsInto(outboundVO, delOutsideGoods);
|
|
|
//endregion
|
|
|
|
|
|
//region 修改库存
|
|
|
@@ -693,11 +698,10 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
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);
|
|
|
+ invMap.put("delOutDetail", invDelList);
|
|
|
inventoryService.operatingInventoryInformation(invMap);
|
|
|
//endregion
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -839,8 +843,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -953,7 +956,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
List<OutboundItemResponse> outsideGoods = outboundItemResponseList.stream().filter(it -> it.getSkuId() == null).collect(Collectors.toList());
|
|
|
List<OutboundItemVO> outsideGoodsVOList = outboundItemConvert.convertResListToVOList(outsideGoods);
|
|
|
//删除外协品生产外协入库单
|
|
|
- this.deleteOutsideGoodsInto(outboundVO,outsideGoodsVOList);
|
|
|
+ this.deleteOutsideGoodsInto(outboundVO, outsideGoodsVOList);
|
|
|
//endregion
|
|
|
|
|
|
//region 修改库存
|
|
|
@@ -963,8 +966,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
map.put("delOutDetail", invList);
|
|
|
inventoryService.operatingInventoryInformation(map);
|
|
|
//endregion
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -1042,8 +1044,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -1283,12 +1284,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
//筛选出skuId为空的 走外协品逻辑
|
|
|
List<OutboundItemVO> outsideGoods = outboundVO.getItemList().stream().filter(it -> it.getSkuId() == null).collect(Collectors.toList());
|
|
|
//删除外协品生产外协入库单
|
|
|
- this.deleteOutsideGoodsInto(outboundVO,outsideGoods);
|
|
|
+ this.deleteOutsideGoodsInto(outboundVO, outsideGoods);
|
|
|
//新建外协品生产外协入库单
|
|
|
- this.insertOutsideGoodsInto(outboundVO,outsideGoods);
|
|
|
+ this.insertOutsideGoodsInto(outboundVO, outsideGoods);
|
|
|
List<OutboundItemVO> delOutsideGoods = outboundVO.getDeleteItemList().stream().filter(it -> it.getSkuId() == null).collect(Collectors.toList());
|
|
|
//删除外协品生产外协入库单
|
|
|
- this.deleteOutsideGoodsInto(outboundVO,delOutsideGoods);
|
|
|
+ this.deleteOutsideGoodsInto(outboundVO, delOutsideGoods);
|
|
|
//endregion
|
|
|
|
|
|
//region 调用库存
|
|
|
@@ -1297,7 +1298,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
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);
|
|
|
+ map.put("delOutDetail", invDelList);
|
|
|
inventoryService.operatingInventoryInformation(map);
|
|
|
//endregion
|
|
|
return ResponseResultUtil.success(outboundVO);
|
|
|
@@ -1426,7 +1427,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
List<OutboundItemResponse> outsideGoods = outboundItemResponseList.stream().filter(it -> it.getSkuId() == null).collect(Collectors.toList());
|
|
|
List<OutboundItemVO> outsideGoodsVOList = outboundItemConvert.convertResListToVOList(outsideGoods);
|
|
|
//删除外协品生产外协入库单
|
|
|
- this.deleteOutsideGoodsInto(outsideGoodVO,outsideGoodsVOList);
|
|
|
+ this.deleteOutsideGoodsInto(outsideGoodVO, outsideGoodsVOList);
|
|
|
//endregion
|
|
|
|
|
|
//region 调用库存
|
|
|
@@ -1480,17 +1481,17 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
//入库中+已入库 小于 总数
|
|
|
if (intoingQty.add(intoQty).compareTo(sumQty) < 0) {
|
|
|
//入库中
|
|
|
- outStatus =Constant.OutStatus.CHUKUZHONG.getName();
|
|
|
+ outStatus = Constant.OutStatus.CHUKUZHONG.getName();
|
|
|
}
|
|
|
//已入库数量=0 入库中数量=0
|
|
|
else if (intoQty.compareTo(BigDecimal.ZERO) == 0 && intoingQty.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
//待入库
|
|
|
- outStatus = Constant.OutStatus.DAICHUKU.getName();
|
|
|
+ outStatus = Constant.OutStatus.DAICHUKU.getName();
|
|
|
}
|
|
|
//入库中+已入库 等于 总数
|
|
|
else if (intoingQty.add(intoQty).compareTo(sumQty) == 0) {
|
|
|
//已入库
|
|
|
- outStatus = Constant.OutStatus.YICHUKU.getName();
|
|
|
+ outStatus = Constant.OutStatus.YICHUKU.getName();
|
|
|
}
|
|
|
return outStatus;
|
|
|
}
|
|
|
@@ -1587,7 +1588,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
OutboundResponse outboundResponse = outboundMapper.selectByIdForReturn(id);
|
|
|
List<OutboundItemResponse> outboundItemList = outboundItemMapper.selectByCondForReturn(new OutboundItemQuery().setOutId(id));
|
|
|
|
|
|
- if(outboundItemList != null && outboundItemList.size() > 0){
|
|
|
+ if (outboundItemList != null && outboundItemList.size() > 0) {
|
|
|
// 求和
|
|
|
OutboundItemResponse sumEntity = outboundItemList.stream().reduce((x, y) -> {
|
|
|
OutboundItemResponse item = new OutboundItemResponse();
|