Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

recovery
wang0018 4 years ago
parent
commit
410ec486e4
  1. 53
      beneficiation/src/main/java/com/ccsens/beneficiation/api/ParameterController.java
  2. 69
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/dto/ParameterDto.java
  3. 155
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/vo/ParameterVo.java
  4. 22
      beneficiation/src/main/java/com/ccsens/beneficiation/service/IParameterService.java
  5. 106
      beneficiation/src/main/java/com/ccsens/beneficiation/service/ParameterService.java
  6. 4
      beneficiation/src/main/resources/application.yml
  7. 124
      cloudutil/src/main/resources/application-util-green.yml
  8. 53
      cloudutil/src/main/resources/application-util-greenvalley.yml
  9. 3
      cloudutil/src/main/resources/application-util-test.yml
  10. 3
      tall/src/main/java/com/ccsens/tall/service/ExcelService.java
  11. 10
      tall/src/main/java/com/ccsens/tall/service/ITaskPluginService.java
  12. 39
      tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java
  13. 16
      tall/src/main/java/com/ccsens/tall/web/PluginController.java
  14. 2
      tall/src/main/java/com/ccsens/tall/web/ProjectController.java
  15. 39
      tall/src/main/resources/application-greenvalley.yml
  16. 4
      tall/src/main/resources/application.yml
  17. 33
      tall/src/main/resources/druid-greenvalley.yml
  18. 17
      tcm/src/main/java/com/ccsens/tcm/api/ImportController.java
  19. 20
      tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java
  20. 6
      tcm/src/main/java/com/ccsens/tcm/persist/dao/ReportCodeDao.java
  21. 6
      tcm/src/main/java/com/ccsens/tcm/service/IImportService.java
  22. 18
      tcm/src/main/java/com/ccsens/tcm/service/ImportService.java
  23. 49
      tcm/src/main/resources/application-green.yml
  24. 2
      tcm/src/main/resources/application-test.yml
  25. 33
      tcm/src/main/resources/druid-green.yml
  26. 4
      tcm/src/main/resources/druid-test.yml
  27. 5
      tcm/src/main/resources/mapper_dao/ReportCodeDao.xml
  28. 3
      util/src/main/java/com/ccsens/util/JsonResponse.java
  29. 3
      util/src/main/java/com/ccsens/util/PoiUtil.java

53
beneficiation/src/main/java/com/ccsens/beneficiation/api/ParameterController.java

@ -0,0 +1,53 @@
package com.ccsens.beneficiation.api;
import com.ccsens.beneficiation.bean.dto.ParameterDto;
import com.ccsens.beneficiation.bean.dto.WeightDto;
import com.ccsens.beneficiation.bean.vo.ParameterVo;
import com.ccsens.beneficiation.bean.vo.WeightVo;
import com.ccsens.beneficiation.service.IParameterService;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author
*/
@Slf4j
@Api(tags = "查看设置参数" , description = "")
@RestController
@RequestMapping("/parameter")
public class ParameterController {
@Resource
private IParameterService parameterService;
@MustLogin
@ApiOperation(value = "查看各个设备的参数", notes = "")
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ParameterVo.QueryParameter> queryParameter(@ApiParam @Validated @RequestBody QueryDto params) {
log.info("查看各个设备的参数:{}",params);
ParameterVo.QueryParameter parameterInfo = parameterService.queryParameter(params.getParam());
log.info("各个设备的参数:{}",parameterInfo);
return JsonResponse.newInstance().ok(parameterInfo);
}
@MustLogin
@ApiOperation(value = "修改设备的参数", notes = "")
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse updateParameter(@ApiParam @Validated @RequestBody QueryDto<ParameterDto.ParameterInfo> params) {
log.info("修改设备的参数:{}",params);
parameterService.updateParameter(params.getParam());
log.info("修改设备的参数成功");
return JsonResponse.newInstance().ok();
}
}

69
beneficiation/src/main/java/com/ccsens/beneficiation/bean/dto/ParameterDto.java

@ -0,0 +1,69 @@
package com.ccsens.beneficiation.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* @author
*/
@Data
public class ParameterDto {
@Data
@ApiModel("修改仪器的参数")
public static class ParameterInfo{
@ApiModelProperty("电耳1")
private ParameterThreshold electricEar1;
@ApiModelProperty("电耳2")
private ParameterThreshold electricEar2;
@ApiModelProperty("电磁阀1")
private Parameter solenoidValue1;
@ApiModelProperty("电磁阀2")
private Parameter solenoidValue2;
@ApiModelProperty("变频器1")
private Parameter transducer1;
@ApiModelProperty("变频器2")
private Parameter transducer2;
@ApiModelProperty("变频器3")
private Parameter transducer3;
@ApiModelProperty("变频器4")
private Parameter transducer4;
}
@Data
@ApiModel("单个仪器的参数")
public static class Parameter{
@NotNull
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("设置值")
private BigDecimal settingValue;
}
@Data
@ApiModel("电耳的阀值")
public static class ParameterThreshold{
@NotNull
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("阀值1")
private Threshold thresholdValue1;
@ApiModelProperty("阀值2")
private Threshold thresholdValue2;
@ApiModelProperty("阀值3")
private Threshold thresholdValue3;
}
@Data
@ApiModel("阀值的最大最小值")
public static class Threshold{
@ApiModelProperty("最小")
private BigDecimal minValue;
@ApiModelProperty("最打")
private BigDecimal maxValue;
}
}

155
beneficiation/src/main/java/com/ccsens/beneficiation/bean/vo/ParameterVo.java

@ -0,0 +1,155 @@
package com.ccsens.beneficiation.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @author
*/
@Data
public class ParameterVo {
@Data
@ApiModel("查看每个仪器的参数")
public static class QueryParameter{
@ApiModelProperty("只有实时值 能修改,例:变频器")
private List<Transducer> transducers;
@ApiModelProperty("实时值累计值,不能修改,例:皮带秤")
private List<BeltWeigher> beltWeigher;
@ApiModelProperty("有阀值能设置 例:电耳")
private List<Parameter> parameter;
}
@Data
@ApiModel("只有实时值 能修改,例:变频器")
public static class Transducer{
@ApiModelProperty("设备名")
private String title;
@ApiModelProperty("参数")
private List<TransducerValue> values;
}
@Data
@ApiModel("只有实时值 能修改,例:变频器")
public static class TransducerValue{
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("修改时用的类型")
private String type;
@ApiModelProperty("名字")
private String key;
@ApiModelProperty("实时值")
private BigDecimal currentTimeValue;
public TransducerValue(Long id, String type, String key, BigDecimal currentTimeValue) {
this.id = id;
this.type = type;
this.key = key;
this.currentTimeValue = currentTimeValue;
}
public TransducerValue() {
}
}
@Data
@ApiModel("实时值累计值,不能修改,例:皮带秤")
public static class BeltWeigher{
@ApiModelProperty("设备名")
private String title;
@ApiModelProperty("参数")
private List<BeltWeigherValue> values;
}
@Data
@ApiModel("实时值累计值,不能修改,例:皮带秤")
public static class BeltWeigherValue{
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("名字")
private String key;
@ApiModelProperty("修改时用的类型")
private String type;
@ApiModelProperty("实时值")
private BigDecimal currentTimeValue;
@ApiModelProperty("累计值")
private BigDecimal totalValue;
public BeltWeigherValue(Long id, String key, BigDecimal currentTimeValue, BigDecimal totalValue) {
this.id = id;
this.key = key;
this.currentTimeValue = currentTimeValue;
this.totalValue = totalValue;
}
public BeltWeigherValue() {
}
}
@Data
@ApiModel("实时值累计值,不能修改,例:皮带秤")
public static class Parameter{
@ApiModelProperty("设备名")
private String title;
@ApiModelProperty("参数")
private List<ParameterThreshold> values;
}
@Data
@ApiModel("单个仪器的参数带阀值")
public static class ParameterThreshold{
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("修改时用的类型")
private String type;
@ApiModelProperty("实时")
private String key;
@ApiModelProperty("实时值")
private BigDecimal currentTimeValue;
@ApiModelProperty("阀值1")
private ThresholdValue thresholdValue1;
@ApiModelProperty("阀值2")
private ThresholdValue thresholdValue2;
@ApiModelProperty("阀值3")
private ThresholdValue thresholdValue3;
public ParameterThreshold(Long id, String type, String key, BigDecimal currentTimeValue, ThresholdValue thresholdValue1, ThresholdValue thresholdValue2, ThresholdValue thresholdValue3) {
this.id = id;
this.type = type;
this.key = key;
this.currentTimeValue = currentTimeValue;
this.thresholdValue1 = thresholdValue1;
this.thresholdValue2 = thresholdValue2;
this.thresholdValue3 = thresholdValue3;
}
public ParameterThreshold() {
}
}
@Data
@ApiModel("阀值")
public static class ThresholdValue{
@ApiModelProperty("id")
private Long id = 1L;
@ApiModelProperty("修改时用的类型")
private String type;
@ApiModelProperty("key")
private String key;
@ApiModelProperty("最小")
private BigDecimal minValue;
@ApiModelProperty("最打")
private BigDecimal maxValue;
public ThresholdValue(BigDecimal minValue, BigDecimal maxValue) {
this.minValue = minValue;
this.maxValue = maxValue;
}
public ThresholdValue() {
}
}
}

