Commit 45308987 authored by chenhao's avatar chenhao

提交关于预案匹配的后端接口

parent 2e7a6dca
package com.yeejoin.amos.boot.module.common.api.feign;
import org.springframework.cloud.openfeign.FeignClient;
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.typroject.tyboot.core.restful.utils.ResponseModel;
@FeignClient(name = "${Knowledgebase.fegin.name}",path = "knowledgebase" ,configuration = {MultipartSupportConfig.class})
public interface KnowledgebaseFeignClient {
@RequestMapping(value = "/v1/tagvalue/getAll/tegartValue", method = RequestMethod.GET)
ResponseModel<Object> getAllTegartValue(@RequestParam String value) ;
@RequestMapping(value = "/v1/taginstance/find/{id}", method = RequestMethod.GET)
ResponseModel<Object> findById(@PathVariable("id") Long id);
@RequestMapping(value = "/v1/doccontent/getSimpleDetail/{sequenceNbr}", method = RequestMethod.GET)
ResponseModel<Object> getSimpleDetail(@PathVariable(value = "sequenceNbr") String sequenceNbr);
@RequestMapping(value = "/v1/taginstance/targetSeq/{id}", method = RequestMethod.GET)
ResponseModel<Object> queryListByTargetSeq(@PathVariable("id") Long id);
@RequestMapping(value = "/v1/tagvalue/getOne/", method = RequestMethod.GET)
ResponseModel<Object> queryByInstance(@RequestParam Long id) ;
@RequestMapping(value = "/v1/taginstance/getTarget/byName", method = RequestMethod.GET)
ResponseModel<Object> queryListByTagName(@RequestParam String name);
}
......@@ -52,6 +52,12 @@ public enum AlertStageEnums {
fireBrigade("fireBrigade", "岗位名称,规则配置"),
airportUnit("airportUnit", "人员职务规则配置"),
flag("flag", "值班单位"),
keySiteExcle("keySiteExcle","重点部位"),
救援预案警情类型("0","救援预案警情类型"),
责任单位("1","责任单位"),
重点部位名称("2","重点部位名称"),
航空器救援子类("3","航空器救援子类"),
aircraftRescueSub("aircraftRescueSub","航空器救援子类"),
JKDD("6", "企(事)业单位监控大队");
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
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.typroject.tyboot.component.event.RestEventTrigger;
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.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -25,36 +54,9 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ESAlertCalledService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
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.typroject.tyboot.component.event.RestEventTrigger;
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.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
......@@ -515,4 +517,14 @@ public class AlertCalledController extends BaseController {
public ResponseModel<Object> getLocationLike(@RequestParam(required = false) String locationt) {
return ResponseHelper.buildResponse(iAlertCalledService.getLocationLike(locationt));
}
/**
* 警情预案匹配
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/police/situation/match")
@ApiOperation(httpMethod = "GET", value = "警情预案匹配", notes = "警情预案匹配")
public ResponseModel<Object> toCompletePoliceSituationMatch(@RequestParam Long id)throws Exception {
return ResponseHelper.buildResponse(iAlertCalledService.toCompletePoliceSituationMatch(id));
}
}
\ No newline at end of file
package com.yeejoin.amos.knowledgebase.controller;
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 java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
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.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.DateUtil;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -22,10 +22,16 @@ 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 javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
import java.util.Map;
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;
/**
* <p>
......@@ -221,5 +227,12 @@ 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));
}
}
package com.yeejoin.amos.knowledgebase.controller;
import com.yeejoin.amos.knowledgebase.face.service.TagInstanceService;
import io.swagger.annotations.Api;
import java.util.List;
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>
......@@ -27,4 +41,25 @@ 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.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>
......@@ -27,5 +36,17 @@ 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));
}
}
......@@ -16,6 +16,7 @@ import com.yeejoin.amos.knowledgebase.face.feign.RemoteData;
import com.yeejoin.amos.knowledgebase.face.model.*;
import com.yeejoin.amos.knowledgebase.face.orm.dao.DocContentMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeDocContent;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTagValue;
import com.yeejoin.amos.knowledgebase.face.util.Constants;
import com.yeejoin.amos.knowledgebase.face.util.DocSortUtil;
import com.yeejoin.amos.knowledgebase.face.util.QuoteCountFlushTiming;
......@@ -657,4 +658,19 @@ public class DocContentService extends BaseService<KnowledgeDocContentModel, Kno
private List<KnowledgeDocContentModel> queryListByCategorySeqList(@Condition(Operator.in) List<Long> directoryId) {
return this.queryForList(null, false, directoryId);
}
public List<Map<String, Object>> getSimpleDetail(String sequenceNbrs) {
String[] idStrings= sequenceNbrs.split(",");
List<String> idListString= Arrays.asList(idStrings);
List<Long> idList= new ArrayList<Long>();
idListString.stream().forEach(i->{
idList.add(Long.parseLong(i));
});
QueryWrapper<KnowledgeDocContent> wrapper = new QueryWrapper<KnowledgeDocContent>();
wrapper.eq("DOC_STATUS", "PUBLISHED");
wrapper.in("SEQUENCE_NBR",idList);
wrapper.select("SEQUENCE_NBR","DOC_TITLE","REC_DATE");
return this.baseMapper.selectMaps(wrapper);
}
}
package com.yeejoin.amos.knowledgebase.face.service;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -19,7 +15,14 @@ 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 java.util.*;
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;
/**
......@@ -152,4 +155,16 @@ public class TagInstanceService extends BaseService<KnowledgeTagInstanceModel, K
public List<KnowledgeTagInstanceModel> queryListByTargetSeqs(@Condition(Operator.in) Collection<Long> targetSeq) {
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);
}
}
package com.yeejoin.amos.knowledgebase.face.service;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
......@@ -12,10 +13,14 @@ 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;
/**
* <p>
......@@ -66,4 +71,13 @@ 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);
}
}
......@@ -79,6 +79,8 @@ equip.fegin.name=AMOS-EQUIPMANAGE
## 设备联动服务(车库门、广播、警铃)
control.fegin.name=JCS-API-CONTROL
Knowledgebase.fegin.name=AMOS-API-KNOWLEDGEBASE
## 故障报修流程
failure.work.flow.processDefinitionKey=malfunction_repair
#设置文件上传的大小限制
......
......@@ -9,6 +9,9 @@ import org.slf4j.LoggerFactory;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
......@@ -20,6 +23,9 @@ import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
*/
@EnableScheduling
@EnableFeignClients
@EnableDiscoveryClient
@EnableEurekaClient
@EnableAsync
@MapperScan({"com.yeejoin.amos.knowledgebase.face.orm.dao*",
"org.typroject.tyboot.face.*.orm.dao*",
......
##开发环境配置文件
# jdbc_config
spring.datasource.url=jdbc:mysql://localhost:3306/safety-knowledge-3.0.0?characterEncoding=utf8&serverTimezone=Asia/Shanghai
spring.datasource.url=jdbc:mysql://172.16.6.60:3306/knowledge_base?characterEncoding=utf8&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=root_123
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
......
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