Forráskód Böngészése

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

lyr 8 éve
szülő
commit
78238bced8

+ 2 - 9
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java

@ -137,17 +137,13 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
	int updateOpenidByPatient(String openid, String patient);
	// 查询已签约的总数
	@Query("select count(1) from SignFamily a where a.doctor = ?1 and (a.status = 1 or a.status = 2) and a.type = 2")
	@Query("select count(1) from SignFamily a where (a.doctor = ?1 or a.doctorHealth = ?1) and (a.status = 1 or a.status = 2) and a.type = 2")
	int countAmountSignedByDoctor(String doctor);
	// 查询待签约总数
	@Query("select count(1) from SignFamily a where a.doctor = ?1 and a.status = 0 and a.type = 2")
	@Query("select count(1) from SignFamily a where (a.doctor = ?1 or a.doctorHealth = ?1) and a.status = 0 and a.type = 2")
	int countAmountUnsignByDoctor(String doctor);
	// 查询待签约总数
	@Query("select count(1) from SignFamily a where a.doctorHealth = ?1 and a.status = 0 and a.type = 2")
	int countAmountUnsignByDoctorHealth(String doctor);
	
	// 查询团队中的健康管理师 sf.doctorHealth,sf.doctorHealthName,
	//select sf.doctorHealth,sf.doctorHealthName,count(*) totalContract from SignFamily sf where sf.healthDoctor = ?1
	@Query("select sf.doctorHealth,sf.doctorHealthName,count(sf)  from SignFamily sf where sf.doctorHealth = ?1")
@ -213,9 +209,6 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
	@Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b where a.patient=b.code and a.doctor=?1 and a.status=?2 order by a.begin desc")
	Page<Object> findToBeSignSignWebByDoctor_0(String doctor,  int i, Pageable pageRequest);
	@Query("select count(1) from SignFamily a where a.doctorHealth = ?1 and (a.status = 1 or a.status = 2) and a.type = 2")
	int countAmountSignedByHeather(String uid);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type =1 and a.status >= 1")
	SignFamily findBySanshiPatient(String code);

