|
@ -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"), "");
|
|
@ -3657,15 +3705,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
int i = 1;
|
|
|
String n = " ";
|
|
|
for (Map<String, Object> m : list) {
|
|
|
String status = m.get("STATUS").toString();
|
|
|
if (status.equals("1")){
|
|
|
status = "候诊中";
|
|
|
}else if (status.equals("2")){
|
|
|
status = "就诊中";
|
|
|
}else if (status.equals("3")){
|
|
|
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 = "取消";
|
|
|
status += "取消";
|
|
|
}
|
|
|
|
|
|
Integer pay = (Integer) m.get("pay");
|
|
@ -3720,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
|
|
@ -3728,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();
|