22
beneficiation/src/main/java/com/ccsens/beneficiation/service/IParameterService.java

@ -0,0 +1,22 @@
package com.ccsens.beneficiation.service;
import com.ccsens.beneficiation.bean.dto.ParameterDto;
import com.ccsens.beneficiation.bean.vo.ParameterVo;
/**
* @author
*/
public interface IParameterService {
/**
* 查询每个设备的参数
* @param param 没有参数
* @return 返回每个设备的数据
*/
ParameterVo.QueryParameter queryParameter(Object param);
/**
* 修改一起的参数
* @param param 参数
*/
void updateParameter(ParameterDto.ParameterInfo param);
}

106
beneficiation/src/main/java/com/ccsens/beneficiation/service/ParameterService.java

@ -0,0 +1,106 @@
package com.ccsens.beneficiation.service;
import com.ccsens.beneficiation.bean.dto.ParameterDto;
import com.ccsens.beneficiation.bean.vo.ParameterVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* @author
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class ParameterService implements IParameterService{
@Override
public ParameterVo.QueryParameter queryParameter(Object param) {
ParameterVo.QueryParameter parameterInfo = new ParameterVo.QueryParameter();
List<ParameterVo.TransducerValue> transducerValues = new ArrayList<>();
ParameterVo.TransducerValue transducer1 = new ParameterVo.TransducerValue(6L,"transducer1","实时/设置1", BigDecimal.valueOf(45));
ParameterVo.TransducerValue transducer2 = new ParameterVo.TransducerValue(7L,"transducer2","实时/设置2", BigDecimal.valueOf(8));
ParameterVo.TransducerValue transducer3 = new ParameterVo.TransducerValue(8L,"transducer3","实时/设置3", BigDecimal.valueOf(67));
ParameterVo.TransducerValue transducer4 = new ParameterVo.TransducerValue(10L,"transducer4","实时/设置4", BigDecimal.valueOf(75));
transducerValues.add(transducer1);
transducerValues.add(transducer2);
transducerValues.add(transducer3);
transducerValues.add(transducer4);
List<ParameterVo.Transducer> transducers = new ArrayList<>();
ParameterVo.Transducer transducer = new ParameterVo.Transducer();
transducer.setTitle("变频器");
transducer.setValues(transducerValues);
transducers.add(transducer);
List<ParameterVo.TransducerValue> transducerValues1 = new ArrayList<>();
ParameterVo.TransducerValue transducer11 = new ParameterVo.TransducerValue(6L,"solenoidValue1","实时/设置1", BigDecimal.valueOf(45));
ParameterVo.TransducerValue transducer21 = new ParameterVo.TransducerValue(7L,"solenoidValue2","实时/设置2", BigDecimal.valueOf(8));
transducerValues1.add(transducer11);
transducerValues1.add(transducer21);
List<ParameterVo.Transducer> transducers2 = new ArrayList<>();
ParameterVo.Transducer transducer12 = new ParameterVo.Transducer();
transducer12.setTitle("电磁阀");
transducer12.setValues(transducerValues);
transducers2.add(transducer12);
parameterInfo.setTransducers(transducers2);
List<ParameterVo.BeltWeigher> beltWeighers1 = new ArrayList<>();
ParameterVo.BeltWeigher beltWeigher1 = new ParameterVo.BeltWeigher();
beltWeigher1.setTitle("皮带秤");
List<ParameterVo.BeltWeigherValue> beltWeigherValueList1 = new ArrayList<>();
ParameterVo.BeltWeigherValue beltWeigher01 = new ParameterVo.BeltWeigherValue(1L,"实时/累计", BigDecimal.valueOf(12),BigDecimal.valueOf(1212));
beltWeigherValueList1.add(beltWeigher01);
beltWeigher1.setValues(beltWeigherValueList1);
beltWeighers1.add(beltWeigher1);
parameterInfo.setBeltWeigher(beltWeighers1);
List<ParameterVo.BeltWeigher> beltWeighers2 = new ArrayList<>();
ParameterVo.BeltWeigher beltWeigher2 = new ParameterVo.BeltWeigher();
beltWeigher2.setTitle("流量计");
List<ParameterVo.BeltWeigherValue> beltWeigherValueList2 = new ArrayList<>();
ParameterVo.BeltWeigherValue beltWeigher02 = new ParameterVo.BeltWeigherValue(2L,"实时/累计", BigDecimal.valueOf(16),BigDecimal.valueOf(1524));
ParameterVo.BeltWeigherValue beltWeigher03 = new ParameterVo.BeltWeigherValue(3L,"实时/累计", BigDecimal.valueOf(5),BigDecimal.valueOf(232));
beltWeigherValueList2.add(beltWeigher02);
beltWeigherValueList2.add(beltWeigher03);
beltWeigher2.setValues(beltWeigherValueList2);
beltWeighers2.add(beltWeigher2);
parameterInfo.setBeltWeigher(beltWeighers2);
List<ParameterVo.Parameter> parameters = new ArrayList<>();
ParameterVo.Parameter parameter = new ParameterVo.Parameter();
parameter.setTitle("电耳");
List<ParameterVo.ParameterThreshold> parameterThresholds = new ArrayList<>();
ParameterVo.ParameterThreshold parameterThreshold1 = new ParameterVo.ParameterThreshold(11L,"实时","electricEar1",BigDecimal.valueOf(60),
new ParameterVo.ThresholdValue(BigDecimal.valueOf(20),BigDecimal.valueOf(60)),
new ParameterVo.ThresholdValue(BigDecimal.valueOf(30),BigDecimal.valueOf(70)),
new ParameterVo.ThresholdValue(BigDecimal.valueOf(40),BigDecimal.valueOf(80)));
ParameterVo.ParameterThreshold parameterThreshold2 = new ParameterVo.ParameterThreshold(12L,"实时","electricEar1",BigDecimal.valueOf(65),
new ParameterVo.ThresholdValue(BigDecimal.valueOf(30),BigDecimal.valueOf(70)),
new ParameterVo.ThresholdValue(BigDecimal.valueOf(40),BigDecimal.valueOf(80)),
new ParameterVo.ThresholdValue(BigDecimal.valueOf(50),BigDecimal.valueOf(90)));
parameterThresholds.add(parameterThreshold1);
parameterThresholds.add(parameterThreshold2);
parameter.setValues(parameterThresholds);
parameterInfo.setParameter(parameters);
return parameterInfo;
}
@Override
public void updateParameter(ParameterDto.ParameterInfo param) {
}
}

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

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

