Merge branch 'develop_master' into FOTON

# Conflicts:
#	adc-da-main/src/main/resources/application.properties
This commit is contained in:
Superman_Main
2021-11-27 19:55:06 +08:00
19 changed files with 972 additions and 142 deletions
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarModelTree.controller;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
import com.adc.da.slrs.sarModelTree.service.ISarModelTreeService;
import com.adc.da.slrs.sarModelTree.service.ISarModuleTreeService;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
@@ -38,17 +39,18 @@ public class SarModelTreeController extends BaseController<SarModelTree> {
@ApiOperation("查询父所有资源")
@GetMapping("/list")
public ResponseMessage<List<SarModelTree>> getAll(){
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
// TODO List<SarModelTree> tsResources = iSarModuleTreeService.getAll(null);
// List<SarModuleTree> tsResources = iSarModuleTreeService.getAll(null);
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
return Result.success(tsResources);
}
@ApiOperation("根据父ID查询子所有资源")
@GetMapping("/childByList")
public ResponseMessage<List<SarModelTree>> childByList(String ids){
SarModelTree tree = new SarModelTree();
tree.setId(ids);
List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(tree);
public ResponseMessage<List<SarModelTree>> childByList(SarModelTree parentTree){
// List<SarModuleTree> tsResources = iSarModuleTreeService.recursionGetChildren(parentTree);
List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(parentTree);
return Result.success(tsResources);
}
@@ -13,7 +13,7 @@ import java.util.List;
/**
* <p>
*
*
* </p>
*
* @author super_liu
@@ -70,7 +70,13 @@ public class SarModuleTree {
@TableField("CREATIONDATE")
private String creationdate;
@TableField(exist = false)
private Integer level;
@TableField(exist = false)
private String model;
@TableField(exist = false)
private String nextCondition;
}
@@ -1,15 +1,16 @@
package com.adc.da.slrs.sarModelTree.service;
import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
import java.util.List;
public interface ISarModuleTreeService {
List<SarModelTree> getAll(SarModelTree sarModelTree);
List<SarModuleTree> getAll(SarModuleTree root);
List<SarModelTree> recursionGetChildren(SarModelTree parent);
List<SarModuleTree> recursionGetChildren(SarModuleTree parent);
public Head analysisJsonAndStorage(String json);
@@ -32,6 +32,9 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
// for(SarModelTree tree:list){
// tree.setChildren(recursionGetChildren((tree)));
// }
list.forEach(item->{
item.setId(item.getName());
});
return list;
}
@@ -44,11 +47,16 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
public List<SarModelTree> recursionGetChildren(SarModelTree parent){
QueryWrapper<SarModelTree> sarMenuQueryWrapper=new QueryWrapper<>();
sarMenuQueryWrapper.orderByAsc("SORT");
sarMenuQueryWrapper.in("PID",parent.getId());
// sarMenuQueryWrapper.in("PID",parent.getId());
sarMenuQueryWrapper.eq("PID",parent.getId());
List<SarModelTree> children=this.baseMapper.selectList(sarMenuQueryWrapper);
for(SarModelTree sarMenu:children){
sarMenu.setChildren(recursionGetChildren((sarMenu)));
}
// for(SarModelTree sarMenu:children){
// sarMenu.setChildren(recursionGetChildren((sarMenu)));
// }
children.forEach(item->{
item.setId(item.getName());
});
return children;
}
}
@@ -15,9 +15,11 @@ import com.google.gson.JsonParser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.awt.event.MouseAdapter;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.stream.Collectors;
@Service
@@ -27,16 +29,27 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
private SarModuleTreeServiceImpl sarModuleTreeService;
/**
* @param sarModelTree
* @return 所有的根节点
*/
@Override
public List<SarModelTree> getAll(SarModelTree sarModelTree) {
public List<SarModuleTree> getAll(SarModuleTree root) {
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
treeQueryWrapper.groupBy("FTVSTYPE1");
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
treeQueryWrapper.select("FTVSTYPE1")
.groupBy("FTVSTYPE1");
List<Map<String, Object>> moduleTreeList = this.baseMapper.selectMaps(treeQueryWrapper);
List<SarModuleTree> collect = moduleTreeList.stream()
.map(item -> {
SarModuleTree sarModuleTree = new SarModuleTree();
sarModuleTree.setNextCondition(item.get("FTVSTYPE1").toString());
sarModuleTree.setLevel(1);
sarModuleTree.setModel(item.get("FTVSTYPE1").toString());
return sarModuleTree;
}).collect(Collectors.toList());
//返回转换元素后的数组
return listTransform(moduleTreeList);
return collect;
}
/**
@@ -45,20 +58,47 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
* @return
*/
@Override
public List<SarModelTree> recursionGetChildren(SarModelTree parent) {
public List<SarModuleTree> recursionGetChildren(SarModuleTree parent) {
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
treeQueryWrapper.eq("GUID",parent.getId());
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
Integer level =parent.getLevel();
switch (parent.getLevel()){
case 1:
level=2;
break;
case 6:
return null;
}
String column="FTVSTYPE"+(level+1);
treeQueryWrapper.select(column)
.eq("FTVSTYPE"+parent.getLevel(),parent.getNextCondition())
.groupBy(column);
List<Map<String, Object>> moduleTreeList = this.baseMapper.selectMaps(treeQueryWrapper);
Integer finalLevel = level;
List<SarModuleTree> collect = moduleTreeList.stream()
.map(item -> {
SarModuleTree sarModuleTree = new SarModuleTree();
sarModuleTree.setNextCondition(item.get(column).toString()); //查询子节点条件
sarModuleTree.setLevel(finalLevel + 1);
//拼接前端显示名称
// switch (finalLevel){
// case 3:
// sarModuleTree.setModel(item.get(column).toString());//前端显示名称
// break;
// case
// }
Map<String, List<SarModuleTree>> collect = moduleTreeList.stream().collect(Collectors.groupingBy(SarModuleTree::getFtvstype1));
collect.forEach((k, v)->{
SarModelTree modelTree = new SarModelTree();
//TODO 生成树型结构
// modelTree
});
return null;
return sarModuleTree;
}).collect(Collectors.toList());
return collect;
}
@Override
@@ -155,24 +155,24 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
page.setPageSize(findStandDto.getSize());
page.setUserId(null);
List<SarStandardsInfo> pageInfo = null;
try {
pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
} catch (Exception e) {
e.printStackTrace();
}
// try {
// pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
// } catch (Exception e) {
// e.printStackTrace();
// }
List<String> standId = new ArrayList<>();
for (SarStandardsInfo standardsInfo : pageInfo){
if (standardsInfo.getAttrInfoCaseMap().get("FBGBJBD")!=null || standardsInfo.getAttrInfoCaseMap().get("fbgbjbd")!=null){
standId.add(standardsInfo.getId());
}
}
// for (SarStandardsInfo standardsInfo : pageInfo){
//// if (standardsInfo.getAttrInfoCaseMap().get("FBGBJBD")!=null || standardsInfo.getAttrInfoCaseMap().get("fbgbjbd")!=null){
// standId.add(standardsInfo.getId());
//// }
// }
List<LawsDto> list=new ArrayList<>();
if (standId==null || standId.size()==0){
list = null;
}else {
// if (standId==null || standId.size()==0){
// list = null;
// }else {
list = sarLawsAttrDetailedListDao.selectLawsByIdC((findStandDto.getPage()-1)*findStandDto.getSize(),findStandDto.getPage()*findStandDto.getSize(),standId,findStandDto.getStandName(), findStandDto.getStandType(),findStandDto.getFileType());
}
// }
IPage<LawsDto> page1=new Page<>();
page1.setRecords(list);
page1.setTotal(sarLawsAttrDetailedListDao.selectLawsByIdCount(standId,findStandDto.getStandName(),findStandDto.getStandType(),findStandDto.getFileType()).size());
@@ -195,6 +195,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
public List<SarStandItemsDto> findAllItems(String type,String[] ids){
List<SarStandItemsDto> list=dao.selectAllItemsByIds(type,ids);
List<SarStandItemsDto> res=new ArrayList<>();
List<SarStandItemsDto> chinese=new ArrayList<>();
if (null == list || list.isEmpty()){
return list;
}else {
@@ -206,20 +207,24 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
if (a>0){
mark=mark.substring(0,a);
}
if (null != map.get(Integer.valueOf(mark))){
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
}else {
integerList.add(Integer.valueOf(mark));
List<SarStandItemsDto> middle=new ArrayList<>();
middle.add(sarStandItemsDto);
map.put(Integer.valueOf(mark),middle);
}
try {
if (null != map.get(Integer.valueOf(mark))) {
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
} else {
integerList.add(Integer.valueOf(mark));
List<SarStandItemsDto> middle = new ArrayList<>();
middle.add(sarStandItemsDto);
map.put(Integer.valueOf(mark), middle);
}
}catch (Exception e){
chinese.add(sarStandItemsDto);
}
});
Collections.sort(integerList);
integerList.forEach(integer -> {
res.addAll(map.get(integer));
});
res.addAll(chinese);
return res;
}
}
@@ -74,6 +74,9 @@ public class SarVppsTree extends BaseEntity {
@TableField("TYPE")
private String type;
@ApiModelProperty("查询子节点条件")
@TableField(exist = false)
private String nextCondition;
@TableField(exist=false)
private List<String> roleIds;
@@ -82,4 +85,6 @@ public class SarVppsTree extends BaseEntity {
private List<String> childMenuIds;
}
@@ -31,7 +31,10 @@ public class SarVppsTreeServiceImpl extends ServiceImpl<SarVppsTreeDao, SarVppsT
.eq("LEVEL",0);
List<SarVppsTree> list = this.baseMapper.selectList(tsResourceQueryWrapper);
list.forEach(item->item.setVppsCode("10"));
list.forEach(item->{
item.setCode(item.getVppsCode()+item.getChineseName());
item.setId("10");
});
// for(SarVppsTree tree:list){
// tree.setChildren(recursionGetChildren((tree)));
// }
@@ -47,14 +50,16 @@ public class SarVppsTreeServiceImpl extends ServiceImpl<SarVppsTreeDao, SarVppsT
public List<SarVppsTree> recursionGetChildren(SarVppsTree parent){
QueryWrapper<SarVppsTree> sarMenuQueryWrapper=new QueryWrapper<>();
sarMenuQueryWrapper.orderByAsc("SORT");
// sarMenuQueryWrapper.in("PID",parent.getId());
sarMenuQueryWrapper.eq("LEVEL", parent.getLevel()+1)
.eq("TYPE",parent.getType())
.like("VPPS_CODE",parent.getVppsCode());
.like("VPPS_CODE",parent.getId());
List<SarVppsTree> children=this.baseMapper.selectList(sarMenuQueryWrapper);
// for(SarVppsTree sarMenu:children){
// sarMenu.setChildren(recursionGetChildren((sarMenu)));
// }
children.forEach(item->{
item.setId(item.getVppsCode());
item.setCode(item.getVppsCode()+item.getChineseName());
});
return children;
}
}
@@ -99,95 +99,43 @@
order by number
</select>
<select id="selectLawsByIdC" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
select distinct c.ID,c.* from (
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
and
</if>
<if test="fileType !=null">
ssi.FILE_TYPE = #{fileType} and
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
a.STAND_TYPE = #{standType} and
and a.STAND_TYPE = #{standType}
</if>
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
UNION
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
<where>
<if test="standName != null">
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
and
</if>
<if test="fileType !=null">
ssi.FILE_TYPE = #{fileType} and
</if>
<if test="standType !=null">
a.STAND_TYPE = #{standType} and
</if>
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
limit #{start},#{end}
</select>
<select id="selectLawsByIdCount" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
<where>
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and
ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and
a.STAND_TYPE = #{standType}
</if>
<if test="param1 !=null and param1.size()>0 " >
and
a.ID IN
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
UNION
UNION all
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
@@ -196,21 +144,82 @@
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and
ssi.FILE_TYPE = #{fileType}
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and
a.STAND_TYPE = #{standType}
and a.STAND_TYPE = #{standType}
</if>
<if test="param1 !=null and param1.size()>0 " >
and
a.ID IN
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
)c
limit #{start},#{end}
</select>
<select id="selectLawsByIdCount" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
select distinct c.ID,c.* from (
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and a.STAND_TYPE = #{standType}
</if>
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
UNION all
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and a.STAND_TYPE = #{standType}
</if>
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
)c
</select>
<select id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto">