|
@ -66,7 +66,7 @@ public class MJXLTask extends AbstractTask { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
// @Transactional(rollbackFor = Exception.class)
|
|
|
// @Transactional(rollbackFor = Exception.class)
|
|
|
protected void create() throws BadRequestException { |
|
|
protected synchronized void create() throws BadRequestException { |
|
|
// 获取任务
|
|
|
// 获取任务
|
|
|
List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY); |
|
|
List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY); |
|
|
// 配置信息
|
|
|
// 配置信息
|
|
@ -79,7 +79,7 @@ public class MJXLTask extends AbstractTask { |
|
|
String extGroupData = task.getExt_group_data(); |
|
|
String extGroupData = task.getExt_group_data(); |
|
|
JSONObject jsonObject = JSONObject.parseObject(extGroupData); |
|
|
JSONObject jsonObject = JSONObject.parseObject(extGroupData); |
|
|
String materialType = jsonObject.getString("material_type"); |
|
|
String materialType = jsonObject.getString("material_type"); |
|
|
SchBasePoint point = findNextPoint(startPoint, jsonObject); |
|
|
SchBasePoint point = findNextPoint(startPoint, jsonObject,task); |
|
|
if (ObjectUtil.isEmpty(point)) { |
|
|
if (ObjectUtil.isEmpty(point)) { |
|
|
task.setRemark("未找到所需点位!"); |
|
|
task.setRemark("未找到所需点位!"); |
|
|
taskService.update(task); |
|
|
taskService.update(task); |
|
@ -99,8 +99,8 @@ public class MJXLTask extends AbstractTask { |
|
|
|
|
|
|
|
|
//发起任务时先把点位占用,防止发起重复任务
|
|
|
//发起任务时先把点位占用,防止发起重复任务
|
|
|
// point.setIng_task_code(task.getTask_code());
|
|
|
// point.setIng_task_code(task.getTask_code());
|
|
|
point.setVehicle_type(materialType); |
|
|
// point.setVehicle_type(materialType);
|
|
|
pointService.update(point); |
|
|
// pointService.update(point);
|
|
|
|
|
|
|
|
|
//下发
|
|
|
//下发
|
|
|
this.renotifyAcs(task); |
|
|
this.renotifyAcs(task); |
|
@ -118,7 +118,7 @@ public class MJXLTask extends AbstractTask { |
|
|
* @param extGroupData |
|
|
* @param extGroupData |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
private SchBasePoint findNextPoint(SchBasePoint startPoint, JSONObject extGroupData) { |
|
|
private SchBasePoint findNextPoint(SchBasePoint startPoint, JSONObject extGroupData,SchBaseTask task) { |
|
|
String regionCode = null; |
|
|
String regionCode = null; |
|
|
String materialType = extGroupData.getString("material_type"); |
|
|
String materialType = extGroupData.getString("material_type"); |
|
|
if ("TBX1".equals(startPoint.getRegion_code())) { |
|
|
if ("TBX1".equals(startPoint.getRegion_code())) { |
|
@ -136,6 +136,10 @@ public class MJXLTask extends AbstractTask { |
|
|
!schBasePoint.getPoint_code().endsWith("06")) { |
|
|
!schBasePoint.getPoint_code().endsWith("06")) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
if(task.getTask_code().equals(schBasePoint.getIng_task_code())){ |
|
|
|
|
|
log.info("点位"+schBasePoint.getPoint_code()+"已被当前任务锁定直接反馈"); |
|
|
|
|
|
return schBasePoint; |
|
|
|
|
|
} |
|
|
if ((ObjectUtil.isEmpty(schBasePoint.getVehicle_type()) || |
|
|
if ((ObjectUtil.isEmpty(schBasePoint.getVehicle_type()) || |
|
|
materialType.equals(schBasePoint.getVehicle_type())) |
|
|
materialType.equals(schBasePoint.getVehicle_type())) |
|
|
&& "2".equals(schBasePoint.getPoint_status()) |
|
|
&& "2".equals(schBasePoint.getPoint_status()) |
|
@ -292,18 +296,19 @@ public class MJXLTask extends AbstractTask { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected void feedbackTaskState(JSONObject param, SchBaseTask schBaseTask, BaseResponse result) { |
|
|
protected synchronized void feedbackTaskState(JSONObject param, SchBaseTask schBaseTask, BaseResponse result) { |
|
|
//重新计算固化室放货点位
|
|
|
//重新计算固化室放货点位
|
|
|
JSONObject extGroupData = JSONObject.parseObject(schBaseTask.getExt_group_data()); |
|
|
JSONObject extGroupData = JSONObject.parseObject(schBaseTask.getExt_group_data()); |
|
|
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
.eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code1())); |
|
|
.eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code1())); |
|
|
SchBasePoint point = findNextPoint(startPoint, extGroupData); |
|
|
SchBasePoint point = findNextPoint(startPoint, extGroupData,schBaseTask); |
|
|
schBaseTask.setPoint_code2(point.getPoint_code()+"0"+(point.getVehicle_qty()+1)); |
|
|
schBaseTask.setPoint_code2(point.getPoint_code()+"0"+(point.getVehicle_qty()+1)); |
|
|
if(ObjectUtil.isNotEmpty(point.getIng_task_code())&&!schBaseTask.getTask_code().equals(point.getIng_task_code())){ |
|
|
if(ObjectUtil.isNotEmpty(point.getIng_task_code())&&!schBaseTask.getTask_code().equals(point.getIng_task_code())){ |
|
|
throw new BadRequestException("当前固化室点位有任务,暂不反馈!"); |
|
|
throw new BadRequestException("当前固化室点位有任务,暂不反馈!"); |
|
|
} |
|
|
} |
|
|
//重算点位时把点位占用
|
|
|
//重算点位时把点位占用
|
|
|
point.setIng_task_code(schBaseTask.getTask_code()); |
|
|
point.setIng_task_code(schBaseTask.getTask_code()); |
|
|
|
|
|
point.setVehicle_type(extGroupData.getString("material_type")); |
|
|
pointService.update(point); |
|
|
pointService.update(point); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|