Browse Source

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

wangjun 4 years ago
parent
commit
4739e56b3b

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

@ -1,6 +1,7 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.BaseNatAppointmentDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -12,4 +13,7 @@ public interface BaseNatAppointmentDao extends PagingAndSortingRepository<BaseNa
    @Query("from BaseNatAppointmentDO t where t.payStatus = 0 ")
    List<BaseNatAppointmentDO> findByPayStatus();
    @Query("select a from BaseNatAppointmentDO a where  a.realOrder =?1 ")
    List<BaseNatAppointmentDO> findByRealOrderList(String realOrder);
}

+ 20 - 8
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PayInfoNoticeService.java

@ -1,27 +1,22 @@
package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import jxl.WorkbookSettings;
import jxl.write.*;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.io.OutputStream;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
public class PayInfoNoticeService {
@ -58,6 +53,23 @@ public class PayInfoNoticeService {
        return null;
    }
    public String pushPrescriptionPayAndHsjc(String patient,String doctorName,String orderNo,String id,String total,String title,String url){
        BasePatientDO patientDO = patientDao.findById(patient);
        if (patientDO!=null){
            String userName = patientDO.getName();
            String idcard = patientDO.getIdcard();
            String phone = patientDO.getMobile();
            if (!StringUtils.isNotBlank(url)){
                url = "https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+id;
            }
            String remark = "结算方式:微信结算" +
                    "点击查看核酸预约开单信息";
            return paySuccessNotice(userName,idcard,phone,title,url,doctorName,total,"0",total,orderNo,remark);
        }
        return null;
    }
    /**
     * 支付成功提醒
     * @param userName 用户名 (不能为空)

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

@ -10531,6 +10531,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            jsondate.put("dept",map.get("deptCode").toString());
                            jsondate.put("doctor",map.get("doctorMappingCode").toString());
                            baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
                            baseNatAppointmentDO.setDoctorName(map.get("doctorName").toString());
                        }else {
                            returnMap.put("msg","已经挂号的数据有误");
                            returnMap.put("status","-1");
@ -10624,6 +10625,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            return returnMap;
                        }
                        baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
                        baseNatAppointmentDO.setDoctorName(map.get("doctorName").toString());
                    }
                } catch (Exception e) {
@ -10653,7 +10655,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        baseNatAppointmentDO.setIsSuccess("1");
                        baseNatAppointmentDao.save(baseNatAppointmentDO);
                        String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
                        String applyDepaName = map.get("deptCode").toString();
                        String applyDepaName = map.get("deptName").toString();
                        String voucherNo = jsonObject.getString("@xtgzh0");
                        String applyDoctorName = map.get("doctorName").toString();
@ -10671,14 +10673,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        }
                        logger.info("cardNo:" + cardNo);
                        /*JSONObject jsonObject1 =entranceService.BS15054(patientMappingDO.getMappingCode(),realOrder,demoFlag);
                        JSONObject jsonObject1 =entranceService.BS15054(patientMappingDO.getMappingCode(),realOrder,demoFlag);
                        net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest");
                        logger.info("获取待结算数据 res: " + res.toString());
                        String rsCode = res.getString("@RESULT");*/
                        String free= 80+"";
                        /*if ("0".equals(rsCode)) {
                        String rsCode = res.getString("@RESULT");
                        String free= "";
                        if ("0".equals(rsCode)) {
                            free = res.getString("@total_charge");
                        }*/
                        }
                        ylzPayService.msgPush("01", mediaCard, "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1");
                        /*//成功后发送模板消息

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatAppointmentDO.java

@ -51,6 +51,7 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    private String winNo;
    private String chargeCode;
    private String icdCode;
    private String doctorName;
    public String getMedicare() {
        return medicare;
@ -372,4 +373,12 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
}

+ 42 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -180,6 +180,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private BaseBannerDoctorService baseBannerDoctorService;
    @Autowired
    private BaseNatAppointmentDao baseNatAppointmentDao;
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
@ -890,6 +892,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                            if (listWPD!=null&&listWPD.size()!=0){
                                WaitPayDetailVO waitPayDetailVO = listWPD.get(0);
                                String voucherNo = waitPayDetailVO.getVoucherNo();
                                //判断处方
                                List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findByRealOrderList(waitPayDetailVO.getRecipeNo());
                                for (WlyyPrescriptionDO prescriptionDO:prescriptionDOList){
                                    if (prescriptionDO.getStatus()!=30){
@ -939,6 +942,45 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                        logger.info("处方结算成功"+pushPayLog+"====="+waitPayDetailVO.getRecipeNo());
                                    }
                                }
                                //判断检查订单
                                List<BaseNatAppointmentDO> baseNatAppointmentDOS = baseNatAppointmentDao.findByRealOrderList(waitPayDetailVO.getRecipeNo());
                                for (BaseNatAppointmentDO natAppointmentDO:baseNatAppointmentDOS){
                                    natAppointmentDO.setPayStatus("1");
                                    baseNatAppointmentDao.save(natAppointmentDO);
                                    //发送支付成功通知
                                    String pushPayLog = null;
                                    String fee = waitPayDetailVO.getFee();
                                    if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                                        String title="您在厦门大学附属中山医院有一笔交易已支付完成!";
                                        pushPayLog = payInfoNoticeService.pushPrescriptionPayAndHsjc(natAppointmentDO.getPatientId(),natAppointmentDO.getDoctorName(),voucherNo,natAppointmentDO.getId()+"",fee,title,null);
                                    }
                                    //发送预约成功通知
                                    String name= natAppointmentDO.getName();
                                    String idcard = natAppointmentDO.getCardNo();
                                    String mobile = natAppointmentDO.getMobile();
                                    String url = "https://hlwyy.xmzsh.com";
                                    String date = DateUtil.dateToStrLong(natAppointmentDO.getAppointmentTime());
                                    String first = "尊敬的用户"+name+",您已完成线上自助核酸检测开单预约";
                                    String contentMsg = "申请人:"+name+";预约时间:"+date+";发票流水号:"+voucherNo;
                                    String remark="<div style=\"color:#ff4949;\">\n" +
                                            "        <p>备注:1、请您持核酸开单预约信息和发票流水号、医保卡/就诊卡/电子健康卡,提前15分钟至我院五号楼北侧(急诊部后侧)核酸检测点?号取管窗口绑定检测。</p >\n" +
                                            "<p>2、核酸检测标本采集24小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。</p >\n" +
                                            "    </div>";
                                    String responseMsg="";
                                    if ("xm_zsyy_wx".equalsIgnoreCase(wxId)) {
                                        responseMsg = entranceService.ehospitalNotice(
                                                name,
                                                idcard,
                                                mobile,
                                                first,
                                                url,
                                                contentMsg,
                                                remark);
                                        logger.info("中山发送模板消息返回结果="+responseMsg);
                                        System.out.println("结束发送模板消息");
                                    }
                                }
                            }
                            for (WaitPayDetailVO waitPayDetailVO:listWPD){
                                if (waitPayDetailVO.getItemName().equalsIgnoreCase("互联网医院复诊诊查费")){