Browse Source

20210301修改选矿

recovery
zy_Java 4 years ago
parent
commit
7d346ac851
  1. 6
      beneficiation/src/main/java/com/ccsens/beneficiation/api/ParameterController.java
  2. 124
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/vo/ParameterVo.java
  3. 2
      beneficiation/src/main/java/com/ccsens/beneficiation/service/IParameterService.java
  4. 98
      beneficiation/src/main/java/com/ccsens/beneficiation/service/ParameterService.java
  5. 124
      cloudutil/src/main/resources/application-util-green.yml
  6. 53
      cloudutil/src/main/resources/application-util-greenvalley.yml
  7. 3
      cloudutil/src/main/resources/application-util-test.yml
  8. 39
      tall/src/main/resources/application-greenvalley.yml
  9. 33
      tall/src/main/resources/druid-greenvalley.yml
  10. 17
      tcm/src/main/java/com/ccsens/tcm/api/ImportController.java
  11. 6
      tcm/src/main/java/com/ccsens/tcm/persist/dao/ReportCodeDao.java
  12. 6
      tcm/src/main/java/com/ccsens/tcm/service/IImportService.java
  13. 18
      tcm/src/main/java/com/ccsens/tcm/service/ImportService.java
  14. 49
      tcm/src/main/resources/application-green.yml
  15. 2
      tcm/src/main/resources/application-test.yml
  16. 33
      tcm/src/main/resources/druid-green.yml
  17. 4
      tcm/src/main/resources/druid-test.yml
  18. 3
      tcm/src/main/resources/mapper_dao/ReportCodeDao.xml
  19. 3
      util/src/main/java/com/ccsens/util/PoiUtil.java

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

