| 
															
																@ -10,6 +10,7 @@ import com.yihu.jw.entity.care.visit.BaseVisitDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.patient.dao.BasePatientDao; 
															 | 
															
															 | 
															
																import com.yihu.jw.patient.dao.BasePatientDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.common.IdCardUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.common.IdCardUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.date.DateUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.date.DateUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import org.apache.commons.lang.StringUtils; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springframework.beans.factory.annotation.Autowired; 
															 | 
															
															 | 
															
																import org.springframework.beans.factory.annotation.Autowired; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springframework.stereotype.Service; 
															 | 
															
															 | 
															
																import org.springframework.stereotype.Service; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -37,8 +38,12 @@ public class BaseVisitService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public List<Map<String, Object>> getListByDoctor(String doctorCode, String startTime, String endTime) throws Exception { 
															 | 
															
															 | 
															
																    public List<Map<String, Object>> getListByDoctor(String doctorCode, String startTime, String endTime) throws Exception { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        List<Map<String, Object>> re = new ArrayList<>(); 
															 | 
															
															 | 
															
																        List<Map<String, Object>> re = new ArrayList<>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        Map<String, Map<String, Object>> temp = new HashMap<>(); 
															 | 
															
															 | 
															
																        Map<String, Map<String, Object>> temp = new HashMap<>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        List<BaseVisitDO> list = baseVisitDao.findByDoctor(doctorCode, DateUtil.strToDate(startTime), DateUtil.strToDate(endTime)); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        List<BaseVisitDO> list = null; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if(StringUtils.isNotBlank(doctorCode)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            list = baseVisitDao.findByDoctor(doctorCode, DateUtil.strToDate(startTime), DateUtil.strToDate(endTime)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        }else{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            list = baseVisitDao.findByDoctor2(DateUtil.strToDate(startTime), DateUtil.strToDate(endTime)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (list != null && list.size() > 0) { 
															 | 
															
															 | 
															
																        if (list != null && list.size() > 0) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            for (BaseVisitDO visitDO : list) { 
															 | 
															
															 | 
															
																            for (BaseVisitDO visitDO : list) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                String date = DateUtil.dateToStrShort(visitDO.getVisitPlanDate()); 
															 | 
															
															 | 
															
																                String date = DateUtil.dateToStrShort(visitDO.getVisitPlanDate()); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -121,6 +126,37 @@ public class BaseVisitService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        return null; 
															 | 
															
															 | 
															
																        return null; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * 直接新增走访--管理员端 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @param visitContent 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @param visitImg 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public void adminAddVisit(String doctorCode,String patientCode,String visitContent,String visitImg) throws Exception{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        BaseVisitDO visitDO = new BaseVisitDO(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        //获取患者信息 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        BasePatientDO patient = patientDao.findById(patientCode); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (patient == null) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            throw new Exception("获取不到用户信息!"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        BaseDoctorDO doctor = doctorDao.findById(doctorCode); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (doctor == null) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            throw new Exception("获取不到医生信息!"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        visitDO.setDoctor(doctorCode); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        visitDO.setDoctorName(doctor.getName()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        visitDO.setPatient(patientCode); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        visitDO.setPatientName(patient.getName()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        visitDO.setVisitPlanDate(new Date()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        visitDO.setVisitDate(new Date()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        visitDO.setStatus("1"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        visitDO.setType("2"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        visitDO.setVisitContent(visitContent); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        visitDO.setVisitImg(visitImg); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        baseVisitDao.save(visitDO); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    /** 
															 | 
															
															 | 
															
																    /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * 完成走访 
															 | 
															
															 | 
															
																     * 完成走访 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @param id 
															 | 
															
															 | 
															
																     * @param id 
															 |