Commit 5714942e993f44603f8f85a2963f02ead22f97f3

Authored by zhangchao
1 parent 3d2965340b
Exists in dev

#fix 优化问诊卡推送服务接口

Showing 2 changed files with 29 additions and 22 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsHisInfoServiceImpl.java View file @ 5714942
... ... @@ -73,41 +73,48 @@
73 73 new Thread(new Runnable() {
74 74 @Override
75 75 public void run() {
76   - LymsPatient patient =null;
77   - String idCard = lymsHisInfo.getIdcard();
78   - if (StringUtil.isEmpty(idCard)) {
79   - QueryWrapper<LymsPatient> queryWrapper = new QueryWrapper<>();
80   - queryWrapper.eq("pname",lymsHisInfo.getName());
81   - queryWrapper.eq("enrolment_phone",lymsHisInfo.getPhone());
82   - List<LymsPatient> list = lymsPatientService.list(queryWrapper);
83   - if(CollectionUtils.isNotEmpty(list)){
84   - patient=list.get(0);
  76 + try {
  77 + Thread.sleep(5000);
  78 + LymsPatient patient =null;
  79 + String idCard = lymsHisInfo.getIdcard();
  80 + if (StringUtil.isEmpty(idCard)) {
  81 + QueryWrapper<LymsPatient> queryWrapper = new QueryWrapper<>();
  82 + queryWrapper.eq("pname",lymsHisInfo.getName());
  83 + queryWrapper.eq("enrolment_phone",lymsHisInfo.getPhone());
  84 + List<LymsPatient> list = lymsPatientService.list(queryWrapper);
  85 + if(CollectionUtils.isNotEmpty(list)){
  86 + patient=list.get(0);
  87 + }
  88 + }else {
  89 + //判断患者是否存在
  90 + LymsPatient patientQuery = new LymsPatient();
  91 + patientQuery.setIdno(idCard.toLowerCase());
  92 + patient = lymsPatientService.getOne(Wrappers.query(patientQuery));
85 93 }
86   - }else {
87   - //判断患者是否存在
88   - LymsPatient patientQuery = new LymsPatient();
89   - patientQuery.setIdno(idCard.toLowerCase());
90   - patient = lymsPatientService.getOne(Wrappers.query(patientQuery));
91   - }
92   - if (patient!=null){
93   - List<PushOrderResult> orderList= lymsOrderService.selectPushOrder(patient.getId());
94   - if (CollectionUtils.isNotEmpty(orderList)){
95   - PushOrderResult order= orderList.get(0);
  94 + if (patient!=null){
  95 + List<PushOrderResult> orderList= lymsOrderService.selectPushOrder(patient.getId());
  96 + log.info("SendWeChatMsg--->orderList,"+orderList.toString());
  97 + if (CollectionUtils.isNotEmpty(orderList)){
  98 + PushOrderResult order= orderList.get(0);
96 99 //推送微信公众号
97 100 Map<String,Object> map=new HashMap<>();
98 101 map.put("keyword1",new DataEntity(order.getPname(),"#173177"));
99 102 map.put("keyword2",new DataEntity(order.getHname(),"#173177"));
100   - map.put("keyword3",new DataEntity(order.getDname(),"#173177"));
  103 + map.put("keyword3",new DataEntity(order.getDname()+"【点击此提醒可查看服务具体内容】","#173177"));
101 104  
102 105 //公众号跳转小程序需要的登录信息
103 106 Map<String,Object> mapInfo =lymsUserService.pLoginInfo(order.getPid(),3);
104 107 try {
  108 + log.info("SendWeChatMsg--->startup");
105 109 Integer code= WeiXinUtil.SendWeChatMsg(order.getGzopenid(),Constant.GZ_TEMPLATE_ID,map,mapInfo);
106 110 log.info("SendWeChatMsg--->code, "+code);
107 111 } catch (Exception e) {
108 112 log.error("serviceContent Exception,"+e.getMessage());
109 113 }
  114 + }
110 115 }
  116 + }catch (Exception e){
  117 + log.error("upHisInfo---> Thread Exception"+e.getMessage());
111 118 }
112 119 }
113 120 }).start();
talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/ServiceContentTask.java View file @ 5714942
... ... @@ -55,12 +55,12 @@
55 55 Map<String,Object> map=new HashMap<>();
56 56 map.put("keyword1",new DataEntity(order.getPname(),"#173177"));
57 57 map.put("keyword2",new DataEntity(order.getHname(),"#173177"));
58   - map.put("keyword3",new DataEntity(order.getDname(),"#173177"));
  58 + map.put("keyword3",new DataEntity(order.getDname()+"【点击此提醒可查看服务具体内容】","#173177"));
59 59  
60 60 //公众号跳转小程序需要的登录信息
61 61 Map<String,Object> mapInfo =lymsUserService.pLoginInfo(order.getPid(),3);
62 62 try {
63   -
  63 + log.info("serviceContent-->SendWeChatMsg--->start up");
64 64 Integer code= WeiXinUtil.SendWeChatMsg(order.getGzopenid(),Constant.GZ_TEMPLATE_ID,map,mapInfo);
65 65 log.info("SendWeChatMsg--->code, "+code);
66 66 } catch (Exception e) {