|
@@ -280,7 +280,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
* @param orderNo
|
|
* @param orderNo
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
@Override
|
|
@Override
|
|
public AjaxResult doAllocation(String orderNo) {
|
|
public AjaxResult doAllocation(String orderNo) {
|
|
WmsDocOrderHeader orderHeader = wmsDocOrderHeaderMapper.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
WmsDocOrderHeader orderHeader = wmsDocOrderHeaderMapper.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
@@ -332,7 +332,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
* @param orderNo
|
|
* @param orderNo
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
@Override
|
|
@Override
|
|
public AjaxResult doAllocationBH(String orderNo) {
|
|
public AjaxResult doAllocationBH(String orderNo) {
|
|
WmsDocOrderHeader orderHeader = wmsDocOrderHeaderMapper.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
WmsDocOrderHeader orderHeader = wmsDocOrderHeaderMapper.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
@@ -697,12 +697,13 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
// pickingListVOS.add(pickingListVO);
|
|
// pickingListVOS.add(pickingListVO);
|
|
// }
|
|
// }
|
|
// 二次组盘查询不到
|
|
// 二次组盘查询不到
|
|
- if (pickingListVOS.size() == 0) {
|
|
|
|
|
|
+
|
|
InvLocIdSearchFrom invLocIdSearchFrom = new InvLocIdSearchFrom();
|
|
InvLocIdSearchFrom invLocIdSearchFrom = new InvLocIdSearchFrom();
|
|
LotattDTO lotattDTO = new LotattDTO();
|
|
LotattDTO lotattDTO = new LotattDTO();
|
|
lotattDTO.setLotatt07(palletNo);
|
|
lotattDTO.setLotatt07(palletNo);
|
|
invLocIdSearchFrom.setLotattDTO(lotattDTO);
|
|
invLocIdSearchFrom.setLotattDTO(lotattDTO);
|
|
List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattList(invLocIdSearchFrom);
|
|
List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattList(invLocIdSearchFrom);
|
|
|
|
+ if (CollectionUtil.isEmpty(invLotLocIdLotattVOList)) return pickingListVOS;
|
|
for (InvLotLocIdLotattVO locIdLotattVO : invLotLocIdLotattVOList) {
|
|
for (InvLotLocIdLotattVO locIdLotattVO : invLotLocIdLotattVOList) {
|
|
String orderNo = locIdLotattVO.getLotatt14();
|
|
String orderNo = locIdLotattVO.getLotatt14();
|
|
WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
@@ -718,7 +719,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
pickingListVO.setModel(locIdLotattVO.getSkuModel());
|
|
pickingListVO.setModel(locIdLotattVO.getSkuModel());
|
|
pickingListVOS.add(pickingListVO);
|
|
pickingListVOS.add(pickingListVO);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+
|
|
return CollectionUtil.isNotEmpty(pickingListVOS) ? pickingListVOS.stream().
|
|
return CollectionUtil.isNotEmpty(pickingListVOS) ? pickingListVOS.stream().
|
|
sorted(Comparator.comparing(PickingListVO::getOrderNo, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList()) : pickingListVOS;
|
|
sorted(Comparator.comparing(PickingListVO::getOrderNo, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList()) : pickingListVOS;
|
|
}
|
|
}
|
|
@@ -979,7 +980,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
return endCheckOutVOList;
|
|
return endCheckOutVOList;
|
|
}
|
|
}
|
|
|
|
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
@Override
|
|
@Override
|
|
public AjaxResult doCheckout(CheckOutInfoForm check) {
|
|
public AjaxResult doCheckout(CheckOutInfoForm check) {
|
|
// String orderNo = check.getOrderNo();
|
|
// String orderNo = check.getOrderNo();
|
|
@@ -2235,7 +2236,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
return codeSkuRelationshipSoVO;
|
|
return codeSkuRelationshipSoVO;
|
|
}
|
|
}
|
|
|
|
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
@Override
|
|
@Override
|
|
public AjaxResult addOrUpdateErp(List<ErpOrderList> erpOrderList) {
|
|
public AjaxResult addOrUpdateErp(List<ErpOrderList> erpOrderList) {
|
|
try {
|
|
try {
|
|
@@ -2840,7 +2841,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
* 库存匹配
|
|
* 库存匹配
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
public Boolean inventoryMatch(String orderNos) {
|
|
public Boolean inventoryMatch(String orderNos) {
|
|
List<String> orderList = JSONArray.parseArray(orderNos, String.class);
|
|
List<String> orderList = JSONArray.parseArray(orderNos, String.class);
|
|
List<PalletMatchLog> palletMatchLogList = palletMatchLogService.checkOrderNoAndGetPalletMatchLogList(orderList);
|
|
List<PalletMatchLog> palletMatchLogList = palletMatchLogService.checkOrderNoAndGetPalletMatchLogList(orderList);
|
|
@@ -2852,7 +2853,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
* 分拣出库
|
|
* 分拣出库
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
public Boolean separatePick(String orderNos) {
|
|
public Boolean separatePick(String orderNos) {
|
|
List<String> orderList = JSONArray.parseArray(orderNos, String.class);
|
|
List<String> orderList = JSONArray.parseArray(orderNos, String.class);
|
|
List<WmsDocOrderHeader> wmsDocOrderHeaderList = wmsDocOrderHeaderMapper.selectList(Wrappers.<WmsDocOrderHeader>lambdaQuery().
|
|
List<WmsDocOrderHeader> wmsDocOrderHeaderList = wmsDocOrderHeaderMapper.selectList(Wrappers.<WmsDocOrderHeader>lambdaQuery().
|
|
@@ -2882,7 +2883,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
* 反拣出库
|
|
* 反拣出库
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
public Boolean reversePickInventoryMatch(String orderNos) {
|
|
public Boolean reversePickInventoryMatch(String orderNos) {
|
|
List<String> orderList = JSONArray.parseArray(orderNos, String.class);
|
|
List<String> orderList = JSONArray.parseArray(orderNos, String.class);
|
|
palletMatchLogService.checkOrderNoAndGetPalletMatchLogList(orderList);
|
|
palletMatchLogService.checkOrderNoAndGetPalletMatchLogList(orderList);
|
|
@@ -2920,7 +2921,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
* PDA理货备货/分拣组盘(不传出库单号)
|
|
* PDA理货备货/分拣组盘(不传出库单号)
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
public AjaxResult pdaGroupDisk(PdaGroupDiskDTO pdaGroupDiskDTO) {
|
|
public AjaxResult pdaGroupDisk(PdaGroupDiskDTO pdaGroupDiskDTO) {
|
|
GroupDiskConvertDTO groupDiskConvertDTO = buildGroupDiskConvertDTO(pdaGroupDiskDTO);
|
|
GroupDiskConvertDTO groupDiskConvertDTO = buildGroupDiskConvertDTO(pdaGroupDiskDTO);
|
|
String locationId = invLotLocGroupDisk(groupDiskConvertDTO);
|
|
String locationId = invLotLocGroupDisk(groupDiskConvertDTO);
|
|
@@ -2935,7 +2936,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
* PDA反拣组盘
|
|
* PDA反拣组盘
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
public AjaxResult pdaReversePickGroupDisk(ReversePickGroupDiskDTO reversePickGroupDiskDTO){
|
|
public AjaxResult pdaReversePickGroupDisk(ReversePickGroupDiskDTO reversePickGroupDiskDTO){
|
|
ReversePickConvertDTO reversePickConvertDTO = buildReversePickConvertDTO(reversePickGroupDiskDTO);
|
|
ReversePickConvertDTO reversePickConvertDTO = buildReversePickConvertDTO(reversePickGroupDiskDTO);
|
|
//判断反拣类型为解绑还是扩容
|
|
//判断反拣类型为解绑还是扩容
|
|
@@ -2963,7 +2964,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
* PDA解绑物料
|
|
* PDA解绑物料
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- @Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
public AjaxResult pdaUnbind(UnbindDTO unbindDTO) {
|
|
public AjaxResult pdaUnbind(UnbindDTO unbindDTO) {
|
|
InvLotLocId invLotLocId = invLotLocIdService.queryInvLotLocIdByLotnum(unbindDTO.getLotnum());
|
|
InvLotLocId invLotLocId = invLotLocIdService.queryInvLotLocIdByLotnum(unbindDTO.getLotnum());
|
|
Long locationId = unbindWmsBox(unbindDTO.getPalletTo(), unbindDTO.getPalletFrom());
|
|
Long locationId = unbindWmsBox(unbindDTO.getPalletTo(), unbindDTO.getPalletFrom());
|
|
@@ -3173,6 +3174,16 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
.eq(WmsDocOrderHeader::getOrderNo, orderNo)) > 0;
|
|
.eq(WmsDocOrderHeader::getOrderNo, orderNo)) > 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public BigDecimal getPalletInvCount(String palletNo) {
|
|
|
|
+ List<InvLotAtt> invLotAttList = invLotAttService.queryInvLotAtt(palletNo);
|
|
|
|
+ if (CollectionUtil.isEmpty(invLotAttList)) return BigDecimal.ZERO;
|
|
|
|
+ List<InvLotLocId> invLotLocIdList = invLotLocIdService.queryInvLotLocIdByLotnum(invLotAttList.stream().map(InvLotAtt::getLotnum).collect(Collectors.toList()));
|
|
|
|
+ if (CollectionUtil.isEmpty(invLotLocIdList)) return BigDecimal.ZERO;
|
|
|
|
+ long count = invLotLocIdList.stream().filter(item -> Constant.LOC_SORTATION_CACHE.equals(Long.parseLong(item.getLocationId()))).count();
|
|
|
|
+ return new BigDecimal(count);
|
|
|
|
+ }
|
|
|
|
+
|
|
private void unbindWmsDocOrder(String erpNo, String orderNo, BigDecimal qty, String sku, String sn){
|
|
private void unbindWmsDocOrder(String erpNo, String orderNo, BigDecimal qty, String sku, String sn){
|
|
List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsService.queryWmsDocOrderDetails(orderNo, sku);
|
|
List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsService.queryWmsDocOrderDetails(orderNo, sku);
|
|
if (CollectionUtil.isEmpty(wmsDocOrderDetailsList)) throw new BaseException("出库单明细为空!");
|
|
if (CollectionUtil.isEmpty(wmsDocOrderDetailsList)) throw new BaseException("出库单明细为空!");
|
|
@@ -3253,10 +3264,10 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
String asnNo = invLotAttList.stream().filter(item -> item.getLotnum().equals(invLotLocId.getLotnum())).
|
|
String asnNo = invLotAttList.stream().filter(item -> item.getLotnum().equals(invLotLocId.getLotnum())).
|
|
map(InvLotAtt::getLotatt08).findFirst().orElseThrow(() -> new BaseException("此批次入库信息丢失!"));
|
|
map(InvLotAtt::getLotatt08).findFirst().orElseThrow(() -> new BaseException("此批次入库信息丢失!"));
|
|
String sku = groupDiskConvertDTO.getSku();
|
|
String sku = groupDiskConvertDTO.getSku();
|
|
- invLotAttService.insertInvLotAtt(buildInvLotAtt(groupDiskConvertDTO.getLotNum(), groupDiskConvertDTO.getPalletTo(),
|
|
|
|
- orderNo, sn, sku, asnNo, "cause is pda group disk"));
|
|
|
|
//验证托盘相关信息并获取指向托盘库位信息
|
|
//验证托盘相关信息并获取指向托盘库位信息
|
|
String locationId = verifyInvLotAndGetLocationId(groupDiskConvertDTO.getPalletTo(), sn, orderNo);
|
|
String locationId = verifyInvLotAndGetLocationId(groupDiskConvertDTO.getPalletTo(), sn, orderNo);
|
|
|
|
+ invLotAttService.insertInvLotAtt(buildInvLotAtt(groupDiskConvertDTO.getLotNum(), groupDiskConvertDTO.getPalletTo(),
|
|
|
|
+ orderNo, sn, sku, asnNo, "cause is pda group disk"));
|
|
locationId = StringUtils.isNotBlank(locationId) ? locationId : invLotLocId.getLocationId();
|
|
locationId = StringUtils.isNotBlank(locationId) ? locationId : invLotLocId.getLocationId();
|
|
if (CompareUtil.compare(groupDiskConvertDTO.getGroupDiskQty(), invLotLocQty) >= 0) {
|
|
if (CompareUtil.compare(groupDiskConvertDTO.getGroupDiskQty(), invLotLocQty) >= 0) {
|
|
invLotLocIdService.updateInvLotLocId(invLotLocId.getLotnum(), groupDiskConvertDTO.getLotNum(),
|
|
invLotLocIdService.updateInvLotLocId(invLotLocId.getLotnum(), groupDiskConvertDTO.getLotNum(),
|
|
@@ -3327,7 +3338,8 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
List<InvLotAtt> palletNoToInvLotAttList = invLotAttService.queryInvLotAtt(palletNoTo);
|
|
List<InvLotAtt> palletNoToInvLotAttList = invLotAttService.queryInvLotAtt(palletNoTo);
|
|
if (CollectionUtil.isEmpty(palletNoToInvLotAttList)) return null;
|
|
if (CollectionUtil.isEmpty(palletNoToInvLotAttList)) return null;
|
|
if (StringUtils.isNotBlank(sn) && CollectionUtil.isNotEmpty(palletNoToInvLotAttList.stream()
|
|
if (StringUtils.isNotBlank(sn) && CollectionUtil.isNotEmpty(palletNoToInvLotAttList.stream()
|
|
- .filter(item -> item.getLotatt02().equals(sn)).collect(Collectors.toList()))) {
|
|
|
|
|
|
+ .filter(item -> (StringUtils.isNotBlank(orderNo) ? StringUtils.isNotBlank(item.getLotatt14()) : Boolean.TRUE)
|
|
|
|
+ && item.getLotatt02().equals(sn)).collect(Collectors.toList()))) {
|
|
throw new BaseException("该条码已生成批次");
|
|
throw new BaseException("该条码已生成批次");
|
|
}
|
|
}
|
|
//验证是否已经有不同出库单备货了
|
|
//验证是否已经有不同出库单备货了
|