Sfoglia il codice sorgente

Merge branch 'dev' of trick9191/jw2.0 into dev

huangwenjie 7 anni fa
parent
commit
67df9b0874

+ 1 - 1
common/common-request-mapping/src/main/java/com/yihu/jw/rm/specialist/SpecialistMapping.java

@ -24,6 +24,6 @@ public class SpecialistMapping {
        public static final String getLabelpatientCount ="/getLabelpatientCount";
        public static final String getAssistantPatientCount ="/getAssistantPatientCount";
        public static final String getDoctorPatientByName ="/getDoctorPatientByName";
        public static final String findPatientNoAssistant ="/findPatientNoAssistant";
    }
}

+ 0 - 2
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/common/EnvelopRestController.java

@ -2,8 +2,6 @@ package com.yihu.jw.restmodel.common;
import com.fasterxml.jackson.databind.ObjectMapper;
//import com.yihu.jw.exception.ApiException;
//import com.yihu.jw.exception.code.ExceptionCode;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.exception.code.ExceptionCode;

+ 10 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/specialist/PatientLabelVO.java

@ -25,6 +25,8 @@ public class PatientLabelVO {
    private String health;
    @ApiModelProperty("居民健康情况code")
    private String healthcode;
    @ApiModelProperty("性别")
    private String sex;
    public String getCode() {
        return code;
@ -97,4 +99,12 @@ public class PatientLabelVO {
    public void setHealthcode(String healthcode) {
        this.healthcode = healthcode;
    }
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
}

+ 20 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/specialist/PatientRelationVO.java

@ -23,6 +23,10 @@ public class PatientRelationVO {
    private String photo;
    @ApiModelProperty("出院时间")
    private String createTime;
    @ApiModelProperty("居民健康情况")
    private String health;
    @ApiModelProperty("居民健康情况code")
    private String healthcode;
    public String getPatient() {
        return patient;
@ -71,4 +75,20 @@ public class PatientRelationVO {
    public void setSex(String sex) {
        this.sex = sex;
    }
    public String getHealth() {
        return health;
    }
    public void setHealth(String health) {
        this.health = health;
    }
    public String getHealthcode() {
        return healthcode;
    }
    public void setHealthcode(String healthcode) {
        this.healthcode = healthcode;
    }
}

+ 20 - 0
svr/svr-wlyy-specialist/pom.xml

@ -15,6 +15,26 @@
    <version>${parent.version}</version>
    <packaging>war</packaging>
    <build>
        <finalName>svr-wlyy-specialist</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <mainClass>com.yihu.jw.SvrWlyySpecialistApplication</mainClass>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>com.yihu.jw</groupId>

+ 13 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/config/WarConfig.java

@ -0,0 +1,13 @@
package com.yihu.jw.config;
import com.yihu.jw.SvrWlyySpecialistApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
public class WarConfig extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(SvrWlyySpecialistApplication.class);
    }
}

+ 16 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java

@ -164,7 +164,7 @@ public class SpecialistController extends EnvelopRestController {
    @GetMapping(value = SpecialistMapping.specialist.getDoctorPatientByName)
    @ApiOperation(value = "搜索专科医生居民")
    public Envelop<PatientRelationVO> getDoctorPatientByName(@ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true)String doctor,
                                                             @ApiParam(name = "name", value = "居民姓名模糊") @RequestParam(required = false)String nameKey,
                                                             @ApiParam(name = "nameKey", value = "居民姓名模糊") @RequestParam(required = false)String nameKey,
                                                             @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true)Integer page,
                                                             @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true)Integer size) {
        try {
@ -176,6 +176,21 @@ public class SpecialistController extends EnvelopRestController {
        }
    }
    @GetMapping(value = SpecialistMapping.specialist.findPatientNoAssistant)
    @ApiOperation(value = "获取未分配计管师居民列表")
    public Envelop<PatientRelationVO> findPatientNoAssistant(@ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true)String doctor,
                                                             @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true)Integer page,
                                                             @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true)Integer size){
        try {
            return specialistService.findPatientNoAssistant(doctor,page,size);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return Envelop.getError(e.getMessage());
        }
    }
//    @PostMapping(value = SpecialistMapping.specialist.createArticle)
//    @ApiOperation(value = "创建专科医生健康文章")

