|
@@ -1466,6 +1466,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
boolean isAllUpdate = false; // 库存转移类型,是全部修改,还是拆分
|
|
|
boolean isStockPalletNoTo = groupDiskFrom.isStockPalletNoTo(); // 目标托盘是否是备货托盘,为了方便,目标托盘默认是备货托盘
|
|
|
final Double toQty;
|
|
|
+ boolean isAllocation = false; // 扫描条码对应库存是否被其他备货单分配
|
|
|
Long currentVirtualZone; // 当前所在的虚拟区
|
|
|
if (StringUtils.isNotEmpty(groupDiskFrom.getOrderNo())) {
|
|
|
orderNo = groupDiskFrom.getOrderNo();
|
|
@@ -1507,6 +1508,10 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
if (endLotattVO == null) {
|
|
|
return AjaxResult.error("组盘数量大于单条库存数量!");
|
|
|
}
|
|
|
+ // 判断扫描条码的库存是否被分配
|
|
|
+ if (endLotattVO.getQtyallocated().compareTo(BigDecimal.ONE.doubleValue()) == 0) {
|
|
|
+ isAllocation = true;
|
|
|
+ }
|
|
|
currentVirtualZone = endLotattVO.getLocationId();
|
|
|
invLotLocIdLotattVOList.add(endLotattVO);
|
|
|
// 验证备货库存是否已经备货
|
|
@@ -1549,12 +1554,36 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
if (invLotAttMapper.insertInvLotAtt(invLotAtt) > 0) {
|
|
|
for (InvLotLocIdLotattVO v : invLocIdList) {
|
|
|
if (isAllUpdate) {
|
|
|
+ // 如果扫描的条码未分配
|
|
|
+ if (!isAllocation) {
|
|
|
+ // 修改原本出库单对应的任意一个条码分配数为1
|
|
|
+ InvLocIdSearchFrom locIdSearchFrom01 = new InvLocIdSearchFrom();
|
|
|
+ LotattDTO lotattDTO01 = new LotattDTO();
|
|
|
+ lotattDTO01.setLotatt07(palletNoFrom);
|
|
|
+ lotattDTO01.setLotatt15(orderNo);
|
|
|
+ locIdSearchFrom01.setLotattDTO(lotattDTO01);
|
|
|
+ List<InvLotLocIdLotattVO> invLotLocIdLotattList01 = invLotLocIdService.selectInvLocIdLotattList(locIdSearchFrom01);
|
|
|
+ for (InvLotLocIdLotattVO locIdLotattVO : invLotLocIdLotattList01) {
|
|
|
+ // 没有备货并且分配数为1
|
|
|
+ if (StringUtils.isEmpty(locIdLotattVO.getLotatt14())
|
|
|
+ && locIdLotattVO.getQtyallocated().compareTo(BigDecimal.ONE.doubleValue()) == 0) {
|
|
|
+ InvLotLocIdForm invLotLocIdUpdate = new InvLotLocIdForm();
|
|
|
+ invLotLocIdUpdate.setLotnum(locIdLotattVO.getLotnum());
|
|
|
+ invLotLocIdUpdate.setLocationId(locIdLotattVO.getLocationId().toString());
|
|
|
+ invLotLocIdUpdate.setCustomerId(locIdLotattVO.getCustomerId());
|
|
|
+ invLotLocIdUpdate.setSku(locIdLotattVO.getSku());
|
|
|
+ invLotLocIdUpdate.setQtyallocated(BigDecimal.ZERO);
|
|
|
+ invLotLocIdService.updateInvLotLocId(invLotLocIdUpdate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
InvLotLocIdForm invLotLocIdUpdate = new InvLotLocIdForm();
|
|
|
invLotLocIdUpdate.setLotnum(lotnum);
|
|
|
invLotLocIdUpdate.setLocationId(v.getLocationId().toString());
|
|
|
invLotLocIdUpdate.setCustomerId(v.getCustomerId());
|
|
|
invLotLocIdUpdate.setSku(v.getSku());
|
|
|
- invLotLocIdUpdate.setQtyallocated(invLotLocIdUpdate.getQty());
|
|
|
+ invLotLocIdUpdate.setQtyallocated(BigDecimal.ONE);
|
|
|
invLotLocIdUpdate.setLotnumTo(newLotnum);
|
|
|
invLotLocIdService.updateInvLotLocId(invLotLocIdUpdate);
|
|
|
}
|
|
@@ -1863,7 +1892,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
InvLocIdSearchFrom invLocIdSearchFrom = new InvLocIdSearchFrom();
|
|
|
LotattDTO lotattDTO = new LotattDTO();
|
|
|
lotattDTO.setLotatt07(snCheckSoForm.getPalletNo());
|
|
|
- lotattDTO.setLotatt15(snCheckSoForm.getOrderNo());
|
|
|
+// lotattDTO.setLotatt15(snCheckSoForm.getOrderNo());
|
|
|
lotattDTO.setLotatt02(snCheckSoForm.getSn());
|
|
|
invLocIdSearchFrom.setLotattDTO(lotattDTO);
|
|
|
List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattList(invLocIdSearchFrom);
|
|
@@ -1953,6 +1982,8 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
details.setdEdi07(erpOrderNo); //项次
|
|
|
details.setdEdi08(erpOrder.getOrderType()); //erp单据类型
|
|
|
details.setdEdi09(erpOrder.getInout()); //erp出入库类型
|
|
|
+ details.setdEdi10(erpOrder.getCreateDate()); //创建时间
|
|
|
+ details.setdEdi11(erpOrder.getCreateUser()); //人员
|
|
|
details.setLineStatus("00");
|
|
|
details.setCreateTime(new Date());
|
|
|
details.setCreateBy(erpOrder.getCreateUser());
|