2 Commits

Author SHA1 Message Date
3ea67da152 Merge remote-tracking branch 'origin/master' 2025-12-23 14:42:38 +08:00
c7dce89d36 组态添加全局的概念 2025-12-23 14:42:32 +08:00
4 changed files with 46 additions and 37 deletions

View File

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

View File

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

View File

@@ -7,6 +7,7 @@
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<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_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
@@ -14,7 +15,7 @@
</resultMap>
<sql id="Base_Column_List">
<!--@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>
<select id="queryPage" resultMap="BaseResultMap">
@@ -24,7 +25,11 @@
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</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 !=''">
AND a.name like concat(concat("%",#{temp.searchValue}),"%")
</if>

View File

@@ -56,11 +56,10 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
BeanUtils.copyProperties(csConfigurationParm, csConfigurationPO);
List<String> projectIds = csConfigurationParm.getProjectIds();
if(CollectionUtils.isEmpty(projectIds)){
throw new BusinessException("请选择项目");
String projects = "";
if (!CollectionUtils.isEmpty(projectIds)) {
projects = String.join(",", projectIds);
}
String projects = String.join(",", projectIds);
csConfigurationPO.setProjectIds(projects);
//排序不填给个100往后排
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());
List<String> data1 = roleEngineerDevFeignClient.getRoleProject().getData();
if(CollectionUtils.isEmpty(data1)){
return returnpage;
}
// if (CollectionUtils.isEmpty(data1)) {
// return returnpage;
// }
//+无线项目id
data1.add(DataParam.WIRELESS_PROJECT_ID);
Page<CsConfigurationPO> csConfigurationPOPage = this.getBaseMapper().queryPage(temppage,csConfigurationQueryParam,data1,csConfigurationQueryParam.getCurrentUserId());
String userId = csConfigurationQueryParam.getCurrentUserId();
String roleCode = csConfigurationQueryParam.getRoleCode();
if (roleCode.indexOf("operation_manager") > 0) {
userId = null;
}
Page<CsConfigurationPO> csConfigurationPOPage = this.getBaseMapper().queryPage(temppage, csConfigurationQueryParam, data1, userId);
// QueryWrapper<CsConfigurationPO> query = new QueryWrapper<>();
// query.like(StringUtils.isNotBlank(csConfigurationQueryParam.getSearchValue()),CsConfigurationPO.COL_NAME,csConfigurationQueryParam.getSearchValue()).
// 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());
return returnpage;
}