Просмотр исходного кода

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

lyr 8 лет назад
Родитель
Сommit
7394f6861c

+ 10 - 0
src/main/java/com/yihu/wlyy/service/app/disease/PatientDiseaseService.java

@ -56,6 +56,16 @@ public class PatientDiseaseService extends BaseService {
        return patientDiseaseDao.findByPatient(patient);
    }
    /**
     * 根据居民code查询三师疾病
     *
     * @param patient 居民code
     * @return
     */
    public List<PatientDisease> getPatientSsDisease(String patient) {
        return patientDiseaseDao.findByPatientSsDisease(patient);
    }
    /**
     * 根据居民code查询疾病
     *

+ 39 - 21
src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -93,15 +93,15 @@ public class SignPatientLabelInfoService extends BaseService {
                }
                startDate.add(Calendar.DATE, -week);
                sql += " and apply_date >= '" + (df.format(startDate.getTime()) + " 00:00:00")
                        + "' and apply_date <= '" + (df.format(today.getTime()) + " 23:59:59");
                        + "' and apply_date <= '" + (df.format(today.getTime()) + " 23:59:59'");
            } else if (labelCode.equals("2")) {
                startDate.set(Calendar.DATE, 1);
                sql += " and apply_date >= '" + (df.format(startDate.getTime()) + " 00:00:00")
                        + "' and apply_date <= '" + (df.format(today.getTime()) + " 23:59:59");
                        + "' and apply_date <= '" + (df.format(today.getTime()) + " 23:59:59'");
            } else if (labelCode.equals("3")) {
                startDate.add(Calendar.DATE, 29);
                sql += " and apply_date >= '" + (df.format(today.getTime()) + " 00:00:00")
                        + "' and apply_date <= '" + (df.format(startDate.getTime()) + " 23:59:59");
                        + "' and apply_date <= '" + (df.format(startDate.getTime()) + " 23:59:59'");
            } else {
                throw new Exception("label is not exist");
            }
@ -195,14 +195,16 @@ public class SignPatientLabelInfoService extends BaseService {
        SignPatientLabel labelNo = new SignPatientLabel();
        labelNo.setLabelCode("0");
        labelNo.setLabelName("未分组");
        labelNo.setStatus(1);
        labelNo.setIsSystem(1);
        labelNo.setLabelType(labelType);
        labelNo.setSort(999999999);
        if (!labelType.equals("5")) {
            labelNo.setLabelCode("0");
            labelNo.setLabelName("未分组");
            labelNo.setStatus(1);
            labelNo.setIsSystem(1);
            labelNo.setLabelType(labelType);
            labelNo.setSort(999999999);
        labels.add(labelNo);
            labels.add(labelNo);
        }
        if (labels != null) {
            for (SignPatientLabel label : labels) {
@ -216,32 +218,32 @@ public class SignPatientLabelInfoService extends BaseService {
                String sql = "";
                Object[] args = null;
                if(labelType.equals("5")){
                if (labelType.equals("5")) {
                    Calendar today = Calendar.getInstance();
                    Calendar startDate = Calendar.getInstance();
                    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
                    sql = "select count(DISTINCT patient) " +
                    sql = "select count(DISTINCT patient) count" +
                            " from " +
                            "     wlyy_sign_family " +
                            " where " + (doc.getLevel() == 2 ? " doctor" : "doctor_health") + " = ? and status > 0 " +
                            (teamCode > 0 ? " and admin_team_code = ? " : "");
                    if (label.getLabelCode().equals("1")) {
                        int week = today.get(Calendar.DAY_OF_WEEK) - 1;
                        if (week == 0) {
                        int week = today.get(Calendar.DAY_OF_WEEK) - 2;
                        if (week == -1) {
                            week = 6;
                        }
                        startDate.add(Calendar.DATE, -week);
                        sql += " and apply_date >= '" + (df.format(startDate.getTime()) + " 00:00:00")
                                + "' and apply_date <= '" + (df.format(today.getTime()) + " 23:59:59");
                                + "' and apply_date <= '" + (df.format(today.getTime()) + " 23:59:59'");
                    } else if (label.getLabelCode().equals("2")) {
                        startDate.set(Calendar.DATE, 1);
                        sql += " and apply_date >= '" + (df.format(startDate.getTime()) + " 00:00:00")
                                + "' and apply_date <= '" + (df.format(today.getTime()) + " 23:59:59");
                                + "' and apply_date <= '" + (df.format(today.getTime()) + " 23:59:59'");
                    } else if (label.getLabelCode().equals("3")) {
                        startDate.add(Calendar.DATE, 29);
                        sql += " and apply_date >= '" + (df.format(today.getTime()) + " 00:00:00")
                                + "' and apply_date <= '" + (df.format(startDate.getTime()) + " 23:59:59");
                                + "' and apply_date <= '" + (df.format(startDate.getTime()) + " 23:59:59'");
                    } else {
                        throw new Exception("label is not exist");
                    }
@ -250,7 +252,7 @@ public class SignPatientLabelInfoService extends BaseService {
                    } else {
                        args = new Object[]{doctor};
                    }
                }else {
                } else {
                    if (label.getLabelCode().equals("0")) {
                        sql = "select count(DISTINCT a.patient) count" +
                                " from" +
@ -280,10 +282,10 @@ public class SignPatientLabelInfoService extends BaseService {
                    }
                }
                Map<String, Object> count = jdbcTemplate.queryForMap(sql, args);
                List<Map<String, Object>> count = jdbcTemplate.queryForList(sql, args);
                if (count != null && count.containsKey("count")) {
                    amount = Integer.valueOf(String.valueOf(count.get("count")));
                if (count != null && count.size() > 0 && count.get(0).containsKey("count")) {
                    amount = Integer.valueOf(String.valueOf(count.get(0).get("count")));
                }
                json.put("amount", amount);
@ -313,6 +315,22 @@ public class SignPatientLabelInfoService extends BaseService {
        } else {
            idcard = p.getIdcard();
            patientName = p.getName();
            List<PatientDisease> diseaseSs = diseaseDao.findByPatientSsDisease(p.getCode());
            if (diseaseSs != null && diseaseSs.size() > 0) {
                String[] diseaseArr = disease.split(",");
                if(diseaseArr == null || diseaseArr.length < 1){
                    return -3;
                }
                for (PatientDisease dis : diseaseSs) {
                    if (!Arrays.asList(diseaseArr).contains(dis.getDisease())) {
                        return -3;
                    }
                }
            }
        }
        String[] diseaseArr = disease.split(",");

+ 55 - 278
src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -11,6 +11,7 @@ import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeam;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientDisease;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.patient.SignFamilyCode;
import com.yihu.wlyy.repository.consult.ConsultTeamDao;
@ -24,6 +25,7 @@ import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.repository.patient.SocialSecurityInfoDao;
import com.yihu.wlyy.repository.statistics.WlyySignFamilyCodeDao;
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.task.SignUploadTask;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -88,17 +90,18 @@ public class FamilyContractService extends BaseService {
    @Autowired
    private PatientDiseaseService patientDiseaseService;
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Autowired
    private PatientDiseaseDao patientDiseaseDao;
    @Autowired
    private SocialSecurityInfoDao socialSecurityInfoDao;
    @Autowired
    private SignPatientLabelInfoService labelInfoService;
    @Autowired
    private DoctorAdminTeamDao doctorAdminTeamDao;
    public SignFamily findSignFamilyByCode(String code){
       return signFamilyDao.findByCodeAndType(code,2);
    public SignFamily findSignFamilyByCode(String code) {
        return signFamilyDao.findByCodeAndType(code, 2);
    }
    public SignFamily findByPatientByType(String patient, int type) {
@ -638,7 +641,9 @@ public class FamilyContractService extends BaseService {
                                         String majorDoctorName,
                                         String hospital, String hospitalName,
                                         String idcard, String ssc, String mobile,
                                         String emerMobile, String images, String disease, String expenses, String signDoctorCode,
                                         String emerMobile, String images,
                                         String healthLabel, String customLabel, String disease,
                                         String expenses, String signDoctorCode,
                                         String signDoctorName, String signDoctorLevel, String customGroup) throws Exception {
        // 查询是否有家庭签约
        SignFamily sc = signFamilyDao.findByIdcard(idcard);
@ -790,123 +795,10 @@ public class FamilyContractService extends BaseService {
        wlyyDoctorTeamPatient.setCzrq(new Date());
        doctorTeamDoctor.save(wlyyDoctorTeamPatient);
        //病人分组类别
        String groupCode = "1";
        //判断病人分组
        if (!StringUtils.isEmpty(disease)) {
            List<String> diseases = Arrays.asList(disease.split(","));
            if (diseases.contains("1") || diseases.contains("2")) {
                groupCode = "2";
            }
        } else {
            String birth = patient.getIdcard().substring(6, 14);
            int year = Integer.valueOf(birth.substring(0, 4));
            int month = Integer.valueOf(birth.substring(4, 6));
            int day = Integer.valueOf(birth.substring(6));
            Calendar cal = Calendar.getInstance();
            int age = cal.get(Calendar.YEAR) - year;
            //周岁计算
            if (cal.get(Calendar.MONTH) > (month - 1) || (cal.get(Calendar.MONTH) == (month - 1) && cal.get(Calendar.DATE) > day)) {
                age--;
            }
            if (age >= 65) {
                groupCode = "3";
            }
        }
        //把病人添加到健康管理师的健康分组里
        DoctorPatientGroupInfo doctorPatientGroupInfo = new DoctorPatientGroupInfo();
        doctorPatientGroupInfo.setCzrq(new Date());
        doctorPatientGroupInfo.setDoctor(doctorHealth);
        doctorPatientGroupInfo.setStatus(1);
        doctorPatientGroupInfo.setPatient(patient.getCode());
        doctorPatientGroupInfo.setPname(patient.getName());
        doctorPatientGroupInfo.setPartAmount(0);
        doctorPatientGroupInfo.setGroup(groupCode);//默认健康分组
        doctorPatientGroupInfo.setQyrq(new Date());
        doctorPatientGroupInfo.setSignType("2");//家庭签约
        doctorPatientGroupInfoDao.save(doctorPatientGroupInfo);
        //把病人添加到全科医生的健康分组里
        doctorPatientGroupInfo = new DoctorPatientGroupInfo();
        doctorPatientGroupInfo.setCzrq(new Date());
        doctorPatientGroupInfo.setDoctor(doctor);
        doctorPatientGroupInfo.setStatus(1);
        doctorPatientGroupInfo.setPatient(patient.getCode());
        doctorPatientGroupInfo.setPname(patient.getName());
        doctorPatientGroupInfo.setPartAmount(0);
        doctorPatientGroupInfo.setGroup(groupCode);//默认健康分组
        doctorPatientGroupInfo.setQyrq(new Date());
        doctorPatientGroupInfo.setSignType("2");//家庭签约
        doctorPatientGroupInfoDao.save(doctorPatientGroupInfo);
        if (!StringUtils.isEmpty(customGroup) && !customGroup.equals("0")) {
            DoctorPatientGroupInfo customDoctorGroup = new DoctorPatientGroupInfo();
            customDoctorGroup.setCzrq(new Date());
            customDoctorGroup.setDoctor(signDoctorCode);
            customDoctorGroup.setStatus(1);
            customDoctorGroup.setPatient(patient.getCode());
            customDoctorGroup.setPname(patient.getName());
            customDoctorGroup.setPartAmount(0);
            customDoctorGroup.setGroup(customGroup);
            customDoctorGroup.setQyrq(new Date());
            customDoctorGroup.setSignType("2");//家庭签约
            doctorPatientGroupInfoDao.save(customDoctorGroup);
            SignFamily signFamily = signFamilyDao.findSsSignByDoctorPatient(sf.getDoctor(), sf.getPatient());
            if (signFamily != null) {
                DoctorPatientGroupInfo ssDoctorGroup = new DoctorPatientGroupInfo();
                ssDoctorGroup.setCzrq(new Date());
                ssDoctorGroup.setDoctor(signDoctorCode);
                ssDoctorGroup.setStatus(1);
                ssDoctorGroup.setPatient(patient.getCode());
                ssDoctorGroup.setPname(patient.getName());
                ssDoctorGroup.setPartAmount(0);
                ssDoctorGroup.setGroup(customGroup);
                ssDoctorGroup.setQyrq(new Date());
                ssDoctorGroup.setSignType("1");//三师签约
                doctorPatientGroupInfoDao.save(ssDoctorGroup);
            }
        }
        List<DoctorPatientGroupInfo> groups = doctorPatientGroupInfoDao.findPatientGroups(patient.getCode());
        if (groups != null && groups.size() > 0) {
            for (DoctorPatientGroupInfo group : groups) {
                if (StringUtils.isNotEmpty(group.getSignType()) && group.getSignType().equals("2")) {
                    continue;
                }
                if (group.getGroup().equals(customGroup)) {
                    continue;
                }
                DoctorPatientGroupInfo patientGroup = new DoctorPatientGroupInfo();
                patientGroup.setCzrq(new Date());
                patientGroup.setDoctor(group.getDoctor());
                patientGroup.setStatus(1);
                patientGroup.setPatient(patient.getCode());
                patientGroup.setPname(patient.getName());
                patientGroup.setPartAmount(0);
                patientGroup.setGroup(group.getGroup());
                patientGroup.setQyrq(new Date());
                patientGroup.setSignType("2");//家庭签约
                doctorPatientGroupInfoDao.save(patientGroup);
            }
        }
        if (!StringUtils.isEmpty(disease) && !disease.equals("0")) {
            boolean flag = patientDiseaseService.updatePatientDisease(sf.getPatient(), disease);
            if (!flag) {
                throw new Exception("疾病更新失败");
            }
        // 患者标签设置
        if(!(labelInfoService.setPatientLabels(patient.getCode(),patient.getIdcard(),
                patient.getName(),healthLabel,disease,customLabel) == 1)){
            throw new Exception("patient sign label settting error:" + patient.getIdcard());
        }
        SignFamily temp = signFamilyDao.save(sf);
@ -947,7 +839,9 @@ public class FamilyContractService extends BaseService {
                          String healthDoctor,
                          String healthDoctorName,
                          long msgid,
                          String patientCard, int type, String disease, String majorDoctor, String majorhDoctorName, String customGroup, String expenses) throws Exception {
                          String patientCard, int type,
                          String healthLabel, String customLabel, String disease,
                          String majorDoctor, String majorhDoctorName, String customGroup, String expenses) throws Exception {
        if (type != 1 && type != 2) {
            return -1;
        }
@ -1072,124 +966,10 @@ public class FamilyContractService extends BaseService {
            return 2;
        }
        //病人分组类别
        String groupCode = "1";
        //判断病人分组
        if (!StringUtils.isEmpty(disease)) {
            List<String> diseases = Arrays.asList(disease.split(","));
            if (diseases.contains("1") || diseases.contains("2")) {
                groupCode = "2";
            }
        } else {
            String birth = p.getIdcard().substring(6, 14);
            int year = Integer.valueOf(birth.substring(0, 4));
            int month = Integer.valueOf(birth.substring(4, 6));
            int day = Integer.valueOf(birth.substring(6));
            Calendar cal = Calendar.getInstance();
            int age = cal.get(Calendar.YEAR) - year;
            //周岁计算
            if (cal.get(Calendar.MONTH) > (month - 1) || (cal.get(Calendar.MONTH) == (month - 1) && cal.get(Calendar.DATE) > day)) {
                age--;
            }
            if (age >= 65) {
                groupCode = "3";
            }
        }
        //设置签约人到全科管理师和健康管理师的健康人群分组里
        //给病人分组
        //把病人添加到健康管理师的健康分组里
        DoctorPatientGroupInfo doctorPatientGroupInfo = new DoctorPatientGroupInfo();
        doctorPatientGroupInfo.setCzrq(new Date());
        doctorPatientGroupInfo.setDoctor(healthDoctor);
        doctorPatientGroupInfo.setStatus(1);
        doctorPatientGroupInfo.setPatient(p.getCode());
        doctorPatientGroupInfo.setPname(p.getName());
        doctorPatientGroupInfo.setPartAmount(0);
        doctorPatientGroupInfo.setGroup(groupCode);//默认健康分组
        doctorPatientGroupInfo.setQyrq(new Date());
        doctorPatientGroupInfo.setSignType("2");//家庭签约
        doctorPatientGroupInfoDao.save(doctorPatientGroupInfo);
        //把病人添加到全科医生的健康分组里
        doctorPatientGroupInfo = new DoctorPatientGroupInfo();
        doctorPatientGroupInfo.setCzrq(new Date());
        doctorPatientGroupInfo.setDoctor(sf.getDoctor());
        doctorPatientGroupInfo.setStatus(1);
        doctorPatientGroupInfo.setPatient(p.getCode());
        doctorPatientGroupInfo.setPname(p.getName());
        doctorPatientGroupInfo.setPartAmount(0);
        doctorPatientGroupInfo.setGroup(groupCode);//默认健康分组
        doctorPatientGroupInfo.setQyrq(new Date());
        doctorPatientGroupInfo.setSignType("2");//家庭签约
        doctorPatientGroupInfoDao.save(doctorPatientGroupInfo);
        if (!StringUtils.isEmpty(customGroup) && !customGroup.equals("0")) {
            DoctorPatientGroupInfo customDoctorGroup = new DoctorPatientGroupInfo();
            customDoctorGroup.setCzrq(new Date());
            customDoctorGroup.setDoctor(sf.getDoctor());
            customDoctorGroup.setStatus(1);
            customDoctorGroup.setPatient(p.getCode());
            customDoctorGroup.setPname(p.getName());
            customDoctorGroup.setPartAmount(0);
            customDoctorGroup.setGroup(customGroup);
            customDoctorGroup.setQyrq(new Date());
            customDoctorGroup.setSignType("2");//家庭签约
            doctorPatientGroupInfoDao.save(customDoctorGroup);
            SignFamily signFamily = signFamilyDao.findSsSignByDoctorPatient(sf.getDoctor(), sf.getPatient());
            if (signFamily != null) {
                DoctorPatientGroupInfo ssDoctorGroup = new DoctorPatientGroupInfo();
                ssDoctorGroup.setCzrq(new Date());
                ssDoctorGroup.setDoctor(sf.getDoctor());
                ssDoctorGroup.setStatus(1);
                ssDoctorGroup.setPatient(p.getCode());
                ssDoctorGroup.setPname(p.getName());
                ssDoctorGroup.setPartAmount(0);
                ssDoctorGroup.setGroup(customGroup);
                ssDoctorGroup.setQyrq(new Date());
                ssDoctorGroup.setSignType("1");//三师签约
                doctorPatientGroupInfoDao.save(ssDoctorGroup);
            }
        }
        List<DoctorPatientGroupInfo> groups = doctorPatientGroupInfoDao.findPatientGroups(p.getCode());
        if (groups != null && groups.size() > 0) {
            for (DoctorPatientGroupInfo group : groups) {
                if (StringUtils.isNotEmpty(group.getSignType()) && group.getSignType().equals("2")) {
                    continue;
                }
                if (group.getGroup().equals(customGroup)) {
                    continue;
                }
                DoctorPatientGroupInfo patientGroup = new DoctorPatientGroupInfo();
                patientGroup.setCzrq(new Date());
                patientGroup.setDoctor(group.getDoctor());
                patientGroup.setStatus(1);
                patientGroup.setPatient(p.getCode());
                patientGroup.setPname(p.getName());
                patientGroup.setPartAmount(0);
                patientGroup.setGroup(group.getGroup());
                patientGroup.setQyrq(new Date());
                patientGroup.setSignType("2");//家庭签约
                doctorPatientGroupInfoDao.save(patientGroup);
            }
        }
        if (!StringUtils.isEmpty(disease) && !disease.equals("0")) {
            boolean flag = patientDiseaseService.updatePatientDisease(sf.getPatient(), disease);
            if (!flag) {
                throw new Exception("疾病更新失败");
            }
        // 患者标签设置
        if(!(labelInfoService.setPatientLabels(p.getCode(),p.getIdcard(),
                p.getName(),healthLabel,disease,customLabel) == 1)){
            throw new Exception("patient sign label settting error:" + p.getIdcard());
        }
        // 推送消息消息给微信端
@ -1523,16 +1303,13 @@ public class FamilyContractService extends BaseService {
            }
            // 查询患者疾病
            String diseases = redisTemplate.opsForValue().get("disease:" + p.getCode());
            if (!StringUtils.isEmpty(diseases)) {
                JSONArray array = new JSONArray(diseases);
            List<PatientDisease> diseases = patientDiseaseDao.findByPatientSsDisease(p.getCode());
            if (diseases != null && diseases.size() > 0) {
                JSONArray disArray = new JSONArray();
                for (int i = 0; i < array.length(); i++) {
                    JSONObject json = array.getJSONObject(i);
                    if (json != null && json.get("signType").toString().equals("1")) {
                        disArray.put(json);
                    }
                for (PatientDisease dis : diseases) {
                    disArray.put(new JSONObject(dis));
                }
                result.put("diseases", disArray);
@ -1652,24 +1429,24 @@ public class FamilyContractService extends BaseService {
    public String produceSignAdminTeamCode() {
        StringBuffer sf=new StringBuffer();
        StringBuffer sf1=new StringBuffer();
        Long size=0L;
        StringBuffer sf = new StringBuffer();
        StringBuffer sf1 = new StringBuffer();
        Long size = 0L;
        //找出家庭签约中团队code是空的
        List<SignFamily> signFamilys= signFamilyDao.findBySignTypeAndTeamCode();
        sf.append("家庭签约中团队code是空的数据数:"+signFamilys.size());
        for(SignFamily signFamily:signFamilys){
        List<SignFamily> signFamilys = signFamilyDao.findBySignTypeAndTeamCode();
        sf.append("家庭签约中团队code是空的数据数:" + signFamilys.size());
        for (SignFamily signFamily : signFamilys) {
            //得到签约中的全科医生的团队
            String doctorCode=signFamily.getDoctor();
            Long id= doctorAdminTeamDao.findIdByLeaderCode(doctorCode);
            if(id!=null&&id>0){
            String doctorCode = signFamily.getDoctor();
            Long id = doctorAdminTeamDao.findIdByLeaderCode(doctorCode);
            if (id != null && id > 0) {
                size++;
                signFamily.setAdminTeamId(id);
            }else{
                sf1.append(",找不到医生所属的团队,医生code:"+doctorCode);
            } else {
                sf1.append(",找不到医生所属的团队,医生code:" + doctorCode);
            }
        }
        sf.append(",填充团队的签约数据数:"+size);
        sf.append(",填充团队的签约数据数:" + size);
        sf.append(sf1);
        return sf.toString();
    }
@ -1677,25 +1454,25 @@ public class FamilyContractService extends BaseService {
    /**
     * 分配健管师
     *
     * @param patient 患者code
     * @param patient      患者code
     * @param healthDoctor 健康管理师code
     * @return
     */
    public JSONObject updateSignInfo(String patient,String healthDoctor,String expensesType){
    public JSONObject updateSignInfo(String patient, String healthDoctor, String expensesType) {
        JSONObject result = new JSONObject();
        SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patient);
        if(signFamily == null){
            result.put("status",-1);
            result.put("msg","居民不存在家庭签约");
        if (signFamily == null) {
            result.put("status", -1);
            result.put("msg", "居民不存在家庭签约");
        }
        if(StringUtils.isNotEmpty(healthDoctor)) {
        if (StringUtils.isNotEmpty(healthDoctor)) {
            Doctor doctor = doctorDao.findByCode(healthDoctor);
            if(doctor == null){
                result.put("status",-2);
                result.put("msg","医生不存在");
            if (doctor == null) {
                result.put("status", -2);
                result.put("msg", "医生不存在");
            }
            if (StringUtils.isNotEmpty(signFamily.getDoctorHealth())) {
                // 取消原有健康管理师的家庭签约分组,并新增分组
@ -1794,30 +1571,30 @@ public class FamilyContractService extends BaseService {
            signFamily.setCzrq(new Date());
        }
        if(StringUtils.isNotEmpty(expensesType)){
        if (StringUtils.isNotEmpty(expensesType)) {
            if (StringUtils.isNotEmpty(signFamily.getMedicalInsuranceNum())) {
                result.put("status", -3);
                result.put("msg","数据已上传社保,不能修改补贴类型");
            }else{
                result.put("msg", "数据已上传社保,不能修改补贴类型");
            } else {
                signFamily.setExpensesType(expensesType);
            }
        }
        result.put("status",1);
        result.put("msg","更新成功");
        result.put("status", 1);
        result.put("msg", "更新成功");
        return result;
    }
    public List<SignFamily> findNoHealthSignFamilyNum(String doctor) {
       return  signFamilyDao.findNoHealthSignFamilyNum(doctor);
        return signFamilyDao.findNoHealthSignFamilyNum(doctor);
    }
    public Page<SignFamily> findNoHealthSignFamilyHealth(String doctor, Integer page, Integer pagesize) {
        if (pagesize==null||pagesize <= 0) {
        if (pagesize == null || pagesize <= 0) {
            pagesize = 10;
        }
        if (page==null||page < 0) {
        if (page == null || page < 0) {
            page = 0;
        }
        // 分页信息

+ 21 - 0
src/main/java/com/yihu/wlyy/web/doctor/patient/PatientDiseaseController.java

@ -57,6 +57,27 @@ public class PatientDiseaseController extends BaseController {
        }
    }
    /**
     * 查询患者的三师疾病
     *
     * @param patient 患者
     * @return
     */
    @RequestMapping(value = "/disease_sanshi")
    public String getPatientSsDisease(String patient) {
        try {
            if (StringUtils.isEmpty(patient)) {
                return error(-1, "患者不能为空");
            }
            List<PatientDisease> diseases = patientDiseaseService.getPatientSsDisease(patient);
            return write(200, "查询成功", "data", new JSONArray(diseases));
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 更新患者疾病
     *

+ 1 - 1
src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -159,7 +159,7 @@ public class SignPatientLabelInfoController extends BaseController {
                return error(-1, "搜索字段不能为空");
            }
            if (!StringUtils.isEmpty(labelCode) || StringUtils.isEmpty(labelType)) {
            if (!StringUtils.isEmpty(labelCode) && StringUtils.isEmpty(labelType)) {
                return error(-1, "标签参数不为空时标签类型不能为空");
            }

+ 12 - 2
src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -168,6 +168,8 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            String idcard,
            @RequestParam(required = false) String ssc,
            String mobile,
            String healthLabel,
            @RequestParam(required = false, defaultValue = "") String customLabel,
            @RequestParam(required = false, defaultValue = "") String disease,
            @RequestParam(required = false) String emerMobile,
            @RequestParam(required = false) String majorDoctor,
@ -225,6 +227,9 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            if (StringUtils.isEmpty(mobile)) {
                return error(-1, "手机号不允许为空!");
            }
            if(StringUtils.isEmpty(healthLabel)){
                return error(-1, "健康情况标签不能为空!");
            }
            int amount = familyContractService.hasSingStatus(idcard);
            if (amount > 0) {
                return error(-1, "该居民已签约了家庭医生!");
@ -239,7 +244,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            Doctor cDoctor = doctorService.findDoctorByCode(getUID());
            SignFamily sf = familyContractService.agent(getAccessToken(), name, doctor, doctorName,
                    healthDoctor, healthDoctorName, majorDoctor, majorDoctorName, cDoctor.getHospital(), cDoctor.getHosptialName(),
                    idcard, ssc, mobile, emerMobile, images, disease, expenses, signDoctorCode, signDoctorName, signDoctorLevel, group);
                    idcard, ssc, mobile, emerMobile, images, healthLabel,customLabel,disease, expenses, signDoctorCode, signDoctorName, signDoctorLevel, group);
            if (sf == null) {
                return error(-1, "代理签约失败!");
@ -271,6 +276,8 @@ public class DoctorFamilyContractController extends WeixinBaseController {
    public String sign(
            @RequestParam(required = true, defaultValue = "1") String signType,
            String healthDoctor,
            String healthLabel,
            @RequestParam(required = false, defaultValue = "") String customLabel,
            @RequestParam(required = false, defaultValue = "1") String disease,
            String healthDoctorName,
            @RequestParam(required = false) String majorDoctor,
@ -301,8 +308,11 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                e.printStackTrace();
            }
            if(StringUtils.isEmpty(healthLabel)){
                return error(-1, "健康情况标签不能为空!");
            }
            int res = familyContractService.handleSign(signType, getAccessToken(), healthDoctor, healthDoctorName, msgid, patientIDcard, type, disease, majorDoctor, majorDoctorName, group, expenses);
            int res = familyContractService.handleSign(signType, getAccessToken(), healthDoctor, healthDoctorName, msgid, patientIDcard, type,healthLabel,customLabel, disease, majorDoctor, majorDoctorName, group, expenses);
            if (res == -1) {
                return error(-1, "未知的处理类型!");
            } else if (res == 0) {