Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationPlanController.java
wangzhinan 6 years ago
parent
commit
30cef164df

+ 21 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java

@ -467,5 +467,26 @@ public class SpecialistController extends EnvelopRestEndpoint {
    }
    /**
     * 根据共管医生和居民code查询专科签约信息
     * @param patient
     * @param doctor
     * @return
     */
    @GetMapping(value = "/selectByAssistant")
    @ApiOperation(value = "根据共管医生和居民code查询专科签约信息")
    public MixEnvelop<SpecialistPatientRelationDO,SpecialistPatientRelationDO> selectByAssistant(
            @ApiParam(name = "patient", value = "居民code") @RequestParam(required = true)String patient,
            @ApiParam(name = "doctor", value = "共管医生code") @RequestParam(required = true)String doctor){
        try {
            MixEnvelop envelop = new MixEnvelop();
            envelop.setDetailModelList(specialistService.selectByAssistant(patient,doctor));
            return envelop;
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

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

@ -1,10 +1,11 @@
package com.yihu.jw.service;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dao.*;
import com.yihu.jw.entity.specialist.*;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.dao.PatientHospitalRecordDao;
import com.yihu.jw.dao.SpecialistPatientRelationDao;
import com.yihu.jw.entity.specialist.SpecialistPatientRelationDO;
import com.yihu.jw.restmodel.specialist.*;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.util.common.IdCardUtil;
@ -18,7 +19,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
@ -234,7 +234,7 @@ public class SpecialistService{
                "  t.label_type = '8' " +
                " AND t.`status` = '1' " +
                " ) h ON h.patient = lb.patient " +
                " WHERE ( s.doctor ='"+doctor+"' OR s.health_doctor='"+doctor+"') AND s.status >=0  AND s.sign_status >0"+
                " WHERE ( s.doctor ='"+doctor+"' OR s.health_doctor='"+doctor+"' OR s.health_assistant='"+doctor+ "') AND s.status >=0  AND s.sign_status >0"+
                " LIMIT "+(page-1)*size+","+size;
        
        if("7".equals(labelType)){
@ -281,8 +281,7 @@ public class SpecialistService{
                "  AND i.`status` = '1' " +
                " ) lb " +
                " JOIN wlyy_specialist_patient_relation s ON s.patient = lb.patient " +
                " WHERE " +
                " s.doctor = '"+doctor+"' AND s.status >=0  AND s.sign_status >0";
                " WHERE ( s.doctor ='"+doctor+"' OR s.health_doctor='"+doctor+"' OR s.health_assistant='"+doctor+ "')  AND s.status >=0  AND s.sign_status >0";
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        Long count = 0L;
        if(rstotal!=null&&rstotal.size()>0){
@ -947,4 +946,18 @@ public class SpecialistService{
        });
        return null==unique?0:unique.size();
    }
    /**
     * 根据共管医生和居民code查询专科签约信息
     *
     * @param patient
     * @param doctor
     * @return
     */
    public List<SpecialistPatientRelationDO> selectByAssistant(String patient,String doctor){
        String sql = "select * from wlyy_specialist_patient_relation r where r.health_assistant = '"+doctor+"' and r.patient = '"+patient+"' and status = 1 and sign_status = 1";
        List<SpecialistPatientRelationDO> relationDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationDO.class));
        return relationDOS;
    }
}