Browse Source

修改 很多问题

master
张江玮 2 years ago
parent
commit
e984b95cf3
  1. 2
      acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java
  2. 22
      acs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java
  3. 22
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  4. 4
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/WmsToAcsWebService.java
  5. 4
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/WmsToAcsWebServiceImpl.java
  6. 12
      acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java
  7. 5
      acs/nladmin-system/src/main/java/org/nl/acs/test/rest/TestController.java
  8. 60
      acs/nladmin-system/src/main/java/org/nl/acs/test/service/impl/TestServiceImpl.java
  9. 8
      acs/nladmin-ui/src/views/acs/task/index.vue

2
acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java

@ -159,6 +159,8 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
inst.setAgv_jobno(String.valueOf(index)); inst.setAgv_jobno(String.valueOf(index));
inst.setSend_status("1"); inst.setSend_status("1");
instructionService.update(inst); instructionService.update(inst);
} else {
log.info("phase == 0x01 , 未找到指令号为" + ikey + "的指令");
} }
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
} }

22
acs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java

@ -23,27 +23,7 @@ public enum DriverTypeEnum {
AGV_NDC_ONE(7, "agv_ndc_one", "NDC1楼AGV", "agv"), AGV_NDC_ONE(7, "agv_ndc_one", "NDC1楼AGV", "agv"),
AGV_NDC_TWO(8, "agv_ndc_two", "NDC2楼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");
//驱动索引 //驱动索引

22
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java

@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.acs.AcsConfig;
import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.agv.server.NDCAgvService;
import org.nl.acs.auto.run.OneNDCSocketConnectionAutoRun; import org.nl.acs.auto.run.OneNDCSocketConnectionAutoRun;
import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.DeviceService;
@ -128,7 +129,11 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
inst.setCarno(String.valueOf(carno)); inst.setCarno(String.valueOf(carno));
instructionService.update(inst); instructionService.update(inst);
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + "反馈:" + data); logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + "反馈:" + data);
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
if (StrUtil.equals(hasWms, "1")) {
TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code()); TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code());
if (!StrUtil.startWith(task.getTask_code(), "-")) {
JSONObject request = new JSONObject(); JSONObject request = new JSONObject();
request.put("REQCODE", task.getTask_code()); request.put("REQCODE", task.getTask_code());
request.put("TASKCODE", task.getTask_code()); request.put("TASKCODE", task.getTask_code());
@ -138,6 +143,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
request.put("AGVCODE", this.device_code); request.put("AGVCODE", this.device_code);
request.put("REQTIME", DateUtil.now()); request.put("REQTIME", DateUtil.now());
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString()); new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString());
}
}
//到达取货点 //到达取货点
//(需要WCS反馈) //(需要WCS反馈)
} else if (phase == 0x03) { } else if (phase == 0x03) {
@ -197,7 +204,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
} }
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data); logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
if (StrUtil.equals(hasWms, "1")) {
TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code()); TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code());
if (!StrUtil.startWith(task.getTask_code(), "-")) {
JSONObject request = new JSONObject(); JSONObject request = new JSONObject();
request.put("REQCODE", task.getTask_code()); request.put("REQCODE", task.getTask_code());
request.put("TASKCODE", task.getTask_code()); request.put("TASKCODE", task.getTask_code());
@ -207,6 +217,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
request.put("AGVCODE", this.device_code); request.put("AGVCODE", this.device_code);
request.put("REQTIME", DateUtil.now()); request.put("REQTIME", DateUtil.now());
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString()); new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString());
}
}
//取货完毕 //取货完毕
//(需要WCS反馈) //(需要WCS反馈)
@ -279,7 +291,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
} }
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data); logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
if (StrUtil.equals(hasWms, "1")) {
TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code()); TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code());
if (!StrUtil.startWith(task.getTask_code(), "-")) {
JSONObject request = new JSONObject(); JSONObject request = new JSONObject();
request.put("REQCODE", task.getTask_code()); request.put("REQCODE", task.getTask_code());
request.put("TASKCODE", task.getTask_code()); request.put("TASKCODE", task.getTask_code());
@ -289,6 +304,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
request.put("AGVCODE", this.device_code); request.put("AGVCODE", this.device_code);
request.put("REQTIME", DateUtil.now()); request.put("REQTIME", DateUtil.now());
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString()); new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString());
}
}
//到达放货点 //到达放货点
//(需要WCS反馈) //(需要WCS反馈)
@ -341,7 +358,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
} }
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data); logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
if (StrUtil.equals(hasWms, "1")) {
TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code()); TaskDto task = SpringContextHolder.getBean(TaskService.class).findByCodeFromCache(inst.getTask_code());
if (!StrUtil.startWith(task.getTask_code(), "-")) {
JSONObject request = new JSONObject(); JSONObject request = new JSONObject();
request.put("REQCODE", task.getTask_code()); request.put("REQCODE", task.getTask_code());
request.put("TASKCODE", task.getTask_code()); request.put("TASKCODE", task.getTask_code());
@ -351,6 +371,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
request.put("AGVCODE", this.device_code); request.put("AGVCODE", this.device_code);
request.put("REQTIME", DateUtil.now()); request.put("REQTIME", DateUtil.now());
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString()); new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString());
}
}
//放货完毕 //放货完毕
//(需要WCS反馈) //(需要WCS反馈)

4
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/WmsToAcsWebService.java

@ -6,7 +6,7 @@ import javax.jws.WebService;
@WebService(targetNamespace = "http://service.mrxu.com/") @WebService(targetNamespace = "http://service.mrxu.com/")
public interface WmsToAcsWebService { 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);
} }

4
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/WmsToAcsWebServiceImpl.java

@ -23,7 +23,7 @@ public class WmsToAcsWebServiceImpl implements WmsToAcsWebService {
private final WmsToAcsService wmsToAcsService; private final WmsToAcsService wmsToAcsService;
@Override @Override
public String createTask(String jsonStr) { public String rta_genAgvSchedulingTask(String jsonStr) {
CreateTaskResponse methodResult = wmsToAcsService.crateTask(jsonStr); CreateTaskResponse methodResult = wmsToAcsService.crateTask(jsonStr);
JSONObject response = new JSONObject(); JSONObject response = new JSONObject();
response.put("REQCODE", methodResult.getREQCODE()); response.put("REQCODE", methodResult.getREQCODE());
@ -35,7 +35,7 @@ public class WmsToAcsWebServiceImpl implements WmsToAcsWebService {
} }
@Override @Override
public String cancelTask(String jsonStr) { public String rta_cancelTask(String jsonStr) {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
JSONObject json = JSONObject.parseObject(jsonStr); JSONObject json = JSONObject.parseObject(jsonStr);
if (ObjectUtil.isEmpty(json)) { if (ObjectUtil.isEmpty(json)) {

12
acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java

@ -344,6 +344,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
// hongXiangConveyorDeviceDriver.writing(3, Integer.valueOf(dto.getInstruction_code())); // hongXiangConveyorDeviceDriver.writing(3, Integer.valueOf(dto.getInstruction_code()));
// } // }
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
try { try {
String start_device_code = dto.getStart_device_code(); String start_device_code = dto.getStart_device_code();
String next_device_code = dto.getNext_device_code(); String next_device_code = dto.getNext_device_code();
@ -364,6 +365,10 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
if (ObjectUtil.isEmpty(route)) { if (ObjectUtil.isEmpty(route)) {
throw new BadRequestException("未查询到相关路由!"); throw new BadRequestException("未查询到相关路由!");
} }
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
wo.insert(json);
instructions.add(dto);
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) { if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
// 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统 // 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统
if (!StrUtil.equals(task.getAgv_system_type(), "0") if (!StrUtil.equals(task.getAgv_system_type(), "0")
@ -382,15 +387,10 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
} }
} catch (Exception e) { } catch (Exception e) {
dto.setSend_status("2"); dto.setSend_status("2");
wo.update((JSONObject) JSONObject.toJSON(dto));
e.printStackTrace(); e.printStackTrace();
log.error(""); log.error("");
} }
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
wo.insert(json);
instructions.add(dto);
} }
@Override @Override

5
acs/nladmin-system/src/main/java/org/nl/acs/test/rest/TestController.java

@ -39,14 +39,13 @@ public class TestController {
@SaIgnore @SaIgnore
//@PreAuthorize("@el.check('task:add')") //@PreAuthorize("@el.check('task:add')")
public ResponseEntity<Object> test1() throws IOException { public ResponseEntity<Object> test1() throws IOException {
HttpHeaders headers = new HttpHeaders(); return new ResponseEntity<>(testService.test1(), HttpStatus.CREATED);
headers.add(HttpHeaders.CONTENT_TYPE,"text/plain;charset=UTF-8");
return new ResponseEntity<>(testService.test1(), headers, HttpStatus.CREATED);
} }
@Log("test2") @Log("test2")
@ApiOperation("test2") @ApiOperation("test2")
@PostMapping("/test2") @PostMapping("/test2")
@SaIgnore
//@PreAuthorize("@el.check('task:add')") //@PreAuthorize("@el.check('task:add')")
public ResponseEntity<Object> test2() throws IOException { public ResponseEntity<Object> test2() throws IOException {
testService.test2(); testService.test2();

60
acs/nladmin-system/src/main/java/org/nl/acs/test/service/impl/TestServiceImpl.java

@ -2,11 +2,16 @@
package org.nl.acs.test.service.impl; package org.nl.acs.test.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; 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.test.service.TestService;
import org.nl.acs.wsdl.org.tempuri.RTMSAGVSERVICE; import org.nl.acs.wsdl.org.tempuri.RTMSAGVSERVICE;
import org.nl.modules.wql.util.SpringContextHolder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.IOException; import java.io.IOException;
@ -21,18 +26,63 @@ import java.util.Map;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
public class TestServiceImpl implements TestService public class TestServiceImpl implements TestService {
{
@Override @Override
public String test1() { public String test1() {
String s = new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback("{}"); JSONObject jsonObject = new JSONObject();
return new String(s.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); 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 @Override
public void test2() throws IOException { 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 @Override

8
acs/nladmin-ui/src/views/acs/task/index.vue

@ -97,7 +97,7 @@
<el-form-item v-if="false" label="任务标识" prop="task_id"> <el-form-item v-if="false" label="任务标识" prop="task_id">
<el-input v-model="form.task_id" style="width: 370px;" /> <el-input v-model="form.task_id" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="物料类型"> <el-form-item v-if="false" label="物料类型">
<el-select <el-select
v-model="form.material" v-model="form.material"
style="width: 370px;" style="width: 370px;"
@ -113,7 +113,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="任务类型"> <el-form-item v-if="false" label="任务类型">
<el-select <el-select
v-model="form.task_type" v-model="form.task_type"
style="width: 370px;" style="width: 370px;"
@ -145,7 +145,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="agv系统"> <el-form-item v-if="false" label="agv系统">
<el-select <el-select
v-model="form.agv_system_type" v-model="form.agv_system_type"
style="width: 370px;" style="width: 370px;"
@ -491,7 +491,7 @@ export default {
to_x: null, to_x: null,
to_y: null, to_y: null,
to_z: null, to_z: null,
agv_system_type: '' agv_system_type: '1'
}, },
rules: { rules: {
start_point_code: [ start_point_code: [

Loading…
Cancel
Save