Browse Source

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

liubing 3 years ago
parent
commit
9c2868af51

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

@ -3312,73 +3312,60 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        } else {
            sql = sql + "date_format(p.pay_time,'%Y-%m-%d %H:%i:%S' )  AS \"payTime\",";
        }
        sql = sql + "p.create_time\n" +
                "as time,\n" +
                "e. NAME\n" +
                "as NAME,\n" +
                "p.pay_time\n" +
                "as pay_time,\n" +
                "p.real_order\n" +
                "as realOrder,\n" +
                "o.patient_name\n" +
                "as patientName,\n" +
                "i.drug_name\n" +
                "as infoName,\n" +
                " CASE p.create_time\n" +
                "WHEN NULL THEN\n" +
                "\t'否'\n" +
                "ELSE\n" +
                "\t'是'\n" +
                "END \"create_time\",\n" +
                " CASE e.oneself_pickup_flg\n" +
                "WHEN 1 THEN\n" +
                "\t'自取'\n" +
                "WHEN 2 THEN\n" +
                "\t'快递配送'\n" +
                "ELSE\n" +
                "\t' '\n" +
                "END \"oneself_pickup_flg\",\n" +
                " CASE p. STATUS\n" +
                "WHEN - 4 THEN\n" +
                "\t'已作废'\n" +
                "WHEN - 3 THEN\n" +
                "\t'支付过期取消'\n" +
                "WHEN - 2 THEN\n" +
                "\t'患者自己取消'\n" +
                "WHEN - 1 THEN\n" +
                "\t'医生取消'\n" +
                "WHEN 0 THEN\n" +
                "\t'候诊中'\n" +
                "WHEN 10 THEN\n" +
                "\t'诊断中'\n" +
                "WHEN 11 THEN\n" +
                "\t'药师审核失败 / 调整中'\n" +
                "WHEN 12 THEN\n" +
                "\t'药师审核完成'\n" +
                "WHEN 13 THEN\n" +
                "\t'开方失败/调整中'\n" +
                "WHEN 20 THEN\n" +
                "\t'诊断完成/开方成功/待支付'\n" +
                "WHEN 30 THEN\n" +
                "\t'支付成功/等待配药'\n" +
                "WHEN 31 THEN\n" +
                "\t'配药成功/等待取药'\n" +
                "WHEN 32 THEN\n" +
                "\t'配送中'\n" +
                "WHEN 100 THEN\n" +
                "\t'已完成/未评价'\n" +
                "WHEN 101 THEN\n" +
                "\t'已完成/已经评价'\n" +
                "ELSE\n" +
                "\t' '\n" +
                "END STATUS\n" +
                "FROM\n" +
                "\twlyy_outpatient o\n" +
                "LEFT JOIN wlyy_prescription p ON p.outpatient_id = o.id\n" +
                "LEFT JOIN wlyy_prescription_expressage e ON e.outpatient_id = o.id\n" +
                "LEFT JOIN wlyy_prescription_info i ON i.prescription_id = p.id\n" +
                "WHERE\n" +
                "\t1 = 1";
        if ("xm_ykyy_wx".equals(wxId)) {
            sql = sql +
                    "p.create_time AS \"time\",\n" +
                    "\te. NAME AS \"NAME\",\n" +
                    "\tp.pay_time AS \"pay_time\",\n" +
                    "\tp.real_order AS \"realOrder\",\n" +
                    "\to.patient_name AS \"patientName\",\n" +
                    "\tA.infoName,\n" +
                    "\tp.create_time AS \"create_time\",\n" +
                    "\te.oneself_pickup_flg AS \"oneself_pickup_flg\",\n" +
                    "\tp. STATUS AS \"STATUS\"\n" +
                    "FROM\n" +
                    "\twlyy_outpatient o\n" +
                    "JOIN wlyy_prescription p ON p.outpatient_id = o.id\n" +
                    "JOIN (\n" +
                    "\tSELECT\n" +
                    "\t\ti.prescription_id,\n" +
                    "\t\tWM_CONCAT(i.drug_name) AS \"infoName\"\n" +
                    "\tFROM\n" +
                    "\t\twlyy_prescription_info i\n" +
                    "\tGROUP BY\n" +
                    "\t\ti.prescription_id\n" +
                    ") A ON A.prescription_id = p.id\n" +
                    "JOIN wlyy_prescription_expressage e ON e.outpatient_id = o.id\n" +
                    "WHERE\n" +
                    "\t1 = 1\n";//oracle
        } else {
            sql = sql +
                    "\tp.create_time AS \"time\",\n" +
                    "\te. NAME AS \"NAME\",\n" +
                    "\tp.pay_time AS \"pay_time\",\n" +
                    "\tp.real_order AS \"realOrder\",\n" +
                    "\to.patient_name AS \"patientName\",\n" +
                    "\tA.infoName,\n" +
                    "\tp.create_time AS \"create_time\",\n" +
                    "\te.oneself_pickup_flg AS \"oneself_pickup_flg\",\n" +
                    "\tp. STATUS AS \"STATUS\"\n" +
                    "FROM\n" +
                    "\twlyy_outpatient o\n" +
                    "JOIN wlyy_prescription p ON p.outpatient_id = o.id\n" +
                    "JOIN (\n" +
                    "\tSELECT\n" +
                    "\t\ti.prescription_id,\n" +
                    "\t\tGROUP_CONCAT(i.drug_name) AS \"infoName\"\n" +
                    "\tFROM\n" +
                    "\t\twlyy_prescription_info i\n" +
                    "\tGROUP BY\n" +
                    "\t\ti.prescription_id\n" +
                    ") A ON A.prescription_id = p.id\n" +
                    "JOIN wlyy_prescription_expressage e ON e.outpatient_id = o.id\n" +
                    "WHERE\n" +
                    "\t1 = 1\n";//MySQL
        }
        if (StringUtils.isNotBlank(status)) {
            sql += " AND p.status in(" + status + ") ";
        }
