Commit c5189fa9 by zhiwj

指标修改

parent bbb5b080
......@@ -62,4 +62,6 @@ public interface TabIndexDescMapper {
// List<IndexDescDTO> listRecycle(@Param("enterpriseId") Integer enterpriseId, @Param("moduleId") String moduleId, @Param("indexGroupName") String indexGroupName, @Param("userId") Integer userId);
List<TabIndexDesc> listAllUnRel(@Param("ids") List<Integer> relIndexDescIdList);
List<TabIndexDesc> listByIds(@Param("ids") List<Integer> indexDescIdList);
}
\ No newline at end of file
......@@ -23,5 +23,7 @@ public interface IndexDescService {
TabIndexDesc getIndexDesc(Integer enterpriseId, Integer indexDescId);
List<TabIndexDesc> listAllUnRel(List<Integer> relModuleIdList);
List<TabIndexDesc> listAllUnRel(List<Integer> indexDescIdList);
List<TabIndexDesc> listByIds(List<Integer> indexDescIdList);
}
......@@ -53,7 +53,12 @@ public class IndexDescServiceImpl implements IndexDescService {
}
@Override
public List<TabIndexDesc> listAllUnRel(List<Integer> relModuleIdList) {
return tabIndexDescMapper.listAllUnRel(relModuleIdList);
public List<TabIndexDesc> listAllUnRel(List<Integer> indexDescIdList) {
return tabIndexDescMapper.listAllUnRel(indexDescIdList);
}
@Override
public List<TabIndexDesc> listByIds(List<Integer> indexDescIdList) {
return tabIndexDescMapper.listByIds(indexDescIdList);
}
}
......@@ -103,18 +103,23 @@ public class IndexDescApiServiceImpl implements IndexDescApiService {
@Override
public ServiceResponse<List<IndexDescDTO>> listAllUnRel(String moduleIds) {
List<String> list = new ArrayList<>();
List<String> relModuleIdList = indexModuleRelService.listRelModuleId(LogAndUpdateTipsTypeEnum.INDEX.getCode());
if (CollectionUtils.isNotEmpty(relModuleIdList)) {
list.addAll(relModuleIdList);
}
List<Integer> notInIndexDescIdList = Optional.of(relModuleIdList).orElse(Collections.emptyList())
.stream().map(Integer::valueOf).collect(Collectors.toList());
List<TabIndexDesc> indexDescList = this.indexDescService.listAllUnRel(notInIndexDescIdList);
if (StringUtils.isNotBlank(moduleIds)) {
List<String> relModuleIdList2 = Stream.of(moduleIds.split(",")).collect(Collectors.toList());
list.addAll(relModuleIdList2);
List<Integer> relModuleIdList2 = Stream.of(moduleIds.split(",")).map(Integer::valueOf).collect(Collectors.toList());
List<TabIndexDesc> indexDescList2 = this.indexDescService.listByIds(relModuleIdList2);
if (CollectionUtils.isNotEmpty(indexDescList2)) {
if (CollectionUtils.isEmpty(indexDescList)) {
indexDescList = new ArrayList<>();
}
indexDescList.addAll(indexDescList2);
}
}
List<Integer> indexDescIdList = Optional.of(list).orElse(Collections.emptyList())
.stream().map(Integer::valueOf).collect(Collectors.toList());
List<TabIndexDesc> indexDescList = this.indexDescService.listAllUnRel(indexDescIdList);
List<IndexDescDTO> indexDescDTOList = EntityUtil.changeEntityListByJSON(IndexDescDTO.class, indexDescList);
return EnterpriseServiceResponse.success(indexDescDTOList);
}
......
......@@ -215,4 +215,15 @@
</if>
order by module_id, index_desc_id
</select>
<select id="listByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_index_desc where status = 1
<if test="null != ids and ids.size > 0">
and index_desc_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment