Przeglądaj źródła

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

ysj 5 lat temu
rodzic
commit
f049337090

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientDao.java

@ -36,6 +36,8 @@ public interface BasePatientDao extends PagingAndSortingRepository<BasePatientDO
    @Query("from BasePatientDO p where p.mobile = ?1 and p.del=?2")
    List<BasePatientDO> findByMobileAndDel(String mobile,String del);
    
    BasePatientDO findByIdcard(String idcard);
//    @Modifying
//    @Query(" update BasePatientDO a set a.openid=?2 where a.id=?1 ")

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/wechat/service/WechatInfoService.java

@ -66,7 +66,7 @@ public class WechatInfoService {
            WxWechatDO wxWechat = null;
            
            //中山医院互联网医院
            if("xm_zsyy_wx".equals(wxId) || "xm_xzzx_wx".equals(wxId)){
            if("xm_zsyy_wx".equals(wxId) || "xm_xzzx_wx".equals(wxId) || "xm_ykyy_wx".equals(wxId)){
                jsapiTickets = wxAccessTokenService.findJsapiTicket(wxId);
            }else{
                wxWechat = wxAccessTokenService.getWxInfo(wxId);

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

@ -11,6 +11,7 @@ import com.yihu.jw.oauth.OauthSsoService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.utils.RSAEncrypt;
@ -199,6 +200,7 @@ public class WxTemplateService {
        weixinMessagePushUtils.putWxMsg(wxAccessTokenService.getWxAccessTokenById(wechatId).getAccessToken(),openid,config);
        return "success";
    }
    
    public Envelop getAllTemp(String wechatId){
@ -245,5 +247,40 @@ public class WxTemplateService {
        }
        return rs;
    }
    
    /**
     * 发送微信模版消息
     * @param userName
     * @param senderName
     * @param idCard
     * @param phone
     * @param title
     * @param content
     * @param contentString
     * @param url
     */
    public String sendWxTemple(String userName, String senderName,
                             String idCard, String phone, String title,
                             String content, String contentString,
                             String url) throws Exception{
        BasePatientDO basePatientDO = basePatientDao.findByIdcard(idCard);
        if(basePatientDO!=null){
            List<BasePatientWechatDo> ps = basePatientWechatDao.findByWechatIdAndPatientId(wechatId,basePatientDO.getId());
            if(ps.isEmpty()){
                logger.info("该用户"+basePatientDO.getName()+"没有openid,无法推送模版消息,用户ID:"+basePatientDO.getId()+"wechatId:"+wechatId);
            }else{
                for (BasePatientWechatDo basePatientWechatDo:ps){
                        WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId,"template_im_notice","zxtx",1);
                        config.setFirst(config.getFirst().replace("key1",senderName));
                        config.setKeyword1(contentString);
                        config.setKeyword2(DateUtil.dateToStrLong(new Date()));
                        config.setUrl(url);
                        weixinMessagePushUtils.putWxMsg(wxAccessTokenService.getWxAccessTokenById(wechatId).getAccessToken(),basePatientWechatDo.getOpenid(),config);
                }
            }
        }else{
            throw new Exception("接收者ID错误,无法找到该账号");
        }
        return "success";
    }
}

+ 8 - 8
common/common-entity/src/main/java/com/yihu/jw/entity/iot/company/IotCompanyDO.java

@ -74,7 +74,7 @@ public class IotCompanyDO extends UuidIdentityEntityWithOperator implements Seri
    @Column(name = "audit_name")
    private String auditName;//审核人姓名
    @Transient
    private List<IotCompanyAppDO> appList;//应用实体
//    private List<IotCompanyAppDO> appList;//应用实体
    public String getSaasId() {
        return saasId;
@ -285,11 +285,11 @@ public class IotCompanyDO extends UuidIdentityEntityWithOperator implements Seri
        this.auditName = auditName;
    }
    public List<IotCompanyAppDO> getAppList() {
        return appList;
    }
    public void setAppList(List<IotCompanyAppDO> appList) {
        this.appList = appList;
    }
//    public List<IotCompanyAppDO> getAppList() {
//        return appList;
//    }
//
//    public void setAppList(List<IotCompanyAppDO> appList) {
//        this.appList = appList;
//    }
}

+ 2 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -1076,5 +1076,7 @@ public class BaseHospitalRequestMapping {
    public static class WxPay extends Basic{
        public static final String wechatPay =  "/wechatPay";
        public static final String Notify =  "/notify";
        //发送微信模版消息
        public static final String sendWxTemple = "/sendWxTemple";
    }
}

+ 29 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java

@ -5,11 +5,13 @@ import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import com.yihu.jw.wechat.service.WxTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -40,6 +42,8 @@ public class YkyyController extends EnvelopRestEndpoint {
    private BusinessOrderService businessOrderService;
    @Autowired
    private YkyyEntranceService ykyyEntranceService;
    @Autowired
    private WxTemplateService wxTemplateService;
    @GetMapping(value = "/selectCardList")
@ -285,8 +289,29 @@ public class YkyyController extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    
    @ResponseBody
    @ApiOperation("发送微信模版消息")
    @RequestMapping(value = BaseHospitalRequestMapping.WxPay.sendWxTemple, method = {RequestMethod.GET, RequestMethod.POST})
    public Envelop sendWxTemple(@ApiParam(name = "userName", value = "居民名称")
                                              @RequestParam(value = "userName", required = false,defaultValue = "") String userName,
                                          @ApiParam(name = "senderName", value = "发送人名称")
                                              @RequestParam(value = "senderName", required = false,defaultValue = "") String senderName,
                                          @ApiParam(name = "idCard", value = "身份证")
                                              @RequestParam(value = "idCard", required = false,defaultValue = "") String idCard,
                                          @ApiParam(name = "phone", value = "居民手机")
                                              @RequestParam(value = "phone", required = false,defaultValue = "") String phone,
                                          @ApiParam(name = "title", value = "标题")
                                              @RequestParam(value = "title", required = false,defaultValue = "") String title,
                                          @ApiParam(name = "content", value = "简介")
                                              @RequestParam(value = "content", required = false,defaultValue = "") String content,
                                          @ApiParam(name = "contentString", value = "回复内容")
                                              @RequestParam(value = "contentString", required = false,defaultValue = "") String contentString,
                                          @ApiParam(name = "url", value = "跳转URL")
                                              @RequestParam(value = "url", required = false,defaultValue = "") String url
    )throws Exception  {
        wxTemplateService.sendWxTemple(userName,senderName,idCard,phone,title,content,contentString,url);
        return success("操作成功");
    }
}