Browse Source

Merge branch 'dev' of liubing/wlyy2.0 into dev

liubing 3 years ago
parent
commit
8dbc721139

+ 6 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorBirthdayWishesEndpoint.java

@ -279,7 +279,12 @@ public class DoctorBirthdayWishesEndpoint extends BaseController {
                if (patients.size()>0){//发送生日祝福
                    Map<String,Object> tmp = patients.get(0);
                    com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
                    String first = "社工key1为您发送生日祝福,请点击查看。";
                    String first="";
                    if (2==one.getSendLevel()){
                        first = "社工key1为您发送生日祝福,请点击查看。";
                    }if (4==one.getSendLevel()){
                         first = "助老员key1为您发送生日祝福,请点击查看。";
                    }
                    first = first.replace("key1",one.getDoctorName());
                    json.put("id", one.getId());
//                    json.put("toUser", patient);

+ 4 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/birthday/BirthdayWishesService.java

@ -296,6 +296,7 @@ public class BirthdayWishesService {
        Map<String, Object> resultMap = new HashMap<>();
        List<Map<String, Object>> resultList = new ArrayList();
        Long allCount = 0l;
        String year = DateUtil.getNowYear()+"";
        //判断是否筛选推送条件,若未筛选则从数据库直接查生日居民,再进行匹配是否推送,若选择已推送则从推送记录查,若未发送则从未推送表查
        //社工签约患者
        String sql = " SELECT Distinct p.id patient,p.idcard,p.mobile,p.name,p.sex,p.id,p.photo," +
@ -357,7 +358,7 @@ public class BirthdayWishesService {
            }
        }
        whereSql += "and DATE_FORMAT(sr.create_time,'%m%d')< CASE LENGTH(p.idcard) WHEN 18 THEN SUBSTR(p.idcard, 11, 4) WHEN 15 THEN SUBSTR(p.idcard, 9, 4) END ";
        whereSql += "and DATE_FORMAT(ph.create_time,'%Y%m%d')<= CONCAT('"+year+"',(CASE LENGTH(p.idcard) WHEN 18 THEN SUBSTR(p.idcard, 11, 4) WHEN 15 THEN SUBSTR(p.idcard, 9, 4) END)) ";
        sql = sql + whereSql + " ) order by birthday limit "+(page-1)*pageSize + "," + pageSize;
        sqlCount = sqlCount + whereSql+")";
@ -607,6 +608,7 @@ public class BirthdayWishesService {
    public Map<String, Object> helperGetBirthdayPatientList(String doctorCode, String patientName, Integer signYear, String startDate, String endDate, Integer status, String currentUserRole, String currentUserRoleLevel,
                                                      Integer roleType, Integer page, Integer pageSize) throws Exception {
        String year = DateUtil.getNowYear()+"";
        Map<String, Object> resultMap = new HashMap<>();
        List<Map<String, Object>> resultList = new ArrayList();
        Long allCount = 0l;
@ -665,7 +667,7 @@ public class BirthdayWishesService {
            }
        }
        whereSql += "and DATE_FORMAT(ph.create_time,'%m%d')< CASE LENGTH(p.idcard) WHEN 18 THEN SUBSTR(p.idcard, 11, 4) WHEN 15 THEN SUBSTR(p.idcard, 9, 4) END ";
        whereSql += "and DATE_FORMAT(ph.create_time,'%Y%m%d')<= CONCAT('"+year+"',(CASE LENGTH(p.idcard) WHEN 18 THEN SUBSTR(p.idcard, 11, 4) WHEN 15 THEN SUBSTR(p.idcard, 9, 4) END)) ";
        sql = sql + whereSql + "  order by birthday limit "+(page-1)*pageSize + "," + pageSize;
        sqlCount = sqlCount + whereSql ;