Переглянути джерело

人事修改修改

Signed-off-by: anderx <312518615@qq.com>
anderx 5 роки тому
батько
коміт
cd732c0f8b

+ 12 - 16
src/main/java/com/goafanti/personnel/controller/AdminPersonnelApiController.java

@@ -113,23 +113,19 @@ public class AdminPersonnelApiController extends CertifyApiController {
 	@RequestMapping(value = "/update", method = RequestMethod.POST)
 	public Result updatePersonnel(InputPersonnelBo i){
 		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())) {
 				i.setBirthday(DateUtils.StringToDate(i.getBirthdays(), AFTConstants.YYYYMMDD));