权限控制
This commit is contained in:
parent
ad73710f0d
commit
6441726621
|
|
@ -33,6 +33,7 @@ import com.engine.organization.util.page.PageUtil;
|
|||
import weaver.crm.Maint.SectorInfoComInfo;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
|
||||
|
|
@ -78,6 +79,11 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
@Override
|
||||
public Map<String, Object> listPage(CompSearchParam params) {
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
|
||||
datas.put("hasRight", hasRight());
|
||||
if (!hasRight()) {
|
||||
return datas;
|
||||
}
|
||||
CompPO compPO = CompBO.convertParamToPO(params, (long) user.getUID());
|
||||
boolean filter = isFilter(compPO);
|
||||
PageInfo<CompListDTO> pageInfos;
|
||||
|
|
@ -119,6 +125,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
|
||||
@Override
|
||||
public int saveBaseComp(CompSearchParam params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
// 自动编号
|
||||
params.setCompNo(CodeRuleUtil.generateCode(RuleCodeType.SUBCOMPANY, params.getCompNo()));
|
||||
List<CompPO> list = getCompMapper().listByNo(Util.null2String(params.getCompNo()));
|
||||
|
|
@ -129,12 +136,14 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
|
||||
@Override
|
||||
public int updateForbiddenTagById(CompSearchParam params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
CompPO compPO = CompPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||
return getCompMapper().updateForbiddenTagById(compPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateComp(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
CompSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), CompSearchParam.class);
|
||||
String groupId = (String) params.get("viewCondition");
|
||||
CompPO compPO = CompBO.convertParamToPO(searchParam, (long) user.getUID());
|
||||
|
|
@ -151,12 +160,14 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
return getCompMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -199,11 +210,13 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
return MenuBtn.getDatasNoBtnColum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getCompBaseForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notNull(params.get("viewAttr"), "请标识操作类型");
|
||||
// 2编辑 1查看
|
||||
int viewAttr = Integer.parseInt((String) params.get("viewAttr"));
|
||||
|
|
@ -239,6 +252,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getCompSaveForm() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -384,5 +398,14 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
return conditionItems;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有该模块权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRight() {
|
||||
return HrmUserVarify.checkUserRight("Company:All", user);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import com.engine.organization.util.tree.SearchTreeUtil;
|
|||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -92,7 +93,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public PageInfo<SingleDeptTreeVO> getDeptListByPid(QuerySingleDeptListParam param) {
|
||||
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
//1.查询分部下所有部门
|
||||
//PageUtil.start(param.getCurrent(), param.getPageSize());
|
||||
List<DepartmentPO> departmentPOS = MapperProxyFactory.getProxy(DepartmentMapper.class).list();
|
||||
|
|
@ -108,6 +109,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public PageInfo<SingleJobTreeVO> getJobListByPid(QuerySingleDeptListParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
List<JobPO> jobPOS = MapperProxyFactory.getProxy(JobMapper.class).listAll();
|
||||
PageInfo<JobPO> pageInfo = new PageInfo<>(jobPOS);
|
||||
List<SingleJobTreeVO> singleDeptTreeVOS = JobBO.buildSingleJobTreeVOS(jobPOS, param.getParentDept());
|
||||
|
|
@ -121,6 +123,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
String keyword = params.getKeyword();
|
||||
String id = params.getId();
|
||||
String type = Util.null2String(params.getType());
|
||||
|
|
@ -131,6 +134,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
@Override
|
||||
public Map<String, Object> listPage(DeptSearchParam param) {
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
datas.put("hasRight", hasRight());
|
||||
if (!hasRight()) {
|
||||
return datas;
|
||||
}
|
||||
DepartmentPO departmentPO = DepartmentBO.convertParamsToPO(param, user.getUID());
|
||||
boolean filter = isFilter(departmentPO);
|
||||
PageInfo<DepartmentListDTO> pageInfos;
|
||||
|
|
@ -172,6 +179,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public int saveBaseForm(DeptSearchParam params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
// 自动编号
|
||||
params.setDeptNo(CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, params.getDeptNo()));
|
||||
List<DepartmentPO> list = getDepartmentMapper().listByNo(Util.null2String(params.getDeptNo()));
|
||||
|
|
@ -182,12 +190,14 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public int updateForbiddenTagById(DeptSearchParam params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
DepartmentPO departmentPO = DepartmentPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||
return getDepartmentMapper().updateForbiddenTagById(departmentPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
DeptSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), DeptSearchParam.class);
|
||||
String groupId = (String) params.get("viewCondition");
|
||||
DepartmentPO departmentPO = DepartmentBO.convertParamsToPO(searchParam, user.getUID());
|
||||
|
|
@ -204,12 +214,14 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
return getDepartmentMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -251,28 +263,13 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
Map<String, Object> btnDatas = new HashMap<>();
|
||||
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
|
||||
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
|
||||
// 新增
|
||||
topMenuList.add(MenuBtn.topMenu_addNew());
|
||||
// 批量删除
|
||||
topMenuList.add(MenuBtn.topMenu_batchDelete());
|
||||
// 复制
|
||||
topMenuList.add(MenuBtn.topMenu_copy());
|
||||
btnDatas.put("topMenu", topMenuList);
|
||||
// 新增
|
||||
rightMenuList.add(MenuBtn.rightMenu_addNew());
|
||||
// 复制
|
||||
rightMenuList.add(MenuBtn.rightMenu_copy());
|
||||
// 日志
|
||||
rightMenuList.add(MenuBtn.rightMenu_btnLog());
|
||||
btnDatas.put("rightMenu", rightMenuList);
|
||||
return btnDatas;
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
return MenuBtn.getDatasHasCopy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getDeptBaseForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notNull(params.get("viewAttr"), "请标识操作类型");
|
||||
|
||||
// 2编辑 1查看
|
||||
|
|
@ -308,6 +305,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSaveForm() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -360,6 +358,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
*/
|
||||
@Override
|
||||
public List<SearchConditionGroup> getCopyForm() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> condition = new ArrayList<>();
|
||||
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "复制到", "161", "company", "compBrowser");
|
||||
|
|
@ -367,7 +366,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
||||
SearchConditionOption Option = new SearchConditionOption("1", "");
|
||||
selectOptions.add(Option);
|
||||
SearchConditionItem isCheckItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "是否复制岗位信息", "copyJob");
|
||||
SearchConditionItem isCheckItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 5, 10, false, "是否复制岗位信息", "copyJob");
|
||||
isCheckItem.setDetailtype(2);
|
||||
condition.add(compBrowserItem);
|
||||
condition.add(isCheckItem);
|
||||
|
|
@ -383,6 +382,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
*/
|
||||
@Override
|
||||
public int copyDepartment(DeptCopyParam copyParam) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notBlank(copyParam.getCompany(), "请指定需要复制的公司/分部");
|
||||
int insertCount = 0;
|
||||
List<Long> idList = Arrays.stream(copyParam.getIds().split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
|
|
@ -410,6 +410,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public List<SearchConditionGroup> getMergeForm(Long id) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> condition = new ArrayList<>();
|
||||
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "合并到部门", "161", "department", "deptBrowser");
|
||||
|
|
@ -427,6 +428,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public int mergeDepartment(DepartmentMergeParam mergeParam) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
int updateCount = 0;
|
||||
OrganizationAssert.isFalse(mergeParam.getId().equals(mergeParam.getDepartment()), "所选部门与待合并部门一致,无需操作");
|
||||
OrganizationAssert.notNull(mergeParam.getDepartment(), "请选择需要合并的部门");
|
||||
|
|
@ -448,6 +450,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public List<SearchConditionGroup> getMoveForm() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> condition = new ArrayList<>();
|
||||
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "请选择公司/分部", "161", "company", "compBrowser");
|
||||
|
|
@ -461,6 +464,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
selectOptions.add(deptOption);
|
||||
SearchConditionItem moveTypeItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "转移到", "moveType");
|
||||
moveTypeItem.setDetailtype(3);
|
||||
moveTypeItem.setValue("0");
|
||||
|
||||
condition.add(moveTypeItem);
|
||||
condition.add(compBrowserItem);
|
||||
|
|
@ -471,6 +475,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public int moveDepartment(DepartmentMoveParam moveParam) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notBlank(moveParam.getMoveType(), "请选择转移类型");
|
||||
DepartmentPO deptById = getDepartmentMapper().getDeptById(moveParam.getId());
|
||||
// 0:公司/分部 1:部门
|
||||
|
|
@ -648,5 +653,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 是否有该模块权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRight() {
|
||||
return HrmUserVarify.checkUserRight("Department:All", user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -53,6 +54,11 @@ public class GradeServiceImpl extends Service implements GradeService {
|
|||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
// 刷新引用状态
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("hasRight", hasRight());
|
||||
if (!hasRight()) {
|
||||
return resultMap;
|
||||
}
|
||||
RefreshIsUsedUtil.RefreshGrade("jcl_org_grade");
|
||||
OrganizationWeaTable<GradeTableVO> table = new OrganizationWeaTable<>(user, GradeTableVO.class);
|
||||
String sqlWhere = buildSqlWhere(params);
|
||||
|
|
@ -60,12 +66,14 @@ public class GradeServiceImpl extends Service implements GradeService {
|
|||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
return result.getResultMap();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int saveGrade(GradeSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
List<GradePO> list = getGradeMapper().listByNo(Util.null2String(param.getGradeNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
GradePO gradePO = GradeDTO.convertParamToPO(param, (long) user.getUID());
|
||||
|
|
@ -74,18 +82,21 @@ public class GradeServiceImpl extends Service implements GradeService {
|
|||
|
||||
@Override
|
||||
public int updateGrade(GradeSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
GradePO gradePO = GradeDTO.convertParamToPO(param, (long) user.getUID());
|
||||
return getGradeMapper().updateGrade(gradePO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateForbiddenTagById(GradeSearchParam params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
GradePO gradePO = GradePO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||
return getGradeMapper().updateForbiddenTagById(gradePO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
return getGradeMapper().deleteByIds(ids);
|
||||
}
|
||||
|
|
@ -93,6 +104,7 @@ public class GradeServiceImpl extends Service implements GradeService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -108,6 +120,7 @@ public class GradeServiceImpl extends Service implements GradeService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getGradeForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
|
|
@ -159,11 +172,13 @@ public class GradeServiceImpl extends Service implements GradeService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
return MenuBtn.getCommonBtnDatas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getTabInfo() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<TopTab> topTabs = new ArrayList<>();
|
||||
topTabs.add(TopTab.builder().color("#000000").groupId("flowAll").showcount(true).title("全部").viewCondition("-1").build());
|
||||
|
|
@ -204,4 +219,13 @@ public class GradeServiceImpl extends Service implements GradeService {
|
|||
}
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有该模块权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRight() {
|
||||
return HrmUserVarify.checkUserRight("Grade:All", user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.engine.organization.util.OrganizationFormItemUtil;
|
|||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
|
@ -26,6 +27,7 @@ import java.util.Map;
|
|||
public class GroupServiceImpl extends Service implements GroupService {
|
||||
@Override
|
||||
public Map<String, Object> getGroupFormField(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
|
|
@ -72,6 +74,7 @@ public class GroupServiceImpl extends Service implements GroupService {
|
|||
|
||||
@Override
|
||||
public boolean updateGroup(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
String id = Util.null2String(params.get("id"));
|
||||
OrganizationAssert.notNull(id, "数据有误");
|
||||
String companyname = (String) params.get("companyname");
|
||||
|
|
@ -84,6 +87,7 @@ public class GroupServiceImpl extends Service implements GroupService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> btnDatas = new HashMap<>();
|
||||
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
|
||||
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
|
||||
|
|
@ -98,6 +102,7 @@ public class GroupServiceImpl extends Service implements GroupService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getTabInfo() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<TopTab> topTabs = new ArrayList<>();
|
||||
topTabs.add(TopTab.builder().title("总部信息").viewCondition("1").build());
|
||||
|
|
@ -105,4 +110,13 @@ public class GroupServiceImpl extends Service implements GroupService {
|
|||
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有该模块权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRight() {
|
||||
return HrmUserVarify.checkUserRight("Group:All", user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ import com.engine.organization.util.tree.SearchTreeUtil;
|
|||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -126,6 +127,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
String keyword = params.getKeyword();
|
||||
String id = params.getId();
|
||||
String type = Util.null2String(params.getType());
|
||||
|
|
@ -136,6 +138,10 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
@Override
|
||||
public Map<String, Object> listPage(JobSearchParam param) {
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
datas.put("hasRight", hasRight());
|
||||
if (!hasRight()) {
|
||||
return datas;
|
||||
}
|
||||
JobPO jobPO = JobBO.convertParamsToPO(param, user.getUID());
|
||||
boolean filter = isFilter(jobPO);
|
||||
PageInfo<JobListDTO> pageInfos;
|
||||
|
|
@ -177,28 +183,13 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
Map<String, Object> btnDatas = new HashMap<>();
|
||||
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
|
||||
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
|
||||
// 新增
|
||||
topMenuList.add(MenuBtn.topMenu_addNew());
|
||||
// 批量删除
|
||||
topMenuList.add(MenuBtn.topMenu_batchDelete());
|
||||
// 复制
|
||||
topMenuList.add(MenuBtn.topMenu_copy());
|
||||
btnDatas.put("topMenu", topMenuList);
|
||||
// 新增
|
||||
rightMenuList.add(MenuBtn.rightMenu_addNew());
|
||||
// 复制
|
||||
rightMenuList.add(MenuBtn.rightMenu_copy());
|
||||
// 日志
|
||||
rightMenuList.add(MenuBtn.rightMenu_btnLog());
|
||||
btnDatas.put("rightMenu", rightMenuList);
|
||||
return btnDatas;
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
return MenuBtn.getDatasHasCopy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -260,6 +251,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSaveForm() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -310,6 +302,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getJobBaseForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notNull(params.get("viewAttr"), "请标识操作类型");
|
||||
|
||||
// 2编辑 1查看
|
||||
|
|
@ -365,6 +358,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
@Override
|
||||
public int saveBaseForm(JobSearchParam params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
// 处理自动编号
|
||||
params.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, params.getJobNo()));
|
||||
List<JobPO> list = getJobMapper().listByNo(Util.null2String(params.getJobNo()));
|
||||
|
|
@ -387,6 +381,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
@Override
|
||||
public int updateForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
|
||||
String groupId = (String) params.get("viewCondition");
|
||||
JobPO jobPO = JobBO.convertParamsToPO(searchParam, user.getUID());
|
||||
|
|
@ -412,6 +407,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
@Override
|
||||
public int copyJobItem(String ids, String department) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notBlank(department, "请指定需要复制的部门");
|
||||
int insertCount = 0;
|
||||
List<Long> idList = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
|
|
@ -428,12 +424,14 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
@Override
|
||||
public int updateForbiddenTagById(JobSearchParam params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
JobPO jobPO = JobPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||
return getJobMapper().updateForbiddenTagById(jobPO.getId(), jobPO.getForbiddenTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
Collection<Long> deleteIds = new ArrayList<>();
|
||||
// 递归删除子节点
|
||||
|
|
@ -443,6 +441,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getHrmListByJobId(Long jobId) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationWeaTable<EmployeeTableVO> table = new OrganizationWeaTable<>(user, EmployeeTableVO.class);
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
|
|
@ -686,4 +685,13 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
getChildIds(childIds, deleteIds);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有该模块权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRight() {
|
||||
return HrmUserVarify.checkUserRight("Job:All", user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -47,6 +48,11 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("hasRight", hasRight());
|
||||
if (!hasRight()) {
|
||||
return resultMap;
|
||||
}
|
||||
// 刷新引用状态
|
||||
RefreshIsUsedUtil.RefreshLevel("jcl_org_level");
|
||||
OrganizationWeaTable<LevelTableVO> table = new OrganizationWeaTable<>(user, LevelTableVO.class);
|
||||
|
|
@ -55,12 +61,14 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
return result.getResultMap();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int saveLevel(LevelSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
List<LevelPO> list = getLevelMapper().listByNo(Util.null2String(param.getLevelNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
LevelPO levelPO = LevelDTO.convertParamToPO(param, (long) user.getUID());
|
||||
|
|
@ -69,18 +77,21 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
|
||||
@Override
|
||||
public int updateLevel(LevelSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
LevelPO levelPO = LevelDTO.convertParamToPO(param, (long) user.getUID());
|
||||
return getLevelMapper().updateLevel(levelPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateForbiddenTagById(LevelSearchParam params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
LevelPO levelPO = LevelPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||
return getLevelMapper().updateForbiddenTagById(levelPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
return getLevelMapper().deleteByIds(ids);
|
||||
}
|
||||
|
|
@ -88,6 +99,7 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -103,6 +115,7 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getLevelForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
|
|
@ -145,11 +158,13 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getTableBtn() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
return MenuBtn.getCommonBtnDatas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getTabInfo() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<TopTab> topTabs = new ArrayList<>();
|
||||
topTabs.add(TopTab.builder().color("#000000").groupId("flowAll").showcount(true).title("全部").viewCondition("-1").build());
|
||||
|
|
@ -190,4 +205,13 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
}
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有该模块权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRight() {
|
||||
return HrmUserVarify.checkUserRight("Level:All", user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -45,18 +46,25 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("hasRight", hasRight());
|
||||
if (!hasRight()) {
|
||||
return resultMap;
|
||||
}
|
||||
OrganizationWeaTable<PostInfoTableVO> table = new OrganizationWeaTable<>(user, PostInfoTableVO.class);
|
||||
String sqlWhere = buildSqlWhere(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
return result.getResultMap();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int savePostInfo(PostInfoSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
List<PostInfoPO> list = getPostInfoMapper().listByNo(Util.null2String(param.getPostInfoNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
PostInfoPO postInfoPO = PostInfoDTO.convertParamToPO(param, (long) user.getUID());
|
||||
|
|
@ -65,12 +73,14 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
|
|||
|
||||
@Override
|
||||
public int updatePostInfo(PostInfoSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
PostInfoPO postInfoPO = PostInfoDTO.convertParamToPO(param, (long) user.getUID());
|
||||
return getPostInfoMapper().updatePostInfo(postInfoPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateForbiddenTagById(PostInfoSearchParam params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
PostInfoPO postInfoPO = PostInfoPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||
return getPostInfoMapper().updateForbiddenTagById(postInfoPO);
|
||||
}
|
||||
|
|
@ -78,6 +88,7 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
|
|||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
return getPostInfoMapper().deleteByIds(ids);
|
||||
}
|
||||
|
|
@ -85,6 +96,7 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -100,6 +112,7 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getPostInfoForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
|
|
@ -157,6 +170,7 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
return MenuBtn.getCommonBtnDatas();
|
||||
}
|
||||
|
||||
|
|
@ -180,4 +194,13 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
|
|||
}
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有该模块权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRight() {
|
||||
return HrmUserVarify.checkUserRight("PostInfo:All", user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.engine.organization.util.OrganizationFormItemUtil;
|
|||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -30,24 +31,28 @@ public class PostServiceImpl extends Service implements PostService {
|
|||
|
||||
@Override
|
||||
public int savePost(PostPO postPO) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
List<PostPO> list = getPostMapper().listByNo(Util.null2String(postPO.getPostNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
return getPostMapper().insertIgnoreNull(PostDTO.convertPO(postPO,user.getUID()));
|
||||
return getPostMapper().insertIgnoreNull(PostDTO.convertPO(postPO, user.getUID()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePost(PostPO postPO) {
|
||||
return getPostMapper().updatePost(PostDTO.convertPO(postPO,user.getUID()));
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
return getPostMapper().updatePost(PostDTO.convertPO(postPO, user.getUID()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
return getPostMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getPostForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
|
|
@ -79,7 +84,17 @@ public class PostServiceImpl extends Service implements PostService {
|
|||
|
||||
@Override
|
||||
public TreeData getTreeData() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
ArrayList<TreeData> treeDataList = getPostMapper().getTreeData();
|
||||
return TreeData.builder().children(treeDataList).title("全部类型").key("-1").build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有该模块权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRight() {
|
||||
return HrmUserVarify.checkUserRight("Post:All", user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -38,6 +39,11 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("hasRight", hasRight());
|
||||
if (!hasRight()) {
|
||||
return resultMap;
|
||||
}
|
||||
// 刷新引用状态
|
||||
RefreshIsUsedUtil.RefreshScheme("jcl_org_scheme");
|
||||
OrganizationWeaTable<SchemeTableVO> table = new OrganizationWeaTable<>(user, SchemeTableVO.class);
|
||||
|
|
@ -46,11 +52,13 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
return result.getResultMap();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> save(SchemeSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apidatas = new HashMap<>(16);
|
||||
List<SchemePO> list = getSchemeMapper().listByNo(Util.null2String(param.getSchemeNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
|
|
@ -61,6 +69,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> updateScheme(SchemeSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apidatas = new HashMap<>();
|
||||
SchemePO schemePO = SchemeDTO.convertParamToPO(param, (long) user.getUID());
|
||||
getSchemeMapper().updateScheme(schemePO);
|
||||
|
|
@ -69,6 +78,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
|
||||
@Override
|
||||
public void updateForbiddenTagById(SchemeSearchParam params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
SchemePO schemePO = SchemePO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||
getSchemeMapper().updateForbiddenTagById(schemePO);
|
||||
}
|
||||
|
|
@ -76,6 +86,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
|
||||
@Override
|
||||
public void deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
getSchemeMapper().deleteByIds(ids);
|
||||
}
|
||||
|
|
@ -83,6 +94,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -98,6 +110,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSchemeForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
|
|
@ -130,6 +143,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getTableBtn() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
return MenuBtn.getCommonBtnDatas();
|
||||
}
|
||||
|
||||
|
|
@ -153,4 +167,13 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
return sqlWhere;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有该模块权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRight() {
|
||||
return HrmUserVarify.checkUserRight("Scheme:All", user);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -47,6 +48,11 @@ public class SequenceServiceImpl extends Service implements SequenceService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("hasRight", hasRight());
|
||||
if (!hasRight()) {
|
||||
return resultMap;
|
||||
}
|
||||
// 刷新引用状态
|
||||
RefreshIsUsedUtil.RefreshSequence("jcl_org_sequence");
|
||||
OrganizationWeaTable<SequenceTableVO> table = new OrganizationWeaTable<>(user, SequenceTableVO.class);
|
||||
|
|
@ -55,12 +61,14 @@ public class SequenceServiceImpl extends Service implements SequenceService {
|
|||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
return result.getResultMap();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int saveSequence(SequenceSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
List<SequencePO> list = getSequenceMapper().listByNo(Util.null2String(param.getSequenceNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
SequencePO sequencePO = SequenceDTO.convertParamToPO(param, (long) user.getUID());
|
||||
|
|
@ -69,18 +77,21 @@ public class SequenceServiceImpl extends Service implements SequenceService {
|
|||
|
||||
@Override
|
||||
public int updateSequence(SequenceSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
SequencePO sequencePO = SequenceDTO.convertParamToPO(param, (long) user.getUID());
|
||||
return getSequenceMapper().updateSequence(sequencePO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateForbiddenTagById(SequenceSearchParam params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
SequencePO sequencePO = SequencePO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||
return getSequenceMapper().updateForbiddenTagById(sequencePO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
return getSequenceMapper().deleteByIds(ids);
|
||||
}
|
||||
|
|
@ -88,6 +99,7 @@ public class SequenceServiceImpl extends Service implements SequenceService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -103,6 +115,7 @@ public class SequenceServiceImpl extends Service implements SequenceService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSequenceForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
|
|
@ -145,11 +158,13 @@ public class SequenceServiceImpl extends Service implements SequenceService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
return MenuBtn.getCommonBtnDatas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getTabInfo() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<TopTab> topTabs = new ArrayList<>();
|
||||
topTabs.add(TopTab.builder().color("#000000").groupId("flowAll").showcount(true).title("全部").viewCondition("-1").build());
|
||||
|
|
@ -190,4 +205,13 @@ public class SequenceServiceImpl extends Service implements SequenceService {
|
|||
}
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有该模块权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRight() {
|
||||
return HrmUserVarify.checkUserRight("Sequence:All", user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -46,6 +47,11 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(StaffPlanSearchParam params) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("hasRight", hasRight());
|
||||
if (!hasRight()) {
|
||||
return resultMap;
|
||||
}
|
||||
// 刷新引用状态
|
||||
RefreshIsUsedUtil.RefreshStaffPlan("jcl_org_staffplan");
|
||||
OrganizationWeaTable<StaffPlanTableVO> table = new OrganizationWeaTable<>(user, StaffPlanTableVO.class);
|
||||
|
|
@ -55,11 +61,13 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
return result.getResultMap();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveStaffPlan(StaffPlanSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
List<StaffPlanPO> list = getStaffPlanMapper().listByNo(Util.null2String(param.getPlanNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID());
|
||||
|
|
@ -68,24 +76,28 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
|
||||
@Override
|
||||
public int updateStaffPlan(StaffPlanSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID());
|
||||
return getStaffPlanMapper().updateStaffPlan(staffPlanPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateForbiddenTagById(StaffPlanSearchParam params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
StaffPlanPO staffPlanPO = StaffPlanPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||
return getStaffPlanMapper().updateForbiddenTagById(staffPlanPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
return getStaffPlanMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -128,6 +140,7 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
|
|
@ -189,6 +202,7 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
return MenuBtn.getCommonBtnDatas();
|
||||
}
|
||||
|
||||
|
|
@ -237,4 +251,13 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
}
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有该模块权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRight() {
|
||||
return HrmUserVarify.checkUserRight("StaffPlan:All", user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -61,6 +62,11 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(StaffSearchParam params) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("hasRight", hasRight());
|
||||
if (!hasRight()) {
|
||||
return resultMap;
|
||||
}
|
||||
// 刷新引用状态
|
||||
RefreshIsUsedUtil.RefreshStaff("jcl_org_staff");
|
||||
OrganizationWeaTable<StaffTableVO> table = new OrganizationWeaTable<>(user, StaffTableVO.class);
|
||||
|
|
@ -70,17 +76,20 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
return result.getResultMap();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveStaff(StaffSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
StaffPO staffPO = StaffBO.convertParamToPO(param, (long) user.getUID());
|
||||
return getStaffMapper().insertIgnoreNull(staffPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateStaff(StaffSearchParam param) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
StaffPO staffPlanPO = StaffBO.convertParamToPO(param, (long) user.getUID());
|
||||
return getStaffMapper().updateStaff(staffPlanPO);
|
||||
}
|
||||
|
|
@ -88,12 +97,14 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
return getStaffMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
|
@ -144,6 +155,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getForm(Map<String, Object> params) {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
|
|
@ -217,6 +229,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
OrganizationAssert.isTrue(hasRight(), "暂无权限");
|
||||
return MenuBtn.getCommonBtnDatas();
|
||||
}
|
||||
|
||||
|
|
@ -277,4 +290,13 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有该模块权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRight() {
|
||||
return HrmUserVarify.checkUserRight("StaffPlan:All", user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,5 +136,30 @@ public class MenuBtn {
|
|||
return btnDatas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取常用按钮列表
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, Object> getDatasHasCopy() {
|
||||
Map<String, Object> btnDatas = new HashMap<>();
|
||||
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
|
||||
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
|
||||
// 新增
|
||||
topMenuList.add(MenuBtn.topMenu_addNew());
|
||||
// 批量删除
|
||||
topMenuList.add(MenuBtn.topMenu_batchDelete());
|
||||
// 复制
|
||||
topMenuList.add(MenuBtn.topMenu_copy());
|
||||
btnDatas.put("topMenu", topMenuList);
|
||||
// 新增
|
||||
rightMenuList.add(MenuBtn.rightMenu_addNew());
|
||||
// 复制
|
||||
rightMenuList.add(MenuBtn.rightMenu_copy());
|
||||
// 日志
|
||||
rightMenuList.add(MenuBtn.rightMenu_btnLog());
|
||||
btnDatas.put("rightMenu", rightMenuList);
|
||||
return btnDatas;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue