|
|
@@ -342,7 +342,7 @@ public class AdminUserLogic {
|
|
|
* 新增帐号
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public void add(AdminUserAddReqBean adminUser, Boolean addMch) throws RemoteServiceException {
|
|
|
+ public void add(AdminUserAddReqBean adminUser, Boolean addMch, Boolean addWebsit) throws RemoteServiceException {
|
|
|
AdminUserCom curAdminUser = commonLogic.getAdminUser();
|
|
|
if (StringUtils.isBlank(adminUser.getUserName()) || StringUtils.isBlank(adminUser.getPassword())) {
|
|
|
throw new RemoteServiceException("参数错误");
|
|
|
@@ -384,20 +384,22 @@ public class AdminUserLogic {
|
|
|
if (addMch) {
|
|
|
adminUser.setType(1);
|
|
|
} else {
|
|
|
- if (!curAdminUser.getType().equals(AdminWebsitTypeEnum.A.getKey()) && StringUtils.equals(adminWebsit.getType(), AdminWebsitTypeEnum.A.getKey())) {
|
|
|
- throw new RemoteServiceException("暂无权限创建当前网点的账号");
|
|
|
- }
|
|
|
- if (StringUtils.equals(adminWebsit.getType(), AdminWebsitTypeEnum.C.getKey())) {
|
|
|
- adminUser.setType(0);
|
|
|
- } else if (StringUtils.equals(adminWebsit.getType(), AdminWebsitTypeEnum.B.getKey())) {
|
|
|
- adminUser.setType(1);
|
|
|
- } else if (StringUtils.equals(adminWebsit.getType(), AdminWebsitTypeEnum.A.getKey())) {
|
|
|
- adminUser.setType(2);
|
|
|
+ if (!addWebsit) {
|
|
|
+ if (!curAdminUser.getType().equals(AdminWebsitTypeEnum.A.getKey()) && StringUtils.equals(adminWebsit.getType(), AdminWebsitTypeEnum.A.getKey())) {
|
|
|
+ throw new RemoteServiceException("暂无权限创建当前网点的账号");
|
|
|
+ }
|
|
|
+ if (StringUtils.equals(adminWebsit.getType(), AdminWebsitTypeEnum.C.getKey())) {
|
|
|
+ adminUser.setType(0);
|
|
|
+ } else if (StringUtils.equals(adminWebsit.getType(), AdminWebsitTypeEnum.B.getKey())) {
|
|
|
+ adminUser.setType(1);
|
|
|
+ } else if (StringUtils.equals(adminWebsit.getType(), AdminWebsitTypeEnum.A.getKey())) {
|
|
|
+ adminUser.setType(2);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if (!CollectionUtils.isEmpty(adminUser.getAdminDeptId())) {
|
|
|
+ if (!addWebsit && !CollectionUtils.isEmpty(adminUser.getAdminDeptId())) {
|
|
|
AdminDept adminDept = adminDeptService.getById(adminUser.getAdminDeptId().get(0));
|
|
|
|
|
|
if (!curAdminUser.getType().equals("2") && adminDept.getAdminDeptId().equals("1")) {
|