Commit f998e1c2 authored by caotao's avatar caotao

知识库代码提交

parent 5167791c
......@@ -21,6 +21,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<!-- 规则模块 -->
<dependency>
<groupId>com.yeejoin</groupId>
......@@ -74,20 +78,28 @@
<artifactId>html2pdf</artifactId>
<version>2.0.1</version>
</dependency>
<!-- 解析excel -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<!-- 解析excel -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<!-- 针对2007以上版本的库 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<!-- 针对2003版本的库 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.poi.xwpf.converter.xhtml</artifactId>
<version>2.0.2</version>
</dependency>
</dependencies>
</project>
package com.yeejoin.amos.knowledgebase.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeDocContent;
import org.apache.ibatis.annotations.Param;
......@@ -9,7 +10,7 @@ import java.util.Map;
/**
* <p>
* 知识库文档存储 Mapper 接口
* 知识库文档存储 Mapper 接口
* </p>
*
* @author 子杨
......@@ -18,18 +19,24 @@ import java.util.Map;
public interface DocContentMapper extends BaseMapper<KnowledgeDocContent> {
List<Map<String,Long>> searchForDocIds(@Param("agencyCode") String agencyCode,
@Param("queryStr") String queryStr,
@Param("docStatus")String []docStatus,
@Param("auditStatus")String [] auditStatus,
@Param("userId")String userId,
@Param("orgCode")String orgCode,
@Param("offset") long offset,
@Param("length") long length);
List<Map<String, Long>> searchForDocIds(
@Param("agencyCode") String agencyCode,
@Param("queryStr") String queryStr,
@Param("docStatus") String[] docStatus,
@Param("auditStatus") String[] auditStatus,
@Param("userId") String userId,
@Param("orgCode") String orgCode,
@Param("offset") long offset,
@Param("length") long length);
List<Map<String,Object>> queryDocBaseInfoList(Map<String, Object> paramMap);
List<Map<String, Object>> queryDocBaseInfoList(Map<String, Object> paramMap);
int queryDocBaseInfoTotal(Map<String, Object> paramMap);
List<Long> getAllPublishedDocIds();
IPage<KnowledgeDocContent> pageByType(
IPage<KnowledgeDocContent> page,
@Param("typeId") Long typeId,
@Param("tagId") Long tagId);
}
\ No newline at end of file
package com.yeejoin.amos.knowledgebase.face.orm.dao;
import com.yeejoin.amos.knowledgebase.face.orm.entity.ESDocEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchCrudRepository;
public interface ESDocRepository extends ElasticsearchCrudRepository<ESDocEntity, Long> {
......
......@@ -2,7 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowlegeStatisticsRecord;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -37,5 +39,21 @@ public interface StatisticsRecordMapper extends BaseMapper<KnowlegeStatisticsRec
* 按类型查询/按时间分段总计
*/
List<Map<String, Object>> selectCountByNameAndDateRange(Map<String, Object> queryMap);
List<Map<String, Object>> tagStatisticsMonth(@Param("tag")String tag, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
List<Map<String, Object>> tagStatisticsYear(@Param("tag")String tag, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
List<Map<String, Object>> docStatisticsMonth(@Param("categoryName")String categoryName, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
List<Map<String, Object>> docStatisticsYear(@Param("categoryName")String categoryName, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
List<Map<String, Object>> tagChartStatistics(@Param("tag")String tag, @Param("startDate")Date startDate, @Param("endDate")Date endDate,@Param("splitSQL")String splitSQL);
List<Map<String, Object>> tagTimeChartStatistics(@Param("startDate")Date startDate, @Param("endDate")Date endDate,@Param("splitSQL")String splitSQL);
List<Map<String, Object>> docChartStatistics(@Param("startDate")Date startDate, @Param("endDate")Date endDate);
List<Map<String, Object>> docBurnChartStatistics(@Param("startDate")Date startDate,@Param("endDate") Date endDate);
}
\ No newline at end of file
package com.yeejoin.amos.knowledgebase.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagValueModel;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTagValue;
import org.apache.ibatis.annotations.Param;
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import java.util.Date;
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* <p>
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* <p>
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* <p>
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* <p>
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* <p>
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* <p>
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* <p>
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* <p>
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* <p>
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* <p>
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.knowledgebase.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* <p>
......
......@@ -24,6 +24,29 @@
</exclusion>
</exclusions>
</dependency>
<!-- 解析excel -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<!-- 针对2007以上版本的库 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<!-- 针对2003版本的库 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.poi.xwpf.converter.xhtml</artifactId>
<version>2.0.2</version>
</dependency>
</dependencies>
</project>
//package com.yeejoin.amos.knowledgebase.config;
//
//import com.baomidou.mybatisplus.core.toolkit.Sequence;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @author 杨博超
// * @ClassName Config
// * @Deacription TODO
// **/
//@Configuration
//public class Config {
//
// @Bean
// public Sequence sequence() {
// return new Sequence();
// }
//}
package com.yeejoin.amos.knowledgebase.config;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author 杨博超
* @ClassName Config
* @Deacription TODO
**/
@Configuration
public class Config {
@Bean
public Sequence sequence() {
return new Sequence();
}
}
......@@ -2,12 +2,7 @@ package com.yeejoin.amos.knowledgebase.config;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
......@@ -21,31 +16,17 @@ public class ElasticSearchClientConfig {
@Value("${spring.elasticsearch.rest.uris}")
private String uris;
@Value("${elasticsearch.username}")
private String username;
@Value("${elasticsearch.password}")
private String password;
@Bean
@Qualifier("highLevelClient")
public RestHighLevelClient restHighLevelClient() {
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY,
new UsernamePasswordCredentials(username, password));
try {
String url = uris.replace("http://", "");
final String[] parts = StringUtils.split(url, ":");
HttpHost httpHost = new HttpHost(parts[0], Integer.parseInt(parts[1]), "http");
RestClientBuilder builder = RestClient.builder(httpHost);
builder.setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {
@Override
public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpClientBuilder) {
httpClientBuilder.disableAuthCaching();
return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
}
});
builder.setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback() {
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
@Override
......
......@@ -34,6 +34,7 @@ import java.util.List;
public class DocAnnotateResource {
private final Logger logger = LogManager.getLogger(DocAnnotateResource.class);
@Autowired
private DocAnnotateService docAnnotateService;
......
......@@ -86,7 +86,7 @@ public class DocCategoryResource {
return ResponseHelper.buildResponse(docCategoryService.queryForKnowledgeDocCategoryList(parentId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "文档分类树查询")
@RequestMapping(value = "/tree", method = RequestMethod.GET)
public ResponseModel<Collection<KnowledgeDocCategoryModel>> docCategoryTree() {
......
package com.yeejoin.amos.knowledgebase.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDocCommentsModel;
import com.yeejoin.amos.knowledgebase.face.service.DocCommentsService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.logging.log4j.LogManager;
......@@ -11,11 +10,11 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.doc.TycloudResource;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......
package com.yeejoin.amos.knowledgebase.controller;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.knowledgebase.face.enumeration.DynamicsFunctional;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDocContentModel;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeDocContent;
import com.yeejoin.amos.knowledgebase.face.service.DocContentService;
import com.yeejoin.amos.knowledgebase.face.service.DocLibraryService;
import com.yeejoin.amos.knowledgebase.face.service.DynamicsOptionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
......@@ -22,16 +21,9 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.knowledgebase.face.enumeration.DynamicsFunctional;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDocContentModel;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeDocContent;
import com.yeejoin.amos.knowledgebase.face.service.DocContentService;
import com.yeejoin.amos.knowledgebase.face.service.DocLibraryService;
import com.yeejoin.amos.knowledgebase.face.service.DynamicsOptionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
* <p>
......@@ -129,7 +121,7 @@ public class DocContentResource {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "查询单个文档内容信息")
@RequestMapping(value = "/{sequenceNbr}", method = RequestMethod.GET)
public ResponseModel<KnowledgeDocContentModel> seleteOne(@PathVariable("sequenceNbr") Long sequenceNbr) {
......@@ -145,48 +137,6 @@ public class DocContentResource {
}
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "分页查询文档信息")
// @RequestMapping(value = "/page", method = RequestMethod.GET)
// public ResponseModel<Page> queryDocPage(HttpServletRequest request) {
// Map paramMap = request.getParameterMap();
//
// String[] auditStatus = request.getParameterValues("auditStatus");
// String[] docStatus = request.getParameterValues("docStatus");
//
// if (!ValidationUtil.isEmpty(auditStatus) && auditStatus[0].length() == 0) {
// auditStatus = null;
// }
// if (!ValidationUtil.isEmpty(docStatus) && docStatus[0].length() == 0) {
// docStatus = null;
// }
// Date createTimeLeft = null;
// Date createTimeRight = null;
// try {
// if (!ValidationUtil.isEmpty(paramMap.get("createTimeLeft"))) {
// createTimeLeft = DateUtil.formatStringToDate(request.getParameterValues("createTimeLeft")[0], null);
// }
// if (!ValidationUtil.isEmpty(paramMap.get("createTimeRight"))) {
// createTimeRight = DateUtil.formatStringToDate(request.getParameterValues("createTimeRight")[0], null);
// }
// } catch (Exception e) {
// throw new BadRequest("时间范围参数格式有误");
// }
// int offset = Integer.parseInt(request.getParameterValues("offset")[0]);
// int end = Integer.parseInt(request.getParameterValues("end")[0]);
//
// paramMap.remove("offset");
// paramMap.remove("end");
// paramMap.remove("total");
// paramMap.remove("auditStatus");
// paramMap.remove("docStatus");
// paramMap.remove("createTimeLeft");
// paramMap.remove("createTimeRight");
//
// return ResponseHelper.buildResponse(docContentService.queryDocPage(offset, end, paramMap, auditStatus, docStatus, createTimeLeft, createTimeRight));
// }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "分页查询文档信息")
@RequestMapping(value = "/page", method = RequestMethod.GET)
......@@ -206,20 +156,6 @@ public class DocContentResource {
}
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "字符串模糊查询文档(搜索项为文档标题和标签名称)")
// @RequestMapping(value = "/title/tag", method = RequestMethod.GET)
// public ResponseModel searchForDocs(
// @RequestParam(value = "queryStr", defaultValue = "") String queryStr,
// @RequestParam(value = "current") int current,
// @RequestParam(value = "size") int size) {
// Page page = new Page();
// page.setCurrent(current);
// page.setSize(size);
// return ResponseHelper.buildResponse(docContentService.searchForDoc(page, queryStr));
// }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "文档被点赞/吐槽状态")
@RequestMapping(value = "/{sequenceNbr}/statistics/likes", method = RequestMethod.GET)
......@@ -227,12 +163,5 @@ public class DocContentResource {
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(docContentService.queryLikeOrDis(sequenceNbr));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取简单的预案信息")
@RequestMapping(value = "/getSimpleDetail/{sequenceNbr}", method = RequestMethod.GET)
public ResponseModel<List<Map<String, Object>>> getSimpleDetail(
@PathVariable(value = "sequenceNbr") String sequenceNbr) {
return ResponseHelper.buildResponse(docContentService.getSimpleDetail(sequenceNbr));
}
}
......@@ -9,7 +9,6 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -51,10 +50,12 @@ public class DocOuterResource {
public ResponseModel<Page> queryDocPage(@RequestParam(value = "current") Integer current,
@RequestParam(value = "size") Integer size,
@RequestParam(value = "code", required = false) String code,
@RequestParam(value = "docTitle", required = false) String docTitle) {
@RequestParam(value = "docTitle", required = false) String docTitle,
@RequestParam(value = "directoryId", required = false) Long directoryId,
@RequestParam(value = "orgCode", required = false) String orgCode) {
Page page = new Page(current, size);
return ResponseHelper.buildResponse(docLibraryService.queryDocPage(page, docTitle, code));
return ResponseHelper.buildResponse(docLibraryService.queryDocPage(page, docTitle, code,directoryId,orgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
package com.yeejoin.amos.knowledgebase.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.knowledgebase.face.service.MessageService;
import io.swagger.annotations.Api;
......@@ -42,7 +40,7 @@ public class MessageResource {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询用户的消息列表.")
@RequestMapping(value = "/list/owner", method = RequestMethod.GET)
public ResponseModel list(@RequestParam(value = "messageType", required = false) String messageType) {
public ResponseModel listOwner(@RequestParam(value = "messageType", required = false) String messageType) {
if (ValidationUtil.isEmpty(messageType)) {
messageType = null;
}
......@@ -129,7 +127,7 @@ public class MessageResource {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "分页查询查询用户的消息列表.")
@RequestMapping(value = "/list/page", method = RequestMethod.GET)
public ResponseModel<Page> list(
public ResponseModel<Page> listPage(
@RequestParam(value = "current", required = true) int current,
@RequestParam(value = "size", required = true) int size,
@RequestParam(value = "messageType", required = false) String messageType) {
......
......@@ -2,8 +2,6 @@ package com.yeejoin.amos.knowledgebase.controller;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagGroupModel;
import com.yeejoin.amos.knowledgebase.face.service.TagGroupService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.logging.log4j.LogManager;
......@@ -11,10 +9,10 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.doc.TycloudResource;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......
package com.yeejoin.amos.knowledgebase.controller;
import java.util.List;
import com.yeejoin.amos.knowledgebase.face.service.TagInstanceService;
import io.swagger.annotations.Api;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.doc.TycloudResource;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagInstanceModel;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTagInstance;
import com.yeejoin.amos.knowledgebase.face.service.TagInstanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* <p>
......@@ -41,25 +27,4 @@ public class TagInstanceResource {
private final Logger logger = LogManager.getLogger(TagInstanceResource.class);
@Autowired
private TagInstanceService tagInstanceService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据主键查询实例标签")
@RequestMapping(value = "find/{id}", method = RequestMethod.GET)
public ResponseModel<KnowledgeTagInstance> findById(@PathVariable("id") Long id) {
return ResponseHelper.buildResponse(tagInstanceService.findById(id));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据targetSeq查询实例标签")
@RequestMapping(value = "targetSeq/{id}", method = RequestMethod.GET)
public ResponseModel<List<KnowledgeTagInstanceModel>> queryListByTargetSeq(@PathVariable("id") Long id) {
return ResponseHelper.buildResponse(tagInstanceService.queryListByTargetSeq(id));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据targetSeq查询实例标签")
@RequestMapping(value = "getTarget/byName", method = RequestMethod.GET)
public ResponseModel<List<KnowledgeTagInstanceModel>> queryListByTagName(@RequestParam String name) {
return ResponseHelper.buildResponse(tagInstanceService.queryListByTagName(name));
}
}
package com.yeejoin.amos.knowledgebase.controller;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagModel;
import com.yeejoin.amos.knowledgebase.face.service.TagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -18,13 +17,6 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagModel;
import com.yeejoin.amos.knowledgebase.face.service.TagService;
import com.yeejoin.amos.knowledgebase.face.util.Constants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* <p>
* 标签库 前端控制器
......@@ -107,7 +99,7 @@ public class TagResource {
@ApiOperation(value = "查询TOP15")
@RequestMapping(value = "/list/top", method = RequestMethod.GET)
public ResponseModel selectForList(@RequestParam(value = "quoteType", required = false) String quoteType) {
boolean isAll = ValidationUtil.equalsIgnoreCase(quoteType, Constants.APPKEY_ALL);
boolean isAll = ValidationUtil.equalsIgnoreCase(quoteType, TagService.APPKEY_ALL);
return ResponseHelper.buildResponse(tagService.queryTopList(isAll));
}
......@@ -123,14 +115,14 @@ public class TagResource {
@ApiOperation(value = "启用标签")
@RequestMapping(value = "status/activate/{ids}", method = RequestMethod.PUT)
public ResponseModel batchActivate(@PathVariable(value = "ids") String ids) {
return ResponseHelper.buildResponse(tagService.updateTagStatus(StringUtil.String2LongList(ids), Constants.TAG_STATUS_ACTIVATE));
return ResponseHelper.buildResponse(tagService.updateTagStatus(StringUtil.String2LongList(ids), TagService.TAG_STATUS_ACTIVATE));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "停用标签")
@RequestMapping(value = "status/deactivate/{ids}", method = RequestMethod.PUT)
public ResponseModel batchDeactivate(@PathVariable(value = "ids") String ids) {
return ResponseHelper.buildResponse(tagService.updateTagStatus(StringUtil.String2LongList(ids), Constants.TAG_STATUS_DEACTIVATE));
return ResponseHelper.buildResponse(tagService.updateTagStatus(StringUtil.String2LongList(ids), TagService.TAG_STATUS_DEACTIVATE));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
package com.yeejoin.amos.knowledgebase.controller;
import com.yeejoin.amos.knowledgebase.face.service.TagValueService;
import io.swagger.annotations.Api;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.doc.TycloudResource;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.yeejoin.amos.knowledgebase.face.service.TagValueService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* <p>
......@@ -36,17 +27,5 @@ public class TagValueResource {
private final Logger logger = LogManager.getLogger(TagValueResource.class);
@Autowired
private TagValueService tagValueService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取所有当前系统的值标签的实例值")
@RequestMapping(value = "/getAll/tegartValue", method = RequestMethod.GET)
public ResponseModel<Object> getAllTegartValue(@RequestParam String value) {
return ResponseHelper.buildResponse(tagValueService.getAllTegartValue(value));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取所有当前系统的值标签的实例值")
@RequestMapping(value = "/getOne/", method = RequestMethod.GET)
public ResponseModel<Object> queryByInstance(@RequestParam Long id) {
return ResponseHelper.buildResponse(tagValueService.queryByInstance(id));
}
}
package com.yeejoin.amos.knowledgebase.face.model;
import org.typroject.tyboot.core.foundation.utils.TreeNode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.foundation.utils.TreeNode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import java.util.Collection;
......
package com.yeejoin.amos.knowledgebase.face.model;
import com.baomidou.mybatisplus.annotation.TableField;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* <p>
......
package com.yeejoin.amos.knowledgebase.face.model;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* <p>
......
package com.yeejoin.amos.knowledgebase.face.model;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* <p>
* 知识库系统动态选项配置的实例值
......
package com.yeejoin.amos.knowledgebase.face.model;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* <p>
* 知识库内容交互计数表
......
package com.yeejoin.amos.knowledgebase.face.model;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* <p>
* 知识库内容交互记录
......
package com.yeejoin.amos.knowledgebase.face.model;
import org.typroject.tyboot.core.foundation.utils.TreeNode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.foundation.utils.TreeNode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import java.util.Collection;
......
package com.yeejoin.amos.knowledgebase.face.model;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import java.util.List;
......
package com.yeejoin.amos.knowledgebase.face.model;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import java.util.List;
import java.util.Map;
......
package com.yeejoin.amos.knowledgebase.face.model;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* <p>
* 值标签的实例值
......
package com.yeejoin.amos.knowledgebase.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeDocContent;
import org.apache.ibatis.annotations.Param;
......@@ -9,7 +10,7 @@ import java.util.Map;
/**
* <p>
* 知识库文档存储 Mapper 接口
* 知识库文档存储 Mapper 接口
* </p>
*
* @author 子杨
......@@ -18,18 +19,24 @@ import java.util.Map;
public interface DocContentMapper extends BaseMapper<KnowledgeDocContent> {
List<Map<String,Long>> searchForDocIds(@Param("agencyCode") String agencyCode,
@Param("queryStr") String queryStr,
@Param("docStatus")String []docStatus,
@Param("auditStatus")String [] auditStatus,
@Param("userId")String userId,
@Param("orgCode")String orgCode,
@Param("offset") long offset,
@Param("length") long length);
List<Map<String, Long>> searchForDocIds(
@Param("agencyCode") String agencyCode,
@Param("queryStr") String queryStr,
@Param("docStatus") String[] docStatus,
@Param("auditStatus") String[] auditStatus,
@Param("userId") String userId,
@Param("orgCode") String orgCode,
@Param("offset") long offset,
@Param("length") long length);
List<Map<String,Object>> queryDocBaseInfoList(Map<String, Object> paramMap);
List<Map<String, Object>> queryDocBaseInfoList(Map<String, Object> paramMap);
int queryDocBaseInfoTotal(Map<String, Object> paramMap);
List<Long> getAllPublishedDocIds();
IPage<KnowledgeDocContent> pageByType(
IPage<KnowledgeDocContent> page,
@Param("typeId") Long typeId,
@Param("tagId") Long tagId);
}
\ No newline at end of file
package com.yeejoin.amos.knowledgebase.face.orm.dao;
import com.yeejoin.amos.knowledgebase.face.orm.entity.ESDocEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchCrudRepository;
public interface ESDocRepository extends ElasticsearchCrudRepository<ESDocEntity, Long> {
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.knowledgebase.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowlegeStatisticsRecord;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
......@@ -9,7 +10,7 @@ import java.util.Map;
/**
* <p>
* 标签分组 Mapper 接口
* 标签分组 Mapper 接口
* </p>
*
* @author 子杨
......@@ -17,43 +18,42 @@ import java.util.Map;
*/
public interface StatisticsRecordMapper extends BaseMapper<KnowlegeStatisticsRecord> {
/**
* 表清空
*
* @return
*/
void deleteAll();
/**
* 表清空
* @return
*/
void deleteAll();
/**
* 查询灾情总计
*
* @return
*/
Map<String, Object> selectDisasterCount();
/**
* 查询灾情总计
* @return
*/
Map<String, Object> selectDisasterCount();
/**
* 按类型分组查询
*/
List<Map<String, Object>> selectCategoryByName(String recordName);
/**
* 按类型分组查询
*/
List<Map<String, Object>> selectCategoryByName(String recordName);
/**
* 按类型查询/按时间分段总计
*/
List<Map<String, Object>> selectCountByNameAndDateRange(Map<String, Object> queryMap);
/**
* 按类型查询/按时间分段总计
*/
List<Map<String, Object>> selectCountByNameAndDateRange(Map<String, Object> queryMap);
List<Map<String, Object>> tagStatisticsMonth(@Param("tag")String tag, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
List<Map<String, Object>> tagStatisticsMonth(String tag, Date startDate, Date endDate);
List<Map<String, Object>> tagStatisticsYear(@Param("tag")String tag, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
List<Map<String, Object>> tagStatisticsYear(String tag, Date startDate, Date endDate);
List<Map<String, Object>> docStatisticsMonth(@Param("categoryName")String categoryName, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
List<Map<String, Object>> docStatisticsMonth(String categoryName, Date startDate, Date endDate);
List<Map<String, Object>> docStatisticsYear(String categoryName, Date startDate, Date endDate);
List<Map<String, Object>> docStatisticsYear(@Param("categoryName")String categoryName, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
List<Map<String, Object>> tagChartStatistics(String tag, Date startDate, Date endDate,String splitSQL);
List<Map<String, Object>> tagChartStatistics(@Param("tag")String tag, @Param("startDate")Date startDate, @Param("endDate")Date endDate,@Param("splitSQL")String splitSQL);
List<Map<String, Object>> tagTimeChartStatistics(Date startDate, Date endDate,String splitSQL);
List<Map<String, Object>> tagTimeChartStatistics(@Param("startDate")Date startDate, @Param("endDate")Date endDate,@Param("splitSQL")String splitSQL);
List<Map<String, Object>> docChartStatistics(Date startDate, Date endDate);
List<Map<String, Object>> docChartStatistics(@Param("startDate")Date startDate, @Param("endDate")Date endDate);
List<Map<String, Object>> docBurnChartStatistics(Date startDate, Date endDate);
List<Map<String, Object>> docBurnChartStatistics(@Param("startDate")Date startDate,@Param("endDate") Date endDate);
}
\ No newline at end of file
package com.yeejoin.amos.knowledgebase.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagValueModel;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTagValue;
import org.apache.ibatis.annotations.Param;
......
package com.yeejoin.amos.knowledgebase.face.service;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDocAnnotateModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.DocAnnotateMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeDocAnnotate;
import com.yeejoin.amos.knowledgebase.face.util.RemoteData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
......@@ -16,10 +14,11 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.yeejoin.amos.knowledgebase.face.feign.RemoteData;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDocAnnotateModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.DocAnnotateMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeDocAnnotate;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
......@@ -88,13 +87,12 @@ public class DocAnnotateService extends BaseService<KnowledgeDocAnnotateModel, K
**/
public List<KnowledgeDocAnnotateModel> queryForAnnotateList(String docSeq) {
List<KnowledgeDocAnnotateModel> list = this.queryForList("CREATE_TIME",true, docSeq);
Set<String> userIds = list.stream().filter(item -> !ValidationUtil.isEmpty(item)).map(arg0 -> arg0.getUserId()).collect(Collectors.toSet());
Set<String> userIds = list.stream().filter(item -> !ValidationUtil.isEmpty(item)).map(KnowledgeDocAnnotateModel::getUserId).collect(Collectors.toSet());
Map<String, String> userMap = RemoteData.getUserMap(userIds);
list.forEach(item -> {
item.setUsername(userMap.get(item.getUserId()));
item.setIsCurrentUser(ValidationUtil.equals(item.getUserId(),RequestContext.getExeUserId()));
});
return list;
}
}
package com.yeejoin.amos.knowledgebase.face.service;
import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDocCategoryModel;
import com.yeejoin.amos.knowledgebase.face.model.MultipleNodeModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.DocCategoryMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeDocCategory;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTag;
import com.yeejoin.amos.knowledgebase.face.util.BaseUtil;
import com.yeejoin.amos.knowledgebase.face.util.TreeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
......@@ -17,16 +24,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.exception.instance.RequestForbidden;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDocCategoryModel;
import com.yeejoin.amos.knowledgebase.face.model.MultipleNodeModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.DocCategoryMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeDocCategory;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTag;
import com.yeejoin.amos.knowledgebase.face.util.BaseUtil;
import com.yeejoin.amos.knowledgebase.face.util.Constants;
import com.yeejoin.amos.knowledgebase.face.util.TreeUtil;
import java.util.*;
/**
* <p>
......@@ -173,6 +171,16 @@ public class DocCategoryService extends BaseService<KnowledgeDocCategoryModel, K
return sequenceList;
}
public Map<String, Long> getGroupNameValue(List<Long> ids) {
List<KnowledgeDocCategoryModel> list = this.queryBatchSeq(ids);
Map<String, Long> result = new HashMap<>();
for(KnowledgeDocCategoryModel knowledgeDocCategoryModel: list) {
result.put(knowledgeDocCategoryModel.getCategoryName(), knowledgeDocCategoryModel.getSequenceNbr());
}
return result;
}
private void getAllChildList(KnowledgeDocCategoryModel currentTagGroupModel, List<KnowledgeDocCategoryModel> resList) {
if (null == currentTagGroupModel) {
return;
......@@ -205,7 +213,7 @@ public class DocCategoryService extends BaseService<KnowledgeDocCategoryModel, K
List<KnowledgeDocCategoryModel> allChildren = TreeUtil.getAllChildren(categoryTree);
if (!allChildren.isEmpty()) {
List<Long> directoryIds = BaseUtil.getModelIds(allChildren);
List<MultipleNodeModel> multipleNodeModels = this.baseMapper.queryDocAndCategoryTree(directoryIds, onlyPublish ? Constants.DOC_STATUS_PUBLISHED : null);
List<MultipleNodeModel> multipleNodeModels = this.baseMapper.queryDocAndCategoryTree(directoryIds, onlyPublish ? DocContentService.DOC_STATUS_PUBLISHED : null);
return TreeBuilder.buildByRecursive(multipleNodeModels, null == rootCategory ? root : rootCategory.getParentId());
}
}
......@@ -250,13 +258,4 @@ public class DocCategoryService extends BaseService<KnowledgeDocCategoryModel, K
List<KnowledgeDocCategoryModel> categoryModelList = this.queryForList(null, true, categoryName, parentId);
return categoryModelList.isEmpty() ? null : categoryModelList.get(0);
}
public Map<String, Long> getGroupNameValue(List<Long> ids) {
List<KnowledgeDocCategoryModel> list = this.queryBatchSeq(ids);
Map<String, Long> result = new HashMap<>();
for(KnowledgeDocCategoryModel knowledgeDocCategoryModel: list) {
result.put(knowledgeDocCategoryModel.getCategoryName(), knowledgeDocCategoryModel.getSequenceNbr());
}
return result;
}
}
package com.yeejoin.amos.knowledgebase.face.service;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.knowledgebase.face.enumeration.OperateType;
import com.yeejoin.amos.knowledgebase.face.feign.RemoteData;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDocCommentsModel;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeInteractionRecordModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.DocCommentsMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeDocComments;
import com.yeejoin.amos.knowledgebase.face.util.RemoteData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Date;
import java.util.List;
/**
......
......@@ -4,7 +4,6 @@ package com.yeejoin.amos.knowledgebase.face.service;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDynamicsGroupModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.DynamicsGroupMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeDynamicsGroup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......
......@@ -5,13 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.knowledgebase.face.enumeration.DynamicsFunctional;
import com.yeejoin.amos.knowledgebase.face.enumeration.KnowledgeRoleName;
import com.yeejoin.amos.knowledgebase.face.enumeration.OptionDataType;
import com.yeejoin.amos.knowledgebase.face.feign.DataFillter;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDynamicsOptionModel;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDynamicsValueModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.DynamicsValueMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeDynamicsValue;
import com.yeejoin.amos.knowledgebase.face.util.Constants;
import com.yeejoin.amos.knowledgebase.face.util.DataFillter;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -26,6 +24,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -148,8 +147,8 @@ public class DynamicsValueService extends BaseService<KnowledgeDynamicsValueMode
}
switch (knowledgeRoleName) {
case AUDITOR:
auditStatusSet.add(Constants.DOC_AUDIT_STATUS_PASSED);
auditStatusSet.add(Constants.DOC_AUDIT_STATUS_SUBMITTED);
auditStatusSet.add(DocAuditService.DOC_AUDIT_STATUS_PASSED);
auditStatusSet.add(DocAuditService.DOC_AUDIT_STATUS_SUBMITTED);
dataPrivilegemap.put(DataFillter.orgCode, orgCode);
dataPrivilegemap.put(auditStatus, auditStatusSet.toArray(new String[auditStatusSet.size()]));
break;
......@@ -160,8 +159,8 @@ public class DynamicsValueService extends BaseService<KnowledgeDynamicsValueMode
dataPrivilegemap.put(DataFillter.noData, true);
break;
case VIEWER:
auditStatusSet.add(Constants.DOC_AUDIT_STATUS_PASSED);
docStatusSet.add(Constants.DOC_STATUS_PUBLISHED);
auditStatusSet.add(DocAuditService.DOC_AUDIT_STATUS_PASSED);
docStatusSet.add(DocContentService.DOC_STATUS_PUBLISHED);
dataPrivilegemap.put(docStatus, docStatusSet.toArray(new String[docStatusSet.size()]));
dataPrivilegemap.put(auditStatus, auditStatusSet.toArray(new String[auditStatusSet.size()]));
break;
......@@ -370,4 +369,15 @@ public class DynamicsValueService extends BaseService<KnowledgeDynamicsValueMode
public List<KnowledgeDynamicsValueModel> queryByInstanceIds(@Condition(Operator.in) Collection<Long> instanceId) {
return this.queryForList("", false, instanceId);
}
//查询文档发布时间是否为空
public List<KnowledgeDynamicsValue> isRequiredByFile(String appKey, String name, List<Long> docSeqList) {
String fineSeqs = docSeqList.stream().map(String::valueOf).collect(Collectors.joining(","));
QueryWrapper<KnowledgeDynamicsValue> wrapper = new QueryWrapper<>();
wrapper.inSql("OPTION_SEQ",
"SELECT kdo.SEQUENCE_NBR FROM `knowledge_dynamics_option` kdo WHERE kdo.FUNCTIONAL = '" + name + "' AND kdo.APP_KEY = '" + appKey + "' AND kdo.FRONT_END_CONFIG LIKE '%\"required\":true%'");
wrapper.and(wq -> wq.inSql("INSTANCE_ID", fineSeqs));
return this.list(wrapper);
}
}
......@@ -6,19 +6,16 @@ import com.yeejoin.amos.knowledgebase.face.model.KnowledgeInteractionCountModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.InteractionCountMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeInteractionCount;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
/**
......
......@@ -4,12 +4,11 @@ package com.yeejoin.amos.knowledgebase.face.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.yeejoin.amos.knowledgebase.face.feign.RemoteData;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeMessageModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.MessageMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeMessage;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeMessagePersonal;
import com.yeejoin.amos.knowledgebase.face.util.Constants;
import com.yeejoin.amos.knowledgebase.face.util.RemoteData;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -36,7 +35,20 @@ import java.util.*;
@Component
public class MessageService extends BaseService<KnowledgeMessageModel, KnowledgeMessage, MessageMapper> {
/**
* 消息类型-要点推送
*/
public static final String MESSAGE_TYPE_PUSH = "ESSENTIAL_PUSH";
/**
* 消息类型-战例分享
*/
public static final String MESSAGE_TYPE_SHARE = "DOC_SHARE";
/**
* 消息主题前缀
*/
public static final String TOPIC_PREFIX = "knowledge_message_";
public static final String SHARE_WAY_APP = "app";
private final String userTypeUser = "user";
private final String userTypeGroup = "group";
......@@ -95,14 +107,14 @@ public class MessageService extends BaseService<KnowledgeMessageModel, Knowledge
*/
@Transactional(rollbackFor = {BaseException.class, Exception.class})
public boolean shareDoc(List<Map<String, Object>> users, List<Map<String, Object>> docs, String way) {
if (ValidationUtil.equalsIgnoreCase(way, Constants.SHARE_WAY_APP)) {
if (ValidationUtil.equalsIgnoreCase(way, SHARE_WAY_APP)) {
for (Map<String, Object> doc : docs) {
//创建消息
if (ValidationUtil.isEmpty(doc) || ValidationUtil.isEmpty(doc.get("sequenceNbr"))) {
throw new BadRequest("分享内容缺失");
}
String messageTitle = String.valueOf(doc.get("docTitle"));
KnowledgeMessageModel message = createMessage(Constants.MESSAGE_TYPE_SHARE, Long.valueOf(doc.get("sequenceNbr").toString()), messageTitle, String.valueOf(doc.get("summary")));
KnowledgeMessageModel message = createMessage(MESSAGE_TYPE_SHARE, Long.valueOf(doc.get("sequenceNbr").toString()), messageTitle, String.valueOf(doc.get("summary")));
Set<String> userIdSet = new HashSet<>();
userIdSet = parseUserMapToIdList(users, userIdSet);
//创建个人消息
......@@ -122,7 +134,7 @@ public class MessageService extends BaseService<KnowledgeMessageModel, Knowledge
@Transactional(rollbackFor = {BaseException.class, Exception.class})
public boolean pushEssential(List<Map<String, Object>> users, String messageTitle, String content, Long docSeq) {
//创建消息
KnowledgeMessageModel message = createMessage(Constants.MESSAGE_TYPE_PUSH, docSeq, messageTitle, content);
KnowledgeMessageModel message = createMessage(MESSAGE_TYPE_PUSH, docSeq, messageTitle, content);
Set<String> userIdSet = new HashSet<>();
userIdSet = parseUserMapToIdList(users, userIdSet);
//创建个人消息
......@@ -239,7 +251,7 @@ public class MessageService extends BaseService<KnowledgeMessageModel, Knowledge
* 获取用户的主题
*/
private String getTopic(String userId) {
return Constants.TOPIC_PREFIX + String.valueOf(userId);
return TOPIC_PREFIX + String.valueOf(userId);
}
/**
......
package com.yeejoin.amos.knowledgebase.face.service;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDynamicsValueModel;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagInstanceModel;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagModel;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagValueModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.TagInstanceMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTagInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.context.RequestContext;
......@@ -15,14 +17,10 @@ import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeDynamicsValueModel;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagInstanceModel;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagModel;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagValueModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.TagInstanceMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTagInstance;
import com.yeejoin.amos.knowledgebase.face.util.Constants;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
......@@ -36,6 +34,10 @@ import com.yeejoin.amos.knowledgebase.face.util.Constants;
@Component
public class TagInstanceService extends BaseService<KnowledgeTagInstanceModel, KnowledgeTagInstance, TagInstanceMapper> {
public static final String MARKING_TYPE_DOC = "DOC"; // 标记类型--文档标签
public static final String MARKING_TYPE_CONTENT = "CONTENT";// 标记类型--内容标签
@Autowired
private TagValueService tagValueService;
......@@ -72,11 +74,11 @@ public class TagInstanceService extends BaseService<KnowledgeTagInstanceModel, K
instanceModel.setTagType(tagModel.getTagType());
//值标签保存标签的具体值
List<KnowledgeTagValueModel> valueModels = instanceModel.getTagValues();
if (Constants.TAG_TYPE_VALUE.equals(tagModel.getTagType()) && !ValidationUtil.isEmpty(valueModels)) {
if (TagService.TAG_TYPE_VALUE.equals(tagModel.getTagType()) && !ValidationUtil.isEmpty(valueModels)) {
List<KnowledgeDynamicsValueModel> valueTagConfigs = dynamicsValueService.queryByInstanceId(tagModel.getSequenceNbr());
Map<String,Object> valueTagConfigMap = Bean.listToMap(valueTagConfigs,"fieldName","fieldValue",KnowledgeDynamicsValueModel.class);
Map<String, Object> valueTagConfigMap = Bean.listToMap(valueTagConfigs, "fieldName", "fieldValue", KnowledgeDynamicsValueModel.class);
String unit = String.valueOf(valueTagConfigMap.get("unit"));
List<KnowledgeTagValueModel> savedValues = this.tagValueService.saveInstanceValue(instanceSeq, valueModels,unit);
List<KnowledgeTagValueModel> savedValues = this.tagValueService.saveInstanceValue(instanceSeq, valueModels, unit);
instanceModel.setTagValues(savedValues);
}
this.createWithModel(instanceModel);
......@@ -111,7 +113,9 @@ public class TagInstanceService extends BaseService<KnowledgeTagInstanceModel, K
// return this.queryCount(tagSeq, targetSeq);
// }
/** 根据标签ID统计标签实例数量 */
/**
* 根据标签ID统计标签实例数量
*/
public int queryCountByTagSeq(Long tagSeq) {
return this.queryCount(tagSeq);
}
......@@ -136,10 +140,10 @@ public class TagInstanceService extends BaseService<KnowledgeTagInstanceModel, K
public List<KnowledgeTagInstanceModel> queryByTargetAndType(String agencyCode, Long targetSeq, String markingType) {
List<KnowledgeTagInstanceModel> instanceModels = this.queryForList(null, false, agencyCode, targetSeq,markingType);
List<KnowledgeTagInstanceModel> instanceModels = this.queryForList(null, false, agencyCode, targetSeq, markingType);
if (!ValidationUtil.isEmpty(instanceModels)) {
for (KnowledgeTagInstanceModel instanceModel : instanceModels) {
if (Constants.TAG_TYPE_VALUE.equals(instanceModel.getTagType())) {
if (TagService.TAG_TYPE_VALUE.equals(instanceModel.getTagType())) {
List<KnowledgeTagValueModel> list = this.tagValueService.queryByInstance(instanceModel.getSequenceNbr());
instanceModel.setTagValues(list);
}
......@@ -156,15 +160,7 @@ public class TagInstanceService extends BaseService<KnowledgeTagInstanceModel, K
return this.queryForList(null, false, targetSeq);
}
public KnowledgeTagInstance findById(Long id) {
return this.baseMapper.selectById(id);
}
public List<KnowledgeTagInstanceModel> queryListByTagName(String tagName) {
// TODO Auto-generated method stub
return this.queryForList(null, false, tagName);
}
public List<KnowledgeTagInstanceModel> queryTopTagListByUser(String recUserId) {
return this.queryForList("REC_DATE", true, recUserId);
}
}
package com.yeejoin.amos.knowledgebase.face.service;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagValueModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.TagValueMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTagValue;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.context.RequestContext;
......@@ -13,13 +12,8 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.knowledgebase.face.model.KnowledgeTagValueModel;
import com.yeejoin.amos.knowledgebase.face.orm.dao.TagValueMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTagValue;
import net.bytebuddy.asm.Advice.This;
import java.util.Collection;
import java.util.List;
/**
......@@ -33,6 +27,15 @@ import net.bytebuddy.asm.Advice.This;
@Component
public class TagValueService extends BaseService<KnowledgeTagValueModel, KnowledgeTagValue, TagValueMapper> {
public static final String VALUE_TAG_FIELD_SINGLEVALUE = "singleValue";//单值字段名
public static final String VALUE_TAG_FIELD_RANGE_MAX = "rangeMax";//范围值 上界
public static final String VALUE_TAG_FIELD_RANGE_MIN = "rangeMin";//范围值 下界
public static final String VALUE_TAG_FIELD_TEXT = "text";//文本值
public static final String VALUE_TAG_FIELD_DATE_H = "dateH";//时间,年月日时分秒
public static final String VALUE_TAG_FIELD_ENUM_NAME = "enumName";// 枚举类型字段名
@Transactional(rollbackFor = {Exception.class, BaseException.class})
public List<KnowledgeTagValueModel> saveInstanceValue(Long instanceSeq, List<KnowledgeTagValueModel> valueModels, String unit) {
......@@ -71,13 +74,4 @@ public class TagValueService extends BaseService<KnowledgeTagValueModel, Knowled
public List<KnowledgeTagValueModel> queryTagValuesByDocIds(Collection<Long> docSeqList) {
return Bean.toModels(this.getBaseMapper().queryTagValuesByDocIds(docSeqList), KnowledgeTagValueModel.class);
}
public List<KnowledgeTagValue> getAllTegartValue(String value) {
String[] strings = value.split(",");
QueryWrapper<KnowledgeTagValue> wrapper = new QueryWrapper<KnowledgeTagValue>();
wrapper.eq("AGENCY_CODE", RequestContext.getAgencyCode());
wrapper.in("TAG_VALUE", Arrays.asList(strings));
return this.baseMapper.selectList(wrapper);
}
}
......@@ -21,6 +21,29 @@
</exclusion>
</exclusions>
</dependency>
<!-- 解析excel -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<!-- 针对2007以上版本的库 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<!-- 针对2003版本的库 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.poi.xwpf.converter.xhtml</artifactId>
<version>2.0.2</version>
</dependency>
</dependencies>
<build>
......
......@@ -332,7 +332,7 @@ public class TzsAppService {
JSONObject object = JSON.parseObject(JSON.toJSONString(obj));
if (!ValidationUtil.isEmpty(object)) {
object.getString("url");
object.put("url", minioPath + object.getString("url"));
object.put("url",object.getString("url"));
json.add(object);
}
}
......@@ -378,7 +378,7 @@ public class TzsAppService {
Map<String, String> map = date.getResult();
Iterator<String> it = map.keySet().iterator();
String urlString = it.next();
jsonObject.put("fileUrl", minioPath + urlString);
jsonObject.put("fileUrl", urlString);
jsonObject.put("fileName", code);
}
} catch (IOException e) {
......
......@@ -21,6 +21,7 @@ import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -47,6 +48,12 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
@Autowired
CylinderFillingRecordMapper cylinderFillingRecordMapper;
@Value("${biz.elasticsearch.address}")
private String esAddress;
@Value("${biz.elasticsearch.port}")
private Integer esPort;
/**
* 分页查询
*/
......@@ -178,7 +185,7 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
Page<ESCylinderFillingRecordDto> result = new Page<ESCylinderFillingRecordDto>(pageNum, pageSize);
RestHighLevelClient esClient = new RestHighLevelClient(
RestClient.builder(new HttpHost("36.46.151.113", 9200, "http"))
RestClient.builder(new HttpHost(esAddress, esPort, "http"))
);
SearchRequest request = new SearchRequest();
......
......@@ -129,6 +129,12 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
@Value("${cylinder-early-warning-packageId:气瓶消息预警/cylwarningmsg}")
private String cylPackageId;
@Value("${biz.elasticsearch.address}")
private String esAddress;
@Value("${biz.elasticsearch.port}")
private Integer esPort;
@Autowired
StartPlatformTokenService startPlatformTokenService;
......@@ -711,7 +717,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
Page<ESCylinderInfoDto> result = new Page<ESCylinderInfoDto>(pageNum, pageSize);
RestHighLevelClient esClient = new RestHighLevelClient(
RestClient.builder(new HttpHost("36.46.151.113", 9200, "http"))
RestClient.builder(new HttpHost(esAddress, esPort, "http"))
);
SearchRequest request = new SearchRequest();
......
......@@ -39,6 +39,7 @@ eureka.instance.metadata-map.management.api-docs=http://172.16.3.34:${server.por
eureka.instance.ip-address = 172.16.3.34
## ES properties:
biz.elasticsearch.port=9200
biz.elasticsearch.address=36.46.151.113
spring.data.elasticsearch.cluster-name=docker-cluster
spring.data.elasticsearch.cluster-nodes=${biz.elasticsearch.address}:9300
......
......@@ -294,7 +294,7 @@
<repository>
<id>Releases</id>
<name>Releases</name>
<url>http://36.46.149.14:8081/nexus/content/repositories/releases/</url>
<url>http://113.142.68.105:8081/nexus/content/repositories/releases/</url>
</repository>
<repository>
<id>com.e-iceblue</id>
......@@ -305,13 +305,13 @@
<repository>
<id>Snapshots</id>
<name>Snapshots</name>
<url>http://36.46.149.14:8081/nexus/content/repositories/snapshots/</url>
<url>http://113.142.68.105:8081/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>thirdparty</id>
<name>thirdparty</name>
<url>http://36.46.149.14:8081/nexus/content/repositories/thirdparty/</url>
<url>http://113.142.68.105:8081/nexus/content/repositories/thirdparty/</url>
</repository>
</repositories>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment