Browse Source

新锐更新

master
loujf 3 years ago
parent
commit
9e66143626
  1. 21
      hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/standard_inspect/ReadUtil.java
  2. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java
  3. 10
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/whxr/whxr_ball_mill_device/BallMillDeviceDriver.java
  4. 8
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/whxr/whxr_spary_tower_device/SparyTowerDeviceDriver.java
  5. 14
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/whxr/whxr_weighing/WhxrWeighingDeviceDriver.java
  6. 2
      hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java
  7. 3
      qd/src/views/acs/instruction/index.vue
  8. 13
      qd/src/views/acs/task/index.vue
  9. 3
      qd/src/views/acs/task/taskFeedback/index.vue

21
hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/standard_inspect/ReadUtil.java

@ -5,8 +5,13 @@ import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.jinterop.dcom.common.JIException;
import org.jinterop.dcom.core.JIVariant;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.log.service.impl.LogServerImpl;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.acs.opc.OpcUtl;
import org.nl.exception.BadRequestException;
import org.nl.utils.SpringContextHolder;
import org.nl.wql.core.bean.WQLObject;
import org.openscada.opc.dcom.list.ClassDetails;
import org.openscada.opc.lib.common.AlreadyConnectedException;
@ -16,13 +21,16 @@ import org.openscada.opc.lib.da.*;
import org.openscada.opc.lib.list.Categories;
import org.openscada.opc.lib.list.Category;
import org.openscada.opc.lib.list.ServerList;
import org.springframework.beans.factory.annotation.Autowired;
import java.net.UnknownHostException;
import java.util.*;
import java.util.concurrent.Executors;
public class ReadUtil {
public static void main(String[] args) throws AlreadyConnectedException, JIException, UnknownHostException, NotConnectedException, DuplicateGroupException, AddFailedException, InterruptedException {
// 启动服务
/* ItemProtocol ipl = new ItemProtocol();
List<ItemDto> list = ipl.getReadableItemDtos();
@ -156,7 +164,18 @@ public class ReadUtil {
}
public static void write(Map<String, Object> strings, Server server) {
String device_code = "";
String param = "";
String value = "";
LogServer logServer = SpringContextHolder.getBean(LogServerImpl.class);
try {
Set<String> strs = strings.keySet();
for (String str : strs) {
String[] split = str.split("\\.");
device_code = split[2];
param = split[3];
value = strings.get(str).toString();
}
//Group group = this.opcServerService.getServer(opcServiceCode);
Group group = server.addGroup();
Iterator it = strings.keySet().iterator();
@ -173,7 +192,9 @@ public class ReadUtil {
OpcUtl.writeValue(group, (WriteRequest[]) list.toArray(new WriteRequest[0]));
}
server.disconnect();
logServer.log("","","",device_code + "," + param + "," + value + ",下发电气返回值:成功!","","","","");
} catch (Exception e) {
logServer.log("","","",device_code + "," + param + "," + value + ",下发电气返回值:失败!","","","","");
e.printStackTrace();
}

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java

@ -130,7 +130,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
try {
String device_code = this.getDeviceCode();
mode = this.itemProtocol.getMode();
error = this.itemProtocol.getError();
error = this.itemProtocol.getError();
move = this.itemProtocol.getMove();
task = this.itemProtocol.getTask();
hasGoods = this.itemProtocol.getMove();

10
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/whxr/whxr_ball_mill_device/BallMillDeviceDriver.java

@ -5,11 +5,15 @@ import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.opc.Device;
import org.nl.utils.SpringContextHolder;
import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired;
import java.lang.reflect.Field;
import java.util.HashMap;
@ -24,6 +28,9 @@ import java.util.Map;
public class BallMillDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
LogServer logServer = SpringContextHolder.getBean("logServerImpl");
@Override
public Device getDevice() {
return this.device;
@ -54,7 +61,6 @@ public class BallMillDeviceDriver extends AbstractOpcDeviceDriver implements Dev
public void writing(String param, String value) {
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + param;
String opcservcerid = this.getDevice().getOpc_server_id();
@ -63,6 +69,8 @@ public class BallMillDeviceDriver extends AbstractOpcDeviceDriver implements Dev
itemMap.put(to_param, Double.valueOf(value).intValue());
ReadUtil.write(itemMap, server);
// logServer.log("","球磨机","",device_code + "," + param + "," + value,"","","","");
}
}

8
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/whxr/whxr_spary_tower_device/SparyTowerDeviceDriver.java

@ -8,8 +8,11 @@ import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.opc.Device;
import org.nl.utils.SpringContextHolder;
import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired;
import java.lang.reflect.Field;
import java.util.HashMap;
@ -24,6 +27,9 @@ import java.util.Map;
public class SparyTowerDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
LogServer logServer = SpringContextHolder.getBean("logServerImpl");
@Override
public Device getDevice() {
return this.device;
@ -63,6 +69,8 @@ public class SparyTowerDeviceDriver extends AbstractOpcDeviceDriver implements D
itemMap.put(to_param, Double.valueOf(value).intValue());
ReadUtil.write(itemMap, server);
// logServer.log("","喷雾机","",device_code + "," + param + "," + value,"","","","");
}
}

14
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/whxr/whxr_weighing/WhxrWeighingDeviceDriver.java

@ -15,6 +15,7 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.opc.Device;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
@ -45,6 +46,8 @@ public class WhxrWeighingDeviceDriver extends AbstractOpcDeviceDriver implements
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
@Autowired
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
@Autowired
LogServer logServer = SpringContextHolder.getBean("logServerImpl");
//放货准备锁
String putReadyLock = null;
//有货标记
@ -102,7 +105,7 @@ public class WhxrWeighingDeviceDriver extends AbstractOpcDeviceDriver implements
@Override
public void execute() {
public void execute() throws Exception {
String message = null;
try {
String device_code = this.getDeviceCode();
@ -275,7 +278,7 @@ public class WhxrWeighingDeviceDriver extends AbstractOpcDeviceDriver implements
*
* @return
*/
public synchronized boolean enter(JSONObject json) {
public synchronized boolean enter(JSONObject json) throws Exception {
Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
@ -287,11 +290,15 @@ public class WhxrWeighingDeviceDriver extends AbstractOpcDeviceDriver implements
if (ObjectUtil.isNotEmpty(result)) {
JSONObject jsonObject = JSONObject.fromObject(result.body());
if (result.getStatus() == 200 && jsonObject.get("status").equals("200")) {
// Thread.sleep(300L);
// this.writing(0);
this.writing(this.mode);
} else {
// Thread.sleep(300L);
this.writing(99);
}
} else {
// Thread.sleep(300L);
this.writing(99);
}
this.setRequireSucess(true);
@ -311,6 +318,7 @@ public class WhxrWeighingDeviceDriver extends AbstractOpcDeviceDriver implements
itemMap.put(to_param, value);
// itemMap.put(to_param, Integer.parseInt(value));
ReadUtil.write(itemMap, server);
// logServer.log("","称重机","",device_code + "," + param + "," + value,"","","","");
}
public void executing(Server server, Map<String, Object> itemMap) {
@ -326,7 +334,7 @@ public class WhxrWeighingDeviceDriver extends AbstractOpcDeviceDriver implements
Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_command, command);
ReadUtil.write(itemMap, server);
// logServer.log("","称重机","",this.getDevice().getDevice_code() + ",to_command," + String.valueOf(command),"","","","");
}
public static Boolean isExistFieldName(String fieldName, Object obj) throws NoSuchFieldException {

2
hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java

@ -3583,7 +3583,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
//反馈故障
}
dto.setState("ERROR");
acsToWmsService.feedbackAgvStatus(String.valueOf(carno), "1", "error");
acsToWmsService.feedbackAgvStatus(String.valueOf(carno), String.valueOf(ikey), "error");
}
}
//X坐标

3
qd/src/views/acs/instruction/index.vue

@ -173,6 +173,7 @@
import crudInstruction from '@/api/acs/instruction/instruction'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import rrOperation from '@crud/RR.operation'
import { getDicts } from '@/api/system/dict'
import crudTask from '@/api/acs/task/task'
@ -215,7 +216,7 @@ const defaultForm = {
export default {
dicts: ['task_status'],
name: 'Instruction',
components: { crudOperation },
components: { crudOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({

13
qd/src/views/acs/task/index.vue

@ -55,6 +55,7 @@
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation />
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
@ -310,6 +311,7 @@
import crudTask from '@/api/acs/task/task'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import deviceCrud from '@/api/acs/device/device'
import routeCurd from '@/api/acs/route/routePlan'
@ -337,11 +339,18 @@ const defaultForm = {
}
export default {
name: 'Task',
components: { pagination, crudOperation },
components: { pagination, crudOperation, rrOperation },
dicts: ['task_status', 'task_type'],
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({ title: '任务', url: 'api/task', idField: 'task_id', sort: 'task_id,desc', crudMethod: { ...crudTask }})
return CRUD({ title: '任务', url: 'api/task', idField: 'task_id', sort: 'task_id,desc', crudMethod: { ...crudTask },
optShow: {
add: true,
edit: true,
del: true
// reset: true
}
})
},
data() {
const checkFromY = (rule, value, callback) => {

3
qd/src/views/acs/task/taskFeedback/index.vue

@ -134,12 +134,13 @@ import crudTaskFeedback, { invalid } from '@/api/acs/task/taskFeedback'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import rrOperation from '@crud/RR.operation'
import crudTask from '@/api/acs/task/task'
const defaultForm = { taskback_id: null, task_id: null, task_code: null, vehicle_code: null, vehicle_type: null, task_type: null, task_status: null, is_finished: null, error_code: null, start_time: null, finish_time: null, create_type: null, finish_type: null, retry_times: null, start_point_code: null, start_device_code: null, next_point_code: null, next_device_code: null, remark: null, is_active: null, is_delete: null, create_by: null, create_time: null, update_by: null, update_time: null }
export default {
name: 'TaskFeedback',
components: { pagination, crudOperation },
components: { pagination, crudOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({

Loading…
Cancel
Save