+ 39 - 13
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -265,7 +265,7 @@ public class SignPatientLabelInfoService extends BaseService {
        String sqlDoc = sql.replaceAll("repdoctor", "doctor");
        String sqlDocHealth = sql.replaceAll("repdoctor", "doctor_health").replaceAll("t1", "t3").replaceAll("t2", "t4").replaceAll("repf", "repf1").replaceAll("repl", "repl1");
        sql = "select t.* from (" + sqlDoc + " union all " + sqlDocHealth + ") t limit " + start + "," + pagesize;
        sql = "select DISTINCT t.* from (" + sqlDoc + " union all " + sqlDocHealth + ") t limit " + start + "," + pagesize;
        signList = jdbcTemplate.queryForList(sql, args);
@ -292,8 +292,12 @@ public class SignPatientLabelInfoService extends BaseService {
                        // 缴费类型
                        jsonP.put("expensesType", sign.get("expenses_type") != null ? String.valueOf(sign.get("expenses_type")) : "");
                        if (StringUtils.isEmpty(String.valueOf(jsonP.get("expensesStatus"))) || String.valueOf(jsonP.get("expensesStatus")).equals("0")) {
                            String epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                            String epTime = "";
                            try {
                                epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                            if (StringUtils.isEmpty(epTime)) {
                                jsonP.put("expensesRemindStatus", 0);
                            } else {
@ -425,8 +429,12 @@ public class SignPatientLabelInfoService extends BaseService {
                        // 缴费类型
                        jsonP.put("expensesType", sign.get("expenses_type") != null ? String.valueOf(sign.get("expenses_type")) : "");
                        if (StringUtils.isEmpty(String.valueOf(jsonP.get("expensesStatus"))) || String.valueOf(jsonP.get("expensesStatus")).equals("0")) {
                            String epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                            String epTime = "";
                            try {
                                epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                            } catch (Exception e){
                                e.printStackTrace();
                            }
                            if (StringUtils.isEmpty(epTime)) {
                                jsonP.put("expensesRemindStatus", 0);
                            } else {
@ -1190,8 +1198,12 @@ public class SignPatientLabelInfoService extends BaseService {
                        // 缴费类型
                        jsonP.put("expensesType", sign.get("expenses_type") != null ? String.valueOf(sign.get("expenses_type")) : "");
                        if (StringUtils.isEmpty(String.valueOf(jsonP.get("expensesStatus"))) || String.valueOf(jsonP.get("expensesStatus")).equals("0")) {
                            String epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                            String epTime = "";
                            try {
                                epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                            if (StringUtils.isEmpty(epTime)) {
                                jsonP.put("expensesRemindStatus", 0);
                            } else {
@ -1610,8 +1622,12 @@ public class SignPatientLabelInfoService extends BaseService {
                        // 缴费类型
                        jsonP.put("expensesType", sign.get("expenses_type") != null ? String.valueOf(sign.get("expenses_type")) : "");
                        if (StringUtils.isEmpty(String.valueOf(jsonP.get("expensesStatus"))) || String.valueOf(jsonP.get("expensesStatus")).equals("0")) {
                            String epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                            String epTime = "";
                            try {
                                epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                            if (StringUtils.isEmpty(epTime)) {
                                jsonP.put("expensesRemindStatus", 0);
                            } else {
@ -1754,7 +1770,12 @@ public class SignPatientLabelInfoService extends BaseService {
                        // 缴费类型
                        jsonP.put("expensesType", sign.get("expenses_type") != null ? String.valueOf(sign.get("expenses_type")) : "");
                        if (StringUtils.isEmpty(String.valueOf(jsonP.get("expensesStatus"))) || String.valueOf(jsonP.get("expensesStatus")).equals("0")) {
                            String epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                            String epTime = "";
                            try{
                                epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                            if (StringUtils.isEmpty(epTime)) {
                                jsonP.put("expensesRemindStatus", 0);
@ -1889,7 +1910,7 @@ public class SignPatientLabelInfoService extends BaseService {
        } else {
            if (labelCode.equals("0")) {
                sql = "SELECT " +
                        "    t1.* " +
                        "    DISTINCT  t1.* " +
                        " FROM " +
                        "    wlyy_sign_family t1 " +
                        " left join " +
@ -1903,7 +1924,7 @@ public class SignPatientLabelInfoService extends BaseService {
                args = new Object[]{teamCode, labelType, teamCode};
            } else {
                sql = "SELECT " +
                        "    t1.* " +
                        "    DISTINCT t1.* " +
                        " FROM " +
                        "    wlyy_sign_family t1, " +
                        "    wlyy_sign_patient_label_info t2 " +
@ -1945,7 +1966,12 @@ public class SignPatientLabelInfoService extends BaseService {
                        // 缴费类型
                        jsonP.put("expensesType", sign.get("expenses_type") != null ? String.valueOf(sign.get("expenses_type")) : "");
                        if (StringUtils.isEmpty(String.valueOf(jsonP.get("expensesStatus"))) || String.valueOf(jsonP.get("expensesStatus")).equals("0")) {
                            String epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                            String epTime = "";
                            try {
                                epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                            if (StringUtils.isEmpty(epTime)) {
                                jsonP.put("expensesRemindStatus", 0);

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

@ -1275,16 +1275,6 @@ public class FamilyContractService extends BaseService {
    }
    /**
     * 查询待签约总数
     *
     * @param doctor
     * @return
     */
    public int countAmountUnsign2(String doctor) {
        return signFamilyDao.countAmountUnsignByDoctorHealth(doctor);
    }
    public List<?> amountPatients(String uid) {
        return null;
    }
@ -1329,11 +1319,6 @@ public class FamilyContractService extends BaseService {
        return year + hospital1.getRoadCode() + hospital1.getCenterSite() + "Y" + StringUtils.leftPad(String.valueOf(amount + 1), 5, "0");
    }
    public int countAmountSigned2(String uid) {
        return signFamilyDao.countAmountSignedByHeather(uid);
    }
    public SignFamily findBySanshiPatient(String code) {
        return signFamilyDao.findSanshiSignByPatient(code);

+ 7 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -55,7 +55,8 @@ public class SignWebService extends BaseService {
                "    ,b1.address " +
                "    ,b1.photo " +
                "    ,a1.status " +
                "    ,a1.id " +
                "    ,a1.id" +
                "    ,a1.begin" +
                (status == 1 ? "    ,a1.patient_apply_date as applyDate " : "    ,a1.expenses_time as applyDate ") +
                "    ,a1.reason " +
                "    ,b1.street_name as streetName" +
@ -66,7 +67,7 @@ public class SignWebService extends BaseService {
                " ,wlyy_patient b1 " +
                " where a1.patient = b1.code ";
        sql = "select t.* from (" + sql.replaceAll("repdoctor","doctor") + " union all "
        sql = "select DISTINCT t.* from (" + sql.replaceAll("repdoctor","doctor") + " union all "
                + sql.replaceAll("repdoctor","doctor_health").replaceAll("a1","a2").replaceAll("b1","b2")
                + ") t order by t.begin desc limit " + page * pagesize  + "," + pagesize;
@ -88,12 +89,13 @@ public class SignWebService extends BaseService {
                "    ,a1.reason " +
                "    ,b1.street_name as streetName" +
                "    ,b1.sex" +
                "    ,a1.begin" +
                " from " +
                " ( select code,patient,repdoctor,status,id,apply_date,reason,begin,expenses_status,LENGTH(trim(ifnull(expenses_status,''))) len from wlyy_sign_family where repdoctor = ? and status > ? and type = 2 ) a1 " +
                " ,wlyy_patient b1 " +
                " where a1.patient = b1.code and (a1.expenses_status = '0' or a1.len < 1) ";
        sqlExpenses = "select t.* from (" + sqlExpenses.replaceAll("repdoctor","doctor") + " union all "
        sqlExpenses = "select DISTINCT t.* from (" + sqlExpenses.replaceAll("repdoctor","doctor") + " union all "
                + sqlExpenses.replaceAll("repdoctor","doctor_health").replaceAll("a1","a2").replaceAll("b1","b2")
                + ") t order by t.begin desc limit " + page * pagesize  + "," + pagesize;
@ -115,12 +117,13 @@ public class SignWebService extends BaseService {
                "    ,a1.reason " +
                "    ,b1.street_name as streetName" +
                "    ,b1.sex" +
                "    ,a1.begin" +
                " from " +
                " ( select code,patient,repdoctor,status,id,apply_date,apply_unsign_date,reason,begin from wlyy_sign_family where repdoctor = ? and ( status = ? or status = ? ) and type = 2 ) a1 " +
                " ,wlyy_patient b1 " +
                " where a1.patient = b1.code ";
        surrSql = "select t.* from (" + surrSql.replaceAll("repdoctor","doctor") + " union all "
        surrSql = "select DISTINCT t.* from (" + surrSql.replaceAll("repdoctor","doctor") + " union all "
                + surrSql.replaceAll("repdoctor","doctor_health").replaceAll("a1","a2").replaceAll("b1","b2")
                + ") t order by t.begin desc limit " + page * pagesize  + "," + pagesize;

+ 4 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -613,15 +613,13 @@ public class DoctorController extends BaseController {
            Doctor temp = doctorInfoService.findDoctorByCode(getUID());
            if (temp != null) {
                JSONObject json = new JSONObject();
                int count1 = familyContractService.countAmountSigned(getUID());
                int count2 = familyContractService.countAmountSigned2(getUID());
                int count = familyContractService.countAmountSigned(getUID());
                // 审核总数
                json.put("signed_amount", count1 + count2);
                json.put("signed_amount", count);
                int count3 = familyContractService.countAmountUnsign(getUID());
                int count4 = familyContractService.countAmountUnsign2(getUID());
                int count1 = familyContractService.countAmountUnsign(getUID());
                // 等审核总数
                json.put("unsign_amount", count3 + count4);
                json.put("unsign_amount", count1);
                return write(200, "医生信息查询成功!", "data", json);
            } else {
                return error(-1, "医生信息查询失败!");

+ 6 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java

@ -256,8 +256,12 @@ public class DoctorSignController extends BaseController {
                    json.put("streetName", temp.get("streetName"));
                    json.put("sex", temp.get("sex"));
                    if (status == 5) {
                        String epTime = redisTemplate.opsForValue().get("expenses:remind:" + temp.get("patient"));
                        String epTime = "";
                        try {
                            epTime = redisTemplate.opsForValue().get("expenses:remind:" + temp.get("patient"));
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        if (StringUtils.isEmpty(epTime)) {
                            json.put("expensesRemindStatus", 0);
                        } else {