|
@@ -113,23 +113,19 @@ public class AdminPersonnelApiController extends CertifyApiController {
|
|
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
|
public Result updatePersonnel(InputPersonnelBo i){
|
|
public Result updatePersonnel(InputPersonnelBo i){
|
|
|
Result res = new Result();
|
|
Result res = new Result();
|
|
|
- if (i.getDoorId()==null) {
|
|
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "门禁", "门禁"));
|
|
|
|
|
- return res;
|
|
|
|
|
- }
|
|
|
|
|
- if (i.getEmployeeId()==null) {
|
|
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "员工编号", "员工编号"));
|
|
|
|
|
- return res;
|
|
|
|
|
- }
|
|
|
|
|
- int x=personnelService.checkDoorId(i.getDoorId(),i.getId());
|
|
|
|
|
- if(x>0) {
|
|
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "门禁", "门禁"));
|
|
|
|
|
- return res;
|
|
|
|
|
|
|
+ if (i.getDoorId()!=null) {
|
|
|
|
|
+ int x=personnelService.checkDoorId(i.getDoorId(),i.getId());
|
|
|
|
|
+ if(x>0) {
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "门禁", "门禁"));
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- int y=personnelService.checkEmployeeId(i.getEmployeeId(),i.getId());
|
|
|
|
|
- if (y>0) {
|
|
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "员工编号", "员工编号"));
|
|
|
|
|
- return res;
|
|
|
|
|
|
|
+ if (i.getEmployeeId()!=null) {
|
|
|
|
|
+ int y=personnelService.checkEmployeeId(i.getEmployeeId(),i.getId());
|
|
|
|
|
+ if (y>0) {
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "员工编号", "员工编号"));
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if ( !StringUtils.isBlank(i.getBirthdays())) {
|
|
if ( !StringUtils.isBlank(i.getBirthdays())) {
|
|
|
i.setBirthday(DateUtils.StringToDate(i.getBirthdays(), AFTConstants.YYYYMMDD));
|
|
i.setBirthday(DateUtils.StringToDate(i.getBirthdays(), AFTConstants.YYYYMMDD));
|