rev:增加任务校验

This commit is contained in:
2025-11-05 09:20:25 +08:00
parent 5209aca9a9
commit 257b512bea
14 changed files with 158 additions and 97 deletions

View File

@@ -27,6 +27,7 @@ import org.nl.system.service.param.ISysParamService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -67,15 +68,10 @@ public class QueryAGVStatus {
JSONObject taskStatus = json.getJSONObject("TaskStatus"); JSONObject taskStatus = json.getJSONObject("TaskStatus");
String instructionCode = taskStatus.getString("TaskNo"); String instructionCode = taskStatus.getString("TaskNo");
if ("true".equals(json.getString("Result")) && instructionCode.equals(instruction.getInstruction_code())) { if ("true".equals(json.getString("Result")) && instructionCode.equals(instruction.getInstruction_code())) {
// 已创建=CREATED // 正在执行=running
// 待分配=TOBEDISPATCHED // 完成=finish
// 正在执行=RUNNING // 失败=failed(主动失败)
// 完成=FINISHED // 终止=aborted(被人为终止)
// 失败=FAILED(主动失败)
// 终止=STOPPED(被人为终止)
// 无法执行=Error(参数错误)
// 等待=WAITING
//执行中
String state = json.getString("Status"); String state = json.getString("Status");
String carNo = json.getString("VehicleNo"); String carNo = json.getString("VehicleNo");
if ("running".equals(state)) { if ("running".equals(state)) {
@@ -85,7 +81,7 @@ public class QueryAGVStatus {
instruction.setInstruction_status("1"); instruction.setInstruction_status("1");
instructionService.update(instruction); instructionService.update(instruction);
instructionService.update(instruction); instructionService.update(instruction);
task.setCarno(carNo); task.setCar_no(carNo);
task.setTask_id(instruction.getTask_id()); task.setTask_id(instruction.getTask_id());
taskService.update(task); taskService.update(task);
} }
@@ -100,10 +96,12 @@ public class QueryAGVStatus {
e.printStackTrace(); e.printStackTrace();
} }
} }
} else if ("paused".equals(state) || "aborted".equals(state) || "Error".equals(state)) { } else if ("failed".equals(state) || "aborted".equals(state)) {
if (!"1".equals(instruction.getInstruction_status())) { TaskDto task = taskService.findById(instruction.getTask_id());
List<String> list = Arrays.asList("0", "1");
if (list.contains(instruction.getInstruction_status())&&"1".equals(task.getTask_status())) {
instruction.setInstruction_status("1"); instruction.setInstruction_status("1");
//todo 备注异常信息 instruction.setRemark("调度取消指令");
instructionService.update(instruction); instructionService.update(instruction);
} }
} }

View File

@@ -57,7 +57,7 @@ public class KeCongAgvServiceImpl implements KeCongAgvService {
@Override @Override
public HttpResponse deleteTask(String instCode) throws Exception { public HttpResponse deleteTask(String instCode) throws Exception {
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("下发科聪任务") .device_code("删除科聪任务")
.content(instCode) .content(instCode)
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
@@ -81,7 +81,7 @@ public class KeCongAgvServiceImpl implements KeCongAgvService {
.timeout(20000) .timeout(20000)
.execute(); .execute();
LuceneLogDto logDto1 = LuceneLogDto.builder() LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code("删除科聪任务") .device_code(instCode)
.content("指令号:" + instCode + ",删除科聪任务序列反馈参数:" + ja) .content("指令号:" + instCode + ",删除科聪任务序列反馈参数:" + ja)
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
@@ -209,10 +209,16 @@ public class KeCongAgvServiceImpl implements KeCongAgvService {
@Override @Override
public JSONObject agvWaitPointRequest(JSONObject requestParam) { public JSONObject agvWaitPointRequest(JSONObject requestParam) {
log.info("科聪二次分配请求参数:" + requestParam); log.info("agv二次分配请求参数:" + requestParam);
String instNo = requestParam.getString("TaskNo"); String instNo = requestParam.getString("TaskNo");
String vehicleNo = requestParam.getString("VehicleNo"); String vehicleNo = requestParam.getString("VehicleNo");
String type = requestParam.getString("type"); // 1 取货点等待 2 放货点等待 String type = requestParam.getString("type"); // 1 取货点等待 2 放货点等待
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(vehicleNo)
.content("agv二次分配请求参数:" + requestParam)
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
Instruction inst = instructionService.findByCodeFromCache(instNo); Instruction inst = instructionService.findByCodeFromCache(instNo);
if (ObjectUtil.isEmpty(inst)) { if (ObjectUtil.isEmpty(inst)) {
throw new BadRequestException("请求失败,未找到指令!"); throw new BadRequestException("请求失败,未找到指令!");
@@ -225,7 +231,13 @@ public class KeCongAgvServiceImpl implements KeCongAgvService {
ja.put("code", "200"); ja.put("code", "200");
ja.put("message", "操作成功"); ja.put("message", "操作成功");
ja.put("point_code", String.valueOf(startAddress)); ja.put("point_code", String.valueOf(startAddress));
log.info("科聪二次分配返回参数:" + ja); log.info("申请取货二次分配成功,返回agv参数:" + ja);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(vehicleNo)
.content("申请取货二次分配成功,返回agv参数:" + inst.getTask_code() + "--" + ja)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
return ja; return ja;
} }
//如果是放货二次分配 //如果是放货二次分配
@@ -237,11 +249,13 @@ public class KeCongAgvServiceImpl implements KeCongAgvService {
ja.put("code", "200"); ja.put("code", "200");
ja.put("message", "操作成功"); ja.put("message", "操作成功");
ja.put("point_code", String.valueOf(nextAddress)); ja.put("point_code", String.valueOf(nextAddress));
log.info("申请放货二次分配成功,返回agv参数:" + ja);
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(vehicleNo) .device_code(vehicleNo)
.content("放货二次分配,参数:" + inst.getTask_code() + "--" + ActionTypeEnum.getStatus(Integer.parseInt(inst.getInstruction_type()))) .content("申请放货二次分配成功,返回agv参数:" + inst.getTask_code() + "--" + ja)
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
return ja; return ja;
} }
throw new BadRequestException("请求失败IN OUT 站点错误!"); throw new BadRequestException("请求失败IN OUT 站点错误!");
@@ -254,7 +268,7 @@ public class KeCongAgvServiceImpl implements KeCongAgvService {
param.put("type", type); param.put("type", type);
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(vehicleNo) .device_code(vehicleNo)
.content("二次分配请求wms,参数:" + inst.getTask_code() + "--" + ActionTypeEnum.getStatus(Integer.parseInt(inst.getInstruction_type()))) .content("二次分配请求wms,参数:" + param)
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -263,21 +277,21 @@ public class KeCongAgvServiceImpl implements KeCongAgvService {
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(vehicleNo) .device_code(vehicleNo)
.content("二次分配请求lms,参数,接口返回:" + jo) .content("二次分配请求wms成功,接口返回参数:" + jo)
.build(); .build();
logDto2.setLog_level(4); logDto2.setLog_level(4);
//二次分配更新点位 //二次分配更新点位
updataTask(inst, jo.getString("data")); updataTask(inst, type,jo.getString("data"));
return jo.getString("data"); return jo.getString("data");
} else { } else {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(vehicleNo) .device_code(vehicleNo)
.content("二次分配请求lms,返回参数:" + jo) .content("二次分配请求wms失败,接口返回参数:" + jo)
.build(); .build();
logDto2.setLog_level(4); logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2); luceneExecuteLogService.deviceExecuteLog(logDto2);
log.info("科聪二次分配请求lms失败,返回参数:" + jo); log.info("二次分配请求wms失败,接口返回参数:" + jo);
throw new BadRequestException("二次分配请求lms返回失败" + jo); throw new BadRequestException("二次分配请求wms返回失败" + jo);
} }
} }
@@ -295,67 +309,72 @@ public class KeCongAgvServiceImpl implements KeCongAgvService {
@Override @Override
public JSONObject applyIn(JSONObject requestParam) { public JSONObject applyIn(JSONObject requestParam) {
log.info("agv申请进入或者离开,请求参数:" + requestParam);
String resourceID = requestParam.getString("point_code"); String resourceID = requestParam.getString("point_code");
String vehicleNo = requestParam.getString("VehicleNo"); String vehicleNo = requestParam.getString("VehicleNo");
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(vehicleNo)
.content("agv申请进入或者离开,请求参数:"+ requestParam)
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
if (resourceID.equals("659") || resourceID.equals("17")) { if (resourceID.equals("659") || resourceID.equals("17")) {
log.info("科聪申请离开请求参数:" + requestParam);
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(vehicleNo)
.content("agv申请进入请求离开成功")
.build();
logDto2.setLog_level(4);
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("code", "200"); json.put("code", "200");
json.put("message", "操作成功"); json.put("message", "操作成功");
log.info("agv申请离开成功返回参数"+ json);
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(vehicleNo)
.content("agv申请离开成功返回参数"+ json)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
return json; return json;
} }
log.info("科聪申请进入请求参数:" + requestParam);
List<StorageCell> storageCells = storageCellMapper.selectList(new LambdaQueryWrapper<StorageCell>().eq(StorageCell::getAddress, resourceID).orderByDesc(StorageCell::getUpdate_time)); List<StorageCell> storageCells = storageCellMapper.selectList(new LambdaQueryWrapper<StorageCell>().eq(StorageCell::getAddress, resourceID).orderByDesc(StorageCell::getUpdate_time));
StorageCell storageCell = storageCells.get(0); StorageCell storageCell = storageCells.get(0);
String storage_code = storageCell.getStorage_code(); String storage_code = storageCell.getStorage_code();
JSONObject ja = new JSONObject(); JSONObject ja = new JSONObject();
ja.put("point_code", storage_code); ja.put("point_code", storage_code);
String response = acsToWmsService.applyIn(ja); String response = acsToWmsService.applyIn(ja);
JSONObject jo = JSON.parseObject(response); JSONObject jo = JSON.parseObject(response);
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
log.info("agv申请进入请求lms成功,参数,接口返回:" + jo);
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(vehicleNo)
.content("agv申请进入请求lms成功,参数,接口返回:" + jo)
.build();
logDto2.setLog_level(4);
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("code", "200"); json.put("code", "200");
json.put("message", "操作成功"); json.put("message", "操作成功");
log.info("科聪申请进入下发返回参数:" + json); log.info("agv申请进入成功返回agv参数:" + json);
return json;
} else {
log.info("agv申请进入请求lms失败,参数,接口返回:" + jo);
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(vehicleNo) .device_code(vehicleNo)
.content("agv申请进入请求lms失败,返回参数:" + jo) .content("agv申请进入成功返回agv参数:" + json)
.build(); .build();
logDto2.setLog_level(4); logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2); luceneExecuteLogService.deviceExecuteLog(logDto2);
return json;
} else {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("code", "400"); json.put("code", "400");
json.put("message", "申请进入失败,接口返回:" + jo); json.put("message", "申请进入失败,接口返回:" + jo);
log.info("科聪申请进入下发返回参数:" + json); log.info("agv申请进入失败返回agv参数:" + json);
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(vehicleNo)
.content("agv申请进入失败返回agv参数:" + json)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
return json; return json;
} }
} }
private void updataTask(Instruction instructionDto, String newPoint) { private void updataTask(Instruction instructionDto,String type, String newPoint) {
TaskDto taskUpdate = new TaskDto(); TaskDto taskUpdate = new TaskDto();
if (AgvActionTypeEnum.IN_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { if ("1".equals(type)) {
instructionDto.setStart_point_code(newPoint); instructionDto.setStart_point_code(newPoint);
taskUpdate.setStart_point_code(newPoint); taskUpdate.setStart_point_code(newPoint);
instructionDto.setStart_device_code(newPoint); instructionDto.setStart_device_code(newPoint);
taskUpdate.setStart_device_code(newPoint); taskUpdate.setStart_device_code(newPoint);
} }
if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { if ("2".equals(type)) {
instructionDto.setNext_point_code(newPoint); instructionDto.setNext_point_code(newPoint);
taskUpdate.setNext_point_code(newPoint); taskUpdate.setNext_point_code(newPoint);
instructionDto.setNext_device_code(newPoint); instructionDto.setNext_device_code(newPoint);
@@ -377,19 +396,36 @@ public class KeCongAgvServiceImpl implements KeCongAgvService {
@Override @Override
public JSONObject requestAction(JSONObject requestParam) { public JSONObject requestAction(JSONObject requestParam) {
String taskNo = requestParam.getString("TaskNo"); String taskNo = requestParam.getString("TaskNo");
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(taskNo)
.content("agv取货完成反馈,请求参数:" + requestParam)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
Instruction instruction = instructionService.findByCode(taskNo); Instruction instruction = instructionService.findByCode(taskNo);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("task_code", instruction.getTask_code()); jsonObject.put("task_code", instruction.getTask_code());
LuceneLogDto logDto1 = LuceneLogDto.builder() LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(taskNo) .device_code(taskNo)
.content("取货完成反馈:" + jsonObject.toJSONString() + ";指令号:" + taskNo) .content("取货完成反馈wms,请求参数:" + jsonObject.toJSONString() + ";指令号:" + taskNo)
.build(); .build();
logDto1.setLog_level(4); logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1); luceneExecuteLogService.deviceExecuteLog(logDto1);
acsToWmsService.actionFinishRequest2(jsonObject); acsToWmsService.actionFinishRequest2(jsonObject);
TaskDto dto = taskserver.findByCode(instruction.getTask_code());
dto.setExecute_code("1");
instruction.setExecute_code("1");
taskserver.update(dto);
instructionService.update(instruction);
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("code", "200"); jo.put("code", "200");
jo.put("message", "请求成功"); jo.put("message", "请求成功");
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(taskNo)
.content("取货完成,返回agv参数:" + jsonObject.toJSONString() + ";指令号:" + taskNo)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
return jo; return jo;
} }

View File

@@ -738,7 +738,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
public String applyIn(JSONObject param) { public String applyIn(JSONObject param) {
try { try {
MDC.put(log_file_type, log_type); MDC.put(log_file_type, log_type);
log.info("applyIn-----agv申请进入输入参数{}", param); log.info("applyIn-----agv申请进入,请求lms参数{}", param);
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("applyIn"); AddressDto addressDto = addressService.findByCode("applyIn");
String url = wmsurl + addressDto.getMethods_url(); String url = wmsurl + addressDto.getMethods_url();
@@ -759,13 +759,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.info("applyIn-----输出参数{}", "返回结果为空"); log.info("applyIn-----输出参数{}", "返回结果为空");
return null; return null;
} }
String type = ""; log.info("applyIn-----agv申请进入,lms返回参数{}", result2.body());
if (result2.getStatus() == 200) {
type = "info";
} else {
type = "error";
}
log.info("secondaryAllocationPoint-----输出参数{}", result2.body());
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyIn", String.valueOf(result2.getStatus()), LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyIn", String.valueOf(result2.getStatus()),
JSON.toJSONString(param), String.valueOf(result2.body()), "agv申请进入"); JSON.toJSONString(param), String.valueOf(result2.body()), "agv申请进入");
luceneLogService.interfaceExecuteLog(luceneLogDto); luceneLogService.interfaceExecuteLog(luceneLogDto);

View File

@@ -498,7 +498,7 @@ public interface InstructionService extends CommonService<InstructionMybatis> {
List<Instruction> findByCodeAndExcute(String nextDeviceCode); List<Instruction> findByCodeAndExcute(String nextDeviceCode);
List<Instruction> findByNextCode(String nextDeviceCode); List<Instruction> findByNextCode(String taskCode,String nextDeviceCode);
List<Instruction> findReadyIns(); List<Instruction> findReadyIns();
List<Instruction> findReadyIns2(); List<Instruction> findReadyIns2();

View File

@@ -503,6 +503,11 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (regional(dto.getStart_device_code(), dto.getNext_device_code())) { if (regional(dto.getStart_device_code(), dto.getNext_device_code())) {
throw new BadRequestException(LangProcess.msg("error_regional_max")); throw new BadRequestException(LangProcess.msg("error_regional_max"));
} }
//判断是否存在到同一个等待点的任务
List<Instruction> byCodeAndExcute = this.findByNextCode(task_code,dto.getNext_device_code());
if (CollUtil.isNotEmpty(byCodeAndExcute)) {
throw new BadRequestException("存在相同终点的任务,无法生成指令");
}
String start_device_code = dto.getStart_device_code(); String start_device_code = dto.getStart_device_code();
// if (StrUtil.isNotEmpty(dto.getTask_code())) { // if (StrUtil.isNotEmpty(dto.getTask_code())) {
@@ -628,7 +633,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
throw e; // throw e;
} }
InstructionMybatis entity = ConvertUtil.convert(dto, InstructionMybatis.class); InstructionMybatis entity = ConvertUtil.convert(dto, InstructionMybatis.class);
instructionMapper.insert(entity); instructionMapper.insert(entity);
@@ -792,6 +797,10 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void finish(String id) { public void finish(String id) {
InstructionDto entity = this.findById(id); InstructionDto entity = this.findById(id);
//execute_code=1 取货完成
if (ObjectUtil.isNotEmpty(entity.getExecute_code())&& !entity.getExecute_code().equals("1")){
throw new BadRequestException("agv还未取货不允许点完成");
}
// if (entity == null) throw new BadRequestException(LangProcess.msg("error_sysAuth")); // if (entity == null) throw new BadRequestException(LangProcess.msg("error_sysAuth"));
String currentUsername = SecurityUtils.getCurrentNickName(); String currentUsername = SecurityUtils.getCurrentNickName();
String now = DateUtil.now(); String now = DateUtil.now();
@@ -1135,6 +1144,10 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (entity == null) { if (entity == null) {
throw new BadRequestException(LangProcess.msg("error_sysAuth")); throw new BadRequestException(LangProcess.msg("error_sysAuth"));
} }
//execute_code=1 取货完成
if (ObjectUtil.isNotEmpty(entity.getExecute_code()) && entity.getExecute_code().equals("1")){
throw new BadRequestException("agv已经取货完成不允许取消");
}
TaskDto task = taskService.findByCodeFromCache(entity.getTask_code()); TaskDto task = taskService.findByCodeFromCache(entity.getTask_code());
if (StrUtil.isEmpty(entity.getRoute_plan_code())) { if (StrUtil.isEmpty(entity.getRoute_plan_code())) {
entity.setRoute_plan_code(task.getRoute_plan_code()); entity.setRoute_plan_code(task.getRoute_plan_code());
@@ -1149,30 +1162,14 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
// //
// } else // } else
//1=XZ 2=NDC //1=XZ 2=NDC
if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(CommonFinalParam.TWO)) { if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "5")
// NDC agv指令不当场取消指令,需要等agv上报
if ("1".equals(entity.getSend_status())) {
ndcAgvService.deleteAgvInstToNDC(BeanUtil.copyProperties(entity, Instruction.class));
flag = true;
} else {
flag = true;
}
} else if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(CommonFinalParam.ONE)
&& !StrUtil.equals(entity.getSend_status(), "2")) {
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
flag = true;
} else if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type)
&& !StrUtil.equals(entity.getSend_status(), "2")) {
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
flag = true;
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "5")
&& !StrUtil.equals(entity.getSend_status(), "2")) { && !StrUtil.equals(entity.getSend_status(), "2")) {
KeCongAgvService keCongAgvService = SpringContextHolder.getBean(KeCongAgvService.class); KeCongAgvService keCongAgvService = SpringContextHolder.getBean(KeCongAgvService.class);
log.info("开始删除agv任务");
keCongAgvService.deleteTask(entity.getInstruction_code()); keCongAgvService.deleteTask(entity.getInstruction_code());
flag = true; flag = true;
}else { }else {
log.info("只删除系统任务!");
flag = true; flag = true;
} }
if (flag) { if (flag) {
@@ -1902,9 +1899,10 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override @Override
public List<Instruction> findByNextCode(String next_code) { public List<Instruction> findByNextCode(String taskCode,String next_code) {
List<Instruction> instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code)).collect(Collectors.toList()); List<Instruction> instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code)
&& !item.getTask_code().equals(taskCode)
&& (StrUtil.equals(item.getInstruction_status(), InstructionStatusEnum.READY.getIndex()) || StrUtil.equals(item.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex()))).collect(Collectors.toList());
return instructionList; return instructionList;
} }

View File

@@ -244,6 +244,8 @@ public class Task extends CommonModel<Task> implements Serializable {
private String interaction_json; private String interaction_json;
private String car_no;
private Integer agv_action_type; private Integer agv_action_type;

View File

@@ -57,7 +57,7 @@ public class TaskDto implements Serializable {
/** /**
* 车号 * 车号
*/ */
private String carno; private String car_no;
/** /**
* 复合任务 * 复合任务

View File

@@ -893,6 +893,11 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
throw new BadRequestException(LangProcess.msg("error_sysAuth")); throw new BadRequestException(LangProcess.msg("error_sysAuth"));
} }
//execute_code=1 取货完成
if (ObjectUtil.isNotEmpty(entity.getExecute_code())&& !entity.getExecute_code().equals("1")){
throw new BadRequestException("agv还未取货不允许点完成");
}
InstructionDto instdto = instructionService.findByTaskid(taskIdAndStatus.getTask_id(), "instruction_status <2 "); InstructionDto instdto = instructionService.findByTaskid(taskIdAndStatus.getTask_id(), "instruction_status <2 ");
if (instdto != null) { if (instdto != null) {
throw new BadRequestException(LangProcess.msg("task_insHas")); throw new BadRequestException(LangProcess.msg("task_insHas"));
@@ -920,6 +925,10 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
if (entity == null) { if (entity == null) {
throw new BadRequestException(LangProcess.msg("error_sysAuth")); throw new BadRequestException(LangProcess.msg("error_sysAuth"));
} }
//execute_code=1 取货完成
if (ObjectUtil.isNotEmpty(entity.getExecute_code()) && entity.getExecute_code().equals("1")){
throw new BadRequestException("agv已经取货完成不允许点取消");
}
InstructionDto instdto = instructionService.findByTaskid(id, "instruction_status <2 "); InstructionDto instdto = instructionService.findByTaskid(id, "instruction_status <2 ");
if (instdto != null) { if (instdto != null) {
@@ -1162,7 +1171,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
map.put("路由方案编码", acsTask.getRoute_plan_code()); map.put("路由方案编码", acsTask.getRoute_plan_code());
map.put("是否需要反馈上位系统", acsTask.getIs_needfeedback()); map.put("是否需要反馈上位系统", acsTask.getIs_needfeedback());
map.put("备注", acsTask.getRemark()); map.put("备注", acsTask.getRemark());
map.put("agv车号", acsTask.getCarno()); map.put("agv车号", acsTask.getCar_no());
map.put("是否启用", acsTask.getIs_active()); map.put("是否启用", acsTask.getIs_active());
map.put("是否删除", acsTask.getIs_delete()); map.put("是否删除", acsTask.getIs_delete());
map.put("创建者", acsTask.getCreate_by()); map.put("创建者", acsTask.getCreate_by());
@@ -1797,8 +1806,8 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
if (ObjectUtil.isNotEmpty(entity.getWeight())) { if (ObjectUtil.isNotEmpty(entity.getWeight())) {
feed_jo.put("weight", entity.getWeight()); feed_jo.put("weight", entity.getWeight());
} }
if (ObjectUtil.isNotEmpty(entity.getCarno())) { if (ObjectUtil.isNotEmpty(entity.getCar_no())) {
feed_jo.put("car_no", entity.getCarno()); feed_jo.put("car_no", entity.getCar_no());
} }
// JSONArray ja = new JSONArray(); // JSONArray ja = new JSONArray();
// ja.add(feed_jo); // ja.add(feed_jo);

View File

@@ -104,6 +104,12 @@ public class AutoCreateInst {
if (!StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) { if (!StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) {
continue; continue;
} }
//判断是否存在到同一个等待点的任务
List<Instruction> byCodeAndExcute = instructionService.findByNextCode(taskcode,next_device_code);
if (CollUtil.isNotEmpty(byCodeAndExcute)) {
log.info("存在相同等待点的任务,无法生成指令");
continue;
}
// RouteLineDto routeLineDto = shortPathsList.get(0); // RouteLineDto routeLineDto = shortPathsList.get(0);
// String path = routeLineDto.getPath(); // String path = routeLineDto.getPath();

View File

@@ -48,6 +48,7 @@ export default {
'Pickup_point': 'Pickup Point', 'Pickup_point': 'Pickup Point',
'Delivery_point': 'Delivery Point', 'Delivery_point': 'Delivery Point',
'Remark': 'Remark', 'Remark': 'Remark',
'Car_no': 'Car_no',
'Creator': 'Creator', 'Creator': 'Creator',
'Create_time': 'Creation Time', 'Create_time': 'Creation Time',
'Operation': 'Operation', 'Operation': 'Operation',

View File

@@ -48,6 +48,7 @@ export default {
'Pickup_point': 'Titik Pengambilan', 'Pickup_point': 'Titik Pengambilan',
'Delivery_point': 'Titik Pengiriman', 'Delivery_point': 'Titik Pengiriman',
'Remark': 'Catatan', 'Remark': 'Catatan',
'Car_no': 'Car_no',
'Creator': 'Pencipta', 'Creator': 'Pencipta',
'Create_time': 'Waktu Penciptaan', 'Create_time': 'Waktu Penciptaan',
'Operation': 'Operasi', 'Operation': 'Operasi',

View File

@@ -50,6 +50,7 @@ export default {
'Pickup_point': '取货点', 'Pickup_point': '取货点',
'Delivery_point': '放货点', 'Delivery_point': '放货点',
'Remark': '备注', 'Remark': '备注',
'Car_no': '车号',
'Creator': '创建者', 'Creator': '创建者',
'Create_time': '创建时间', 'Create_time': '创建时间',
'Operation': '操作', 'Operation': '操作',

View File

@@ -168,8 +168,13 @@
:min-width="flexWidth('start_point_code2',crud.data,$t('Inst.table.start_point_code2'))"/> :min-width="flexWidth('start_point_code2',crud.data,$t('Inst.table.start_point_code2'))"/>
<el-table-column prop="next_point_code2" :label="$t('Inst.table.next_point_code2')" <el-table-column prop="next_point_code2" :label="$t('Inst.table.next_point_code2')"
:min-width="flexWidth('next_point_code2',crud.data,$t('Inst.table.next_point_code2'))"/> :min-width="flexWidth('next_point_code2',crud.data,$t('Inst.table.next_point_code2'))"/>
<el-table-column prop="execute_device_code" :label="$t('Inst.table.execute_device_code')" <el-table-column prop="execute_code" label="取货状态"
:min-width="flexWidth('execute_device_code',crud.data,$t('Inst.table.execute_device_code'))"/> :min-width="flexWidth('execute_code',crud.data,'取货状态')">
<template slot-scope="scope">
<span v-if="scope.row.execute_code=='0' ">{{ "未取货" }}</span>
<span v-if="scope.row.execute_code=='1' ">{{ "取货完成" }}</span>
</template>
</el-table-column>
<el-table-column prop="carno" :label="$t('Inst.table.carno')" <el-table-column prop="carno" :label="$t('Inst.table.carno')"
:min-width="flexWidth('carno',crud.data,$t('Inst.table.carno'))"/> :min-width="flexWidth('carno',crud.data,$t('Inst.table.carno'))"/>
<el-table-column prop="remark" :label="$t('Inst.table.remark')" <el-table-column prop="remark" :label="$t('Inst.table.remark')"
@@ -185,7 +190,7 @@
<el-table-column <el-table-column
v-permission="['admin','instruction:edit','instruction:del']" v-permission="['admin','instruction:edit','instruction:del']"
:label="$t('auto.common.Operate')" :label="$t('auto.common.Operate')"
width="200" width="130"
align="center" align="center"
fixed="right" fixed="right"
> >
@@ -200,9 +205,9 @@
<el-button type="text" icon="el-icon-circle-close" @click="handleCommand(scope.$index, scope.row,'b')"> <el-button type="text" icon="el-icon-circle-close" @click="handleCommand(scope.$index, scope.row,'b')">
{{ $t('auto.common.Cancel') }} {{ $t('auto.common.Cancel') }}
</el-button> </el-button>
<el-button type="text" icon="el-icon-error" @click="handleCommand(scope.$index, scope.row,'c')"> <!-- <el-button type="text" icon="el-icon-error" @click="handleCommand(scope.$index, scope.row,'c')">-->
{{ $t('auto.common.Forced_cancellation') }} <!-- {{ $t('auto.common.Forced_cancellation') }}-->
</el-button> <!-- </el-button>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@@ -457,6 +457,15 @@
/> />
<el-table-column prop="put_point_code" :label="$t('TaskRecord.table.Transit_point')" <el-table-column prop="put_point_code" :label="$t('TaskRecord.table.Transit_point')"
:min-width="flexWidth('put_point_code',crud.data,$t('TaskRecord.table.Transit_point'))"/> :min-width="flexWidth('put_point_code',crud.data,$t('TaskRecord.table.Transit_point'))"/>
<el-table-column prop="car_no" :label="$t('task.select.Car_no')"
:min-width="flexWidth('car_no',crud.data,$t('task.select.Car_no'))"/>
<el-table-column prop="execute_code" label="取货状态"
:min-width="flexWidth('execute_code',crud.data,'取货状态')">
<template slot-scope="scope">
<span v-if="scope.row.execute_code === null || scope.row.execute_code === ''">{{ "未取货" }}</span>
<span v-if="scope.row.execute_code==='1' ">{{ "取货完成" }}</span>
</template>
</el-table-column>
<el-table-column prop="remark" :label="$t('task.select.Remark')" <el-table-column prop="remark" :label="$t('task.select.Remark')"
:min-width="flexWidth('remark',crud.data,$t('task.select.Remark'))"/> :min-width="flexWidth('remark',crud.data,$t('task.select.Remark'))"/>
<el-table-column prop="create_by" :label="$t('task.select.Creator')" <el-table-column prop="create_by" :label="$t('task.select.Creator')"
@@ -468,7 +477,7 @@
<el-table-column prop="update_time" :label="$t('Inst.table.update_time')" <el-table-column prop="update_time" :label="$t('Inst.table.update_time')"
:min-width="flexWidth('update_time',crud.data,$t('Inst.table.update_time'))"/> :min-width="flexWidth('update_time',crud.data,$t('Inst.table.update_time'))"/>
<el-table-column v-permission="['admin','task:edit','task:del']" :label="$t('task.select.Operation')" <el-table-column v-permission="['admin','task:edit','task:del']" :label="$t('task.select.Operation')"
width="250" align="center" fixed="right"> width="200" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
@@ -483,12 +492,12 @@
<el-button type="text" icon="el-icon-folder-add" @click="handleCommand(scope.$index, scope.row,'c')"> <el-button type="text" icon="el-icon-folder-add" @click="handleCommand(scope.$index, scope.row,'c')">
{{ $t('task.select.Create_command') }} {{ $t('task.select.Create_command') }}
</el-button> </el-button>
<el-button type="text" icon="el-icon-finished" @click="handleCommand(scope.$index, scope.row,'d')"> <!-- <el-button type="text" icon="el-icon-finished" @click="handleCommand(scope.$index, scope.row,'d')">-->
{{ $t('task.select.Forced_Completed') }} <!-- {{ $t('task.select.Forced_Completed') }}-->
</el-button> <!-- </el-button>-->
<el-button type="text" icon="el-icon-circle-close" @click="handleCommand(scope.$index, scope.row,'e')"> <!-- <el-button type="text" icon="el-icon-circle-close" @click="handleCommand(scope.$index, scope.row,'e')">-->
{{ $t('task.select.Cancel_Tasks_And_Commands') }} <!-- {{ $t('task.select.Cancel_Tasks_And_Commands') }}-->
</el-button> <!-- </el-button>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -610,6 +619,7 @@ export default {
empty_site: '', empty_site: '',
task_status: null, task_status: null,
priority: 1, priority: 1,
execute_code: null,
start_point_code: null, start_point_code: null,
start_point_code2: null, start_point_code2: null,
start_device_code: null, start_device_code: null,