|
|
|
|
@ -124,7 +124,15 @@ public class PutInOutStorageServiceImpl extends ServiceImpl<BasePointDeviceMappe |
|
|
|
|
@Resource |
|
|
|
|
BaseInventoryRatioService baseInventoryRatioService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
IBaseAreaService iBaseAreaService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 下挂生成相关任务 |
|
|
|
|
* @param bo |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public Result<Long> saveBusinBillTaskData(MachineHandAddBo bo) { |
|
|
|
|
@ -1031,17 +1039,16 @@ public class PutInOutStorageServiceImpl extends ServiceImpl<BasePointDeviceMappe |
|
|
|
|
bodyQueryBo.setTaskId(taskId); |
|
|
|
|
|
|
|
|
|
BusinDataTask businDataTask = iBusinDataTaskService.getById(taskId); |
|
|
|
|
BaseLocation baseLocation=null; |
|
|
|
|
if (StringUtils.isNotEmpty(businDataTask.getLocationId().toString())){ |
|
|
|
|
baseLocation= iBaseLocationService.getById(businDataTask.getLocationId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(taskId); |
|
|
|
|
//获取要入库的物料信息
|
|
|
|
|
List<BusinBillHeadbodyInVo> bodyInOutDatas = iBusinBillheadService.getBillHeadBodyInOutData(bodyQueryBo); |
|
|
|
|
//List<BusinBillHeadbodyInVo> bodyInOutDatas = iBusinBillheadService.getBillHeadBodyInOutData(bodyQueryBo);
|
|
|
|
|
if(businDataTask.getTaskType().equals(TaskTypeEnum.emptyCon.getValue()) || businDataTask.getTaskType().equals(TaskTypeEnum.empty_in.getValue())){ |
|
|
|
|
//改货位状态
|
|
|
|
|
//获取货位
|
|
|
|
|
// BaseLocation baseLocation = iBaseLocationService.getOne(new LambdaQueryWrapper<BaseLocation>()
|
|
|
|
|
// .eq(BaseLocation::getLocationColumn, businDataTask.getToColumn())
|
|
|
|
|
// .eq(BaseLocation::getLayer, businDataTask.getToLayer())
|
|
|
|
|
// .eq(BaseLocation::getLocationRow, businDataTask.getToRow())
|
|
|
|
|
// .eq(BaseLocation::getLocationStatus,"4"));
|
|
|
|
|
BaseLocation baseLocation = iBaseLocationService.getById(businDataTask.getLocationId()); |
|
|
|
|
baseLocation.setLocationStatus("2"); |
|
|
|
|
//添加库存
|
|
|
|
|
//TODO 空治具出库是没有处理库存流程 考虑入库时是否添加库存
|
|
|
|
|
@ -1062,10 +1069,10 @@ public class PutInOutStorageServiceImpl extends ServiceImpl<BasePointDeviceMappe |
|
|
|
|
return businDataTaskMapper.updateById(businDataTask)>0?Result.ok():Result.err(); |
|
|
|
|
} |
|
|
|
|
if (businDataTask.getTaskType().equals(TaskTypeEnum.scancode_err.getValue())){ |
|
|
|
|
BaseLocation baseLocation = iBaseLocationService.getOne(new LambdaQueryWrapper<BaseLocation>() |
|
|
|
|
.eq(BaseLocation::getLocationColumn, businDataTask.getToColumn()) |
|
|
|
|
.eq(BaseLocation::getLayer, businDataTask.getToLayer()) |
|
|
|
|
.eq(BaseLocation::getLocationRow, businDataTask.getToRow())); |
|
|
|
|
// BaseLocation baseLocation = iBaseLocationService.getOne(new LambdaQueryWrapper<BaseLocation>()
|
|
|
|
|
// .eq(BaseLocation::getLocationColumn, businDataTask.getToColumn())
|
|
|
|
|
// .eq(BaseLocation::getLayer, businDataTask.getToLayer())
|
|
|
|
|
// .eq(BaseLocation::getLocationRow, businDataTask.getToRow()));
|
|
|
|
|
baseLocation.setLocationStatus("2"); |
|
|
|
|
SysStockDetail sysStockDetail = new SysStockDetail(); |
|
|
|
|
sysStockDetail.setQty(new BigDecimal("1")); |
|
|
|
|
@ -1083,7 +1090,7 @@ public class PutInOutStorageServiceImpl extends ServiceImpl<BasePointDeviceMappe |
|
|
|
|
iSysStockDetailService.save(sysStockDetail); |
|
|
|
|
return businDataTaskMapper.updateById(businDataTask)>0?Result.ok():Result.err(); |
|
|
|
|
} |
|
|
|
|
if(ObjectUtils.isEmpty(bodyInOutDatas)){ |
|
|
|
|
if(ObjectUtils.isEmpty(businDataTaskGoodsVos)){ |
|
|
|
|
return Result.err().msg("没有要处理的库存信息"); |
|
|
|
|
} |
|
|
|
|
Long locationCode=0L; |
|
|
|
|
@ -1093,24 +1100,24 @@ public class PutInOutStorageServiceImpl extends ServiceImpl<BasePointDeviceMappe |
|
|
|
|
int isPunching=0; |
|
|
|
|
int isRepair=0; |
|
|
|
|
List<BaseBarcodesIn> barcodesIns = new ArrayList<>(); |
|
|
|
|
locationCode = baseLocation.getId(); |
|
|
|
|
BaseArea baseArea = iBaseAreaService.getById(baseLocation.getAreaId()); |
|
|
|
|
storageCode = baseArea.getStorageId(); |
|
|
|
|
batch = businDataTask.getBatch(); |
|
|
|
|
containerCode = businDataTask.getContainerId(); |
|
|
|
|
List goods = new ArrayList(); |
|
|
|
|
for (BusinBillHeadbodyInVo bodyInOutData : bodyInOutDatas) { |
|
|
|
|
locationCode = bodyInOutData.getLocationCode(); |
|
|
|
|
storageCode = bodyInOutData.getStorageCode(); |
|
|
|
|
batch = bodyInOutData.getBatch(); |
|
|
|
|
isRepair += Integer.valueOf(bodyInOutData.getIsRepair()); |
|
|
|
|
isPunching += Integer.valueOf(bodyInOutData.getIsPunching()); |
|
|
|
|
containerCode = bodyInOutData.getContainerCode(); |
|
|
|
|
for (BusinDataTaskGoodsVo taskGoodsVo : businDataTaskGoodsVos) { |
|
|
|
|
isRepair += Integer.valueOf(taskGoodsVo.getIsRepair()); |
|
|
|
|
isPunching += Integer.valueOf(taskGoodsVo.getIsPunching()); |
|
|
|
|
|
|
|
|
|
Map goodsMap =new HashMap(); |
|
|
|
|
goodsMap.put("goodsNo",bodyInOutData.getGoodsNo()); |
|
|
|
|
goodsMap.put("qrCode",bodyInOutData.getQrCode()); |
|
|
|
|
goodsMap.put("goodsNo",taskGoodsVo.getGoodsNo()); |
|
|
|
|
goodsMap.put("qrCode",taskGoodsVo.getQrCode()); |
|
|
|
|
goods.add(goodsMap); |
|
|
|
|
|
|
|
|
|
// TODO 测试注释 要打开
|
|
|
|
|
//更改入库条码状态
|
|
|
|
|
BaseBarcodesIn baseBarcodesIn = iBaseBarcodesInService.getOne(new LambdaQueryWrapper<BaseBarcodesIn>() |
|
|
|
|
.eq(BaseBarcodesIn::getQrCode, bodyInOutData.getQrCode()).last("limit 1")); |
|
|
|
|
|
|
|
|
|
.eq(BaseBarcodesIn::getQrCode, taskGoodsVo.getQrCode()).last("limit 1")); |
|
|
|
|
baseBarcodesIn.setInStatus("4"); |
|
|
|
|
baseBarcodesIn.setInDate(DateUtils.getDate()); |
|
|
|
|
barcodesIns.add(baseBarcodesIn); |
|
|
|
|
|