@ -3615,16 +3602,77 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            int i = 1;
            String n = " ";
            for (Map<String, Object> m : ls) {
                Object create_time = m.get("create_time");
                String createTime = "";
                if (create_time == null){
                    createTime += "否";
                }else {
                    createTime += "是";
                }
                Integer oneself_pickup_flg = (Integer) m.get("oneself_pickup_flg");
                String opf = "";
                if(oneself_pickup_flg == null) {
                    opf += " ";
                }else if (oneself_pickup_flg == 1) {
                    opf += "自取";
                }else if (oneself_pickup_flg == 2) {
                    opf += "快递配送";
                }else {
                    opf += "其他";
                }
                Integer statuss = (Integer) m.get("STATUS");
                String status = "";
                if(statuss == null) {
                    status += " ";
                }else if (statuss == -4) {
                    status += "已作废";
                }else if (statuss == -3) {
                    status += "支付过期取消";
                }else if (statuss == -2) {
                    status += "患者自己取消";
                }else if (statuss == -1) {
                    status += "医生取消";
                }else if (statuss == 0) {
                    status += "候诊中";
                }else if (statuss == 10) {
                    status += "诊断中";
                }else if (statuss == 11) {
                    status += "药师审核失败 / 调整中";
                }else if (statuss == 12) {
                    status += "药师审核完成";
                }else if (statuss == 13) {
                    status += "开方失败/调整中";
                }else if (statuss == 20) {
                    status += "诊断完成/开方成功/待支付";
                }else if (statuss == 30) {
                    status += "支付成功/等待配药";
                }else if (statuss == 31) {
                    status += "配药成功/等待取药";
                }else if (statuss == 32) {
                    status += "配送中";
                }else if (statuss == 100) {
                    status += "已完成/未评价";
                }else if (statuss == 101) {
                    status += "已完成/已经评价";
                }else {
                    status += " ";
                }
                addCell(ws, i, 0, m.get("time")!=null?m.get("time").toString():n);
                addCell(ws, i, 1, m.get("realOrder")!=null?m.get("realOrder").toString():n);
                addCell(ws, i, 2, m.get("patientName")!=null?m.get("patientName").toString():n);
                addCell(ws, i, 3, m.get("NAME")!=null?m.get("NAME").toString():n);
                addCell(ws, i, 4, m.get("infoName")!=null?m.get("infoName").toString():n);
                addCell(ws, i, 5, m.get("oneself_pickup_flg")!=null?m.get("oneself_pickup_flg").toString():n);
                addCell(ws, i, 6, m.get("pay_time")!=null?m.get("pay_time").toString():n);
                addCell(ws, i, 7, m.get("create_time")!=null?m.get("create_time").toString():n);
                addCell(ws, i, 8, m.get("STATUS")!=null?m.get("STATUS").toString():n);
                addCell(ws, i, 5, opf!=null?opf:n);
                addCell(ws, i, 6, m.get("payTime")!=null?m.get("payTime").toString():n);
                addCell(ws, i, 7, createTime!=null?createTime:n);
                addCell(ws, i, 8, status!=null?status:n);
                /*addCell(ws, i, 0, m.get("createTime").toString());
                addCell(ws, i, 1, (String) m.get("name"), "");
                addCell(ws, i, 2, (String) m.get("icd10Name"), "");
@ -3655,17 +3703,57 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
            int i = 1;
            String n = " ";
            for (Map<String, Object> m : list) {
                addCell(ws, i, 0, (String) m.get("pname"));
                addCell(ws, i, 1, (String) m.get("dname"));
                addCell(ws, i, 2, (String) m.get("dept"));
                addCell(ws, i, 3, (String) m.get("type"));
                addCell(ws, i, 4, (String) m.get("ctime"));
                addCell(ws, i, 5, (String) m.get("rtime"));
                addCell(ws, i, 6, (String) m.get("etime"));
                addCell(ws, i, 7, (String) m.get("des"));
                addCell(ws, i, 8, (String) m.get("pay"));
                addCell(ws, i, 9, (String) m.get("STATUS"));
                Object statuss = m.get("STATUS");
                String status = "";
                if (statuss == null){
                    status += " ";
                }else if (statuss.equals("1")){
                    status += "候诊中";
                }else if (statuss.equals("2")){
                    status += "就诊中";
                }else if (statuss.equals("3")){
                    status += "结束";
                }else {
                    status += "取消";
                }
                Integer pay = (Integer) m.get("pay");
                String payy = "";
                if(pay == null){
                    payy = "";
                }
                else if (pay >= 20) {
                    payy += "是";
                }else if (pay < 20){
                    payy += "否";
                }
                Object type = m.get("type");
                if (type == null) {
                    type = " ";
                }else {
                    if(type.equals("1")) {
                        type = "在线复诊";
                    }else if (type.equals("2")) {
                        type = "协同门诊";
                    }else if (type.equals("3")) {
                        type = "专家咨询";
                    }
                }
                addCell(ws, i, 0, m.get("pname")!=null?m.get("pname").toString():n);
                addCell(ws, i, 1, m.get("dname")!=null?m.get("dname").toString():n);
                addCell(ws, i, 2, m.get("dept")!=null?m.get("dept").toString():n);
                addCell(ws, i, 3, type.toString()!=null?type.toString():n);
                addCell(ws, i, 4, m.get("ctime")!=null?m.get("ctime").toString():n);
                addCell(ws, i, 5, m.get("rtime")!=null?m.get("rtime").toString():n);
                addCell(ws, i, 6, m.get("etime")!=null?m.get("etime").toString():n);
                addCell(ws, i, 7, m.get("des")!=null?m.get("des").toString():n);
                addCell(ws, i, 8, payy.toString()!=null?payy.toString():n);
                addCell(ws, i, 9, status.toString()!=null?status.toString():n);
                i++;
            }
            wwb.write();
@ -3683,7 +3771,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            WritableSheet ws;
            ws = wwb.createSheet("sheet", 1);
            String[] header = {"序号","充值时间","商户订单号","医院订单号","患者姓名","证件号码","就诊卡号","手机号码","金额","状态"};
            String[] header = {"序号","充值时间","商户订单号","医院订单号","患者姓名","证件号码","就诊卡号","手机号码","金额","业务类型","咨询方式"};
            int k = 0;
            for (String h : header) {
                addCell(ws, 0, k, h);//表名,行,列,header
@ -3691,17 +3779,98 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
            int i = 1;
            String n = "";
            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"));
                /*Object status = m.get("status");
                String statuss = "";
                if (status == null) {
                    statuss += " ";
                }else if (status.equals("0")) {
                    statuss += "未支付";
                }else if (status.equals("1")) {
                    statuss += "已支付";
                }else if (status.equals("2")) {
                    statuss += "交易关闭";
                }else if (status.equals("3")) {
                    statuss += "支付超时";
                }else if (status.equals("4")) {
                    statuss += "交易完成";
                }else if (status.equals("5")) {
                    statuss += "交易进行中";
                }else if (status.equals("6")) {
                    statuss += "退款申请";
                }else if (status.equals("9")) {
                    statuss += "退款完成";
                }else {
                    statuss += " ";
                }*/
                Object orderCategory = m.get("orderCategory");
                String odry = "";
                if(orderCategory == null) {
                    odry += " ";
                }else if (orderCategory.equals("1")) {
                    odry += "专家咨询";
                }else if (orderCategory.equals("2")) {
                    odry += "图文诊室";
                }else if (orderCategory.equals("3")) {
                    odry += "视频诊室";
                }else if (orderCategory.equals("4")) {
                    odry += "处方";
                }else if (orderCategory.equals("5")) {
                    odry += "就诊卡充值";
                }else {
                    odry += " ";
                }
                Integer orderType = (Integer) m.get("orderType");
                String odte = "";
                if(orderType == null) {
                    odte += " ";
                } else if (orderType == 1) {
                    odte += "图文";
                }else if (orderType == 3) {
                    odte += "视频";
                }else if (orderType == 10) {
                    odte += "就诊卡号";
                }else if (orderType == 11) {
                    odte += "门诊卡号";
                }
                Object payPrice = m.get("payPrice");
                String pay = "";
                if (payPrice == null) {
                    pay += " ";
                }else{
                    String s = payPrice.toString();
                    pay += s;
                }
                Object payTime = m.get("payTime");
                String time = "";
                if (payTime == null) {
                    time += " ";
                }else {
                    time = payTime.toString();
                }
                addCell(ws, i, 0, m.get("id")!=null?m.get("id").toString():n);
                addCell(ws, i, 1, time!=null?time:n);
                addCell(ws, i, 2, (String) m.get("orderNo")!=null?(String) m.get("orderNo"):n);
                addCell(ws, i, 3, (String) m.get("ykOrderNo")!=null?(String) m.get("ykOrderNo"):n);
                addCell(ws, i, 4, (String) m.get("patientName")!=null?(String) m.get("patientName"):n);
                addCell(ws, i, 5, (String) m.get("idcard")!=null?(String) m.get("idcard"):n);
                addCell(ws, i, 6, (String) m.get("medicard")!=null?(String) m.get("medicard"):n);
                addCell(ws, i, 7, (String) m.get("mobile")!=null?(String) m.get("mobile"):n);
                addCell(ws, i, 8, pay!=null?pay:n);
                addCell(ws, i, 9, odry!=null?odry:n);
                addCell(ws, i, 10, odte!=null?odte:n);
                i++;
            }
            wwb.write();

+ 23 - 149
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -2053,153 +2053,28 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    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" +
                "\tCASE t.id\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.id\n" +
                "END \"id\",\n" +
                " CASE t.patient\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.patient\n" +
                "END \"patient\",\n" +
                " CASE t.patient_name\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.patient_name\n" +
                "END \"patientName\",\n" +
                " CASE t.order_no\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.order_no\n" +
                "END \"orderNo\",\n" +
                /*" CASE t.order_type\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.order_type\n" +
                "END orderType,\n" +*/
                " CASE t.relation_code\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.relation_code\n" +
                "END \"relationCode\",\n" +
                " CASE t.relation_name\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.relation_name\n" +
                "END \"relationName\",\n" +
                " CASE t.description\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.description\n" +
                "END \"description\",\n" +
                " CASE t.pay_type\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.pay_type\n" +
                "END \"payType\",\n" +
                " CASE t.pay_price\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.pay_price\n" +
                "END \"payPrice\",\n" +
                " CASE t.pay_time\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.pay_time\n" +
                "END \"payTime\",\n" +
                " CASE t.upload_status\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.upload_status\n" +
                "END \"uploadStatus\",\n" +
                " CASE t.create_time\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.create_time\n" +
                "END \"createTime\",\n" +
                " CASE t.remark\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.remark\n" +
                "END \"remark\",\n" +
                " CASE t.relation_code\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.relation_code\n" +
                "END \"medicard\",\n" +
                " CASE t.yk_order_no\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.yk_order_no\n" +
                "END \"ykOrderNo\",\n" +
                " CASE t.yk_order_id\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tt.yk_order_id\n" +
                "END \"ykOrderId\",\n" +
                " CASE b.idcard\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tb.idcard\n" +
                "END \"idcard\",\n" +
                " CASE b.mobile\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\tb.mobile\n" +
                "END \"mobile\",\n" +
                " CASE 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" +
                " CASE 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 \"orderCategory\" \n" +
        String sql = "SELECT\n" +
                "\tt.id AS \"id\",\n" +
                "\tt.patient AS \"patient\",\n" +
                "\tt.patient_name AS \"patientName\",\n" +
                "\tt.order_no AS \"orderNo\",\n" +
                "\tt.order_type AS \"orderType\",\n" +
                "\tt.relation_code AS \"relationCode\",\n" +
                "\tt.relation_name AS \"relationName\",\n" +
                "\tt.description AS \"description\",\n" +
                "\tt.pay_type AS \"payType\",\n" +
                "\tt.pay_price AS \"payPrice\",\n" +
                "\tt.pay_time AS \"payTime\",\n" +
                "\tt.upload_status AS \"uploadStatus\",\n" +
                "\tt.create_time AS \"createTime\",\n" +
                "\tt.remark AS \"remark\",\n" +
                "\tt.relation_code AS \"medicard\",\n" +
                "\tt.yk_order_no AS \"ykOrderNo\",\n" +
                "\tt.yk_order_id AS \"ykOrderId\",\n" +
                "\tb.idcard AS \"idcard\",\n" +
                "\tb.mobile AS \"mobile\",\n" +
                "\tt. STATUS AS \"status\",\n" +
                "\tt.order_category AS \"orderCategory\"\n" +
                "FROM\n" +
                "\tbase_business_order_pay t\n" +
                "LEFT JOIN base_patient b ON t.patient = b.id\n" +
