|
@@ -2732,6 +2732,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /********************************************************************************************需求变更后新业务逻辑*******************************************************************************************/
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* PDA解绑物料并发控制
|
|
* PDA解绑物料并发控制
|
|
*/
|
|
*/
|
|
@@ -2798,6 +2801,85 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
return palletMatchLogService.insertBatch(buildPalletMatchLogList(result, orderList));
|
|
return palletMatchLogService.insertBatch(buildPalletMatchLogList(result, orderList));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 托盘出库回显推荐列表
|
|
|
|
+ * @param orderNos
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<PalletMatchLogDTO> queryPalletMatchInfoList(String orderNos) {
|
|
|
|
+ List<String> orderList = JSONArray.parseArray(orderNos, String.class);
|
|
|
|
+ String order = String.join(",", orderList);
|
|
|
|
+ List<PalletMatchLog> palletMatchLogList = palletMatchLogService.queryPalletMatchLogByOrderNos(order);
|
|
|
|
+ List<BaseLocationInfo> baseLocationInfoList = baseLocationInfoService.selectBaseLocationInfoList(palletMatchLogList.stream().map(PalletMatchLog::getLocationId).collect(Collectors.toList()));
|
|
|
|
+
|
|
|
|
+ return palletMatchLogList.stream().map(item -> {
|
|
|
|
+ PalletMatchLogDTO palletMatchLogDTO = ConvertUtils.sourceToTarget(item, PalletMatchLogDTO.class);
|
|
|
|
+ BaseLocationInfo locationInfo = baseLocationInfoList.stream().filter(baseLocationInfo -> baseLocationInfo.getId().equals(Long.parseLong(item.getLocationId()))).findFirst().orElseThrow(() -> new BaseException("库位信息有误"));
|
|
|
|
+ palletMatchLogDTO.setLocationNo(locationInfo.getLocationNo());
|
|
|
|
+ return palletMatchLogDTO;
|
|
|
|
+ }).collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(PalletMatchLogDTO::getPalletNo))), ArrayList::new));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * PDA理货备货/分拣组盘(不传出库单号)
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
+ public AjaxResult pdaGroupDisk(PdaGroupDiskDTO pdaGroupDiskDTO) {
|
|
|
|
+ GroupDiskConvertDTO groupDiskConvertDTO = buildGroupDiskConvertDTO(pdaGroupDiskDTO);
|
|
|
|
+ String locationId = invLotLocGroupDisk(groupDiskConvertDTO);
|
|
|
|
+ BigDecimal palletTotal = invLotAttService.queryPalletTotal(groupDiskConvertDTO.getPalletTo());
|
|
|
|
+ if (StringUtils.isBlank(groupDiskConvertDTO.getWmsOrderNo())) return AjaxResult.success("组盘成功!托盘数量: " + palletTotal);
|
|
|
|
+ groupDiskConvertDTO.setLocationId(locationId);
|
|
|
|
+ wmsDocOrderGroupDisk(groupDiskConvertDTO);
|
|
|
|
+ return AjaxResult.success("当前托盘备货成功!托盘数量: " + palletTotal);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * PDA反拣组盘
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
+ public AjaxResult pdaReversePickGroupDisk(ReversePickGroupDiskDTO reversePickGroupDiskDTO){
|
|
|
|
+ ReversePickConvertDTO reversePickConvertDTO = buildReversePickConvertDTO(reversePickGroupDiskDTO);
|
|
|
|
+ //判断反拣类型为解绑还是扩容
|
|
|
|
+ BigDecimal qty = judgeReversePickType(reversePickConvertDTO.getSku(), reversePickConvertDTO.getOrderNo());
|
|
|
|
+ //1. 理货备货
|
|
|
|
+ if (CompareUtil.compare(qty, BigDecimal.ZERO) < 0){
|
|
|
|
+ PdaGroupDiskDTO pdaGroupDiskDTO = ConvertUtils.sourceToTarget(reversePickConvertDTO, PdaGroupDiskDTO.class);
|
|
|
|
+ return pdaGroupDisk(pdaGroupDiskDTO);
|
|
|
|
+ }
|
|
|
|
+ //2. 解绑当前物料
|
|
|
|
+ //反拣情况下原托盘为目标解绑托盘 新托盘为目标绑定托盘
|
|
|
|
+ Long locationId = unbindWmsBox(reversePickConvertDTO.getPalletFrom(), reversePickConvertDTO.getPalletTo());
|
|
|
|
+ List<InvLotAtt> invLotAttList = invLotAttService.queryInvLotAtt(reversePickConvertDTO.getPalletFrom(), reversePickConvertDTO.getSn(), reversePickConvertDTO.getOrderNo());
|
|
|
|
+ unbindInvLotLoc(invLotAttList.stream().map(InvLotAtt::getLotnum).collect(Collectors.toList()), locationId, reversePickConvertDTO.getPalletTo(), reversePickConvertDTO.getSku());
|
|
|
|
+ //出库单明细数量解绑
|
|
|
|
+ reversePickUnbindWmsDocOrder(reversePickConvertDTO.getOrderNo(), reversePickConvertDTO.getSku(), reversePickConvertDTO.getQty());
|
|
|
|
+ //删除条码扫描记录
|
|
|
|
+ erpBarcodesService.untieRecordErpBarcodeListAsnSo(reversePickConvertDTO.getErpNo(), null, reversePickConvertDTO.getSn());
|
|
|
|
+ return AjaxResult.success("条码:" + reversePickConvertDTO.getSn() + "与出库单:" + reversePickGroupDiskDTO.getErpNo() + "解绑成功!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * PDA解绑物料
|
|
|
|
+ */
|
|
|
|
+ @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
+ public AjaxResult pdaUnbind(UnbindDTO unbindDTO) {
|
|
|
|
+ InvLotLocId invLotLocId = invLotLocIdService.queryInvLotLocIdByLotnum(unbindDTO.getLotnum());
|
|
|
|
+ Long locationId = unbindWmsBox(unbindDTO.getPalletTo(), unbindDTO.getPalletFrom());
|
|
|
|
+ unbindInvLotLoc(unbindDTO.getLotnum(), locationId, unbindDTO.getPalletFrom(), unbindDTO.getSku());
|
|
|
|
+ if (StringUtils.isBlank(unbindDTO.getErpNo())) return AjaxResult.success("托盘:" + unbindDTO.getPalletTo() + "解绑成功!托盘数量: " + invLotAttService.queryPalletTotal(unbindDTO.getPalletTo()));
|
|
|
|
+ // 删除条码扫描记录
|
|
|
|
+ erpBarcodesService.untieRecordErpBarcodeListAsnSo(unbindDTO.getErpNo(), null, unbindDTO.getSn());
|
|
|
|
+ unbindWmsDocOrder(unbindDTO.getErpNo(), invLotLocId.getQty());
|
|
|
|
+ return AjaxResult.success("托盘:" + unbindDTO.getPalletTo() + "解绑成功!托盘数量: " + invLotAttService.queryPalletTotal(unbindDTO.getPalletTo()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * PDA托盘出库:构建匹配列表
|
|
|
|
+ */
|
|
private List<InvLotAttPalletTotalDTO> buildInventoryMatchList(List<String> orderList, List<PalletMatchLog> palletMatchLogList){
|
|
private List<InvLotAttPalletTotalDTO> buildInventoryMatchList(List<String> orderList, List<PalletMatchLog> palletMatchLogList){
|
|
//根据erp单号获取出库单头列表
|
|
//根据erp单号获取出库单头列表
|
|
List<WmsDocOrderHeader> wmsDocOrderHeaderList = wmsDocOrderHeaderMapper.selectList(Wrappers.<WmsDocOrderHeader>lambdaQuery().in(WmsDocOrderHeader::getSoReference1, orderList).orderByDesc(WmsDocOrderHeader::getCreateTime));
|
|
List<WmsDocOrderHeader> wmsDocOrderHeaderList = wmsDocOrderHeaderMapper.selectList(Wrappers.<WmsDocOrderHeader>lambdaQuery().in(WmsDocOrderHeader::getSoReference1, orderList).orderByDesc(WmsDocOrderHeader::getCreateTime));
|
|
@@ -2839,6 +2921,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * PDA反拣出库:构建匹配列表
|
|
|
|
+ */
|
|
private LinkedList<Object> buildReversePickInventoryMatchList(List<String> orderList, List<PalletMatchLog> palletMatchLogList){
|
|
private LinkedList<Object> buildReversePickInventoryMatchList(List<String> orderList, List<PalletMatchLog> palletMatchLogList){
|
|
//根据erp单号获取出库单头列表
|
|
//根据erp单号获取出库单头列表
|
|
List<WmsDocOrderHeader> wmsDocOrderHeaderList = wmsDocOrderHeaderMapper.selectList(Wrappers.<WmsDocOrderHeader>lambdaQuery().in(WmsDocOrderHeader::getSoReference1, orderList).orderByDesc(WmsDocOrderHeader::getCreateTime));
|
|
List<WmsDocOrderHeader> wmsDocOrderHeaderList = wmsDocOrderHeaderMapper.selectList(Wrappers.<WmsDocOrderHeader>lambdaQuery().in(WmsDocOrderHeader::getSoReference1, orderList).orderByDesc(WmsDocOrderHeader::getCreateTime));
|
|
@@ -2889,6 +2974,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * PDA托盘出库、PDA反拣出库、PDA分拣出库:通过计算获得所需出库托盘列表
|
|
|
|
+ */
|
|
private List<InvLotAttPalletTotalDTO> buildInvLotAttPalletTotalList(List<InvLotAttPalletTotalDTO> lotAttPalletTotalDTOList, BigDecimal qty, List<PalletMatchLog> palletMatchLogList){
|
|
private List<InvLotAttPalletTotalDTO> buildInvLotAttPalletTotalList(List<InvLotAttPalletTotalDTO> lotAttPalletTotalDTOList, BigDecimal qty, List<PalletMatchLog> palletMatchLogList){
|
|
//所需出库托盘
|
|
//所需出库托盘
|
|
List<InvLotAttPalletTotalDTO> result = new ArrayList<>();
|
|
List<InvLotAttPalletTotalDTO> result = new ArrayList<>();
|
|
@@ -2915,86 +3003,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 托盘出库回显推荐列表
|
|
|
|
- * @param orderNos
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @Override
|
|
|
|
- public List<PalletMatchLogDTO> queryPalletMatchInfoList(String orderNos) {
|
|
|
|
- List<String> orderList = JSONArray.parseArray(orderNos, String.class);
|
|
|
|
- String order = String.join(",", orderList);
|
|
|
|
- List<PalletMatchLog> palletMatchLogList = palletMatchLogService.queryPalletMatchLogByOrderNos(order);
|
|
|
|
- List<BaseLocationInfo> baseLocationInfoList = baseLocationInfoService.selectBaseLocationInfoList(palletMatchLogList.stream().map(PalletMatchLog::getLocationId).collect(Collectors.toList()));
|
|
|
|
-
|
|
|
|
- return palletMatchLogList.stream().map(item -> {
|
|
|
|
- PalletMatchLogDTO palletMatchLogDTO = ConvertUtils.sourceToTarget(item, PalletMatchLogDTO.class);
|
|
|
|
- BaseLocationInfo locationInfo = baseLocationInfoList.stream().filter(baseLocationInfo -> baseLocationInfo.getId().equals(Long.parseLong(item.getLocationId()))).findFirst().orElseThrow(() -> new BaseException("库位信息有误"));
|
|
|
|
- palletMatchLogDTO.setLocationNo(locationInfo.getLocationNo());
|
|
|
|
- return palletMatchLogDTO;
|
|
|
|
- }).collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(PalletMatchLogDTO::getPalletNo))), ArrayList::new));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * PDA理货备货/分拣组盘(不传出库单号)
|
|
|
|
- */
|
|
|
|
- @Override
|
|
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
- public AjaxResult pdaGroupDisk(PdaGroupDiskDTO pdaGroupDiskDTO) {
|
|
|
|
- GroupDiskConvertDTO groupDiskConvertDTO = buildGroupDiskConvertDTO(pdaGroupDiskDTO);
|
|
|
|
- String locationId = invLotLocGroupDisk(groupDiskConvertDTO);
|
|
|
|
- BigDecimal palletTotal = invLotAttService.queryPalletTotal(groupDiskConvertDTO.getPalletTo());
|
|
|
|
- if (StringUtils.isBlank(groupDiskConvertDTO.getWmsOrderNo())) return AjaxResult.success("组盘成功!托盘数量: " + palletTotal);
|
|
|
|
- groupDiskConvertDTO.setLocationId(locationId);
|
|
|
|
- wmsDocOrderGroupDisk(groupDiskConvertDTO);
|
|
|
|
- return AjaxResult.success("当前托盘备货成功!托盘数量: " + palletTotal);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * PDA反拣组盘
|
|
|
|
- */
|
|
|
|
- @Override
|
|
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
- public AjaxResult pdaReversePickGroupDisk(ReversePickGroupDiskDTO reversePickGroupDiskDTO){
|
|
|
|
- ReversePickConvertDTO reversePickConvertDTO = buildReversePickConvertDTO(reversePickGroupDiskDTO);
|
|
|
|
- //判断反拣类型为解绑还是扩容
|
|
|
|
- BigDecimal qty = judgeReversePickType(reversePickConvertDTO.getSku(), reversePickConvertDTO.getOrderNo());
|
|
|
|
- //1. 理货备货
|
|
|
|
- if (CompareUtil.compare(qty, BigDecimal.ZERO) < 0){
|
|
|
|
- PdaGroupDiskDTO pdaGroupDiskDTO = ConvertUtils.sourceToTarget(reversePickConvertDTO, PdaGroupDiskDTO.class);
|
|
|
|
- return pdaGroupDisk(pdaGroupDiskDTO);
|
|
|
|
- }
|
|
|
|
- //2. 解绑当前物料
|
|
|
|
- //反拣情况下原托盘为目标解绑托盘 新托盘为目标绑定托盘
|
|
|
|
- Long locationId = unbindWmsBox(reversePickConvertDTO.getPalletFrom(), reversePickConvertDTO.getPalletTo());
|
|
|
|
- List<InvLotAtt> invLotAttList = invLotAttService.queryInvLotAtt(reversePickConvertDTO.getPalletFrom(), reversePickConvertDTO.getSn(), reversePickConvertDTO.getOrderNo());
|
|
|
|
- unbindInvLotLoc(invLotAttList.stream().map(InvLotAtt::getLotnum).collect(Collectors.toList()), locationId, reversePickConvertDTO.getPalletTo(), reversePickConvertDTO.getSku());
|
|
|
|
- //出库单明细数量解绑
|
|
|
|
- reversePickUnbindWmsDocOrder(reversePickConvertDTO.getOrderNo(), reversePickConvertDTO.getSku(), reversePickConvertDTO.getQty());
|
|
|
|
- //删除条码扫描记录
|
|
|
|
- erpBarcodesService.untieRecordErpBarcodeListAsnSo(reversePickConvertDTO.getErpNo(), null, reversePickConvertDTO.getSn());
|
|
|
|
- return AjaxResult.success("条码:" + reversePickConvertDTO.getSn() + "与出库单:" + reversePickGroupDiskDTO.getErpNo() + "解绑成功!");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * PDA解绑物料
|
|
|
|
- */
|
|
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
- public AjaxResult pdaUnbind(UnbindDTO unbindDTO) {
|
|
|
|
- InvLotLocId invLotLocId = invLotLocIdService.queryInvLotLocIdByLotnum(unbindDTO.getLotnum());
|
|
|
|
- Long locationId = unbindWmsBox(unbindDTO.getPalletTo(), unbindDTO.getPalletFrom());
|
|
|
|
- unbindInvLotLoc(unbindDTO.getLotnum(), locationId, unbindDTO.getPalletFrom(), unbindDTO.getSku());
|
|
|
|
- if (StringUtils.isBlank(unbindDTO.getErpNo())) return AjaxResult.success("托盘:" + unbindDTO.getPalletTo() + "解绑成功!托盘数量: " + invLotAttService.queryPalletTotal(unbindDTO.getPalletTo()));
|
|
|
|
- // 删除条码扫描记录
|
|
|
|
- erpBarcodesService.untieRecordErpBarcodeListAsnSo(unbindDTO.getErpNo(), null, unbindDTO.getSn());
|
|
|
|
- unbindWmsDocOrder(unbindDTO.getErpNo(), invLotLocId.getQty());
|
|
|
|
- return AjaxResult.success("托盘:" + unbindDTO.getPalletTo() + "解绑成功!托盘数量: " + invLotAttService.queryPalletTotal(unbindDTO.getPalletTo()));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 解绑托盘
|
|
|
|
- * @param palletTo 目标解绑托盘
|
|
|
|
- * @param palletFrom 目标绑定托盘
|
|
|
|
- * @return
|
|
|
|
|
|
+ * PDA解绑物料:解绑托盘
|
|
*/
|
|
*/
|
|
private Long unbindWmsBox(String palletTo, String palletFrom){
|
|
private Long unbindWmsBox(String palletTo, String palletFrom){
|
|
WmsBoxInfo wmsBoxToInfo = wmsBoxInfoService.selectWmsBoxInfoByBoxNo(palletTo);
|
|
WmsBoxInfo wmsBoxToInfo = wmsBoxInfoService.selectWmsBoxInfoByBoxNo(palletTo);
|
|
@@ -3012,12 +3021,18 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
return locationId;
|
|
return locationId;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * PDA解绑物料:解绑库位库存
|
|
|
|
+ */
|
|
private void unbindInvLotLoc(List<String> lotNumList, Long locationId, String palletNo, String sku){
|
|
private void unbindInvLotLoc(List<String> lotNumList, Long locationId, String palletNo, String sku){
|
|
List<InvLotLocId> invLotLocIdList = invLotLocIdService.queryInvLotLocIdByLotnum(lotNumList);
|
|
List<InvLotLocId> invLotLocIdList = invLotLocIdService.queryInvLotLocIdByLotnum(lotNumList);
|
|
InvLotLocId invLotLocId = invLotLocIdList.stream().findFirst().orElseThrow(() -> new BaseException("库位库存信息丢失!"));
|
|
InvLotLocId invLotLocId = invLotLocIdList.stream().findFirst().orElseThrow(() -> new BaseException("库位库存信息丢失!"));
|
|
unbindInvLotLoc(invLotLocId.getLotnum(), locationId, palletNo, sku);
|
|
unbindInvLotLoc(invLotLocId.getLotnum(), locationId, palletNo, sku);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * PDA解绑物料:解绑库位库存
|
|
|
|
+ */
|
|
private void unbindInvLotLoc(String lotNum, Long locationId, String palletNo, String sku){
|
|
private void unbindInvLotLoc(String lotNum, Long locationId, String palletNo, String sku){
|
|
InvLotAtt invLotAtt = invLotAttService.selectInvLotAttByLotnum(lotNum);
|
|
InvLotAtt invLotAtt = invLotAttService.selectInvLotAttByLotnum(lotNum);
|
|
//创建新批次
|
|
//创建新批次
|
|
@@ -3028,6 +3043,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
invLotLocIdService.updateInvLotLocIdLotNum(lotNum, newLotNum, String.valueOf(locationId), BigDecimal.ZERO);
|
|
invLotLocIdService.updateInvLotLocIdLotNum(lotNum, newLotNum, String.valueOf(locationId), BigDecimal.ZERO);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * PDA解绑物料:解绑出库单
|
|
|
|
+ */
|
|
private void unbindWmsDocOrder(String erpNo, BigDecimal qty){
|
|
private void unbindWmsDocOrder(String erpNo, BigDecimal qty){
|
|
WmsDocOrderHeader wmsDocOrderHeader = selectWmsDocOrderHeaderByErpNo(erpNo);
|
|
WmsDocOrderHeader wmsDocOrderHeader = selectWmsDocOrderHeaderByErpNo(erpNo);
|
|
if (ObjectUtil.isNull(wmsDocOrderHeader)) throw new BaseException("出库单号错误!");
|
|
if (ObjectUtil.isNull(wmsDocOrderHeader)) throw new BaseException("出库单号错误!");
|
|
@@ -3051,6 +3069,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
.set(WmsDocOrderHeader::getOrderStatus, Constant.ORDER_STS.STS22.getValue()).eq(WmsDocOrderHeader::getOrderNo, orderNo));
|
|
.set(WmsDocOrderHeader::getOrderStatus, Constant.ORDER_STS.STS22.getValue()).eq(WmsDocOrderHeader::getOrderNo, orderNo));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * PDA反拣组盘:解绑出库单
|
|
|
|
+ */
|
|
private void reversePickUnbindWmsDocOrder(String orderNo, String sku, BigDecimal qty){
|
|
private void reversePickUnbindWmsDocOrder(String orderNo, String sku, BigDecimal qty){
|
|
List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsService.queryWmsDocOrderDetails(orderNo);
|
|
List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsService.queryWmsDocOrderDetails(orderNo);
|
|
if (CollectionUtil.isEmpty(wmsDocOrderDetailsList)) throw new BaseException("出库单明细为空!");
|
|
if (CollectionUtil.isEmpty(wmsDocOrderDetailsList)) throw new BaseException("出库单明细为空!");
|
|
@@ -3068,20 +3089,8 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private ReversePickConvertDTO buildReversePickConvertDTO(ReversePickGroupDiskDTO reversePickGroupDiskDTO) {
|
|
|
|
- ReversePickConvertDTO reversePickConvertDTO = ConvertUtils.sourceToTarget(reversePickGroupDiskDTO, ReversePickConvertDTO.class);
|
|
|
|
- // 根据条码获取物料号
|
|
|
|
- CodeSkuRelationshipVO codeSkuRelationshipVO = codeSkuRelationshipService.checkIsProduct(reversePickConvertDTO.getSn());
|
|
|
|
- String sku = codeSkuRelationshipVO.getSku();
|
|
|
|
- WmsDocOrderHeader wmsDocOrderHeader = selectWmsDocOrderHeaderByErpNo(reversePickConvertDTO.getErpNo());
|
|
|
|
- String orderNo = Optional.ofNullable(wmsDocOrderHeader).orElseThrow(() -> new BaseException("请扫描正确的出库单号!")).getOrderNo();
|
|
|
|
- reversePickConvertDTO.setOrderNo(orderNo);
|
|
|
|
- reversePickConvertDTO.setSku(sku);
|
|
|
|
- return reversePickConvertDTO;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
- * 判断反拣类型为解绑还是扩容 返回负数扩容 正数解绑
|
|
|
|
|
|
+ * 判断反拣类型为解绑还是扩容 返回负数扩容 正数为需解绑数量
|
|
*/
|
|
*/
|
|
private BigDecimal judgeReversePickType(String sku, String orderNo){
|
|
private BigDecimal judgeReversePickType(String sku, String orderNo){
|
|
List<InvLotAtt> invLotAttList = invLotAttService.queryOrderSameSkuInvLotAttList(sku, orderNo);
|
|
List<InvLotAtt> invLotAttList = invLotAttService.queryOrderSameSkuInvLotAttList(sku, orderNo);
|
|
@@ -3094,24 +3103,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
return NumberUtil.sub(orderAllocatedQty, orderRequireQty);
|
|
return NumberUtil.sub(orderAllocatedQty, orderRequireQty);
|
|
}
|
|
}
|
|
|
|
|
|
- private GroupDiskConvertDTO buildGroupDiskConvertDTO(PdaGroupDiskDTO pdaGroupDiskDTO) {
|
|
|
|
- GroupDiskConvertDTO groupDiskConvertDTO = ConvertUtils.sourceToTarget(pdaGroupDiskDTO, GroupDiskConvertDTO.class);
|
|
|
|
- String boxNo = StringUtils.isNotBlank(pdaGroupDiskDTO.getBoxNo()) ? pdaGroupDiskDTO.getBoxNo() : pdaGroupDiskDTO.getPalletTo();
|
|
|
|
- String lotNum = IdWorker.getIdStr();
|
|
|
|
- groupDiskConvertDTO.setBoxNo(boxNo);
|
|
|
|
- groupDiskConvertDTO.setGroupDiskQty(new BigDecimal(pdaGroupDiskDTO.getQty()));
|
|
|
|
- groupDiskConvertDTO.setLotNum(lotNum);
|
|
|
|
- // 根据条码获取物料号
|
|
|
|
- CodeSkuRelationshipVO codeSkuRelationshipVO = codeSkuRelationshipService.checkIsProduct(pdaGroupDiskDTO.getSn());
|
|
|
|
- // 物料编码
|
|
|
|
- String sku = codeSkuRelationshipVO.getSku();
|
|
|
|
- groupDiskConvertDTO.setSku(sku);
|
|
|
|
- if (StringUtils.isBlank(pdaGroupDiskDTO.getErpNo())) return groupDiskConvertDTO;
|
|
|
|
- WmsDocOrderHeader wmsDocOrderHeader = selectWmsDocOrderHeaderByErpNo(pdaGroupDiskDTO.getErpNo());
|
|
|
|
- groupDiskConvertDTO.setWmsOrderNo(Optional.ofNullable(wmsDocOrderHeader).orElseThrow(() -> new BaseException("请扫描正确的出库单号!")).getOrderNo());
|
|
|
|
- return groupDiskConvertDTO;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 托盘出库:库位库存相关业务
|
|
|
|
+ */
|
|
private String invLotLocGroupDisk(GroupDiskConvertDTO groupDiskConvertDTO){
|
|
private String invLotLocGroupDisk(GroupDiskConvertDTO groupDiskConvertDTO){
|
|
List<InvLotAtt> invLotAttList = invLotAttService.queryInvLotAtt(groupDiskConvertDTO.getPalletFrom(), groupDiskConvertDTO.getSn());
|
|
List<InvLotAtt> invLotAttList = invLotAttService.queryInvLotAtt(groupDiskConvertDTO.getPalletFrom(), groupDiskConvertDTO.getSn());
|
|
List<InvLotLocId> invLotLocIdList = invLotLocIdService.queryInvLotLocIdByLotnum(invLotAttList.stream().map(InvLotAtt::getLotnum).collect(Collectors.toList()));
|
|
List<InvLotLocId> invLotLocIdList = invLotLocIdService.queryInvLotLocIdByLotnum(invLotAttList.stream().map(InvLotAtt::getLotnum).collect(Collectors.toList()));
|
|
@@ -3140,6 +3134,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
return locationId;
|
|
return locationId;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 托盘出库:出库单相关业务
|
|
|
|
+ */
|
|
private void wmsDocOrderGroupDisk(GroupDiskConvertDTO groupDiskConvertDTO){
|
|
private void wmsDocOrderGroupDisk(GroupDiskConvertDTO groupDiskConvertDTO){
|
|
BigDecimal qty = groupDiskConvertDTO.getGroupDiskQty();
|
|
BigDecimal qty = groupDiskConvertDTO.getGroupDiskQty();
|
|
List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsService.queryWmsDocOrderDetails(groupDiskConvertDTO.getWmsOrderNo());
|
|
List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsService.queryWmsDocOrderDetails(groupDiskConvertDTO.getWmsOrderNo());
|
|
@@ -3184,6 +3181,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
.set(WmsDocOrderHeader::getOrderStatus, CollectionUtil.isNotEmpty(docOrderDetailsList) ? Constant.ORDER_STS.STS22.getValue() : Constant.ORDER_STS.STS23.getValue()).eq(WmsDocOrderHeader::getOrderNo, groupDiskConvertDTO.getWmsOrderNo()));
|
|
.set(WmsDocOrderHeader::getOrderStatus, CollectionUtil.isNotEmpty(docOrderDetailsList) ? Constant.ORDER_STS.STS22.getValue() : Constant.ORDER_STS.STS23.getValue()).eq(WmsDocOrderHeader::getOrderNo, groupDiskConvertDTO.getWmsOrderNo()));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 验证库位库存并获取库位id
|
|
|
|
+ */
|
|
private String verifyInvLotAndGetLocationId(String palletNoTo, String sn, String orderNo) {
|
|
private String verifyInvLotAndGetLocationId(String palletNoTo, String sn, String orderNo) {
|
|
List<InvLotAtt> palletNoToInvLotAttList = invLotAttService.queryInvLotAtt(palletNoTo);
|
|
List<InvLotAtt> palletNoToInvLotAttList = invLotAttService.queryInvLotAtt(palletNoTo);
|
|
if (CollectionUtil.isEmpty(palletNoToInvLotAttList)) return null;
|
|
if (CollectionUtil.isEmpty(palletNoToInvLotAttList)) return null;
|
|
@@ -3203,6 +3203,36 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
return locationId;
|
|
return locationId;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private ReversePickConvertDTO buildReversePickConvertDTO(ReversePickGroupDiskDTO reversePickGroupDiskDTO) {
|
|
|
|
+ ReversePickConvertDTO reversePickConvertDTO = ConvertUtils.sourceToTarget(reversePickGroupDiskDTO, ReversePickConvertDTO.class);
|
|
|
|
+ // 根据条码获取物料号
|
|
|
|
+ CodeSkuRelationshipVO codeSkuRelationshipVO = codeSkuRelationshipService.checkIsProduct(reversePickConvertDTO.getSn());
|
|
|
|
+ String sku = codeSkuRelationshipVO.getSku();
|
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = selectWmsDocOrderHeaderByErpNo(reversePickConvertDTO.getErpNo());
|
|
|
|
+ String orderNo = Optional.ofNullable(wmsDocOrderHeader).orElseThrow(() -> new BaseException("请扫描正确的出库单号!")).getOrderNo();
|
|
|
|
+ reversePickConvertDTO.setOrderNo(orderNo);
|
|
|
|
+ reversePickConvertDTO.setSku(sku);
|
|
|
|
+ return reversePickConvertDTO;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private GroupDiskConvertDTO buildGroupDiskConvertDTO(PdaGroupDiskDTO pdaGroupDiskDTO) {
|
|
|
|
+ GroupDiskConvertDTO groupDiskConvertDTO = ConvertUtils.sourceToTarget(pdaGroupDiskDTO, GroupDiskConvertDTO.class);
|
|
|
|
+ String boxNo = StringUtils.isNotBlank(pdaGroupDiskDTO.getBoxNo()) ? pdaGroupDiskDTO.getBoxNo() : pdaGroupDiskDTO.getPalletTo();
|
|
|
|
+ String lotNum = IdWorker.getIdStr();
|
|
|
|
+ groupDiskConvertDTO.setBoxNo(boxNo);
|
|
|
|
+ groupDiskConvertDTO.setGroupDiskQty(new BigDecimal(pdaGroupDiskDTO.getQty()));
|
|
|
|
+ groupDiskConvertDTO.setLotNum(lotNum);
|
|
|
|
+ // 根据条码获取物料号
|
|
|
|
+ CodeSkuRelationshipVO codeSkuRelationshipVO = codeSkuRelationshipService.checkIsProduct(pdaGroupDiskDTO.getSn());
|
|
|
|
+ // 物料编码
|
|
|
|
+ String sku = codeSkuRelationshipVO.getSku();
|
|
|
|
+ groupDiskConvertDTO.setSku(sku);
|
|
|
|
+ if (StringUtils.isBlank(pdaGroupDiskDTO.getErpNo())) return groupDiskConvertDTO;
|
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = selectWmsDocOrderHeaderByErpNo(pdaGroupDiskDTO.getErpNo());
|
|
|
|
+ groupDiskConvertDTO.setWmsOrderNo(Optional.ofNullable(wmsDocOrderHeader).orElseThrow(() -> new BaseException("请扫描正确的出库单号!")).getOrderNo());
|
|
|
|
+ return groupDiskConvertDTO;
|
|
|
|
+ }
|
|
|
|
+
|
|
private InvLotLocId buildInvLotLocId(String lotNum, BigDecimal qty, String locationId, String traceId, String sku) {
|
|
private InvLotLocId buildInvLotLocId(String lotNum, BigDecimal qty, String locationId, String traceId, String sku) {
|
|
InvLotLocId invLotLocId = new InvLotLocId();
|
|
InvLotLocId invLotLocId = new InvLotLocId();
|
|
invLotLocId.setLotnum(lotNum);
|
|
invLotLocId.setLotnum(lotNum);
|