|  | @ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 | 
	
		
			
				|  |  | import com.yihu.jw.doctor.dao.BaseDoctorDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.door.dao.*;
 | 
	
		
			
				|  |  | import com.yihu.jw.door.util.MessageUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.door.util.StreamUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.im.ConsultDo;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.im.ConsultTeamDo;
 | 
	
	
		
			
				|  | @ -23,7 +24,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;
 | 
	
	
		
			
				|  | @ -768,11 +768,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";
 | 
	
		
			
				|  |  |             }
 | 
	
	
		
			
				|  | @ -787,11 +786,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 + "'";
 | 
	
		
			
				|  |  |             }
 | 
	
	
		
			
				|  | @ -883,14 +884,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");
 | 
	
	
		
			
				|  | @ -1583,9 +1577,10 @@ public class DoorOrderService {
 | 
	
		
			
				|  |  |             fileName = java.net.URLEncoder.encode(fileName,"UTF-8");
 | 
	
		
			
				|  |  |             fileName = java.net.URLDecoder.decode(fileName,"UTF-8");
 | 
	
		
			
				|  |  |             response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
 | 
	
		
			
				|  |  |             String pathName = this.getClass().getResource("/").getPath() + "conclusion.mht";
 | 
	
		
			
				|  |  |             System.out.println("路径pathName:" + pathName);
 | 
	
		
			
				|  |  |             Document doc = Jsoup.parse(new File(pathName), "UTF-8");
 | 
	
		
			
				|  |  | //            String pathName = this.getClass().getResource("/").getPath() + "conclusion.mht";
 | 
	
		
			
				|  |  | //            System.out.println("路径pathName:" + pathName);
 | 
	
		
			
				|  |  | //            Document doc = Jsoup.parse(new File(pathName), "UTF-8");
 | 
	
		
			
				|  |  |             Document doc = Jsoup.parse(StreamUtil.readResources());
 | 
	
		
			
				|  |  |             String html = this.handleData(doc, orderId.get(i));//16
 | 
	
		
			
				|  |  |             BufferedWriter bw = new BufferedWriter(new FileWriter(path+"/"+fileName));//创建的文件
 | 
	
		
			
				|  |  |             bw.write(html);
 | 
	
	
		
			
				|  | @ -1699,12 +1694,11 @@ 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 ";
 | 
	
		
			
				|  |  |        if(status == 6){//已完成状态
 | 
	
		
			
				|  |  |            sql+=" and o.status ='"+status+"'";
 | 
	
		
			
				|  |  |            sql+=" and o.status in (5,6) ";
 | 
	
		
			
				|  |  |        }else {//5是待补录状态
 | 
	
		
			
				|  |  |            sql+=" and o.conclusion_status =1 ";
 | 
	
		
			
				|  |  |        }
 |