| 
					
				 | 
			
			
				@ -1374,6 +1374,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject data = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            data.put("name", outpatient.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            data.put("consumerName",outpatient.getConsumerName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            data.put("age", IdCardUtil.getAgeForIdcard(outpatient.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            data.put("gender", IdCardUtil.getSexForIdcard_new(outpatient.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            data.put("recipeType", prescriptionDO.getDispensaryType()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4404,6 +4405,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //医生关注 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(patient)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<WlyyOutpatientDO> wlyyOutpatientDOList= outpatientDao.findOutpatientAndPatient(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (wlyyOutpatientDOList != null && wlyyOutpatientDOList.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    rs.put("isComment", "1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    rs.put("isComment", "0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //专家咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String zjCountsql = "SELECT id AS \"id\" FROM wlyy_consult_team WHERE doctor='" + doctor + "' AND (type=1 OR type=15)"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4778,6 +4790,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("name", wlyyOutpatientDO.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("consumerName",wlyyOutpatientDO.getConsumerName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("age", IdCardUtil.getAgeForIdcard(wlyyOutpatientDO.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("gender", IdCardUtil.getSexForIdcard(wlyyOutpatientDO.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("question", wlyyOutpatientDO.getIcd10Name()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -8271,6 +8284,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                systemMessageDO.setSenderName(outpatient.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                systemMessageDO.setRelationCode(outpatient.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("name", outpatient.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("consumerName",outpatient.getConsumerName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("age", IdCardUtil.getAgeForIdcard(outpatient.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("gender", IdCardUtil.getSexForIdcard_new(outpatient.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("question", outpatient.getDescription()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -8316,6 +8330,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                systemMessageDO.setSenderName(outpatient.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                systemMessageDO.setRelationCode(outpatient.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("name", outpatient.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("consumerName",outpatient.getConsumerName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("age", IdCardUtil.getAgeForIdcard(outpatient.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("gender", IdCardUtil.getSexForIdcard_new(outpatient.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("question", outpatient.getDescription()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -8359,6 +8374,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("name", outpatient.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("age", IdCardUtil.getAgeForIdcard(outpatient.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("gender", IdCardUtil.getSexForIdcard_new(outpatient.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("consumerName",outpatient.getConsumerName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("question", outpatient.getDescription()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("msg", msg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                systemMessageDO.setData(data.toString()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -8413,6 +8429,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("name", outpatient.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("age", IdCardUtil.getAgeForIdcard(outpatient.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("gender", IdCardUtil.getSexForIdcard_new(outpatient.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("consumerName",outpatient.getConsumerName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("question", outpatient.getDescription()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("msg", msg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("type", type); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -8451,6 +8468,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("name", patientDO.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("age", IdCardUtil.getAgeForIdcard(patientDO.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("consumerName",outpatient.getConsumerName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("gender", IdCardUtil.getSexForIdcard_new(patientDO.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("question", consultTeamDo.getSymptoms()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("msg", msg); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -9938,7 +9956,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                gender = IdCardUtil.getSexForIdcard(patientDO.getIdcard()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String conditiaon=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (wlyyOutpatientDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("consumerName",wlyyOutpatientDO.getConsumerName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (!wlyyOutpatientDO.getConsumerName().equalsIgnoreCase(prescriptionDO.getPatientName())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    conditiaon = "("+wlyyOutpatientDO.getConsumerName()+"代问诊)"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            data.put("name", prescriptionDO.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            data.put("age", age); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            data.put("gender", gender); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            data.put("outpatientId", prescriptionDO.getOutpatientId()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -9947,7 +9974,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                systemMessageDO.setType("9"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                systemMessageDO.setTitle("审方通过"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("message", "审方通过"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("message", "您为" + prescriptionDO.getPatientName() + "(" + age + "岁 " + gender + ")开具的处方已审核通过。"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("message", "您为" + prescriptionDO.getPatientName() +conditiaon+"(" + age + "岁 " + gender + ")开具的处方已审核通过。"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 *  * @param userName      推送人姓名 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 * @param idCard        推送人身份证 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -9973,7 +10000,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                systemMessageDO.setType("8"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                systemMessageDO.setTitle("审方退回"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("message", "审方退回"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("message", "您为" + prescriptionDO.getPatientName() + "(" + age + "岁 " + gender + ")开具的处方被审方退回,请尽快处理"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                data.put("message", "您为" + prescriptionDO.getPatientName() +conditiaon+ "(" + age + "岁 " + gender + ")开具的处方被审方退回,请尽快处理"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            systemMessageDO.setData(data.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            systemMessageService.saveMessage(systemMessageDO); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -11062,7 +11089,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.check_status as \"checkStatus\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.id as \"id\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.status as \"status\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.check_reason as \"checkReason\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.check_reason as \"checkReason\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " o.consumer as \"consumer\", "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " o.consumer_name as \"consumerName\" "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " from wlyy_prescription p left join wlyy_outpatient o on p.outpatient_id  = o.id" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " where  1=1 "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNotBlank(keyWord)){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -13879,7 +13908,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            DecimalFormat df = new DecimalFormat("#.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String[] header3 = {"无","无",df.format(Double.parseDouble(price1)),df.format(Double.parseDouble(price1)),"无"};// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String[] header3 = {"无",startTime+"至"+endTime,df.format(Double.parseDouble(price1)),df.format(Double.parseDouble(price1)),"无"};// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            int k3 = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (String h : header3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                addCell(ws, 3, k3, h);//表名,行,列,header 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -13923,7 +13952,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (Map<String, Object> map:mapList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (map.get("orderCategory")!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if(map.get("orderCategory").toString().equalsIgnoreCase("5")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("payPrice",Double.parseDouble(map.get("orderCategory").toString())*100); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    logger.info("payPrice"+Double.parseDouble(map.get("payPrice").toString())+"===="+Double.parseDouble(map.get("payPrice").toString())*100); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("payPrice",Double.parseDouble(map.get("payPrice").toString())*100); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -13994,7 +14024,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Double price7 = Double.parseDouble(price4);//处方费 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Double price8 = Double.parseDouble(price5);//就诊卡充值 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            DecimalFormat df = new DecimalFormat("#.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String[] header3 = {"无",df.format(price6+price7+price8)+"",df.format(price8)+"",df.format(price7)+"",df.format(price6)+""};// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String[] header3 = {startTime+"至"+endTime,df.format(price6+price7+price8)+"",df.format(price8)+"",df.format(price7)+"",df.format(price6)+""};// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            int k3 = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (String h : header3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                addCell(ws, 3, k3, h);//表名,行,列,header 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -14143,7 +14173,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                addCell(ws, 1, k1, h);//表名,行,列,header 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                k1++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String[] header2 = {"患者名称","订单药品","规格","总量","单位","进价","零售价","进货金额","零售金额","发药时间","审方时间","开方时间"};// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String[] header2 = {"患者名称","订单药品","规格","总量","单位","进价","零售价","进货金额","零售金额","发药时间","审方时间","开方时间","开方医生"};// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            int k2 = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (String h : header2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                addCell(ws, 2, k2, h);//表名,行,列,header 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -14179,6 +14209,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        addCell(ws, i, 9,jsonObject.get("dispDate")!=null?DateUtil.stampToString(jsonObject.get("dispDate").toString()):n); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        addCell(ws, i, 10,jsonObject.get("checkTime")!=null?DateUtil.stampToString(jsonObject.get("checkTime").toString()):n); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        addCell(ws, i, 11,jsonObject.get("createTime")!=null?DateUtil.stampToString(jsonObject.get("createTime").toString()):n); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        addCell(ws, i, 12,jsonObject.get("doctorName")!=null?jsonObject.get("doctorName").toString():n); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        i++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    ws.mergeCells(0,j,0,i-1); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -14189,8 +14220,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ws.mergeCells(0,0,11,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ws.mergeCells(0,1,11,1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ws.mergeCells(0,0,12,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ws.mergeCells(0,1,12,1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            wwb.write(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            wwb.close(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } catch (IOException e) { 
			 |