فهرست منبع

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

LAPTOP-KB9HII50\70708 1 سال پیش
والد
کامیت
edc3ecb99b
19فایلهای تغییر یافته به همراه1017 افزوده شده و 668 حذف شده
  1. 8 0
      business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareService.java
  2. 44 5
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 641 547
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  4. 31 10
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  5. 36 16
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseAppointmentLogDO.java
  6. 12 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistPatientRelationDO.java
  7. 46 46
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationPlanTemplateDO.java
  8. 16 0
      common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java
  9. 1 1
      common/common-util/src/main/java/com/yihu/jw/util/wechat/WeiXinMessageReplyUtils.java
  10. 15 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/RemindDoctorService.java
  11. 9 9
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  12. 15 10
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  13. 1 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/wechat/WechatCoreController.java
  14. 43 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java
  15. 3 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/wechat/WeiXinCoreService.java
  16. 43 7
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/wechat/WeiXinEventProcess.java
  17. 9 14
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java
  18. 1 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistPatientRelationDao.java
  19. 43 3
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

+ 8 - 0
business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareService.java

@ -1215,6 +1215,8 @@ public class HealthCareService {
            ylzMedicalRelationDO.setInsuranceTypeName(encryptData.getString("insurance_type_name"));
            ylzMedicailRelationDao.save(ylzMedicalRelationDO);
            logger.info("医保挂号流水号保存成功");
        }else {
            throw new Exception(object.getString("cause"));
        }
        return result;
    }
@ -1390,6 +1392,8 @@ public class HealthCareService {
            ylzMedicalRelationDO.setDetailSerial(detailSerial);
            ylzMedicailRelationDao.save(ylzMedicalRelationDO);
            logger.info("医保费用明细上传保存成功");
        }else {
            throw new Exception(object.getString("cause"));
        }
        return result;
    }
@ -1593,6 +1597,8 @@ public class HealthCareService {
                    ylzMb.setCreateTime(new Date());
                    ylzMedicailBillDao.save(ylzMb);
                }
            }else {
                throw new Exception(resObj.getString("cause"));
            }
        }
@ -1801,6 +1807,8 @@ public class HealthCareService {
                String str2=link_url.substring(str1.length()+1, link_url.length());
                ylzMedicalRelationDO.setPageCode(str2);
                ylzMedicailRelationDao.save(ylzMedicalRelationDO);
            }else {
                throw new Exception(object.getString("cause"));
            }
        }
        return result;

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

@ -149,6 +149,8 @@ import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalTime;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -15180,11 +15182,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                object.put("getSettleInfo",ylzMedicalRelationDO);
                return object;
            }
            try {
                ylzMedicalRelationDO = entranceService.getSettleInfo(outpatientDO.getCardNo(),outpatientDO.getIdcard(),outpatientDO.getId());
            }catch (Exception e){
                throw new Exception(e.getMessage());
            }
            ylzMedicalRelationDO = entranceService.getSettleInfo(outpatientDO.getCardNo(),outpatientDO.getIdcard(),outpatientDO.getId());
            if (ylzMedicalRelationDO==null){
                throw new Exception("无待结算信息");
            }
@ -16501,4 +16499,45 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    /**
     * 根据后台配置,发起后多少个小时内可以取消或者转医生
     * @param outpatientId
     * @return
     */
    public boolean selectByDate(String outpatientId){
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("cancelTime");
        boolean flag= true;
        if(outpatientDO!=null){
            if (hospitalSysDictDO!=null){
                String time = hospitalSysDictDO.getDictValue();
                int days; //天数
                int hours; //时
                int minutes;
                Date firstDate = outpatientDO.getCreateTime();
                Date secondDate = new Date();
                long firstDateMilliSeconds = firstDate.getTime();
                long secondDateMilliSeconds = secondDate.getTime();
                //得到两者之差
                long firstMinusSecond = secondDateMilliSeconds - firstDateMilliSeconds;
                logger.info(""+firstMinusSecond);
                //毫秒转为秒
                long milliSeconds = firstMinusSecond;
                int totalSeconds = (int)(milliSeconds / 1000);
                //得到总天数
                days = totalSeconds / (3600*24);
                int days_remains = totalSeconds % (3600*24);
                //得到总小时数
                hours = days_remains / 3600;
                int remains_hours = days_remains % 3600;
                //得到分种数
                minutes = remains_hours / 60;
                if (hours<Integer.parseInt(time)){
                    flag= false;
                }
            }
        }
        return flag;
    }
}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 641 - 547
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java


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

