wujunjie преди 7 години
родител
ревизия
5bfb969a0e

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/SMS.java

@ -18,7 +18,7 @@ public class SMS extends IdEntity {
    private String mobile;// 手机号
    private String ip;// ip地址
    private Integer type;// 消息类型:1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录,6代预约(发送给居民)  10患者添加家庭关系,11账号申诉处理完成
    private Integer type;// 消息类型:0:客服系统发送消息 1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录,6代预约(发送给居民)  10患者添加家庭关系,11账号申诉处理完成
    private String captcha;// 验证码
    private String content;// 消息内容
    private Date deadline;// 过期时间

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

@ -1,10 +1,14 @@
package com.yihu.wlyy.web.third.gateway.controller.doctor;
import com.yihu.wlyy.entity.message.SMS;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.message.SMSDao;
import com.yihu.wlyy.service.common.SMSService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.NetworkUtil;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.web.third.gateway.vo.base.BaseResultModel;
import com.yihu.wlyy.web.third.gateway.vo.base.ResultBatchModel;
import com.yihu.wlyy.wechat.util.WeiXinTempMsgSendUtils;
@ -46,6 +50,8 @@ public class GcMessageController {
    private SMSService smsService;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    public SMSDao smsDao;
    @Value("${wechat.message.template_consult_notice}")
    private String templateId;
    @Value("${wechat.message.template_callserver_remind}")
@ -211,6 +217,25 @@ public class GcMessageController {
            for (String mobile : codeArr) {
                try {
                    JSONObject result = smsService.sendMsg(mobile, content);
                    // 保存短信发送记录
                    SMS sms = new SMS();
                    Date date = new Date();
                    // 延后5分钟
                    sms.setContent(content);
                    sms.setDeadline(DateUtil.getNextMin(date, 5));
                    sms.setCzrq(date);
                    sms.setMobile(mobile);
                    sms.setIp("customer");
                    sms.setType(0);
                    // 调用总部发送信息的接口
                    if (result != null && result.getInt("result") == 0) {
                        //发送成功,保存到数据库
                        sms.setStatus(1);
                        smsDao.save(sms);
                    }
                    logger.info("send mobile message param : "+mobile+" ====> "+content);
                    logger.info("send mobile message return : "+result);
                    success++;

+ 2 - 6
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/PatientConfirmReceiptJob.java

@ -47,8 +47,6 @@ public class PatientConfirmReceiptJob implements Job {
    private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
    @Autowired
    private WeiXinOpenIdUtils weiXinOpenIdUtils;
    @Value("${server.server_url}")
    private String server_url;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
@ -74,8 +72,6 @@ public class PatientConfirmReceiptJob implements Job {
                        long days = DateUtil.getDays(today,payTime);
                        if(days == 3){
                            //支付后第三天发送自动确认预提醒
                            prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
                            list.add(prescription);
                            sendWechatTemplate(1,patient,prescription.getCode());
                        }
                        int result = today.compareTo(confirm);
@ -117,7 +113,7 @@ public class PatientConfirmReceiptJob implements Job {
        JSONObject sendJson = new JSONObject();
        if (type == 1) {
            String url = server_url+"wx/html/prescription/html/order_tracking.html?code=" + PrescriptionCode +"&represented="+patient;
            String url = "prescription/html/order_tracking.html?code=" + PrescriptionCode +"&represented="+patient;
            String first = name + "您好,您的续方订单将在4天后自动确认收药,如您已经取药,请点击本消息完成确认收药操作,结束订单";
            String remark = "如果您希望延长自动确认收药时间,请点击本消息后进行延长收药操作。";
@ -147,7 +143,7 @@ public class PatientConfirmReceiptJob implements Job {
            }
            logger.info("sendJson: " + sendJson);
        }else if (type == 2) {
            String url = server_url+"wx/html/prescription/html/order_tracking.html?code=" + PrescriptionCode +"&represented="+patient;
            String url = "prescription/html/order_tracking.html?code=" + PrescriptionCode +"&represented="+patient;
            String first = name + "您好,您的续方订单已自动确认收药";
            String remark = "如果您未收到续方药品,请及时与社区药房工作人员联系。";
            sendJson.put("keyword1", name);