Browse Source

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

zdm 5 years ago
parent
commit
9d40efd3cf

+ 7 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/mapping/service/PatientMappingService.java

@ -1,12 +1,15 @@
package com.yihu.jw.hospital.mapping.service;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.patient.dao.BasePatientDao;
import net.sf.json.JSONArray;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import net.sf.json.JSONObject;
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.stereotype.Service;
@ -20,6 +23,8 @@ import java.util.Date;
@Service
public class PatientMappingService {
    private static final Logger logger = LoggerFactory.getLogger(PatientMappingService.class);
    @Autowired
    private PatientMappingDao patientMappingDao;
    @Autowired
@ -61,8 +66,9 @@ public class PatientMappingService {
    }
    public String findHisPatNoByPatient(String patient)throws Exception{
        logger.info("findHisPatNoByPatient:"+patient);
        BasePatientDO patientDO = basePatientDao.findById(patient);
        logger.info("patientDO:"+patientDO.toString());
        PatientMappingDO patientMappingDO = patientMappingDao.findByIdcardAndSource(patientDO.getIdcard(),"1");
        if(patientMappingDO!=null){

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

@ -61,6 +61,8 @@ import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
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.jdbc.core.BeanPropertyRowMapper;
@ -83,6 +85,8 @@ import java.util.*;
@Transactional
public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, PrescriptionDao> {
    private static final Logger logger = LoggerFactory.getLogger(PrescriptionService.class);
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
@ -149,7 +153,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @throws Exception
     */
    public  List<WlyyOutpatientVO> findOutpatientList(String patient, String startTime, String endTime, boolean demoFlag)throws Exception{
        logger.info("findOutpatientList patient:"+patient);
        String patNo =patientMappingService.findHisPatNoByPatient(patient);
        logger.info("findOutpatientList patNo "+patNo);
        return entranceService.BS30025(patNo,null,startTime,endTime,demoFlag);
    }
@ -160,12 +166,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @return
     */
    public WlyyOutpatientVO findOutpatientInfo(String patient,String conNo)throws Exception{
        logger.info("findOutpatientList patient:"+patient);
        String patNo =patientMappingService.findHisPatNoByPatient(patient);
        logger.info("findOutpatientList patNo:"+patNo);
        List<WlyyOutpatientVO> list = entranceService.BS30025(patNo,conNo,null,null,demoFlag);
        if(list!=null&&list.size()>0){
            WlyyOutpatientVO outpatientVO = list.get(0);
            BasePatientDO patientDO = basePatientDao.findById(outpatientVO.getPatient());
            BasePatientDO patientDO = basePatientDao.findById(patient);
            outpatientVO.setSex(patientDO.getSex()+"");
            outpatientVO.setBirthday(patientDO.getBirthday());
            return outpatientVO;
@ -1056,6 +1064,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            prescriptionDO = new WlyyPrescriptionDO();
            prescriptionDO.setOutpatientId(outPatientId);
        }
        prescriptionDO.setCreateTime(new Date());
        prescriptionDO.setStatus(10);
        prescriptionDO.setPatientCode(outpatientDO.getPatient());
        prescriptionDO.setPatientName(outpatientDO.getPatientName());

+ 2 - 2
business/base-service/src/mqConfig/mqdata/BS15018.json

@ -1,7 +1,7 @@
{
	"code": "1",
	"MsgInfo": [{
		"PAT_NO": "P5616242-0  ",
		"PAT_NO": "P5616242-0",
		"CARD_NO": "D40136791",
		"CARD_STAT": "旧卡停用",
		"OP_DATE": "2011-09-27 15:35:57",
@ -10,7 +10,7 @@
		"social_no": "350211198411053024"
	},
	{
		"PAT_NO": "P5616242-0  ",
		"PAT_NO": "P5616242-0",
		"CARD_NO": "DA1872143",
		"CARD_STAT": "激活",
		"OP_DATE": "2014-07-25 08:46:40",

+ 1 - 1
business/base-service/src/mqConfig/mqdata/BS30025.json

@ -7,7 +7,7 @@
			"SEX": "2",
			"BIRTH_DATE": "1959/01/01 00:00:00",
			"ID_CARD": [],
			"PAT_NO": "P11160895-0   ",
			"PAT_NO": "P11160895-0",
			"ADM_DAT": "2019/06/03 01:37:52",
			"ADM_SPEC": "1190007",
			"ADM_SPEC_NAME": "急诊外科",

+ 52 - 14
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -14,11 +14,16 @@ import com.yihu.jw.entity.base.score.BaseEvaluateDO;
import com.yihu.jw.entity.base.score.BaseEvaluateScoreDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateDao;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateScoreDao;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.mapping.service.DoctorMappingService;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.dao.ConsultTeamDao;
import com.yihu.jw.im.dao.ConsultTeamDoctorDao;
@ -121,6 +126,9 @@ public class ImService {
	@Value("${fastDFS.fastdfs_file_url}")
	private String fastdfs_file_url;
	
	@Value("${demo.flag}")
	private boolean demoFlag;
	
	@Autowired
	private JdbcTemplate jdbcTemplate;
	
@ -130,6 +138,13 @@ public class ImService {
	@Autowired
	private OutpatientDao outpatientDao;
	
	@Autowired
	private EntranceService entranceService;
	@Autowired
	private DoctorMappingService doctorMappingService;
	@Autowired
	private WlyyHttpLogDao wlyyHttpLogDao;
	
	
	
	/**
@ -877,13 +892,45 @@ public class ImService {
	public JSONObject addPrescriptionConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type) throws Exception {
		
		synchronized (outpatientCode.intern()) {
			
			//1、获取his就诊记录详情(保存续方表、药品续方信息表、续方疾病类型表)
			WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outpatientCode);
			
			//2. 调用HIS挂号接口---START
			DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(doctorCode,wlyyOutpatientDO.getHospital());
			if(doctorMappingDO==null){
				throw new RuntimeException("未找到医生映射信息");
			}
			
			net.sf.json.JSONObject rs = entranceService.BS10111(wlyyOutpatientDO.getCardNo(),doctorMappingDO.getMappingCode(),wlyyOutpatientDO.getDept(),null,wlyyOutpatientDO.getWinNo(),demoFlag);
			String rsCode = (String)rs.get("@RESULT");
			if("0".equals(rsCode)){
				//存储挂号号
				String serialNo = (String)rs.get("serial_no");
				wlyyOutpatientDO.setRegisterNo(serialNo);
				String conNo = (String)rs.get("@times");
				wlyyOutpatientDO.setConNo(conNo);
			}
			
			//保存日志
			WlyyHttpLogDO log = new WlyyHttpLogDO();
			log.setCode("registerOutPatient");
			log.setName("挂号");
			log.setPatient(wlyyOutpatientDO.getPatient());
			log.setDoctor(doctorCode);
			log.setResponse(rs.toString());
			log.setRequest("outPatientId="+outpatientCode+"&doctor="+doctorCode);
			log.setStatus(rsCode);
			log.setCreateTime(new Date());
			wlyyHttpLogDao.save(log);
			
			// 调用HIS挂号接口---END
			
			
			/**
			 * toto 判断是否存在未审核的复诊
			 */
//			String check = prescriptionInfoService.presCheckState(jwCode);
//			if ("0".equals(check)) {//存在未审核的续方
//				return -1;
//			}
			
			
			BaseDoctorDO doctor = baseDoctorDao.findById(doctorCode);
@ -891,8 +938,7 @@ public class ImService {
			// 查询患者信息
			BasePatientDO p = basePatientDao.findById(patient);
			
			//1、获取his就诊记录详情(保存续方表、药品续方信息表、续方疾病类型表)
			WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outpatientCode);
			
			
			if(!"0".equals(wlyyOutpatientDO.getStatus())){
				throw new RuntimeException("该就诊记录已被取消,无法接单!");
@ -920,14 +966,6 @@ public class ImService {
			// 设置患者信息
			ct.setPatient(patient);
			ct.setSymptoms(wlyyOutpatientDO.getDescription());
//			if (1 == type) {
//				ct.setSymptoms("高血压");
//			} else if (2 == type) {
//				ct.setSymptoms("糖尿病");
//			} else if (3 == type) {
//				ct.setSymptoms("高血压,糖尿病");
//			} else {
//			}
			
			// 设置患者姓名
			ct.setName(p.getName());

+ 5 - 5
gateway/ag-basic/src/main/resources/application.yml

@ -45,7 +45,7 @@ zuul:
      serviceId: svr-base
    svr-authentication:
      path: /cityihealth/auth/**
      serviceId: svr-authentication
      serviceId: svr-authentication-lyx
    svr-healthy-house:
      path: /cityihealth/healthyHouse/**
      serviceId: svr-healthy-house
@ -54,7 +54,7 @@ zuul:
      serviceId: svr-patient
    svr-internet-hospital:
      path: /hospital/**
      serviceId: svr-internet-hospital
      serviceId: svr-internet-hospital-lyx
    svr-internet-hospital-entrance:
      path: /hospitalEntrance/**
      serviceId: svr-internet-hospital-entrance
@ -77,9 +77,9 @@ spring:
spring:
  profiles: jwtest
  datasource:
     url: jdbc:mysql://172.17.110.160/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
     username: ssgg
     password: ssgg
    url: jdbc:mysql://172.26.0.104/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: ssgg
    password: ssgg@jkzl2019
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.

+ 14 - 2
server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthYlzConfigService.java

@ -14,9 +14,12 @@ import com.ylzinfo.ehc.common.utils.DateUtils;
import com.ylzinfo.ehc.trans.TransRequest;
import com.ylzinfo.ehc.trans.TransResponse;
import org.apache.commons.collections.map.HashedMap;
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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.InputStream;
import java.util.Date;
@ -27,8 +30,11 @@ import java.util.UUID;
 * Created by Trick on 2019/7/26.
 */
@Service
@Transactional
public class OauthYlzConfigService {
    private static final Logger logger = LoggerFactory.getLogger(OauthYlzConfigService.class);
    @Autowired
    private OauthYlzConfigDao oauthYlzConfigDao;
    @Autowired
@ -40,9 +46,9 @@ public class OauthYlzConfigService {
    private String fastdfs_file_url;
    public Map<String,Object> getOauthQRCode(){
        OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findOne("ylz_config");
        try {
            OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findOne("ylz_config");
            logger.info("getOauthQRCode:",oauthYlzConfigDO.toString());
            TransRequest e = new TransRequest();
            e.setMethod("ehc.ehealthcard.authurl");
            e.setApp_id(oauthYlzConfigDO.getAppId());
@ -58,10 +64,13 @@ public class OauthYlzConfigService {
            e.setBiz_content(JSON.toJSONString(bizContent));
            EhcHandler ehcHandler = new EhcHandler(oauthYlzConfigDO.getUrl(), oauthYlzConfigDO.getAppId(), oauthYlzConfigDO.getTermId(), oauthYlzConfigDO.getAppKey());
            TransResponse re = ehcHandler.execute(e);
            String rs = com.alibaba.fastjson.JSONObject.toJSONString(re);
            logger.info("TransResponse:"+rs);
            com.alibaba.fastjson.JSONObject json = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.parse(rs);
            com.alibaba.fastjson.JSONObject biz = json.getJSONObject("biz_content");
            InputStream qrcode = QrcodeUtil.createQrcode(biz.getString("ehealth_authurl"),300,"jpg");
            logger.info("fastdfs_file_url:"+fastdfs_file_url);
            UploadVO uploadVO = fileUploadService.uploadStream(qrcode,"qrcode.jpg",fastdfs_file_url);
            Map<String,Object> map = new HashedMap();
            map.put("fileName",uploadVO.getFileName());
@ -69,6 +78,8 @@ public class OauthYlzConfigService {
            map.put("fullUrl",uploadVO.getFullUrl());
            map.put("fullUri",uploadVO.getFullUri());
            map.put("out_authorize_no",no);
            logger.info("fileUploadService:"+map.toString());
            return map;
        } catch (Exception var5) {
            var5.printStackTrace();
@ -113,6 +124,7 @@ public class OauthYlzConfigService {
                        String mobile = biz.getString("mobile_phone");
                        String pw = idcard.substring(mobile.length()-6);
                        patient.setIdcard(idcard);
                        patient.setName(biz.getString("user_name"));
                        patient.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                        patient.setSalt(salt);