소스 검색

新增医生添加身份证格式验证

huangzhiyong 6 년 전
부모
커밋
0317fcf10f
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      src/main/java/com.yihu.ehr/basic/user/controller/DoctorEndPoint.java

+ 7 - 0
src/main/java/com.yihu.ehr/basic/user/controller/DoctorEndPoint.java

@ -16,10 +16,12 @@ import com.yihu.ehr.basic.user.service.DoctorService;
import com.yihu.ehr.basic.user.service.RoleUserService;
import com.yihu.ehr.basic.user.service.RolesService;
import com.yihu.ehr.basic.user.service.UserService;
import com.yihu.ehr.basic.util.IdcardValidator;
import com.yihu.ehr.constants.ApiVersion;
import com.yihu.ehr.constants.ServiceApi;
import com.yihu.ehr.controller.EnvelopRestEndPoint;
import com.yihu.ehr.entity.patient.DemographicInfo;
import com.yihu.ehr.model.common.Result;
import com.yihu.ehr.model.org.MOrgDeptJson;
import com.yihu.ehr.model.user.MDoctor;
import com.yihu.ehr.util.datetime.DateUtil;
@ -76,6 +78,8 @@ public class DoctorEndPoint extends EnvelopRestEndPoint {
    private RolesService rolesService;
    @Autowired
    private RoleUserService roleUserService;
    @Autowired
    private IdcardValidator idcardValidator;
    @RequestMapping(value = ServiceApi.Doctors.Doctors, method = RequestMethod.GET)
    @ApiOperation(value = "获取医生列表", notes = "根据查询条件获取医生列表在前端表格展示")
@ -133,6 +137,9 @@ public class DoctorEndPoint extends EnvelopRestEndPoint {
        Organization organization = orgService.getOrgById(mOrgDeptJson.getOrgId());
        OrgDept orgDept = orgDeptService.searchBydeptId(Integer.parseInt(mOrgDeptJson.getDeptIds().split(",")[0]));
        Doctors doctor = toEntity(doctoJsonData, Doctors.class);
        if (!idcardValidator.isValidatedAllIdcard(doctor.getIdCardNo())){
            return null;
        }
        doctor.setStatus("1");
        doctor.setPyCode(PinyinUtil.getPinYinHeadChar(doctor.getName(), false));
        doctor.setOrgId(organization.getId().toString());