Explorar o código

Merge branch 'dev' of chenweida/patient-co-management into dev

chenweida %!s(int64=8) %!d(string=hai) anos
pai
achega
198b8e8970

+ 19 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -39,6 +39,7 @@ import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
@ -1667,17 +1668,29 @@ public class FamilyContractService extends BaseService {
        return signFamilyDao.findNoHealthSignFamilyNum(doctor);
    }
    public Page<SignFamily> findNoHealthSignFamilyHealth(String doctor, Integer page, Integer pagesize) {
    public List<Patient> findNoHealthSignFamilyHealth(String doctor, Integer page, Integer pagesize,String patientName,String patientAddr) {
        if (pagesize == null || pagesize <= 0) {
            pagesize = 10;
        }
        if (page == null || page < 0) {
            page = 0;
        if (page == null || page <=0) {
            page =1;
        }
        // 分页信息
        PageRequest pageRequest = new PageRequest(page, pagesize);
        int start =(page-1)*pagesize;
        int end=page*pagesize-1;
        //先找出该医生下面没有健康管理师的患者 然后在去患者表找出该患者
        StringBuffer sql=new StringBuffer("" +
                " select p.* from wlyy_patient p where p.code in " +
                " (select a.patient code from wlyy_sign_family a where a.type = 2 and a.status >= 1 and a.doctor_health is null and a.doctor='"+doctor+"' order by a.czrq desc ) ");
        if(!org.springframework.util.StringUtils.isEmpty(patientName)){
            sql.append(" and name like '"+patientName+"%'");
        }
        if(!org.springframework.util.StringUtils.isEmpty(patientAddr)){
            sql.append(" and address like '"+patientAddr+"%'");
        }
        sql.append(" limit "+start+","+end+"");
        List<Patient> returnList= jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(Patient.class));
        return signFamilyDao.findNoHealthSignFamilyHealth(doctor, pageRequest);
        return returnList;
    }
    /**

+ 12 - 5
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -787,22 +787,29 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     * @param doctor   医生code
     * @param page     当前页
     * @param pageSize 每页显示条数
     * @param patientName 患者名称
     * @param patientAddr 患者居住地址
     * @return
     */
    @RequestMapping(value = "/findNoHealthSignFamilyHealth")
    @ResponseBody
    public String findNoHealthSignFamilyHealth(String doctor, Integer page, Integer pageSize) {
    public String findNoHealthSignFamilyHealth(
            String doctor,
            Integer page,
            Integer pageSize,
            @RequestParam(required = false) String patientName,
            @RequestParam(required = false) String patientAddr) {
        try {
            JSONArray array = new JSONArray();
            Page<SignFamily> list = familyContractService.findNoHealthSignFamilyHealth(doctor, page, pageSize);
            List<Patient> list = familyContractService.findNoHealthSignFamilyHealth(doctor, page, pageSize,patientName,patientAddr);
            if (list != null) {
                for (SignFamily sf : list) {
                for (Patient sf : list) {
                    if (sf == null) {
                        continue;
                    }
                    JSONObject json = new JSONObject();
                    json.put("signCode", sf.getCode());//签约code
                    json.put("code", sf.getPatient());//患者code
                    //json.put("signCode", sf.getCode());//签约code
                    json.put("code", sf.getCode());//患者code
                    json.put("name", sf.getName());//患者name
                    String idcard = sf.getIdcard();
                    if (StringUtils.isNotBlank(idcard) && (idcard.length() == 15 || idcard.length() == 18)) {