瀏覽代碼

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

wangzhinan 4 年之前
父節點
當前提交
0fb0bc443a
共有 17 個文件被更改,包括 343 次插入118 次删除
  1. 8 10
      business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java
  2. 87 51
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 70 5
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  4. 33 23
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  5. 7 0
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  6. 3 0
      business/sms-service/src/main/java/com/yihu/jw/sms/dao/BaseSmsTemplateDao.java
  7. 17 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatAppointmentDO.java
  8. 6 0
      svr/svr-internet-hospital-job/pom.xml
  9. 20 2
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/TimeoutOverDueService.java
  10. 30 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java
  11. 1 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/CancelNotPay.java
  12. 9 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  13. 17 21
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java
  14. 28 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  15. 1 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  16. 5 0
      svr/svr-internet-hospital/src/main/resources/wechat/weixin_menu.txt
  17. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

+ 8 - 10
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -75,7 +75,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        BasePatientMemberDictDO basePatientMemberDictDO = basePatientMemberDictDao.findOne(dictId);
        BasePatientDO basePatientDO = basePatientDao.findByIdcard(idCard);
        List<BasePatientDO> list = basePatientDao.findByMobile(phoneNum);
        if (!"xm_zsyy_wx".equalsIgnoreCase(wxId)){
        if ("xm_xzzx_wx".equalsIgnoreCase(wxId)){
            if (list!=null&&list.size()>0&&basePatientDO!=null){
                if (basePatientDO.getMobile().equalsIgnoreCase(phoneNum)){
@ -107,6 +107,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        WlyyPatientFamilyMemberDO result = new WlyyPatientFamilyMemberDO();
        if (StringUtils.isNotBlank(id)){
            result = wlyyPatientFamilyMemberDao.findOne(id);
            basePatientDO = basePatientDao.findById(result.getFamilyMember());
        }
        String dictName = "";
@ -328,21 +329,17 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
            mixEnvelop.setMessage("添加成功");
            mixEnvelop.setDetailModelList(resultList);
            if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
                PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByCode(medicare);
                //PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByCode(medicare);
                PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",sucessPatient.getId(),"1");
                if (patientMedicareCardDO==null){
                    patientMedicareCardDO = new PatientMedicareCardDO();
                }
                if (null!=patientMedicareCardDO){
                    if (!patientMedicareCardDO.getPatientCode().equalsIgnoreCase(sucessPatient.getId())){
                        mixEnvelop.setStatus(408);
                        mixEnvelop.setMessage("请确认该就诊卡为当前家人的就诊卡");
                        return mixEnvelop;
                    }
                }
                patientMedicareCardDO.setCode(medicare);
                //patientMedicareCardDO.setType(medicareType);
                patientMedicareCardDO.setPatientCode(patientNewId);
                patientMedicareCardDO.setDel("1");
                patientMedicareCardDO.setParentType("A");
                patientMedicareCardDO.setType("A_01");
                basePatientMedicareCardDao.save(patientMedicareCardDO);
            }
@ -499,7 +496,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                        System.out.println("birthday:"+map.get("birthday").toString());
                    }
                    List<PatientMedicareCardDO> list1 = basePatientMedicareCardDao.findByPatientCode(patientId);
                    if (null!=list1&&list.size()>0){
                    if (null!=list1&&list1.size()>0){
                        map.put("card",list1.get(0));
                    }else {
                        map.put("card","");
@ -579,6 +576,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                    envelop.setStatus(-1);
                    return envelop;
                }
            }
            wlyyPatientFamilyMemberDao.save(wlyyPatientFamilyMemberDO);
            envelop.setMessage("删除成功");

+ 87 - 51
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -10465,7 +10465,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return null;
    }
    public Map saveNatAppointment(String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushChannel,String pushFlag,String cardNoType) throws Exception {
                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushChannel,String pushFlag,String cardNoType,String consumer) throws Exception {
        Map returnMap = new HashMap();
        if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
            net.sf.json.JSONObject jsondate = new JSONObject();
@ -10701,11 +10701,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            baseNatAppointmentDO.setDeptName("感染疾病科");
            baseNatAppointmentDO.setAmpm(pm);
            baseNatAppointmentDO.setHospitalFlag(pushFlag);
            baseNatAppointmentDO.setConsumer(consumer);
            BasePatientDO basePatientDO = basePatientDao.findById(consumer);
            baseNatAppointmentDO.setConsumerName(basePatientDO.getName());
            baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
            //添加订单
            BusinessOrderDO businessDO = new BusinessOrderDO();
            businessDO.setPatient(patientId);
            businessDO.setPatientName(name);
            businessDO.setPatient(consumer);
            businessDO.setPatientName(basePatientDO.getName());
            businessDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            businessDO.setCreateTime(new Date());
            businessDO.setStatus(0);
@ -10719,6 +10722,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            businessDO.setPayType(1);
            businessDO.setUpdateTime(new Date());
            businessOrderDao.save(businessDO);
            logger.info("建档开始");
            com.alibaba.fastjson.JSONObject jdObject = ykyyEntranceService.patientJDKH(patientId, cardNo,name,mobile,mediaCard);
            logger.info("建档结束");
            logger.info("更新建档信息");
            BaseJobCategoryDO jobCategoryDO =jobCategoryDao.findByName(firstJobName);
            Float zy= 0f;
@ -10833,11 +10839,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (patientDO != null) {
            userName = patientDO.getName();
        }
        if (StringUtils.isNotEmpty(baseNatAppointmentDO.getPatientId())){
            ps = basePatientWechatDao.findByWechatIdAndPatientId(wechatId, baseNatAppointmentDO.getPatientId());
        if (StringUtils.isNotEmpty(baseNatAppointmentDO.getConsumer())){
            ps = basePatientWechatDao.findByWechatIdAndPatientId(wechatId, baseNatAppointmentDO.getConsumer());
        }
        if (ps.isEmpty()) {
            logger.info("该用户没有openid,无法推送模版消息,用户ID:" + baseNatAppointmentDO.getPatientId() + "wechatId:" + wechatId);
            logger.info("该用户没有openid,无法推送模版消息,用户ID:" + baseNatAppointmentDO.getConsumer() + "wechatId:" + wechatId);
        }
        Map<String,Object> map = ykyyEntranceService.findYkDoctor(baseNatAppointmentDO.getHospitalFlag());
        WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
@ -10851,6 +10857,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    BeanUtils.copyProperties(config, newConfig);
                    newConfig.setFirst(config.getFirst().replace("key1",userName));
                    newConfig.setKeyword1("核酸检测预约单支付");
                    if ("3".equalsIgnoreCase(baseNatAppointmentDO.getHospitalFlag())){
                        newConfig.setKeyword2("厦门大学附属厦门眼科中心思北院区");
                    }else {
                        newConfig.setKeyword2("厦门大学附属厦门眼科中心五缘院区");
                    }
                    newConfig.setKeyword3(map.get("doctorName")==null?"":map.get("doctorName").toString());
                    newConfig.setKeyword4(userName);
                    newConfig.setKeyword5(DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()));
@ -10876,6 +10887,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    BeanUtils.copyProperties(configPayNotice, newPayNotice);
                    newPayNotice.setFirst(configPayNotice.getFirst().replace("key1",userName));
                    newPayNotice.setKeyword1("核酸检测预约单支付");
                    if ("3".equalsIgnoreCase(baseNatAppointmentDO.getHospitalFlag())){
                        newPayNotice.setKeyword2("厦门大学附属厦门眼科中心思北院区");
                    }else {
                        newPayNotice.setKeyword2("厦门大学附属厦门眼科中心五缘院区");
                    }
                    newPayNotice.setKeyword3(map.get("doctorName")==null?"":map.get("doctorName").toString());
                    newPayNotice.setRemark(configPayNotice.getRemark());
                    newPayNotice.setUrl(configPayNotice.getUrl()+baseNatAppointmentDO.getId());
@ -10914,12 +10930,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "t.pay_status as \"payStatus\"," +
                "t.medicare as \"medicare\","+
                "t.voucher_no as \"voucherNo\","+
                "t.dept as \"dept\","+
                "t.dept_name as \"deptName\","+
                "t.id as \"id\"," +
                "t.card_no_type as \"cardNoType\"," +
                "t.HOSPITAL_FLAG as \"hospitalFlag\"," +
                "t.appointment_time as \"appointmentTime\" " +
                " from base_nat_appointment t where 1=1 ";
        if (StringUtils.isNoneBlank(patientId)){
            sql+=" and t.patient_id ='"+patientId+"'";
            sql+=" and t.consumer ='"+patientId+"'";
        }
        if (StringUtils.isNoneBlank(id)){
            sql+=" and t.id ='"+id+"'";
@ -11023,54 +11042,71 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            try {
                BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
                if (null!=baseNatAppointmentDO){
                    res = entranceService.BS10145("3150000","0001",DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),demoFlag);
                    logger.info("核酸检测预约取消"+res);
                    com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
                    Boolean flag = false;
                    if (jsonObject!=null){
                        com.alibaba.fastjson.JSONObject object = jsonObject.getJSONObject("MsgInfo");
                        String Msg = object.getString("Msg");
                        if (Msg.contains("Error")){
                            throw new Exception(Msg);
                        }else {
                            baseNatAppointmentDO.setIsSuccess("-1");
                            baseNatAppointmentDO.setCancelReson("患者本人取消");
                            baseNatAppointmentDO.setCancelTime(new Date());
                            baseNatAppointmentDO.setCancelBy(patientId);
                            baseNatAppointmentDao.save(baseNatAppointmentDO);
                            if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
                                //删除处方
                                logger.info("删除处方开始");
                                net.sf.json.JSONObject jsondate = new JSONObject();
                                jsondate.put("checkPart","鼻/咽拭子");
                                jsondate.put("cardNo",baseNatAppointmentDO.getMedicare());
                                jsondate.put("chargeFlag","2");
                                jsondate.put("chargeCode","361322");
                                jsondate.put("icdCode","Z00.000");
                                jsondate.put("socialNo",baseNatAppointmentDO.getCardNo());
                                jsondate.put("tellPhone",baseNatAppointmentDO.getMobile());
                                jsondate.put("address1",baseNatAppointmentDO.getProvinceName());
                                jsondate.put("address2",baseNatAppointmentDO.getCityName());
                                jsondate.put("address3",baseNatAppointmentDO.getTownName());
                                jsondate.put("address4",baseNatAppointmentDO.getStreetName());
                                jsondate.put("address5",2);
                                jsondate.put("area",baseNatAppointmentDO.getAddress());
                                jsondate.put("winNo",6);
                                jsondate.put("target",2);
                                jsondate.put("quantity",1);
                                jsondate.put("serialNo",baseNatAppointmentDO.getRegisterNo());
                                jsondate.put("dept",baseNatAppointmentDO.getDept());
                                jsondate.put("doctor",baseNatAppointmentDO.getDoctorId());
                                jsondate.put("realOrder",baseNatAppointmentDO.getRealOrder());
                                JSONArray array = new JSONArray();
                                array.add(jsondate);
                                JSONObject object1  = entranceService.BS10112(array.toString(),demoFlag);
                                logger.info("删除处方结束");
                            }
                    if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                        res = entranceService.BS10145("3150000","0001",DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),demoFlag);
                        logger.info("核酸检测预约取消"+res);
                        com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
                        Boolean flag = false;
                        if (jsonObject!=null){
                            com.alibaba.fastjson.JSONObject object = jsonObject.getJSONObject("MsgInfo");
                            String Msg = object.getString("Msg");
                            if (Msg.contains("Error")){
                                throw new Exception(Msg);
                            }else {
                                baseNatAppointmentDO.setIsSuccess("-1");
                                baseNatAppointmentDO.setCancelReson("患者本人取消");
                                baseNatAppointmentDO.setCancelTime(new Date());
                                baseNatAppointmentDO.setCancelBy(patientId);
                                baseNatAppointmentDao.save(baseNatAppointmentDO);
                                if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
                                    //删除处方
                                    logger.info("删除处方开始");
                                    net.sf.json.JSONObject jsondate = new JSONObject();
                                    jsondate.put("checkPart","鼻/咽拭子");
                                    jsondate.put("cardNo",baseNatAppointmentDO.getMedicare());
                                    jsondate.put("chargeFlag","2");
                                    jsondate.put("chargeCode","361322");
                                    jsondate.put("icdCode","Z00.000");
                                    jsondate.put("socialNo",baseNatAppointmentDO.getCardNo());
                                    jsondate.put("tellPhone",baseNatAppointmentDO.getMobile());
                                    jsondate.put("address1",baseNatAppointmentDO.getProvinceName());
                                    jsondate.put("address2",baseNatAppointmentDO.getCityName());
                                    jsondate.put("address3",baseNatAppointmentDO.getTownName());
                                    jsondate.put("address4",baseNatAppointmentDO.getStreetName());
                                    jsondate.put("address5",2);
                                    jsondate.put("area",baseNatAppointmentDO.getAddress());
                                    jsondate.put("winNo",6);
                                    jsondate.put("target",2);
                                    jsondate.put("quantity",1);
                                    jsondate.put("serialNo",baseNatAppointmentDO.getRegisterNo());
                                    jsondate.put("dept",baseNatAppointmentDO.getDept());
                                    jsondate.put("doctor",baseNatAppointmentDO.getDoctorId());
                                    jsondate.put("realOrder",baseNatAppointmentDO.getRealOrder());
                                    JSONArray array = new JSONArray();
                                    array.add(jsondate);
                                    JSONObject object1  = entranceService.BS10112(array.toString(),demoFlag);
                                    logger.info("删除处方结束");
                                }
                            }
                        }
                    }else if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                        baseNatAppointmentDO.setIsSuccess("-1");
                        baseNatAppointmentDO.setCancelReson("患者本人取消");
                        baseNatAppointmentDO.setCancelTime(new Date());
                        baseNatAppointmentDO.setCancelBy(patientId);
                        baseNatAppointmentDao.save(baseNatAppointmentDO);
                        if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
                            logger.info("同步his订单状态"+baseNatAppointmentDO.getRealOrder());
                            String updateJcsq = "update V_EMR_JCSQ set ZFBZ = 1 where yjxh = "+baseNatAppointmentDO.getRealOrder();
                            ykyyEntranceService.updateHisStatus(updateJcsq);
                            String update01sq = "update V_MS_YJ01 set ZFPB = 1 where yjxh = "+baseNatAppointmentDO.getRealOrder();
                            ykyyEntranceService.updateHisStatus(update01sq);
                        }
                    }
                }
            } catch (Exception e) {

+ 70 - 5
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -51,6 +51,7 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.CheckSumBuilder;
import com.yihu.jw.utils.FileUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.mysql.query.BaseJpaService;
@ -66,6 +67,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -928,13 +930,12 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        }
        Long endTime = new Date().getTime();
        Long startTime = new Date().getTime()-24*60*60*1000;
        List vids = new ArrayList();
        String appKey = sysDictDO.getDictValue();
        String appSecret = hospitalSysDictDO.getDictValue();
        String nonce =  randomInt(10);
        String curTime = String.valueOf((new Date()).getTime() / 1000L);
        String checkSum = CheckSumBuilder.getCheckSum(appSecret, nonce ,curTime);//参考 计算CheckSum的java代码
        String url = "https://vcloud.163.com/app/vod/video/get";
        String url = "https://vcloud.163.com/app/vod/video/list";
        Map<String,Object> httpPost = new HashedMap();
        // 设置请求的header
        httpPost.put("AppKey", appKey);
