wangzhinan 1 år sedan
förälder
incheckning
d9d2658876
14 ändrade filer med 4038 tillägg och 16 borttagningar
  1. 173 0
      business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareNewService.java
  2. 4 0
      business/base-service/src/main/java/com/yihu/jw/hospital/family/dao/WlyyPatientFamilyMemberDao.java
  3. 19 0
      business/base-service/src/main/java/com/yihu/jw/hospital/healthCare/YlzMedicalUserInfoDao.java
  4. 159 8
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  5. 3305 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/DsyyEntranceService.java
  6. 1 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  7. 89 3
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  8. 2 4
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  9. 83 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/healthCare/YlzMedicalUserInfoDO.java
  10. 52 0
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/DsyyController.java
  11. 67 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/healthCare/HealthCareEndPoint.java
  12. 50 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  13. 9 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  14. 25 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java

+ 173 - 0
business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareNewService.java

@ -1,6 +1,7 @@
package com.yihu.jw.healthCare.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
@ -9,15 +10,18 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
import com.yihu.jw.entity.hospital.healthCare.*;
import com.yihu.jw.entity.hospital.httplog.YlzHttpLogDO;
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.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.healthCare.utils.AES;
import com.yihu.jw.healthCare.utils.SafeUtil;
import com.yihu.jw.healthCare.utils.YibaoJiaMi;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.family.dao.WlyyPatientFamilyMemberDao;
import com.yihu.jw.hospital.healthCare.*;
import com.yihu.jw.hospital.httplog.dao.YlzHttpLogDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
@ -27,9 +31,17 @@ import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.common.QrcodeUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.idcard.IdCardUtil;
import com.yihu.jw.utils.ByteToInputStream;
import com.yihu.utils.security.MD5;
import com.ylzinfo.ehc.EhcHandler;
import com.ylzinfo.ehc.trans.TransRequest;
import com.ylzinfo.ehc.trans.TransResponse;
import net.sf.json.util.JSONTokener;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -38,12 +50,16 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import javax.transaction.Transactional;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
 * 医保对接
