Browse Source

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

wangzhinan 1 year ago
parent
commit
97e0b0611c

+ 10 - 18
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/DsyyPrescriptionService.java

@ -8,46 +8,38 @@ import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
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.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.entrance.DsyyEntranceService;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.network.HttpResponse;
import com.yihu.jw.util.network.HttpUtils;
import com.yihu.jw.utils.WebserviceUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import net.sf.json.xml.XMLSerializer;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
@Transactional
@ -91,8 +83,8 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     * @param patient 居民id
     * @return
     */
    public List<WlyyOutpatientVO> selectOutpatientList(String patient, String startTime, String endTime,String ksdm,String cardNo) throws Exception {
        return dsyyEntranceService.selectOutpatientList(patient,startTime,endTime,ksdm,cardNo);
    public List<WlyyOutpatientVO> selectOutpatientList(String patient, String startTime, String endTime,boolean demoFlag,String ksdm,String cardNo) throws Exception {
        return dsyyEntranceService.selectOutpatientList(patient,startTime,endTime,demoFlag,ksdm,cardNo);
    }
    /**
     * 获取单条门诊就诊记录

+ 134 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/DsyyEntranceService.java

@ -25,6 +25,7 @@ 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.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.entrance.util.ConvertUtil;
import com.yihu.jw.oauth.OauthRsaKeyDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
@ -47,12 +48,18 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
 * 第三医院内网his对接服务
@ -122,7 +129,6 @@ public class DsyyEntranceService {
    @Autowired
    private OauthCaConfigDao oauthCaConfigDao;
    private static String key="bvvsf3JA0mUXMU+mVnMaOQ==";
    private static String caKey = "bvvsf3JA0mUXMU+mVnMaOQ==";
@ -497,13 +503,139 @@ public class DsyyEntranceService {
        }
    }
    /**
     * 获取本地示例返参
     *
     * @param fid 服务id
     * @return
     * @throws Exception
     */
    public String getJosnFileResullt(String fid) throws Exception {
        String contentStr = null;
        Resource resource = new ClassPathResource("mqConfig/mqdata/" + fid + ".json");
        if (resource.exists()) {
            InputStream is = resource.getInputStream();
            contentStr = new BufferedReader(new InputStreamReader(is, "utf-8"))
                    .lines().collect(Collectors.joining(System.lineSeparator()));
//            contentStr =  replaceSpecialStr(contentStr);
        } else {
            throw new Exception("文件不存在");
        }
        return contentStr;
    }
    public List<WlyyOutpatientVO> BS30025_demo(String PAT_NO, String conNo, String startTime, String endTime ,String ksdm) throws Exception {
        System.out.println("ksdm="+ksdm);
        String fid = "BS30025";
        logger.info("EntranceService " + fid + " PAT_NO :" + PAT_NO + " conNo:" + conNo + " startTime:" + startTime + " endTime:" + endTime);
        String resp = "";
        String orgCode = "350211A1002";
        String orgName = "厦门大学附属中山医院";
        resp = getJosnFileResullt(fid);
        net.sf.json.JSONArray jsonArray = ConvertUtil.convertListEnvelopInRow(resp);
        if (null == jsonArray) {
            return null;        }
        List<WlyyOutpatientVO> wlyyOutpatientVOS = new ArrayList<>();
        WlyyOutpatientVO wlyyOutpatientVO;
        for (Object object : jsonArray) {
            net.sf.json.JSONObject jsonObjectMgsInfo = (net.sf.json.JSONObject) object;
            if (null != jsonObjectMgsInfo) {
                wlyyOutpatientVO = new WlyyOutpatientVO();
                //中山医院固定入参
                wlyyOutpatientVO.setHospital(orgCode);
                wlyyOutpatientVO.setHospitalName(orgName);
                wlyyOutpatientVO.setWinNo("6");
                wlyyOutpatientVO.setAdmNo(null == jsonObjectMgsInfo.get("ADM_NO") ? "" : jsonObjectMgsInfo.get("ADM_NO") + "");
                wlyyOutpatientVO.setRegisterNo(null == jsonObjectMgsInfo.get("REGISTER_SN") ? "" : jsonObjectMgsInfo.get("REGISTER_SN") + "");
                wlyyOutpatientVO.setDept(null == jsonObjectMgsInfo.get("ADM_SPEC") ? "" : jsonObjectMgsInfo.get("ADM_SPEC") + "");
                wlyyOutpatientVO.setDeptName(null == jsonObjectMgsInfo.get("ADM_SPEC_NAME") ? "" : jsonObjectMgsInfo.get("ADM_SPEC_NAME") + "");
                String patNo = null != jsonObjectMgsInfo.get("PAT_NO") ? jsonObjectMgsInfo.get("PAT_NO").toString() : "";
                String patientName = null != jsonObjectMgsInfo.get("PAT_NAME") ? jsonObjectMgsInfo.get("PAT_NAME").toString() : "";
                PatientMappingDO patientMappingDo = new PatientMappingDO();
                if (StringUtils.isNotBlank(patNo)) {
                    patientMappingDo = patientMappingDao.findByMappingCodeAndSource(patNo.trim(), "1");
                    patNo = null == patientMappingDo ? null : patientMappingDo.getPatient();
                    patientName = null == patientMappingDo ? null : patientMappingDo.getPatientName();
                }
                wlyyOutpatientVO.setPatient(patNo);
                wlyyOutpatientVO.setPatientName(patientName);
                wlyyOutpatientVO.setConNo(null == jsonObjectMgsInfo.get("CON_NO") ? "" : jsonObjectMgsInfo.get("CON_NO") + "");
                String doctor = null == jsonObjectMgsInfo.get("CON_DOC") ? "" : jsonObjectMgsInfo.get("CON_DOC") + "";
                //转化医生
                String mappingCode = doctor.trim();
                String doctorCode = "";
                if (StringUtils.isNotBlank(mappingCode)) {
                    List<DoctorMappingDO> mappingDOs = doctorMappingDao.findByOrgCodeAndMappingCode(orgCode, mappingCode);
                    if (mappingDOs != null && mappingDOs.size() > 0) {
                        doctorCode = mappingDOs.get(0).getDoctor();
                    }
                }
                wlyyOutpatientVO.setDoctor(doctorCode);
                wlyyOutpatientVO.setDoctorName(null == jsonObjectMgsInfo.get("CON_DOC_NAME") ? "" : jsonObjectMgsInfo.get("CON_DOC_NAME") + "");
//                wlyyOutpatientVO.setIdcard(null == jsonObjectMgsInfo.get("social_no") ? "" : jsonObjectMgsInfo.get("social_no") + "");
                wlyyOutpatientVO.setMjz(null == jsonObjectMgsInfo.get("MJZ") ? "" : jsonObjectMgsInfo.get("MJZ") + "");
                //主诊断 毒蛇咬伤&T63.001
                String[] icdName = jsonObjectMgsInfo.get("icd_name").toString().split("&");
                String[] diagTwo = jsonObjectMgsInfo.get("diag_two").toString().split("&");
                String[] diagThree = jsonObjectMgsInfo.get("diag_three").toString().split("&");
                String[] diagFour = jsonObjectMgsInfo.get("diag_four").toString().split("&");
                String[] diagFive = jsonObjectMgsInfo.get("diag_five").toString().split("&");
                String icdcodes = "";
                String icdNames = "";
                if (icdName.length > 1) {
                    icdcodes += icdName[1];
                    icdNames += icdName[0];
                }
                if (diagTwo.length > 1) {
                    icdcodes += "," + diagTwo[1];
                    icdNames += "," + diagTwo[0];
                }
                if (diagThree.length > 1) {
                    icdcodes += "," + diagThree[1];
                    icdNames += "," + diagThree[0];
                }
                if (diagFour.length > 1) {
                    icdcodes += "," + diagFour[1];
                    icdNames += "," + diagFour[0];
                }
                if (diagFive.length > 1) {
                    icdcodes += "," + diagFive[1];
                    icdNames += "," + diagFive[0];
                }
//                String icds = null == jsonObjectMgsInfo.get("icd_name") ? "" : jsonObjectMgsInfo.get("icd_name") + "";
//                String[] icdcodeAndName = icds.split("&");
//                wlyyOutpatientVO.setIcd10(icdcodeAndName.length > 1 ? icdcodeAndName[1].toString() : "");
//                wlyyOutpatientVO.setIcd10Name(icdcodeAndName.length > 0 ? icdcodeAndName[0].toString() : "");
                wlyyOutpatientVO.setIcd10(icdcodes);
                wlyyOutpatientVO.setIcd10Name(icdNames);
                String admDate = null == jsonObjectMgsInfo.get("ADM_DAT") ? "" : jsonObjectMgsInfo.get("ADM_DAT") + "";
                String conDate = null == jsonObjectMgsInfo.get("CON_DATE") ? "" : jsonObjectMgsInfo.get("CON_DATE") + "";
                wlyyOutpatientVO.setAdmDate(DateUtil.strToDate(admDate, DateUtil.YYYY_MM_DD_HH_MM_SS_));
                wlyyOutpatientVO.setConDate(DateUtil.strToDate(conDate, DateUtil.YYYY_MM_DD_HH_MM_SS_));
                wlyyOutpatientVOS.add(wlyyOutpatientVO);
            }
        }
        return wlyyOutpatientVOS;
    }
    /**
     * 获取门诊就诊记录列表
     * @param patient 居民id
     * @return
     */
    public List<WlyyOutpatientVO> selectOutpatientList(String patient, String startTime, String endTime,String ksdm, String cardNo) throws Exception {
    public List<WlyyOutpatientVO> selectOutpatientList(String patient, String startTime, String endTime,boolean demoFlag,String ksdm, String cardNo) throws Exception {
        List<WlyyOutpatientVO> wlyyOutpatientVOList = new ArrayList<>();
        if(demoFlag){
            return BS30025_demo(patient, null, startTime, endTime,ksdm);
        }
        JSONArray array = new JSONArray();
        patient = updatePatientMapping(patient,cardNo);
        String sql = "SELECT\n" +

+ 1 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/door/dao/ServiceItemPlanDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.hospital.module.door.dao;
package com.yihu.jw.rehabilitation;
import com.yihu.jw.entity.base.servicePackage.ServiceItemPlanDO;

+ 6 - 0
business/im-service/pom.xml

@ -44,6 +44,12 @@
            <groupId>com.yihu.jw</groupId>
            <artifactId>base-service</artifactId>
            <version>${version.wlyy-common}</version>
            <exclusions>
                <exclusion>
                    <artifactId>xalan</artifactId>
                    <groupId>xalan</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <!--   poi xml导入导出工具 end -->
    </dependencies>

+ 25 - 4
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -16,6 +16,7 @@ import com.yihu.jw.entity.base.im.ConsultTeamLogDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.score.BaseEvaluateDO;
import com.yihu.jw.entity.base.score.BaseEvaluateScoreDO;
import com.yihu.jw.entity.base.servicePackage.ServiceItemPlanDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.message.BaseBannerDoctorDO;
@ -46,6 +47,7 @@ import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.im.util.ImageCompress;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.rehabilitation.ServiceItemPlanDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
@ -87,7 +89,8 @@ public class ImService {
    @Autowired
    public ConsultDao consultDao;
    @Autowired
    private ServiceItemPlanDao serviceItemPlanDao;
    @Autowired
    public ConsultTeamDao consultTeamDao;
@ -997,7 +1000,7 @@ public class ImService {
     * @return
     * @throws Exception
     */
    public JSONObject addTeamConsult(ConsultTeamDo ct, String patient, String doctor, String source) throws Exception {
    public JSONObject addTeamConsult(ConsultTeamDo ct, String patient, String doctor, String source,String relationCode) throws Exception {
        JSONObject re = new JSONObject();
        boolean boo = StringUtils.isEmpty(getUnfinishedConsult(patient, doctor));
        logger.info("boo" + boo);
@ -1022,6 +1025,14 @@ public class ImService {
        String title = "专家咨询";
        if(ct.getType()==28){
            title = "康复咨询";
            ServiceItemPlanDO serviceItemPlanDO = serviceItemPlanDao.findById(relationCode).orElse(null);
            if(serviceItemPlanDO!=null){
                if(!StringUtils.isEmpty(serviceItemPlanDO.getRelationCode())){
                    throw new RuntimeException("该计划已发起过咨询,请选择其他计划发起!");
                }
                serviceItemPlanDO.setRelationCode(ct.getConsult());
                serviceItemPlanDao.save(serviceItemPlanDO);
            }
        }
@ -1084,7 +1095,6 @@ public class ImService {
        ct.setStartMsgId(obj.get("start_msg_id").toString());
        consultTeamDao.save(ct);
        consultDao.save(consult);
        JSONArray doctors = new JSONArray();
        for (String key : users.keySet()) {
            if (patient.equals(key)) {
@ -1511,6 +1521,8 @@ public class ImService {
        JSONObject jsonObject = new JSONObject();
        if ("3".equals(wlyyOutpatientDO.getOutpatientType())) {
            jsonObject.put("title", p.getName() + "申请咨询");
        } else if("4".equals(wlyyOutpatientDO.getOutpatientType())){
            jsonObject.put("title", p.getName() + "申请康复咨询");
        } else {
            jsonObject.put("title", p.getName() + "申请复诊");
        }
@ -1555,6 +1567,9 @@ public class ImService {
                consultTitle = "家医咨询";
            }
        }else if("4".equals(wlyyOutpatientDO.getOutpatientType())){
            users.put(patient, 0);
            consultTitle = "申请康复咨询";
        } else {
            users.put(patient, 0);
            consultTitle = "申请复诊";
@ -1627,6 +1642,12 @@ public class ImService {
            } else {
                obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_GENERAL_EXPERT);
            }
        }else if("4".equals(wlyyOutpatientDO.getOutpatientType())){
            messages = imUtil.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(), doctorCode);
            //5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+28(图文,视频,图文+视频)
            sessionId = patient + "_" + outpatientCode + "_" + ct.getType();
            obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_KANGFUConsult);
        } else {
            messages = imUtil.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(), doctorCode);
            //5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+9(图文,视频,图文+视频)
@ -1673,7 +1694,7 @@ public class ImService {
        addLogs(ct);
        JSONObject result = imUtil.getSingleSessionInfo(sessionId, doctorCode);
        //发送外层SOCKET消息 在线复诊
        if ("1".equals(wlyyOutpatientDO.getOutpatientType()) || "3".equals(wlyyOutpatientDO.getOutpatientType())) {
        if ("1".equals(wlyyOutpatientDO.getOutpatientType()) || "3".equals(wlyyOutpatientDO.getOutpatientType())|| "4".equals(wlyyOutpatientDO.getOutpatientType())) {
            System.out.println("发送外层SOCKET消息:在线复诊");
            JSONObject object = new JSONObject();
            object.put("socket_sms_type", 5);

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

@ -849,6 +849,7 @@ public class ImUtil {
    public static final String SESSION_TYPE_ONLINE = "23";//新生儿在线咨询
    public static final String SESSION_TYPE_ONLINEAged = "24";//老人在线咨询
    public static final String SESSION_TYPE_HealthConsult = "25";//老人在线咨询
    public static final String SESSION_TYPE_KANGFUConsult = "28";//康复咨询
    public static final String CONTENT_TYPE_TEXT = "1";

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

@ -471,13 +471,12 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		consult.setVoice(voice);
		consult.setDoctor(doctor);
		consult.setPatient(patient);
		consult.setRelationCode(relationCode);
		// 保存到数据库
//		int res = 0;
//		JSONArray dts = null;
		synchronized (patient.intern()){//新增同步方法。设备保存写在service层但是不生效,写在controller层才生效
			JSONObject re = null;
			re = imService.addTeamConsult(consult, patient,doctor,source);
			re = imService.addTeamConsult(consult, patient,doctor,source,relationCode);
//			res = re.getInteger("status");
//			dts = re.containsKey("doctor")?re.getJSONArray("doctor"):null;
			if (payFlag){
@ -659,7 +658,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
		//结束时医生未开处方则发送模板消息结算
		ConsultDo cons = consultDao.findById(consult).orElse(null);
		if (org.apache.commons.lang3.StringUtils.isNoneBlank(cons.getRelationCode())&&cons.getType()!=28){
		if (org.apache.commons.lang3.StringUtils.isNoneBlank(cons.getRelationCode())){
			WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode()).orElse(null);
			List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
			if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
@ -921,16 +920,11 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "times", required = false) Integer times,
			@ApiParam(name = "wechat_appid", value = "wechat_appid", defaultValue = "")
			@RequestParam(value = "wechat_appid", required = false) String wechat_appid
	)throws Exception{
	){
		try {
			List<String> failed = new ArrayList<>();
			//处理语音文件
			if(!org.springframework.util.StringUtils.isEmpty(wechat_appid)){
//			imService.getInputStream("1",wechat_appid);
				if("3".equalsIgnoreCase(content_type)){//语音文件
					String voicepath = imService.fetchWxVoices(wechat_appid);
					logger.info("voice_path:"+voicepath);
@ -941,7 +935,6 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
						if("xm_ihealth_wx".equals(wechat_appid)){
							logger.info("voice_wx_type:"+wechat_appid);
							voiceurl = fileUploadService.uploadWxVoice(voicepath);
//					uploadVO.setFullUri(map.get("accessory").toString());
						}else if ("xm_xzzx_wx".equalsIgnoreCase(wechat_appid)){
							voiceurl = fileUploadService.uploadWxVoiceToEntrance(remote_inner_url,voicepath);
							logger.info(voiceurl);
@ -962,7 +955,6 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
						if("xm_ihealth_wx".equals(wechat_appid)){
							logger.info("imge_wx_type:"+wechat_appid);
							imgeUrl = fileUploadService.uploadWxImage(imagepath);
//					uploadVO.setFullUri(map.get("accessory").toString());
						}else{
							imgeUrl = fileUtil.copyTempVoice(imagepath,fastdfs_file_url);
						}

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

@ -240,7 +240,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            } else if (wxId.equalsIgnoreCase("xm_hcyy_wx")) {
                vos = hcyyPrescriptionService.selectOutpatientList(patient,startTime,endTime,cardNo);
            } else if (wxId.equalsIgnoreCase("xm_dsyy_wx")) {
                vos = dsyyPrescriptionService.selectOutpatientList(patient, startTime, endTime, ksdm, cardNo);
                vos = dsyyPrescriptionService.selectOutpatientList(patient, startTime, endTime,demoFlag, ksdm, cardNo);
            } else {
                return ListEnvelop.getError("尚未开发!");
            }
@ -361,7 +361,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                                               @RequestParam(value = "startTime", required = false) String startTime,
                                                                               @ApiParam(name = "endTime", value = "结束时间,yyyy-MM-dd’")
                                                                               @RequestParam(value = "endTime", required = false) String endTime,
                                                                               @ApiParam(name = "outpatientType", value = "1复诊2协同3咨询")
                                                                               @ApiParam(name = "outpatientType", value = "1复诊2协同3咨询4康复咨询")
                                                                               @RequestParam(value = "outpatientType", required = false) String outpatientType,
                                                                               @ApiParam(name = "page", value = "第几页,1开始’")
                                                                               @RequestParam(value = "page", required = false) Integer page,
@ -463,7 +463,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @RequestParam(value = "patient", required = true) String patient,
                                      @ApiParam(name = "flag", value = "标识是否开启结算")
                                      @RequestParam(value = "flag", required = false) boolean flag,
                                      @ApiParam(name = "outpatientType", value = "1在线复诊 2 协同 3 专家咨询")
                                      @ApiParam(name = "outpatientType", value = "1在线复诊 2 协同 3 专家咨询 4康复咨询")
                                      @RequestParam(value = "outpatientType", required = false) String outpatientType) throws Exception {
        try {

+ 1 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/door/service/DoorOrderService.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.base.servicePackage.ServicePackageSubItemDO;
import com.yihu.jw.entity.base.system.SystemDictDO;
import com.yihu.jw.rehabilitation.ServiceItemPlanDao;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.door.*;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;

+ 1 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/door/service/WlyyDoorServiceOrderService.java

@ -24,6 +24,7 @@ import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.rehabilitation.ServiceItemPlanDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.restmodel.qvo.ParamQvo;

+ 32 - 25
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/service/PatientDeviceService.java

@ -625,31 +625,38 @@ public class PatientDeviceService  {
     * @param type 1同意解绑,2不同意
     */
    public void sendWxMessage(DevicePatientDevice patientDevice, int type) {
        BasePatientDO patient = patientDao.findById(patientDevice.getUser()).orElse(null);
        WxTemplateConfigDO templateConfig = null;
        //判断是同意解绑还是拒绝解绑
        if(type == 1){
            templateConfig = wxMessageUtil.findByWechatIdAndTemplateNameAndSceneAndStatus(null,"template_process_feedback","unbind",1);
        }else if(type == 2) {
            templateConfig = wxMessageUtil.findByWechatIdAndTemplateNameAndSceneAndStatus(null,"template_process_feedback", "refuse",1);
        }
        WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
        BeanUtils.copyProperties(templateConfig,newConfig);
        String first = newConfig.getFirst();
        first = first.replace("key1", patientDevice.getDeviceName());
        String keyword2 = newConfig.getKeyword2();
        if(keyword2.contains("key2")){
            keyword2 = keyword2.replace("key2", patientDevice.getRefuseReason());
        }
        newConfig.setFirst(first);
        newConfig.setKeyword2(keyword2);
        newConfig.setKeyword1(DateUtil.dateToStrShort(new Date()));
        com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
        json.put("deviceId", patientDevice.getCategoryCode());
        json.put("id", patientDevice.getId());
        if(patient != null && StringUtils.isNotBlank(patient.getOpenid())) {
            wxMessageUtil.putWxMsg(null,  patient.getOpenid(),newConfig, 33, json);
        try {
            BasePatientDO patient = patientDao.findById(patientDevice.getUser()).orElse(null);
            WxTemplateConfigDO templateConfig = null;
            //判断是同意解绑还是拒绝解绑
            if(type == 1){
                templateConfig = wxMessageUtil.findByWechatIdAndTemplateNameAndSceneAndStatus(null,"template_process_feedback","unbind",1);
            }else if(type == 2) {
                templateConfig = wxMessageUtil.findByWechatIdAndTemplateNameAndSceneAndStatus(null,"template_process_feedback", "refuse",1);
            }
            if(templateConfig==null){
                return;
            }
            WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
            BeanUtils.copyProperties(templateConfig,newConfig);
            String first = newConfig.getFirst();
            first = first.replace("key1", patientDevice.getDeviceName());
            String keyword2 = newConfig.getKeyword2();
            if(keyword2.contains("key2")){
                keyword2 = keyword2.replace("key2", patientDevice.getRefuseReason());
            }
            newConfig.setFirst(first);
            newConfig.setKeyword2(keyword2);
            newConfig.setKeyword1(DateUtil.dateToStrShort(new Date()));
            com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
            json.put("deviceId", patientDevice.getCategoryCode());
            json.put("id", patientDevice.getId());
            if(patient != null && StringUtils.isNotBlank(patient.getOpenid())) {
                wxMessageUtil.putWxMsg(null,  patient.getOpenid(),newConfig, 33, json);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }

+ 1 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/RehabilitationGuidanceService.java

@ -7,13 +7,13 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.servicePackage.ServiceItemPlanDO;
import com.yihu.jw.entity.rehabilitation.RehabilitationguidanceDO;
import com.yihu.jw.entity.rehabilitation.RehabilitationguidancePatientDO;
import com.yihu.jw.hospital.module.door.dao.ServiceItemPlanDao;
import com.yihu.jw.hospital.module.rehabilitation.dao.RehabilitationGuidanceDao;
import com.yihu.jw.hospital.module.rehabilitation.dao.RehabilitationGuidancePatientDao;
import com.yihu.jw.hospital.task.PushMsgTask;
import com.yihu.jw.hospital.utils.WeiXinAccessTokenUtils;
import com.yihu.jw.hospital.utils.WeiXinOpenIdUtils;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.rehabilitation.ServiceItemPlanDao;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.entity.ServiceException;

+ 3 - 3
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/RehabilitationManageService.java

@ -14,7 +14,6 @@ import com.yihu.jw.entity.specialist.RehabilitationServiceItemDO;
import com.yihu.jw.entity.specialist.SpecialistPatientRelationDO;
import com.yihu.jw.entity.specialist.rehabilitation.*;
import com.yihu.jw.entity.util.TransforSqlUtl;
import com.yihu.jw.hospital.module.door.dao.ServiceItemPlanDao;
import com.yihu.jw.hospital.module.followup.dao.FollowUpDao;
import com.yihu.jw.hospital.module.followup.service.FollowUpService;
import com.yihu.jw.hospital.module.rehabilitation.dao.*;
@ -24,6 +23,7 @@ import com.yihu.jw.hospital.module.specialist.dao.SpecialistPatientRelationDao;
import com.yihu.jw.hospital.module.system.service.SystemDictService;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.rehabilitation.ServiceItemPlanDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -182,7 +182,7 @@ public class RehabilitationManageService {
        String relationType = detailDO.getHospitalServiceItemId();
        Integer plan_start_time_type = detailDO.getTimeType();//计划开始时间类型
        String server_count = detailDO.getServerCount();//服务次数
        if(StringUtils.isBlank(server_count)&&!"2".equals(relationType)&&!"3".equals(relationType)){
        if(StringUtils.isBlank(server_count)&&!"3".equals(relationType)){
            return planDOList;
        }
        String planDetailId = detailDO.getId();
@ -1399,7 +1399,7 @@ public class RehabilitationManageService {
                            "type = '28' order by p.czrq desc limit 0,1 ";
                    List<Map<String,Object>> indexList = jdbcTemplate.queryForList(sqlTemp);
                    if(indexList.size()>0){
                        detailDO.setCompleteTime(indexList.get(0).get("")+"czrq");
                        detailDO.setCompleteTime(indexList.get(0).get("czrq")+"");
                    }
                }
            }