+ 86 - 5
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -7,6 +7,7 @@ import com.yihu.jw.restmodel.specialist.*;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -84,14 +85,15 @@ public class SpecialistService{
                " FROM " +
                " wlyy_specialist_patient_relation r " +
                " WHERE " +
                " r.patient " +
                " r.doctor ='"+doctor+"'" +
                " AND r.patient " +
                " NOT IN ( " +
                " SELECT " +
                " patient " +
                " FROM " +
                " "+basedb+".wlyy_sign_patient_label_info i " +
                " WHERE " +
                " i.label_type = '5' AND " +
                " i.label_type = '7' AND " +
                " i.status = 1 " +
                " )";
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
@ -114,7 +116,8 @@ public class SpecialistService{
                " wlyy_specialist_patient_relation r JOIN "+basedb+".wlyy_patient p ON p.code = r.patient  " +
                " LEFT JOIN wlyy_patient_hospital_record rd ON r.discharge_record = rd.id " +
                " WHERE " +
                " r.patient " +
                " r.doctor = '"+doctor+"'" +
                " AND r.patient " +
                " NOT IN ( " +
                "  SELECT " +
                "   i.patient " +
@ -146,9 +149,23 @@ public class SpecialistService{
                " r.patient, " +
                " r.patient_name AS patientName, " +
                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
                " p.photo " +
                " p.photo ," +
                " p.sex," +
                " h.label_name as health, " +
                " h.label AS healthcode " +
                " FROM " +
                " wlyy_specialist_patient_relation r JOIN "+basedb+".wlyy_patient p ON p.`code` = r.patient " +
                " LEFT JOIN ( " +
                " SELECT " +
                "  t.label, " +
                "  t.label_name, " +
                "  t.patient " +
                " FROM " +
                "  "+basedb+".wlyy_sign_patient_label_info t " +
                " WHERE " +
                "  t.label_type = '8' " +
                " AND t.`status` = '1' " +
                " ) h ON h.patient = r.patient " +
                " WHERE " +
                " r.health_assistant = '"+assistant+"' LIMIT "+(page-1)*size+","+size;
@ -162,6 +179,7 @@ public class SpecialistService{
        String sql="SELECT " +
                " p. NAME, " +
                " p. CODE, " +
                " p.sex," +
                " IFNULL( " +
                "  YEAR ( " +
                "   from_days(datediff(now(), p.birthday)) " +
@ -255,10 +273,23 @@ public class SpecialistService{
                " p.`name` AS patientName, " +
                " p.photo, " +
                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
                " p.sex " +
                " p.sex ," +
                " h.label_name as health, " +
                " h.label AS healthcode " +
                " FROM " +
                " wlyy_specialist_patient_relation r " +
                " JOIN "+basedb+".wlyy_patient p ON r.patient = p.`code` " +
                " LEFT JOIN ( " +
                " SELECT " +
                "  t.label, " +
                "  t.label_name, " +
                "  t.patient " +
                " FROM " +
                "  "+basedb+".wlyy_sign_patient_label_info t " +
                " WHERE " +
                "  t.label_type = '8' " +
                " AND t.`status` = '1' " +
                " ) h ON h.patient = r.patient " +
                " WHERE " +
                " r.doctor='"+doctor+"' " +
                " AND r.`status`<>'-1'" +
@ -270,6 +301,56 @@ public class SpecialistService{
        return Envelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
    }
    public Envelop<PatientRelationVO> findPatientNoAssistant(String doctor, Integer page,Integer size){
        String sqlTotal ="SELECT " +
                " COUNT(1) AS total" +
                " FROM " +
                " wlyy_specialist_patient_relation r " +
                " JOIN "+basedb+".wlyy_patient p ON r.patient = p.`code` " +
                " WHERE " +
                " r.doctor='"+doctor+"' " +
                " AND r.`status`<>'-1'" +
                " AND r.health_assistant IS NULL ";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sqlTotal);
        Long total = 0L;
        if(list!=null&&list.size()>0){
            total =  (Long) list.get(0).get("total");
        }
        String sql ="SELECT " +
                " p.code AS patient, " +
                " p.`name` AS patientName, " +
                " p.photo, " +
                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
                " p.sex, " +
                " h.label_name as health, " +
                " h.label AS healthcode " +
                " FROM " +
                " wlyy_specialist_patient_relation r " +
                " JOIN "+basedb+".wlyy_patient p ON r.patient = p.`code` " +
                " LEFT JOIN ( " +
                " SELECT " +
                "  t.label, " +
                "  t.label_name, " +
                "  t.patient " +
                " FROM " +
                "  "+basedb+".wlyy_sign_patient_label_info t " +
                " WHERE " +
                "  t.label_type = '8' " +
                " AND t.`status` = '1' " +
                " ) h ON h.patient = r.patient " +
                " WHERE " +
                " r.doctor='"+doctor+"' " +
                " AND r.`status`<>'-1'" +
                " AND r.health_assistant IS NULL "+
                " LIMIT "+(page-1)*size+","+size;
        List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
        return Envelop.getSuccessList(SpecialistMapping.api_success,patientRelationVOs,total.intValue());
    }
//    public Envelop<Boolean> createSpecialists(List<SpecialistDO> info){
//        specialistDao.save(info);
//        return Envelop.getSuccess(SpecialistMapping.api_success,true);

+ 5 - 1
svr/svr-wlyy-specialist/src/main/resources/application.yml

@ -99,6 +99,10 @@ fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
---
spring:
  profiles: jwprod
  profiles: prod
  datasource:
    url: jdbc:mysql://59.61.92.90:9069/wlyy_specialist?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy
    password: jkzlehr@123
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/

+ 2 - 5
svr/svr-wlyy-specialist/src/main/resources/bootstrap.yml

@ -26,7 +26,6 @@ eureka:
spring:
  profiles: jwtest
eureka:
  client:
    serviceUrl:
@ -37,7 +36,6 @@ eureka:
spring:
  profiles: jwdevtest
eureka:
  client:
    serviceUrl:
@ -46,11 +44,10 @@ eureka:
---
spring:
  profiles: jwprod
  profiles: prod
eureka:
  client:
    serviceUrl:
      #http://账号:密码@127.0.0.1:8761/eureka/
      defaultZone: http://jw:jkzl@127.0.0.1:8761/eureka/
      defaultZone: http://jw:jkzl@192.168.120.153:8761/eureka/