diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java index 0caea7515..2f1c1a72e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java @@ -250,13 +250,13 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i // apply_for_casing_inspection(material1, material2); bushingSucess(); } else if (move != 1) { - remark += "套管工位没有货"; + remark = "套管工位没有货"; } else if (task < 1) { - remark += "纸管库的任务号为空"; + remark = "纸管库的任务号为空"; } else if (task1 < 1) { - remark += "行架任务为空"; + remark = "行架任务为空"; } else if (requireSucess) { - remark += "requrieSucess为" + requireSucess; + remark = "requrieSucess为" + requireSucess; } break; default: diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java index 9d7c4f991..13572bf9b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java @@ -256,7 +256,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple if (action != last_action) { this.setFeedbackSucess(false); logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action); + logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action + " feedbackSucess:" + feedbackSucess); } if (error != last_error) { if (error != 0) { @@ -296,7 +296,9 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple if (task > 0 && !feedbackSucess) { update_instruction_status(); - } + }/*else { + logServer.deviceExecuteLog(this.device_code,"","","更新指令状态,条件不满足的原因,task:"+task+"feedbackSucess:"+feedbackSucess); + }*/ } catch (Exception var17) { @@ -435,6 +437,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple applyManipulatorActionRequest.setType("2"); applyManipulatorActionRequest.setTask_code1(task_code); applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); + logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈尺寸"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { feedbackSucess = true; @@ -455,6 +458,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple String task_code = inst1.getTask_code(); applyManipulatorActionRequest.setType("3"); applyManipulatorActionRequest.setTask_code1(task_code); + logServer.deviceExecuteLog(this.device_code, "", "", "开始申请放货点"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { logServer.deviceExecuteLog(this.device_code, "", "", "申请放货点请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); @@ -481,6 +485,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple String task_code = inst1.getTask_code(); applyManipulatorActionRequest.setType("4"); applyManipulatorActionRequest.setTask_code1(task_code); + logServer.deviceExecuteLog(this.device_code, "", "", "开始申请取货点"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { String get_device_code = applyManipulatorActionResponse.getDevice_code(); @@ -507,6 +512,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple String task_code = inst1.getTask_code(); applyManipulatorActionRequest.setType("5"); applyManipulatorActionRequest.setTask_code1(task_code); + logServer.deviceExecuteLog(this.device_code, "", "", "申请二次放货点"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { String put_device_code2 = applyManipulatorActionResponse.getDevice_code(); @@ -533,6 +539,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple String task_code = inst1.getTask_code(); applyManipulatorActionRequest.setAction("1"); applyManipulatorActionRequest.setTask_code1(task_code); + logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈缓存库取货完成"); ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse1.getstatus() == 200) { logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1)); @@ -553,6 +560,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple String task_code = inst1.getTask_code(); applyManipulatorActionRequest.setAction("2"); applyManipulatorActionRequest.setTask_code1(task_code); + logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈缓存库放货完成"); ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse1.getstatus() == 200) { logServer.deviceExecuteLog(this.device_code, "", "", "缓存库放货完成,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1)); @@ -569,12 +577,40 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } } + //异常气胀轴反馈 + /*if (action == 9) { + String task_code = inst1.getTask_code(); + applyManipulatorActionRequest.setType("9"); + applyManipulatorActionRequest.setTask_code1(task_code); + logServer.deviceExecuteLog(this.device_code, "", "", "异常反馈"); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + if (ObjectUtil.isNotEmpty(applyManipulatorActionResponse) && applyManipulatorActionResponse.getstatus() == 200) { + logServer.deviceExecuteLog(this.device_code, "", "", "异常反馈完成,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + Map map = new LinkedHashMap<>(); + map.put("to_command", 9); + this.writing(map); + feedbackSucess = true; + message = "缓存库放货成功"; + try { + instructionService.cancel(inst1.getInstruction_id()); + logServer.deviceExecuteLog(this.device_code, "", "", "取消指令完成"); + TaskDto byTaskCode = taskserver.findByTaskCode(inst1.getTask_code()); + taskserver.cancel(byTaskCode.getTask_id()); + logServer.deviceExecuteLog(this.device_code, "", "", "取消任务完成"); + } catch (Exception e) { + message = "取消任务或指令失败,失败原因"+ e.getMessage(); + logServer.deviceExecuteLog(this.device_code, "", "", "取消任务或指令失败,失败原因"+e.getMessage()); + } + } + }*/ + //放货完成 if (mode == 3 && action == 8 && move == 0) { if (inst1 != null) { try { feedbackSucess = true; + logServer.deviceExecuteLog(this.device_code, "", "", "放货完成"); finish_instruction(inst1); Map map = new LinkedHashMap<>(); map.put("to_command", 8); @@ -744,12 +780,12 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple 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(); -//Server server = ReadUtil.getServer(opcservcerid); + // String opcservcerid = this.getDevice().getOpc_server_id(); + // Server server = ReadUtil.getServer(opcservcerid); Map itemMap = new HashMap(); itemMap.put(to_param, Integer.parseInt(value)); -// itemMap.put(to_param, Integer.parseInt(value)); + // itemMap.put(to_param, Integer.parseInt(value)); this.control(itemMap); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value); } @@ -810,13 +846,13 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple Map map = new LinkedHashMap<>(); map.put("to_command", 1); - map.put("inflatableShaftVersion", Integer.parseInt(version)); + map.put("inflatableShaftVersion", version); map.put("tube_num", bushing_num); map.put("is_wrapped", is_bushing); - map.put("to_task_type", Integer.parseInt(taskDto.getTruss_type())); - map.put("to_onset", Integer.parseInt(start_addr)); - map.put("to_task", Integer.parseInt(instruction.getInstruction_code())); - map.put("to_target", Integer.parseInt(next_addr)); + map.put("to_task_type", taskDto.getTruss_type()); + map.put("to_onset", start_addr); + map.put("to_task", instruction.getInstruction_code()); + map.put("to_target", next_addr); try { this.writing(map); } catch (Exception e) { @@ -836,11 +872,11 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple if ("6".equals(task.getTruss_type())) { flag = checkAgv(task); if (flag) { - logServer.deviceExecuteLog(this.device_code,"","","RGV条件满足,允许创建指令,任务号为:"+task.getTask_code()); + logServer.deviceExecuteLog(this.device_code, "", "", "RGV条件满足,允许创建指令,任务号为:" + task.getTask_code()); break; } else { task = null; - logServer.deviceExecuteLog(this.device_code,"","","RGV条件不满足,不允许允许创建指令,任务号为:"+task); + logServer.deviceExecuteLog(this.device_code, "", "", "RGV条件不满足,不允许允许创建指令,任务号为:" + task); continue; } @@ -866,6 +902,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple return false; } } + String taskid = task.getTask_id(); String taskcode = task.getTask_code(); String vehiclecode = task.getVehicle_code(); @@ -966,15 +1003,14 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple rgv1 = (RgvDeviceDriver) agv1.getDeviceDriver(); rgv2 = (RgvDeviceDriver) agv2.getDeviceDriver(); if ((rgv1.getMode() == 2 && rgv1.getMove1() == 1 && rgv1.getMove2() == 0) || (rgv2.getMode() == 2 && rgv2.getMove1() == 1 && rgv2.getMove2() == 0)) { - logServer.deviceExecuteLog(device_code, "", "", "mode1"+rgv1.getMode()+"mode2"+ - rgv2.getMode()+"rgv1的move2"+ rgv1.getMove2()+"rgv2的move2"+rgv2.getMove2()); + logServer.deviceExecuteLog(device_code, "", "", "mode1" + rgv1.getMode() + "mode2" + + rgv2.getMode() + "rgv1的move2" + rgv1.getMove2() + "rgv2的move2" + rgv2.getMove2()); return true; } else { logServer.deviceExecuteLog(device_code, "", "", "rgv信号不符合"); } } else { logServer.deviceExecuteLog(device_code, "", "", "关联的站点不是rgv"); - } } else { logServer.deviceExecuteLog(device_code, "", "", "rgv没有关联站点"); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index c9a4b4fb0..dbc364806 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -383,7 +383,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i //存在行架->暂存的AGV任务 需要过滤 // 6 行架任务 8烘箱任务 - if(!StrUtil.equals(taskDto.getTask_type(),"6") && !StrUtil.equals(taskDto.getTask_type(),"8")){ + if (!StrUtil.equals(taskDto.getTask_type(), "6") && !StrUtil.equals(taskDto.getTask_type(), "8")) { taskDto = null; continue; } @@ -436,7 +436,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code); //未关门结束 if (isCloseDoor) { - notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code +",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code(); + notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code(); return false; } instruction.setInstruction_status("1"); @@ -473,12 +473,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } else { List taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode); if (ObjectUtil.isNotEmpty(taskDtoList)) { - for(int j=0; j map = new LinkedHashMap<>(); + map.put("to_command", 98); + this.writing(map); + requireSucess = true; + message = "等待套轴"; + logServer.deviceExecuteLog(this.device_code, "", "", "等待套轴,返回参数:" + applyManipulatorActionResponse); }else { message = applyManipulatorActionResponse.getMessage(); Map map = new LinkedHashMap<>(); map.put("to_command", 99); this.writing(map); requireSucess = true; - message = "申请失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴失败,返回参数:" + applyManipulatorActionResponse); + message = "套轴申请失败"; + logServer.deviceExecuteLog(this.device_code, "", "", "套轴申请失败,返回参数:" + applyManipulatorActionResponse); } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java index e27f926d1..cfe8daab8 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java @@ -697,7 +697,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme this.instruction_require_time = date; //判断是否存在起点相同 任务状态就绪的任务 TaskDto taskdto = taskserver.findByStartCodeAndReady(device_code); - if (!ObjectUtil.isEmpty(taskdto)) { + if (!ObjectUtil.isEmpty(taskdto) && "5".equals(taskdto.getTask_type())) { // if (!ObjectUtils.isEmpty(instructionService.findByBarcodeFromCache(container_code))) { // return false; // } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java index 6fadb47c9..884ee1b27 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java @@ -33,7 +33,6 @@ public class WmsToAcsController { @PostMapping("/task") @Log(value = "ACS接收WMS任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS) - @SaIgnore public ResponseEntity createFromWms(@RequestBody String whereJson) { return new ResponseEntity<>(wmstoacsService.crateTask(whereJson), HttpStatus.OK); @@ -73,7 +72,6 @@ public class WmsToAcsController { @PostMapping("/action") @Log(value = "WMS下发点位信号",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS) - @SaIgnore public ResponseEntity putAction(@RequestBody String whereJson) throws Exception { return new ResponseEntity<>(wmstoacsService.putAction(whereJson), HttpStatus.OK); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index dc95f6734..e4228194d 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -207,6 +207,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { HongXiangStationDeviceDriver hongXiangStationDeviceDriver; LampThreecolorDeviceDriver lampThreecolorDeviceDriver; SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; + PluggingUnpluggingMachineDeviceDriver pluggingUnpluggingMachineDeviceDriver; if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); hongXiangStationDeviceDriver.writing(code, value); @@ -219,6 +220,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver(); siemensConveyorDeviceDriver.writing(code, value); } + if (device.getDeviceDriver() instanceof PluggingUnpluggingMachineDeviceDriver) { + pluggingUnpluggingMachineDeviceDriver = (PluggingUnpluggingMachineDeviceDriver) device.getDeviceDriver(); + pluggingUnpluggingMachineDeviceDriver.writing(code, value); + } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/route/rest/RoutePlanController.java b/acs/nladmin-system/src/main/java/org/nl/acs/route/rest/RoutePlanController.java index dd38e71a8..44fc0b67f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/route/rest/RoutePlanController.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/route/rest/RoutePlanController.java @@ -2,8 +2,6 @@ package org.nl.acs.route.rest; - - import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.route.service.RoutePlanService; @@ -34,7 +32,7 @@ public class RoutePlanController { @GetMapping @Log("查询路由方案") - + //@PreAuthorize("@el.check('routePlan:list')") public ResponseEntity query(@RequestParam Map whereJson, Pageable page) { return new ResponseEntity<>(routePlanService.queryAll(whereJson, page), HttpStatus.OK); @@ -42,7 +40,7 @@ public class RoutePlanController { @PostMapping @Log("新增路由方案") - + //@PreAuthorize("@el.check('routePlan:add')") public ResponseEntity create(@Validated @RequestBody RoutePlanDto dto) { routePlanService.create(dto); @@ -51,7 +49,7 @@ public class RoutePlanController { @PutMapping @Log("修改路由方案") - + //@PreAuthorize("@el.check('routePlan:edit')") public ResponseEntity update(@Validated @RequestBody RoutePlanDto dto) { routePlanService.update(dto); @@ -59,7 +57,7 @@ public class RoutePlanController { } @Log("删除路由方案") - + //@PreAuthorize("@el.check('routePlan:del')") @DeleteMapping public ResponseEntity delete(@RequestBody String[] ids) { @@ -68,7 +66,6 @@ public class RoutePlanController { } @Log("导出路由方案") - @GetMapping(value = "/download") //@PreAuthorize("@el.check('routePlan:list')") public void download(HttpServletResponse response, Map whereJson) throws IOException { @@ -77,7 +74,6 @@ public class RoutePlanController { @GetMapping("/selectList") @Log("下拉选路由方案") - //@PreAuthorize("@el.check('routePlan:list')") public ResponseEntity selectList() { return new ResponseEntity<>(routePlanService.selectList(), HttpStatus.OK); diff --git a/acs/nladmin-ui/dist.rar b/acs/nladmin-ui/dist.rar new file mode 100644 index 000000000..9bc86f237 Binary files /dev/null and b/acs/nladmin-ui/dist.rar differ diff --git a/acs/nladmin-ui/src/views/system/monitor/device/index.vue b/acs/nladmin-ui/src/views/system/monitor/device/index.vue index 39bcb9a57..5a7120842 100644 --- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue @@ -749,6 +749,9 @@ export default { } else if (val === 'out_qty_arr') { const obj = { name: '出库数量', value: data[val] } this.arr.push(obj) + } else if (val === 'now_steps_type') { + const obj = { name: '烘箱执行信号', value: data[val] } + this.arr.push(obj) } } } diff --git a/lms/nladmin-system/pom.xml b/lms/nladmin-system/pom.xml index 9b9392bb3..40e0cbdef 100644 --- a/lms/nladmin-system/pom.xml +++ b/lms/nladmin-system/pom.xml @@ -31,6 +31,11 @@ + + org.dromara.dynamictp + dynamic-tp-spring-boot-starter-adapter-webserver + 1.1.6.1 + com.yomahub @@ -297,12 +302,6 @@ 1.8.0 - - org.aspectj - aspectjweaver - 1.9.2 - - org.springframework.boot diff --git a/lms/nladmin-system/src/main/java/org/nl/AppRun.java b/lms/nladmin-system/src/main/java/org/nl/AppRun.java index 2b8801ed6..82688bca3 100644 --- a/lms/nladmin-system/src/main/java/org/nl/AppRun.java +++ b/lms/nladmin-system/src/main/java/org/nl/AppRun.java @@ -3,13 +3,12 @@ package org.nl; import cn.dev33.satoken.annotation.SaIgnore; import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation; import com.alicp.jetcache.anno.config.EnableMethodCache; +import org.dromara.dynamictp.core.spring.EnableDynamicTp; import org.mybatis.spring.annotation.MapperScan; import org.nl.modules.wql.util.SpringContextHolder; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.ServletComponentScan; -import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.scheduling.annotation.EnableAsync; @@ -25,6 +24,7 @@ import org.springframework.web.bind.annotation.RestController; */ @EnableAsync @RestController +@EnableDynamicTp @SpringBootApplication(exclude = { org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class }) @@ -47,14 +47,6 @@ public class AppRun { public SpringContextHolder springContextHolder() { return new SpringContextHolder(); } - - @Bean - public ServletWebServerFactory webServerFactory() { - TomcatServletWebServerFactory fa = new TomcatServletWebServerFactory(); - fa.addConnectorCustomizers(connector -> connector.setProperty("relaxedQueryChars", "[]{}")); - return fa; - } - /** * 访问首页提示 * diff --git a/lms/nladmin-system/src/main/java/org/nl/config/lucene/AsyncLuceneAppender.java b/lms/nladmin-system/src/main/java/org/nl/config/lucene/AsyncLuceneAppender.java index a048c91b3..4ab09d6f4 100644 --- a/lms/nladmin-system/src/main/java/org/nl/config/lucene/AsyncLuceneAppender.java +++ b/lms/nladmin-system/src/main/java/org/nl/config/lucene/AsyncLuceneAppender.java @@ -25,7 +25,6 @@ public class AsyncLuceneAppender extends AspectLogbackAsyncAppender { if (mdcPropertyMap.getClass().getName().contains("SynchronizedMap")) { mdcPropertyMap.put("traceId", traceId); } - MDC.clear(); } super.append(event); } diff --git a/lms/nladmin-system/src/main/java/org/nl/config/thread/ThreadPoolExecutorUtil.java b/lms/nladmin-system/src/main/java/org/nl/config/thread/ThreadPoolExecutorUtil.java index 08e8dfa4b..14ed1dcd8 100644 --- a/lms/nladmin-system/src/main/java/org/nl/config/thread/ThreadPoolExecutorUtil.java +++ b/lms/nladmin-system/src/main/java/org/nl/config/thread/ThreadPoolExecutorUtil.java @@ -16,7 +16,12 @@ package org.nl.config.thread; +import org.dromara.dynamictp.core.support.DynamicTp; import org.nl.modules.wql.util.SpringContextHolder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; @@ -28,16 +33,22 @@ import java.util.concurrent.TimeUnit; * @author Zheng Jie * @date 2019年10月31日18:16:47 */ +@Configuration public class ThreadPoolExecutorUtil { - public static ThreadPoolExecutor getPoll() { - AsyncTaskProperties properties = SpringContextHolder.getBean(AsyncTaskProperties.class); + @Autowired + private AsyncTaskProperties asyncTaskProperties; + + @Bean + @Primary + @DynamicTp("el-thread") + public ThreadPoolExecutor threadPoolExecutor() { return new ThreadPoolExecutor( - properties.getCorePoolSize(), - properties.getMaxPoolSize(), - properties.getKeepAliveSeconds(), + asyncTaskProperties.getCorePoolSize(), + asyncTaskProperties.getMaxPoolSize(), + asyncTaskProperties.getKeepAliveSeconds(), TimeUnit.SECONDS, - new ArrayBlockingQueue<>(properties.getQueueCapacity()), + new ArrayBlockingQueue<>(asyncTaskProperties.getQueueCapacity()), new TheadFactoryName() ); } diff --git a/lms/nladmin-system/src/main/java/org/nl/modules/logging/aspect/LogAspect.java b/lms/nladmin-system/src/main/java/org/nl/modules/logging/aspect/LogAspect.java index fede5af97..16107ee06 100644 --- a/lms/nladmin-system/src/main/java/org/nl/modules/logging/aspect/LogAspect.java +++ b/lms/nladmin-system/src/main/java/org/nl/modules/logging/aspect/LogAspect.java @@ -139,8 +139,8 @@ public class LogAspect { throw ex; } finally { log.info("[--response--][请求接口:{} 执行结束][耗时:{}s]", url, (System.currentTimeMillis() - comming) / 1000); - MDC.clear(); LuceneAppender.traceIdTL.remove(); + MDC.clear(); } return result; } diff --git a/lms/nladmin-system/src/main/java/org/nl/system/service/quartz/utils/ExecutionJob.java b/lms/nladmin-system/src/main/java/org/nl/system/service/quartz/utils/ExecutionJob.java index b1c551c88..5f2628b56 100644 --- a/lms/nladmin-system/src/main/java/org/nl/system/service/quartz/utils/ExecutionJob.java +++ b/lms/nladmin-system/src/main/java/org/nl/system/service/quartz/utils/ExecutionJob.java @@ -16,6 +16,8 @@ import org.nl.system.service.quartz.impl.SysQuartzJobServiceImpl; import org.quartz.DisallowConcurrentExecution; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.scheduling.annotation.Async; import java.util.concurrent.Future; @@ -35,7 +37,9 @@ public class ExecutionJob extends TLogQuartzJobBean { /** * 该处仅供参考 */ - private final static ThreadPoolExecutor EXECUTOR = ThreadPoolExecutorUtil.getPoll(); + @Autowired + @Qualifier("threadPoolExecutor") + private ThreadPoolExecutor EXECUTOR; @Override public void executeTask(JobExecutionContext context) throws JobExecutionException { diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/wql/QST_IVT_RAWASSISTISTOR.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/wql/QST_IVT_RAWASSISTISTOR.wql index 7db7c7dfa..0bd82c1e1 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/wql/QST_IVT_RAWASSISTISTOR.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/wql/QST_IVT_RAWASSISTISTOR.wql @@ -71,7 +71,7 @@ FROM ST_IVT_IOStorInv ios LEFT JOIN st_ivt_iostorinvdis dis ON dis.iostorinv_id = ios.iostorinv_id - LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn AND dis.box_no = sub.package_box_sn + LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn WHERE ios.is_delete = '0' AND diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java index 04edd3e69..e39b5bb36 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java @@ -792,7 +792,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { JSONArray resultJSONArray = WQL.getWO("QST_IVT_CHECKOUTBILL").addParamMap(map).process().getResultJSONArray(0); - List ivtList = WQL.getWO("QST_IVT_CHECKOUTBILL").addParam("flag", "20").process().getResultJSONArray(0).toJavaList(JSONObject.class); + List ivtList = WQL.getWO("QST_IVT_CHECKOUTBILL").addParam("flag", "21").process().getResultJSONArray(0).toJavaList(JSONObject.class); List> list = new ArrayList<>(); @@ -822,7 +822,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } String box_weight = ivtList.stream() - .filter(row -> row.getString("bill_code").equals(jsonObject.getString("bill_code"))) + .filter(row -> row.getString("iostorinvdtl_id").equals(jsonObject.getString("iostorinvdtl_id"))) .map(row -> row.getDoubleValue("box_weight")) .reduce(Double::sum).orElse(0.00).toString(); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql index 775554686..68ee63ede 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql @@ -199,7 +199,8 @@ MAX(ios.order_number) AS order_number, MAX(ios.receiptaddress) AS receiptaddress, MAX( sd.label ) AS bill_status, - count(DISTINCT(dis.box_no)) as box_count + count(DISTINCT(dis.box_no)) as box_count, + dtl.iostorinvdtl_id FROM st_ivt_iostorinvdis dis LEFT JOIN st_ivt_iostorinvdtl dtl ON dis.iostorinvdtl_id = dtl.iostorinvdtl_id @@ -1105,32 +1106,21 @@ ENDQUERY ENDIF - IF 输入.flag = "20" + IF 输入.flag = "21" QUERY SELECT SUM(sub.box_weight) AS box_weight, - MAX(ios.bill_code) AS bill_code + MAX(dtl.iostorinvdtl_id) AS iostorinvdtl_id FROM - ( - SELECT - a.box_no, - MAX(b.iostorinv_id) AS iostorinv_id, - MAX(a.pcsn) AS pcsn - FROM - st_ivt_iostorinvdis a - LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id - WHERE - b.io_type = '1' - and b.is_delete='0' - - GROUP BY a.box_no - ) dis - LEFT JOIN st_ivt_iostorinv ios ON dis.iostorinv_id = ios.iostorinv_id + st_ivt_iostorinvdis dis + LEFT JOIN st_ivt_iostorinvdtl dtl ON dis.iostorinvdtl_id = dtl.iostorinvdtl_id + LEFT JOIN st_ivt_iostorinv ios ON ios.iostorinv_id = dtl.iostorinv_id LEFT JOIN pdm_bi_subpackagerelation sub ON sub.package_box_sn = dis.box_no AND dis.pcsn = sub.container_name WHERE ios.io_type = '1' and ios.is_delete='0' - GROUP BY ios.bill_code + + GROUP BY dtl.iostorinvdtl_id ENDSELECT ENDQUERY diff --git a/lms/nladmin-system/src/main/resources/config/application.yml b/lms/nladmin-system/src/main/resources/config/application.yml index 0780a00a4..c5e679827 100644 --- a/lms/nladmin-system/src/main/resources/config/application.yml +++ b/lms/nladmin-system/src/main/resources/config/application.yml @@ -1,3 +1,7 @@ +server: + tomcat: + relaxed-query-chars: [ '|','{','}','[',']' ] #字符问题:https://blog.csdn.net/CanYue_Yi/article/details/109182577 + relaxed-path-chars: [ '|','{','}','[',']' ] #字符问题: https://blog.csdn.net/weixin_41996632/article/details/90715118 spring: freemarker: check-template-location: false @@ -9,7 +13,45 @@ spring: redis: repositories: enabled: false + dynamic: + tp: + enabled: true # 是否启用 dynamictp,默认true + enabledBanner: false # 是否启用 控制台banner,默认true + enabledCollect: true # 是否开启监控指标采集,默认true + collectorTypes: logging # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer + logPath: C:\log\lms # 监控日志数据路径,默认 ${user.home}/logs,采集类型非logging不用配置 + monitorInterval: 8 + tomcatTp: # tomcat webserver 线程池配置 + threadPoolAliasName: tomcat 线程池 # 线程池别名,可选 + corePoolSize: 100 + maximumPoolSize: 200 + keepAliveTime: 60 + runTimeout: 10000 + queueTimeout: 100 + notifyItems: # 报警项,不配置自动会按默认值配置(变更通知、容量报警、活性报警、拒绝报警、任务超时报警) + - type: change + enabled: true + - type: capacity # 队列容量使用率,报警项类型,查看源码 NotifyTypeEnum枚举类 + enabled: true + threshold: 80 # 报警阈值,默认70,意思是队列使用率达到70%告警 + interval: 120 # 报警间隔(单位:s),默认120 + + - type: liveness # 线程池活性 + enabled: true + threshold: 80 # 报警阈值,默认 70,意思是活性达到70%告警 + + - type: reject # 触发任务拒绝告警 + enabled: true + threshold: 100 # 默认阈值10 + + - type: run_timeout # 任务执行超时告警 + enabled: true + threshold: 100 # 默认阈值10 + + - type: queue_timeout # 任务排队超时告警 + enabled: true + threshold: 100 # 默认阈值10 #配置 Jpa jpa: hibernate: