浏览代码

Merge branch 'dev' of lyr/patient-co-management into dev

lyr 8 年之前
父节点
当前提交
7867b50f47

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java

@ -308,4 +308,7 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
	@Query("select a from SignFamily a where a.patient = ?1 and a.status >= 0")
	List<SignFamily> findAllSignByPatient(String patient);
	@Query("select a.patient from SignFamily a where a.doctor = ?1 and a.type = 2 and a.status > 0 and a.doctorHealth is null")
	List<String> findNohealthByDoctor(String doctor);
}

+ 14 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java

@ -785,6 +785,20 @@ public class DoctorInfoService extends BaseService {
        }
    }
    @Transactional
    public void updateTeamHealthDoctorsAll(String newDoctorCode,String doctor) throws Exception {
        List<String> patients = signFamilyDao.findNohealthByDoctor(doctor);
        if(patients != null){
            for (String patient : patients) {
                try {
                    updateTeamHealthDoctor(newDoctorCode, "", patient);
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }
    }
    /**
     * 医生更换手机号
     *

+ 10 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -1472,9 +1472,17 @@ public class DoctorController extends BaseController {
    @ResponseBody
    public String updateTeamHealthDoctors(String newDoctorCode,
                                          @RequestParam(required = false) String oldDoctorCode,
                                          String patients) {
                                          @RequestParam(required = false) String patients,
                                          @RequestParam(required = false) String isAll) {
        try {
            doctorInfoService.updateTeamHealthDoctors(newDoctorCode, oldDoctorCode, patients);
            if (StringUtils.isNotEmpty(isAll) && isAll.equals("1")) {
                doctorInfoService.updateTeamHealthDoctorsAll(newDoctorCode, getUID());
            } else {
                if (StringUtils.isEmpty(patients)) {
                    return error(-1, "居民不能为空");
                }
                doctorInfoService.updateTeamHealthDoctors(newDoctorCode, oldDoctorCode, patients);
            }
            return write(200, "更新成功");
        } catch (Exception e) {
            e.printStackTrace();