Quellcode durchsuchen

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

chenweida vor 8 Jahren
Ursprung
Commit
98c3e9cadf
16 geänderte Dateien mit 166 neuen und 118 gelöschten Zeilen
  1. 26 27
      patient-co-wlyy/src/main/java/com/yihu/wlyy/job/RenewToSignJob.java
  2. 35 35
      patient-co-wlyy/src/main/java/com/yihu/wlyy/job/SignEndJob.java
  3. 1 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java
  4. 3 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java
  5. 33 14
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java
  6. 3 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java
  7. 12 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java
  8. 6 3
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/archives/PatientArchivesController.java
  9. 2 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/booking/PatientBookingController.java
  10. 8 12
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultMoviController.java
  11. 2 3
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/EvaluateController.java
  12. 2 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthController.java
  13. 2 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthGuidanceController.java
  14. 21 13
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyContractController.java
  15. 2 2
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyWithoutFilterController.java
  16. 8 4
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/PatientSignController.java

+ 26 - 27
patient-co-wlyy/src/main/java/com/yihu/wlyy/job/RenewToSignJob.java

@ -22,39 +22,38 @@ public class RenewToSignJob implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        try {
            System.out.println("RenewToSign start");
            Calendar cal = Calendar.getInstance();
            int year = cal.get(Calendar.YEAR)-1;
            int month = cal.get(Calendar.MONTH)+1;
            if(month >=7){
                //设置已过期
                String sql = "UPDATE wlyy_sign_family t SET t.status = -4,t.apply_unsign_date='"+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss")+"' WHERE t.status>=0 AND t.sign_year='"+year+"'";
                //数据迁移
//                String sql2 ="INSERT INTO wlyy_sign_family(" +
//                        "code,lw_code,type,patient,openid,name,idcard,ssc," +
//                        "mobile,emer_mobile,hospital,hospital_name,doctor," +
//                        "doctor_name,begin,end,images,group_code,status,reason," +
//                        "czrq,team_code,sign_type,apply_date,release_speak," +
//                        "doctor_health_name,doctor_health,family_code,patient_apply_date," +
//                        "expenses,expenses_status,sign_source,sign_doctor_code,sign_doctor_name," +
//                        "sign_doctor_level,patient_apply_unsgin_date,apply_unsign_date,expenses_type," +
//                        "sign_year,medical_insurance_num,agent_doctor_code,agent_doctor_name," +
//                        "agent_doctor_level,admin_team_code,expenses_time,server_type,server_type_name,special_population,special_population_name) " +
//                        "SELECT code,lw_code,type,patient,openid,name,idcard,ssc," +
//                        "mobile,emer_mobile,hospital,hospital_name,doctor,doctor_name," +
//                        "begin,end,images,group_code,status,reason,czrq,team_code," +
//                        "sign_type,apply_date,release_speak,doctor_health_name," +
//                        "doctor_health,family_code,patient_apply_date,expenses," +
//                        "expenses_status,sign_source,sign_doctor_code,sign_doctor_name," +
//                        "sign_doctor_level,patient_apply_unsgin_date,apply_unsign_date," +
//                        "expenses_type,sign_year,medical_insurance_num,agent_doctor_code," +
//                        "agent_doctor_name,agent_doctor_level,admin_team_code,expenses_time,server_type,server_type_name,special_population,special_population_name " +
//                        "FROM wlyy_sign_family_renew t WHERE t.is_valid =0 AND t.status =1 AND t.sign_year='"+(year+1)+"' AND t.expenses_status='1'";
//                //更改迁移状态
//                String sql3 = "UPDATE wlyy_sign_family_renew t SET t.is_valid =1 WHERE t.is_valid =0 AND t.status =1 AND t.sign_year='"+(year+1)+"' AND t.expenses_status='1'";
                String sql = "UPDATE wlyy_sign_family t SET t.status = -4,t.apply_unsign_date='"+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss")+"'  WHERE t.status>=0 AND t.sign_year='"+year+"'";
//                //数据迁移
                String sql2 ="INSERT INTO wlyy_sign_family(" +
                        "code,lw_code,type,patient,openid,name,idcard,ssc," +
                        "mobile,emer_mobile,hospital,hospital_name,doctor," +
                        "doctor_name,begin,end,images,group_code,status,reason," +
                        "czrq,team_code,sign_type,apply_date,release_speak," +
                        "doctor_health_name,doctor_health,family_code,patient_apply_date," +
                        "expenses,expenses_status,sign_source,sign_doctor_code,sign_doctor_name," +
                        "sign_doctor_level,patient_apply_unsgin_date,apply_unsign_date,expenses_type," +
                        "sign_year,medical_insurance_num,agent_doctor_code,agent_doctor_name," +
                        "agent_doctor_level,admin_team_code,expenses_time,server_type,server_type_name,special_population,special_population_name,renew_flag,renew_change_reason) " +
                        "SELECT code,lw_code,type,patient,openid,name,idcard,ssc," +
                        "mobile,emer_mobile,hospital,hospital_name,doctor,doctor_name," +
                        "begin,end,images,group_code,status,reason,czrq,team_code," +
                        "sign_type,apply_date,release_speak,doctor_health_name," +
                        "doctor_health,family_code,patient_apply_date,expenses," +
                        "expenses_status,sign_source,sign_doctor_code,sign_doctor_name," +
                        "sign_doctor_level,patient_apply_unsgin_date,apply_unsign_date," +
                        "expenses_type,sign_year,medical_insurance_num,agent_doctor_code," +
                        "agent_doctor_name,agent_doctor_level,admin_team_code,expenses_time,server_type,server_type_name,special_population,special_population_name,renew_flag,renew_change_reason " +
                        "FROM wlyy_sign_family_renew t WHERE t.is_valid =0 AND t.sign_year='"+(year+1)+"'";
                //更改迁移状态
                String sql3 = "UPDATE wlyy_sign_family_renew t SET t.is_valid =1 WHERE t.is_valid =0 AND t.sign_year='"+(year+1)+"'";
                jdbcTemplate.execute(sql);
//                jdbcTemplate.execute(sql2);
//                jdbcTemplate.execute(sql3);
                jdbcTemplate.execute(sql2);
                jdbcTemplate.execute(sql3);
            }
            System.out.println("RenewToSign end");

+ 35 - 35
patient-co-wlyy/src/main/java/com/yihu/wlyy/job/SignEndJob.java

@ -22,7 +22,7 @@ public class SignEndJob implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        try {
            System.out.println("sign end job start");
            //System.out.println("sign end job start");
            //2017-06-06 新签约和续签逻辑修改
//            SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
//            Calendar today = Calendar.getInstance();
@ -37,41 +37,41 @@ public class SignEndJob implements Job {
//            int sucessTm = jdbcTemplate.update(sqlTm, start, end);
//            int sucess = jdbcTemplate.update(sql, start, end);
            Calendar cal = Calendar.getInstance();
            int year = cal.get(Calendar.YEAR)-1;
            int month = cal.get(Calendar.MONTH)+1;
            if(month >=7){
                //设置已过期
                String sql = "UPDATE wlyy_sign_family t SET t.status = -4,t.apply_unsign_date='"+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss")+"'  WHERE t.status>=0 AND t.sign_year='"+year+"'";
//                //数据迁移
                String sql2 ="INSERT INTO wlyy_sign_family(" +
                        "code,lw_code,type,patient,openid,name,idcard,ssc," +
                        "mobile,emer_mobile,hospital,hospital_name,doctor," +
                        "doctor_name,begin,end,images,group_code,status,reason," +
                        "czrq,team_code,sign_type,apply_date,release_speak," +
                        "doctor_health_name,doctor_health,family_code,patient_apply_date," +
                        "expenses,expenses_status,sign_source,sign_doctor_code,sign_doctor_name," +
                        "sign_doctor_level,patient_apply_unsgin_date,apply_unsign_date,expenses_type," +
                        "sign_year,medical_insurance_num,agent_doctor_code,agent_doctor_name," +
                        "agent_doctor_level,admin_team_code,expenses_time,server_type,server_type_name,special_population,special_population_name) " +
                        "SELECT code,lw_code,type,patient,openid,name,idcard,ssc," +
                        "mobile,emer_mobile,hospital,hospital_name,doctor,doctor_name," +
                        "begin,end,images,group_code,status,reason,czrq,team_code," +
                        "sign_type,apply_date,release_speak,doctor_health_name," +
                        "doctor_health,family_code,patient_apply_date,expenses," +
                        "expenses_status,sign_source,sign_doctor_code,sign_doctor_name," +
                        "sign_doctor_level,patient_apply_unsgin_date,apply_unsign_date," +
                        "expenses_type,sign_year,medical_insurance_num,agent_doctor_code," +
                        "agent_doctor_name,agent_doctor_level,admin_team_code,expenses_time,server_type,server_type_name,special_population,special_population_name " +
                        "FROM wlyy_sign_family_renew t WHERE t.is_valid =0 AND t.status =1 AND t.sign_year='"+(year+1)+"' AND t.expenses_status='1'";
                //更改迁移状态
                String sql3 = "UPDATE wlyy_sign_family_renew t SET t.is_valid =1 WHERE t.is_valid =0 AND t.status =1 AND t.sign_year='"+(year+1)+"' AND t.expenses_status='1'";
                jdbcTemplate.execute(sql);
                jdbcTemplate.execute(sql2);
                jdbcTemplate.execute(sql3);
            }
//            Calendar cal = Calendar.getInstance();
//            int year = cal.get(Calendar.YEAR)-1;
//            int month = cal.get(Calendar.MONTH)+1;
//            if(month >=7){
//                //设置已过期
//                String sql = "UPDATE wlyy_sign_family t SET t.status = -4,t.apply_unsign_date='"+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss")+"'  WHERE t.status>=0 AND t.sign_year='"+year+"'";
////                //数据迁移
//                String sql2 ="INSERT INTO wlyy_sign_family(" +
//                        "code,lw_code,type,patient,openid,name,idcard,ssc," +
//                        "mobile,emer_mobile,hospital,hospital_name,doctor," +
//                        "doctor_name,begin,end,images,group_code,status,reason," +
//                        "czrq,team_code,sign_type,apply_date,release_speak," +
//                        "doctor_health_name,doctor_health,family_code,patient_apply_date," +
//                        "expenses,expenses_status,sign_source,sign_doctor_code,sign_doctor_name," +
//                        "sign_doctor_level,patient_apply_unsgin_date,apply_unsign_date,expenses_type," +
//                        "sign_year,medical_insurance_num,agent_doctor_code,agent_doctor_name," +
//                        "agent_doctor_level,admin_team_code,expenses_time,server_type,server_type_name,special_population,special_population_name,renew_flag,renew_change_reason) " +
//                        "SELECT code,lw_code,type,patient,openid,name,idcard,ssc," +
//                        "mobile,emer_mobile,hospital,hospital_name,doctor,doctor_name," +
//                        "begin,end,images,group_code,status,reason,czrq,team_code," +
//                        "sign_type,apply_date,release_speak,doctor_health_name," +
//                        "doctor_health,family_code,patient_apply_date,expenses," +
//                        "expenses_status,sign_source,sign_doctor_code,sign_doctor_name," +
//                        "sign_doctor_level,patient_apply_unsgin_date,apply_unsign_date," +
//                        "expenses_type,sign_year,medical_insurance_num,agent_doctor_code," +
//                        "agent_doctor_name,agent_doctor_level,admin_team_code,expenses_time,server_type,server_type_name,special_population,special_population_name,renew_flag,renew_change_reason " +
//                        "FROM wlyy_sign_family_renew t WHERE t.is_valid =0 AND t.sign_year='"+(year+1)+"'";
//                //更改迁移状态
//                String sql3 = "UPDATE wlyy_sign_family_renew t SET t.is_valid =1 WHERE t.is_valid =0 AND t.sign_year='"+(year+1)+"'";
//                jdbcTemplate.execute(sql);
//                jdbcTemplate.execute(sql2);
//                jdbcTemplate.execute(sql3);
//            }
            System.out.println("sign end job end");
            //System.out.println("sign end job end");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("sign end job failed");

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java

@ -1173,7 +1173,7 @@ public class FamilyMemberService extends BaseService {
    }
    public boolean isMobileNO(String number){
        Pattern pattern = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
        Pattern pattern = Pattern.compile("^1(3|4|5|7|8)[0-9]\\d{8}$");
        Matcher m = pattern.matcher(number);
        return m.matches();
    }

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

@ -3228,11 +3228,13 @@ public class FamilyContractService extends BaseService {
        //判断续签医生是否一致
        if(doctor.equals((String)sign.get("doctor"))){
            //如果一致保存团队信息
            sf.setRenewFlag("1");
            sf.setTeamCode((String)sign.get("teamCode"));
            Integer c=(Integer)sign.get("adminTeamCode");
            sf.setAdminTeamId(c.longValue());
        }else {
            //如果不一致 查看医生团队
            sf.setRenewFlag("2");
//            String tcSql = "SELECT t.id FROM wlyy_admin_team t WHERE t.leader_code ='"+doctor+"'";
//            List<Map<String ,Object>> ids = jdbcTemplate.queryForList(tcSql);
//            if(ids!=null&&ids.size()>0){
@ -3340,7 +3342,7 @@ public class FamilyContractService extends BaseService {
            Message message = new Message();
            message.setCzrq(new Date());
            message.setCreateTime(new Date());
            message.setContent("您有一条新的家庭医生签约申请!");
            message.setContent("您有一条新的家庭医生续签申请!");
            message.setRead(1);//设置未读
            message.setReceiver(doctor);//设置接受医生的code
            message.setSender(patient);//设置发送的用户

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

@ -112,8 +112,9 @@ public class SignWebService extends BaseService {
                "    ,b.street_name as streetName" +
                "    ,b.sex" +
                "    ,b.openid" +
                "    ,a.renew_flag as renewFlag" +
                " from " +
                " ( select code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin from wlyy_sign_family where (doctor = ? or doctor_health = ?) and status = ? and type = 2" +
                " ( select renew_flag,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin from wlyy_sign_family where doctor = ?  and status = ? and type = 2" +
                (status == 3 ? " and expenses_status = '1'" : "") + " order by begin desc ) a " +
                " ,wlyy_patient b " +
                " where a.patient = b.code  order by a.begin desc limit " + page * pageSize + "," + pageSize;
@ -137,8 +138,9 @@ public class SignWebService extends BaseService {
                "    ,b.street_name as streetName" +
                "    ,b.sex" +
                "    ,b.openid" +
                "    ,a.renew_flag as renewFlag" +
                " from " +
                " ( select code,patient,doctor,status,id,apply_date,reason,begin,expenses_status,LENGTH(trim(ifnull(expenses_status,''))) len from wlyy_sign_family where (doctor = ? or doctor_health = ?) and status > ? and type = 2 order by begin desc ) a " +
                " ( select renew_flag,code,patient,doctor,status,id,apply_date,reason,begin,expenses_status,LENGTH(trim(ifnull(expenses_status,''))) len from wlyy_sign_family where doctor = ?  and status > ? and type = 2 order by begin desc ) a " +
                " ,wlyy_patient b " +
                " where a.patient = b.code and (a.expenses_status = '0' or a.len < 1) order by a.begin desc limit " + page * pageSize + "," + pageSize;
@ -161,8 +163,9 @@ public class SignWebService extends BaseService {
                "    ,b.street_name as streetName" +
                "    ,b.sex" +
                "    ,b.openid" +
                "    ,a.renew_flag as renewFlag" +
                " from " +
                " ( select code,patient,doctor,status,id,apply_date,apply_unsign_date,reason,begin from wlyy_sign_family where (doctor = ? or doctor_health = ?) and ( status = ? or status = ? ) and type = 2 order by begin desc ) a " +
                " ( select renew_flag,code,patient,doctor,status,id,apply_date,apply_unsign_date,reason,begin from wlyy_sign_family where doctor = ?  and ( status = ? or status = ? ) and type = 2 order by begin desc ) a " +
                " ,wlyy_patient b " +
                " where a.patient = b.code  order by a.begin desc limit " + page * pageSize + "," + pageSize;
@ -173,19 +176,19 @@ public class SignWebService extends BaseService {
        List<Map<String, Object>> patients = null;
        switch (status) {
            case 1:// 待签约
                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, 0});
                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, 0});
                break;
            case 2:// 待解约
                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, 2});
                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, 2});
                break;
            case 3:// 已签约
                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, 1});
                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, 1});
                break;
            case 4:// 4已经解约
                patients = jdbcTemplate.queryForList(surrSql, new Object[]{doctor, doctor, -3, -4});
                patients = jdbcTemplate.queryForList(surrSql, new Object[]{doctor, -3, -4});
                break;
            case 5: // 未缴费
                patients = jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor, doctor, 0});
                patients = jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor, 0});
        }
        return patients;
