Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage
This commit is contained in:
+16
-4
@@ -9,6 +9,7 @@ import com.jero.common.system.base.controller.JeroController;
|
|||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.modules.extRepo.entity.ExtRepoData;
|
import com.jero.modules.extRepo.entity.ExtRepoData;
|
||||||
|
import com.jero.modules.extRepo.entity.ExtRepoDataPage;
|
||||||
import com.jero.modules.extRepo.service.IExtRepoDataService;
|
import com.jero.modules.extRepo.service.IExtRepoDataService;
|
||||||
import com.jero.modules.extRepo.service.IExtRepoFolderService;
|
import com.jero.modules.extRepo.service.IExtRepoFolderService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -78,7 +79,8 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
|
|||||||
log.info("查询当前页数量:" + pageList.getSize());
|
log.info("查询当前页数量:" + pageList.getSize());
|
||||||
log.info("查询结果数量:" + pageList.getRecords().size());
|
log.info("查询结果数量:" + pageList.getRecords().size());
|
||||||
log.info("数据总数:" + pageList.getTotal());
|
log.info("数据总数:" + pageList.getTotal());
|
||||||
return Result.OK(pageList);
|
ExtRepoDataPage res = new ExtRepoDataPage(extRepoFolderService.haveManageAuth(extRepoData.getSupFolder()), pageList);
|
||||||
|
return Result.OK(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -122,7 +124,9 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
|
|||||||
@ApiOperation(value = "对外报告数据表-编辑", notes = "对外报告数据表-编辑")
|
@ApiOperation(value = "对外报告数据表-编辑", notes = "对外报告数据表-编辑")
|
||||||
@PutMapping(value = "/edit")
|
@PutMapping(value = "/edit")
|
||||||
public Result<?> edit(@Validated @RequestBody ExtRepoData extRepoData) {
|
public Result<?> edit(@Validated @RequestBody ExtRepoData extRepoData) {
|
||||||
if (extRepoFolderService.haveManageAuth(extRepoData.getSupFolder())) {
|
ExtRepoData erd = extRepoDataService.queryById(extRepoData.getId());
|
||||||
|
if (extRepoFolderService.haveManageAuth(erd.getSupFolder())) {
|
||||||
|
extRepoData.setSupFolder(erd.getSupFolder());
|
||||||
extRepoDataService.editById(extRepoData);
|
extRepoDataService.editById(extRepoData);
|
||||||
return Result.OK("编辑成功!");
|
return Result.OK("编辑成功!");
|
||||||
} else {
|
} else {
|
||||||
@@ -142,7 +146,7 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
|
|||||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
ExtRepoData erd = extRepoDataService.queryById(id);
|
ExtRepoData erd = extRepoDataService.queryById(id);
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
if (extRepoFolderService.haveManageAuth(erd.getSupFolder()) && erd.getCreateBy().equals(sysUser.getUsername())) {
|
if (erd.getCreateBy().equals(sysUser.getUsername())) {
|
||||||
extRepoDataService.deleteById(id);
|
extRepoDataService.deleteById(id);
|
||||||
return Result.OK("删除成功!");
|
return Result.OK("删除成功!");
|
||||||
} else {
|
} else {
|
||||||
@@ -160,7 +164,15 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
|
|||||||
@ApiOperation(value = "对外报告数据表-批量删除", notes = "对外报告数据表-批量删除")
|
@ApiOperation(value = "对外报告数据表-批量删除", notes = "对外报告数据表-批量删除")
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
this.extRepoDataService.deleteByIds(Arrays.asList(ids.split(",")));
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
List<String> idsList = Arrays.asList(ids.split(","));
|
||||||
|
for (String id : idsList) {
|
||||||
|
ExtRepoData erd = extRepoDataService.queryById(id);
|
||||||
|
if (null != erd && !erd.getCreateBy().equals(sysUser.getUsername())) {
|
||||||
|
return Result.OK("没有权限!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.extRepoDataService.deleteByIds(idsList);
|
||||||
return Result.OK("批量删除成功!");
|
return Result.OK("批量删除成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+68
-136
@@ -1,12 +1,8 @@
|
|||||||
package com.jero.modules.extRepo.controller;
|
package com.jero.modules.extRepo.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.aspect.annotation.AutoLog;
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
import com.jero.common.system.base.controller.JeroController;
|
import com.jero.common.system.base.controller.JeroController;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
|
||||||
import com.jero.modules.extRepo.entity.ERFTreeData;
|
import com.jero.modules.extRepo.entity.ERFTreeData;
|
||||||
import com.jero.modules.extRepo.entity.ExtRepoFolder;
|
import com.jero.modules.extRepo.entity.ExtRepoFolder;
|
||||||
import com.jero.modules.extRepo.service.IExtRepoFolderService;
|
import com.jero.modules.extRepo.service.IExtRepoFolderService;
|
||||||
@@ -16,157 +12,93 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 对外报告文件夹表
|
* @Description: 对外报告文件夹表
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2022-07-25
|
* @Date: 2022-07-25
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Api(tags="对外报告文件夹表")
|
@Api(tags = "对外报告文件夹表")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/extRepo/extRepoFolder")
|
@RequestMapping("/extRepo/extRepoFolder")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtRepoFolderService> {
|
public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtRepoFolderService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IExtRepoFolderService extRepoFolderService;
|
private IExtRepoFolderService extRepoFolderService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页列表查询
|
|
||||||
*
|
|
||||||
* @param extRepoFolder
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "对外报告文件夹表-分页列表查询")
|
|
||||||
@ApiOperation(value="对外报告文件夹表-分页列表查询", notes="对外报告文件夹表-分页列表查询")
|
|
||||||
@GetMapping(value = "/page")
|
|
||||||
public Result<?> queryPageList(ExtRepoFolder extRepoFolder,
|
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<ExtRepoFolder> queryWrapper = QueryGenerator.initQueryWrapper(extRepoFolder, req.getParameterMap());
|
|
||||||
Page<ExtRepoFolder> page = new Page<ExtRepoFolder>(pageNo, pageSize);
|
|
||||||
IPage<ExtRepoFolder> pageList = extRepoFolderService.page(page, queryWrapper);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "对外报告文件夹表-列表查询")
|
@AutoLog(value = "对外报告文件夹表-列表查询")
|
||||||
@ApiOperation(value="对外报告文件夹表-列表查询", notes="对外报告文件夹表-列表查询")
|
@ApiOperation(value = "对外报告文件夹表-列表查询", notes = "对外报告文件夹表-列表查询")
|
||||||
@GetMapping(value = "/list")
|
@GetMapping(value = "/list")
|
||||||
public Result<List<ERFTreeData>> queryList() {
|
public Result<List<ERFTreeData>> queryList() {
|
||||||
List<ERFTreeData> list = extRepoFolderService.queryTreeList();
|
List<ERFTreeData> list = extRepoFolderService.queryTreeList();
|
||||||
return Result.OK(list);
|
return Result.OK(list);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param extRepoFolder
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "对外报告文件夹表-添加")
|
|
||||||
@ApiOperation(value="对外报告文件夹表-添加", notes="对外报告文件夹表-添加")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<?> add(@Validated @RequestBody ExtRepoFolder extRepoFolder) {
|
|
||||||
extRepoFolderService.add(extRepoFolder);
|
|
||||||
return Result.OK("添加成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param extRepoFolder
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "对外报告文件夹表-编辑")
|
|
||||||
@ApiOperation(value="对外报告文件夹表-编辑", notes="对外报告文件夹表-编辑")
|
|
||||||
@PutMapping(value = "/edit")
|
|
||||||
public Result<?> edit(@Validated @RequestBody ExtRepoFolder extRepoFolder) {
|
|
||||||
extRepoFolderService.editById(extRepoFolder);
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "对外报告文件夹表-通过id删除")
|
|
||||||
@ApiOperation(value="对外报告文件夹表-通过id删除", notes="对外报告文件夹表-通过id删除")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
|
||||||
extRepoFolderService.deleteById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "对外报告文件夹表-批量删除")
|
|
||||||
@ApiOperation(value="对外报告文件夹表-批量删除", notes="对外报告文件夹表-批量删除")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
||||||
this.extRepoFolderService.deleteByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "对外报告文件夹表-通过id查询")
|
|
||||||
@ApiOperation(value="对外报告文件夹表-通过id查询", notes="对外报告文件夹表-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
|
||||||
ExtRepoFolder extRepoFolder = extRepoFolderService.queryById(id);
|
|
||||||
if(extRepoFolder==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(extRepoFolder);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出excel
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* @param extRepoFolder
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/exportXls")
|
|
||||||
public ModelAndView exportXls(HttpServletRequest request, ExtRepoFolder extRepoFolder) {
|
|
||||||
return super.exportXls(request, extRepoFolder, ExtRepoFolder.class, "对外报告文件夹表");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过excel导入数据
|
* 添加
|
||||||
*
|
*
|
||||||
* @param request
|
* @param extRepoFolder
|
||||||
* @param response
|
* @return
|
||||||
* @return
|
*/
|
||||||
*/
|
@AutoLog(value = "对外报告文件夹表-添加")
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
@ApiOperation(value = "对外报告文件夹表-添加", notes = "对外报告文件夹表-添加")
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
@PostMapping(value = "/add")
|
||||||
return super.importExcel(request, response, ExtRepoFolder.class);
|
public Result<?> add(@Validated @RequestBody ExtRepoFolder extRepoFolder) {
|
||||||
|
extRepoFolderService.add(extRepoFolder);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param extRepoFolder
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "对外报告文件夹表-编辑")
|
||||||
|
@ApiOperation(value = "对外报告文件夹表-编辑", notes = "对外报告文件夹表-编辑")
|
||||||
|
@PutMapping(value = "/edit")
|
||||||
|
public Result<?> edit(@Validated @RequestBody ExtRepoFolder extRepoFolder) {
|
||||||
|
extRepoFolderService.editById(extRepoFolder);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "对外报告文件夹表-通过id删除")
|
||||||
|
@ApiOperation(value = "对外报告文件夹表-通过id删除", notes = "对外报告文件夹表-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
extRepoFolderService.deleteById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "对外报告文件夹表-通过id查询")
|
||||||
|
@ApiOperation(value = "对外报告文件夹表-通过id查询", notes = "对外报告文件夹表-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
ExtRepoFolder extRepoFolder = extRepoFolderService.queryById(id);
|
||||||
|
if (extRepoFolder == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(extRepoFolder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+63
-12
@@ -18,6 +18,8 @@ public class ERFTreeData implements Comparable<ERFTreeData> {
|
|||||||
*/
|
*/
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
|
private String folderName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件夹ID 对应 id
|
* 文件夹ID 对应 id
|
||||||
*/
|
*/
|
||||||
@@ -40,6 +42,27 @@ public class ERFTreeData implements Comparable<ERFTreeData> {
|
|||||||
*/
|
*/
|
||||||
private boolean display = false;
|
private boolean display = false;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看权限人员
|
||||||
|
*/
|
||||||
|
private String authView = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理权限人员
|
||||||
|
*/
|
||||||
|
private String authManage = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看权限人员id
|
||||||
|
*/
|
||||||
|
private String authViewIds = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理权限人员id
|
||||||
|
*/
|
||||||
|
private String authManageIds = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子文件夹
|
* 子文件夹
|
||||||
*/
|
*/
|
||||||
@@ -48,8 +71,9 @@ public class ERFTreeData implements Comparable<ERFTreeData> {
|
|||||||
public ERFTreeData() {
|
public ERFTreeData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ERFTreeData(String title, String key, int level,int orderId) {
|
public ERFTreeData(String title, String key, int level, int orderId) {
|
||||||
this.title = title;
|
this.title = title;
|
||||||
|
this.folderName = title;
|
||||||
this.key = key;
|
this.key = key;
|
||||||
this.level = level;
|
this.level = level;
|
||||||
this.orderId = orderId;
|
this.orderId = orderId;
|
||||||
@@ -103,23 +127,50 @@ public class ERFTreeData implements Comparable<ERFTreeData> {
|
|||||||
this.display = display;
|
this.display = display;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public String getFolderName() {
|
||||||
public String toString() {
|
return folderName;
|
||||||
return "ERFTreeData{" +
|
}
|
||||||
"title='" + title + '\'' +
|
|
||||||
", key='" + key + '\'' +
|
public void setFolderName(String folderName) {
|
||||||
", level=" + level +
|
this.folderName = folderName;
|
||||||
", orderId=" + orderId +
|
}
|
||||||
", display=" + display +
|
|
||||||
", children=" + children +
|
public String getAuthView() {
|
||||||
'}';
|
return authView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthView(String authView) {
|
||||||
|
this.authView = authView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthManage() {
|
||||||
|
return authManage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthManage(String authManage) {
|
||||||
|
this.authManage = authManage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthViewIds() {
|
||||||
|
return authViewIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthViewIds(String authViewIds) {
|
||||||
|
this.authViewIds = authViewIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthManageIds() {
|
||||||
|
return authManageIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthManageIds(String authManageIds) {
|
||||||
|
this.authManageIds = authManageIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sortChildren() {
|
public void sortChildren() {
|
||||||
Collections.sort(children);
|
Collections.sort(children);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(@NotNull ERFTreeData o) {
|
public int compareTo(@NotNull ERFTreeData o) {
|
||||||
return this.orderId - o.orderId;
|
return this.orderId - o.orderId;
|
||||||
|
|||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
package com.jero.modules.extRepo.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
|
||||||
|
public class ExtRepoDataPage {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 此页面是否有管理权限
|
||||||
|
*/
|
||||||
|
private boolean auth_manage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据列表
|
||||||
|
*/
|
||||||
|
private IPage<ExtRepoData> pageList;
|
||||||
|
|
||||||
|
public ExtRepoDataPage() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExtRepoDataPage(boolean auth_manage, IPage<ExtRepoData> pageList) {
|
||||||
|
this.auth_manage = auth_manage;
|
||||||
|
this.pageList = pageList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAuth_manage() {
|
||||||
|
return auth_manage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuth_manage(boolean auth_manage) {
|
||||||
|
this.auth_manage = auth_manage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IPage<ExtRepoData> getPageList() {
|
||||||
|
return pageList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPageList(IPage<ExtRepoData> pageList) {
|
||||||
|
this.pageList = pageList;
|
||||||
|
}
|
||||||
|
}
|
||||||
+18
-19
@@ -13,14 +13,12 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
|||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 对外报告文件夹表
|
* @Description: 对外报告文件夹表
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2022-07-25
|
* @Date: 2022-07-27
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@@ -34,11 +32,11 @@ public class ExtRepoFolder implements Serializable {
|
|||||||
/**主键*/
|
/**主键*/
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
@ApiModelProperty(value = "主键")
|
@ApiModelProperty(value = "主键")
|
||||||
private java.lang.String id;
|
private String id;
|
||||||
|
|
||||||
/**创建人*/
|
/**创建人*/
|
||||||
@ApiModelProperty(value = "创建人")
|
@ApiModelProperty(value = "创建人")
|
||||||
private java.lang.String createBy;
|
private String createBy;
|
||||||
|
|
||||||
/**创建日期*/
|
/**创建日期*/
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@@ -48,7 +46,7 @@ public class ExtRepoFolder implements Serializable {
|
|||||||
|
|
||||||
/**更新人*/
|
/**更新人*/
|
||||||
@ApiModelProperty(value = "更新人")
|
@ApiModelProperty(value = "更新人")
|
||||||
private java.lang.String updateBy;
|
private String updateBy;
|
||||||
|
|
||||||
/**更新日期*/
|
/**更新日期*/
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@@ -58,39 +56,40 @@ public class ExtRepoFolder implements Serializable {
|
|||||||
|
|
||||||
/**所属部门*/
|
/**所属部门*/
|
||||||
@ApiModelProperty(value = "所属部门")
|
@ApiModelProperty(value = "所属部门")
|
||||||
private java.lang.String sysOrgCode;
|
private String sysOrgCode;
|
||||||
|
|
||||||
/**文件夹名称*/
|
/**文件夹名称*/
|
||||||
@Excel(name = "文件夹名称", width = 15)
|
@Excel(name = "文件夹名称", width = 15)
|
||||||
@ApiModelProperty(value = "文件夹名称")
|
@ApiModelProperty(value = "文件夹名称")
|
||||||
private java.lang.String folderName;
|
private String folderName;
|
||||||
|
|
||||||
/**文件夹排序*/
|
/**文件夹排序*/
|
||||||
@Excel(name = "文件夹排序", width = 15)
|
@Excel(name = "文件夹排序", width = 15)
|
||||||
@ApiModelProperty(value = "文件夹排序")
|
@ApiModelProperty(value = "文件夹排序")
|
||||||
private java.lang.Integer orderId;
|
private Integer orderId;
|
||||||
|
|
||||||
/**所属文件夹*/
|
/**所属文件夹*/
|
||||||
@Excel(name = "所属文件夹", width = 15)
|
@Excel(name = "所属文件夹", width = 15)
|
||||||
@ApiModelProperty(value = "所属文件夹")
|
@ApiModelProperty(value = "所属文件夹")
|
||||||
private java.lang.String supFolder;
|
private String supFolder;
|
||||||
|
|
||||||
/**查看权限人员*/
|
/**查看权限人员*/
|
||||||
@Excel(name = "查看权限人员", width = 15)
|
@Excel(name = "查看权限人员", width = 15)
|
||||||
@ApiModelProperty(value = "查看权限人员")
|
@ApiModelProperty(value = "查看权限人员")
|
||||||
private java.lang.String authView;
|
private String authView;
|
||||||
|
|
||||||
/**管理权限人员*/
|
/**管理权限人员*/
|
||||||
@Excel(name = "管理权限人员", width = 15)
|
@Excel(name = "管理权限人员", width = 15)
|
||||||
@ApiModelProperty(value = "管理权限人员")
|
@ApiModelProperty(value = "管理权限人员")
|
||||||
private java.lang.String authManage;
|
private String authManage;
|
||||||
|
|
||||||
public List<String> getAuthManageList(){
|
/**查看权限人员id*/
|
||||||
return Arrays.asList(authManage.split(","));
|
@Excel(name = "查看权限人员id", width = 15)
|
||||||
}
|
@ApiModelProperty(value = "查看权限人员id")
|
||||||
|
private String authViewIds;
|
||||||
public List<String> getAuthViewList(){
|
|
||||||
return Arrays.asList(authView.split(","));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**管理权限人员id*/
|
||||||
|
@Excel(name = "管理权限人员id", width = 15)
|
||||||
|
@ApiModelProperty(value = "管理权限人员id")
|
||||||
|
private String authManageIds;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -13,5 +13,7 @@
|
|||||||
<result column="sup_folder" property="supFolder" />
|
<result column="sup_folder" property="supFolder" />
|
||||||
<result column="auth_view" property="authView" />
|
<result column="auth_view" property="authView" />
|
||||||
<result column="auth_manage" property="authManage" />
|
<result column="auth_manage" property="authManage" />
|
||||||
|
<result column="auth_view_ids" property="authViewIds" />
|
||||||
|
<result column="auth_manage_ids" property="authManageIds" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
</mapper>
|
</mapper>
|
||||||
+42
-48
@@ -9,69 +9,63 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* @Description: 对外报告文件夹表
|
* @Description: 对外报告文件夹表
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2022-07-25
|
* @Date: 2022-07-25
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface IExtRepoFolderService extends IService<ExtRepoFolder> {
|
public interface IExtRepoFolderService extends IService<ExtRepoFolder> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
* @param extRepoFolder
|
* @param extRepoFolder
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void add(ExtRepoFolder extRepoFolder);
|
void add(ExtRepoFolder extRepoFolder);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*
|
*
|
||||||
* @param extRepoFolder
|
* @param extRepoFolder
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void editById(ExtRepoFolder extRepoFolder);
|
void editById(ExtRepoFolder extRepoFolder);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id删除
|
* 通过id删除
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void deleteById(String id);
|
void deleteById(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 通过id查询
|
||||||
*
|
*
|
||||||
* @param ids
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void deleteByIds(List<String> ids);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
ExtRepoFolder queryById(String id);
|
ExtRepoFolder queryById(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<ExtRepoFolder> queryList();
|
List<ExtRepoFolder> queryList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询返回树结构
|
* 查询返回树结构
|
||||||
* @return
|
*
|
||||||
*/
|
* @return
|
||||||
List<ERFTreeData> queryTreeList();
|
*/
|
||||||
|
List<ERFTreeData> queryTreeList();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否有管理权限
|
* 是否有管理权限
|
||||||
* @param folderId
|
*
|
||||||
* @return
|
* @param folderId
|
||||||
*/
|
* @return
|
||||||
boolean haveManageAuth(String folderId);
|
*/
|
||||||
|
boolean haveManageAuth(String folderId);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -1,9 +1,11 @@
|
|||||||
package com.jero.modules.extRepo.service.impl;
|
package com.jero.modules.extRepo.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.modules.extRepo.entity.ExtRepoData;
|
import com.jero.modules.extRepo.entity.ExtRepoData;
|
||||||
import com.jero.modules.extRepo.mapper.ExtRepoDataMapper;
|
import com.jero.modules.extRepo.mapper.ExtRepoDataMapper;
|
||||||
import com.jero.modules.extRepo.service.IExtRepoDataService;
|
import com.jero.modules.extRepo.service.IExtRepoDataService;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -29,6 +31,8 @@ public class ExtRepoDataServiceImpl extends ServiceImpl<ExtRepoDataMapper, ExtRe
|
|||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
extRepoData.setCreateTime(now);
|
extRepoData.setCreateTime(now);
|
||||||
extRepoData.setUpdateTime(now);
|
extRepoData.setUpdateTime(now);
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
extRepoData.setUpdateBy(sysUser.getUsername());
|
||||||
save(extRepoData);
|
save(extRepoData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+62
-46
@@ -38,9 +38,6 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
|
|||||||
@Override
|
@Override
|
||||||
public void add(ExtRepoFolder extRepoFolder) {
|
public void add(ExtRepoFolder extRepoFolder) {
|
||||||
try {
|
try {
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
||||||
//创建文件夹的时候把创建人加入管理权限
|
|
||||||
extRepoFolder.setAuthManage(extRepoFolder.getAuthManage() + "," + sysUser.getUsername());
|
|
||||||
if (StringUtils.isEmpty(extRepoFolder.getSupFolder())) {
|
if (StringUtils.isEmpty(extRepoFolder.getSupFolder())) {
|
||||||
//一级文件夹的supFolder统一存root,方便以后查找
|
//一级文件夹的supFolder统一存root,方便以后查找
|
||||||
extRepoFolder.setSupFolder(superFolder);
|
extRepoFolder.setSupFolder(superFolder);
|
||||||
@@ -71,7 +68,7 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ExtRepoFolder> getListBySupFolder(String supFolder){
|
private List<ExtRepoFolder> getListBySupFolder(String supFolder) {
|
||||||
ExtRepoFolder erf = new ExtRepoFolder();
|
ExtRepoFolder erf = new ExtRepoFolder();
|
||||||
erf.setSupFolder(supFolder);
|
erf.setSupFolder(supFolder);
|
||||||
QueryWrapper<ExtRepoFolder> queryWrapper = QueryGenerator.initQueryWrapper(erf, new HashMap<>());
|
QueryWrapper<ExtRepoFolder> queryWrapper = QueryGenerator.initQueryWrapper(erf, new HashMap<>());
|
||||||
@@ -104,53 +101,57 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
|
|||||||
* 修改所有关联文件夹的权限
|
* 修改所有关联文件夹的权限
|
||||||
*/
|
*/
|
||||||
private void editAuth(ExtRepoFolder erf_orig, ExtRepoFolder erf_new) throws Exception {
|
private void editAuth(ExtRepoFolder erf_orig, ExtRepoFolder erf_new) throws Exception {
|
||||||
List<String> authManage_orig = erf_orig.getAuthManageList();
|
//管理权限
|
||||||
List<String> authManage_new = erf_new.getAuthManageList();
|
Map<String, String> authManage_orig = getAuthMap(erf_orig.getAuthManage(), erf_orig.getAuthManageIds());
|
||||||
|
Map<String, String> authManage_new = getAuthMap(erf_new.getAuthManage(), erf_new.getAuthManageIds());
|
||||||
//增加管理权限的人
|
//增加管理权限的人
|
||||||
List<String> addManageRole = getDefList(authManage_new, authManage_orig);
|
Map<String, String> addManageRole = getDefMap(authManage_new, authManage_orig);
|
||||||
//删除管理权限的人
|
//删除管理权限的人
|
||||||
List<String> delManageRole = getDefList(authManage_orig, authManage_new);
|
Map<String, String> delManageRole = getDefMap(authManage_orig, authManage_new);
|
||||||
|
|
||||||
List<String> authView_orig = erf_orig.getAuthViewList();
|
//查看权限
|
||||||
List<String> authView_new = erf_new.getAuthViewList();
|
Map<String, String> authView_orig = getAuthMap(erf_orig.getAuthView(), erf_orig.getAuthViewIds());
|
||||||
|
Map<String, String> authView_new = getAuthMap(erf_new.getAuthView(), erf_new.getAuthViewIds());
|
||||||
//增加查看权限的人
|
//增加查看权限的人
|
||||||
List<String> addViewRole = getDefList(authView_new, authView_orig);
|
Map<String, String> addViewRole = getDefMap(authView_new, authView_orig);
|
||||||
//删除查看权限的人
|
//删除查看权限的人
|
||||||
List<String> delViewRole = getDefList(authView_orig, authView_new);
|
Map<String, String> delViewRole = getDefMap(authView_orig, authView_new);
|
||||||
|
|
||||||
List<ExtRepoFolder> allSubFolder = getAllSubFolder(erf_orig.getId());
|
List<ExtRepoFolder> allSubFolder = getAllSubFolder(erf_orig.getId());
|
||||||
//存储变化的对象
|
//存储变化的对象
|
||||||
List<ExtRepoFolder> updateFolder = new ArrayList<ExtRepoFolder>();
|
List<ExtRepoFolder> updateFolder = new ArrayList<ExtRepoFolder>();
|
||||||
for (ExtRepoFolder erf : allSubFolder) {
|
for (ExtRepoFolder erf : allSubFolder) {
|
||||||
boolean isChange = false;
|
boolean isChange = false;
|
||||||
List<String> authManage_erf = erf.getAuthManageList();
|
Map<String, String> authManage_erf = getAuthMap(erf.getAuthManage(), erf.getAuthManageIds());
|
||||||
List<String> authView_erf = erf.getAuthViewList();
|
Map<String, String> authView_erf = getAuthMap(erf.getAuthView(), erf.getAuthViewIds());
|
||||||
for (String add : addManageRole) {
|
for (String add : addManageRole.keySet()) {
|
||||||
if (!authManage_erf.contains(add)) {
|
if (!authManage_erf.keySet().contains(add)) {
|
||||||
authManage_erf.add(add);
|
authManage_erf.put(add, addManageRole.get(add));
|
||||||
isChange = true;
|
isChange = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (String del : delManageRole) {
|
for (String del : delManageRole.keySet()) {
|
||||||
if (authManage_erf.contains(del)) {
|
if (authManage_erf.keySet().contains(del)) {
|
||||||
authManage_erf.remove(del);
|
authManage_erf.remove(del);
|
||||||
isChange = true;
|
isChange = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (String add : addViewRole) {
|
for (String add : addViewRole.keySet()) {
|
||||||
if (!authView_erf.contains(add)) {
|
if (!authView_erf.keySet().contains(add)) {
|
||||||
authView_erf.add(add);
|
authView_erf.put(add, addViewRole.get(add));
|
||||||
isChange = true;
|
isChange = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (String del : delViewRole) {
|
for (String del : delViewRole.keySet()) {
|
||||||
if (authView_erf.contains(del)) {
|
if (authView_erf.keySet().contains(del)) {
|
||||||
authView_erf.remove(del);
|
authView_erf.remove(del);
|
||||||
isChange = true;
|
isChange = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
erf.setAuthManage(StringUtils.join(authManage_erf, ","));
|
erf.setAuthManage(StringUtils.join(authManage_erf.keySet(), ","));
|
||||||
erf.setAuthView(StringUtils.join(authView_erf, ","));
|
erf.setAuthManageIds(StringUtils.join(authManage_erf.values(), ","));
|
||||||
|
erf.setAuthView(StringUtils.join(authView_erf.keySet(), ","));
|
||||||
|
erf.setAuthViewIds(StringUtils.join(authView_erf.values(), ","));
|
||||||
if (isChange) {
|
if (isChange) {
|
||||||
updateFolder.add(erf);
|
updateFolder.add(erf);
|
||||||
}
|
}
|
||||||
@@ -163,15 +164,15 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
|
|||||||
/**
|
/**
|
||||||
* 得到列表新增元素集合
|
* 得到列表新增元素集合
|
||||||
*
|
*
|
||||||
* @param listA
|
* @param mapA
|
||||||
* @param listB
|
* @param mapB
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private List<String> getDefList(List<String> listA, List<String> listB) {
|
private Map<String, String> getDefMap(Map<String, String> mapA, Map<String, String> mapB) {
|
||||||
List<String> res = new ArrayList<String>();
|
Map<String, String> res = new HashMap<String, String>();
|
||||||
for (String s : listA) {
|
for (String s : mapA.keySet()) {
|
||||||
if (StringUtils.isNotBlank(s) && !listB.contains(s)) {
|
if (StringUtils.isNotBlank(s) && !mapB.keySet().contains(s)) {
|
||||||
res.add(s);
|
res.put(s, mapA.get(s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
@@ -206,17 +207,6 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void deleteByIds(List<String> ids) {
|
|
||||||
removeByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
*
|
*
|
||||||
@@ -272,8 +262,12 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
|
|||||||
if (supId.equals(erf.getSupFolder())) {
|
if (supId.equals(erf.getSupFolder())) {
|
||||||
ERFTreeData date = new ERFTreeData(erf.getFolderName(), erf.getId(), level, erf.getOrderId());
|
ERFTreeData date = new ERFTreeData(erf.getFolderName(), erf.getId(), level, erf.getOrderId());
|
||||||
//检查有没有权限查看
|
//检查有没有权限查看
|
||||||
date.setDisplay(erf.getAuthManageList().contains(sysUser.getUsername()) || erf.getAuthViewList().contains(sysUser.getUsername()));
|
date.setDisplay(erf.getCreateBy().equals(sysUser.getUsername()) || getStringList(erf.getAuthManage()).contains(sysUser.getUsername()) || getStringList(erf.getAuthView()).contains(sysUser.getUsername()));
|
||||||
int childLevel = date.getLevel() + 1;
|
int childLevel = date.getLevel() + 1;
|
||||||
|
date.setAuthManage(erf.getAuthManage());
|
||||||
|
date.setAuthManageIds(erf.getAuthManageIds());
|
||||||
|
date.setAuthView(erf.getAuthManage());
|
||||||
|
date.setAuthViewIds(erf.getAuthViewIds());
|
||||||
date.setChildren(getSubFolder(erf.getId(), list, childLevel));
|
date.setChildren(getSubFolder(erf.getId(), list, childLevel));
|
||||||
date.sortChildren();
|
date.sortChildren();
|
||||||
resList.add(date);
|
resList.add(date);
|
||||||
@@ -284,6 +278,7 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否有管理权限
|
* 是否有管理权限
|
||||||
|
*
|
||||||
* @param folderId
|
* @param folderId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -291,8 +286,29 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
|
|||||||
public boolean haveManageAuth(String folderId) {
|
public boolean haveManageAuth(String folderId) {
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
ExtRepoFolder erf = queryById(folderId);
|
ExtRepoFolder erf = queryById(folderId);
|
||||||
return erf.getAuthManageList().contains(sysUser.getUsername());
|
//如果是创建人 则默认有权限
|
||||||
|
if (null != erf) {
|
||||||
|
return getStringList(erf.getAuthManage()).contains(sysUser.getUsername()) || erf.getCreateBy().equals(sysUser.getUsername());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<String> getStringList(String listStr) {
|
||||||
|
List<String> res = new ArrayList<String>();
|
||||||
|
if (null != listStr) {
|
||||||
|
res = Arrays.asList(listStr.split(","));
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, String> getAuthMap(String strKey, String strValue) {
|
||||||
|
Map<String, String> resMap = new HashMap<String, String>();
|
||||||
|
List<String> keyList = getStringList(strKey);
|
||||||
|
List<String> valueList = getStringList(strValue);
|
||||||
|
for (int i = 0; i < keyList.size(); i++) {
|
||||||
|
resMap.put(keyList.get(i), valueList.get(i));
|
||||||
|
}
|
||||||
|
return resMap;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user