|
|
|
|
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.http.HttpResponse;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
@@ -18,6 +19,7 @@ import org.nl.acs.AcsConfig;
|
|
|
|
|
import org.nl.acs.agv.server.MagicAgvService;
|
|
|
|
|
import org.nl.acs.agv.server.NDCAgvService;
|
|
|
|
|
import org.nl.acs.agv.server.XianGongAgvService;
|
|
|
|
|
import org.nl.acs.agv.server.ZheDaAgvService;
|
|
|
|
|
import org.nl.acs.auto.initial.ApplicationAutoInitial;
|
|
|
|
|
import org.nl.acs.device.domain.Device;
|
|
|
|
|
import org.nl.acs.device.service.DeviceService;
|
|
|
|
|
@@ -73,9 +75,9 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author jiaolm
|
|
|
|
|
* @date 2023-05-09
|
|
|
|
|
*/
|
|
|
|
|
* @author jiaolm
|
|
|
|
|
* @date 2023-05-09
|
|
|
|
|
*/
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
|
// @CacheConfig(cacheNames = InstructionService.CACHE_KEY)
|
|
|
|
|
@@ -88,7 +90,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
@Autowired
|
|
|
|
|
TaskMapper taskMapper;
|
|
|
|
|
List<Instruction> instructions = new CopyOnWriteArrayList();
|
|
|
|
|
// List<InstructionMybatis> instructions_mybatis = new CopyOnWriteArrayList();
|
|
|
|
|
// List<InstructionMybatis> instructions_mybatis = new CopyOnWriteArrayList();
|
|
|
|
|
@Autowired
|
|
|
|
|
DeviceAppService deviceAppService;
|
|
|
|
|
@Autowired
|
|
|
|
|
@@ -110,7 +112,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<InstructionDto> queryAll(InstructionQueryParam query){
|
|
|
|
|
public List<InstructionDto> queryAll(InstructionQueryParam query) {
|
|
|
|
|
return ConvertUtil.convertList(instructionMapper.selectList(QueryHelpMybatisPlus.getPredicate(query)), InstructionDto.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -127,7 +129,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public int updateById(InstructionDto resources){
|
|
|
|
|
public int updateById(InstructionDto resources) {
|
|
|
|
|
InstructionMybatis entity = ConvertUtil.convert(resources, InstructionMybatis.class);
|
|
|
|
|
int ret = instructionMapper.updateById(entity);
|
|
|
|
|
// delCaches(resources.id);
|
|
|
|
|
@@ -136,14 +138,14 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public int removeByIds(Set<String> ids){
|
|
|
|
|
public int removeByIds(Set<String> ids) {
|
|
|
|
|
// delCaches(ids);
|
|
|
|
|
return instructionMapper.deleteBatchIds(ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public int removeById(String id){
|
|
|
|
|
public int removeById(String id) {
|
|
|
|
|
Set<String> set = new HashSet<>(1);
|
|
|
|
|
set.add(id);
|
|
|
|
|
return this.removeByIds(set);
|
|
|
|
|
@@ -175,7 +177,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
.eq(InstructionMybatis::getIs_delete, "0")
|
|
|
|
|
.list();
|
|
|
|
|
// List list = this.queryAll("instruction_status <2 and is_delete =0");
|
|
|
|
|
this.instructions = new CopyOnWriteArrayList<>(ConvertUtil.convertList(list,Instruction.class));
|
|
|
|
|
this.instructions = new CopyOnWriteArrayList<>(ConvertUtil.convertList(list, Instruction.class));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@@ -191,20 +193,20 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
IPage<InstructionMybatis> queryPage = PageUtil.toMybatisPage(page);
|
|
|
|
|
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
// wrapper.eq(InstructionMybatis::getIs_delete,0);
|
|
|
|
|
wrapper.and(StringUtils.isNotBlank(code), instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code,code).or().like(InstructionMybatis::getTask_code,code));
|
|
|
|
|
wrapper.like(StringUtils.isNotBlank(vehicle_code),InstructionMybatis::getVehicle_code,vehicle_code);
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(material_type),InstructionMybatis::getMaterial,material_type);
|
|
|
|
|
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.eq(StringUtils.isNotBlank(instruction_type),InstructionMybatis::getInstruction_type,instruction_type);
|
|
|
|
|
wrapper.and(StringUtils.isNotBlank(code), instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code, code).or().like(InstructionMybatis::getTask_code, code));
|
|
|
|
|
wrapper.like(StringUtils.isNotBlank(vehicle_code), InstructionMybatis::getVehicle_code, vehicle_code);
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(material_type), InstructionMybatis::getMaterial, material_type);
|
|
|
|
|
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.eq(StringUtils.isNotBlank(instruction_type), InstructionMybatis::getInstruction_type, instruction_type);
|
|
|
|
|
if (!StrUtil.isEmpty(is_over)) {
|
|
|
|
|
if (StrUtil.equals(is_over,"1")){
|
|
|
|
|
wrapper.ge(InstructionMybatis::getInstruction_status,2);
|
|
|
|
|
}else{
|
|
|
|
|
wrapper.lt(InstructionMybatis::getInstruction_status,2);
|
|
|
|
|
if (StrUtil.equals(is_over, "1")) {
|
|
|
|
|
wrapper.ge(InstructionMybatis::getInstruction_status, 2);
|
|
|
|
|
} else {
|
|
|
|
|
wrapper.lt(InstructionMybatis::getInstruction_status, 2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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));
|
|
|
|
|
return json;
|
|
|
|
|
}
|
|
|
|
|
@@ -223,31 +225,31 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
// wrapper.eq(InstructionMybatis::getIs_delete,"0");
|
|
|
|
|
if (!StrUtil.isEmpty(code)) {
|
|
|
|
|
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code,code).or().like(InstructionMybatis::getTask_code,code));
|
|
|
|
|
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code, code).or().like(InstructionMybatis::getTask_code, code));
|
|
|
|
|
}
|
|
|
|
|
if (!StrUtil.isEmpty(vehicle_code)) {
|
|
|
|
|
wrapper.like(InstructionMybatis::getVehicle_code,vehicle_code);
|
|
|
|
|
wrapper.like(InstructionMybatis::getVehicle_code, vehicle_code);
|
|
|
|
|
}
|
|
|
|
|
if (!StrUtil.isEmpty(material_type)) {
|
|
|
|
|
wrapper.eq(InstructionMybatis::getMaterial,material_type);
|
|
|
|
|
wrapper.eq(InstructionMybatis::getMaterial, material_type);
|
|
|
|
|
}
|
|
|
|
|
if (!StrUtil.isEmpty(status)) {
|
|
|
|
|
wrapper.eq(InstructionMybatis::getInstruction_status,status);
|
|
|
|
|
wrapper.eq(InstructionMybatis::getInstruction_status, status);
|
|
|
|
|
}
|
|
|
|
|
if (!StrUtil.isEmpty(point_code)) {
|
|
|
|
|
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getStart_point_code,point_code).or().like(InstructionMybatis::getNext_point_code,point_code));
|
|
|
|
|
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getStart_point_code, point_code).or().like(InstructionMybatis::getNext_point_code, point_code));
|
|
|
|
|
}
|
|
|
|
|
if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) {
|
|
|
|
|
wrapper.between(InstructionMybatis::getCreate_time,create_time,end_time);
|
|
|
|
|
wrapper.between(InstructionMybatis::getCreate_time, create_time, end_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));
|
|
|
|
|
return json;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getByTaskId(String id) {
|
|
|
|
|
List<InstructionMybatis> insList= new LambdaQueryChainWrapper<>(instructionMapper)
|
|
|
|
|
List<InstructionMybatis> insList = new LambdaQueryChainWrapper<>(instructionMapper)
|
|
|
|
|
.eq(InstructionMybatis::getTask_id, id)
|
|
|
|
|
.list();
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
@@ -273,9 +275,9 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Instruction> queryAll(Map whereJson) {
|
|
|
|
|
List<InstructionMybatis> insList= new LambdaQueryChainWrapper<>(instructionMapper)
|
|
|
|
|
List<InstructionMybatis> insList = new LambdaQueryChainWrapper<>(instructionMapper)
|
|
|
|
|
.list();
|
|
|
|
|
return ConvertUtil.convertList(insList,Instruction.class);
|
|
|
|
|
return ConvertUtil.convertList(insList, Instruction.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@@ -283,10 +285,10 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
|
|
|
|
// JSONArray arr = wo.query(whereJson, "create_time").getResultJSONArray(0);
|
|
|
|
|
// List<Instruction> list = arr.toJavaList(Instruction.class);
|
|
|
|
|
List<InstructionMybatis> insList= new LambdaQueryChainWrapper<>(instructionMapper)
|
|
|
|
|
List<InstructionMybatis> insList = new LambdaQueryChainWrapper<>(instructionMapper)
|
|
|
|
|
.lt(InstructionMybatis::getInstruction_status, "2")
|
|
|
|
|
.list();
|
|
|
|
|
return ConvertUtil.convertList(insList,Instruction.class);
|
|
|
|
|
return ConvertUtil.convertList(insList, Instruction.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -300,13 +302,13 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
// final Instruction obj = json.toJavaObject(Instruction.class);
|
|
|
|
|
// return obj;
|
|
|
|
|
|
|
|
|
|
InstructionMybatis ins= new LambdaQueryChainWrapper<>(instructionMapper)
|
|
|
|
|
InstructionMybatis ins = new LambdaQueryChainWrapper<>(instructionMapper)
|
|
|
|
|
.eq(InstructionMybatis::getInstruction_code, code)
|
|
|
|
|
.one();
|
|
|
|
|
if(ObjectUtil.isEmpty(ins)){
|
|
|
|
|
if (ObjectUtil.isEmpty(ins)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
return ConvertUtil.convert(ins,Instruction.class);
|
|
|
|
|
return ConvertUtil.convert(ins, Instruction.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@@ -315,13 +317,13 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
// 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)
|
|
|
|
|
.one();
|
|
|
|
|
if(ObjectUtil.isEmpty(ins)){
|
|
|
|
|
if (ObjectUtil.isEmpty(ins)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
return ConvertUtil.convert(ins,Instruction.class);
|
|
|
|
|
return ConvertUtil.convert(ins, Instruction.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@@ -350,11 +352,11 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
// return null;
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
wrapper.eq(InstructionMybatis::getTask_id,id);
|
|
|
|
|
wrapper.apply(StringUtils.isNotBlank(wherecaluse),wherecaluse);
|
|
|
|
|
wrapper.eq(InstructionMybatis::getTask_id, id);
|
|
|
|
|
wrapper.apply(StringUtils.isNotBlank(wherecaluse), wherecaluse);
|
|
|
|
|
InstructionMybatis ins = instructionMapper.selectOne(wrapper);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(ins)) {
|
|
|
|
|
return ConvertUtil.convert(ins,Instruction.class);
|
|
|
|
|
return ConvertUtil.convert(ins, Instruction.class);
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
@@ -386,7 +388,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
dto.setIs_send(task.getLink_num());
|
|
|
|
|
}
|
|
|
|
|
// if (task.getTask_type().equals("1") || task.getTask_type().equals("2")) {
|
|
|
|
|
dto.setInstruction_type(task.getTask_type());
|
|
|
|
|
dto.setInstruction_type(task.getTask_type());
|
|
|
|
|
// } else if (false) {
|
|
|
|
|
//
|
|
|
|
|
// } else {
|
|
|
|
|
@@ -410,8 +412,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername)?currentUsername:"admin");
|
|
|
|
|
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername)?currentUsername:"admin");
|
|
|
|
|
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
|
|
|
|
|
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
|
|
|
|
|
dto.setUpdate_time(now);
|
|
|
|
|
dto.setCreate_time(now);
|
|
|
|
|
dto.setStart_parent_code(task.getStart_parent_code());
|
|
|
|
|
@@ -450,19 +452,34 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
|
|
|
|
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
|
|
|
|
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
|
|
|
|
|
} else if (StrUtil.equals(shortPathsList.get(0).getType(), "2")) {
|
|
|
|
|
ZheDaAgvService zheDaAgvService = SpringContextHolder.getBean(ZheDaAgvService.class);
|
|
|
|
|
HttpResponse result = zheDaAgvService.sendAgvInstToAgv(dto);
|
|
|
|
|
if (!ObjectUtils.isEmpty(result)) {
|
|
|
|
|
JSONObject jo = JSON.parseObject(result.body());
|
|
|
|
|
if (jo.getInteger("status") != 200) {
|
|
|
|
|
dto.setSend_status("2");
|
|
|
|
|
} else {
|
|
|
|
|
dto.setSend_status("1");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
dto.setSend_status("2");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
dto.setSend_status("2");
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("");
|
|
|
|
|
}
|
|
|
|
|
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
|
|
|
|
} catch(Exception e)
|
|
|
|
|
{
|
|
|
|
|
dto.setSend_status("2");
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
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);
|
|
|
|
|
instructions.add(dto);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void create2(Instruction dto) throws Exception {
|
|
|
|
|
@@ -602,11 +619,11 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
// + dto.getTask_id()
|
|
|
|
|
// + "'")
|
|
|
|
|
// .uniqueResult(0);
|
|
|
|
|
InstructionMybatis ins= new LambdaQueryChainWrapper<>(instructionMapper)
|
|
|
|
|
InstructionMybatis ins = new LambdaQueryChainWrapper<>(instructionMapper)
|
|
|
|
|
.lt(InstructionMybatis::getInstruction_status, 3)
|
|
|
|
|
.eq(InstructionMybatis::getNext_point_code,dto.getNext_point_code())
|
|
|
|
|
.eq(InstructionMybatis::getStart_point_code,dto.getStart_point_code())
|
|
|
|
|
.eq(InstructionMybatis::getTask_id,dto.getTask_id())
|
|
|
|
|
.eq(InstructionMybatis::getNext_point_code, dto.getNext_point_code())
|
|
|
|
|
.eq(InstructionMybatis::getStart_point_code, dto.getStart_point_code())
|
|
|
|
|
.eq(InstructionMybatis::getTask_id, dto.getTask_id())
|
|
|
|
|
.one();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -801,7 +818,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
// TaskDto obj = taskjson.toJavaObject(TaskDto.class);
|
|
|
|
|
|
|
|
|
|
Task task = new LambdaQueryChainWrapper<>(taskMapper)
|
|
|
|
|
.eq(Task::getTask_id,insttaskid)
|
|
|
|
|
.eq(Task::getTask_id, insttaskid)
|
|
|
|
|
.one();
|
|
|
|
|
// =0 则不用再次请求
|
|
|
|
|
if (StrUtil.equals(task.getRequest_again(), "0")) {
|
|
|
|
|
@@ -836,7 +853,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
// TaskDto obj = taskjson.toJavaObject(TaskDto.class);
|
|
|
|
|
|
|
|
|
|
Task task = new LambdaQueryChainWrapper<>(taskMapper)
|
|
|
|
|
.eq(Task::getTask_id,insttaskid)
|
|
|
|
|
.eq(Task::getTask_id, insttaskid)
|
|
|
|
|
.one();
|
|
|
|
|
// =0 则不用再次请求
|
|
|
|
|
if (StrUtil.equals(task.getRequest_again(), "0")) {
|
|
|
|
|
@@ -890,7 +907,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
// JSONObject taskjson = taskwo.query("task_id ='" + dto.getTask_id() + "'").uniqueResult(0);
|
|
|
|
|
// TaskDto acsTask = taskjson.toJavaObject(TaskDto.class);
|
|
|
|
|
Task acsTask = new LambdaQueryChainWrapper<>(taskMapper)
|
|
|
|
|
.eq(Task::getTask_id,dto.getTask_id())
|
|
|
|
|
.eq(Task::getTask_id, dto.getTask_id())
|
|
|
|
|
.one();
|
|
|
|
|
|
|
|
|
|
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineServiceImpl.class);
|
|
|
|
|
@@ -978,24 +995,22 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
entity.setRoute_plan_code(task.getRoute_plan_code());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// != 0 为agv任务 1=magic 2=NDC 3=XZ,4=ZHEDA
|
|
|
|
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "1")
|
|
|
|
|
// != 0 1=NDC任务 2=RGV任务
|
|
|
|
|
if (StrUtil.equals(task.getAgv_system_type(), "1")
|
|
|
|
|
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
|
|
|
|
MagicAgvService magicAgvService = SpringContextHolder.getBean(MagicAgvService.class);
|
|
|
|
|
magicAgvService.deleteAgvInst(entity.getInstruction_code());
|
|
|
|
|
flag = true;
|
|
|
|
|
|
|
|
|
|
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "2")) {
|
|
|
|
|
// NDC agv指令不当场取消指令,需要等agv上报
|
|
|
|
|
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
|
|
|
|
|
ndcAgvService.deleteAgvInstToNDC((Instruction)entity);
|
|
|
|
|
} else {
|
|
|
|
|
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 if (StrUtil.equals(task.getAgv_system_type(), "2")) {
|
|
|
|
|
try {
|
|
|
|
|
ZheDaAgvService zheDaAgvService = SpringContextHolder.getBean(ZheDaAgvService.class);
|
|
|
|
|
zheDaAgvService.deleteZDAgvInst(entity.getInstruction_code());
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
log.error("下发浙大取消指令失败{}",e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
flag = true;
|
|
|
|
|
} else {
|
|
|
|
|
flag = true;
|
|
|
|
|
@@ -1525,7 +1540,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void init(String id) {
|
|
|
|
|
InstructionDto inst = this.findById(id);
|
|
|
|
|
InstructionDto inst = this.findById(id);
|
|
|
|
|
if (inst == null) {
|
|
|
|
|
throw new BadRequestException("指令不存在或已删除");
|
|
|
|
|
}
|
|
|
|
|
|