From 5f91a8d7816954e705b033b56ba91f3544b21d25 Mon Sep 17 00:00:00 2001 From: manailin <261030956@qq.com> Date: 星期一, 28 六月 2021 15:54:06 +0800 Subject: [PATCH] [修改]修改注释 --- springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/LangChaoEventUploadJobHandler.java | 8 +- springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/model/dto/ComMngPopulationDTO.java | 60 +------------- springcloud_k8s_panzhihuazhihuishequ/service_api/src/test/java/com/panzhihua/serviceapi/biz/impl/LcApiServiceImplTest.java | 1 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/api/LcRequestEnum.java | 6 + springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/aop/OperLogAspect.java | 96 ++++++----------------- springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/api/LcVisitRecordKeyPersonLabelEnum.java | 12 +++ 6 files changed, 55 insertions(+), 128 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/api/LcRequestEnum.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/api/LcRequestEnum.java index fd069bc..ab774db 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/api/LcRequestEnum.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/api/LcRequestEnum.java @@ -9,7 +9,13 @@ */ @Getter public enum LcRequestEnum { + /** + * 浪潮接口请求返回失败枚举 + */ FALSE("0", "失败"), + /** + *浪潮接口请求返回成功枚举 + */ SUCCESS("200", "成功"); private final String code; diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/api/LcVisitRecordKeyPersonLabelEnum.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/api/LcVisitRecordKeyPersonLabelEnum.java index bef01ed..b774513 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/api/LcVisitRecordKeyPersonLabelEnum.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/api/LcVisitRecordKeyPersonLabelEnum.java @@ -10,9 +10,21 @@ */ @Getter public enum LcVisitRecordKeyPersonLabelEnum { + /** + * 浪潮接口请求参数:吸毒人员类型 + */ XD(1, "p01_drug"), + /** + *浪潮接口请求参数:重精人员类型 + */ JS(2, "p01_trouble_schiz"), + /** + * 浪潮接口请求参数:释放人员类型 + */ XM(3, "p01_release"), + /** + * 浪潮接口请求参数:纠正人员类型 + */ SJ(4, "p01_be_corrected"); private final Integer code; diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/aop/OperLogAspect.java b/springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/aop/OperLogAspect.java index 9e46023..30986ce 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/aop/OperLogAspect.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/aop/OperLogAspect.java @@ -51,12 +51,6 @@ public void operLogPoinCut() { } -// /** -// * 设置操作异常切入点记录异常日志 扫描所有controller包下操作 -// */ -// @Pointcut("execution(* com.hyd.zcar.cms.controller..*.*(..))") -// public void operExceptionLogPoinCut() { -// } /** * 正常返回通知,拦截用户操作日志,连接点正常执行完成后执行, 如果连接点抛出异常,则不会执行 @@ -76,13 +70,13 @@ String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO); boolean empty = ObjectUtils.isEmpty(userInfo); if (empty) { - log.error("操作日志获取登录用户信息失败【{}】",joinPoint); + log.error("操作日志获取登录用户信息失败【{}】", joinPoint); return; } byte[] bytes = AES.parseHexStr2Byte(userInfo); byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY); - userInfo=new String(decrypt); - LoginUserInfoVO loginUserInfoVO= JSONObject.parseObject(userInfo,LoginUserInfoVO.class); + userInfo = new String(decrypt); + LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(userInfo, LoginUserInfoVO.class); SysOperLogVO operlog = new SysOperLogVO(); try { @@ -96,8 +90,10 @@ if (opLog != null) { String operModul = opLog.operModul(); int operType = opLog.operType(); - operlog.setTitle(operModul); // 操作模块 - operlog.setBusinessType(operType); // 操作类型 + operlog.setTitle(operModul); + // 操作模块 + operlog.setBusinessType(operType); + // 操作类型 } // 获取请求的类名 String className = joinPoint.getTarget().getClass().getName(); @@ -105,82 +101,41 @@ String methodName = method.getName(); methodName = className + "." + methodName; - operlog.setMethod(methodName); // 请求方法 + operlog.setMethod(methodName); + // 请求方法 if (joinPoint.getArgs().length > 0) { for (Object o : joinPoint.getArgs()) { if (o instanceof HttpServletRequest || o instanceof HttpServletResponse) { continue; } - operlog.setOperParam(JSONObject.toJSONString(o)); // 请求参数 + operlog.setOperParam(JSONObject.toJSONString(o)); + // 请求参数 } } - operlog.setJsonResult(JSONObject.toJSONString(keys)); // 返回结果 + operlog.setJsonResult(JSONObject.toJSONString(keys)); + // 返回结果 operlog.setAccount(loginUserInfoVO.getAccount()); - operlog.setOperName(loginUserInfoVO.getName()); // 请求用户名称 - operlog.setOperIp(IPUtil.getIpAddress(request)); // 请求IP - operlog.setOperUrl(request.getRequestURI()); // 请求URI + operlog.setOperName(loginUserInfoVO.getName()); + // 请求用户名称 + operlog.setOperIp(IPUtil.getIpAddress(request)); + // 请求IP + operlog.setOperUrl(request.getRequestURI()); + // 请求URI operlog.setRequestMethod(request.getMethod()); operlog.setOperLocation(IPUtil.getIpBelongAddress(request)); - operlog.setOperTime(new Date()); // 创建时间 + operlog.setOperTime(new Date()); + // 创建时间 operlog.setAccount(loginUserInfoVO.getAccount()); Long communityId = loginUserInfoVO.getCommunityId(); - operlog.setCommunityId(null==communityId?0:communityId); + operlog.setCommunityId(null == communityId ? 0 : communityId); userService.addOperLog(operlog); } catch (Exception e) { e.printStackTrace(); } } -// /** -// * 异常返回通知,用于拦截异常日志信息 连接点抛出异常后执行 -// * -// * @param joinPoint 切入点 -// * @param e 异常信息 -// */ -// @AfterThrowing(pointcut = "operExceptionLogPoinCut()", throwing = "e") -// public void saveExceptionLog(JoinPoint joinPoint, Throwable e) { -// // 获取RequestAttributes -// RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); -// // 从获取RequestAttributes中获取HttpServletRequest的信息 -// HttpServletRequest request = (HttpServletRequest) requestAttributes -// .resolveReference(RequestAttributes.REFERENCE_REQUEST); -// -// ExceptionLog excepLog = new ExceptionLog(); -// try { -// // 从切面织入点处通过反射机制获取织入点处的方法 -// MethodSignature signature = (MethodSignature) joinPoint.getSignature(); -// // 获取切入点所在的方法 -// Method method = signature.getMethod(); -// excepLog.setExcId(UuidUtil.get32UUID()); -// // 获取请求的类名 -// String className = joinPoint.getTarget().getClass().getName(); -// // 获取请求的方法名 -// String methodName = method.getName(); -// methodName = className + "." + methodName; -// // 请求的参数 -// Map<String, String> rtnMap = converMap(request.getParameterMap()); -// // 将参数所在的数组转换成json -// String params = JSON.toJSONString(rtnMap); -// excepLog.setExcRequParam(params); // 请求参数 -// excepLog.setOperMethod(methodName); // 请求方法名 -// excepLog.setExcName(e.getClass().getName()); // 异常名称 -// excepLog.setExcMessage(stackTraceToString(e.getClass().getName(), e.getMessage(), e.getStackTrace())); // 异常信息 -// excepLog.setOperUserId(UserShiroUtil.getCurrentUserLoginName()); // 操作员ID -// excepLog.setOperUserName(UserShiroUtil.getCurrentUserName()); // 操作员名称 -// excepLog.setOperUri(request.getRequestURI()); // 操作URI -// excepLog.setOperIp(IPUtil.getRemortIP(request)); // 操作员IP -// excepLog.setOperVer(operVer); // 操作版本号 -// excepLog.setOperCreateTime(new Date()); // 发生异常时间 -// -// exceptionLogService.insert(excepLog); -// -// } catch (Exception e2) { -// e2.printStackTrace(); -// } -// -// } /** * 转换request 请求参数 @@ -188,21 +143,22 @@ * @param paramMap request获取的参数数组 */ public Map<String, String> converMap(Map<String, String[]> paramMap) { - Map<String, String> rtnMap = new HashMap<String, String>(); + Map<String, String> rtnMap = new HashMap<>(6); for (String key : paramMap.keySet()) { rtnMap.put(key, paramMap.get(key)[0]); } return rtnMap; } - private String getPostData(HttpServletRequest request) { + private String getPostData(HttpServletRequest request) { StringBuffer data = new StringBuffer(); String line = null; BufferedReader reader = null; try { reader = request.getReader(); - while (null != (line = reader.readLine())) + while (null != (line = reader.readLine())) { data.append(line); + } } catch (IOException e) { } finally { } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/model/dto/ComMngPopulationDTO.java b/springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/model/dto/ComMngPopulationDTO.java index 6d616e9..7738b4b 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/model/dto/ComMngPopulationDTO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/model/dto/ComMngPopulationDTO.java @@ -1,12 +1,17 @@ package com.panzhihua.serviceapi.model.dto; -import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; import lombok.Data; import java.io.Serializable; import java.util.Date; - +/** + * program 攀枝花智慧社区项目 + * description 实有人口信息 + * + * @author manailin + * Date 2021-06-22 15:30 + **/ @Data public class ComMngPopulationDTO implements Serializable { private static final long serialVersionUID = 1L; @@ -35,10 +40,6 @@ * 性别(1.男 2.女 3.未知) */ private Integer sex; - /** - * 年龄 - */ -// private Integer age; /** * 身份证号码 */ @@ -127,12 +128,6 @@ */ private String villageName; - /** - * 与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他) - */ -// private Integer relation; -// -// private String relationStr; /** * 文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他) @@ -159,46 +154,5 @@ * 出生年月日 */ private String birthday; - - /** - * 居住地房屋id - */ -// private Long houseId; - - /** - * 性别(1.男 2.女 3.未知) - */ - public interface sex{ - int nan = 1; - int nv = 2; - int no = 3; - } - - /** - * 是否租住 - */ - public interface isOk{ - int yes = 1; - int no = 0; - } - - /** - * 政治面貌 - */ - public interface politicalOutlook{ - int dang = 1; - int tuan = 3; - int wu = 12; - int qun = 13; - int no = 13; - } - - /** - * 外地or本地(1.本地 2.外地) - */ - public interface outOrLocal{ - int bd = 1; - int wd = 2; - } } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_api/src/test/java/com/panzhihua/serviceapi/biz/impl/LcApiServiceImplTest.java b/springcloud_k8s_panzhihuazhihuishequ/service_api/src/test/java/com/panzhihua/serviceapi/biz/impl/LcApiServiceImplTest.java index c7759f4..0ce59cf 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_api/src/test/java/com/panzhihua/serviceapi/biz/impl/LcApiServiceImplTest.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_api/src/test/java/com/panzhihua/serviceapi/biz/impl/LcApiServiceImplTest.java @@ -95,7 +95,6 @@ void submitEventRelationFile() throws URISyntaxException { EventFile eventFile = new EventFile(); eventFile.setDataId("1111116"); - //eventFile.setFiles("https://www.baidu.com/img/flexible/logo/pc/result@2.png"); eventFile.setFiles("http://image.panzhihua.nhys.cdnhxx.com//idcard/4f843ad2d756456e900d5f24b419aa7c.mp4"); eventFile.setType("mp4"); eventFile.setModule("event"); diff --git a/springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/LangChaoEventUploadJobHandler.java b/springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/LangChaoEventUploadJobHandler.java index e85da02..db0dc88 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/LangChaoEventUploadJobHandler.java +++ b/springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/LangChaoEventUploadJobHandler.java @@ -21,7 +21,7 @@ @Resource - private ApiServiceFeign ApiServiceFeign; + private ApiServiceFeign apiServiceFeign; /** * description 生成或更新redis里面的对接浪潮所需的token信息,token有效期12小时 @@ -32,7 +32,7 @@ @XxlJob("langChaoGetToken") public ReturnT<String> langChaoGetToken(String param) { log.info("定时更新浪潮对接token。token有效期12小时"); - ApiServiceFeign.getToken("18080799023", "123456"); + apiServiceFeign.getToken("18080799023", "123456"); log.info("定时更新浪潮对接token完成"); return ReturnT.SUCCESS; } @@ -46,7 +46,7 @@ @XxlJob("langChaoAutomationUpload") public ReturnT<String> langChaoAutomationUpload(String param) { log.info("向浪潮服务器提交网格事件登记开始"); - ApiServiceFeign.automationUploadEventAndFile(); + apiServiceFeign.automationUploadEventAndFile(); log.info("向浪潮服务器提交网格事件登记完成"); return ReturnT.SUCCESS; } @@ -60,7 +60,7 @@ @XxlJob("automationUploadVisitRecord") public ReturnT<String> automationUploadVisitRecord(String param) { log.info("向浪潮服务器自动上传重点人员和流动人员走访记录开始"); - ApiServiceFeign.automationUploadVisitRecord(); + apiServiceFeign.automationUploadVisitRecord(); log.info("向浪潮服务器自动上传重点人员和流动人员走访记录完成"); return ReturnT.SUCCESS; } -- Gitblit v1.7.1