no message
This commit is contained in:
parent
79a9d8e47e
commit
89bf856d96
@ -22,6 +22,8 @@ public class TreeSelect implements Serializable {
|
||||
// 节点名称
|
||||
private String label;
|
||||
|
||||
private String deptType;
|
||||
|
||||
// 子节点
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<TreeSelect> childrens;
|
||||
@ -35,6 +37,7 @@ public class TreeSelect implements Serializable {
|
||||
{
|
||||
this.id = dept.getDeptId();
|
||||
this.label = dept.getDeptName();
|
||||
this.deptType = dept.getDeptType();
|
||||
this.childrens = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
public TreeSelect(TreeNode menu) {
|
||||
@ -66,4 +69,12 @@ public class TreeSelect implements Serializable {
|
||||
public void setChildrens(List<TreeSelect> childrens) {
|
||||
this.childrens = childrens;
|
||||
}
|
||||
|
||||
public String getDeptType() {
|
||||
return deptType;
|
||||
}
|
||||
|
||||
public void setDeptType(String deptType) {
|
||||
this.deptType = deptType;
|
||||
}
|
||||
}
|
||||
|
@ -132,11 +132,13 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
||||
|
||||
return paginationResponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<TAccount> listAccount(com.baomidou.mybatisplus.extension.plugins.pagination.Page page, TAccount accountInfo) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
SysDept sysDept = deptService.selectDeptById(nowAccountInfo.getDeptId());
|
||||
return baseMapper.listAccount(page, accountInfo,sysDept.getAncestors());
|
||||
IPage<TAccount> tAccountIPage = baseMapper.listAccount(page, accountInfo, sysDept.getAncestors());
|
||||
return tAccountIPage;
|
||||
}
|
||||
@Override
|
||||
public AccountInfo getAccountByName(String userName) {
|
||||
|
@ -23,6 +23,7 @@ import com.fuint.utils.StringUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
@ -170,6 +171,7 @@ public class BackendAccountController extends BaseController {
|
||||
@ApiOperation(value = "新增账户")
|
||||
@RequestMapping(value = "/doCreate", method = RequestMethod.POST)
|
||||
@CrossOrigin
|
||||
@Transactional
|
||||
public ResponseObject doCreate(HttpServletRequest request, @RequestBody Map<String, Object> param) {
|
||||
String token = request.getHeader("Access-Token");
|
||||
AccountInfo loginAccount = TokenUtil.getAccountInfoByToken(token);
|
||||
@ -177,11 +179,12 @@ public class BackendAccountController extends BaseController {
|
||||
return getFailureResult(1001, "请先登录");
|
||||
}
|
||||
|
||||
List<Integer> roleIds = (List) param.get("roleIds");
|
||||
// List<Integer> roleIds = (List) param.get("roleIds");
|
||||
String accountName = param.get("accountName").toString();
|
||||
String accountStatus = param.get("accountStatus").toString();
|
||||
String realName = param.get("realName").toString();
|
||||
String password = param.get("password").toString();
|
||||
String roleIds = param.get("roleIds").toString();
|
||||
String storeId = param.get("storeId") == null ? "0" : param.get("storeId").toString();
|
||||
String merchantId = param.get("merchantId") == null ? "0" : param.get("merchantId").toString();
|
||||
String staffId = param.get("staffId") == null ? "0" : param.get("staffId").toString();
|
||||
@ -192,17 +195,18 @@ public class BackendAccountController extends BaseController {
|
||||
}
|
||||
|
||||
List<TDuty> duties = new ArrayList<>();
|
||||
if (roleIds.size() > 0) {
|
||||
Integer[] roles = roleIds.toArray(new Integer[roleIds.size()]);
|
||||
String[] ids = new String[roles.length];
|
||||
for (int i = 0; i < roles.length; i++) {
|
||||
ids[i] = roles[i].toString();
|
||||
}
|
||||
duties = tDutyService.findDatasByIds(ids);
|
||||
if (duties.size() < roleIds.size()) {
|
||||
return getFailureResult(201, "您分配的角色不存在");
|
||||
}
|
||||
}
|
||||
// todo
|
||||
// if (roleIds.size() > 0) {
|
||||
// Integer[] roles = roleIds.toArray(new Integer[roleIds.size()]);
|
||||
// String[] ids = new String[roles.length];
|
||||
// for (int i = 0; i < roles.length; i++) {
|
||||
// ids[i] = roles[i].toString();
|
||||
// }
|
||||
// duties = tDutyService.findDatasByIds(ids);
|
||||
// if (duties.size() < roleIds.size()) {
|
||||
// return getFailureResult(201, "您分配的角色不存在");
|
||||
// }
|
||||
// }
|
||||
|
||||
TAccount tAccount = new TAccount();
|
||||
tAccount.setAccountKey(CommonUtil.createAccountKey());
|
||||
|
Loading…
Reference in New Issue
Block a user