Przeglądaj źródła

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

yeshijie 4 lat temu
rodzic
commit
afa341e2bb
33 zmienionych plików z 1691 dodań i 81 usunięć
  1. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/doctor/dao/service/BaseDoctorBGService.java
  2. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java
  3. 14 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionSignDao.java
  4. 248 7
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  5. 22 13
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  6. 23 8
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  7. 31 10
      business/base-service/src/main/java/com/yihu/jw/hospital/suggest/service/BaseSuggestionDictService.java
  8. 88 0
      business/base-service/src/main/java/com/yihu/jw/hospital/suggest/service/BaseSuggestionService.java
  9. 1 1
      business/base-service/src/main/java/com/yihu/jw/order/pay/ylz/YlzPayService.java
  10. 96 0
      business/base-service/src/main/java/com/yihu/jw/utils/Pkis/PKIServiceProxy.java
  11. 481 0
      business/base-service/src/main/java/com/yihu/jw/utils/Pkis/PKIServiceSoapBindingStub.java
  12. 19 0
      business/base-service/src/main/java/com/yihu/jw/utils/Pkis/PKIService_PortType.java
  13. 16 0
      business/base-service/src/main/java/com/yihu/jw/utils/Pkis/PKIService_Service.java
  14. 142 0
      business/base-service/src/main/java/com/yihu/jw/utils/Pkis/PKIService_ServiceLocator.java
  15. 18 15
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  16. 2 1
      business/im-service/src/main/java/com/yihu/jw/im/util/ImUtil.java
  17. 3 1
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  18. 1 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java
  19. 10 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorMessageDO.java
  20. 15 1
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDO.java
  21. 64 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionSignDO.java
  22. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkMsYj02DO.java
  23. 92 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/suggest/BaseSuggestionDO.java
  24. 25 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  25. 4 5
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  26. 7 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  27. 38 8
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/OutPatientRemindJob.java
  28. 8 4
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  29. 12 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  30. 3 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java
  31. 83 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseSuggestionController.java
  32. 120 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseSuggestionDictController.java
  33. 2 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/doctor/dao/service/BaseDoctorBGService.java

@ -86,7 +86,7 @@ public class BaseDoctorBGService extends BaseJpaService<BaseDoctorBackgroundDO,
     */
    public List<Map<String,Object>> selectByDoctor(String doctor, Integer contentType, String content, Integer page, Integer size){
        String sql = "select id as \"id\", doctor as \"doctor\",doctor_name as \"doctorName\",content_type as \"contentType\"," +
                "content as \"content\" , content_desc as \"contentDesc\",is_sort as \"isSort\",del as \"del\" " +
                "content as \"content\" , content_desc as \"contentDesc\",is_sort as \"isSort\",del as \"del\",extend as \"extend\"  " +
                " from base_doctor_message where del=1 and doctor='"+doctor+"' ";
        if (contentType!=null){
            sql +=" and content_type= "+contentType;

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java

@ -40,7 +40,7 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("select count(id) from  WlyyOutpatientDO a where a.outpatientType = ?1 and a.doctor = ?2 and a.admDate >=?3 and a.admDate <=?4")
    Integer countByTime(String type,String doctor,Date startTime,Date endTime);
    @Query("from WlyyOutpatientDO a where a.status = 0 ")
    @Query("from WlyyOutpatientDO a where a.status = 0 and a.payStatus = 1")
    List<WlyyOutpatientDO> findWaitingOutpatient();
}

+ 14 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionSignDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionSignDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by wangzhinan on 2020/5/18
 */
public interface PrescriptionSignDao extends PagingAndSortingRepository<WlyyPrescriptionSignDO, String>, JpaSpecificationExecutor<WlyyPrescriptionSignDO> {
}

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

@ -42,6 +42,7 @@ import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao;
import com.yihu.jw.hospital.doctor.dao.WlyyDoctorOnlineTimeDao;
import com.yihu.jw.hospital.drugstore.dao.BaseDrugStoreDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.mapping.service.DoctorMappingService;
import com.yihu.jw.hospital.mapping.service.PatientMappingService;
@ -75,7 +76,8 @@ import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.utils.EntityUtils;
import com.yihu.jw.utils.Pkis.PKIService_PortType;
import com.yihu.jw.utils.Pkis.PKIService_ServiceLocator;
import com.yihu.jw.utils.WebserviceUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
@ -94,6 +96,7 @@ import jxl.write.*;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import net.sf.json.xml.XMLSerializer;
import org.apache.commons.codec.binary.*;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -108,12 +111,16 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.xml.rpc.ServiceException;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.Boolean;
import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.DecimalFormat;
import java.util.*;
import java.util.Base64;
/**
 * Created by Trick on 2019/5/17.
@ -247,6 +254,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private BaseBannerDoctorDao baseBannerDoctorDao;
    @Autowired
    private BaseDrugStoreDao baseDrugStoreDao;
    @Autowired
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private PrescriptionSignDao prescriptionSignDao;
@ -314,7 +326,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        //BS16017(String REGISTER_SN,String realOrder,String PAT_NO,String ADM_NO,boolean demoFlag) throws Exception {
        logger.info("findOriginPrescriptionList: registerSn:" + registerSn + " patient" + patient + " patNo:" + patNo + " realOrder:" + realOrder + " admNo:" + admNo);
        return entranceService.BS16017(registerSn, realOrder, patNo, admNo, demoFlag);
        List<WlyyPrescriptionVO> prescriptionVOS = entranceService.BS16017(registerSn, realOrder, patNo, admNo, demoFlag);
        for (WlyyPrescriptionVO prescriptionVO:prescriptionVOS){
            WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = readOutPatientXml(registerSn);//电子病历
            prescriptionVO.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO);
        }
        return prescriptionVOS;
    }
    /**
@ -486,6 +503,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        rs.put("patientCancelValue", outpatientDO.getPatientCancelValue());
        rs.put("patientCancelRemark", outpatientDO.getPatientCancelRemark());
        rs.put("operator",outpatientDO.getOperator());
        rs.put("status",outpatientDO.getStatus());
        rs.put("createTime",DateUtil.dateToStrLong(outpatientDO.getCreateTime()));
        //居民详情
        BasePatientDO basePatientDO = basePatientDao.findById(outpatientDO.getPatient());
        rs.put("patientName", basePatientDO.getName());
@ -3494,12 +3513,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                    data.put("type", "9");
                    msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个图文复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "9", "doctorRefuseRemind", "");
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "9", "doctorRefuseRemind", cancelRemark);
                }
                if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                    data.put("type", "16");
                    msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个视频复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "16", "doctorRefuseRemind", "");
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "16", "doctorRefuseRemind", cancelRemark);
                }
                data.put("msg", msg);
                messageDO.setData(data.toString());
@ -3600,6 +3619,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
            logger.info("doctorRefuseRemind医生拒诊入参:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if("outPatientTimeOutRemind".equalsIgnoreCase(titelType)) {
            contentMsg = "您邀请的医师暂无应答,您可以选择继续等待或者取消邀请。";
            first = outpatientDO.getPatientName() + ",您好!";
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId=    "+outpatientId;
        } else if ("payRemind".equalsIgnoreCase(titelType)) {
            if ("9".equals(type)) {
@ -3722,6 +3745,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 医生拒诊开始");
            }else if("outPatientTimeOutRemind".equals(titelType)){
                //就诊等待过长提示
                scene="jzddgcts";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_timeout_remind", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("就诊等待过长提示");
            } else if ("payRemind".equalsIgnoreCase(titelType)) {
                scene = "zxzfts";
                //就诊支付
@ -3898,7 +3928,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        } else if ("xm_xzzx_wx".equalsIgnoreCase(wxId)) {
            String responseMsg="";
            String prefix="https://www.xmheart.com";
            //String prefix="https://www.xmheart.com";
            String prefix = "https://ih.xmheart.com";
            if(StringUtils.isNotEmpty(outpatientId)){
                responseMsg = xzzxEntranceService.sendXCXMes(wxId,
                        patientDO.getId(),
@ -3920,7 +3951,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        prefix+msgUrl,
                        "wx53f6bb4ac081d840");
            }
            logger.info("url="+prefix+msgUrl);
            String msg="first:"+first+"contentMsg:"+contentMsg+"remark:"+remark;
            logger.info("发送的信息="+msg);
@ -3930,6 +3960,76 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if ("prescriptionPayRemind".equalsIgnoreCase(titelType)){
                return;
            }
            List<BasePatientWechatDo> ps = new ArrayList<BasePatientWechatDo>();
            if (StringUtils.isNotEmpty(outpatientId)){
                ps = basePatientWechatDao.findByWechatIdAndPatientId(wxId, outpatientDO.getPatient());
            }
            if (consultTeam!=null){
                ps = basePatientWechatDao.findByWechatIdAndPatientId(wxId, consultTeam.getPatient());
            }
            if (ps.isEmpty()) {
                logger.info("该用户" + outpatientDO.getPatientName() + "没有openid,无法推送模版消息,用户ID:" + outpatientDO.getPatient() + "wechatId:" + wxId);
                return;
            }
            String scene = "";
            WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
            if ("doctorRefuseRemind".equalsIgnoreCase(titelType)) {
                scene = "zsysqxts";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_doctor_notice", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getPatientName()));
                if ("9".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊")+"取消原因为:"+remindMsg);
                } else if ("16".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频复诊")+"取消原因为:"+remindMsg);
                }
                newConfig.setKeyword1( outpatientDO.getHospitalName());
                newConfig.setKeyword2(outpatientDO.getDoctorName());
                newConfig.setKeyword3( doctorDO.getFee());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("中山医院消息模板推送 医生拒诊开始");
            }else if("outPatientTimeOutRemind".equalsIgnoreCase(titelType)){
                scene = "hzsjgctx";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_doctor_notice", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getPatientName()));
                if ("9".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊"));
                } else if ("16".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频复诊"));
                }
                newConfig.setKeyword1( outpatientDO.getHospitalName());
                newConfig.setKeyword2(outpatientDO.getDoctorName());
                newConfig.setKeyword3( doctorDO.getFee());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("中山医院消息模板推送 候诊时间过长开始");
            }
            logger.info("=======setUrl========" + newConfig.getUrl());
            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
            for (BasePatientWechatDo one : ps) {
                logger.info("发送的消息="+ com.alibaba.fastjson.JSONObject.toJSONString(newConfig));
                try {
                    logger.info("调用中山微信模板消息接口的入参:AccessToken="+wxAccessTokenDO.getAccessToken()+"---Openid="+one.getOpenid());
                    weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), one.getOpenid(), newConfig);
                    logger.info("发送成功");
                } catch (Exception e) {
                    e.printStackTrace();
                    logger.info("发送失败,error="+e.getMessage());
                }
                //保存发送模板记录,
                WxPushLogDO wxPushLogDO = new WxPushLogDO();
                wxPushLogDO.setCreateTime(new Date());
                wxPushLogDO.setOpenid(one.getOpenid());
                wxPushLogDO.setReceiver(outpatientDO.getPatient());
                wxPushLogDO.setWechatId(wechatId);
                wxPushLogDO.setReceiverName(outpatientDO.getPatientName());
                wxPushLogDO.setScene(scene);
                wxPushLogDao.save(wxPushLogDO);
            }
            String responseMsg="";
            String prefix="https://hlwyy.xmzsh.com";
            if(StringUtils.isNotEmpty(outpatientId)){
@ -7060,11 +7160,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        setInspectionParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, ins, outpatientDO.getIcd10());
                    }
                    Map<String, Object> map = sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO);
                    //处方签名
                    logger.info("处方签名");
                    SOF_SignDataWithExtraInfo(wlyyPrescriptionDO);
                    //同步电子病历
                    WlyyPrescriptionEmrDO prescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionId);
                    if (prescriptionEmrDO != null) {
                        String doctorId = doctorMappingDO.getMappingCode();
                        String doctorName = doctorMappingDO.getDoctorName();
                        logger.info("电子病历签名");
                        SOF_SignDataWithExtraInfoEmr(prescriptionEmrDO);
                        writeOutPatient(outpatientDO.getRegisterNo(), prescriptionEmrDO.getComplaint(), prescriptionEmrDO.getMedicalHistory(), prescriptionEmrDO.getPastHistory(), prescriptionEmrDO.getPhysicalExamination(), prescriptionEmrDO.getAssistExamination(), doctorId, doctorName);
                    }
                    if (map.get("code").toString().equalsIgnoreCase("1")) {
@ -7620,10 +7725,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        String returnValue = "";
        Map<String, String> params = new HashedMap();
        params.put("type", "getPatInfoDataXml");
        params.put("data", data);
        returnValue = com.yihu.jw.utils.WebserviceUtil.post(url,
                "http://business.htemr.haitaiinc.com",
                "getPatInfoDataXml",
                "manageEmrDataAll",
                params);
        logger.info("门诊病历列表信息,返回值xmlstr:" + returnValue);
@ -8080,4 +8186,139 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, res);
    }
    /**
     * 处方签名
     * @param prescriptionDO
     * @throws Exception
     */
    public void SOF_SignDataWithExtraInfo(WlyyPrescriptionDO prescriptionDO) throws Exception {
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(prescriptionDO.getDoctor());
        BaseDoctorDO doctorDO = baseDoctorDao.findById(prescriptionDO.getDoctor());
        BasePatientDO patientDO = basePatientDao.findById(prescriptionDO.getPatientCode());
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
        PKIService_ServiceLocator locator = new PKIService_ServiceLocator();
        URL portAddress = new URL("http://192.0.33.91:8080/pkis/services/v1?wsdl");
        PKIService_PortType service = locator.getPKIServiceImplPort(portAddress);
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
        List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionDO.getId(), 1);
        List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionDO.getId(), 1);
        //his处方拼接开方条件
        com.alibaba.fastjson.JSONArray jsonData = new com.alibaba.fastjson.JSONArray();
        for (WlyyPrescriptionInfoDO info : infoDOS) {
            //设置his药品查询条件
            setInfoJsonParam(jsonData, doctorMappingDO, outpatientDO, prescriptionDO, info, outpatientDO.getIcd10());
        }
        for (WlyyInspectionDO ins : inspectionDOS) {
            //设置his药品查询条件
            setInspectionParam(jsonData, doctorMappingDO, outpatientDO, prescriptionDO, ins, outpatientDO.getIcd10());
        }
        // 1.1.1 服务端签名(带取证查询扩展信息)
        // inData 参数
        String inData = jsonData.toJSONString();
        inData = org.apache.commons.codec.binary.Base64.encodeBase64String(inData.getBytes("gbk"));
        // extInfo  参数
        String idCardNo = "123502004266006872;"+doctorDO.getIdcard();
        Map<String, String> extInfoMap = new HashMap<String, String>();
        extInfoMap.put("busSys", "ZhongJianXinLianHLWYY");
        extInfoMap.put("doctorNo", doctorMappingDO!=null?doctorMappingDO.getMappingCode():null);
        extInfoMap.put("doctorName", doctorMappingDO!=null?doctorMappingDO.getDoctorName():null);
        extInfoMap.put("deptName", "部门");
        extInfoMap.put("patientName", patientDO!=null?patientDO.getName():null);
        extInfoMap.put("patientSex", patientDO!=null?IdCardUtil.getSexForIdcard(patientDO.getIdcard()):null);
        extInfoMap.put("hospitalNo", wlyyOutpatientDO!=null?wlyyOutpatientDO.getOriginAdmNo():null);
        extInfoMap.put("hospitalNumber",  wlyyOutpatientDO!=null?wlyyOutpatientDO.getOriginConNo():null);
        extInfoMap.put("diagnostic", wlyyOutpatientDO!=null?wlyyOutpatientDO.getIcd10Name():null);
        String extInfo = org.apache.commons.codec.binary.Base64.encodeBase64String(JSON.toJSONString(extInfoMap).getBytes("GBK"));
        String result = service.SOF_SignDataWithExtraInfo(idCardNo, inData, extInfo);
        logger.info("请求返参"+result);
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
        if ("1000".equalsIgnoreCase(object.getString("code"))){
            com.alibaba.fastjson.JSONArray array = com.alibaba.fastjson.JSONArray.parseArray(object.getString("data"));
            for (int i=0;i<array.size();i++){
                com.alibaba.fastjson.JSONObject jsonObject = array.getJSONObject(i);
                String signData = jsonObject.getString("signData");
                String signResult = jsonObject.getString("signResult");
                String certData = jsonObject.getString("certData");
                WlyyPrescriptionSignDO prescriptionSignDO = new WlyyPrescriptionSignDO();
                prescriptionSignDO.setCertData(certData);
                prescriptionSignDO.setPrescriptionId(prescriptionDO.getId());
                prescriptionSignDO.setSignData(signData);
                prescriptionSignDO.setSignResult(signResult);
                prescriptionSignDO.setCreateTime(new Date());
                prescriptionSignDO.setUpdateTime(new Date());
                prescriptionSignDao.save(prescriptionSignDO);
            }
            prescriptionDO.setSignFlag(1);
        }
    }
    /**
     * 电子病历签名
     * @param prescriptionDO
     * @throws Exception
     */
    public void SOF_SignDataWithExtraInfoEmr(WlyyPrescriptionEmrDO prescriptionEmrDO) throws Exception {
        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionEmrDO.getId());
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(prescriptionDO.getDoctor());
        BaseDoctorDO doctorDO = baseDoctorDao.findById(prescriptionDO.getDoctor());
        BasePatientDO patientDO = basePatientDao.findById(prescriptionDO.getPatientCode());
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
        PKIService_ServiceLocator locator = new PKIService_ServiceLocator();
        URL portAddress = new URL("http://192.0.33.91:8080/pkis/services/v1?wsdl");
        PKIService_PortType service = locator.getPKIServiceImplPort(portAddress);
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
        List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionDO.getId(), 1);
        List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionDO.getId(), 1);
        //电子病历签名
        com.alibaba.fastjson.JSONObject jsonData = new com.alibaba.fastjson.JSONObject();
        jsonData.put("CHIEF_COMPLAINT",prescriptionEmrDO.getComplaint());
        jsonData.put("HPI",prescriptionEmrDO.getMedicalHistory());
        jsonData.put("ELAPSEMHIS",prescriptionEmrDO.getPastHistory());
        jsonData.put("BODYCHECK",prescriptionEmrDO.getPhysicalExamination());
        jsonData.put("ASSISTANTCHECK",prescriptionEmrDO.getAssistExamination());
        // 1.1.1 服务端签名(带取证查询扩展信息)
        // inData 参数
        String inData = jsonData.toJSONString();
        inData = org.apache.commons.codec.binary.Base64.encodeBase64String(inData.getBytes("gbk"));
        // extInfo  参数
        String idCardNo = "123502004266006872;"+doctorDO.getIdcard();
        Map<String, String> extInfoMap = new HashMap<String, String>();
        extInfoMap.put("busSys", "ZhongJianXinLianHLWYY");
        extInfoMap.put("doctorNo", doctorMappingDO!=null?doctorMappingDO.getMappingCode():null);
        extInfoMap.put("doctorName", doctorMappingDO!=null?doctorMappingDO.getDoctorName():null);
        extInfoMap.put("deptName", "部门");
        extInfoMap.put("patientName", patientDO!=null?patientDO.getName():null);
        extInfoMap.put("patientSex", patientDO!=null?IdCardUtil.getSexForIdcard(patientDO.getIdcard()):null);
        extInfoMap.put("hospitalNo", wlyyOutpatientDO!=null?wlyyOutpatientDO.getOriginAdmNo():null);
        extInfoMap.put("hospitalNumber",  wlyyOutpatientDO!=null?wlyyOutpatientDO.getOriginConNo():null);
        extInfoMap.put("diagnostic", wlyyOutpatientDO!=null?wlyyOutpatientDO.getIcd10Name():null);
        String extInfo = org.apache.commons.codec.binary.Base64.encodeBase64String(JSON.toJSONString(extInfoMap).getBytes("GBK"));
        String result = service.SOF_SignDataWithExtraInfo(idCardNo, inData, extInfo);
        logger.info("请求返参"+result);
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
        if ("1000".equalsIgnoreCase(object.getString("code"))){
            com.alibaba.fastjson.JSONArray array = com.alibaba.fastjson.JSONArray.parseArray(object.getString("data"));
            for (int i=0;i<array.size();i++){
                com.alibaba.fastjson.JSONObject jsonObject = array.getJSONObject(i);
                String signData = jsonObject.getString("signData");
                String signResult = jsonObject.getString("signResult");
                String certData = jsonObject.getString("certData");
                WlyyPrescriptionSignDO prescriptionSignDO = new WlyyPrescriptionSignDO();
                prescriptionSignDO.setCertData(certData);
                prescriptionSignDO.setPrescriptionId(prescriptionDO.getId());
                prescriptionSignDO.setSignData(signData);
                prescriptionSignDO.setSignResult(signResult);
                prescriptionSignDO.setCreateTime(new Date());
                prescriptionSignDO.setUpdateTime(new Date());
                prescriptionSignDO.setRelationCode(prescriptionEmrDO.getId());
                prescriptionSignDao.save(prescriptionSignDO);
            }
            prescriptionDO.setSignFlag(1);
        }
    }
}

+ 22 - 13
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -364,6 +364,7 @@ public class EntranceService {
                                wlyyPrescriptionInfoVO.setSupplyName(null != jsonObjectBody.get("YPYF00") ? jsonObjectBody.get("YPYF00").toString() : "");
                                wlyyPrescriptionInfoVO.setDays(null != jsonObjectBody.get("days") ? jsonObjectBody.get("days").toString() : "");
                                wlyyPrescriptionInfoVO.setFrequency(null != jsonObjectBody.get("frequency") ? jsonObjectBody.get("frequency").toString() : "");
                                wlyyPrescriptionInfoVO.setGroupNo(null != jsonObjectBody.get("DISP_DEPOSITE") ? jsonObjectBody.get("DISP_DEPOSITE").toString() : "");
                                //规格
                                wlyyPrescriptionInfoVO.setSpecification(null != jsonObjectBody.get("DRUG_SPEC") ? jsonObjectBody.get("DRUG_SPEC").toString() : "");
                                wlyyPrescriptionInfoVO.setDel(1);
@ -1791,16 +1792,27 @@ public class EntranceService {
                                //保存医生信息
                                BaseDoctorDO baseDoctorDO = new BaseDoctorDO();
                                String idCard = null == jsonObjectBody.get("Card_Id") ? "" : jsonObjectBody.get("Card_Id").toString();
                                baseDoctorDO.setIdcard(idCard);
                                baseDoctorDO.setBirthday(IdCardUtil.getBirthdayForIdcard(idCard));
                                baseDoctorDO.setSex(Integer.valueOf(IdCardUtil.getSexForIdcard(idCard)));
                                baseDoctorDO.setLocked(0);
                                baseDoctorDO.setEnabled(1);
                                List<BaseDoctorDO> baseDoctorDOS = baseDoctorDao.findByIdcard(idCard);
                                if (baseDoctorDOS!=null&&baseDoctorDOS.size()!=0){
                                    baseDoctorDO=baseDoctorDOS.get(0);
                                }else {
                                    baseDoctorDO.setIdcard(idCard);
                                    baseDoctorDO.setBirthday(IdCardUtil.getBirthdayForIdcard(idCard));
                                    baseDoctorDO.setSex(Integer.valueOf(IdCardUtil.getSexForIdcard(idCard)));
                                    baseDoctorDO.setLocked(0);
                                    baseDoctorDO.setEnabled(1);
                                    String disableFlag = null == jsonObjectBody.get("Disable_Flag") ? "" : jsonObjectBody.get("Disable_Flag").toString();
                                    //互联网医院:1停用,0使用  转 i健康:1正常,0作废
                                    baseDoctorDO.setDel("1".equals(disableFlag) ? "0" : "1");
                                    baseDoctorDO.setMobile("0");
                                    baseDoctorDO.setName(doctorName);
                                    baseDoctorDO.setIsFamous(0);
                                    baseDoctorDO.setCreateTime(new Date());
                                    baseDoctorDO.setUpdateTime(new Date());
                                }
                                //拼音码
                                baseDoctorDO.setSpell(null == jsonObjectBody.get("PinYin_Code") ? "" : jsonObjectBody.get("PinYin_Code").toString());
                                String disableFlag = null == jsonObjectBody.get("Disable_Flag") ? "" : jsonObjectBody.get("Disable_Flag").toString();
                                //互联网医院:1停用,0使用  转 i健康:1正常,0作废
                                baseDoctorDO.setDel("1".equals(disableFlag) ? "0" : "1");
                                //姓名
                                doctorName = null == jsonObjectBody.get("Emp_Name") ? "" : jsonObjectBody.get("Emp_Name").toString();
                                //号别
@ -1815,16 +1827,12 @@ public class EntranceService {
                                } else {
                                    baseDoctorDO.setPassword(com.yihu.utils.security.MD5.md5Hex("123456" + "{" + baseDoctorDO.getSalt() + "}"));
                                }
                                baseDoctorDO.setName(doctorName);
                                baseDoctorDO.setIsFamous(0);
                                baseDoctorDO.setCreateTime(new Date());
                                baseDoctorDO.setUpdateTime(new Date());
                                baseDoctorDO.setMobile("0");
                                baseDoctorDO = baseDoctorDao.save(baseDoctorDO);
                                //根据医生和机构判断数据是否存在,若不存在则在mapping中追加记录
                                List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByDoctorAndOrgCode(baseDoctorDO.getId(), "350211A1002");
                                if (!(null != doctorMappingDOS && doctorMappingDOS.size() > 0)) {
                                    DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
                                    doctorMappingDao.delete(doctorMappingDOS);
                                    doctorMappingDO.setDoctor(baseDoctorDO.getId());
                                    doctorMappingDO.setDoctorName(doctorName);
                                    doctorMappingDO.setMappingCode(doctorCode);
@ -1837,6 +1845,7 @@ public class EntranceService {
                                String deptCode = null == jsonObjectBody.get("Dept_Code") ? "" : jsonObjectBody.get("Dept_Code").toString();
                                List<BaseDoctorHospitalDO> baseDoctorHospitalDOS = baseDoctorHospitalDao.findByOrgCodeAndDeptCodeAndDoctorCode("350211A1002", deptCode, baseDoctorDO.getId());
                                if (!(null != baseDoctorHospitalDOS && baseDoctorHospitalDOS.size() > 0)) {
                                    baseDoctorHospitalDao.delete(baseDoctorHospitalDOS);
                                    BaseDoctorHospitalDO baseDoctorHospitalDO = new BaseDoctorHospitalDO();
                                    baseDoctorHospitalDO.setOrgCode("350211A1002");
                                    baseDoctorHospitalDO.setOrgName("厦门大学附属中山医院");

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

@ -137,6 +137,8 @@ public class YkyyEntranceService {
    @Autowired
    private YkyyService ykyyService;
    @Autowired
    private PrescriptionEmrDao prescriptionEmrDao;
    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
@ -1642,7 +1644,7 @@ public class YkyyEntranceService {
            List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(code,1);
            synPrecriptionHis(prescriptionVO,code);
            //同步检查检验
           /* synInspect(inspectionDOS);*/
            synInspect(inspectionDOS);
        }
        return wlyyPrescriptionDOs.toString();
@ -1651,6 +1653,7 @@ public class YkyyEntranceService {
    //同步检查检验
    public void  synInspect(List<WlyyInspectionDO> inspectionDOS) throws Exception {
        System.out.println("进入同步");
        List<YkEmrJcsqDO> ykEmrJcsqDOS = new ArrayList<>();
        String doctor = null;
        String patient = null;
@ -2277,8 +2280,8 @@ public class YkyyEntranceService {
    }
    //根据组套项目id查询组套明细
    public JSONArray findZtmxByid(String ztId) throws Exception{
        String sql = "select t.ztid as \"ztid\",t.xmdm as \"xmdm\"," +
                "t.xmmc as \"xmmc\",t.mrsl as \"mrsl\",t.zxks as \"zxks\"" +
        String sql = "select t.ztid as \"ztid\",t.xmdm as \"code\"," +
                "t.xmmc as \"name\",t.mrsl as \"quantity\",t.zxks as \"dept\"" +
                "from portal_his.emr_ztmx@ykzxtest t where 1=1";
        if (StringUtils.isNotEmpty(ztId)){
            sql += " and t.ztid = '"+ztId+"'";
@ -2301,9 +2304,9 @@ public class YkyyEntranceService {
    }
    //查询诊疗项目视图
    public JSONArray findZlxm(String itemName) throws Exception{
        String sql = "select t.item_code as \"itemCode\",t.item_name as \"itemName\"," +
                "t.price as \"price\",t.total_unit as \"totalUnit\"," +
                "t.zxks as \"zxks\" from VEMR_ORDER_ITEM t where 1=1";
        String sql = "select t.item_code as \"code\",t.item_name as \"name\"," +
                "t.price as \"chargeAmount\",t.total_unit as \"totalUnit\"," +
                "t.zxks as \"dept\" from VEMR_ORDER_ITEM t where 1=1";
        if (StringUtils.isNotEmpty(itemName)){
            sql+=" and t.ITEM_NAME like '%"+itemName+"%'";
        }
@ -2324,7 +2327,7 @@ public class YkyyEntranceService {
    }
    //查询诊疗项目明细视图
    public JSONArray findZlxmMx(String zlxmId) throws Exception{
        String sql = "select t.zlxmid as \"zlxmid\",t.fyxh as \"fyxh\",t.fysl \"fysl\"" +
        String sql = "select t.zlxmid as \"code\",t.fyxh as \"fyxh\",t.fysl \"quantity\"" +
                " from VEMR_ORDER_ITEM_MX t where 1=1";
        if (StringUtils.isNotEmpty(zlxmId)){
            sql+=" and t.zlxmid = '"+zlxmId+"'";
@ -2553,5 +2556,17 @@ public class YkyyEntranceService {
            return "failed";
        }
    }
    //获取上一次的电子病例
    public List<WlyyPrescriptionEmrDO>  getPrevious(String patientId){
        List<WlyyPrescriptionDO> list =  prescriptionDao.findByPatientCode(patientId);
        String emrId = "";
        List<WlyyPrescriptionEmrDO> result = new ArrayList<>();
        if (list.size()>0){
            for (WlyyPrescriptionDO wlyyPrescriptionDO:list){
                WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO= prescriptionEmrDao.findOne(wlyyPrescriptionDO.getId());
                result.add(wlyyPrescriptionEmrDO);
            }
        }
        return result;
    }
}

+ 31 - 10
business/base-service/src/main/java/com/yihu/jw/hospital/suggest/service/BaseSuggestionDictService.java

@ -4,16 +4,21 @@ import com.yihu.jw.entity.hospital.message.BaseBannerDO;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDO;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDictDO;
import com.yihu.jw.hospital.suggest.dao.BaseSuggestionDictDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class BaseSuggestionDictService extends BaseJpaService<BaseSuggestionDictDO, BaseSuggestionDictDao> {
    @Autowired
    private BaseSuggestionDictDao baseSuggestionDictDao;
@ -100,6 +105,7 @@ public class BaseSuggestionDictService extends BaseJpaService<BaseSuggestionDict
            }
        }
        baseSuggestionDictDO.setIsSort(sort+1);
        baseSuggestionDictDO.setIsDel(1);
        baseSuggestionDictDO.setUpdateTime(new Date());
        baseSuggestionDictDO.setCreateTime(new Date());
        BaseSuggestionDictDO result =  baseSuggestionDictDao.save(baseSuggestionDictDO);
@ -111,7 +117,7 @@ public class BaseSuggestionDictService extends BaseJpaService<BaseSuggestionDict
     * @return
     * @throws Exception
     */
    public BaseSuggestionDictDO updateSuggest(String id,String suggestName,String suggestDes,String isDel,String updateUser,String updateUserName){
    public BaseSuggestionDictDO updateSuggest(String id,String suggestName,String suggestDes,String updateUser,String updateUserName){
        BaseSuggestionDictDO baseSuggestionDictDO = baseSuggestionDictDao.findOne(id);
        if (null == baseSuggestionDictDO){
            return null;
@ -129,9 +135,6 @@ public class BaseSuggestionDictService extends BaseJpaService<BaseSuggestionDict
        if (!StringUtil.isEmpty(updateUserName)){
            baseSuggestionDictDO.setUpdateUser(updateUserName);
        }
        if (!StringUtil.isEmpty(isDel)){
            baseSuggestionDictDO.setIsDel(Integer.valueOf(isDel));
        }
        baseSuggestionDictDao.save(baseSuggestionDictDO);
        return baseSuggestionDictDO;
    }
@ -153,11 +156,29 @@ public class BaseSuggestionDictService extends BaseJpaService<BaseSuggestionDict
    *   根据建议名称 或者描述查询
    *
     */
    public List<Map<String,Object>> findByNameAndDes(String name,String des){
    public MixEnvelop findByNameAndDes(String name, String des, Integer page, Integer pageSize){
        String sql = "select t.id as\"id\",t.suggest_name as\"suggestName\",t.suggest_describe as\"suggestDescribe\"," +
                "t.is_del as\"isDel\",t.is_sort as\"isSort\",t.create_time as\"createTime\"" +
                " from base_suggestions_dict t where 1=1";
        List<Map<String,Object>> list= hibenateUtils.createSQLQuery(sql);
        return list;
                "t.is_del as\"isDel\",t.is_sort as\"isSort\",t.create_time as\"createTime\",t.update_time as \"updateTime\"" +
                " from base_suggestions_dict t where 1=1 and t.is_del = 1";
        if(StringUtils.isNotEmpty(name)){
            sql+=" and t.suggest_name like '%"+name+"%'";
        }
        if(StringUtils.isNotEmpty(des)){
            sql+=" and t.suggest_describe like '%"+des+"%'";
        }
        sql+= " order by t.is_sort asc";
        List<Map<String,Object>> list= hibenateUtils.createSQLQuery(sql,page,pageSize);
        for (Map<String,Object> map:list){
            String createTime= map.get("createTime").toString();
            String updateTime = map.get("updateTime").toString();
            map.put("createTime", DateUtil.dateToStrLong(DateUtil.strToDateLong(createTime)));
            map.put("updateTime",DateUtil.dateToStrLong(DateUtil.strToDateLong(updateTime)));
        }
        MixEnvelop mixEnvelop = new MixEnvelop();
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setTotalCount(list.size());
        mixEnvelop.setDetailModelList(list);
        mixEnvelop.setCurrPage(page);
        return mixEnvelop;
    }
}

+ 88 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/suggest/service/BaseSuggestionService.java

@ -2,10 +2,98 @@ package com.yihu.jw.hospital.suggest.service;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDO;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDictDO;
import com.yihu.jw.hospital.suggest.dao.BaseSuggestionDao;
import com.yihu.jw.hospital.suggest.dao.BaseSuggestionDictDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.persistence.criteria.CriteriaBuilder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class BaseSuggestionService extends BaseJpaService<BaseSuggestionDO, BaseSuggestionDao> {
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private BaseSuggestionDao baseSuggestionDao;
    @Autowired
    private BaseSuggestionDictDao baseSuggestionDictDao;
    /**
     * 新增反馈建议
     * @param
     * @return
     * @throws Exception
     */
    public BaseSuggestionDO createSuggestion(BaseSuggestionDO baseSuggestionDO){
        baseSuggestionDO.setUpdateTime(new Date());
        baseSuggestionDO.setCreateTime(new Date());
        baseSuggestionDO.setIsDel(1);
        baseSuggestionDO.setSuggestStatus(0);
        BaseSuggestionDO result =  baseSuggestionDao.save(baseSuggestionDO);
        return result;
    }
    /**
     * 建议查看
     * @param
     * @return
     * @throws Exception
     */
    public MixEnvelop findSuggestionByType(String type,String senderId, Integer page, Integer pageSize){
        String sql = "select a.id as\"id\",a.suggest_id as\"suggestId\",a.suggest_content as\"suggestContent\",a.suggest_img_url as\"suggestImgUrl\"," +
                "a.suggest_user_id as\"suggestUserId\",a.user_client as \"userClient\",a.user_type as \"userType\"," +
                "a.suggest_user_name as\"suggestUserName\",a.suggest_user_phone as\"suggestUserPhone\",a.create_time as\"createTime\"," +
                "a.update_time as\"updateTime\",a.suggest_status as \"suggestStatus\"," +
                "b.suggest_name as\"suggestName\",b.suggest_describe as\"suggestSescribe\" from base_suggestion a ," +
                "base_suggestions_dict b where a.suggest_id = b.id and a.is_del = 1" ;
        if(StringUtils.isNoneBlank(type)){
            sql+=" and a.suggest_id = '"+type+"'";
        }if (StringUtils.isNoneBlank(senderId)){
            sql+=" and a.suggest_user_id = '"+senderId+"'";
        }
        sql+=" order by a.create_time desc";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        for (Map<String,Object> map:list){
            String createTime= map.get("createTime").toString();
            String updateTime = map.get("updateTime").toString();
            map.put("createTime", DateUtil.dateToStrLong(DateUtil.strToDateLong(createTime)));
            map.put("updateTime",DateUtil.dateToStrLong(DateUtil.strToDateLong(updateTime)));
        }
        MixEnvelop mixEnvelop = new MixEnvelop();
        mixEnvelop.setCurrPage(page);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setTotalCount(list.size());
        mixEnvelop.setDetailModelList(list);
        return mixEnvelop;
    }
    //回复反馈
    public void reponseSuggestion(String id,String responseContent,String userId,String userName){
        BaseSuggestionDO baseSuggestionDO = baseSuggestionDao.findOne(id);
        if (null!=baseSuggestionDO){
            baseSuggestionDO.setManagerRes(responseContent);
            baseSuggestionDO.setResUser(userId);
            baseSuggestionDO.setResUserName(userName);
            baseSuggestionDO.setSuggestStatus(1);
        }
        baseSuggestionDao.save(baseSuggestionDO);
    }
    //查看单条
    public BaseSuggestionDO findSuggestionById(String id){
        BaseSuggestionDO baseSuggestionDO = baseSuggestionDao.findOne(id);
        BaseSuggestionDictDO baseSuggestionDictDO = baseSuggestionDictDao.findOne(baseSuggestionDO.getSuggestId());
        baseSuggestionDO.setSuggestName(baseSuggestionDictDO.getSuggestName());
        return baseSuggestionDO;
    }
}

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/order/pay/ylz/YlzPayService.java

@ -275,7 +275,7 @@ public class YlzPayService {
            jsonObject.put("applyDepaName",applyDepaName);//申请科室名称
            jsonObject.put("applyDoctorName",applyDoctorName);//申请医生姓名
            jsonObject.put("recipeTime",recipeTime);//处方时间yyyyMMddHHmmss
            jsonObject.put("fee",fee);//总费用
            jsonObject.put("fee",Double.parseDouble(fee)+15);//总费用
            jsonObject.put("recipeNum",recipeNum);//处方数
            System.out.println("推送模板消息参数"+jsonObject.toJSONString());
            //jsonObject.put("extra")

+ 96 - 0
business/base-service/src/main/java/com/yihu/jw/utils/Pkis/PKIServiceProxy.java

@ -0,0 +1,96 @@
package com.yihu.jw.utils.Pkis;
public class PKIServiceProxy implements PKIService_PortType {
  private String _endpoint = null;
  private PKIService_PortType pKIService_PortType = null;
  
  public PKIServiceProxy() {
    _initPKIServiceProxy();
  }
  
  public PKIServiceProxy(String endpoint) {
    _endpoint = endpoint;
    _initPKIServiceProxy();
  }
  
  private void _initPKIServiceProxy() {
    try {
      pKIService_PortType = (new PKIService_ServiceLocator()).getPKIServiceImplPort();
      if (pKIService_PortType != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)pKIService_PortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)pKIService_PortType)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (pKIService_PortType != null)
      ((javax.xml.rpc.Stub)pKIService_PortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public PKIService_PortType getPKIService_PortType() {
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType;
  }
  
  public String SOF_LoginAuthentication(String certData, String inData, String signData) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_LoginAuthentication(certData, inData, signData);
  }
  
  public String SOF_SignDataWithExtraInfo(String idCardNo, String inData, String extInfo) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_SignDataWithExtraInfo(idCardNo, inData, extInfo);
  }
  
  public String SOF_SignData(String idCardNo, String inData) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_SignData(idCardNo, inData);
  }
  
  public String SOF_VerifySignedData(String certData, String inData, String signData) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_VerifySignedData(certData, inData, signData);
  }
  
  public String SOF_LoginWithAccountInfo(String sys, String accountType, String account, String password) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_LoginWithAccountInfo(sys, accountType, account, password);
  }
  
  public String SOF_GetCertInfoByType(String certData, int type) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_GetCertInfoByType(certData, type);
  }
  
  public String SOF_GetCertInfoByOid(String certData, String oid) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_GetCertInfoByOid(certData, oid);
  }
  
  public String SOF_GenRandom(int len) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_GenRandom(len);
  }
  
  
}

+ 481 - 0
business/base-service/src/main/java/com/yihu/jw/utils/Pkis/PKIServiceSoapBindingStub.java

@ -0,0 +1,481 @@
/**
 * PKIServiceSoapBindingStub.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils.Pkis;
public class PKIServiceSoapBindingStub extends org.apache.axis.client.Stub implements PKIService_PortType {
    private java.util.Vector cachedSerClasses = new java.util.Vector();
    private java.util.Vector cachedSerQNames = new java.util.Vector();
    private java.util.Vector cachedSerFactories = new java.util.Vector();
    private java.util.Vector cachedDeserFactories = new java.util.Vector();
    static org.apache.axis.description.OperationDesc [] _operations;
    static {
        _operations = new org.apache.axis.description.OperationDesc[8];
        _initOperationDesc1();
    }
    private static void _initOperationDesc1(){
        org.apache.axis.description.OperationDesc oper;
        org.apache.axis.description.ParameterDesc param;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("SOF_LoginAuthentication");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "certData"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "inData"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "signData"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "return"));
        oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        _operations[0] = oper;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("SOF_SignDataWithExtraInfo");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "idCardNo"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "inData"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "extInfo"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "return"));
        oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        _operations[1] = oper;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("SOF_VerifySignedData");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "certData"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "inData"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "signData"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "return"));
        oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        _operations[2] = oper;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("SOF_SignData");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "idCardNo"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "inData"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "return"));
        oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        _operations[3] = oper;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("SOF_LoginWithAccountInfo");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "sys"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "accountType"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "account"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "password"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "return"));
        oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        _operations[4] = oper;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("SOF_GetCertInfoByType");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "certData"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "type"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "return"));
        oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        _operations[5] = oper;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("SOF_GetCertInfoByOid");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "certData"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "oid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "return"));
        oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        _operations[6] = oper;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("SOF_GenRandom");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "len"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "return"));
        oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        _operations[7] = oper;
    }
    public PKIServiceSoapBindingStub() throws org.apache.axis.AxisFault {
         this(null);
    }
    public PKIServiceSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
         this(service);
         super.cachedEndpoint = endpointURL;
    }
    public PKIServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
        if (service == null) {
            super.service = new org.apache.axis.client.Service();
        } else {
            super.service = service;
        }
        ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
    }
    protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
        try {
            org.apache.axis.client.Call _call = super._createCall();
            if (super.maintainSessionSet) {
                _call.setMaintainSession(super.maintainSession);
            }
            if (super.cachedUsername != null) {
                _call.setUsername(super.cachedUsername);
            }
            if (super.cachedPassword != null) {
                _call.setPassword(super.cachedPassword);
            }
            if (super.cachedEndpoint != null) {
                _call.setTargetEndpointAddress(super.cachedEndpoint);
            }
            if (super.cachedTimeout != null) {
                _call.setTimeout(super.cachedTimeout);
            }
            if (super.cachedPortName != null) {
                _call.setPortName(super.cachedPortName);
            }
            java.util.Enumeration keys = super.cachedProperties.keys();
            while (keys.hasMoreElements()) {
                String key = (String) keys.nextElement();
                _call.setProperty(key, super.cachedProperties.get(key));
            }
            return _call;
        }
        catch (Throwable _t) {
            throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
        }
    }
    public String SOF_LoginAuthentication(String certData, String inData, String signData) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[0]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("SOF_LoginAuthentication");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://webservice.platform.jhsec.com.cn/", "SOF_LoginAuthentication"));
        setRequestHeaders(_call);
        setAttachments(_call);
 try {        Object _resp = _call.invoke(new Object[] {certData, inData, signData});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (String) _resp;
            } catch (Exception _exception) {
                return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }
    public String SOF_SignDataWithExtraInfo(String idCardNo, String inData, String extInfo) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[1]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("SOF_SignDataWithExtraInfo");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://webservice.platform.jhsec.com.cn/", "SOF_SignDataWithExtraInfo"));
        setRequestHeaders(_call);
        setAttachments(_call);
 try {        Object _resp = _call.invoke(new Object[] {idCardNo, inData, extInfo});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (String) _resp;
            } catch (Exception _exception) {
                return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }
    public String SOF_VerifySignedData(String certData, String inData, String signData) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[2]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("SOF_VerifySignedData");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://webservice.platform.jhsec.com.cn/", "SOF_VerifySignedData"));
        setRequestHeaders(_call);
        setAttachments(_call);
 try {        Object _resp = _call.invoke(new Object[] {certData, inData, signData});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (String) _resp;
            } catch (Exception _exception) {
                return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }
    public String SOF_SignData(String idCardNo, String inData) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[3]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("SOF_SignData");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://webservice.platform.jhsec.com.cn/", "SOF_SignData"));
        setRequestHeaders(_call);
        setAttachments(_call);
 try {        Object _resp = _call.invoke(new Object[] {idCardNo, inData});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (String) _resp;
            } catch (Exception _exception) {
                return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }
    public String SOF_LoginWithAccountInfo(String sys, String accountType, String account, String password) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[4]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("SOF_LoginWithAccountInfo");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://webservice.platform.jhsec.com.cn/", "SOF_LoginWithAccountInfo"));
        setRequestHeaders(_call);
        setAttachments(_call);
 try {        Object _resp = _call.invoke(new Object[] {sys, accountType, account, password});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (String) _resp;
            } catch (Exception _exception) {
                return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }
    public String SOF_GetCertInfoByType(String certData, int type) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[5]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("SOF_GetCertInfoByType");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://webservice.platform.jhsec.com.cn/", "SOF_GetCertInfoByType"));
        setRequestHeaders(_call);
        setAttachments(_call);
 try {        Object _resp = _call.invoke(new Object[] {certData, new Integer(type)});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (String) _resp;
            } catch (Exception _exception) {
                return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }
    public String SOF_GetCertInfoByOid(String certData, String oid) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[6]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("SOF_GetCertInfoByOid");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://webservice.platform.jhsec.com.cn/", "SOF_GetCertInfoByOid"));
        setRequestHeaders(_call);
        setAttachments(_call);
 try {        Object _resp = _call.invoke(new Object[] {certData, oid});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (String) _resp;
            } catch (Exception _exception) {
                return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }
    public String SOF_GenRandom(int len) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[7]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("SOF_GenRandom");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://webservice.platform.jhsec.com.cn/", "SOF_GenRandom"));
        setRequestHeaders(_call);
        setAttachments(_call);
 try {        Object _resp = _call.invoke(new Object[] {new Integer(len)});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (String) _resp;
            } catch (Exception _exception) {
                return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }
}

+ 19 - 0
business/base-service/src/main/java/com/yihu/jw/utils/Pkis/PKIService_PortType.java

@ -0,0 +1,19 @@
/**
 * PKIService_PortType.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils.Pkis;
public interface PKIService_PortType extends java.rmi.Remote {
    public String SOF_LoginAuthentication(String certData, String inData, String signData) throws java.rmi.RemoteException;
    public String SOF_SignDataWithExtraInfo(String idCardNo, String inData, String extInfo) throws java.rmi.RemoteException;
    public String SOF_SignData(String idCardNo, String inData) throws java.rmi.RemoteException;
    public String SOF_VerifySignedData(String certData, String inData, String signData) throws java.rmi.RemoteException;
    public String SOF_LoginWithAccountInfo(String sys, String accountType, String account, String password) throws java.rmi.RemoteException;
    public String SOF_GetCertInfoByType(String certData, int type) throws java.rmi.RemoteException;
    public String SOF_GetCertInfoByOid(String certData, String oid) throws java.rmi.RemoteException;
    public String SOF_GenRandom(int len) throws java.rmi.RemoteException;
}

+ 16 - 0
business/base-service/src/main/java/com/yihu/jw/utils/Pkis/PKIService_Service.java

@ -0,0 +1,16 @@
/**
 * PKIService_Service.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils.Pkis;
public interface PKIService_Service extends javax.xml.rpc.Service {
    public String getPKIServiceImplPortAddress();
    public PKIService_PortType getPKIServiceImplPort() throws javax.xml.rpc.ServiceException;
    public PKIService_PortType getPKIServiceImplPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
}

+ 142 - 0
business/base-service/src/main/java/com/yihu/jw/utils/Pkis/PKIService_ServiceLocator.java

@ -0,0 +1,142 @@
/**
 * PKIService_ServiceLocator.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils.Pkis;
public class PKIService_ServiceLocator extends org.apache.axis.client.Service implements PKIService_Service {
    public PKIService_ServiceLocator() {
    }
    public PKIService_ServiceLocator(org.apache.axis.EngineConfiguration config) {
        super(config);
    }
    public PKIService_ServiceLocator(String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
        super(wsdlLoc, sName);
    }
    // Use to get a proxy class for PKIServiceImplPort
    private String PKIServiceImplPort_address = "http://101.132.67.155:8080/pkis/services/v1";
    public String getPKIServiceImplPortAddress() {
        return PKIServiceImplPort_address;
    }
    // The WSDD service name defaults to the port name.
    private String PKIServiceImplPortWSDDServiceName = "PKIServiceImplPort";
    public String getPKIServiceImplPortWSDDServiceName() {
        return PKIServiceImplPortWSDDServiceName;
    }
    public void setPKIServiceImplPortWSDDServiceName(String name) {
        PKIServiceImplPortWSDDServiceName = name;
    }
    public PKIService_PortType getPKIServiceImplPort() throws javax.xml.rpc.ServiceException {
       java.net.URL endpoint;
        try {
            endpoint = new java.net.URL(PKIServiceImplPort_address);
        }
        catch (java.net.MalformedURLException e) {
            throw new javax.xml.rpc.ServiceException(e);
        }
        return getPKIServiceImplPort(endpoint);
    }
    public PKIService_PortType getPKIServiceImplPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
        try {
            PKIServiceSoapBindingStub _stub = new PKIServiceSoapBindingStub(portAddress, this);
            _stub.setPortName(getPKIServiceImplPortWSDDServiceName());
            return _stub;
        }
        catch (org.apache.axis.AxisFault e) {
            return null;
        }
    }
    public void setPKIServiceImplPortEndpointAddress(String address) {
        PKIServiceImplPort_address = address;
    }
    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (PKIService_PortType.class.isAssignableFrom(serviceEndpointInterface)) {
                PKIServiceSoapBindingStub _stub = new PKIServiceSoapBindingStub(new java.net.URL(PKIServiceImplPort_address), this);
                _stub.setPortName(getPKIServiceImplPortWSDDServiceName());
                return _stub;
            }
        }
        catch (Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        if (portName == null) {
            return getPort(serviceEndpointInterface);
        }
        String inputPortName = portName.getLocalPart();
        if ("PKIServiceImplPort".equals(inputPortName)) {
            return getPKIServiceImplPort();
        }
        else  {
            java.rmi.Remote _stub = getPort(serviceEndpointInterface);
            ((org.apache.axis.client.Stub) _stub).setPortName(portName);
            return _stub;
        }
    }
    public javax.xml.namespace.QName getServiceName() {
        return new javax.xml.namespace.QName("http://webservice.platform.jhsec.com.cn/", "PKIService");
    }
    private java.util.HashSet ports = null;
    public java.util.Iterator getPorts() {
        if (ports == null) {
            ports = new java.util.HashSet();
            ports.add(new javax.xml.namespace.QName("http://webservice.platform.jhsec.com.cn/", "PKIServiceImplPort"));
        }
        return ports.iterator();
    }
    /**
    * Set the endpoint address for the specified port name.
    */
    public void setEndpointAddress(String portName, String address) throws javax.xml.rpc.ServiceException {
        
if ("PKIServiceImplPort".equals(portName)) {
            setPKIServiceImplPortEndpointAddress(address);
        }
        else 
{ // Unknown Port Name
            throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
        }
    }
    /**
    * Set the endpoint address for the specified port name.
    */
    public void setEndpointAddress(javax.xml.namespace.QName portName, String address) throws javax.xml.rpc.ServiceException {
        setEndpointAddress(portName.getLocalPart(), address);
    }
}

+ 18 - 15
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -1996,9 +1996,9 @@ public class ImService {
			WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionVO.getOutpatientId());
			if (wlyyOutpatientDO.getOutpatientType()!=null){
				if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1")&&wlyyOutpatientDO.getType().equalsIgnoreCase("1")){
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "24", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS),"1");
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "24", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS),"1",null);
				}else if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1")&&wlyyOutpatientDO.getType().equalsIgnoreCase("2")){
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_16", "24", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS),"1");
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_16", "24", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS),"1",null);
				}
			}
		}
