Quellcode durchsuchen

Merge branch 'dev' of wujunjie/patient-management into dev

trick9191 vor 8 Jahren
Ursprung
Commit
5dfa7ef01f

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

@ -1,6 +1,7 @@
package com.yihu.wlyy.event;
package com.yihu.wlyy.event;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.SignAgainJob;
import com.yihu.wlyy.job.SignEndJob;
import com.yihu.wlyy.job.SignEndJob;
import com.yihu.wlyy.job.consult.EvaluateScoreJob;
import com.yihu.wlyy.job.consult.EvaluateScoreJob;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.util.SystemConf;
@ -15,7 +16,7 @@ import java.util.HashMap;
 * Created by lyr-pc on 2017/3/10.
 * Created by lyr-pc on 2017/3/10.
 */
 */
@Service
@Service
public class ApplicationEvent implements ApplicationListener<ContextRefreshedEvent>{
public class ApplicationEvent implements ApplicationListener<ContextRefreshedEvent> {
    @Autowired
    @Autowired
    QuartzHelper quartzHelper;
    QuartzHelper quartzHelper;
@ -38,6 +39,14 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            } else {
            } else {
                System.out.println("evaluate_score_job exist");
                System.out.println("evaluate_score_job exist");
            }
            }
             //启动群发续签图文消息
            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");
            }
        } catch (Exception e) {
        } catch (Exception e) {
            System.out.println("sign end job start failed");
            System.out.println("sign end job start failed");
        }
        }

+ 49 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/job/SignAgainJob.java

@ -0,0 +1,49 @@
package com.yihu.wlyy.job;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.common.account.WechatController;
import com.yihu.wlyy.wechat.process.WeiXinEventProcess;
import com.yihu.wlyy.wechat.util.WeiXinMessageReplyUtils;
import org.json.JSONObject;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
/**
 * Created by Reece on 2017/5/18.
 */
public class SignAgainJob implements Job {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private PatientService patientService;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            System.out.println("sign again job start1 SignAgainJob");
            SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
//            Calendar today = Calendar.getInstance();
            WechatController wechatController = new WechatController();
            wechatController.sendNews();
            System.out.println("sign again job end1 SignAgainJob");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("sign end job failed1 SignAgainJob");
        }
    }
}

+ 35 - 31
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientDao.java

@ -18,46 +18,50 @@ import java.util.List;
public interface PatientDao extends PagingAndSortingRepository<Patient, Long> {
public interface PatientDao extends PagingAndSortingRepository<Patient, Long> {
	// 查询患者姓名
	@Query("select p.name from Patient p where p.code=?1 and p.status=1")
	String findNameByCode(String code);
    // 查询患者姓名
    @Query("select p.name from Patient p where p.code=?1 and p.status=1")
    String findNameByCode(String code);
	// 根據患者標識查詢患者信息
	@Query("select p from Patient p where p.code=?1 and p.status=1")
	Patient findByCode(String code);
    // 根據患者標識查詢患者信息
    @Query("select p from Patient p where p.code=?1 and p.status=1")
    Patient findByCode(String code);
	// 根據身份證號查詢患者信息
	@Query("select p from Patient p where p.idcard=?1 and p.status=1")
	Patient findByIdcard(String idcard);
    // 根據身份證號查詢患者信息
    @Query("select p from Patient p where p.idcard=?1 and p.status=1")
    Patient findByIdcard(String idcard);
	@Query("select p from Patient p where p.ssc=?1 and p.status=1")
	Patient findBySsc(String ssc);
    @Query("select p from Patient p where p.ssc=?1 and p.status=1")
    Patient findBySsc(String ssc);
	// 根據手机号查詢患者信息
	@Query("select p from Patient p where p.mobile=?1 and p.status=1")
	List<Patient> findByMobile(String mobile);
    // 根據手机号查詢患者信息
    @Query("select p from Patient p where p.mobile=?1 and p.status=1")
    List<Patient> findByMobile(String mobile);
	// 根據病情等级获取患者信息
	@Query("select p from Patient p where p.diseaseCondition=?1 and p.status=1")
	Iterable<Patient> findInfoByLevel(int level);
    // 根據病情等级获取患者信息
    @Query("select p from Patient p where p.diseaseCondition=?1 and p.status=1")
    Iterable<Patient> findInfoByLevel(int level);
	@Query("select p from Patient p where p.openid=?1 and p.status=1")
	Patient findByOpenid(String openid);
    @Query("select p from Patient p where p.openid=?1 and p.status=1")
    Patient findByOpenid(String openid);
	@Query("select count(1) from Patient p where p.openid=?1 and p.status=1")
	int countByOpenid(String openid);
    @Query("select count(1) from Patient p where p.openid=?1 and p.status=1")
    int countByOpenid(String openid);
	//清空openid
	@Modifying
	@Query("update Patient p set p.openid = null where p.code <> ?1 and p.openid = ?2 and p.status=1")
	int clearOpenid(String patient, String openid);
    //清空openid
    @Modifying
    @Query("update Patient p set p.openid = null where p.code <> ?1 and p.openid = ?2 and p.status=1")
    int clearOpenid(String patient, String openid);
	@Query(" select p from Patient p,SignFamily s where p.code=s.patient and s.status > 0 ")
	List<Patient> findAllSignPatient();
    @Query(" select p from Patient p,SignFamily s where p.code=s.patient and s.status > 0 ")
    List<Patient> findAllSignPatient();
	@Query(" select p from Patient p where password is null ")
	List<Patient> findAllIdCardPatientAndNoPassword();
    @Query(" select p from Patient p where password is null ")
    List<Patient> findAllIdCardPatientAndNoPassword();
	@Query("select p from Patient p where p.status = 1 and p.openid = ?1 order by p.czrq desc")
	Page<Patient> findPatientByOpenid(String openid, Pageable pageable);
    @Query("select p from Patient p where p.status = 1 and p.openid = ?1 order by p.czrq desc")
    Page<Patient> findPatientByOpenid(String openid, Pageable pageable);
    //获取所有的openid并排重
    @Query("select distinct p.openid from Patient p where p.openid is not null and p.openid <> '' ")
    List<String> findOpenids();
}
}

+ 26 - 9
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/WeiXinCoreService.java

@ -1,15 +1,20 @@
package com.yihu.wlyy.service.weixin;
package com.yihu.wlyy.service.weixin;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.wechat.process.WeiXinEventProcess;
import com.yihu.wlyy.wechat.process.WeiXinEventProcess;
import com.yihu.wlyy.wechat.util.WeiXinMessageUtils;
import com.yihu.wlyy.wechat.util.WeiXinMessageUtils;
import org.dom4j.Document;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.dom4j.io.SAXReader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.HashMap;
import java.util.List;
import java.util.List;
import java.util.Map;
import java.util.Map;
@ -18,7 +23,9 @@ import java.util.Map;
 * Created by lyr on 2016/08/11.
 * Created by lyr on 2016/08/11.
 */
 */
