法规技术评估、法规意见收集添加品牌字段,根据viewer角色跟品牌字段进行筛选
This commit is contained in:
+3
@@ -49,4 +49,7 @@ public interface SysDictItemMapper extends BaseMapper<SysDictItem> {
|
|||||||
|
|
||||||
@Select("select * from sys_dict_item where item_text=#{itemText} and dict_id=#{dictId}")
|
@Select("select * from sys_dict_item where item_text=#{itemText} and dict_id=#{dictId}")
|
||||||
List<SysDictItem> selctItemByName(String itemText,String dictId);
|
List<SysDictItem> selctItemByName(String itemText,String dictId);
|
||||||
|
|
||||||
|
@Select("select * from sys_dict_item item LEFT JOIN sys_dict dict on item.dict_id = dict.id WHERE dict.dict_code = #{dictCode} and item.item_value = #{itemValue}")
|
||||||
|
List<SysDictItem> queryItemByValue(@Param("dictCode") String dictCode,@Param("itemValue") String itemValue);
|
||||||
}
|
}
|
||||||
|
|||||||
+54
-2
@@ -1,7 +1,10 @@
|
|||||||
package com.jero.modules.lawsOpinionGather.controller;
|
package com.jero.modules.lawsOpinionGather.controller;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
@@ -14,9 +17,13 @@ import com.jero.modules.lawsOpinionGather.service.ILawsOpinionGatherEOService;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||||
|
import com.jero.modules.system.service.IProjectUserBrandService;
|
||||||
import com.jero.modules.system.service.ISysUserService;
|
import com.jero.modules.system.service.ISysUserService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.jero.common.system.base.controller.JeroController;
|
import com.jero.common.system.base.controller.JeroController;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -42,6 +49,8 @@ public class LawsOpinionGatherEOController extends JeroController<LawsOpinionGat
|
|||||||
private ILawsOpinionGatherEOService lawsOpinionGatherEOService;
|
private ILawsOpinionGatherEOService lawsOpinionGatherEOService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService sysUserService;
|
private ISysUserService sysUserService;
|
||||||
|
@Autowired
|
||||||
|
private IProjectUserBrandService projectUserBrandService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
@@ -60,24 +69,67 @@ public class LawsOpinionGatherEOController extends JeroController<LawsOpinionGat
|
|||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
@RequestParam(name="cut", defaultValue="cn") String cut,
|
@RequestParam(name="cut", defaultValue="cn") String cut,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
String brandSelect = lawsOpinionGatherEO.getBrand();
|
||||||
|
lawsOpinionGatherEO.setBrand(null);
|
||||||
QueryWrapper<LawsOpinionGatherEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsOpinionGatherEO, req.getParameterMap());
|
QueryWrapper<LawsOpinionGatherEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsOpinionGatherEO, req.getParameterMap());
|
||||||
queryWrapper.orderByDesc("start_time");
|
queryWrapper.orderByDesc("start_time");
|
||||||
/**
|
/**
|
||||||
* 创建查询数据权限,超级管理员可以看到所有的数据,并且能删除,其它用户只能看到自己创建、或自己为评估人的数据。
|
* 创建查询数据权限,超级管理员可以看到所有的数据,并且能删除,其它用户只能看到自己创建、或自己为评估人的数据。
|
||||||
*/
|
*/
|
||||||
boolean administrator = this.sysUserService.isAdministrator();
|
boolean administrator = this.sysUserService.isAdministrator();
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
if(!administrator){
|
if(!administrator){
|
||||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
||||||
//如果不是超级管理员,获取自己所有参与过的法规意见收集
|
//如果不是超级管理员,获取自己所有参与过的法规意见收集
|
||||||
queryWrapper.and(query -> {
|
queryWrapper.and(query -> {
|
||||||
query.eq("create_by",currentUser.getUsername());
|
query.eq("create_by",currentUser.getUsername());
|
||||||
query.or().like("evaluator_ids",currentUser.getId());
|
query.or().like("evaluator_ids",currentUser.getId());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(brandSelect)) {
|
||||||
|
//根据品牌搜索
|
||||||
|
queryWrapper.and(query -> {
|
||||||
|
query.lambda().like(LawsOpinionGatherEO::getBrand, brandSelect);
|
||||||
|
if(StringUtils.contains(brandSelect,",")){
|
||||||
|
for (String brand : brandSelect.split(",")) {
|
||||||
|
query.or(q -> {
|
||||||
|
q.like("brand",brand);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Page<LawsOpinionGatherEO> page = new Page<LawsOpinionGatherEO>(pageNo, pageSize);
|
Page<LawsOpinionGatherEO> page = new Page<LawsOpinionGatherEO>(pageNo, pageSize);
|
||||||
IPage<LawsOpinionGatherEO> pageList = lawsOpinionGatherEOService.page(page, queryWrapper);
|
IPage<LawsOpinionGatherEO> pageList = lawsOpinionGatherEOService.page(page, queryWrapper);
|
||||||
this.lawsOpinionGatherEOService.disposeData(pageList.getRecords(),cut);
|
List<LawsOpinionGatherEO> records = pageList.getRecords();
|
||||||
|
//如果是Viewer,根据品牌进行筛选
|
||||||
|
List<String> ownedBrandList = projectUserBrandService.queryBrandByUserId(currentUser.getId());
|
||||||
|
if (ObjectUtils.isNotEmpty(ownedBrandList)) {
|
||||||
|
QueryWrapper<LawsOpinionGatherEO> brandWrapper = new QueryWrapper<>();
|
||||||
|
if (ObjectUtils.isNotEmpty(brandSelect)) {
|
||||||
|
//取交集
|
||||||
|
ownedBrandList = Arrays.asList(brandSelect.split(",")).stream().filter(ownedBrandList::contains).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
for (int i= 0; i<ownedBrandList.size(); i++) {
|
||||||
|
if (i==0) {
|
||||||
|
brandWrapper.like("brand",ownedBrandList.get(i));
|
||||||
|
} else {
|
||||||
|
brandWrapper.or().like("brand",ownedBrandList.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(ownedBrandList)) {
|
||||||
|
//合并去重
|
||||||
|
records = Stream.of(records, lawsOpinionGatherEOService.list(brandWrapper))
|
||||||
|
.flatMap(Collection::stream)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lawsOpinionGatherEOService.disposeData(records,cut);
|
||||||
|
pageList.setRecords(records);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.jero.common.aspect.annotation.Dict;
|
||||||
import com.jero.modules.oss.entity.OSSFile;
|
import com.jero.modules.oss.entity.OSSFile;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
@@ -126,4 +127,11 @@ public class LawsOpinionGatherEO implements Serializable {
|
|||||||
/**删除标识 true 可以删除,false,没有权限删除**/
|
/**删除标识 true 可以删除,false,没有权限删除**/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private boolean deleteFlag = false;
|
private boolean deleteFlag = false;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "品牌")
|
||||||
|
@Dict(dicCode = "brand")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String brand_text;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -15,5 +15,6 @@
|
|||||||
<result column="start_time" property="startTime" />
|
<result column="start_time" property="startTime" />
|
||||||
<result column="end_time" property="endTime" />
|
<result column="end_time" property="endTime" />
|
||||||
<result column="acti_proc_inst_id" property="actiProcInstId" />
|
<result column="acti_proc_inst_id" property="actiProcInstId" />
|
||||||
|
<result column="brand" property="brand" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+19
@@ -12,6 +12,7 @@ import com.jero.common.exception.JeroBootException;
|
|||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||||
|
import com.jero.modules.enums.DictCodeEnum;
|
||||||
import com.jero.modules.feishu.service.IFeishuService;
|
import com.jero.modules.feishu.service.IFeishuService;
|
||||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||||
@@ -33,7 +34,10 @@ import com.jero.modules.project.enums.OperatorTypeEnum;
|
|||||||
import com.jero.modules.project.enums.RequestSourceEnum;
|
import com.jero.modules.project.enums.RequestSourceEnum;
|
||||||
import com.jero.modules.project.util.SendMessageUtils;
|
import com.jero.modules.project.util.SendMessageUtils;
|
||||||
import com.jero.modules.system.entity.SysCategory;
|
import com.jero.modules.system.entity.SysCategory;
|
||||||
|
import com.jero.modules.system.entity.SysDictItem;
|
||||||
import com.jero.modules.system.entity.SysUser;
|
import com.jero.modules.system.entity.SysUser;
|
||||||
|
import com.jero.modules.system.mapper.SysDictItemMapper;
|
||||||
|
import com.jero.modules.system.service.ISysDictItemService;
|
||||||
import com.jero.modules.system.service.ISysUserService;
|
import com.jero.modules.system.service.ISysUserService;
|
||||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||||
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
||||||
@@ -89,6 +93,8 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
|
|||||||
private IFeishuService feishuService;
|
private IFeishuService feishuService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||||
|
@Autowired
|
||||||
|
private SysDictItemMapper sysDictItemMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
@@ -245,6 +251,19 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
|
|||||||
List<OSSFile> opinionArchiveFileList = iOSSFileService.getFileInfosByConnectId(StringUtils.join(lawsOpinionGather.getOpinionArchiveId(), ","));
|
List<OSSFile> opinionArchiveFileList = iOSSFileService.getFileInfosByConnectId(StringUtils.join(lawsOpinionGather.getOpinionArchiveId(), ","));
|
||||||
lawsOpinionGather.setOpinionArchiveFileList(opinionArchiveFileList);
|
lawsOpinionGather.setOpinionArchiveFileList(opinionArchiveFileList);
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotEmpty(lawsOpinionGather.getBrand())) {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (String brandValue : lawsOpinionGather.getBrand().split(",")) {
|
||||||
|
List<SysDictItem> sysDictItem = sysDictItemMapper.queryItemByValue(DictCodeEnum.BRAND.getValue(), brandValue);
|
||||||
|
if (CutEnum.CN.getValue().equals(cut)) {
|
||||||
|
builder.append(sysDictItem.get(0).getItemText() + ",");
|
||||||
|
} else {
|
||||||
|
builder.append(sysDictItem.get(0).getEnName()+ ",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String brandText = builder.toString().substring(0, builder.toString().length() - 1);
|
||||||
|
lawsOpinionGather.setBrand_text(brandText);
|
||||||
|
}
|
||||||
//如果当前用户是超级管理员,或是这条数据的创建人,给删除权限。
|
//如果当前用户是超级管理员,或是这条数据的创建人,给删除权限。
|
||||||
if(StringUtils.equals(lawsOpinionGather.getCreateBy(),currentUser.getUsername()) || administrator){
|
if(StringUtils.equals(lawsOpinionGather.getCreateBy(),currentUser.getUsername()) || administrator){
|
||||||
lawsOpinionGather.setDeleteFlag(true);
|
lawsOpinionGather.setDeleteFlag(true);
|
||||||
|
|||||||
+50
-1
@@ -1,9 +1,11 @@
|
|||||||
package com.jero.modules.lawsTechnologyEvaluation.controller;
|
package com.jero.modules.lawsTechnologyEvaluation.controller;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
@@ -11,6 +13,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
|
import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO;
|
||||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
|
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
|
||||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationFlowDetailEO;
|
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationFlowDetailEO;
|
||||||
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService;
|
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService;
|
||||||
@@ -18,10 +21,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationFlowDetailEOService;
|
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationFlowDetailEOService;
|
||||||
|
import com.jero.modules.system.service.IProjectUserBrandService;
|
||||||
import com.jero.modules.system.service.ISysUserService;
|
import com.jero.modules.system.service.ISysUserService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.jero.common.system.base.controller.JeroController;
|
import com.jero.common.system.base.controller.JeroController;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -51,6 +57,8 @@ public class LawsTechnologyEvaluationEOController extends JeroController<LawsTec
|
|||||||
private ISysUserService sysUserService;
|
private ISysUserService sysUserService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ILawsTechnologyEvaluationFlowDetailEOService lawsTechnologyEvaluationFlowDetailEOService;
|
private ILawsTechnologyEvaluationFlowDetailEOService lawsTechnologyEvaluationFlowDetailEOService;
|
||||||
|
@Autowired
|
||||||
|
private IProjectUserBrandService projectUserBrandService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
@@ -69,15 +77,56 @@ public class LawsTechnologyEvaluationEOController extends JeroController<LawsTec
|
|||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
@RequestParam(name="cut", defaultValue="cn") String cut,
|
@RequestParam(name="cut", defaultValue="cn") String cut,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
|
String brandSelect = lawsTechnologyEvaluationEO.getBrand();
|
||||||
|
lawsTechnologyEvaluationEO.setBrand(null);
|
||||||
QueryWrapper<LawsTechnologyEvaluationEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationEO, req.getParameterMap());
|
QueryWrapper<LawsTechnologyEvaluationEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationEO, req.getParameterMap());
|
||||||
queryWrapper.orderByDesc("start_time");
|
queryWrapper.orderByDesc("start_time");
|
||||||
boolean administrator = this.sysUserService.isAdministrator();
|
boolean administrator = this.sysUserService.isAdministrator();
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
if(!administrator){
|
if(!administrator){
|
||||||
this.lawsTechnologyEvaluationEOService.createQueryPermission(queryWrapper,lawsTechnologyEvaluationEO,administrator);
|
this.lawsTechnologyEvaluationEOService.createQueryPermission(queryWrapper,lawsTechnologyEvaluationEO,administrator);
|
||||||
}
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(brandSelect)) {
|
||||||
|
//根据品牌搜索
|
||||||
|
queryWrapper.and(query -> {
|
||||||
|
query.lambda().like(LawsTechnologyEvaluationEO::getBrand, brandSelect);
|
||||||
|
if(StringUtils.contains(brandSelect,",")){
|
||||||
|
for (String brand : brandSelect.split(",")) {
|
||||||
|
query.or(q -> {
|
||||||
|
q.like("brand",brand);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
Page<LawsTechnologyEvaluationEO> page = new Page<LawsTechnologyEvaluationEO>(pageNo, pageSize);
|
Page<LawsTechnologyEvaluationEO> page = new Page<LawsTechnologyEvaluationEO>(pageNo, pageSize);
|
||||||
IPage<LawsTechnologyEvaluationEO> pageList = lawsTechnologyEvaluationEOService.page(page, queryWrapper);
|
IPage<LawsTechnologyEvaluationEO> pageList = lawsTechnologyEvaluationEOService.page(page, queryWrapper);
|
||||||
this.lawsTechnologyEvaluationEOService.disposeData(pageList.getRecords(),cut);
|
List<LawsTechnologyEvaluationEO> records = pageList.getRecords();
|
||||||
|
//如果是Viewer,根据品牌进行筛选
|
||||||
|
List<String> ownedBrandList = projectUserBrandService.queryBrandByUserId(currentUser.getId());
|
||||||
|
if (ObjectUtils.isNotEmpty(ownedBrandList)) {
|
||||||
|
QueryWrapper<LawsTechnologyEvaluationEO> brandWrapper = new QueryWrapper<>();
|
||||||
|
if (ObjectUtils.isNotEmpty(brandSelect)) {
|
||||||
|
//取交集
|
||||||
|
ownedBrandList = Arrays.asList(brandSelect.split(",")).stream().filter(ownedBrandList::contains).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
for (int i= 0; i<ownedBrandList.size(); i++) {
|
||||||
|
if (i==0) {
|
||||||
|
brandWrapper.like("brand",ownedBrandList.get(i));
|
||||||
|
} else {
|
||||||
|
brandWrapper.or().like("brand",ownedBrandList.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(ownedBrandList)) {
|
||||||
|
//合并去重
|
||||||
|
records = Stream.of(records, lawsTechnologyEvaluationEOService.list(brandWrapper))
|
||||||
|
.flatMap(Collection::stream)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.lawsTechnologyEvaluationEOService.disposeData(records,cut);
|
||||||
|
pageList.setRecords(records);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
@@ -152,4 +152,11 @@ public class LawsTechnologyEvaluationEO implements Serializable {
|
|||||||
/**删除标识 true 可以删除,false,没有权限删除**/
|
/**删除标识 true 可以删除,false,没有权限删除**/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private boolean deleteFlag = false;
|
private boolean deleteFlag = false;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "品牌")
|
||||||
|
@Dict(dicCode = "brand")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String brand_text;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -23,5 +23,6 @@
|
|||||||
<result column="regulation_owner_id" property="regulationOwnerId" />
|
<result column="regulation_owner_id" property="regulationOwnerId" />
|
||||||
<result column="evaluation_type" property="evaluationType" />
|
<result column="evaluation_type" property="evaluationType" />
|
||||||
<result column="prc_num" property="prcNum" />
|
<result column="prc_num" property="prcNum" />
|
||||||
|
<result column="brand" property="brand" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+17
@@ -15,6 +15,7 @@ import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
|||||||
import com.jero.modules.document.enums.FieldTypeEnum;
|
import com.jero.modules.document.enums.FieldTypeEnum;
|
||||||
import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper;
|
import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper;
|
||||||
import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl;
|
import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl;
|
||||||
|
import com.jero.modules.enums.DictCodeEnum;
|
||||||
import com.jero.modules.feishu.service.IFeishuService;
|
import com.jero.modules.feishu.service.IFeishuService;
|
||||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||||
import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum;
|
import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum;
|
||||||
@@ -33,6 +34,7 @@ import com.jero.modules.split.service.ISarFileSplitInfoService;
|
|||||||
import com.jero.modules.system.entity.SysCategory;
|
import com.jero.modules.system.entity.SysCategory;
|
||||||
import com.jero.modules.system.entity.SysDictItem;
|
import com.jero.modules.system.entity.SysDictItem;
|
||||||
import com.jero.modules.system.entity.SysUser;
|
import com.jero.modules.system.entity.SysUser;
|
||||||
|
import com.jero.modules.system.mapper.SysDictItemMapper;
|
||||||
import com.jero.modules.system.service.ISysUserService;
|
import com.jero.modules.system.service.ISysUserService;
|
||||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||||
@@ -114,6 +116,8 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
|
|||||||
private IFeishuService feishuService;
|
private IFeishuService feishuService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private LawsTechnologyEvaluationFlowDetailEOMapper flowDetailEOMapper;
|
private LawsTechnologyEvaluationFlowDetailEOMapper flowDetailEOMapper;
|
||||||
|
@Autowired
|
||||||
|
private SysDictItemMapper sysDictItemMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
@@ -268,6 +272,19 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
|
|||||||
String name = getTreeName(cut, categoryList, technologyTerritory);
|
String name = getTreeName(cut, categoryList, technologyTerritory);
|
||||||
data.setTechnologyTerritoryName(name);
|
data.setTechnologyTerritoryName(name);
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotEmpty(data.getBrand())) {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (String brandValue : data.getBrand().split(",")) {
|
||||||
|
List<SysDictItem> sysDictItem = sysDictItemMapper.queryItemByValue(DictCodeEnum.BRAND.getValue(), brandValue);
|
||||||
|
if (CutEnum.CN.getValue().equals(cut)) {
|
||||||
|
builder.append(sysDictItem.get(0).getItemText() + ",");
|
||||||
|
} else {
|
||||||
|
builder.append(sysDictItem.get(0).getEnName() + ",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String brandText = builder.toString().substring(0, builder.toString().length() - 1);
|
||||||
|
data.setBrand_text(brandText);
|
||||||
|
}
|
||||||
if(administrator || StringUtils.equals(data.getCreateBy(),currentUser.getUsername())){
|
if(administrator || StringUtils.equals(data.getCreateBy(),currentUser.getUsername())){
|
||||||
data.setDeleteFlag(true);
|
data.setDeleteFlag(true);
|
||||||
}
|
}
|
||||||
|
|||||||
+50
-44
@@ -721,23 +721,26 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
|||||||
@Override
|
@Override
|
||||||
public List<ProjectLibraryBase> queryPageList(Map<String,Object> params) {
|
public List<ProjectLibraryBase> queryPageList(Map<String,Object> params) {
|
||||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
//根据项目用户权限表筛选有权访问的项目
|
Integer isViewer = sysRoleMapper.queryUserRoleByCode(ProjectRoleEnum.VIEWER.getName(), loginUser.getId());
|
||||||
Set<String> projectIds = new HashSet<>();
|
Set<String> projectIds = new HashSet<>();
|
||||||
Set<String> permissionProjectIds = projectUserPermissionMapper.queryProjectIdsByUserId(loginUser.getId());
|
if (isViewer == 0) {
|
||||||
if (ObjectUtils.isNotEmpty(permissionProjectIds)) {
|
//如果不是viewer,根据项目用户权限表筛选有权访问的项目
|
||||||
projectIds.addAll(permissionProjectIds);
|
Set<String> permissionProjectIds = projectUserPermissionMapper.queryProjectIdsByUserId(loginUser.getId());
|
||||||
}
|
if (ObjectUtils.isNotEmpty(permissionProjectIds)) {
|
||||||
if (sysRoleMapper.queryUserRoleByCode(ProjectRoleEnum.VIEWER.getName(), loginUser.getId()) > 0) {
|
projectIds.addAll(permissionProjectIds);
|
||||||
//如果是Viewer,根据配置的品牌筛选可访问的项目
|
|
||||||
List<String> brandTypes = projectUserBrandService.queryBrandByUserId(loginUser.getId());
|
|
||||||
if (ObjectUtils.isNotEmpty(brandTypes)) {
|
|
||||||
QueryWrapper<ProjectLibraryBase> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.in("brand",brandTypes);
|
|
||||||
if (ObjectUtils.isNotEmpty(list(queryWrapper))) {
|
|
||||||
projectIds.addAll(list(queryWrapper).stream().map(ProjectLibraryBase::getId).collect(Collectors.toSet()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//if (sysRoleMapper.queryUserRoleByCode(ProjectRoleEnum.VIEWER.getName(), loginUser.getId()) > 0) {
|
||||||
|
// //如果是Viewer,根据配置的品牌筛选可访问的项目
|
||||||
|
// List<String> brandTypes = projectUserBrandService.queryBrandByUserId(loginUser.getId());
|
||||||
|
// if (ObjectUtils.isNotEmpty(brandTypes)) {
|
||||||
|
// QueryWrapper<ProjectLibraryBase> queryWrapper = new QueryWrapper<>();
|
||||||
|
// queryWrapper.in("brand",brandTypes);
|
||||||
|
// if (ObjectUtils.isNotEmpty(list(queryWrapper))) {
|
||||||
|
// projectIds.addAll(list(queryWrapper).stream().map(ProjectLibraryBase::getId).collect(Collectors.toSet()));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
List<ProjectLibraryBase> result = projectLibraryBaseMapper.queryPageList(params);
|
List<ProjectLibraryBase> result = projectLibraryBaseMapper.queryPageList(params);
|
||||||
disposeData(result,"",false);
|
disposeData(result,"",false);
|
||||||
@@ -825,38 +828,41 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
|||||||
}
|
}
|
||||||
|
|
||||||
//权限筛选
|
//权限筛选
|
||||||
List<ProjectLibraryBase> resultLast = new ArrayList<>();
|
if (isViewer != 0) {
|
||||||
for (ProjectLibraryBase projectLibraryBase : resultNew) {
|
return resultNew;
|
||||||
//判断父项目是否有权限
|
} else {
|
||||||
if (!projectIds.contains(projectLibraryBase.getId())) {
|
List<ProjectLibraryBase> resultLast = new ArrayList<>();
|
||||||
//判断子项目是否有权限
|
for (ProjectLibraryBase projectLibraryBase : resultNew) {
|
||||||
List<ProjectLibraryBase> children = projectLibraryBase.getChildren();
|
//判断父项目是否有权限
|
||||||
if (ObjectUtils.isNotEmpty(children)) {
|
if (!projectIds.contains(projectLibraryBase.getId())) {
|
||||||
for (ProjectLibraryBase child : children) {
|
//判断子项目是否有权限
|
||||||
//将有权限的放入最后返回的集合中
|
List<ProjectLibraryBase> children = projectLibraryBase.getChildren();
|
||||||
if (projectIds.contains(child.getId())) {
|
if (ObjectUtils.isNotEmpty(children)) {
|
||||||
resultLast.add(child);
|
for (ProjectLibraryBase child : children) {
|
||||||
}
|
//将有权限的放入最后返回的集合中
|
||||||
}
|
if (projectIds.contains(child.getId())) {
|
||||||
}
|
resultLast.add(child);
|
||||||
} else {
|
}
|
||||||
List<ProjectLibraryBase> children = projectLibraryBase.getChildren();
|
}
|
||||||
if (ObjectUtils.isNotEmpty(children)) {
|
}
|
||||||
List<ProjectLibraryBase> lastChild = new ArrayList<>();
|
} else {
|
||||||
//判断子项目是否有权限
|
List<ProjectLibraryBase> children = projectLibraryBase.getChildren();
|
||||||
for (ProjectLibraryBase child : children) {
|
if (ObjectUtils.isNotEmpty(children)) {
|
||||||
if (projectIds.contains(child.getId())) {
|
List<ProjectLibraryBase> lastChild = new ArrayList<>();
|
||||||
lastChild.add(child);
|
//判断子项目是否有权限
|
||||||
}
|
for (ProjectLibraryBase child : children) {
|
||||||
}
|
if (projectIds.contains(child.getId())) {
|
||||||
projectLibraryBase.setChildren(lastChild);
|
lastChild.add(child);
|
||||||
}
|
}
|
||||||
resultLast.add(projectLibraryBase);
|
}
|
||||||
|
projectLibraryBase.setChildren(lastChild);
|
||||||
|
}
|
||||||
|
resultLast.add(projectLibraryBase);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return resultLast;
|
||||||
}
|
}
|
||||||
|
|
||||||
return resultLast;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
<div class="title-text" :title="$t('brand')">
|
<div class="title-text" :title="$t('brand')">
|
||||||
<span>{{$t('brand')}}</span>
|
<span>{{$t('brand')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<j-multi-select-tag class="box-input" v-model="queryParam.brands"
|
<j-multi-select-tag class="box-input" v-model="queryParam.brand"
|
||||||
:placeholder="$t('PleaseSelect')+$t('brand')"
|
:placeholder="$t('PleaseSelect')+$t('brand')"
|
||||||
:type="'select'"
|
:type="'select'"
|
||||||
:triggerChange="false" :dictCode="'brand'"/>
|
:triggerChange="false" :dictCode="'brand'"/>
|
||||||
@@ -216,7 +216,7 @@
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
width: 140,
|
width: 140,
|
||||||
dataIndex: 'brand'
|
dataIndex: 'brand_text'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('dateOfInitiation'),
|
title: this.$t('dateOfInitiation'),
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
<div class="title-text" :title="$t('brand')">
|
<div class="title-text" :title="$t('brand')">
|
||||||
<span>{{$t('brand')}}</span>
|
<span>{{$t('brand')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<j-multi-select-tag class="box-input" v-model="queryParam.brands"
|
<j-multi-select-tag class="box-input" v-model="queryParam.brand"
|
||||||
:placeholder="$t('PleaseSelect')+$t('brand')"
|
:placeholder="$t('PleaseSelect')+$t('brand')"
|
||||||
:type="'select'"
|
:type="'select'"
|
||||||
:triggerChange="false" :dictCode="'brand'"/>
|
:triggerChange="false" :dictCode="'brand'"/>
|
||||||
@@ -285,7 +285,7 @@
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
width: 140,
|
width: 140,
|
||||||
dataIndex: 'brand'
|
dataIndex: 'brand_text'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('dateOfInitiation'),
|
title: this.$t('dateOfInitiation'),
|
||||||
|
|||||||
@@ -384,8 +384,12 @@
|
|||||||
},
|
},
|
||||||
loadUserduty(userid) {
|
loadUserduty(userid) {
|
||||||
queryViewerInfo({ userId: userid }).then((res) => {
|
queryViewerInfo({ userId: userid }).then((res) => {
|
||||||
|
if(res.dutyTerritoryList){
|
||||||
this.dutyTerritories = res.dutyTerritoryList.join(',')
|
this.dutyTerritories = res.dutyTerritoryList.join(',')
|
||||||
|
}
|
||||||
|
if(res.brandList){
|
||||||
this.brands = res.brandList.join(',')
|
this.brands = res.brandList.join(',')
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
selectChange(value){
|
selectChange(value){
|
||||||
|
|||||||
Reference in New Issue
Block a user