修改 很多问题
This commit is contained in:
@@ -159,6 +159,8 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
inst.setAgv_jobno(String.valueOf(index));
|
||||
inst.setSend_status("1");
|
||||
instructionService.update(inst);
|
||||
} else {
|
||||
log.info("phase == 0x01 , 未找到指令号为" + ikey + "的指令");
|
||||
}
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
|
||||
@@ -23,27 +23,7 @@ public enum DriverTypeEnum {
|
||||
|
||||
AGV_NDC_ONE(7, "agv_ndc_one", "NDC1楼AGV", "agv"),
|
||||
|
||||
AGV_NDC_TWO(8, "agv_ndc_two", "NDC2楼AGV", "agv"),
|
||||
|
||||
HONGXIANG_DEVICE(9, "hongxiang_device", "烘箱设备点位", "conveyor"),
|
||||
|
||||
OVEN_MANIPULATOR(10, "oven_manipulator", "烘箱-行架机械手", "station"),
|
||||
|
||||
SLIT_TWO_MANIPULATOR(11, "slit_two_manipulator", "分切双工位-行架机械手", "station"),
|
||||
|
||||
BOX_PALLETIZING_MANIPULATOR(12, "box_palletizing_manipulator", "木箱码垛-行架机械手", "station"),
|
||||
|
||||
SIEMENS_CONVEYOR(13, "siemens_conveyor", "西门子-输送机驱动", "conveyor"),
|
||||
|
||||
HONGXIANG_CONVEYOR(13, "hongxiang_conveyor", "烘箱对接位", "conveyor"),
|
||||
|
||||
INSPECT_CONVEYOR_CONTROL_WITH_SCANNER(14, "standard_conveyor_control_with_scanner", "标准版-输送机-控制点-关联扫码", "conveyor"),
|
||||
|
||||
PLUG_PULL_DEVICE_SITE(15, "plug_pull_device_site", "插拔轴站点", "conveyor"),
|
||||
|
||||
SIEMENS_CONVEYOR_LABELING(16, "siemens_conveyor_labeling", "西门子-输送机驱动-贴标", "conveyor"),
|
||||
|
||||
SIEMENS_CONVEYOR_CKK(17, "siemens_conveyor_ckk", "西门子-输送机驱动-出库口", "conveyor");
|
||||
AGV_NDC_TWO(8, "agv_ndc_two", "NDC2楼AGV", "agv");
|
||||
|
||||
|
||||
//驱动索引
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.agv.server.NDCAgvService;
|
||||
import org.nl.acs.auto.run.OneNDCSocketConnectionAutoRun;
|
||||
import org.nl.acs.device.service.DeviceService;
|
||||
@@ -128,16 +129,22 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
inst.setCarno(String.valueOf(carno));
|
||||
instructionService.update(inst);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + "反馈:" + data);
|
||||
TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code());
|
||||
JSONObject request = new JSONObject();
|
||||
request.put("REQCODE", task.getTask_code());
|
||||
request.put("TASKCODE", task.getTask_code());
|
||||
request.put("PODCODE", task.getVehicle_code());
|
||||
request.put("TASKTYPE", task.getTask_type());
|
||||
request.put("METHOD", "1");
|
||||
request.put("AGVCODE", this.device_code);
|
||||
request.put("REQTIME", DateUtil.now());
|
||||
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString());
|
||||
|
||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
if (StrUtil.equals(hasWms, "1")) {
|
||||
TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code());
|
||||
if (!StrUtil.startWith(task.getTask_code(), "-")) {
|
||||
JSONObject request = new JSONObject();
|
||||
request.put("REQCODE", task.getTask_code());
|
||||
request.put("TASKCODE", task.getTask_code());
|
||||
request.put("PODCODE", task.getVehicle_code());
|
||||
request.put("TASKTYPE", task.getTask_type());
|
||||
request.put("METHOD", "1");
|
||||
request.put("AGVCODE", this.device_code);
|
||||
request.put("REQTIME", DateUtil.now());
|
||||
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString());
|
||||
}
|
||||
}
|
||||
//到达取货点
|
||||
//(需要WCS反馈)
|
||||
} else if (phase == 0x03) {
|
||||
@@ -197,16 +204,21 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
|
||||
TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code());
|
||||
JSONObject request = new JSONObject();
|
||||
request.put("REQCODE", task.getTask_code());
|
||||
request.put("TASKCODE", task.getTask_code());
|
||||
request.put("PODCODE", task.getVehicle_code());
|
||||
request.put("TASKTYPE", task.getTask_type());
|
||||
request.put("METHOD", "2");
|
||||
request.put("AGVCODE", this.device_code);
|
||||
request.put("REQTIME", DateUtil.now());
|
||||
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString());
|
||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
if (StrUtil.equals(hasWms, "1")) {
|
||||
TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code());
|
||||
if (!StrUtil.startWith(task.getTask_code(), "-")) {
|
||||
JSONObject request = new JSONObject();
|
||||
request.put("REQCODE", task.getTask_code());
|
||||
request.put("TASKCODE", task.getTask_code());
|
||||
request.put("PODCODE", task.getVehicle_code());
|
||||
request.put("TASKTYPE", task.getTask_type());
|
||||
request.put("METHOD", "2");
|
||||
request.put("AGVCODE", this.device_code);
|
||||
request.put("REQTIME", DateUtil.now());
|
||||
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString());
|
||||
}
|
||||
}
|
||||
|
||||
//取货完毕
|
||||
//(需要WCS反馈)
|
||||
@@ -279,16 +291,21 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
|
||||
TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code());
|
||||
JSONObject request = new JSONObject();
|
||||
request.put("REQCODE", task.getTask_code());
|
||||
request.put("TASKCODE", task.getTask_code());
|
||||
request.put("PODCODE", task.getVehicle_code());
|
||||
request.put("TASKTYPE", task.getTask_type());
|
||||
request.put("METHOD", "3");
|
||||
request.put("AGVCODE", this.device_code);
|
||||
request.put("REQTIME", DateUtil.now());
|
||||
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString());
|
||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
if (StrUtil.equals(hasWms, "1")) {
|
||||
TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code());
|
||||
if (!StrUtil.startWith(task.getTask_code(), "-")) {
|
||||
JSONObject request = new JSONObject();
|
||||
request.put("REQCODE", task.getTask_code());
|
||||
request.put("TASKCODE", task.getTask_code());
|
||||
request.put("PODCODE", task.getVehicle_code());
|
||||
request.put("TASKTYPE", task.getTask_type());
|
||||
request.put("METHOD", "3");
|
||||
request.put("AGVCODE", this.device_code);
|
||||
request.put("REQTIME", DateUtil.now());
|
||||
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString());
|
||||
}
|
||||
}
|
||||
|
||||
//到达放货点
|
||||
//(需要WCS反馈)
|
||||
@@ -341,16 +358,21 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
|
||||
TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code());
|
||||
JSONObject request = new JSONObject();
|
||||
request.put("REQCODE", task.getTask_code());
|
||||
request.put("TASKCODE", task.getTask_code());
|
||||
request.put("PODCODE", task.getVehicle_code());
|
||||
request.put("TASKTYPE", task.getTask_type());
|
||||
request.put("METHOD", "4");
|
||||
request.put("AGVCODE", this.device_code);
|
||||
request.put("REQTIME", DateUtil.now());
|
||||
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString());
|
||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
if (StrUtil.equals(hasWms, "1")) {
|
||||
TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code());
|
||||
if (!StrUtil.startWith(task.getTask_code(), "-")) {
|
||||
JSONObject request = new JSONObject();
|
||||
request.put("REQCODE", task.getTask_code());
|
||||
request.put("TASKCODE", task.getTask_code());
|
||||
request.put("PODCODE", task.getVehicle_code());
|
||||
request.put("TASKTYPE", task.getTask_type());
|
||||
request.put("METHOD", "4");
|
||||
request.put("AGVCODE", this.device_code);
|
||||
request.put("REQTIME", DateUtil.now());
|
||||
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString());
|
||||
}
|
||||
}
|
||||
|
||||
//放货完毕
|
||||
//(需要WCS反馈)
|
||||
|
||||
@@ -6,7 +6,7 @@ import javax.jws.WebService;
|
||||
@WebService(targetNamespace = "http://service.mrxu.com/")
|
||||
public interface WmsToAcsWebService {
|
||||
|
||||
String createTask(@WebParam(name = "jsonStr") String jsonStr);
|
||||
String rta_genAgvSchedulingTask(@WebParam(name = "jsonStr") String jsonStr);
|
||||
|
||||
String cancelTask(@WebParam(name = "jsonStr") String jsonStr);
|
||||
String rta_cancelTask(@WebParam(name = "jsonStr") String jsonStr);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class WmsToAcsWebServiceImpl implements WmsToAcsWebService {
|
||||
private final WmsToAcsService wmsToAcsService;
|
||||
|
||||
@Override
|
||||
public String createTask(String jsonStr) {
|
||||
public String rta_genAgvSchedulingTask(String jsonStr) {
|
||||
CreateTaskResponse methodResult = wmsToAcsService.crateTask(jsonStr);
|
||||
JSONObject response = new JSONObject();
|
||||
response.put("REQCODE", methodResult.getREQCODE());
|
||||
@@ -35,7 +35,7 @@ public class WmsToAcsWebServiceImpl implements WmsToAcsWebService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String cancelTask(String jsonStr) {
|
||||
public String rta_cancelTask(String jsonStr) {
|
||||
JSONObject result = new JSONObject();
|
||||
JSONObject json = JSONObject.parseObject(jsonStr);
|
||||
if (ObjectUtil.isEmpty(json)) {
|
||||
|
||||
@@ -344,6 +344,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
// hongXiangConveyorDeviceDriver.writing(3, Integer.valueOf(dto.getInstruction_code()));
|
||||
// }
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||
try {
|
||||
String start_device_code = dto.getStart_device_code();
|
||||
String next_device_code = dto.getNext_device_code();
|
||||
@@ -364,6 +365,10 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
if (ObjectUtil.isEmpty(route)) {
|
||||
throw new BadRequestException("未查询到相关路由!");
|
||||
}
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||
|
||||
wo.insert(json);
|
||||
instructions.add(dto);
|
||||
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||
// 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统
|
||||
if (!StrUtil.equals(task.getAgv_system_type(), "0")
|
||||
@@ -382,15 +387,10 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
} catch (Exception e) {
|
||||
dto.setSend_status("2");
|
||||
wo.update((JSONObject) JSONObject.toJSON(dto));
|
||||
e.printStackTrace();
|
||||
log.error("");
|
||||
}
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||
|
||||
wo.insert(json);
|
||||
instructions.add(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,14 +39,13 @@ public class TestController {
|
||||
@SaIgnore
|
||||
//@PreAuthorize("@el.check('task:add')")
|
||||
public ResponseEntity<Object> test1() throws IOException {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add(HttpHeaders.CONTENT_TYPE,"text/plain;charset=UTF-8");
|
||||
return new ResponseEntity<>(testService.test1(), headers, HttpStatus.CREATED);
|
||||
return new ResponseEntity<>(testService.test1(), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("test2")
|
||||
@ApiOperation("test2")
|
||||
@PostMapping("/test2")
|
||||
@SaIgnore
|
||||
//@PreAuthorize("@el.check('task:add')")
|
||||
public ResponseEntity<Object> test2() throws IOException {
|
||||
testService.test2();
|
||||
|
||||
@@ -2,11 +2,16 @@
|
||||
package org.nl.acs.test.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device.device_driver.DriverTypeEnum;
|
||||
import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device.service.dto.DeviceDto;
|
||||
import org.nl.acs.test.service.TestService;
|
||||
import org.nl.acs.wsdl.org.tempuri.RTMSAGVSERVICE;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -21,18 +26,63 @@ import java.util.Map;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class TestServiceImpl implements TestService
|
||||
{
|
||||
public class TestServiceImpl implements TestService {
|
||||
|
||||
@Override
|
||||
public String test1() {
|
||||
String s = new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback("{}");
|
||||
return new String(s.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("address", "");
|
||||
jsonObject.put("device_type", "conveyor");
|
||||
jsonObject.put("device_type_name", "固定货台-Station");
|
||||
jsonObject.put("driver_code", "");
|
||||
jsonObject.put("is_route", "FALSE");
|
||||
jsonObject.put("region", "3");
|
||||
jsonObject.put("region_name", "货柜零部件交接区");
|
||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class);
|
||||
for (int i = 3001, j = 35; i <= 3004; i++, j++) {
|
||||
jsonObject.put("device_code", String.valueOf(i));
|
||||
jsonObject.put("device_name", String.valueOf(i));
|
||||
jsonObject.put("seq_num", j);
|
||||
deviceService.create(jsonObject.toJavaObject(DeviceDto.class));
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void test2() throws IOException {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("form", new JSONObject() {{
|
||||
put("address", "");
|
||||
}});
|
||||
|
||||
JSONObject parentForm = new JSONObject();
|
||||
parentForm.put("address", "");
|
||||
parentForm.put("create_by", "admin");
|
||||
parentForm.put("create_time", DateUtil.now());
|
||||
parentForm.put("driver_code", DriverTypeEnum.ORDINARY_SITE.getCode());
|
||||
parentForm.put("is_active", "1");
|
||||
parentForm.put("is_config", "FALSE");
|
||||
parentForm.put("is_delete", "0");
|
||||
parentForm.put("is_route", false);
|
||||
parentForm.put("manufacturer", "");
|
||||
parentForm.put("manufacturer_phone", "");
|
||||
parentForm.put("opc_plc_id", "");
|
||||
parentForm.put("opc_server_id", "");
|
||||
parentForm.put("remark", "");
|
||||
parentForm.put("update_by", "admin");
|
||||
parentForm.put("update_time", DateUtil.now());
|
||||
jsonObject.put("parentForm", parentForm);
|
||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class);
|
||||
for (int i = 3001; i <= 3004; i++) {
|
||||
DeviceDto device = deviceService.findByCode(String.valueOf(i));
|
||||
parentForm.put("region", device.getRegion());
|
||||
parentForm.put("device_code", device.getDevice_code());
|
||||
parentForm.put("device_id", device.getDevice_id());
|
||||
parentForm.put("device_name", device.getDevice_name());
|
||||
parentForm.put("device_type", device.getDevice_type());
|
||||
parentForm.put("seq_num", device.getSeq_num());
|
||||
deviceService.updateConfig(jsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
<el-form-item v-if="false" label="任务标识" prop="task_id">
|
||||
<el-input v-model="form.task_id" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料类型">
|
||||
<el-form-item v-if="false" label="物料类型">
|
||||
<el-select
|
||||
v-model="form.material"
|
||||
style="width: 370px;"
|
||||
@@ -113,7 +113,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务类型">
|
||||
<el-form-item v-if="false" label="任务类型">
|
||||
<el-select
|
||||
v-model="form.task_type"
|
||||
style="width: 370px;"
|
||||
@@ -145,7 +145,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="agv系统">
|
||||
<el-form-item v-if="false" label="agv系统">
|
||||
<el-select
|
||||
v-model="form.agv_system_type"
|
||||
style="width: 370px;"
|
||||
@@ -353,8 +353,8 @@
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column prop="compound_task_data" width="200" label="复合路线" />-->
|
||||
<!-- <el-table-column prop="matarial" label="物料" />-->
|
||||
<!-- <el-table-column prop="quantity" label="数量" />-->
|
||||
<!-- <el-table-column prop="matarial" label="物料" />-->
|
||||
<!-- <el-table-column prop="quantity" label="数量" />-->
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="create_by" label="创建者" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="135" />
|
||||
@@ -491,7 +491,7 @@ export default {
|
||||
to_x: null,
|
||||
to_y: null,
|
||||
to_z: null,
|
||||
agv_system_type: ''
|
||||
agv_system_type: '1'
|
||||
},
|
||||
rules: {
|
||||
start_point_code: [
|
||||
|
||||
Reference in New Issue
Block a user