add:政策资料中心修改

This commit is contained in:
wxyclub
2023-10-24 11:08:02 +08:00
parent b3acedf0e1
commit 00d1714ca8
5 changed files with 9 additions and 10 deletions
@@ -76,7 +76,7 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
// 若体系类别不存在,则默认属于根节点 // 若体系类别不存在,则默认属于根节点
if (StringUtils.isBlank(sarLawsInformation.getTreeNodeId())) { if (StringUtils.isBlank(sarLawsInformation.getTreeNodeId())) {
LambdaQueryWrapper<SarLawsInformationCenterTree> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SarLawsInformationCenterTree> wrapper = new LambdaQueryWrapper<>();
wrapper.isNull(SarLawsInformationCenterTree::getPId); wrapper.isNull(SarLawsInformationCenterTree::getParentId);
SarLawsInformationCenterTree one = treeService.getOne(wrapper); SarLawsInformationCenterTree one = treeService.getOne(wrapper);
sarLawsInformation.setTreeNodeId(one.getId()); sarLawsInformation.setTreeNodeId(one.getId());
} }
@@ -25,9 +25,8 @@ public class SarLawsInformationCenterTree implements Serializable {
/** /**
* 父ID * 父ID
*/ */
@JsonProperty("pId") @TableField(value = "parent_id")
@TableField(value = "p_id") private String parentId;
private String pId;
/** /**
* 节点名称 * 节点名称
@@ -19,7 +19,7 @@ public class SarLawsInformationCenterTreeData implements Serializable {
/** /**
* 父ID * 父ID
*/ */
private String pId; private String parentId;
/** /**
* 节点名称 * 节点名称
@@ -76,7 +76,7 @@ public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl<SarLaws
List<SarLawsInformationCenterTreeData> treeData = new ArrayList<>(); List<SarLawsInformationCenterTreeData> treeData = new ArrayList<>();
//代码遍历生成树 //代码遍历生成树
for (SarLawsInformationCenterTree informationCenterTree : list) { for (SarLawsInformationCenterTree informationCenterTree : list) {
if (StringUtils.isNotBlank(informationCenterTree.getPId())) { if (StringUtils.isNotBlank(informationCenterTree.getParentId())) {
SarLawsInformationCenterTreeData informationCenterTreeData = new SarLawsInformationCenterTreeData(); SarLawsInformationCenterTreeData informationCenterTreeData = new SarLawsInformationCenterTreeData();
BeanUtils.copyProperties(informationCenterTree, informationCenterTreeData); BeanUtils.copyProperties(informationCenterTree, informationCenterTreeData);
treeData.add(informationCenterTreeData); treeData.add(informationCenterTreeData);
@@ -105,7 +105,7 @@ public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl<SarLaws
@Override @Override
public void setResource(SarLawsInformationCenterTree informationCenterTree) { public void setResource(SarLawsInformationCenterTree informationCenterTree) {
//获取pid //获取pid
String pId = informationCenterTree.getPId(); String pId = informationCenterTree.getParentId();
List<String> roleIds = tsRoleDao.getResourceId(pId); List<String> roleIds = tsRoleDao.getResourceId(pId);
for (String roleId : roleIds){ for (String roleId : roleIds){
tsRoleDao.addResource(roleId,informationCenterTree.getId()); tsRoleDao.addResource(roleId,informationCenterTree.getId());
@@ -119,7 +119,7 @@ public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl<SarLaws
List<SarLawsInformationCenterTreeData> data1=new ArrayList<>(); List<SarLawsInformationCenterTreeData> data1=new ArrayList<>();
res.setChildren(data1); res.setChildren(data1);
} }
if (res.getId().equals(data.getPId())){ if (res.getId().equals(data.getParentId())){
if (null!=res.getChildren()){ if (null!=res.getChildren()){
res.getChildren().add(data); res.getChildren().add(data);
}else { }else {
@@ -6,13 +6,13 @@
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree"> <resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree">
<result property="id" column="id" jdbcType="VARCHAR"/> <result property="id" column="id" jdbcType="VARCHAR"/>
<result property="pId" column="p_id" jdbcType="VARCHAR"/> <result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/> <result property="name" column="name" jdbcType="VARCHAR"/>
<result property="sort" column="sort" jdbcType="INTEGER"/> <result property="sort" column="sort" jdbcType="INTEGER"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,p_id,`name`, id,parent_id,`name`,
sort sort
</sql> </sql>
</mapper> </mapper>