|
@@ -2740,7 +2740,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
*/
|
|
|
@Override
|
|
|
public synchronized AjaxResult syncPdaUnbind(UnbindDTO unbindDTO){
|
|
|
- return pdaUnbind(unbindDTO);
|
|
|
+ return wmsDocOrderHeaderService.pdaUnbind(unbindDTO);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2748,7 +2748,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
*/
|
|
|
@Override
|
|
|
public synchronized AjaxResult syncPdaGroupDisk(PdaGroupDiskDTO pdaGroupDiskDTO){
|
|
|
- return pdaGroupDisk(pdaGroupDiskDTO);
|
|
|
+ return wmsDocOrderHeaderService.pdaGroupDisk(pdaGroupDiskDTO);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2756,14 +2756,14 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
*/
|
|
|
@Override
|
|
|
public synchronized AjaxResult syncPdaReversePickGroupDisk(ReversePickGroupDiskDTO reversePickGroupDiskDTO){
|
|
|
- return pdaReversePickGroupDisk(reversePickGroupDiskDTO);
|
|
|
+ return wmsDocOrderHeaderService.pdaReversePickGroupDisk(reversePickGroupDiskDTO);
|
|
|
}
|
|
|
/**
|
|
|
* PDA库存匹配并发控制
|
|
|
*/
|
|
|
@Override
|
|
|
public synchronized Boolean syncInventoryMatch(String orderNos){
|
|
|
- return inventoryMatch(orderNos);
|
|
|
+ return wmsDocOrderHeaderService.inventoryMatch(orderNos);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2771,7 +2771,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
*/
|
|
|
@Override
|
|
|
public synchronized Boolean syncPdaReversePickInventoryMatch(String orderNos){
|
|
|
- return reversePickInventoryMatch(orderNos);
|
|
|
+ return wmsDocOrderHeaderService.reversePickInventoryMatch(orderNos);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2845,6 +2845,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
ReversePickConvertDTO reversePickConvertDTO = buildReversePickConvertDTO(reversePickGroupDiskDTO);
|
|
|
//判断反拣类型为解绑还是扩容
|
|
|
BigDecimal qty = judgeReversePickType(reversePickConvertDTO.getSku(), reversePickConvertDTO.getOrderNo());
|
|
|
+ if (CompareUtil.compare(qty, BigDecimal.ZERO) == 0) throw new BaseException("出库单该品号不存在反拣情况!");
|
|
|
//1. 理货备货
|
|
|
if (CompareUtil.compare(qty, BigDecimal.ZERO) < 0){
|
|
|
PdaGroupDiskDTO pdaGroupDiskDTO = ConvertUtils.sourceToTarget(reversePickConvertDTO, PdaGroupDiskDTO.class);
|
|
@@ -2865,6 +2866,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
/**
|
|
|
* PDA解绑物料
|
|
|
*/
|
|
|
+ @Override
|
|
|
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
public AjaxResult pdaUnbind(UnbindDTO unbindDTO) {
|
|
|
InvLotLocId invLotLocId = invLotLocIdService.queryInvLotLocIdByLotnum(unbindDTO.getLotnum());
|
|
@@ -2873,7 +2875,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
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());
|
|
|
+ unbindWmsDocOrder(unbindDTO.getErpNo(), invLotLocId.getQty(), unbindDTO.getSku());
|
|
|
return AjaxResult.success("托盘:" + unbindDTO.getPalletTo() + "解绑成功!托盘数量: " + invLotAttService.queryPalletTotal(unbindDTO.getPalletTo()));
|
|
|
}
|
|
|
|
|
@@ -2946,6 +2948,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
for (String sku : skuList) {
|
|
|
//判断反拣类型为解绑还是扩容 如果大于零则为该解绑得数量
|
|
|
BigDecimal qty = judgeReversePickType(sku, wmsDocOrderDetailsGroupByOrderNoEntry.getKey());
|
|
|
+ if (CompareUtil.compare(qty, BigDecimal.ZERO) == 0) continue;
|
|
|
if (CompareUtil.compare(qty, BigDecimal.ZERO) < 0) {
|
|
|
flag = Boolean.TRUE;
|
|
|
continue;
|
|
@@ -3005,7 +3008,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
/**
|
|
|
* PDA解绑物料:解绑托盘
|
|
|
*/
|
|
|
- private Long unbindWmsBox(String palletTo, String palletFrom){
|
|
|
+ public Long unbindWmsBox(String palletTo, String palletFrom){
|
|
|
WmsBoxInfo wmsBoxToInfo = wmsBoxInfoService.selectWmsBoxInfoByBoxNo(palletTo);
|
|
|
if (ObjectUtil.isNull(wmsBoxToInfo)) {
|
|
|
throw new BaseException("查询不到目标托盘:" + palletTo);
|
|
@@ -3046,11 +3049,11 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
/**
|
|
|
* PDA解绑物料:解绑出库单
|
|
|
*/
|
|
|
- private void unbindWmsDocOrder(String erpNo, BigDecimal qty){
|
|
|
+ public void unbindWmsDocOrder(String erpNo, BigDecimal qty, String sku){
|
|
|
WmsDocOrderHeader wmsDocOrderHeader = selectWmsDocOrderHeaderByErpNo(erpNo);
|
|
|
if (ObjectUtil.isNull(wmsDocOrderHeader)) throw new BaseException("出库单号错误!");
|
|
|
String orderNo = wmsDocOrderHeader.getOrderNo();
|
|
|
- List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsService.queryWmsDocOrderDetails(orderNo);
|
|
|
+ List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsService.queryWmsDocOrderDetails(orderNo, sku);
|
|
|
if (CollectionUtil.isEmpty(wmsDocOrderDetailsList)) throw new BaseException("出库单明细为空!");
|
|
|
wmsDocOrderDetailsList = ListUtil.reverse(wmsDocOrderDetailsList.stream().filter(item -> ObjectUtil.isNotNull(item.getQtyAllocated())
|
|
|
|| !NumberUtil.equals(item.getQtyAllocated(), BigDecimal.ZERO)).collect(Collectors.toList()));
|
|
@@ -3083,6 +3086,8 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
wmsDocOrderDetails.setQtyAllocated(flag ? wmsDocOrderDetails.getQtyOrdered() : wmsDocOrderDetails.getQtyAllocated().subtract(qty));
|
|
|
wmsDocOrderDetails.setQtyAllocatedEach(wmsDocOrderDetails.getQtyAllocated());
|
|
|
wmsDocOrderDetails.setLineStatus(Constant.ORDER_STS.STS23.getValue());
|
|
|
+ wmsDocOrderDetails.setQtySoftAllocated(flag ? BigDecimal.ZERO : wmsDocOrderDetails.getQtySoftAllocated().add(qty));
|
|
|
+ wmsDocOrderDetails.setQtySoftallocatedEach(wmsDocOrderDetails.getQtySoftAllocated());
|
|
|
wmsDocOrderDetailsService.updateWmsDocOrderDetails(wmsDocOrderDetails);
|
|
|
qty = qty.subtract(orderRequireSub);
|
|
|
if (!flag || NumberUtil.equals(qty, BigDecimal.ZERO)) return;
|
|
@@ -3093,13 +3098,12 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
* 判断反拣类型为解绑还是扩容 返回负数扩容 正数为需解绑数量
|
|
|
*/
|
|
|
private BigDecimal judgeReversePickType(String sku, String orderNo){
|
|
|
+ List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsService.queryWmsDocOrderDetails(orderNo, sku);
|
|
|
+ BigDecimal orderRequireQty = wmsDocOrderDetailsList.stream().map(WmsDocOrderDetails::getQtyOrdered).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
List<InvLotAtt> invLotAttList = invLotAttService.queryOrderSameSkuInvLotAttList(sku, orderNo);
|
|
|
- if (CollectionUtil.isEmpty(invLotAttList)) throw new BaseException("该出库单未进行理货备货,无法反拣!");
|
|
|
+ if (CollectionUtil.isEmpty(invLotAttList)) return NumberUtil.sub(BigDecimal.ZERO, orderRequireQty);
|
|
|
List<InvLotLocId> invLotLocIdList = invLotLocIdService.queryInvLotLocIdByLotnum(invLotAttList.stream().map(InvLotAtt::getLotnum).collect(Collectors.toList()));
|
|
|
- List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsService.queryWmsDocOrderDetails(orderNo, sku);
|
|
|
BigDecimal orderAllocatedQty = invLotLocIdList.stream().map(InvLotLocId::getQtyallocated).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- BigDecimal orderRequireQty = wmsDocOrderDetailsList.stream().map(WmsDocOrderDetails::getQtyOrdered).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- if (CompareUtil.compare(orderAllocatedQty, orderRequireQty) == 0) throw new BaseException("出库单该品号不存在反拣情况!");
|
|
|
return NumberUtil.sub(orderAllocatedQty, orderRequireQty);
|
|
|
}
|
|
|
|