|
|
|
@ -38,45 +38,47 @@ public class InComingServiceImpl implements IInComingService {
|
|
|
|
|
String trayCode = inComingDTO.getTrayCode();//托盘码
|
|
|
|
|
String trayType = inComingDTO.getTrayType();//打托方式
|
|
|
|
|
|
|
|
|
|
log.info("############incomingPackage: 包件入库开始 orderPackageCode={} billladingId={} warehouseId={}",orderPackageCode,billladingId,warehouseId); |
|
|
|
|
//包件入库开始
|
|
|
|
|
//查询包件是否有数据
|
|
|
|
|
QueryWrapper<TrunklineAdvanceDetailEntity> advanceDetailQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
advanceDetailQueryWrapper.eq("order_package_code",orderPackageCode) |
|
|
|
|
.eq("warehouse_id",warehouseId); |
|
|
|
|
TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailService.getOne(advanceDetailQueryWrapper); |
|
|
|
|
if(Objects.isNull(advanceDetailEntity)){ |
|
|
|
|
log.warn("############incomingPackage: 包件不存在 orderPackageCode={} warehouseId={}",orderPackageCode,warehouseId); |
|
|
|
|
return Resp.scanFail(405,"包件无数据","包件无数据"); |
|
|
|
|
} |
|
|
|
|
Long advanceDetailId = advanceDetailEntity.getId(); |
|
|
|
|
String packageStatus = advanceDetailEntity.getPackageStatus(); |
|
|
|
|
if("1".equals(packageStatus)){ |
|
|
|
|
log.warn("############incomingPackage: 包件已入库 orderPackageCode={} warehouseId={}",orderPackageCode,warehouseId); |
|
|
|
|
return Resp.scanFail(405,"包件已入库","包件已入库"); |
|
|
|
|
} |
|
|
|
|
String[] packageCodes = orderPackageCode.split(","); |
|
|
|
|
for (String packageCode : packageCodes) { |
|
|
|
|
log.info("############incomingPackage: 包件入库开始 packageCode={} billladingId={} warehouseId={}",packageCode,billladingId,warehouseId); |
|
|
|
|
//包件入库开始
|
|
|
|
|
//查询包件是否有数据
|
|
|
|
|
QueryWrapper<TrunklineAdvanceDetailEntity> advanceDetailQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
advanceDetailQueryWrapper.eq("order_package_code",packageCode) |
|
|
|
|
.eq("warehouse_id",warehouseId); |
|
|
|
|
TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailService.getOne(advanceDetailQueryWrapper); |
|
|
|
|
if(Objects.isNull(advanceDetailEntity)){ |
|
|
|
|
log.warn("############incomingPackage: 包件不存在 packageCode={} warehouseId={}",packageCode,warehouseId); |
|
|
|
|
return Resp.scanFail(405,"包件无数据","包件无数据"); |
|
|
|
|
} |
|
|
|
|
Long advanceDetailId = advanceDetailEntity.getId(); |
|
|
|
|
String packageStatus = advanceDetailEntity.getPackageStatus(); |
|
|
|
|
if("1".equals(packageStatus)){ |
|
|
|
|
log.warn("############incomingPackage: 包件已入库 packageCode={} warehouseId={}",packageCode,warehouseId); |
|
|
|
|
return Resp.scanFail(405,"包件已入库","包件已入库"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//1.修改暂存单包件入库状态
|
|
|
|
|
advanceDetailService.updatePackageStatusById("1",advanceDetailId); |
|
|
|
|
//1.修改暂存单包件入库状态
|
|
|
|
|
advanceDetailService.updatePackageStatusById("1",advanceDetailId); |
|
|
|
|
|
|
|
|
|
//2.判断包件和订单是否已经存入在库订单
|
|
|
|
|
advanceService.saveOrderAndPackage(advanceDetailEntity,warehouseId); |
|
|
|
|
//2.判断包件和订单是否已经存入在库订单
|
|
|
|
|
advanceService.saveOrderAndPackage(advanceDetailEntity,warehouseId); |
|
|
|
|
|
|
|
|
|
//3.根据是否有提货单id绑定提货单
|
|
|
|
|
if(!Objects.isNull(billladingId)){ |
|
|
|
|
billladingPackageServicie.saveEntity(orderPackageCode,billladingId,warehouseId,incomingType); |
|
|
|
|
} |
|
|
|
|
//3.根据是否有提货单id绑定提货单
|
|
|
|
|
if(!Objects.isNull(billladingId)){ |
|
|
|
|
billladingPackageServicie.saveEntity(packageCode,billladingId,warehouseId,incomingType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//4.如果有托盘码
|
|
|
|
|
if(StringUtil.isNotBlank(trayCode) && StringUtil.isNotBlank(trayType)){ |
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("trayType",trayType); |
|
|
|
|
map.put("trayCode",trayCode); |
|
|
|
|
map.put("warehouseId",warehouseId); |
|
|
|
|
map.put("orderPackageCode",orderPackageCode); |
|
|
|
|
warehouseTrayTypeClient.orderScanOrderPackageCode(map); |
|
|
|
|
//4.如果有托盘码
|
|
|
|
|
if(StringUtil.isNotBlank(trayCode) && StringUtil.isNotBlank(trayType)){ |
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("trayType",trayType); |
|
|
|
|
map.put("trayCode",trayCode); |
|
|
|
|
map.put("warehouseId",warehouseId); |
|
|
|
|
map.put("orderPackageCode",packageCode); |
|
|
|
|
warehouseTrayTypeClient.orderScanOrderPackageCode(map); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return R.success("入库成功"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|