hxm 3 лет назад
Родитель
Сommit
ff1f5370b7

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

@ -3482,6 +3482,42 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
    }
    public void pushYktCardChargeWrite(OutputStream os, List<Map<String, Object>> list) 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++;
            }
            int i = 1;
            for (Map<String, Object> m : list) {
                addCell(ws, i, 0, (String) m.get("id"));
                addCell(ws, i, 1, (String) m.get("payTime"));
                addCell(ws, i, 2, (String) m.get("orderNo"));
                addCell(ws, i, 3, (String) m.get("ykOrderNo"));
                addCell(ws, i, 4, (String) m.get("patientName"));
                addCell(ws, i, 5, (String) m.get("idcard"));
                addCell(ws, i, 6, (String) m.get("meidcard"));
                addCell(ws, i, 7, (String) m.get("mobile"));
                addCell(ws, i, 8, (String) m.get("payPrice"));
                addCell(ws, i, 9, (String) m.get("status"));
                i++;
            }
            wwb.write();
            wwb.close();
        } catch (IOException e) {
            e.printStackTrace();
            if (wwb != null) wwb.close();
            throw e;
        }
    }
    /**
     * @return

+ 127 - 0
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -35,6 +35,7 @@ import com.yihu.jw.order.pay.wx.WeChatConfig;
import com.yihu.jw.order.pay.ylz.YlzPayService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.sms.dao.BaseSmsTemplateDao;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.QrcodeUtil;
@ -2037,6 +2038,132 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        mixEnvelop.setTotalCount(listCount==null?0:listCount.size());
        return mixEnvelop;
    }
    public MixEnvelop pushYktCardCharge(String startTime, String endTime, String orderNo, String yktOrderNo, String patientName
            , String idCard, String medicard,Integer status, Integer page, Integer pageSize,String orderType,String orderCategory){
        String sql = " SELECT\n" +
                "\tIFNULL(t.id, ' ') AS \"id\",\n" +
                "\tIFNULL(t.patient, ' ') AS \"patient\",\n" +
                "\tIFNULL(t.patient_name, ' ') AS \"patientName\",\n" +
                "\tIFNULL(t.order_no, ' ') AS \"orderNo\",\n" +
                "\tIFNULL(t.order_type, ' ') AS \"orderType\",\n" +
                "\tIFNULL(t.relation_code, ' ') AS \"relationCode\",\n" +
                "\tIFNULL(t.relation_name, ' ') AS \"relationName\",\n" +
                "\tIFNULL(t.description, ' ') AS \"description\",\n" +
                "\tIFNULL(t.pay_type, ' ') AS \"payType\",\n" +
                "\tIFNULL(t.pay_price, ' ') AS \"payPrice\",\n" +
                "\tIFNULL(t.pay_time, ' ') AS \"payTime\",\n" +
                "\tIFNULL(t.upload_status, ' ') AS \"uploadStatus\",\n" +
                "\tIFNULL(t.create_time, ' ') AS \"createTime\",\n" +
                "\tIFNULL(t.remark, ' ') AS \"remark\",\n" +
                "\tIFNULL(t.relation_code, ' ') AS \"medicard\",\n" +
                "\tIFNULL(t.yk_order_no, ' ') AS \"ykOrderNo\",\n" +
                "\tIFNULL(t.yk_order_id, ' ') AS \"ykOrderId\",\n" +
                "\tIFNULL(b.idcard, ' ') AS \"idcard\",\n" +
                "\tIFNULL(b.mobile, ' ') AS \"mobile\",\n" +
                "\tCASE t. STATUS\n" +
                "WHEN 0 THEN\n" +
                "\t'未支付'\n" +
                "WHEN 1 THEN\n" +
                "\t'已支付'\n" +
                "WHEN 2 THEN\n" +
                "\t'交易关闭'\n" +
                "WHEN 3 THEN\n" +
                "\t'支付超时'\n" +
                "WHEN 4 THEN\n" +
                "\t'交易完成'\n" +
                "WHEN 5 THEN\n" +
                "\t'交易进行中'\n" +
                "WHEN 6 THEN\n" +
                "\t'退款申请'\n" +
                "WHEN 9 THEN\n" +
                "\t'退款完成'\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt. STATUS\n" +
                "END AS \"status\",\n" +
                "\tCASE t.order_category\n" +
                "WHEN '2' THEN\n" +
                "\t'2'\n" +
                "WHEN '3' THEN\n" +
                "\t'2'\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.order_category\n" +
                "END AS \"orderCategory\"\n" +
                "FROM\n" +
                "\tbase_business_order_pay t\n" +
                "LEFT JOIN base_patient b ON t.patient = b.id\n" +
                "WHERE\n" +
                "\t1 = 1";
        if (StringUtils.isNoneBlank(startTime)){
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
                    sql+=" and t.create_time > '" + startTime + "'";
                }else {
                    sql+=" and t.create_time > to_date('" + startTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sql+=" and t.create_time > '" + startTime + "'";
            }
        }
        if (StringUtils.isNoneBlank(endTime)){
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
                    sql+=" and t.create_time <= '" + endTime + "'";
                }else {
                    sql+=" and t.create_time <= to_date('" + endTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sql+=" and t.create_time <= '" + endTime + "'";
            }
        }
        if (StringUtils.isNoneBlank(orderNo)){
            sql+=" and t.order_no ='"+orderNo+"'";
        }
        if (StringUtils.isNoneBlank(yktOrderNo)){
            sql+=" and t.yk_order_no ='"+yktOrderNo+"'";
        }
        if (StringUtils.isNoneBlank(patientName)){
            sql+=" and t.patient_name  like '%"+patientName+"%'";
        }
        if (StringUtils.isNoneBlank(idCard)){
            sql+=" and b.idcard ='"+idCard+"'";
        }
        if (StringUtils.isNoneBlank(medicard)){
            sql+=" and t.relation_code ='"+medicard+"'";
        }
        if (status!=null){
            sql+=" and t.status ="+status+"";
        }
        if (StringUtils.isNoneBlank(orderType)){
            sql+=" and t.order_type ="+orderType+"";
        }
        if (StringUtils.isNoneBlank(orderCategory)){
            if (orderCategory.equalsIgnoreCase("2")){
                sql+=" and t.order_category IN ('2','3') ";
            }
            sql+=" and t.order_category = '"+orderCategory+"'  ";
        }
        sql+=" order by t.create_time desc ";
        List<Map<String,Object>> mapList = hibenateUtils.createSQLQuery(sql);
        /*for (Map<String,Object> map:list){
            if (map.get("createTime")!=null){
                map.put("createTime",);
            }
        }*/
        return MixEnvelop.getSuccessListWithPage2(BaseHospitalRequestMapping.Prescription.api_success, mapList);
    }
    public  JSONObject validateGeet( String geetestChallenge,String geetestValidate,String geetestSeccode,String isPatient){
        String validateUrl = "http://localhost:8088/validate";

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -40,6 +40,7 @@ public class BaseHospitalRequestMapping {
        public static final String findDoctorByIdCard = "/findDoctorByIdCard";
        public static final String testJpush = "/testJpush";
        public static final String findYkCardCharge = "/findYkCardCharge";
        public static final String pushYkCardCharge = "/pushYkCardCharge";
        public static final String zsMsgFlowTest = "/zsMsgFlowTest";
        public static final String updateChannelId = "/updateChannelId";

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

@ -2085,6 +2085,48 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.pushYkCardCharge)
    @ApiOperation(value = "导出眼科通充值记录", notes = "")
    public Envelop pushYkCardCharge(@ApiParam(name = "startTime", value = "开始时间")
                                       @RequestParam(value = "startTime", required = false)String startTime,
                                       @ApiParam(name = "endTime", value = "结束时间")
                                       @RequestParam(value = "endTime", required = false)String endTime,
                                       @ApiParam(name = "orderNo", value = "订单号")
                                       @RequestParam(value = "orderNo", required = false)String orderNo,
                                       @ApiParam(name = "yktOrderNo", value = "眼科订单号")
                                       @RequestParam(value = "yktOrderNo", required = false)String yktOrderNo,
                                       @ApiParam(name = "patientName", value = "患者姓名")
                                       @RequestParam(value = "patientName", required = false)String patientName,
                                       @ApiParam(name = "idCard", value = "身份证")
                                       @RequestParam(value = "idCard", required = false)String idCard,
                                       @ApiParam(name = "medicard", value = "就诊卡")
                                       @RequestParam(value = "medicard", required = false)String medicard,
                                       @ApiParam(name = "status", value = "状态(0:未支付|1:已支付| 9退款完成)")
                                       @RequestParam(value = "status", required = false)Integer status,
                                       @ApiParam(name = "page", value = "页数")
                                       @RequestParam(value = "page", required = false)Integer page,
                                       @ApiParam(name = "pageSize", value = "页吗")
                                       @RequestParam(value = "pageSize", required = false)Integer pageSize,
                                       @ApiParam(name = "orderType", value = "咨询方式(1、图文、3、视频)")
                                       @RequestParam(value = "orderType", required = false)String orderType,
                                       @ApiParam(name = "orderCategory", value = "业务列表(1,专家咨询,2、复诊,4处方、5、就诊卡充值)")
                                       @RequestParam(value = "orderCategory", required = false)String orderCategory,
                                       HttpServletResponse response) {
        try {
            MixEnvelop expressages = businessOrderService.pushYktCardCharge(startTime,endTime,orderNo,yktOrderNo,patientName,idCard,medicard,status,page,pageSize, orderType, orderCategory);
            List<Map<String, Object>> list = expressages.getDetailModelList();
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename=" + new String("searchRecordWrite.xls"));
            OutputStream os = response.getOutputStream();
            prescriptionService.pushYktCardChargeWrite(os, list);
            return success(expressages);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    /**
     * 咨询列表
     * @param startDate