Commit d682ee60 by zhiwj

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-auth into developer
parents 838bee85 5b4417da
......@@ -212,4 +212,35 @@ public class AccountGroupController {
String operationObject = result.isSuccess() ? result.getResult() : null;
return OperationResultUtils.operationResult(result, "添加组员", operationObject);
}
/**
* 新增账号分组,并且添加组员
* @Title: addGroupAndMember

* @Description:

* @author guojuxing
* @param memberArr
* @param dto

* @return com.gic.commons.webapi.reponse.RestResponse


*/
@RequestMapping("/add-group-and-member")
public RestResponse addGroupAndMember(String memberArr, AccountGroupDTO dto) {
LOGGER.info("添加账号分组&组员数组参数:{}", memberArr);
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
dto.setEnterpriseId(enterpriseId);
ServiceResponse<Integer> addGroupResponse = accountGroupApiService.save(dto);
if (addGroupResponse.isSuccess()) {
Integer groupId = addGroupResponse.getResult();
List<AccountGroupMemberDTO> list = JSON.parseArray(memberArr, AccountGroupMemberDTO.class);
if (CollectionUtils.isNotEmpty(list)) {
for (AccountGroupMemberDTO temp : list) {
temp.setEnterpriseId(enterpriseId);
temp.setAccountGroupId(groupId);
}
}
ServiceResponse<String> result = accountGroupApiService.saveAccountGroupRelFetch(list);
String operationObject = result.isSuccess() ? result.getResult() : null;
return OperationResultUtils.operationResult(result, "添加账号分组和组员", operationObject);
}
return RestResponse.failure(addGroupResponse.getCode(), addGroupResponse.getMessage());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment