acs兼容浙大和NDC系统

This commit is contained in:
psh
2023-12-28 16:57:47 +08:00
parent 9fbd0016c4
commit 262430da28
6 changed files with 119 additions and 121 deletions

View File

@@ -14,18 +14,14 @@ public interface AcsConfig {
String CREATETASKCHECK = "createTaskCheck";
//撤销任务检查
String CANCELTASKCHECK = "cancelTaskCheck";
//一楼agv系统接口地址
//agv系统接口地址
String AGVURL = "agvurl";
//AGV系统端口
String AGVPORT = "agvport";
//二楼1区agv系统接口地址
String AGVURL2 = "agvurl2";
//二楼1区AGV系统端口
String AGVPORT2 = "agvport2";
//二楼2区agv系统接口地址
String AGVURL22 = "agvurl22";
//二楼2区AGV系统端口
String AGVPORT22 = "agvport22";
//rgv系统接口地址
String RGVURL = "rgvurl";
//RGV系统端口
String RGVPORT = "rgvport";
//指定AGV系统
String AGVTYPE = "agvType";
//WMS系统接口地址

View File

@@ -36,6 +36,6 @@ public interface ZheDaAgvService {
* @param instCode
* @return
*/
public HttpResponse deleteZDAgvInst(String instCode);
public HttpResponse deleteZDAgvInst(String instCode) throws Exception;
}

View File

@@ -69,18 +69,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
jo.put("destinations", destinations);
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvurl2 = paramService.findByCode(AcsConfig.AGVURL2).getValue();
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
String agvport2 = paramService.findByCode(AcsConfig.AGVPORT2).getValue();
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + inst.getInstruction_code();
//不同楼层下发不同的agv系统
if (task_type.equals("1")) {
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + inst.getInstruction_code();
} else {
agvurl = agvurl2 + ":" + agvport2 + "/v1/transportOrders/" + inst.getInstruction_code();
}
log.info("下发agv任务请求:{}", agvurl);
HttpResponse result = HttpRequest.post(agvurl)
@@ -101,14 +94,10 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
String agvurl = "";
String agvport = "";
if (type.equals("1")) {
agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
}
if (type.equals("2")) {
agvurl = paramService.findByCode(AcsConfig.AGVURL2).getValue();
agvport = paramService.findByCode(AcsConfig.AGVPORT2).getValue();
}
agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
agvurl = agvurl + ":" + agvport + "/v1/transportOrders";
HttpResponse result = HttpRequest.get(agvurl)
@@ -278,8 +267,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
jo.put("destinations", destinations);
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
String url = agvurl + ":" + agvport + "/addDestinations";
log.info("下发agv任务请求:{}", url);
@@ -399,12 +388,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
log.info("反馈AGV请求数据:{}", requestjo);
System.out.println("back agv:" + requestjo);
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
if (inst.getInstruction_type().equals("4")) {
agvurl = paramService.findByCode(AcsConfig.AGVURL2).getValue();
}
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + jobno + "/interact";
HttpResponse result = HttpRequest.post(agvurl)
@@ -420,8 +405,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
public HttpResponse markComplete(String code) {
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
agvurl = agvurl + ":" + agvport + "/v1/" + code + "/markComplete";
log.info("关闭agv运单序列请求:{}", agvurl);
@@ -554,14 +539,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
@LokiLog(type = LokiLogType.AGV)
@Override
public HttpResponse deleteZDAgvInst(String instCode) {
public HttpResponse deleteZDAgvInst(String instCode) throws Exception {
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
String agvurl = paramService.findByCode(AcsConfig.AGVURL2).getValue();
String agvport = paramService.findByCode(AcsConfig.AGVPORT2).getValue();
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
Instruction instruction = instructionService.findByCode(instCode);
if (instruction.getInstruction_type().equals("1")) {
agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
}
agvurl = agvurl + ":" + agvport + "/rmds/v1/transportOrders/" + instCode + "/withdrawal";
log.info("删除agv指令请求agvurl:{}", agvurl);
HttpResponse result = HttpRequest.post(agvurl)

View File

@@ -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("指令不存在或已删除");
}

View File

@@ -34,7 +34,7 @@ public class AutoCreateInst {
* 根据任务状态创建指令、生成下一条指令
* 创建指令前需要判断是否条件具备:起始位置是否有货、目标位置是否有货
*/
public void run() throws Exception {
public synchronized void run() throws Exception {
TaskService taskserver = SpringContextHolder.getBean(TaskService.class);
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
@@ -123,9 +123,9 @@ public class AutoCreateInst {
continue;
}
if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
continue;
}
// if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
// continue;
// }
Device startdevice = appService.findDeviceByCode(start_device_code);
Device nextdevice = appService.findDeviceByCode(next_device_code);
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {

View File

@@ -168,6 +168,7 @@
<template slot-scope="scope">
<span v-if="scope.row.type=='0' ">输送路由</span>
<span v-if="scope.row.type=='1' ">agv路由</span>
<span v-if="scope.row.type=='2' ">rgv路由</span>
</template>
</el-table-column>
<el-table-column prop="next_device_code" min-width="120" label="后置设备号" />
@@ -269,6 +270,10 @@ export default {
{
typeName: 'agv路由',
typeValue: '1'
},
{
typeName: 'rgv路由',
typeValue: '2'
}],
permission: {
add: ['admin', 'routeLine:add'],