acs兼容浙大和NDC系统
This commit is contained in:
@@ -14,18 +14,14 @@ public interface AcsConfig {
|
|||||||
String CREATETASKCHECK = "createTaskCheck";
|
String CREATETASKCHECK = "createTaskCheck";
|
||||||
//撤销任务检查
|
//撤销任务检查
|
||||||
String CANCELTASKCHECK = "cancelTaskCheck";
|
String CANCELTASKCHECK = "cancelTaskCheck";
|
||||||
//一楼agv系统接口地址
|
//agv系统接口地址
|
||||||
String AGVURL = "agvurl";
|
String AGVURL = "agvurl";
|
||||||
//AGV系统端口
|
//AGV系统端口
|
||||||
String AGVPORT = "agvport";
|
String AGVPORT = "agvport";
|
||||||
//二楼1区agv系统接口地址
|
//rgv系统接口地址
|
||||||
String AGVURL2 = "agvurl2";
|
String RGVURL = "rgvurl";
|
||||||
//二楼1区AGV系统端口
|
//RGV系统端口
|
||||||
String AGVPORT2 = "agvport2";
|
String RGVPORT = "rgvport";
|
||||||
//二楼2区agv系统接口地址
|
|
||||||
String AGVURL22 = "agvurl22";
|
|
||||||
//二楼2区AGV系统端口
|
|
||||||
String AGVPORT22 = "agvport22";
|
|
||||||
//指定AGV系统
|
//指定AGV系统
|
||||||
String AGVTYPE = "agvType";
|
String AGVTYPE = "agvType";
|
||||||
//WMS系统接口地址
|
//WMS系统接口地址
|
||||||
|
|||||||
@@ -36,6 +36,6 @@ public interface ZheDaAgvService {
|
|||||||
* @param instCode
|
* @param instCode
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public HttpResponse deleteZDAgvInst(String instCode);
|
public HttpResponse deleteZDAgvInst(String instCode) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,18 +69,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
jo.put("destinations", destinations);
|
jo.put("destinations", destinations);
|
||||||
|
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
|
||||||
String agvurl2 = paramService.findByCode(AcsConfig.AGVURL2).getValue();
|
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
|
||||||
String agvport2 = paramService.findByCode(AcsConfig.AGVPORT2).getValue();
|
|
||||||
|
|
||||||
|
|
||||||
//不同楼层下发不同的agv系统
|
|
||||||
if (task_type.equals("1")) {
|
|
||||||
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + inst.getInstruction_code();
|
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + inst.getInstruction_code();
|
||||||
} else {
|
|
||||||
agvurl = agvurl2 + ":" + agvport2 + "/v1/transportOrders/" + inst.getInstruction_code();
|
|
||||||
}
|
|
||||||
log.info("下发agv任务请求:{}", agvurl);
|
log.info("下发agv任务请求:{}", agvurl);
|
||||||
|
|
||||||
HttpResponse result = HttpRequest.post(agvurl)
|
HttpResponse result = HttpRequest.post(agvurl)
|
||||||
@@ -101,14 +94,10 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||||
String agvurl = "";
|
String agvurl = "";
|
||||||
String agvport = "";
|
String agvport = "";
|
||||||
if (type.equals("1")) {
|
|
||||||
agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
|
||||||
agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
|
||||||
}
|
|
||||||
if (type.equals("2")) {
|
|
||||||
agvurl = paramService.findByCode(AcsConfig.AGVURL2).getValue();
|
|
||||||
agvport = paramService.findByCode(AcsConfig.AGVPORT2).getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
agvurl = agvurl + ":" + agvport + "/v1/transportOrders";
|
agvurl = agvurl + ":" + agvport + "/v1/transportOrders";
|
||||||
HttpResponse result = HttpRequest.get(agvurl)
|
HttpResponse result = HttpRequest.get(agvurl)
|
||||||
@@ -278,8 +267,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
|
|
||||||
jo.put("destinations", destinations);
|
jo.put("destinations", destinations);
|
||||||
|
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
|
||||||
|
|
||||||
String url = agvurl + ":" + agvport + "/addDestinations";
|
String url = agvurl + ":" + agvport + "/addDestinations";
|
||||||
log.info("下发agv任务请求:{}", url);
|
log.info("下发agv任务请求:{}", url);
|
||||||
@@ -399,12 +388,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
log.info("反馈AGV请求数据:{}", requestjo);
|
log.info("反馈AGV请求数据:{}", requestjo);
|
||||||
System.out.println("back agv:" + requestjo);
|
System.out.println("back agv:" + requestjo);
|
||||||
|
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
|
||||||
|
|
||||||
if (inst.getInstruction_type().equals("4")) {
|
|
||||||
agvurl = paramService.findByCode(AcsConfig.AGVURL2).getValue();
|
|
||||||
}
|
|
||||||
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + jobno + "/interact";
|
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + jobno + "/interact";
|
||||||
|
|
||||||
HttpResponse result = HttpRequest.post(agvurl)
|
HttpResponse result = HttpRequest.post(agvurl)
|
||||||
@@ -420,8 +405,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
public HttpResponse markComplete(String code) {
|
public HttpResponse markComplete(String code) {
|
||||||
|
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
|
||||||
|
|
||||||
agvurl = agvurl + ":" + agvport + "/v1/" + code + "/markComplete";
|
agvurl = agvurl + ":" + agvport + "/v1/" + code + "/markComplete";
|
||||||
log.info("关闭agv运单序列请求:{}", agvurl);
|
log.info("关闭agv运单序列请求:{}", agvurl);
|
||||||
@@ -554,14 +539,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
|
|
||||||
@LokiLog(type = LokiLogType.AGV)
|
@LokiLog(type = LokiLogType.AGV)
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse deleteZDAgvInst(String instCode) {
|
public HttpResponse deleteZDAgvInst(String instCode) throws Exception {
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL2).getValue();
|
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT2).getValue();
|
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
|
||||||
Instruction instruction = instructionService.findByCode(instCode);
|
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";
|
agvurl = agvurl + ":" + agvport + "/rmds/v1/transportOrders/" + instCode + "/withdrawal";
|
||||||
log.info("删除agv指令请求agvurl:{}", agvurl);
|
log.info("删除agv指令请求agvurl:{}", agvurl);
|
||||||
HttpResponse result = HttpRequest.post(agvurl)
|
HttpResponse result = HttpRequest.post(agvurl)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
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.MagicAgvService;
|
||||||
import org.nl.acs.agv.server.NDCAgvService;
|
import org.nl.acs.agv.server.NDCAgvService;
|
||||||
import org.nl.acs.agv.server.XianGongAgvService;
|
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.auto.initial.ApplicationAutoInitial;
|
||||||
import org.nl.acs.device.domain.Device;
|
import org.nl.acs.device.domain.Device;
|
||||||
import org.nl.acs.device.service.DeviceService;
|
import org.nl.acs.device.service.DeviceService;
|
||||||
@@ -450,12 +452,27 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||||
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||||
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
|
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");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} else {
|
||||||
|
dto.setSend_status("2");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch(Exception e)
|
||||||
|
{
|
||||||
dto.setSend_status("2");
|
dto.setSend_status("2");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.error("");
|
log.error("");
|
||||||
}
|
}
|
||||||
|
|
||||||
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||||
// JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
// JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||||
// wo.insert(json);
|
// wo.insert(json);
|
||||||
@@ -978,24 +995,22 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
entity.setRoute_plan_code(task.getRoute_plan_code());
|
entity.setRoute_plan_code(task.getRoute_plan_code());
|
||||||
}
|
}
|
||||||
|
|
||||||
// != 0 为agv任务 1=magic 2=NDC 3=XZ,4=ZHEDA
|
// != 0 1=NDC任务 2=RGV任务
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "1")
|
if (StrUtil.equals(task.getAgv_system_type(), "1")
|
||||||
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
&& !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上报
|
// NDC agv指令不当场取消指令,需要等agv上报
|
||||||
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
|
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
|
||||||
ndcAgvService.deleteAgvInstToNDC((Instruction)entity);
|
ndcAgvService.deleteAgvInstToNDC((Instruction)entity);
|
||||||
} else {
|
|
||||||
flag = true;
|
|
||||||
}
|
}
|
||||||
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")
|
flag = true;
|
||||||
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
|
||||||
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
|
} else if (StrUtil.equals(task.getAgv_system_type(), "2")) {
|
||||||
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
|
try {
|
||||||
|
ZheDaAgvService zheDaAgvService = SpringContextHolder.getBean(ZheDaAgvService.class);
|
||||||
|
zheDaAgvService.deleteZDAgvInst(entity.getInstruction_code());
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("下发浙大取消指令失败{}",e.getMessage());
|
||||||
|
}
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
flag = true;
|
flag = true;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class AutoCreateInst {
|
|||||||
* 根据任务状态创建指令、生成下一条指令
|
* 根据任务状态创建指令、生成下一条指令
|
||||||
* 创建指令前需要判断是否条件具备:起始位置是否有货、目标位置是否有货
|
* 创建指令前需要判断是否条件具备:起始位置是否有货、目标位置是否有货
|
||||||
*/
|
*/
|
||||||
public void run() throws Exception {
|
public synchronized void run() throws Exception {
|
||||||
TaskService taskserver = SpringContextHolder.getBean(TaskService.class);
|
TaskService taskserver = SpringContextHolder.getBean(TaskService.class);
|
||||||
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
|
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
|
||||||
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
|
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
|
||||||
@@ -123,9 +123,9 @@ public class AutoCreateInst {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
// if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
Device startdevice = appService.findDeviceByCode(start_device_code);
|
Device startdevice = appService.findDeviceByCode(start_device_code);
|
||||||
Device nextdevice = appService.findDeviceByCode(next_device_code);
|
Device nextdevice = appService.findDeviceByCode(next_device_code);
|
||||||
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
|
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
|
||||||
|
|||||||
@@ -168,6 +168,7 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.type=='0' ">输送路由</span>
|
<span v-if="scope.row.type=='0' ">输送路由</span>
|
||||||
<span v-if="scope.row.type=='1' ">agv路由</span>
|
<span v-if="scope.row.type=='1' ">agv路由</span>
|
||||||
|
<span v-if="scope.row.type=='2' ">rgv路由</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="next_device_code" min-width="120" label="后置设备号" />
|
<el-table-column prop="next_device_code" min-width="120" label="后置设备号" />
|
||||||
@@ -269,6 +270,10 @@ export default {
|
|||||||
{
|
{
|
||||||
typeName: 'agv路由',
|
typeName: 'agv路由',
|
||||||
typeValue: '1'
|
typeValue: '1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
typeName: 'rgv路由',
|
||||||
|
typeValue: '2'
|
||||||
}],
|
}],
|
||||||
permission: {
|
permission: {
|
||||||
add: ['admin', 'routeLine:add'],
|
add: ['admin', 'routeLine:add'],
|
||||||
|
|||||||
Reference in New Issue
Block a user