@ -2014,9 +2014,9 @@ public class ImService {
			WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionVO.getOutpatientId());
			if (wlyyOutpatientDO.getOutpatientType()!=null){
				if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1")&&wlyyOutpatientDO.getType().equalsIgnoreCase("1")){
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "27", JSON.toJSONString(object),"1");
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "27", JSON.toJSONString(object),"1",null);
				}else if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1")&&wlyyOutpatientDO.getType().equalsIgnoreCase("2")){
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_16", "27", JSON.toJSONString(object),"1");
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_16", "27", JSON.toJSONString(object),"1",null);
				}
			}
		}
@ -2042,7 +2042,7 @@ public class ImService {
//			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_9", "31",jsonObject.toString(),"1");
//		}else
		if("2".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_12", "31",jsonObject.toString(),"1");
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_12", "31",jsonObject.toString(),"1",null);
		}else{
			return null;
		}
@ -2056,7 +2056,7 @@ public class ImService {
	 * @throws Exception
	 */
	public String sendOutPatientSuggestMsg(String msg,String doctor,String doctorName,String sessionid) throws Exception {
		return imUtil.sendImMsg(doctor, doctorName, sessionid, "34",msg,"1");
		return imUtil.sendImMsg(doctor, doctorName, sessionid, "34",msg,"1",null);
	}
	
	
@ -2072,9 +2072,9 @@ public class ImService {
	 */
	public String pushPrescriptionBackMsg(com.alibaba.fastjson.JSONObject jsonObject,String doctor,String doctorName,String outpatientId,String patient,String outpatientType) throws Exception {
		if("1".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_9", "33",jsonObject.toString(),"1");
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_9", "33",jsonObject.toString(),"1",null);
		}else if("2".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_12", "33",jsonObject.toString(),"1");
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_12", "33",jsonObject.toString(),"1",null);
		}else{
			return null;
		}
@ -2092,9 +2092,9 @@ public class ImService {
	 */
	public String sendOutPatientPayMsg(com.alibaba.fastjson.JSONObject jsonObject,String doctor,String doctorName,String outpatientId,String patient,String outpatientType) throws Exception {
		if("1".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_9", "35",jsonObject.toString(),"1");
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_9", "35",jsonObject.toString(),"1",null);
		}else if("2".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_12", "35",jsonObject.toString(),"1");
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_12", "35",jsonObject.toString(),"1",null);
		}else{
			return null;
		}
@ -2140,7 +2140,8 @@ public class ImService {
					"d.id as \"patientId\"," +
					"d.idcard as \"patientIdcard\"," +
					"d.sex as \"patientSex\"," +
					"d.photo AS \"patientPhoto\" " +
					"d.photo AS \"patientPhoto\", " +
					"b.doctor as \"doctor\"  "+
					"FROM wlyy_consult a," +
					"wlyy_consult_team b," +
					"base_patient d " +
@ -2172,7 +2173,8 @@ public class ImService {
					"op.type as \"consultType\"," +
					"op.general_doctor as \"generalDoctor\"," +
					"op.icd10_name as \"icd10Name\"," +
					"d.photo AS \"patientPhoto\" " +
					"d.photo AS \"patientPhoto\" , " +
					"b.doctor as \"doctor\"  "+
					"FROM wlyy_consult_team b," +
					"base_patient d," +
					"wlyy_consult a   " +
@ -2406,8 +2408,8 @@ public class ImService {
	 * @param business_type
	 * @return
	 */
	public String patientGuaidenceAppend(String sender_id, String sender_name, String session_id,String content_type, String content, String business_type)throws Exception  {
		return imUtil.sendImMsg(sender_id, sender_name,session_id, content_type, content, "1");
	public String patientGuaidenceAppend(String sender_id, String sender_name, String session_id,String content_type, String content, String business_type,String extend)throws Exception  {
		return imUtil.sendImMsg(sender_id, sender_name,session_id, content_type, content, "1",extend);
	}
	
	/**
@ -3088,11 +3090,12 @@ public class ImService {
	 * @param cancleContent
	 * @return
	 */
	public String sendOutPatientCancle(String patientName,String patientCode,String doctor,String cancleReason, String cancleContent) {
	public String sendOutPatientCancle(String patientName,String patientCode,String doctor,String cancleReason, String cancleContent,String outPatientId) {
		JSONObject msg = new JSONObject();
		msg.put("content",patientName+",您好!您的复诊已被医生取消");
		msg.put("cancleReason",cancleReason);
		msg.put("cancleContent",cancleContent);
		msg.put("outPatientId",outPatientId);
		logger.info("开始发送"+msg.toJSONString());
		return imUtil.sendMessage(doctor,patientCode,"2",msg.toString());
	}

+ 2 - 1
business/im-service/src/main/java/com/yihu/jw/im/util/ImUtil.java

@ -254,7 +254,7 @@ public class ImUtil {
	 * @param contentType 1文字 2图片消息
	 * @param content     内容
	 */
	public String sendImMsg(String from, String fromName, String sessionId, String contentType, String content, String businessType) {
	public String sendImMsg(String from, String fromName, String sessionId, String contentType, String content, String businessType,String extend) {
		String imAddr = im_host + "api/v2/sessions/" + sessionId + "/messages";
		System.out.println("im地址"+imAddr);
		JSONObject params = new JSONObject();
@ -264,6 +264,7 @@ public class ImUtil {
		params.put("content", content);
		params.put("session_id", sessionId);
		params.put("business_type", businessType);
		params.put("extend",extend);
		String response = HttpClientUtil.postBody(imAddr, params);
		return response;
	}

+ 3 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -25,7 +25,9 @@ public abstract class IntegerIdentityEntity implements Serializable {
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
/*   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
/*
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 1 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java

@ -619,4 +619,5 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
    public void setOnline(String online) {
        this.online = online;
    }
}

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorMessageDO.java

@ -22,6 +22,7 @@ public class BaseDoctorMessageDO extends UuidIdentityEntityWithOperator {
    private String content;
    private String contentDesc;
    private Integer isSort;
    private String extend;
    private Integer del;
    @Column(name = "doctor")
@ -86,4 +87,13 @@ public class BaseDoctorMessageDO extends UuidIdentityEntityWithOperator {
    public void setDel(Integer del) {
        this.del = del;
    }
    @Column(name = "extend")
    public String getExtend() {
        return extend;
    }
    public void setExtend(String extend) {
        this.extend = extend;
    }
}

+ 15 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDO.java

@ -2,7 +2,7 @@ package com.yihu.jw.entity.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@ -263,6 +263,11 @@ public class WlyyPrescriptionDO extends UuidIdentityEntity {
     */
    private Integer payType;
    /**
     * 是否签名
     */
    private Integer signFlag;
    @Column(name = "outpatient_id")
    public String getOutpatientId() {
        return outpatientId;
@ -652,4 +657,13 @@ public class WlyyPrescriptionDO extends UuidIdentityEntity {
    public void setPayType(Integer payType) {
        this.payType = payType;
    }
    @Column(name = "sign_flag")
    public Integer getSignFlag() {
        return signFlag;
    }
    public void setSignFlag(Integer signFlag) {
        this.signFlag = signFlag;
    }
}

+ 64 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionSignDO.java

@ -0,0 +1,64 @@
package com.yihu.jw.entity.hospital.prescription;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* 处方签名记录
*
* @author wangzhinan 20200518
*
*/
@Entity
@Table(name = "wlyy_prescription_sign")
public class WlyyPrescriptionSignDO extends UuidIdentityEntityWithOperator {
    private String prescriptionId;
    private String signData;
    private String signResult;
    private String certData;
    private String relationCode;
    public String getPrescriptionId() {
        return prescriptionId;
    }
    public void setPrescriptionId(String prescriptionId) {
        this.prescriptionId = prescriptionId;
    }
    public String getSignData() {
        return signData;
    }
    public void setSignData(String signData) {
        this.signData = signData;
    }
    public String getSignResult() {
        return signResult;
    }
    public void setSignResult(String signResult) {
        this.signResult = signResult;
    }
    public String getCertData() {
        return certData;
    }
    public void setCertData(String certData) {
        this.certData = certData;
    }
    public String getRelationCode() {
        return relationCode;
    }
    public void setRelationCode(String relationCode) {
        this.relationCode = relationCode;
    }
}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkMsYj02DO.java

@ -46,7 +46,7 @@ public class YkMsYj02DO {
        return ylxh;
    }
    public void setYlxh(Integer ylx) {
    public void setYlxh(Integer ylxh) {
        this.ylxh = ylxh;
    }
    @Basic

+ 92 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/suggest/BaseSuggestionDO.java

@ -5,6 +5,7 @@ import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
 * Created by wj on 2020/0811.
@ -50,6 +51,97 @@ public class BaseSuggestionDO extends UuidIdentityEntityWithOperator {
     */
    @Column(name = "is_del")
    private Integer  isDel;
    /*
     *状态图 1回复 0未回复
     */
    @Column(name = "suggest_status")
    private Integer  suggestStatus;
    /*
     *回复内容
     */
    @Column(name = "manager_res")
    private String  managerRes;
    /*
     *回复人id
     */
    @Column(name = "res_user")
    private String  resUser;
    /*
     *回复人名称
     */
    @Column(name = "res_user_name")
    private String  resUserName;
    /*
     *用户客户端
     */
    @Column(name = "user_client")
    private String  userClient;
    /*
     *建议名称
     */
    @Transient
    private String  suggestName;
    /*
     *用户类型
     */
    @Column(name = "user_type")
    private String  userType;
    public String getUserType() {
        return userType;
    }
    public void setUserType(String userType) {
        this.userType = userType;
    }
    @Transient
    public String getSuggestName() {
        return suggestName;
    }
    public void setSuggestName(String suggestName) {
        this.suggestName = suggestName;
    }
    public Integer getSuggestStatus() {
        return suggestStatus;
    }
    public void setSuggestStatus(Integer suggestStatus) {
        this.suggestStatus = suggestStatus;
    }
    public String getManagerRes() {
        return managerRes;
    }
    public void setManagerRes(String managerRes) {
        this.managerRes = managerRes;
    }
    public String getResUser() {
        return resUser;
    }
    public void setResUser(String resUser) {
        this.resUser = resUser;
    }
    public String getResUserName() {
        return resUserName;
    }
    public void setResUserName(String resUserName) {
        this.resUserName = resUserName;
    }
    public String getUserClient() {
        return userClient;
    }
    public void setUserClient(String userClient) {
        this.userClient = userClient;
    }
    public String getSuggestId() {
        return suggestId;

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

@ -1029,6 +1029,7 @@ public class BaseHospitalRequestMapping {
        public static final String findZtmxByid = "/findZtmxByid";
        public static final String findZlxm = "/findZlxm";
        public static final String findZlxmMx = "/findZlxmMx";
        public static final String getPrevious = "/getPrevious";
    }
@ -1213,6 +1214,30 @@ public class BaseHospitalRequestMapping {
        public static final String selectMessageById = "/selectMessageById";
    }
    /**
     * 反馈建议
     */
    public static class suggestion extends Basic{
        public static final String suggestionManage  = "/suggestionManage";
        public static final String findSuggestionByType  = "/findSuggestionByType";
        public static final String delSuggestion  = "/delSuggestion";;
        public static final String saveSuggestion  = "/saveSuggestion";
        public static final String responseSuggestion  = "/responseSuggestion";
        public static final String findSuggestionById  = "/findSuggestionById";
    }
    /**
     * 反馈建议类型
     */
    public static class suggestionDict extends Basic{
        public static final String suggestionDictManage  = "/suggestionDictManage";
        public static final String findSuggestionType  = "/findSuggestionType";
        public static final String delSuggestionType = "/delSuggestionType";;
        public static final String saveSuggestionType  = "/saveSuggestionType";
        public static final String updateSuggestionType  = "/updateSuggestionType";
        public static final String upSuggestionType  = "/upSuggestionType";
        public static final String downSuggestionType  = "/downSuggestionType";
    }
    /**

+ 4 - 5
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -2,17 +2,16 @@ package com.yihu.jw.security.oauth2.provider.endpoint;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.restmodel.ResultStatus;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.security.core.userdetails.jdbc.WlyyUserDetailsService;
import com.yihu.jw.security.dao.OauthKeypairDao;
import com.yihu.jw.security.dao.doctor.BaseDoctorDao;
import com.yihu.jw.security.dao.patient.BasePatientDao;
import com.yihu.jw.security.exception.ImgCaptchaException;
import com.yihu.jw.security.login.service.BaseLoginLogService;
@ -52,11 +51,11 @@ import org.springframework.security.oauth2.provider.request.DefaultOAuth2Request
import org.springframework.security.oauth2.provider.request.DefaultOAuth2RequestValidator;
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;
import org.springframework.util.*;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import sun.misc.BASE64Encoder;
import javax.annotation.PostConstruct;
import javax.imageio.ImageIO;
@ -74,7 +73,6 @@ import java.security.interfaces.RSAPublicKey;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import sun.misc.BASE64Encoder;
/**
 *
@ -136,6 +134,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    private YkyyService ykyyService;
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    @PostConstruct
    private void init() {
@ -254,7 +254,6 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        baseLoginLogDO.setUserAgent(userAgent);
        baseLoginLogDO.setLoginType(loginType);
        baseLoginLogService.save(baseLoginLogDO);
        return getResponse(wlyyUserSimple);
    }

+ 7 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -87,6 +87,8 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    @Autowired
    private DictDoctorDutyService dictDoctorDutyService;
    @Autowired
    private DictHospitalDeptDao dictHospitalDeptDao;
    @Value("${wechat.flag}")
    private boolean flag;
@ -497,6 +499,11 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                         hospitalIdList.remove(baseDoctorHospitalDO.getId());
                     }
                     baseDoctorHospitalDO.setDoctorCode(baseDoctorDO.getId());
                     String deptCode = baseDoctorHospitalDO.getDeptCode();
                     DictHospitalDeptDO dictHospitalDeptDO = dictHospitalDeptDao.findByCode(deptCode);
                     if (dictHospitalDeptDO!=null){
                         baseDoctorHospitalDO.setDeptName(dictHospitalDeptDO.getName());
                     }
                     baseDoctorHospitalService.save(baseDoctorHospitalDO);
                 }
             } catch (IOException e) {

+ 38 - 8
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/OutPatientRemindJob.java

@ -1,16 +1,23 @@
package com.yihu.jw.job;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.util.date.DateUtil;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import java.util.Date;
import java.util.List;
/**
@ -22,22 +29,45 @@ public class OutPatientRemindJob implements Job {
    public ImUtil imUtil;
    @Autowired
    private OutpatientDao outpatientDao;
    @Autowired
    private PrescriptionService prescriptionService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Value("${wechat.id}")
    private String wxId;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        List<WlyyOutpatientDO> wlyyOutpatientDOS= outpatientDao.findWaitingOutpatient();
        String senderId ="";
        String reciverId = "";
        long timeCount = 0l;
        String content = "您邀请的医师暂无应答,您可以选择继续等待或者取消邀请。";
        logger.info("---本次要发送的消息数量+"+wlyyOutpatientDOS.size());
        JSONObject object = new JSONObject();
        object.put("socket_sms_type",14);
        object.put("msg",content);
        object.put("msg_time", DateUtil.dateToStrLong(new Date()));
        if (null!=wlyyOutpatientDOS){
            for (WlyyOutpatientDO wlyyOutpatientDO:wlyyOutpatientDOS){
                logger.info("--便利发送消息");
                senderId = wlyyOutpatientDO.getPatient();
                logger.info("---发送人id"+senderId);
                reciverId = wlyyOutpatientDO.getDoctor();
                logger.info("---接受人Id"+reciverId);
                imUtil.sendMessage(senderId,reciverId,"1",content);
                logger.info("--发送结束");
                long patientTime = wlyyOutpatientDO.getCreateTime().getTime();
                logger.info("接诊创建时间="+patientTime);
                List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findByDictName("outpatient_timeout_remind");
                if (wlyyHospitalSysDictDOS.size()>0){
                    timeCount = Long.valueOf(wlyyHospitalSysDictDOS.get(0).getDictValue());
                }
                long currentTime = new Date().getTime();
                logger.info("当前时间="+currentTime);
                logger.info("数据库配置时间=0"+timeCount);
                if (currentTime-patientTime>timeCount*60*1000){
                    logger.info("--便利发送消息");
                    reciverId = wlyyOutpatientDO.getPatient();
                    logger.info("---发送人id"+senderId);
                    senderId= wlyyOutpatientDO.getDoctor();
                    logger.info("---接受人Id"+reciverId);
                    imUtil.sendMessage(senderId,reciverId,"1",object.toString());
                    logger.info("--发送结束");
                    logger.info("--模板发送开始");
                    prescriptionService.sendWxTemplateMsg(wxId,wlyyOutpatientDO.getId(),null,null,"outPatientTimeOutRemind","");
                }
            }
        }

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

@ -1,7 +1,9 @@
package com.yihu.jw.web.quota;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.job.QuartzJobConfig;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.internet.service.DataGeneratorService;
import com.yihu.jw.internet.service.InternetCommonService;
@ -62,6 +64,8 @@ public class JobController extends BaseController {
    private WxTemplateService wxTemplateService;
    @Autowired
    private QuartzJobConfigDao wlyyJobConfigDao;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    public JobController(JobService jobService, QuartzHelper quartzHelper) {
@ -193,12 +197,12 @@ public class JobController extends BaseController {
                case "out_patient_remind_job":
                    //互联网医院 待结算消息推送
                    if (!quartzHelper.isExistJob("out_patient_remind_job")) {
                        QuartzJobConfig quartzJobConfig = wlyyJobConfigDao.findById("18");
                        List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findByDictName("out_patient_remind_job");
                        String trigger = "";
                        if (quartzJobConfig.getQuartzCron()==null){
                            trigger = SystemConf.getInstance().getSystemProperties().getProperty("out_patient_remind_job");
                        if (wlyyHospitalSysDictDOS.size()>0){
                            trigger = wlyyHospitalSysDictDOS.get(0).getDictValue();
                        }else {
                            trigger = quartzJobConfig.getQuartzCron();
                            trigger = SystemConf.getInstance().getSystemProperties().getProperty("out_patient_remind_job");
                        }
                        quartzHelper.addJob(OutPatientRemindJob.class, trigger, "out_patient_remind_job", new HashMap<String, Object>());
                        logger.info("out_patient_remind_job  job success");

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

@ -11,6 +11,7 @@ import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionEmrDO;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.XzyyPrescriptionService;
@ -558,7 +559,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
							logger.info("结束咨询成功!");
						}
					}
					String immsg = imService.sendOutPatientCancle(patientName,patientCode,doctor,cancelRemark,cancelValue);
					String immsg = imService.sendOutPatientCancle(patientName,patientCode,doctor,cancelRemark,cancelValue,outPatientId);
					System.out.println("发送拒绝接诊消息成功:"+immsg);
				}
			}
@ -984,4 +985,14 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		objEnvelop.setObj(array);
		return objEnvelop;
	}
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.getPrevious)
	@ApiOperation(value = "查询病人的电子病历", notes = "查询病人的电子病历")
	public ObjEnvelop findPatientEmr(@ApiParam(name = "patientId", value = "patientId")
								 @RequestParam(value = "patientId", required = true)String patientId)throws Exception {
		List<WlyyPrescriptionEmrDO> array= ykyyEntranceService.getPrevious(patientId);
		ObjEnvelop objEnvelop = new ObjEnvelop();
		objEnvelop.setObj(array);
		return objEnvelop;
	}
}

+ 3 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -775,6 +775,8 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "content_type", required = true) String content_type,
			@ApiParam(name = "content", value = "消息内容", defaultValue = "")
			@RequestParam(value = "content", required = true) String content,
			@ApiParam(name = "extend", value = "扩展内容", defaultValue = "")
			@RequestParam(value = "extend", required = false) String extend,
			@ApiParam(name = "type", value = "咨询type", defaultValue = "")
			@RequestParam(value = "type", required = false) String type,
			@ApiParam(name = "times", value = "times", defaultValue = "")
@ -831,7 +833,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			}
		}
		session_id = imService.getPatientGuaidenceConsult(sender_id,session_id,type);
		String result = imService.patientGuaidenceAppend(sender_id,sender_name,session_id,content_type,content,"1");
		String result = imService.patientGuaidenceAppend(sender_id,sender_name,session_id,content_type,content,"1",extend);
		List<BaseDoctorRoleDO> doctorRoleDOS = doctorRoleDao.findByRoleCode("guidance");
		for (BaseDoctorRoleDO doctorRoleDO:doctorRoleDOS){
			System.out.println("发送外层SOCKET消息:通知医生导诊");

+ 83 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseSuggestionController.java

@ -0,0 +1,83 @@
package com.yihu.jw.hospital.endpoint.hospital;
import com.yihu.jw.entity.base.doctor.BaseDoctorBackgroundDO;
import com.yihu.jw.entity.hospital.message.BaseBannerDO;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDO;
import com.yihu.jw.hospital.suggest.service.BaseSuggestionService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.suggestion.suggestionManage)
@Api(value = "反馈建议", description = "反馈建议", tags = {"互联网医院 - 反馈建议"})
public class BaseSuggestionController extends EnvelopRestEndpoint {
    @Autowired
    private BaseSuggestionService baseSuggestionService;
    @ApiOperation("查询反馈建议")
    @PostMapping(value= BaseHospitalRequestMapping.suggestion.findSuggestionByType)
    public MixEnvelop findSuggestionByType(@ApiParam(name = "type", value = "类型id", required = false)
                                @RequestParam(value = "type", required = false)String type,
                                           @ApiParam(name = "userId", value = "发送者id", required = false)
                                           @RequestParam(value = "userId", required = false)String userId,
                               @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
                            @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                               @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                            @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        MixEnvelop mixEnvelop=baseSuggestionService.findSuggestionByType(type,userId,page,pageSize);
        return mixEnvelop;
    }
    @PostMapping(value= BaseHospitalRequestMapping.suggestion.saveSuggestion)
    @ApiOperation("新增反馈建议")
    public Envelop saveSuggestion(
            @ApiParam(name = "json", value = "Json数据", required = true)
            @RequestParam(value = "json", required = false)String json)throws Exception{
        BaseSuggestionDO baseSuggestionDO = toEntity(json, BaseSuggestionDO.class);
        BaseSuggestionDO result = baseSuggestionService.createSuggestion(baseSuggestionDO);
        if (null == result){
            return failed("新增失败");
        }
        return success("新增成功");
    }
    @PostMapping(value= BaseHospitalRequestMapping.suggestion.responseSuggestion)
    @ApiOperation("回复反馈建议")
    public Envelop responseSuggestion(
            @ApiParam(name = "id", value = "建议id", required = true)
    @RequestParam(value = "id", required = true)String id,
            @ApiParam(name = "content", value = "回复内容", required = true)
            @RequestParam(value = "content", required = false)String content,
            @ApiParam(name = "userId", value = "回复人id", required = true)
            @RequestParam(value = "userId", required = false)String userId)throws Exception{
        if (!StringUtils.isNoneBlank(userId)){
            userId= getUID();
        }
        String userName = getUNAME();
        baseSuggestionService.reponseSuggestion(id,content,userId,userName);
        return success("回复成功");
    }
    @PostMapping(value= BaseHospitalRequestMapping.suggestion.findSuggestionById)
    @ApiOperation("回复反馈建议")
    public Envelop findSuggestionById(
            @ApiParam(name = "id", value = "建议id", required = true)
            @RequestParam(value = "id", required = true)String id) {
        BaseSuggestionDO baseSuggestionDO = baseSuggestionService.findSuggestionById(id);
        return success(baseSuggestionDO);
    }
}

+ 120 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseSuggestionDictController.java

@ -0,0 +1,120 @@
package com.yihu.jw.hospital.endpoint.hospital;
import com.yihu.jw.entity.hospital.message.BaseBannerDO;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDO;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDictDO;
import com.yihu.jw.hospital.suggest.service.BaseSuggestionDictService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.suggestionDict.suggestionDictManage)
@Api(value = "反馈建议类型", description = "反馈建议类型", tags = {"互联网医院 - 反馈建议类型"})
public class BaseSuggestionDictController extends EnvelopRestEndpoint {
    @Autowired
    private BaseSuggestionDictService baseSuggestionDictService;
    @ApiOperation("查询反馈建议类型")
    @PostMapping(value= BaseHospitalRequestMapping.suggestionDict.findSuggestionType)
    public MixEnvelop findSuggestionByType(@ApiParam(name = "name", value = "类型名称", required = false)
                                           @RequestParam(value = "name", required = false)String name,
                                           @ApiParam(name = "des", value = "类型描述", required = false)
                                           @RequestParam(value = "des", required = false)String des,
                                           @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
                                           @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                                           @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                                           @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        MixEnvelop mixEnvelop=baseSuggestionDictService.findByNameAndDes(name,des,page,pageSize);
        return mixEnvelop;
    }
    @PostMapping(value= BaseHospitalRequestMapping.suggestionDict.saveSuggestionType)
    @ApiOperation("新增反馈建议类型")
    public Envelop saveSuggestionType(
            @ApiParam(name = "json", value = "Json数据", required = true)
            @RequestParam(value = "json", required = false)String json)throws Exception{
        BaseSuggestionDictDO baseSuggestionDO = toEntity(json, BaseSuggestionDictDO.class);
        BaseSuggestionDictDO result = baseSuggestionDictService.createSuggestionType(baseSuggestionDO);
        if (null == result){
            return failed("新增失败");
        }
        return success("新增成功");
    }
    @GetMapping(value= BaseHospitalRequestMapping.suggestionDict.delSuggestionType  )
    @ApiOperation("删除反馈建议类型")
    public Envelop delSuggestionType(
            @ApiParam(name = "id", value = "建议id", required = true)
            @RequestParam(value = "id", required = true)String id)throws Exception{
        boolean flag = baseSuggestionDictService.deleteSuggest(id);
        if (true==flag){
            return success("删除成功");
        }else {
            return failed("删除失败");
        }
    }
    @PostMapping(value= BaseHospitalRequestMapping.suggestionDict.updateSuggestionType)
    @ApiOperation("更新建议类型")
    public Envelop updateSuggestionType(
            @ApiParam(name = "id", value = "id", required = true)
            @RequestParam(value = "id", required = true)String id,
            @ApiParam(name = "suggestName", value = "suggestName", required = false)
            @RequestParam(value = "suggestName", required = false)String suggestName,
            @ApiParam(name = "suggestDes", value = "suggestDes", required = false)
            @RequestParam(value = "suggestDes", required = false)String suggestDes,
            @ApiParam(name = "updateUser", value = "updateUser", required = false)
            @RequestParam(value = "updateUser", required = false)String updateUser)throws Exception {
        if (!StringUtils.isNoneBlank(updateUser)){
            updateUser = getUID();
        }
        String updateUserName = getUNAME();
        BaseSuggestionDictDO result = baseSuggestionDictService.updateSuggest(id,suggestName,suggestDes,updateUser,updateUserName);
        if (null == result) {
            return failed("更新失败,礼物不存在");
        }
        return success("更新成功");
    }
    @GetMapping(value= BaseHospitalRequestMapping.suggestionDict.upSuggestionType)
    @ApiOperation("上移")
    public Envelop upBanner(@ApiParam(name = "id", value = "id", required = true)
                            @RequestParam(value = "id", required = true)String id){
        BaseSuggestionDictDO baseSuggestionDictDO = new BaseSuggestionDictDO();
        String erroMessage = null;
        try {
            baseSuggestionDictDO = baseSuggestionDictService.upSuggestion(id);
        } catch (Exception e) {
            erroMessage = e.getMessage();
        }
        if (org.apache.commons.lang.StringUtils.isNotEmpty(erroMessage)){
            return failed("上移失败"+erroMessage);
        }else {
            return success("上移成功");
        }
    }
    @GetMapping(value= BaseHospitalRequestMapping.suggestionDict.downSuggestionType)
    @ApiOperation("下移")
    public Envelop downBanner(@ApiParam(name = "id", value = "id", required = true)
                              @RequestParam(value = "id", required = true)String id){
        BaseSuggestionDictDO baseSuggestionDictDO = new BaseSuggestionDictDO();
        String erroMessage = null;
        try {
            baseSuggestionDictDO = baseSuggestionDictService.downSuggestion(id);
        } catch (Exception e) {
            erroMessage = e.getMessage();
        }
        if (org.apache.commons.lang.StringUtils.isNotEmpty(erroMessage)){
            return failed("下移失败"+erroMessage);
        }else {
            return success("下移成功");
        }
    }
}

+ 2 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

@ -240,7 +240,7 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
					object.put("title",knowledgeArticleDO.getTitle());
					object.put("content",knowledgeArticleDO.getIntro());
					object.put("img",knowledgeArticleDO.getImage());
					imUtil.sendImMsg(patientBusinessDO.getDoctor(), patientBusinessDO.getDoctorName(), patientBusinessDO.getSessionId(), "4", object.toJSONString(),"1");
					imUtil.sendImMsg(patientBusinessDO.getDoctor(), patientBusinessDO.getDoctorName(), patientBusinessDO.getSessionId(), "4", object.toJSONString(),"1",null);
				}else {
					WlyySurveyUserDO wlyySurveyUserDO = new WlyySurveyUserDO();
					String doctor = patientBusinessDO.getDoctor();
@ -264,7 +264,7 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
						object.put("content",wlyySurveyTemplateDO.getTemplateComment());
						object.put("id",wlyySurveyTemplateDO.getId());
					}
					imUtil.sendImMsg(patientBusinessDO.getDoctor(), patientBusinessDO.getDoctorName(), patientBusinessDO.getSessionId(), "17", object.toJSONString(),"1");
					imUtil.sendImMsg(patientBusinessDO.getDoctor(), patientBusinessDO.getDoctorName(), patientBusinessDO.getSessionId(), "17", object.toJSONString(),"1",null);
				}
			}