Bladeren bron

眼科医保结算流程

wangzhinan 1 jaar geleden
bovenliggende
commit
ec3a9df746

+ 1 - 1
app/app-iot-server/pom.xml

@ -1,4 +1,4 @@
st<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <modelVersion>4.0.0</modelVersion>

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

@ -14923,15 +14923,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                }
            }
            }
            if (ylzMedicalRelationDO != null && ylzMedicalRelationDO.getStatus() == 1) {
            if (ylzMedicalRelationDO != null && ylzMedicalRelationDO.getStatus() == 1) {
                com.alibaba.fastjson.JSONObject object2 = hcyyPrescriptionService.selectCardInfo(outpatientDO.getCardNo());
                Double cardFee = object2.getDouble("ZHYE");
         /*       com.alibaba.fastjson.JSONObject object2 = hcyyPrescriptionService.selectCardInfo(outpatientDO.getCardNo());
                Double cardFee = object2.getDouble("ZHYE");*/
                //医保已结算直接返回数据
                //医保已结算直接返回数据
                List<YlzMedicalMxDO> mxDOList = ylzMedicailMxDao.findByMedicalId(ylzMedicalRelationDO.getId());
                List<YlzMedicalMxDO> mxDOList = ylzMedicailMxDao.findByMedicalId(ylzMedicalRelationDO.getId());
                ylzMedicalRelationDO.setYlzMedicalMxDOList(mxDOList);
                ylzMedicalRelationDO.setYlzMedicalMxDOList(mxDOList);
                BigDecimal b1 = new BigDecimal(ylzMedicalRelationDO.getPersonCash());//个人现金
                BigDecimal b1 = new BigDecimal(ylzMedicalRelationDO.getPersonCash());//个人现金
                BigDecimal b2 = new BigDecimal(ylzMedicalRelationDO.getPersonAccount());//个人账户
                BigDecimal b2 = new BigDecimal(ylzMedicalRelationDO.getPersonAccount());//个人账户
                BigDecimal b3 = new BigDecimal(ylzMedicalRelationDO.getMedicalPrice());//医保总金额
                BigDecimal b3 = new BigDecimal(ylzMedicalRelationDO.getMedicalPrice());//医保总金额
                ylzMedicalRelationDO.setBalance(cardFee + "");
                ylzMedicalRelationDO.setBalance("0");
                ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
                ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
                Double totalPirce = b1.add(b2).add(b3).doubleValue();
                Double totalPirce = b1.add(b2).add(b3).doubleValue();
                logger.info("总费用:" + totalPirce);
                logger.info("总费用:" + totalPirce);

File diff suppressed because it is too large
+ 215 - 9
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java


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

@ -3891,6 +3891,7 @@ public class YkyyEntranceService {
            ylzMedicalRelationDO.setCardNo(outpatientDO.getCardNo());
            ylzMedicalRelationDO.setCardNo(outpatientDO.getCardNo());
            ylzMedicalRelationDO.setDate(wlyyPrescriptionDO.getCreateTime());
            ylzMedicalRelationDO.setDate(wlyyPrescriptionDO.getCreateTime());
            ylzMedicalRelationDO.setBcwkje(wlyyPrescriptionDO.getDrugFee()+"");
            ylzMedicalRelationDO.setBcwkje(wlyyPrescriptionDO.getDrugFee()+"");
            ylzMedicalRelationDO.setCreateTime(new Date());
        }else {
        }else {
            ylzMedicalRelationDO.setLogNo(wlyyPrescriptionDO.getRealOrder());
            ylzMedicalRelationDO.setLogNo(wlyyPrescriptionDO.getRealOrder());
            ylzMedicalRelationDO.setRelationCode(outpatientId);
            ylzMedicalRelationDO.setRelationCode(outpatientId);
@ -3940,7 +3941,7 @@ public class YkyyEntranceService {
            medicalMxDO.setHisDetailSn(infoDO.getHisCode()+"");
            medicalMxDO.setHisDetailSn(infoDO.getHisCode()+"");
            medicalMxDO.setItemCode(infoDO.getGjbm());
            medicalMxDO.setItemCode(infoDO.getGjbm());
            medicalMxDO.setPrescriptionCode(wlyyPrescriptionDO.getRealOrder());
            medicalMxDO.setPrescriptionCode(wlyyPrescriptionDO.getRealOrder());
            medicalMxDO.setChargeUnit(infoDO.getUnit());
            medicalMxDO.setChargeUnit(infoDO.getPackUnit());
            medicalMxDO.setSpecificationType(infoDO.getSpecification());
            medicalMxDO.setSpecificationType(infoDO.getSpecification());
            medicalMxDO.setAmount(infoDO.getQuantity());
            medicalMxDO.setAmount(infoDO.getQuantity());
            medicalMxDO.setPrice(infoDO.getPackRetprice()+"");
            medicalMxDO.setPrice(infoDO.getPackRetprice()+"");

+ 178 - 3
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -27,6 +27,7 @@ import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.HcyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.HcyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.YkyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.HcyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.HcyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
@ -90,6 +91,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    @Autowired
    @Autowired
    private BusinessOrderDao businessOrderDao;
    private BusinessOrderDao businessOrderDao;
    @Autowired
    @Autowired
    private YkyyPrescriptionService ykyyPrescriptionService;
    @Autowired
    private WechatDao wechatDao;
    private WechatDao wechatDao;
    @Autowired
    @Autowired
    private WxPayLogDao wxPayLogDao;
    private WxPayLogDao wxPayLogDao;
@ -978,14 +981,14 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                        }
                        }
                    }
                    }
                }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
                }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
                    List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(businessOrderDO.getRelationCode());
                    /*List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(businessOrderDO.getRelationCode());
                    if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
                    if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
                        WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
                        WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
                        wlyyPrescriptionDO.setStatus(30);
                        wlyyPrescriptionDO.setStatus(30);
                        wlyyPrescriptionDO.setPayStatus(1);
                        wlyyPrescriptionDO.setPayStatus(1);
                        wlyyPrescriptionDO.setPayTime(new Date());
                        wlyyPrescriptionDO.setPayTime(new Date());
                        prescriptionDao.save(wlyyPrescriptionDO);
                        prescriptionDao.save(wlyyPrescriptionDO);
                        /*List<WlyyInspectionDO> inspectionDOList = inspectionDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                        *//*List<WlyyInspectionDO> inspectionDOList = inspectionDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                        for (WlyyInspectionDO wlyyInspectionDO:inspectionDOList){
                        for (WlyyInspectionDO wlyyInspectionDO:inspectionDOList){
                            String updateMsYj01 = "update V_MS_YJ01 t set t.HLWJF=1 where t.yjxh='"+wlyyInspectionDO.getHisCode()+"'";
                            String updateMsYj01 = "update V_MS_YJ01 t set t.HLWJF=1 where t.yjxh='"+wlyyInspectionDO.getHisCode()+"'";
                            try {
                            try {
@ -993,7 +996,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                            } catch (Exception e) {
                            } catch (Exception e) {
                                e.printStackTrace();
                                e.printStackTrace();
                            }
                            }
                        }*/
                        }*//*
                        prescriptionLogService.addPrescriptionLog(wlyyPrescriptionDO.getId(),30,1,wlyyPrescriptionDO.getPatientCode(),wlyyPrescriptionDO.getPatientName(),"",new Date());
                        prescriptionLogService.addPrescriptionLog(wlyyPrescriptionDO.getId(),30,1,wlyyPrescriptionDO.getPatientCode(),wlyyPrescriptionDO.getPatientName(),"",new Date());
                        List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                        List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                        if (infoDOS!=null&&infoDOS.size()!=0){
                        if (infoDOS!=null&&infoDOS.size()!=0){
@ -1055,7 +1058,17 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                                e.printStackTrace();
                                e.printStackTrace();
                            }
                            }
                        }
                        }
                        }*/
                    List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(businessOrderDO.getRelationCode());
                    if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
                        WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
                        try {
                            ykyyPrescriptionService.confirmSettlement(wlyyPrescriptionDO.getOutpatientId());
                        } catch (Exception e) {
                            throw new RuntimeException(e);
                        }
                        }
                    }
                }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("5")){
                }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("5")){
                    String price = Integer.parseInt(totalFee)/100+"";
                    String price = Integer.parseInt(totalFee)/100+"";
@ -1690,6 +1703,11 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                        String url="https://ih.xmheart.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                        String url="https://ih.xmheart.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                        enterpriseService.sendTWMesByDoctor("xm_xzzx_wx",outpatientDO.getDoctor(),title,msg,url);
                        enterpriseService.sendTWMesByDoctor("xm_xzzx_wx",outpatientDO.getDoctor(),title,msg,url);
                    }else if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
                    }else if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
                        BaseDoctorDO baseDoctorDO= doctorDao.findById(wlyyOutpatientDO.getDoctor());
                        if (baseDoctorDO!=null){
                            ykyySMSService.sendSmsByTempcode("consult_remind",wlyyOutpatientDO,null,baseDoctorDO.getMobile());
                            prescriptionService.wxTempalteJPush("outpatient_remind",wlyyOutpatientDO,null,"","","","");
                        }
                        String url=baseUrl+"/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                        String url=baseUrl+"/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                        enterpriseService.sendTWMesByDoctor("xm_ykyy_wx",outpatientDO.getDoctor(),title,msg,url);
                        enterpriseService.sendTWMesByDoctor("xm_ykyy_wx",outpatientDO.getDoctor(),title,msg,url);
                    }else if (wxId.equalsIgnoreCase("xm_hcyy_wx")){
                    }else if (wxId.equalsIgnoreCase("xm_hcyy_wx")){
@ -2321,6 +2339,163 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        }
        }
    }
    }
    /**
     * 眼科自费结算部分
     *
     * @param code
     * @param depositType
     * @param wechatId
     * @return
     * @throws Exception
     */
    public Map<String,Object> ylzRechargePreYk(String code,String depositType,String wechatId,String cardType,String cardNo,boolean demoFlag,String appletCode) throws Exception {
        try {
            WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
            if(wxWechatDO==null){
                throw new Exception("can't find wechat:the wxId is "+wechatId);
            }
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(code);
            YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(code);
            List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(code);
            WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(ylzMedicalRelationDO.getId());
            BigDecimal b1 = new BigDecimal(ylzMedicalRelationDO.getBcwkje());//总金额
            BigDecimal b2 = new BigDecimal(ylzMedicalRelationDO.getPersonAccount());//个人账户
            BigDecimal b3 = new BigDecimal(ylzMedicalRelationDO.getMedicalPrice());//医保总金额
            Double fee = b1.subtract(b2).subtract(b3).doubleValue();
            if (businessOrderDO==null) {
                businessOrderDO = new BusinessOrderDO();
                businessOrderDO.setCreateTime(new Date());
                businessOrderDO.setUpdateTime(new Date());
                businessOrderDO.setStatus(0);
                businessOrderDO.setOrderNo("HLWYY" + System.currentTimeMillis() + (int) (Math.random() * 900) + 100);
                businessOrderDO.setUploadStatus(0);
                businessOrderDO.setPayType(1);
                businessOrderDO.setRelationCode(ylzMedicalRelationDO.getId());
                businessOrderDO.setRelationName("处方结算");
                businessOrderDO.setOrderCategory("4");
                businessOrderDO.setOrderType(4);
                businessOrderDO.setDoctor(wlyyOutpatientDO.getDoctor());
                businessOrderDO.setPatient(wlyyOutpatientDO.getConsumer());
                businessOrderDO.setPatientName(wlyyOutpatientDO.getConsumerName());
                String a = String.valueOf(String.format("%.2f",fee));
                BigDecimal b = new BigDecimal(a);
                BigDecimal c = new BigDecimal(String.valueOf(100));
                BigDecimal bc = b.multiply(c);
                businessOrderDO.setPayPrice(bc.doubleValue());
                businessOrderDO.setDescription("处方结算");
                businessOrderDO = businessOrderDao.save(businessOrderDO);
                wlyyPrescriptionDO.setOrderNo(businessOrderDO.getOrderNo());
                wlyyPrescriptionDO.setOrderId(getCode());
                wlyyPrescriptionDO = prescriptionDao.save(wlyyPrescriptionDO);
                JSONArray array = new JSONArray();
                List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(code, 1);
                if (wechatId.equalsIgnoreCase("xm_ykyy_wx")){
                    WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("YKTCONTROL");
                    for (WlyyPrescriptionInfoDO prescriptionInfoDO : wlyyPrescriptionInfoDOS) {
                        JSONObject object = new JSONObject();
                        //{"commodityName":"","commodityPrice":"","DrugUnit":"","MedicineDoctor":""}
                        object.put("commodityName", prescriptionInfoDO.getDrugName());
                        object.put("commodityPrice", prescriptionInfoDO.getPackRetprice());
                        object.put("DrugUnit", prescriptionInfoDO.getPackUnitName());
                        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(businessOrderDO.getDoctor());
                        String yktDoctor = "";
                        if (doctorMappingDO != null && StringUtils.isNoneBlank(doctorMappingDO.getMappingCode())) {
                            System.out.println("----------------"+hospitalSysDictDO.getDictValue());
                            if (null != hospitalSysDictDO && "0".equalsIgnoreCase(hospitalSysDictDO.getDictValue())) {
                            } else {
                                String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
                                JSONObject jsonObject = JSONObject.parseObject(doctorResponse);
                                if (jsonObject.getInteger("code") == 200) {
                                    JSONArray array1 = jsonObject.getJSONArray("data");
                                    if (array1 != null && array1.size() != 0) {
                                        yktDoctor = array1.getJSONObject(0).getString("DOCTORUSERID");
                                    }
                                }
                            }
                        } else {
                            throw new Exception("医生映射表不存在!");
                        }
                        object.put("MedicineDoctor", yktDoctor);
                        array.add(object);
                    }
                    BasePatientDO patientDO = patientDao.findById(businessOrderDO.getPatient());
                    String userId = null;
                    if (patientDO != null) {
                        userId = patientDO.getUserId();
                    }
                    if (null != hospitalSysDictDO && "0".equalsIgnoreCase(hospitalSysDictDO.getDictValue())) {
                    } else {
                        String response2 = ykyyService.addOrder4Jkzl("1", wlyyPrescriptionDO.getOrderId(), businessOrderDO.getOrderNo(), userId, array);
                        if (StringUtils.isNoneBlank(response2)) {
                            JSONObject jsonObject = JSONObject.parseObject(response2);
                            if (jsonObject.getString("code").equalsIgnoreCase("10000")) {
                                String orderId = jsonObject.getString("orderId");
                                String orderNo = jsonObject.getString("orderNo");
                                businessOrderDO.setYkOrderId(orderId);
                                businessOrderDO.setYkOrderNo(orderNo);
                                businessOrderDO.setUploadStatus(1);
                                businessOrderDao.save(businessOrderDO);
                            }
                        }
                    }
                }
            }else {
                if (businessOrderDO.getStatus()==1){
                    throw new Exception("该处方已支付过");
                }
                String a = String.valueOf(String.format("%.2f",fee));
                BigDecimal b = new BigDecimal(a);
                BigDecimal c = new BigDecimal(String.valueOf(100));
                BigDecimal bc = b.multiply(c);
                businessOrderDO.setPayPrice(bc.doubleValue());
                businessOrderDO = businessOrderDao.save(businessOrderDO);
            }
            Map<String,Object> map = new HashedMap();
            if(wxWechatDO==null){
                throw new Exception("can't find wechat:the wxId is "+wechatId);
            }
            if (businessOrderDO!=null){
                if (businessOrderDO.getStatus()==1){
                    throw new Exception("该处方已支付过");
                }
                String openId = "";
                if (StringUtils.isNotBlank(appletCode)){
                    logger.info("appletCode不为空"+appletCode);
                    Map<String,Object> objectMap = checkApplets(appletCode,wxWechatDO.getApplets(),wxWechatDO.getAppletsSecret());
                    if (objectMap!=null){
                        openId = objectMap.get("openid").toString();
                        logger.info("appletCode"+appletCode);
                        logger.info("openid"+openId);
                    }
                }else {
                    logger.info("appletCode为空"+appletCode);
                    List<BasePatientWechatDo> patientWechatDo = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
                    if (patientWechatDo!=null&&patientWechatDo.size()!=0){
                        openId = patientWechatDo.get(0).getOpenid();
                    }
                }
                if (businessOrderDO.getOrderNo()!=null&&businessOrderDO.getOrderNo().contains("HLWYYQD")){
                    businessOrderDO.setOrderNo("HLWYYQD"+businessOrderDO.getOrderType()+System.currentTimeMillis()+(int)(Math.random()*900)+100);
                }else {
                    businessOrderDO.setOrderNo("HLWYY"+businessOrderDO.getOrderType()+System.currentTimeMillis()+(int)(Math.random()*900)+100);
                }
                businessOrderDO= businessOrderDao.save(businessOrderDO);
                String url = wxWechatDO.getBaseUrl();
                String notifyUrl =url;
                String totalFee =businessOrderDO.getPayPrice().intValue()+"";
                map = unifiedorder(wechatId,businessOrderDO.getDescription(),totalFee, depositType,openId,businessOrderDO.getOrderNo(),notifyUrl,businessOrderDO.getPatient());
            }
            return map;
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }
    /**
    /**
     * 咨询退费
     * 咨询退费
     * @param consult
     * @param consult

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/utils/YkyySMSService.java

@ -206,7 +206,7 @@ public class YkyySMSService {
            }else if ("oneself_pick".equalsIgnoreCase(temlateCode)){//病人自取
            }else if ("oneself_pick".equalsIgnoreCase(temlateCode)){//病人自取
                smsTemplateDO = smsTemplateDao.findByClientId("oneself_pick");
                smsTemplateDO = smsTemplateDao.findByClientId("oneself_pick");
                if (smsTemplateDO!=null){
                if (smsTemplateDO!=null){
                    content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{门诊号码}}",wlyyOutpatientDO.getRealOrder())
                    content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方号码}}",wlyyPrescriptionDO.getRealOrder())
                    .replace("{{性别}}",sex);
                    .replace("{{性别}}",sex);
                    if (wxPushLogDO==null&&"1".equalsIgnoreCase(sendMesControl)){
                    if (wxPushLogDO==null&&"1".equalsIgnoreCase(sendMesControl)){
                        ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
                        ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);

+ 568 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/HlwMzybjsDO.java

@ -0,0 +1,568 @@
package com.yihu.jw.entity.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.boot.ApplicationRunner;
import javax.persistence.*;
import java.util.Date;
/**
 * 医保结算表
 *
 * */
@Entity
@Table(name = "v_hlw_mzybjs")
public class HlwMzybjsDO {
    private String insuranceSerial;//医保流水号
    private String billSerial;//医保收费流水号
    private String hisBillSerial;//收费流水号
    private String medicalMode;//医疗就诊方式MEDICAL_MODE
    private String medicalType;//医疗类别MEDICAL_TYPE
    private String regionCode;//参保地区划代码REGION_CODE
    private String idcard;//证件号码IDCARD
    private String certType;//证件类型CERT_TYPE
    private String personalCode;//个人管理码PERSONAL_CODE
    private String name;//姓名NAME
    private String sex;//性别SEX
    private String sexMc;//性别名称SEX_MC
    private String insutype;//险种类型INSUTYPE
    private String clrOptins;//清算经办机构CLR_OPTINS
    private String clrWay;//清算方式CLR_WAY
    private String clrType;//清算类别CLR_TYPE
    private String diseaseCode;//病种编码DISEASE_CODE
    private String treatmentType;//人员待遇类别TREATMENT_TYPE
    private String treatmentTypeName;//人员待遇类别名称TREATMENT_TYPE_NAME
    private String treatmentStatus;//医疗待遇状态TREATMENT_STATUS
    private String treatmentStatusName;//医疗待遇状态名称TREATMENT_STATUS_NAME
    private String allopatryType;//异地就医类型ALLOPATRY_TYPE
    private String allopatryTypeName;//异地就医类型名称ALLOPATRY_TYPE_NAME
    private String administrativeArea;//参保地行政区划ADMINISTRATIVE_AREA
    private Double payStandard;//统筹支付医保费用起付标准PAY_STANDARD
    private Double totalAmount;//医疗费总金额TOTAL_AMOUNT
    private Double personCash;//个人现金支付金额(实付现金)PERSON_CASH
    private Double personAccount;//个人账户支付金额PERSON_ACCOUNT
    private Double fundAmount;//基金支付总额FUND_AMOUNT
    private Double tcjjPay;//其中:统筹基金支付TCJJ_PAY
    private Double sbjjPay;//其中:商保基金支付(大额补充)SBJJ_PAY
    private Double gwyPay;//其中:公务员医疗补助GWY_PAY
    private Double jzfpPay;//其中:精准扶贫医疗叠加JZFP_PAY
    private Double yljzPay;//其中:医疗救助基金YLJZ_PAY
    private Double otherPay;//其中:其他基金支付OTHER_PAY
    private Double enterpriseSupplement;//其中:企业补充ENTERPRISE_SUPPLEMENT
    private Double jtgjPay;//家庭共济账户支付JTGJ_PAY
    private Double jkzhPay;//健康帐户支付JKZH_PAY
    private Double ownPay;//个人自费(非医保费用)OWN_PAY
    private Double accountBalance;//个人账户余额ACCOUNT_BALANCE
    private Integer hospitalizationQty;//本年度住院次数HOSPITALIZATION_QTY
    private String sjjzDate;//实际就诊日期
    private String sjjzTime;//实际就诊时间
    private String payDate;//费用发生日期(结算日期)PAY_DATE
    private String payTime;//费用发生时间(结算时间)PAY_TIME
    private String collector;//收费人COLLECTOR
    private String fphm;//票据号码FPHM
    private Date jsrq;//结算日期JSRQ
    private Integer zfpb;//作废判别ZFPB
    private Date zfrq;//作废日期ZFRQ
    @Id
    @Column(name = "INSURANCE_SERIAL")
    public String getInsuranceSerial() {
        return insuranceSerial;
    }
    public void setInsuranceSerial(String insuranceSerial) {
        this.insuranceSerial = insuranceSerial;
    }
    @Basic
    @Column(name = "BILL_SERIAL")
    public String getBillSerial() {
        return billSerial;
    }
    public void setBillSerial(String billSerial) {
        this.billSerial = billSerial;
    }
    @Basic
    @Column(name = "HIS_BILL_SERIAL")
    public String getHisBillSerial() {
        return hisBillSerial;
    }
    public void setHisBillSerial(String hisBillSerial) {
        this.hisBillSerial = hisBillSerial;
    }
    @Basic
    @Column(name = "MEDICAL_MODE")
    public String getMedicalMode() {
        return medicalMode;
    }
    public void setMedicalMode(String medicalMode) {
        this.medicalMode = medicalMode;
    }
    @Basic
    @Column(name = "MEDICAL_TYPE")
    public String getMedicalType() {
        return medicalType;
    }
    public void setMedicalType(String medicalType) {
        this.medicalType = medicalType;
    }
    @Basic
    @Column(name = "REGION_CODE")
    public String getRegionCode() {
        return regionCode;
    }
    public void setRegionCode(String regionCode) {
        this.regionCode = regionCode;
    }
    @Basic
    @Column(name = "IDCARD")
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    @Basic
    @Column(name = "CERT_TYPE")
    public String getCertType() {
        return certType;
    }
    public void setCertType(String certType) {
        this.certType = certType;
    }
    @Basic
    @Column(name = "PERSONAL_CODE")
    public String getPersonalCode() {
        return personalCode;
    }
    public void setPersonalCode(String personalCode) {
        this.personalCode = personalCode;
    }
    @Basic
    @Column(name = "NAME")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Basic
    @Column(name = "SEX")
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    @Basic
    @Column(name = "SEX_MC")
    public String getSexMc() {
        return sexMc;
    }
    public void setSexMc(String sexMc) {
        this.sexMc = sexMc;
    }
    @Basic
    @Column(name = "INSUTYPE")
    public String getInsutype() {
        return insutype;
    }
    public void setInsutype(String insutype) {
        this.insutype = insutype;
    }
    @Basic
    @Column(name = "CLR_OPTINS")
    public String getClrOptins() {
        return clrOptins;
    }
    public void setClrOptins(String clrOptins) {
        this.clrOptins = clrOptins;
    }
    @Basic
    @Column(name = "CLR_WAY")
    public String getClrWay() {
        return clrWay;
    }
    public void setClrWay(String clrWay) {
        this.clrWay = clrWay;
    }
    @Basic
    @Column(name = "CLR_TYPE")
    public String getClrType() {
        return clrType;
    }
    public void setClrType(String clrType) {
        this.clrType = clrType;
    }
    @Basic
    @Column(name = "DISEASE_CODE")
    public String getDiseaseCode() {
        return diseaseCode;
    }
    public void setDiseaseCode(String diseaseCode) {
        this.diseaseCode = diseaseCode;
    }
    @Basic
    @Column(name = "TREATMENT_TYPE")
    public String getTreatmentType() {
        return treatmentType;
    }
    public void setTreatmentType(String treatmentType) {
        this.treatmentType = treatmentType;
    }
    @Basic
    @Column(name = "TREATMENT_TYPE_NAME")
    public String getTreatmentTypeName() {
        return treatmentTypeName;
    }
    public void setTreatmentTypeName(String treatmentTypeName) {
        this.treatmentTypeName = treatmentTypeName;
    }
    @Basic
    @Column(name = "TREATMENT_STATUS")
    public String getTreatmentStatus() {
        return treatmentStatus;
    }
    public void setTreatmentStatus(String treatmentStatus) {
        this.treatmentStatus = treatmentStatus;
    }
    @Basic
    @Column(name = "TREATMENT_STATUS_NAME")
    public String getTreatmentStatusName() {
        return treatmentStatusName;
    }
    public void setTreatmentStatusName(String treatmentStatusName) {
        this.treatmentStatusName = treatmentStatusName;
    }
    @Basic
    @Column(name = "ALLOPATRY_TYPE")
    public String getAllopatryType() {
        return allopatryType;
    }
    public void setAllopatryType(String allopatryType) {
        this.allopatryType = allopatryType;
    }
    @Basic
    @Column(name = "ALLOPATRY_TYPE_NAME")
    public String getAllopatryTypeName() {
        return allopatryTypeName;
    }
    public void setAllopatryTypeName(String allopatryTypeName) {
        this.allopatryTypeName = allopatryTypeName;
    }
    @Basic
    @Column(name = "ADMINISTRATIVE_AREA")
    public String getAdministrativeArea() {
        return administrativeArea;
    }
    public void setAdministrativeArea(String administrativeArea) {
        this.administrativeArea = administrativeArea;
    }
    @Basic
    @Column(name = "PAY_STANDARD")
    public Double getPayStandard() {
        return payStandard;
    }
    public void setPayStandard(Double payStandard) {
        this.payStandard = payStandard;
    }
    @Basic
    @Column(name = "TOTAL_AMOUNT")
    public Double getTotalAmount() {
        return totalAmount;
    }
    public void setTotalAmount(Double totalAmount) {
        this.totalAmount = totalAmount;
    }
    @Basic
    @Column(name = "PERSON_CASH")
    public Double getPersonCash() {
        return personCash;
    }
    public void setPersonCash(Double personCash) {
        this.personCash = personCash;
    }
    @Basic
    @Column(name = "PERSON_ACCOUNT")
    public Double getPersonAccount() {
        return personAccount;
    }
    public void setPersonAccount(Double personAccount) {
        this.personAccount = personAccount;
    }
    @Basic
    @Column(name = "FUND_AMOUNT")
    public Double getFundAmount() {
        return fundAmount;
    }
    public void setFundAmount(Double fundAmount) {
        this.fundAmount = fundAmount;
    }
    @Basic
    @Column(name = "TCJJ_PAY")
    public Double getTcjjPay() {
        return tcjjPay;
    }
    public void setTcjjPay(Double tcjjPay) {
        this.tcjjPay = tcjjPay;
    }
    @Basic
    @Column(name = "SBJJ_PAY")
    public Double getSbjjPay() {
        return sbjjPay;
    }
    public void setSbjjPay(Double sbjjPay) {
        this.sbjjPay = sbjjPay;
    }
    @Basic
    @Column(name = "GWY_PAY")
    public Double getGwyPay() {
        return gwyPay;
    }
    public void setGwyPay(Double gwyPay) {
        this.gwyPay = gwyPay;
    }
    @Basic
    @Column(name = "JZFP_PAY")
    public Double getJzfpPay() {
        return jzfpPay;
    }
    public void setJzfpPay(Double jzfpPay) {
        this.jzfpPay = jzfpPay;
    }
    @Basic
    @Column(name = "YLJZ_PAY")
    public Double getYljzPay() {
        return yljzPay;
    }
    public void setYljzPay(Double yljzPay) {
        this.yljzPay = yljzPay;
    }
    @Basic
    @Column(name = "OTHER_PAY")
    public Double getOtherPay() {
        return otherPay;
    }
    public void setOtherPay(Double otherPay) {
        this.otherPay = otherPay;
    }
    @Basic
    @Column(name = "ENTERPRISE_SUPPLEMENT")
    public Double getEnterpriseSupplement() {
        return enterpriseSupplement;
    }
    public void setEnterpriseSupplement(Double enterpriseSupplement) {
        this.enterpriseSupplement = enterpriseSupplement;
    }
    @Basic
    @Column(name = "JTGJ_PAY")
    public Double getJtgjPay() {
        return jtgjPay;
    }
    public void setJtgjPay(Double jtgjPay) {
        this.jtgjPay = jtgjPay;
    }
    @Basic
    @Column(name = "JKZH_PAY")
    public Double getJkzhPay() {
        return jkzhPay;
    }
    public void setJkzhPay(Double jkzhPay) {
        this.jkzhPay = jkzhPay;
    }
    @Basic
    @Column(name = "OWN_PAY")
    public Double getOwnPay() {
        return ownPay;
    }
    public void setOwnPay(Double ownPay) {
        this.ownPay = ownPay;
    }
    @Basic
    @Column(name = "ACCOUNT_BALANCE")
    public Double getAccountBalance() {
        return accountBalance;
    }
    public void setAccountBalance(Double accountBalance) {
        this.accountBalance = accountBalance;
    }
    @Basic
    @Column(name = "HOSPITALIZATION_QTY")
    public Integer getHospitalizationQty() {
        return hospitalizationQty;
    }
    public void setHospitalizationQty(Integer hospitalizationQty) {
        this.hospitalizationQty = hospitalizationQty;
    }
    @Basic
    @Column(name = "SJJZDATE")
    public String getSjjzDate() {
        return sjjzDate;
    }
    public void setSjjzDate(String sjjzDate) {
        this.sjjzDate = sjjzDate;
    }
    @Basic
    @Column(name = "SJJZTIME")
    public String getSjjzTime() {
        return sjjzTime;
    }
    public void setSjjzTime(String sjjzTime) {
        this.sjjzTime = sjjzTime;
    }
    @Basic
    @Column(name = "PAY_DATE")
    public String getPayDate() {
        return payDate;
    }
    public void setPayDate(String payDate) {
        this.payDate = payDate;
    }
    @Basic
    @Column(name = "PAY_TIME")
    public String getPayTime() {
        return payTime;
    }
    public void setPayTime(String payTime) {
        this.payTime = payTime;
    }
    @Basic
    @Column(name = "COLLECTOR")
    public String getCollector() {
        return collector;
    }
    public void setCollector(String collector) {
        this.collector = collector;
    }
    @Basic
    @Column(name = "FPHM")
    public String getFphm() {
        return fphm;
    }
    public void setFphm(String fphm) {
        this.fphm = fphm;
    }
    @Basic
    @Column(name = "JSRQ")
    public Date getJsrq() {
        return jsrq;
    }
    public void setJsrq(Date jsrq) {
        this.jsrq = jsrq;
    }
    @Basic
    @Column(name = "ZFPB")
    public Integer getZfpb() {
        return zfpb;
    }
    public void setZfpb(Integer zfpb) {
        this.zfpb = zfpb;
    }
    @Basic
    @Column(name = "ZFRQ")
    public Date getZfrq() {
        return zfrq;
    }
    public void setZfrq(Date zfrq) {
        this.zfrq = zfrq;
    }
}

+ 14 - 0
common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java

@ -296,6 +296,20 @@ public class DateUtil {
        return formatter.format(dateDate);
        return formatter.format(dateDate);
    }
    }
    /**
     * 将长时间格式时间转换为字符串 yyyy-MM-dd HH:mm:ss
     *
     * @param dateDate
     * @return
     */
    public static String dateToShortStrHh(java.util.Date dateDate) {
        if (dateDate == null) {
            return "";
        }
        SimpleDateFormat formatter = new SimpleDateFormat(HH_MM_SS);
        return formatter.format(dateDate);
    }
    /**
    /**
     * 将长时间格式时间转换为字符串 yyyy-MM-dd HH:mm:ss
     * 将长时间格式时间转换为字符串 yyyy-MM-dd HH:mm:ss
     *
     *

+ 8 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java

@ -98,6 +98,10 @@ public class YkyyController extends EnvelopRestEndpoint {
            HlwGhmxDO hlwGhmxDO =  JSONObject.toJavaObject(object,HlwGhmxDO.class);
            HlwGhmxDO hlwGhmxDO =  JSONObject.toJavaObject(object,HlwGhmxDO.class);
            ykyyEntranceService.update(hlwGhmxDO);
            ykyyEntranceService.update(hlwGhmxDO);
            envelop.setObj(hlwGhmxDO);
            envelop.setObj(hlwGhmxDO);
        }else if(table.equalsIgnoreCase("HlwMzybjsDO")){
            HlwMzybjsDO hlwMzybjsDO =  JSONObject.toJavaObject(object,HlwMzybjsDO.class);
            ykyyEntranceService.update(hlwMzybjsDO);
            envelop.setObj(hlwMzybjsDO);
        }
        }
        return success(envelop);
        return success(envelop);
    }
    }
@ -219,6 +223,10 @@ public class YkyyController extends EnvelopRestEndpoint {
            envelop.setObj(object1);
            envelop.setObj(object1);
            hlwYsMzJzLsDO.setJZXH(jzxh.intValue());
            hlwYsMzJzLsDO.setJZXH(jzxh.intValue());
            ykyyEntranceService.save(hlwYsMzJzLsDO);
            ykyyEntranceService.save(hlwYsMzJzLsDO);
        }else if(table.equalsIgnoreCase("HlwMzybjsDO")){
            // portal_his.gy_identity_ms@xec_link
            HlwMzybjsDO hlwMzybjsDO =  JSONObject.toJavaObject(object,HlwMzybjsDO.class);
            ykyyEntranceService.save(hlwMzybjsDO);
        }
        }
        return envelop;
        return envelop;

+ 2 - 2
svr/svr-internet-hospital/pom.xml

@ -11,7 +11,7 @@
    </parent>
    </parent>
    <groupId>com.yihu.jw</groupId>
    <groupId>com.yihu.jw</groupId>
    <artifactId>svr-internet-hospital</artifactId>
    <artifactId>svr-internet-hospital-test</artifactId>
    <packaging>jar</packaging>
    <packaging>jar</packaging>
    <version>${parent.version}</version>
    <version>${parent.version}</version>
@ -267,7 +267,7 @@
    </dependencies>
    </dependencies>
    <build>
    <build>
        <finalName>svr-internet-hospital</finalName>
        <finalName>svr-internet-hospital-test</finalName>
        <plugins>
        <plugins>
            <plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <groupId>org.apache.maven.plugins</groupId>

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

@ -770,6 +770,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                            YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findOne(businessOrderDO.getRelationCode());
                            YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findOne(businessOrderDO.getRelationCode());
                            if (wxId.equalsIgnoreCase("xm_hcyy_wx")){
                            if (wxId.equalsIgnoreCase("xm_hcyy_wx")){
                                hcyyPrescriptionService.confirmSettlement(ylzMedicalRelationDO.getRelationCode());
                                hcyyPrescriptionService.confirmSettlement(ylzMedicalRelationDO.getRelationCode());
                            }if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
                                ykyyPrescriptionService.confirmSettlement(ylzMedicalRelationDO.getRelationCode());
                            }else {
                            }else {
                                prescriptionService.confirmSettlementService(ylzMedicalRelationDO.getRelationCode());
                                prescriptionService.confirmSettlementService(ylzMedicalRelationDO.getRelationCode());
                            }
                            }

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

@ -142,6 +142,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    @Autowired
    private HcyyPrescriptionService hcyyPrescriptionService;
    private HcyyPrescriptionService hcyyPrescriptionService;
    @Autowired
    private YkyyPrescriptionService ykyyPrescriptionService;
    @Value("${qywx.id}")
    @Value("${qywx.id}")
    private String qywxId;
    private String qywxId;
@ -2165,13 +2167,17 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(required = true) String relationCode,
            @RequestParam(required = true) String relationCode,
            @ApiParam(name = "depositType", value = "depositType", required = true)
            @ApiParam(name = "depositType", value = "depositType", required = true)
            @RequestParam(required = true) String depositType,
            @RequestParam(required = true) String depositType,
            @ApiParam(name = "cardType", value = "cardType", required = true)
            @RequestParam(required = true) String cardType,
            @ApiParam(name = "cardNo", value = "cardNo", required = true)
            @RequestParam(required = true) String cardNo) throws Exception {
            @ApiParam(name = "cardType", value = "cardType", required = false)
            @RequestParam(required = false) String cardType,
            @ApiParam(name = "cardNo", value = "cardNo", required = false)
            @RequestParam(required = false) String cardNo,
            @ApiParam(name = "appletCode", value = "appletCode", required = false)
            @RequestParam(required = false) String appletCode) throws Exception {
        try {
        try {
            if (wxId.equalsIgnoreCase("xm_hcyy_wx")){
            if (wxId.equalsIgnoreCase("xm_hcyy_wx")){
                return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargePreHc(relationCode, depositType, wxId, cardType, cardNo, demoFlag));
                return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargePreHc(relationCode, depositType, wxId, cardType, cardNo, demoFlag));
            } else if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
                return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargePreYk(relationCode, depositType, wxId, cardType, cardNo, demoFlag,appletCode));
            }
            }
            return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargePre(relationCode, depositType, wxId, cardType, cardNo, demoFlag));
            return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargePre(relationCode, depositType, wxId, cardType, cardNo, demoFlag));
        } catch (Exception e) {
        } catch (Exception e) {
@ -3695,6 +3701,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
        try {
            if (wxId.equalsIgnoreCase("xm_hcyy_wx")){
            if (wxId.equalsIgnoreCase("xm_hcyy_wx")){
                return success("操作成功", hcyyPrescriptionService.confirmSettlement(outpatientId));
                return success("操作成功", hcyyPrescriptionService.confirmSettlement(outpatientId));
            }else if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
                return success("操作成功", ykyyPrescriptionService.confirmSettlement(outpatientId));
            }
            }
            return success("操作成功", prescriptionService.confirmSettlementService(outpatientId));
            return success("操作成功", prescriptionService.confirmSettlementService(outpatientId));
        } catch (Exception e) {
        } catch (Exception e) {