组态添加全局的概念

This commit is contained in:
2025-12-23 14:42:32 +08:00
parent bc6f3dca80
commit c7dce89d36
4 changed files with 46 additions and 37 deletions

View File

@@ -62,6 +62,8 @@ public class CsConfigurationParm {
private String id; private String id;
@ApiModelProperty(value = "当前用户ID") @ApiModelProperty(value = "当前用户ID")
private String currentUserId; private String currentUserId;
@ApiModelProperty(value = "当前用户角色")
private String roleCode;
} }

View File

@@ -31,6 +31,8 @@ public class CsConfigurationVO extends BaseEntity {
private Integer orderBy; private Integer orderBy;
private Integer scope;
private List<String> projectIds; private List<String> projectIds;

View File

@@ -7,6 +7,7 @@
<id column="id" jdbcType="VARCHAR" property="id" /> <id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
<result column="status" jdbcType="INTEGER" property="status" /> <result column="status" jdbcType="INTEGER" property="status" />
<result column="scope" jdbcType="INTEGER" property="scope" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> <result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
@@ -14,7 +15,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, `name`, `status`, create_by, create_time, update_by, update_time id, `name`, `status`, `scope`,create_by, create_time, update_by, update_time
</sql> </sql>
<select id="queryPage" resultMap="BaseResultMap"> <select id="queryPage" resultMap="BaseResultMap">
@@ -24,7 +25,11 @@
<foreach collection="list" index="index" item="item" open="(" separator="," close=")"> <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
AND (a.scope = 1 OR (a.scope = 0 AND a.create_by = #{userId})) AND (a.scope = 1
<if test="userId != null and userId != ''">
OR (a.scope = 0 AND a.create_by = #{userId})
</if>
)
<if test="temp!=null and temp.searchValue != null and temp.searchValue !=''"> <if test="temp!=null and temp.searchValue != null and temp.searchValue !=''">
AND a.name like concat(concat("%",#{temp.searchValue}),"%") AND a.name like concat(concat("%",#{temp.searchValue}),"%")
</if> </if>

View File

@@ -56,11 +56,10 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
BeanUtils.copyProperties(csConfigurationParm, csConfigurationPO); BeanUtils.copyProperties(csConfigurationParm, csConfigurationPO);
List<String> projectIds = csConfigurationParm.getProjectIds(); List<String> projectIds = csConfigurationParm.getProjectIds();
if(CollectionUtils.isEmpty(projectIds)){ String projects = "";
throw new BusinessException("请选择项目"); if (!CollectionUtils.isEmpty(projectIds)) {
projects = String.join(",", projectIds);
} }
String projects = String.join(",", projectIds);
csConfigurationPO.setProjectIds(projects); csConfigurationPO.setProjectIds(projects);
//排序不填给个100往后排 //排序不填给个100往后排
csConfigurationPO.setOrderBy(Objects.isNull(csConfigurationParm.getOrderBy()) ? 100 : csConfigurationParm.getOrderBy()); csConfigurationPO.setOrderBy(Objects.isNull(csConfigurationParm.getOrderBy()) ? 100 : csConfigurationParm.getOrderBy());
@@ -119,15 +118,17 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
Page<CsConfigurationPO> temppage = new Page<>(csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize()); Page<CsConfigurationPO> temppage = new Page<>(csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize());
List<String> data1 = roleEngineerDevFeignClient.getRoleProject().getData(); List<String> data1 = roleEngineerDevFeignClient.getRoleProject().getData();
if(CollectionUtils.isEmpty(data1)){ // if (CollectionUtils.isEmpty(data1)) {
return returnpage; // return returnpage;
} // }
//+无线项目id //+无线项目id
data1.add(DataParam.WIRELESS_PROJECT_ID); data1.add(DataParam.WIRELESS_PROJECT_ID);
String userId = csConfigurationQueryParam.getCurrentUserId();
String roleCode = csConfigurationQueryParam.getRoleCode();
if (roleCode.indexOf("operation_manager") > 0) {
Page<CsConfigurationPO> csConfigurationPOPage = this.getBaseMapper().queryPage(temppage,csConfigurationQueryParam,data1,csConfigurationQueryParam.getCurrentUserId()); userId = null;
}
Page<CsConfigurationPO> csConfigurationPOPage = this.getBaseMapper().queryPage(temppage, csConfigurationQueryParam, data1, userId);
// QueryWrapper<CsConfigurationPO> query = new QueryWrapper<>(); // QueryWrapper<CsConfigurationPO> query = new QueryWrapper<>();
// query.like(StringUtils.isNotBlank(csConfigurationQueryParam.getSearchValue()),CsConfigurationPO.COL_NAME,csConfigurationQueryParam.getSearchValue()). // query.like(StringUtils.isNotBlank(csConfigurationQueryParam.getSearchValue()),CsConfigurationPO.COL_NAME,csConfigurationQueryParam.getSearchValue()).
// le (StringUtils.isNotBlank (csConfigurationQueryParam.getSearchEndTime()), CsConfigurationPO.COL_CREATE_TIME, csConfigurationQueryParam.getSearchEndTime ( )). // le (StringUtils.isNotBlank (csConfigurationQueryParam.getSearchEndTime()), CsConfigurationPO.COL_CREATE_TIME, csConfigurationQueryParam.getSearchEndTime ( )).
@@ -174,7 +175,6 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
returnpage.setTotal(csConfigurationPOPage.getTotal()); returnpage.setTotal(csConfigurationPOPage.getTotal());
return returnpage; return returnpage;
} }