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 20160ad0b..23517ed3b 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 @@ -126,8 +126,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i task = this.itemProtocol.getTask(); if (mode != last_mode) { if (mode == 2) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号复位前requireSuccess:" + requireSucess); this.setRequireSucess(false); message = null; + logServer.deviceExecuteLog(this.device_code, "", "", "信号复位后requireSuccess:" + requireSucess); + } logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); @@ -559,7 +562,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i instructionService.create(instdto); } catch (Exception e) { notCreateInstMessage = e.getMessage(); - e.printStackTrace(); + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "创建指令时出现异常:" + e.getMessage()); return false; } //创建指令后修改任务状态 @@ -571,10 +574,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i Device nextDevice = deviceAppService.findDeviceByCode(instdto.getNext_device_code()); if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { notCreateInstMessage = "设备:" + startDevice.getDevice_code() + "未设置电气调度号!"; + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); } if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { notCreateInstMessage = "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"; + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } String start_addr = startDevice.getExtraValue().get("address").toString(); @@ -692,6 +697,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } } catch (Exception e) { isClose = true; + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "检查烘箱是否关门时出现异常:" + e.getMessage()); notCreateInstMessage = "检查烘箱是否关门时出现异常:" + e.getMessage(); } return isClose; @@ -761,6 +767,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } else if (this.getMove() == 1) { move = "有货"; } + String requireSucess = "0"; if (this.requireSucess) { requireSucess = "1"; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index 6f170f7fe..e4b19a71f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -1470,7 +1470,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl jo.put("isError", this.getIserror()); jo.put("is_disable1", this.getIs_disable()); jo.put("is_disable", is_disable); - jo.put("message", "此时,type = 1时," + this.getNow_steps_type1() + ",type = 2时," + this.getNow_steps_type2() + ",type = 3时," + this.getNow_steps_type3()); + jo.put("message", this.messageInfo(type)); jo.put("is_click", true); jo.put("driver_type", "slit_two_manipulator"); jo.put("notCreateTaskMessage", notCreateTaskMessage); @@ -1479,6 +1479,46 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl return jo; } + public String messageInfo(int type) { + String set_type = ""; + JSONObject map = new JSONObject(); + if (type == 1) { + set_type = String.valueOf(now_steps_type1); + map.put("0", "前工位单任务未执行"); + map.put("1", "前工位单任务改变指令状态"); + map.put("2", "前工位单任务下发电气任务信息"); + map.put("3", "单任务前工位允许取货"); + map.put("4", "单任务前工位取货完成"); + map.put("5", "单任务前工位允许放货"); + map.put("6", "单任务前工位放货完成"); + } else if (type == 2) { + set_type = String.valueOf(now_steps_type2); + map.put("0", "后工位单任务未执行"); + map.put("1", "后工位单任务改变指令状态"); + map.put("2", "后工位单任务下发电气任务信息"); + map.put("3", "单任务后工位允许取货"); + map.put("4", "单任务后工位取货完成"); + map.put("5", "单任务后工位允许放货"); + map.put("6", "单任务后工位放货完成"); + } else if (type == 3) { + set_type = String.valueOf(now_steps_type3); + map.put("0", "双任务未执行"); + map.put("1", "双任务改变指令状态"); + map.put("2", "双任务下发电气任务信息"); + map.put("3", "双任务后工位允许取货"); + map.put("4", "双任务后工位取货完成"); + map.put("5", "双任务前工位允许取货"); + map.put("6", "双任务前工位取货完成"); + map.put("7", "双任务后工位允许放货"); + map.put("8", "双任务后工位放货完成"); + map.put("9", "双任务前工位允许放货"); + map.put("10", "双任务前工位放货完成"); + } else { + return "未执行任务"; + } + return map.getString(set_type); + } + @Override public void setDeviceStatus(JSONObject data) { String is_disable = data.getString("is_disable"); diff --git a/lms/nladmin-system/src/main/java/org/nl/modules/logging/InterfaceLogType.java b/lms/nladmin-system/src/main/java/org/nl/modules/logging/InterfaceLogType.java new file mode 100644 index 000000000..0e26f05b8 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/modules/logging/InterfaceLogType.java @@ -0,0 +1,28 @@ +package org.nl.modules.logging; + +/** + * @author: lyd + * @description: + * @Date: 2022/10/11 + */ +public enum InterfaceLogType { + DEFAULT("默认"), + LMS_TO_MES("LMS请求MES"), + MES_TO_LMS("MES请求LMS"), + LMS_TO_CRM("LMS请求CRM"), + CRM_TO_LMS("CRM请求LMS"), + LMS_TO_SAP("LMS请求SAP"), + SAP_TO_LMS("SAP请求LMS"), + LMS_TO_ACS("LMS请求ACS"), + ACS_TO_LMS("ACS请求LMS"); + + private String desc; + + InterfaceLogType(String desc) { + this.desc=desc; + } + + public String getDesc() { + return desc; + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/modules/logging/annotation/Log.java b/lms/nladmin-system/src/main/java/org/nl/modules/logging/annotation/Log.java index e14ae508e..98984194a 100644 --- a/lms/nladmin-system/src/main/java/org/nl/modules/logging/annotation/Log.java +++ b/lms/nladmin-system/src/main/java/org/nl/modules/logging/annotation/Log.java @@ -15,6 +15,8 @@ */ package org.nl.modules.logging.annotation; +import org.nl.modules.logging.InterfaceLogType; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -28,4 +30,33 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) public @interface Log { String value() default ""; + + /** + * 是否打印到日志文件 + * + * @return + */ + boolean isPrintToLogFile() default false; + + + /** + * 是否插入操作日志表 + * + * @return + */ + boolean isAddLogTable() default true; + + /** + * 是否接口日志 + * + * @return + */ + boolean isInterfaceLog() default false; + + /** + * 接口日志类型 + * + * @return + */ + InterfaceLogType interfaceLogType() default InterfaceLogType.DEFAULT; } 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 53c68b192..7161e6e6e 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 @@ -18,6 +18,7 @@ package org.nl.modules.logging.aspect; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import lombok.extern.slf4j.Slf4j; +import net.sf.json.JSONObject; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.AfterThrowing; @@ -25,12 +26,14 @@ import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; -import org.nl.modules.common.utils.RequestHolder; +import org.nl.common.utils.IdUtil; import org.nl.common.utils.SecurityUtils; +import org.nl.modules.common.utils.RequestHolder; import org.nl.modules.common.utils.StringUtils; import org.nl.modules.common.utils.ThrowableUtil; import org.nl.modules.logging.domain.Log; import org.nl.modules.logging.service.LogService; +import org.nl.modules.wql.core.bean.WQLObject; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; @@ -79,17 +82,60 @@ public class LogAspect { Method method = signature.getMethod(); // 方法路径 String methodName = joinPoint.getTarget().getClass().getName() + "." + signature.getName() + "()"; - String params=getParameter(method, joinPoint.getArgs()); - log.info("请求方法:{}",methodName); - log.info("请求方法参数:{}",params); + String params = getParameter(method, joinPoint.getArgs()); + + org.nl.modules.logging.annotation.Log logInfo = method.getAnnotation(org.nl.modules.logging.annotation.Log.class); + + //是否输出到日志文件 + if (logInfo.isPrintToLogFile()) { + log.info("请求方法:{}", methodName); + log.info("请求方法参数:{}", params); + } + Object result; currentTime.set(System.currentTimeMillis()); result = joinPoint.proceed(); - Log log = new Log("INFO",System.currentTimeMillis() - currentTime.get()); - currentTime.remove(); + HttpServletRequest request = RequestHolder.getHttpServletRequest(); - logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request),joinPoint, log); + + String requestIp = StringUtils.getIp(request); + //是否把日志存到日志表 + if (logInfo.isAddLogTable()) { + Log log = new Log("INFO", System.currentTimeMillis() - currentTime.get()); + currentTime.remove(); + + + logService.save(getUsername(), StringUtils.getBrowser(request), requestIp, joinPoint, log); + } + + + //保存到接口日志表 + if (logInfo.isInterfaceLog()) { + try { + System.out.println("日志存储到接口日志表!"); + WQLObject interfaceLog = WQLObject.getWQLObject("sys_interface_log"); + JSONObject json = new JSONObject(); + json.put("log_id", IdUtil.getStringId()); + json.put("description", logInfo.value()); + json.put("log_type", logInfo.interfaceLogType().getDesc()); + json.put("log_level", "1"); + json.put("method", methodName); + json.put("params", getParameter(method, joinPoint.getArgs())); + json.put("request_ip", StringUtils.getIp(request)); + json.put("time", 10); + json.put("username", getUsername()); + json.put("address", StringUtils.getCityInfo(requestIp)); + json.put("browser", StringUtils.getBrowser(request)); + json.put("exception_detail", IdUtil.getStringId()); + json.put("create_time", IdUtil.getStringId()); + json.put("return_result", JSONObject.fromObject(result).getJSONObject("body")); + interfaceLog.insert(json); + } catch (Exception e) { + System.out.println("接口日志保存异常!"+e.getMessage()); + } + } + return result; } @@ -127,21 +173,21 @@ public class LogAspect { * 配置异常通知 * * @param joinPoint join point for advice - * @param e exception + * @param e exception */ @AfterThrowing(pointcut = "logPointcut()", throwing = "e") public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { - Log log = new Log("ERROR",System.currentTimeMillis() - currentTime.get()); + Log log = new Log("ERROR", System.currentTimeMillis() - currentTime.get()); currentTime.remove(); log.setExceptionDetail(ThrowableUtil.getStackTrace(e).getBytes()); HttpServletRequest request = RequestHolder.getHttpServletRequest(); - logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log); + logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint) joinPoint, log); } public String getUsername() { try { return SecurityUtils.getCurrentUsername(); - }catch (Exception e){ + } catch (Exception e) { return ""; } } diff --git a/lms/nladmin-system/src/main/java/org/nl/modules/logging/rest/InterfaceLogController.java b/lms/nladmin-system/src/main/java/org/nl/modules/logging/rest/InterfaceLogController.java new file mode 100644 index 000000000..eb9734e8b --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/modules/logging/rest/InterfaceLogController.java @@ -0,0 +1,40 @@ +package org.nl.modules.logging.rest; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.nl.modules.logging.annotation.Log; +import org.nl.modules.logging.service.InterfaceLogService; +import org.nl.wms.sch.service.PointService; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +/** + * @author ldjun + * @version 1.0 + * @date 2023年01月29日 18:55 + * @desc desc + */ + +@RestController +@RequiredArgsConstructor +@RequestMapping("/api/interfaceLog") +@Api(tags = "系统:接口日志管理") +public class InterfaceLogController { + private final InterfaceLogService interfaceLogService; + + @GetMapping + @Log("查询接口日志") + @ApiOperation("查询接口日志") + //@SaCheckPermission("point:list") + public ResponseEntity query(@RequestParam Map whereJson, Pageable page) { + return new ResponseEntity<>(interfaceLogService.queryAll(whereJson, page), HttpStatus.OK); + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/modules/logging/service/InterfaceLogService.java b/lms/nladmin-system/src/main/java/org/nl/modules/logging/service/InterfaceLogService.java new file mode 100644 index 000000000..c853272fb --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/modules/logging/service/InterfaceLogService.java @@ -0,0 +1,37 @@ +/* + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.nl.modules.logging.service; + +import org.springframework.data.domain.Pageable; + +import java.util.Map; + +/** + * @author Zheng Jie + * @date 2018-11-24 + */ +public interface InterfaceLogService { + + /** + * 查询数据分页 + * @param whereJson 条件 + * @param page 分页参数 + * @return Map + */ + Map queryAll(Map whereJson, Pageable page); + + +} diff --git a/lms/nladmin-system/src/main/java/org/nl/modules/logging/service/impl/InterfaceLogServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/modules/logging/service/impl/InterfaceLogServiceImpl.java new file mode 100644 index 000000000..28ed5805a --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/modules/logging/service/impl/InterfaceLogServiceImpl.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.nl.modules.logging.service.impl; + +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.modules.logging.service.InterfaceLogService; +import org.nl.modules.wql.core.bean.ResultBean; +import org.nl.modules.wql.core.bean.WQLObject; +import org.nl.modules.wql.util.WqlUtil; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * @author Zheng Jie + * @date 2018-11-24 + */ +@Service +@RequiredArgsConstructor +@Slf4j +public class InterfaceLogServiceImpl implements InterfaceLogService { + + + @Override + public Map queryAll(Map whereJson, Pageable pageable) { + String where = "1=1"; + ResultBean rb = WQLObject.getWQLObject("sys_interface_log").pagequery(WqlUtil.getHttpContext(pageable), where, "create_time desc "); + final JSONObject json = rb.pageResult(); + return json; + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/modules/system/wql/sys.xls b/lms/nladmin-system/src/main/java/org/nl/modules/system/wql/sys.xls index fdf223030..5c164309c 100644 Binary files a/lms/nladmin-system/src/main/java/org/nl/modules/system/wql/sys.xls and b/lms/nladmin-system/src/main/java/org/nl/modules/system/wql/sys.xls differ diff --git a/lms/nladmin-system/src/main/java/org/nl/system/controller/param/SysParamController.java b/lms/nladmin-system/src/main/java/org/nl/system/controller/param/SysParamController.java index c255155e4..900bfac2f 100644 --- a/lms/nladmin-system/src/main/java/org/nl/system/controller/param/SysParamController.java +++ b/lms/nladmin-system/src/main/java/org/nl/system/controller/param/SysParamController.java @@ -1,6 +1,8 @@ package org.nl.system.controller.param; +import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaIgnore; +import cn.dev33.satoken.annotation.SaMode; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -35,11 +37,12 @@ import java.util.Map; @RequiredArgsConstructor class SysParamController { private final ISysParamService paramService; + @GetMapping - @Log("查询系统参数") + @Log(value = "查询系统参数", isAddLogTable = true, isInterfaceLog = true) @ApiOperation("查询系统参数") //@SaCheckPermission("param:list") - public ResponseEntity query(@RequestParam Map whereJson, PageQuery page){ + public ResponseEntity query(@RequestParam Map whereJson, PageQuery page) { return new ResponseEntity<>(TableDataInfo.build(paramService.queryPage(whereJson, page)), HttpStatus.OK); } @@ -47,7 +50,7 @@ class SysParamController { @Log("新增系统参数") @ApiOperation("新增系统参数") //@SaCheckPermission("param:add") - public ResponseEntity create(@Validated @RequestBody Param param){ + public ResponseEntity create(@Validated @RequestBody Param param) { paramService.create(param); return new ResponseEntity<>(HttpStatus.CREATED); } @@ -56,7 +59,7 @@ class SysParamController { @Log("修改系统参数") @ApiOperation("修改系统参数") //@SaCheckPermission("param:edit") - public ResponseEntity update(@Validated @RequestBody Param param){ + public ResponseEntity update(@Validated @RequestBody Param param) { paramService.update(param); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java index c70523920..f9a83842e 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java @@ -9,6 +9,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.nl.modules.logging.InterfaceLogType; import org.nl.modules.logging.annotation.Log; import org.nl.wms.ext.acs.service.AcsToWmsService; import org.springframework.http.HttpStatus; @@ -31,7 +32,7 @@ public class AcsToWmsController { private final AcsToWmsService acsToWmsService; @PostMapping("/status") - @Log("ACS给WMS反馈任务状态") + @Log(value = "ACS给WMS反馈任务状态", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS) @ApiOperation("ACS给WMS反馈任务状态") @SaIgnore public ResponseEntity receiveTaskStatusAcs(@RequestBody String string) { @@ -39,7 +40,7 @@ public class AcsToWmsController { } @PostMapping("/orderFinish") - @Log("ACS给WMS下发工单完成状态") + @Log(value = "ACS给WMS下发工单完成状态", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS) @ApiOperation("ACS给WMS下发工单完成状态") @SaIgnore public ResponseEntity orderFinish(@RequestBody String string) { @@ -47,7 +48,7 @@ public class AcsToWmsController { } @PostMapping("/apply") - @Log("申请任务") + @Log(value = "申请任务", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS) @ApiOperation("申请任务") @SaCheckPermission("menu:list") @SaIgnore @@ -56,7 +57,7 @@ public class AcsToWmsController { } @PostMapping("/againApply") - @Log("二次申请任务") + @Log(value = "二次申请任务", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS) @ApiOperation("二次申请任务") @SaCheckPermission("menu:list") @SaIgnore @@ -65,15 +66,14 @@ public class AcsToWmsController { } @PostMapping("/deviceApply") - @Log("申请贴标、捆扎") - @ApiOperation("申请贴标、捆扎") + @Log(value = "申请贴标、捆扎", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS) @SaIgnore public ResponseEntity deviceApply(@RequestBody JSONObject jo) { return new ResponseEntity<>(acsToWmsService.deviceApply(jo), HttpStatus.OK); } @PostMapping("/process") - @Log("RCS上报密集库任务异常处理") + @Log(value = "RCS上报密集库任务异常处理", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS) @ApiOperation("RCS上报密集库任务异常处理") @SaIgnore public ResponseEntity process(@RequestBody JSONObject jo) { @@ -81,7 +81,7 @@ public class AcsToWmsController { } @PostMapping("/initialize") - @Log("仓位初始化") + @Log(value = "仓位初始化", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS) @ApiOperation("仓位初始化") @SaIgnore @SaCheckPermission("menu:list") diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java index e0c0cae7b..581ec4f23 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java @@ -9,6 +9,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.nl.modules.logging.InterfaceLogType; import org.nl.modules.logging.annotation.Log; import org.nl.wms.ext.acs.service.WmsToAcsService; import org.springframework.http.HttpStatus; @@ -33,7 +34,7 @@ public class WmsToAcsController { private final WmsToAcsService wmsToAcsService; @PostMapping - @Log("WMS给ACS发送任务") + @Log(value = "WMS给ACS发送任务", isInterfaceLog = true, interfaceLogType = InterfaceLogType.LMS_TO_ACS) @ApiOperation("WMS给ACS发送任务") public ResponseEntity issueTaskToAcs(@RequestBody Map whereJson) { JSONArray arr = JSONArray.parseArray(JSON.toJSONString(whereJson.get("data"))); @@ -41,7 +42,7 @@ public class WmsToAcsController { } @PostMapping("/cancel") - @Log("WMS主动取消ACS任务") + @Log(value = "WMS主动取消ACS任务", isInterfaceLog = true, interfaceLogType = InterfaceLogType.LMS_TO_ACS) @ApiOperation("WMS主动取消ACS任务") public ResponseEntity cancelToAcs(@RequestBody Map whereJson) { JSONArray arr = JSONArray.parseArray(JSON.toJSONString(whereJson.get("data"))); @@ -49,7 +50,7 @@ public class WmsToAcsController { } @PostMapping("/updatePointStatus") - @Log("WMS更新ACS点位状态") + @Log(value = "WMS更新ACS点位状态", isInterfaceLog = true, interfaceLogType = InterfaceLogType.LMS_TO_ACS) @ApiOperation("WMS更新ACS点位状态") public ResponseEntity updatePointStatus(@RequestBody Map whereJson) { JSONArray arr = JSONArray.parseArray(JSON.toJSONString(whereJson.get("data"))); @@ -57,7 +58,7 @@ public class WmsToAcsController { } @PostMapping("/order") - @Log("WMS开工向acs下发工单") + @Log(value = "WMS开工向acs下发工单", isInterfaceLog = true, interfaceLogType = InterfaceLogType.LMS_TO_ACS) @ApiOperation("WMS开工向acs下发工单") public ResponseEntity startWork(@RequestBody Map whereJson) { JSONArray arr = JSONArray.parseArray(JSON.toJSONString(whereJson.get("data"))); @@ -65,7 +66,7 @@ public class WmsToAcsController { } @PostMapping("/orderStatusUpdate") - @Log("WMS向acs发送强制完成") + @Log(value = "WMS向acs发送强制完成", isInterfaceLog = true, interfaceLogType = InterfaceLogType.LMS_TO_ACS) @ApiOperation("WMS强制完成向acs发送强制完成") public ResponseEntity orderStatusUpdate(@RequestBody Map whereJson) { JSONArray arr = JSONArray.parseArray(JSON.toJSONString(whereJson.get("data"))); @@ -73,7 +74,7 @@ public class WmsToAcsController { } @PostMapping("/querydevice") - @Log("WMS向acs发送获取点位状态") + @Log(value = "WMS向acs发送获取点位状态", isInterfaceLog = true, interfaceLogType = InterfaceLogType.LMS_TO_ACS) @ApiOperation("WMS向acs发送获取点位状态") public ResponseEntity getPointStatus(@RequestBody JSONArray whereJson) { return new ResponseEntity<>(wmsToAcsService.getPointStatus(whereJson), HttpStatus.OK); @@ -81,7 +82,7 @@ public class WmsToAcsController { @PostMapping("/updateTask") - @Log("WMS向acs发送更新任务状态") + @Log(value = "WMS向acs发送更新任务状态", isInterfaceLog = true, interfaceLogType = InterfaceLogType.LMS_TO_ACS) @ApiOperation("WMS向acs发送更新任务状态") public ResponseEntity updateTask(@RequestBody Map whereJson) { JSONArray arr = JSONArray.parseArray(JSON.toJSONString(whereJson.get("data"))); @@ -89,7 +90,7 @@ public class WmsToAcsController { } @PostMapping("/action") - @Log("给ACS下发修改PLC的值") + @Log(value = "给ACS下发修改PLC的值", isInterfaceLog = true, interfaceLogType = InterfaceLogType.LMS_TO_ACS) @ApiOperation("给ACS下发修改PLC的值") public ResponseEntity action(@RequestBody Map whereJson) { JSONArray arr = JSONArray.parseArray(JSON.toJSONString(whereJson.get("data"))); @@ -97,7 +98,7 @@ public class WmsToAcsController { } @PostMapping("/putPlusPullAction") - @Log("给ACS下发修改PLC的值") + @Log(value = "给ACS下发修改PLC的值", isInterfaceLog = true, interfaceLogType = InterfaceLogType.LMS_TO_ACS) @ApiOperation("给ACS下发修改PLC的值") public ResponseEntity putPlusPullAction(@RequestBody JSONObject jo) { return new ResponseEntity<>(wmsToAcsService.putPlusPullAction(jo), HttpStatus.OK); diff --git a/lms/nladmin-ui/src/views/monitor/interfaceLog/index.vue b/lms/nladmin-ui/src/views/monitor/interfaceLog/index.vue new file mode 100644 index 000000000..313116807 --- /dev/null +++ b/lms/nladmin-ui/src/views/monitor/interfaceLog/index.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/lms/nladmin-ui/src/views/monitor/interfaceLog/interfaceLog.js b/lms/nladmin-ui/src/views/monitor/interfaceLog/interfaceLog.js new file mode 100644 index 000000000..8b55d10fa --- /dev/null +++ b/lms/nladmin-ui/src/views/monitor/interfaceLog/interfaceLog.js @@ -0,0 +1,10 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/interfaceLog', + method: 'post', + data + }) +} +export default { add } diff --git a/lms/nladmin-ui/src/views/monitor/interfaceLog/search.vue b/lms/nladmin-ui/src/views/monitor/interfaceLog/search.vue new file mode 100644 index 000000000..cc9f175e5 --- /dev/null +++ b/lms/nladmin-ui/src/views/monitor/interfaceLog/search.vue @@ -0,0 +1,24 @@ + + +