Browse Source

0324.5

master
zhangye 5 years ago
parent
commit
7ea7de839f
  1. 12
      cloudutil/src/main/java/com/ccsens/cloudutil/aspect/LogAspect.java
  2. 2
      health/src/main/java/com/ccsens/health/service/JourneyService.java
  3. 2
      health/src/main/java/com/ccsens/health/service/StudentService.java
  4. 4
      health/src/main/resources/application-common.yml
  5. 3
      health/src/main/resources/application-dev.yml
  6. 38
      health/src/main/resources/application-prod.yml
  7. 3
      health/src/main/resources/application-test.yml
  8. 4
      health/src/main/resources/application.yml
  9. 8
      health/src/main/resources/druid-prod.yml
  10. 5
      ht/src/main/java/com/ccsens/ht/service/PatientReportService.java
  11. 1
      ht/src/main/java/com/ccsens/ht/uitl/Constant.java
  12. 18
      tall/src/main/java/com/ccsens/tall/web/UserController.java
  13. 4
      tall/src/main/resources/application.yml

12
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.HttpServletRequest;
import javax.servlet.http.Part; import javax.servlet.http.Part;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;
/** /**
* @description: * @description:
@ -38,6 +40,12 @@ public class LogAspect {
@Autowired @Autowired
private TallFeignClient tallFeignClient; private TallFeignClient tallFeignClient;
private Set<String> ignoreUrlSet = new HashSet<>();
{
ignoreUrlSet.add("/log/operation");
ignoreUrlSet.add("/users/token");
}
@Pointcut("execution(* com.ccsens.tall.web..*(..)) || execution(* com.ccsens.ht.api..*(..))") @Pointcut("execution(* com.ccsens.tall.web..*(..)) || execution(* com.ccsens.ht.api..*(..))")
public void logAdvice(){ public void logAdvice(){
@ -81,8 +89,8 @@ public class LogAspect {
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String url = request.getServletPath(); String url = request.getServletPath();
String logUrl = "/log/operation";
if (logUrl.equalsIgnoreCase(url)){ if (ignoreUrlSet.contains(url)){
log.info("保存日志,不进行记录"); log.info("保存日志,不进行记录");
return null; return null;
} }

2
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 com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -49,6 +50,7 @@ public class JourneyService implements IJourneyService{
@Resource @Resource
private IStudentService studentService; private IStudentService studentService;
@Resource @Resource
@Lazy
private IAsyncService asyncService; private IAsyncService asyncService;
@Autowired @Autowired
private JourneyAbnormalDao journeyAbnormalDao; private JourneyAbnormalDao journeyAbnormalDao;

2
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 com.ccsens.util.exception.BaseException;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.PlatformTransactionManager;
@ -49,6 +50,7 @@ public class StudentService implements IStudentService{
@Resource @Resource
private RealNameAuthDao realNameAuthDao; private RealNameAuthDao realNameAuthDao;
@Resource @Resource
@Lazy
private IAsyncService asyncService; private IAsyncService asyncService;
@Resource @Resource
private SiteClockInDao siteClockInDao; private SiteClockInDao siteClockInDao;

4
health/src/main/resources/application-common.yml

@ -24,7 +24,5 @@ spring:
multipart: multipart:
max-file-size: 10MB max-file-size: 10MB
max-request-size: 100MB max-request-size: 100MB
snowflake:
datacenterId: 1
workerId: 1

3
health/src/main/resources/application-dev.yml

@ -3,6 +3,9 @@ server:
servlet: servlet:
context-path: context-path:
spring: spring:
snowflake:
datacenterId: 1
workerId: 1
application: application:
name: health name: health
datasource: datasource:

38
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

3
health/src/main/resources/application-test.yml

@ -3,6 +3,9 @@ server:
servlet: servlet:
context-path: context-path:
spring: spring:
snowflake:
datacenterId: 1
workerId: 1
application: application:
name: health name: health
datasource: datasource:

4
health/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring: spring:
profiles: profiles:
active: common active: prod
include: common, util-common include: common, util-prod

8
health/src/main/resources/druid-prod.yml

@ -3,7 +3,7 @@ spring:
druid: druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver 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/*' filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter filterName: druidFilter
filterProfileEnable: true filterProfileEnable: true
@ -15,7 +15,7 @@ spring:
maxWait: 60000 maxWait: 60000
minEvictableIdleTimeMillis: 300000 minEvictableIdleTimeMillis: 300000
minIdle: 5 minIdle: 5
password: password: 7cdefb88e0b8c8a401b66a83ee0cf80387461268074d1c3dcb146ab485318633
poolPreparedStatements: true poolPreparedStatements: true
servletLogSlowSql: true servletLogSlowSql: true
servletLoginPassword: 111111 servletLoginPassword: 111111
@ -27,7 +27,7 @@ spring:
testOnReturn: false testOnReturn: false
testWhileIdle: true testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000 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 username: root
validationQuery: SELECT 1 FROM DUAL validationQuery: SELECT 1 FROM DUAL
env: CCSENS_GAME env: CCSENS_HEALTH

5
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.setEvaluationCode(Constant.Ht.Report.PARENT_CODE);
htPatientReport.setName(Constant.Ht.Report.PARENT_NAME + DateUtil.today()); htPatientReport.setName(Constant.Ht.Report.PARENT_NAME + DateUtil.today());
htPatientReport.setSerialNumber(htPatient.getId() + "_" + (times + 1)); htPatientReport.setSerialNumber(htPatient.getId() + "_" + (times + 1));
htPatientReport.setReportTime(System.currentTimeMillis());
htPatientReportDao.insertSelective(htPatientReport); htPatientReportDao.insertSelective(htPatientReport);
log.info("生成病友报告单:{}", generate); log.info("生成病友报告单:{}", generate);
PatientReportVo.Generate generateVo = new PatientReportVo.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)) { if (StringUtil.isNotEmpty(score.getRemark()) && score.getRemark().matches(Constant.Ht.Report.IGNORE_SCORE)) {
return score.getScore() == null ? null : 0; return score.getScore() == null ? null : 0;
} }
if (Constant.Ht.Report.MOCA_SJZ.equals(score.getCode())) {
return 0;
}
return score.getScore(); return score.getScore();
} }
if (hasAdd.get()) { if (hasAdd.get()) {

1
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 String PARENT_NAME = "认知功能神经心理量表检查报告单";
public final static Byte TYPE_EVALUATION = 2; public final static Byte TYPE_EVALUATION = 2;
public final static String IGNORE_SCORE = "[个]"; public final static String IGNORE_SCORE = "[个]";
public final static String MOCA_SJZ = "SZJ";
public final static Map<String, Byte> TYPE = new HashMap<>(); public final static Map<String, Byte> TYPE = new HashMap<>();
static { static {
//1:报告单 2:测评 3:测评子类 4:二级子类 //1:报告单 2:测评 3:测评子类 4:二级子类

18
tall/src/main/java/com/ccsens/tall/web/UserController.java

@ -380,15 +380,15 @@ public class UserController {
}catch(Exception e){ }catch(Exception e){
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
} }
//验证用户存根 // //验证用户存根
if(userService.tokenNotExistInCache(Long.valueOf(claims.getSubject()))){ // if(userService.tokenNotExistInCache(Long.valueOf(claims.getSubject()))){
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); // return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
} // }
//验证用户是否禁用 // //验证用户是否禁用
SysUser user = userService.getUserById(Long.valueOf(claims.getSubject())); // SysUser user = userService.getUserById(Long.valueOf(claims.getSubject()));
if(user.getRecStatus() == WebConstant.REC_STATUS.Disabled.value){ // if(user.getRecStatus() == WebConstant.REC_STATUS.Disabled.value){
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); // return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
} // }
tokenToUserId.setId(Long.valueOf(claims.getSubject())); tokenToUserId.setId(Long.valueOf(claims.getSubject()));

4
tall/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring: spring:
profiles: profiles:
active: dev active: prod
include: util-dev,common include: util-prod,common
Loading…
Cancel
Save