|
@ -59,15 +59,15 @@ public class HealthMessageJob implements Job {
|
|
|
now=getYesterday(0,new Date());
|
|
|
}
|
|
|
//删除原来的数据
|
|
|
String deleteSql="delete from wlyy_message where type=3 and czrq >= '"+yesterday+" 'and czrq <= '"+now+" '";
|
|
|
String deleteSql="delete from wlyy_message where type=3 and czrq >= '"+yesterday+" 00:00:00'and czrq <= '"+now+" 00:00:00'";
|
|
|
jdbcTemplate.execute(deleteSql);
|
|
|
//生成新的数据
|
|
|
String sql="select doctor,doctor_name from wlyy_sign_family " +
|
|
|
" where status >0 and type='2' and expenses_status='1' " +
|
|
|
" and expenses_time >='"+yesterday+" ' and expenses_time<'"+now+" ' and (doctor_health is null or doctor_health = '')" ;
|
|
|
" and expenses_time >='"+yesterday+" 00:00:00' and expenses_time<'"+now+" 00:00:00' and (doctor_health is null or doctor_health = '')" ;
|
|
|
String countSql="select count(id) from wlyy_sign_family " +
|
|
|
" where status >0 and type='2' and expenses_status='1' " +
|
|
|
" and expenses_time >='"+yesterday+" ' and expenses_time<'"+now+" ' and (doctor_health is null or doctor_health = '')" ;
|
|
|
" and expenses_time >='"+yesterday+" 00:00:00' and expenses_time<'"+now+" 00:00:00' and (doctor_health is null or doctor_health = '')" ;
|
|
|
List<SignFamily> signFamilyList=dbExtract.extractByPage(SignFamily.class,sql,countSql,true);
|
|
|
Map<String,List<SignFamily>> signFamilyMap=new HashMap<String,List<SignFamily>>();
|
|
|
for(int i=0;i<signFamilyList.size();i++){
|
|
@ -84,7 +84,7 @@ public class HealthMessageJob implements Job {
|
|
|
for(Map.Entry<String,List<SignFamily>> entry:signFamilyMap.entrySet()){
|
|
|
countSql="select count(id) from wlyy_sign_family " +
|
|
|
" where status >0 and type='2' and expenses_status='1' " +
|
|
|
" and expenses_time<'"+now+" ' and (doctor_health is null or doctor_health = '') and doctor='"+entry.getKey()+"'" ;
|
|
|
" and expenses_time<'"+now+" 00:00:00' and (doctor_health is null or doctor_health = '') and doctor='"+entry.getKey()+"'" ;
|
|
|
|
|
|
Integer allCount=jdbcTemplate.queryForObject(countSql,Integer.class);
|
|
|
Message message=new Message();
|
|
@ -99,7 +99,7 @@ public class HealthMessageJob implements Job {
|
|
|
message.setTitle(title);
|
|
|
SimpleDateFormat dateFormat1=new SimpleDateFormat("yyyy-MM-dd");
|
|
|
SimpleDateFormat dateFormat2=new SimpleDateFormat("MM月dd日");
|
|
|
String content=dateFormat2.format(dateFormat1.parse(now))+"新增"+entry.getValue().size()+"个签约居民待分配健管师,目前共"+allCount+"人待处理";
|
|
|
String content=dateFormat2.format(dateFormat1.parse(yesterday))+"新增"+entry.getValue().size()+"个签约居民待分配健管师,目前共"+allCount+"人待处理";
|
|
|
message.setContent(content);
|
|
|
message.setCode(UUID.randomUUID().toString());
|
|
|
message.setReceiver(entry.getKey());
|
|
@ -116,7 +116,7 @@ public class HealthMessageJob implements Job {
|
|
|
jsonArray.add(json);
|
|
|
}
|
|
|
quartzJobLog.setJobEndTime(new Date());
|
|
|
quartzJobLog.setJobContent("生成"+now+"的健康管理师消息成功");
|
|
|
quartzJobLog.setJobContent("生成"+yesterday+"的健康管理师消息成功");
|
|
|
quartzJobLog.setJobType("1");
|
|
|
dbStorage.saveLog(quartzJobLog);
|
|
|
|