|
|
@@ -94,23 +94,18 @@ public class AdminSuperviserApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "", "咨询师管理员"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
Admin ad = new Admin();
|
|
|
BeanUtils.copyProperties(admin, ad);
|
|
|
/*ad.setId(UUID.randomUUID().toString());*/
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.set(Calendar.MILLISECOND, 0);
|
|
|
-
|
|
|
ad.setCreateTime(now.getTime());
|
|
|
if (StringUtils.isBlank(ad.getPassword())) {
|
|
|
ad.setPassword(AFTConstants.INITIALPASSWORD);
|
|
|
}
|
|
|
ad.setPassword(passwordUtil.getEncryptPwd(ad));
|
|
|
-
|
|
|
res.setData(newAdminService.insertNewAdmin(ad,roles));
|
|
|
}
|
|
|
-
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -129,22 +124,18 @@ public class AdminSuperviserApiController extends CertifyApiController {
|
|
|
}
|
|
|
if (null != jo) {
|
|
|
Admin admin = jo.toJavaObject(Admin.class);
|
|
|
-
|
|
|
if (null == admin.getId()) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户id"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
if (null == admin.getMobile()) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "登录帐号为空", "登录帐号"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
if (null == admin.getName()) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "用户名为空", "用户名"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
Admin aa = newAdminService.selectByMobile(admin.getMobile().trim());
|
|
|
if (null != aa && !admin.getId().equals(aa.getId())) {
|
|
|
res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "当前用户已注册!"));
|
|
|
@@ -155,7 +146,6 @@ public class AdminSuperviserApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户id"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
if (newAdminService.checkAdminRole(roles,admin)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "", "咨询师管理员"));
|
|
|
return res;
|
|
|
@@ -168,10 +158,8 @@ public class AdminSuperviserApiController extends CertifyApiController {
|
|
|
}
|
|
|
res.setData(newAdminService.updateByPrimaryKeySelective(ad, roles));
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
return res;
|
|
|
-}
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 重置管理员密码
|
|
|
@@ -183,7 +171,6 @@ public class AdminSuperviserApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户id"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
Admin admin = newAdminService.selectByPrimaryKey(id);
|
|
|
if (null == admin) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户id"));
|
|
|
@@ -219,7 +206,6 @@ public class AdminSuperviserApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "省份为空", "所在省份"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
if (province.intValue() > AFTConstants.PROVINCEMAXNUM) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "所在省份"));
|
|
|
return res;
|