Browse Source

居民搜索修改

wujunjie 8 years ago
parent
commit
805d328172

+ 4 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java

@ -40,13 +40,13 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
                System.out.println("evaluate_score_job exist");
            }
             //启动群发续签图文消息
//            if (!quartzHelper.isExistJob("sign_again_job")) {
            if (!quartzHelper.isExistJob("sign_again_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("sign_again_job_trigger");
                quartzHelper.addJob(SignAgainJob.class, trigger, "sign_again_job", new HashMap<String, Object>());
                System.out.println("sign_again_job start success");
//            } else {
//                System.out.println("sign_again_job exist");
//            }
            } else {
                System.out.println("sign_again_job exist");
            }
        } catch (Exception e) {
            System.out.println("sign end job start failed");
        }

+ 5 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/job/SignAgainJob.java

@ -28,6 +28,8 @@ import java.util.Map;
 * Created by Reece on 2017/5/18.
 */
public class SignAgainJob extends WeixinBaseController implements Job {
    @Autowired
    private  PatientDao patientDao;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
@ -36,13 +38,13 @@ public class SignAgainJob extends WeixinBaseController implements Job {
            SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
            System.out.println(" ============job ===========>");
            String accessToken = getAccessToken();
//            SendNews sendNews = new SendNews();
            SendNews.sendNews(accessToken);
            List<String> openIds = patientDao.findOpenids();
            SendNews.sendNews(accessToken,openIds);
            System.out.println(" ==============================>");
            System.out.println("sign again job end");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("sign end job failed");
            System.out.println("sign again job failed");
        }
    }
}

+ 6 - 14
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SendNews.java

@ -153,11 +153,11 @@ public class SendNews {
        return json;
    }
    public static String sendNews(String accessToken) throws Exception {
    public static void sendNews(String accessToken,List<String> openIds) throws Exception {
        // 配置信息
        Properties systemConf = SystemConf.getInstance().getSystemProperties();
        //本地上传图片的路径
        /*String renewPath = systemConf.getProperty("patient_sign_again_pic_url");
        //本地上传图片的路径及跳转路径
        String renewPath = systemConf.getProperty("patient_sign_again_pic_url");
        String renewUrl = systemConf.getProperty("patient_sign_again_url");
        String signPath = systemConf.getProperty("doctor_qrcode_pic_url");
        String signUrl = systemConf.getProperty("doctor_subscribe_url");
@ -196,22 +196,14 @@ public class SendNews {
        JSONObject news = new JSONObject();
        JSONObject mapnews = new JSONObject();
        mapnews.put("media_id", new JSONObject(media).get("media_id"));*/
        mapnews.put("media_id", new JSONObject(media).get("media_id"));
       /* String sql = "select distinct p.openid from Patient p where p.openid is not null and p.openid <> '' ";
        JdbcTemplate jdbcTemplate = new JdbcTemplate();
        List<String> openIds = jdbcTemplate.queryForList(sql, String.class);*/
//        List<String> openIds = patientDao.findOpenids();
       /* news.put("touser", openIds);
        news.put("touser", openIds);
        news.put("mpnews", mapnews);
        news.put("msgtype", "mpnews");
        news.put("send_ignore_reprint", 1);
        SendNews.sendNewspMessage(accessToken, groupUrl, news);*/
        return null;
        SendNews.sendNewspMessage(accessToken, groupUrl, news);
    }

+ 7 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java

@ -294,6 +294,7 @@ public class ManagerUtilController extends BaseController {
            return error(-1, "启动失败");
        }
    }
    @RequestMapping(value = "/start_renew_to_sign_job")
    @ResponseBody
    public String startRenewToSignJob() {
@ -308,6 +309,12 @@ public class ManagerUtilController extends BaseController {
            return error(-1, "启动失败");
        }
    }
    /**
     * 立即开始后台群发图文消息任务
     *
     * @return
     */
    @RequestMapping(value = "/start_sign_again_job")
    @ResponseBody
    public String startSignAgainJob() {

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

@ -216,16 +216,18 @@ public class DoctorFamilyContractController extends WeixinBaseController {
    }
    /**
     * 根据标签查看当前医生签约的居民  3 健康管理师  2是全科
     * 根据标签查看当前医生签约的居民  3 健康管理师  2是全科    修改为未分组 未标注 参考doctor/patient_label_info/label_patient_amount
     */
    @RequestMapping(value = "/getPatientLables")
    @ResponseBody
    public String getPatientLables(String labelType, String level, String oldDoctorCode, Long teamCode) {
        try {
            int count = 0;
            List listNum = new ArrayList();
            JSONObject list = familyContractService.getPatientByLable(oldDoctorCode, labelType, level, teamCode);
            List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode);
            int count = 0;
            for (SignPatientLabel label : s) {
                Map map = new HashMap();
                String labelName = label.getLabelName();
@ -248,6 +250,28 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                listNum.add(map);
                count += length;
            }
            if (list.getJSONArray("未标注")!=null){
                JSONArray noGroup = list.getJSONArray("未标注");
                List codes = new ArrayList();
                for (int i = 0; i < noGroup.length(); i++) {
                    JSONObject json = noGroup.getJSONObject(i);
                    Map info = new HashMap();
                    String code = json.getString("code");
                    String name = json.getString("name");
                    info.put("code", code);
                    info.put("name", name);
                    codes.add(info);
                }
                Map map = new HashMap();
                int size = noGroup.length();
                map.put("label", "未标注");
                map.put("codes", codes);
                map.put("number",size);
                listNum.add(map);
                count += size;
            }
            Map map = new HashMap();
            map.put("count", count);
            map.put("patients", listNum);