124
cloudutil/src/main/resources/application-util-green.yml

@ -0,0 +1,124 @@
#<<<<<<< HEAD
##服务端点暴露
#management:
# endpoints:
# web:
# exposure:
# # 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*'
# include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream
## # 不暴露哪些端点
## exclude: env,beans,configprops
# endpoint:
# health:
# # 是否展示健康检查详情
# show-details: always
# health:
# redis:
# enabled: false
##eureka注册
#eureka:
# client:
# service-url:
# # 指定eureka server通信地址,注意/eureka/小尾巴不能少
# #defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/
## defaultZone: http://admin:admin@49.233.89.188:7010/eureka/
# defaultZone: http://admin:admin@192.168.0.99:7010/eureka/
# instance:
# # 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server
# prefer-ip-address: true
# metadata-map:
# management:
# context-path: ${server.servlet.context-path:}/actuator
# home-page-url-path: ${server.servlet.context-path:}/
# status-page-url-path: ${server.servlet.context-path:}/actuator/info
# health-check-url-path: ${server.servlet.context-path:}/actuator/health
#feign:
# client:
# config:
# default:
# connectTime: 5000
# readTimeout: 5000
# # NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。
# # BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。
# # HEADERS:记录BASIC级别的基础上,记录请求和响应的header。
# # FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据
# loggerLevel: basic
# hystrix:
# enabled: true
## sleuth
#logging:
# level:
# root: info
# org.springframework.cloud.sleuth: DEBUG
#spring:
## zipkin:
## base-url: http://49.233.89.188:9411
## sleuth:
## sampler:
## # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。
## probability: 1.0
# cloud:
# inetutils:
#=======
#服务端点暴露
management:
endpoints:
web:
exposure:
# 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*'
include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream
# # 不暴露哪些端点
# exclude: env,beans,configprops
endpoint:
health:
# 是否展示健康检查详情
show-details: always
health:
redis:
enabled: false
#eureka注册
eureka:
client:
service-url:
# 指定eureka server通信地址,注意/eureka/小尾巴不能少
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/
defaultZone: http://admin:admin@49.232.6.143:7010/eureka/
# defaultZone: http://admin:admin@192.168.0.99:7010/eureka/
# defaultZone: http://admin:admin@test.tall.wiki:7010/eureka/
instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server
prefer-ip-address: true
metadata-map:
management:
context-path: ${server.servlet.context-path:}/actuator
home-page-url-path: ${server.servlet.context-path:}/
status-page-url-path: ${server.servlet.context-path:}/actuator/info
health-check-url-path: ${server.servlet.context-path:}/actuator/health
feign:
client:
config:
default:
connectTime: 5000
readTimeout: 5000
# NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。
# BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。
# HEADERS:记录BASIC级别的基础上,记录请求和响应的header。
# FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据
loggerLevel: basic
hystrix:
enabled: true
# sleuth
logging:
level:
root: info
org.springframework.cloud.sleuth: DEBUG
spring:
# zipkin:
# base-url: http://49.233.89.188:9411
# sleuth:
# sampler:
# # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。
# probability: 1.0
cloud:
inetutils:
ignored-interfaces: ['VMware.*']

