trick9191 преди 7 години
родител
ревизия
9c39c1660a

+ 39 - 0
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcMessageController.java

@ -48,6 +48,8 @@ public class GcMessageController {
    private DoctorDao doctorDao;
    @Value("${wechat.message.template_consult_notice}")
    private String templateId;
    @Value("${wechat.message.template_callserver_remind}")
    private String callServerTemplateId;
    @Value("${server.server_url}")
    private String server_url;
@ -152,6 +154,43 @@ public class GcMessageController {
        }
    }
    @RequestMapping(value = "/sendCallServerWechatMessage", method = RequestMethod.POST)
    @ApiOperation("客服系统发送协同服务微信模板消息接口")
    public ResultBatchModel sendCallServerWechatMessage(
            @ApiParam(name = "openIds", value = "微信openid", required = true) @RequestParam(value = "openIds", required = true) String openIds,
            @ApiParam(name = "remark", value = "服务内容", required = true) @RequestParam(value = "remark", required = true)String remark,
            @ApiParam(name = "doctorName", value = "消息内容", required = true) @RequestParam(value = "doctorName", required = true)String doctorName,
            @ApiParam(name = "patientName", value = "居民姓名", required = true) @RequestParam(value = "patientName", required = true) String patientName,
            @ApiParam(name = "mobile", value = "居民手机", required = true) @RequestParam(value = "mobile", required = true)String mobile,
            @ApiParam(name = "typeName", value = "服务类型", required = true) @RequestParam(value = "typeName", required = true)String typeName) {
        Integer success = 0;
        Integer error = 0;
        List<String> errorLiust = new ArrayList<>();
        try {
            String url = server_url + "wx_doctor/html/home/html/jumpApp.html";
            String[] codeArr = openIds.split(",");
            for (String openId : codeArr) {
                try {
                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                    JSONObject sendJson = weiXinTempMsgSendUtils.packageTemplate("您好,您有一条协同服务待处理。", remark, doctorName, patientName,mobile,dateFormat.format(new Date()),typeName);
                    Boolean flag = weiXinTempMsgSendUtils.sendTemplateMessage(callServerTemplateId, openId, url, sendJson,null);
                    logger.info("send wechat message param : " + openId+" =======> "+remark);
                    logger.info("send wechat message retuen : " + openId+" =======> "+flag);
                    success++;
                } catch (Exception e) {
                    e.printStackTrace();
                    logger.error("openids " + openIds + " send Template error:" + e.getMessage());
                    error++;
                    errorLiust.add(openIds);
                }
            }
            return new ResultBatchModel(success, error, errorLiust);
        } catch (Exception e) {
            e.printStackTrace();
            return new ResultBatchModel(-1, "发送失败!", success, error, errorLiust);
        }
    }
    /**
     * 客服系统发送消息接口 居民没有有openID只发手机短信 有openID发微信模板消息、手机短信 没有IP次数限制
     *

+ 2 - 0
patient-co/patient-co-doctor-assistant/src/main/resources/application-dev.yml

@ -52,6 +52,8 @@ wechat:
   template_schedule_remind: z32DERzD6X4ShOl86sI3YCOWl-lkr5Z9sKh1w_YG8Bs
   #服务待处理提醒
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
   #协同服务提醒
   template_callserver_remind: Fsnt5YUDBCNOREMKifZbr51XhNRyop6VAEV8mIuFYuc
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/

+ 2 - 1
patient-co/patient-co-doctor-assistant/src/main/resources/application-devtest.yml

@ -52,7 +52,8 @@ wechat:
   template_schedule_remind: z32DERzD6X4ShOl86sI3YCOWl-lkr5Z9sKh1w_YG8Bs
   #服务待处理提醒
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
   #协同服务提醒
   template_callserver_remind: Fsnt5YUDBCNOREMKifZbr51XhNRyop6VAEV8mIuFYuc
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/

+ 2 - 1
patient-co/patient-co-doctor-assistant/src/main/resources/application-local.yml

@ -52,7 +52,8 @@ wechat:
   template_schedule_remind: z32DERzD6X4ShOl86sI3YCOWl-lkr5Z9sKh1w_YG8Bs
   #服务待处理提醒
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
   #协同服务提醒
   template_callserver_remind: Fsnt5YUDBCNOREMKifZbr51XhNRyop6VAEV8mIuFYuc
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/

+ 2 - 0
patient-co/patient-co-doctor-assistant/src/main/resources/application-localtest.yml

@ -52,6 +52,8 @@ wechat:
   template_schedule_remind: z32DERzD6X4ShOl86sI3YCOWl-lkr5Z9sKh1w_YG8Bs
   #服务待处理提醒
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
   #协同服务提醒
   template_callserver_remind: Fsnt5YUDBCNOREMKifZbr51XhNRyop6VAEV8mIuFYuc
yihu:

+ 2 - 0
patient-co/patient-co-doctor-assistant/src/main/resources/application-prod.yml

@ -51,6 +51,8 @@ wechat:
   template_schedule_remind:  9l1CBFlnJJaqWXW2UVQfgUidhtt5Fff_1L50RgXpIY8
   #服务待处理提醒
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
   #协同服务提醒
   template_callserver_remind: Fsnt5YUDBCNOREMKifZbr51XhNRyop6VAEV8mIuFYuc
yihu:
  yihu_OpenPlatform_url: http://api.yihu.com.cn/OpenPlatform/cgiBin/1.0/

+ 2 - 0
patient-co/patient-co-doctor-assistant/src/main/resources/application-test.yml

@ -51,6 +51,8 @@ wechat:
   template_schedule_remind: z32DERzD6X4ShOl86sI3YCOWl-lkr5Z9sKh1w_YG8Bs
   #服务待处理提醒
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
   #协同服务提醒
   template_callserver_remind: Fsnt5YUDBCNOREMKifZbr51XhNRyop6VAEV8mIuFYuc
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/