@ -24,7 +24,7 @@ import javax.annotation.Resource;
* @author * @author
*/ */
@Slf4j @Slf4j
@Api(tags = "皮带秤每天上传的重量统计相关" , description = "") @Api(tags = "查看设置参数" , description = "")
@RestController @RestController
@RequestMapping("/parameter") @RequestMapping("/parameter")
public class ParameterController { public class ParameterController {
@ -34,9 +34,9 @@ public class ParameterController {
@MustLogin @MustLogin
@ApiOperation(value = "查看各个设备的参数", notes = "") @ApiOperation(value = "查看各个设备的参数", notes = "")
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) @RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ParameterVo.ParameterInfo> queryParameter(@ApiParam @Validated @RequestBody QueryDto params) { public JsonResponse<ParameterVo.QueryParameter> queryParameter(@ApiParam @Validated @RequestBody QueryDto params) {
log.info("查看各个设备的参数:{}",params); log.info("查看各个设备的参数:{}",params);
ParameterVo.ParameterInfo parameterInfo = parameterService.queryParameter(params.getParam()); ParameterVo.QueryParameter parameterInfo = parameterService.queryParameter(params.getParam());
log.info("各个设备的参数:{}",parameterInfo); log.info("各个设备的参数:{}",parameterInfo);
return JsonResponse.newInstance().ok(parameterInfo); return JsonResponse.newInstance().ok(parameterInfo);
} }

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

@ -5,81 +5,121 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
/** /**
* @author * @author
*/ */
@Data @Data
public class ParameterVo { public class ParameterVo {
@Data @Data
@ApiModel("查看每个仪器的参数") @ApiModel("查看每个仪器的参数")
public static class ParameterInfo{ public static class QueryParameter{
@ApiModelProperty("皮带秤") @ApiModelProperty("只有实时值 能修改,例:变频器")
private Parameter beltWeigher; private List<Transducer> transducers;
@ApiModelProperty("电耳1") @ApiModelProperty("实时值累计值,不能修改,例:皮带秤")
private ParameterThreshold electricEar1; private List<BeltWeigher> beltWeigher;
@ApiModelProperty("电耳2") @ApiModelProperty("有阀值能设置 例:电耳")
private ParameterThreshold electricEar2; private List<Parameter> parameter;
@ApiModelProperty("电磁阀1")
private Parameter solenoidValue1;
@ApiModelProperty("电磁阀2")
private Parameter solenoidValue2;
@ApiModelProperty("流量计1")
private Parameter flowmeter1;
@ApiModelProperty("流量计1")
private Parameter flowmeter2;
@ApiModelProperty("变频器1")
private Parameter transducer1;
@ApiModelProperty("变频器2")
private Parameter transducer2;
@ApiModelProperty("变频器3")
private Parameter transducer3;
@ApiModelProperty("变频器4")
private Parameter transducer4;
} }
@Data @Data
@ApiModel("单个仪器的参数") @ApiModel("只有实时值 能修改,例:变频器")
public static class Parameter{ public static class Transducer{
@ApiModelProperty("设备名")
private String title;
@ApiModelProperty("参数")
private List<TransducerValue> values;
}
@Data
@ApiModel("只有实时值 能修改,例:变频器")
public static class TransducerValue{
@ApiModelProperty("id") @ApiModelProperty("id")
private Long id; private Long id;
@ApiModelProperty("修改时用的类型")
private String type;
@ApiModelProperty("名字") @ApiModelProperty("名字")
private String name; 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("实时值") @ApiModelProperty("实时值")
private BigDecimal currentTimeValue; private BigDecimal currentTimeValue;
@ApiModelProperty("累计值") @ApiModelProperty("累计值")
private BigDecimal totalValue; private BigDecimal totalValue;
public Parameter(Long id, String name, BigDecimal currentTimeValue, BigDecimal totalValue) { public BeltWeigherValue(Long id, String key, BigDecimal currentTimeValue, BigDecimal totalValue) {
this.id = id; this.id = id;
this.name = name; this.key = key;
this.currentTimeValue = currentTimeValue; this.currentTimeValue = currentTimeValue;
this.totalValue = totalValue; this.totalValue = totalValue;
} }
public Parameter() { public BeltWeigherValue() {
} }
} }
@Data
@ApiModel("实时值累计值,不能修改,例:皮带秤")
public static class Parameter{
@ApiModelProperty("设备名")
private String title;
@ApiModelProperty("参数")
private List<ParameterThreshold> values;
}
@Data @Data
@ApiModel("单个仪器的参数带阀值") @ApiModel("单个仪器的参数带阀值")
public static class ParameterThreshold{ public static class ParameterThreshold{
@ApiModelProperty("id") @ApiModelProperty("id")
private Long id; private Long id;
@ApiModelProperty("名字") @ApiModelProperty("修改时用的类型")
private String name; private String type;
@ApiModelProperty("实时")
private String key;
@ApiModelProperty("实时值") @ApiModelProperty("实时值")
private BigDecimal currentTimeValue; private BigDecimal currentTimeValue;
@ApiModelProperty("阀值1") @ApiModelProperty("阀值1")
private Threshold thresholdValue1; private ThresholdValue thresholdValue1;
@ApiModelProperty("阀值2") @ApiModelProperty("阀值2")
private Threshold thresholdValue2; private ThresholdValue thresholdValue2;
@ApiModelProperty("阀值3") @ApiModelProperty("阀值3")
private Threshold thresholdValue3; private ThresholdValue thresholdValue3;
public ParameterThreshold(Long id, String name, BigDecimal currentTimeValue, Threshold thresholdValue1, Threshold thresholdValue2, Threshold thresholdValue3) { public ParameterThreshold(Long id, String type, String key, BigDecimal currentTimeValue, ThresholdValue thresholdValue1, ThresholdValue thresholdValue2, ThresholdValue thresholdValue3) {
this.id = id; this.id = id;
this.name = name; this.type = type;
this.key = key;
this.currentTimeValue = currentTimeValue; this.currentTimeValue = currentTimeValue;
this.thresholdValue1 = thresholdValue1; this.thresholdValue1 = thresholdValue1;
this.thresholdValue2 = thresholdValue2; this.thresholdValue2 = thresholdValue2;
@ -91,18 +131,24 @@ public class ParameterVo {
} }
@Data @Data
@ApiModel("阀值") @ApiModel("阀值")
public static class Threshold{ public static class ThresholdValue{
@ApiModelProperty("id")
private Long id = 1L;
@ApiModelProperty("修改时用的类型")
private String type;
@ApiModelProperty("key")
private String key;
@ApiModelProperty("最小") @ApiModelProperty("最小")
private BigDecimal minValue; private BigDecimal minValue;
@ApiModelProperty("最打") @ApiModelProperty("最打")
private BigDecimal maxValue; private BigDecimal maxValue;
public Threshold(BigDecimal minValue, BigDecimal maxValue) { public ThresholdValue(BigDecimal minValue, BigDecimal maxValue) {
this.minValue = minValue; this.minValue = minValue;
this.maxValue = maxValue; this.maxValue = maxValue;
} }
public Threshold() { public ThresholdValue() {
} }
} }

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

@ -12,7 +12,7 @@ public interface IParameterService {
* @param param 没有参数 * @param param 没有参数
* @return 返回每个设备的数据 * @return 返回每个设备的数据
*/ */
ParameterVo.ParameterInfo queryParameter(Object param); ParameterVo.QueryParameter queryParameter(Object param);
/** /**
* 修改一起的参数 * 修改一起的参数

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

@ -8,6 +8,8 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/** /**
* @author * @author
@ -18,28 +20,82 @@ import java.math.BigDecimal;
public class ParameterService implements IParameterService{ public class ParameterService implements IParameterService{
@Override @Override
public ParameterVo.ParameterInfo queryParameter(Object param) { public ParameterVo.QueryParameter queryParameter(Object param) {
ParameterVo.ParameterInfo parameterInfo = new ParameterVo.ParameterInfo(); ParameterVo.QueryParameter parameterInfo = new ParameterVo.QueryParameter();
parameterInfo.setBeltWeigher(new ParameterVo.Parameter(1L,"皮带秤", BigDecimal.valueOf(12),BigDecimal.valueOf(1212)));
parameterInfo.setFlowmeter1(new ParameterVo.Parameter(2L,"流量计1", BigDecimal.valueOf(16),BigDecimal.valueOf(1524)));
parameterInfo.setFlowmeter2(new ParameterVo.Parameter(3L,"流量计2", BigDecimal.valueOf(5),BigDecimal.valueOf(232)));
parameterInfo.setSolenoidValue1(new ParameterVo.Parameter(4L,"电磁阀1", BigDecimal.valueOf(84),null));
parameterInfo.setSolenoidValue2(new ParameterVo.Parameter(5L,"电磁阀2", BigDecimal.valueOf(95),null));
parameterInfo.setTransducer1(new ParameterVo.Parameter(6L,"变频器1", BigDecimal.valueOf(45),null));
parameterInfo.setTransducer2(new ParameterVo.Parameter(7L,"变频器2", BigDecimal.valueOf(8),null));
parameterInfo.setTransducer3(new ParameterVo.Parameter(8L,"变频器3", BigDecimal.valueOf(67),null));
parameterInfo.setTransducer4(new ParameterVo.Parameter(10L,"变频器4", BigDecimal.valueOf(75),null));
parameterInfo.setElectricEar1(new ParameterVo.ParameterThreshold(11L,"电耳1",BigDecimal.valueOf(60),
new ParameterVo.Threshold(BigDecimal.valueOf(20),BigDecimal.valueOf(60)),
new ParameterVo.Threshold(BigDecimal.valueOf(30),BigDecimal.valueOf(70)),
new ParameterVo.Threshold(BigDecimal.valueOf(40),BigDecimal.valueOf(80))));
parameterInfo.setElectricEar1(new ParameterVo.ParameterThreshold(12L,"电耳2",BigDecimal.valueOf(65),
new ParameterVo.Threshold(BigDecimal.valueOf(30),BigDecimal.valueOf(70)),
new ParameterVo.Threshold(BigDecimal.valueOf(40),BigDecimal.valueOf(80)),
new ParameterVo.Threshold(BigDecimal.valueOf(50),BigDecimal.valueOf(90))));
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; return parameterInfo;
} }

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

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

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(); 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 = "") @ApiOperation(value = "更新redis内的试题",notes = "")
@ApiImplicitParams({}) @ApiImplicitParams({})
@RequestMapping(value = "/updateRedis", method = RequestMethod.POST) @RequestMapping(value = "/updateRedis", method = RequestMethod.POST)

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

@ -31,4 +31,10 @@ public interface ReportCodeDao extends ReportCodeMapper {
* @return 返回类型详细信息 * @return 返回类型详细信息
*/ */
List<QuestionVo.PatientCode> selectCodeByCode(@Param("code") String code); 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 * @param param code
*/ */
List<QuestionVo.ReportCodeVo> getQuestion(CodeVo.QuestionCode param); 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; 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 enable: true
eureka: eureka:
instance: instance:
ip-address: 49.232.6.143 ip-address: 192.168.0.99
file: file:
path: /home/cloud/tcm/uploads/ path: /home/cloud/tcm/uploads/
domain: https://www.sxwikionline.com/gateway/tcm/ 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 maxWait: 60000
minEvictableIdleTimeMillis: 300000 minEvictableIdleTimeMillis: 300000
minIdle: 5 minIdle: 5
password: password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473
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/tcm?useUnicode=true&characterEncoding=UTF-8 url: jdbc:mysql://test.tall.wiki/tcm?useUnicode=true&characterEncoding=UTF-8
username: root username: root
validationQuery: SELECT 1 FROM DUAL validationQuery: SELECT 1 FROM DUAL
env: CCSENS_TALL env: CCSENS_TALL

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

@ -141,6 +141,9 @@
and (c1.`code` = #{code} or c2.`code` = #{code}) and (c1.`code` = #{code} or c2.`code` = #{code})
</if> </if>
</select> </select>
<select id="queryCodeAll" resultType="java.lang.String">
SELECT `code` FROM `t_report_code` WHERE rec_status = 0
</select>
</mapper> </mapper>

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

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

Loading…
Cancel
Save