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())) {
LambdaQueryWrapper<SarLawsInformationCenterTree> wrapper = new LambdaQueryWrapper<>();
wrapper.isNull(SarLawsInformationCenterTree::getPId);
wrapper.isNull(SarLawsInformationCenterTree::getParentId);
SarLawsInformationCenterTree one = treeService.getOne(wrapper);
sarLawsInformation.setTreeNodeId(one.getId());
}
@@ -25,9 +25,8 @@ public class SarLawsInformationCenterTree implements Serializable {
/**
* 父ID
*/
@JsonProperty("pId")
@TableField(value = "p_id")
private String pId;
@TableField(value = "parent_id")
private String parentId;
/**
* 节点名称
@@ -19,7 +19,7 @@ public class SarLawsInformationCenterTreeData implements Serializable {
/**
* 父ID
*/
private String pId;
private String parentId;
/**
* 节点名称
@@ -76,7 +76,7 @@ public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl<SarLaws
List<SarLawsInformationCenterTreeData> treeData = new ArrayList<>();
//代码遍历生成树
for (SarLawsInformationCenterTree informationCenterTree : list) {
if (StringUtils.isNotBlank(informationCenterTree.getPId())) {
if (StringUtils.isNotBlank(informationCenterTree.getParentId())) {
SarLawsInformationCenterTreeData informationCenterTreeData = new SarLawsInformationCenterTreeData();
BeanUtils.copyProperties(informationCenterTree, informationCenterTreeData);
treeData.add(informationCenterTreeData);
@@ -105,7 +105,7 @@ public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl<SarLaws
@Override
public void setResource(SarLawsInformationCenterTree informationCenterTree) {
//获取pid
String pId = informationCenterTree.getPId();
String pId = informationCenterTree.getParentId();
List<String> roleIds = tsRoleDao.getResourceId(pId);
for (String roleId : roleIds){
tsRoleDao.addResource(roleId,informationCenterTree.getId());
@@ -119,7 +119,7 @@ public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl<SarLaws
List<SarLawsInformationCenterTreeData> data1=new ArrayList<>();
res.setChildren(data1);
}
if (res.getId().equals(data.getPId())){
if (res.getId().equals(data.getParentId())){
if (null!=res.getChildren()){
res.getChildren().add(data);
}else {
@@ -6,13 +6,13 @@
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree">
<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="sort" column="sort" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
id,p_id,`name`,
id,parent_id,`name`,
sort
</sql>
</mapper>