|
|
|
@ -1587,6 +1587,8 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R downPackageAndDelTrayAndIsUpdate(List<UpShelfPackageDTO> upShelfPackageList, Long warehouseId, String remark, boolean isOrNo) { |
|
|
|
|
|
|
|
|
|
log.info(">>>>> T downPackageAndDelTrayAndIsUpdate start"); |
|
|
|
|
int num = 0; |
|
|
|
|
Set<String> orderSet = new TreeSet<>(); |
|
|
|
|
|
|
|
|
@ -1612,6 +1614,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
|
|
|
|
|
.eq("association_value", orderPackageCode); |
|
|
|
|
WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(queryWrapper); |
|
|
|
|
if (Objects.isNull(updownGoodsEntity)) { |
|
|
|
|
// 有托盘 没有上架
|
|
|
|
|
log.warn("##############downPackage: 包件没有上架记录 orderPackageCode={}", orderPackageCode); |
|
|
|
|
//判断是否有打托记录
|
|
|
|
|
QueryWrapper<WarehouseTrayGoodsEntity> trayGoodsEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
@ -1623,52 +1626,53 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
|
|
|
|
|
//有托盘,托盘下托
|
|
|
|
|
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode, remark, warehouseId); |
|
|
|
|
} |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
DistributionParcelListEntity parcelListEntity =parcelListEntitys.stream() |
|
|
|
|
.filter(t -> t.getOrderPackageCode().equals(orderPackageCode)) |
|
|
|
|
.findFirst() |
|
|
|
|
.orElse(null); |
|
|
|
|
if(parcelListEntity==null){ |
|
|
|
|
log.info(">>>>>>>>>>>>>> 包条找不到 {} ",orderPackageCode); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
// 托盘存在上架
|
|
|
|
|
DistributionParcelListEntity parcelListEntity =parcelListEntitys.stream() |
|
|
|
|
.filter(t -> t.getOrderPackageCode().equals(orderPackageCode)) |
|
|
|
|
.findFirst() |
|
|
|
|
.orElse(null); |
|
|
|
|
if(parcelListEntity==null){ |
|
|
|
|
log.info(">>>>>>>>>>>>>> 包条找不到 {} ",orderPackageCode); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Long allocationId = updownGoodsEntity.getAllocationId(); |
|
|
|
|
Integer quantity = parcelListEntity.getQuantity(); |
|
|
|
|
String orderCode = parcelListEntity.getOrderCode(); |
|
|
|
|
Long updownGoodsId = updownGoodsEntity.getId(); |
|
|
|
|
Long updownTypeId = updownGoodsEntity.getUpdownTypeId(); |
|
|
|
|
WarehouseUpdownTypeEntity updownTypeEntity = baseMapper.selectById(updownTypeId); |
|
|
|
|
QueryWrapper<WarehouseTaryAllocationEntity> taryAllocationEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
taryAllocationEntityQueryWrapper.eq("allocation_id", allocationId) |
|
|
|
|
.eq("is_deleted", 0); |
|
|
|
|
WarehouseTaryAllocationEntity taryAllocationEntity = warehouseTaryAllocationService.getOne(taryAllocationEntityQueryWrapper); |
|
|
|
|
// BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
|
|
|
|
|
if (!Objects.isNull(taryAllocationEntity)) { |
|
|
|
|
//有托盘,托盘下托
|
|
|
|
|
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode, remark, warehouseId); |
|
|
|
|
} |
|
|
|
|
Integer residue = warehouseUpdownGoodsService.deleteByUpdownGoodsId(updownGoodsId); |
|
|
|
|
if (residue == 0) { |
|
|
|
|
//删除上架方式
|
|
|
|
|
removeById(updownTypeId); |
|
|
|
|
//修改库位状态为空闲
|
|
|
|
|
basicdataGoodsAllocationClient.updateAllocationStatus(allocationId, "1"); |
|
|
|
|
//如果有托盘还要删除托盘与库位的绑定
|
|
|
|
|
Long allocationId = updownGoodsEntity.getAllocationId(); |
|
|
|
|
Integer quantity = parcelListEntity.getQuantity(); |
|
|
|
|
String orderCode = parcelListEntity.getOrderCode(); |
|
|
|
|
Long updownGoodsId = updownGoodsEntity.getId(); |
|
|
|
|
Long updownTypeId = updownGoodsEntity.getUpdownTypeId(); |
|
|
|
|
WarehouseUpdownTypeEntity updownTypeEntity = baseMapper.selectById(updownTypeId); |
|
|
|
|
QueryWrapper<WarehouseTaryAllocationEntity> taryAllocationEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
taryAllocationEntityQueryWrapper.eq("allocation_id", allocationId) |
|
|
|
|
.eq("is_deleted", 0); |
|
|
|
|
WarehouseTaryAllocationEntity taryAllocationEntity = warehouseTaryAllocationService.getOne(taryAllocationEntityQueryWrapper); |
|
|
|
|
if (!Objects.isNull(taryAllocationEntity)) { |
|
|
|
|
warehouseTaryAllocationService.deleteById(taryAllocationEntity); |
|
|
|
|
//有托盘,托盘下托
|
|
|
|
|
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode, remark, warehouseId); |
|
|
|
|
} |
|
|
|
|
Integer residue = warehouseUpdownGoodsService.deleteByUpdownGoodsId(updownGoodsId); |
|
|
|
|
if (residue == 0) { |
|
|
|
|
//删除上架方式
|
|
|
|
|
removeById(updownTypeId); |
|
|
|
|
//修改库位状态为空闲
|
|
|
|
|
basicdataGoodsAllocationClient.updateAllocationStatus(allocationId, "1"); |
|
|
|
|
//如果有托盘还要删除托盘与库位的绑定
|
|
|
|
|
if (!Objects.isNull(taryAllocationEntity)) { |
|
|
|
|
warehouseTaryAllocationService.deleteById(taryAllocationEntity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
warehouseUpdownGoodsLogService.saveAllocationAndPackage(updownTypeEntity, parcelListEntity, "2", 0, remark); |
|
|
|
|
if (isOrNo) { |
|
|
|
|
updatePackageGroundingStatus(orderPackageCode, "10", warehouseId); |
|
|
|
|
} |
|
|
|
|
updateUpdownTypeNum(updownTypeEntity); |
|
|
|
|
|
|
|
|
|
orderSet.add(orderCode); |
|
|
|
|
num = num + quantity; |
|
|
|
|
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString()); |
|
|
|
|
} |
|
|
|
|
warehouseUpdownGoodsLogService.saveAllocationAndPackage(updownTypeEntity, parcelListEntity, "2", 0, remark); |
|
|
|
|
if (isOrNo) { |
|
|
|
|
updatePackageGroundingStatus(orderPackageCode, "10", warehouseId); |
|
|
|
|
} |
|
|
|
|
updateUpdownTypeNum(updownTypeEntity); |
|
|
|
|
|
|
|
|
|
orderSet.add(orderCode); |
|
|
|
|
num = num + quantity; |
|
|
|
|
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// for (String orderCode : orderSet) {
|
|
|
|
@ -1680,6 +1684,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
|
|
|
|
|
orderPackageDTO1.setWarehouseId(warehouseId); |
|
|
|
|
orderPackageDTO1.setStrings(orders); |
|
|
|
|
distributionStockArticleClient.updateOrdersInfo(orderPackageDTO1); |
|
|
|
|
log.info(">>>>> T downPackageAndDelTrayAndIsUpdate end"); |
|
|
|
|
|
|
|
|
|
return Resp.scanSuccess("下架成功", "成功下架" + num + "件"); |
|
|
|
|
} |
|
|
|
|