瀏覽代碼

专病服务优化相关代码提交

huangwenjie 6 年之前
父節點
當前提交
1c69c33a05

+ 9 - 0
app/app-iot-server/pom.xml

@ -148,6 +148,15 @@
            <artifactId>fastdfs-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
        </dependency>
        <dependency>
            <groupId>eu.medsea.mimeutil</groupId>
            <artifactId>mime-util</artifactId>
            <version>2.1.3</version>
        </dependency>
    </dependencies>
    <build>

+ 9 - 0
app/public-health-server/pom.xml

@ -127,6 +127,15 @@
            <artifactId>swagger-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>eu.medsea.mimeutil</groupId>
            <artifactId>mime-util</artifactId>
            <version>2.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
        </dependency>
    </dependencies>
    <build>

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

@ -34,6 +34,8 @@ public class SpecialistMapping {
        public static final String findPatientSignSpecialist ="/findPatientSignSpecialist";
        public static final String findPatientSignSpecialistInfo ="/findPatientSignSpecialistInfo";
        public static final String findDoctorAndDoctorHealthBySpecialDoctor ="/findDoctorAndDoctorHealthBySpecialDoctor";
        public static final String findSpecialistSignFamilyPatientCout ="/findSpecialistSignFamilyPatientCout";
        public static final String getSpecialistSignFamilyPatientByName ="/getSpecialistSignFamilyPatientByName";

+ 34 - 2
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java

@ -266,14 +266,46 @@ public class SpecialistController extends EnvelopRestEndpoint {
    
    @GetMapping(value = SpecialistMapping.specialist.findDoctorAndDoctorHealthBySpecialDoctor)
    @ApiOperation(value = "获取当前专科医生有关联的家庭医生和健管师列表")
    public Envelop findDoctorAndDoctorHealthBySpecialDoctor(
    public MixEnvelop findDoctorAndDoctorHealthBySpecialDoctor(
            @ApiParam(name = "doctor", value = "专科医生code") @RequestParam(required = true)String doctor){
        try {
            return specialistService.findDoctorAndDoctorHealthBySpecialDoctor(doctor);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    
    @GetMapping(value = SpecialistMapping.specialist.findSpecialistSignFamilyPatientCout)
    @ApiOperation(value = "获取专科医生家庭医生共管居民数目")
    public MixEnvelop<Long, Long> findSpecialistSignFamilyPatientCout(
            @ApiParam(name = "specialdoctor", value = "专科医生") @RequestParam(required = true)String specialdoctor,
            @ApiParam(name = "familydoctor", value = "家庭医生") @RequestParam(required = true)String familydoctor
    ){
        try {
            return specialistService.findSpecialistSignFamilyPatientCout(specialdoctor,familydoctor);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    
    @GetMapping(value = SpecialistMapping.specialist.getSpecialistSignFamilyPatientByName)
    @ApiOperation(value = "搜索专科医生家庭医生共管居民")
    public MixEnvelop<PatientRelationVO, PatientRelationVO> getSpecialistSignFamilyPatientByName(
            @ApiParam(name = "specialdoctor", value = "专科医生") @RequestParam(required = true)String specialdoctor,
            @ApiParam(name = "familydoctor", value = "家庭医生") @RequestParam(required = true)String familydoctor,
            @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 {
            return specialistService.getSpecialistSignFamilyPatientByName(specialdoctor,familydoctor,nameKey,page,size);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }

+ 45 - 3
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -5,6 +5,7 @@ import com.yihu.jw.entity.specialist.*;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.specialist.*;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
@ -596,7 +597,7 @@ public class SpecialistService{
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientSignInfoVOs.get(0));
    }
    
    public Envelop findDoctorAndDoctorHealthBySpecialDoctor(String doctor) {
    public MixEnvelop findDoctorAndDoctorHealthBySpecialDoctor(String doctor) {
        String sql = "SELECT " +
                "doctor.CODE AS CODE," +
                "doctor.NAME AS NAME," +
@ -622,8 +623,49 @@ public class SpecialistService{
                "SELECT a.doctor_health AS doctorcode FROM wlyy.wlyy_sign_family a RIGHT JOIN ( " +
                "SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 AND doctor='"+doctor+"') b ON a.patient=b.patient WHERE a.`status`=1) " +
                "t ON doctor.CODE=t.doctorcode";
        List<SignFamilyDoctorVO> patientSignInfoVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientSignInfoVO.class));
        return Envelop.getSuccess(SpecialistMapping.api_success,patientSignInfoVOs.get(0));
        List<SignFamilyDoctorVO> patientSignInfoVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamilyDoctorVO.class));
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientSignInfoVOs);
    }
    
    public MixEnvelop<Long,Long> findSpecialistSignFamilyPatientCout(String specialdoctor, String familydoctor) {
    
        String sql = "SELECT count(1) AS total " +
                "FROM wlyy.wlyy_sign_family a WHERE a.`status`=1 AND a.expenses_status=1 " +
                "AND patient IN (" +
                "SELECT patient FROM wlyy_specialist.wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 " +
                "AND doctor='"+specialdoctor+"') " +
                "AND (a.doctor='"+familydoctor+"' OR a.doctor_health='"+familydoctor+"') ";
    
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        Long count = 0L;
        if(rstotal!=null&&rstotal.size()>0){
            count = (Long) rstotal.get(0).get("total");
        }
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,count);
    }
    
    public MixEnvelop<PatientRelationVO,PatientRelationVO> getSpecialistSignFamilyPatientByName(String specialdoctor, String familydoctor, String nameKey, Integer page, Integer size) {
        String sql ="SELECT " +
                "p.CODE AS patient," +
                "p.`name` AS patientName," +
                "p.photo," +
                "IFNULL(YEAR (from_days(datediff(now(),p.birthday))),'未知') age," +
                "p.sex " +
                "FROM wlyy.wlyy_patient p " +
                "JOIN ( " +
                " SELECT a.patient FROM wlyy.wlyy_sign_family a WHERE patient IN (" +
                "  SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 " +
                "  AND doctor='"+specialdoctor+"') " +
                "  AND (a.doctor='"+familydoctor+"' OR a.doctor_health='"+familydoctor+"') ";
        if(StringUtils.isNotBlank(nameKey)){
            sql= sql + "  AND a.NAME LIKE '%"+nameKey+"%' ";
        }
        sql= sql +" AND a.`status`=1 AND a.expenses_status=1) s ON p.CODE=s.patient" +
                " LIMIT "+(page-1)*size+","+size;
    
        List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
    
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
    }

+ 16 - 0
svr/svr-wlyy-specialist/src/main/resources/bootstrap.yml

@ -18,6 +18,22 @@ spring:
---
spring:
  profiles: jwtest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.17.110.212:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: jwdevtest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.17.110.212:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: prod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.17.110.212:1221}