@ -847,7 +850,7 @@ public class SignWebService extends BaseService {
                "    ,a.czrq" +
                "    ,a.renew_flag as renewFlag "+
                " from " +
                " ( select czrq,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin,renew_flag from wlyy_sign_family_renew where (doctor = ? or doctor_health = ?) and status = ? and type = 2" +
                " ( select czrq,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin,renew_flag from wlyy_sign_family_renew where doctor = ? and status = ? and type = 2" +
                " order by begin desc ) a " +
                " ,wlyy_patient b " +
                " where a.patient = b.code  order by a.begin desc limit " + page * pageSize + "," + pageSize;
@ -874,7 +877,7 @@ public class SignWebService extends BaseService {
                "    ,a.czrq" +
                "    ,a.renew_flag as renewFlag "+
                " from " +
                " ( select czrq,renew_flag,code,patient,doctor,status,id,apply_date,reason,begin,expenses_status,LENGTH(trim(ifnull(expenses_status,''))) len from wlyy_sign_family_renew where (doctor = ? or doctor_health = ?) and status > ? and type = 2 order by begin desc ) a " +
                " ( select czrq,renew_flag,code,patient,doctor,status,id,apply_date,reason,begin,expenses_status,LENGTH(trim(ifnull(expenses_status,''))) len from wlyy_sign_family_renew where doctor = ? and status > ? and type = 2 order by begin desc ) a " +
                " ,wlyy_patient b " +
                " where a.patient = b.code and a.expenses_status = '0' order by a.begin desc limit " + page * pageSize + "," + pageSize;
@ -900,7 +903,7 @@ public class SignWebService extends BaseService {
                "    ,a.czrq" +
                "    ,a.renew_flag as renewFlag "+
                " from " +
                " ( select expenses_status,czrq,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin,renew_flag from wlyy_sign_family_renew where (doctor = ? or doctor_health = ?) and status = ? and type = 2" +
                " ( select expenses_status,czrq,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin,renew_flag from wlyy_sign_family_renew where doctor = ? and status = ? and type = 2" +
                " order by begin desc ) a " +
                " ,wlyy_patient b " +
                " where a.patient = b.code and a.expenses_status = '1' order by a.begin desc limit " + page * pageSize + "," + pageSize;
@ -911,13 +914,13 @@ public class SignWebService extends BaseService {
        List<Map<String, Object>> patients = null;
        switch (status) {
            case 1:// 待处理
                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, 0});
                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, 0});
                break;
            case 2:// 待缴费
                patients = jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor, doctor, 0});
                patients = jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor, 0});
                break;
            case 3:// 已签约
                patients = jdbcTemplate.queryForList(signedSql, new Object[]{doctor, doctor, 1});
                patients = jdbcTemplate.queryForList(signedSql, new Object[]{doctor, 1});
                break;
        }
