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 c0a329d2..f32a9274 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 new file mode 100644 index 00000000..4e45e18b --- /dev/null +++ b/health/src/main/resources/application-prod.yml @@ -0,0 +1,38 @@ +server: + port: 7081 + servlet: + context-path: +spring: + snowflake: + datacenterId: 2 + workerId: 2 + 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 a3912bc7..5abf2423 100644 --- a/health/src/main/resources/application.yml +++ b/health/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: common - include: common, util-common \ No newline at end of file + active: prod + include: common, util-prod 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 b1f326d9..082fa44d 100644 --- a/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java +++ b/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java @@ -89,6 +89,7 @@ public class PatientReportService implements IPatientReportService { htPatientReport.setEvaluationCode(Constant.Ht.Report.PARENT_CODE); htPatientReport.setName(Constant.Ht.Report.PARENT_NAME + DateUtil.today()); htPatientReport.setSerialNumber(htPatient.getId() + "_" + (times + 1)); + htPatientReport.setReportTime(System.currentTimeMillis()); htPatientReportDao.insertSelective(htPatientReport); log.info("生成病友报告单:{}", generate); PatientReportVo.Generate generateVo = new PatientReportVo.Generate(); @@ -343,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