3-16
This commit is contained in:
+94
@@ -0,0 +1,94 @@
|
||||
package com.adc.da.slrs.sarBussStandData.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarBussStandData.service.ISarBussStandDataService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.sarBussStandData.entity.SarBussStandData;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-16
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|SarBussStandData|")
|
||||
@RequestMapping("/${restPath}/sarBussStandData/sar-buss-stand-data")
|
||||
public class SarBussStandDataController extends BaseController<SarBussStandData> {
|
||||
|
||||
@Autowired
|
||||
ISarBussStandDataService iSarBussStandDataService;
|
||||
|
||||
@ApiOperation("角色与菜单关联控制右侧数据列表")
|
||||
@PostMapping("/saveBatch")
|
||||
public ResponseMessage<Object> disable(SarBussStandData sarBussStandData){
|
||||
//上来就给他 清了 能满足清空 修改 新增
|
||||
if (StringUtils.isNotBlank(sarBussStandData.getBussStandId())){
|
||||
List<String> menus=new ArrayList<>();
|
||||
if (sarBussStandData.getBussStandId().contains(",")){
|
||||
menus.addAll(new ArrayList<>(Arrays.asList(sarBussStandData.getBussStandId().split(","))));
|
||||
}else {
|
||||
menus.add(sarBussStandData.getBussStandId());
|
||||
}
|
||||
List<SarBussStandData> res=new ArrayList<>();
|
||||
menus.forEach(s -> {
|
||||
SarBussStandData sarBussStandData1=new SarBussStandData();
|
||||
sarBussStandData1.setId(String.valueOf(UUID.randomUUID()));
|
||||
sarBussStandData1.setValidFlag("0");
|
||||
sarBussStandData1.setBussStandId(s);
|
||||
sarBussStandData1.setMenuId(sarBussStandData.getMenuId());
|
||||
res.add(sarBussStandData1);
|
||||
});
|
||||
iSarBussStandDataService.saveBatch(res);
|
||||
return Result.success();
|
||||
}else {
|
||||
return Result.error("请选择菜单");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("角色与菜单关联控制右侧数据列表")
|
||||
@PostMapping("/removeBatch")
|
||||
public ResponseMessage<Object> removeBatch(String ids){
|
||||
List<String> removeIds=new ArrayList<>();
|
||||
if (ids.contains(",")){
|
||||
removeIds.addAll(new ArrayList<>(Arrays.asList(ids.split(","))));
|
||||
}else {
|
||||
removeIds.add(ids);
|
||||
}
|
||||
QueryWrapper<SarBussStandData> wrapper=new QueryWrapper<>();
|
||||
wrapper.in("ID",ids);
|
||||
return Result.success(iSarBussStandDataService.remove(wrapper));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询与角色绑定的菜单--支持多个角色查询")
|
||||
@GetMapping("/list")
|
||||
public ResponseMessage<Object> list(String menuIds){
|
||||
//判断disableFlag是否填入正确
|
||||
List<String> list=new ArrayList<>();
|
||||
if (menuIds.contains(",")){
|
||||
list.addAll(new ArrayList<>(Arrays.asList(menuIds.split(","))));
|
||||
}else {
|
||||
list.add(menuIds);
|
||||
}
|
||||
QueryWrapper<SarBussStandData> wrapper=new QueryWrapper<>();
|
||||
wrapper.in("MENU_ID",list);
|
||||
return Result.success(iSarBussStandDataService.list(wrapper));
|
||||
}
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarBussStandData.dao;
|
||||
|
||||
import com.adc.da.slrs.sarBussStandData.entity.SarBussStandData;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-16
|
||||
*/
|
||||
public interface SarBussStandDataDao extends BaseMapper<SarBussStandData> {
|
||||
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.adc.da.slrs.sarBussStandData.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarBussStandData对象", description="")
|
||||
public class SarBussStandData extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "标准id")
|
||||
@TableField("BUSS_STAND_ID")
|
||||
private String bussStandId;
|
||||
|
||||
@ApiModelProperty(value = "菜单id")
|
||||
@TableField("MENU_ID")
|
||||
private String menuId;
|
||||
|
||||
@ApiModelProperty(value = "删除标志")
|
||||
@TableField("VALID_FLAG")
|
||||
private String validFlag;
|
||||
|
||||
@ApiModelProperty(value = "菜单id")
|
||||
@TableField(exist = false)
|
||||
private String menuIds;
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarBussStandData.service;
|
||||
|
||||
import com.adc.da.slrs.sarBussStandData.entity.SarBussStandData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-16
|
||||
*/
|
||||
public interface ISarBussStandDataService extends IService<SarBussStandData> {
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarBussStandData.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarBussStandData.entity.SarBussStandData;
|
||||
import com.adc.da.slrs.sarBussStandData.dao.SarBussStandDataDao;
|
||||
import com.adc.da.slrs.sarBussStandData.service.ISarBussStandDataService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-16
|
||||
*/
|
||||
@Service
|
||||
public class SarBussStandDataServiceImpl extends ServiceImpl<SarBussStandDataDao, SarBussStandData> implements ISarBussStandDataService {
|
||||
|
||||
}
|
||||
+32
-6
@@ -1027,12 +1027,38 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Integer rowCount = this.baseMapper.getBussionessStandInfoCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<SarBussionessStand> sarlist = this.baseMapper.getBussionessStandInfoPage(page);
|
||||
attrInfoCollect(sarlist);
|
||||
return sarlist;
|
||||
//配置列表显示的数据权限
|
||||
if ("1".equals(page.getIsKU())) {
|
||||
List<SarBussionessStand> sarlist = new ArrayList<>();
|
||||
List<String> access = tsUserService.getResourceDataUserId(page.getUserId());
|
||||
if (null == page.getMenuId() && null == page.getMenuAllChildrenIdList()) {
|
||||
page.setMenuAllChildrenIdList(access);
|
||||
page.setMenuId("");
|
||||
} else if (page.getMenuId().equals("3")) {
|
||||
page.setMenuAllChildrenIdList(access);
|
||||
}
|
||||
List<String> finalData = page.getMenuAllChildrenIdList().stream().filter(s -> access.contains(s)).collect(Collectors.toList());
|
||||
if (finalData.size() > 0) {
|
||||
page.setMenuAllChildrenIdList(finalData);
|
||||
if (null == page.getMenuId() && null == page.getMenuAllChildrenIdList()) {
|
||||
page.setMenuAllChildrenIdList(access);
|
||||
}
|
||||
Integer rowCount = this.baseMapper.getBussionessStandInfoCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
sarlist = this.baseMapper.getBussionessStandInfoPage(page);
|
||||
attrInfoCollect(sarlist);
|
||||
return sarlist;
|
||||
} else {
|
||||
page.getPager().setRowCount(0);
|
||||
return sarlist;
|
||||
}
|
||||
}else {
|
||||
Integer rowCount = this.baseMapper.getBussionessStandInfoCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<SarBussionessStand> sarlist = this.baseMapper.getBussionessStandInfoPage(page);
|
||||
attrInfoCollect(sarlist);
|
||||
return sarlist;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.adc.da.slrs.sarMenuStandard.controller;
|
||||
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.SarMenuStandardNew;
|
||||
import com.adc.da.slrs.sarMenuStandard.service.ISarMenuStandardNewService;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.sys.sarMenuStandard.entity.SarMenuStandard;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-07-07
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "福田标准法规--标准法规库-菜单标准体系")
|
||||
@RequestMapping("/${restPath}/lawss/sarMenuStandardLimit")
|
||||
public class SarMenuStandardNewController extends BaseController<SarMenuStandardNew> {
|
||||
|
||||
@Autowired
|
||||
private ISarMenuStandardNewService iSarMenuStandardNewService;
|
||||
|
||||
@Autowired
|
||||
private ITsUserService tsUserService;
|
||||
|
||||
@ApiOperation("查询有权限资源")
|
||||
@GetMapping("/getListStandLimit")
|
||||
public ResponseMessage<List<SarMenuStandard>> getListStandLimit(SarMenuStandardNew sarMenuStandardNew){
|
||||
List<String> access = tsUserService.getResourceUserId(LoginUserUtil.getUserId());
|
||||
List<SarMenuStandard> tsResources= iSarMenuStandardNewService.getListStandLimit(sarMenuStandardNew,access);
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarMenuStandard.dao;
|
||||
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.SarMenuStandardNew;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-07-07
|
||||
*/
|
||||
public interface SarMenuStandardNewDao extends BaseMapper<SarMenuStandardNew> {
|
||||
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
package com.adc.da.slrs.sarMenuStandard.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.adc.da.sys.utils.treetool.annotation.TreeNodeId;
|
||||
import com.adc.da.sys.utils.treetool.annotation.TreeNodeName;
|
||||
import com.adc.da.sys.utils.treetool.annotation.TreeNodeParentId;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-07-07
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarMenuStandard对象", description="")
|
||||
public class SarMenuStandardNew extends BaseEntity {
|
||||
public interface update{
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TreeNodeId
|
||||
@NotNull(message = "id不能为空",groups = {update.class})
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "ID",type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "标准法规划分")
|
||||
@TableField("SOR_DIVIDE")
|
||||
private String sorDivide;
|
||||
|
||||
@TreeNodeName
|
||||
@ApiModelProperty(value = "目录名称")
|
||||
@TableField("MENU_NAME")
|
||||
private String menuName;
|
||||
|
||||
@TreeNodeParentId
|
||||
@ApiModelProperty(value = "父级ID")
|
||||
@TableField("PARENT_ID")
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty(value = "父级ID集合")
|
||||
@TableField("PARENT_IDS")
|
||||
private String parentIds;
|
||||
|
||||
@ApiModelProperty(value = "排序序号")
|
||||
@TableField("DISPLAY_SEQ")
|
||||
private Integer displaySeq;
|
||||
|
||||
@ApiModelProperty(value = "路径")
|
||||
@TableField("HREF")
|
||||
private String href;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private Integer validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
@TableField("REMARKS")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "数据字典ID")
|
||||
@TableField("DIC_ID")
|
||||
private String dicId;
|
||||
|
||||
@ApiModelProperty(value = "子菜单")
|
||||
@TableField(exist = false)
|
||||
private List<SarMenuStandardNew> children;
|
||||
|
||||
@TableField(exist=false)
|
||||
private List<String> roleIds;
|
||||
|
||||
@TableField(exist=false)
|
||||
private List<String> childMenuIds;
|
||||
|
||||
@TableField(exist=false)
|
||||
private String parentIdsName;
|
||||
|
||||
@TableField(exist=false)
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "树结构数据 区分 类型: 标准数据 tsr 技术系列 sarMs")
|
||||
@TableField(exist = false)
|
||||
private String treeType;
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.slrs.sarMenuStandard.service;
|
||||
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.SarMenuStandardNew;
|
||||
import com.adc.da.sys.sarMenuStandard.entity.SarMenuStandard;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-07-07
|
||||
*/
|
||||
public interface ISarMenuStandardNewService extends IService<SarMenuStandardNew> {
|
||||
|
||||
|
||||
List<SarMenuStandard> getListStandLimit(SarMenuStandardNew sarMenuStandardNew, List<String> access);
|
||||
|
||||
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.adc.da.slrs.sarMenuStandard.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarMenuStandard.dao.SarMenuStandardNewDao;
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.SarMenuStandardNew;
|
||||
import com.adc.da.slrs.sarMenuStandard.service.ISarMenuStandardNewService;
|
||||
import com.adc.da.sys.sarMenuStandard.dao.SarMenuStandardDao;
|
||||
import com.adc.da.sys.sarMenuStandard.entity.SarMenuStandard;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-07-07
|
||||
*/
|
||||
@Service
|
||||
public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandardNewDao, SarMenuStandardNew> implements ISarMenuStandardNewService {
|
||||
|
||||
@Autowired
|
||||
private SarMenuStandardDao dao;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询有权限菜单
|
||||
* @param sarMenuStandardNew
|
||||
*/
|
||||
@Override
|
||||
public List<SarMenuStandard> getListStandLimit(SarMenuStandardNew sarMenuStandardNew, List<String> access) {
|
||||
List<SarMenuStandard> TsResources = new ArrayList<>();
|
||||
|
||||
QueryWrapper<SarMenuStandard> queryWrapper =new QueryWrapper<>();
|
||||
if(sarMenuStandardNew.getSorDivide()!=null){
|
||||
queryWrapper.eq("sor_divide", sarMenuStandardNew.getSorDivide());
|
||||
}
|
||||
|
||||
if(sarMenuStandardNew.getDicId()!=null){
|
||||
queryWrapper.eq("DIC_ID", sarMenuStandardNew.getDicId());
|
||||
}
|
||||
queryWrapper.in(null!=access,"ID",access);
|
||||
queryWrapper.isNull("PARENT_ID");
|
||||
queryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
TsResources=dao.selectList(queryWrapper);
|
||||
|
||||
for(SarMenuStandard resource:TsResources){
|
||||
resource.setTreeType("sarMs");
|
||||
QueryWrapper<SarMenuStandard> TsResourceQueryWrapper=new QueryWrapper<>();
|
||||
TsResourceQueryWrapper.like("PARENT_IDS",resource.getId());
|
||||
TsResourceQueryWrapper.in(null!=access,"ID",access);
|
||||
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
List<SarMenuStandard> children=dao.selectList(TsResourceQueryWrapper);
|
||||
resource.setChildren(recursionGetListChildrenStand((resource),(children)));
|
||||
}
|
||||
|
||||
return TsResources;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归调用获取子节点
|
||||
* @return List<TsResource>
|
||||
*/
|
||||
private List<SarMenuStandard> recursionGetListChildrenStand(SarMenuStandard resource, List<SarMenuStandard> children){
|
||||
List<SarMenuStandard> tsResources = children.stream()
|
||||
.filter(resource1 -> resource1.getParentId().equals(resource.getId()))
|
||||
.collect(Collectors.toList());
|
||||
if(!tsResources.isEmpty()){
|
||||
tsResources = tsResources.stream().sorted(Comparator.comparing(resource1 -> resource1.getDisplaySeq())).collect(Collectors.toList());
|
||||
tsResources.forEach(resource1 -> {
|
||||
resource1.setTreeType("sarMs");
|
||||
resource1.setChildren(recursionGetListChildrenStand((resource1),(children)));
|
||||
});
|
||||
}
|
||||
return tsResources;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+11
@@ -6,6 +6,7 @@ import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarResource.entity.TsResource;
|
||||
import com.adc.da.slrs.sarResource.service.ITsResourceService;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -32,6 +33,8 @@ import java.util.stream.Collectors;
|
||||
public class TsResourceController extends BaseController<TsResource> {
|
||||
@Autowired
|
||||
private ITsResourceService tsResourceService;
|
||||
@Autowired
|
||||
private ITsUserService tsUserService;
|
||||
|
||||
@ApiOperation("根据ID查询菜单")
|
||||
@GetMapping("/getMenuById")
|
||||
@@ -68,6 +71,14 @@ public class TsResourceController extends BaseController<TsResource> {
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
@ApiOperation("查询有权限资源")
|
||||
@GetMapping("/getListStandLimitData")
|
||||
public ResponseMessage<List<TsResource>> getListStandLimit(TsResource tsResource){
|
||||
List<String> access = tsUserService.getResourceUserId(tsResource.getUserId());
|
||||
List<TsResource> tsResources=tsResourceService.getListStandLimit(tsResource,access);
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
// @ApiOperation("查询所有资源")
|
||||
// @GetMapping("/getDefault")
|
||||
// public ResponseMessage<List<TsResource>> getDefault(){
|
||||
|
||||
@@ -38,6 +38,8 @@ public interface ITsResourceService extends IService<TsResource> {
|
||||
|
||||
List<TsResource> getListStand(TsResource tsResource);
|
||||
|
||||
List<TsResource> getListStandLimit(TsResource tsResource,List<String> access);
|
||||
|
||||
List<String> getDefaultByName();
|
||||
|
||||
ResponseMessage<Object> addResource(TsResource tsResource);
|
||||
|
||||
+39
@@ -240,6 +240,45 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
||||
return TsResources;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询有权限菜单
|
||||
* @param tsResource
|
||||
*/
|
||||
@Override
|
||||
public List<TsResource> getListStandLimit(TsResource tsResource,List<String> access) {
|
||||
List<TsResource> TsResources = new ArrayList<>();
|
||||
|
||||
QueryWrapper<TsResource> queryWrapper =new QueryWrapper<>();
|
||||
if(tsResource.getSorDivide()!=null){
|
||||
queryWrapper.eq("sor_divide",tsResource.getSorDivide());
|
||||
}
|
||||
queryWrapper.isNull("PARENT_ID");
|
||||
queryWrapper.in(null!=access,"ID",access);
|
||||
queryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
TsResources=dao.selectList(queryWrapper);
|
||||
|
||||
for(TsResource resource:TsResources){
|
||||
resource.setTreeType("tsr");
|
||||
QueryWrapper<TsResource> TsResourceQueryWrapper=new QueryWrapper<>();
|
||||
TsResourceQueryWrapper.like("PARENT_IDS",resource.getId());
|
||||
TsResourceQueryWrapper.in(null!=access,"ID",access);
|
||||
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
List<TsResource> children=dao.selectList(TsResourceQueryWrapper);
|
||||
|
||||
/**
|
||||
* 入库流程去除我的收藏 flow
|
||||
*/
|
||||
if ( tsResource.getIsFlow()!=null && "flow".equals(tsResource.getIsFlow())){
|
||||
children=children.stream()
|
||||
.filter(item->!"我的收藏".equals(item.getMenuName()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
resource.setChildren(recursionGetListChildrenStand((resource),(children)));
|
||||
}
|
||||
|
||||
return TsResources;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDefaultByName() {
|
||||
List<String> menusNames=new ArrayList<>();
|
||||
|
||||
+1
-1
@@ -191,7 +191,7 @@ public class SarStandardComplianceAssessResultController {
|
||||
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper1 = new QueryWrapper<>();
|
||||
queryWrapper1.eq("STAND_ID", eo.getStandId());
|
||||
queryWrapper1.eq("product_id", eo.getProductId());
|
||||
queryWrapper1.and(sarStandardComplianceProductAssessQueryWrapper -> sarStandardComplianceProductAssessQueryWrapper.ne("research_compliance","").or().isNotNull("research_compliance"));
|
||||
queryWrapper1.and(sarStandardComplianceProductAssessQueryWrapper -> sarStandardComplianceProductAssessQueryWrapper.ne("research_compliance","").isNotNull("research_compliance"));
|
||||
queryWrapper1.orderByAsc("product_name");
|
||||
queryWrapper1.orderByAsc("standard_item");
|
||||
IPage<SarStandardComplianceProductAssess> page1 = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper1);
|
||||
|
||||
+10
-1
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
import com.adc.da.sys.common.BasePage;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -28,7 +29,6 @@ public class SarBussionessStandEOPage extends BasePage {
|
||||
private String endPutTime;
|
||||
|
||||
|
||||
|
||||
private String modifyTime;
|
||||
private String modifyTime1;
|
||||
private String modifyTime2;
|
||||
@@ -168,6 +168,15 @@ public class SarBussionessStandEOPage extends BasePage {
|
||||
private String CBCD;
|
||||
private String CYCD;
|
||||
private String CYBZ;
|
||||
private String isKU;
|
||||
|
||||
public String getIsKU() {
|
||||
return isKU;
|
||||
}
|
||||
|
||||
public void setIsKU(String isKU) {
|
||||
this.isKU = isKU;
|
||||
}
|
||||
|
||||
public String getLLCS() {
|
||||
return LLCS;
|
||||
|
||||
@@ -73,6 +73,9 @@ public interface ITsUserService extends IService<TsUser> {
|
||||
|
||||
List<String> getResourceUserId(String userId);
|
||||
|
||||
//获取当前用户的 数据查看权限 针对于企业标准
|
||||
List<String> getResourceDataUserId(String userId);
|
||||
|
||||
/**
|
||||
* 导入人员数据
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,8 @@ import com.adc.da.slrs.sarRole.service.ITsRoleService;
|
||||
import com.adc.da.slrs.sarUser.entity.*;
|
||||
import com.adc.da.slrs.sarUser.dao.TsUserDao;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.slrs.tsRoleMeunData.entity.TsRoleMenuData;
|
||||
import com.adc.da.slrs.tsRoleMeunData.service.ITsRoleMenuDataService;
|
||||
import com.adc.da.sync.service.SyncUserService;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.utils.util.ListUtil;
|
||||
@@ -35,6 +37,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -65,6 +68,8 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
private TsPositionDao tsPositionDao;
|
||||
@Autowired
|
||||
private ITsInstitutionService tsInstitutionService;
|
||||
@Autowired
|
||||
ITsRoleMenuDataService iTsRoleMenuDataService;
|
||||
|
||||
|
||||
public void deleteUser(){
|
||||
@@ -277,6 +282,21 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
return tsRoleService.getResourceIdsByRoleIds(roleIds);
|
||||
|
||||
}
|
||||
/**
|
||||
* 查询当前登录的用户资源
|
||||
* @return List<SarMenu>
|
||||
*/
|
||||
@Override
|
||||
public List<String> getResourceDataUserId(String userId) {
|
||||
List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
QueryWrapper<TsRoleMenuData> wrapper=new QueryWrapper<>();
|
||||
wrapper.select("MENU_ID");
|
||||
wrapper.in("ROLE_ID",roleIds);
|
||||
List<TsRoleMenuData> tsRoleMenuData=iTsRoleMenuDataService.list(wrapper);
|
||||
return tsRoleMenuData.stream().map(TsRoleMenuData::getMenuId).distinct().collect(Collectors.toList());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.adc.da.slrs.tsRoleMeunData.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.tsRoleMeunData.service.ITsRoleMenuDataService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.tsRoleMeunData.entity.TsRoleMenuData;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-16
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|TsRoleMenuData|")
|
||||
@RequestMapping("/${restPath}/tsRoleMeunData/ts-role-menu-data")
|
||||
public class TsRoleMenuDataController extends BaseController<TsRoleMenuData> {
|
||||
|
||||
@Autowired
|
||||
private ITsRoleMenuDataService iTsRoleMenuDataService;
|
||||
|
||||
|
||||
@ApiOperation("角色与菜单关联控制右侧数据列表")
|
||||
@PostMapping("/saveBatch")
|
||||
public ResponseMessage<Object> disable(@RequestBody TsRoleMenuData tsRoleMenuData){
|
||||
//上来就给他 清了 能满足清空 修改 新增
|
||||
QueryWrapper<TsRoleMenuData> wrapper=new QueryWrapper<>();
|
||||
wrapper.eq("ROLE_ID",tsRoleMenuData.getRoleId());
|
||||
iTsRoleMenuDataService.remove(wrapper);
|
||||
|
||||
if (StringUtils.isNotBlank(tsRoleMenuData.getMenuIds())){
|
||||
List<String> menus=new ArrayList<>();
|
||||
if (tsRoleMenuData.getMenuIds().contains(",")){
|
||||
menus.addAll(new ArrayList<>(Arrays.asList(tsRoleMenuData.getMenuIds().split(","))));
|
||||
}else {
|
||||
menus.add(tsRoleMenuData.getMenuIds());
|
||||
}
|
||||
List<TsRoleMenuData> res=new ArrayList<>();
|
||||
menus.forEach(s -> {
|
||||
TsRoleMenuData tsRoleMenuData1=new TsRoleMenuData();
|
||||
tsRoleMenuData1.setRoleId(tsRoleMenuData.getRoleId());
|
||||
tsRoleMenuData1.setMenuId(s);
|
||||
res.add(tsRoleMenuData1);
|
||||
});
|
||||
iTsRoleMenuDataService.saveBatch(res);
|
||||
return Result.success();
|
||||
}else {
|
||||
return Result.error("请选择菜单");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询与角色绑定的菜单--支持多个角色查询")
|
||||
@GetMapping("/list")
|
||||
public ResponseMessage<Object> list(String ids){
|
||||
//判断disableFlag是否填入正确
|
||||
List<String> list=new ArrayList<>();
|
||||
if (ids.contains(",")){
|
||||
list.addAll(new ArrayList<>(Arrays.asList(ids.split(","))));
|
||||
}else {
|
||||
list.add(ids);
|
||||
}
|
||||
QueryWrapper<TsRoleMenuData> wrapper=new QueryWrapper<>();
|
||||
wrapper.in("ROLE_ID",list);
|
||||
List<TsRoleMenuData> tsRoleMenuData=iTsRoleMenuDataService.list(wrapper);
|
||||
return Result.success(tsRoleMenuData.stream().map(TsRoleMenuData::getMenuId).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.tsRoleMeunData.dao;
|
||||
|
||||
import com.adc.da.slrs.tsRoleMeunData.entity.TsRoleMenuData;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-16
|
||||
*/
|
||||
public interface TsRoleMenuDataDao extends BaseMapper<TsRoleMenuData> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.slrs.tsRoleMeunData.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="TsRoleMenuData对象", description="")
|
||||
public class TsRoleMenuData extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "角色id")
|
||||
@TableField("ROLE_ID")
|
||||
private String roleId;
|
||||
|
||||
@ApiModelProperty(value = "菜单id")
|
||||
@TableField("MENU_ID")
|
||||
private String menuId;
|
||||
|
||||
@ApiModelProperty(value = "菜单id")
|
||||
@TableField(exist = false)
|
||||
private String menuIds;
|
||||
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.tsRoleMeunData.service;
|
||||
|
||||
import com.adc.da.slrs.tsRoleMeunData.entity.TsRoleMenuData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-16
|
||||
*/
|
||||
public interface ITsRoleMenuDataService extends IService<TsRoleMenuData> {
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.tsRoleMeunData.service.impl;
|
||||
|
||||
import com.adc.da.slrs.tsRoleMeunData.entity.TsRoleMenuData;
|
||||
import com.adc.da.slrs.tsRoleMeunData.dao.TsRoleMenuDataDao;
|
||||
import com.adc.da.slrs.tsRoleMeunData.service.ITsRoleMenuDataService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-16
|
||||
*/
|
||||
@Service
|
||||
public class TsRoleMenuDataServiceImpl extends ServiceImpl<TsRoleMenuDataDao, TsRoleMenuData> implements ITsRoleMenuDataService {
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sarBussStandData.dao.SarBussStandDataDao">
|
||||
|
||||
</mapper>
|
||||
+3
-3
@@ -444,7 +444,7 @@
|
||||
</sql>
|
||||
<sql id="SarBussionInfo_Where_Clause">
|
||||
left join SAR_BUSS_STAND_MENU ON SAR_BUSSIONESS_STAND.id = SAR_BUSS_STAND_MENU.buss_stand_id
|
||||
<if test="menuId != null and menuId =='nomenu' and menuAllChildrenIdList != null and sarMsType != null and sarMsType == 'filterSarMsMenu'" >
|
||||
<if test="menuId != null and menuId =='nomenu' and menuAllChildrenIdList != null and menuAllChildrenIdList.size()>0 and sarMsType != null and sarMsType == 'filterSarMsMenu'" >
|
||||
and SAR_BUSS_STAND_MENU.TREE_TYPE = 'sarMs'
|
||||
and SAR_BUSS_STAND_MENU.MENU_ID in
|
||||
<foreach collection="menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
|
||||
@@ -525,12 +525,12 @@
|
||||
</if>
|
||||
|
||||
|
||||
<if test="menuId != null and menuId =='nomenu' and menuAllChildrenIdList != null and sarMsType != null and sarMsType == 'filterSarMsMenu'" >
|
||||
<if test="menuId != null and menuId =='nomenu' and menuAllChildrenIdList != null and menuAllChildrenIdList.size()>0 and sarMsType != null and sarMsType == 'filterSarMsMenu'" >
|
||||
and SAR_BUSS_STAND_MENU.MENU_ID IS NULL
|
||||
</if>
|
||||
|
||||
<!-- 目录判断 -->
|
||||
<if test="menuId != null and menuId !='nomenu' and menuAllChildrenIdList != null" >
|
||||
<if test="menuId != null and menuId !='nomenu' and menuAllChildrenIdList != null and menuAllChildrenIdList.size()>0 " >
|
||||
and SAR_BUSS_STAND_MENU.MENU_ID in
|
||||
<foreach collection="menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.tsRoleMeunData.dao.TsRoleMenuDataDao">
|
||||
|
||||
</mapper>
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sarMenuStandard.dao.SarMenuStandardDao">
|
||||
<mapper namespace="com.adc.da.slrs.sarMenuStandardNew.dao.SarMenuStandardNewDao">
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user