@ -2376,14 +2251,13 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                }
            }
        }
       /* List<BasePatientWechatDo> patientWechatDoList = patientWechatDao.findByWechatIdAndPatientId(wechatId, patientId);
        List<BasePatientWechatDo> patientWechatDoList = patientWechatDao.findByWechatIdAndPatientId(wechatId, patientId);
        if (patientWechatDoList==null || patientWechatDoList.size()==0){
            map.put("error","无openId");
            logger.info("error=无openId");
            return map;
        }
     */
        String url = wxWechatDO.getBaseUrl();
        String notifyUrl =url;
        String price = (int)(businessOrderDO.getPayPrice()*100)+"";

+ 17 - 76
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -4505,82 +4505,23 @@ public class ImService {
        }
        String pushSql = "";
        pushSql = "SELECT\n" +
                "\tCASE a.patient_name\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\ta.patient_name\n" +
                "END \"pname\",\n" +
                " CASE a.doctor_name\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\ta.doctor_name\n" +
                "END \"dname\",\n" +
                " CASE a.dept_name\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\ta.dept_name\n" +
                "END \"dept\",\n" +
                " CASE a.outpatient_type\n" +
                "WHEN 1 THEN\n" +
                "\t'在线复诊'\n" +
                "WHEN 2 THEN\n" +
                "\t'协同门诊'\n" +
                "WHEN 3 THEN\n" +
                "\t'专家咨询'\n" +
                "ELSE\n" +
                "\t' '\n" +
                "END \"type\",\n" +
                " CASE a.create_time\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\ta.create_time\n" +
                "END \"ctime\",\n" +
                " CASE a.con_date\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\ta.con_date\n" +
                "END \"rtime\",\n" +
                " CASE a.end_time\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\ta.end_time\n" +
                "END \"etime\",\n" +
                " CASE a.description\n" +
                "WHEN NULL THEN\n" +
                "\t' '\n" +
                "ELSE\n" +
                "\ta.description\n" +
                "END \"des\",\n" +
                " CASE b. STATUS\n" +
                "WHEN b. STATUS >= 20 THEN\n" +
                "\t'是'\n" +
                "ELSE\n" +
                "\t'否'\n" +
                "END \"pay\",\n" +
                " CASE a. 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" +
                "ELSE\n" +
                "\t'取消'\n" +
                "END \"STATUS\"\n" +
                "FROM\n" +
                "\twlyy_outpatient a\n" +
                "LEFT JOIN wlyy_prescription b ON a.patient_name = b.patient_name\n" +
                "WHERE\n" +
                "\t1 = 1";
        pushSql =
                "SELECT\n" +
                        "\ta.patient_name AS \"pname\",\n" +
                        "\ta.doctor_name AS \"dname\",\n" +
                        "\ta.dept_name AS \"dept\",\n" +
                        "\ta.outpatient_type AS \"type\",\n" +
                        "\ta.create_time AS \"ctime\",\n" +
                        "\ta.con_date AS \"rtime\",\n" +
                        "\ta.end_time AS \"etime\",\n" +
                        "\ta.description AS \"des\",\n" +
                        "\tb. STATUS AS \"pay\",\n" +
                        "\ta. STATUS AS \"STATUS\"\n" +
                        "FROM\n" +
                        "\twlyy_outpatient a\n" +
                        "LEFT JOIN wlyy_prescription b ON a.id = b.outpatient_id\n" +
                        "WHERE\n" +
                        "\t1 = 1";
        List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(pushSql);

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

@ -834,7 +834,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.searchRecordWrite)
    @ApiOperation(value = "咨询记录导出", notes = "咨询记录导出")
    public Envelop searchRecordWrite(@ApiParam(name = "doctor", value = "医生id")
    public void searchRecordWrite(@ApiParam(name = "doctor", value = "医生id")
                                         @RequestParam(value = "doctor",required = false) String doctor,
                                     @ApiParam(name = "title", value = "咨询标题关键字")
                                         @RequestParam(value = "title",required = false) String title,
@ -851,7 +851,6 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                     @ApiParam(name = "end_time", value = "结束时间 YYYY-MM-DD HH:MM:SS")
                                         @RequestParam(value = "end_time",required = false) String end_time,
            HttpServletResponse response) throws Exception {
        try {
            MixEnvelop expressages = imService.recordByDoctor(doctor, id, type, status, title, start_time, end_time, patient);//
            List<Map<String, Object>> list = expressages.getDetailModelList();
            response.setContentType("octets/stream");
@ -859,10 +858,6 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            OutputStream os = response.getOutputStream();
            prescriptionService.searchRecordWrite(os, list);
            return success(expressages);
        } catch (Exception e) {
            return failedException(e);
        }
    }