fix: 备货区任务修改

This commit is contained in:
2024-06-29 14:10:32 +08:00
parent 1a86159e34
commit d851b6c6ba
4 changed files with 51 additions and 13 deletions

View File

@@ -70,4 +70,11 @@ public interface IPdmBiSlittingproductionplanService extends IService<PdmBiSlitt
* @return /
*/
List<SlitterPlanDistinctDto> getAllHalfPlan(List<String> qzzs);
/**
* 根据子卷获取分切
* @param containerName 子卷
* @return /
*/
PdmBiSlittingproductionplan getByContainerName(String containerName);
}

View File

@@ -104,5 +104,12 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
return pdmBiSlittingproductionplanMapper.getAllHalfPlan(qzzs);
}
@Override
public PdmBiSlittingproductionplan getByContainerName(String containerName) {
LambdaQueryWrapper<PdmBiSlittingproductionplan> lam = new QueryWrapper<PdmBiSlittingproductionplan>().lambda();
lam.eq(PdmBiSlittingproductionplan::getContainer_name, containerName);
return pdmBiSlittingproductionplanMapper.selectOne(lam);
}
}

View File

@@ -243,15 +243,6 @@ public class AutoCallAirShaftTask {
// 找一个点位: 目的需要的点位
BstIvtStockingivt needPoint = stockingivtList.get(0);
// 找到就创建AGV搬运任务
// 查找一个没有任务的空位
List<BstIvtStockingivt> list = stockingivtService.getEmptyPointNotTask(location, "0");
if (list.size() == 0) {
noticeService.createNotice("备货区找不到空位置搬运",
"点位[" + empty.getPoint_name() + "]无法从备货区找到空位",
NoticeTypeEnum.EXCEPTION.getCode());
return;
}
BstIvtStockingivt endPoint = list.get(0);
// 筛选3个位置中数量最少的搬走
BstIvtStockingivt needMovePoint = stockingivtService.getCanMovePointOne(location, "1");
// 空位就直接创建搬过来的任务
@@ -261,6 +252,7 @@ public class AutoCallAirShaftTask {
param.put("point_code1", needPoint.getPoint_code());
param.put("point_code2", needMovePoint.getPoint_code());
param.put("vehicle_code", needPoint.getVehicle_code());
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
param.put("task_type", SlitterEnum.TASK_TYPE.code("备货区送纸管"));
// 存储纸管信息
List<MdPbPapervehicle> paperList = mdPbPapervehicleService.list(new LambdaQueryWrapper<MdPbPapervehicle>()
@@ -269,6 +261,15 @@ public class AutoCallAirShaftTask {
stockAreaCallTubeTask.createTask(param);
return;
}
// 查找一个没有任务的空位
List<BstIvtStockingivt> list = stockingivtService.getEmptyPointNotTask(location, "0");
if (list.size() == 0) {
noticeService.createNotice("备货区找不到空位置搬运",
"点位[" + empty.getPoint_name() + "]无法从备货区找到空位",
NoticeTypeEnum.EXCEPTION.getCode());
return;
}
BstIvtStockingivt endPoint = list.get(0);
// 创建任务 -> HINT: 在此任务完成之后会调用搬回来的任务,因此任务中要记录需要搬运的点位放在任务请求参数中。
JSONObject param = new JSONObject();
param.put("point_code1", needMovePoint.getPoint_code());

View File

@@ -840,6 +840,9 @@ public class SlitterServiceImpl implements SlitterService {
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject acsActionFinishRequestToRelease(JSONObject param) {
JSONObject result = new JSONObject();
result.put("status", HttpStatus.HTTP_OK);
result.put("message", "反馈取货成功!");
String taskCode = param.getString("task_code");
if (ObjectUtil.isEmpty(taskCode)) {
throw new BadRequestException("ACS二楼请求取货完成失败任务号不能为空!");
@@ -848,6 +851,11 @@ public class SlitterServiceImpl implements SlitterService {
// 起点释放
String startPoint = task.getPoint_code1();
BstIvtCutpointivt startPointObj = bcutpointivtService.getPintByAgvCode(startPoint, false);
if (ObjectUtil.isEmpty(startPointObj)) {
log.error("BstIvtCutpointivt-任务{}起点不存在,放行", taskCode);
result.put("message", "不更新库存,放行!");
return result;
}
startPointObj.setPoint_status("1");
startPointObj.setQzz_no1("");
startPointObj.setQzz_no2("");
@@ -856,9 +864,6 @@ public class SlitterServiceImpl implements SlitterService {
task.setTask_status(TaskStatusEnum.PICK_UP_COMPLETED.getCode());
TaskUtils.updateOptMessageByTask(task);
taskService.updateById(task);
JSONObject result = new JSONObject();
result.put("status", HttpStatus.HTTP_OK);
result.put("message", "反馈取货成功!");
return result;
}
@@ -976,7 +981,25 @@ public class SlitterServiceImpl implements SlitterService {
@Override
public JSONObject slitterSpliceOperation(JSONObject param) {
// todo:
// paramOutsideContainerName 、 InsideContainerName、CarrierStatus
String outsideContainerName = param.getString("OutsideContainerName");
String insideContainerName = param.getString("InsideContainerName");
String carrierStatus = param.getString("CarrierStatus");
if (SlitterConstant.SLITTER_NO.equals(carrierStatus)) {
// 不下卷需要修改。
PdmBiSlittingproductionplan outPlan = slittingproductionplanService.getByContainerName(outsideContainerName);
PdmBiSlittingproductionplan inPlan = slittingproductionplanService.getByContainerName(insideContainerName);
outPlan.setQzzno(inPlan.getQzzno());
outPlan.setStatus(inPlan.getStatus());
outPlan.setIs_child_tz_ok(inPlan.getIs_child_tz_ok());
outPlan.setIs_paper_ok(inPlan.getIs_paper_ok());
TaskUtils.updateOptMessageBySlitterPlan(outPlan);
inPlan.setQzzno(inPlan.getQzzno() + "拼接");
inPlan.setStatus("09");
TaskUtils.updateOptMessageBySlitterPlan(outPlan);
List<PdmBiSlittingproductionplan> collect = Stream.of(outPlan, inPlan).collect(Collectors.toList());
slittingproductionplanService.updateBatchById(collect);
}
return null;
}
}