Explorar el Código

眼科医院处方物流

ysj hace 5 años
padre
commit
8b0865a553

+ 9 - 9
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxTemplateService.java

@ -22,6 +22,8 @@ import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.dao.WxTemplateDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -134,11 +136,6 @@ public class WxTemplateService {
        if("xm_ykyy_wx".equals(wechatId)){
            //获取已审核未结算的处方
            JSONArray array = ykyyEntranceService.getUnsettledPrescription();
//            JSONArray array = new JSONArray();
//            JSONObject tmpjson = new JSONObject();
//            tmpjson.put("BRID","1234");
//            tmpjson.put("CFSB","1159744");
//            array.add(tmpjson);
            //发送模板
            if(array!=null&&array.size()>0) {
                for (int i = 0; i<array.size(); i++){
@ -168,11 +165,14 @@ public class WxTemplateService {
                                }else{
                                    ps.stream().forEach(one->{
                                        WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId,"template_unsettled_notice","djsxxtz",1);
                                        config.setFirst(config.getFirst().replace("key1",patientDO.getName()));
                                        config.setUrl(config.getUrl()+""+outpatientId+"&openid="+one.getOpenid());
                                        config.setKeyword3(doctorName);
                                        WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
                                        BeanUtils.copyProperties(config,newConfig);
                                        newConfig.setFirst(config.getFirst().replace("key1",patientDO.getName()));
                                        newConfig.setUrl(config.getUrl()+""+outpatientId);
                                        newConfig.setKeyword3(doctorName);
                                        WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
                                        weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(),one.getOpenid(),config);
                                        logger.info("=======setUrl========"+newConfig.getUrl());
                                        weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(),one.getOpenid(),newConfig);
                                    });
                                    //保存发送模板记录,
                                    WxPushLogDO wxPushLogDO = new WxPushLogDO();