|  | @ -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 as \"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 " +
 | 
	
		
			
				|  |  |                     "\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;
 | 
	
	
		
			
				|  | @ -3605,7 +3594,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             for (Map<String, Object> m : ls) {
 | 
	
		
			
				|  |  |                 String createTime = "";
 | 
	
		
			
				|  |  |                 if (m.get("create_time") == null) {
 | 
	
		
			
				|  |  |                 if (m.get("createTime") == null) {
 | 
	
		
			
				|  |  |                      createTime = "否";
 | 
	
		
			
				|  |  |                 }else {
 | 
	
		
			
				|  |  |                     createTime = "是";
 | 
	
	
		
			
				|  | @ -3614,48 +3603,52 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 String opf = "";
 | 
	
		
			
				|  |  |                 if (m.get("oneself_pickup_flg") == null) {
 | 
	
		
			
				|  |  |                     opf = null;
 | 
	
		
			
				|  |  |                 }else if (Integer.parseInt(m.get("oneself_pickup_flg").toString()) == 1){
 | 
	
		
			
				|  |  |                     opf += "自取";
 | 
	
		
			
				|  |  |                 }else if (Integer.parseInt(m.get("oneself_pickup_flg").toString()) == 2){
 | 
	
		
			
				|  |  |                     opf += "快递配送";
 | 
	
		
			
				|  |  |                 }else {
 | 
	
		
			
				|  |  |                     opf += "其他";
 | 
	
		
			
				|  |  |                     String opff = m.get("oneself_pickup_flg").toString();
 | 
	
		
			
				|  |  |                     if (opff.equals("1")){
 | 
	
		
			
				|  |  |                         opf = "自取";
 | 
	
		
			
				|  |  |                     }else if (opff.equals("0")){
 | 
	
		
			
				|  |  |                         opf = "快递配送";
 | 
	
		
			
				|  |  |                     }else {
 | 
	
		
			
				|  |  |                         opf = "其他";
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 String status = "";
 | 
	
		
			
				|  |  |                 if (m.get("STATUS") == null) {
 | 
	
		
			
				|  |  |                 if (m.get("status") == null) {
 | 
	
		
			
				|  |  |                     status = null;
 | 
	
		
			
				|  |  |                 }else{
 | 
	
		
			
				|  |  |                     if (Integer.parseInt(m.get("STATUS").toString()) == -4) {
 | 
	
		
			
				|  |  |                         status += "已作废";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == -3) {
 | 
	
		
			
				|  |  |                         status += "支付过期取消";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == -2) {
 | 
	
		
			
				|  |  |                         status += "患者自己取消";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == -1) {
 | 
	
		
			
				|  |  |                         status += "医生取消";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == 0) {
 | 
	
		
			
				|  |  |                         status += "候诊中";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == 10) {
 | 
	
		
			
				|  |  |                         status += "诊断中";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == 11) {
 | 
	
		
			
				|  |  |                         status += "药师审核失败 / 调整中";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == 12) {
 | 
	
		
			
				|  |  |                         status += "药师审核完成";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == 13) {
 | 
	
		
			
				|  |  |                         status += "开方失败/调整中";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == 20) {
 | 
	
		
			
				|  |  |                         status += "诊断完成/开方成功/待支付";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == 30) {
 | 
	
		
			
				|  |  |                         status += "支付成功/等待配药";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == 31) {
 | 
	
		
			
				|  |  |                         status += "配药成功/等待取药";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == 32) {
 | 
	
		
			
				|  |  |                         status += "配送中";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == 100) {
 | 
	
		
			
				|  |  |                         status += "已完成/未评价";
 | 
	
		
			
				|  |  |                     }else if (Integer.parseInt(m.get("STATUS").toString()) == 101) {
 | 
	
		
			
				|  |  |                         status += "已完成/已经评价";
 | 
	
		
			
				|  |  |                     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;
 | 
	
		
			
				|  |  |                     }
 | 
	
	
		
			
				|  | @ -3664,17 +3657,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 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();
 | 
	
	
		
			
				|  | @ -3768,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
 | 
	
	
		
			
				|  | @ -3826,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;
 | 
	
	
		
			
				|  | @ -3865,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();
 |