操作billhead 和billbody的相关代码注释

main
judy 1 year ago
parent bbd1a0f560
commit f112deebbf
  1. 9
      shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java
  2. 43
      shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java
  3. 6
      shkj-wms/src/main/java/com/shkj/wms/service/IPutInOutStorageService.java
  4. 8
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java
  5. 14
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinPickupServiceImpl.java
  6. 57
      shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java
  7. 14
      shkj-wms/src/main/java/com/shkj/wms/service/impl/StackServiceImpl.java

@ -531,7 +531,8 @@ public class PlcEventTask {
if (booleanResult.getCode() == HttpStatus.SUCCESS) {
checkValue = true;
}
} else if (taskType.equals(TaskTypeEnum.seat_adjustment.getValue())) {
}
else if (taskType.equals(TaskTypeEnum.seat_adjustment.getValue())) {
// 处理货位调整的库存
BaseLocationQueryBo bo = new BaseLocationQueryBo();
bo.setLocationRow(businDataTaskServiceById.getFromRow());
@ -565,7 +566,8 @@ public class PlcEventTask {
if (changeType) {
checkValue = true;
}
} else if (TaskTypeEnum.normal_out.getValue().equals(taskType)
}
else if (TaskTypeEnum.normal_out.getValue().equals(taskType)
|| TaskTypeEnum.urgent_out.getValue().equals(taskType)
|| TaskTypeEnum.abnormal_delivery.getValue().equals(taskType)
|| TaskTypeEnum.punching_out.getValue().equals(taskType)
@ -578,7 +580,8 @@ public class PlcEventTask {
if (delStock) {
checkValue = true;
}
} else {
}
else {
if (taskType.equals(TaskTypeEnum.emptyContainer_out.getValue())) {
//处理 15空治具出库 库存
BusinDpscontainerRecord oneByTask = businDpsContainerRecordMapper.selectByTaskid(String.valueOf(taskId));

@ -513,15 +513,15 @@ public class ScheduledTasks {
//生成入库单
if (randome.equals("P01")) {
Result<String> stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
// Result<String> stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
//生成入库单成功
if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) {
businDataTaskVo.setTransId(stringResult.getData());
} else {
// if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) {
// businDataTaskVo.setTransId(stringResult.getData());
// } else {
businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue());
businDataTaskVo.setExceptionMsg("生成入库单失败");
}
//}
}
}
@ -964,7 +964,7 @@ public class ScheduledTasks {
exeBo.setBaseLocationVo(locationVo);
exeBo.setTransNo("1");
exeBo.setTransQual("1");
iPutInOutStorageService.exeTaskPutinStorage(exeBo);
// iPutInOutStorageService.exeTaskPutinStorage(exeBo);
//获取巷道对应的立库输送线接驳口
pointQueryBo.setTunnel(tunnel);
pointQueryBo.setDirection("0");
@ -1102,8 +1102,8 @@ public class ScheduledTasks {
if (ObjectUtils.isNotEmpty(businDataTask) && ObjectUtils.isNotEmpty(businDataTask.getFromLayer())) {
if (ObjectUtils.isNotEmpty(businTaskExeBo)) {
////生成出库单
Result<String> billResult = iPutInOutStorageService.exeTaskPutinStorage(businTaskExeBo);
businDataTask.setTransId(billResult.getData());
// Result<String> billResult = iPutInOutStorageService.exeTaskPutinStorage(businTaskExeBo);
// businDataTask.setTransId(billResult.getData());
}
//添加货位预占和库存预占
//获取货位信息
@ -1278,8 +1278,8 @@ public class ScheduledTasks {
exeBo.setTransNo("2");
exeBo.setTransQual("2");
////生成出库单
Result<String> billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
businDataTaskVo.setTransId(billResult.getData());
// Result<String> billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
// businDataTaskVo.setTransId(billResult.getData());
} else {
businDataTaskVo.setExceptionMsg("下发堆垛机指令失败");
businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue());
@ -1385,8 +1385,8 @@ public class ScheduledTasks {
exeBo.setTransNo("2");
exeBo.setTransQual("2");
Result<String> billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
businDataTaskVo.setTransId(billResult.getData());
// Result<String> billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
// businDataTaskVo.setTransId(billResult.getData());
//添加货位预占和库存预占
//获取货位信息
baseLocationVo.setLocationStatus("4");
@ -1536,8 +1536,8 @@ public class ScheduledTasks {
exeBo.setTransNo("2");
exeBo.setTransQual("2");
Result<String> billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
businDataTaskVo.setTransId(billResult.getData());
// Result<String> billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
// businDataTaskVo.setTransId(billResult.getData());
//添加货位预占和库存预占
//获取货位信息
baseLocationVo.setLocationStatus("4");
@ -1984,6 +1984,7 @@ public class ScheduledTasks {
businDataTaskVo.setToLayer(locationVo.getLayer());
businDataTaskVo.setToRow(locationVo.getLocationRow());
businDataTaskVo.setTunnel(tunnel);
businDataTaskVo.setLocationId(locationVo.getId());
//获取货位对应的巷道及巷道对应的设备信息
pointQueryBo.setTunnel(tunnel);
pointQueryBo.setDirection("0");
@ -2112,15 +2113,15 @@ public class ScheduledTasks {
//生成入库单
if (randome.equals("P01")) {
Result<String> stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
// Result<String> stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
//生成入库单成功
if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) {
businDataTaskVo.setTransId(stringResult.getData());
} else {
businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue());
businDataTaskVo.setExceptionMsg("生成入库单失败");
}
// if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) {
// businDataTaskVo.setTransId(stringResult.getData());
// } else {
// businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue());
// businDataTaskVo.setExceptionMsg("生成入库单失败");
// }
}
}

@ -20,6 +20,12 @@ public interface IPutInOutStorageService extends IService<BasePointDevice> {
/** 自动入库*/
public Result<Long > saveBusinBillTaskData(MachineHandAddBo bo,String type);
/**
* 下挂生成相关任务
* @param bo
* @return
*/
public Result<Long > saveBusinBillTaskData(MachineHandAddBo bo);
/**

@ -541,6 +541,9 @@ public class BusinDataTaskServiceImpl extends ServiceImpl<BusinDataTaskMapper, B
}
}
if(StringUtils.isEmpty(sysStockDetailVoList.get(0).getGoodsNo())){
return Result.err().msg("此货位未查询到保险杠信息不可出库,请确认!" + locationCode);
}
//需要搬运到的码头信息
String toPoint = sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.abnormal_out_point);
@ -1741,7 +1744,7 @@ public class BusinDataTaskServiceImpl extends ServiceImpl<BusinDataTaskMapper, B
if (booleanResult.getCode() == HttpStatus.SUCCESS.getCode()) {
businDataTask.setTaskStatus(TaskStatusEnum.wait_callback.getValue());
this.updateById(businDataTask);
Result<String> billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
// Result<String> billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
//扣除库存
List<BusinDataTaskGoodsVo> DataTaskGoodsList = baseDeriveTraverseVo.getBusinDataTaskGoodsList();
for (BusinDataTaskGoodsVo dateTaskgoods : DataTaskGoodsList
@ -2010,6 +2013,9 @@ public class BusinDataTaskServiceImpl extends ServiceImpl<BusinDataTaskMapper, B
dataTaskAdd.setToRow(inBaseLocation.getLocationRow());
dataTaskAdd.setToColumn(inBaseLocation.getLocationColumn());
dataTaskAdd.setTaskType(TaskTypeEnum.seat_adjustment.getValue());
dataTaskAdd.setFromRow(outBaseLocation.getLocationRow());
dataTaskAdd.setFromLayer(outBaseLocation.getLayer());
dataTaskAdd.setFromColumn(outBaseLocation.getLocationColumn());
}
for (SysStockDetailVo sysStockDetailVo : sysStockDetailVos) {

@ -274,14 +274,14 @@ public class BusinPickupServiceImpl extends ServiceImpl<BusinPickupMapper, Busin
if (booleanResult.getCode()==HttpStatus.SUCCESS.getCode()){
businDataTask.setTaskStatus("1");
//生成入库单
Result<String> stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
// Result<String> stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
//生成入库单成功
if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) {
businDataTask.setTransId(stringResult.getData());
} else {
businDataTask.setTaskStatus(TaskStatusEnum.err.getValue());
businDataTask.setExceptionMsg("生成入库单失败");
}
// if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) {
// businDataTask.setTransId(stringResult.getData());
// } else {
// businDataTask.setTaskStatus(TaskStatusEnum.err.getValue());
// businDataTask.setExceptionMsg("生成入库单失败");
// }
iBusinDataTaskService.updateById(businDataTask);
}
}

@ -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);

@ -417,14 +417,14 @@ public class StackServiceImpl implements IStackService {
businDataTaskVo.setTaskPath(toLocation);
businDataTaskVo.setTaskStatus(TaskStatusEnum.wait_callback.getValue());
//生成入库单
Result<String> stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
// Result<String> stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo);
//生成入库单成功
if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) {
businDataTaskVo.setTransId(stringResult.getData());
} else {
businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue());
businDataTaskVo.setExceptionMsg("生成入库单失败");
}
// if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) {
// businDataTaskVo.setTransId(stringResult.getData());
// } else {
// businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue());
// businDataTaskVo.setExceptionMsg("生成入库单失败");
//}
//修改冲孔完成
BasePunchRecord basePunchRecord = iBasePunchRecordService.getOne(new LambdaQueryWrapper<BasePunchRecord>()
.eq(BasePunchRecord::getTaskCode,Long.valueOf(endIdArr[0]))

Loading…
Cancel
Save