From d4dcb1455bb3a024fe3474fdc540cef721ca2de6 Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Tue, 24 Mar 2020 18:32:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccsens/cloudutil/aspect/LogAspect.java | 12 +++++-- .../ccsens/health/service/JourneyService.java | 2 ++ .../ccsens/health/service/StudentService.java | 2 ++ .../src/main/resources/application-common.yml | 4 +-- health/src/main/resources/application-dev.yml | 3 ++ .../src/main/resources/application-prod.yml | 5 ++- .../src/main/resources/application-prod2.yml | 35 ------------------- .../src/main/resources/application-test.yml | 3 ++ health/src/main/resources/application.yml | 4 +-- health/src/main/resources/druid-prod.yml | 8 ++--- .../ht/service/PatientReportService.java | 4 +++ .../java/com/ccsens/ht/uitl/Constant.java | 1 + .../com/ccsens/tall/web/UserController.java | 18 +++++----- tall/src/main/resources/application.yml | 4 +-- .../test/java/com/ccsens/util/KeyTest.java | 4 +-- 15 files changed, 49 insertions(+), 60 deletions(-) delete mode 100644 health/src/main/resources/application-prod2.yml diff --git a/cloudutil/src/main/java/com/ccsens/cloudutil/aspect/LogAspect.java b/cloudutil/src/main/java/com/ccsens/cloudutil/aspect/LogAspect.java index 9dc1a590..0c43b14e 100644 --- a/cloudutil/src/main/java/com/ccsens/cloudutil/aspect/LogAspect.java +++ b/cloudutil/src/main/java/com/ccsens/cloudutil/aspect/LogAspect.java @@ -23,6 +23,8 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.Part; import java.lang.reflect.Method; +import java.util.HashSet; +import java.util.Set; /** * @description: @@ -38,6 +40,12 @@ public class LogAspect { @Autowired private TallFeignClient tallFeignClient; + private Set ignoreUrlSet = new HashSet<>(); + { + ignoreUrlSet.add("/log/operation"); + ignoreUrlSet.add("/users/token"); + } + @Pointcut("execution(* com.ccsens.tall.web..*(..)) || execution(* com.ccsens.ht.api..*(..))") public void logAdvice(){ @@ -81,8 +89,8 @@ public class LogAspect { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); String url = request.getServletPath(); - String logUrl = "/log/operation"; - if (logUrl.equalsIgnoreCase(url)){ + + if (ignoreUrlSet.contains(url)){ log.info("保存日志,不进行记录"); return null; } diff --git a/health/src/main/java/com/ccsens/health/service/JourneyService.java b/health/src/main/java/com/ccsens/health/service/JourneyService.java index 6f11059c..1ad32232 100644 --- a/health/src/main/java/com/ccsens/health/service/JourneyService.java +++ b/health/src/main/java/com/ccsens/health/service/JourneyService.java @@ -26,6 +26,7 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -49,6 +50,7 @@ public class JourneyService implements IJourneyService{ @Resource private IStudentService studentService; @Resource + @Lazy private IAsyncService asyncService; @Autowired private JourneyAbnormalDao journeyAbnormalDao; diff --git a/health/src/main/java/com/ccsens/health/service/StudentService.java b/health/src/main/java/com/ccsens/health/service/StudentService.java index ef5b62fb..24d76a51 100644 --- a/health/src/main/java/com/ccsens/health/service/StudentService.java +++ b/health/src/main/java/com/ccsens/health/service/StudentService.java @@ -16,6 +16,7 @@ import com.ccsens.util.bean.dto.QueryDto; import com.ccsens.util.exception.BaseException; import io.swagger.annotations.ApiModelProperty; import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Lazy; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.PlatformTransactionManager; @@ -49,6 +50,7 @@ public class StudentService implements IStudentService{ @Resource private RealNameAuthDao realNameAuthDao; @Resource + @Lazy private IAsyncService asyncService; @Resource private SiteClockInDao siteClockInDao; diff --git a/health/src/main/resources/application-common.yml b/health/src/main/resources/application-common.yml index 40efee80..5e410c6a 100644 --- a/health/src/main/resources/application-common.yml +++ b/health/src/main/resources/application-common.yml @@ -24,7 +24,5 @@ spring: multipart: max-file-size: 10MB max-request-size: 100MB - snowflake: - datacenterId: 1 - workerId: 1 + diff --git a/health/src/main/resources/application-dev.yml b/health/src/main/resources/application-dev.yml index 203f780b..eb398e73 100644 --- a/health/src/main/resources/application-dev.yml +++ b/health/src/main/resources/application-dev.yml @@ -3,6 +3,9 @@ server: servlet: context-path: spring: + snowflake: + datacenterId: 1 + workerId: 1 application: name: health datasource: diff --git a/health/src/main/resources/application-prod.yml b/health/src/main/resources/application-prod.yml index 6b500848..4e45e18b 100644 --- a/health/src/main/resources/application-prod.yml +++ b/health/src/main/resources/application-prod.yml @@ -1,8 +1,11 @@ server: - port: 7080 + port: 7081 servlet: context-path: spring: + snowflake: + datacenterId: 2 + workerId: 2 application: name: health datasource: diff --git a/health/src/main/resources/application-prod2.yml b/health/src/main/resources/application-prod2.yml deleted file mode 100644 index da05f767..00000000 --- a/health/src/main/resources/application-prod2.yml +++ /dev/null @@ -1,35 +0,0 @@ -server: - port: 7081 - servlet: - context-path: -spring: - application: - name: health - datasource: - type: com.alibaba.druid.pool.DruidDataSource - rabbitmq: - host: api.ccsens.com - password: 111111 - port: 5672 - username: admin - redis: - database: 0 - host: 127.0.0.1 - jedis: - pool: - max-active: 200 - max-idle: 10 - max-wait: -1ms - min-idle: 0 - password: '' - port: 6379 - timeout: 1000ms -swagger: - enable: false -eureka: - instance: - ip-address: 192.144.182.42 -file: - path: /home/cloud/health/uploads/ - domain: https://sd.tall.com/gateway/health/ - imgDomain: https://sd.tall.com/gateway/health/uploads \ No newline at end of file diff --git a/health/src/main/resources/application-test.yml b/health/src/main/resources/application-test.yml index 5d7e369d..bb0b8d3f 100644 --- a/health/src/main/resources/application-test.yml +++ b/health/src/main/resources/application-test.yml @@ -3,6 +3,9 @@ server: servlet: context-path: spring: + snowflake: + datacenterId: 1 + workerId: 1 application: name: health datasource: diff --git a/health/src/main/resources/application.yml b/health/src/main/resources/application.yml index 5889ff7f..d082c0ea 100644 --- a/health/src/main/resources/application.yml +++ b/health/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: test - include: common, util-test \ No newline at end of file + active: prod + include: common, util-prod \ No newline at end of file diff --git a/health/src/main/resources/druid-prod.yml b/health/src/main/resources/druid-prod.yml index 26b452e4..59b36c1d 100644 --- a/health/src/main/resources/druid-prod.yml +++ b/health/src/main/resources/druid-prod.yml @@ -3,7 +3,7 @@ spring: druid: connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 driverClassName: com.mysql.cj.jdbc.Driver - dynamicUrl: jdbc:mysql://localhost:3306/${schema} + dynamicUrl: jdbc:mysql://api.ccsens.com:3306/${schema} filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' filterName: druidFilter filterProfileEnable: true @@ -15,7 +15,7 @@ spring: maxWait: 60000 minEvictableIdleTimeMillis: 300000 minIdle: 5 - password: + password: 7cdefb88e0b8c8a401b66a83ee0cf80387461268074d1c3dcb146ab485318633 poolPreparedStatements: true servletLogSlowSql: true servletLoginPassword: 111111 @@ -27,7 +27,7 @@ spring: testOnReturn: false testWhileIdle: true timeBetweenEvictionRunsMillis: 60000 - url: jdbc:mysql://127.0.0.1/health?useUnicode=true&characterEncoding=UTF-8 + url: jdbc:mysql://api.ccsens.com/health?useUnicode=true&characterEncoding=UTF-8 username: root validationQuery: SELECT 1 FROM DUAL - env: CCSENS_GAME \ No newline at end of file + env: CCSENS_HEALTH \ No newline at end of file diff --git a/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java b/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java index c490f542..082fa44d 100644 --- a/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java +++ b/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java @@ -344,6 +344,10 @@ public class PatientReportService implements IPatientReportService { if (StringUtil.isNotEmpty(score.getRemark()) && score.getRemark().matches(Constant.Ht.Report.IGNORE_SCORE)) { return score.getScore() == null ? null : 0; } + if (Constant.Ht.Report.MOCA_SJZ.equals(score.getCode())) { + return 0; + } + return score.getScore(); } if (hasAdd.get()) { diff --git a/ht/src/main/java/com/ccsens/ht/uitl/Constant.java b/ht/src/main/java/com/ccsens/ht/uitl/Constant.java index e48b6402..16010d2c 100644 --- a/ht/src/main/java/com/ccsens/ht/uitl/Constant.java +++ b/ht/src/main/java/com/ccsens/ht/uitl/Constant.java @@ -108,6 +108,7 @@ public class Constant { public final static String PARENT_NAME = "认知功能神经心理量表检查报告单"; public final static Byte TYPE_EVALUATION = 2; public final static String IGNORE_SCORE = "[个]"; + public final static String MOCA_SJZ = "SZJ"; public final static Map TYPE = new HashMap<>(); static { //1:报告单 2:测评 3:测评子类 4:二级子类 diff --git a/tall/src/main/java/com/ccsens/tall/web/UserController.java b/tall/src/main/java/com/ccsens/tall/web/UserController.java index 3a8b0b73..26e49892 100644 --- a/tall/src/main/java/com/ccsens/tall/web/UserController.java +++ b/tall/src/main/java/com/ccsens/tall/web/UserController.java @@ -380,15 +380,15 @@ public class UserController { }catch(Exception e){ return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); } - //验证用户存根 - if(userService.tokenNotExistInCache(Long.valueOf(claims.getSubject()))){ - return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); - } - //验证用户是否禁用 - SysUser user = userService.getUserById(Long.valueOf(claims.getSubject())); - if(user.getRecStatus() == WebConstant.REC_STATUS.Disabled.value){ - return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); - } +// //验证用户存根 +// if(userService.tokenNotExistInCache(Long.valueOf(claims.getSubject()))){ +// return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); +// } +// //验证用户是否禁用 +// SysUser user = userService.getUserById(Long.valueOf(claims.getSubject())); +// if(user.getRecStatus() == WebConstant.REC_STATUS.Disabled.value){ +// return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); +// } tokenToUserId.setId(Long.valueOf(claims.getSubject())); diff --git a/tall/src/main/resources/application.yml b/tall/src/main/resources/application.yml index 1d881c2f..af245946 100644 --- a/tall/src/main/resources/application.yml +++ b/tall/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: dev - include: util-dev,common \ No newline at end of file + active: prod + include: util-prod,common \ No newline at end of file diff --git a/util/src/test/java/com/ccsens/util/KeyTest.java b/util/src/test/java/com/ccsens/util/KeyTest.java index 99a0ec32..3479a700 100644 --- a/util/src/test/java/com/ccsens/util/KeyTest.java +++ b/util/src/test/java/com/ccsens/util/KeyTest.java @@ -21,9 +21,9 @@ public class KeyTest { Console.log(Base64.encode(key)); } /**加密*/ -// @Test + @Test public void test3(){ - String key = "a6RlI/GctLgENUvF6DOY7w=="; + String key = "g9RlI/GctLgDFJvF6DOY7w=="; String string = "po3OynBO[M3579p6L7)o"; SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, Base64.decode(key)); String encryptHex = aes.encryptHex(string);