|
@ -87,7 +87,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
@Autowired |
|
|
@Autowired |
|
|
TaskMapper taskMapper; |
|
|
TaskMapper taskMapper; |
|
|
List<Instruction> instructions = new CopyOnWriteArrayList(); |
|
|
List<Instruction> instructions = new CopyOnWriteArrayList(); |
|
|
// List<InstructionMybatis> instructions_mybatis = new CopyOnWriteArrayList();
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
DeviceAppService deviceAppService; |
|
|
DeviceAppService deviceAppService; |
|
|
@Autowired |
|
|
@Autowired |
|
@ -196,6 +195,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
wrapper.eq(StringUtils.isNotBlank(status),InstructionMybatis::getInstruction_status,status); |
|
|
wrapper.eq(StringUtils.isNotBlank(status),InstructionMybatis::getInstruction_status,status); |
|
|
wrapper.and(StringUtils.isNotBlank(point_code),instructionMybatis -> instructionMybatis.like(InstructionMybatis::getStart_point_code,point_code).or().like(InstructionMybatis::getNext_point_code,point_code)); |
|
|
wrapper.and(StringUtils.isNotBlank(point_code),instructionMybatis -> instructionMybatis.like(InstructionMybatis::getStart_point_code,point_code).or().like(InstructionMybatis::getNext_point_code,point_code)); |
|
|
wrapper.eq(StringUtils.isNotBlank(instruction_type),InstructionMybatis::getInstruction_type,instruction_type); |
|
|
wrapper.eq(StringUtils.isNotBlank(instruction_type),InstructionMybatis::getInstruction_type,instruction_type); |
|
|
|
|
|
wrapper.le(InstructionMybatis::getInstruction_status, 1); |
|
|
if (!StrUtil.isEmpty(is_over)) { |
|
|
if (!StrUtil.isEmpty(is_over)) { |
|
|
if (StrUtil.equals(is_over,"1")){ |
|
|
if (StrUtil.equals(is_over,"1")){ |
|
|
wrapper.ge(InstructionMybatis::getInstruction_status,2); |
|
|
wrapper.ge(InstructionMybatis::getInstruction_status,2); |
|
@ -203,6 +203,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
wrapper.lt(InstructionMybatis::getInstruction_status,2); |
|
|
wrapper.lt(InstructionMybatis::getInstruction_status,2); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
wrapper.orderByDesc(InstructionMybatis::getCreate_time); |
|
|
IPage<InstructionMybatis> insPage = instructionMapper.selectPage(queryPage,wrapper); |
|
|
IPage<InstructionMybatis> insPage = instructionMapper.selectPage(queryPage,wrapper); |
|
|
final JSONObject json = (JSONObject) JSON.toJSON(ConvertUtil.convertPage(insPage, InstructionDto.class)); |
|
|
final JSONObject json = (JSONObject) JSON.toJSON(ConvertUtil.convertPage(insPage, InstructionDto.class)); |
|
|
return json; |
|
|
return json; |
|
@ -311,10 +312,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Instruction findByTaskcode(String code) { |
|
|
public Instruction findByTaskcode(String code) { |
|
|
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
|
|
|
|
|
// JSONObject json = wo.query("task_code ='" + code + "'").uniqueResult(0);
|
|
|
|
|
|
// final Instruction obj = json.toJavaObject(Instruction.class);
|
|
|
|
|
|
// return obj;
|
|
|
|
|
|
InstructionMybatis ins= new LambdaQueryChainWrapper<>(instructionMapper) |
|
|
InstructionMybatis ins= new LambdaQueryChainWrapper<>(instructionMapper) |
|
|
.eq(InstructionMybatis::getTask_code, code) |
|
|
.eq(InstructionMybatis::getTask_code, code) |
|
|
.one(); |
|
|
.one(); |
|
@ -339,15 +336,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Instruction findByTaskid(String id, String wherecaluse) { |
|
|
public Instruction findByTaskid(String id, String wherecaluse) { |
|
|
// if (!StrUtil.isEmpty(wherecaluse)) {
|
|
|
|
|
|
// wherecaluse = " and " + wherecaluse;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
|
|
|
|
|
// JSONObject json = wo.query("task_id ='" + id + "'" + wherecaluse).uniqueResult(0);
|
|
|
|
|
|
// if (ObjectUtil.isNotEmpty(json)) {
|
|
|
|
|
|
// return json.toJavaObject(Instruction.class);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// return null;
|
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>(); |
|
|
wrapper.eq(InstructionMybatis::getTask_id,id); |
|
|
wrapper.eq(InstructionMybatis::getTask_id,id); |
|
@ -456,9 +444,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
log.error(""); |
|
|
log.error(""); |
|
|
} |
|
|
} |
|
|
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
|
|
|
|
|
// JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
|
|
|
|
|
// wo.insert(json);
|
|
|
|
|
|
InstructionMybatis entity = ConvertUtil.convert(dto, InstructionMybatis.class); |
|
|
InstructionMybatis entity = ConvertUtil.convert(dto, InstructionMybatis.class); |
|
|
instructionMapper.insert(entity); |
|
|
instructionMapper.insert(entity); |
|
|
instructions.add(dto); |
|
|
instructions.add(dto); |
|
@ -470,7 +455,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
String task_code = dto.getTask_code(); |
|
|
String task_code = dto.getTask_code(); |
|
|
TaskDto task = taskService.findByCodeFromCache(task_code); |
|
|
TaskDto task = taskService.findByCodeFromCache(task_code); |
|
|
|
|
|
|
|
|
// WQLObject instwo = WQLObject.getWQLObject("acs_instruction");
|
|
|
|
|
|
String currentUsername = SecurityUtils.getCurrentUsername(); |
|
|
String currentUsername = SecurityUtils.getCurrentUsername(); |
|
|
String now = DateUtil.now(); |
|
|
String now = DateUtil.now(); |
|
|
if (StrUtil.isEmpty(dto.getRoute_plan_code())) { |
|
|
if (StrUtil.isEmpty(dto.getRoute_plan_code())) { |
|
@ -626,10 +610,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
dto.setUpdate_time(now); |
|
|
dto.setUpdate_time(now); |
|
|
dto.setCreate_time(now); |
|
|
dto.setCreate_time(now); |
|
|
|
|
|
|
|
|
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
|
|
|
|
|
// JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
|
|
|
|
|
//
|
|
|
|
|
|
// wo.insert(json);
|
|
|
|
|
|
|
|
|
|
|
|
InstructionMybatis entity = ConvertUtil.convert(dto, InstructionMybatis.class); |
|
|
InstructionMybatis entity = ConvertUtil.convert(dto, InstructionMybatis.class); |
|
|
instructionMapper.insert(entity); |
|
|
instructionMapper.insert(entity); |
|
@ -821,19 +801,12 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
public void finish(Instruction dto) { |
|
|
public void finish(Instruction dto) { |
|
|
String now = DateUtil.now(); |
|
|
String now = DateUtil.now(); |
|
|
dto.setInstruction_status("2"); |
|
|
dto.setInstruction_status("2"); |
|
|
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
|
|
|
|
|
// JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
|
|
|
|
|
//
|
|
|
|
|
|
// wo.update(json);
|
|
|
|
|
|
|
|
|
|
|
|
InstructionMybatis ins = ConvertUtil.convert(dto, InstructionMybatis.class); |
|
|
InstructionMybatis ins = ConvertUtil.convert(dto, InstructionMybatis.class); |
|
|
instructionMapper.updateById(ins); |
|
|
instructionMapper.updateById(ins); |
|
|
|
|
|
|
|
|
String instnextdevice = dto.getNext_device_code(); |
|
|
String instnextdevice = dto.getNext_device_code(); |
|
|
String insttaskid = dto.getTask_id(); |
|
|
String insttaskid = dto.getTask_id(); |
|
|
// WQLObject taskwo = WQLObject.getWQLObject("acs_task");
|
|
|
|
|
|
// JSONObject taskjson = taskwo.query("task_id ='" + insttaskid + "'").uniqueResult(0);
|
|
|
|
|
|
// TaskDto obj = taskjson.toJavaObject(TaskDto.class);
|
|
|
|
|
|
|
|
|
|
|
|
Task task = new LambdaQueryChainWrapper<>(taskMapper) |
|
|
Task task = new LambdaQueryChainWrapper<>(taskMapper) |
|
|
.eq(Task::getTask_id,insttaskid) |
|
|
.eq(Task::getTask_id,insttaskid) |
|
@ -990,14 +963,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
if (!StrUtil.isEmpty(entity.getAgv_jobno())) { |
|
|
if (!StrUtil.isEmpty(entity.getAgv_jobno())) { |
|
|
ndcAgvService.deleteAgvInstToNDC(new Instruction(entity)); |
|
|
ndcAgvService.deleteAgvInstToNDC(new Instruction(entity)); |
|
|
} |
|
|
} |
|
|
// } else {
|
|
|
flag = true; |
|
|
flag = true; |
|
|
|
|
|
// }
|
|
|
|
|
|
// } else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")
|
|
|
|
|
|
// && !StrUtil.equals(entity.getSend_status(), "2")) {
|
|
|
|
|
|
// XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
|
|
|
|
|
|
// xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
|
|
|
|
|
|
// flag = true;
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
flag = true; |
|
|
flag = true; |
|
|
} |
|
|
} |
|
@ -1032,9 +998,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
entity.setUpdate_time(now); |
|
|
entity.setUpdate_time(now); |
|
|
entity.setUpdate_by(currentUsername); |
|
|
entity.setUpdate_by(currentUsername); |
|
|
entity.setInstruction_status("3"); |
|
|
entity.setInstruction_status("3"); |
|
|
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
|
|
|
|
|
// JSONObject json = (JSONObject) JSONObject.toJSON(entity);
|
|
|
|
|
|
// wo.update(json);
|
|
|
|
|
|
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class); |
|
|
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class); |
|
|
instructionMapper.updateById(ins); |
|
|
instructionMapper.updateById(ins); |
|
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); |
|
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); |
|
@ -1072,7 +1035,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
} |
|
|
} |
|
|
removeByCodeFromCache(entity.getInstruction_code()); |
|
|
removeByCodeFromCache(entity.getInstruction_code()); |
|
|
} |
|
|
} |
|
|
// this.reload();
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -1092,9 +1054,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper, |
|
|
entity.setUpdate_time(now); |
|
|
entity.setUpdate_time(now); |
|
|
entity.setUpdate_by(currentUsername); |
|
|
entity.setUpdate_by(currentUsername); |
|
|
entity.setInstruction_status("3"); |
|
|
entity.setInstruction_status("3"); |
|
|
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
|
|
|
|
|
// JSONObject json = (JSONObject) JSONObject.toJSON(entity);
|
|
|
|
|
|
// wo.update(json);
|
|
|
|
|
|
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class); |
|
|
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class); |
|
|
instructionMapper.updateById(ins); |
|
|
instructionMapper.updateById(ins); |
|
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); |
|
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); |
|
|