Browse Source

专病启动包配置

trick9191 7 years ago
parent
commit
c35d5a2c41

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

@ -27,6 +27,10 @@ public class PatientLabelVO {
    private String healthcode;
    @ApiModelProperty("性别")
    private String sex;
    @ApiModelProperty("计管师")
    private String healthAssistant;
    @ApiModelProperty("计管师姓名")
    private String healthAssistantName;
    public String getCode() {
        return code;
@ -107,4 +111,20 @@ public class PatientLabelVO {
    public void setSex(String sex) {
        this.sex = sex;
    }
    public String getHealthAssistant() {
        return healthAssistant;
    }
    public void setHealthAssistant(String healthAssistant) {
        this.healthAssistant = healthAssistant;
    }
    public String getHealthAssistantName() {
        return healthAssistantName;
    }
    public void setHealthAssistantName(String healthAssistantName) {
        this.healthAssistantName = healthAssistantName;
    }
}

+ 6 - 4
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java

@ -106,11 +106,12 @@ public class SpecialistController extends EnvelopRestController {
    @GetMapping(value = SpecialistMapping.specialist.findPatientRelatioByAssistant)
    @ApiOperation(value = "根据计管师获取居民信息")
    public Envelop<PatientRelationVO> findPatientRelatioByAssistant(@ApiParam(name = "assistant", value = "计管师") @RequestParam(required = true)String assistant,
    public Envelop<PatientRelationVO> findPatientRelatioByAssistant(@ApiParam(name = "doctor", value = "医生") @RequestParam(required = true)String doctor,
                                                                    @ApiParam(name = "assistant", value = "计管师") @RequestParam(required = true)String assistant,
                                                                    @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true)Integer page,
                                                                    @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true)Integer size) {
        try {
            return specialistService.findPatientRelatioByAssistant(assistant,page,size);
            return specialistService.findPatientRelatioByAssistant(doctor,assistant,page,size);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
@ -151,9 +152,10 @@ public class SpecialistController extends EnvelopRestController {
    @GetMapping(value = SpecialistMapping.specialist.getAssistantPatientCount)
    @ApiOperation(value = "根据计管获取居民数量")
    public Envelop<Long> getAssistantPatientCount(@ApiParam(name = "doctor", value = "计管师医生") @RequestParam(required = true)String doctor) {
    public Envelop<Long> getAssistantPatientCount(@ApiParam(name = "doctor", value = "医生") @RequestParam(required = true)String doctor,
                                                  @ApiParam(name = "assistant", value = "计管师医生") @RequestParam(required = true)String assistant) {
        try {
            return specialistService.getAssistantPatientCount(doctor);
            return specialistService.getAssistantPatientCount(doctor,assistant);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());

+ 20 - 6
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -144,7 +144,7 @@ public class SpecialistService{
        return Envelop.getSuccess(SpecialistMapping.api_success,true);
    }
    public Envelop<PatientRelationVO> findPatientRelatioByAssistant(String assistant,Integer page,Integer size){
    public Envelop<PatientRelationVO> findPatientRelatioByAssistant(String doctor ,String assistant,Integer page,Integer size){
        String sql ="SELECT " +
                " r.patient, " +
                " r.patient_name AS patientName, " +
@ -167,7 +167,8 @@ public class SpecialistService{
                " AND t.`status` = '1' " +
                " ) h ON h.patient = r.patient " +
                " WHERE " +
                " r.health_assistant = '"+assistant+"' LIMIT "+(page-1)*size+","+size;
                "  r.doctor = '"+doctor+"'"+
                " AND r.health_assistant = '"+assistant+"' LIMIT "+(page-1)*size+","+size;
        List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
@ -191,7 +192,9 @@ public class SpecialistService{
                " lb.label, " +
                " p.photo, " +
                " h.label_name as health, " +
                " h.label AS healthcode " +
                " h.label AS healthcode ," +
                " s.health_assistant AS healthAssistant," +
                " s.health_assistant_name AS healthAssistantName" +
                " FROM " +
                " ( " +
                "  SELECT " +
@ -255,9 +258,9 @@ public class SpecialistService{
        return Envelop.getSuccess(SpecialistMapping.api_success,count);
    }
    public Envelop<Long> getAssistantPatientCount(String doctor){
    public Envelop<Long> getAssistantPatientCount(String doctor,String assistant){
        String sql = "SELECT COUNT(1) AS total FROM wlyy_specialist_patient_relation r WHERE r.health_assistant = '"+doctor+"' AND r.`status` <> '-1' ";
        String sql = "SELECT COUNT(1) AS total FROM wlyy_specialist_patient_relation r WHERE r.doctor ='"+doctor+"'  AND r.health_assistant = '"+assistant+"' AND r.`status` <> '-1' ";
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        Long count = 0L;
@ -308,6 +311,17 @@ public class SpecialistService{
                " FROM " +
                " wlyy_specialist_patient_relation r " +
                " JOIN "+basedb+".wlyy_patient p ON r.patient = p.`code` " +
                " 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'" +
@ -329,7 +343,7 @@ public class SpecialistService{
                " FROM " +
                " wlyy_specialist_patient_relation r " +
                " JOIN "+basedb+".wlyy_patient p ON r.patient = p.`code` " +
                " LEFT JOIN ( " +
                " JOIN ( " +
                " SELECT " +
                "  t.label, " +
                "  t.label_name, " +