Merge branch 'develop_master' into 'FOTON'

Develop master

See merge request LiuChao/foton-slrs-system-rest!328
This commit is contained in:
王夏晖
2021-12-27 16:34:49 +08:00
4 changed files with 281 additions and 4 deletions
@@ -714,7 +714,14 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
}
public void attrInfoShowExport(List<SarStandardsInfo> sarlist) throws Exception {
public void attrInfoShowExport(List<SarStandardsInfo> sarlist) throws Exception {
List<DicTypeEO> dicInfo = dicTypeEODao.getDicInfo("dic_type_code", "dic_type_name");
Map<String, String> dicMap =
dicInfo.stream()
.collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getDicTypeName,(value1, value2 )->value2));
for (SarStandardsInfo row : sarlist) {
attrInfoDetailsExport(row);
Map<String, Object> getAttrMap = row.getAttrInfoMap();
@@ -724,6 +731,28 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
String value = "";
/**
*============================ 对getAttrMap的value赋值中文名称===============================
*/
if(entry.getValue()!=null) {
StringBuilder builder = new StringBuilder("");
for (String s : entry.getValue().toString().split(",")) {
if (dicMap.containsKey(s)) {
builder.append(dicMap.get(s)+" ");
} else {
builder.append(entry.getValue().toString());
}
getAttrMap.put(name, builder.toString());
}
}
/**
*============================ 对getAttrMap的value赋值中文名称===============================
*/
if ("SVPPS".equals(name)) {
Object svpps = entry.getValue();
if (svpps != null && StringUtils.isNotBlank(svpps.toString())) {
@@ -760,6 +789,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
getAttrMap.put("SVPPSTips", svppsTip);
}
//对attrMap赋值
row.setAttrInfoMap(getAttrMap);
}
}
@@ -106,6 +106,47 @@
dicstandTextStatus.DIC_TYPE_NAME as standTextStatusShow,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
</sql>
<sql id="Base_Column_List_Export_Show" >
SAR_STANDARDS_INFO.id,
SAR_STANDARDS_INFO.stand_type,
SAR_STANDARDS_INFO.country,
SAR_STANDARDS_INFO.stand_sort,
SAR_STANDARDS_INFO.stand_number,
SAR_STANDARDS_INFO.stand_year,
SAR_STANDARDS_INFO.stand_name,
SAR_STANDARDS_INFO.stand_en_name,
SAR_STANDARDS_INFO.stand_state,
SAR_STANDARDS_INFO.stand_nature,
SAR_STANDARDS_INFO.issue_time,
SAR_STANDARDS_INFO.put_time,
concat(SAR_STANDARDS_INFO.synopsis, '') as synopsis,
concat(replace_stand_num, '') as replace_stand_num,
replaced_stand_num,
SAR_STANDARDS_INFO.creation_user,
SAR_STANDARDS_INFO.valid_flag,
SAR_STANDARDS_INFO.creation_time,
SAR_STANDARDS_INFO.modify_time,
dicstandSort.DIC_TYPE_NAME as standSortShow,
dicstandNature.DIC_TYPE_NAME as standNatureShow,
dicstandTextStatus.DIC_TYPE_NAME as standTextStatusShow,
is_relate_access,
cite_stand,
cited_stand,
SAR_STANDARDS_INFO.text_status,
SAR_STANDARDS_INFO.STAND_SYSTEM
</sql>
<sql id="Group_Column_List_Export_Show">
SAR_STANDARDS_INFO.id, SAR_STANDARDS_INFO.stand_type, SAR_STANDARDS_INFO.country, SAR_STANDARDS_INFO.stand_sort,
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
SAR_STANDARDS_INFO.stand_state, SAR_STANDARDS_INFO.stand_nature, SAR_STANDARDS_INFO.issue_time, SAR_STANDARDS_INFO.put_time,
concat(SAR_STANDARDS_INFO.synopsis, ''), concat(replace_stand_num, ''), replaced_stand_num, SAR_STANDARDS_INFO.creation_user, SAR_STANDARDS_INFO.valid_flag,
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time, dicstandSort.DIC_TYPE_NAME,
dicstandNature.DIC_TYPE_NAME,
dicstandTextStatus.DIC_TYPE_NAME,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
</sql>
<sql id="Group_Column_List_Show">
SAR_STANDARDS_INFO.id, SAR_STANDARDS_INFO.stand_type, SAR_STANDARDS_INFO.country, SAR_STANDARDS_INFO.stand_sort,
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
@@ -587,6 +628,190 @@
</trim>
</sql>
<sql id="SarStandardsInfo_Where_Export_Clause">
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
dicstandTextStatus.dic_type_code = SAR_STANDARDS_INFO.text_status
AND dicstandTextStatus.dic_id IS NOT NULL
AND dicstandTextStatus.valid_flag = 0
)
LEFT JOIN TS_DICTYPE dicstandNature ON (
dicstandNature.dic_type_code = SAR_STANDARDS_INFO.stand_nature
AND dicstandNature.dic_id IS NOT NULL
AND dicstandNature.valid_flag = 0
)
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
left join TS_RESOURCE on SAR_STAND_MENU.menu_id = TS_RESOURCE.id
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
left join TS_PERSON_COLLECT on (TS_PERSON_COLLECT.COLLECT_RES_ID = SAR_STANDARDS_INFO.id and TS_PERSON_COLLECT.VALID_FLAG=0)
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
<trim suffixOverrides=",">
<!-- 标准分类 国内标准,国外标准 必要搜索项 -->
<if test='standType != null and standType != "ALL"'>
and stand_type = #{standType}
</if>
<!-- 基本搜索项 -->
<!-- 国家、地区 -->
<if test="country != null and country != ''">
and country = #{country}
</if>
<!-- 标准编号111 -->
<if test="standNumber != null and standNumber != ''">
and (
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ',''))
)
<!-- and SAR_STANDARDS_INFO.STAND_YEAR = '' -->
or (stand_name like concat(concat('%',#{standNumber}),'%'))
)
</if>
<!-- 标准名称 -->
<if test="standName != null and standName != ''">
and stand_name like concat(concat('%',#{standName}),'%')
or STAND_NUMBER like concat(concat('%',#{standName}),'%')
or STAND_YEAR like concat(concat('%',#{standName}),'%')
or STAND_SORT like concat(concat('%',#{standName}),'%')
</if>
<if test="standEnName != null and standEnName != ''">
and stand_en_name like concat(concat('%',#{standEnName}),'%')
</if>
<!-- 标准状态 -->
<if test="standState != null and standState != ''">
and stand_state = #{standState}
</if>
<!-- 高级检索项 -->
<!-- 标准性质 -->
<if test="standNature != null and standNature != ''">
and stand_nature = #{standNature}
</if>
<!-- 代替标准 允许输入的时候输入多个-->
<if test="replaceStandNum != null and replaceStandNum != ''">
and replace_stand_num like concat(concat('%',#{replaceStandNum}),'%')
</if>
<!-- 被代替标准 -->
<if test="replacedStandNum != null and replacedStandNum != ''">
and replaced_stand_num like concat(concat('%',#{replacedStandNum}),'%')
</if>
<if test="isRelateAccess != null and isRelateAccess != ''" >
and is_relate_access = #{isRelateAccess}
</if>
<!-- 目录判断 -->
<if test="menuId != null and menuId !='nomenu' and menuAllChildrenIdList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 游离态标准查询 -->
<!-- <if test="menuId != null and menuId =='nomenu' and standType =='INLAND'">
and SAR_STAND_MENU.MENU_ID = (select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null and sor_divide
='INLAND_STAND')
&lt;!&ndash;-查询游离态标准,编号和名称是分开的 &ndash;&gt;
<if test="standNumber != null">
and ((concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR is not null)
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
and SAR_STANDARDS_INFO.STAND_YEAR is null))
</if>
</if>
<if test="menuId != null and menuId =='nomenu' and standType =='FOREIGN'">
and SAR_STAND_MENU.MENU_ID = (select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null and sor_divide
='FOREIGN_STAND')
<if test="standNumber != null">
and ((concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR is not null)
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
and SAR_STANDARDS_INFO.STAND_YEAR is null))
</if>
</if> -->
<!-- 当第一次进入页面未选择记录时-->
<!-- <if test="(menuId == null or menuId =='') and standType =='INLAND'">-->
<!-- and SAR_STAND_MENU.MENU_ID in (-->
<!-- select TS_RESOURCE.id from TS_RESOURCE start with id=(select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null-->
<!-- and sor_divide-->
<!-- ='INLAND_STAND') connect by prior id= parent_id-->
<!-- )-->
<!-- </if>-->
<!-- 新修改需求,根据角色查询有权限的菜单数据-->
<if test="menuRoleList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- <if test="(menuId == null or menuId =='') and standType =='FOREIGN'">-->
<!-- and SAR_STAND_MENU.MENU_ID in (-->
<!-- select TS_RESOURCE.id from TS_RESOURCE start with id=(select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null-->
<!-- and sor_divide-->
<!-- ='FOREIGN_STAND') connect by prior id= parent_id-->
<!-- )-->
<!-- </if>-->
<!-- 导出数据过程中,选择的id -->
<if test="idlist != null">
and SAR_STANDARDS_INFO.id in
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="standSort != null and standSort != ''" >
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
</if>
<!--标准年份-->
<if test="standYear != null and standYear != ''">
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
</if>
<if test="issueTime != null and issueTime != ''">
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{issueTime}
</if>
<!--内容摘要-->
<if test="synopsis != null and synopsis != ''" >
AND dbms_lob.instr(SYNOPSIS, #{synopsis} ,1,1) > 0
</if>
<!--文本状态-->
<if test="textStatus != null and textStatus != ''" >
and SAR_STANDARDS_INFO.TEXT_STATUS = #{textStatus}
</if>
<!--是否纳入法规清单-->
<if test="isRelateAccess != null and isRelateAccess != ''" >
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
</if>
<if test="collectMenuId != null and collectMenuId != ''">
and SAR_STANDARDS_INFO.id in (
select COLLECT_RES_ID from TS_PERSON_COLLECT where TS_PERSON_COLLECT.VALID_FLAG=0
and (collect_type='INLAND_STAND' or collect_type='FOREIGN_STAND')
and TS_PERSON_COLLECT.user_id=#{userId}
)
</if>
<if test='labelMenuId != null and labelMenuId == "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ is not null
</if>
<if test='labelMenuId != null and labelMenuId != "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
</if>
<!--适用车型-->
<if test="applyArctic != null and applyArctic != ''">
and SAR_STAND_ATTR_INFO.CLLX = #{applyArctic}
</if>
<if test="advanceSearchStr != null and advanceSearchStr != ''">
and (${advanceSearchStr})
</if>
</trim>
</sql>
<sql id="standSort_in">
ORDER BY
<if test='page.orderByA != null and page.orderByA != "" and page.order1 != null and page.order1 != ""'>
@@ -1323,10 +1548,10 @@
<select id="getSarStandardsExportInfo" resultMap="BaseResultMapExcel"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select a.* from (
select<include refid="Base_Column_List_Show"/>
select<include refid="Base_Column_List_Export_Show"/>
from SAR_STANDARDS_INFO
<include refid="SarStandardsInfo_Where_Clause"/>
GROUP BY <include refid="Group_Column_List_Show"/>
<include refid="SarStandardsInfo_Where_Export_Clause"/>
GROUP BY <include refid="Group_Column_List_Export_Show"/>
) a
order by
<if test='orderByA != null and orderByA != "" and order1 != null and order1 != ""'>
@@ -77,4 +77,12 @@ public interface DicTypeEODao extends BaseMapper<DicTypeEO> {
public int queryByCount(DicTypeEOPage page);
public List<DicTypeEO> queryByList(DicTypeEOPage page);
/**
* @param filed 需要查询的字段名
* 查询需要的字段的所有数据
* @return
*/
public List<DicTypeEO> getDicInfo(@Param("filed") String... filed);
}
@@ -593,4 +593,16 @@
</foreach>
</select>
<select id="getDicInfo" resultMap="BaseResultMap">
SELECT
<foreach collection="filed" index="index" item="item" separator="," >
${item}
</foreach>
FROM
TS_DICTYPE
</select>
</mapper>