@ -95,6 +111,12 @@ public class HealthCareNewService {
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    @Autowired
    private YlzMedicailRelationRefundDao ylzMedicailRelationRefundDao;
    @Autowired
    private YlzMedicalUserInfoDao ylzMedicalUserInfoDao;
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private WlyyPatientFamilyMemberDao familyMemberDao;
    private String ylzConfigUrl;
    private String ylzConfigAppid;
@ -103,6 +125,7 @@ public class HealthCareNewService {
    private String ylzConfigSignKey;
    private String ylzConfigOrgCode;
    public static String entranceHealthCareUrl = "http://127.0.0.1:10023/healthCare/";
@ -2281,4 +2304,154 @@ public class HealthCareNewService {
            return false;
        }
    }
    /**
     * 获取用户信息(N03.00.05.16)
     *
     * 返回值
     *
     * @param code 用户信息临时串
     * @return
     * @throws Exception
     */
    public String getUserInfo(String code) throws Exception{
        String funid = "N03.00.05.16";
        JSONObject data = new JSONObject();
        data.put("code",code);//用户信息临时串
        logger.info("data"+data.toJSONString());
        String result = requestYlz(data,funid,"获取用户信息");
        if (result==null){
            throw new Exception("获取用户信息失败");
        }
        return result;
    }
    /**
     * 获取医保二维码
     *
     * @return
     * @throws UnsupportedEncodingException
     */
    public Map<String,Object> getYbImage() throws UnsupportedEncodingException {
        String no = UUID.randomUUID().toString().substring(0,30);
        YlzMedicalUserInfoDO ylzMedicalUserInfoDO = new YlzMedicalUserInfoDO();
        ylzMedicalUserInfoDO.setNo(no);
        String redirectUrl = "https://hlwyy.xmhcyy.com/hcyy/ims-wx/#/login?no="+no;
        String url = "https://service.ylbz.xm.gov.cn/xmyb/web-ixm/app/#/ecAuth?redirectUrl="+ URLEncoder.encode(redirectUrl, "UTF-8");
        ylzMedicalUserInfoDO.setUrl(url);
        ylzMedicalUserInfoDO.setCreateTime(new Date());
        ylzMedicalUserInfoDao.save(ylzMedicalUserInfoDO);
        ByteToInputStream byteToInputStream = new ByteToInputStream();
        InputStream qrcode = QrcodeUtil.createQrcode(url,300,"jpg");
        String QRCodeImg = byteToInputStream.getBase64FromInputStream(qrcode);
        Map<String,Object> map = new HashedMap();
        map.put("QRCodeImg","data:image/png;base64,"+ QRCodeImg);
        map.put("out_authorize_no",no);
        return map;
    }
    /**
     *
     * @param no
     * @param token
     * @return
     * @throws Exception
     */
    public YlzMedicalUserInfoDO updateUserInfo(String no,String token) throws Exception {
        YlzMedicalUserInfoDO ylzMedicalUserInfoDO = ylzMedicalUserInfoDao.findByNo(no);
        String result = getUserInfo(token);
        ylzMedicalUserInfoDO.setToken(token);
        ylzMedicalUserInfoDO.setJson(result);
        ylzMedicalUserInfoDO = ylzMedicalUserInfoDao.save(ylzMedicalUserInfoDO);
        JSONObject object = JSONObject.parseObject(result);
        logger.info(object.toJSONString());
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject data = object.getJSONObject("encrypt_data");
            String idcard = data.getString("idcard");
            String name = data.getString("name");
            String cardno = data.getString("cardno");
            String sex = data.getString("sex");
            ylzMedicalUserInfoDO.setIdcard(idcard);
            ylzMedicalUserInfoDO.setName(name);
            BasePatientDO patientDO =  basePatientDao.findByIdcardAndDel(idcard,"1");
            if(StringUtils.isNotBlank(idcard)&&patientDO == null){
                BasePatientDO patient = new BasePatientDO();
                String salt = UUID.randomUUID().toString().substring(0,5);
                String pw = null;
                pw = idcard.substring(idcard.length()-6);
                patient.setIdcard(idcard);
                patient.setName(name);
                patient.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                patient.setSalt(salt);
                patient.setDel("1");
                patient.setEnabled(1);
                patient.setLocked(0);
                patient.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)));
                patient.setCreateTime(new Date());
                patient.setUpdateTime(new Date());
                patient.setBirthday(DateUtil.strToDate(IdCardUtil.getBirthdayForIdcardStr(idcard),"yyyyMMdd"));
                patientDO = basePatientDao.save(patient);
                WlyyPatientFamilyMemberDO basePatientFamilyMemberDO = familyMemberDao.findFamilyMemberByPatientAndRelationCode(patientDO.getId(),"7");
                if (basePatientFamilyMemberDO==null){
                    basePatientFamilyMemberDO = new WlyyPatientFamilyMemberDO();
                    basePatientFamilyMemberDO.setPatient(patientDO.getId());
                    basePatientFamilyMemberDO.setFamilyRelation("7");
                    basePatientFamilyMemberDO.setFamilyRelationName("自己");
                    basePatientFamilyMemberDO.setCardType("身份证");
                    basePatientFamilyMemberDO.setCardNo(patientDO.getIdcard());
                    basePatientFamilyMemberDO.setCreateTime(new Date());
                    basePatientFamilyMemberDO.setUpdateTime(new Date());
                    basePatientFamilyMemberDO.setIsAuthorize(1);
                    basePatientFamilyMemberDO.setIsDel(1);
                    basePatientFamilyMemberDO.setFamilyMember(patientDO.getId());
                    familyMemberDao.save(basePatientFamilyMemberDO);
                }
            }else {
                basePatientDao.save(patientDO);
                WlyyPatientFamilyMemberDO basePatientFamilyMemberDO = familyMemberDao.findFamilyMemberByPatientAndRelationCode(patientDO.getId(), "7");
                if (basePatientFamilyMemberDO == null) {
                    basePatientFamilyMemberDO = new WlyyPatientFamilyMemberDO();
                    basePatientFamilyMemberDO.setPatient(patientDO.getId());
                    basePatientFamilyMemberDO.setFamilyRelation("7");
                    basePatientFamilyMemberDO.setFamilyRelationName("自己");
                    basePatientFamilyMemberDO.setCardType("身份证");
                    basePatientFamilyMemberDO.setCardNo(patientDO.getIdcard());
                    basePatientFamilyMemberDO.setCreateTime(new Date());
                    basePatientFamilyMemberDO.setUpdateTime(new Date());
                    basePatientFamilyMemberDO.setIsAuthorize(1);
                    basePatientFamilyMemberDO.setIsDel(1);
                    basePatientFamilyMemberDO.setFamilyMember(patientDO.getId());
                    familyMemberDao.save(basePatientFamilyMemberDO);
                }
            }
            logger.info("获取用户信息成功");
        }
        return ylzMedicalUserInfoDO;
    }
    /**
     * 验证医保凭证是否授权
     * @param authorizeNo
     * @return
     */
    public Map<String,Object> checkOauthQRCode(String authorizeNo) {
        YlzMedicalUserInfoDO ylzMedicalUserInfoDO = ylzMedicalUserInfoDao.findByNo(authorizeNo);
        Map<String, Object> rsMap = new HashedMap();
        if (ylzMedicalUserInfoDO != null) {
            if (StringUtils.isNoneBlank(ylzMedicalUserInfoDO.getToken())) {
                rsMap.put("sCode", "succ");
                rsMap.put("sMes", "success");
            }else {
                rsMap.put("sCode", "ing");
                rsMap.put("sMes", "正在授权");
            }
        } else {
            rsMap.put("sCode", "ing");
            rsMap.put("sMes", "正在授权");
        }
        return rsMap;
    }
}

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

@ -27,4 +27,8 @@ public interface WlyyPatientFamilyMemberDao extends PagingAndSortingRepository<W
     * @return
     */
    WlyyPatientFamilyMemberDO findByPatientAndFamilyMember(String patient,String member);
    @Query("from WlyyPatientFamilyMemberDO t where t.patient = ?1 and t.familyRelation =?2 and t.isDel = 1 ")
    WlyyPatientFamilyMemberDO findFamilyMemberByPatientAndRelationCode(String patient,String familyRelation);
}

+ 19 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/healthCare/YlzMedicalUserInfoDao.java

@ -0,0 +1,19 @@
package com.yihu.jw.hospital.healthCare;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalBillDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalUserInfoDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by wangzhinan 20211003
 */
public interface YlzMedicalUserInfoDao extends PagingAndSortingRepository<YlzMedicalUserInfoDO, String>, JpaSpecificationExecutor<YlzMedicalUserInfoDO> {
    @Query("from YlzMedicalUserInfoDO a where a.no = ?1 ")
    YlzMedicalUserInfoDO findByNo(String no);
}

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

@ -8401,8 +8401,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                System.out.println("获取顺丰物流面单信息:1");
                sfexpress_obj = expressageDOList.get(0);
                List<WlyyPrescriptionDO> wlyyPrescriptionDOS1 = prescriptionDao.findByOutpatientId(wlyyPrescriptionDOS.getOutpatientId());
                if (StringUtils.isNoneBlank(sfexpress_obj.getMailno())&&wlyyPrescriptionDOS1.size()>1){
                    throw new Exception("已存在地址"+sfexpress_obj.getAddress()+"、电话"+sfexpress_obj.getMobile()+"的快递单(单号"+sfexpress_obj.getMailno()+"),请将此处方与其打包一起。");
                if (wlyyPrescriptionDOS.getStatus()<31){
                    if (StringUtils.isNoneBlank(sfexpress_obj.getMailno())&&wlyyPrescriptionDOS1.size()>1){
                        String orderNo = "";
                        for (WlyyPrescriptionDO prescriptionDO:wlyyPrescriptionDOS1){
                            if (!prescriptionDO.getRealOrder().equalsIgnoreCase(wlyyPrescriptionDOS.getRealOrder())){
                                orderNo = prescriptionDO.getRealOrder();
                            }
                        }
                        throw new Exception("已存在地址"+sfexpress_obj.getAddress()+"、电话"+sfexpress_obj.getMobile()+"的快递单(单号"+orderNo+"),请将此处方与其打包一起。");
                    }
                }
                String sql = "SELECT\n" +
                        "\tpe.outpatient_id as outpatientId,\n" +
@ -8420,11 +8428,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                List<Map<String,Object>> maps = jdbcTemplate.queryForList(sql);
                if (maps!=null&&maps.size()!=0){
                    Map<String,Object> map = maps.get(0);
                    if (!map.get("outpatientId").toString().equalsIgnoreCase(wlyyPrescriptionDOS.getOutpatientId())){
                        String mailNo= map.get("mailno").toString();
                        sfexpress_obj.setMailno(mailNo);
                        sfexpressService.updatePrescriptionExpressage(sfexpress_obj);
                        throw new Exception("已存在地址"+map.get("address")+"、电话"+map.get("mobile")+"的快递单(单号"+mailNo+"),请将此处方与其打包一起。");
                    if (wlyyPrescriptionDOS.getStatus()<31){
                        if (!map.get("outpatientId").toString().equalsIgnoreCase(wlyyPrescriptionDOS.getOutpatientId())){
                            String mailNo= map.get("mailno").toString();
                            sfexpress_obj.setMailno(mailNo);
                            sfexpressService.updatePrescriptionExpressage(sfexpress_obj);
                            List<WlyyPrescriptionDO> wlyyPrescriptionDOS2 = prescriptionDao.findByOutpatientId(map.get("outpatientId").toString());
                            String orderNo = "";
                            for (WlyyPrescriptionDO wlyyPrescriptionDO:wlyyPrescriptionDOS2){
                                orderNo +=wlyyPrescriptionDO.getRealOrder()+" ";
                            }
                            throw new Exception("已存在地址"+map.get("address")+"、电话"+map.get("mobile")+"的快递单(单号"+orderNo+"),请将此处方与其打包一起。");
                        }
                    }
                }
                System.out.println("获取顺丰物流面单信息:2");
@ -15612,6 +15627,89 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    /**
     * 收入日报导出
     * @param os
     * @param ls
     * @param startTime
     * @param endTime
     * @throws Exception
     */
    public void pushListWritePrescriptionPriceTotal(OutputStream os, List<Map<String, Object>> ls,String startTime,String endTime) throws Exception {
        WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
        try {
            WritableSheet ws;
            ws = wwb.createSheet("sheet", 1);
            String[] header = {"门诊收入项目汇总报表","","",""};//
            int k = 0;
            for (String h : header) {
                addCell(ws, 0, k, h);//表名,行,列,header
                k++;
            }
            String[] header1 = {"汇总日期:"+startTime+"至"+endTime,"","",""};//
            int k1 = 0;
            for (String h : header1) {
                addCell(ws, 1, k1, h);//表名,行,列,header
                k1++;
            }
            String[] header2 = {"医疗费总金额","人人现金支付金额(实付现金)","个人账户支付金额","医保基金支付总额","统筹基金支付","商保基金支付(大额补充)","公务员医疗补助","精准扶贫医疗叠加",
            "医疗救助基金","其他基金支付","企业补充","家庭共济账户支付","个人自费(非医保费用)"};//
            int k2 = 0;
            for (String h : header2) {
                addCell(ws, 2, k2, h);//表名,行,列,header
                k2++;
            }
            String payPrice = "0";
            String totalAmount ="0";
            String personAccount ="0";
            String personCash = "0";
            String tcjjPay = "0";
            String gwyPay = "0";
            String jkzhPay = "0";
            String jtgjPay = "0";
            String fundAmount ="0";
            String sbjjPay = "0";
            String jzfpPay = "0";
            String yljzPay = "0";
            String otherPay = "0";
            String enterpriseSupplement = "0";
            String ownPay = "0";
            for (Map<String, Object> m : ls) {
                payPrice = m.get("payPrice").toString();
                totalAmount = m.get("totalAmount").toString();
                personAccount = m.get("personAccount").toString();
                personCash = m.get("personCash").toString();
                tcjjPay = m.get("tcjjPay").toString();
                gwyPay = m.get("gwyPay").toString();
                jkzhPay = m.get("jkzhPay").toString();
                jtgjPay = m.get("jtgjPay").toString();
                fundAmount = m.get("fundAmount").toString();
                sbjjPay =m.get("sbjjPay").toString();
                jzfpPay = m.get("jzfpPay").toString();
                yljzPay = m.get("yljzPay").toString();
                otherPay = m.get("otherPay").toString();
                enterpriseSupplement = m.get("enterpriseSupplement").toString();
                ownPay = m.get("ownPay").toString();
            }
            int k3 = 0;
            String[] header3 = {totalAmount,personCash,personAccount,fundAmount,tcjjPay,sbjjPay,gwyPay,jzfpPay,yljzPay,otherPay,enterpriseSupplement,jtgjPay,ownPay};//
            for (String h : header3) {
                addCell(ws, 3, k3, h);//表名,行,列,header
                k3++;
            }
            ws.mergeCells(0,0,13,0);
            ws.mergeCells(0,1,13,1);
            wwb.write();
            wwb.close();
        } catch (IOException e) {
            e.printStackTrace();
            if (wwb != null) wwb.close();
            throw e;
        }
    }
    /**
     * 收入日报导出
     * @param os
@ -16017,7 +16115,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return mapList;
    }
    /**
     * 药品明细表导出
     *
@ -16111,6 +16208,60 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            throw e;
        }
    }
    /**
     * 收入日报
     */
    public List<Map<String, Object>> selectPrescriptionFeeTotal(String startTime,String endTime){
        List<Map<String, Object>> mapList = new ArrayList<>();
        Map<String, Object> params = new HashedMap();
        String sql =" SELECT\n" +
                "\tt.ORDER_CATEGORY AS \"orderCategory\",\n" +
                "\tSUM(t.PAY_PRICE) / 100 AS \"payPrice\",\n" +
                "    nvl (SUM(ymr.total_amount), 0) AS \"totalAmount\",\n" +
                "\tnvl (SUM(ymr.person_account), 0) AS \"personAccount\",\n" +
                "    nvl (SUM(ymr.person_cash), 0) AS \"personCash\",\n" +
                "    nvl(SUM(ymr.tcjj_pay),0) as \"tcjjPay\",\n" +
                "    nvl(SUM(ymr.gwy_pay),0) as \"gwyPay\",\n" +
                "    NVL(SUM(ymr.jkzh_pay),0) as \"jkzhPay\",\n" +
                "    nvl(SUM(ymr.jtgj_pay),0) as \"jtgjPay\","+
                "    nvl(SUM(ymr.fund_price),0) as \"fundAmount\","+
                "    nvl(SUM(ymr.sbjj_pay),0) as \"sbjjPay\","+
                "    nvl(SUM(ymr.jzfp_pay),0) as \"jzfpPay\","+
                "    nvl(SUM(ymr.yljz_pay),0) as \"yljzPay\","+
                "    nvl(SUM(ymr.other_pay),0) as \"otherPay\","+
                "    nvl(SUM(ymr.enterprise_supplement),0) as \"enterpriseSupplement\","+
                "    nvl(SUM(ymr.own_pay),0) as \"ownPay\","+
                "\tnvl (SUM(ymr.medical_price), 0) AS \"medicalPrice\",\n" +
                "\tnvl (SUM(ymr.medical_price), 0) + nvl (SUM(ymr.person_account), 0) AS \"medicalPrice1\"\n" +
                "FROM\n" +
                "\tBASE_BUSINESS_ORDER_PAY t\n" +
                "LEFT JOIN base_ylz_medical_relation ymr ON ymr.id = t.relation_code\n" +
                "WHERE\n" +
                "\tt.ORDER_CATEGORY IN (6)\n" +
                "AND t. STATUS = 1\n" ;
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
            sql+=" and t.create_time <= to_date('" + endTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
        } else {
            sql+=" and t.create_time <='"+endTime+"' ";
        }
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
            sql+=" and t.create_time >= to_date('" + startTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
        } else {
            sql+=" and t.create_time >='"+startTime+"' ";
        }
        sql+=" GROUP BY t.ORDER_CATEGORY ";
        logger.info("sql="+sql);
        mapList = hibenateUtils.createSQLQuery(sql, params);
        return mapList;
    }
    public ObjEnvelop selectNatTime(Integer flag)throws Exception{
        ObjEnvelop envelop = new ObjEnvelop();
        Date now = new Date();

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 3305 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/DsyyEntranceService.java


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

@ -436,6 +436,7 @@ public class EntranceService {
                                wlyyPrescriptionInfoVO.setSpecification(null != jsonObjectBody.get("DRUG_SPEC") ? jsonObjectBody.get("DRUG_SPEC").toString() : "");
                                wlyyPrescriptionInfoVO.setSerial(null!=jsonObjectBody.get("serial")? jsonObjectBody.get("serial").toString() : "");
                                wlyyPrescriptionInfoVO.setDel(1);
                                wlyyPrescriptionInfoVO.setSfybxm(null!=jsonObjectBody.get("ybxy")?jsonObjectBody.get("ybxy").toString() : "");
                                wlyyPrescriptionInfoVOS.add(wlyyPrescriptionInfoVO);
                            }
                        }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 89 - 3
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java


+ 2 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -19,15 +19,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
//==========mysql 环境 id策略======================================================
    @GeneratedValue(generator = "generator")
/*    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)
    @Column(name = "id", unique = true, nullable = false)*/
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
/*
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 83 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/healthCare/YlzMedicalUserInfoDO.java

@ -0,0 +1,83 @@
package com.yihu.jw.entity.hospital.healthCare;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by wangzhinan on 20211003
 * 医保发票打印
 */
@Entity
@Table(name = "base_ylz_medical_userinfo")
public class YlzMedicalUserInfoDO extends UuidIdentityEntityWithCreateTime {
    private String url;//医保二维码url
    private String no;//认证编码
    private String token;//医保跳转返回token
    private String json;//用户信息json
    private Date createTime;//创建时间
    private String idcard;//身份证
    private String name;//姓名
    public String getNo() {
        return no;
    }
    public void setNo(String no) {
        this.no = no;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getToken() {
        return token;
    }
    public void setToken(String token) {
        this.token = token;
    }
    public String getJson() {
        return json;
    }
    public void setJson(String json) {
        this.json = json;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
}

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

@ -0,0 +1,52 @@
package com.yihu.jw.entrance.controller;
import com.yihu.jw.hospital.prescription.service.entrance.DsyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.HcyyEntranceService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
 * Created by Trick on 2020/1/19.
 */
@RestController
@RequestMapping(value ="/dsyy")
@Api(value = "第三医院视图解析", description = "第三医院视图解析", tags = {"第三医院视图解析"})
public class DsyyController extends EnvelopRestEndpoint {
    @Autowired
    private DsyyEntranceService dsyyEntranceService;
    @GetMapping(value = "/createSQLQuery")
    @ApiOperation(value = "视图统一查询")
    public ListEnvelop createSQLQuery(@ApiParam(name = "sql", value = "sql语句", required = true)
                                      @RequestParam(value = "sql",required = true)String sql,
                                      @ApiParam(name = "params", value = "入参", required = false)
                                      @RequestParam(value = "params",required = false)Map<String, Object> params,
                                      @ApiParam(name = "page", value = "第几页", required = false)
                                      @RequestParam(value = "page",required = false)Integer page,
                                      @ApiParam(name = "size", value = "分页大小", required = false)
                                      @RequestParam(value = "size",required = false)Integer size){
        return success(dsyyEntranceService.createSQLQuery(sql,params,page,size));
    }
    @GetMapping(value = "/jdbcSQLQuery")
    @ApiOperation(value = "视图统一查询")
    public ListEnvelop jdbcSQLQuery(@ApiParam(name = "sql", value = "sql语句", required = true)
                                      @RequestParam(value = "sql",required = true)String sql){
        return success(dsyyEntranceService.jdbcSQLQuery(sql));
    }
    
}

+ 67 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/healthCare/HealthCareEndPoint.java

@ -746,4 +746,71 @@ public class HealthCareEndPoint extends EnvelopRestEndpoint {
            return failedObjEnvelopException(e);
        }
    }
    @PostMapping(value = "/getUserInfo")
    @ApiOperation(value = " 4.2.1获取用户信息(N03.00.05.16)", notes = " 4.2.1获取用户信息(N03.00.05.16)")
    public ObjEnvelop getUserInfo(@ApiParam(name = "code", value = "用户信息临时串", required = false)
                                       @RequestParam(value = "code", required = false)String code)throws Exception{
        try {
            if (wechatId.equalsIgnoreCase("xm_hcyy_wx")) {
                return ObjEnvelop.getSuccess("ok",healthCareNewService.getUserInfo(code));
            }else{
                return null;
            }
        }catch (Exception e){
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = "/getOauthQRCodeImg")
    @ApiOperation(value = "获取医保授权二维码", notes = "获取医保授权二维码")
    public ObjEnvelop getOauthQRCodeImg()throws Exception{
        try {
            if (wechatId.equalsIgnoreCase("xm_hcyy_wx")) {
                return ObjEnvelop.getSuccess("ok",healthCareNewService.getYbImage());
            }else{
                return null;
            }
        }catch (Exception e){
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = "/updateUserInfo")
    @ApiOperation(value = "更新医保用户信息", notes = "更新医保用户信息")
    public ObjEnvelop updateUserInfo(@ApiParam(name = "no", value = "唯一编码", required = false)
                                         @RequestParam(value = "no", required = false)String no,
                                     @ApiParam(name = "token", value = "用户信息临时串", required = false)
                                         @RequestParam(value = "token", required = false)String token)throws Exception{
        try {
            if (wechatId.equalsIgnoreCase("xm_hcyy_wx")) {
                return ObjEnvelop.getSuccess("ok",healthCareNewService.updateUserInfo(no,token));
            }else{
                return null;
            }
        }catch (Exception e){
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = "/checkOauthQRCode")
    @ApiOperation(value = "验证医保凭证是否授权", notes = "验证医保凭证是否授权")
    public ObjEnvelop checkOauthQRCode(@ApiParam(name = "authorizeNo", value = "唯一编码", required = false)
                                     @RequestParam(value = "authorizeNo", required = false)String authorizeNo)throws Exception{
        try {
            if (wechatId.equalsIgnoreCase("xm_hcyy_wx")) {
                return ObjEnvelop.getSuccess("ok",healthCareNewService.checkOauthQRCode(authorizeNo));
            }else{
                return null;
            }
        }catch (Exception e){
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
}

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

@ -692,7 +692,6 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    }
    /**
     * 商户回调通知
     * @param request
@ -3031,4 +3030,54 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = "/getOauthQRCodeImg")
    @ApiOperation(value = "获取医保授权二维码", notes = "获取医保授权二维码")
    public ObjEnvelop getOauthQRCodeImg()throws Exception{
        try {
            if (wechatId.equalsIgnoreCase("xm_hcyy_wx")) {
                return ObjEnvelop.getSuccess("ok",healthCareNewService.getYbImage());
            }else{
                return null;
            }
        }catch (Exception e){
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = "/updateUserInfo")
    @ApiOperation(value = "更新医保用户信息", notes = "更新医保用户信息")
    public ObjEnvelop updateUserInfo(@ApiParam(name = "no", value = "唯一编码", required = false)
                                     @RequestParam(value = "no", required = false)String no,
                                     @ApiParam(name = "token", value = "用户信息临时串", required = false)
                                     @RequestParam(value = "token", required = false)String token)throws Exception{
        try {
            if (wechatId.equalsIgnoreCase("xm_hcyy_wx")) {
                return ObjEnvelop.getSuccess("ok",healthCareNewService.updateUserInfo(no,token));
            }else{
                return null;
            }
        }catch (Exception e){
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = "/checkOauthQRCode")
    @ApiOperation(value = "验证医保凭证是否授权", notes = "验证医保凭证是否授权")
    public ObjEnvelop checkOauthQRCode(@ApiParam(name = "authorizeNo", value = "唯一编码", required = false)
                                       @RequestParam(value = "authorizeNo", required = false)String authorizeNo)throws Exception{
        try {
            if (wechatId.equalsIgnoreCase("xm_hcyy_wx")) {
                return ObjEnvelop.getSuccess("ok",healthCareNewService.checkOauthQRCode(authorizeNo));
            }else{
                return null;
            }
        }catch (Exception e){
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
}

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

@ -890,6 +890,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            }else if (type.equalsIgnoreCase("5")){
                //药品明细表
                list = prescriptionService.selectDrugTotal(startTime,endTime);
            }else if (type.equalsIgnoreCase("6")){
                list = prescriptionService.selectPrescriptionFeeTotal(startTime,endTime);
            }
            if (businessType.equalsIgnoreCase("2")){
                if (type.equalsIgnoreCase("1")){
@ -917,6 +919,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                    response.setHeader("Content-Disposition", "attachment; filename=" + new String(URLEncoder.encode("互联网医院药品明细表_"+startTime+"_"+endTime)+".xls"));
                    OutputStream os = response.getOutputStream();
                    prescriptionService.pushListDrugTotal(os, list,startTime,endTime);
                }else if (type.equalsIgnoreCase("6")){
                    response.setContentType("octets/stream");
                    response.setHeader("Content-Disposition", "attachment; filename=" + new String(URLEncoder.encode("门诊收入项目汇总报表_"+startTime+"_"+endTime)+".xls"));
                    OutputStream os = response.getOutputStream();
                    prescriptionService.pushListWritePrescriptionPriceTotal(os, list,startTime,endTime);
                }
            }
@ -952,6 +959,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            }else if (type.equalsIgnoreCase("5")){
                //药品汇总表
                list = prescriptionService.selectDrugTotal(startTime,endTime);
            }else if (type.equalsIgnoreCase("6")){
                list = prescriptionService.selectPrescriptionFeeTotal(startTime,endTime);
            }
            if (businessType.equalsIgnoreCase("2")){
                if (type.equalsIgnoreCase("1")){

+ 25 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java

@ -272,6 +272,31 @@ public class YkyyController extends EnvelopRestEndpoint {
    }
    /**
     *
     * 眼科支付同步
     * @param patient
     * @param orderNo
     * @param refundPrice
     * @param description
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "synOrder", method = RequestMethod.POST)
    @ApiOperation("眼科支付同步")
    public Envelop synOrder(
            @ApiParam(name = "id", value = "id", required = true)
            @RequestParam(required = true)String id) throws Exception {
        try {
            businessOrderService.synOrder(id);
            return Envelop.getSuccess("请求成功");
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
    /**
     *
     * 微信退款