|  | @ -2091,4 +2091,115 @@ public class ImService {
 | 
	
		
			
				|  |  | 		re.put("list", ja);
 | 
	
		
			
				|  |  | 		return re;
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	/**
 | 
	
		
			
				|  |  | 	 * 健管平台模拟上传数据
 | 
	
		
			
				|  |  | 	 * @param list outpatientlist
 | 
	
		
			
				|  |  | 	 * @param date 日期
 | 
	
		
			
				|  |  | 	 */
 | 
	
		
			
				|  |  | 	public void setJobData(List<WlyyOutpatientDO> list,String date) throws Exception {
 | 
	
		
			
				|  |  | 		for (WlyyOutpatientDO outpatient: list){
 | 
	
		
			
				|  |  | 			ConsultTeamDo ct = new ConsultTeamDo();
 | 
	
		
			
				|  |  | 			
 | 
	
		
			
				|  |  | 			if("1" == outpatient.getOutpatientType()){
 | 
	
		
			
				|  |  | 				if("1".equals(outpatient.getType())){
 | 
	
		
			
				|  |  | 					ct.setType(9);//图文复诊
 | 
	
		
			
				|  |  | 				}else if("2".equals(outpatient.getType())){
 | 
	
		
			
				|  |  | 					ct.setType(16);//视频复诊
 | 
	
		
			
				|  |  | 				}else{}
 | 
	
		
			
				|  |  | 			}else if("2" == outpatient.getOutpatientType()){
 | 
	
		
			
				|  |  | 				ct.setType(12);//协同门诊
 | 
	
		
			
				|  |  | 			}else{}
 | 
	
		
			
				|  |  | 			
 | 
	
		
			
				|  |  | 			BaseDoctorDO doctor = baseDoctorDao.findById(outpatient.getDoctor());
 | 
	
		
			
				|  |  | //			doctorCode = doctor.getCode();
 | 
	
		
			
				|  |  | 			// 查询患者信息
 | 
	
		
			
				|  |  | 			BasePatientDO p = basePatientDao.findById(outpatient.getPatient());
 | 
	
		
			
				|  |  | 			
 | 
	
		
			
				|  |  | 			String title = "";
 | 
	
		
			
				|  |  | 			//协同门诊
 | 
	
		
			
				|  |  | 			if("2".equals(outpatient.getOutpatientType())){
 | 
	
		
			
				|  |  | 				title = "申请协同门诊";
 | 
	
		
			
				|  |  | 			}else{
 | 
	
		
			
				|  |  | 				title = "申请复诊";
 | 
	
		
			
				|  |  | 			}
 | 
	
		
			
				|  |  | 			
 | 
	
		
			
				|  |  | 			//关联业务code
 | 
	
		
			
				|  |  | 			ct.setRelationCode(outpatient.getId());
 | 
	
		
			
				|  |  | 			//医生信息
 | 
	
		
			
				|  |  | 			ct.setDoctor(outpatient.getDoctor());
 | 
	
		
			
				|  |  | 			ct.setDoctorName(doctor.getName());
 | 
	
		
			
				|  |  | 			// 设置患者信息
 | 
	
		
			
				|  |  | 			ct.setPatient(outpatient.getPatient());
 | 
	
		
			
				|  |  | 			ct.setSymptoms(outpatient.getDescription());
 | 
	
		
			
				|  |  | 			
 | 
	
		
			
				|  |  | 			// 设置患者姓名
 | 
	
		
			
				|  |  | 			ct.setName(p.getName());
 | 
	
		
			
				|  |  | 			// 设置患者生日
 | 
	
		
			
				|  |  | 			ct.setBirthday(p.getBirthday());
 | 
	
		
			
				|  |  | 			//新增性别
 | 
	
		
			
				|  |  | 			ct.setSex(p.getSex());
 | 
	
		
			
				|  |  | 			// 设置患者头像
 | 
	
		
			
				|  |  | 			ct.setPhoto(p.getPhoto());
 | 
	
		
			
				|  |  | 			// 设置操作日期
 | 
	
		
			
				|  |  | 			ct.setCzrq(new Date());
 | 
	
		
			
				|  |  | 			ct.setDel("1");
 | 
	
		
			
				|  |  | 			ct.setStatus(0);
 | 
	
		
			
				|  |  | 			ct.setEvaluate(0);
 | 
	
		
			
				|  |  | 			// 医生未读数量为1
 | 
	
		
			
				|  |  | 			ct.setDoctorRead(1);
 | 
	
		
			
				|  |  | 			ct.setCzrq(outpatient.getAdmDate());
 | 
	
		
			
				|  |  | 			
 | 
	
		
			
				|  |  | 			ConsultDo consult = new ConsultDo();
 | 
	
		
			
				|  |  | 			consult.setId(UUID.randomUUID().toString().replaceAll("-", ""));
 | 
	
		
			
				|  |  | 			consult.setCzrq(new Date());
 | 
	
		
			
				|  |  | 			consult.setDel("1");
 | 
	
		
			
				|  |  | 			consult.setPatient(p.getId());
 | 
	
		
			
				|  |  | 			consult.setTitle(title);
 | 
	
		
			
				|  |  | 			consult.setSymptoms(outpatient.getDescription());
 | 
	
		
			
				|  |  | //			consult.setImages(images);
 | 
	
		
			
				|  |  | 			consult.setType(ct.getType());
 | 
	
		
			
				|  |  | 			consult = consultDao.save(consult);
 | 
	
		
			
				|  |  | 			ct.setConsult(consult.getId());
 | 
	
		
			
				|  |  | 			ct.setCzrq(outpatient.getAdmDate());
 | 
	
		
			
				|  |  | 			ct = consultTeamDao.save(ct);
 | 
	
		
			
				|  |  | 			
 | 
	
		
			
				|  |  | 			String scoreContent= "[{\"scoreType\":\"1\",\"score\":100,\"content\":\"\"},{\"scoreType\":\"2\",\"score\":100,\"content\":\"\"},{\"scoreType\":\"3\",\"score\":100,\"content\":\"\"},{\"scoreType\":\"4\",\"score\":0,\"content\":\"五星好评!\"}]";
 | 
	
		
			
				|  |  | 			
 | 
	
		
			
				|  |  | 			this.evaluationByConsultCode(consult.getId(),scoreContent,2);
 | 
	
		
			
				|  |  | 		}
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	/**
 | 
	
		
			
				|  |  | 	 * 健管平台模拟删除数据
 | 
	
		
			
				|  |  | 	 * @param list outpatientlist
 | 
	
		
			
				|  |  | 	 * @param date 日期
 | 
	
		
			
				|  |  | 	 */
 | 
	
		
			
				|  |  | 	public void deleteJobData(List<WlyyOutpatientDO> list,String date) throws Exception {
 | 
	
		
			
				|  |  | 		for (WlyyOutpatientDO outpatient: list){
 | 
	
		
			
				|  |  | 			String consultCode =  this.getConsultCodeByOutpatientId(outpatient.getId());
 | 
	
		
			
				|  |  | 			if(!StringUtils.isEmpty(consultCode)){
 | 
	
		
			
				|  |  | 				ConsultTeamDo consultTeamDo = consultTeamDao.findByConsult(consultCode);
 | 
	
		
			
				|  |  | 				consultTeamDao.delete(consultTeamDo.getId());
 | 
	
		
			
				|  |  | 				consultTeamDao.delete(consultCode);
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				//根据咨询查找评价
 | 
	
		
			
				|  |  | 				List<BaseEvaluateScoreDO> baseEvaluateScoreDOS = new ArrayList<>();
 | 
	
		
			
				|  |  | 				baseEvaluateScoreDOS = baseEvaluateScoreDao.findByRelationCode(consultCode);
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				for (BaseEvaluateScoreDO evaluateScoreDO :baseEvaluateScoreDOS){
 | 
	
		
			
				|  |  | 					List<BaseEvaluateDO> baseEvaluateDOS =  new ArrayList<>();
 | 
	
		
			
				|  |  | 					baseEvaluateDOS = baseEvaluateDao.findByRelationCode(evaluateScoreDO.getId());
 | 
	
		
			
				|  |  | 					for(BaseEvaluateDO baseEvaluateDO:baseEvaluateDOS){
 | 
	
		
			
				|  |  | 						//删除评价评分表
 | 
	
		
			
				|  |  | 						baseEvaluateDao.delete(baseEvaluateDO.getId());
 | 
	
		
			
				|  |  | 					}
 | 
	
		
			
				|  |  | 					//删除评分主表
 | 
	
		
			
				|  |  | 					baseEvaluateDao.delete(evaluateScoreDO.getId());
 | 
	
		
			
				|  |  | 				}
 | 
	
		
			
				|  |  | 			}
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 			
 | 
	
		
			
				|  |  | 		}
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | }
 |