@ -946,6 +947,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        object.put("currentPage",500);
        object.put("pageSize",1);
        object.put("status",40);
        object.put("type",0);
        object.put("beginTime",startTime);
        object.put("endTime",endTime);
        logger.info("入参"+object.toJSONString());
@ -956,14 +958,13 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            if (jsonObject.getString("code").equalsIgnoreCase("200")){
                JSONObject object1 = jsonObject.getJSONObject("ret");
                if (object1!=null){
                    Integer total = object1.getInteger("totalRecords");
                    JSONArray jsonArray = object1.getJSONArray("list");
                    if (jsonArray!=null&&jsonArray.size()>0){
                        for (int i=0;i<jsonArray.size();i++){
                            JSONObject object2 = jsonArray.getJSONObject(i);
                            if (object2!=null){
                                String vedioUrl =object1.getString("origUrl");
                                String vedioName = object1.getString("videoName");
                                String vedioUrl =object2.getString("origUrl");
                                String vedioName = object2.getString("videoName");
                                String filePath = "/Projects/Video/"+DateUtil.getStringDate("yyyyMMdd");
                                logger.info("filePath:"+filePath);
                                logger.info("vedioUrl"+vedioUrl);
@ -1016,6 +1017,70 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        }
        return null;
    }
    public String saveVideoFileList(String startTime,String endTime,Integer status,Integer page ,Integer pageSize){
        WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.findById("YXAPPKEY");
        WlyyHospitalSysDictDO hospitalSysDictDO =  hospitalSysDictDao.findById("YXAPPSECRET");
        if (sysDictDO==null){
            return  "找不到对应的key";
        }
        JSONObject object = new JSONObject();
        if (StringUtils.isNoneBlank(startTime)){
            Long start = DateUtil.strToDate(startTime).getTime();
            object.put("beginTime",start);
        }
        if (StringUtils.isNoneBlank(endTime)){
            Long end = DateUtil.strToDate(endTime).getTime();
            object.put("endTime",end);
        }
        if (status!=null){
            object.put("status",40);
        }
        object.put("type",0);
        String appKey = sysDictDO.getDictValue();
        String appSecret = hospitalSysDictDO.getDictValue();
        String nonce =  randomInt(10);
        String curTime = String.valueOf((new Date()).getTime() / 1000L);
        String checkSum = CheckSumBuilder.getCheckSum(appSecret, nonce ,curTime);//参考 计算CheckSum的java代码
        String url = "https://vcloud.163.com/app/vod/video/list";
        Map<String,Object> httpPost = new HashedMap();
        // 设置请求的header
        httpPost.put("AppKey", appKey);
        httpPost.put("Nonce", nonce);
        httpPost.put("CurTime", curTime);
        httpPost.put("CheckSum", checkSum);
        httpPost.put("Content-Type", "application/json");
        object.put("currentPage",page);
        object.put("pageSize",pageSize);
        logger.info("入参"+object.toJSONString());
        String response = httpClientUtil.postBodyHead(url,object,httpPost);
        logger.info("返回日志"+response);
        if(StringUtils.isNoneBlank(response)){
            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(response);
            if (jsonObject.getString("code").equalsIgnoreCase("200")){
                JSONObject object1 = jsonObject.getJSONObject("ret");
                if (object1!=null){
                    JSONArray jsonArray = object1.getJSONArray("list");
                    if (jsonArray!=null&&jsonArray.size()>0){
                        for (int i=0;i<jsonArray.size();i++){
                            JSONObject object2 = jsonArray.getJSONObject(i);
                            if (object2!=null){
                                String vedioUrl =object2.getString("origUrl");
                                String vedioName = object2.getString("videoName");
                                String filePath = "/Projects/Video/"+DateUtil.getStringDate("yyyyMMdd");
                                //String filePath = "D:\\Backup\\桌面\\配置及相关文档\\"+DateUtil.getStringDate("yyyyMMdd");
                                logger.info("filePath:"+filePath);
                                logger.info("vedioUrl"+vedioUrl);
                                FileUtil.saveUrlAs(vedioUrl,filePath,"GET",vedioName);
                            }
                        }
                    }
                }
            }
        }
        return null;
    }
}

+ 33 - 23
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -68,19 +68,19 @@ public class YkyyEntranceService {
    private static Logger logger = LoggerFactory.getLogger(YkyyEntranceService.class);
    private final static String url="http://192.168.33.197:10023/ykyy/createSQLQuery";
    private final static String url="http://192.168.20.55:10023/ykyy/createSQLQuery";
//    private final static String url="http://localhost:10023/ykyy/createSQLQuery";
    private final static String saveUrl="http://192.168.33.197:10023/ykyy/save";
    private final static String orderUrl="http://192.168.33.197:10023/ykyy/outPatientOrder";
    private final static String saveUrl="http://192.168.20.55:10023/ykyy/save";
    private final static String orderUrl="http://192.168.20.55:10023/ykyy/outPatientOrder";
    private final static String updateUrl="http://192.168.33.197:10023/ykyy/updateBySql";
    private final static String updateUrl="http://192.168.20.55:10023/ykyy/updateBySql";
    private final static String updateEntityUrl="http://192.168.33.197:10023/ykyy/update";
    private final static String updateEntityUrl="http://192.168.20.55:10023/ykyy/update";
    private final static String jdbcUrl="http://192.168.33.197:10023/ykyy/jdbcSQLQuery";
    private final static String jdbcUrl="http://192.168.20.55:10023/ykyy/jdbcSQLQuery";
    private final static String updateJdxx="http://192.168.33.197:10023/ykyy/updateJdxx";
    private final static String updateJdxx="http://192.168.20.55:10023/ykyy/updateJdxx";
    private final static String orgCode ="350211A5004";
@ -3116,7 +3116,7 @@ public class YkyyEntranceService {
        JSONObject res = new JSONObject();
        //查询是否建档
        String brid = "";
        String bridSql = "SELECT brid \"brid\" from portal_his.V_ZKSG_BRCX@xec_link where jzkh = '" +medicare + " ' ";
        String bridSql = "SELECT brid \"brid\" from portal_his.V_ZKSG_BRCX@xec_link where jzkh = '" + medicare + "' ";
        Map<String, Object> params = new HashedMap();
        params.put("sql", bridSql);
        logger.info("bridSql:" + bridSql);
@ -3125,12 +3125,12 @@ public class YkyyEntranceService {
        logger.info("response:" + content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
        if (status == 200) {
            JSONArray array = rs.getJSONArray("detailModelList");
            int size = array.size();
            if(size == 1){
                brid = ((JSONObject)array.get(0)).getString("BRID");
            }else if (size > 1){
            if (size == 1) {
                brid = ((JSONObject) array.get(0)).getString("BRID");
            } else if (size > 1) {
                res.put("status", -1);
                res.put("message", "该居民存在多条建档信息!");
                return res;
@ -3146,38 +3146,48 @@ public class YkyyEntranceService {
            params1.put("sfzh", idcard);
            params1.put("sjhm", phoneNum);
            params1.put("ybkh", medicare);
            params1.put("lxdz", null);
            params1.put("lxdz", 0);
            params1.put("zy", 0);
            HttpResponse response1 = HttpUtils.doGet(saveJdxxUrl, params);
            HttpResponse response1 = HttpUtils.doGet(saveJdxxUrl, params1);
            String content1 = response1.getContent();
            logger.info("params1:" + params1);
            logger.info("response1:" + content1);
            JSONObject rs1 = JSON.parseObject(content1);
            if (rs.getInteger("status") != 200)
            {
            if (rs1.getInteger("status") != 200) {
                res.put("status", -1);
                res.put("message", "操作失败,失败原因:" + rs1.getString("message"));
                return res;
            } else {
                if (rs1.get("message")!=null){
                    if (rs1.getString("message").contains("已经建过档案")){
                        res.put("status", 200);
                        res.put("message",rs1.getString("message"));
                        return res;
                    }
                }
                //获取病人id
                response = HttpUtils.doGet(url, params);
                content = response.getContent();
                logger.info("response:" + content);
                rs = JSON.parseObject(content);
                status = rs.getInteger("status");
                if (status==200){
                    JSONArray array = rs.getJSONArray("detailModelList");
                if (status == 200) {
                    res.put("status", 200);
                    /*JSONArray array = rs.getJSONArray("detailModelList");
                    int size = array.size();
                    if(size == 1){
                        brid = ((JSONObject)array.get(0)).getString("BRID");
                        logger.info("array:" + array.toString());
                        brid = ((JSONObject)array.get(0)).getString("brid");
                        res.put("status", 200);
                        res.put("message", brid);
                        logger.info("brid:" + brid);
                    }else if (size > 1){
                        res.put("status", -1);
                        res.put("message", "该居民存在多条建档信息!");
                        return res;
                    }
                    }*/
                }
            }
        }
        res.put("status", 200);
        res.put("message", brid);
        return res;
    }
}

+ 7 - 0
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -451,6 +451,13 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    public Map<String,Object> selectOrderByRelationCode(String relationCode,String tradeType,String wechatId,boolean payFlag,String appletCode) throws Exception {
        WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(relationCode);
        BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(Integer.parseInt(relationCode));
        if (baseNatAppointmentDO!=null&&"-1".equalsIgnoreCase(baseNatAppointmentDO.getIsSuccess())){
            throw new Exception("订单已取消");
        }
        if (businessOrderDO!=null&&businessOrderDO.getStatus()==1){
            throw new Exception("订单已支付");
        }
        String body = businessOrderDO.getDescription();
        String totalFee = businessOrderDO.getPayPrice().intValue()+"";
        String patient = businessOrderDO.getPatient();

+ 3 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/dao/BaseSmsTemplateDao.java

@ -2,6 +2,7 @@ package com.yihu.jw.sms.dao;
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
@ -14,4 +15,6 @@ public interface BaseSmsTemplateDao extends PagingAndSortingRepository<SmsTempla
    List<SmsTemplateDO> findByClientIdAndType(String clientId, SmsTemplateDO.Type type);
    SmsTemplateDO findByClientId(String clientId);
}

+ 17 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatAppointmentDO.java

@ -57,7 +57,16 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    private String ampm;
    private String cardNoType;
    private String hospitalFlag;
    private String consumer;
    private String consumerName;
    public String getConsumer() {
        return consumer;
    }
    public void setConsumer(String consumer) {
        this.consumer = consumer;
    }
    public String getMedicare() {
        return medicare;
@ -427,4 +436,12 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    public void setHospitalFlag(String hospitalFlag) {
        this.hospitalFlag = hospitalFlag;
    }
    public String getConsumerName() {
        return consumerName;
    }
    public void setConsumerName(String consumerName) {
        this.consumerName = consumerName;
    }
}

+ 6 - 0
svr/svr-internet-hospital-job/pom.xml

@ -153,6 +153,12 @@
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.3</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>sms-service</artifactId>
            <version>2.0.0</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

+ 20 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/TimeoutOverDueService.java

@ -20,6 +20,7 @@ import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.dao.ConsultTeamDao;
@ -27,8 +28,8 @@ import com.yihu.jw.im.service.ImService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.DateUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -92,6 +93,8 @@ public class TimeoutOverDueService {
    private EntranceService entranceService;
    @Autowired
    private PatientMappingDao patientMappingDao;
    @Autowired
    private YkyyEntranceService ykyyEntranceService;
    /**
     *  取消未结束门诊
     */
@ -238,7 +241,22 @@ public class TimeoutOverDueService {
                    if (patientMappingDO != null) {
                        userNo = patientMappingDO.getMappingCode();
                    }
                    entranceService.BS10145(baseNatAppointmentDO.getDept(),baseNatAppointmentDO.getDoctorId(), DateUtil.dateToStr(baseNatAppointmentDO.getAppointmentTime(),"yyyy-MM-dd hh:mm:ss"),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),userNo,baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),false);
                    if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                        entranceService.BS10145("3150000","0001", DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),false);
                    }
                    if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                        baseNatAppointmentDO.setIsSuccess("-1");
                        baseNatAppointmentDO.setCancelReson("系统超时取消");
                        baseNatAppointmentDO.setCancelTime(new Date());
                        baseNatAppointmentDO.setCancelBy("system");
                        baseNatAppointmentDao.save(baseNatAppointmentDO);
                        if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
                            String updateJcsq = "update V_EMR_JCSQ set ZFBZ = 1 where yjxh = "+baseNatAppointmentDO.getRealOrder();
                            ykyyEntranceService.updateHisStatus(updateJcsq);
                            String update01sq = "update V_MS_YJ01 set ZFPB = 1 where yjxh = "+baseNatAppointmentDO.getRealOrder();
                            ykyyEntranceService.updateHisStatus(update01sq);
                        }
                    }
                    //取消挂号
                } catch (Exception e) {
                    e.printStackTrace();

+ 30 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java

@ -7,6 +7,7 @@ import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import com.yihu.jw.entity.base.wx.*;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
@ -33,6 +34,8 @@ import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.sms.dao.BaseSmsTemplateDao;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
@ -116,6 +119,10 @@ public class UnSettledHISPrescriptionService {
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    @Autowired
    private BaseSmsTemplateDao smsTemplateDao;
    @Autowired
    private YkyySMSService ykyySMSService;
    
    
    /**
@ -182,7 +189,7 @@ public class UnSettledHISPrescriptionService {
                    JSONObject json = jsonArray.getJSONObject(i);
                    String cfsb = json.getString("CFSB");
                    //查找对应的处方
                    String sql = "SELECT w.OUTPATIENT_ID,w.ID,w.DOCTOR,w.DOCTOR_NAME from WLYY_PRESCRIPTION w WHERE REAL_ORDER = '"+cfsb+"' and status <> 11 ORDER BY w.CREATE_TIME desc";
                    String sql = "SELECT w.OUTPATIENT_ID,w.ID,w.DOCTOR,w.DOCTOR_NAME,to_char(w.CREATE_TIME,'YYYY-MM-DD hh24:mi:ss')  AS \"CREATE_TIME\" from WLYY_PRESCRIPTION w WHERE REAL_ORDER = '"+cfsb+"' and status <> 11 ORDER BY w.CREATE_TIME desc";
                    List<Map<String, Object>> pre = hibenateUtils.createSQLQuery(sql);
                    if(pre!=null && pre.size()>0){
                        String prescriptionId = pre.get(0).get("ID").toString();
@ -200,6 +207,19 @@ public class UnSettledHISPrescriptionService {
                        System.out.println("发送诊断消息开始+"+wlyyOutpatientDO.getId());
                        String immsg = imService.pushPrescriptionBackMsg(msgObj,doctor,doctorName,outpatientId,wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType(),wlyyOutpatientDO.getType());
                        System.out.println("发送诊断消息成功:"+immsg);
                        //发送短信提醒
                        String content = "";
                        SmsTemplateDO smsTemplateDO = smsTemplateDao.findByClientId("check_failed_patient");
                        if (smsTemplateDO!=null){
                            content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",cfsb);
                            ykyySMSService.ykyySendSMS(wlyyOutpatientDO.getConsumerMobile(),content);
                        }
                        SmsTemplateDO smsTemplateDO1 = smsTemplateDao.findByClientId("check_failed_doctor");
                        if (smsTemplateDO1!=null){
                            content = smsTemplateDO.getContent().replace("{{医生姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{时间}}",pre.get(0).get("CREATE_TIME").toString())
                                    .replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",cfsb);
                            ykyySMSService.ykyySendSMS(wlyyOutpatientDO.getConsumerMobile(),content);
                        }
                    }
                }
            }
@ -220,6 +240,7 @@ public class UnSettledHISPrescriptionService {
                        List<Map<String, Object>> pre = hibenateUtils.createSQLQuery(sql);
                        if(pre!=null && pre.size()>0){
                            String outpatientId = pre.get(0).get("OUTPATIENT_ID").toString();
                            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
                            String prescriptionId = pre.get(0).get("ID").toString();
                            String doctorName = pre.get(0).get("DOCTOR_NAME").toString();
                            //判断是否发送过
@ -284,6 +305,14 @@ public class UnSettledHISPrescriptionService {
                                }
                                prescriptionVO.setDiagnosisVOs(wlyyPrescriptionDiagnosisVOS);
                                imService.pushPrescriptionImMessage(prescriptionVO);
                                //发送审核成功短信提醒
                                //发送短信提醒
                                String content = "";
                                SmsTemplateDO smsTemplateDO = smsTemplateDao.findByClientId("check_failed_patient");
                                if (smsTemplateDO!=null&&wlyyOutpatientDO!=null){
                                    content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",cfsb);
                                    ykyySMSService.ykyySendSMS(wlyyOutpatientDO.getConsumerMobile(),content);
                                }
                            }
                        }
                    }

+ 1 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/CancelNotPay.java

@ -22,7 +22,7 @@ import java.util.Date;
public class CancelNotPay implements SchedulingConfigurer {
    private static final Logger logger = LoggerFactory.getLogger(CancelNotPay.class);
    private static String cron = "0 */1 * * * ?";//"0 0 0 * * ?";0 */5 * * * ?
    private static String cron = "0 0 0 * * ?";//"0 0 0 * * ?";0 */5 * * * ?
    @Autowired
    private TimeoutOverDueService timeoutOverDueService;
    public String change(String corIn) {

+ 9 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
@ -721,4 +722,12 @@ public class JobController extends BaseController {
        return success(ykyyPrescriptionService.saveVideoFile(vip));
    }
    @RequestMapping(value = "saveVideoFileList", method = RequestMethod.GET)
    @ApiOperation("下载云信录制")
    public String saveVideoFile(@RequestParam(value = "startTime", required = false)String startTime,
                                @RequestParam(value = "endTime", required = false)String endTime, Integer status, Integer page , Integer pageSize){
        return success(ykyyPrescriptionService.saveVideoFileList(startTime,endTime,status,page,pageSize));
    }
}

+ 17 - 21
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -102,7 +102,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
        }*/
        net.sf.json.JSONArray jsonArray = new JSONArray();
        if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            jsonArray = ykyyEntranceService.findHisPatientBymMedicare(medicare,clinicId,false);
            /*jsonArray = ykyyEntranceService.findHisPatientBymMedicare(medicare,clinicId,false);
            if(jsonArray!=null&&jsonArray.size()>0){
                net.sf.json.JSONObject jsonObject= net.sf.json.JSONObject.fromObject(jsonArray.get(0).toString());
                if (null!=jsonObject.get("brid")){
@ -122,7 +122,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属无就诊记录无法添加");
                return mixEnvelop;
            }
            }*/
        }else if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
            jsonArray = entranceService.BS10008(idCard, "", "", "", "", "", false);
            if(jsonArray!=null&&jsonArray.size()>0){
@ -195,20 +195,14 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
            if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
                System.out.println("发送眼科验证码开始");
                ResultMsg result= null;
                if (null!=jsonArray&&jsonArray.size() > 0) {
                    result = ykyySMSService.ykyySendSMS(phoneNum, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
                    if (result.isSuccess()){
                        this.store(client_id, phoneNum, captcha, 120);
                        mixEnvelop.setMessage("验证码发送成功");
                    } else {
                        mixEnvelop.setMessage("验证码发送失败");
                        mixEnvelop.setStatus(500);
                    }
                }else {
                    mixEnvelop.setStatus(408);
                    mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
                result = ykyySMSService.ykyySendSMS(phoneNum, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
                if (result.isSuccess()){
                    this.store(client_id, phoneNum, captcha, 120);
                    mixEnvelop.setMessage("验证码发送成功");
                } else {
                    mixEnvelop.setMessage("验证码发送失败");
                    mixEnvelop.setStatus(500);
                }
            }else if("xm_zsyy_wx".equalsIgnoreCase(wxId)){
                System.out.println("发送中山验证码开始");
                int result = 1;
@ -359,12 +353,14 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
                }
                //获取建档信息
                JSONObject jdObject = ykyyEntranceService.patientJDKH(patientId, idCard,familyName,username,medicare);
                if(jdObject.getInteger("status") == 200) {
                    mixEnvelop = wlyyFamilyMemberService.addFamily(id, patientId, familyName, dictId, cardType, idCard, username, false, medicareType, medicare, clinicId);
                }else {
                    mixEnvelop.setStatus(408);
                    mixEnvelop.setMessage(jdObject.getString("message"));
                    return mixEnvelop;
                if (jdObject!=null){
                    if(jdObject.getInteger("status") == 200) {
                        mixEnvelop = wlyyFamilyMemberService.addFamily(id, patientId, familyName, dictId, cardType, idCard, username, false, medicareType, medicare, clinicId);
                    }else {
                        mixEnvelop.setStatus(408);
                        mixEnvelop.setMessage(jdObject.getString("message"));
                        return mixEnvelop;
                    }
                }
            } else {
                mixEnvelop.setStatus(408);

+ 28 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -10,6 +10,7 @@ import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleUserDO;
@ -48,6 +49,7 @@ 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.sms.service.YkyySMSService;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
@ -182,7 +184,10 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private BaseBannerDoctorService baseBannerDoctorService;
    @Autowired
    private BaseNatAppointmentDao baseNatAppointmentDao;
    @Autowired
    private YkyySMSService ykyySMSService;
    @Autowired
    private BasePatientWechatDao basePatientWechatDao;
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生")
@ -403,7 +408,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
     */
    @RequestMapping(value = "/getOpenidByCode", method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    public Envelop getOpenidByCode(String code) throws Exception {
    public Envelop getOpenidByCode(String code,@RequestParam(value = "patientId", required = false)String patientId) throws Exception {
        //通过redis获取openid, 获取不到,则调用微信接口去取
        String key = wxId+":code";
        String openid = redisTemplate.opsForValue().get(key);
@ -411,6 +416,23 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            return success(PatientRequestMapping.Wechat.api_success,openid);
        }
        openid = wechatInfoService.getOpenidByCode(code, wxId);
        if (!StringUtils.isEmpty(patientId)){
            List<BasePatientWechatDo> list = basePatientWechatDao.findByWechatIdAndPatientId(wxId,patientId);
            if (list!=null&&list.size()>0){
                for (BasePatientWechatDo basePatientWechatDo:list){
                    basePatientWechatDo.setOpenid(openid);
                    basePatientWechatDao.save(basePatientWechatDo);
                }
            }else {
                BasePatientWechatDo basePatientWechatDo = new BasePatientWechatDo();
                basePatientWechatDo.setPatientId(patientId);
                basePatientWechatDo.setWechatId(wxId);
                basePatientWechatDo.setCreateTime(new Date());
                basePatientWechatDo.setOpenid(openid);
                basePatientWechatDao.save(basePatientWechatDo);
            }
        }
        redisTemplate.opsForValue().set(key,openid);
        redisTemplate.expire(key,10, TimeUnit.SECONDS);
        return success(PatientRequestMapping.Wechat.api_success,openid);
@ -1514,4 +1536,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        return  success(prescriptionService.findBaseAddress(addressFlag,parentName));
    }
    @GetMapping("/testsms")
    public void testsms(String mobile ,String contet){
        ykyySMSService.ykyySendSMS(mobile,contet);
    }
}

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -2592,7 +2592,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @ApiParam(name = "cardNoType", value = "cardNoType")
                                          @RequestParam(value = "cardNoType",required = false)String cardNoType){
        try {
            return success(prescriptionService.saveNatAppointment(mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,cityName,townName,streetName,pm,pushChannel,pushFlag,cardNoType));
            return success(prescriptionService.saveNatAppointment(mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,cityName,townName,streetName,pm,pushChannel,pushFlag,cardNoType,getUID()));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }

+ 5 - 0
svr/svr-internet-hospital/src/main/resources/wechat/weixin_menu.txt

@ -9,6 +9,11 @@
   {
	  "name":"就医问诊",
	  "sub_button":[
	    {
               		"type":"view",
               		"name":"核酸预约申请",
               		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3a%2f%2fintel.yanketong.com%2fims-wx%2f%23%2fpersonal%2ffamilyMember%2findex%3ftype%3dnucleicTest&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
               },
		 {
         		"type":"view",
         		"name":"预约挂号",

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -1130,7 +1130,7 @@ public class MonitorPlatformService  {
                jsonObject.put("filter",jsonArray1);
                jsonObject.put("page",1);
                jsonObject.put("size",5);
                String sqlLocation = "select idcard idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                String sqlLocation = "select AES_DECRYPT(from_base64(idcard),'jkzl2021ZJXL*#%a') idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                        "create_time createTime,device_name equimentName\n" +
                        "from device.wlyy_patient_device_location where del=0 and  device_sn='"+deviceSn+"' limit 0,5 ";
                try {