分包商模版配置和待审核通知功能开发
This commit is contained in:
parent
10e9cc1310
commit
335e9c4621
|
|
@ -38,4 +38,6 @@ public class SetTemplateBean {
|
||||||
private String standard;
|
private String standard;
|
||||||
private String dutyDept;
|
private String dutyDept;
|
||||||
private String isUse;
|
private String isUse;
|
||||||
|
private Integer isEnable;
|
||||||
|
private Integer configId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import com.bonus.gs.sub.evaluate.manager.model.SysUser;
|
||||||
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes;
|
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes;
|
||||||
import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst;
|
import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst;
|
||||||
import com.bonus.gs.sub.evaluate.manager.utils.UserUtil;
|
import com.bonus.gs.sub.evaluate.manager.utils.UserUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.time.DateUtils;
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,7 @@ import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -45,6 +42,22 @@ public class SetTemplateController {
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "changeEnable", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxRes changeEnable(SetTemplateBean o){
|
||||||
|
AjaxRes ar = new AjaxRes();
|
||||||
|
Integer i = service.changeEnable(o);
|
||||||
|
if (i > 0){
|
||||||
|
ar.setRes(GlobalConst.SUCCEED);
|
||||||
|
ar.setResMsg("启用成功");
|
||||||
|
return ar;
|
||||||
|
}else {
|
||||||
|
ar.setRes(GlobalConst.FAIL);
|
||||||
|
ar.setFailMsg("启用失败");
|
||||||
|
return ar;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping("deleteTemplateById")
|
@RequestMapping("deleteTemplateById")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes deleteTemplateById(String id) {
|
public AjaxRes deleteTemplateById(String id) {
|
||||||
|
|
|
||||||
|
|
@ -63,4 +63,8 @@ public interface SetTemplateDao {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SetTemplateBean> getResponsibleDepartmentSelect(SetTemplateBean bean);
|
List<SetTemplateBean> getResponsibleDepartmentSelect(SetTemplateBean bean);
|
||||||
|
|
||||||
|
Integer changeEnable(SetTemplateBean o);
|
||||||
|
|
||||||
|
void setTemplatePass();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,4 +25,6 @@ public interface SetTemplateService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxRes addTemplate(SetTemplateBean o);
|
AjaxRes addTemplate(SetTemplateBean o);
|
||||||
|
|
||||||
|
Integer changeEnable(SetTemplateBean o);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,14 @@ public class SetTemplateServiceImpl implements SetTemplateService {
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer changeEnable(SetTemplateBean o) {
|
||||||
|
// 先全部改为未启用状态
|
||||||
|
dao.setTemplatePass();
|
||||||
|
// 再把当前模板改成启用
|
||||||
|
return dao.changeEnable(o);
|
||||||
|
}
|
||||||
|
|
||||||
public static List<SetTemplateBean> convertJsonToBeans(String jsonString) {
|
public static List<SetTemplateBean> convertJsonToBeans(String jsonString) {
|
||||||
JSONArray jsonArray = JSONArray.parseArray(jsonString);
|
JSONArray jsonArray = JSONArray.parseArray(jsonString);
|
||||||
List<SetTemplateBean> templateBeans = new ArrayList<>();
|
List<SetTemplateBean> templateBeans = new ArrayList<>();
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,22 @@
|
||||||
package com.bonus.gs.sub.evaluate.manager.controller;
|
package com.bonus.gs.sub.evaluate.manager.controller;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.bonus.gs.sub.evaluate.evaluate.beans.OutSourceBean;
|
||||||
|
import com.bonus.gs.sub.evaluate.evaluate.beans.TeamEvaluateBean;
|
||||||
|
import com.bonus.gs.sub.evaluate.evaluate.dao.OutsourcerEvaluateDao;
|
||||||
|
import com.bonus.gs.sub.evaluate.evaluate.service.OutsourcerEvaluateService;
|
||||||
|
import com.bonus.gs.sub.evaluate.evaluate.service.TeamEvaluateService;
|
||||||
import com.bonus.gs.sub.evaluate.manager.annotation.LogAnnotation;
|
import com.bonus.gs.sub.evaluate.manager.annotation.LogAnnotation;
|
||||||
import com.bonus.gs.sub.evaluate.manager.dao.PermissionDao;
|
import com.bonus.gs.sub.evaluate.manager.dao.PermissionDao;
|
||||||
import com.bonus.gs.sub.evaluate.manager.entity.LoginUser;
|
import com.bonus.gs.sub.evaluate.manager.entity.LoginUser;
|
||||||
import com.bonus.gs.sub.evaluate.manager.model.Permission;
|
import com.bonus.gs.sub.evaluate.manager.model.Permission;
|
||||||
import com.bonus.gs.sub.evaluate.manager.service.PermissionService;
|
import com.bonus.gs.sub.evaluate.manager.service.PermissionService;
|
||||||
|
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes;
|
||||||
|
import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst;
|
||||||
import com.bonus.gs.sub.evaluate.manager.utils.UserUtil;
|
import com.bonus.gs.sub.evaluate.manager.utils.UserUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
@ -31,56 +37,127 @@ import com.google.common.collect.Lists;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限相关接口
|
* 权限相关接口
|
||||||
*/
|
*/
|
||||||
@Api(tags = "权限")
|
@Api(tags = "权限")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/permissions")
|
@RequestMapping("/permissions")
|
||||||
|
@Slf4j
|
||||||
public class PermissionController {
|
public class PermissionController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PermissionDao permissionDao;
|
private PermissionDao permissionDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private PermissionService permissionService;
|
private PermissionService permissionService;
|
||||||
|
@Resource
|
||||||
|
private OutsourcerEvaluateService outsourcerEvaluateService;
|
||||||
|
@Resource
|
||||||
|
private OutsourcerEvaluateDao outsourcerEvaluateDao;
|
||||||
|
|
||||||
@ApiOperation(value = "当前登录用户拥有的权限")
|
@Autowired
|
||||||
@GetMapping("/current")
|
private TeamEvaluateService service;
|
||||||
public List<Permission> permissionsCurrent() {
|
|
||||||
LoginUser loginUser = UserUtil.getLoginUser();
|
@ApiOperation(value = "当前登录用户拥有的权限")
|
||||||
List<Permission> list = loginUser.getPermissions();
|
@GetMapping("/current")
|
||||||
final List<Permission> permissions = list.stream().filter(l -> l.getType().equals(1))
|
public List<Permission> permissionsCurrent() {
|
||||||
.collect(Collectors.toList());
|
LoginUser loginUser = UserUtil.getLoginUser();
|
||||||
|
List<Permission> list = loginUser.getPermissions();
|
||||||
|
final List<Permission> permissions = list.stream().filter(l -> l.getType().equals(1))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
// setChild(permissions);
|
// setChild(permissions);
|
||||||
//
|
//
|
||||||
// return permissions.stream().filter(p -> p.getParentId().equals(0L)).collect(Collectors.toList());
|
// return permissions.stream().filter(p -> p.getParentId().equals(0L)).collect(Collectors.toList());
|
||||||
// 2018.06.09 支持多级菜单
|
// 2018.06.09 支持多级菜单
|
||||||
List<Permission> firstLevel = permissions.stream().filter(p -> p.getParentId().equals(0L)).collect(Collectors.toList());
|
List<Permission> firstLevel = permissions.stream().filter(p -> p.getParentId().equals(0L)).collect(Collectors.toList());
|
||||||
firstLevel.parallelStream().forEach(p -> {
|
firstLevel.parallelStream().forEach(p -> {
|
||||||
setChild(p, permissions);
|
setChild(p, permissions);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
List<OutSourceBean> outSourceBeans = checkExamine(new OutSourceBean());
|
||||||
|
List<TeamEvaluateBean> teamEvaluateBeans = TeamEvaluateBean(new TeamEvaluateBean());
|
||||||
|
for (Permission permission : firstLevel) {
|
||||||
|
permission.getChild().forEach(c -> {
|
||||||
|
if (c.getHref().equals("pages/evaluate/outsourceAudit/outsourceAuditList.html")) {
|
||||||
|
for (OutSourceBean outSourceBean : outSourceBeans) {
|
||||||
|
if ((Integer.parseInt(outSourceBean.getEvaluateNum())) > 0 && (Integer.parseInt(outSourceBean.getIsApprove())) == 0){
|
||||||
|
c.setIsCheckWBS(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (c.getHref().equals("pages/evaluate/team/evaluateCheckList.html")) {
|
||||||
|
for (TeamEvaluateBean teamEvaluateBean : teamEvaluateBeans) {
|
||||||
|
if ("5".equals(loginUser.getRoleId()) ||
|
||||||
|
Arrays.asList(loginUser.getRoleId().split(",")).contains("5")) {
|
||||||
|
if ("1".equals(teamEvaluateBean.getStatus())) {
|
||||||
|
if ("待审核".equals(teamEvaluateBean.getCheckStatus())) {
|
||||||
|
c.setIsCheckBZ(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ("6".equals(loginUser.getRoleId()) ||
|
||||||
|
Arrays.asList(loginUser.getRoleId().split(",")).contains("6")) {
|
||||||
|
if (!"1".equals(teamEvaluateBean.getStatus())) {
|
||||||
|
if ("待审核".equals(teamEvaluateBean.getCheckStatus())) {
|
||||||
|
c.setIsCheckBZ(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
return firstLevel;
|
return firstLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private List<OutSourceBean> checkExamine(OutSourceBean o) {
|
||||||
* 设置子元素
|
try {
|
||||||
* 2018.06.09
|
o.setDeptId(UserUtil.getLoginUser().getDeptId());
|
||||||
*
|
String isBusinessDivision = outsourcerEvaluateDao.getIsBusinessDivision(o.getDeptId());
|
||||||
* @param p
|
if (!org.apache.commons.lang3.StringUtils.isBlank(isBusinessDivision) && "1".equals(isBusinessDivision)) {
|
||||||
* @param permissions
|
o.setIsBusinessDivision("1");
|
||||||
*/
|
} else {
|
||||||
private void setChild(Permission p, List<Permission> permissions) {
|
o.setIsBusinessDivision("0");
|
||||||
List<Permission> child = permissions.parallelStream().filter(a -> a.getParentId().equals(p.getId())).collect(Collectors.toList());
|
}
|
||||||
p.setChild(child);
|
List<OutSourceBean> list = outsourcerEvaluateService.getEvaluateAuditList(o);
|
||||||
if (!CollectionUtils.isEmpty(child)) {
|
return list;
|
||||||
child.parallelStream().forEach(c -> {
|
} catch (Exception e) {
|
||||||
//递归设置子元素,多级菜单支持
|
log.error(e.toString(), e);
|
||||||
setChild(c, permissions);
|
}
|
||||||
});
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
}
|
private List<TeamEvaluateBean> TeamEvaluateBean(TeamEvaluateBean o) {
|
||||||
|
List<TeamEvaluateBean> list = service.getTeamEvaluateList(o);
|
||||||
|
for (TeamEvaluateBean bean : list) {
|
||||||
|
String sendPhone = bean.getSendPhone();
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isBlank(sendPhone)) {
|
||||||
|
String sendPhone2 = service.getSendPhone(bean);
|
||||||
|
bean.setSendPhone(sendPhone2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置子元素
|
||||||
|
* 2018.06.09
|
||||||
|
*
|
||||||
|
* @param p
|
||||||
|
* @param permissions
|
||||||
|
*/
|
||||||
|
private void setChild(Permission p, List<Permission> permissions) {
|
||||||
|
List<Permission> child = permissions.parallelStream().filter(a -> a.getParentId().equals(p.getId())).collect(Collectors.toList());
|
||||||
|
p.setChild(child);
|
||||||
|
if (!CollectionUtils.isEmpty(child)) {
|
||||||
|
child.parallelStream().forEach(c -> {
|
||||||
|
//递归设置子元素,多级菜单支持
|
||||||
|
setChild(c, permissions);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// private void setChild(List<Permission> permissions) {
|
// private void setChild(List<Permission> permissions) {
|
||||||
// permissions.parallelStream().forEach(per -> {
|
// permissions.parallelStream().forEach(per -> {
|
||||||
|
|
@ -90,131 +167,131 @@ public class PermissionController {
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单列表
|
* 菜单列表
|
||||||
*
|
*
|
||||||
* @param pId
|
* @param pId
|
||||||
* @param permissionsAll
|
* @param permissionsAll
|
||||||
* @param list
|
* @param list
|
||||||
*/
|
*/
|
||||||
private void setPermissionsList(Long pId, List<Permission> permissionsAll, List<Permission> list) {
|
private void setPermissionsList(Long pId, List<Permission> permissionsAll, List<Permission> list) {
|
||||||
for (Permission per : permissionsAll) {
|
for (Permission per : permissionsAll) {
|
||||||
if (per.getParentId().equals(pId)) {
|
if (per.getParentId().equals(pId)) {
|
||||||
list.add(per);
|
list.add(per);
|
||||||
if (permissionsAll.stream().filter(p -> p.getParentId().equals(per.getId())).findAny() != null) {
|
if (permissionsAll.stream().filter(p -> p.getParentId().equals(per.getId())).findAny() != null) {
|
||||||
setPermissionsList(per.getId(), permissionsAll, list);
|
setPermissionsList(per.getId(), permissionsAll, list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@ApiOperation(value = "菜单列表")
|
@ApiOperation(value = "菜单列表")
|
||||||
@PreAuthorize("hasAuthority('sys:menu:query')")
|
@PreAuthorize("hasAuthority('sys:menu:query')")
|
||||||
public List<Permission> permissionsList() {
|
public List<Permission> permissionsList() {
|
||||||
List<Permission> permissionsAll = permissionDao.listAll();
|
List<Permission> permissionsAll = permissionDao.listAll();
|
||||||
|
|
||||||
List<Permission> list = Lists.newArrayList();
|
List<Permission> list = Lists.newArrayList();
|
||||||
setPermissionsList(0L, permissionsAll, list);
|
setPermissionsList(0L, permissionsAll, list);
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
@ApiOperation(value = "所有菜单")
|
@ApiOperation(value = "所有菜单")
|
||||||
@PreAuthorize("hasAuthority('sys:menu:query')")
|
@PreAuthorize("hasAuthority('sys:menu:query')")
|
||||||
public JSONArray permissionsAll() {
|
public JSONArray permissionsAll() {
|
||||||
List<Permission> permissionsAll = permissionDao.listAll();
|
List<Permission> permissionsAll = permissionDao.listAll();
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
setPermissionsTree(0L, permissionsAll, array);
|
setPermissionsTree(0L, permissionsAll, array);
|
||||||
|
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/parents")
|
@GetMapping("/parents")
|
||||||
@ApiOperation(value = "一级菜单")
|
@ApiOperation(value = "一级菜单")
|
||||||
@PreAuthorize("hasAuthority('sys:menu:query')")
|
@PreAuthorize("hasAuthority('sys:menu:query')")
|
||||||
public List<Permission> parentMenu() {
|
public List<Permission> parentMenu() {
|
||||||
List<Permission> parents = permissionDao.listParents();
|
List<Permission> parents = permissionDao.listParents();
|
||||||
|
|
||||||
return parents;
|
return parents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单树
|
* 菜单树
|
||||||
*
|
*
|
||||||
* @param pId
|
* @param pId
|
||||||
* @param permissionsAll
|
* @param permissionsAll
|
||||||
* @param array
|
* @param array
|
||||||
*/
|
*/
|
||||||
private void setPermissionsTree(Long pId, List<Permission> permissionsAll, JSONArray array) {
|
private void setPermissionsTree(Long pId, List<Permission> permissionsAll, JSONArray array) {
|
||||||
for (Permission per : permissionsAll) {
|
for (Permission per : permissionsAll) {
|
||||||
if (per.getParentId().equals(pId)) {
|
if (per.getParentId().equals(pId)) {
|
||||||
String string = JSONObject.toJSONString(per);
|
String string = JSONObject.toJSONString(per);
|
||||||
JSONObject parent = (JSONObject) JSONObject.parse(string);
|
JSONObject parent = (JSONObject) JSONObject.parse(string);
|
||||||
array.add(parent);
|
array.add(parent);
|
||||||
|
|
||||||
if (permissionsAll.stream().filter(p -> p.getParentId().equals(per.getId())).findAny() != null) {
|
if (permissionsAll.stream().filter(p -> p.getParentId().equals(per.getId())).findAny() != null) {
|
||||||
JSONArray child = new JSONArray();
|
JSONArray child = new JSONArray();
|
||||||
parent.put("child", child);
|
parent.put("child", child);
|
||||||
setPermissionsTree(per.getId(), permissionsAll, child);
|
setPermissionsTree(per.getId(), permissionsAll, child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(params = "roleId")
|
@GetMapping(params = "roleId")
|
||||||
@ApiOperation(value = "根据角色id获取权限")
|
@ApiOperation(value = "根据角色id获取权限")
|
||||||
@PreAuthorize("hasAnyAuthority('sys:menu:query','sys:role:query')")
|
@PreAuthorize("hasAnyAuthority('sys:menu:query','sys:role:query')")
|
||||||
public List<Permission> listByRoleId(Long roleId) {
|
public List<Permission> listByRoleId(Long roleId) {
|
||||||
return permissionDao.listByRoleId(roleId);
|
return permissionDao.listByRoleId(roleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@LogAnnotation
|
@LogAnnotation
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ApiOperation(value = "保存菜单")
|
@ApiOperation(value = "保存菜单")
|
||||||
@PreAuthorize("hasAuthority('sys:menu:add')")
|
@PreAuthorize("hasAuthority('sys:menu:add')")
|
||||||
public void save(@RequestBody Permission permission) {
|
public void save(@RequestBody Permission permission) {
|
||||||
permissionDao.save(permission);
|
permissionDao.save(permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
@ApiOperation(value = "根据菜单id获取菜单")
|
@ApiOperation(value = "根据菜单id获取菜单")
|
||||||
@PreAuthorize("hasAuthority('sys:menu:query')")
|
@PreAuthorize("hasAuthority('sys:menu:query')")
|
||||||
public Permission get(@PathVariable Long id) {
|
public Permission get(@PathVariable Long id) {
|
||||||
return permissionDao.getById(id);
|
return permissionDao.getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@LogAnnotation
|
@LogAnnotation
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@ApiOperation(value = "修改菜单")
|
@ApiOperation(value = "修改菜单")
|
||||||
@PreAuthorize("hasAuthority('sys:menu:add')")
|
@PreAuthorize("hasAuthority('sys:menu:add')")
|
||||||
public void update(@RequestBody Permission permission) {
|
public void update(@RequestBody Permission permission) {
|
||||||
permissionService.update(permission);
|
permissionService.update(permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验权限
|
* 校验权限
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/owns")
|
@GetMapping("/owns")
|
||||||
@ApiOperation(value = "校验当前用户的权限")
|
@ApiOperation(value = "校验当前用户的权限")
|
||||||
public Set<String> ownsPermission() {
|
public Set<String> ownsPermission() {
|
||||||
List<Permission> permissions = UserUtil.getLoginUser().getPermissions();
|
List<Permission> permissions = UserUtil.getLoginUser().getPermissions();
|
||||||
if (CollectionUtils.isEmpty(permissions)) {
|
if (CollectionUtils.isEmpty(permissions)) {
|
||||||
return Collections.emptySet();
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
return permissions.parallelStream().filter(p -> !StringUtils.isEmpty(p.getPermission()))
|
return permissions.parallelStream().filter(p -> !StringUtils.isEmpty(p.getPermission()))
|
||||||
.map(Permission::getPermission).collect(Collectors.toSet());
|
.map(Permission::getPermission).collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
@LogAnnotation
|
@LogAnnotation
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
@ApiOperation(value = "删除菜单")
|
@ApiOperation(value = "删除菜单")
|
||||||
@PreAuthorize("hasAuthority('sys:menu:del')")
|
@PreAuthorize("hasAuthority('sys:menu:del')")
|
||||||
public void delete(@PathVariable Long id) {
|
public void delete(@PathVariable Long id) {
|
||||||
permissionService.delete(id);
|
permissionService.delete(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,26 @@ public class Permission extends BaseEntity<Long> {
|
||||||
private String permission;
|
private String permission;
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
|
private Integer isCheckBZ;
|
||||||
|
|
||||||
|
public Integer getIsCheckBZ() {
|
||||||
|
return isCheckBZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsCheckBZ(Integer isCheckBZ) {
|
||||||
|
this.isCheckBZ = isCheckBZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getIsCheckWBS() {
|
||||||
|
return isCheckWBS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsCheckWBS(Integer isCheckWBS) {
|
||||||
|
this.isCheckWBS = isCheckWBS;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Integer isCheckWBS;
|
||||||
|
|
||||||
private List<Permission> child;
|
private List<Permission> child;
|
||||||
|
|
||||||
public Long getParentId() {
|
public Long getParentId() {
|
||||||
|
|
|
||||||
|
|
@ -1345,6 +1345,9 @@
|
||||||
</w:rPr>
|
</w:rPr>
|
||||||
<w:jc w:val="right"/>
|
<w:jc w:val="right"/>
|
||||||
</w:pPr>
|
</w:pPr>
|
||||||
|
<w:r>
|
||||||
|
<w:br/> <w:br/> <w:br/>
|
||||||
|
</w:r>
|
||||||
<w:r>
|
<w:r>
|
||||||
<w:rPr>
|
<w:rPr>
|
||||||
<w:rFonts w:hint="eastAsia" w:ascii="仿宋" w:hAnsi="仿宋" w:eastAsia="仿宋"
|
<w:rFonts w:hint="eastAsia" w:ascii="仿宋" w:hAnsi="仿宋" w:eastAsia="仿宋"
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,16 @@
|
||||||
version = version + 1
|
version = version + 1
|
||||||
where config_id = #{id}
|
where config_id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="setTemplatePass">
|
||||||
|
update pj_template_config
|
||||||
|
set is_enable = 1
|
||||||
|
where is_active = '1'
|
||||||
|
</update>
|
||||||
|
<update id="changeEnable">
|
||||||
|
update pj_template_config
|
||||||
|
set is_enable = 0
|
||||||
|
where config_id = #{configId}
|
||||||
|
</update>
|
||||||
<delete id="deleteTemplateById">
|
<delete id="deleteTemplateById">
|
||||||
update pj_template_config set is_active = '0' where config_id = #{id}
|
update pj_template_config set is_active = '0' where config_id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
@ -36,6 +46,7 @@
|
||||||
ptc.create_time as createTime,
|
ptc.create_time as createTime,
|
||||||
ptc.version as version,
|
ptc.version as version,
|
||||||
ptc.json as jsonTxt,
|
ptc.json as jsonTxt,
|
||||||
|
ptc.is_enable as isEnable,
|
||||||
ifnull(per.evaluate_id, 0) as isUse
|
ifnull(per.evaluate_id, 0) as isUse
|
||||||
FROM
|
FROM
|
||||||
pj_template_config ptc
|
pj_template_config ptc
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
config_name as name,
|
config_name as name,
|
||||||
version as version
|
version as version
|
||||||
from pj_template_config
|
from pj_template_config
|
||||||
where is_active = 1
|
where is_active = 1 and is_enable = 0
|
||||||
</select>
|
</select>
|
||||||
<select id="getOrgTree" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.NodeBean">
|
<select id="getOrgTree" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.NodeBean">
|
||||||
SELECT id,
|
SELECT id,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue