diff --git a/acs/nladmin-ui/.env.development b/acs/nladmin-ui/.env.development index e37a9a4f0..809e77ff1 100644 --- a/acs/nladmin-ui/.env.development +++ b/acs/nladmin-ui/.env.development @@ -1,8 +1,8 @@ ENV = 'development' # 接口地址 -VUE_APP_BASE_API = 'http://localhost:8011' -VUE_APP_WS_API = 'ws://localhost:8011' +VUE_APP_BASE_API = 'http://localhost:8010' +VUE_APP_WS_API = 'ws://localhost:8010' # 是否启用 babel-plugin-dynamic-import-node插件 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/acs/nladmin-ui/.env.production b/acs/nladmin-ui/.env.production index 2c75e4bb6..762ac12e7 100644 --- a/acs/nladmin-ui/.env.production +++ b/acs/nladmin-ui/.env.production @@ -2,6 +2,6 @@ ENV = 'production' # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http -VUE_APP_BASE_API = 'http://10.1.3.94:8011' +VUE_APP_BASE_API = 'http://127.0.0.1:8010' # 如果接口是 http 形式, wss 需要改为 ws -VUE_APP_WS_API = 'ws://10.1.3.94:8011' +VUE_APP_WS_API = 'ws://127.0.0.1:8010' diff --git a/acs/nladmin-ui/public/config.js b/acs/nladmin-ui/public/config.js index 6a4112c8c..c4d32ea74 100644 --- a/acs/nladmin-ui/public/config.js +++ b/acs/nladmin-ui/public/config.js @@ -1,9 +1,9 @@ window.g = { dev: { - VUE_APP_BASE_API: 'http://127.0.0.1:8015' + VUE_APP_BASE_API: 'http://127.0.0.1:8010' }, prod: { - VUE_APP_BASE_API: 'http://127.0.0.1:8012' + VUE_APP_BASE_API: 'http://127.0.0.1:8010' } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/rest/DeviceController.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/rest/DeviceController.java index b77d6ac3e..411819849 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/rest/DeviceController.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/rest/DeviceController.java @@ -2,32 +2,23 @@ package org.nl.acs.device.rest; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; import org.nl.acs.device.device_driver.DriverTypeEnum; -import org.nl.acs.device.device_driver.standard_inspect.OpcPlcDto; -import org.nl.acs.device.service.mapper.DeviceMapper; -import org.nl.acs.device.service.mapper.DeviceMappers; -import org.nl.common.logging.annotation.Log; -import org.nl.acs.device.domain.Device; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.dto.DeviceDto; -import org.nl.acs.device.service.dto.DeviceQueryParam; -import org.springframework.beans.factory.annotation.Autowired; +import org.nl.common.logging.annotation.Log; import org.springframework.data.domain.Pageable; -import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; - import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.util.List; import java.util.Map; -import java.util.Set; /** * @author jiaolm @@ -35,38 +26,32 @@ import java.util.Set; **/ @RestController @RequiredArgsConstructor - @RequestMapping("/api/device") public class DeviceController { private final DeviceService deviceService; - - @GetMapping @Log("查询设备") - + public ResponseEntity query(@RequestParam Map whereJson, Pageable page) { return new ResponseEntity<>(deviceService.queryAll(whereJson, page), HttpStatus.OK); } @GetMapping("/protocol") @Log("查询设备协议") - public ResponseEntity protocol(@RequestParam Map whereJson, Pageable page) { return new ResponseEntity<>(deviceService.queryDeviceProtocol(whereJson, page), HttpStatus.OK); } @Log("导出设备协议") - @GetMapping(value = "/protocol/download") public void downDeviceDBload(HttpServletResponse response, @RequestParam Map whereJson) throws IOException { deviceService.downDeviceDBload(deviceService.queryDeviceProtocol(whereJson), response); } @Log("导出设备协议") - @GetMapping(value = "/protocol/downloadCSV") public void downDeviceDBloadCSV(HttpServletResponse response, @RequestParam Map whereJson) throws IOException { deviceService.downDeviceDBloadCSV(deviceService.queryDeviceProtocol(whereJson), response); @@ -74,7 +59,7 @@ public class DeviceController { @PostMapping @Log("新增设备") - + public ResponseEntity create(@Validated @RequestBody DeviceDto dto) { deviceService.create(dto); return new ResponseEntity<>(HttpStatus.CREATED); @@ -82,14 +67,12 @@ public class DeviceController { @PutMapping @Log("修改设备") - public ResponseEntity update(@Validated @RequestBody DeviceDto dto) { deviceService.update(dto); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @Log("删除设备") - @DeleteMapping public ResponseEntity delete(@RequestBody String[] ids) { @@ -98,7 +81,6 @@ public class DeviceController { } @Log("导出设备") - @GetMapping(value = "/download") public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException { deviceService.download(deviceService.queryAll(whereJson), response); @@ -106,128 +88,61 @@ public class DeviceController { @GetMapping("/selectList") @Log("下拉选设备") - public ResponseEntity selectList() { return new ResponseEntity<>(deviceService.selectList(), HttpStatus.OK); } @GetMapping("/region/{region}") @Log("根据区域查询设备") - public ResponseEntity selectList(@PathVariable String region) { return new ResponseEntity<>(deviceService.selectDeviceListByRegion(region), HttpStatus.OK); } - @GetMapping("/selectListOne") - @Log("查询区域一设备") - - public ResponseEntity selectListOne() { - return new ResponseEntity<>(deviceService.selectDeviceListOne(), HttpStatus.OK); - } - - @GetMapping("/selectListTwo") - @Log("查询区域二设备") - - public ResponseEntity selectListTwo() { - return new ResponseEntity<>(deviceService.selectDeviceListTwo(), HttpStatus.OK); - } - - @GetMapping("/selectListThree") - @Log("查询区域三设备") - - public ResponseEntity selectListThree() { - return new ResponseEntity<>(deviceService.selectDeviceListThree(), HttpStatus.OK); - } - @GetMapping("/type/{type}") @Log("根据设备类型查询已配置设备") - + public ResponseEntity selectListByType(@PathVariable String type) { return new ResponseEntity<>(deviceService.selectDeviceListByType(type), HttpStatus.OK); } @GetMapping("/selectDeviceDevicerInfo/{status}") @Log("根据状态查询设备信息") - + public ResponseEntity selectDeviceDevicerInfo(@PathVariable String status) { return new ResponseEntity<>(deviceService.selectDeviceDevicerInfo(status), HttpStatus.OK); } - @PostMapping("/callAgv") - @Log("呼叫请求") - - public ResponseEntity callAgv(@RequestBody JSONObject json) { - deviceService.callAgv(json); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @PostMapping("/addMaterial") - @Log("添加物料信息") - - public ResponseEntity addMaterial(@RequestBody JSONObject json) { - deviceService.addMaterial(json); - return new ResponseEntity<>(HttpStatus.CREATED); - } - @PostMapping("/changeDeviceStatus") @Log("改变设备状态") - public ResponseEntity changeDeviceStatus(@RequestBody JSONObject json) { deviceService.changeDeviceStatus(json); return new ResponseEntity<>(HttpStatus.CREATED); } - @PostMapping("/changeFenceStatus") - @Log("改变电子围栏状态") - - public ResponseEntity changeFenceStatus(@RequestBody JSONObject json) { - deviceService.changeFenceStatus(json); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @PostMapping("/responseAgv") - @Log("响应请求") - - public ResponseEntity responseAgv(@RequestBody JSONObject json) { - deviceService.responseAgv(json); - return new ResponseEntity<>(HttpStatus.CREATED); - } - @PostMapping("/autoCreateTask") @Log("自动创建接任务") - public ResponseEntity autoCreateTask(@RequestBody JSONObject json) { deviceService.autoCreateTask(json); - return new ResponseEntity<>(HttpStatus.CREATED); } @PostMapping("/cleanTask") @Log("清除设备状态为空位") - + public ResponseEntity cleanTask(@RequestBody JSONObject json) { deviceService.cleanTask(json); return new ResponseEntity<>(HttpStatus.CREATED); } - @PostMapping("/cleanMaterial") - @Log("清除设备物料信息") - - public ResponseEntity cleanMaterial(@RequestBody JSONObject json) { - deviceService.cleanMaterial(json); - return new ResponseEntity<>(HttpStatus.CREATED); - } - @GetMapping("/selectDriverCodeList/{device_code}") @Log("下拉选设备驱动") - public ResponseEntity selectDriverCodeList(@PathVariable String device_code) { DeviceDto device = deviceService.findByCode(device_code); JSONArray ja = deviceService.selectDriverCodeList(device_code); return new ResponseEntity<>(ja, HttpStatus.OK); } - + @GetMapping({"/{device_code}"}) public ResponseEntity query(@PathVariable String device_code) { final JSONObject model = new JSONObject(); @@ -236,7 +151,7 @@ public class DeviceController { return new ResponseEntity(model, HttpStatus.OK); } - + @GetMapping({"/queryStorageExtra/{storage_code}"}) public ResponseEntity queryStorageExtra(@PathVariable String storage_code) { return new ResponseEntity(deviceService.queryStorageExtra(storage_code), HttpStatus.OK); @@ -258,7 +173,7 @@ public class DeviceController { @PostMapping({"/updateConfig"}) @Log("配置设备驱动") - + @Transactional(rollbackFor = Exception.class) public ResponseEntity updateConfig(@RequestBody Map map) { JSONObject jsonObject = (JSONObject) JSONObject.toJSON(map); @@ -268,25 +183,25 @@ public class DeviceController { @PostMapping({"/driverConfig"}) @Log("配置驱动查询") - + public ResponseEntity queryDriverConfigByDeviceId(@RequestBody Map map) { return new ResponseEntity(deviceService.queryDriverConfigByDeviceId((String) map.get("device_id"), (String) map.get("driver_code")), HttpStatus.OK); } - + @PostMapping({"/testRead"}) public ResponseEntity testRead(@RequestBody Map map) { return new ResponseEntity(deviceService.testRead(map), HttpStatus.OK); } - + @PostMapping({"/testWrite"}) public ResponseEntity testWrite(@RequestBody Map map) { deviceService.testWrite(map); return new ResponseEntity(HttpStatus.NO_CONTENT); } - + @GetMapping({"/queryScanner/{device_code}"}) public ResponseEntity queryScannerByCode(@PathVariable String device_code) throws Exception { String bcr = deviceService.queryScannerByCode(device_code); @@ -295,27 +210,27 @@ public class DeviceController { @GetMapping("/selectConveyorList") @Log("下拉选输送设备") - + public ResponseEntity selectConveyorList() { return new ResponseEntity<>(deviceService.selectConveyorList(), HttpStatus.OK); } @Log("查询缓存所有指令") - + @PostMapping(value = "/findAllStorageCellFromCache") public ResponseEntity findAllInstFromCache() { return new ResponseEntity<>(deviceService.findAllStorageCellFromCache(), HttpStatus.OK); } @Log("查询缓存所有设备") - + @PostMapping(value = "/findCacheDevice") public ResponseEntity findCacheDevice() { return new ResponseEntity<>(deviceService.findCacheDevice(), HttpStatus.OK); } @Log("更新条码") - + @PostMapping(value = "/updateBarcode") public ResponseEntity updateBarcode(@RequestBody JSONObject json) throws Exception { deviceService.updateBarcode(json); @@ -324,13 +239,13 @@ public class DeviceController { @GetMapping({"/queryDBInfoByDriverCode/{driverCode}"}) @Log("根据驱动编码获取db信息") - + public ResponseEntity queryDBInfoByDriverCode(@PathVariable String driverCode) { return new ResponseEntity(deviceService.queryDBInfoByDriverCode(driverCode), HttpStatus.OK); } @Log("导出设备db") - + @PostMapping(value = "/downloadProtocolConfig") public void downloadProtocolConfig(HttpServletResponse response, @RequestBody JSONObject whereJson) throws IOException { deviceService.downloadProtocolConfig(whereJson, response); @@ -338,20 +253,20 @@ public class DeviceController { @GetMapping("/getAllDriverCodeList") @Log("协议配置下拉选设备驱动") - + public ResponseEntity getAllDriverCodeList() { return new ResponseEntity<>(DriverTypeEnum.getList(), HttpStatus.OK); } @Log("导出Smart设备协议CSV") - + @GetMapping(value = "/protocol/downloadSmartCSV") public void downDeviceDBloadOumulongCSV(HttpServletResponse response, @RequestParam Map whereJson) throws IOException { deviceService.downDeviceDBloadSmartCSV(deviceService.queryDeviceProtocol(whereJson), response); } @Log("导出FX5U设备协议CSV") - + @GetMapping(value = "/protocol/downloadFX5UCSV") public void downDeviceDBloadFX5UCSV(HttpServletResponse response, @RequestParam Map whereJson) throws IOException { deviceService.downDeviceDBloadFX5UCSV(deviceService.queryDeviceProtocol(whereJson), response); @@ -359,7 +274,7 @@ public class DeviceController { @PostMapping("/excelImport") @Log("excel导入") - + public ResponseEntity excelImport(@RequestParam("file") MultipartFile file, HttpServletRequest request) { deviceService.excelImport(file, request); return new ResponseEntity<>(HttpStatus.OK); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/DeviceService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/DeviceService.java index 444189c0e..d0fb1a846 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/DeviceService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/DeviceService.java @@ -201,27 +201,6 @@ public interface DeviceService extends CommonService { */ JSONArray selectDeviceDevicerInfo(String status); - /** - * 查询区域一设备 - * - * @return - */ - JSONArray selectDeviceListOne(); - - /** - * 查询区域二设备 - * - * @return - */ - JSONArray selectDeviceListTwo(); - - /** - * 查询区域三设备 - * - * @return - */ - JSONArray selectDeviceListThree(); - /** * 更新驱动配置信息 * @@ -236,34 +215,6 @@ public interface DeviceService extends CommonService { */ void changeDeviceStatus(JSONObject form); - /** - * 改变电子围栏状态 - * - * @param form - */ - void changeFenceStatus(JSONObject form); - - /** - * 呼叫请求 - * - * @param form - */ - void callAgv(JSONObject form); - - /** - * 添加物料信息 - * - * @param form - */ - void addMaterial(JSONObject form); - - /** - * 响应请求参数 - * - * @param form - */ - void responseAgv(JSONObject form); - /** * 自动创建任务 * @param json @@ -283,11 +234,6 @@ public interface DeviceService extends CommonService { */ void cleanTask(JSONObject json); - /** - * 清理材料 - * @param json - */ - void cleanMaterial(JSONObject json); /** * 根据设备标识查询设备驱动配置,如果未配置过,就从驱动配置定义找,否则从数据库里面找 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index d88426ba8..e79944bd9 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -565,179 +565,6 @@ public class DeviceServiceImpl extends CommonServiceImpl i return result; } - @Override - public JSONArray selectDeviceListOne() { - //设备基础信息表【acs_device】 - List deviceList = new LambdaQueryChainWrapper<>(deviceMapper) - .apply("is_delete= '0' AND is_active= '1' AND region = '1'") - .orderByAsc(Device::getSeq_num) - .list(); - JSONArray arr = JSONArray.parseArray(JSON.toJSONString(deviceList)); - - //acs_device_extra - JSONArray result = new JSONArray(); - for (int i = 0; i < arr.size(); i++) { - JSONObject obj = arr.getJSONObject(i); - JSONObject json = new JSONObject(); - json.put("device_id", obj.getString("device_id")); - json.put("device_code", obj.getString("device_code")); - json.put("checked", false); - json.put("device_name", obj.getString("device_name")); - Device device = deviceAppService.findDeviceByCode(obj.getString("device_code")); - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - json.put("quantity", standardOrdinarySiteDeviceDriver.getQty()); - json.put("material_type", standardOrdinarySiteDeviceDriver.getMaterial()); - json.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); - } - List deviceExtraList = new LambdaQueryChainWrapper<>(deviceExtraMapper) - .eq(DeviceExtra::getDevice_id, obj.getString("device_id")) - .list(); - JSONArray extraArr = JSONArray.parseArray(JSON.toJSONString(deviceExtraList)); - - for (int m = 0; m < extraArr.size(); m++) { - JSONObject jsonObject = extraArr.getJSONObject(m); - String extra_code = jsonObject.getString("extra_code"); - //定点作业:自动创建任务 - if ("auto_create_task".equals(extra_code)) { - json.put("auto_create_task", jsonObject.getBoolean("extra_value")); - } - //呼叫 - if ("apply_task".equals(extra_code)) { - json.put("apply_task", jsonObject.getBoolean("extra_value")); - } - //响应 - if ("manual_create_task".equals(extra_code)) { - json.put("manual_create_task", jsonObject.getBoolean("extra_value")); - } - //清除 - if ("auto_clean_task".equals(extra_code)) { - json.put("auto_clean_task", jsonObject.getBoolean("extra_value")); - } - - } - result.add(json); - } - return result; - } - - @Override - public JSONArray selectDeviceListTwo() { - //设备基础信息表【acs_device】 -// JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' AND region = '2'", "seq_num").getResultJSONArray(0); - List deviceList = new LambdaQueryChainWrapper<>(deviceMapper) - .apply("is_delete= '0' AND is_active= '1' AND region = '2'") - .orderByAsc(Device::getSeq_num) - .list(); - JSONArray arr = JSONArray.parseArray(JSON.toJSONString(deviceList)); - //acs_device_extra -// WQLObject extraTab = WQLObject.getWQLObject("acs_device_extra"); - JSONArray result = new JSONArray(); - for (int i = 0; i < arr.size(); i++) { - JSONObject obj = arr.getJSONObject(i); - JSONObject json = new JSONObject(); - json.put("device_id", obj.getString("device_id")); - json.put("checked", false); - json.put("device_code", obj.getString("device_code")); - json.put("device_name", obj.getString("device_name")); - Device device = deviceAppService.findDeviceByCode(obj.getString("device_code")); - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - json.put("quantity", standardOrdinarySiteDeviceDriver.getQty()); - json.put("material_type", standardOrdinarySiteDeviceDriver.getMaterial()); - json.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); - } -// JSONArray extraArr = extraTab.query("device_id = '" + obj.getString("device_id") + "'").getResultJSONArray(0); - List deviceExtraList = new LambdaQueryChainWrapper<>(deviceExtraMapper) - .eq(DeviceExtra::getDevice_id, obj.getString("device_id")) - .list(); - JSONArray extraArr = JSONArray.parseArray(JSON.toJSONString(deviceExtraList)); - for (int m = 0; m < extraArr.size(); m++) { - JSONObject jsonObject = extraArr.getJSONObject(m); - String extra_code = jsonObject.getString("extra_code"); - //定点作业:自动创建任务 - if ("auto_create_task".equals(extra_code)) { - json.put("auto_create_task", jsonObject.getBoolean("extra_value")); - } - //呼叫 - if ("apply_task".equals(extra_code)) { - json.put("apply_task", jsonObject.getBoolean("extra_value")); - } - //响应 - if ("manual_create_task".equals(extra_code)) { - json.put("manual_create_task", jsonObject.getBoolean("extra_value")); - } - //清除 - if ("auto_clean_task".equals(extra_code)) { - json.put("auto_clean_task", jsonObject.getBoolean("extra_value")); - } - - } - result.add(json); - } - return result; - } - - @Override - public JSONArray selectDeviceListThree() { - //设备基础信息表【acs_device】 -// JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' AND region = '3'", "seq_num").getResultJSONArray(0); - List deviceList = new LambdaQueryChainWrapper<>(deviceMapper) - .apply("is_delete= '0' AND is_active= '1' AND region = '3'") - .orderByAsc(Device::getSeq_num) - .list(); - JSONArray arr = JSONArray.parseArray(JSON.toJSONString(deviceList)); - //acs_device_extra -// WQLObject extraTab = WQLObject.getWQLObject("acs_device_extra"); - JSONArray result = new JSONArray(); - for (int i = 0; i < arr.size(); i++) { - JSONObject obj = arr.getJSONObject(i); - JSONObject json = new JSONObject(); - json.put("device_id", obj.getString("device_id")); - json.put("device_code", obj.getString("device_code")); - json.put("checked", false); - json.put("device_name", obj.getString("device_name")); - Device device = deviceAppService.findDeviceByCode(obj.getString("device_code")); - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - json.put("quantity", standardOrdinarySiteDeviceDriver.getQty()); - json.put("material_type", standardOrdinarySiteDeviceDriver.getMaterial()); - json.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); - } -// JSONArray extraArr = extraTab.query("device_id = '" + obj.getString("device_id") + "'").getResultJSONArray(0); - List deviceExtraList = new LambdaQueryChainWrapper<>(deviceExtraMapper) - .eq(DeviceExtra::getDevice_id, obj.getString("device_id")) - .list(); - JSONArray extraArr = JSONArray.parseArray(JSON.toJSONString(deviceExtraList)); - for (int m = 0; m < extraArr.size(); m++) { - JSONObject jsonObject = extraArr.getJSONObject(m); - String extra_code = jsonObject.getString("extra_code"); - //定点作业:自动创建任务 - if ("auto_create_task".equals(extra_code)) { - json.put("auto_create_task", jsonObject.getBoolean("extra_value")); - } - //呼叫 - if ("apply_task".equals(extra_code)) { - json.put("apply_task", jsonObject.getBoolean("extra_value")); - } - //响应 - if ("manual_create_task".equals(extra_code)) { - json.put("manual_create_task", jsonObject.getBoolean("extra_value")); - } - //清除 - if ("auto_clean_task".equals(extra_code)) { - json.put("auto_clean_task", jsonObject.getBoolean("extra_value")); - } - - } - result.add(json); - } - return result; - } - @Override public JSONArray selectDeviceDevicerInfo(String status) { @@ -1196,18 +1023,6 @@ public class DeviceServiceImpl extends CommonServiceImpl i } } - @Override - public void changeFenceStatus(JSONObject form) { - String device_code = form.getString("device_code"); - String suspended = form.getString("suspended"); - if (StrUtil.isEmpty(suspended)) { - return; - } - - Device device = deviceAppService.findDeviceByCode(device_code); - - } - public String formatNum(int x) { if (x < 10) { return "0" + x; @@ -1215,89 +1030,6 @@ public class DeviceServiceImpl extends CommonServiceImpl i return String.valueOf(x); } - @Override - public void callAgv(JSONObject form) { - String device_code = form.getString("device_code"); - //需要数量 - String quantity = form.getString("quantity"); - //物料类型 - String material_type = form.getString("material_type"); - String remark = form.getString("remark"); - if (StrUtil.isEmpty(quantity) || StrUtil.isEmpty(material_type)) { - throw new BadRequestException(LangProcess.msg("error_checkNull", "quantity or material_type")); - } - Device device = deviceAppService.findDeviceByCode(device_code); - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - if (standardOrdinarySiteDeviceDriver.getBranchProtocol() == 2) { - throw new BadRequestException(LangProcess.msg("device_checkStatus")); - } else { - standardOrdinarySiteDeviceDriver.setBranchProtocol(2); - standardOrdinarySiteDeviceDriver.setQty(quantity); - standardOrdinarySiteDeviceDriver.setMaterial(material_type); - standardOrdinarySiteDeviceDriver.setRemark(remark); - } - } - - StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; - if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - standardInspectSiteDeviceDriver.setBranchProtocol(2); - standardInspectSiteDeviceDriver.setQty(quantity); - standardInspectSiteDeviceDriver.setMaterial(material_type); - standardInspectSiteDeviceDriver.setRemark(remark); - } - } - - @Override - public void addMaterial(JSONObject form) { - String device_code = form.getString("device_code"); - //需要数量 - String quantity = form.getString("quantity"); - //物料类型 - String material_type = form.getString("material_type"); - String remark = form.getString("remark"); - - Device device = deviceAppService.findDeviceByCode(device_code); - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - standardOrdinarySiteDeviceDriver.setQty(quantity); - standardOrdinarySiteDeviceDriver.setMaterial(material_type); - standardOrdinarySiteDeviceDriver.setRemark(remark); - device.setMaterial_type(material_type); - device.setQuantity(quantity); - device.setRemark(remark); - } - - } - - @Override - public void responseAgv(JSONObject form) { - //起始设备 - String start_device_code = form.getString("start_device_code"); - //下一设备 - String next_device_code = form.getString("device_code"); - //需要数量 - String quantity = form.getString("qty"); - //物料类型 - String material_type = form.getString("material"); - //备注信息 - String remark = form.getString("remark"); - - Device startDevice = deviceAppService.findDeviceByCode(start_device_code); - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; - if (startDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) startDevice.getDeviceDriver(); - standardOrdinarySiteDeviceDriver.setBranchProtocol(3); - standardOrdinarySiteDeviceDriver.setQty(quantity); - standardOrdinarySiteDeviceDriver.setMaterial(material_type); - standardOrdinarySiteDeviceDriver.setRemark(remark); - standardOrdinarySiteDeviceDriver.setPurpose(next_device_code); - } - } - @Override public void autoCreateTask(JSONObject form) { //起始设备 @@ -1340,30 +1072,6 @@ public class DeviceServiceImpl extends CommonServiceImpl i } } - @Override - public void cleanMaterial(JSONObject json) { - String device_code = json.getString("device_code"); - //需要数量 - String quantity = json.getString("quantity"); - //物料类型 - String material_type = json.getString("material_type"); - String remark = json.getString("remark"); - - Device device = deviceAppService.findDeviceByCode(device_code); - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - standardOrdinarySiteDeviceDriver.setHasGoods(0); - standardOrdinarySiteDeviceDriver.setQty(""); - standardOrdinarySiteDeviceDriver.setMaterial(""); - standardOrdinarySiteDeviceDriver.setRemark(""); - JSONObject jsonjo = new JSONObject(); - jsonjo.put("device_code", device_code); - jsonjo.put("hasGoodStatus", "0"); - changeDeviceStatus(jsonjo); - } - } - @Override public JSONObject queryDriverConfigByDeviceId(String device_id, String driver_code) { final JSONObject extraObj = new JSONObject(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java index 0bab2973b..5bb0f812c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java @@ -242,11 +242,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv // 更新指令状态 updateInstruct(); - } catch (Exception var17) { - var17.printStackTrace(); - feedMessage = var17.getMessage(); - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); - + } catch (Exception e) { + logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace())); } if (mode == 0) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/log/service/impl/DeviceExecuteLogServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/log/service/impl/DeviceExecuteLogServiceImpl.java index d57f21691..de875291e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/log/service/impl/DeviceExecuteLogServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/log/service/impl/DeviceExecuteLogServiceImpl.java @@ -33,8 +33,6 @@ public class DeviceExecuteLogServiceImpl implements DeviceExecuteLogService { e.printStackTrace(); } finally { MDC.remove("device_code_log"); - System.out.println("successNum:" + OpcUtl.successNum); - System.out.println("errNum:" + OpcUtl.errNum); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/ACSToLMS.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/ACSToLMS.xml new file mode 100644 index 000000000..f5107763c --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/ACSToLMS.xml @@ -0,0 +1,29 @@ + + + + + + + + + ${LOG_HOME}/ACS请求LMS/%d{yyyy-MM-dd}.%i.log + + 15 + + 50MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} + + + + + + + + + diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/LMSToACS.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/LMSToACS.xml new file mode 100644 index 000000000..6f8517c54 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/LMSToACS.xml @@ -0,0 +1,29 @@ + + + + + + + + + ${LOG_HOME}/LMS下发ACS/%d{yyyy-MM-dd}.%i.log + + 15 + + 50MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} + + + + + + + + + diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml new file mode 100644 index 000000000..ca3f78791 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml @@ -0,0 +1,33 @@ + + + + + + + + + ${LOG_HOME}/一楼NDC系统/%d{yyyy-MM-dd}.%i.log + + 15 + + 200MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} + + + + + + + + + + + diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml index 152cb05e1..e15810b10 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml @@ -21,9 +21,8 @@ https://juejin.cn/post/6844903775631572999 - - + + @@ -68,7 +67,7 @@ https://juejin.cn/post/6844903775631572999 - +