53
cloudutil/src/main/resources/application-util-greenvalley.yml

@ -0,0 +1,53 @@
#服务端点暴露
management:
endpoints:
web:
exposure:
# 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*'
include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream
# # 不暴露哪些端点
# exclude: env,beans,configprops
endpoint:
health:
# 是否展示健康检查详情
show-details: always
health:
redis:
enabled: false
#eureka注册
eureka:
client:
service-url:
# 指定eureka server通信地址,注意/eureka/小尾巴不能少
defaultZone: http://admin:admin@82.156.116.247:7010/eureka/
instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server
prefer-ip-address: true
metadata-map:
management:
context-path: ${server.servlet.context-path:}/actuator
home-page-url-path: ${server.servlet.context-path:}/
status-page-url-path: ${server.servlet.context-path:}/actuator/info
health-check-url-path: ${server.servlet.context-path:}/actuator/health
feign:
client:
config:
default:
connectTime: 5000
readTimeout: 5000
# NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。
# BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。
# HEADERS:记录BASIC级别的基础上,记录请求和响应的header。
# FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据
loggerLevel: basic
hystrix:
enabled: true
# sleuth
logging:
level:
root: info
org.springframework.cloud.sleuth: DEBUG
spring:
cloud:
inetutils:
ignored-interfaces: ['VMware.*']

3
cloudutil/src/main/resources/application-util-test.yml

@ -82,7 +82,8 @@ eureka:
service-url:
# 指定eureka server通信地址,注意/eureka/小尾巴不能少
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/
defaultZone: http://admin:admin@49.232.6.143:7010/eureka/
# defaultZone: http://admin:admin@49.232.6.143:7010/eureka/
defaultZone: http://admin:admin@192.168.0.99:7010/eureka/
# defaultZone: http://admin:admin@test.tall.wiki:7010/eureka/
instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server

3
tall/src/main/java/com/ccsens/tall/service/ExcelService.java

