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
PdfGState gs = new PdfGState();
// 设置透明度为0.2
gs.setFillOpacity(0.5f);
gs.setFillOpacity(0.4f);
under.setGState(gs);
under.restoreState();
under.beginText();
under.setFontAndSize(base, 25);
under.setFontAndSize(base, 56);
under.setTextMatrix(30, 30);
under.setColorFill(BaseColor.LIGHT_GRAY);
for (int y = 0; y < 10; y++) {
for (int x = 0; x < 8; x++) {
// 水印文字成45度角倾斜
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.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
* <p>
@@ -184,8 +182,15 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
tsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
TsResources=dao.selectList(tsResourceQueryWrapper);
for(TsResource TsResource:TsResources){
TsResource.setChildren(recursionGetListChildren((tsResource.getSorDivide()),(TsResource),(getMenuIdList)));
for(TsResource resource:TsResources){
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");
TsResources=dao.selectList(queryWrapper);
for(TsResource TsResource:TsResources){
TsResource.setChildren(recursionGetListChildrenStand((tsResource.getSorDivide()),(TsResource)));
for(TsResource resource:TsResources){
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;
@@ -311,37 +320,17 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
/**
* 递归调用获取子节点
* @param parent:父节点
* @return List<TsResource>
*/
private List<TsResource> recursionGetListChildren(String sorDivide,TsResource parent,List<String> getMenuIdList){
QueryWrapper<TsResource> TsResourceQueryWrapper=new QueryWrapper<>();
TsResourceQueryWrapper.eq("PARENT_ID",parent.getId());
if(StringUtils.isNotBlank(sorDivide)){
TsResourceQueryWrapper.in("ID",getMenuIdList);
private List<TsResource> recursionGetListChildrenStand(TsResource resource,List<TsResource> children){
List<TsResource> tsResources = children.stream().filter(resource1 -> resource1.getParentId().equals(resource.getId())).collect(Collectors.toList());
if(!tsResources.isEmpty()){
tsResources = tsResources.stream().sorted(Comparator.comparing(resource1 -> resource1.getDisplaySeq())).collect(Collectors.toList());
tsResources.forEach(resource1 -> {
resource1.setChildren(recursionGetListChildrenStand((resource1),(children)));
});
}
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
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;
return tsResources;
}
/**
@@ -235,14 +235,34 @@
<select id="getSarStandardsInfoPage" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage">
select
a.*,
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
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,
(
CASE
WHEN SAR_LAWS_ATTR_INFO.XCXSSRQLAWS ='' THEN '9999-01-01'
ELSE SAR_LAWS_ATTR_INFO.XCXSSRQLAWS
END
) AS XCXSSRQLAWS
from
(select tmp_tb.* from
(
@@ -287,7 +307,27 @@
<select id="getSarStandardsExportInfo" resultMap="BaseResultMapExcel"
parameterType="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage">
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
from (select <include refid="Base_Column_List_Show"/>
from SAR_LAWS_STAND_INFO
@@ -966,7 +966,25 @@
<select id="getSarStandardsInfoPage" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
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,
dicstandSort.DIC_TYPE_NAME AS standSortShow,
dicstandTextStatus.DIC_TYPE_NAME AS standTextStatusShow,
@@ -275,14 +275,14 @@ public class AttFileEOController {
String userMsg = "";
TsUser tsUser = userDao.selectById(userId);
if (tsUser != null) {
userMsg = tsUser.getUname() + ",";
if (StringUtils.isNotEmpty(tsUser.getWorkNum())) {
userMsg += tsUser.getWorkNum() + ",";
}
userMsg = tsUser.getUname();
// if (StringUtils.isNotEmpty(tsUser.getWorkNum())) {
// userMsg += tsUser.getWorkNum() + ",";
// }
}
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");//设置日期格式
String date = df.format(new Date());
String waterContent = userMsg + date;
String waterContent = userMsg;
//2020年9月5日 去掉水印处理
//2021年7月25日要求下载生成水印
WaterMarkUtil.waterMark(oldFilePath,waterFilePath,waterContent);