|
|
@ -1582,6 +1582,77 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd |
|
|
|
return Resp.scanSuccess("下架成功","成功下架"+num+"件"); |
|
|
|
return Resp.scanSuccess("下架成功","成功下架"+num+"件"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public R downPackageAndDelTrayAndIsUpdate(List<UpShelfPackageDTO> upShelfPackageList,Long warehouseId,String remark,boolean isOrNo) { |
|
|
|
|
|
|
|
int num = 0; |
|
|
|
|
|
|
|
Set<String> orderSet = new TreeSet<>(); |
|
|
|
|
|
|
|
for (UpShelfPackageDTO upShelfPackageDTO:upShelfPackageList){ |
|
|
|
|
|
|
|
String orderPackageCode = upShelfPackageDTO.getOrderPackageCode(); |
|
|
|
|
|
|
|
//查询包件在哪个库位上
|
|
|
|
|
|
|
|
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapper.eq("association_type","3") |
|
|
|
|
|
|
|
.eq("warehouse_id",warehouseId) |
|
|
|
|
|
|
|
.eq("association_value",orderPackageCode); |
|
|
|
|
|
|
|
WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(queryWrapper); |
|
|
|
|
|
|
|
if(Objects.isNull(updownGoodsEntity)){ |
|
|
|
|
|
|
|
log.warn("##############downPackage: 包件没有上架记录 orderPackageCode={}",orderPackageCode); |
|
|
|
|
|
|
|
//判断是否有打托记录
|
|
|
|
|
|
|
|
QueryWrapper<WarehouseTrayGoodsEntity> trayGoodsEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
trayGoodsEntityQueryWrapper.eq("association_type","3") |
|
|
|
|
|
|
|
.eq("warehouse_id",warehouseId) |
|
|
|
|
|
|
|
.eq("association_value",orderPackageCode); |
|
|
|
|
|
|
|
WarehouseTrayGoodsEntity warehouseTrayGoodsEntity = warehouseTrayGoodsService.getOne(trayGoodsEntityQueryWrapper); |
|
|
|
|
|
|
|
if(!Objects.isNull(warehouseTrayGoodsEntity)){ |
|
|
|
|
|
|
|
//有托盘,托盘下托
|
|
|
|
|
|
|
|
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode,remark,warehouseId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Long allocationId = updownGoodsEntity.getAllocationId(); |
|
|
|
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode,warehouseId); |
|
|
|
|
|
|
|
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"); |
|
|
|
|
|
|
|
//如果有托盘还要删除托盘与库位的绑定
|
|
|
|
|
|
|
|
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()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (String orderCode : orderSet) { |
|
|
|
|
|
|
|
distributionStockArticleClient.updateOrderInfo(orderCode,warehouseId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Resp.scanSuccess("下架成功","成功下架"+num+"件"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R downZeroOrder(List<UpShelfZeroOrderDTO> upShelfPackageList,Long warehouseId,String remark) { |
|
|
|
public R downZeroOrder(List<UpShelfZeroOrderDTO> upShelfPackageList,Long warehouseId,String remark) { |
|
|
|
StringBuffer stringBuffer = new StringBuffer("下架零担订单成功"); |
|
|
|
StringBuffer stringBuffer = new StringBuffer("下架零担订单成功"); |
|
|
|