@ -1879,4 +1882,20 @@ public class SignWebService extends BaseService {
       List<SystemDict> systemDict = systemDictService.getDictByDictName("RENEW_CHANGE_REASON");
        return new JSONArray(systemDict);
    }
    public JSONObject getPatientSignLogInfo(String patient){
        Patient p = patientService.findByCode(patient);
        if(p!=null){
            String sql = "SELECT f.hospital_name as oldHospitalName,t.name AS oldTeamName,d.name as OldLeaderName,f.doctor_name AS OldDoctorName,f.doctor_health_name AS OldHealthDoctorName FROM wlyy_sign_family_renew_log r  " +
                    " LEFT JOIN wlyy_sign_family f ON r.old_sign_code = f.code " +
                    " LEFT JOIN wlyy_admin_team t ON r.old_admin_team_id = t.id " +
                    " LEFt JOIN wlyy_doctor d ON t.leader_code = d.code  " +
                    " WHERE r.idcard ='"+p.getIdcard()+"' AND r.sign_year='"+DateUtil.getSignYear()+"'";
            List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
            if(list!=null&&list.size()>0){
               return new JSONObject(list.get(0));
            }
        }
        return new JSONObject();
    }
}

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -4417,6 +4417,9 @@ public class StatisticsService extends BaseService {
    public JSONObject getConsultingStatisticsListYear(Integer level, String area, String lowlevel, String year) {
        return null;
    }

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

@ -235,6 +235,7 @@ public class DoctorSignController extends WeixinBaseController {
                    json.put("photo", temp.get("photo"));
                    json.put("status", temp.get("status"));
                    json.put("openid", temp.get("openid"));
                    json.put("renewFlag", temp.get("renewFlag"));
                    String statusName = "";
                    switch (Integer.parseInt(temp.get("status").toString())) {
                        case 0:
@ -658,4 +659,15 @@ public class DoctorSignController extends WeixinBaseController {
            return error(-1, "查询失败");
        }
    }
    @RequestMapping(value = "/getPatientSignLogInfo", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    public String getPatientSignLogInfo(@RequestParam(required = true)String patient){
        try {
            JSONObject result = signWebService.getPatientSignLogInfo(patient);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            return error(-1, "查询失败");
        }
    }
}

+ 6 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/archives/PatientArchivesController.java

@ -113,7 +113,8 @@ public class PatientArchivesController extends WeixinBaseController {
    public String getEventCatalog(@ApiParam(name="event",value="事件ID",defaultValue = "")
                                @RequestParam(value="event",required = true) String event) {
        try {
            List<Map<String,String>> result = patientRecordService.getEventCatalog(getUID(),event);
            List<Map<String,String>> result = patientRecordService.getEventCatalog(getRepUID(),event);
//            List<Map<String,String>> result = patientRecordService.getEventCatalog(getUID(),event);
            return write(200, "通过事件号获取档案类型列表成功!", "data", result);
        } catch (Exception e) {
@ -140,7 +141,8 @@ public class PatientArchivesController extends WeixinBaseController {
                               @ApiParam(name="pageSize",value="每页几行",defaultValue = "10")
                                   @RequestParam(value="pageSize",required = true) String pageSize) {
        try {
            String result = patientRecordService.getDrugsListPage(getUID(), page, pageSize);     //"P20161008001"
            String result = patientRecordService.getDrugsListPage(getRepUID(), page, pageSize);     //"P20161008001"
//            String result = patientRecordService.getDrugsListPage(getUID(), page, pageSize);     //"P20161008001"
            return write(200, "获取用药记录成功!", "data", result);
        } catch (Exception e) {
@ -261,7 +263,8 @@ public class PatientArchivesController extends WeixinBaseController {
                                 @RequestParam(value="data",required = true) String data)
    {
        try {
            patientEventService.saveEventDetail(data, getUID());
            patientEventService.saveEventDetail(data, getRepUID());
//            patientEventService.saveEventDetail(data, getUID());
            return write(200, "保存就诊事件成功!");
        } catch (Exception e) {

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/booking/PatientBookingController.java

@ -64,7 +64,8 @@ public class PatientBookingController extends WeixinBaseController{
            if (re) {
                //更新状态
                patientReservationService.patientCancelOrder(orderId,getUID());//"9aa5c557e06a4324911487a035195545"
                patientReservationService.patientCancelOrder(orderId,getRepUID());//"9aa5c557e06a4324911487a035195545"
//                patientReservationService.patientCancelOrder(orderId,getUID());//"9aa5c557e06a4324911487a035195545"
                //微信消息
                Patient p = patientService.findByCode(obj.getPatient());
                if (StringUtils.isNotEmpty(p.getOpenid())) {

+ 8 - 12
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultMoviController.java

@ -1,23 +1,18 @@
package com.yihu.wlyy.web.patient.consult;
import com.yihu.wlyy.entity.consult.ConsultMoVi;
import com.yihu.wlyy.entity.doctor.profile.DoctorComment;
import com.yihu.wlyy.service.app.consult.ConsultMoviService;
import com.yihu.wlyy.service.app.consult.DoctorCommentService;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yihu.wlyy.entity.consult.ConsultMoVi;
import com.yihu.wlyy.entity.doctor.profile.DoctorComment;
import com.yihu.wlyy.service.app.consult.ConsultMoviService;
import com.yihu.wlyy.service.app.consult.DoctorCommentService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.WeixinBaseController;
/**
 * 患者端视频咨询控制类
 * 
@ -61,7 +56,7 @@ public class ConsultMoviController extends WeixinBaseController {
	 * @param hour_begin 预约开始时间
	 * @param hour_end 预约结束时间
	 * @param content 咨询内容说明
	 * @param imageUrls 图片URL,多图逗号分隔
	 * @param images 图片URL,多图逗号分隔
	 * @return
	 */
	@RequestMapping(value = "add")
@ -97,7 +92,8 @@ public class ConsultMoviController extends WeixinBaseController {
				doctor = consultMoviService.findToDoctor(consult);
			}
			// 保存评价
			DoctorComment comment = doctorCommentService.consultMoViComment(getUID(), consult, content, doctor, star, 1);
			DoctorComment comment = doctorCommentService.consultMoViComment(getRepUID(), consult, content, doctor, star, 1);
//			DoctorComment comment = doctorCommentService.consultMoViComment(getUID(), consult, content, doctor, star, 1);
			if (comment == null) {
				return error(-1, "评价失败!");
			}

+ 2 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/EvaluateController.java

@ -1,12 +1,10 @@
package com.yihu.wlyy.web.patient.consult;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.consult.Evaluate;
import com.yihu.wlyy.entity.consult.EvaluateLabel;
import com.yihu.wlyy.service.app.consult.ConsultTeamService;
import com.yihu.wlyy.service.app.consult.EvaluateLabelService;
import com.yihu.wlyy.service.app.consult.EvaluateService;
import com.yihu.wlyy.util.ClazzReflect;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import org.json.JSONArray;
@ -44,7 +42,8 @@ public class EvaluateController  extends BaseController {
    @ResponseBody
    public String save(@RequestParam(required = true,value="evaluate") String evaluateJson){
        try{
            evaluateService.saveByJson(evaluateJson,getUID());
            evaluateService.saveByJson(evaluateJson,getRepUID());
//            evaluateService.saveByJson(evaluateJson,getUID());
            return  write(200,"保存成功!");
        }catch (Exception e){
            error(e);

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthController.java

@ -390,7 +390,8 @@ public class PatientHealthController extends BaseController {
        try {
//            DevicePatientHealthIndex obj = healthIndexService.addPatientHealthIndex(data, type, getUID(), null);
            if(StringUtils.isBlank(patient)){
                patient = getUID();
                patient = getRepUID();
//                patient = getUID();
            }
            DevicePatientHealthIndex obj = healthIndexService.addPatientHealthIndex(data, type, patient, null);
            //血糖和血压需要校验

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthGuidanceController.java

@ -34,7 +34,8 @@ public class PatientHealthGuidanceController extends BaseController {
	@ResponseBody
	public String modifyStatus() {
		try {
			patientHealthGuidanceService.modifyStatus(getUID(),"1");
			patientHealthGuidanceService.modifyStatus(getRepUID(),"1");
//			patientHealthGuidanceService.modifyStatus(getUID(),"1");
			return write(200, "设置成功!");
		} catch (Exception e) {
			error(e);

+ 21 - 13
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyContractController.java

@ -1,22 +1,22 @@
package com.yihu.wlyy.web.patient.sign;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorPatientGroupInfo;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.patient.invitation.PatientInvitationLog;
import com.yihu.wlyy.repository.doctor.DoctorPatientGroupInfoDao;
import com.yihu.wlyy.service.app.family.FamilyService;
import com.yihu.wlyy.service.app.sign.FamilyContractService;
import com.yihu.wlyy.service.app.sign.SignWebService;
import com.yihu.wlyy.service.common.account.*;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.IdcardValidator;
import com.yihu.wlyy.util.RSAUtils;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.entity.patient.invitation.PatientInvitationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
@ -24,7 +24,6 @@ import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.CacheControl;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -204,7 +203,8 @@ public class FamilyContractController extends BaseController {
    @ResponseBody
    public String homepage(String doctor) {
        try {
            JSONObject json = familyContractService.findDoctorMainPage(getUID(), doctor);
            JSONObject json = familyContractService.findDoctorMainPage(getRepUID(), doctor);
//            JSONObject json = familyContractService.findDoctorMainPage(getUID(), doctor);
            if (json == null) {
                return error(-1, "医生主页查询失败!");
@ -227,7 +227,8 @@ public class FamilyContractController extends BaseController {
    public String signStatus(String doctor) {
        try {
            // -1未签约,0待签约,1已签约,2患者申请取消签约,3医生申请取消签约
            int status = familyContractService.findSignStatus(getUID(), doctor);
            int status = familyContractService.findSignStatus(getRepUID(), doctor);
//            int status = familyContractService.findSignStatus(getUID(), doctor);
            return write(200, "数据加载成功!", "data", status);
        } catch (Exception e) {
            error(e);
@ -314,7 +315,8 @@ public class FamilyContractController extends BaseController {
            if (StringUtils.isEmpty(getOpenid())) {
                return error(-1, "无效的Openid!");
            }
            String doctor = familyContractService.checkPatient(getUID());
            String doctor = familyContractService.checkPatient(getRepUID());
//            String doctor = familyContractService.checkPatient(getUID());
            return write(200, "签约验证成功!", "data", doctor);
        } catch (Exception e) {
            error(e);
@ -352,7 +354,8 @@ public class FamilyContractController extends BaseController {
                return error(-1, "请输入正确的身份证号!");
            }
            Patient patient = patientService.findByCode(getUID());
            Patient patient = patientService.findByCode(getRepUID());
//            Patient patient = patientService.findByCode(getUID());
            if (!StringUtils.equals(patient.getIdcard(), idcard)) {
                return error(-1, "身份证号错误,请输入注册的身份证号!");
            }
@ -548,7 +551,8 @@ public class FamilyContractController extends BaseController {
            // return error(-1, "无效的用户请求!");
            // }
            // -1申请失败, 200申请成功,其他为状态已变化无法取消申请
            patientCode = StringUtils.isNoneBlank(patientCode) ? patientCode : getUID();
            patientCode = StringUtils.isNoneBlank(patientCode) ? patientCode : getRepUID();
//            patientCode = StringUtils.isNoneBlank(patientCode) ? patientCode : getUID();
            int res = familyContractService.unsign(patientCode, doctor);
            if (res == -1) {
                return error(-1, "取消签约失败!");
@ -575,7 +579,8 @@ public class FamilyContractController extends BaseController {
    public String surrender(String doctor, String doctorName, String reason,
                            @RequestParam(required = false) String patientCode) {
        try {
            patientCode = StringUtils.isNoneBlank(patientCode) ? patientCode : getUID();
            patientCode = StringUtils.isNoneBlank(patientCode) ? patientCode : getRepUID();
//            patientCode = StringUtils.isNoneBlank(patientCode) ? patientCode : getUID();
            Patient patient = patientService.findByCode(patientCode);
            int res = familyContractService.surrender(patient.getCode(), patient.getName(), patient.getPhoto(), doctor, doctorName, patient.getOpenid(), reason, patient.getSex());
            if (res == 0) {
@ -599,7 +604,8 @@ public class FamilyContractController extends BaseController {
    public String messages(long id, int pagesize) {
        try {
            JSONArray array = new JSONArray();
            Page<Message> list = familyContractService.findMessageByPatient(getUID(), id, pagesize);
//            Page<Message> list = familyContractService.findMessageByPatient(getUID(), id, pagesize);
            Page<Message> list = familyContractService.findMessageByPatient(getRepUID(), id, pagesize);
            if (list != null) {
                for (Message msg : list) {
                    if (msg == null) {
@ -651,7 +657,8 @@ public class FamilyContractController extends BaseController {
            if (StringUtils.isEmpty(doctor)) {
                return error(-1, "医生不能为空");
            }
            JSONObject result = familyContractService.isPatientAndDoctorExistSign(getUID(), doctor);
            JSONObject result = familyContractService.isPatientAndDoctorExistSign(getRepUID(), doctor);
//            JSONObject result = familyContractService.isPatientAndDoctorExistSign(getUID(), doctor);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            error(e);
@ -672,7 +679,8 @@ public class FamilyContractController extends BaseController {
            if (StringUtils.isEmpty(doctor)) {
                return error(-1, "医生不能为空");
            }
            JSONObject result = familyContractService.isPatientAndDoctorCanSign(getUID(), doctor);
            JSONObject result = familyContractService.isPatientAndDoctorCanSign(getRepUID(), doctor);
//            JSONObject result = familyContractService.isPatientAndDoctorCanSign(getUID(), doctor);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            error(e);

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyWithoutFilterController.java

@ -8,7 +8,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
@ -30,7 +29,8 @@ public class FamilyWithoutFilterController extends BaseController {
    @ResponseBody
    public String homepage(String doctor) {
        try {
            JSONObject json = familyContractService.findDoctorMainPage(getUID(), doctor);
            JSONObject json = familyContractService.findDoctorMainPage(getRepUID(), doctor);
//            JSONObject json = familyContractService.findDoctorMainPage(getUID(), doctor);
            if (json == null) {
                return error(-1, "医生主页查询失败!");

+ 8 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/PatientSignController.java

@ -36,12 +36,14 @@ public class PatientSignController extends BaseController {
			@RequestParam(value = "startTime", required = false) String startTime, 
			@RequestParam(value = "endTime", required = false) String endTime) {
		try {
			List<Object> listDoctor = signWebService.getSignInfoByStatus(getUID());
			List<Object> listDoctor = signWebService.getSignInfoByStatus(getRepUID());
//			List<Object> listDoctor = signWebService.getSignInfoByStatus(getUID());
			if (listDoctor.size() > 0) {
				return error(-1, "存在已签约的医生,请确认!");
			}
			Page<Object> list = signWebService.getSignInfoByPatient(getUID(), 0, 0, 15);
			Page<Object> list = signWebService.getSignInfoByPatient(getRepUID(), 0, 0, 15);
//			Page<Object> list = signWebService.getSignInfoByPatient(getUID(), 0, 0, 15);
			if (list.getTotalPages() > 0) {
				return error(-1, "已存在申请签约的医生,请确认!");
			}
@ -56,7 +58,8 @@ public class PatientSignController extends BaseController {
			}
			SignWeb signWeb = new SignWeb();
			signWeb.setUser(getUID());
			signWeb.setUser(getRepUID());
//			signWeb.setUser(getUID());
			signWeb.setDoctor(doctor);
			signWeb.setStatus(0);
			SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
@ -191,7 +194,8 @@ public class PatientSignController extends BaseController {
				iStatus = Integer.parseInt(status);
			}
			Page<Object> listSign = signWebService.getSignInfoByPatient(getUID(), iStatus, id, pageSize);
//			Page<Object> listSign = signWebService.getSignInfoByPatient(getUID(), iStatus, id, pageSize);
			Page<Object> listSign = signWebService.getSignInfoByPatient(getRepUID(), iStatus, id, pageSize);
			JSONArray jsonArray = new JSONArray();
			if (listSign != null) {