Browse Source

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

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/doctor/dao/DoctorWorkTimeDao.java
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
#	gateway/ag-basic/src/main/resources/bootstrap.yml
#	svr/svr-internet-hospital/src/main/resources/application.yml
wangzhinan 5 years ago
parent
commit
9689e7af34

+ 50 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionExpressageService.java

@ -240,6 +240,35 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
    }
    /**
     * 顺丰面单查询
     * @param sfexpress_obj
     * @return
     * @throws Exception
     */
    public JSONObject postSFOrderQueryService(WlyyPrescriptionExpressageDO sfexpress_obj) throws Exception {
        //获取医生所处的医院详细地址,作为寄件人地址
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(sfexpress_obj.getOutpatientId());
        JSONObject params =new JSONObject();
        params.put("orderNo",sfexpress_obj.getMailno());
        String re = this.SFExpressQueryPostV2(params);
        //xml验证
        logger.info("顺丰快递面单查询:re"+re);
        verificationResponV2(re);
        JSONObject respone = JSONObject.parseObject(re);
        String mailno = "";//顺丰运单号
        JSONArray successResult =  respone.getJSONArray("result");
        JSONObject object = new JSONObject();
        if(!successResult.isEmpty()){
             object = successResult.getJSONObject(0);
        }
        return object;
    }
    /**
     * 向顺丰快递取消订单
     * @param sfexpress_obj
@ -750,6 +779,27 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
        String re = HttpClientUtils.doPost(url, params.toJSONString(), ContentType.APPLICATION_JSON);
        return re;
    }
    /**
     * 查询面单组装请求参数,发送请求
     * @param params
     * @return
     * @throws Exception
     */
    private String SFExpressQueryPostV2(JSONObject params)throws Exception{
        params.put("version","1.0");
        params.put("timestamp",new Date().getTime());
        String sign = SHAUtils.SHA512(params.toJSONString()+sf_check_word);
        String url =sf_url+"/api/open/api/addOrder?hospitalCode="+sf_code+"&sign="+sign;
        logger.info("顺丰快递面单查询:sf_url"+url);
        logger.info("顺丰快递面单查询:params"+params.toString());
        String re = HttpClientUtils.doPost(url, params.toJSONString(), ContentType.APPLICATION_JSON);
        return re;
    }
    
    /**
     * 校验返回的报文

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

@ -770,9 +770,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        WlyyOutpatientDO outpatient = outpatientDao.save(outpatientDO);
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("WX_MONEY");
        Double price = 0.0;
        if (doctorDO != null && StringUtils.isNoneBlank(doctorDO.getFee())) {
            price = Double.parseDouble(doctorDO.getFee());
        }else {
            price = Double.parseDouble(hospitalSysDictDO.getDictValue());
        }
        if (price == 0.0) {
            outpatientDO.setPayStatus(1);
@ -5106,12 +5109,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                if (sfexpress_obj != null && StringUtils.isNoneBlank(sfexpress_obj.getMailno())) {
                    com.alibaba.fastjson.JSONObject object = sfexpressService.postSFOrderQueryService(sfexpress_obj);
                    System.out.println("获取顺丰物流面单信息7-1"+object.toJSONString());
                    System.out.println("获取顺丰物流面单信息:7");
                    com.alibaba.fastjson.JSONObject sfJsonObject = new com.alibaba.fastjson.JSONObject();
                    sfJsonObject.put("mailno", sfexpress_obj.getMailno());
                    sfJsonObject.put("mailtype", "标准快递");
                    sfJsonObject.put("destcode", "592");
                    sfJsonObject.put("destcode", object.getString("destcode"));
                    if (wxId.equalsIgnoreCase("xm_zsyy_wx")) {
                        sfJsonObject.put("j_name", "厦门大学附属中山医院");
                        sfJsonObject.put("j_phone", "4003008888");
@ -5252,6 +5257,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        outpatientDO.setIdcard(patientDO.getIdcard());
        outpatientDO.setOutpatientType("2");
        outpatientDO.setCreateTime(new Date());
        outpatientDO.setPayStatus(1);
        if (outpatientDO.getRegisterDate() == null) {
            outpatientDO.setRegisterDate(new Date());
@ -6632,6 +6638,26 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public WlyyPrescriptionVO selectByPrescriptionId(String prescriptionId) throws Exception {
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
        if (wlyyPrescriptionDO != null) {
            List<BaseDoctorHospitalDO> doctorHospitalDOS = baseDoctorHospitalDao.findByDoctorCode(wlyyPrescriptionDO.getDoctor());
            String deptName = null;
            String hospitalName =null;
            String sex = null;
            String age = null;
            String cardNo = null;
            if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
                deptName = doctorHospitalDO.getDeptName();
                hospitalName = doctorHospitalDO.getOrgName();
            }
            BasePatientDO patientDO = basePatientDao.findById(wlyyPrescriptionDO.getPatientCode());
            if (patientDO!=null){
                sex = patientDO.getSex()+"";
                age = DateUtil.getAgeForIdcard(patientDO.getIdcard())+"";
            }
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
            if (outpatientDO!=null){
                cardNo = outpatientDO.getCardNo();
            }
            com.alibaba.fastjson.JSONObject objectString = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.toJSON(wlyyPrescriptionDO);
            WlyyPrescriptionVO prescriptionVO = com.alibaba.fastjson.JSONObject.toJavaObject(objectString, WlyyPrescriptionVO.class);
            List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId, 1);
@ -6662,8 +6688,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                inspectionVOList.add(inspectionVO);
            }
            prescriptionVO.setInspectionVOs(inspectionVOList);
            prescriptionVO.setAge(StringUtils.isNoneBlank(wlyyPrescriptionDO.getIdcard()) ? IdCardUtil.getAgeForIdcard(wlyyPrescriptionDO.getIdcard()) + "" : null);
            prescriptionVO.setSex(StringUtils.isNoneBlank(wlyyPrescriptionDO.getIdcard()) ? IdCardUtil.getSexForIdcard_new(wlyyPrescriptionDO.getIdcard()) : null);
            prescriptionVO.setAge(age);
            prescriptionVO.setSex(sex);
            prescriptionVO.setDeptName(deptName);
            prescriptionVO.setHospitalName(hospitalName);
            prescriptionVO.setCardNo(cardNo);
            return prescriptionVO;
        }
        return null;

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

@ -1201,16 +1201,20 @@ public class XzzxEntranceService{
     * @param cardNo 就诊卡
     * @return
     */
    public JSONArray selectCardInfo(String cardNo){
    public JSONObject selectCardInfo(String cardNo){
        JSONArray array = new JSONArray();
        String response="";
        String url = entranceUrl+"getCardInfo?cardNo="+cardNo;
        response = httpClientUtil.get(url,"GBK");
        JSONObject object = JSONObject.parseObject(response);
        JSONObject jsonObject = new JSONObject();
        if (object.getInteger("status")==200){
            array = JSONArray.parseArray(object.getString("obj")).getJSONArray(0);
            if (array!=null&&array.size()!=0){
                jsonObject = array.getJSONObject(0);
            }
        }
        return array;
        return jsonObject;
    }

+ 47 - 11
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -27,6 +27,7 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.order.dao.BusinessOrderDao;
@ -108,6 +109,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    private BaseDoctorDao doctorDao;
    @Autowired
    private EntranceService entranceService;
    @Autowired
    private XzzxEntranceService xzzxEntranceService;
@ -1073,21 +1076,45 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        if (businessOrderDO!=null){
            BasePatientDO patientDO = patientDao.findById(businessOrderDO.getPatient());
            String idcard = "";
            String ssc = "";
            if (patientDO!=null){
                idcard = patientDO.getIdcard();
            }
            logger.info("开始1"+idcard);
            String openId = "";
            BaseDoctorDO doctorDO = doctorDao.findById(businessOrderDO.getDoctor());
            String fee = doctorDO.getFee();
            if (!StringUtils.isNoneBlank(fee)){
                throw new Exception("医生费用为空");
            Double doctorFee = 0.0;
            if (StringUtils.isNoneBlank(businessOrderDO.getDoctor())){
                BaseDoctorDO doctorDO = doctorDao.findById(businessOrderDO.getDoctor());
                String fee = doctorDO.getFee();
                if (!StringUtils.isNoneBlank(fee)){
                    throw new Exception("医生费用为空");
                }
                doctorFee= Double.parseDouble(fee);
            }else {
                WlyyHospitalSysDictDO wlyyHospitalSysDictDO =hospitalSysDictDao.findById("WX_MONEY");
                doctorFee = Double.parseDouble(wlyyHospitalSysDictDO.getDictValue());
            }
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO =hospitalSysDictDao.findById("YLZ_YE");
            if (wlyyHospitalSysDictDO!=null&&wlyyHospitalSysDictDO.getDictValue().equalsIgnoreCase("0")){
                businessOrderDO.setPayPrice(doctorFee);
            }else {
                if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
                    net.sf.json.JSONObject object1 = entranceService.qutpatientBalance(cardNo, demoFlag);
                    Double cardFee = object1.getDouble("ZHYE");
                    BigDecimal b = new BigDecimal(String.valueOf(cardFee));
                    BigDecimal c = new BigDecimal(String.valueOf(doctorFee));
                    BigDecimal balance = c.subtract(b);
                    businessOrderDO.setPayPrice(balance.doubleValue());
                }else if(wechatId.equalsIgnoreCase("xm_xzzx_wx")){
                    JSONObject object = xzzxEntranceService.selectCardInfo(cardNo);
                    Double cardFee = object.getDouble("ZHYE");
                    BigDecimal b = new BigDecimal(String.valueOf(cardFee));
                    BigDecimal c = new BigDecimal(String.valueOf(doctorFee));
                    BigDecimal balance = c.subtract(b);
                    businessOrderDO.setPayPrice(balance.doubleValue());
                }
            }
            net.sf.json.JSONObject object1 = entranceService.qutpatientBalance(cardNo, demoFlag);
            Double cardFee = object1.getDouble("ZHYE");
            Double doctorFee = Double.parseDouble(fee);
            Double balance = doctorFee-cardFee;
            businessOrderDO.setPayPrice(balance);
            businessOrderDO.setPayType(4);
            businessOrderDao.save(businessOrderDO);
            List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
@ -1097,7 +1124,16 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            }
            String price = businessOrderDO.getPayPrice().toString();
            String notifyUrl = hospitalSysDictDO.getDictCode();
            response = ylzPayService.recharge("123456",businessOrderDO.getPatientName(),cardType,"01",cardNo,idcard,depositType,price,businessOrderDO.getOrderNo(),openId,patientDO.getName(),notifyUrl);
            String operatorId =null;
            String operatorName = null;
            if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
                operatorId = "123456";
                operatorName =businessOrderDO.getPatientName();
            }else if(wechatId.equalsIgnoreCase("xm_xzzx_wx")){
                operatorId = "hlwyy";
                operatorName = "互联网医院";
            }
            response = ylzPayService.recharge(operatorId,operatorName,cardType,"01",cardNo,idcard,depositType,price,businessOrderDO.getOrderNo(),openId,patientDO.getName(),notifyUrl);
            if (depositType.equalsIgnoreCase("WX_QR")){
                JSONObject object = JSONObject.parseObject(response);
                if (object!=null){

+ 11 - 1
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -20,6 +20,7 @@ import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateDao;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateScoreDao;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
@ -39,6 +40,7 @@ import com.yihu.jw.im.dao.ConsultTeamLogDao;
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.restmodel.hospital.consult.WlyyHospitalSysDictVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
@ -124,6 +126,8 @@ public class ImService {
	@Autowired
	private YkyyService ykyyService;
	@Autowired
	private BusinessOrderDao businessOrderDao;
	@Autowired
	private PrescriptionService prescriptionService;
@ -1099,13 +1103,19 @@ public class ImService {
	 * @param reason
	 * @return
	 */
	public JSONObject addPrescriptionConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type) throws Exception {
	public JSONObject addPrescriptionConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type,String wxId) throws Exception {
		
		synchronized (outpatientCode.intern()) {
			
			//1、获取his就诊记录详情(保存续方表、药品续方信息表、续方疾病类型表)
			WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outpatientCode);
			if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
				//眼科接诊时更新眼科通状态
				BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(wlyyOutpatientDO.getId());
				ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"5");
			}
			
			//2. 调用HIS挂号接口---START  移到CONTROLER层,直接调用挂号接口
//			DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(doctorCode,wlyyOutpatientDO.getHospital());

+ 24 - 0
svr/svr-internet-hospital-entrance/src/main/resources/application.yml

@ -71,6 +71,9 @@ spring:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -109,6 +112,9 @@ spring:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -145,6 +151,9 @@ spring:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -190,6 +199,9 @@ spring:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -235,6 +247,9 @@ spring:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -273,6 +288,9 @@ spring:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -313,6 +331,9 @@ spring:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -353,6 +374,9 @@ spring:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL

+ 22 - 0
svr/svr-internet-hospital-job/src/main/resources/application.yml

@ -71,6 +71,9 @@ hlwyyEntrance:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -102,6 +105,9 @@ hlwyyEntrance:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -142,6 +148,9 @@ hlwyyEntrance:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -182,6 +191,9 @@ hlwyyEntrance:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -215,6 +227,9 @@ hlwyyEntrance:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://172.16.1.34
  mqUser: JKZL
@ -249,6 +264,10 @@ hlwyyEntrance:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -282,6 +301,9 @@ hlwyyEntrance:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL

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

@ -203,8 +203,6 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
							rsCode = (String)res.get("@RESULT");
							mes = (String)res.get("@MSG");
						}
					}
					if("0".equals(rsCode)||"-2".equals(rsCode)){
@ -217,7 +215,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
				
				
				//2.
				result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type);
				result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId);
			}
			return success("操作成功",result);
	}

+ 24 - 0
svr/svr-internet-hospital/src/main/resources/application.yml

@ -118,6 +118,9 @@ sms:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -193,6 +196,9 @@ myFamily:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -274,6 +280,9 @@ myFamily:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -364,6 +373,9 @@ myFamily:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -450,6 +462,9 @@ myFamily:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -533,6 +548,9 @@ myFamily:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -614,6 +632,9 @@ myFamily:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
@ -697,6 +718,9 @@ myFamily:
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL