|
@ -3314,53 +3314,35 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql = sql +
|
|
|
"p.id AS \"prescriptionId\",\n" +
|
|
|
"p.create_time AS \"time\",\n" +
|
|
|
"\te. NAME AS \"NAME\",\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" +
|
|
|
"\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 +
|
|
|
"p.id AS \"prescriptionId\",\n" +
|
|
|
"\tp.create_time AS \"time\",\n" +
|
|
|
"\te. NAME AS \"NAME\",\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" +
|
|
|
"\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
|
|
@ -3406,11 +3388,17 @@ 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 = "";
|
|
|
for (WlyyPrescriptionInfoDO info:wlyyPrescriptionInfoDOS) {
|
|
|
drugName += info.getDrugName() + ",";
|
|
|
}
|
|
|
map.put("infooName",drugName);
|
|
|
}
|
|
|
}
|
|
|
return MixEnvelop.getSuccessListWithPage2(BaseHospitalRequestMapping.Prescription.api_success, mapList);
|
|
@ -3588,6 +3576,7 @@ 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;
|
|
@ -3604,80 +3593,77 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
String n = " ";
|
|
|
|
|
|
for (Map<String, Object> m : ls) {
|
|
|
|
|
|
Object create_time = m.get("create_time");
|
|
|
String createTime = "";
|
|
|
if (create_time == null){
|
|
|
createTime += "否";
|
|
|
if (m.get("createTime") == null) {
|
|
|
createTime = "否";
|
|
|
}else {
|
|
|
createTime += "是";
|
|
|
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 += "快递配送";
|
|
|
if (m.get("oneself_pickup_flg") == null) {
|
|
|
opf = null;
|
|
|
}else {
|
|
|
opf += "其他";
|
|
|
String opff = m.get("oneself_pickup_flg").toString();
|
|
|
if (opff.equals("1")){
|
|
|
opf = "自取";
|
|
|
}else if (opff.equals("0")){
|
|
|
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 += " ";
|
|
|
if (m.get("status") == null) {
|
|
|
status = null;
|
|
|
}else{
|
|
|
String statuss = m.get("status").toString();
|
|
|
if (statuss.equals("-4")) {
|
|
|
status = "已作废";
|
|
|
}else if (statuss.equals("-3")) {
|
|
|
status = "支付过期取消";
|
|
|
}else if (statuss.equals("-2")){
|
|
|
status = "患者自己取消";
|
|
|
}else if (statuss.equals("-1")){
|
|
|
status = "医生取消";
|
|
|
}else if (statuss.equals("0")){
|
|
|
status = "候诊中";
|
|
|
}else if (statuss.equals("10")) {
|
|
|
status = "诊断中";
|
|
|
}else if (statuss.equals("11")) {
|
|
|
status = "药师审核失败 / 调整中";
|
|
|
}else if (statuss.equals("12")) {
|
|
|
status = "药师审核完成";
|
|
|
}else if (statuss.equals("13")) {
|
|
|
status = "开方失败/调整中";
|
|
|
}else if (statuss.equals("20")) {
|
|
|
status = "诊断完成/开方成功/待支付";
|
|
|
}else if (statuss.equals("30")) {
|
|
|
status = "支付成功/等待配药";
|
|
|
}else if (statuss.equals("31")) {
|
|
|
status = "配药成功/等待取药";
|
|
|
}else if (statuss.equals("32")) {
|
|
|
status = "配送中";
|
|
|
}else if (statuss.equals("100")) {
|
|
|
status = "已完成/未评价";
|
|
|
}else if (statuss.equals("101")) {
|
|
|
status = "已完成/已经评价";
|
|
|
}else {
|
|
|
status = null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
addCell(ws, i, 0, m.get("time")!=null?m.get("time").toString():n);
|
|
|
addCell(ws, i, 0, m.get("createTime")!=null?m.get("createTime").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, 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);
|
|
|
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"), "");
|
|
|
addCell(ws, i, 3, getOneselfPickupFlgString((Integer) m.get("oneselfPickupFlg")), "");
|
|
|
addCell(ws, i, 4, getStatusName((Integer) m.get("status")), "");*/
|
|
|
i++;
|
|
|
}
|
|
|
wwb.write();
|
|
@ -3705,45 +3691,45 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
int i = 1;
|
|
|
String n = " ";
|
|
|
for (Map<String, Object> m : list) {
|
|
|
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 += "取消";
|
|
|
if(m.get("STATUS") == null){
|
|
|
status = null;
|
|
|
}else{
|
|
|
if (m.get("STATUS").equals("1")){
|
|
|
status += "候诊中";
|
|
|
}else if (m.get("STATUS").equals("2")){
|
|
|
status += "就诊中";
|
|
|
}else if (m.get("STATUS").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 += "否";
|
|
|
if (m.get("pay") == null) {
|
|
|
payy = null;
|
|
|
}else {
|
|
|
if (Integer.parseInt(m.get("pay").toString()) >= 20) {
|
|
|
payy += "是";
|
|
|
}else if (Integer.parseInt(m.get("pay").toString()) < 20){
|
|
|
payy += "否";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
Object type = m.get("type");
|
|
|
if (type == null) {
|
|
|
type = " ";
|
|
|
String type = "";
|
|
|
if (m.get("type") == null) {
|
|
|
|
|
|
}else {
|
|
|
if(type.equals("1")) {
|
|
|
if(m.get("type").equals("1")) {
|
|
|
type = "在线复诊";
|
|
|
}else if (type.equals("2")) {
|
|
|
}else if (m.get("type").equals("2")) {
|
|
|
type = "协同门诊";
|
|
|
}else if (type.equals("3")) {
|
|
|
}else if (m.get("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);
|
|
@ -3752,7 +3738,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
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, 8, payy!=null?payy:n);
|
|
|
addCell(ws, i, 9, status.toString()!=null?status.toString():n);
|
|
|
i++;
|
|
|
}
|
|
@ -3771,7 +3757,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
|
|
@ -3829,6 +3815,30 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
}
|
|
|
|
|
|
String status ="";
|
|
|
if (m.get("status") == null) {
|
|
|
status = null;
|
|
|
}else {
|
|
|
String statuss = m.get("status").toString();
|
|
|
if (statuss.equals("0")){
|
|
|
status = "未支付";
|
|
|
}else if (statuss.equals("1")) {
|
|
|
status = "已支付";
|
|
|
}else if (statuss.equals("2")) {
|
|
|
status = "未支付";
|
|
|
}else if (statuss.equals("3")) {
|
|
|
status = "交易关闭";
|
|
|
}else if (statuss.equals("4")) {
|
|
|
status = "交易完成";
|
|
|
}else if (statuss.equals("5")) {
|
|
|
status = "交易进行中";
|
|
|
}else if (statuss.equals("6")) {
|
|
|
status = "退款申请";
|
|
|
}else if (statuss.equals("9")) {
|
|
|
status = "退款完成";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
String odte = "";
|
|
|
if(m.get("orderType") == null) {
|
|
|
odte = null;
|
|
@ -3868,8 +3878,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
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);
|
|
|
addCell(ws, i, 9, status!=null?status:n);
|
|
|
addCell(ws, i, 10, odry!=null?odry:n);
|
|
|
addCell(ws, i, 11, odte!=null?odte:n);
|
|
|
i++;
|
|
|
}
|
|
|
wwb.write();
|