"src/main/webapp/WEB-INF/git@ustchcs.com:gujinli1118/MCMS.git" did not exist on "3e26c01c951966980d50bc0d05a0c344e5ce0846"
Commit 18144407 authored by trumansdo's avatar trumansdo
Browse files

应用codestyle


千万千万要用vscode打开前端项目,或者关闭eslint,移除它
Signed-off-by: default avatartrumansdo <1012243881@qq.com>
parent 9b3d96a6
...@@ -34,194 +34,180 @@ import com.ibeetl.admin.core.web.JsonResult; ...@@ -34,194 +34,180 @@ import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.dto.FunctionNodeView; import com.ibeetl.admin.core.web.dto.FunctionNodeView;
/** /**
* 描述: 功能点管理 * 描述: 功能点管理
* *
* @author : lijiazhi * @author : lijiazhi
*/ */
@Controller @Controller
public class FunctionController { public class FunctionController {
private final Log log = LogFactory.getLog(this.getClass()); private final Log log = LogFactory.getLog(this.getClass());
private static final String MODEL = "/admin/function"; private static final String MODEL = "/admin/function";
@Autowired @Autowired CorePlatformService platformService;
CorePlatformService platformService; @Autowired private FunctionConsoleService functionConsoleService;
@Autowired
private FunctionConsoleService functionConsoleService; /*页面*/
@GetMapping(MODEL + "/index.do")
/*页面*/ @Function("function")
public ModelAndView index() {
@GetMapping(MODEL + "/index.do") ModelAndView view = new ModelAndView("/admin/function/index.html");
@Function("function") view.addObject("search", FunctionQuery.class.getName());
public ModelAndView index() { return view;
ModelAndView view = new ModelAndView("/admin/function/index.html"); }
view.addObject("search", FunctionQuery.class.getName());
return view; @GetMapping(MODEL + "/add.do")
} @Function("function.add")
public ModelAndView add() {
@GetMapping(MODEL + "/add.do") ModelAndView view = new ModelAndView("/admin/function/add.html");
@Function("function.add") return view;
public ModelAndView add() { }
ModelAndView view = new ModelAndView("/admin/function/add.html");
return view; @GetMapping(MODEL + "/edit.do")
} @Function("function.edit")
@GetMapping(MODEL + "/edit.do") public ModelAndView edit(Integer id) {
@Function("function.edit") ModelAndView view = new ModelAndView("/admin/function/edit.html");
public ModelAndView edit(Integer id) { CoreFunction function = functionConsoleService.queryById(id);
ModelAndView view = new ModelAndView("/admin/function/edit.html"); view.addObject("function", function);
CoreFunction function = functionConsoleService.queryById(id); return view;
view.addObject("function", function); }
return view;
} /*Json*/
/*Json*/ @RequestMapping(MODEL + "/add.json")
@Function("function.add")
@RequestMapping(MODEL + "/add.json") @ResponseBody
@Function("function.add") public JsonResult<CoreFunction> addFunction(
@ResponseBody @Validated(ValidateConfig.ADD.class) CoreFunction function) {
public JsonResult<CoreFunction> addFunction(@Validated(ValidateConfig.ADD.class) CoreFunction function) { String code = function.getCode();
String code = function.getCode(); CoreFunction dbFunction = functionConsoleService.getFunction(code);
CoreFunction dbFunction = functionConsoleService.getFunction(code); if (dbFunction != null) {
if(dbFunction!=null){ throw new FormFieldException(CoreFunction.class.getName(), "code", "已经存在");
throw new FormFieldException(CoreFunction.class.getName(),"code","已经存在");
}
if(function.getParentId()==null){
function.setParentId(0l);
}
function.setCreateTime(new Date());
functionConsoleService.saveFunction(function);
return JsonResult.success(function);
}
@RequestMapping(MODEL + "/update.json")
@Function("function.update")
@ResponseBody
public JsonResult<?> updateFunction(@Validated(ValidateConfig.UPDATE.class) CoreFunction function) {
CoreFunction dbFunction = functionConsoleService.getFunction(function.getCode());
if(dbFunction!=null&&!dbFunction.getId().equals(function.getId())){
throw new FormFieldException(CoreFunction.class.getName(),"code","已经存在");
}
if(function.getParentId()==null){
function.setParentId(0l);
}
// function.setCreateTime(dbFunction.getCreateTime());
functionConsoleService.updateFunction(function);
return JsonResult.success();
} }
@RequestMapping(MODEL + "/view.json") if (function.getParentId() == null) {
@Function("function.query") function.setParentId(0l);
@ResponseBody
public JsonResult<CoreFunction> getFunction(Long id) {
CoreFunction function = functionConsoleService.getFunction(id);
if (function.hasParent()){
CoreFunction parent = functionConsoleService.getFunction(function.getParentId());
function.set("parentName",parent.getName());
}else {
function.set("parentName","");
}
functionConsoleService.queryEntityAfter(function);
return JsonResult.success(function);
} }
function.setCreateTime(new Date());
functionConsoleService.saveFunction(function);
@RequestMapping(MODEL + "/delete.json") return JsonResult.success(function);
@Function("function.delete") }
@ResponseBody
public JsonResult deleteFunction(Long id) { @RequestMapping(MODEL + "/update.json")
CoreFunction fun = functionConsoleService.queryById(id); @Function("function.update")
if (fun == null) { @ResponseBody
throw new PlatformException("删除失败,没有找到Function "+id+"!"); public JsonResult<?> updateFunction(
} @Validated(ValidateConfig.UPDATE.class) CoreFunction function) {
//删除功能和所有子功能 CoreFunction dbFunction = functionConsoleService.getFunction(function.getCode());
functionConsoleService.deleteFunction(id); if (dbFunction != null && !dbFunction.getId().equals(function.getId())) {
return new JsonResult().success(); throw new FormFieldException(CoreFunction.class.getName(), "code", "已经存在");
} }
if (function.getParentId() == null) {
/** function.setParentId(0l);
* 字典列表 分页
*
* @param condtion
* @return
*/
@RequestMapping(MODEL + "/list.json")
@Function("function.query")
@ResponseBody
public JsonResult<PageQuery<CoreFunction>> list(FunctionQuery condtion) {
PageQuery page = condtion.getPageQuery();
functionConsoleService.queryByCondtion(page);
return JsonResult.success(page);
} }
// function.setCreateTime(dbFunction.getCreateTime());
functionConsoleService.updateFunction(function);
@PostMapping(MODEL + "/list/condition.json") return JsonResult.success();
@Function("function.query") }
@ResponseBody
public JsonResult<List<Map<String, Object>>> listCondtion() { @RequestMapping(MODEL + "/view.json")
List<Map<String, Object>> list = AnnotationUtil.getInstance().getAnnotations(Query.class, FunctionQuery.class); @Function("function.query")
return JsonResult.success(list); @ResponseBody
public JsonResult<CoreFunction> getFunction(Long id) {
CoreFunction function = functionConsoleService.getFunction(id);
if (function.hasParent()) {
CoreFunction parent = functionConsoleService.getFunction(function.getParentId());
function.set("parentName", parent.getName());
} else {
function.set("parentName", "");
} }
functionConsoleService.queryEntityAfter(function);
return JsonResult.success(function);
private List<Long> findChildFunctionIds(Long funtionId) { }
FunctionItem funItem = platformService.buildFunction().findChild(funtionId); @RequestMapping(MODEL + "/delete.json")
List<Long> children = funItem.findAllChildrenId(); @Function("function.delete")
children.add(funtionId); @ResponseBody
return children; public JsonResult deleteFunction(Long id) {
CoreFunction fun = functionConsoleService.queryById(id);
if (fun == null) {
throw new PlatformException("删除失败,没有找到Function " + id + "!");
} }
// 删除功能和所有子功能
functionConsoleService.deleteFunction(id);
return new JsonResult().success();
}
/**
* 字典列表 分页
*
* @param condtion
* @return
*/
@RequestMapping(MODEL + "/list.json")
@Function("function.query")
@ResponseBody
public JsonResult<PageQuery<CoreFunction>> list(FunctionQuery condtion) {
PageQuery page = condtion.getPageQuery();
functionConsoleService.queryByCondtion(page);
return JsonResult.success(page);
}
@PostMapping(MODEL + "/list/condition.json")
@Function("function.query")
@ResponseBody
public JsonResult<List<Map<String, Object>>> listCondtion() {
List<Map<String, Object>> list =
AnnotationUtil.getInstance().getAnnotations(Query.class, FunctionQuery.class);
return JsonResult.success(list);
}
private List<Long> findChildFunctionIds(Long funtionId) {
FunctionItem funItem = platformService.buildFunction().findChild(funtionId);
List<Long> children = funItem.findAllChildrenId();
children.add(funtionId);
return children;
}
@RequestMapping(MODEL + "/batchDel.json")
@Function("function.delete")
@ResponseBody
public JsonResult batchDel(String ids) {
List<Long> dels = ConvertUtil.str2longs(ids);
functionConsoleService.batchDeleteFunction(dels);
return new JsonResult().success();
}
@PostMapping(MODEL + "/tree.json")
@Function("function.query")
@ResponseBody
public JsonResult<List<FunctionNodeView>> tree() {
FunctionItem root = this.platformService.buildFunction();
List<FunctionNodeView> tree = buildFunctionTree(root);
return JsonResult.success(tree);
}
@RequestMapping(MODEL + "/batchDel.json") private List<FunctionNodeView> buildFunctionTree(FunctionItem node) {
@Function("function.delete") List<FunctionItem> list = node.getChildren();
@ResponseBody if (list.size() == 0) {
public JsonResult batchDel(String ids) { return Collections.EMPTY_LIST;
List<Long> dels = ConvertUtil.str2longs(ids);
functionConsoleService.batchDeleteFunction(dels);
return new JsonResult().success();
} }
List<FunctionNodeView> views = new ArrayList<FunctionNodeView>(list.size());
@PostMapping(MODEL + "/tree.json") for (FunctionItem item : list) {
@Function("function.query") FunctionNodeView view = new FunctionNodeView();
@ResponseBody view.setCode(item.getData().getCode());
public JsonResult<List<FunctionNodeView> > tree() { view.setName(item.getData().getName());
FunctionItem root = this.platformService.buildFunction(); view.setId(item.getData().getId());
List<FunctionNodeView> tree = buildFunctionTree(root); view.setAccessUrl(item.getData().getAccessUrl());
return JsonResult.success(tree); List<FunctionNodeView> children = this.buildFunctionTree(item);
view.setChildren(children);
views.add(view);
} }
return views;
}
private List<FunctionNodeView> buildFunctionTree(FunctionItem node){
List<FunctionItem> list = node.getChildren();
if(list.size()==0){
return Collections.EMPTY_LIST;
}
List<FunctionNodeView> views = new ArrayList<FunctionNodeView>(list.size());
for(FunctionItem item :list){
FunctionNodeView view = new FunctionNodeView();
view.setCode(item.getData().getCode());
view.setName(item.getData().getName());
view.setId(item.getData().getId());
view.setAccessUrl(item.getData().getAccessUrl());
List<FunctionNodeView> children = this.buildFunctionTree(item);
view.setChildren(children);
views.add(view);
}
return views;
}
} }
...@@ -28,148 +28,142 @@ import com.ibeetl.admin.core.util.AnnotationUtil; ...@@ -28,148 +28,142 @@ import com.ibeetl.admin.core.util.AnnotationUtil;
import com.ibeetl.admin.core.util.ConvertUtil; import com.ibeetl.admin.core.util.ConvertUtil;
import com.ibeetl.admin.core.web.JsonResult; import com.ibeetl.admin.core.web.JsonResult;
/** /** @author lijiazhi */
* @author lijiazhi
*/
@Controller @Controller
public class MenuController { public class MenuController {
private static final String MODEL = "/admin/menu";
private static final String MODEL = "/admin/menu"; private final Log log = LogFactory.getLog(this.getClass());
private final Log log = LogFactory.getLog(this.getClass());
@Autowired MenuConsoleService menuService;
@Autowired @Autowired CorePlatformService platformService;
MenuConsoleService menuService;
/*页面*/
@Autowired
CorePlatformService platformService; @GetMapping(MODEL + "/index.do")
@Function("menu")
/*页面*/ public ModelAndView index() {
ModelAndView view = new ModelAndView("/admin/menu/index.html");
@GetMapping(MODEL + "/index.do") view.addObject("search", MenuQuery.class.getName());
@Function("menu") return view;
public ModelAndView index() { }
ModelAndView view = new ModelAndView("/admin/menu/index.html");
view.addObject("search", MenuQuery.class.getName()); @GetMapping(MODEL + "/add.do")
return view; @Function("menu.add")
} public ModelAndView add() {
ModelAndView view = new ModelAndView("/admin/menu/add.html");
@GetMapping(MODEL + "/add.do") return view;
@Function("menu.add") }
public ModelAndView add() {
ModelAndView view = new ModelAndView("/admin/menu/add.html"); @GetMapping(MODEL + "/edit.do")
return view; @Function("menu.edit")
} public ModelAndView edit(Integer id) {
@GetMapping(MODEL + "/edit.do") ModelAndView view = new ModelAndView("/admin/menu/edit.html");
@Function("menu.edit") CoreMenu menu = menuService.queryById(id);
public ModelAndView edit(Integer id) { view.addObject("menu", menu);
ModelAndView view = new ModelAndView("/admin/menu/edit.html"); return view;
CoreMenu menu = menuService.queryById(id); }
view.addObject("menu", menu);
return view; /*Json*/
}
/**
/*Json*/ * 查询
*
/** * @param menu
* 查询 * @return
* @param menu */
* @return @PostMapping(MODEL + "/list/condition.json")
*/ @Function("menu.query")
@PostMapping(MODEL + "/list/condition.json") @ResponseBody
@Function("menu.query") public JsonResult condition() {
@ResponseBody List<Map<String, Object>> list =
public JsonResult condition() { AnnotationUtil.getInstance().getAnnotations(Query.class, MenuQuery.class);
List<Map<String, Object>> list = AnnotationUtil.getInstance().getAnnotations(Query.class, MenuQuery.class); return JsonResult.success(list);
return JsonResult.success(list); }
}
@PostMapping(MODEL + "/list.json")
@Function("menu.query")
@PostMapping(MODEL + "/list.json") @ResponseBody
@Function("menu.query") public JsonResult<PageQuery> list(MenuQuery condtion) {
@ResponseBody PageQuery page = condtion.getPageQuery();
public JsonResult<PageQuery> list(MenuQuery condtion) { menuService.queryByCondtion(page);
PageQuery page = condtion.getPageQuery(); return JsonResult.success(page);
menuService.queryByCondtion(page); }
return JsonResult.success(page);
} /**
* 添加
*
/** * @param menu
* 添加 * @return
* @param menu */
* @return @PostMapping(MODEL + "/save.json")
*/ @Function("menu.save")
@PostMapping(MODEL + "/save.json") @ResponseBody
@Function("menu.save") public JsonResult save(@Validated CoreMenu menu) {
@ResponseBody menu.setCreateTime(new Date());
public JsonResult save(@Validated CoreMenu menu) { Long id = menuService.saveMenu(menu);
menu.setCreateTime(new Date()); return JsonResult.success(id);
Long id = menuService.saveMenu(menu); }
return JsonResult.success(id);
} /**
* 更新
/** *
* 更新 * @param fun
* @param fun * @return
* @return */
*/ @PostMapping(MODEL + "/update.json")
@PostMapping(MODEL + "/update.json") @Function("menu.update")
@Function("menu.update") @ResponseBody
@ResponseBody public JsonResult update(CoreMenu fun) {
public JsonResult update(CoreMenu fun) { menuService.updateMenu(fun);
menuService.updateMenu(fun); return new JsonResult().success();
return new JsonResult().success(); }
}
/**
/** * 根据id查询菜单信息
* 根据id查询菜单信息 *
* @param id 菜单Id * @param id 菜单Id
* @return * @return
*/ */
@PostMapping(MODEL + "/view.json") @PostMapping(MODEL + "/view.json")
@Function("menu.query") @Function("menu.query")
@ResponseBody @ResponseBody
public JsonResult<CoreMenu> view(Long id) { public JsonResult<CoreMenu> view(Long id) {
CoreMenu fun = menuService.queryById(id); CoreMenu fun = menuService.queryById(id);
MenuItem root = this.platformService.buildMenu(); MenuItem root = this.platformService.buildMenu();
MenuItem child = root.findChild(fun.getId()); MenuItem child = root.findChild(fun.getId());
CoreMenu parent = child.getParent().getData(); CoreMenu parent = child.getParent().getData();
fun.set("parentMenuName", parent.getName()); fun.set("parentMenuName", parent.getName());
return JsonResult.success(fun); return JsonResult.success(fun);
} }
/** /**
* 删除 * 删除
* @param id 菜单id *
* @return * @param id 菜单id
*/ * @return
@PostMapping(MODEL + "/delete.json") */
@Function("menu.delete") @PostMapping(MODEL + "/delete.json")
@ResponseBody @Function("menu.delete")
public JsonResult delete(Long id) { @ResponseBody
menuService.deleteMenu(id); public JsonResult delete(Long id) {
return new JsonResult().success(); menuService.deleteMenu(id);
} return new JsonResult().success();
}
/**
* 批量删除 /**
* @param ids 菜单id集合 * 批量删除
* @return *
*/ * @param ids 菜单id集合
@PostMapping(MODEL + "/batchDel.json") * @return
@Function("menu.delete") */
@ResponseBody @PostMapping(MODEL + "/batchDel.json")
public JsonResult delete(String ids) { @Function("menu.delete")
List<Long> dels = ConvertUtil.str2longs(ids); @ResponseBody
menuService.batchDeleteMenuId(dels); public JsonResult delete(String ids) {
return new JsonResult().success(); List<Long> dels = ConvertUtil.str2longs(ids);
} menuService.batchDeleteMenuId(dels);
return new JsonResult().success();
}
} }
...@@ -33,149 +33,143 @@ import com.ibeetl.admin.core.web.JsonResult; ...@@ -33,149 +33,143 @@ import com.ibeetl.admin.core.web.JsonResult;
/** /**
* 描述: 组织机构 controller * 描述: 组织机构 controller
*
* @author : xiandafu * @author : xiandafu
*/ */
@Controller @Controller
public class OrgConsoleController { public class OrgConsoleController {
private final Log log = LogFactory.getLog(this.getClass()); private final Log log = LogFactory.getLog(this.getClass());
private static final String MODEL = "/admin/org"; private static final String MODEL = "/admin/org";
@Autowired @Autowired private OrgConsoleService orgConsoleService;
private OrgConsoleService orgConsoleService;
@Autowired UserConsoleService userConsoleService;
@Autowired
UserConsoleService userConsoleService; @Autowired CorePlatformService platformService;
@Autowired /*页面*/
CorePlatformService platformService;
@GetMapping(MODEL + "/index.do")
@Function("org.query")
public ModelAndView index() {
/*页面*/ ModelAndView view = new ModelAndView("/admin/org/index.html");
view.addObject("search", OrgQuery.class.getName());
@GetMapping(MODEL + "/index.do") return view;
@Function("org.query") }
public ModelAndView index() {
ModelAndView view = new ModelAndView("/admin/org/index.html"); @GetMapping(MODEL + "/edit.do")
view.addObject("search", OrgQuery.class.getName()); @Function("org.edit")
return view; public ModelAndView edit(String id) {
ModelAndView view = new ModelAndView("/admin/org/edit.html");
CoreOrg org = orgConsoleService.queryById(id);
view.addObject("org", org);
return view;
}
@GetMapping(MODEL + "/user/list.do")
@Function("org.query")
public ModelAndView getUsers(Long orgId) {
ModelAndView view = new ModelAndView("/admin/org/orgUser.html");
CoreOrg org = orgConsoleService.queryById(orgId);
view.addObject("org", org);
view.addObject("search", OrgUserQuery.class.getName());
return view;
}
/**
* 组织机构列表 分页
*
* @param condtion 查询条件
* @return
*/
@PostMapping(MODEL + "/list.json")
@Function("org.query")
@ResponseBody
public JsonResult<PageQuery<CoreOrg>> list(OrgQuery condtion) {
PageQuery page = condtion.getPageQuery();
orgConsoleService.queryByCondtion(page);
return JsonResult.success(page);
}
/**
* 获取列表查询条件
*
* @return
*/
@PostMapping(MODEL + "/list/condition.json")
@Function("org.query")
@ResponseBody
public JsonResult<List<Map<String, Object>>> listCondtion() {
List<Map<String, Object>> list =
AnnotationUtil.getInstance().getAnnotations(Query.class, OrgQuery.class);
return JsonResult.success(list);
}
/**
* 保存数据
*
* @param org
* @return
*/
@PostMapping(MODEL + "/save.json")
@Function("org.save")
@ResponseBody
public JsonResult<Long> save(
@Validated(ValidateConfig.ADD.class) CoreOrg org, BindingResult result) {
if (result.hasErrors()) {
return JsonResult.failMessage(result.toString());
} }
@GetMapping(MODEL + "/edit.do")
@Function("org.edit")
public ModelAndView edit(String id) {
ModelAndView view = new ModelAndView("/admin/org/edit.html");
CoreOrg org = orgConsoleService.queryById(id);
view.addObject("org", org);
return view;
}
@GetMapping(MODEL + "/user/list.do")
@Function("org.query")
public ModelAndView getUsers(Long orgId) {
ModelAndView view = new ModelAndView("/admin/org/orgUser.html");
CoreOrg org = orgConsoleService.queryById(orgId);
view.addObject("org", org);
view.addObject("search",OrgUserQuery.class.getName());
return view;
}
/**
* 组织机构列表 分页
* @param condtion 查询条件
* @return
*/
@PostMapping(MODEL + "/list.json")
@Function("org.query")
@ResponseBody
public JsonResult<PageQuery<CoreOrg>> list(OrgQuery condtion) {
PageQuery page = condtion.getPageQuery();
orgConsoleService.queryByCondtion(page);
return JsonResult.success(page);
}
/**
* 获取列表查询条件
* @return
*/
@PostMapping(MODEL + "/list/condition.json")
@Function("org.query")
@ResponseBody
public JsonResult<List<Map<String, Object>>> listCondtion() {
List<Map<String, Object>> list = AnnotationUtil.getInstance().getAnnotations(Query.class, OrgQuery.class);
return JsonResult.success(list);
}
/**
* 保存数据
* @param org
* @return
*/
@PostMapping(MODEL + "/save.json")
@Function("org.save")
@ResponseBody
public JsonResult<Long> save(@Validated(ValidateConfig.ADD.class) CoreOrg org, BindingResult result) {
if (result.hasErrors()) {
return JsonResult.failMessage(result.toString());
}
org.setCreateTime(new Date());
orgConsoleService.save(org);
platformService.clearOrgCache();
return JsonResult.success(org.getId());
}
/**
* 更新数据
* @param org
* @return
*/
@PostMapping(MODEL + "/update.json")
@Function("org.update")
@ResponseBody
public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) CoreOrg org) {
boolean success = orgConsoleService.updateTemplate(org);
if (success) {
platformService.clearOrgCache();
return JsonResult.successMessage("保存成功");
} else {
return JsonResult.failMessage("保存失败");
}
}
org.setCreateTime(new Date());
orgConsoleService.save(org);
platformService.clearOrgCache();
/** return JsonResult.success(org.getId());
* 删除组织机构 }
* @param ids 组织id,多个用“,”隔开
* @return /**
*/ * 更新数据
@PostMapping(MODEL + "/delete.json") *
@Function("org.delete") * @param org
@ResponseBody * @return
public JsonResult delete(String ids) { */
if (ids.endsWith(",")) { @PostMapping(MODEL + "/update.json")
ids = StringUtils.substringBeforeLast(ids, ","); @Function("org.update")
} @ResponseBody
List<Long> idList = ConvertUtil.str2longs(ids); public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) CoreOrg org) {
orgConsoleService.deleteById(idList); boolean success = orgConsoleService.updateTemplate(org);
this.platformService.clearOrgCache(); if (success) {
return new JsonResult().success(); platformService.clearOrgCache();
return JsonResult.successMessage("保存成功");
} else {
return JsonResult.failMessage("保存失败");
} }
}
@PostMapping(MODEL + "/user/list.json") /**
@Function("org.query") * 删除组织机构
@ResponseBody *
public JsonResult<PageQuery<CoreUser>> getUsers(OrgUserQuery userQuery) { * @param ids 组织id,多个用“,”隔开
PageQuery<CoreUser> page = userQuery.getPageQuery(); * @return
orgConsoleService.queryUserByCondition(page); */
return JsonResult.success(page); @PostMapping(MODEL + "/delete.json")
@Function("org.delete")
@ResponseBody
public JsonResult delete(String ids) {
if (ids.endsWith(",")) {
ids = StringUtils.substringBeforeLast(ids, ",");
} }
List<Long> idList = ConvertUtil.str2longs(ids);
orgConsoleService.deleteById(idList);
this.platformService.clearOrgCache();
return new JsonResult().success();
}
@PostMapping(MODEL + "/user/list.json")
@Function("org.query")
@ResponseBody
public JsonResult<PageQuery<CoreUser>> getUsers(OrgUserQuery userQuery) {
PageQuery<CoreUser> page = userQuery.getPageQuery();
orgConsoleService.queryUserByCondition(page);
return JsonResult.success(page);
}
} }
...@@ -35,295 +35,287 @@ import com.ibeetl.admin.core.util.ConvertUtil; ...@@ -35,295 +35,287 @@ import com.ibeetl.admin.core.util.ConvertUtil;
import com.ibeetl.admin.core.util.ValidateConfig; import com.ibeetl.admin.core.util.ValidateConfig;
import com.ibeetl.admin.core.web.JsonResult; import com.ibeetl.admin.core.web.JsonResult;
/** /** 角色 */
* 角色
*/
@Controller @Controller
public class RoleConsoleController { public class RoleConsoleController {
private final Log log = LogFactory.getLog(this.getClass()); private final Log log = LogFactory.getLog(this.getClass());
private static final String MODEL = "/admin/role"; private static final String MODEL = "/admin/role";
@Autowired @Autowired private RoleConsoleService roleConsoleService;
private RoleConsoleService roleConsoleService;
@Autowired private FunctionConsoleService functionConsoleService;
@Autowired
private FunctionConsoleService functionConsoleService; @Autowired CorePlatformService platformService;
@Autowired @Autowired private OrgConsoleService orgConsoleService;
CorePlatformService platformService;
/* 页面 */
@Autowired
private OrgConsoleService orgConsoleService; @GetMapping(MODEL + "/index.do")
@Function("role")
/* 页面 */ public ModelAndView index() {
ModelAndView view = new ModelAndView("/admin/role/index.html");
@GetMapping(MODEL + "/index.do") view.addObject("search", RoleQuery.class.getName());
@Function("role") return view;
public ModelAndView index() { }
ModelAndView view = new ModelAndView("/admin/role/index.html");
view.addObject("search", RoleQuery.class.getName()); @GetMapping(MODEL + "/edit.do")
return view; @Function("role.edit")
} public ModelAndView edit(String id) {
ModelAndView view = new ModelAndView("/admin/role/edit.html");
@GetMapping(MODEL + "/edit.do") CoreRole role = roleConsoleService.queryById(id);
@Function("role.edit") view.addObject("role", role);
public ModelAndView edit(String id) { return view;
ModelAndView view = new ModelAndView("/admin/role/edit.html"); }
CoreRole role = roleConsoleService.queryById(id);
view.addObject("role", role); @GetMapping(MODEL + "/add.do")
return view; @Function("role.add")
} public ModelAndView add() {
ModelAndView view = new ModelAndView("/admin/role/add.html");
@GetMapping(MODEL + "/add.do") return view;
@Function("role.add") }
public ModelAndView add() {
ModelAndView view = new ModelAndView("/admin/role/add.html"); @GetMapping(MODEL + "/user/list.do")
return view; @Function("role.user.query")
public ModelAndView users(Long roleId) {
CoreRole role = roleConsoleService.queryById(roleId);
ModelAndView view = new ModelAndView("/admin/role/roleUser.html");
view.addObject("role", role);
view.addObject("search", RoleUserQuery.class.getName());
return view;
}
@GetMapping(MODEL + "/function.do")
@Function("role.function.query")
public ModelAndView functions() {
ModelAndView view = new ModelAndView("/admin/role/function.html");
return view;
}
@GetMapping(MODEL + "/data.do")
@Function("role.function.query")
public ModelAndView data() {
ModelAndView view = new ModelAndView("/admin/role/data.html");
return view;
}
/**
* 列表页、 分页数据
*
* @param condtion
* @return
*/
@PostMapping(MODEL + "/list.json")
@Function("role.query")
@ResponseBody
public JsonResult<PageQuery> list(RoleQuery condtion) {
PageQuery page = condtion.getPageQuery();
roleConsoleService.queryByCondtion(page);
return JsonResult.success(page);
}
@GetMapping(MODEL + "/all.json")
@Function("role.query")
@ResponseBody
public JsonResult<List<CoreRole>> all() {
List<CoreRole> list = roleConsoleService.queryAllPermissionList();
return JsonResult.success(list);
}
/**
* 获取列表查询条件
*
* @return
*/
@PostMapping(MODEL + "/list/condition.json")
@Function("role.query")
@ResponseBody
public JsonResult<List<Map<String, Object>>> listCondtion() {
List<Map<String, Object>> list =
AnnotationUtil.getInstance().getAnnotations(Query.class, RoleQuery.class);
return JsonResult.success(list);
}
/**
* 保存
*
* @return
*/
@PostMapping(MODEL + "/add.json")
@Function("role.add")
@ResponseBody
public JsonResult addRole(@Validated(ValidateConfig.ADD.class) CoreRole role) {
CoreRole role1 = roleConsoleService.queryByCode(role.getCode());
if (role1 != null) {
return JsonResult.failMessage("用户编号已存在");
} }
JsonResult result = new JsonResult();
@GetMapping(MODEL + "/user/list.do") role.setCreateTime(new Date());
@Function("role.user.query") roleConsoleService.save(role);
public ModelAndView users(Long roleId) { platformService.clearFunctionCache();
CoreRole role = roleConsoleService.queryById(roleId); return result.success();
ModelAndView view = new ModelAndView("/admin/role/roleUser.html"); }
view.addObject("role", role);
view.addObject("search", RoleUserQuery.class.getName()); /**
return view; * 更新
*
* @param role
* @return
*/
@PostMapping(MODEL + "/update.json")
@Function("role.edit")
@ResponseBody
public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) CoreRole role) {
boolean success = roleConsoleService.update(role);
if (success) {
platformService.clearFunctionCache();
return new JsonResult().success();
} else {
return JsonResult.failMessage("保存失败");
} }
}
@GetMapping(MODEL + "/function.do")
@Function("role.function.query") /**
public ModelAndView functions() { * 查询角色信息
ModelAndView view = new ModelAndView("/admin/role/function.html"); *
return view; * @param id
} * @return
@GetMapping(MODEL + "/data.do") */
@Function("role.function.query") @GetMapping(MODEL + "/view.json")
public ModelAndView data() { @Function("role.query")
ModelAndView view = new ModelAndView("/admin/role/data.html"); @ResponseBody
return view; public JsonResult<CoreRole> queryInfo(Long id) {
CoreRole role = roleConsoleService.queryById(id);
return JsonResult.success(role);
}
/**
* (批量)删除
*
* @param ids 角色id
* @return
*/
@PostMapping(MODEL + "/delete.json")
@Function("role.delete")
@ResponseBody
public JsonResult delete(String ids) {
if (ids.endsWith(",")) {
ids = StringUtils.substringBeforeLast(ids, ",");
} }
/** List<Long> idList = ConvertUtil.str2longs(ids);
* 列表页、 分页数据 roleConsoleService.deleteById(idList);
* return new JsonResult().success();
* @param condtion }
* @return
*/ /**
@PostMapping(MODEL + "/list.json") * 查询角色下授权用户列表
@Function("role.query") *
@ResponseBody * @param queryCondtion 查询条件
public JsonResult<PageQuery> list(RoleQuery condtion) { * @return
PageQuery page = condtion.getPageQuery(); */
roleConsoleService.queryByCondtion(page); @PostMapping(MODEL + "/user/list.json")
return JsonResult.success(page); @Function("role.user.query")
@ResponseBody
public JsonResult<PageQuery<CoreUser>> userList(RoleUserQuery query) {
PageQuery page = query.getPageQuery();
PageQuery<CoreUser> pageQuery = roleConsoleService.queryRoleUser(page);
return JsonResult.success(page);
}
// /**
// * 给角色添加用户
// * @param userRole 角色用户关系
// * @return
// */
// @PostMapping(MODEL + "/user/save.json")
// @Function("role.user.save")
// @ResponseBody
// public JsonResult saveRoleUser(CoreUserRole userRole) {
// userRole.setCreateTime(new Date());
// userRoleConsoleService.saveSysUserRole(userRole);
// platformService.clearFunctionCache();
// return JsonResult.success();
// }
//
//
// /**
// * 用户授权删除
// * @param ids 记录id
// * @return
// */
// @GetMapping(MODEL + "/user/delete.json")
// @Function("role.user.delete")
// @ResponseBody
// public Object deleteRoleUser(String ids) {
// List<Long> dels = ConvertUtil.str2longs(ids);
// userRoleConsoleService.deleteUserRoles(dels);
// platformService.clearFunctionCache();
// return JsonResult.success();
// }
@PostMapping(MODEL + "/function/ids.json")
@Function("role.function.query")
@ResponseBody
public JsonResult<List<Long>> getFunctionIdByRole(Long roleId) {
List<Long> list = functionConsoleService.getFunctionByRole(roleId);
return JsonResult.success(list);
}
@GetMapping(MODEL + "/function/queryFunction.json")
@Function("role.function.query")
@ResponseBody
public JsonResult<List<RoleDataAccessFunction>> getQueryFunctionByRole(Long roleId) {
List<RoleDataAccessFunction> list = functionConsoleService.getQueryFunctionByRole(roleId);
return JsonResult.success(list);
}
@PostMapping(MODEL + "/function/update.json")
@Function("role.function.edit")
@ResponseBody
public JsonResult updateFunction(Long roleId, String ids) {
List<Long> all = ConvertUtil.str2longs(ids);
List<Long> addIds = new ArrayList<Long>();
List<Long> delIds = new ArrayList<Long>();
List<Long> dbs = functionConsoleService.getFunctionByRole(roleId);
Iterator<Long> it = all.iterator();
for (Long id : all) {
if (!dbs.contains(id)) {
addIds.add(id);
}
} }
@GetMapping(MODEL + "/all.json") for (Long id : dbs) {
@Function("role.query") if (!all.contains(id)) {
@ResponseBody delIds.add(id);
public JsonResult<List<CoreRole>> all() { }
List<CoreRole> list = roleConsoleService.queryAllPermissionList();
return JsonResult.success(list);
} }
functionConsoleService.updateSysRoleFunction(roleId, addIds, delIds);
/** return JsonResult.success();
* 获取列表查询条件 }
*
* @return @PostMapping(MODEL + "/function/updateDataAccess.json")
*/ @Function("role.function.updateDataAccess")
@PostMapping(MODEL + "/list/condition.json") @ResponseBody
@Function("role.query") public JsonResult updateFunctionDataAccess(Long roleId, Long fnId, Integer accessType) {
@ResponseBody RoleDataAccessFunction data = new RoleDataAccessFunction();
public JsonResult<List<Map<String, Object>>> listCondtion() { data.setRoleId(roleId);
List<Map<String, Object>> list = AnnotationUtil.getInstance().getAnnotations(Query.class, RoleQuery.class); data.setId(fnId);
return JsonResult.success(list); data.setDataAccessType(accessType);
} functionConsoleService.updateFunctionAccessByRole(Arrays.asList(data));
return JsonResult.success();
/** }
* 保存
* /*后端模板渲染*/
* @return @PostMapping(MODEL + "/function/dataAccess.do")
*/ @Function("role.function.updateDataAccess")
@PostMapping(MODEL + "/add.json") public ModelAndView datapage(Long roleId) {
@Function("role.add") List<RoleDataAccessFunction> list = functionConsoleService.getQueryFunctionByRole(roleId);
@ResponseBody ModelAndView view = new ModelAndView("/admin/role/dataConfigPart.html");
public JsonResult addRole(@Validated(ValidateConfig.ADD.class) CoreRole role) { view.addObject("list", list);
CoreRole role1 = roleConsoleService.queryByCode(role.getCode()); return view;
if (role1 != null) { }
return JsonResult.failMessage("用户编号已存在");
}
JsonResult result = new JsonResult();
role.setCreateTime(new Date());
roleConsoleService.save(role);
platformService.clearFunctionCache();
return result.success();
}
/**
* 更新
*
* @param role
* @return
*/
@PostMapping(MODEL + "/update.json")
@Function("role.edit")
@ResponseBody
public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) CoreRole role) {
boolean success = roleConsoleService.update(role);
if (success) {
platformService.clearFunctionCache();
return new JsonResult().success();
} else {
return JsonResult.failMessage("保存失败");
}
}
/**
* 查询角色信息
*
* @param id
* @return
*/
@GetMapping(MODEL + "/view.json")
@Function("role.query")
@ResponseBody
public JsonResult<CoreRole> queryInfo(Long id) {
CoreRole role = roleConsoleService.queryById(id);
return JsonResult.success(role);
}
/**
* (批量)删除
*
* @param ids
* 角色id
* @return
*/
@PostMapping(MODEL + "/delete.json")
@Function("role.delete")
@ResponseBody
public JsonResult delete(String ids) {
if (ids.endsWith(",")) {
ids = StringUtils.substringBeforeLast(ids, ",");
}
List<Long> idList = ConvertUtil.str2longs(ids);
roleConsoleService.deleteById(idList);
return new JsonResult().success();
}
/**
* 查询角色下授权用户列表
*
* @param queryCondtion
* 查询条件
* @return
*/
@PostMapping(MODEL + "/user/list.json")
@Function("role.user.query")
@ResponseBody
public JsonResult<PageQuery<CoreUser>> userList(RoleUserQuery query) {
PageQuery page = query.getPageQuery();
PageQuery<CoreUser> pageQuery = roleConsoleService.queryRoleUser(page);
return JsonResult.success(page);
}
// /**
// * 给角色添加用户
// * @param userRole 角色用户关系
// * @return
// */
// @PostMapping(MODEL + "/user/save.json")
// @Function("role.user.save")
// @ResponseBody
// public JsonResult saveRoleUser(CoreUserRole userRole) {
// userRole.setCreateTime(new Date());
// userRoleConsoleService.saveSysUserRole(userRole);
// platformService.clearFunctionCache();
// return JsonResult.success();
// }
//
//
// /**
// * 用户授权删除
// * @param ids 记录id
// * @return
// */
// @GetMapping(MODEL + "/user/delete.json")
// @Function("role.user.delete")
// @ResponseBody
// public Object deleteRoleUser(String ids) {
// List<Long> dels = ConvertUtil.str2longs(ids);
// userRoleConsoleService.deleteUserRoles(dels);
// platformService.clearFunctionCache();
// return JsonResult.success();
// }
@PostMapping(MODEL + "/function/ids.json")
@Function("role.function.query")
@ResponseBody
public JsonResult<List<Long>> getFunctionIdByRole(Long roleId) {
List<Long> list = functionConsoleService.getFunctionByRole(roleId);
return JsonResult.success(list);
}
@GetMapping(MODEL + "/function/queryFunction.json")
@Function("role.function.query")
@ResponseBody
public JsonResult<List<RoleDataAccessFunction>> getQueryFunctionByRole(Long roleId) {
List<RoleDataAccessFunction> list = functionConsoleService.getQueryFunctionByRole(roleId);
return JsonResult.success(list);
}
@PostMapping(MODEL + "/function/update.json")
@Function("role.function.edit")
@ResponseBody
public JsonResult updateFunction(Long roleId, String ids) {
List<Long> all = ConvertUtil.str2longs(ids);
List<Long> addIds = new ArrayList<Long>();
List<Long> delIds = new ArrayList<Long>();
List<Long> dbs = functionConsoleService.getFunctionByRole(roleId);
Iterator<Long> it = all.iterator();
for(Long id:all) {
if(!dbs.contains(id)) {
addIds.add(id);
}
}
for(Long id:dbs) {
if(!all.contains(id)) {
delIds.add(id);
}
}
functionConsoleService.updateSysRoleFunction(roleId, addIds, delIds);
return JsonResult.success();
}
@PostMapping(MODEL + "/function/updateDataAccess.json")
@Function("role.function.updateDataAccess")
@ResponseBody
public JsonResult updateFunctionDataAccess(Long roleId,Long fnId,Integer accessType) {
RoleDataAccessFunction data = new RoleDataAccessFunction();
data.setRoleId(roleId);
data.setId(fnId);
data.setDataAccessType(accessType);
functionConsoleService.updateFunctionAccessByRole(Arrays.asList(data));
return JsonResult.success();
}
/*后端模板渲染*/
@PostMapping(MODEL + "/function/dataAccess.do")
@Function("role.function.updateDataAccess")
public ModelAndView datapage(Long roleId) {
List<RoleDataAccessFunction> list = functionConsoleService.getQueryFunctionByRole(roleId);
ModelAndView view = new ModelAndView("/admin/role/dataConfigPart.html");
view.addObject("list", list);
return view;
}
} }
...@@ -52,261 +52,248 @@ import com.ibeetl.admin.core.web.JsonResult; ...@@ -52,261 +52,248 @@ import com.ibeetl.admin.core.web.JsonResult;
*/ */
@Controller @Controller
public class UserConsoleController { public class UserConsoleController {
private final Log log = LogFactory.getLog(this.getClass()); private final Log log = LogFactory.getLog(this.getClass());
private static final String MODEL = "/admin/user"; private static final String MODEL = "/admin/user";
@Autowired @Autowired UserConsoleService userConsoleService;
UserConsoleService userConsoleService;
@Autowired CorePlatformService platformService;
@Autowired
CorePlatformService platformService; @Autowired RoleConsoleService roleConsoleService;
@Autowired OrgConsoleService orgConsoleService;
@Autowired @Autowired FileService fileService;
RoleConsoleService roleConsoleService;
@Autowired /* 页面 */
OrgConsoleService orgConsoleService;
@Autowired @GetMapping(MODEL + "/index.do")
FileService fileService; @Function("user")
public ModelAndView index() {
ModelAndView view = new ModelAndView("/admin/user/index.html");
view.addObject("search", UserQuery.class.getName());
return view;
/* 页面 */ }
@GetMapping(MODEL + "/index.do") @GetMapping(MODEL + "/edit.do")
@Function("user") @Function("user.edit")
public ModelAndView index() { public ModelAndView edit(String id) {
ModelAndView view = new ModelAndView("/admin/user/index.html"); ModelAndView view = new ModelAndView("/admin/user/edit.html");
view.addObject("search", UserQuery.class.getName()); CoreUser user = userConsoleService.queryById(id);
return view; view.addObject("user", user);
} return view;
}
@GetMapping(MODEL + "/edit.do")
@Function("user.edit") @GetMapping(MODEL + "/add.do")
public ModelAndView edit(String id) { @Function("user.add")
ModelAndView view = new ModelAndView("/admin/user/edit.html"); public ModelAndView add() {
CoreUser user = userConsoleService.queryById(id); ModelAndView view = new ModelAndView("/admin/user/add.html");
view.addObject("user", user); return view;
return view; }
@GetMapping(MODEL + "/changePassword.do")
@Function("user.add")
public ModelAndView changePassword(Long id) {
CoreUser user = userConsoleService.queryById(id);
ModelAndView view = new ModelAndView("/admin/user/changePassword.html");
view.addObject("user", user);
return view;
}
@GetMapping(MODEL + "/role/list.do")
@Function("user.role")
public ModelAndView userRoleIndex(Long id) {
CoreUser user = userConsoleService.queryById(id);
ModelAndView view = new ModelAndView("/admin/user/userRole.html");
view.addObject("search", UserRoleQuery.class.getName());
view.addObject("user", user);
return view;
}
@GetMapping(MODEL + "/role/add.do")
@Function("user.role")
public ModelAndView userRoleAdd(Long id) {
CoreUser user = userConsoleService.queryById(id);
ModelAndView view = new ModelAndView("/admin/user/userRoleAdd.html");
view.addObject("user", user);
return view;
}
/* Json */
@PostMapping(MODEL + "/delete.json")
@Function("user.delete")
@ResponseBody
public JsonResult delete(String ids) {
List<Long> dels = ConvertUtil.str2longs(ids);
userConsoleService.batchDelSysUser(dels);
return JsonResult.success();
}
@PostMapping(MODEL + "/update.json")
@Function("user.update")
@ResponseBody
public JsonResult update(@Validated(ValidateConfig.UPDATE.class) CoreUser user) {
boolean success = userConsoleService.updateTemplate(user);
if (success) {
this.platformService.clearFunctionCache();
return JsonResult.success();
} else {
return JsonResult.failMessage("保存失败!");
} }
}
@GetMapping(MODEL + "/add.do")
@Function("user.add") @PostMapping(MODEL + "/add.json")
public ModelAndView add() { @Function("user.add")
ModelAndView view = new ModelAndView("/admin/user/add.html"); @ResponseBody
return view; public JsonResult<Long> add(@Validated(ValidateConfig.ADD.class) CoreUser user) {
if (!platformService.isAllowUserName(user.getCode())) {
return JsonResult.failMessage("不允许的注册名字 " + user.getCode());
} }
user.setCreateTime(new Date());
@GetMapping(MODEL + "/changePassword.do") userConsoleService.saveUser(user);
@Function("user.add") return JsonResult.success(user.getId());
public ModelAndView changePassword(Long id) { }
CoreUser user = userConsoleService.queryById(id);
ModelAndView view = new ModelAndView("/admin/user/changePassword.html"); @PostMapping(MODEL + "/view.json")
view.addObject("user", user); @ResponseBody
return view; @Function("user.query")
} public JsonResult<CoreUser> view(Long id) {
CoreUser user = userConsoleService.queryById(id);
@GetMapping(MODEL + "/role/list.do") return JsonResult.success(user);
@Function("user.role") }
public ModelAndView userRoleIndex(Long id) {
CoreUser user = userConsoleService.queryById(id); @PostMapping(MODEL + "/list.json")
ModelAndView view = new ModelAndView("/admin/user/userRole.html"); @Function("user.query")
view.addObject("search", UserRoleQuery.class.getName()); @ResponseBody
view.addObject("user", user); public JsonResult<PageQuery<CoreUser>> index(UserQuery condtion) {
return view;
PageQuery<CoreUser> page = condtion.getPageQuery();
userConsoleService.queryByCondtion(page);
return JsonResult.success(page);
}
@PostMapping(MODEL + "/list/condition.json")
@Function("user.query")
@ResponseBody
public JsonResult<List<Map<String, Object>>> indexCondtion() {
List<Map<String, Object>> list =
AnnotationUtil.getInstance().getAnnotations(Query.class, UserQuery.class);
return JsonResult.success(list);
}
@PostMapping(MODEL + "/disable.json")
@Function("user.disable")
@ResponseBody
public JsonResult disableUser(String ids) {
List<Long> dels = ConvertUtil.str2longs(ids);
userConsoleService.batchUpdateUserState(dels, GeneralStateEnum.DISABLE);
for (Long id : dels) {
CoreUser user = userConsoleService.queryById(id);
this.platformService.restUserSession(user.getCode());
} }
return JsonResult.success();
@GetMapping(MODEL + "/role/add.do") }
@Function("user.role")
public ModelAndView userRoleAdd(Long id) { /**
CoreUser user = userConsoleService.queryById(id); * 启用用户操作
ModelAndView view = new ModelAndView("/admin/user/userRoleAdd.html"); *
view.addObject("user", user); * @return
return view; */
} @PostMapping(MODEL + "/enable.json")
@Function("user.enable")
/* Json */ @ResponseBody
public JsonResult enableUser(String ids) {
@PostMapping(MODEL + "/delete.json")
@Function("user.delete") List<Long> enables = ConvertUtil.str2longs(ids);
@ResponseBody userConsoleService.batchUpdateUserState(enables, GeneralStateEnum.ENABLE);
public JsonResult delete(String ids) { return JsonResult.success();
List<Long> dels = ConvertUtil.str2longs(ids); }
userConsoleService.batchDelSysUser(dels);
return JsonResult.success(); /**
} * 管理员重置用户密码
*
@PostMapping(MODEL + "/update.json") * @return
@Function("user.update") */
@ResponseBody @PostMapping(MODEL + "/changePassword.json")
public JsonResult update(@Validated(ValidateConfig.UPDATE.class) CoreUser user) { @Function("user.reset")
boolean success = userConsoleService.updateTemplate(user); @ResponseBody
if (success) { public JsonResult changePassword(Long id, String password) {
this.platformService.clearFunctionCache();
return JsonResult.success(); userConsoleService.resetPassword(id, password);
} else { return new JsonResult().success();
return JsonResult.failMessage("保存失败!"); }
}
} /**
* 用户所有授权角色列表
@PostMapping(MODEL + "/add.json") *
@Function("user.add") * @param id 用户id
@ResponseBody * @return
public JsonResult<Long> add(@Validated(ValidateConfig.ADD.class) CoreUser user) { */
if (!platformService.isAllowUserName(user.getCode())) { @PostMapping(MODEL + "/role/list.json")
return JsonResult.failMessage("不允许的注册名字 " + user.getCode()); @Function("user.role")
} @ResponseBody
user.setCreateTime(new Date()); public JsonResult<List<CoreUserRole>> getRoleList(UserRoleQuery roleQuery) {
userConsoleService.saveUser(user); List<CoreUserRole> list = userConsoleService.getUserRoles(roleQuery);
return JsonResult.success(user.getId()); return JsonResult.success(list);
} }
@PostMapping(MODEL + "/view.json") /**
@ResponseBody * 用户添加授权角色页
@Function("user.query") *
public JsonResult<CoreUser> view(Long id) { * @return
CoreUser user = userConsoleService.queryById(id); */
return JsonResult.success(user); @PostMapping(MODEL + "/role/add.json")
} @Function("user.role")
@ResponseBody
@PostMapping(MODEL + "/list.json") public JsonResult saveUserRole(@Validated CoreUserRole userRole) {
@Function("user.query") userRole.setCreateTime(new Date());
@ResponseBody this.userConsoleService.saveUserRole(userRole);
public JsonResult<PageQuery<CoreUser>> index(UserQuery condtion) { this.platformService.clearFunctionCache();
return JsonResult.success(userRole.getId());
PageQuery<CoreUser> page = condtion.getPageQuery(); }
userConsoleService.queryByCondtion(page);
return JsonResult.success(page); /**
* 删除用户角色授权
*
* @return
*/
@PostMapping(MODEL + "/role/delete.json")
@Function("user.role")
@ResponseBody
public JsonResult delUserRole(String ids) {
List<Long> dels = ConvertUtil.str2longs(ids);
userConsoleService.deleteUserRoles(dels);
this.platformService.clearFunctionCache();
return JsonResult.success();
}
@PostMapping(MODEL + "/excel/export.json")
@Function("user.export")
@ResponseBody
public JsonResult<String> export(HttpServletResponse response, UserQuery condtion) {
String excelTemplate = "excelTemplates/admin/user/user_collection_template.xls";
PageQuery<CoreUser> page = condtion.getPageQuery();
// 取出全部符合条件的
page.setPageSize(Integer.MAX_VALUE);
page.setPageNumber(1);
page.setTotalRow(Integer.MAX_VALUE);
List<UserExcelExportData> users = userConsoleService.queryExcel(page);
try (InputStream is =
Thread.currentThread().getContextClassLoader().getResourceAsStream(excelTemplate)) {
if (is == null) {
throw new PlatformException("模板资源不存在:" + excelTemplate);
}
FileItem item = fileService.createFileTemp("user_collection.xls");
OutputStream os = item.openOutpuStream();
Context context = new Context();
context.putVar("users", users);
JxlsHelper.getInstance().processTemplate(is, os, context);
// 下载参考FileSystemContorller
return JsonResult.success(item.getPath());
} catch (IOException e) {
throw new PlatformException(e.getMessage());
} }
}
@PostMapping(MODEL + "/list/condition.json")
@Function("user.query")
@ResponseBody
public JsonResult<List<Map<String, Object>>> indexCondtion() {
List<Map<String, Object>> list = AnnotationUtil.getInstance().getAnnotations(Query.class, UserQuery.class);
return JsonResult.success(list);
}
@PostMapping(MODEL + "/disable.json")
@Function("user.disable")
@ResponseBody
public JsonResult disableUser(String ids) {
List<Long> dels = ConvertUtil.str2longs(ids);
userConsoleService.batchUpdateUserState(dels, GeneralStateEnum.DISABLE);
for (Long id : dels) {
CoreUser user = userConsoleService.queryById(id);
this.platformService.restUserSession(user.getCode());
}
return JsonResult.success();
}
/**
* 启用用户操作
*
* @return
*/
@PostMapping(MODEL + "/enable.json")
@Function("user.enable")
@ResponseBody
public JsonResult enableUser(String ids) {
List<Long> enables = ConvertUtil.str2longs(ids);
userConsoleService.batchUpdateUserState(enables, GeneralStateEnum.ENABLE);
return JsonResult.success();
}
/**
* 管理员重置用户密码
*
* @return
*/
@PostMapping(MODEL + "/changePassword.json")
@Function("user.reset")
@ResponseBody
public JsonResult changePassword(Long id, String password) {
userConsoleService.resetPassword(id, password);
return new JsonResult().success();
}
/**
* 用户所有授权角色列表
*
* @param id 用户id
* @return
*/
@PostMapping(MODEL + "/role/list.json")
@Function("user.role")
@ResponseBody
public JsonResult<List<CoreUserRole>> getRoleList(UserRoleQuery roleQuery) {
List<CoreUserRole> list = userConsoleService.getUserRoles(roleQuery);
return JsonResult.success(list);
}
/**
* 用户添加授权角色页
*
* @return
*/
@PostMapping(MODEL + "/role/add.json")
@Function("user.role")
@ResponseBody
public JsonResult saveUserRole(@Validated CoreUserRole userRole) {
userRole.setCreateTime(new Date());
this.userConsoleService.saveUserRole(userRole);
this.platformService.clearFunctionCache();
return JsonResult.success(userRole.getId());
}
/**
* 删除用户角色授权
*
* @return
*/
@PostMapping(MODEL + "/role/delete.json")
@Function("user.role")
@ResponseBody
public JsonResult delUserRole(String ids) {
List<Long> dels = ConvertUtil.str2longs(ids);
userConsoleService.deleteUserRoles(dels);
this.platformService.clearFunctionCache();
return JsonResult.success();
}
@PostMapping(MODEL + "/excel/export.json")
@Function("user.export")
@ResponseBody
public JsonResult<String> export(HttpServletResponse response, UserQuery condtion) {
String excelTemplate = "excelTemplates/admin/user/user_collection_template.xls";
PageQuery<CoreUser> page = condtion.getPageQuery();
//取出全部符合条件的
page.setPageSize(Integer.MAX_VALUE);
page.setPageNumber(1);
page.setTotalRow(Integer.MAX_VALUE);
List<UserExcelExportData> users = userConsoleService.queryExcel(page);
try (InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(excelTemplate)) {
if (is == null) {
throw new PlatformException("模板资源不存在:" + excelTemplate);
}
FileItem item = fileService.createFileTemp("user_collection.xls");
OutputStream os = item.openOutpuStream();
Context context = new Context();
context.putVar("users", users);
JxlsHelper.getInstance().processTemplate(is, os, context);
//下载参考FileSystemContorller
return JsonResult.success(item.getPath());
} catch (IOException e) {
throw new PlatformException(e.getMessage());
}
}
} }
...@@ -4,28 +4,26 @@ import com.ibeetl.admin.core.entity.CoreDict; ...@@ -4,28 +4,26 @@ import com.ibeetl.admin.core.entity.CoreDict;
/** /**
* 字典数据导入,参考 dict_mapping.xml * 字典数据导入,参考 dict_mapping.xml
* @author xiandafu
* *
* @author xiandafu
*/ */
public class DictExcelImportData extends CoreDict { public class DictExcelImportData extends CoreDict {
private Integer excelId; private Integer excelId;
private Integer parentExcelId; private Integer parentExcelId;
public Integer getExcelId() { public Integer getExcelId() {
return excelId; return excelId;
} }
public void setExcelId(Integer excelId) { public void setExcelId(Integer excelId) {
this.excelId = excelId; this.excelId = excelId;
} }
public Integer getParentExcelId() { public Integer getParentExcelId() {
return parentExcelId; return parentExcelId;
} }
public void setParentExcelId(Integer parentExcelId) { public void setParentExcelId(Integer parentExcelId) {
this.parentExcelId = parentExcelId; this.parentExcelId = parentExcelId;
} }
} }
...@@ -3,23 +3,22 @@ package com.ibeetl.admin.console.web.dto; ...@@ -3,23 +3,22 @@ package com.ibeetl.admin.console.web.dto;
import com.ibeetl.admin.core.entity.CoreFunction; import com.ibeetl.admin.core.entity.CoreFunction;
public class RoleDataAccessFunction extends CoreFunction { public class RoleDataAccessFunction extends CoreFunction {
private Integer dataAccessType; private Integer dataAccessType;
private Long roleId; private Long roleId;
public Integer getDataAccessType() { public Integer getDataAccessType() {
return dataAccessType; return dataAccessType;
} }
public void setDataAccessType(Integer dataAccessType) { public void setDataAccessType(Integer dataAccessType) {
this.dataAccessType = dataAccessType; this.dataAccessType = dataAccessType;
} }
public Long getRoleId() { public Long getRoleId() {
return roleId; return roleId;
} }
public void setRoleId(Long roleId) { public void setRoleId(Long roleId) {
this.roleId = roleId; this.roleId = roleId;
} }
} }
...@@ -7,58 +7,71 @@ import com.ibeetl.admin.core.annotation.Dict; ...@@ -7,58 +7,71 @@ import com.ibeetl.admin.core.annotation.Dict;
/** /**
* excel导出需要的模板数据 * excel导出需要的模板数据
* @author xiandafu
* *
* @author xiandafu
*/ */
public class UserExcelExportData { public class UserExcelExportData {
protected Long id; protected Long id;
private String code; private String code;
private String name; private String name;
private String orgText; private String orgText;
private String password; private String password;
private String stateText; private String stateText;
private String jobType1Text; private String jobType1Text;
public String getCode() {
return code; public String getCode() {
} return code;
public void setCode(String code) { }
this.code = code;
} public void setCode(String code) {
public String getName() { this.code = code;
return name; }
}
public void setName(String name) { public String getName() {
this.name = name; return name;
} }
public String getOrgText() {
return orgText; public void setName(String name) {
} this.name = name;
public void setOrgText(String orgText) { }
this.orgText = orgText;
} public String getOrgText() {
public String getPassword() { return orgText;
return password; }
}
public void setPassword(String password) { public void setOrgText(String orgText) {
this.password = password; this.orgText = orgText;
} }
public String getStateText() {
return stateText; public String getPassword() {
} return password;
public void setStateText(String stateText) { }
this.stateText = stateText;
} public void setPassword(String password) {
public String getJobType1Text() { this.password = password;
return jobType1Text; }
}
public void setJobType1Text(String jobType1Text) { public String getStateText() {
this.jobType1Text = jobType1Text; return stateText;
} }
public Long getId() {
return id; public void setStateText(String stateText) {
} this.stateText = stateText;
public void setId(Long id) { }
this.id = id;
} public String getJobType1Text() {
return jobType1Text;
}
public void setJobType1Text(String jobType1Text) {
this.jobType1Text = jobType1Text;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
} }
...@@ -8,68 +8,75 @@ import com.ibeetl.admin.core.annotation.Query; ...@@ -8,68 +8,75 @@ import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.util.Tool; import com.ibeetl.admin.core.util.Tool;
import com.ibeetl.admin.core.web.query.PageParam; import com.ibeetl.admin.core.web.query.PageParam;
/** /** 审计查询条件 */
* 审计查询条件
*/
public class AuditQuery extends PageParam { public class AuditQuery extends PageParam {
@Query(name = "功能名称", display = true,fuzzy=true) @Query(name = "功能名称", display = true, fuzzy = true)
private String functionName; private String functionName;
@Query(name = "功能编号", display = true,fuzzy=true)
private String functionCode; @Query(name = "功能编号", display = true, fuzzy = true)
@Query(name = "用户名称", display = true,fuzzy=true) private String functionCode;
private String userName;
@Query(name = "用户名称", display = true, fuzzy = true)
@Query(name="创建日期",display=true,type=Query.TYPE_DATE_BETWEEN) private String userName;
private String createDateRange;
private Date createDateMin; @Query(name = "创建日期", display = true, type = Query.TYPE_DATE_BETWEEN)
private Date createDateMax; private String createDateRange;
public String getFunctionCode() { private Date createDateMin;
return functionCode; private Date createDateMax;
}
public void setFunctionCode(String functionCode) { public String getFunctionCode() {
this.functionCode = functionCode; return functionCode;
} }
public String getUserName() {
return userName; public void setFunctionCode(String functionCode) {
} this.functionCode = functionCode;
public void setUserName(String userName) { }
this.userName = userName;
} public String getUserName() {
return userName;
public String getCreateDateRange() { }
return createDateRange;
} public void setUserName(String userName) {
public void setCreateDateRange(String createDateRange) { this.userName = userName;
this.createDateRange = createDateRange; }
if(StringUtils.isEmpty(createDateRange)) {
return ; public String getCreateDateRange() {
} return createDateRange;
Date[] ds = Tool.parseDataRange(createDateRange); }
this.createDateMin=ds[0];
this.createDateMax =ds[1]; public void setCreateDateRange(String createDateRange) {
} this.createDateRange = createDateRange;
public Date getCreateDateMin() { if (StringUtils.isEmpty(createDateRange)) {
return createDateMin; return;
}
public void setCreateDateMin(Date createDateMin) {
this.createDateMin = createDateMin;
}
public Date getCreateDateMax() {
return createDateMax;
}
public void setCreateDateMax(Date createDateMax) {
this.createDateMax = createDateMax;
} }
public String getFunctionName() { Date[] ds = Tool.parseDataRange(createDateRange);
return functionName; this.createDateMin = ds[0];
} this.createDateMax = ds[1];
public void setFunctionName(String functionName) { }
this.functionName = functionName;
} public Date getCreateDateMin() {
return createDateMin;
}
public void setCreateDateMin(Date createDateMin) {
this.createDateMin = createDateMin;
}
public Date getCreateDateMax() {
return createDateMax;
}
public void setCreateDateMax(Date createDateMax) {
this.createDateMax = createDateMax;
}
public String getFunctionName() {
return functionName;
}
public void setFunctionName(String functionName) {
this.functionName = functionName;
}
} }
...@@ -4,17 +4,16 @@ import com.ibeetl.admin.core.annotation.Query; ...@@ -4,17 +4,16 @@ import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.util.enums.CoreDictType; import com.ibeetl.admin.core.util.enums.CoreDictType;
import com.ibeetl.admin.core.web.query.PageParam; import com.ibeetl.admin.core.web.query.PageParam;
import java.util.Date; import java.util.Date;
/** /** CmsBlog查询 */
*CmsBlog查询
*/
public class CmsBlogQuery extends PageParam { public class CmsBlogQuery extends PageParam {
@Query(name = "id", display = true) @Query(name = "id", display = true)
private Integer id; private Integer id;
public Integer getId(){
return id; public Integer getId() {
} return id;
public void setId(Integer id ){ }
this.id = id;
} public void setId(Integer id) {
this.id = id;
}
} }
...@@ -4,41 +4,49 @@ import com.ibeetl.admin.core.annotation.Query; ...@@ -4,41 +4,49 @@ import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.util.enums.CoreDictType; import com.ibeetl.admin.core.util.enums.CoreDictType;
import com.ibeetl.admin.core.web.query.PageParam; import com.ibeetl.admin.core.web.query.PageParam;
import java.util.Date; import java.util.Date;
/** /** CoreDict查询 */
*CoreDict查询
*/
public class CoreDictQuery extends PageParam { public class CoreDictQuery extends PageParam {
@Query(name = "字典值", display = true) @Query(name = "字典值", display = true)
private String value; private String value;
@Query(name = "字典名称", display = true)
private String name; @Query(name = "字典名称", display = true)
@Query(name = "字典类型名称", display = true) private String name;
private String typeName;
@Query(name = "父字典", display = true) @Query(name = "字典类型名称", display = true)
private String parent; private String typeName;
public String getValue(){
return value; @Query(name = "父字典", display = true)
} private String parent;
public void setValue(String value ){
this.value = value; public String getValue() {
} return value;
public String getName(){ }
return name;
} public void setValue(String value) {
public void setName(String name ){ this.value = value;
this.name = name; }
}
public String getTypeName(){ public String getName() {
return typeName; return name;
} }
public void setTypeName(String typeName ){
this.typeName = typeName; public void setName(String name) {
} this.name = name;
public String getParent(){ }
return parent;
} public String getTypeName() {
public void setParent(String parent ){ return typeName;
this.parent = parent; }
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public String getParent() {
return parent;
}
public void setParent(String parent) {
this.parent = parent;
}
} }
...@@ -3,33 +3,38 @@ package com.ibeetl.admin.console.web.query; ...@@ -3,33 +3,38 @@ package com.ibeetl.admin.console.web.query;
import com.ibeetl.admin.core.annotation.Query; import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.util.enums.CoreDictType; import com.ibeetl.admin.core.util.enums.CoreDictType;
import com.ibeetl.admin.core.web.query.PageParam; import com.ibeetl.admin.core.web.query.PageParam;
/** /** 功能查询 */
*功能查询
*/
public class CoreFunctionQuery extends PageParam { public class CoreFunctionQuery extends PageParam {
@Query(name = "名称", display = true) @Query(name = "名称", display = true)
private String name; private String name;
@Query(name = "访问路径", display = true)
private String accessUrl; @Query(name = "访问路径", display = true)
@Query(name = "功能点类型", display = true) private String accessUrl;
private String type;
public String getName(){ @Query(name = "功能点类型", display = true)
return name; private String type;
}
public void setName(String name ){ public String getName() {
this.name = name; return name;
} }
public String getAccessUrl(){
return accessUrl; public void setName(String name) {
} this.name = name;
public void setAccessUrl(String accessUrl ){ }
this.accessUrl = accessUrl;
} public String getAccessUrl() {
public String getType(){ return accessUrl;
return type; }
}
public void setType(String type ){ public void setAccessUrl(String accessUrl) {
this.type = type; this.accessUrl = accessUrl;
} }
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
} }
...@@ -5,64 +5,70 @@ import java.util.List; ...@@ -5,64 +5,70 @@ import java.util.List;
import com.ibeetl.admin.core.annotation.Query; import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.web.query.PageParam; import com.ibeetl.admin.core.web.query.PageParam;
/** /** 功能表单查询条件 */
* 功能表单查询条件
*/
public class FunctionQuery extends PageParam { public class FunctionQuery extends PageParam {
@Query(name = "代码", display = true,fuzzy=true) @Query(name = "代码", display = true, fuzzy = true)
private String code; private String code;
@Query(name = "名称", display = true,fuzzy=true)
private String name; @Query(name = "名称", display = true, fuzzy = true)
@Query(name = "访问地址",fuzzy=true) private String name;
private String accessUrl;
@Query(name = "访问地址", fuzzy = true)
@Query(name="上一级功能",display=true,type=Query.TYPE_CONTROL,control="fun") private String accessUrl;
private Long parentFunctionId;
@Query(name = "上一级功能", display = true, type = Query.TYPE_CONTROL, control = "fun")
private Long functionId; private Long parentFunctionId;
//查询子类
private List<Long> functionIds; private Long functionId;
// 查询子类
private List<Long> functionIds;
public String getCode() { public String getCode() {
return code; return code;
} }
public void setCode(String code) {
this.code = code; public void setCode(String code) {
} this.code = code;
public String getName() { }
return name;
} public String getName() {
public void setName(String name) { return name;
this.name = name; }
}
public String getAccessUrl() { public void setName(String name) {
return accessUrl; this.name = name;
} }
public void setAccessUrl(String accessUrl) {
this.accessUrl = accessUrl; public String getAccessUrl() {
} return accessUrl;
public List<Long> getFunctionIds() { }
return functionIds;
} public void setAccessUrl(String accessUrl) {
public void setFunctionIds(List<Long> functionIds) { this.accessUrl = accessUrl;
this.functionIds = functionIds; }
}
public Long getFunctionId() { public List<Long> getFunctionIds() {
return functionId; return functionIds;
} }
public void setFunctionId(Long functionId) {
this.functionId = functionId; public void setFunctionIds(List<Long> functionIds) {
} this.functionIds = functionIds;
public Long getParentFunctionId() { }
return parentFunctionId;
} public Long getFunctionId() {
public void setParentFunctionId(Long parentFunctionId) { return functionId;
this.parentFunctionId = parentFunctionId; }
}
public void setFunctionId(Long functionId) {
this.functionId = functionId;
}
public Long getParentFunctionId() {
return parentFunctionId;
}
public void setParentFunctionId(Long parentFunctionId) {
this.parentFunctionId = parentFunctionId;
}
} }
...@@ -3,47 +3,50 @@ package com.ibeetl.admin.console.web.query; ...@@ -3,47 +3,50 @@ package com.ibeetl.admin.console.web.query;
import com.ibeetl.admin.core.annotation.Query; import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.web.query.PageParam; import com.ibeetl.admin.core.web.query.PageParam;
/** /** 菜单查询条件 */
* 菜单查询条件
*/
public class MenuQuery extends PageParam { public class MenuQuery extends PageParam {
@Query(name = "代码", display = true,fuzzy=true) @Query(name = "代码", display = true, fuzzy = true)
private String code; private String code;
@Query(name = "名称", display = true,fuzzy=true)
private String name; @Query(name = "名称", display = true, fuzzy = true)
private String name;
@Query(name = "菜单入口地址", display = true,fuzzy=true)
private String url; @Query(name = "菜单入口地址", display = true, fuzzy = true)
private String url;
@Query(name="上一级菜单",display=true,type=Query.TYPE_CONTROL,control="menu")
private Long parentMenuId; @Query(name = "上一级菜单", display = true, type = Query.TYPE_CONTROL, control = "menu")
private Long parentMenuId;
public String getCode() {
return code; public String getCode() {
} return code;
public void setCode(String code) { }
this.code = code;
} public void setCode(String code) {
public String getName() { this.code = code;
return name; }
}
public void setName(String name) { public String getName() {
this.name = name; return name;
} }
public String getUrl() {
return url; public void setName(String name) {
} this.name = name;
public void setUrl(String url) { }
this.url = url;
} public String getUrl() {
public Long getParentMenuId() { return url;
return parentMenuId; }
}
public void setParentMenuId(Long parentMenuId) { public void setUrl(String url) {
this.parentMenuId = parentMenuId; this.url = url;
} }
public Long getParentMenuId() {
return parentMenuId;
}
public void setParentMenuId(Long parentMenuId) {
this.parentMenuId = parentMenuId;
}
} }
...@@ -4,50 +4,50 @@ import com.ibeetl.admin.core.annotation.Query; ...@@ -4,50 +4,50 @@ import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.util.enums.CoreDictType; import com.ibeetl.admin.core.util.enums.CoreDictType;
import com.ibeetl.admin.core.web.query.PageParam; import com.ibeetl.admin.core.web.query.PageParam;
/** /** 字典表单查询条件 */
* 字典表单查询条件
*/
public class OrgQuery extends PageParam { public class OrgQuery extends PageParam {
@Query(name = "机构编号", display = true) @Query(name = "机构编号", display = true)
private String code; private String code;
@Query(name = "机构名称", display = true)
private String name;
@Query(name="机构类型",display=true,type=Query.TYPE_DICT,dict=CoreDictType.ORG_TYPE)
private String type;
@Query(name="上一级机构",display=true,type=Query.TYPE_CONTROL,control="org")
private String parentOrgId;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getParentOrgId() {
return parentOrgId;
}
public void setParentOrgId(String parentOrgId) {
this.parentOrgId = parentOrgId;
}
@Query(name = "机构名称", display = true)
private String name;
@Query(name = "机构类型", display = true, type = Query.TYPE_DICT, dict = CoreDictType.ORG_TYPE)
private String type;
@Query(name = "上一级机构", display = true, type = Query.TYPE_CONTROL, control = "org")
private String parentOrgId;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getParentOrgId() {
return parentOrgId;
}
public void setParentOrgId(String parentOrgId) {
this.parentOrgId = parentOrgId;
}
} }
...@@ -4,26 +4,24 @@ import java.util.List; ...@@ -4,26 +4,24 @@ import java.util.List;
import com.ibeetl.admin.core.web.query.PageParam; import com.ibeetl.admin.core.web.query.PageParam;
/** /** 描述: 带有组织树相关的查询 */
* 描述: 带有组织树相关的查询
*/
public class OrgTreeQuery extends PageParam { public class OrgTreeQuery extends PageParam {
protected Long orgId; //组织id protected Long orgId; // 组织id
protected List<Long> orgIds; protected List<Long> orgIds;
public Long getOrgId() { public Long getOrgId() {
return orgId; return orgId;
} }
public void setOrgId(Long orgId) { public void setOrgId(Long orgId) {
this.orgId = orgId; this.orgId = orgId;
} }
public List<Long> getOrgIds() { public List<Long> getOrgIds() {
return orgIds; return orgIds;
} }
public void setOrgIds(List<Long> orgIds) { public void setOrgIds(List<Long> orgIds) {
this.orgIds = orgIds; this.orgIds = orgIds;
} }
} }
...@@ -9,63 +9,68 @@ import com.ibeetl.admin.core.web.query.PageParam; ...@@ -9,63 +9,68 @@ import com.ibeetl.admin.core.web.query.PageParam;
public class OrgUserQuery extends PageParam { public class OrgUserQuery extends PageParam {
@Query(name="账号",display=true,fuzzy=true) @Query(name = "账号", display = true, fuzzy = true)
private String code ; private String code;
@Query(name="名称",display=true,fuzzy=true)
private String name ;
@Query(name="状态",display=true,type=Query.TYPE_DICT,dict=CoreDictType.USER_STATE)
private String state;
@Query(name="职务",display=true,type=Query.TYPE_DICT,dict="job_type",group="job_type")
private String jobType0;
@Query(name="职务明细",display=true,type=Query.TYPE_DICT,dict="",group="job_type")
private String jobType1;
private Long orgId;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getOrgId() {
return orgId;
}
public void setOrgId(Long orgId) {
this.orgId = orgId;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getJobType0() {
return jobType0;
}
public void setJobType0(String jobType0) {
this.jobType0 = jobType0;
}
public String getJobType1() {
return jobType1;
}
public void setJobType1(String jobType1) {
this.jobType1 = jobType1;
}
@Query(name = "名称", display = true, fuzzy = true)
private String name;
@Query(name = "状态", display = true, type = Query.TYPE_DICT, dict = CoreDictType.USER_STATE)
private String state;
@Query(name = "职务", display = true, type = Query.TYPE_DICT, dict = "job_type", group = "job_type")
private String jobType0;
@Query(name = "职务明细", display = true, type = Query.TYPE_DICT, dict = "", group = "job_type")
private String jobType1;
private Long orgId;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getOrgId() {
return orgId;
}
public void setOrgId(Long orgId) {
this.orgId = orgId;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getJobType0() {
return jobType0;
}
public void setJobType0(String jobType0) {
this.jobType0 = jobType0;
}
public String getJobType1() {
return jobType1;
}
public void setJobType1(String jobType1) {
this.jobType1 = jobType1;
}
} }
...@@ -4,44 +4,38 @@ import com.ibeetl.admin.core.annotation.Query; ...@@ -4,44 +4,38 @@ import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.util.enums.CoreDictType; import com.ibeetl.admin.core.util.enums.CoreDictType;
import com.ibeetl.admin.core.web.query.PageParam; import com.ibeetl.admin.core.web.query.PageParam;
/** /** 描述: 角色查询条件 */
* 描述: 角色查询条件
*
*/
public class RoleQuery extends PageParam { public class RoleQuery extends PageParam {
@Query(name = "编码", display = true) @Query(name = "编码", display = true)
private String code; private String code;
@Query(name = "名称", display = true)
private String name;
@Query(name = "业务角色类型", type = Query.TYPE_DICT,dict=CoreDictType.ROLE_TYPE)
private String type;
@Query(name = "名称", display = true)
private String name;
public String getCode() { @Query(name = "业务角色类型", type = Query.TYPE_DICT, dict = CoreDictType.ROLE_TYPE)
return code; private String type;
}
public void setCode(String code) { public String getCode() {
this.code = code; return code;
} }
public String getName() { public void setCode(String code) {
return name; this.code = code;
} }
public void setName(String name) { public String getName() {
this.name = name; return name;
} }
public String getType() { public void setName(String name) {
return type; this.name = name;
} }
public void setType(String type) {
this.type = type;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
} }
...@@ -4,43 +4,37 @@ import com.ibeetl.admin.core.annotation.Query; ...@@ -4,43 +4,37 @@ import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.util.enums.CoreDictType; import com.ibeetl.admin.core.util.enums.CoreDictType;
import com.ibeetl.admin.core.web.query.PageParam; import com.ibeetl.admin.core.web.query.PageParam;
/** /** 描述: 角色李的用户列表 */
* 描述: 角色李的用户列表
*/
public class RoleUserQuery extends PageParam { public class RoleUserQuery extends PageParam {
@Query(name = "编码", display = true) @Query(name = "编码", display = true)
private String userCode; private String userCode;
@Query(name = "名称", display = true)
private String userName;
private Long roleId;
public String getUserCode() { @Query(name = "名称", display = true)
return userCode; private String userName;
}
public void setUserCode(String userCode) { private Long roleId;
this.userCode = userCode;
}
public String getUserName() { public String getUserCode() {
return userName; return userCode;
} }
public void setUserName(String userName) { public void setUserCode(String userCode) {
this.userName = userName; this.userCode = userCode;
} }
public Long getRoleId() { public String getUserName() {
return roleId; return userName;
} }
public void setRoleId(Long roleId) { public void setUserName(String userName) {
this.roleId = roleId; this.userName = userName;
} }
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
} }
...@@ -11,99 +11,113 @@ import com.ibeetl.admin.core.web.query.PageParam; ...@@ -11,99 +11,113 @@ import com.ibeetl.admin.core.web.query.PageParam;
public class UserQuery extends PageParam { public class UserQuery extends PageParam {
@Query(name="账号",display=true,fuzzy=true) @Query(name = "账号", display = true, fuzzy = true)
private String code ; private String code;
@Query(name="名称",display=true,fuzzy=true)
private String name ; @Query(name = "名称", display = true, fuzzy = true)
@Query(name="部门",display=true,type=Query.TYPE_CONTROL,control="org") private String name;
private Long orgId;
@Query(name = "部门", display = true, type = Query.TYPE_CONTROL, control = "org")
@Query(name="状态",display=true,type=Query.TYPE_DICT,dict=CoreDictType.USER_STATE) private Long orgId;
private String state;
@Query(name = "状态", display = true, type = Query.TYPE_DICT, dict = CoreDictType.USER_STATE)
@Query(name="职务",display=true,type=Query.TYPE_DICT,dict="job_type",group="job_type") private String state;
private String jobType0;
@Query(name = "职务", display = true, type = Query.TYPE_DICT, dict = "job_type", group = "job_type")
@Query(name="职务明细",display=true,type=Query.TYPE_DICT,dict="",group="job_type") private String jobType0;
private String jobType1;
@Query(name = "职务明细", display = true, type = Query.TYPE_DICT, dict = "", group = "job_type")
private String jobType1;
@Query(name="创建日期",display=true,type=Query.TYPE_DATE_BETWEEN)
private String createDateRange; @Query(name = "创建日期", display = true, type = Query.TYPE_DATE_BETWEEN)
private Date createDateMin; private String createDateRange;
private Date createDateMax;
private Date createDateMin;
private Date createDateMax;
public String getCode() {
return code; public String getCode() {
} return code;
public void setCode(String code) { }
this.code = code;
} public void setCode(String code) {
public String getName() { this.code = code;
return name; }
}
public void setName(String name) { public String getName() {
this.name = name; return name;
} }
public Long getOrgId() {
return orgId; public void setName(String name) {
} this.name = name;
public void setOrgId(Long orgId) { }
this.orgId = orgId;
} public Long getOrgId() {
public String getState() { return orgId;
return state; }
}
public void setState(String state) { public void setOrgId(Long orgId) {
this.state = state; this.orgId = orgId;
} }
public String getState() {
public String getJobType0() { return state;
return jobType0; }
}
public void setJobType0(String jobType0) { public void setState(String state) {
this.jobType0 = jobType0; this.state = state;
} }
public String getJobType1() {
return jobType1; public String getJobType0() {
} return jobType0;
public void setJobType1(String jobType1) { }
this.jobType1 = jobType1;
public void setJobType0(String jobType0) {
this.jobType0 = jobType0;
}
public String getJobType1() {
return jobType1;
}
public void setJobType1(String jobType1) {
this.jobType1 = jobType1;
}
public String getCreateDateRange() {
return createDateRange;
}
public void setCreateDateRange(String createDateRange) {
this.createDateRange = createDateRange;
if (StringUtils.isEmpty(createDateRange)) {
return;
} }
public String getCreateDateRange() { Date[] ds = Tool.parseDataRange(createDateRange);
return createDateRange; this.createDateMin = ds[0];
} this.createDateMax = ds[1];
public void setCreateDateRange(String createDateRange) { }
this.createDateRange = createDateRange;
if(StringUtils.isEmpty(createDateRange)) { public Date getCreateDateMin() {
return ; return createDateMin;
} }
Date[] ds = Tool.parseDataRange(createDateRange);
this.createDateMin=ds[0]; public void setCreateDateMin(Date createDateMin) {
this.createDateMax =ds[1]; this.createDateMin = createDateMin;
} }
public Date getCreateDateMin() {
return createDateMin;
}
public void setCreateDateMin(Date createDateMin) {
this.createDateMin = createDateMin;
}
public Date getCreateDateMax() {
return createDateMax;
}
public void setCreateDateMax(Date createDateMax) {
this.createDateMax = createDateMax;
}
// public String getJobSubType() {
// return jobSubType;
// }
// public void setJobSubType(String jobSubType) {
// this.jobSubType = jobSubType;
// }
//
public Date getCreateDateMax() {
return createDateMax;
}
public void setCreateDateMax(Date createDateMax) {
this.createDateMax = createDateMax;
}
// public String getJobSubType() {
// return jobSubType;
// }
// public void setJobSubType(String jobSubType) {
// this.jobSubType = jobSubType;
// }
//
} }
Supports Markdown
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