hxm il y a 3 ans
Parent
commit
ad978ab453

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

@ -3329,6 +3329,41 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "JOIN wlyy_prescription_expressage e ON e.outpatient_id = o.id\n" +
                    "WHERE\n" +
                    "\t1 = 1\n";//oracle
            if (StringUtils.isNotBlank(status)) {
                totalSql += " AND p.status in(" + status + ") ";
            }
            if (StringUtils.isNotBlank(oneselfPickupFlg)) {
                totalSql += " AND e.oneself_pickup_flg = " + oneselfPickupFlg+" ";
            }
            if (StringUtils.isNotBlank(nameKey)) {
                totalSql += " AND e.name like '%" + nameKey + "%' ";
            }
            if (StringUtils.isNotBlank(patientName)) {
                totalSql += " AND o.patient_name like '%" + patientName + "%' ";
            }
            if (StringUtils.isNotBlank(startTime)) {
                if ("xm_ykyy_wx".equals(wxId)) {
                    if (flag){
                        totalSql += " and p.create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                    }else {
                        totalSql += " and p.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                    }
                } else {
                    totalSql += " AND p.create_time >='" + startTime + " 00:00:00'";
                }
            }
            if (StringUtils.isNotBlank(endTime)) {
                if ("xm_ykyy_wx".equals(wxId)) {
                    if (flag){
                        totalSql += " and p.create_time <= str_to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
                    }else {
                        totalSql += " and p.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
                    }
                } else {
                    sql += " AND p.create_time <='" + endTime + " 23:59:59'";
                }
            }
        } else {
            sql = sql +
                    "p.id AS \"prescriptionId\",\n" +
@ -3346,6 +3381,41 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "JOIN wlyy_prescription_expressage e ON e.outpatient_id = o.id\n" +
                    "WHERE\n" +
                    "\t1 = 1\n";//MySQL
            if (StringUtils.isNotBlank(status)) {
                totalSql += " AND p.status in(" + status + ") ";
            }
            if (StringUtils.isNotBlank(oneselfPickupFlg)) {
                totalSql += " AND e.oneself_pickup_flg = " + oneselfPickupFlg+" ";
            }
            if (StringUtils.isNotBlank(nameKey)) {
                totalSql += " AND e.name like '%" + nameKey + "%' ";
            }
            if (StringUtils.isNotBlank(patientName)) {
                totalSql += " AND o.patient_name like '%" + patientName + "%' ";
            }
            if (StringUtils.isNotBlank(startTime)) {
                if ("xm_ykyy_wx".equals(wxId)) {
                    if (flag){
                        totalSql += " and p.create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                    }else {
                        totalSql += " and p.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                    }
                } else {
                    totalSql += " AND p.create_time >='" + startTime + " 00:00:00'";
                }
            }
            if (StringUtils.isNotBlank(endTime)) {
                if ("xm_ykyy_wx".equals(wxId)) {
                    if (flag){
                        totalSql += " and p.create_time <= str_to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
                    }else {
                        totalSql += " and p.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
                    }
                } else {
                    sql += " AND p.create_time <='" + endTime + " 23:59:59'";
                }
            }
        }
        if (StringUtils.isNotBlank(status)) {
@ -3388,17 +3458,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        sql +=" order by p.create_time desc ";
        /*       sql += " LIMIT " + (page - 1) * size + "," + size + "";*/
        logger.info("AAAAAAAAAAAAAAAAAAAAAAA"+ sql);
        List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(sql);
        for (Map<String, Object> map : mapList) {
            if (map.get("prescriptionId") != null) {
                List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(map.get("prescriptionId").toString(), 1);
                map.put("info", wlyyPrescriptionInfoDOS);
                String drugName = "";
                String infoName = "";
                for (WlyyPrescriptionInfoDO info:wlyyPrescriptionInfoDOS) {
                    drugName += info.getDrugName() + ",";
                    infoName += info.getDrugName() + "*" + info.getQuantity() + ",";
                }
                map.put("infooName",drugName);
                map.put("infooName",infoName);
            }
        }
        return MixEnvelop.getSuccessListWithPage2(BaseHospitalRequestMapping.Prescription.api_success, mapList);
@ -3576,7 +3645,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public void pushListWrite(OutputStream os, List<Map<String, Object>> ls) throws Exception {
        logger.info(ls.toString());
        WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
        try {
            WritableSheet ws;
@ -3658,7 +3726,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                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);
                logger.info(m.get("infooName").toString());
                addCell(ws, i, 4, m.get("infooName")!=null?m.get("infooName").toString():n);
                addCell(ws, i, 5, opf!=null?opf:n);
                addCell(ws, i, 6, m.get("payTime")!=null?m.get("payTime").toString():n);
@ -3809,7 +3876,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    }else if (orderCategory.equals("4")) {
                        odry += "处方";
                    }else if (orderCategory.equals("5")) {
                        odry += "就诊卡充值";
                        if (m.get("orderType") != null) {
                            String ort = m.get("orderType").toString();
                            if (ort.equalsIgnoreCase("10")) {
                                odry += "就诊卡号充值";
                            }else if(ort.equalsIgnoreCase("11")) {
                                odry += "门诊卡号充值";
                            }
                        }
                    }else {
                        odry += " ";
                    }
@ -3845,13 +3920,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }else{
                    String orderType =  m.get("orderType").toString();
                    if (orderType.equalsIgnoreCase("1")) {
                        odte += "图文";
                        odte += "图文咨询";
                    }else if (orderType.equalsIgnoreCase("3")) {
                        odte += "视频";
                    }else if (orderType.equalsIgnoreCase("10")) {
                        odte += "就诊卡号";
                    }else if (orderType.equalsIgnoreCase("11")) {
                        odte += "门诊卡号";
                        odte += "视频咨询";
                    }
                }
                String pay = "";

+ 9 - 1
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -2120,10 +2120,18 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        if (status!=null){
            sql+=" and t.status ="+status+"";
        }
        if (StringUtils.isNoneBlank(orderType)){
            sql+=" and t.order_type ="+orderType+"";
        }
        if (StringUtils.isNoneBlank(yktOrderNo)){
            sql+=" and t.yk_order_no =" + yktOrderNo + "";
        }
        if (StringUtils.isNoneBlank(medicard)){
            sql+=" and t.relation_code =" + medicard + "";
        }
        if (StringUtils.isNoneBlank(idCard)){
            sql+=" and b.idcard =" + idCard + "";
        }
        if (StringUtils.isNoneBlank(orderCategory)){
            if (orderCategory.equalsIgnoreCase("2")){

+ 37 - 0
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -4523,6 +4523,43 @@ public class ImService {
                        "WHERE\n" +
                        "\t1 = 1";
        if (org.apache.commons.lang3.StringUtils.isNotBlank(status.toString())) {
            pushSql += " AND a. STATUS in(" + status + ") ";
        }
        if (org.apache.commons.lang3.StringUtils.isNotBlank(type)) {
            pushSql += " AND a.type = " + type +" ";
        }
        if (org.apache.commons.lang3.StringUtils.isNotBlank(doctor)) {
            pushSql += " AND a.doctor_name like '%" + doctor + "%' ";
        }
        if (org.apache.commons.lang3.StringUtils.isNotBlank(patient)) {
            pushSql += " AND a.patient_name like '%" + patient + "%' ";
        }
        if (org.apache.commons.lang3.StringUtils.isNotBlank(start_time)) {
            if ("xm_ykyy_wx".equals(wxId)) {
                if (flag){
                    pushSql += " and a.create_time >= str_to_date('" + start_time + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                }else {
                    pushSql += " and a.create_time >= to_date('" + start_time + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                }
            } else {
                pushSql += " AND a.create_time >='" + start_time + " 00:00:00'";
            }
        }
        if (org.apache.commons.lang3.StringUtils.isNotBlank(end_time)) {
            if ("xm_ykyy_wx".equals(wxId)) {
                if (flag){
                    pushSql += " and a.create_time <= str_to_date('" + end_time + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
                }else {
                    pushSql += " and a.create_time <= to_date('" + end_time + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
                }
            } else {
                sql += " AND a.create_time <='" + end_time + " 23:59:59'";
            }
        }
        pushSql = pushSql + "\tORDER BY ctime desc ";
        List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(pushSql);
        return MixEnvelop.getSuccessListWithPage2(BaseHospitalRequestMapping.Prescription.api_success, mapList);