|
@ -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 = "";
|