@ -1097,7 +1097,8 @@ public class ExcelService implements IExcelService {
if(ObjectUtil.isNull(roleRow)){
throw new BaseException(CodeEnum.NOT_ROW.addMsg(sheet.getSheetName() + (2)));
}
for (int i = 3; i < sheet.getLastRowNum(); i++) {
for (int i = 2; i < sheet.getLastRowNum() + 1; i++) {
List<ProTaskDetail> taskNameList = null;
XSSFRow pluginRow = sheet.getRow(i);
if(ObjectUtil.isNull(pluginRow)){

10
tall/src/main/java/com/ccsens/tall/service/ITaskPluginService.java

@ -6,6 +6,7 @@ import com.ccsens.tall.bean.vo.PluginVo;
import com.ccsens.tall.bean.vo.TaskVo;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
/**
@ -85,4 +86,13 @@ public interface ITaskPluginService {
* @return 返回文件的访问路径下载路径和文件id
*/
List<PluginVo.MinutesInfo> saveMinutesDay(Long currentUserId, PluginDto.GetMinutesDay getMinutesDay, String token) throws FileNotFoundException, Exception;
/**
* 打开Excel
* @param taskId 任务id
* @param token token
* @param currentUserId userId
* @return 返回excel路径
*/
PluginVo.MinutesInfo openExcel(Long taskId, String token, Long currentUserId) throws IOException, Exception;
}

39
tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java

@ -983,4 +983,43 @@ public class TaskPluginService implements ITaskPluginService{
minutesInfoList.add(minutesInfo);
});
}
@Override
public PluginVo.MinutesInfo openExcel(Long taskId, String token, Long currentUserId) throws Exception {
//查询此任务是否有关联的excel,有直接返回
List<PluginVo.MinutesInfo> minutesInfoList = new ArrayList<>();
List<String> wpsPath = wpsService.queryVisitUrls(taskId,(byte) 11,token,null);
if(CollectionUtil.isNotEmpty(wpsPath)){
minutesInfo(taskId, minutesInfoList, wpsPath);
return minutesInfoList.get(0);
}
//没有则新建一个空白excel
Workbook wb = new XSSFWorkbook();
//生成文件
String name = System.currentTimeMillis() + ".xlsx";
String fileName = "excel/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".xlsx";
File tmpFile = saveFile(wb, fileName);
//关联wps
WpsDto.Business business = new WpsDto.Business();
business.setBusinessId(taskId);
business.setBusinessType((byte) 11);
business.setUserId(currentUserId);
business.setFileName(name);
business.setFilePath(fileName);
business.setRealFilePath(PropUtil.path + File.separator + fileName);
business.setFileSize(tmpFile.length());
business.setOperation(WebConstant.Wps.USER_OPERATION_NEW);
business.setPrivilege(WebConstant.Wps.PROJECT_PRIVILEGE_WRITE);
business.setPrivilegeQueryUrl(PropUtil.domain + "v1/3rd/wpsPower");
wpsService.saveFile(business);
//获取wps文件的路径并返回
wpsPath = wpsService.queryVisitUrls(taskId,(byte) 11,token,null);
if(CollectionUtil.isNotEmpty(wpsPath)){
minutesInfo(taskId, minutesInfoList, wpsPath);
}
if(CollectionUtil.isEmpty(minutesInfoList)) {
return null;
}
return minutesInfoList.get(0);
}
}

16
tall/src/main/java/com/ccsens/tall/web/PluginController.java

@ -1,6 +1,7 @@
package com.ccsens.tall.web;
import com.ccsens.tall.bean.dto.PluginDto;
import com.ccsens.tall.bean.dto.TaskDto;
import com.ccsens.tall.bean.dto.WeekMeetingDto;
import com.ccsens.tall.bean.vo.PluginVo;
import com.ccsens.tall.bean.vo.TaskVo;
@ -9,6 +10,7 @@ import com.ccsens.tall.service.ITaskPluginService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import com.ccsens.util.annotation.OperateType;
import com.ccsens.util.bean.dto.QueryDto;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
@ -222,4 +224,18 @@ public class PluginController {
log.info("生成每日会议纪要完成");
return JsonResponse.newInstance().ok(wpsPath);
}
@ApiOperation(value = "打开excel", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/openExcel", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PluginVo.MinutesInfo> openExcel(HttpServletRequest request,@RequestParam(required = true) Long taskId) throws Exception {
log.info("打开excel:{}",taskId);
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN);
String token = authHeader.substring(WebConstant.HEADER_KEY_TOKEN_PREFIX.length());
PluginVo.MinutesInfo path = taskPluginService.openExcel(taskId,token,currentUserId);
log.info("excel的路径:{}",path);
return JsonResponse.newInstance().ok(path);
}
}

