|
@@ -2768,6 +2768,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
public synchronized AjaxResult syncPdaReversePickGroupDisk(ReversePickGroupDiskDTO reversePickGroupDiskDTO){
|
|
|
return wmsDocOrderHeaderService.pdaReversePickGroupDisk(reversePickGroupDiskDTO);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* PDA库存匹配并发控制
|
|
|
*/
|
|
@@ -2776,6 +2777,14 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
return wmsDocOrderHeaderService.inventoryMatch(orderNos);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * PDA分拣出库并发控制
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public synchronized Boolean syncSeparatePick(String orderNos){
|
|
|
+ return wmsDocOrderHeaderService.separatePick(orderNos);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* PDA反拣出库并发控制
|
|
|
*/
|
|
@@ -2827,6 +2836,35 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
return palletMatchLogService.insertBatch(buildPalletMatchLogList(result, orderList));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 分拣出库
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
+ public Boolean separatePick(String orderNos) {
|
|
|
+ List<String> orderList = JSONArray.parseArray(orderNos, String.class);
|
|
|
+ List<WmsDocOrderHeader> wmsDocOrderHeaderList = wmsDocOrderHeaderMapper.selectList(Wrappers.<WmsDocOrderHeader>lambdaQuery().in(WmsDocOrderHeader::getSoReference1, orderList).orderByDesc(WmsDocOrderHeader::getCreateTime));
|
|
|
+ if (CollectionUtil.isEmpty(wmsDocOrderHeaderList)) {
|
|
|
+ throw new BaseException("请扫描正确的出库单号");
|
|
|
+ }
|
|
|
+ List<InvLotAtt> invLotAttList = invLotAttService.queryInvLotAttByOrderNoList(wmsDocOrderHeaderList.stream().map(WmsDocOrderHeader::getOrderNo).collect(Collectors.toList()));
|
|
|
+ Assert.isTrue(CollectionUtil.isNotEmpty(invLotAttList), "扫描出库单未进行理货备货!");
|
|
|
+ List<InvLotLocId> invLotLocIdList = invLotLocIdService.queryInvLotLocIdByLotnum(invLotAttList.stream().map(InvLotAtt::getLotnum).collect(Collectors.toList()));
|
|
|
+ Map<String, List<InvLotLocId>> invLotLocIdGroupByLocationMap = invLotLocIdList.stream().collect(Collectors.groupingBy(InvLotLocId::getLocationId));
|
|
|
+ List<InvLotAttPalletTotalDTO> result = invLotLocIdGroupByLocationMap.entrySet().stream().map(item -> {
|
|
|
+ InvLotLocId invLotLocId = item.getValue().stream().findFirst().orElseThrow(() -> new BaseException("Table invLotLocId data is on error"));
|
|
|
+ InvLotAttPalletTotalDTO invLotAttPalletTotalDTO = new InvLotAttPalletTotalDTO();
|
|
|
+ invLotAttPalletTotalDTO.setLocationId(item.getKey());
|
|
|
+ invLotAttPalletTotalDTO.setSku(item.getValue().stream().map(InvLotLocId::getSku).distinct().collect(Collectors.joining(",")));
|
|
|
+ invLotAttPalletTotalDTO.setOrderNo(String.join(",", orderList));
|
|
|
+ invLotAttPalletTotalDTO.setTotalQty(item.getValue().stream().map(InvLotLocId::getQty).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
|
|
+ invLotAttPalletTotalDTO.setPalletNo(invLotAttList.stream().filter(invLotAtt ->
|
|
|
+ StringUtils.equals(invLotLocId.getLotnum(), invLotAtt.getLotnum())).map(InvLotAtt::getLotatt07).findFirst().orElseGet(() -> null));
|
|
|
+ return invLotAttPalletTotalDTO;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ return palletMatchLogService.insertBatch(buildPalletMatchLogList(result, orderList));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 反拣出库
|
|
|
*/
|
|
@@ -3160,7 +3198,6 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
InvLotLocId invLotLocId = invLotLocIdList.stream().findFirst().orElseThrow(() -> new BaseException("库位库存信息丢失!"));
|
|
|
BigDecimal qtyAllocated = ObjectUtil.isNotNull(invLotLocId.getQtyallocated()) ? invLotLocId.getQtyallocated() : BigDecimal.ZERO;
|
|
|
BigDecimal invLotLocQty = invLotLocId.getQty().subtract(qtyAllocated);
|
|
|
- Assert.isTrue(NumberUtil.isGreater(invLotLocQty, BigDecimal.ZERO), "该产品已备货!");
|
|
|
String asnNo = invLotAttList.stream().filter(item -> item.getLotnum().equals(invLotLocId.getLotnum())).map(InvLotAtt::getLotatt08).findFirst().orElseThrow(() -> new BaseException("此批次入库信息丢失!"));
|
|
|
String sku = groupDiskConvertDTO.getSku();
|
|
|
invLotAttService.insertInvLotAtt(buildInvLotAtt(groupDiskConvertDTO.getLotNum(), groupDiskConvertDTO.getPalletTo(), orderNo, groupDiskConvertDTO.getSn(), sku, asnNo));
|
|
@@ -3168,7 +3205,8 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
String locationId = verifyInvLotAndGetLocationId(groupDiskConvertDTO.getPalletTo(), groupDiskConvertDTO.getSn(), orderNo);
|
|
|
locationId = StringUtils.isNotBlank(locationId) ? locationId : invLotLocId.getLocationId();
|
|
|
if (CompareUtil.compare(groupDiskConvertDTO.getGroupDiskQty(), invLotLocQty) >= 0) {
|
|
|
- invLotLocIdService.updateInvLotLocId(invLotLocId.getLotnum(), groupDiskConvertDTO.getLotNum(), invLotLocQty, sku, locationId);
|
|
|
+ invLotLocIdService.updateInvLotLocId(invLotLocId.getLotnum(), groupDiskConvertDTO.getLotNum(),
|
|
|
+ invLotLocId.getQty(), StringUtils.isNotBlank(orderNo) ? invLotLocId.getQty() : invLotLocId.getQtyallocated(), sku, locationId);
|
|
|
} else {
|
|
|
// 拆分库存
|
|
|
// 修改原库存
|