add:PDMC系统集成标准法规系统接口需求系统集成标准法规系统接口需求,读取目录树和读取文件接口
This commit is contained in:
@@ -168,6 +168,11 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
// 操作日志导出
|
||||
addInterceptor.excludePathPatterns("/api/sysLog/sys-log/exportSysLogExcelVOExcelData");
|
||||
|
||||
// 对外接口:读取目录树接口
|
||||
addInterceptor.excludePathPatterns("/api/pdmcSarResource/ts-resource/getMenu");
|
||||
// 对外接口:读取海外标准和国家标准文件接口
|
||||
addInterceptor.excludePathPatterns("/api/pdmcSarStandardsInfo/sar-standards-info/getSarStandardsInfo");
|
||||
|
||||
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/search/resetSearchCenter/resetALLSearchCenterForExits");
|
||||
|
||||
@@ -17,7 +17,9 @@ public class MybatisPlusConfig {
|
||||
|
||||
@Bean
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
return new PaginationInterceptor();
|
||||
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
|
||||
paginationInterceptor.setLimit(-1);
|
||||
return paginationInterceptor;
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
+7
-2
@@ -5,13 +5,14 @@ import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.pdmcSarResource.entity.PDMCSarResource;
|
||||
import com.adc.da.pdmcSarResource.service.PDMCSarResourceService;
|
||||
import com.adc.da.slrs.sarResource.entity.TsResource;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -19,7 +20,7 @@ import java.util.List;
|
||||
* 对外接口:目录树接口
|
||||
* </p>
|
||||
*
|
||||
* @author Administrator
|
||||
* @author wxy
|
||||
* @date 2023-05-10
|
||||
*/
|
||||
@Api("目录树接口")
|
||||
@@ -29,9 +30,13 @@ public class PDMCSarResourceController extends BaseController<PDMCSarResource> {
|
||||
@Resource
|
||||
private PDMCSarResourceService pdmcSarResourceService;
|
||||
|
||||
@ApiOperation("获取目录菜单树")
|
||||
@GetMapping("/getMenu")
|
||||
public ResponseMessage<List<PDMCSarResource>> getMenu() {
|
||||
List<PDMCSarResource> menuList = pdmcSarResourceService.getMenuList();
|
||||
if (menuList.isEmpty()){
|
||||
return Result.error("404","目录为空",menuList);
|
||||
}
|
||||
return Result.success(menuList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,22 +3,18 @@ package com.adc.da.pdmcSarResource.entity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* TODO 添加类/接口功能描述
|
||||
* 对外接口,目录实体类
|
||||
* </p>
|
||||
*
|
||||
* @author Administrator
|
||||
* @author wxy
|
||||
* @date 2023-05-10
|
||||
*/
|
||||
@ApiModel(value = "PDMCTsResource对象",description = "")
|
||||
@@ -49,8 +45,4 @@ public class PDMCSarResource {
|
||||
@ApiModelProperty("排序字段")
|
||||
@TableField("DISPLAY_SEQ")
|
||||
private Long displaySeq;
|
||||
|
||||
@ApiModelProperty("子节点")
|
||||
@TableField(exist=false)
|
||||
private List<PDMCSarResource> children;
|
||||
}
|
||||
|
||||
+5
-23
@@ -5,14 +5,11 @@ import com.adc.da.pdmcSarResource.entity.PDMCSarResource;
|
||||
import com.adc.da.pdmcSarResource.service.PDMCSarResourceService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -35,32 +32,17 @@ public class PDMCSarResourceServiceImpl extends ServiceImpl<PDMCSarResourceDao,
|
||||
queryWrapper.isNull("PARENT_ID");
|
||||
queryWrapper.eq("VALID_FLAG","0");
|
||||
queryWrapper.eq("SOR_DIVIDE","INLAND_STAND").or().eq("SOR_DIVIDE","FOREIGN_STAND");
|
||||
queryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
// queryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
pdmcSarResourceList=pdmcSarResourceDao.selectList(queryWrapper);
|
||||
for(PDMCSarResource resource:pdmcSarResourceList){
|
||||
List<PDMCSarResource> pdmcSarResourceListTemp = new ArrayList<>(pdmcSarResourceList);
|
||||
for(PDMCSarResource resource:pdmcSarResourceListTemp){
|
||||
QueryWrapper<PDMCSarResource> TsResourceQueryWrapper=new QueryWrapper<>();
|
||||
TsResourceQueryWrapper.eq("VALID_FLAG","0");
|
||||
TsResourceQueryWrapper.like("PARENT_IDS",","+resource.getId()+",");
|
||||
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
// TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
List<PDMCSarResource> children=pdmcSarResourceDao.selectList(TsResourceQueryWrapper);
|
||||
resource.setChildren(recursionGetListChildrenStand(resource,children));
|
||||
pdmcSarResourceList.addAll(children);
|
||||
}
|
||||
return pdmcSarResourceList;
|
||||
}
|
||||
/**
|
||||
* 递归调用获取子节点
|
||||
* @return List<PDMCSarResource>
|
||||
*/
|
||||
private List<PDMCSarResource> recursionGetListChildrenStand(PDMCSarResource resource,List<PDMCSarResource> children){
|
||||
List<PDMCSarResource> tsResources = children.stream()
|
||||
.filter(resource1 -> !children.isEmpty() && StringUtils.isNotBlank(resource1.getParentId()) && resource1.getParentId().equals(resource.getId()))
|
||||
.collect(Collectors.toList());
|
||||
if(!tsResources.isEmpty()){
|
||||
tsResources = tsResources.stream().sorted(Comparator.comparing(PDMCSarResource::getDisplaySeq)).collect(Collectors.toList());
|
||||
tsResources.forEach(resource1 -> {
|
||||
resource1.setChildren(recursionGetListChildrenStand(resource1,children));
|
||||
});
|
||||
}
|
||||
return tsResources;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -41,8 +40,7 @@ public class PDMCSarLawsStandInfoController extends BaseController<PDMCSarLawsSt
|
||||
@GetMapping("getSarStandardsInfo")
|
||||
public ResponseMessage<PageInfo<PDMCSarLawsStandInfo>> getSarStandardsInfoPage(
|
||||
@RequestParam(value = "current", defaultValue = "1") Long current,
|
||||
@RequestParam(value = "limit",required = false,defaultValue = "100") Long limit,
|
||||
@RequestParam(defaultValue = "0") String mark) throws Exception {
|
||||
@RequestParam(value = "limit",required = false,defaultValue = "100") Long limit) throws Exception {
|
||||
if (ObjectUtil.isEmpty(current)){
|
||||
current = 1L;
|
||||
}
|
||||
@@ -56,6 +54,9 @@ public class PDMCSarLawsStandInfoController extends BaseController<PDMCSarLawsSt
|
||||
pdmcSarLawsStandInfoPageInfo.setPageNo((int)sarStandardsInfoPage.getCurrent());
|
||||
pdmcSarLawsStandInfoPageInfo.setCount(sarStandardsInfoPage.getTotal());
|
||||
pdmcSarLawsStandInfoPageInfo.setPageSize((int) sarStandardsInfoPage.getSize());
|
||||
if (pdmcSarLawsStandInfoPageInfo.getList().isEmpty()) {
|
||||
return Result.error("404","文件信息为空",pdmcSarLawsStandInfoPageInfo);
|
||||
}
|
||||
return Result.success(pdmcSarLawsStandInfoPageInfo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user