@ -2255,7 +2255,7 @@ public class YkyyEntranceService {
     * @throws Exception
     */
    public JSONArray findHisDoctor(String idcard) throws Exception{
        String sql ="select y.code AS \"code\",y.ygbh,y.name AS \"name\",y.expertise AS \"expertise\",y.introduce AS \"introduce\",y.mobile AS \"mobile\",y.idCard AS \"idcard\",y.jobtitlecode AS \"jobTitleCode\",y.jobTitleName AS \"jobTitleName\",y.dept AS \"dept\",y.deptName AS \"deptName\" from v_Hlw_Ysxx y where y.idcard ='"+idcard+"'";
        String sql ="select y.code AS \"code\",y.ygbh,y.name AS \"name\",y.expertise AS \"expertise\",y.introduce AS \"introduce\",y.mobile AS \"mobile\",y.idCard AS \"idcard\",y.jobtitlecode AS \"jobTitleCode\",y.jobTitleName AS \"jobTitleName\",y.dept AS \"dept\",y.deptName AS \"deptName\",y.ksdm as \"ksdm\" from v_Hlw_Ysxx y where y.idcard ='"+idcard+"'";
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
@ -2385,6 +2385,16 @@ public class YkyyEntranceService {
            hlwGhmxDO.setBRXZ(json.getInteger("brxz"));
            brid = json.getInteger("brid");
        }
        String doctor = map.get("doctorCode").toString();
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        String ksdm = "";
        //操作工号
        JSONArray jsonArray1 = findHisDoctor(doctorMappingDO.getIdcard());
        if(jsonArray1!=null&&jsonArray1.size()>0){
            //获取医生信息
            JSONObject json = jsonArray1.getJSONObject(0);
            ksdm=json.getString("ksdm");
        }
        hlwGhmxDO.setSBXH(0);
        hlwGhmxDO.setGHCS(1);
        hlwGhmxDO.setGHJE(0);
@ -2403,7 +2413,7 @@ public class YkyyEntranceService {
        hlwGhmxDO.setSFFS(0);
        hlwGhmxDO.setJZZT(2);
        hlwGhmxDO.setJZXH(0);
        hlwGhmxDO.setKSDM(map.get("deptCode").toString());
        hlwGhmxDO.setKSDM(ksdm);
        hlwGhmxDO.setBRID(brid);
        hlwGhmxDO.setGHSJ(new Date());//挂号时间
        hlwGhmxDO.setGHLB(1);//挂号类别
@ -2463,7 +2473,7 @@ public class YkyyEntranceService {
        hlwYsMzJzLsDO.setJZXH(0);
        hlwYsMzJzLsDO.setGHXH(GHXH);
        hlwYsMzJzLsDO.setBRBH(brid);
        hlwYsMzJzLsDO.setKSDM(Integer.parseInt(map.get("deptCode").toString()));
        hlwYsMzJzLsDO.setKSDM(Integer.parseInt(ksdm));
        hlwYsMzJzLsDO.setYSDM(map.get("doctorCode").toString());
        hlwYsMzJzLsDO.setKSSJ(DateUtil.getNowDate());
        hlwYsMzJzLsDO.setJSSJ(DateUtil.getNight23());
@ -2694,7 +2704,6 @@ public class YkyyEntranceService {
        hlwGhmxDO.setSFFS(0);
        hlwGhmxDO.setJZZT(2);
        hlwGhmxDO.setJZXH(0);
        hlwGhmxDO.setKSDM(wlyyPrescriptionVO.getDept());
        hlwGhmxDO.setBRID(Integer.parseInt(patientMappingDO.getMappingCode()));
        hlwGhmxDO.setGHSJ(new Date());//挂号时间
        hlwGhmxDO.setGHLB(1);//挂号类别
@ -2709,12 +2718,16 @@ public class YkyyEntranceService {
        }else {
            throw new Exception("患者信息有误!");
        }
        String ksdm = "";
        //操作工号
        JSONArray jsonArray1 = findHisDoctor(doctorMappingDO.getIdcard());
        if(jsonArray1!=null&&jsonArray1.size()>0){
            //获取医生信息
            JSONObject json = jsonArray1.getJSONObject(0);
            hlwGhmxDO.setCZGH(json.getString("YGBH"));
            hlwGhmxDO.setKSDM(json.getString("ksdm"));
            ksdm=json.getString("ksdm");
         /*   hlwGhmxDO.set*/
        }
        // 同一个医生同一个病人,一天一条挂号记录。
@ -2781,7 +2794,7 @@ public class YkyyEntranceService {
                hlwYsMzJzLsDO.setJZXH(0);
                hlwYsMzJzLsDO.setGHXH(GHXH);
                hlwYsMzJzLsDO.setBRBH(Integer.parseInt(patientMappingDO.getMappingCode()));
                hlwYsMzJzLsDO.setKSDM(Integer.parseInt(wlyyPrescriptionVO.getDept()));
                hlwYsMzJzLsDO.setKSDM(Integer.parseInt(ksdm));
                hlwYsMzJzLsDO.setYSDM(doctorMappingDO.getMappingCode());
                hlwYsMzJzLsDO.setKSSJ(DateUtil.strToDate(DateUtil.dateToStr(wlyyPrescriptionVO.getCreateTime(),"yyyy-MM-dd HH:mm:ss")));
                hlwYsMzJzLsDO.setJSSJ(DateUtil.getNight23());
@ -2884,13 +2897,23 @@ public class YkyyEntranceService {
        logger.info("开始===================");
        if (wlyyPrescriptionVO!=null&&wlyyPrescriptionVO.getInfoVOs()!=null){
            try {
                String doctor = wlyyPrescriptionVO.getDoctor();
                DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
                String ksdm = "";
                //操作工号
                JSONArray jsonArray1 = findHisDoctor(doctorMappingDO.getIdcard());
                if(jsonArray1!=null&&jsonArray1.size()>0){
                    //获取医生信息
                    JSONObject json = jsonArray1.getJSONObject(0);
                    ksdm=json.getString("ksdm");
                }
                hlwCf01DO.setSPZT(0);
                hlwCf01DO.setFKZT(wlyyPrescriptionVO.getPayStatus());
                if (StringUtils.isNoneBlank(drugCode)){
                    Integer yfsb = Integer.parseInt(drugCode);
                    hlwCf01DO.setYFSB(yfsb);
                }
                hlwCf01DO.setCFLX(wlyyPrescriptionVO.getType());
                hlwCf01DO.setKFRQ(DateUtil.strToDate(DateUtil.dateToStr(wlyyPrescriptionVO.getCreateTime(),"yyyy-MM-dd HH:mm:ss")));
                hlwCf01DO.setZFPB(0);
@ -2919,9 +2942,7 @@ public class YkyyEntranceService {
                }
                hlwCf01DO.setBRID(Integer.parseInt(patientMappingDO.getMappingCode()));
                hlwCf01DO.setBRXM(wlyyPrescriptionVO.getPatientName());
                hlwCf01DO.setKSDM(Integer.parseInt(wlyyPrescriptionVO.getDept()));
                String doctor = wlyyPrescriptionVO.getDoctor();
                DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
                hlwCf01DO.setKSDM(Integer.parseInt(ksdm));
                hlwCf01DO.setYSDM(doctorMappingDO.getMappingCode());
                hlwCf01DO.setJZKH(wlyyPrescriptionVO.getSsc());
                hlwCf01DO.setGUID(getCode());
@ -3364,7 +3385,7 @@ public class YkyyEntranceService {
        if(jsonArray1!=null&&jsonArray1.size()>0){
            JSONObject json = jsonArray1.getJSONObject(0);
            doctorHis=json.getString("code");
            kdks = Integer.parseInt(json.getString("dept"));
            kdks = Integer.parseInt(json.getString("ksdm"));
        }
        if (surveys!=null){
            for (YkEmrJcsqDO ykEmrJcsqDO:surveys){

+ 36 - 16
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseAppointmentLogDO.java

@ -19,22 +19,26 @@ import java.util.Date;
@Table(name = "base_appointment_log")
public class BaseAppointmentLogDO extends UuidIdentityEntityWithOperator {
   private String orderCode;
   private String corpNo;
   private String departmentCode;
   private String departmentName;
   private String doctorCode;//院区id
   private String doctorName;
   private String scheduleCode;
   private String scheduleItemCode;
   private Date serviceStartDate;
   private Date serviceEndDate;
   private String patientName;
   private String patientCard;
   private String patientPhone;
   private String appSource;
   private String appointWay;
   private Integer status;//0预约失败1预约成功2取消预约
    private String orderCode;
    private String corpNo;
    private String departmentCode;
    private String departmentName;
    private String doctorCode;//院区id
    private String doctorName;
    private String scheduleCode;
    private String scheduleItemCode;
    private Date serviceStartDate;
    private Date serviceEndDate;
    private String patientName;
    private String patientCard;
    private String patientPhone;
    private String appSource;
    private String appointWay;
    private Integer status;//0预约失败1预约成功2取消预约
    private String consumerDoctor;//代预约人code
    private String consumerDoctorName;//代预约姓名
    public String getOrderCode() {
        return orderCode;
@ -166,4 +170,20 @@ public class BaseAppointmentLogDO extends UuidIdentityEntityWithOperator {
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getConsumerDoctor() {
        return consumerDoctor;
    }
    public void setConsumerDoctor(String consumerDoctor) {
        this.consumerDoctor = consumerDoctor;
    }
    public String getConsumerDoctorName() {
        return consumerDoctorName;
    }
    public void setConsumerDoctorName(String consumerDoctorName) {
        this.consumerDoctorName = consumerDoctorName;
    }
}

+ 12 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistPatientRelationDO.java

@ -104,6 +104,18 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
    @Column(name = "relation_type")
    private String relationType;//relation_type
    @Column(name = "event_type")
    private String eventType;
    public String getEventType() {
        return eventType;
    }
    public void setEventType(String eventType) {
        this.eventType = eventType;
    }
    public String getIsdeal() {
        return isdeal;
    }

+ 46 - 46
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationPlanTemplateDO.java

@ -33,52 +33,52 @@ public class RehabilitationPlanTemplateDO extends UuidIdentityEntityWithOperator
    }
    /**
     * 新增字段
     */
    @Column(name = "disease_id")
    private String diseaseId;//病种code
    @Column(name = "disease_name")
    private String diseaseName;
    @Column(name = "status")
    private String status;
    @Column(name = "type")
    private String type;
    public String getDiseaseId() {
        return diseaseId;
    }
    public void setDiseaseId(String diseaseId) {
        this.diseaseId = diseaseId;
    }
    public String getDiseaseName() {
        return diseaseName;
    }
    public void setDiseaseName(String diseaseName) {
        this.diseaseName = diseaseName;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
//    /**
//     * 新增字段
//     */
//    @Column(name = "disease_id")
//    private String diseaseId;//病种code
//
//    @Column(name = "disease_name")
//    private String diseaseName;
//selectAllCompleteServiceItemsByPatient
//    @Column(name = "status")
//    private String status;
//
//    @Column(name = "type")
//    private String type;
//    public String getDiseaseId() {
//        return diseaseId;
//    }
//
//    public void setDiseaseId(String diseaseId) {
//        this.diseaseId = diseaseId;
//    }
//
//    public String getDiseaseName() {
//        return diseaseName;
//    }
//
//    public void setDiseaseName(String diseaseName) {
//        this.diseaseName = diseaseName;
//    }
//
//    public String getStatus() {
//        return status;
//    }
//
//    public void setStatus(String status) {
//        this.status = status;
//    }
//
//    public String getType() {
//        return type;
//    }
//
//    public void setType(String type) {
//        this.type = type;
//    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;

+ 16 - 0
common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java

@ -381,6 +381,22 @@ public class HttpClientUtil {
        return ret;
    }
    public  static JSONObject postBodySl(String url, com.alibaba.fastjson.JSONObject params,Map<String,Object> headerMap) {
        RestTemplate restTemplate = new RestTemplate();
        JSONObject object = new JSONObject();
        HttpHeaders headers = new HttpHeaders();
        for(String str:headerMap.keySet()){
            headers.add(str,headerMap.get(str).toString());
        }
        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
        headers.setContentType(type);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        org.springframework.http.HttpEntity<String> formEntity = new org.springframework.http.HttpEntity<String>(params.toString(), headers);
        org.springframework.http.HttpEntity<JSONObject> response = restTemplate.exchange(url, HttpMethod.POST,formEntity, JSONObject.class);
        object.put("header",response.getHeaders());
        object.put("body",response.getBody());
        return object;
    }
    public static String postBodyHead(String url, com.alibaba.fastjson.JSONObject params, Map<String, Object> headerMap) {
        RestTemplate restTemplate = new RestTemplate();

+ 1 - 1
common/common-util/src/main/java/com/yihu/jw/util/wechat/WeiXinMessageReplyUtils.java

@ -60,7 +60,7 @@ public class WeiXinMessageReplyUtils {
        result.append("<FromUserName>" + fromUser + "</FromUserName>");
        result.append("<CreateTime>" + System.currentTimeMillis() + "</CreateTime>");
        result.append("<MsgType>text</MsgType>");
        result.append("<Content>" + articles + "</Content>");
        result.append("<Content><![CDATA[" + articles + "]]></Content>");
        result.append("</xml>");
        return result.toString();
    }

+ 15 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/RemindDoctorService.java

@ -2,7 +2,9 @@ package com.yihu.jw.service.channel;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
@ -46,6 +48,8 @@ public class RemindDoctorService {
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    public void sendSystemMessage() {
        try {
            List<WlyyOutpatientDO> list = outpatientDao.findDoctorRemindMessage();
@ -70,6 +74,7 @@ public class RemindDoctorService {
                    sex= IdCardUtil.getSexForIdcard(wlyyOutpatientDO.getIdcard());
                    age = IdCardUtil.getAgeForIdcard(wlyyOutpatientDO.getIdcard())+"";
                    Long createTime = wlyyOutpatientDO.getCreateTime().getTime();
                    BaseDoctorDO doctorDO = baseDoctorDao.findById(wlyyOutpatientDO.getDoctor());
                    Long minusts = TimeUnit.MILLISECONDS.toMinutes(nowTime - createTime);
                    SystemMessageDO systemMessageDO = new SystemMessageDO();
                    if ("2".equals(wlyyOutpatientDO.getOutpatientType())) {
@ -129,6 +134,16 @@ public class RemindDoctorService {
                    if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
                        String url=baseUrl+"/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+wlyyOutpatientDO.getDescription()+"&type=3&id="+wlyyOutpatientDO.getId();
                        enterpriseService.sendTWMesByDoctor("zsyy",wlyyOutpatientDO.getDoctor(),title,msg,url);
                        /*int i= zhongShanSMSService.ZhongShangSendSMS(doctorDO.getMobile(),msg);
                        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
                        wlyyHttpLogDO.setDoctor(outpatient.getDoctor());
                        wlyyHttpLogDO.setRequest("");
                        wlyyHttpLogDO.setName(content);
                        wlyyHttpLogDO.setCode(outpatient.getId());
                        wlyyHttpLogDO.setCreateTime(new Date());
                        wlyyHttpLogDO.setResponse(i+"");
                        wlyyHttpLogDao.save(wlyyHttpLogDO);*/
                    }else if(wechatId.equalsIgnoreCase("xm_ykyy_wx")){
                        String url=baseUrl+"/ims-app-web/#/onlineChat/detail?_rs_title="+wlyyOutpatientDO.getDescription()+"&type=3&id="+wlyyOutpatientDO.getId();
                        enterpriseService.sendTWMesByDoctor("xm_ykyy_wx",wlyyOutpatientDO.getDoctor(),title,msg,url);

+ 9 - 9
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -417,15 +417,15 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.addConsult)
	@ApiOperation(value = "添加(复诊咨询,协同门诊)", notes = "添加(复诊咨询,协同门诊)")
	public Envelop addConsult(@ApiParam(name = "outpatientCode", value = "HIS就诊记录CODE", defaultValue = "1")
										  @RequestParam(value = "outpatientCode", required = true) String outpatientCode,
										  @ApiParam(name = "patientCode", value = "复诊居民", defaultValue = "9638fa184ad14a71ba7e4bf931670778")
										  @RequestParam(value = "patientCode", required = true) String patientCode,
										  @ApiParam(name = "doctorCode", value = "当前医生", defaultValue = "1cd15ffe6b3a11e69f7c005056850d66")
										  @RequestParam(value = "doctorCode", required = true) String doctorCode,
										  @ApiParam(name = "type", value = "咨询类型(1、图文;2、视频,3、图文+视频)", defaultValue = "1")
										  @RequestParam(value = "type", required = true) Integer type,
										  @ApiParam(name = "reason", value = "复诊说明", defaultValue = "复诊说明")
										  @RequestParam(value = "reason", required = false) String reason,
							  @RequestParam(value = "outpatientCode", required = true) String outpatientCode,
							  @ApiParam(name = "patientCode", value = "复诊居民", defaultValue = "9638fa184ad14a71ba7e4bf931670778")
							  @RequestParam(value = "patientCode", required = true) String patientCode,
							  @ApiParam(name = "doctorCode", value = "当前医生", defaultValue = "1cd15ffe6b3a11e69f7c005056850d66")
							  @RequestParam(value = "doctorCode", required = true) String doctorCode,
							  @ApiParam(name = "type", value = "咨询类型(1、图文;2、视频,3、图文+视频)", defaultValue = "1")
							  @RequestParam(value = "type", required = true) Integer type,
							  @ApiParam(name = "reason", value = "复诊说明", defaultValue = "复诊说明")
							  @RequestParam(value = "reason", required = false) String reason,
							  @ApiParam(name = "source", value = "来源")
								  @RequestParam(value = "source", required = false) String source)throws Exception{
		ConsultTeamDo consult = new ConsultTeamDo();

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

@ -3665,12 +3665,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "outpatientId", required = false) String outpatientId,
            @ApiParam(name = "flag", value = "flag")
            @RequestParam(value = "flag", required = false) Integer flag) throws Exception {
        try {
            return success("操作成功", prescriptionService.getSettlementInfo(outpatientId,flag));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
        return success("操作成功", prescriptionService.getSettlementInfo(outpatientId,flag));
    }
    @PostMapping("/confirmSettlementInfo")
@ -3680,11 +3675,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "outpatientId", required = false) String outpatientId,
            @ApiParam(name = "code", value = "code")
            @RequestParam(value = "code", required = false) String code) throws Exception {
        try {
            return success("操作成功", prescriptionService.confirmSettlementInfo(outpatientId, code));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
    @PostMapping("/confirmSettlement")
@ -3828,5 +3819,19 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping("/selectByDate")
    @ApiOperation(value = "根据后台配置,发起后多少个小时内可以取消或者转医生", notes = "根据后台配置,发起后多少个小时内可以取消或者转医生")
    public Envelop selectByDate(
            @ApiParam(name = "outpatientId", value = "门诊id")
            @RequestParam(value = "outpatientId", required = false) String outpatientId) {
        try {
            return success("操作成功", prescriptionService.selectByDate(outpatientId));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
}

+ 1 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/wechat/WechatCoreController.java

@ -159,6 +159,7 @@ public class WechatCoreController extends EnvelopRestEndpoint {
                logger.info("返回xml:"+xmlStr);
                // 判断返回值是xml、json格式(取关是空串)
                Boolean flag = weiXinCoreService.isXML(xmlStr);
                System.out.println("flag"+flag);
                if (xmlStr == "error") {
                    // 服务器错误
                    response.setStatus(500);

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

@ -600,5 +600,48 @@ public class YkyyController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "getStudentInfo", method = RequestMethod.POST)
    @ApiOperation("获取筛查学生视力档案" )
    public ObjEnvelop getStudentInfo(@ApiParam(name = "condition", value = "手机号/证件号/二维码", required = true)
                                 @RequestParam(required = true)String condition,
                                     @ApiParam(name = "username", value = "用户名字", required = true)
                                     @RequestParam(required = false)String username,
                                 @ApiParam(name = "type", value = "登录类型 1-手机号 2-证件号 3 二维码", required = true)
                                 @RequestParam(required = true)String type) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",ykyyPrescriptionService.getStudentInfo(condition,type,username));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @RequestMapping(value = "otherLogin", method = RequestMethod.POST)
    @ApiOperation("视力学生认证信息" )
    public ObjEnvelop otherLogin(@ApiParam(name = "condition", value = "手机号/证件号/二维码", required = true)
                                         @RequestParam(required = true)String condition,
                                 @ApiParam(name = "username", value = "用户名字", required = true)
                                 @RequestParam(required = false)String username,
                                 @ApiParam(name = "type", value = "登录类型 1-手机号 2-证件号 3 二维码", required = true)
                                 @RequestParam(required = true)String type) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",ykyyPrescriptionService.otherLogin(condition,type,username));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @RequestMapping(value = "otherVisionHealthArchives", method = RequestMethod.POST)
    @ApiOperation("获取学生视力筛查报告" )
    public ObjEnvelop otherVisionHealthArchives(@ApiParam(name = "authorization", value = "otherLogin获取到authorization", required = true)
                                 @RequestParam(required = true)String authorization) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",ykyyPrescriptionService.otherVisionHealthArchives(authorization));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}

+ 3 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/wechat/WeiXinCoreService.java

@ -96,6 +96,9 @@ public class WeiXinCoreService {
     */
    public boolean isXML(String value) {
        try {
            if (value.contains("<xml>")){
                return true;
            }
            DocumentHelper.parseText(value);
        } catch (DocumentException e) {
            return false;

+ 43 - 7
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/wechat/WeiXinEventProcess.java

@ -3,6 +3,8 @@ package com.yihu.jw.hospital.service.wechat;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.util.wechat.WeiXinMessageReplyUtils;
import com.yihu.jw.util.wechat.WeiXinMessageUtils;
@ -13,10 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * 微信事件处理
@ -34,6 +33,8 @@ public class WeiXinEventProcess {
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private PrescriptionService prescriptionService;
    @Autowired
    private WlyyHospitalSysDictDao hospitalSysDictDao;
    /**
     * 微信推送事件处理
     *
@ -49,11 +50,11 @@ public class WeiXinEventProcess {
                break;
            case WeiXinMessageUtils.EVENT_TYPE_SUBSCRIBE: // 订阅事件
                if (message.containsKey("EventKey") && StringUtils.isNotEmpty(message.get("EventKey")) && message.containsKey("Ticket")
                        && StringUtils.isNotEmpty(message.get("Ticket"))) {
                        && StringUtils.isNotEmpty(message.get("Ticket"))) {//扫码事件
                    result = scanEventProcess(message);
                } /*else {
                } else {//关注事件
                    result = subscribeEventProcess(message);
                }*/
                }
                break;
            /*case WeiXinMessageUtils.EVENT_TYPE_UNSUBSCRIBE: // 取消订阅事件
                 result = unsubscribeEventProcess(message);
@ -158,5 +159,40 @@ public class WeiXinEventProcess {
        return result;
    }
    /**
     * 关注事件消息发送
     *
     * @param message
     * @return
     * @throws Exception
     */
    private String subscribeEventProcess(Map<String, String> message) throws Exception {
        String result = "";
        String content = "";
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("zdhfContent");
        if (hospitalSysDictDO!=null){
            content = hospitalSysDictDO.getDictValue();
        }else {
            content = "厦门眼科中心互联网医院,欢迎每一位关爱视力健康的你~ \n" +
                    "<a href=\"\" data-miniprogram-appid=\"wx5329829ab3d77bc2\" data-miniprogram-path =\"pages/patient/webview/index?redirectUrl=appointment/hospitalList\">预约挂号</a>\n" +
                    "<a href=\"\" data-miniprogram-appid=\"wx5329829ab3d77bc2\" data-miniprogram-path =\"pages/patient/webview/index?redirectUrl=nDocList&isFz=1\">复诊续方</a>\n" +
                    "<a href=\"\" data-miniprogram-appid=\"wx5329829ab3d77bc2\" data-miniprogram-path =\"pages/patient/webview/index?redirectUrl=nDocList&zjzx=2\">护理咨询</a>\n" +
                    "<a href=\"\" data-miniprogram-appid=\"wxeb5768c50247caa6\" data-miniprogram-path =\"pages/index/index\">药品商城</a>\n" +
                    "<a href=\"https://yhmail.ylzpay.com/records-mail-web/mail/index?pubId=gh_dd490c897028\">病案邮件</a>\n";
        }
        // 图文信息
        // 构建回复消息XML
        result = WeiXinMessageReplyUtils.replyMessage(message.get("FromUserName"), message.get("ToUserName"), content);
        return result;
    }
    /**
     * 设置微信公共的图文消息
     *
     * @param articles
     */
    public void setUrlItems(List<Map<String, String>> articles) {
    }
}

+ 9 - 14
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java

@ -78,20 +78,15 @@ public class RehabilitationManageController {
    @GetMapping(value = SpecialistMapping.rehabilitation.calendarPlanDetail)
    @ApiOperation(value = "康复管理-康复计划按日历展示")
    public ObjEnvelop calendarPlanDetail(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)")
                                          @RequestParam(value = "executeStartTime", required = false)String executeStartTime,
                                          @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)")
                                          @RequestParam(value = "executeEndTime", required = false)String executeEndTime,
                                          @ApiParam(name = "planId", value = "计划id,多个计划逗号隔开", required = true)
                                          @RequestParam(value = "planId", required = true)String planId,
                                          @ApiParam(name = "searchTask", value = "快速查找任务:(1电话/短信关怀,2康复咨询,3健康监测,4上门服务,5康复指导,6康复随访,7康复复诊)", required = false)
                                          @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                          @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                          @RequestParam(value = "status", required = false)Integer status,
                                          @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false)
                                          @RequestParam(value = "doctorCode", required = false)String doctorCode,
                                          @ApiParam(name="taskExecutor",value = "任务执行人:0全部;1我的任务:2他人任务",required = false)
                                          @RequestParam(value = "taskExecutor",required = false,defaultValue = "0")String taskExecutor){
    public ObjEnvelop calendarPlanDetail(
            @ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)") @RequestParam(value = "executeStartTime", required = false)String executeStartTime,
            @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)") @RequestParam(value = "executeEndTime", required = false)String executeEndTime,
            @ApiParam(name = "planId", value = "计划id,多个计划逗号隔开", required = true) @RequestParam(value = "planId", required = true)String planId,
            @ApiParam(name = "searchTask", value = "快速查找任务:(1电话/短信关怀,2康复咨询,3健康监测,4上门服务,5康复指导,6康复随访,7康复复诊)", required = false) @RequestParam(value = "searchTask", required = false)Integer searchTask,
            @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false) @RequestParam(value = "status", required = false)Integer status,
            @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false) @RequestParam(value = "doctorCode", required = false)String doctorCode,
            @ApiParam(name="taskExecutor",value = "任务执行人:0全部;1我的任务:2他人任务",required = false) @RequestParam(value = "taskExecutor",required = false,defaultValue = "0")String taskExecutor
    ){
        try {
            return rehabilitationManageService.calendarPlanDetail(executeStartTime,executeEndTime,planId,searchTask,status,doctorCode,taskExecutor);
        }catch (Exception e){

+ 1 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistPatientRelationDao.java

@ -38,4 +38,5 @@ public interface SpecialistPatientRelationDao extends PagingAndSortingRepository
    @Query("select p from SpecialistPatientRelationDO p where p.teamCode=?1 and p.patient=?2 and p.status>=0 and p.status >=0 and p.signStatus=1")
    List<SpecialistPatientRelationDO> findListByTeamAndPatient(Integer teamCode,String patient);
}

+ 43 - 3
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -1427,12 +1427,29 @@ public class RehabilitationManageService {
        Integer allCount = rehabilitationDetailDao.findAllByPlanId(planId);//计划总服务项目数
        Integer finishedCount = rehabilitationDetailDao.findByStatusAndPlanId(1, planId);
        PatientRehabilitationPlanDO p = patientRehabilitationPlanDao.findById(planId);
        SpecialistPatientRelationDO specialistPatientRelationDO;
        String eventType;
        if (StringUtils.isBlank(p.getEventType())) {
            eventType = "2";
        } else {
            eventType = p.getEventType();
        }
        SpecialistPatientRelationDO specialistPatientRelationDO = null;
        List<SpecialistPatientRelationDO> list;
        if (p.getTeamCode() != null) {
            specialistPatientRelationDO = specialistPatientRelationDao.findByTeamCodeAndPatient(p.getTeamCode(), p.getPatient());
            list = findRelation(String.valueOf(p.getTeamCode()), null, p.getPatient(), eventType);
//            specialistPatientRelationDO = specialistPatientRelationDao.findByTeamCodeAndPatient(p.getTeamCode(), p.getPatient());
        } else {
            specialistPatientRelationDO = specialistPatientRelationDao.findByDoctorAndPatient(p.getCreateUser(), p.getPatient());
            list = findRelation(null, p.getCreateUser(), p.getPatient(), eventType);
//            specialistPatientRelationDO = specialistPatientRelationDao.findByDoctorAndPatient(p.getCreateUser(), p.getPatient());
        }
        if (!list.isEmpty()) {
            specialistPatientRelationDO = list.get(0);
        }
        resultMap.put("allCount", allCount);
        resultMap.put("finishedCount", finishedCount);
        resultMap.put("specialistPatientRelationDO", specialistPatientRelationDO);
@ -1602,4 +1619,27 @@ public class RehabilitationManageService {
    public String getCode() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }
    public List<SpecialistPatientRelationDO> findRelation(String teamCode, String doctor, String patient, String eventType) {
        String sql = " select * from wlyy_specialist_patient_relation p where p.status>=0 and p.sign_status=1 " +
                " and p.patient ='" + patient + "' ";
        if (StringUtils.isNotBlank(teamCode)) {
            sql += " and p.team_code='" + teamCode + "' ";
        }
        if (StringUtils.isNotBlank(doctor)) {
            sql += " AND p.doctor='" + doctor + "'";
        }
        if ("2".equals(eventType)) {
            sql += " and  (p.event_type='2'  or p.event_type is null or p.event_type='' ) ";
        } else {
            sql += " and  p.event_type='1'  ";
        }
        System.out.println("sql==>" + sql);
        List<SpecialistPatientRelationDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(SpecialistPatientRelationDO.class));
        System.out.println("数据==>" + JSON.toJSONString(list));
        return list;
    }
}