2
tall/src/main/java/com/ccsens/tall/web/ProjectController.java

@ -218,7 +218,7 @@ public class ProjectController {
@ApiImplicitParams({
})
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse createProject(HttpServletRequest request,@RequestBody ProjectDto.CreateProject createProject) throws Exception {
public JsonResponse<ProjectVo.ProjectInfo> createProject(HttpServletRequest request,@RequestBody ProjectDto.CreateProject createProject) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN);
String token = authHeader.substring(WebConstant.HEADER_KEY_TOKEN_PREFIX.length());

39
tall/src/main/resources/application-greenvalley.yml

@ -0,0 +1,39 @@
server:
port: 7030
servlet:
context-path: /v1.0
spring:
snowflake:
datacenterId: 1
workerId: 1
application:
name: tall
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: 127.0.0.1
password: admin
port: 5672
username: 111111
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: true
eureka:
instance:
ip-address: 82.156.116.247
gatewayUrl: http://82.156.116.247 /gateway/
notGatewayUrl: http://82.156.116.247 /
file:
domain: http://82.156.116.247 /gateway/tall/v1.0/
imgDomain: http://82.156.116.247 /gateway/tall/v1.0/uploads

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

@ -1,5 +1,5 @@
spring:
profiles:
active: test
include: util-test,common
active: dev
include: util-dev,common

33
tall/src/main/resources/druid-greenvalley.yml

@ -0,0 +1,33 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password: 6ba13d9930a6ad888a3704376c920a75
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://49.232.6.143:3306/tall?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_GREENVALLEY

17
tcm/src/main/java/com/ccsens/tcm/api/ImportController.java

@ -62,6 +62,23 @@ public class ImportController {
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "导入病史相关",notes = "文件大小不能超过20M,支持后缀:.xls|.xlsx")
@ApiImplicitParams({})
@RequestMapping(value = "/all", method = RequestMethod.POST)
public JsonResponse importAll(@RequestParam(required = true) Part file) throws Exception{
//1.上传文件
String allowedExts = "xls,xlsx";
String dir = PropUtil.path;
String path = UploadFileUtil_Servlet3.uploadFile(file, allowedExts, dir);
File excelFile = new File(dir+path);
importService.importAll(excelFile);
log.info("导入病史相关成功");
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "更新redis内的试题",notes = "")
@ApiImplicitParams({})
@RequestMapping(value = "/updateRedis", method = RequestMethod.POST)

20
tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java

@ -109,22 +109,20 @@ public class QuestionVo {
private String remark;
@ApiModelProperty("记录类型 0:只记录1次数据,1:记录3次,分别为0,14,90天 ,2:记录两次,分别是180,365")
private byte reportType;
// @ApiModelProperty("题目信息")
// private List<PatientQuestionNum> questionNums;
@ApiModelProperty("题目信息")
private List<PatientQuestion> questionVos;
@ApiModelProperty("子类型")
private List<PatientCode> optionVos;
private List<PatientCode> subReportCodes;
}
@Data
@ApiModel("患者多次答题信息")
public static class PatientQuestionNum {
@ApiModelProperty("第几次记录,默认为0代表第一次记录,14代表第14天记录的信息")
private Integer reportNums;
@ApiModelProperty("题目信息")
private List<PatientQuestion> questionList;
}
// @Data
// @ApiModel("患者多次答题信息")
// public static class PatientQuestionNum {
// @ApiModelProperty("第几次记录,默认为0代表第一次记录,14代表第14天记录的信息")
// private Integer reportNums;
// @ApiModelProperty("题目信息")
// private List<PatientQuestion> questionList;
// }
@Data

6
tcm/src/main/java/com/ccsens/tcm/persist/dao/ReportCodeDao.java

@ -31,4 +31,10 @@ public interface ReportCodeDao extends ReportCodeMapper {
* @return 返回类型详细信息
*/
List<QuestionVo.PatientCode> selectCodeByCode(@Param("code") String code);
/**
*
* @return
*/
List<String> queryCodeAll();
}

6
tcm/src/main/java/com/ccsens/tcm/service/IImportService.java

@ -34,4 +34,10 @@ public interface IImportService {
* @param param code
*/
List<QuestionVo.ReportCodeVo> getQuestion(CodeVo.QuestionCode param);
/**
* 导入全部
* @param excelFile
*/
void importAll(File excelFile) throws Exception;
}

18
tcm/src/main/java/com/ccsens/tcm/service/ImportService.java

@ -328,4 +328,22 @@ public class ImportService implements IImportService {
}
return reportCode;
}
@Override
public void importAll(File excelFile) throws Exception {
log.info("导入全部试题参数:{}", excelFile);
List<String> types = new ArrayList<>();
//查询所有试题类型
List<String> typeAll = reportCodeDao.queryCodeAll();
if(CollectionUtil.isNotEmpty(typeAll)){
types.addAll(typeAll);
}
log.info("导入试题类型:{}", types);
for (String sheetName: types) {
List<Object[]> questions = PoiUtil.readExce(excelFile, -1, sheetName,1, true);
saveQuestions(questions);
}
}
}

