Merge remote-tracking branch 'origin/develop_master' into develop_master

This commit is contained in:
yuezhihang
2021-11-12 09:28:00 +08:00
5 changed files with 102 additions and 54 deletions
@@ -49,18 +49,19 @@ public class WaterMarkUtil {
// set Transparency // set Transparency
PdfGState gs = new PdfGState(); PdfGState gs = new PdfGState();
// 设置透明度为0.2 // 设置透明度为0.2
gs.setFillOpacity(0.5f); gs.setFillOpacity(0.4f);
under.setGState(gs); under.setGState(gs);
under.restoreState(); under.restoreState();
under.beginText(); under.beginText();
under.setFontAndSize(base, 25); under.setFontAndSize(base, 56);
under.setTextMatrix(30, 30); under.setTextMatrix(30, 30);
under.setColorFill(BaseColor.LIGHT_GRAY); under.setColorFill(BaseColor.LIGHT_GRAY);
for (int y = 0; y < 10; y++) { for (int y = 0; y < 10; y++) {
for (int x = 0; x < 8; x++) { for (int x = 0; x < 8; x++) {
// 水印文字成45度角倾斜 // 水印文字成45度角倾斜
under.showTextAligned(Element.ALIGN_LEFT under.showTextAligned(Element.ALIGN_LEFT
, waterMarkName, 100 + 300 * x, 300 * y, 45); } , waterMarkName, 100 + 300 * x, 300 * y, 40);
}
} }
// 添加水印文字 // 添加水印文字
@@ -17,10 +17,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays; import java.util.stream.Collectors;
import java.util.HashMap;
import java.util.List;
/** /**
* <p> * <p>
@@ -184,8 +182,15 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
tsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ"); tsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
TsResources=dao.selectList(tsResourceQueryWrapper); TsResources=dao.selectList(tsResourceQueryWrapper);
for(TsResource TsResource:TsResources){ for(TsResource resource:TsResources){
TsResource.setChildren(recursionGetListChildren((tsResource.getSorDivide()),(TsResource),(getMenuIdList))); QueryWrapper<TsResource> TsResourceQueryWrapper=new QueryWrapper<>();
TsResourceQueryWrapper.like("PARENT_IDS",resource.getId());
if(StringUtils.isNotBlank(tsResource.getSorDivide())){
TsResourceQueryWrapper.in("ID",getMenuIdList);
}
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
List<TsResource> children=dao.selectList(TsResourceQueryWrapper);
resource.setChildren(recursionGetListChildrenStand((resource),(children)));
} }
} }
} }
@@ -209,8 +214,12 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
queryWrapper.orderByAsc("DISPLAY_SEQ"); queryWrapper.orderByAsc("DISPLAY_SEQ");
TsResources=dao.selectList(queryWrapper); TsResources=dao.selectList(queryWrapper);
for(TsResource TsResource:TsResources){ for(TsResource resource:TsResources){
TsResource.setChildren(recursionGetListChildrenStand((tsResource.getSorDivide()),(TsResource))); QueryWrapper<TsResource> TsResourceQueryWrapper=new QueryWrapper<>();
TsResourceQueryWrapper.like("PARENT_IDS",resource.getId());
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
List<TsResource> children=dao.selectList(TsResourceQueryWrapper);
resource.setChildren(recursionGetListChildrenStand((resource),(children)));
} }
return TsResources; return TsResources;
@@ -311,37 +320,17 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
/** /**
* 递归调用获取子节点 * 递归调用获取子节点
* @param parent:父节点
* @return List<TsResource> * @return List<TsResource>
*/ */
private List<TsResource> recursionGetListChildren(String sorDivide,TsResource parent,List<String> getMenuIdList){ private List<TsResource> recursionGetListChildrenStand(TsResource resource,List<TsResource> children){
QueryWrapper<TsResource> TsResourceQueryWrapper=new QueryWrapper<>(); List<TsResource> tsResources = children.stream().filter(resource1 -> resource1.getParentId().equals(resource.getId())).collect(Collectors.toList());
TsResourceQueryWrapper.eq("PARENT_ID",parent.getId()); if(!tsResources.isEmpty()){
if(StringUtils.isNotBlank(sorDivide)){ tsResources = tsResources.stream().sorted(Comparator.comparing(resource1 -> resource1.getDisplaySeq())).collect(Collectors.toList());
TsResourceQueryWrapper.in("ID",getMenuIdList); tsResources.forEach(resource1 -> {
resource1.setChildren(recursionGetListChildrenStand((resource1),(children)));
});
} }
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ"); return tsResources;
List<TsResource> children=dao.selectList(TsResourceQueryWrapper);
for(TsResource TsResource:children){
TsResource.setChildren(recursionGetListChildren((sorDivide),(TsResource),(getMenuIdList)));
}
return children;
}
/**
* 递归调用获取子节点
* @param parent:父节点
* @return List<TsResource>
*/
private List<TsResource> recursionGetListChildrenStand(String sorDivide,TsResource parent){
QueryWrapper<TsResource> TsResourceQueryWrapper=new QueryWrapper<>();
TsResourceQueryWrapper.eq("PARENT_ID",parent.getId());
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
List<TsResource> children=dao.selectList(TsResourceQueryWrapper);
for(TsResource TsResource:children){
TsResource.setChildren(recursionGetListChildrenStand((sorDivide),(TsResource)));
}
return children;
} }
/** /**
@@ -235,14 +235,34 @@
<select id="getSarStandardsInfoPage" resultMap="BaseResultMap" <select id="getSarStandardsInfoPage" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage"> parameterType="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage">
select select
a.*, DISTINCT a.ID,
dicstandTextStatus.DIC_TYPE_NAME AS standStatusShow, a.LAWS_TYPE,
( a.LAWS_NUMBER,
CASE a.LAWS_NAME,
WHEN SAR_LAWS_ATTR_INFO.XCXSSRQLAWS ='' THEN '9999-01-01' a.LAWS_EN_NAME,
ELSE SAR_LAWS_ATTR_INFO.XCXSSRQLAWS a.LAWS_NO,
END a.ISSUE_TIME,
) AS XCXSSRQLAWS a.ISSUE_COMPANY,
a.COMMENT_CYCLE_START,
a.COMMENT_CYCLE_END,
a.LAWS_TEXT_STATE,
a.LAWS_SYQY,
a.LAWS_SYCX,
a.IS_RELATE_ACCESS,
a.LAWS_YEAR,
a.LAWS_NOTISYNC_NUM,
a.LAWS_BULLETIN,
a.LAWS_LABEL,
a.LAWS_REMARK,
a.COUNTRY,
a.MODIFY_TIME,
dicstandTextStatus.DIC_TYPE_NAME AS standStatusShow,
(
CASE
WHEN SAR_LAWS_ATTR_INFO.XCXSSRQLAWS ='' THEN '9999-01-01'
ELSE SAR_LAWS_ATTR_INFO.XCXSSRQLAWS
END
) AS XCXSSRQLAWS
from from
(select tmp_tb.* from (select tmp_tb.* from
( (
@@ -287,7 +307,27 @@
<select id="getSarStandardsExportInfo" resultMap="BaseResultMapExcel" <select id="getSarStandardsExportInfo" resultMap="BaseResultMapExcel"
parameterType="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage"> parameterType="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage">
select select
a.*, DISTINCT a.ID,
a.LAWS_TYPE,
a.LAWS_NUMBER,
a.LAWS_NAME,
a.LAWS_EN_NAME,
a.LAWS_NO,
a.ISSUE_TIME,
a.ISSUE_COMPANY,
a.COMMENT_CYCLE_START,
a.COMMENT_CYCLE_END,
a.LAWS_TEXT_STATE,
a.LAWS_SYQY,
a.LAWS_SYCX,
a.IS_RELATE_ACCESS,
a.LAWS_YEAR,
a.LAWS_NOTISYNC_NUM,
a.LAWS_BULLETIN,
a.LAWS_LABEL,
a.LAWS_REMARK,
a.COUNTRY,
a.MODIFY_TIME,
dicstandTextStatus.DIC_TYPE_NAME AS standStatusShow dicstandTextStatus.DIC_TYPE_NAME AS standStatusShow
from (select <include refid="Base_Column_List_Show"/> from (select <include refid="Base_Column_List_Show"/>
from SAR_LAWS_STAND_INFO from SAR_LAWS_STAND_INFO
@@ -966,7 +966,25 @@
<select id="getSarStandardsInfoPage" resultMap="BaseResultMap" <select id="getSarStandardsInfoPage" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage"> parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select select
a.*, DISTINCT a.id,
a.stand_type,
a.country,
a.stand_sort,
a.stand_number,
a.stand_year,
a.stand_name,
a.stand_en_name,
a.stand_state,
a.stand_nature,
a.issue_time,
a.put_time,
a.text_status,
a.creation_user,
a.valid_flag,
a.creation_time,
a.modify_time,
a.STAND_SYSTEM,
a.IS_RELATE_ACCESS,
SAR_STAND_ATTR_INFO.CHJL AS CHJL, SAR_STAND_ATTR_INFO.CHJL AS CHJL,
dicstandSort.DIC_TYPE_NAME AS standSortShow, dicstandSort.DIC_TYPE_NAME AS standSortShow,
dicstandTextStatus.DIC_TYPE_NAME AS standTextStatusShow, dicstandTextStatus.DIC_TYPE_NAME AS standTextStatusShow,
@@ -275,14 +275,14 @@ public class AttFileEOController {
String userMsg = ""; String userMsg = "";
TsUser tsUser = userDao.selectById(userId); TsUser tsUser = userDao.selectById(userId);
if (tsUser != null) { if (tsUser != null) {
userMsg = tsUser.getUname() + ","; userMsg = tsUser.getUname();
if (StringUtils.isNotEmpty(tsUser.getWorkNum())) { // if (StringUtils.isNotEmpty(tsUser.getWorkNum())) {
userMsg += tsUser.getWorkNum() + ","; // userMsg += tsUser.getWorkNum() + ",";
} // }
} }
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");//设置日期格式 SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");//设置日期格式
String date = df.format(new Date()); String date = df.format(new Date());
String waterContent = userMsg + date; String waterContent = userMsg;
//2020年9月5日 去掉水印处理 //2020年9月5日 去掉水印处理
//2021年7月25日要求下载生成水印 //2021年7月25日要求下载生成水印
WaterMarkUtil.waterMark(oldFilePath,waterFilePath,waterContent); WaterMarkUtil.waterMark(oldFilePath,waterFilePath,waterContent);