修改srms接口
This commit is contained in:
@@ -56,7 +56,7 @@ public class CsrfFilter implements Filter {
|
|||||||
String url = req.getRequestURL().toString();
|
String url = req.getRequestURL().toString();
|
||||||
// 获取来源
|
// 获取来源
|
||||||
String referurl = req.getHeader("Referer");
|
String referurl = req.getHeader("Referer");
|
||||||
if(isWhiteReq(referurl) || Objects.equals(upgrade,"websocket") || url.contains("view") || url.contains("doc.html")){
|
if(isWhiteReq(referurl) || Objects.equals(upgrade,"websocket") || url.contains("view") || url.contains("/srms/") || url.contains("doc.html")){
|
||||||
chain.doFilter(request, response);
|
chain.doFilter(request, response);
|
||||||
}else{
|
}else{
|
||||||
String log = "";
|
String log = "";
|
||||||
|
|||||||
@@ -152,10 +152,6 @@ public class ShiroConfig {
|
|||||||
|
|
||||||
// 获取token
|
// 获取token
|
||||||
filterChainDefinitionMap.put("/srms/getByToken", "anon");
|
filterChainDefinitionMap.put("/srms/getByToken", "anon");
|
||||||
// 标准法规文档查询
|
|
||||||
filterChainDefinitionMap.put("/srms/getByLawsFileList", "anon");
|
|
||||||
// 设计导航-产品设计条款查询
|
|
||||||
filterChainDefinitionMap.put("/srms/getByLawsProductDesign", "anon");
|
|
||||||
|
|
||||||
// 添加自己的过滤器并且取名为jwt
|
// 添加自己的过滤器并且取名为jwt
|
||||||
Map<String, Filter> filterMap = new HashMap<>(1);
|
Map<String, Filter> filterMap = new HashMap<>(1);
|
||||||
|
|||||||
+15
-8
@@ -58,10 +58,10 @@
|
|||||||
<if test="standard.partCategoryName != '' and standard.partCategoryName != null">
|
<if test="standard.partCategoryName != '' and standard.partCategoryName != null">
|
||||||
and l1.name = #{standard.partCategoryName}
|
and l1.name = #{standard.partCategoryName}
|
||||||
</if>
|
</if>
|
||||||
<if test="standard.hasSplit == '1'">
|
<if test="standard.hasSplit == 1">
|
||||||
and s1.split_result = '成功'
|
and s1.split_result = '成功'
|
||||||
</if>
|
</if>
|
||||||
<if test="standard.hasSplit == '2'">
|
<if test="standard.hasSplit == 2">
|
||||||
and s1.split_result is null
|
and s1.split_result is null
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
@@ -101,20 +101,27 @@
|
|||||||
<select id="getByLawsStandardPage" resultType="com.jero.modules.docking.srms.vo.StandardPageVO">
|
<select id="getByLawsStandardPage" resultType="com.jero.modules.docking.srms.vo.StandardPageVO">
|
||||||
select laws.* from (
|
select laws.* from (
|
||||||
SELECT
|
SELECT
|
||||||
id,standard_number,standard_name,standard_english_name,standard_state,standard_system,release_date,implementation_date,part_name as partCategoryNum
|
id,standard_number,standard_name,standard_english_name,standard_state,standard_system,
|
||||||
|
DATE_FORMAT( release_date, '%Y-%m-%d' ) AS release_date,
|
||||||
|
DATE_FORMAT( implementation_date, '%Y-%m-%d' ) AS implementation_date,
|
||||||
|
part_name as partCategoryNum
|
||||||
FROM laws_domestic_standard
|
FROM laws_domestic_standard
|
||||||
union all
|
union all
|
||||||
SELECT
|
SELECT
|
||||||
id,standard_number,standard_name,standard_english_name,standard_state,standard_system,release_date,implementation_date,part_name as partCategoryNum
|
id,standard_number,standard_name,standard_english_name,standard_state,standard_system,
|
||||||
|
DATE_FORMAT( release_date, '%Y-%m-%d' ) AS release_date,
|
||||||
|
DATE_FORMAT( implementation_date, '%Y-%m-%d' ) AS implementation_date,
|
||||||
|
part_name as partCategoryNum
|
||||||
FROM laws_enterprise_standard
|
FROM laws_enterprise_standard
|
||||||
union all
|
union all
|
||||||
SELECT
|
SELECT
|
||||||
id,standard_number,standard_name,standard_english_name,standard_state,standard_system,release_date,implementation_date,part_name as partCategoryNum
|
id,standard_number,standard_name,standard_english_name,standard_state,standard_system,
|
||||||
|
DATE_FORMAT( release_date, '%Y-%m-%d' ) AS release_date,
|
||||||
|
DATE_FORMAT( implementation_date, '%Y-%m-%d' ) AS implementation_date,
|
||||||
|
part_name as partCategoryNum
|
||||||
FROM laws_overseas_standard
|
FROM laws_overseas_standard
|
||||||
) laws
|
) laws
|
||||||
left join laws_node_relation l on l.unique_relation_flag = laws.id
|
left join laws_node_relation l on l.unique_relation_flag = laws.id
|
||||||
<where>
|
where ${ew.sqlSegment}
|
||||||
${ew.sqlSegment}
|
|
||||||
</where>
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+80
-30
@@ -7,9 +7,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.google.common.base.CaseFormat;
|
||||||
|
import com.google.common.base.Charsets;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.system.api.ISysBaseAPI;
|
import com.jero.common.system.api.ISysBaseAPI;
|
||||||
import com.jero.common.system.util.JwtUtil;
|
import com.jero.common.system.util.JwtUtil;
|
||||||
|
import com.jero.common.system.vo.LoginUser;
|
||||||
|
import com.jero.common.util.MD5Util;
|
||||||
import com.jero.common.util.RedisUtil;
|
import com.jero.common.util.RedisUtil;
|
||||||
import com.jero.common.util.TokenUtils;
|
import com.jero.common.util.TokenUtils;
|
||||||
import com.jero.modules.docking.srms.dto.ByTokenRequests;
|
import com.jero.modules.docking.srms.dto.ByTokenRequests;
|
||||||
@@ -35,13 +39,16 @@ import com.jero.modules.tag.enums.TableNameEnum;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.regexp.RE;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -80,6 +87,19 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
private String appKey;
|
private String appKey;
|
||||||
@Value("${srms.secret}")
|
@Value("${srms.secret}")
|
||||||
private String secret;
|
private String secret;
|
||||||
|
@Value("${srms.font_url_pdf}")
|
||||||
|
private String fontUrlPdf;
|
||||||
|
@Value("${srms.back_url_pdf}")
|
||||||
|
private String backUrlPdf;
|
||||||
|
@Value("${srms.font_url_other}")
|
||||||
|
private String fontUrlOther;
|
||||||
|
@Value("${srms.back_url_other}")
|
||||||
|
private String backUrlOther;
|
||||||
|
@Value("${srms.other_md5_mark}")
|
||||||
|
private String otherMd5Mark;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static final String SRMS_TOKEN = "srms_token_";
|
private static final String SRMS_TOKEN = "srms_token_";
|
||||||
private static final String REQUESTS = "Requests";
|
private static final String REQUESTS = "Requests";
|
||||||
@@ -154,7 +174,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
standardVO.setStandardState(standardState);
|
standardVO.setStandardState(standardState);
|
||||||
// 是否存在拆分信息,默认false; true-是,false-否
|
// 是否存在拆分信息,默认false; true-是,false-否
|
||||||
setHasSplit(requests, standardVO);
|
setHasSplit(requests, standardVO);
|
||||||
List<ByFileRows> listByFileRows = getByFileRows(partCategoryNum, standardVO);
|
List<ByFileRows> listByFileRows = getByFileRows(partCategoryNum, standardVO,token);
|
||||||
return Result.OK(listByFileRows);
|
return Result.OK(listByFileRows);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("标准法规文档查询异常:",e);
|
log.error("标准法规文档查询异常:",e);
|
||||||
@@ -163,7 +183,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private List<ByFileRows> getByFileRows(String partCategoryNum, StandardVO standardVO) {
|
private List<ByFileRows> getByFileRows(String partCategoryNum, StandardVO standardVO,String token) {
|
||||||
List<ByFileRows> listByFileRows = lawsStandardMapper.getStandard(standardVO);
|
List<ByFileRows> listByFileRows = lawsStandardMapper.getStandard(standardVO);
|
||||||
if(CollectionUtils.isEmpty(listByFileRows)) {
|
if(CollectionUtils.isEmpty(listByFileRows)) {
|
||||||
return listByFileRows;
|
return listByFileRows;
|
||||||
@@ -190,7 +210,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
List<OSSFile> listFile = listOssFile.stream().filter(o-> Objects.equals(o.getStandardId(),byFileRows.getId())).collect(Collectors.toList());
|
List<OSSFile> listFile = listOssFile.stream().filter(o-> Objects.equals(o.getStandardId(),byFileRows.getId())).collect(Collectors.toList());
|
||||||
if(!CollectionUtils.isEmpty(listFile)){
|
if(!CollectionUtils.isEmpty(listFile)){
|
||||||
listFile = listFile.stream().sorted(Comparator.comparing(OSSFile::getCreateTime).reversed()).collect(Collectors.toList());
|
listFile = listFile.stream().sorted(Comparator.comparing(OSSFile::getCreateTime).reversed()).collect(Collectors.toList());
|
||||||
byFileRows.setStandardUrl(listFile.get(0).getUrl());
|
byFileRows.setStandardUrl(getUrl(listFile.get(0),token));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<SarFileSplitInfoEO> querySarFileSplitInfoEo = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SarFileSplitInfoEO> querySarFileSplitInfoEo = new LambdaQueryWrapper<>();
|
||||||
@@ -318,16 +338,15 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
List<StandardTree> listStandardTreeAll = new ArrayList<>();
|
List<StandardTree> listStandardTreeAll = new ArrayList<>();
|
||||||
// 企业标准
|
|
||||||
List<LawsTreeNodeModel> listEnterprise = lawsTreeNodeService.queryTreeNodeList(TableNameEnum.ENTERPRISE_STANDARDS.getValue(), nodeName, "1");
|
|
||||||
getStandardTree(listStandardTreeAll, listEnterprise);
|
|
||||||
// 国内标准
|
// 国内标准
|
||||||
List<LawsTreeNodeModel> listDomestic = lawsTreeNodeService.queryTreeNodeList(TableNameEnum.DOMESTIC_REGULATIONS.getValue(), nodeName, "1");
|
List<LawsTreeNodeModel> listDomestic = lawsTreeNodeService.queryTreeNodeList(TableNameEnum.DOMESTIC_REGULATIONS.getValue(), nodeName, "1");
|
||||||
getStandardTree(listStandardTreeAll, listDomestic);
|
getStandardTree(listStandardTreeAll, listDomestic);
|
||||||
// 海外标准
|
// 海外标准
|
||||||
List<LawsTreeNodeModel> listForeign = lawsTreeNodeService.queryTreeNodeList(TableNameEnum.FOREIGN_REGULATIONS.getValue(), nodeName, "1");
|
List<LawsTreeNodeModel> listForeign = lawsTreeNodeService.queryTreeNodeList(TableNameEnum.FOREIGN_REGULATIONS.getValue(), nodeName, "1");
|
||||||
getStandardTree(listStandardTreeAll, listForeign);
|
getStandardTree(listStandardTreeAll, listForeign);
|
||||||
|
// 企业标准
|
||||||
|
List<LawsTreeNodeModel> listEnterprise = lawsTreeNodeService.queryTreeNodeList(TableNameEnum.ENTERPRISE_STANDARDS.getValue(), nodeName, "1");
|
||||||
|
getStandardTree(listStandardTreeAll, listEnterprise);
|
||||||
return Result.OK(listStandardTreeAll);
|
return Result.OK(listStandardTreeAll);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("获取所有体系数据异常:",e);
|
log.error("获取所有体系数据异常:",e);
|
||||||
@@ -382,6 +401,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
if(StringUtils.isBlank(token) || !Objects.equals(TokenUtils.getTokenByRequest(req),token)){
|
if(StringUtils.isBlank(token) || !Objects.equals(TokenUtils.getTokenByRequest(req),token)){
|
||||||
return Result.error(SYS_ERR);
|
return Result.error(SYS_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject requests = JSON.parseObject(JSON.toJSONString(json.get(REQUESTS)));
|
JSONObject requests = JSON.parseObject(JSON.toJSONString(json.get(REQUESTS)));
|
||||||
if(Objects.isNull(requests)){
|
if(Objects.isNull(requests)){
|
||||||
return Result.error(ADD_NOT_NULL);
|
return Result.error(ADD_NOT_NULL);
|
||||||
@@ -414,12 +434,13 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
}
|
}
|
||||||
Page<StandardPageVO> page = new Page<>(Long.parseLong(requests.get(pageNoKey).toString()),
|
Page<StandardPageVO> page = new Page<>(Long.parseLong(requests.get(pageNoKey).toString()),
|
||||||
Long.parseLong(requests.get(pageSizeKey).toString()));
|
Long.parseLong(requests.get(pageSizeKey).toString()));
|
||||||
IPage<StandardPageVO> pageList =lawsStandardMapper.getByLawsStandardPage(page,queryStandardPageVO);
|
IPage<StandardPageVO> pageList = lawsStandardMapper.getByLawsStandardPage(page,queryStandardPageVO);
|
||||||
getListStandardPageVO(pageList);
|
getListStandardPageVO(pageList,token);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setQuery(JSONObject requests, QueryWrapper<StandardPageVO> queryStandardPageVO) {
|
private void setQuery(JSONObject requests, QueryWrapper<StandardPageVO> queryStandardPageVO) {
|
||||||
|
queryStandardPageVO.eq("'1'","1");
|
||||||
String nodeCodeKey = "nodeCode";
|
String nodeCodeKey = "nodeCode";
|
||||||
if(requests.containsKey(nodeCodeKey) && !StringUtils.isEmpty(requests.get(nodeCodeKey).toString())){
|
if(requests.containsKey(nodeCodeKey) && !StringUtils.isEmpty(requests.get(nodeCodeKey).toString())){
|
||||||
String nodeCode = requests.get(nodeCodeKey).toString();
|
String nodeCode = requests.get(nodeCodeKey).toString();
|
||||||
@@ -437,19 +458,20 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
|
|
||||||
private void setOrder(QueryWrapper<StandardPageVO> queryStandardPageVO, String[] column, String[] order) {
|
private void setOrder(QueryWrapper<StandardPageVO> queryStandardPageVO, String[] column, String[] order) {
|
||||||
for (int i = 0; i < column.length; i++) {
|
for (int i = 0; i < column.length; i++) {
|
||||||
|
String c = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, column[i]);
|
||||||
if(Objects.isNull(order)){
|
if(Objects.isNull(order)){
|
||||||
queryStandardPageVO.orderByDesc(column[i]);
|
queryStandardPageVO.orderByDesc(c);
|
||||||
}else{
|
}else{
|
||||||
if(Objects.equals(order[i],"asc") || Objects.equals(order[i],"ASC")){
|
if(Objects.equals(order[i],"asc") || Objects.equals(order[i],"ASC")){
|
||||||
queryStandardPageVO.orderByAsc(column[i]);
|
queryStandardPageVO.orderByAsc(c);
|
||||||
}else{
|
}else{
|
||||||
queryStandardPageVO.orderByDesc(column[i]);
|
queryStandardPageVO.orderByDesc(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getListStandardPageVO(IPage<StandardPageVO> pageList) {
|
private void getListStandardPageVO(IPage<StandardPageVO> pageList,String token) {
|
||||||
List<StandardPageVO> listStandardPageVO = pageList.getRecords();
|
List<StandardPageVO> listStandardPageVO = pageList.getRecords();
|
||||||
if(CollectionUtils.isEmpty(listStandardPageVO)){
|
if(CollectionUtils.isEmpty(listStandardPageVO)){
|
||||||
return;
|
return;
|
||||||
@@ -463,6 +485,29 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
List<OSSFile> listOssFile = ossFileService.list(queryOssFile);
|
List<OSSFile> listOssFile = ossFileService.list(queryOssFile);
|
||||||
|
|
||||||
List<StandardPageVO> listStandardPageVOPartName = listStandardPageVO.stream().filter(o->!StringUtils.isBlank(o.getPartCategoryNum())).collect(Collectors.toList());
|
List<StandardPageVO> listStandardPageVOPartName = listStandardPageVO.stream().filter(o->!StringUtils.isBlank(o.getPartCategoryNum())).collect(Collectors.toList());
|
||||||
|
List<PartName> listPartName = getPartNames(listStandardPageVOPartName);
|
||||||
|
|
||||||
|
for (StandardPageVO standardPageVO : listStandardPageVO) {
|
||||||
|
standardPageVO.setStandardState_dictText(sysBaseAPI.translateDict("standard_state", standardPageVO.getStandardState()));
|
||||||
|
if(!CollectionUtils.isEmpty(listOssFile)){
|
||||||
|
List<OSSFile> listOssFileOne = listOssFile.stream().filter(o-> Objects.equals(o.getStandardId(),standardPageVO.getId())).collect(Collectors.toList());
|
||||||
|
if(!CollectionUtils.isEmpty(listOssFileOne)){
|
||||||
|
listOssFileOne = listOssFileOne.stream().sorted(Comparator.comparing(OSSFile::getCreateTime).reversed()).collect(Collectors.toList());
|
||||||
|
standardPageVO.setStandardUrl(getUrl(listOssFileOne.get(0),token));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 零件号查询
|
||||||
|
if(!CollectionUtils.isEmpty(listPartName) && !StringUtils.isBlank(standardPageVO.getPartCategoryNum())){
|
||||||
|
List<PartName> listPartNameNew = listPartName.stream().filter(o->Arrays.asList(standardPageVO.getPartCategoryNum().split(",")).contains(o.getCode())).collect(Collectors.toList());
|
||||||
|
if(!CollectionUtils.isEmpty(listPartNameNew)){
|
||||||
|
List<String> listName = listPartNameNew.stream().map(PartName::getName).collect(Collectors.toList());
|
||||||
|
standardPageVO.setPartCategoryName(String.join(",",listName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<PartName> getPartNames(List<StandardPageVO> listStandardPageVOPartName) {
|
||||||
List<PartName> listPartName = new ArrayList<>();
|
List<PartName> listPartName = new ArrayList<>();
|
||||||
if(!CollectionUtils.isEmpty(listStandardPageVOPartName)){
|
if(!CollectionUtils.isEmpty(listStandardPageVOPartName)){
|
||||||
List<String> listPartCategoryNum = listStandardPageVOPartName.stream().map(StandardPageVO::getPartCategoryNum).collect(Collectors.toList());
|
List<String> listPartCategoryNum = listStandardPageVOPartName.stream().map(StandardPageVO::getPartCategoryNum).collect(Collectors.toList());
|
||||||
@@ -473,24 +518,29 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
listPartName = partNameService.list(queryPartName);
|
listPartName = partNameService.list(queryPartName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return listPartName;
|
||||||
|
}
|
||||||
|
|
||||||
for (StandardPageVO standardPageVO : listStandardPageVO) {
|
private String getUrl(OSSFile ossFile,String token){
|
||||||
standardPageVO.setStandardState_dictText(sysBaseAPI.translateDict("standard_state", standardPageVO.getStandardState()));
|
String url = "";
|
||||||
if(!CollectionUtils.isEmpty(listOssFile)){
|
try{
|
||||||
List<OSSFile> listOssFileOne = listOssFile.stream().filter(o-> Objects.equals(o.getStandardId(),standardPageVO.getId())).collect(Collectors.toList());
|
if(ossFile.getFileName().toUpperCase().lastIndexOf(".PDF") > 0){
|
||||||
if(!CollectionUtils.isEmpty(listOssFileOne)){
|
// 拼接url pdf预览
|
||||||
listOssFileOne = listOssFileOne.stream().sorted(Comparator.comparing(OSSFile::getCreateTime).reversed()).collect(Collectors.toList());
|
String back = backUrlPdf.replace("{id}",ossFile.getId()).replace("{token}",token);
|
||||||
standardPageVO.setStandardUrl(listOssFileOne.get(0).getUrl());
|
url = fontUrlPdf.replace("{back_url_pdf}", URLEncoder.encode(back, StandardCharsets.UTF_8.name()));
|
||||||
}
|
}else{
|
||||||
}
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
// 零件号查询
|
String mark = loginUser.getUsername() + loginUser.getRealname() + LocalDateTime.now();
|
||||||
if(!CollectionUtils.isEmpty(listPartName)){
|
String markMd5 = MD5Util.MD5Encode(mark + otherMd5Mark,null);
|
||||||
List<PartName> listPartNameNew = listPartName.stream().filter(o->Arrays.asList(standardPageVO.getPartCategoryNum().split(",")).contains(o.getCode())).collect(Collectors.toList());
|
String backOther = backUrlOther.replace("{id}",ossFile.getId()).replace("{token}",token)
|
||||||
if(!CollectionUtils.isEmpty(listPartNameNew)){
|
.replace("{file_name}",ossFile.getFileName());
|
||||||
List<String> listName = listPartNameNew.stream().map(PartName::getName).collect(Collectors.toList());
|
url = fontUrlOther.replace("{back_url_other}",URLEncoder.encode(Base64.getEncoder().encodeToString(backOther.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8.name()))
|
||||||
standardPageVO.setPartCategoryName(String.join(",",listName));
|
.replace("{mark}",URLEncoder.encode(mark, StandardCharsets.UTF_8.name()))
|
||||||
}
|
.replace("{mark_md5}",markMd5);
|
||||||
}
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("拼接url异常",e);
|
||||||
}
|
}
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -483,3 +483,13 @@ srms:
|
|||||||
app_key: eeabe117f06a4d99a15582a143d3be54
|
app_key: eeabe117f06a4d99a15582a143d3be54
|
||||||
# 系统对应秘钥
|
# 系统对应秘钥
|
||||||
secret: 7ddbafa5b7ba4104bff5ffae9d775998
|
secret: 7ddbafa5b7ba4104bff5ffae9d775998
|
||||||
|
# pdf预览 前端url http://ip:port 替换前端地址
|
||||||
|
font_url_pdf: http://localhost:3334/pdfjs/web/viewer.html?file={back_url_pdf}&.pdf
|
||||||
|
# pdf预览 后端url
|
||||||
|
back_url_pdf: /laws-sinotruk/sys/common/view/{id}?type=view&at={token}
|
||||||
|
# 其他文件预览 替换kkfileviewurl
|
||||||
|
font_url_other: http://127.0.0.1:8012/onlinePreview?url={back_url_other}&watermarkTxt={mark}&watermarkSign={mark_md5}
|
||||||
|
# 其他文件预览 后端url 替换侯丹地址
|
||||||
|
back_url_other: http://localhost:8184/${srms.back_url_pdf}&fullfilename={file_name}
|
||||||
|
# 其他文件水印标识
|
||||||
|
other_md5_mark: cnhtc
|
||||||
|
|||||||
Reference in New Issue
Block a user