49
tcm/src/main/resources/application-green.yml

@ -0,0 +1,49 @@
server:
port: 7150
servlet:
context-path:
spring:
application:
name: tcm
datasource:
type: com.alibaba.druid.pool.DruidDataSource
# rabbitmq:
# host: 127.0.0.1
# password: 111111
# port: 5672
# username: admin
rabbitmq:
host: 127.0.0.1
password: guest
port: 5672
username: guest
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: true
eureka:
instance:
ip-address: 49.232.6.143
file:
path: /home/cloud/tcm/uploads/
domain: https://www.sxwikionline.com/gateway/tcm/
imgDomain: https://www.sxwikionline.com/gateway/tcm/uploads/
day:
one: 9
two: 30
oneFront: 0
oneAfter: 14
twoAfter: 90
three: 270
threeFront: 180
threeAfter: 365

2
tcm/src/main/resources/application-test.yml

@ -28,7 +28,7 @@ swagger:
enable: true
eureka:
instance:
ip-address: 49.232.6.143
ip-address: 192.168.0.99
file:
path: /home/cloud/tcm/uploads/
domain: https://www.sxwikionline.com/gateway/tcm/

33
tcm/src/main/resources/druid-green.yml

@ -0,0 +1,33 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password:
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://127.0.0.1/tcm?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_TALL

4
tcm/src/main/resources/druid-test.yml

@ -15,7 +15,7 @@ spring:
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password:
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
@ -27,7 +27,7 @@ spring:
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://127.0.0.1/tcm?useUnicode=true&characterEncoding=UTF-8
url: jdbc:mysql://test.tall.wiki/tcm?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_TALL

5
tcm/src/main/resources/mapper_dao/ReportCodeDao.xml

@ -96,7 +96,7 @@
<result column="fSort" jdbcType="INTEGER" property="sort" />
<result column="fRemark" jdbcType="VARCHAR" property="remark" />
<result column="fReportType" jdbcType="TINYINT" property="reportType" />
<collection property="subCodes" ofType="com.ccsens.tcm.bean.vo.QuestionVo$PatientCode">
<collection property="subReportCodes" ofType="com.ccsens.tcm.bean.vo.QuestionVo$PatientCode">
<id column="sId" jdbcType="BIGINT" property="id" />
<result column="sCode" jdbcType="VARCHAR" property="code" />
<result column="sName" jdbcType="VARCHAR" property="name" />
@ -141,6 +141,9 @@
and (c1.`code` = #{code} or c2.`code` = #{code})
</if>
</select>
<select id="queryCodeAll" resultType="java.lang.String">
SELECT `code` FROM `t_report_code` WHERE rec_status = 0
</select>
</mapper>

3
util/src/main/java/com/ccsens/util/JsonResponse.java

@ -53,6 +53,9 @@ public class JsonResponse<T> {
public static JsonResponse newInstance(){
return new JsonResponse();
}
// public static JsonResponse newInstance(Class T){
// return new JsonResponse<T>();
// }
public JsonResponse ok(){
this.code = CodeEnum.SUCCESS.getCode();

3
util/src/main/java/com/ccsens/util/PoiUtil.java

@ -314,6 +314,9 @@ public class PoiUtil {
List<Object[]> list = new ArrayList<>();
Sheet sheet = createSheet(file, sheetIndex, sheetName);
if(ObjectUtil.isNull(sheet)){
return list;
}
//读取放在首列的图片
Map<String, String> imgMap = null;
if (hasImg) {

Loading…
Cancel
Save