| 
					
				 | 
			
			
				@ -23,7 +23,6 @@ import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.http.HttpClientUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import jxl.Workbook; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import jxl.write.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.commons.collections.CollectionUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.commons.lang.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.poi.poifs.filesystem.POIFSFileSystem; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.jsoup.Jsoup; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -774,11 +773,10 @@ public class DoorOrderService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        WritableWorkbook book = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        OutputStream os = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sql = "select DISTINCT o.id as orderId,o.number,o.status,f.hospital,f.hospital_name as hospitalName1,o.is_trans_other_org," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " o.transed_org_code,h.name as hospitalName2,o.patient_name,f.idcard,o.doctor_sign_time,o.total_fee," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sql = "select DISTINCT o.id as orderId,o.number,o.status,o.is_trans_other_org," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " o.transed_org_code,o.patient_name,p.idcard,o.doctor_sign_time,o.total_fee," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " o.patient_phone,o.remark,o.create_time,o.patient as patientCode from wlyy_door_service_order o " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " LEFT JOIN wlyy_sign_family f ON f.patient = o.patient AND f. STATUS = 1 AND f.expenses_status = 1 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " LEFT JOIN base_org h on h.code=o.transed_org_code and h.del=1 " ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " LEFT JOIN base_patient p on p.id=o.patient " ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(!StringUtils.isEmpty(serverDoctorName)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql+=" RIGHT JOIN wlyy_door_doctor d on d.order_id = o.id"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -793,11 +791,13 @@ public class DoorOrderService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (!StringUtils.isEmpty(patientPhone)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " and o.patient_phone ='" + patientPhone + "'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isNotBlank(hospitalCode) && !hospitalCode.contains("%")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " and (f.hospital = '" + hospitalCode + "' or o.transed_org_code='" + hospitalCode + "') "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				/*            if (StringUtils.isNotBlank(hospitalCode) && !hospitalCode.contains("%")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                sql += " and (h.code = '" + hospitalCode + "' or o.transed_org_code='" + hospitalCode + "') "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " and ( o.transed_org_code='" + hospitalCode + "') "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else if(StringUtils.isNotBlank(hospitalCode) && hospitalCode.contains("%")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " and (f.hospital like '" + hospitalCode + "' or o.transed_org_code like '" + hospitalCode + "') "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                sql += " and (h.code like '" + hospitalCode + "' or o.transed_org_code like '" + hospitalCode + "') "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " and ( o.transed_org_code like '" + hospitalCode + "') "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (status != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " and o.status ='" + status + "'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -889,14 +889,7 @@ public class DoorOrderService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sheet.addCell(new Label(1, b + 1, statusName,cellFormat));//工单状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //工单是否转给其他机构,0-不转,1-已转 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String transOtherOrg = list.get(i).get("is_trans_other_org") + ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String hospitalName = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("0".equals(transOtherOrg)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    hospitalName = list.get(i).get("hospitalName1") + "";//签约表中的机构 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } else if ("1".equals(transOtherOrg)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    hospitalName = list.get(i).get("hospitalName2") + "";//转机构中的机构 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else if("null".equals(transOtherOrg)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    hospitalName = list.get(i).get("hospitalName1") + "";//签约表中的机构 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String hospitalName = "泰安市中医医院"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sheet.addCell(new Label(2, b + 1, hospitalName,cellFormat));//服务机构 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Date createTime = (Date) list.get(i).get("create_time"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1773,7 +1766,6 @@ public class DoorOrderService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   public List<Map<String,Object>> getOrderIdList(Integer status,String doctorCode){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       String sqlList = "select DISTINCT o.id as orderId"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       String sql = " from wlyy_door_service_order o " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               " LEFT JOIN wlyy_sign_family f ON f.patient = o.patient AND f. STATUS = 1 AND f.expenses_status = 1 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               " LEFT JOIN base_org h on h.code=o.hospital and h.del=1 " 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               +" LEFT JOIN wlyy_door_doctor d on d.order_id = o.id "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       sql+= " where 1=1 "; 
			 |