Merge remote-tracking branch 'origin/develop_master' into develop_1
This commit is contained in:
@@ -37,6 +37,12 @@
|
||||
<artifactId>UserAgentUtils</artifactId>
|
||||
<version>1.21</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itextpdf</artifactId>
|
||||
<version>5.5.13</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import com.itextpdf.text.BaseColor;
|
||||
import com.itextpdf.text.Element;
|
||||
import com.itextpdf.text.Rectangle;
|
||||
import com.itextpdf.text.pdf.*;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* @Description:水印
|
||||
* @Author: super_liu
|
||||
@@ -15,7 +23,7 @@ public class WaterMarkUtil {
|
||||
*/
|
||||
public static boolean waterMark(String inputFile,
|
||||
String outputFile, String waterMarkName) {
|
||||
/* try {
|
||||
try {
|
||||
PdfReader reader = new PdfReader(inputFile);
|
||||
Field f = PdfReader.class.getDeclaredField("encrypted");
|
||||
f.setAccessible(true);
|
||||
@@ -65,8 +73,7 @@ public class WaterMarkUtil {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}*/
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.adc.da.main.file;
|
||||
|
||||
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.unit.DataSize;
|
||||
|
||||
import javax.servlet.MultipartConfigElement;
|
||||
|
||||
@Configuration
|
||||
public class FileUploadConfiuration {
|
||||
@Bean
|
||||
public MultipartConfigElement multipartConfigElement() {
|
||||
MultipartConfigFactory factory = new MultipartConfigFactory();
|
||||
//单个文件大小200mb
|
||||
factory.setMaxFileSize(DataSize.ofMegabytes(200L));
|
||||
//设置总上传数据大小10GB
|
||||
factory.setMaxRequestSize(DataSize.ofGigabytes(10L));
|
||||
|
||||
return factory.createMultipartConfig();
|
||||
}
|
||||
}
|
||||
@@ -146,4 +146,4 @@ elasticsearch.clustername=elasticsearch
|
||||
elasticsearch.ip=192.168.10.47
|
||||
elasticsearch.port=9300
|
||||
elasticsearch.poolSize=5
|
||||
elas.flag=true
|
||||
elas.flag=false
|
||||
|
||||
@@ -60,11 +60,11 @@
|
||||
<artifactId>adc-da-base</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!--<dependency>
|
||||
<groupId>com.adc</groupId>
|
||||
<artifactId>adc-da-slrs</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.adc</groupId>
|
||||
@@ -91,12 +91,12 @@
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>transport</artifactId>
|
||||
<version>6.3.2</version>
|
||||
<version>7.6.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch</artifactId>
|
||||
<version>6.3.2</version>
|
||||
<version>7.6.2</version>
|
||||
</dependency>
|
||||
<!-- 6.0版本es需添加此依赖,解决依赖冲突 -->
|
||||
<dependency>
|
||||
|
||||
+22
-11
@@ -4,21 +4,21 @@ import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.excel.poi.excel.ExcelExportUtil;
|
||||
import com.adc.da.excel.poi.excel.entity.ExportParams;
|
||||
import com.adc.da.excel.poi.excel.entity.enums.ExcelType;
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.person.service.IPersonCollectEOService;
|
||||
import com.adc.da.search.dto.*;
|
||||
import com.adc.da.search.dto.SearchBussExportDto;
|
||||
import com.adc.da.search.dto.SearchLawsExportDto;
|
||||
import com.adc.da.search.dto.SearchMsgExportDto;
|
||||
import com.adc.da.search.dto.SearchStandExportDto;
|
||||
import com.adc.da.search.entity.CommonSearchInfoEO;
|
||||
import com.adc.da.search.entity.SarAdvanceSearchVO;
|
||||
import com.adc.da.search.entity.SeniorSearchInfoEO;
|
||||
import com.adc.da.search.service.ElasticsearchService;
|
||||
import com.adc.da.search.service.SearchCenterService;
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsSearchMenu;
|
||||
import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService;
|
||||
import com.adc.da.util.IOUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -26,14 +26,25 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.elasticsearch.client.transport.TransportClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.OutputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static com.adc.da.sys.common.ReadExcelName.encodeFileName;
|
||||
|
||||
@RestController
|
||||
@@ -52,14 +63,14 @@ public class SearchCenterController extends BaseController<Map<String, Object>>
|
||||
@Autowired
|
||||
private ElasticsearchService elasticsearchService;
|
||||
|
||||
@Autowired
|
||||
/*@Autowired
|
||||
private ITsDicTypeService iTsDictypeService;
|
||||
|
||||
@ApiOperation("获取筛选条件")
|
||||
@PostMapping("/getMenu")
|
||||
public ResponseMessage<List<TsSearchMenu>> getSearchMenu(){
|
||||
return Result.success(iTsDictypeService.getSearchMenu());
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
+15
-11
@@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
|
||||
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
|
||||
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
|
||||
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest;
|
||||
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse;
|
||||
import org.elasticsearch.action.bulk.BulkRequestBuilder;
|
||||
@@ -19,6 +18,7 @@ import org.elasticsearch.action.index.IndexResponse;
|
||||
import org.elasticsearch.action.search.SearchRequestBuilder;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.action.search.SearchType;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedResponse;
|
||||
import org.elasticsearch.action.update.UpdateRequest;
|
||||
import org.elasticsearch.action.update.UpdateResponse;
|
||||
import org.elasticsearch.client.transport.TransportClient;
|
||||
@@ -26,15 +26,13 @@ import org.elasticsearch.common.text.Text;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
||||
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
||||
import org.elasticsearch.search.SearchHit;
|
||||
import org.elasticsearch.search.aggregations.AggregationBuilders;
|
||||
import org.elasticsearch.search.aggregations.BucketOrder;
|
||||
import org.elasticsearch.search.aggregations.bucket.range.Range;
|
||||
import org.elasticsearch.search.aggregations.bucket.terms.StringTerms;
|
||||
import org.elasticsearch.search.aggregations.metrics.avg.Avg;
|
||||
import org.elasticsearch.search.aggregations.metrics.max.Max;
|
||||
import org.elasticsearch.search.aggregations.metrics.Avg;
|
||||
import org.elasticsearch.search.aggregations.metrics.Max;
|
||||
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
|
||||
import org.elasticsearch.search.sort.SortOrder;
|
||||
import org.slf4j.Logger;
|
||||
@@ -43,7 +41,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@Component
|
||||
public class ElasticsearchServiceImpl implements ElasticsearchService {
|
||||
@@ -89,7 +91,8 @@ public class ElasticsearchServiceImpl implements ElasticsearchService {
|
||||
if (!isIndexExist(index)) {
|
||||
logger.info("Index is not exits!");
|
||||
}
|
||||
DeleteIndexResponse dResponse = client.admin().indices().prepareDelete(index).get();
|
||||
AcknowledgedResponse dResponse = client.admin().indices().prepareDelete(index).get();
|
||||
|
||||
if (dResponse.isAcknowledged()) {
|
||||
logger.info("delete index " + index + " successfully!");
|
||||
} else {
|
||||
@@ -184,13 +187,14 @@ public class ElasticsearchServiceImpl implements ElasticsearchService {
|
||||
*/
|
||||
@Override
|
||||
public long deleteAllDataOfIndex(String index) {
|
||||
BulkByScrollResponse response = DeleteByQueryAction.INSTANCE.newRequestBuilder(client)
|
||||
/*BulkByScrollResponse response = DeleteByQueryAction.INSTANCE.newRequestBuilder(client)
|
||||
.filter(QueryBuilders.matchAllQuery())
|
||||
.source(index)
|
||||
.get();
|
||||
//一共删除掉多少条
|
||||
long deleted = response.getDeleted();
|
||||
return deleted;
|
||||
return deleted;*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -390,7 +394,7 @@ public class ElasticsearchServiceImpl implements ElasticsearchService {
|
||||
|
||||
SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
|
||||
|
||||
long totalHits = searchResponse.getHits().totalHits;
|
||||
long totalHits = searchResponse.getHits().getTotalHits().value;
|
||||
long length = searchResponse.getHits().getHits().length;
|
||||
|
||||
logger.info("共查询到[{}]条数据,处理数据条数[{}]", totalHits, length);
|
||||
@@ -488,7 +492,7 @@ public class ElasticsearchServiceImpl implements ElasticsearchService {
|
||||
// 执行搜索,返回搜索响应信息
|
||||
SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
|
||||
|
||||
long totalHits = searchResponse.getHits().totalHits;
|
||||
long totalHits = searchResponse.getHits().getTotalHits().value;
|
||||
long length = searchResponse.getHits().getHits().length;
|
||||
|
||||
logger.debug("共查询到[{}]条数据,处理数据条数[{}]", totalHits, length);
|
||||
|
||||
+3
-3
@@ -807,7 +807,7 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
// 获取查询到的结果
|
||||
SearchResponse response = searchRequestBuilder.get();
|
||||
result = SearchResponseToList(response);
|
||||
searchInfoEO.getPager().setRowCount((int) response.getHits().getTotalHits());
|
||||
searchInfoEO.getPager().setRowCount((int) response.getHits().getTotalHits().value);
|
||||
Map<String, Aggregation> aggmap = response.getAggregations().asMap();
|
||||
if (!result.isEmpty()) {
|
||||
for (int i = 0; i < seniortype.length; i++) {
|
||||
@@ -1158,7 +1158,7 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
// }
|
||||
result.add(sourceAsMap);
|
||||
}
|
||||
searchInfoEO.getPager().setRowCount((int) response.getHits().getTotalHits());
|
||||
searchInfoEO.getPager().setRowCount((int) response.getHits().getTotalHits().value);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1243,7 +1243,7 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
}
|
||||
result.add(sourceAsMap);
|
||||
}
|
||||
searchInfoEO.getPager().setRowCount((int) response.getHits().getTotalHits());
|
||||
searchInfoEO.getPager().setRowCount((int) response.getHits().getTotalHits().value);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,12 @@
|
||||
<version>3.1.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adc</groupId>
|
||||
<artifactId>adc-da-search</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- poi -->
|
||||
|
||||
@@ -60,6 +60,7 @@ public class TsInstitution extends BaseEntity {
|
||||
private String hasChild;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty("用户")
|
||||
private TsUserVO tsUserVO;
|
||||
|
||||
|
||||
+16
-3
@@ -1,7 +1,11 @@
|
||||
package com.adc.da.slrs.sarLawsAttrDetailedList.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* //新增清单进行时间的添加
|
||||
@@ -13,10 +17,19 @@ import lombok.Data;
|
||||
public class StandRegionalTimeDto {
|
||||
@ApiModelProperty(value = "国家")
|
||||
private String country;
|
||||
|
||||
@ApiModelProperty(value = "实施日期")
|
||||
private String putTime;
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date putTime;
|
||||
|
||||
@ApiModelProperty(value = "在产车实施日期")
|
||||
private String zccssrq;
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date zccssrq;
|
||||
|
||||
@ApiModelProperty(value = "新车型实施日期")
|
||||
private String xcxssrq;
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date xcxssrq;
|
||||
}
|
||||
|
||||
+4
-5
@@ -17,6 +17,7 @@ import org.springframework.util.CollectionUtils;
|
||||
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@@ -284,13 +285,11 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
||||
}
|
||||
|
||||
private void dateTime(LinkedHashMap<String, List<String>> mapList, List<String> putTime, List<String> xcx, List<String> zcc, StandRegionalTimeDto s) {
|
||||
putTime.add(s.getPutTime()) ;
|
||||
xcx.add(s.getXcxssrq());
|
||||
zcc.add(s.getZccssrq());
|
||||
putTime.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime()));
|
||||
xcx.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq()));
|
||||
zcc.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq()));
|
||||
mapList.put("实施日期("+s.getCountry()+")",putTime);
|
||||
mapList.put("新车型实施日期("+s.getCountry()+")",xcx);
|
||||
mapList.put("在产车实施日期("+s.getCountry()+")",zcc);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarResource.dao;
|
||||
import com.adc.da.slrs.sarResource.entity.TsResource;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -19,4 +20,6 @@ public interface TsResourceDao extends BaseMapper<TsResource> {
|
||||
|
||||
List<TsResource> selectMenuByRole(TsResource sarMenuEO);
|
||||
|
||||
int insertTsRoleResource(HashMap<String,Object> map);
|
||||
|
||||
}
|
||||
|
||||
+9
@@ -7,6 +7,7 @@ import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.slrs.sarResource.dao.TsResourceDao;
|
||||
import com.adc.da.slrs.sarResource.entity.TsResource;
|
||||
import com.adc.da.slrs.sarResource.service.ITsResourceService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.utils.treetool.Tree;
|
||||
import com.adc.da.utils.treetool.TreeNode;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -17,6 +18,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -145,6 +147,7 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
||||
tsResourceQueryWrapper.eq("sor_divide",tsResource.getSorDivide());
|
||||
}
|
||||
tsResourceQueryWrapper.isNull("PARENT_ID");
|
||||
tsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
List<TsResource> TsResources=dao.selectList(tsResourceQueryWrapper);
|
||||
for(TsResource TsResource:TsResources){
|
||||
TsResource.setChildren(recursionGetChildren((TsResource)));
|
||||
@@ -166,6 +169,12 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
||||
}
|
||||
}
|
||||
dao.insert(TsResource);
|
||||
// 把新生成的子目录加入用户的权限的下----插入ts_role_resource表
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("resourceId",TsResource.getId());
|
||||
map.put("roleId",1);
|
||||
dao.insertTsRoleResource(map);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.slrs.sarRole.controller;
|
||||
|
||||
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
@@ -9,6 +10,7 @@ import com.adc.da.slrs.sarRole.entity.TsRoleMenuVO;
|
||||
import com.adc.da.slrs.sarRole.entity.TsRoleResourceVO;
|
||||
import com.adc.da.slrs.sarRole.service.ITsRoleService;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -53,10 +55,17 @@ public class TsRoleController extends BaseController<TsRole> {
|
||||
@ApiOperation("新增角色")
|
||||
@PostMapping
|
||||
public ResponseMessage<Object> addRole(@Validated(TsRole.insert.class) @RequestBody TsRole tsRole){
|
||||
//设置操作人
|
||||
UserEO userEO=UserUtils.getUser();
|
||||
tsRole.setOperator(userEO.getUname());
|
||||
return tsRoleService.addRole(tsRole);
|
||||
QueryWrapper<TsRole> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("NAME",tsRole.getName());
|
||||
int count = tsRoleService.count(queryWrapper);
|
||||
if (count>0){
|
||||
throw new AdcDaBaseException("角色名称已存在,请更换角色名称。");
|
||||
}else {
|
||||
//设置操作人
|
||||
UserEO userEO = UserUtils.getUser();
|
||||
tsRole.setOperator(userEO.getUname());
|
||||
return tsRoleService.addRole(tsRole);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("编辑角色")
|
||||
|
||||
+15
@@ -22,6 +22,7 @@ import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -59,8 +60,22 @@ public class SarStandAttrDetailsController extends BaseController<SarStandAttrDe
|
||||
// 标准属性字段
|
||||
List<SarStandAttrDetails> getInlandStandList = InitStandAttrUtil.standInlandAttrFieldList;
|
||||
resultMap.put(SarTypeEnum.INLAND_STAND.getValue(),getInlandStandList);
|
||||
|
||||
|
||||
List<SarStandAttrDetails> getForeignStandList = InitStandAttrUtil.standForeignAttrFieldList;
|
||||
//新增字段
|
||||
// Iterator<SarStandAttrDetails> iterator = getInlandStandList.iterator();
|
||||
// while (iterator.hasNext()){
|
||||
// SarStandAttrDetails next = iterator.next();
|
||||
//
|
||||
// if (next.getAttrName().matches("能源类型|适用产品线|适用认证|责任工程师|关联文件")){
|
||||
// getForeignStandList.add(next);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
resultMap.put(SarTypeEnum.FOREIGN_STAND.getValue(),getForeignStandList);
|
||||
|
||||
|
||||
// 政策属性字段
|
||||
List<SarStandAttrDetails> getInlandLawsList = InitStandAttrUtil.lawsInlandAttrFieldList;
|
||||
resultMap.put(SarTypeEnum.INLAND_LAWS.getValue(),getInlandLawsList);
|
||||
|
||||
+11
-3
@@ -5,11 +5,13 @@ import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -60,10 +62,14 @@ public class SarStandAttrInfo extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "新车型实施日期(文本)")
|
||||
@TableField("XCXSSRQ")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private String xcxssrq;
|
||||
|
||||
@ApiModelProperty(value = "在产车实施日期(文本)")
|
||||
@TableField("ZCCSSRQ")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private String zccssrq;
|
||||
|
||||
@ApiModelProperty(value = "标签")
|
||||
@@ -148,18 +154,20 @@ public class SarStandAttrInfo extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "实施日期(标准文本)")
|
||||
@TableField("SSRQ")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private String ssrq;
|
||||
|
||||
@ApiModelProperty(value = "实施日期(国际)")
|
||||
@TableField("SSRQGJ")
|
||||
@TableField(exist=false)
|
||||
private String ssrqgj;
|
||||
|
||||
@ApiModelProperty(value = "新车型实施日期(国家)")
|
||||
@TableField("XCXSSRQGJ")
|
||||
@TableField(exist=false)
|
||||
private String xcxssrqgj;
|
||||
|
||||
@ApiModelProperty(value = "在产车实施日期(国家)")
|
||||
@TableField("ZCCSSRQGJ")
|
||||
@TableField(exist=false)
|
||||
private String zccssrqgj;
|
||||
|
||||
@ApiModelProperty(value = "修改单")
|
||||
|
||||
+11
@@ -64,5 +64,16 @@ public class SarPublicIdeaController extends BaseController<SarPublicIdea> {
|
||||
return Result.success(publicList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "发起标准征求意见流程后自动公开征求意见")
|
||||
@PostMapping("/addSarPublicIdea")
|
||||
public ResponseMessage addSarPublicIdea(@RequestBody SarPublicIdea sarPublicIdea){
|
||||
try{
|
||||
sarPublicIdeaService.save(sarPublicIdea);
|
||||
}catch(Exception e){
|
||||
return Result.error();
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public class StandAttrInfoDto {
|
||||
//标准实施日期
|
||||
@ExcelProperty("标准实施日期")
|
||||
private String SSRQ;
|
||||
//新车型实施日期
|
||||
//新车型实施日期 数据库中字段实际没有GJ 如需要修改 可修改此处
|
||||
@ExcelProperty("新车型实施日期")
|
||||
private String XCXSSRQGJ;
|
||||
//在产车实施日期
|
||||
|
||||
+2
-1
@@ -246,6 +246,7 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private IPage<SarStandProjectLibrary> getSarStandProjectLibraryIPage(int current, int pageSize, QueryWrapper<SarStandProjectLibrary> wrapper) {
|
||||
Page<SarStandProjectLibrary> page = new Page<>(current, pageSize);
|
||||
IPage<SarStandProjectLibrary> userIPage = sarStandProjectLibraryDao.selectPage(page, wrapper);
|
||||
@@ -253,4 +254,4 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
System.out.println("总页数"+userIPage.getPages());
|
||||
return userIPage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -151,7 +151,9 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
page.setAdvanceSearchStr(null);
|
||||
}
|
||||
}
|
||||
page.setUserId(LoginUserUtil.getUserId());
|
||||
if(page.getUserId() == null || page.getUserId().equals("")){
|
||||
page.setUserId(LoginUserUtil.getUserId());
|
||||
}
|
||||
List<SarStandardsInfo> rows = sarStandardsInfoEOService.getSarStandardsInfoPage(page);
|
||||
return Result.success(getPageInfo(page.getPager(), rows));
|
||||
}
|
||||
|
||||
+404
@@ -191,5 +191,409 @@ public class SarStandardsInfo extends BaseEntity {
|
||||
|
||||
@TableField(exist = false)
|
||||
private String standSystemName;
|
||||
|
||||
public static long getSerialVersionUID() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getStandType() {
|
||||
return standType;
|
||||
}
|
||||
|
||||
public void setStandType(String standType) {
|
||||
this.standType = standType;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public String getStandSort() {
|
||||
return standSort;
|
||||
}
|
||||
|
||||
public void setStandSort(String standSort) {
|
||||
this.standSort = standSort;
|
||||
}
|
||||
|
||||
public String getStandNumber() {
|
||||
return standNumber;
|
||||
}
|
||||
|
||||
public void setStandNumber(String standNumber) {
|
||||
this.standNumber = standNumber;
|
||||
}
|
||||
|
||||
public String getStandYear() {
|
||||
return standYear;
|
||||
}
|
||||
|
||||
public void setStandYear(String standYear) {
|
||||
this.standYear = standYear;
|
||||
}
|
||||
|
||||
public String getStandName() {
|
||||
return standName;
|
||||
}
|
||||
|
||||
public void setStandName(String standName) {
|
||||
this.standName = standName;
|
||||
}
|
||||
|
||||
public String getStandEnName() {
|
||||
return standEnName;
|
||||
}
|
||||
|
||||
public void setStandEnName(String standEnName) {
|
||||
this.standEnName = standEnName;
|
||||
}
|
||||
|
||||
public String getStandState() {
|
||||
return standState;
|
||||
}
|
||||
|
||||
public void setStandState(String standState) {
|
||||
this.standState = standState;
|
||||
}
|
||||
|
||||
public String getStandNature() {
|
||||
return standNature;
|
||||
}
|
||||
|
||||
public void setStandNature(String standNature) {
|
||||
this.standNature = standNature;
|
||||
}
|
||||
|
||||
public String getIssueTime() {
|
||||
return issueTime;
|
||||
}
|
||||
|
||||
public void setIssueTime(String issueTime) {
|
||||
this.issueTime = issueTime;
|
||||
}
|
||||
|
||||
public Date getPutTime() {
|
||||
return putTime;
|
||||
}
|
||||
|
||||
public void setPutTime(Date putTime) {
|
||||
this.putTime = putTime;
|
||||
}
|
||||
|
||||
public String getSynopsis() {
|
||||
return synopsis;
|
||||
}
|
||||
|
||||
public void setSynopsis(String synopsis) {
|
||||
this.synopsis = synopsis;
|
||||
}
|
||||
|
||||
public String getReplaceStandNum() {
|
||||
return replaceStandNum;
|
||||
}
|
||||
|
||||
public void setReplaceStandNum(String replaceStandNum) {
|
||||
this.replaceStandNum = replaceStandNum;
|
||||
}
|
||||
|
||||
public String getReplacedStandNum() {
|
||||
return replacedStandNum;
|
||||
}
|
||||
|
||||
public void setReplacedStandNum(String replacedStandNum) {
|
||||
this.replacedStandNum = replacedStandNum;
|
||||
}
|
||||
|
||||
public String getCreationUser() {
|
||||
return creationUser;
|
||||
}
|
||||
|
||||
public void setCreationUser(String creationUser) {
|
||||
this.creationUser = creationUser;
|
||||
}
|
||||
|
||||
public String getValidFlag() {
|
||||
return validFlag;
|
||||
}
|
||||
|
||||
public void setValidFlag(String validFlag) {
|
||||
this.validFlag = validFlag;
|
||||
}
|
||||
|
||||
public Date getCreationTime() {
|
||||
return creationTime;
|
||||
}
|
||||
|
||||
public void setCreationTime(Date creationTime) {
|
||||
this.creationTime = creationTime;
|
||||
}
|
||||
|
||||
public Date getModifyTime() {
|
||||
return modifyTime;
|
||||
}
|
||||
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
public String getIsRelateAccess() {
|
||||
return isRelateAccess;
|
||||
}
|
||||
|
||||
public void setIsRelateAccess(String isRelateAccess) {
|
||||
this.isRelateAccess = isRelateAccess;
|
||||
}
|
||||
|
||||
public String getCiteStand() {
|
||||
return citeStand;
|
||||
}
|
||||
|
||||
public void setCiteStand(String citeStand) {
|
||||
this.citeStand = citeStand;
|
||||
}
|
||||
|
||||
public String getCitedStand() {
|
||||
return citedStand;
|
||||
}
|
||||
|
||||
public void setCitedStand(String citedStand) {
|
||||
this.citedStand = citedStand;
|
||||
}
|
||||
|
||||
public String getTextStatus() {
|
||||
return textStatus;
|
||||
}
|
||||
|
||||
public void setTextStatus(String textStatus) {
|
||||
this.textStatus = textStatus;
|
||||
}
|
||||
|
||||
public String getStandSystem() {
|
||||
return standSystem;
|
||||
}
|
||||
|
||||
public void setStandSystem(String standSystem) {
|
||||
this.standSystem = standSystem;
|
||||
}
|
||||
|
||||
public String getCollectId() {
|
||||
return collectId;
|
||||
}
|
||||
|
||||
public void setCollectId(String collectId) {
|
||||
this.collectId = collectId;
|
||||
}
|
||||
|
||||
public String getCountryShow() {
|
||||
return countryShow;
|
||||
}
|
||||
|
||||
public void setCountryShow(String countryShow) {
|
||||
this.countryShow = countryShow;
|
||||
}
|
||||
|
||||
public String getStandSortShow() {
|
||||
return standSortShow;
|
||||
}
|
||||
|
||||
public void setStandSortShow(String standSortShow) {
|
||||
this.standSortShow = standSortShow;
|
||||
}
|
||||
|
||||
public String getStandStateShow() {
|
||||
return standStateShow;
|
||||
}
|
||||
|
||||
public void setStandStateShow(String standStateShow) {
|
||||
this.standStateShow = standStateShow;
|
||||
}
|
||||
|
||||
public String getStandNatureShow() {
|
||||
return standNatureShow;
|
||||
}
|
||||
|
||||
public void setStandNatureShow(String standNatureShow) {
|
||||
this.standNatureShow = standNatureShow;
|
||||
}
|
||||
|
||||
public String getSychronId() {
|
||||
return sychronId;
|
||||
}
|
||||
|
||||
public void setSychronId(String sychronId) {
|
||||
this.sychronId = sychronId;
|
||||
}
|
||||
|
||||
public List<DicTypeEO> getDicTypeList() {
|
||||
return dicTypeList;
|
||||
}
|
||||
|
||||
public void setDicTypeList(List<DicTypeEO> dicTypeList) {
|
||||
this.dicTypeList = dicTypeList;
|
||||
}
|
||||
|
||||
public List<SarStandAttrDetails> getAttrInfoList() {
|
||||
return attrInfoList;
|
||||
}
|
||||
|
||||
public void setAttrInfoList(List<SarStandAttrDetails> attrInfoList) {
|
||||
this.attrInfoList = attrInfoList;
|
||||
}
|
||||
|
||||
public Map<String, Object> getAttrInfoMap() {
|
||||
return attrInfoMap;
|
||||
}
|
||||
|
||||
public void setAttrInfoMap(Map<String, Object> attrInfoMap) {
|
||||
this.attrInfoMap = attrInfoMap;
|
||||
}
|
||||
|
||||
public Map<String, Object> getAttrInfoCaseMap() {
|
||||
return attrInfoCaseMap;
|
||||
}
|
||||
|
||||
public void setAttrInfoCaseMap(Map<String, Object> attrInfoCaseMap) {
|
||||
this.attrInfoCaseMap = attrInfoCaseMap;
|
||||
}
|
||||
|
||||
public String getSarStandAttrEOStr() {
|
||||
return sarStandAttrEOStr;
|
||||
}
|
||||
|
||||
public void setSarStandAttrEOStr(String sarStandAttrEOStr) {
|
||||
this.sarStandAttrEOStr = sarStandAttrEOStr;
|
||||
}
|
||||
|
||||
public String getMenuId() {
|
||||
return menuId;
|
||||
}
|
||||
|
||||
public void setMenuId(String menuId) {
|
||||
this.menuId = menuId;
|
||||
}
|
||||
|
||||
public int getUpReplaceNumFlag() {
|
||||
return upReplaceNumFlag;
|
||||
}
|
||||
|
||||
public void setUpReplaceNumFlag(int upReplaceNumFlag) {
|
||||
this.upReplaceNumFlag = upReplaceNumFlag;
|
||||
}
|
||||
|
||||
public int getUpNumFlag() {
|
||||
return upNumFlag;
|
||||
}
|
||||
|
||||
public void setUpNumFlag(int upNumFlag) {
|
||||
this.upNumFlag = upNumFlag;
|
||||
}
|
||||
|
||||
public String getFileIds() {
|
||||
return fileIds;
|
||||
}
|
||||
|
||||
public void setFileIds(String fileIds) {
|
||||
this.fileIds = fileIds;
|
||||
}
|
||||
|
||||
public Date getNewCarPutTime() {
|
||||
return newCarPutTime;
|
||||
}
|
||||
|
||||
public void setNewCarPutTime(Date newCarPutTime) {
|
||||
this.newCarPutTime = newCarPutTime;
|
||||
}
|
||||
|
||||
public List<SarStandItems> getItemsList() {
|
||||
return itemsList;
|
||||
}
|
||||
|
||||
public void setItemsList(List<SarStandItems> itemsList) {
|
||||
this.itemsList = itemsList;
|
||||
}
|
||||
|
||||
public String getRelateStand() {
|
||||
return relateStand;
|
||||
}
|
||||
|
||||
public void setRelateStand(String relateStand) {
|
||||
this.relateStand = relateStand;
|
||||
}
|
||||
|
||||
public String getAccessCountry() {
|
||||
return accessCountry;
|
||||
}
|
||||
|
||||
public void setAccessCountry(String accessCountry) {
|
||||
this.accessCountry = accessCountry;
|
||||
}
|
||||
|
||||
public String getProcessNum() {
|
||||
return processNum;
|
||||
}
|
||||
|
||||
public void setProcessNum(String processNum) {
|
||||
this.processNum = processNum;
|
||||
}
|
||||
|
||||
public String getMenuType() {
|
||||
return menuType;
|
||||
}
|
||||
|
||||
public void setMenuType(String menuType) {
|
||||
this.menuType = menuType;
|
||||
}
|
||||
|
||||
public String getAllPutTime() {
|
||||
return allPutTime;
|
||||
}
|
||||
|
||||
public void setAllPutTime(String allPutTime) {
|
||||
this.allPutTime = allPutTime;
|
||||
}
|
||||
|
||||
public String getJspg() {
|
||||
return jspg;
|
||||
}
|
||||
|
||||
public void setJspg(String jspg) {
|
||||
this.jspg = jspg;
|
||||
}
|
||||
|
||||
public String getCHJL() {
|
||||
return CHJL;
|
||||
}
|
||||
|
||||
public void setCHJL(String CHJL) {
|
||||
this.CHJL = CHJL;
|
||||
}
|
||||
|
||||
public String getPutTime2() {
|
||||
return putTime2;
|
||||
}
|
||||
|
||||
public void setPutTime2(String putTime2) {
|
||||
this.putTime2 = putTime2;
|
||||
}
|
||||
|
||||
public String getStandSystemName() {
|
||||
return standSystemName;
|
||||
}
|
||||
|
||||
public void setStandSystemName(String standSystemName) {
|
||||
this.standSystemName = standSystemName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+152
-14
@@ -11,6 +11,7 @@ import com.adc.da.person.dao.PersonCollectEODao;
|
||||
import com.adc.da.person.dao.PersonShareEODao;
|
||||
import com.adc.da.person.entity.PersonMsgEO;
|
||||
import com.adc.da.person.service.IPersonCollectEOService;
|
||||
import com.adc.da.search.service.StandLawsSearchService;
|
||||
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
|
||||
import com.adc.da.slrs.sarLawsInfo.page.SarLawsInfoEOPage;
|
||||
import com.adc.da.slrs.sarLawsInfo.page.SarLawsItemsEOPage;
|
||||
@@ -60,6 +61,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.util.PDFTextStripper;
|
||||
import org.apache.pdfbox.util.PDFTextStripperByArea;
|
||||
import org.apache.poi.hwpf.extractor.WordExtractor;
|
||||
import org.apache.poi.openxml4j.opc.OPCPackage;
|
||||
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -70,6 +78,7 @@ import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.sql.Clob;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
@@ -175,6 +184,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
@Autowired
|
||||
private CreateStandMQService createStandMQService;
|
||||
|
||||
@Autowired
|
||||
private StandLawsSearchService standLawsSearchService;
|
||||
|
||||
|
||||
/***
|
||||
* @Description: 分页查询
|
||||
@@ -185,16 +197,23 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
*/
|
||||
public List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception {
|
||||
//查询当前登录人角色拥有权限的菜单
|
||||
List<String> getMenuIdList=tsUserService.getResourceId(new TsResource());
|
||||
// List<String> getMenuIdList = sarMenuEOService.queryRoleMenuIdList(page.getStandType() + "_STAND", null);
|
||||
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
} else {
|
||||
page.setMenuRoleList(null);
|
||||
}
|
||||
List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
page.setMenuAllChildrenIdList(ids);
|
||||
if(page.getMenuId() != null ){
|
||||
QueryWrapper<TsResource> qw = new QueryWrapper<>();
|
||||
qw.eq("ID",page.getMenuId());
|
||||
qw.isNull("PARENT_ID");
|
||||
List<TsResource> children = iTsResourceService.list(qw);
|
||||
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
|
||||
List<String> getMenuIdList = tsUserService.getResourceId(new TsResource());
|
||||
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
} else {
|
||||
page.setMenuRoleList(null);
|
||||
}
|
||||
List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
page.setMenuAllChildrenIdList(ids);
|
||||
}
|
||||
}
|
||||
}
|
||||
Integer rowCount = dao.getSarStandardsInfoCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
@@ -601,8 +620,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
sarStandFileEO.setFileSuffix(fileInfo.getFileSuffix());
|
||||
sarStandFileEO.setOriAttId(fileInfo.getId());
|
||||
standFileList.add(sarStandFileEO);
|
||||
//文档转换
|
||||
if ("pdf".equals(fileInfo.getFileSuffix()) || "PDF".equals(fileInfo.getFileSuffix())) {
|
||||
//多文档转换 PPT|PPTX|ppt|pptx|PDF|pdf|DOC|doc|DOCX|docx
|
||||
if (verifyFileType(fileInfo.getFileSuffix())) {
|
||||
SarStandFile newFileEO = new SarStandFile();
|
||||
newFileEO.setCreationUser(LoginUserUtil.getUserId());
|
||||
newFileEO.setCreationTime(new Date());
|
||||
@@ -633,6 +652,11 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
}
|
||||
}
|
||||
|
||||
private Boolean verifyFileType(String str){
|
||||
String verifyType = "^PPT|PPTX|ppt|pptx|PDF|pdf|DOC|doc|DOCX|docx*$";
|
||||
return Pattern.matches(verifyType,str);
|
||||
}
|
||||
|
||||
public void createStandPutTime(String standId, Map<String, String> multiTimeMap) throws Exception {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (multiTimeMap != null && multiTimeMap.size() > 0) {
|
||||
@@ -1957,12 +1981,126 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
|
||||
@Override
|
||||
public void insertIntoIndexForMap(Map<String, Object> attrInfoMap) {
|
||||
|
||||
Set<String> keys = attrInfoMap.keySet();
|
||||
for (String key:keys) {
|
||||
String value = String.valueOf(attrInfoMap.get(key));
|
||||
if (com.adc.da.util.utils.StringUtils.isNotBlank(value) && !"null".equals(value) && !"SVPPS".equals(key)){
|
||||
value = value.replace(" , ",",");
|
||||
value = value.replace(","," , ");
|
||||
attrInfoMap.put(key,value);
|
||||
}
|
||||
}
|
||||
// 根据文件attid 读取文件内容
|
||||
if (org.apache.commons.lang.StringUtils.isNotEmpty(String.valueOf(attrInfoMap.get("content")))) {
|
||||
String[] attidlist = String.valueOf(attrInfoMap.get("content")).split(" , ");
|
||||
StringBuilder content = new StringBuilder("");
|
||||
for (int i = 0; i < attidlist.length; i++) {
|
||||
if(org.apache.commons.lang.StringUtils.isNotEmpty(attidlist[i]) ){
|
||||
AttFileEO attFileEO = attFileEOService.getFileInfo(attidlist[i]);
|
||||
//String readFilePath = filePath + "/" + attFileEO.getFilePath() + attFileEO.getFileName();
|
||||
String readFilePath = "E:\\上汽企标流程总览.pdf";
|
||||
try {
|
||||
// 判断文件是docx还是PDF
|
||||
if (null != attFileEO.getFileSuffix() && (attFileEO.getFileSuffix().equals("docx") || attFileEO.getFileSuffix().equals("doc") || attFileEO.getFileSuffix().equals("ppt") || attFileEO.getFileSuffix().equals("pptx"))) {
|
||||
if(attFileEO.getFileSuffix().equals("doc")){
|
||||
FileInputStream fis = new FileInputStream(readFilePath);
|
||||
WordExtractor wordExtractor = new WordExtractor(fis);
|
||||
String txt = wordExtractor.getText();
|
||||
content.append(txt);
|
||||
}else {
|
||||
OPCPackage opcPackage = XWPFDocument.openPackage(readFilePath);
|
||||
XWPFWordExtractor extractor = new XWPFWordExtractor(opcPackage);
|
||||
String txt = extractor.getText();
|
||||
content.append(txt);
|
||||
}
|
||||
} else {
|
||||
PDDocument document = PDDocument.load(new File(readFilePath));
|
||||
document.getClass();
|
||||
if (!document.isEncrypted()) {
|
||||
PDFTextStripperByArea stripper = new PDFTextStripperByArea();
|
||||
stripper.setSortByPosition(true);
|
||||
PDFTextStripper tStripper = new PDFTextStripper();
|
||||
String pdfFileInText = tStripper.getText(document);
|
||||
// String[] lines = pdfFileInText.split("\\r?\\n");
|
||||
content.append(pdfFileInText);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("搜索中心新增数据读取文档内容时失败");
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
attrInfoMap.put("content",content.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
attrInfoMap.put("content","");
|
||||
}
|
||||
standLawsSearchService.addStandLawsSearchForMap(attrInfoMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateIntoIndexForMap(Map<String, Object> attrInfoMap) {
|
||||
|
||||
Set<String> keys = attrInfoMap.keySet();
|
||||
for (String key:keys) {
|
||||
String value = String.valueOf(attrInfoMap.get(key));
|
||||
if (com.adc.da.util.utils.StringUtils.isNotBlank(value) && !"null".equals(value) && !"SVPPS".equals(key) && !"content".equals(key)){
|
||||
value = value.replace(" , ",",");
|
||||
value = value.replace(","," , ");
|
||||
attrInfoMap.put(key,value);
|
||||
}
|
||||
}
|
||||
// 根据文件attid 读取文件内容
|
||||
if (org.apache.commons.lang.StringUtils.isNotEmpty(String.valueOf(attrInfoMap.get("content")))) {
|
||||
String[] attidlist = String.valueOf(attrInfoMap.get("content")).split(" , ");
|
||||
StringBuilder content = new StringBuilder("");
|
||||
for (int i = 0; i < attidlist.length; i++) {
|
||||
if(org.apache.commons.lang.StringUtils.isNotEmpty(attidlist[i]) && !"null".equals(attidlist[i])){
|
||||
AttFileEO attFileEO = attFileEOService.getFileInfo(attidlist[i]);
|
||||
//String readFilePath = filePath + "/" + attFileEO.getFilePath() + attFileEO.getFileName();
|
||||
try {
|
||||
// 判断文件是docx还是PDF
|
||||
/*if (attFileEO.getFileSuffix().equals("docx") || attFileEO.getFileSuffix().equals("doc")) {
|
||||
if(attFileEO.getFileSuffix().equals("doc")){
|
||||
FileInputStream fis = new FileInputStream(readFilePath);
|
||||
WordExtractor wordExtractor = new WordExtractor(fis);
|
||||
String txt = wordExtractor.getText();
|
||||
content.append(txt);
|
||||
}else {
|
||||
OPCPackage opcPackage = XWPFDocument.openPackage(readFilePath);
|
||||
XWPFWordExtractor extractor = new XWPFWordExtractor(opcPackage);
|
||||
String txt = extractor.getText();
|
||||
content.append(txt);
|
||||
}
|
||||
} else if (attFileEO.getFileSuffix().equals("pdf")){
|
||||
PDDocument document = PDDocument.load(new File(readFilePath));
|
||||
document.getClass();
|
||||
if (!document.isEncrypted()) {
|
||||
PDFTextStripperByArea stripper = new PDFTextStripperByArea();
|
||||
stripper.setSortByPosition(true);
|
||||
PDFTextStripper tStripper = new PDFTextStripper();
|
||||
String pdfFileInText = tStripper.getText(document);
|
||||
// String[] lines = pdfFileInText.split("\\r?\\n");
|
||||
content.append(pdfFileInText);
|
||||
}
|
||||
}*/
|
||||
String readFilePath = "E:\\上汽企标流程总览.pdf";
|
||||
FileInputStream fis = new FileInputStream(readFilePath);
|
||||
WordExtractor wordExtractor = new WordExtractor(fis);
|
||||
String txt = wordExtractor.getText();
|
||||
content.append(txt);
|
||||
} catch (Exception e) {
|
||||
logger.error("搜索中心修改数据读取文档内容时失败");
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
attrInfoMap.put("content",content.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
attrInfoMap.put("content","");
|
||||
}
|
||||
standLawsSearchService.updateStandLawsSearchForMap(attrInfoMap);
|
||||
}
|
||||
//
|
||||
// @Override
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.adc.da.slrs.search;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsSearchMenu;
|
||||
import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/search")
|
||||
public class SearchController {
|
||||
|
||||
@Autowired
|
||||
private ITsDicTypeService iTsDictypeService;
|
||||
|
||||
@ApiOperation("获取筛选条件")
|
||||
@PostMapping("/getMenu")
|
||||
public ResponseMessage<List<TsSearchMenu>> getSearchMenu(){
|
||||
return Result.success(iTsDictypeService.getSearchMenu());
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,9 @@ public class FieldConvertUtil {
|
||||
public static String exportBaseFieldNames = "标准体系,是否纳入认证清单,标准性质,标准类别,标准编号,标准年份,中文名称,英文名称," +
|
||||
"文本状态,发布日期"; // 导出基础表字段 //删除 实施日期 2021-05-28
|
||||
|
||||
public static String exportBaseFieldNamesForeign = "重要度,标准类别,标准编号,标准年份/系列,中文名称,英文名称," +
|
||||
"标准状态,发布日期,文本说明"; // 导出基础表字段
|
||||
public static String exportBaseFieldNamesForeign = "标准类别,标准编号,标准年份,中文名称,英文名称," +
|
||||
"文本状态,发布日期,文本说明,是否纳入认证清单,体系类别,标签,适用产品线,适用认证,能源类型,责任工程师," +
|
||||
"关联文件,发布稿,增补件,勘误件,草案"; // 导出基础表字段
|
||||
|
||||
public static String exportAttrFieldNamesInland = "归口管理部门,发布机构,工作组信息,我司参与深度,适用车辆类型,要求类型," +
|
||||
"标签,发布稿(必读),增补件(必读),报批稿,送审稿,征求意见稿,草案,相关资料,新车型实施日期(文本),在产车实施日期(文本)," +
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
<result column="remarks" property="remarks" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<!-- SAR_MENU table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
parent_id, menu_name, sor_divide, id, modify_time, creation_time, valid_flag, display_seq, parent_ids, remarks
|
||||
@@ -69,6 +71,12 @@
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
|
||||
<insert id="insertTsRoleResource" parameterType="java.util.Map">
|
||||
INSERT INTO ts_role_resource
|
||||
VALUES(#{roleId},#{resourceId} )
|
||||
</insert>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.slrs.sarResource.entity.TsResource" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
|
||||
@@ -77,6 +77,28 @@
|
||||
<artifactId>dom4j</artifactId>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- pdf -->
|
||||
<dependency>
|
||||
<groupId>com.lowagie</groupId>
|
||||
<artifactId>itext</artifactId>
|
||||
<version>2.1.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lowagie</groupId>
|
||||
<artifactId>itextasian</artifactId>
|
||||
<version>2.1.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itextpdf</artifactId>
|
||||
<version>5.5.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itext-asian</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
package com.adc.da.att.controller;
|
||||
|
||||
import com.adc.da.att.dao.UserDao;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.att.entity.TsUser;
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.att.vo.AttFileVo;
|
||||
import com.adc.da.file.store.IFileStore;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.util.MD5Util;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.util.WaterMarkUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
@@ -46,6 +50,9 @@ public class AttFileEOController {
|
||||
@Autowired
|
||||
private IFileStore iFileStore;
|
||||
|
||||
@Autowired
|
||||
private UserDao userDao;
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@@ -249,7 +256,7 @@ public class AttFileEOController {
|
||||
@ApiOperation(value = "|File|下载文件加水印")
|
||||
@GetMapping("/downloadFileForSarWaterMark")
|
||||
// @RequiresPermissions("sys:file:downloadFileForSar")
|
||||
public void downloadFileForSarWaterMark(String fileId, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
public void downloadFileForSarWaterMark(String userId,String fileId, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
AttFileEO attFileEO = attFileEOService.getFileInfo(fileId);
|
||||
InputStream is = null;
|
||||
OutputStream os = null;
|
||||
@@ -265,24 +272,36 @@ public class AttFileEOController {
|
||||
}
|
||||
String waterFilePath = newFilePath + attFileEO.getOldFileName();
|
||||
// 添加水印
|
||||
String waterContent = "";
|
||||
// String userId = LoginUserUtil.getUserId();
|
||||
// String userMsg = "";
|
||||
// UserEO userEO = userEOService.selectByPrimaryKey(userId);
|
||||
// if (userEO != null) {
|
||||
// userMsg = userEO.getUname() + ",";
|
||||
// if (StringUtils.isNotEmpty(userEO.getWorkNum())) {
|
||||
// userMsg += userEO.getWorkNum() + ",";
|
||||
String userMsg = "";
|
||||
TsUser tsUser = userDao.selectById(userId);
|
||||
if (tsUser != null) {
|
||||
userMsg = tsUser.getUname() + ",";
|
||||
//2021/7/28水印内容取消工号
|
||||
// if (StringUtils.isNotEmpty(tsUser.getWorkNum())) {
|
||||
// userMsg += tsUser.getWorkNum() + ",";
|
||||
// }
|
||||
// }
|
||||
}
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");//设置日期格式
|
||||
String date = df.format(new Date());
|
||||
// waterContent = userMsg + date;
|
||||
String waterContent = userMsg+date ;
|
||||
//2020年9月5日 去掉水印处理
|
||||
// WaterMarkUtil.waterMark(oldFilePath,waterFilePath,waterContent);
|
||||
//2021年7月25日要求下载生成水印
|
||||
WaterMarkUtil.waterMark(oldFilePath,waterFilePath,waterContent);
|
||||
response.setHeader("Content-Disposition", "attachment;filename=\""+fileOldName+"\"");
|
||||
response.setContentType("application/octet-stream");
|
||||
File file = new File(filePath+attFileEO.getFilePath()+attFileEO.getFileName());
|
||||
|
||||
String downloadFilePath="";
|
||||
String fileName=attFileEO.getFileName();
|
||||
String suffix=fileName.substring(fileName.lastIndexOf(".")+1);
|
||||
//只能在pdf中添加水印,
|
||||
//非pdf文件直接下载原文件
|
||||
if (suffix.equals("pdf")){
|
||||
downloadFilePath=waterFilePath;
|
||||
}else {
|
||||
downloadFilePath=oldFilePath;
|
||||
}
|
||||
|
||||
File file = new File(downloadFilePath);
|
||||
is = new FileInputStream(file);
|
||||
os = response.getOutputStream();
|
||||
IOUtils.copy(is, os);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.adc.da.att.dao;
|
||||
|
||||
import com.adc.da.att.entity.TsUser;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface UserDao extends BaseMapper<TsUser> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.adc.da.att.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TsUser extends BaseEntity implements Serializable {
|
||||
@TableId
|
||||
private String usid;
|
||||
@TableField
|
||||
private String uname;
|
||||
@TableField
|
||||
private String workNum;
|
||||
|
||||
|
||||
}
|
||||
+1
-1
@@ -93,7 +93,7 @@ public class PersonCollectEOController extends BaseController<TsPersonCollect> {
|
||||
|
||||
|
||||
@ApiOperation(value = "|PersonCollectEO|修改")
|
||||
@PutMapping(consumes = APPLICATION_JSON_UTF8_VALUE)
|
||||
@PutMapping(consumes = APPLICATION_JSON_UTF8_VALUE,value = "/updatePersonCollect")
|
||||
// @RequiresPermissions("person:personCollect:update")
|
||||
public ResponseMessage<TsPersonCollect> update(@RequestBody TsPersonCollect tsPersonCollect) throws Exception {
|
||||
tsPersonCollect.setModifyTime(new Date());
|
||||
|
||||
@@ -461,8 +461,9 @@
|
||||
AND SAR_LAWS_ITEM_VAL.VALID_FLAG =0
|
||||
union
|
||||
select count(*) from SAR_BUSSIONESS_STAND
|
||||
where (SAR_BUSSIONESS_STAND.STAND_GENERA = #{dicTypeCode} or
|
||||
SAR_BUSSIONESS_STAND.STAND_SUBCLASS = #{dicTypeCode} or
|
||||
where (
|
||||
<!--SAR_BUSSIONESS_STAND.STAND_GENERA = #{dicTypeCode} or-->
|
||||
<!--SAR_BUSSIONESS_STAND.STAND_SUBCLASS = #{dicTypeCode} or-->
|
||||
SAR_BUSSIONESS_STAND.STAND_STATUS = #{dicTypeCode} or
|
||||
SAR_BUSSIONESS_STAND.STAND_SORT = #{dicTypeCode})
|
||||
and SAR_BUSSIONESS_STAND.VALID_FLAG =0
|
||||
|
||||
Reference in New Issue
Block a user