@Service
@Service
public class WeiXinCoreService extends BaseService{
public class WeiXinCoreService extends BaseService {
    @Autowired
    private SignFamilyDao signFamilyDao;
    /**
    /**
     * 微信推送消息处理
     * 微信推送消息处理
@ -26,11 +33,11 @@ public class WeiXinCoreService extends BaseService{
     * @param request
     * @param request
     * @param accessToken
     * @param accessToken
     */
     */
    public String messageProcess(HttpServletRequest request,String accessToken){
        try{
    public String messageProcess(HttpServletRequest request, String accessToken) {
        try {
            String returnStr = "";
            String returnStr = "";
            // 将解析结果存储在HashMap中
            // 将解析结果存储在HashMap中
            Map<String,String> message = new HashMap();
            Map<String, String> message = new HashMap();
            // 从request中取得输入流
            // 从request中取得输入流
            InputStream inputStream = request.getInputStream();
            InputStream inputStream = request.getInputStream();
@ -44,19 +51,19 @@ public class WeiXinCoreService extends BaseService{
            // 遍历所有子节点
            // 遍历所有子节点
            for (Object e : elementList) {
            for (Object e : elementList) {
                Element ele = (Element)e;
                Element ele = (Element) e;
                message.put(ele.getName(), ele.getText());
                message.put(ele.getName(), ele.getText());
            }
            }
            System.out.println("weixin  event:" + message.toString());
            System.out.println("weixin  event:" + message.toString());
            // 释放资源
            // 释放资源
            inputStream.close();
            inputStream.close();
            // 添加access_token参数
            // 添加access_token参数
            message.put("token",accessToken);
            message.put("token", accessToken);
            // 消息处理
            // 消息处理
            returnStr = messageProcess(message);
            returnStr = messageProcess(message);
            return returnStr;
            return returnStr;
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
            e.printStackTrace();
            return "error";
            return "error";
        }
        }
@ -68,18 +75,28 @@ public class WeiXinCoreService extends BaseService{
     * @param message
     * @param message
     * @return
     * @return
     */
     */
    private String messageProcess(Map<String,String> message) throws Exception {
    private String messageProcess(Map<String, String> message) throws Exception {
        String msgType = message.get("MsgType");
        String msgType = message.get("MsgType");
        String result = "";
        String result = "";
        switch (msgType){
        switch (msgType) {
            case WeiXinMessageUtils.REQ_MESSAGE_TYPE_EVENT:  // 事件消息
            case WeiXinMessageUtils.REQ_MESSAGE_TYPE_EVENT:  // 事件消息
                result = WeiXinEventProcess.eventProcess(message);
                result = WeiXinEventProcess.eventProcess(message);
                break;
                break;
            case WeiXinMessageUtils.RESP_MESSAGE_TYPE_TEXT:  // 回复文本消息
                String content = message.get("Content");
                if ("续签".equals(content)){
//                      发送续签和签约图文消息
                    System.out.print("content======? "+content);
                    result = WeiXinEventProcess.replyKeyword(message);
                    System.out.print("图文结束======? ");
                }
                break;
            default:
            default:
                break;
                break;
        }
        }
        return result;
        return result;
    }
    }
}
}

+ 139 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SendNews.java

@ -0,0 +1,139 @@
package com.yihu.wlyy.util;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
/**
 * Created by Reece on 2017/5/20.
 */
public class SendNews {
    private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
    /**
     * 模拟form表单的形式 ,上传文件 以输出流的形式把文件写入到url中,然后用输入流来获取url的响应
     *
     * @param url      请求地址 form表单url地址
     * @param filePath 文件在服务器保存路径
     * @return String url的响应信息返回值
     * @throws IOException
     */
    public static String uploadImage(String url, String filePath) throws IOException {
        String result = null;
        File file = new File(filePath);
        if (!file.exists() || !file.isFile()) {
            throw new IOException("文件不存在");
        }
        /**
         * 第一部分
         */
        URL urlObj = new URL(url);
        // 连接
        HttpURLConnection con = (HttpURLConnection) urlObj.openConnection();
        /**
         * 设置关键值
         */
        con.setRequestMethod("POST"); // 以Post方式提交表单,默认get方式
        con.setDoInput(true);
        con.setDoOutput(true);
        con.setUseCaches(false); // post方式不能使用缓存
        // 设置请求头信息
        con.setRequestProperty("Connection", "Keep-Alive");
        con.setRequestProperty("Charset", "UTF-8");
        // 设置边界
        String BOUNDARY = "---------------------------" + System.currentTimeMillis();
        con.setRequestProperty("Content-Type", "multipart/form-data; boundary="
                + BOUNDARY);
        // 请求正文信息
        // 第一部分:
        StringBuilder sb = new StringBuilder();
        sb.append("--"); // 必须多两道线
        sb.append(BOUNDARY);
        sb.append("\r\n");
        sb.append("Content-Disposition: form-data;name=\"media\";filename=\""
                + file.getName() + "\"\r\n");
        sb.append("Content-Type:application/octet-stream\r\n\r\n");
        byte[] head = sb.toString().getBytes("utf-8");
        // 获得输出流
        OutputStream out = new DataOutputStream(con.getOutputStream());
        // 输出表头
        out.write(head);
        // 文件正文部分
        // 把文件已流文件的方式 推入到url中
        DataInputStream in = new DataInputStream(new FileInputStream(file));
        int bytes = 0;
        byte[] bufferOut = new byte[1024];
        while ((bytes = in.read(bufferOut)) != -1) {
            out.write(bufferOut, 0, bytes);
        }
        in.close();
        // 结尾部分
        byte[] foot = ("\r\n--" + BOUNDARY + "--\r\n").getBytes("utf-8");// 定义最后数据分隔线
        out.write(foot);
        out.flush();
        out.close();
        StringBuffer buffer = new StringBuffer();
        BufferedReader reader = null;
        try {
            // 定义BufferedReader输入流来读取URL的响应
            reader = new BufferedReader(new InputStreamReader(
                    con.getInputStream()));
            String line = null;
            while ((line = reader.readLine()) != null) {
                buffer.append(line);
            }
            if (result == null) {
                result = buffer.toString();
            }
        } catch (IOException e) {
            System.out.println("发送POST请求出现异常!" + e);
            e.printStackTrace();
            throw new IOException("数据读取异常");
        } finally {
            if (reader != null) {
                reader.close();
            }
        }
        return result;
    }
    /**
     * 上传图文消息文字素材
     * @param accessToken
     * @param data 图文消息文字素材内容
     * @return
     */
    public static String uploadNesText(String accessToken,String url,JSONObject data){
        url = url.replaceFirst("ACCESS_TOKEN",accessToken);
        //上传的图文消息数据,其中thumb_media_id是文件上传图片上传的id
//        data = "{\"articles\": [{\"thumb_media_id\":\"BW4eDIdYSvO7AFjfsZKsQ9ujNma_TkCj3VSo3JNTQkYmk_iPuhpUKm48oZ4umHED\",\"author\":\"xxx\",\"title\":\"Happy Day\",\"content_source_url\":\"www.qq.com\",\"content\":\"content\",\"digest\":\"digest\",\"show_cover_pic\":\"0\"}]}";
        String result = HttpClientUtil.postBody(url,data);
        return result;
    }
    /**
     * 发送图文消息
     * @param accessToken
     * @param openidData  群发图文消息内容
     * @return
     */
    public static String sendNewspMessage(String accessToken,String url, JSONObject openidData){
        url = url.replace("ACCESS_TOKEN",accessToken);
        String group1data = "{\"filter\":{\"is_to_all\":false,\"group_id\":\"2\"},\"text\":{\"content\":\"群发消息测试\"},\"msgtype\":\"text\"}\";";
        String openid1data = "{\"touser\":[\"obGXiwHTGN_4HkR2WToFj_3uaEKY\",\"obGXiwNu0z2o_RRWaODvaZctdWEM\"],\"msgtype\": \"text\",\"text\": {\"content\": \"测试文本消息\"}}";
        String openid2data = "{\"touser\":[\"obGXiwHTGN_4HkR2WToFj_3uaEKY\",\"obGXiwNu0z2o_RRWaODvaZctdWEM\"], \"voice\": {\"media_id\":\"UfMRvSiXAD5_iUS8u0Gc3JrKGWOABE9ivQbgrX6i-mVrKGBRL9KnKlioK1BxTPc3\"},\"msgtype\":\"voice\"}";
        String openid3data = "{\"touser\":[\"obGXiwHTGN_4HkR2WToFj_3uaEKY\",\"obGXiwNu0z2o_RRWaODvaZctdWEM\"], \"image\": {\"media_id\":\"fNUzGbYzTRui4N7-eyx9e3viP8uJuzztAvA32lIdjX4Cucj7mGN_1jpWjn7O80c8\"},\"msgtype\":\"image\"}";
        String json = HttpClientUtil.postBody(url,openidData);
        return json;
    }
}

+ 99 - 37
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

@ -13,11 +13,11 @@ import com.yihu.wlyy.repository.patient.SocialSecurityInfoDao;
import com.yihu.wlyy.service.app.family.FamilyMemberService;
import com.yihu.wlyy.service.app.family.FamilyMemberService;
import com.yihu.wlyy.service.app.family.FamilyService;
import com.yihu.wlyy.service.app.family.FamilyService;
import com.yihu.wlyy.service.common.login.LoginLogService;
import com.yihu.wlyy.service.common.login.LoginLogService;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.MD5;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.MediaType;
@ -33,8 +33,6 @@ import com.yihu.wlyy.service.common.SMSService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.common.account.TokenService;
import com.yihu.wlyy.service.common.account.TokenService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.IdcardValidator;
import com.yihu.wlyy.util.RSAUtils;
import com.yihu.wlyy.web.WeixinBaseController;
import com.yihu.wlyy.web.WeixinBaseController;
/**
/**
@ -64,6 +62,7 @@ public class WechatController extends WeixinBaseController {
    @Autowired
    @Autowired
    WeiXinOpenIdUtils weiXinOpenIdUtils;
    WeiXinOpenIdUtils weiXinOpenIdUtils;
    /**
    /**
     * 患者注册-验证手机号
     * 患者注册-验证手机号
     *
     *
@ -76,7 +75,7 @@ public class WechatController extends WeixinBaseController {
        try {
        try {
            /**modify by linz 2017年2月28日10:11:49 校验手机号码的时候返回使用此号码的所有人员**/
            /**modify by linz 2017年2月28日10:11:49 校验手机号码的时候返回使用此号码的所有人员**/
            List<Patient> temp = patientService.findByMobile(phone);
            List<Patient> temp = patientService.findByMobile(phone);
            if (temp != null&&temp.size()>0) {
            if (temp != null && temp.size() > 0) {
                // 设置身份证号
                // 设置身份证号
                return write(200, "患者信息查询成功!", "data", temp);
                return write(200, "患者信息查询成功!", "data", temp);
            }
            }
@ -89,22 +88,24 @@ public class WechatController extends WeixinBaseController {
    /**
    /**
     * 获取验证码发送的手机号码
     * 获取验证码发送的手机号码
     *
     * @param idCard
     * @param idCard
     * @return
     * @return
     */
     */
    @RequestMapping(value = "getMobile")
    @RequestMapping(value = "getMobile")
    @ResponseBody
    @ResponseBody
    public String getPatientInfoByIdCard(@RequestParam(value = "idCard",required = true) String idCard){
    public String getPatientInfoByIdCard(@RequestParam(value = "idCard", required = true) String idCard) {
        Patient temp = patientService.findByIdcard(idCard);
        Patient temp = patientService.findByIdcard(idCard);
        if(temp==null){
        getAccessToken();
        if (temp == null) {
            return error(-1, "用户未注册");
            return error(-1, "用户未注册");
        }else{
            if(StringUtils.isBlank(temp.getMobile())){
        } else {
            if (StringUtils.isBlank(temp.getMobile())) {
                return error(-2, "用户未绑定手机号");
                return error(-2, "用户未绑定手机号");
            }else{
            } else {
                JSONObject object = new JSONObject();
                JSONObject object = new JSONObject();
                object.put("mobile",temp.getMobile());
                return write(200,"获取成功","data",object);
                object.put("mobile", temp.getMobile());
                return write(200, "获取成功", "data", object);
            }
            }
        }
        }
@ -138,7 +139,7 @@ public class WechatController extends WeixinBaseController {
                return write(1, "患者信息查询成功!", "data", json);
                return write(1, "患者信息查询成功!", "data", json);
            } else {
            } else {
                List<Patient> temp1 = patientService.findByMobile(mobile);
                List<Patient> temp1 = patientService.findByMobile(mobile);
                if (temp1 != null&&temp1.size()>0) {
                if (temp1 != null && temp1.size() > 0) {
                    //JSONObject json = new JSONObject();
                    //JSONObject json = new JSONObject();
                    // 设置患者标识
                    // 设置患者标识
                    //json.put("code", temp1.getCode());
                    //json.put("code", temp1.getCode());
@ -237,13 +238,13 @@ public class WechatController extends WeixinBaseController {
     */
     */
    @RequestMapping(value = "regist")
    @RequestMapping(value = "regist")
    @ResponseBody
    @ResponseBody
    public String regist(@RequestParam(value="name",required = true) String name,
                         @RequestParam(value="idcard",required = true) String idcard,
                         @RequestParam(value="ssc",required = true) String ssc,
                         @RequestParam(value="mobile",required = true) String mobile,
                         @RequestParam(value="captcha",required = true) String captcha,
                         @RequestParam(value="openid",required = true) String openid,
                         @RequestParam(value="password",required = true) String password) {
    public String regist(@RequestParam(value = "name", required = true) String name,
                         @RequestParam(value = "idcard", required = true) String idcard,
                         @RequestParam(value = "ssc", required = true) String ssc,
                         @RequestParam(value = "mobile", required = true) String mobile,
                         @RequestParam(value = "captcha", required = true) String captcha,
                         @RequestParam(value = "openid", required = true) String openid,
                         @RequestParam(value = "password", required = true) String password) {
        try {
        try {
            if (StringUtils.isEmpty(name)) {
            if (StringUtils.isEmpty(name)) {
                return error(-1, "姓名不允许为空!");
                return error(-1, "姓名不允许为空!");
@ -378,11 +379,11 @@ public class WechatController extends WeixinBaseController {
            //账号登录 mobile可能是电话号也可能是身份证
            //账号登录 mobile可能是电话号也可能是身份证
            if (StringUtils.isNoneEmpty(mobile) && StringUtils.isNoneEmpty(password)) {
            if (StringUtils.isNoneEmpty(mobile) && StringUtils.isNoneEmpty(password)) {
                Patient p = patientService.findByIdcard(mobile);
                Patient p = patientService.findByIdcard(mobile);
                if(p==null){
                if (p == null) {
                    List<Patient> patients = patientService.findByMobile(mobile);
                    List<Patient> patients = patientService.findByMobile(mobile);
                    if(patients.size()>1){
                        return error(-1,"此手机号码存在多个用户,请用身份证进行登录!");
                    }else if(patients.size()==1){
                    if (patients.size() > 1) {
                        return error(-1, "此手机号码存在多个用户,请用身份证进行登录!");
                    } else if (patients.size() == 1) {
                        p = patients.get(0);
                        p = patients.get(0);
                    }
                    }
                }
                }
@ -456,8 +457,8 @@ public class WechatController extends WeixinBaseController {
            //短信登录
            //短信登录
            if (StringUtils.isNoneEmpty(mobile) && StringUtils.isNoneEmpty(captcha)) {
            if (StringUtils.isNoneEmpty(mobile) && StringUtils.isNoneEmpty(captcha)) {
                List<Patient> patients = patientService.findByMobile(mobile);
                List<Patient> patients = patientService.findByMobile(mobile);
                if(patients.size()>1){
                    return error(-1,"此手机存在多个用户,请用身份证和密码登录!");
                if (patients.size() > 1) {
                    return error(-1, "此手机存在多个用户,请用身份证和密码登录!");
                }
                }
                // 对验证码进行校验
                // 对验证码进行校验
                int res = smsService.check(mobile, 4, captcha);
                int res = smsService.check(mobile, 4, captcha);
@ -483,7 +484,7 @@ public class WechatController extends WeixinBaseController {
                }
                }
                loginLog.setLoginType("1");
                loginLog.setLoginType("1");
                if (patients == null||patients.size()==0) {
                if (patients == null || patients.size() == 0) {
                    if (mobile.length() == 11) {
                    if (mobile.length() == 11) {
                        errorMessage = "该手机号暂未注册账号,请确认后重新输入!";
                        errorMessage = "该手机号暂未注册账号,请确认后重新输入!";
                    } else {
                    } else {
@ -492,11 +493,12 @@ public class WechatController extends WeixinBaseController {
                    loginLog.setErrorMessage(errorMessage);
                    loginLog.setErrorMessage(errorMessage);
                    loginLogService.saveLog(loginLog);
                    loginLogService.saveLog(loginLog);
                    return error(-1, errorMessage);
                    return error(-1, errorMessage);
                }else{
                } else {
                    Patient p = null;
                    Patient p = null;
                    if(patients.size()==1){
                        p  = patients.get(0);
                    }if (p.getStatus() == 0) {
                    if (patients.size() == 1) {
                        p = patients.get(0);
                    }
                    if (p.getStatus() == 0) {
                        if (mobile.length() == 11) {
                        if (mobile.length() == 11) {
                            errorMessage = "该手机号已被禁止使用!";
                            errorMessage = "该手机号已被禁止使用!";
                        } else {
                        } else {
@ -602,17 +604,17 @@ public class WechatController extends WeixinBaseController {
            json.put("orgName", "厦门第一医院");
            json.put("orgName", "厦门第一医院");
            //判断是否判定openId,有没有发则查找家人发送
            //判断是否判定openId,有没有发则查找家人发送
            if(StringUtils.isNotBlank(patient.getOpenid())){
            if (StringUtils.isNotBlank(patient.getOpenid())) {
                // 添加到发送队列
                // 添加到发送队列
                PushMsgTask.getInstance().putWxMsg(getAccessToken(), 5, patient.getOpenid(), patient.getName(), json);
                PushMsgTask.getInstance().putWxMsg(getAccessToken(), 5, patient.getOpenid(), patient.getName(), json);
            }else{
                JSONObject j  = weiXinOpenIdUtils.getFamilyOpenId(patient.getCode());
            } else {
                JSONObject j = weiXinOpenIdUtils.getFamilyOpenId(patient.getCode());
                Patient member = (Patient) j.get("member");
                Patient member = (Patient) j.get("member");
                if(StringUtils.isNotBlank(member.getOpenid())){
                if (StringUtils.isNotBlank(member.getOpenid())) {
                    String first = (String) json.get("first");
                    String first = (String) json.get("first");
                    json.remove("first");
                    json.remove("first");
                    json.put("first",weiXinOpenIdUtils.getTitleMes(patient,j.getInt("relation"),member.getName())+first);
                    PushMsgTask.getInstance().putWxMsg(getAccessToken(),5, member.getOpenid(), member.getName(), json);
                    json.put("first", weiXinOpenIdUtils.getTitleMes(patient, j.getInt("relation"), member.getName()) + first);
                    PushMsgTask.getInstance().putWxMsg(getAccessToken(), 5, member.getOpenid(), member.getName(), json);
                }
                }
            }
            }
@ -722,4 +724,64 @@ public class WechatController extends WeixinBaseController {
            return error(-1, "查询失败");
            return error(-1, "查询失败");
        }
        }
    }
    }
    /**
     * 根据openID群发图文消息
     *
     * @return
     */
    @RequestMapping(value = "/sendNews")
    @ResponseBody
    public String sendNews() {
        try {
            String accessToken = getAccessToken();
//            本地上传图片的路径
            String filePath = SystemConf.getInstance().getChatPath();
            String sendUrl = "http://api.weixin.qq.com/cgi-bin/media/uploadimg?access_token=ACCESS_TOKEN&type=image";
            String mediaurl = "https://api.weixin.qq.com/cgi-bin/media/uploadnews?access_token=ACCESS_TOKEN";//ACCESS_TOKEN是获取到的access_token
            String groupUrl = "https://api.weixin.qq.com/cgi-bin/message/mass/send?access_token=ACCESS_TOKEN";//根据openid发群发消息地址
            sendUrl = sendUrl.replace("ACCESS_TOKEN", accessToken);
            String image = SendNews.uploadImage(sendUrl, filePath);
            JSONObject newsTextData = new JSONObject();
            JSONArray newsText = new JSONArray();
//            续签图文
            JSONObject data = new JSONObject();
            data.put("thumb_media_id", new JSONObject(image).get("url"));
            data.put("author", "作者");
            data.put("content_source_url", "图文跳转链接");
            data.put("content", "图文消息内容");
            data.put("digest", "图文消息描述");
            data.put("show_cover_pic", 1);
//            签约图文
//            JSONObject data1 = new JSONObject();
//            data1.put("thumb_media_id",new JSONObject(image).get("url"));
//            data1.put("author","作者");
//            data1.put("content_source_url","图文跳转链接");
//            data1.put("content","图文消息内容");
//            data1.put("digest","图文消息描述");
//            data1.put("show_cover_pic",1);
            newsText.put(data);
//            newsText.put(data1);
            newsTextData.put("articles", newsText);
            String media = SendNews.uploadNesText(accessToken, mediaurl, newsTextData);
            JSONObject news = new JSONObject();
            JSONObject mapnews = new JSONObject();
            mapnews.put("media_id", new JSONObject(media).get("media_id"));
            List<String> openIds = patientDao.findOpenids();
            news.put("touser", openIds);
            news.put("mpnews", mapnews);
            news.put("msgtype", "mpnews");
            news.put("send_ignore_reprint", 1);
            SendNews.sendNewspMessage(accessToken, groupUrl, news);
            return write(200, "群发图文成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "群发图文失败!");
        }
    }
}
}

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

@ -2,6 +2,7 @@ package com.yihu.wlyy.web.common.util;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.RenewToSignJob;
import com.yihu.wlyy.job.RenewToSignJob;
import com.yihu.wlyy.job.SignAgainJob;
import com.yihu.wlyy.job.SignEndJob;
import com.yihu.wlyy.job.SignEndJob;
import com.yihu.wlyy.job.consult.EvaluateScoreJob;
import com.yihu.wlyy.job.consult.EvaluateScoreJob;
import com.yihu.wlyy.job.consult.FamousConsultTimesJob;
import com.yihu.wlyy.job.consult.FamousConsultTimesJob;
@ -29,6 +30,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.OutputStreamWriter;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.security.Signature;
import java.text.SimpleDateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Date;
import java.util.HashMap;
import java.util.HashMap;
@ -306,4 +308,18 @@ public class ManagerUtilController extends BaseController {
            return error(-1, "启动失败");
            return error(-1, "启动失败");
        }
        }
    }
    }
    @RequestMapping(value = "/start_sign_again_job")
    @ResponseBody
    public String startSignAgainJob() {
        try {
            if (!quartzHelper.isExistJob("start_sign_again_job")) {
                quartzHelper.startNow(SignAgainJob.class, "start_sign_again_job", new HashMap<String, Object>());
                return write(200, "启动成功");
            } else {
                return write(200, "任务已存在");
            }
        } catch (Exception e) {
            return error(-1, "启动失败");
        }
    }
}
}

+ 27 - 26
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/WechatCoreController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.wx;
package com.yihu.wlyy.web.wx;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.weixin.WeiXinCoreService;
import com.yihu.wlyy.service.weixin.WeiXinCoreService;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.util.SystemConf;
@ -47,10 +48,10 @@ public class WechatCoreController extends WeixinBaseController {
            String nonce = request.getParameter("nonce").toString();
            String nonce = request.getParameter("nonce").toString();
            String echostr = request.getParameter("echostr").toString();
            String echostr = request.getParameter("echostr").toString();
            if(validate(signature,timestamp,nonce)){
            if (validate(signature, timestamp, nonce)) {
                // 验证成功,返回验证码
                // 验证成功,返回验证码
                response.getWriter().print(echostr);
                response.getWriter().print(echostr);
            }else{
            } else {
                // 验证失败
                // 验证失败
                response.setStatus(401);
                response.setStatus(401);
            }
            }
@ -61,33 +62,33 @@ public class WechatCoreController extends WeixinBaseController {
    }
    }
    /**
    /**
     * 接收微信推送消息
     * 接收居民微信回复的消息
     *
     *
     * @return
     * @return
     */
     */
    @RequestMapping(method = RequestMethod.POST)
    @RequestMapping(method = RequestMethod.POST)
    @ResponseBody
    @ResponseBody
    public void receiveMessages(HttpServletRequest request, HttpServletResponse response){
        try{
    public void receiveMessages(HttpServletRequest request, HttpServletResponse response) {
        try {
            String signature = request.getParameter("signature").toString();
            String signature = request.getParameter("signature").toString();
            String timestamp = request.getParameter("timestamp").toString();
            String timestamp = request.getParameter("timestamp").toString();
            String nonce = request.getParameter("nonce").toString();
            String nonce = request.getParameter("nonce").toString();
            if(validate(signature,timestamp,nonce)){
                String xmlStr =  weiXinCoreService.messageProcess(request,getAccessToken());
            if (validate(signature, timestamp, nonce)) {
                String xmlStr = weiXinCoreService.messageProcess(request, getAccessToken());
                if(xmlStr == "error"){
                if (xmlStr == "error") {
                    // 服务器错误
                    // 服务器错误
                    response.setStatus(500);
                    response.setStatus(500);
                }else{
                } else {
                    // 返回消息
                    // 返回消息
                    response.getWriter().print(xmlStr);
                    response.getWriter().print(xmlStr);
                }
                }
            }else{
            } else {
                // 验证失败
                // 验证失败
                response.setStatus(401);
                response.setStatus(401);
            }
            }
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
            e.printStackTrace();
            // 服务器错误
            // 服务器错误
            response.setStatus(500);
            response.setStatus(500);
@ -103,7 +104,7 @@ public class WechatCoreController extends WeixinBaseController {
     * @return
     * @return
     * @throws NoSuchAlgorithmException
     * @throws NoSuchAlgorithmException
     */
     */
    private static boolean validate(String signature,String timestamp,String nonce) throws NoSuchAlgorithmException {
    private static boolean validate(String signature, String timestamp, String nonce) throws NoSuchAlgorithmException {
        String token = SystemConf.getInstance().getSystemProperties().getProperty("wechat_token");
        String token = SystemConf.getInstance().getSystemProperties().getProperty("wechat_token");
        // 字典序排序
        // 字典序排序
        String[] array = new String[]{token, timestamp, nonce};
        String[] array = new String[]{token, timestamp, nonce};
@ -121,9 +122,9 @@ public class WechatCoreController extends WeixinBaseController {
        byte[] bytes = md.digest(content.getBytes());
        byte[] bytes = md.digest(content.getBytes());
        decodeStr = byteToStr(bytes);
        decodeStr = byteToStr(bytes);
        if(StringUtils.isNotEmpty(decodeStr) && decodeStr.equals(signature.toUpperCase())){
        if (StringUtils.isNotEmpty(decodeStr) && decodeStr.equals(signature.toUpperCase())) {
            return true;
            return true;
        }else{
        } else {
            return false;
            return false;
        }
        }
    }
    }
@ -149,18 +150,18 @@ public class WechatCoreController extends WeixinBaseController {
     */
     */
    @RequestMapping(value = "/menu/create")
    @RequestMapping(value = "/menu/create")
    @ResponseBody
    @ResponseBody
    public String createMenuTest(){
        try{
    public String createMenuTest() {
        try {
            String filePath = WechatCoreController.class.getResource("/").getPath() +
            String filePath = WechatCoreController.class.getResource("/").getPath() +
                    File.separator + "weixin_menu.txt";
                    File.separator + "weixin_menu.txt";
            String url = " https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + getAccessToken();
            String url = " https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + getAccessToken();
            // 读取微信菜单配置文件
            // 读取微信菜单配置文件
            InputStreamReader reader = new InputStreamReader(new FileInputStream(filePath),"utf-8");
            InputStreamReader reader = new InputStreamReader(new FileInputStream(filePath), "utf-8");
            BufferedReader bufferedReader = new BufferedReader(reader);
            BufferedReader bufferedReader = new BufferedReader(reader);
            String params = "";
            String params = "";
            String readTxt = "";
            String readTxt = "";
            // 读取微信菜单
            // 读取微信菜单
            while((readTxt = bufferedReader.readLine()) != null){
            while ((readTxt = bufferedReader.readLine()) != null) {
                System.out.println(readTxt);
                System.out.println(readTxt);
                params += readTxt;
                params += readTxt;
            }
            }
@ -168,18 +169,18 @@ public class WechatCoreController extends WeixinBaseController {
            bufferedReader.close();
            bufferedReader.close();
            reader.close();
            reader.close();
            // 替换服务器地址、APPID
            // 替换服务器地址、APPID
            params = params.replaceAll("server_url",SystemConf.getInstance().getSystemProperties().getProperty("wechat_base_url"));
            params = params.replaceAll("appId",SystemConf.getInstance().getSystemProperties().getProperty("appId"));
            params = params.replaceAll("server_url", SystemConf.getInstance().getSystemProperties().getProperty("wechat_base_url"));
            params = params.replaceAll("appId", SystemConf.getInstance().getSystemProperties().getProperty("appId"));
            // 请求微信接口创建菜单
            // 请求微信接口创建菜单
            String jsonStr = HttpUtil.sendPost(url, params);
            String jsonStr = HttpUtil.sendPost(url, params);
            JSONObject result = new JSONObject(jsonStr);
            JSONObject result = new JSONObject(jsonStr);
            if(result != null && result.get("errcode").toString().equals("0") && result.getString("errmsg").equals("ok")){
                return write(200,"创建成功!","data",jsonStr);
            }else{
                return write(-1,"创建失败!","data",jsonStr);
            if (result != null && result.get("errcode").toString().equals("0") && result.getString("errmsg").equals("ok")) {
                return write(200, "创建成功!", "data", jsonStr);
            } else {
                return write(-1, "创建失败!", "data", jsonStr);
            }
            }
        }catch (Exception e){
            return error(-1,"创建失败");
        } catch (Exception e) {
            return error(-1, "创建失败");
        }
        }
    }
    }

+ 173 - 110
patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java

@ -10,7 +10,7 @@ import java.util.*;
/**
/**
 * 微信事件处理
 * 微信事件处理
 *
 * <p>
 * Created by lyr on 2016/08/11.
 * Created by lyr on 2016/08/11.
 */
 */
@Component
@Component
@ -34,7 +34,7 @@ public class WeiXinEventProcess {
                if (message.containsKey("EventKey") && StringUtils.isNotEmpty(message.get("EventKey")) && message.containsKey("Ticket")
                if (message.containsKey("EventKey") && StringUtils.isNotEmpty(message.get("EventKey")) && message.containsKey("Ticket")
                        && StringUtils.isNotEmpty(message.get("Ticket"))) {
                        && StringUtils.isNotEmpty(message.get("Ticket"))) {
                    result = scanEventProcess(message);
                    result = scanEventProcess(message);
                }else{
                } else {
                    result = subscribeEventProcess(message);
                    result = subscribeEventProcess(message);
                }
                }
                break;
                break;
@ -55,17 +55,17 @@ public class WeiXinEventProcess {
     */
     */
    public static String clickProcess(Map<String, String> message) throws Exception {
    public static String clickProcess(Map<String, String> message) throws Exception {
        String result = "";
        String result = "";
        if(message.get("EventKey").equals("caozuoshuoming")){
        if (message.get("EventKey").equals("caozuoshuoming")) {
            String tempStr = clickEventProcess(message);
            String tempStr = clickEventProcess(message);
            /*int firsIndex = tempStr.indexOf("<item>");
            /*int firsIndex = tempStr.indexOf("<item>");
            String result1 = tempStr.substring(0,firsIndex-1);
            String result1 = tempStr.substring(0,firsIndex-1);
            int secondIndex = tempStr.indexOf("<item>",firsIndex+10);
            int secondIndex = tempStr.indexOf("<item>",firsIndex+10);
            String result2 = tempStr.substring(secondIndex-1);*/
            String result2 = tempStr.substring(secondIndex-1);*/
            result=tempStr.replace("<ArticleCount>5</ArticleCount>","<ArticleCount>4</ArticleCount>");
            result = tempStr.replace("<ArticleCount>5</ArticleCount>", "<ArticleCount>4</ArticleCount>");
        }
        }
        if(message.get("EventKey").equals("jiankangdangan")){
            result  = clickEventProcessMenu(message);
        if (message.get("EventKey").equals("jiankangdangan")) {
            result = clickEventProcessMenu(message);
        }
        }
        return result;
        return result;
    }
    }
@ -77,15 +77,15 @@ public class WeiXinEventProcess {
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    private static String clickEventProcess(Map<String,String> message) throws Exception{
    private static String clickEventProcess(Map<String, String> message) throws Exception {
        String result = "";
        String result = "";
        // 配置信息
        // 配置信息
        Properties systemConf = SystemConf.getInstance().getSystemProperties();
        Properties systemConf = SystemConf.getInstance().getSystemProperties();
        // 图文信息
        // 图文信息
        List<Map<String,String>> articles =  new ArrayList<>();
        List<Map<String, String>> articles = new ArrayList<>();
        Map<String,String> articleConsult = new HashMap<>();
        Map<String, String> articleConsult = new HashMap<>();
        // 图文URL
        // 图文URL
        String urlConsult = systemConf.getProperty("patient_consult_url");
        String urlConsult = systemConf.getProperty("patient_consult_url");
        // 图文消息图片URL
        // 图文消息图片URL
@ -96,14 +96,14 @@ public class WeiXinEventProcess {
        //图片地址
        //图片地址
        picUrlConsult = picUrlConsult.replace("{server}", systemConf.getProperty("server_url"));
        picUrlConsult = picUrlConsult.replace("{server}", systemConf.getProperty("server_url"));
        articleConsult.put("Url",urlConsult);
        articleConsult.put("Url", urlConsult);
        articleConsult.put("Title", "医生咨询功能使用说明");
        articleConsult.put("Title", "医生咨询功能使用说明");
        articleConsult.put("Description","功能使用说明");
        articleConsult.put("PicUrl",picUrlConsult);
        articleConsult.put("Description", "功能使用说明");
        articleConsult.put("PicUrl", picUrlConsult);
        articles.add(articleConsult);
        articles.add(articleConsult);
        Map<String,String> articleBooking = new HashMap<>();
        Map<String, String> articleBooking = new HashMap<>();
        // 图文URL
        // 图文URL
        String urlBooking = systemConf.getProperty("patient_booking_url");
        String urlBooking = systemConf.getProperty("patient_booking_url");
        // 图文消息图片URL
        // 图文消息图片URL
@ -111,21 +111,17 @@ public class WeiXinEventProcess {
        // URL设置服务器URL、AppId
        // URL设置服务器URL、AppId
        urlBooking = urlBooking.replace("{server}", systemConf.getProperty("wechat_base_url"))
        urlBooking = urlBooking.replace("{server}", systemConf.getProperty("wechat_base_url"))
                .replace("{appId}", systemConf.getProperty("appId"));
                .replace("{appId}", systemConf.getProperty("appId"));
        System.out.println("picUrlBooking ===>"+picUrlBooking);
        System.out.println("server_url ===>"+systemConf.getProperty("server_url"));
        //图片地址
        //图片地址
        picUrlBooking = picUrlBooking.replace("{server}", systemConf.getProperty("server_url"));
        picUrlBooking = picUrlBooking.replace("{server}", systemConf.getProperty("server_url"));
        articleBooking.put("Url",urlBooking);
        articleBooking.put("Url", urlBooking);
        articleBooking.put("Title", "预约挂号功能使用说明");
        articleBooking.put("Title", "预约挂号功能使用说明");
        articleBooking.put("Description","功能使用说明");
        articleBooking.put("PicUrl",picUrlBooking);
        articleBooking.put("Description", "功能使用说明");
        articleBooking.put("PicUrl", picUrlBooking);
        articles.add(articleBooking);
        articles.add(articleBooking);
        Map<String,String> articleDevice = new HashMap<>();
        Map<String, String> articleDevice = new HashMap<>();
        // 图文URL
        // 图文URL
        String urlDevice = systemConf.getProperty("patient_device_url");
        String urlDevice = systemConf.getProperty("patient_device_url");
        // 图文消息图片URL
        // 图文消息图片URL
@ -136,14 +132,14 @@ public class WeiXinEventProcess {
        //图片地址
        //图片地址
        picUrlDevice = picUrlDevice.replace("{server}", systemConf.getProperty("server_url"));
        picUrlDevice = picUrlDevice.replace("{server}", systemConf.getProperty("server_url"));
        articleDevice.put("Url",urlDevice);
        articleDevice.put("Url", urlDevice);
        articleDevice.put("Title", "体征设备管理功能使用说明");
        articleDevice.put("Title", "体征设备管理功能使用说明");
        articleDevice.put("Description","功能使用说明");
        articleDevice.put("PicUrl",picUrlDevice);
        articleDevice.put("Description", "功能使用说明");
        articleDevice.put("PicUrl", picUrlDevice);
        articles.add(articleDevice);
        articles.add(articleDevice);
        Map<String,String> articleFamily = new HashMap<>();
        Map<String, String> articleFamily = new HashMap<>();
        // 图文URL
        // 图文URL
        String urlFamily = systemConf.getProperty("patient_family_url");
        String urlFamily = systemConf.getProperty("patient_family_url");
        // 图文消息图片URL
        // 图文消息图片URL
@ -154,15 +150,15 @@ public class WeiXinEventProcess {
        //图片地址
        //图片地址
        picUrlFamily = picUrlFamily.replace("{server}", systemConf.getProperty("server_url"));
        picUrlFamily = picUrlFamily.replace("{server}", systemConf.getProperty("server_url"));
        articleFamily.put("Url",urlFamily);
        articleFamily.put("Url", urlFamily);
        articleFamily.put("Title", "我的家庭功能使用说明");
        articleFamily.put("Title", "我的家庭功能使用说明");
        articleFamily.put("Description","功能使用说明");
        articleFamily.put("PicUrl",picUrlFamily);
        articleFamily.put("Description", "功能使用说明");
        articleFamily.put("PicUrl", picUrlFamily);
        articles.add(articleFamily);
        articles.add(articleFamily);
        // 构建回复消息XML
        // 构建回复消息XML
        result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"),message.get("ToUserName"),articles);
        result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        return result;
        return result;
    }
    }
@ -175,14 +171,14 @@ public class WeiXinEventProcess {
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    private static String clickEventProcessMenu(Map<String,String> message) throws Exception{
    private static String clickEventProcessMenu(Map<String, String> message) throws Exception {
        String result = "";
        String result = "";
        // 配置信息
        // 配置信息
        Properties systemConf = SystemConf.getInstance().getSystemProperties();
        Properties systemConf = SystemConf.getInstance().getSystemProperties();
        // 图文信息
        // 图文信息
        List<Map<String,String>> articles =  new ArrayList<>();
        List<Map<String, String>> articles = new ArrayList<>();
        //就诊记录
        //就诊记录
        Map<String,String> articleVisit = new HashMap<>();
        Map<String, String> articleVisit = new HashMap<>();
        String visit = systemConf.getProperty("patient_visit_url");
        String visit = systemConf.getProperty("patient_visit_url");
        // 图文消息图片URL
        // 图文消息图片URL
        String visit_pic = systemConf.getProperty("patient_visit_pic");
        String visit_pic = systemConf.getProperty("patient_visit_pic");
@ -192,14 +188,14 @@ public class WeiXinEventProcess {
        //图片地址
        //图片地址
        visit_pic = visit_pic.replace("{server}", systemConf.getProperty("server_url"));
        visit_pic = visit_pic.replace("{server}", systemConf.getProperty("server_url"));
        articleVisit.put("Url",visit);
        articleVisit.put("Url", visit);
        articleVisit.put("Title", "就诊记录");
        articleVisit.put("Title", "就诊记录");
        articleVisit.put("Description","就诊记录");
        articleVisit.put("PicUrl",visit_pic);
        articleVisit.put("Description", "就诊记录");
        articleVisit.put("PicUrl", visit_pic);
        articles.add(articleVisit);
        articles.add(articleVisit);
        //#检查检验
        //#检查检验
        Map<String,String> articleInspect = new HashMap<>();
        Map<String, String> articleInspect = new HashMap<>();
        // 图文URL
        // 图文URL
        String inspect = systemConf.getProperty("patient_inspect_url");
        String inspect = systemConf.getProperty("patient_inspect_url");
        // 图文消息图片URL
        // 图文消息图片URL
@ -210,13 +206,13 @@ public class WeiXinEventProcess {
        //图片地址
        //图片地址
        inspect_pic = inspect_pic.replace("{server}", systemConf.getProperty("server_url"));
        inspect_pic = inspect_pic.replace("{server}", systemConf.getProperty("server_url"));
        articleInspect.put("Url",inspect);
        articleInspect.put("Url", inspect);
        articleInspect.put("Title", "检查检验");
        articleInspect.put("Title", "检查检验");
        articleInspect.put("Description","检查检验");
        articleInspect.put("PicUrl",inspect_pic);
        articleInspect.put("Description", "检查检验");
        articleInspect.put("PicUrl", inspect_pic);
        articles.add(articleInspect);
        articles.add(articleInspect);
        Map<String,String> articleExamination = new HashMap<>();
        Map<String, String> articleExamination = new HashMap<>();
        // 图文URL
        // 图文URL
        String examination = systemConf.getProperty("patient_examination_url");
        String examination = systemConf.getProperty("patient_examination_url");
        // 图文消息图片URL
        // 图文消息图片URL
@ -227,34 +223,33 @@ public class WeiXinEventProcess {
        //图片地址
        //图片地址
        examination_pic = examination_pic.replace("{server}", systemConf.getProperty("server_url"));
        examination_pic = examination_pic.replace("{server}", systemConf.getProperty("server_url"));
        articleExamination.put("Url",examination);
        articleExamination.put("Url", examination);
        articleExamination.put("Title", "社区体检");
        articleExamination.put("Title", "社区体检");
        articleExamination.put("Description","社区体检");
        articleExamination.put("PicUrl",examination_pic);
        articleExamination.put("Description", "社区体检");
        articleExamination.put("PicUrl", examination_pic);
        articles.add(articleExamination);
        articles.add(articleExamination);
        // 构建回复消息XML
        // 构建回复消息XML
        result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"),message.get("ToUserName"),articles);
        result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        return result;
        return result;
    }
    }
    /**
    /**
     * 关注事件消息发送
     * 关注事件消息发送
     *
     * @param message
     * @param message
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    private static String subscribeEventProcess(Map<String,String> message) throws Exception{
    private static String subscribeEventProcess(Map<String, String> message) throws Exception {
        String result = "";
        String result = "";
        // 配置信息
        // 配置信息
        Properties systemConf = SystemConf.getInstance().getSystemProperties();
        Properties systemConf = SystemConf.getInstance().getSystemProperties();
        // 图文信息
        // 图文信息
        List<Map<String,String>> articles =  new ArrayList<>();
        List<Map<String, String>> articles = new ArrayList<>();
        Map<String,String> article = new HashMap<>();
        Map<String, String> article = new HashMap<>();
        // 图文URL
        // 图文URL
        String url = systemConf.getProperty("doctor_subscribe_url");
        String url = systemConf.getProperty("doctor_subscribe_url");
        // 图文消息图片URL
        // 图文消息图片URL
@ -265,28 +260,29 @@ public class WeiXinEventProcess {
        //图片地址
        //图片地址
        picUrl = picUrl.replace("{server}", systemConf.getProperty("server_url"));
        picUrl = picUrl.replace("{server}", systemConf.getProperty("server_url"));
        article.put("Url",url);
        article.put("Url", url);
        article.put("Title", "欢迎关注厦门i健康,快来签约家庭医生吧~");
        article.put("Title", "欢迎关注厦门i健康,快来签约家庭医生吧~");
        article.put("Description","请点击查看家庭签约");
        article.put("PicUrl",picUrl);
        article.put("Description", "请点击查看家庭签约");
        article.put("PicUrl", picUrl);
        articles.add(article);
        articles.add(article);
        //设置URL
        setUrlItems(articles,systemConf);
        //设置共有的图文消息
        setUrlItems(articles, systemConf);
        // 构建回复消息XML
        // 构建回复消息XML
        result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"),message.get("ToUserName"),articles);
        result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        return result;
        return result;
    }
    }
    /**
    /**
     * 设置微信公共链接
     * 设置微信公共的图文消息
     *
     * @param articles
     * @param articles
     */
     */
    public static void setUrlItems(List<Map<String,String>> articles,Properties systemConf){
        Map<String,String> articleConsult = new HashMap<>();
    public static void setUrlItems(List<Map<String, String>> articles, Properties systemConf) {
        Map<String, String> articleConsult = new HashMap<>();
        // 图文URL
        // 图文URL
        String urlConsult = systemConf.getProperty("patient_consult_url");
        String urlConsult = systemConf.getProperty("patient_consult_url");
        // 图文消息图片URL
        // 图文消息图片URL
@ -297,14 +293,14 @@ public class WeiXinEventProcess {
        //图片地址
        //图片地址
        picUrlConsult = picUrlConsult.replace("{server}", systemConf.getProperty("server_url"));
        picUrlConsult = picUrlConsult.replace("{server}", systemConf.getProperty("server_url"));
        articleConsult.put("Url",urlConsult);
        articleConsult.put("Url", urlConsult);
        articleConsult.put("Title", "医生咨询功能使用说明");
        articleConsult.put("Title", "医生咨询功能使用说明");
        articleConsult.put("Description","功能使用说明");
        articleConsult.put("PicUrl",picUrlConsult);
        articleConsult.put("Description", "功能使用说明");
        articleConsult.put("PicUrl", picUrlConsult);
        articles.add(articleConsult);
        articles.add(articleConsult);
        Map<String,String> articleBooking = new HashMap<>();
        Map<String, String> articleBooking = new HashMap<>();
        // 图文URL
        // 图文URL
        String urlBooking = systemConf.getProperty("patient_booking_url");
        String urlBooking = systemConf.getProperty("patient_booking_url");
        // 图文消息图片URL
        // 图文消息图片URL
@ -315,14 +311,14 @@ public class WeiXinEventProcess {
        //图片地址
        //图片地址
        picUrlBooking = picUrlBooking.replace("{server}", systemConf.getProperty("server_url"));
        picUrlBooking = picUrlBooking.replace("{server}", systemConf.getProperty("server_url"));
        articleBooking.put("Url",urlBooking);
        articleBooking.put("Url", urlBooking);
        articleBooking.put("Title", "预约挂号功能使用说明");
        articleBooking.put("Title", "预约挂号功能使用说明");
        articleBooking.put("Description","功能使用说明");
        articleBooking.put("PicUrl",picUrlBooking);
        articleBooking.put("Description", "功能使用说明");
        articleBooking.put("PicUrl", picUrlBooking);
        articles.add(articleBooking);
        articles.add(articleBooking);
        Map<String,String> articleDevice = new HashMap<>();
        Map<String, String> articleDevice = new HashMap<>();
        // 图文URL
        // 图文URL
        String urlDevice = systemConf.getProperty("patient_device_url");
        String urlDevice = systemConf.getProperty("patient_device_url");
        // 图文消息图片URL
        // 图文消息图片URL
@ -333,14 +329,14 @@ public class WeiXinEventProcess {
        //图片地址
        //图片地址
        picUrlDevice = picUrlDevice.replace("{server}", systemConf.getProperty("server_url"));
        picUrlDevice = picUrlDevice.replace("{server}", systemConf.getProperty("server_url"));
        articleDevice.put("Url",urlDevice);
        articleDevice.put("Url", urlDevice);
        articleDevice.put("Title", "体征设备管理功能使用说明");
        articleDevice.put("Title", "体征设备管理功能使用说明");
        articleDevice.put("Description","功能使用说明");
        articleDevice.put("PicUrl",picUrlDevice);
        articleDevice.put("Description", "功能使用说明");
        articleDevice.put("PicUrl", picUrlDevice);
        articles.add(articleDevice);
        articles.add(articleDevice);
        Map<String,String> articleFamily = new HashMap<>();
        Map<String, String> articleFamily = new HashMap<>();
        // 图文URL
        // 图文URL
        String urlFamily = systemConf.getProperty("patient_family_url");
        String urlFamily = systemConf.getProperty("patient_family_url");
        // 图文消息图片URL
        // 图文消息图片URL
@ -351,10 +347,10 @@ public class WeiXinEventProcess {
        //图片地址
        //图片地址
        picUrlFamily = picUrlFamily.replace("{server}", systemConf.getProperty("server_url"));
        picUrlFamily = picUrlFamily.replace("{server}", systemConf.getProperty("server_url"));
        articleFamily.put("Url",urlFamily);
        articleFamily.put("Url", urlFamily);
        articleFamily.put("Title", "我的家庭功能使用说明");
        articleFamily.put("Title", "我的家庭功能使用说明");
        articleFamily.put("Description","功能使用说明");
        articleFamily.put("PicUrl",picUrlFamily);
        articleFamily.put("Description", "功能使用说明");
        articleFamily.put("PicUrl", picUrlFamily);
        articles.add(articleFamily);
        articles.add(articleFamily);
    }
    }
@ -371,102 +367,169 @@ public class WeiXinEventProcess {
        // 场景值
        // 场景值
        String eventKey = message.get("EventKey");
        String eventKey = message.get("EventKey");
        if(StringUtils.isNotEmpty(eventKey) && (eventKey.startsWith("qr_") ||
        if (StringUtils.isNotEmpty(eventKey) && (eventKey.startsWith("qr_") ||
                eventKey.startsWith("qrscene_qr_"))) {
                eventKey.startsWith("qrscene_qr_"))) {
            // 配置
            // 配置
            Properties systemConf = SystemConf.getInstance().getSystemProperties();
            Properties systemConf = SystemConf.getInstance().getSystemProperties();
            // 图文信息
            // 图文信息
            List<Map<String,String>> articles =  new ArrayList<>();
            Map<String,String> article = new HashMap<>();
            // 二维码跳转URL
            List<Map<String, String>> articles = new ArrayList<>();
            Map<String, String> article = new HashMap<>();
            // 医生二维码跳转URL
            String url = systemConf.getProperty("doctor_qrcode_url");
            String url = systemConf.getProperty("doctor_qrcode_url");
            // 图片URL
            // 图片URL
            String picUrl = systemConf.getProperty("doctor_qrcode_pic_url");
            String picUrl = systemConf.getProperty("doctor_qrcode_pic_url");
            // 二维码参数
            // 二维码参数
            String[] keys = eventKey.replace("qrscene_qr_","").replace("qr_","").split("_");
            String[] keys = eventKey.replace("qrscene_qr_", "").replace("qr_", "").split("_");
            // 图文消息URL
            // 图文消息URL
            url = url.replace("{server}", systemConf.getProperty("wechat_base_url"))
            url = url.replace("{server}", systemConf.getProperty("wechat_base_url"))
                    .replace("{appId}", systemConf.getProperty("appId"))
                    .replace("{appId}", systemConf.getProperty("appId"))
                    .replace("{doctorCode}",keys[0]);
                    .replace("{doctorCode}", keys[0]);
            //图片地址
            //图片地址
            picUrl = picUrl.replace("{server}", systemConf.getProperty("server_url"));
            picUrl = picUrl.replace("{server}", systemConf.getProperty("server_url"));
            article.put("Url",url);
            article.put("Title",keys[1] + "医生签约");
            article.put("Description","请点击查看医生详情并申请签约");
            article.put("PicUrl",picUrl);
            article.put("Url", url);
            article.put("Title", keys[1] + "医生签约");
            article.put("Description", "请点击查看医生详情并申请签约");
            article.put("PicUrl", picUrl);
            articles.add(article);
            articles.add(article);
            //设置通用链接
            //设置通用链接
            setUrlItems(articles,systemConf);
            setUrlItems(articles, systemConf);
            //加入续签图文
            Map videoText = getNews("patient_sign_again_url", "patient_sign_again_pic_url", "家庭医生续签提醒", null);
            articles.add(videoText);
            // 消息XML
            // 消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"),message.get("ToUserName"),articles);
        }else if(StringUtils.isNotEmpty(eventKey) && (eventKey.startsWith("hs_") ||
                eventKey.startsWith("qrscene_hs_"))){
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        } else if (StringUtils.isNotEmpty(eventKey) && (eventKey.startsWith("hs_") ||
                eventKey.startsWith("qrscene_hs_"))) {
            // 配置信息
            // 配置信息
            Properties systemConf = SystemConf.getInstance().getSystemProperties();
            Properties systemConf = SystemConf.getInstance().getSystemProperties();
            // 图文信息
            // 图文信息
            List<Map<String,String>> articles =  new ArrayList<>();
            Map<String,String> article = new HashMap<>();
            List<Map<String, String>> articles = new ArrayList<>();
            Map<String, String> article = new HashMap<>();
            // 社区二维码跳转URL
            // 社区二维码跳转URL
            String url = systemConf.getProperty("doctor_hos_qrcode_url");
            String url = systemConf.getProperty("doctor_hos_qrcode_url");
            // 图片URL
            // 图片URL
            String picUrl = systemConf.getProperty("doctor_qrcode_pic_url");
            String picUrl = systemConf.getProperty("doctor_qrcode_pic_url");
            // 二维码参数
            // 二维码参数
            String[] keys = eventKey.replace("qrscene_hs_","").replace("hs_","").split("_");
            String[] keys = eventKey.replace("qrscene_hs_", "").replace("hs_", "").split("_");
            // 图文消息URL
            // 图文消息URL
            url = url.replace("{server}", systemConf.getProperty("wechat_base_url"))
            url = url.replace("{server}", systemConf.getProperty("wechat_base_url"))
                    .replace("{appId}", systemConf.getProperty("appId"))
                    .replace("{appId}", systemConf.getProperty("appId"))
                    .replace("{hospital}",keys[0] + ":" + keys[1]);
                    .replace("{hospital}", keys[0] + ":" + keys[1]);
            //图片地址
            //图片地址
            picUrl = picUrl.replace("{server}", systemConf.getProperty("server_url"));
            picUrl = picUrl.replace("{server}", systemConf.getProperty("server_url"));
            article.put("Url",url);
            article.put("Title",keys[1]);
            article.put("Description","请点击查看社区详情");
            article.put("PicUrl",picUrl);
            article.put("Url", url);
            article.put("Title", keys[1]);
            article.put("Description", "请点击查看社区详情");
            article.put("PicUrl", picUrl);
            articles.add(article);
            articles.add(article);
            //设置通用链接
            //设置通用链接
            setUrlItems(articles,systemConf);
            setUrlItems(articles, systemConf);
            //加入续签图文
            Map videoText = getNews("patient_sign_again_url", "patient_sign_again_pic_url", "家庭医生续签提醒", null);
            articles.add(videoText);
            // 消息XML
            // 消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"),message.get("ToUserName"),articles);
        } else if(StringUtils.isNotEmpty(eventKey) && (eventKey.startsWith("tw_") ||
                eventKey.startsWith("qrscene_tw_"))){
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        } else if (StringUtils.isNotEmpty(eventKey) && (eventKey.startsWith("tw_") ||
                eventKey.startsWith("qrscene_tw_"))) {
            // 配置信息
            // 配置信息
            Properties systemConf = SystemConf.getInstance().getSystemProperties();
            Properties systemConf = SystemConf.getInstance().getSystemProperties();
            // 图文信息
            // 图文信息
            List<Map<String,String>> articles =  new ArrayList<>();
            Map<String,String> article = new HashMap<>();
            // 社区二维码跳转URL
            List<Map<String, String>> articles = new ArrayList<>();
            Map<String, String> article = new HashMap<>();
            // 区二维码跳转URL
            String url = systemConf.getProperty("doctor_town_qrcode_url");
            String url = systemConf.getProperty("doctor_town_qrcode_url");
            // 图片URL
            // 图片URL
            String picUrl = systemConf.getProperty("doctor_qrcode_pic_url");
            String picUrl = systemConf.getProperty("doctor_qrcode_pic_url");
            // 二维码参数
            // 二维码参数
            String[] keys = eventKey.replace("qrscene_tw_","").replace("tw_","").split("_");
            String[] keys = eventKey.replace("qrscene_tw_", "").replace("tw_", "").split("_");
            // 图文消息URL
            // 图文消息URL
            url = url.replace("{server}", systemConf.getProperty("wechat_base_url"))
            url = url.replace("{server}", systemConf.getProperty("wechat_base_url"))
                    .replace("{appId}", systemConf.getProperty("appId"))
                    .replace("{appId}", systemConf.getProperty("appId"))
                    .replace("{town}",keys[0]);
                    .replace("{town}", keys[0]);
            //图片地址
            //图片地址
            picUrl = picUrl.replace("{server}", systemConf.getProperty("server_url"));
            picUrl = picUrl.replace("{server}", systemConf.getProperty("server_url"));
            article.put("Url",url);
            article.put("Title",keys[1]);
            article.put("Description","请点击查看区详情");
            article.put("PicUrl",picUrl);
            article.put("Url", url);
            article.put("Title", keys[1]);
            article.put("Description", "请点击查看区详情");
            article.put("PicUrl", picUrl);
            articles.add(article);
            articles.add(article);
            //设置通用链接
            //设置通用链接
            setUrlItems(articles,systemConf);
            setUrlItems(articles, systemConf);
            //加入续签图文
            Map videoText = getNews("patient_sign_again_url", "patient_sign_again_pic_url", "家庭医生续签提醒", null);
            articles.add(videoText);
            // 消息XML
            // 消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"),message.get("ToUserName"),articles);
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        }
        }
        return result;
        return result;
    }
    }
    /**
     * 构建单个图文消息工具类
     *
     * @param url         跳转URL
     * @param picUrl      图片地址
     * @param title       图文标题
     * @param description 图文描述
     * @return
     */
    public static Map getNews(String url, String picUrl, String title, String description) {
        Properties systemConf = SystemConf.getInstance().getSystemProperties();
        Map<String, String> news = new HashMap<>();
        // 图文URL
        String targetUrl = systemConf.getProperty(url);
        // 图文消息图片URL
        String pictureUrl = systemConf.getProperty(picUrl);
        // URL设置服务器URL、AppId
        targetUrl = targetUrl.replace("{server}", systemConf.getProperty("wechat_base_url"))
                .replace("{appId}", systemConf.getProperty("appId"));
        //图片地址
        pictureUrl = pictureUrl.replace("{server}", systemConf.getProperty("server_url"));
        System.out.println("url ====> " + targetUrl);
        System.out.println("picurl ======> " + pictureUrl);
        news.put("Url", targetUrl);
        if (StringUtils.isNotEmpty(title)) {
            news.put("Title", title);
        }
        if (StringUtils.isNotEmpty(description)) {
            news.put("Description", description);
        }
        news.put("PicUrl", pictureUrl);
        return news;
    }
    /**
     * 居民微信回复关键字处理
     *
     * @param message
     * @return
     */
    public static String replyKeyword(Map<String, String> message) throws Exception {
        String result = "";
        String description = "您的家庭医生签约将于7月31日到期,为了能继续给您提供健康服务,诚邀您续签家庭医生。";
        String description1 = "为了能给您提供健康服务,诚邀您签签约家庭医生。";
        // 图文信息
        List<Map<String, String>> articles = new ArrayList<>();
        Map videoText = getNews("doctor_subscribe_url", "doctor_qrcode_pic_url", "欢迎关注厦门i健康,快来签约家庭医生吧~", null);
        Map videoText1 = getNews("patient_sign_again_url", "patient_sign_again_pic_url", "家庭医生续签提醒", null);
        System.out.println("255");
        articles.add(videoText);
        articles.add(videoText1);
        // 构建回复消息XML
        result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        System.out.println("256");
        return result;
    }
}
}

+ 17 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/util/WeiXinMessageReplyUtils.java

@ -48,4 +48,21 @@ public class WeiXinMessageReplyUtils {
        return result.toString();
        return result.toString();
    }
    }
    /**
     * 公众号群发图文消息
     *
     * @param toUser
     * @param fromUser
     * @param articles
     * @return
     * @throws Exception
     */
    public static String mapNewsMessage(String toUser,String fromUser,List<Map<String,String>> articles) throws Exception {
//1.上传图片到微信服务器
//2.上传图文消息素材到微信服务器
// 3.根据openID列表群发
        return null;
    }
}
}

BIN
patient-co-wlyy/src/main/webapp/images/renew.png