commit 9c86bc093ac784b3f5aaca7ecdc3b560ed58332a
Author: 武 <吴æ武慧娟>
Date: Wed Dec 4 10:06:29 2019 +0800
init cloud
diff --git a/ccsenscloud.iml b/ccsenscloud.iml
new file mode 100644
index 00000000..27ae93b4
--- /dev/null
+++ b/ccsenscloud.iml
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cloudutil/cloudutil.iml b/cloudutil/cloudutil.iml
new file mode 100644
index 00000000..8ae41877
--- /dev/null
+++ b/cloudutil/cloudutil.iml
@@ -0,0 +1,298 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cloudutil/pom.xml b/cloudutil/pom.xml
new file mode 100644
index 00000000..3403de9e
--- /dev/null
+++ b/cloudutil/pom.xml
@@ -0,0 +1,43 @@
+
+
+
+ ccsenscloud
+ com.ccsens
+ 1.0-SNAPSHOT
+
+ 4.0.0
+
+ cloudutil
+
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-netflix-eureka-client
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-openfeign
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-netflix-hystrix
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-sleuth
+
+
+
+ org.springframework.cloud
+ spring-cloud-sleuth-zipkin
+
+
+
+
\ No newline at end of file
diff --git a/cloudutil/src/main/java/com/ccsens/cloudutil/bean/QueryParam.java b/cloudutil/src/main/java/com/ccsens/cloudutil/bean/QueryParam.java
new file mode 100644
index 00000000..99d17bc5
--- /dev/null
+++ b/cloudutil/src/main/java/com/ccsens/cloudutil/bean/QueryParam.java
@@ -0,0 +1,14 @@
+package com.ccsens.cloudutil.bean;
+
+import lombok.Data;
+
+/**
+ * @description:
+ * @author: wuHuiJuan
+ * @create: 2019/11/27 10:06
+ */
+@Data
+public class QueryParam {
+ private T t;
+ private Long userId;
+}
diff --git a/cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java b/cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java
new file mode 100644
index 00000000..4650daeb
--- /dev/null
+++ b/cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java
@@ -0,0 +1,66 @@
+package com.ccsens.cloudutil.feign;
+
+import com.ccsens.cloudutil.bean.QueryParam;
+import feign.hystrix.FallbackFactory;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.configurationprocessor.json.JSONObject;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.Map;
+
+/**
+ * @description:
+ * @author: wuHuiJuan
+ * @create: 2019/11/27 10:03
+ */
+
+@FeignClient(name = "tall", path = "v1.0", fallbackFactory = TallFeignClientFallBack.class)
+public interface TallFeignClient {
+ /**
+ * 获取
+ * @param map
+ * @return
+ */
+ @PostMapping("/getPort")
+ String get(QueryParam map);
+
+ @GetMapping("/")
+ String index();
+ /*
+ 1.如果使用url传参,加注解@PathVariable,不能传递对象,只能用作传递基本数值;
+ 2.如果使用get请求传递参数,同样不能传递对象,而且如果传递参数的话,需要用到@RequestParam标注名称
+ 3.传递对象请使用post方式,并且接收端使用@RequestBody注解
+ */
+}
+
+@Slf4j
+@Component
+class TallFeignClientFallBack implements FallbackFactory {
+
+ @Override
+ public TallFeignClient create(Throwable throwable) {
+ String msg = throwable == null ? "" : throwable.getMessage();
+ if (!StringUtils.isEmpty(msg)) {
+ log.error(msg);
+ }
+ return new TallFeignClient() {
+ @Override
+ public String get(QueryParam map) {
+ return "hello world";
+ }
+
+ @Override
+ public String index() {
+ throw new RuntimeException("网络繁忙,请稍后重试");
+ }
+
+ };
+ }
+
+ }
diff --git a/cloudutil/src/main/java/com/ccsens/cloudutil/ribbon/RibbonClientConfig.java b/cloudutil/src/main/java/com/ccsens/cloudutil/ribbon/RibbonClientConfig.java
new file mode 100644
index 00000000..490c66db
--- /dev/null
+++ b/cloudutil/src/main/java/com/ccsens/cloudutil/ribbon/RibbonClientConfig.java
@@ -0,0 +1,14 @@
+package com.ccsens.cloudutil.ribbon;
+
+import org.springframework.cloud.netflix.ribbon.RibbonClient;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @description:
+ * @author: wuHuiJuan
+ * @create: 2019/11/26 12:11
+ */
+@Configuration
+@RibbonClient(name="${spring.application.name}", configuration = RibbonConfiguration.class)
+public class RibbonClientConfig {
+}
diff --git a/cloudutil/src/main/java/com/ccsens/cloudutil/ribbon/RibbonConfiguration.java b/cloudutil/src/main/java/com/ccsens/cloudutil/ribbon/RibbonConfiguration.java
new file mode 100644
index 00000000..441982df
--- /dev/null
+++ b/cloudutil/src/main/java/com/ccsens/cloudutil/ribbon/RibbonConfiguration.java
@@ -0,0 +1,41 @@
+package com.ccsens.cloudutil.ribbon;
+
+import com.netflix.loadbalancer.IRule;
+import com.netflix.loadbalancer.RoundRobinRule;
+import com.netflix.loadbalancer.WeightedResponseTimeRule;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @description: 负载均衡
+ * @author: wuHuiJuan
+ * @create: 2019/11/26 12:04
+ */
+@Configuration
+public class RibbonConfiguration {
+ /**根据响应时间加权,响应时间越长,权重越小,被选中的可能性越低*/
+// @Bean
+// public IRule weightedResponseTimeRule() {
+// return new WeightedResponseTimeRule();
+// }
+
+ /**轮询*/
+ @Bean
+ public IRule roundRobinRule(){
+ return new RoundRobinRule();
+ }
+
+
+ /*
+ 负载均衡机制 ,也可以自定义
+ AvailabilityFilteringRule:过滤掉一直连接失败的被标记为circuit tripped的后端Server,并过滤掉那些高并发的后端Server或者使用一个AvailabilityPredicate来包含过滤server的逻辑,其实就就是检查status里记录的各个Server的运行状态;
+ BestAvailableRule:选择一个最小的并发请求的Server,逐个考察Server,如果Server被tripped了,则跳过。
+ RandomRule:随机选择一个Server;
+ ResponseTimeWeightedRule:作用同WeightedResponseTimeRule,二者作用一样;
+ RetryRule:对选定的负载均衡策略机上重试机制,在一个配置时间段内当选择Server不成功,则一直尝试使用subRule的方式选择一个可用的server;
+ RoundRobinRule:轮询选择, 轮询index,选择index对应位置的Server;
+ WeightedResponseTimeRule:根据响应时间加权,响应时间越长,权重越小,被选中的可能性越低;
+ ZoneAvoidanceRule:复合判断Server所在区域的性能和Server的可用性选择Server;
+ */
+
+}
diff --git a/cloudutil/src/main/resources/application-util-dev.yml b/cloudutil/src/main/resources/application-util-dev.yml
new file mode 100644
index 00000000..599979df
--- /dev/null
+++ b/cloudutil/src/main/resources/application-util-dev.yml
@@ -0,0 +1,56 @@
+#服务端点暴露
+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/
+ 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://anyring.cc:9411
+ sleuth:
+ sampler:
+ # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。
+ probability: 1.0
diff --git a/ht/ht.iml b/ht/ht.iml
new file mode 100644
index 00000000..f500ffff
--- /dev/null
+++ b/ht/ht.iml
@@ -0,0 +1,301 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ht/pom.xml b/ht/pom.xml
new file mode 100644
index 00000000..8ce5223c
--- /dev/null
+++ b/ht/pom.xml
@@ -0,0 +1,55 @@
+
+
+
+ ccsenscloud
+ com.ccsens
+ 1.0-SNAPSHOT
+
+ 4.0.0
+
+ ht
+
+
+
+ cloudutil
+ com.ccsens
+ 1.0-SNAPSHOT
+
+
+
+ util
+ com.ccsens
+ 1.0-SNAPSHOT
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.62
+
+
+
+
+
+
+ org.mybatis.generator
+ mybatis-generator-maven-plugin
+ 1.3.7
+
+ ${basedir}/src/main/resources/mbg.xml
+ true
+
+
+
+ mysql
+ mysql-connector-java
+ 5.1.34
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ht/src/main/java/com/ccsens/ht/HtApplication.java b/ht/src/main/java/com/ccsens/ht/HtApplication.java
new file mode 100644
index 00000000..a501e5c0
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/HtApplication.java
@@ -0,0 +1,30 @@
+package com.ccsens.ht;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.web.servlet.ServletComponentScan;
+import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableAsync;
+
+/**
+ * @description:
+ * @author: wuHuiJuan
+ * @create: 2019/11/26 14:58
+ */
+//@ComponentScan(basePackages = "com.ccsens.ht.*")
+@MapperScan(basePackages = {"com.ccsens.ht.persist.*"})
+@ServletComponentScan
+@EnableAsync
+//开启断路器功能
+@EnableCircuitBreaker
+@EnableFeignClients(basePackages = "com.ccsens.cloudutil.feign")
+@SpringBootApplication(scanBasePackages = "com.ccsens")
+public class HtApplication {
+ public static void main(String[] args) {
+ SpringApplication.run(HtApplication.class, args);
+ }
+}
diff --git a/ht/src/main/java/com/ccsens/ht/annotation/DoctorAudit.java b/ht/src/main/java/com/ccsens/ht/annotation/DoctorAudit.java
new file mode 100644
index 00000000..a7296778
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/annotation/DoctorAudit.java
@@ -0,0 +1,14 @@
+package com.ccsens.ht.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 医生是否审核通过
+ * @author: wuHuiJuan
+ * @create: 2019/11/21 10:47
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface DoctorAudit {
+}
diff --git a/ht/src/main/java/com/ccsens/ht/api/DoctorController.java b/ht/src/main/java/com/ccsens/ht/api/DoctorController.java
new file mode 100644
index 00000000..ce3fb59c
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/api/DoctorController.java
@@ -0,0 +1,75 @@
+package com.ccsens.ht.api;
+
+
+import com.ccsens.ht.annotation.DoctorAudit;
+import com.ccsens.ht.bean.dto.DoctorDto;
+import com.ccsens.ht.bean.dto.QueryDto;
+import com.ccsens.ht.bean.vo.DoctorVo;
+import com.ccsens.ht.service.IDoctorService;
+import com.ccsens.util.CodeEnum;
+import com.ccsens.util.JsonResponse;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.*;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+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;
+
+/**
+ * @program: ptpro
+ * @description:
+ * @author: wu huijuan
+ * @create: 2019/10/24 17:03
+ */
+@Slf4j
+@Api(tags = "资格认证/审核",value = "医生进行资格认证和资格审核")
+@RestController
+public class DoctorController {
+
+ @Autowired
+ private IDoctorService doctorService;
+
+ @ApiOperation(value = "资格认证",notes = "医生提交基本信息进行资格认证")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "医生基本信息", required = true)
+ })
+ @RequestMapping(value = "/doctorSubmit", method = RequestMethod.POST)
+ public JsonResponse doctorSubmit(@RequestBody @ApiParam @Validated QueryDto params) {
+ log.info("资格认证参数:{}", params);
+ DoctorDto.Submit submit = params.getParam();
+ return doctorService.doctorSubmit(submit, params.getUserId());
+ }
+
+
+ @DoctorAudit
+ @ApiOperation(value = "资格认证列表",notes = "医生资格认证列表")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "医生查询条件", required = true)
+ })
+ @RequestMapping(value = "/queryDoctors", method = RequestMethod.POST)
+ public JsonResponse queryDoctors(@RequestBody @ApiParam @Validated QueryDto params) {
+ log.info("资格认证列表:{}", params);
+ PageInfo dtos = doctorService.queryDoctors(params.getParam(), params.getUserId());
+ return JsonResponse.newInstance().ok(CodeEnum.SUCCESS, dtos);
+ }
+
+ @DoctorAudit
+ @ApiOperation(value = "资格审核",notes = "医生资格审核 通过/拒绝")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "医生基本信息", required = true)
+ })
+ @RequestMapping(value = "/doctorAudit", method = RequestMethod.POST)
+ public JsonResponse doctorAudit(@RequestBody @ApiParam @Validated QueryDto params) throws Exception {
+
+ log.info("资格审核:{}", params);
+ DoctorDto.Audit audit = params.getParam();
+ CodeEnum codeEnum = doctorService.doctorAudit(audit, params.getUserId());
+ log.info("审核结果:{}", codeEnum);
+ return JsonResponse.newInstance().ok(codeEnum);
+ }
+
+
+}
diff --git a/ht/src/main/java/com/ccsens/ht/api/ImportController.java b/ht/src/main/java/com/ccsens/ht/api/ImportController.java
new file mode 100644
index 00000000..21dd6f31
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/api/ImportController.java
@@ -0,0 +1,76 @@
+package com.ccsens.ht.api;
+
+import com.ccsens.ht.service.IImportService;
+import com.ccsens.ht.uitl.Constant;
+import com.ccsens.util.JsonResponse;
+import com.ccsens.util.UploadFileUtil_Servlet3;
+import com.ccsens.util.WebConstant;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.Part;
+import java.io.File;
+
+
+/**
+ * @program: ptpro
+ * @description: 医疗测评数据导入
+ * @author: wu huijuan
+ * @create: 2019/10/21 09:51
+ */
+
+@Slf4j
+@Api(tags = "数据导入",value = "导入医疗项目相关数据")
+@RestController
+public class ImportController {
+
+ @Autowired
+ private IImportService importService;
+
+ /**
+ *@Description:
+ *@Param:
+ *@return: com.ccsens.ptpro.util.JsonResponse
+ *@Author: wuhuijuan
+ *@date: 2019/10/21 10:04
+ */
+ @ApiOperation(value = "导入医疗项目相关数据",notes = "文件大小不能超过20M,支持后缀:.xls|.xlsx")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "file", value = "医疗项目表", required = true, paramType = "form",dataType = "__file")
+ })
+ @RequestMapping(value = "/importBase", method = RequestMethod.POST)
+ public JsonResponse importAll(@RequestParam(required = true) Part file) throws Exception{
+
+ long time1 = System.currentTimeMillis();
+ //1.上传文件
+ String allowedExts = "xls,xlsx";
+ String dir = WebConstant.UPLOAD_PROJECT_WBS + File.separator;
+ String path = UploadFileUtil_Servlet3.uploadFile(file, allowedExts, dir);
+ File execlFile = new File(dir+path);
+ long time2 = System.currentTimeMillis();
+ log.info("解析文件耗时:{}", (time2 - time1));
+ importService.importPosition(execlFile, 0);
+ long time3 = System.currentTimeMillis();
+ log.info("导入职务耗时:{}", (time3 - time2));
+ importService.importTitle(execlFile, 1);
+ long time4 = System.currentTimeMillis();
+ log.info("导入职称耗时:{}", (time4 - time3));
+ importService.importReport(execlFile, 2);
+ long time5 = System.currentTimeMillis();
+ log.info("导入报告单耗时:{}", (time5 - time4));
+ importService.importQuestion(execlFile, Constant.Ht.Question.ALL);
+ return JsonResponse.newInstance().ok();
+ }
+
+
+
+
+}
diff --git a/ht/src/main/java/com/ccsens/ht/api/IndexController.java b/ht/src/main/java/com/ccsens/ht/api/IndexController.java
new file mode 100644
index 00000000..3dbd2dab
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/api/IndexController.java
@@ -0,0 +1,58 @@
+package com.ccsens.ht.api;
+
+import com.ccsens.cloudutil.bean.QueryParam;
+import com.ccsens.cloudutil.feign.TallFeignClient;
+import com.ccsens.util.PropUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.configurationprocessor.json.JSONException;
+import org.springframework.boot.configurationprocessor.json.JSONObject;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * @description:
+ * @author: wuHuiJuan
+ * @create: 2019/11/26 15:01
+ */
+@RestController
+public class IndexController {
+
+// @Autowired
+// private RestTemplate restTemplate;
+ @Autowired
+ private TallFeignClient tallFeignClient;
+
+ @RequestMapping("get/{id}")
+ public String get(@PathVariable("id") Long id) throws JSONException {
+
+// return restTemplate.getForObject("http://tall/getPort", String.class);
+
+ Map t = new HashMap();
+ t.put("name","zs");
+ t.put("age",1);
+ QueryParam json = new QueryParam();
+ json.setT(t);
+ json.setUserId(id);
+ String s = tallFeignClient.get(json);
+// String s = tallFeignClient.index();
+ return s;
+
+ }
+
+ @RequestMapping({"","/","/index"})
+ public String index(){
+ System.out.println("+++++++++++++++++++++++++++++++++:" + PropUtil.domain);
+ return "hello world:";
+ }
+
+}
diff --git a/ht/src/main/java/com/ccsens/ht/api/PatientController.java b/ht/src/main/java/com/ccsens/ht/api/PatientController.java
new file mode 100644
index 00000000..3b254876
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/api/PatientController.java
@@ -0,0 +1,129 @@
+package com.ccsens.ht.api;
+
+import cn.hutool.core.util.IdcardUtil;
+import com.ccsens.ht.annotation.DoctorAudit;
+import com.ccsens.ht.bean.dto.PatientDto;
+import com.ccsens.ht.bean.dto.QueryDto;
+import com.ccsens.ht.bean.po.HtPatient;
+import com.ccsens.ht.bean.vo.PatientVo;
+import com.ccsens.ht.service.IPatientService;
+import com.ccsens.ht.uitl.Constant;
+import com.ccsens.util.CodeEnum;
+import com.ccsens.util.JsonResponse;
+import io.swagger.annotations.*;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.StringUtils;
+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 java.util.List;
+
+/**
+ * @program: ptpro
+ * @description: 病人信息查询及编辑
+ * @author: wu huijuan
+ * @create: 2019/10/28 17:48
+ */
+@Slf4j
+@Api(tags = "病友信息",value = "病友信息查询/编辑")
+@RestController
+public class PatientController {
+
+ @Autowired
+ private IPatientService patientService;
+
+ /**
+ *@Description:
+ * @param params
+ *@return: com.ccsens.ptpro.util.JsonResponse
+ *@Author: wuhuijuan
+ *@date: 2019/10/29 9:24
+ */
+ @DoctorAudit
+ @ApiOperation(value = "基础信息查询",notes = "病友基础信息查询")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "病友基础信息", required = true)
+ })
+ @RequestMapping(value="/queryPatient", method = RequestMethod.POST)
+ public JsonResponse query(@RequestBody @ApiParam @Validated QueryDto params) {
+ log.info("病友信息查询:{}", params);
+ PatientDto.Query patient = params.getParam();
+
+ List patients = patientService.selectPatient(patient);
+ log.info("病友查询结果:{}", patients);
+ return JsonResponse.newInstance().ok(PatientVo.Query.copy(patients));
+ }
+
+ /**
+ *@Description:病人基本信息编辑,返回病人ID
+ * 1.为用户注册账号 2有则修改,无则添加
+ * @param params
+ *@return: com.ccsens.ptpro.util.JsonResponse
+ *@Author: wuhuijuan
+ *@date: 2019/10/30 9:27
+ */
+ @DoctorAudit
+ @ApiOperation(value = "基础信息编辑",notes = "病友基础信息编辑")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "病友基础信息", required = true)
+ })
+ @RequestMapping(value="/editPatient", method = RequestMethod.POST)
+ public JsonResponse edit(@RequestBody @ApiParam @Validated QueryDtoparams) {
+ log.info("病友信息编辑:{}", params);
+ PatientDto.Edit patient = params.getParam();
+ if(StringUtils.isEmpty(patient.getMobile()) || StringUtils.isEmpty(patient.getName())) {
+ log.info("手机号或名字为空");
+ return JsonResponse.newInstance().ok(CodeEnum.PARAM_NULL);
+ }
+ //校验身份证格式
+ if (patient.getId() == null) {
+ if (StringUtils.isEmpty(patient.getIdcard())) {
+ return JsonResponse.newInstance().ok(CodeEnum.PARAM_NULL);
+ }
+ if (!IdcardUtil.isValidCard(patient.getIdcard())){
+ return JsonResponse.newInstance().ok(CodeEnum.ID_CARD_ERROR);
+ }
+ } else if (StringUtils.isEmpty(patient.getIdcard()) || patient.getIdcard().contains("*")) {
+ patient.setIdcard(null);
+ }
+ //设置记录值
+ patient.setRecorder(patient.getId() == null ? Constant.Ht.NUMBER_DEFAULT : params.getUserId());
+ long id = patientService.editPatient(patient.copy());
+ log.info("病友编辑结果:{}", id);
+ if (id <= 0) {
+ log.info("病友编辑失败");
+ return JsonResponse.newInstance().ok(CodeEnum.PARAM_ERROR);
+ }
+ PatientVo.Edit idModel = new PatientVo.Edit();
+ idModel.setId(id);
+ return JsonResponse.newInstance().ok(idModel);
+ }
+
+
+ @DoctorAudit
+ @ApiOperation(value = "病友其他信息查询",notes = "病友其他信息查询")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "病友其他信息查询", required = true)
+ })
+ @RequestMapping(value="/queryPatientOtherMsg", method = RequestMethod.POST)
+ public JsonResponse queryPatientOtherMsg(@RequestBody @ApiParam @Validated QueryDto params) {
+ log.info("查询其他信息请求参数:{}", params);
+ List list = patientService.queryPatientOtherMsg(params.getParam(), params.getUserId());
+ return JsonResponse.newInstance().ok(list);
+ }
+ @DoctorAudit
+ @ApiOperation(value = "编辑其他病友信息",notes = "编辑其他病友信息")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "编辑其他病友信息", required = true)
+ })
+ @RequestMapping(value="/editPatientOtherMsg", method = RequestMethod.POST)
+ public JsonResponse editPatientOtherMsg(@RequestBody @ApiParam @Validated QueryDto params) {
+ log.info("查询其他信息请求参数:{}", params);
+ CodeEnum codeEnum = patientService.editPatientOtherMsg(params.getParam(), params.getUserId());
+ return JsonResponse.newInstance().ok(codeEnum);
+ }
+}
diff --git a/ht/src/main/java/com/ccsens/ht/api/PatientReportController.java b/ht/src/main/java/com/ccsens/ht/api/PatientReportController.java
new file mode 100644
index 00000000..fb5607b8
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/api/PatientReportController.java
@@ -0,0 +1,105 @@
+package com.ccsens.ht.api;
+
+
+import com.ccsens.ht.annotation.DoctorAudit;
+import com.ccsens.ht.bean.dto.PatientReportDto;
+import com.ccsens.ht.bean.dto.QueryDto;
+import com.ccsens.ht.bean.vo.PatientReportVo;
+import com.ccsens.ht.service.IPatientReportService;
+import com.ccsens.util.CodeEnum;
+import com.ccsens.util.JsonResponse;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.*;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+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;
+
+/**
+ * @program: ptpro
+ * @description:病人报告单
+ * @author: wu huijuan
+ * @create: 2019/10/30 16:22
+ */
+@Slf4j
+@Api(tags = "报告单信息",value = "报告单生成,查看,编辑,生成文件等")
+@RestController
+public class PatientReportController {
+
+ @Autowired
+ private IPatientReportService patientReportService;
+
+ @DoctorAudit
+ @ApiOperation(value = "生成报告单",notes = "生成报告单")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "报告单信息", required = true)
+ })
+ @RequestMapping(value="/generatePatientReport", method = RequestMethod.POST)
+ public JsonResponse generate(@RequestBody @ApiParam @Validated QueryDto dto){
+ log.info("生成报告单请求参数:{}", dto);
+ PatientReportDto.Generate patientReport = dto.getParam();
+ if (patientReport == null || patientReport.getPatientId() == null || patientReport.getPatientId() == 0) {
+ return JsonResponse.newInstance().ok(CodeEnum.PARAM_NULL);
+ }
+ //TODO 判断病友是否和当前医院绑定,未绑定,进行绑定
+ JsonResponse response = patientReportService.generatePatientReport(patientReport, dto.getUserId());
+ log.info("生成病友报告单返回:{}", response);
+ return JsonResponse.newInstance().ok(response);
+ }
+ @DoctorAudit
+ @ApiOperation(value = "编辑报告单",notes = "编辑报告单")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "编辑报告单信息", required = true)
+ })
+ @RequestMapping(value="/editPatientReport", method = RequestMethod.POST)
+ public JsonResponse edit(@RequestBody @ApiParam @Validated QueryDto param){
+
+ //编辑报告单信息
+ log.info("编辑报告单:{}", param);
+ CodeEnum codeEnum = patientReportService.editPatientReport(param.getParam(), param.getUserId());
+ log.info("编辑报告单结果:{}", codeEnum);
+ return JsonResponse.newInstance().ok(codeEnum);
+ }
+
+ @ApiOperation(value = "查询报告单列表",notes = "根据病人ID查询报告单列表")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "编辑报告单信息", required = true)
+ })
+ @RequestMapping(value="/queryReports", method = RequestMethod.POST)
+ public JsonResponse queryReports(@RequestBody @ApiParam @Validated QueryDto param){
+
+ //编辑报告单信息
+ log.info("查询报告单列表:{}", param);
+ PageInfo reportNamePageInfo = patientReportService.queryReports(param.getParam(), param.getUserId());
+ log.info("查询报告单结果:{}", reportNamePageInfo);
+ return JsonResponse.newInstance().ok(reportNamePageInfo);
+ }
+ @ApiOperation(value = "查询报告单详情",notes = "根据病人ID查询报告单详情")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "查询报告单详情", required = true)
+ })
+ @RequestMapping(value="/queryReportDetail", method = RequestMethod.POST)
+ public JsonResponse queryReportDetail(@RequestBody @ApiParam @Validated QueryDto param){
+ //查询报告单信息
+ log.info("查询报告单详情:{}", param);
+ PatientReportVo.ReprotDetail detail = patientReportService.queryReportDetail(param.getParam(), param.getUserId());
+ log.info("查询报告单详情结果:{}", detail);
+ return JsonResponse.newInstance().ok(detail);
+ }
+
+ @ApiOperation(value = "查询医生对报告单的权限",notes = "查询医生对报告单的权限")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "报告单ID", required = true)
+ })
+ @RequestMapping(value="/queryAuthority", method = RequestMethod.POST)
+ public JsonResponse queryAuthority(@RequestBody @ApiParam @Validated QueryDto param){
+ //查询报告单信息
+ log.info("查询医生对报告单的权限:{}", param);
+ PatientReportVo.Authority authority = patientReportService.queryReportAuthority(param.getParam(), param.getUserId());
+ log.info("查询医生对报告单的权限结果:{}", authority);
+ return JsonResponse.newInstance().ok(authority);
+ }
+}
diff --git a/ht/src/main/java/com/ccsens/ht/api/PositionController.java b/ht/src/main/java/com/ccsens/ht/api/PositionController.java
new file mode 100644
index 00000000..fd9d79a9
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/api/PositionController.java
@@ -0,0 +1,53 @@
+package com.ccsens.ht.api;
+
+import com.ccsens.ht.bean.dto.PositionDto;
+import com.ccsens.ht.bean.dto.QueryDto;
+import com.ccsens.ht.bean.vo.PositionVo;
+import com.ccsens.ht.service.IPositionService;
+import com.ccsens.util.JsonResponse;
+import io.swagger.annotations.*;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+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 java.util.List;
+
+/**
+ * @description: 查询职务职称
+ * @author: wu huijuan
+ * @create: 2019/11/19 16:19
+ */
+@Slf4j
+@Api(tags = "部门 和 职称",value = "查询部门/职称")
+@RestController
+public class PositionController {
+
+ @Autowired
+ private IPositionService positionService;
+
+ @ApiOperation(value = "医院/部门/职务查询",notes = "医院/部门/职务查询")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "医院/部门/职务查询", required = true)
+ })
+ @RequestMapping(value="/queryPosition", method = RequestMethod.POST)
+ public JsonResponse queryPosition(@RequestBody @ApiParam @Validated QueryDto params){
+ log.info("查询职务:{}", params);
+ List positions = positionService.queryPosition(params.getParam(), params.getUserId());
+ return JsonResponse.newInstance().ok(positions);
+ }
+ @ApiOperation(value = "职称查询",notes = "职称查询")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "职称查询", required = true)
+ })
+ @RequestMapping(value="/queryTitle", method = RequestMethod.POST)
+ public JsonResponse queryTitle(@RequestBody @ApiParam @Validated QueryDto params){
+ log.info("查询职称:{}", params);
+ List titles = positionService.queryTitles();
+ return JsonResponse.newInstance().ok(titles);
+ }
+
+}
diff --git a/ht/src/main/java/com/ccsens/ht/api/QuestionController.java b/ht/src/main/java/com/ccsens/ht/api/QuestionController.java
new file mode 100644
index 00000000..f7d93ca7
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/api/QuestionController.java
@@ -0,0 +1,62 @@
+package com.ccsens.ht.api;
+
+
+import com.ccsens.ht.annotation.DoctorAudit;
+import com.ccsens.ht.bean.dto.QueryDto;
+import com.ccsens.ht.bean.dto.QuestionDto;
+import com.ccsens.ht.bean.vo.QuestionVo;
+import com.ccsens.ht.service.IQuestionService;
+import com.ccsens.util.CodeEnum;
+import com.ccsens.util.JsonResponse;
+import com.ccsens.util.NotSupportedFileTypeException;
+import io.swagger.annotations.*;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+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 java.io.IOException;
+
+/**
+ * @description:
+ * @author: wu huijuan
+ * @create: 2019/11/08 15:33
+ */
+@Slf4j
+@Api(tags = "测评题目信息",value = "测评题目查询等")
+@RestController
+public class QuestionController {
+
+ @Autowired
+ private IQuestionService questionService;
+
+ @DoctorAudit
+ @ApiOperation(value = "测评试题查询",notes = "测评试题查询")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "测评试题查询信息", required = true)
+ })
+ @RequestMapping(value="/queryQuestion", method = RequestMethod.POST)
+ public JsonResponse query(@RequestBody @ApiParam @Validated QueryDto queryDto){
+ log.info("查询试题:{}", queryDto);
+ QuestionVo.Query query = questionService.queryQuestion(queryDto.getParam(), queryDto.getUserId());
+ log.info("查询试题结果:{}", query);
+ return JsonResponse.newInstance().ok(query);
+ }
+ @DoctorAudit
+ @ApiOperation(value = "保存试题得分",notes = "保存试题得分")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "json", value = "试题得分情况", required = true)
+ })
+ @RequestMapping(value="/saveScore", method = RequestMethod.POST)
+ public JsonResponse saveScore(@RequestBody @ApiParam @Validated QueryDto queryDto) throws IOException, NotSupportedFileTypeException {
+ log.info("保存试题得分:{}", queryDto);
+ CodeEnum codeEnum = questionService.saveScore(queryDto.getParam(), queryDto.getUserId());
+ log.info("保存试题得分结果:{}", codeEnum);
+ return JsonResponse.newInstance().ok(codeEnum);
+ }
+
+
+}
diff --git a/ht/src/main/java/com/ccsens/ht/aspect/DoctorAuditAspect.java b/ht/src/main/java/com/ccsens/ht/aspect/DoctorAuditAspect.java
new file mode 100644
index 00000000..60d90478
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/aspect/DoctorAuditAspect.java
@@ -0,0 +1,61 @@
+package com.ccsens.ht.aspect;
+
+import com.ccsens.ht.bean.dto.QueryDto;
+import com.ccsens.ht.bean.po.HtDoctor;
+import com.ccsens.ht.bean.po.HtDoctorExample;
+import com.ccsens.ht.persist.mapper.HtDoctorMapper;
+import com.ccsens.ht.uitl.Constant;
+import com.ccsens.util.CodeEnum;
+import com.ccsens.util.JsonResponse;
+import com.ccsens.util.exception.BaseException;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+
+/**
+ * 判断医生是否审核通过
+ * @author: wuHuiJuan
+ * @create: 2019/11/21 10:51
+ */
+@Slf4j
+@Aspect
+@Component
+public class DoctorAuditAspect {
+
+ @Autowired
+ private HtDoctorMapper htDoctorMapper;
+
+ @Pointcut("@annotation(com.ccsens.ht.annotation.DoctorAudit)")
+ public void doctorAuditAdvice(){}
+ @Around("doctorAuditAdvice()")
+ public Object around(ProceedingJoinPoint pjp){
+
+ Object[] args = pjp.getArgs();
+ QueryDto dto = (QueryDto) args[0];
+ Long userId = dto.getUserId();
+ HtDoctorExample doctorExample = new HtDoctorExample();
+ doctorExample.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS);
+ List doctors = htDoctorMapper.selectByExample(doctorExample);
+ if (CollectionUtils.isEmpty(doctors)) {
+ log.info("{}没有审核信息", userId);
+ return JsonResponse.newInstance().ok(CodeEnum.AUDIT_NOT_PASS);
+ }
+
+ Object result;
+ try {
+ result =pjp.proceed();
+ } catch (Throwable throwable) {
+ log.error("doctorAudit运行异常", throwable);
+ throw new BaseException(CodeEnum.SYS_ERROR);
+ }
+ return result;
+ }
+
+}
diff --git a/ht/src/main/java/com/ccsens/ht/bean/BeanConfig.java b/ht/src/main/java/com/ccsens/ht/bean/BeanConfig.java
new file mode 100644
index 00000000..454d5c0e
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/bean/BeanConfig.java
@@ -0,0 +1,20 @@
+//package com.ccsens.ht.bean;
+//
+//import org.springframework.cloud.client.loadbalancer.LoadBalanced;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.web.client.RestTemplate;
+//
+///**
+// * @description:
+// * @author: wuHuiJuan
+// * @create: 2019/11/26 15:45
+// */
+//@Configuration
+//public class BeanConfig {
+// @Bean
+// @LoadBalanced
+// public RestTemplate restTemplate() {
+// return new RestTemplate();
+// }
+//}
diff --git a/ht/src/main/java/com/ccsens/ht/bean/dto/DoctorDto.java b/ht/src/main/java/com/ccsens/ht/bean/dto/DoctorDto.java
new file mode 100644
index 00000000..7ec02d40
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/bean/dto/DoctorDto.java
@@ -0,0 +1,78 @@
+package com.ccsens.ht.bean.dto;
+
+import com.ccsens.ht.bean.po.HtDoctor;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.beans.BeanUtils;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @program: ptpro
+ * @description:
+ * @author: wu huijuan
+ * @create: 2019/10/31 10:35
+ */
+public class DoctorDto {
+ @ApiModel
+ @Data
+ public static class Submit{
+ @ApiModelProperty("职务ID")
+ @NotNull
+ private Long positionId;
+ @ApiModelProperty("职称ID")
+ @NotNull
+ private Long titleId;
+ @ApiModelProperty("姓名")
+ @NotNull
+ private String name;
+ @ApiModelProperty("性别(0:男 1:女)")
+ @NotNull
+ @Min(0)
+ @Max(1)
+ private Byte sex;
+ @ApiModelProperty("年龄")
+ @NotNull
+ @Min(0)
+ @Max(150)
+ private Integer age;
+
+ public HtDoctor copy() {
+ HtDoctor doctor = new HtDoctor();
+ BeanUtils.copyProperties(this, doctor);
+ return doctor;
+ }
+ }
+
+
+
+ @ApiModel
+ @Data
+ public static class Audit{
+ @ApiModelProperty("待审核医生ID")
+ @NotNull
+ private Long doctorId;
+ @ApiModelProperty("审核状态 1:审核通过 2:审核失败")
+ @NotNull
+ private Byte auditState;
+ }
+
+ @ApiModel
+ @Data
+ public static class Query{
+ @ApiModelProperty("职称ID")
+ private Long titleId;
+ @ApiModelProperty("医院/科室/职务ID")
+ private Long positionId;
+ @ApiModelProperty("第几页")
+ @Min(value = 1)
+ private int pageNum = 1;
+ @ApiModelProperty("每页多少条")
+ @Min(value = 1)
+ @Max(value=100)
+ private int pageSize = 10;
+ }
+}
diff --git a/ht/src/main/java/com/ccsens/ht/bean/dto/PatientDto.java b/ht/src/main/java/com/ccsens/ht/bean/dto/PatientDto.java
new file mode 100644
index 00000000..8b0a14c9
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/bean/dto/PatientDto.java
@@ -0,0 +1,115 @@
+package com.ccsens.ht.bean.dto;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ccsens.ht.bean.po.HtPatient;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.beans.BeanUtils;
+
+/**
+ * @program: ptpro
+ * @description: 病人相关接口请求参数
+ * @author: wu huijuan
+ * @create: 2019/10/31 09:28
+ */
+public class PatientDto {
+ @ApiModel
+ @Data
+ public static class Query{
+ @ApiModelProperty("报告单ID")
+ private Long reportId;
+ @ApiModelProperty("病人ID")
+ private Long id;
+ @ApiModelProperty("病人名字")
+ private String name;
+ @ApiModelProperty("病人门诊号")
+ private String patientNumber;
+ @ApiModelProperty("病人住院号")
+ private String hospitalNumber;
+ @ApiModelProperty("病人身份证号")
+ private String idcard;
+ }
+
+ @Data
+ @ApiModel
+ public static class Edit{
+ @ApiModelProperty("病人id")
+ private Long id;
+ @ApiModelProperty("病人用户id")
+ private Long userId;
+ @ApiModelProperty("病人名字")
+ private String name;
+ @ApiModelProperty("病人门诊号")
+ private String patientNumber;
+ @ApiModelProperty("病人住院号")
+ private String hospitalNumber;
+ @ApiModelProperty("病人身份证号")
+ private String idcard;
+ @ApiModelProperty("性别(0:男 1:女)")
+ private Byte sex;
+ @ApiModelProperty("婚姻状况(1:未婚2:已婚 3:离异 4:分居 5:丧偶 6:同居 7:其他 )")
+ private Byte maritalStatus;
+ @ApiModelProperty("教育程度(1:文盲 2:小学 3:初中 4:高中 5:大学 6:大学以上 7:其他)")
+ private Byte educationalStatus;
+ @ApiModelProperty("受教育时间(年或月)")
+ private String educationalStatusUnit;
+ @ApiModelProperty("民族")
+ private String nation;
+ @ApiModelProperty("籍贯")
+ private String nativePlace;
+ @ApiModelProperty("职业(1:农林牧渔水利生产人员 2:教师 3:医务工作者 4:专业技术人员 5:生产、运输设备操作人员及有关人员6:商业、服务业人员7:国家机关、事业单位、企业负责人8:国家机关、事业单位、企业办事人员和有关人员9:军人 10:媒体、文体类工作人员 11:在校学生 12:未就业 13:家务 14:其他")
+ private Byte career;
+ @ApiModelProperty("生育数量")
+ private Integer birthNumber;
+ @ApiModelProperty("绝经年龄(女)")
+ private Integer menopauseAge;
+ @ApiModelProperty("联系人")
+ private String contact;
+ @ApiModelProperty("手机")
+ private String mobile;
+ @ApiModelProperty("电话")
+ private String phone;
+ @ApiModelProperty("省份")
+ private String province;
+ @ApiModelProperty("城市")
+ private String city;
+ @ApiModelProperty("住址")
+ private String adress;
+ @ApiModelProperty("住所(1:自己家中 2:养老院 3:其他)")
+ private Byte domicile;
+ @ApiModelProperty("独立生活能力(1:能够独立生活 2:需要他人帮助完成复杂活动 3:需要他人帮助完成基本活动 4:完全依赖他人生活 5:未知 6:其他)")
+ private Byte independentLivingSkills;
+ @ApiModelProperty("居住状态(1:独居 2:与配偶或对象或子女 3:与亲戚或朋友居住)")
+ private Byte dwellingState;
+ @ApiModelProperty("备注")
+ private String remark;
+ @ApiModelProperty("第一次录入人ID")
+ private Long recorder;
+
+ /**复制当前的对象为HtPatient*/
+ public HtPatient copy(){
+ HtPatient patient = new HtPatient();
+ BeanUtils.copyProperties(this, patient);
+ return patient;
+ }
+ }
+
+ @Data
+ @ApiModel
+ public static class QueryOtherMsg {
+ @ApiModelProperty("病人id")
+ private Long patientId;
+ @ApiModelProperty("类型")
+ private String queryType;
+ }
+
+ @Data
+ @ApiModel
+ public static class EditOtherMsg {
+ @ApiModelProperty("病人其他信息")
+ private JSONObject model;
+ @ApiModelProperty("类型")
+ private String editType;
+ }
+}
diff --git a/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java b/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java
new file mode 100644
index 00000000..e484948b
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java
@@ -0,0 +1,93 @@
+package com.ccsens.ht.bean.dto;
+
+import com.ccsens.ht.bean.po.HtPatientReport;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.beans.BeanUtils;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @program: ptpro
+ * @description: 报告单请求参数
+ * @author: wu huijuan
+ * @create: 2019/10/31 10:22
+ */
+public class PatientReportDto {
+
+ @ApiModel
+ @Data
+ public static class Generate{
+ @ApiModelProperty("病人ID")
+ @NotNull
+ private Long patientId;
+ }
+
+ @ApiModel
+ @Data
+ public static class Edit{
+ @ApiModelProperty("初步印象")
+ @NotNull
+ private String initialImpression;
+ @ApiModelProperty("临床诊断")
+ @NotNull
+ private String clinicalDiagnosis;
+ @ApiModelProperty("床号")
+ @NotNull
+ private String bedNumber;
+ @ApiModelProperty("病人年龄 ")
+ @NotNull
+ private Byte patientAge;
+ @ApiModelProperty("严重程度(1:轻度 2:中度 3:重度) ")
+ @NotNull
+ private Long pasi;
+ @ApiModelProperty("科别")
+ @NotNull
+ private String department;
+ @ApiModelProperty("病人报告单ID")
+ @NotNull
+ private Long id;
+
+ public HtPatientReport copy(){
+ HtPatientReport report = new HtPatientReport();
+ BeanUtils.copyProperties(this, report);
+ report.setReportTime(System.currentTimeMillis());
+ return report;
+ }
+ }
+
+ @ApiModel
+ @Data
+ public static class QueryReports{
+ @ApiModelProperty("病人ID")
+ @NotNull
+ private Long patientId;
+ @ApiModelProperty("第几页")
+ @Min(value = 1)
+ private int pageNum = 1;
+ @ApiModelProperty("每页多少条")
+ @Min(value = 1)
+ @Max(value=100)
+ private int pageSize = 10;
+ }
+
+ @ApiModel
+ @Data
+ public static class QueryDetail{
+ @ApiModelProperty("病人报告单ID")
+ @NotNull
+ private Long id;
+ }
+
+ /**医生对报告单权限*/
+ @ApiModel
+ @Data
+ public static class Authority{
+ @ApiModelProperty("病人报告单ID")
+ @NotNull
+ private Long id;
+ }
+}
diff --git a/ht/src/main/java/com/ccsens/ht/bean/dto/PositionDto.java b/ht/src/main/java/com/ccsens/ht/bean/dto/PositionDto.java
new file mode 100644
index 00000000..644a6923
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/bean/dto/PositionDto.java
@@ -0,0 +1,21 @@
+package com.ccsens.ht.bean.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @description:职务和职称
+ * @author: wu huijuan
+ * @create: 2019/11/19 16:24
+ */
+public class PositionDto {
+ @ApiModel
+ @Data
+ public static class Position {
+ @ApiModelProperty("上级部门ID 为空,默认查所有医院")
+ private Long superiorDepartmentId;
+ }
+
+
+}
diff --git a/ht/src/main/java/com/ccsens/ht/bean/dto/QueryDto.java b/ht/src/main/java/com/ccsens/ht/bean/dto/QueryDto.java
new file mode 100644
index 00000000..be91b829
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/bean/dto/QueryDto.java
@@ -0,0 +1,20 @@
+package com.ccsens.ht.bean.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @program: ptpro
+ * @description: 编辑病人信息
+ * @author: wu huijuan
+ * @create: 2019/10/30 14:33
+ */
+@ApiModel
+@Data
+public class QueryDto {
+ @ApiModelProperty("真正的请求参数")
+ private T param;
+ @ApiModelProperty("登录用户ID")
+ private Long userId;
+}
diff --git a/ht/src/main/java/com/ccsens/ht/bean/dto/QuestionDto.java b/ht/src/main/java/com/ccsens/ht/bean/dto/QuestionDto.java
new file mode 100644
index 00000000..3da611f0
--- /dev/null
+++ b/ht/src/main/java/com/ccsens/ht/bean/dto/QuestionDto.java
@@ -0,0 +1,58 @@
+package com.ccsens.ht.bean.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.servlet.http.Part;
+import javax.validation.constraints.NotNull;
+import java.io.File;
+import java.util.List;
+
+/**
+ * @description:
+ * @author: wu huijuan
+ * @create: 2019/11/08 15:37
+ */
+public class QuestionDto {
+
+ @Data
+ @ApiModel
+ public static class Query{
+
+ @ApiModelProperty("病人报告单ID")
+ @NotNull
+ private Long patientReportId;
+ @ApiModelProperty("测评类型")
+ @NotNull
+ private String code;
+ @ApiModelProperty("题号")
+ @NotNull
+ private int num;
+ }
+
+ @Data
+ @ApiModel("保存分数")
+ public static class Score{
+ @ApiModelProperty("病人报告单ID")
+ @NotNull
+ private Long patientReportId;
+ @ApiModelProperty("试题ID")
+ @NotNull
+ private Long questionId;
+ @ApiModelProperty("选项集合")
+ @NotNull
+ private List