Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
45308987
Commit
45308987
authored
Dec 06, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交关于预案匹配的后端接口
parent
2e7a6dca
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
488 additions
and
76 deletions
+488
-76
KnowledgebaseFeignClient.java
...oot/module/common/api/feign/KnowledgebaseFeignClient.java
+31
-0
AlertStageEnums.java
...ejoin/amos/boot/module/jcs/api/enums/AlertStageEnums.java
+6
-0
AlertCalledController.java
...boot/module/jcs/biz/controller/AlertCalledController.java
+41
-28
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+259
-19
DocContentResource.java
...oin/amos/knowledgebase/controller/DocContentResource.java
+28
-15
TagInstanceResource.java
...in/amos/knowledgebase/controller/TagInstanceResource.java
+37
-2
TagValueResource.java
...ejoin/amos/knowledgebase/controller/TagValueResource.java
+23
-2
DocContentService.java
...in/amos/knowledgebase/face/service/DocContentService.java
+16
-0
TagInstanceService.java
...n/amos/knowledgebase/face/service/TagInstanceService.java
+24
-9
TagValueService.java
...join/amos/knowledgebase/face/service/TagValueService.java
+14
-0
application.properties
...boot-system-jcs/src/main/resources/application.properties
+2
-0
KnowledgebaseApplication.java
.../main/java/com/yeejoin/amos/KnowledgebaseApplication.java
+6
-0
application-dev.properties
...owledgebase/src/main/resources/application-dev.properties
+1
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/feign/KnowledgebaseFeignClient.java
0 → 100644
View file @
45308987
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
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/enums/AlertStageEnums.java
View file @
45308987
...
...
@@ -52,6 +52,12 @@ public enum AlertStageEnums {
fireBrigade
(
"fireBrigade"
,
"岗位名称,规则配置"
),
airportUnit
(
"airportUnit"
,
"人员职务规则配置"
),
flag
(
"flag"
,
"值班单位"
),
keySiteExcle
(
"keySiteExcle"
,
"重点部位"
),
救援预案警情类型
(
"0"
,
"救援预案警情类型"
),
责任单位
(
"1"
,
"责任单位"
),
重点部位名称
(
"2"
,
"重点部位名称"
),
航空器救援子类
(
"3"
,
"航空器救援子类"
),
aircraftRescueSub
(
"aircraftRescueSub"
,
"航空器救援子类"
),
JKDD
(
"6"
,
"企(事)业单位监控大队"
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertCalledController.java
View file @
45308987
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
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
View file @
45308987
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
static
org
.
hamcrest
.
CoreMatchers
.
nullValue
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.*
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.*
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IVoiceRecordFileService
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -25,8 +26,10 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
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
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -44,10 +47,27 @@ import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrzhDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.RequestData
;
import
com.yeejoin.amos.boot.module.common.api.feign.JcsControlServerClient
;
import
com.yeejoin.amos.boot.module.common.api.feign.KnowledgebaseFeignClient
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledTodyDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerData
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.VoiceRecordFileDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertLocationLog
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Template
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.ControllerTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum
;
...
...
@@ -68,7 +88,6 @@ import com.yeejoin.amos.component.rule.config.RuleConfig;
public
class
AlertCalledServiceImpl
extends
BaseService
<
AlertCalledDto
,
AlertCalled
,
AlertCalledMapper
>
implements
IAlertCalledService
{
private
final
Logger
logger
=
LogManager
.
getLogger
(
AlertCalledServiceImpl
.
class
);
@Autowired
...
...
@@ -126,6 +145,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
@Autowired
VoiceRecordFileServiceImpl
voiceRecordFileService
;
@Autowired
KnowledgebaseFeignClient
knowledgebaseFeignClient
;
private
static
int
comparingByGroupVal
(
Map
<
String
,
Object
>
map
,
Map
<
String
,
Object
>
map2
,
String
key
)
{
int
result
=
0
;
if
(
map
.
get
(
key
)
instanceof
DateTime
)
{
...
...
@@ -206,9 +228,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
,
data
,
lift
,
isFatherAlert
);
IPage
<
AlertCalled
>
iPage
=
new
Page
<>();
iPage
.
setRecords
(
list
);
iPage
.
setTotal
(
alertCalledMapper
.
selectAllCount
(
alertStatus
,
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
,
isFatherAlert
));
//
iPage.setSize(pageBean.getSize());
iPage
.
setTotal
(
alertCalledMapper
.
selectAllCount
(
alertStatus
,
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
,
isFatherAlert
));
//
iPage.setSize(pageBean.getSize());
return
iPage
;
/* bug2407 表头筛选失效 补充条件方法 XML中添加了排序条件判断 data代表排序条件 lift 升降序 陈召 2021-09-03 结束 */
...
...
@@ -258,8 +280,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
List
<
FormValue
>
formValue
=
new
ArrayList
<
FormValue
>();
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
AlertFormValue
alertFormValue
:
list
)
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
()
,
"text"
,
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getBlock
());
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
"text"
,
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getBlock
());
formValue
.
add
(
value
);
}
}
...
...
@@ -299,7 +321,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
try
{
// 警情基本信息
AlertCalled
alertCalled
=
alertCalledObjsDto
.
getAlertCalled
();
//
主表增加备注字段
//
主表增加备注字段
if
(
alertCalled
.
getAddress
()
!=
null
)
{
JSONObject
address
=
WaterResourceServiceImpl
.
getLongLatFromAddress
(
alertCalled
.
getAddress
());
...
...
@@ -367,7 +389,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
alertCalledObjsDto
.
setAlertFormValue
(
alertFormValuelist
);
// 警情报送
// 调用规则 警情初报
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledObjsDto
,
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
null
,
null
,
null
);
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledObjsDto
,
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
null
,
null
,
null
);
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
/**
...
...
@@ -394,14 +417,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
case
"314"
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
).
set
(
"alert_status"
,
1
)
.
set
(
"alert_stage"
,
AlertStageEnums
.
ZBQJ
.
getValue
())
.
set
(
"update_time"
,
new
Date
())
.
set
(
"alert_stage"
,
AlertStageEnums
.
ZBQJ
.
getValue
()).
set
(
"update_time"
,
new
Date
())
.
set
(
"alarm_type"
,
AlertStageEnums
.
FJQ
.
getValue
())
.
set
(
"alarm_type_code"
,
AlertStageEnums
.
FJQ
.
getCode
()));
break
;
case
"315"
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"alert_status"
,
1
).
set
(
"update_time"
,
new
Date
()).
set
(
"alert_stage"
,
AlertStageEnums
.
CZJS
.
getValue
()));
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
).
set
(
"alert_status"
,
1
)
.
set
(
"update_time"
,
new
Date
()).
set
(
"alert_stage"
,
AlertStageEnums
.
CZJS
.
getValue
()));
break
;
default
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
...
...
@@ -652,7 +675,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
bellNum
=
bellNum
.
substring
(
0
,
bellNum
.
length
()
-
1
);
String
[]
bellNums
=
bellNum
.
split
(
","
);
for
(
int
i
=
0
;
i
<
bellNums
.
length
;
i
++)
{
//
打开15s后自动关闭
//
打开15s后自动关闭
try
{
jcsControlServerClient
.
sendBellActionWithTime
(
bellNums
[
i
],
"1"
,
15
);
}
catch
(
Exception
e
)
{
...
...
@@ -784,8 +807,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
map
.
put
(
"contactUser"
,
alertCalled
.
getContactUser
());
map
.
put
(
"contactPhone"
,
alertCalled
.
getContactPhone
());
map
.
put
(
"callTime"
,
alertCalled
.
getCallTime
());
//获取通话录音文件地址
List
<
VoiceRecordFileDto
>
voiceRecordFileDtos
=
voiceRecordFileService
.
listByAlertId
(
alertCalled
.
getSequenceNbr
());
// 获取通话录音文件地址
List
<
VoiceRecordFileDto
>
voiceRecordFileDtos
=
voiceRecordFileService
.
listByAlertId
(
alertCalled
.
getSequenceNbr
());
if
(!
voiceRecordFileDtos
.
isEmpty
())
{
map
.
put
(
"voiceRecordFile"
,
voiceRecordFileDtos
.
get
(
0
).
getFilePath
());
}
...
...
@@ -944,4 +968,220 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
set
.
remove
(
null
);
return
set
;
}
@SuppressWarnings
(
"unchecked"
)
public
Object
toCompletePoliceSituationMatch
(
Long
id
)
throws
Exception
{
AlertCalledFormDto
dto
=
(
AlertCalledFormDto
)
selectAlertCalledByIdNoRedis
(
id
);
AlertCalled
alertCalled
=
dto
.
getAlertCalled
();
List
<
FormValue
>
list
=
dto
.
getDynamicFormAlert
();
if
(
alertCalled
.
getAlertTypeCode
().
equals
(
AlertStageEnums
.
YBHZ
.
getCode
()))
{
// 一般火灾
String
condition1
=
alertCalled
.
getAlertType
();
// 一般火灾
String
condition2
=
alertCalled
.
getUnitInvolved
();
// 事发单位
String
condition3
=
""
;
for
(
FormValue
i
:
list
)
{
if
(
i
.
getKey
().
equals
(
AlertStageEnums
.
keySiteExcle
.
getCode
()))
{
condition3
=
i
.
getValue
();
break
;
}
}
return
getIdsList1
(
alertCalled
.
getAlertTypeCode
()
,
AlertStageEnums
.
救援预案警情类型
.
getValue
()
+
","
+
condition1
,
AlertStageEnums
.
责任单位
.
getValue
()
+
","
+
condition2
,
AlertStageEnums
.
重点部位名称
.
getValue
()
+
","
+
condition3
);
}
else
if
(
alertCalled
.
getAlertTypeCode
().
equals
(
AlertStageEnums
.
HKJY
.
getCode
()))
{
String
condition1
=
alertCalled
.
getAlertType
();
// 航空器救援
String
condition2
=
""
;
for
(
FormValue
i
:
list
)
{
if
(
i
.
getKey
().
equals
(
AlertStageEnums
.
aircraftRescueSub
.
getCode
()))
{
condition2
=
condition1
+
i
.
getValue
();
}
}
return
getIdsList1
(
alertCalled
.
getAlertTypeCode
(),
AlertStageEnums
.
救援预案警情类型
.
getValue
()
+
","
+
condition1
,
AlertStageEnums
.
航空器救援子类
.
getValue
()
+
","
+
condition2
,
null
);
}
else
{
String
condition1
=
alertCalled
.
getAlertType
();
return
getIdsList1
(
alertCalled
.
getAlertTypeCode
(),
AlertStageEnums
.
救援预案警情类型
.
getValue
()
+
","
+
condition1
,
null
,
null
);
}
}
// private List<Map<String, Object>> getIdsList(String condition1, String condition2, String condition3) {
// List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
// ResponseModel condition1Response = knowledgebaseFeignClient.getAllTegartValue(condition1.split(",")[1]);
// List condition1List = (List) condition1Response.getResult();
// if (condition1List.size() < 1) {
// return null;
// } else {
// for (Object i : condition1List) {
// int priority = 1;
// JSONObject obj = JSONObject.parseObject(JSONObject.toJSONString(i));
// String instanceSeq = obj.getString("instanceSeq");
// ResponseModel<Object> list = knowledgebaseFeignClient.findById(Long.parseLong(instanceSeq));
// Object instanceReslt = list.getResult();
// if (instanceReslt != null) {
// JSONObject instanceResltobj = JSONObject.parseObject(JSONObject.toJSONString(instanceReslt));
// String targetSeq = instanceResltobj.getString("targetSeq");
// ResponseModel<Object> targetSeqResult = knowledgebaseFeignClient
// .queryListByTargetSeq(Long.parseLong(targetSeq));
// Object targetSeqResultObj = targetSeqResult.getResult();
// JSONArray targetSeqResultArray = JSONArray.parseArray(JSONArray.toJSONString(targetSeqResultObj));
// boolean flag2 = false;
// boolean flag3 = false;
// for (Object targetDetail : targetSeqResultArray) {
// JSONObject targetDetailJson = JSONObject.parseObject(JSONObject.toJSONString(targetDetail));
// String sequenceNbr = targetDetailJson.getString("sequenceNbr");
// ResponseModel<Object> detailResponseModel = knowledgebaseFeignClient
// .queryByInstance(Long.parseLong(sequenceNbr));
// Object detailResponseModelObj = detailResponseModel.getResult();
// JSONArray detailResponseModelArray = JSONArray
// .parseArray(JSONArray.toJSONString(detailResponseModelObj));
// JSONObject detailJson = JSONObject
// .parseObject(JSONObject.toJSONString(detailResponseModelArray.get(0)));
// if (!detailJson.containsKey("tagValue")) {
// continue;
// }
// if (condition2 != null && condition2.split(",")[1].equals(detailJson.getString("tagValue"))) {
// flag2 = true;
// }
// if (condition3 != null && condition3.split(",")[1].equals(detailJson.getString("tagValue"))) {
// flag3 = true;
// }
// }
// if (StringUtils.isNotBlank(condition3)) {
// if (flag2 && flag3) {
// priority = 1;
// } else if (flag2) {
// priority = 2;
// } else if (flag3) {
// priority = 3;
// } else {
// priority = 0;
// }
// } else if (StringUtils.isNotBlank(condition2) && condition3 == null) {
// if (flag2) {
// priority = 1;
// } else {
// priority = 2;
// }
// }
//
// Map<String, Object> map = new HashMap<String, Object>();
// ResponseModel<Object> SimpleDetailResponse = knowledgebaseFeignClient.getSimpleDetail(targetSeq);
// if (ObjectUtils.isNotEmpty(SimpleDetailResponse) && priority != 0) {
// map.put("priority", priority);
// map.put("data", SimpleDetailResponse.getResult());
// resultList.add(map);
// }
// }
// }
// }
// return resultList;
// }
private
Object
getIdsList1
(
String
type
,
String
condition1
,
String
condition2
,
String
condition3
)
throws
Exception
{
List
<
Object
>
resultList
=
new
ArrayList
<
Object
>();
ResponseModel
<
Object
>
responseForcondition1Name
=
knowledgebaseFeignClient
.
queryListByTagName
(
condition1
.
split
(
","
)[
0
]);
if
(
200
!=
responseForcondition1Name
.
getStatus
())
{
return
responseForcondition1Name
;
}
List
listForcondition1Name
=
(
List
)
responseForcondition1Name
.
getResult
();
if
(
listForcondition1Name
.
size
()
>
0
)
{
for
(
Object
i
:
listForcondition1Name
)
{
int
priority
=
1
;
boolean
flag2
=
false
;
boolean
flag3
=
false
;
JSONObject
listForcondition1Nameobj
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
ResponseModel
<
Object
>
responseForInstanceId
=
knowledgebaseFeignClient
.
queryByInstance
(
Long
.
parseLong
(
listForcondition1Nameobj
.
getString
(
"sequenceNbr"
)));
List
responseForInstanceIdList
=
(
List
)
responseForInstanceId
.
getResult
();
Object
responseForInstanceIdDetail
=
responseForInstanceIdList
.
get
(
0
);
JSONObject
responseForInstanceIdJsonDetail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
responseForInstanceIdDetail
));
if
(!(
condition1
.
split
(
","
)[
1
]).
equals
(
responseForInstanceIdJsonDetail
.
getString
(
"tagValue"
)))
{
continue
;
}
String
condition2Name
=
null
;
String
condition2value
=
null
;
if
(
condition2
!=
null
)
{
String
[]
condition2Array
=
condition2
.
split
(
","
);
if
(
condition2Array
.
length
>
1
)
{
condition2Name
=
condition2Array
[
0
];
condition2value
=
condition2Array
[
1
];
}
}
String
condition3Name
=
null
;
String
condition3value
=
null
;
if
(
condition3
!=
null
)
{
String
[]
condition3Array
=
condition3
.
split
(
","
);
if
(
condition3Array
.
length
>
1
)
{
condition3Name
=
condition3Array
[
0
];
condition3value
=
condition3Array
[
1
];
}
}
ResponseModel
<
Object
>
targetSeqResult
=
knowledgebaseFeignClient
.
queryListByTargetSeq
(
Long
.
parseLong
(
listForcondition1Nameobj
.
getString
(
"targetSeq"
)));
Object
targetSeqResultObj
=
targetSeqResult
.
getResult
();
JSONArray
targetSeqResultArray
=
JSONArray
.
parseArray
(
JSONArray
.
toJSONString
(
targetSeqResultObj
));
for
(
Object
m
:
targetSeqResultArray
)
{
JSONObject
detailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
m
));
if
(
condition2Name
!=
null
&&
condition2Name
.
equals
(
detailJson
.
getString
(
"tagName"
)))
{
ResponseModel
<
Object
>
condition2ResponseForInstanceId
=
knowledgebaseFeignClient
.
queryByInstance
(
Long
.
parseLong
(
detailJson
.
getString
(
"sequenceNbr"
)));
List
condition2ResponseForInstanceIdList
=
(
List
)
condition2ResponseForInstanceId
.
getResult
();
Object
condition2ResponseForInstanceIdDetail
=
condition2ResponseForInstanceIdList
.
get
(
0
);
JSONObject
condition2ResponseForInstanceIdJsonDetail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
condition2ResponseForInstanceIdDetail
));
if
(
condition2value
!=
null
&&
condition2value
.
equals
(
condition2ResponseForInstanceIdJsonDetail
.
getString
(
"tagValue"
)))
{
flag2
=
true
;
}
}
if
(
condition3Name
!=
null
&&
condition3Name
.
equals
(
detailJson
.
getString
(
"tagName"
)))
{
ResponseModel
<
Object
>
condition3ResponseForInstanceId
=
knowledgebaseFeignClient
.
queryByInstance
(
Long
.
parseLong
(
detailJson
.
getString
(
"sequenceNbr"
)));
List
condition3ResponseForInstanceIdList
=
(
List
)
condition3ResponseForInstanceId
.
getResult
();
Object
condition3ResponseForInstanceIdDetail
=
condition3ResponseForInstanceIdList
.
get
(
0
);
JSONObject
condition3ResponseForInstanceIdJsonDetail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
condition3ResponseForInstanceIdDetail
));
if
(
condition3value
!=
null
&&
condition3value
.
equals
(
condition3ResponseForInstanceIdJsonDetail
.
getString
(
"tagValue"
)))
{
flag3
=
true
;
}
}
}
if
(
type
.
equals
(
AlertStageEnums
.
YBHZ
.
getCode
()))
{
if
(
flag2
&&
flag3
)
{
priority
=
1
;
}
else
if
(
flag2
)
{
priority
=
2
;
}
else
if
(
flag3
)
{
priority
=
3
;
}
else
{
priority
=
0
;
}
}
else
if
(
type
.
equals
(
AlertStageEnums
.
HKJY
.
getCode
()))
{
if
(
flag2
)
{
priority
=
1
;
}
else
{
priority
=
2
;
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
ResponseModel
<
Object
>
SimpleDetailResponse
=
knowledgebaseFeignClient
.
getSimpleDetail
(
listForcondition1Nameobj
.
getString
(
"targetSeq"
));
if
(
ObjectUtils
.
isNotEmpty
(
SimpleDetailResponse
.
getResult
())
&&
priority
!=
0
)
{
JSONArray
detailJsonArray
=
JSONArray
.
parseArray
(
JSONArray
.
toJSONString
(
SimpleDetailResponse
.
getResult
()));
JSONObject
detailJsonObject
=
detailJsonArray
.
getJSONObject
(
0
);
map
.
put
(
"recDate"
,
detailJsonObject
.
getString
(
"REC_DATE"
));
map
.
put
(
"sequenceNbr"
,
detailJsonObject
.
getString
(
"SEQUENCE_NBR"
));
map
.
put
(
"docTitle"
,
detailJsonObject
.
getString
(
"DOC_TITLE"
));
map
.
put
(
"priority"
,
priority
);
resultList
.
add
(
map
);
}
}
}
return
resultList
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-knowledgebase-biz/src/main/java/com/yeejoin/amos/knowledgebase/controller/DocContentResource.java
View file @
45308987
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>
...
...
@@ -222,4 +228,11 @@ public class DocContentResource {
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
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-knowledgebase-biz/src/main/java/com/yeejoin/amos/knowledgebase/controller/TagInstanceResource.java
View file @
45308987
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
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-knowledgebase-biz/src/main/java/com/yeejoin/amos/knowledgebase/controller/TagValueResource.java
View file @
45308987
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>
...
...
@@ -28,4 +37,16 @@ public class TagValueResource {
@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
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-knowledgebase-biz/src/main/java/com/yeejoin/amos/knowledgebase/face/service/DocContentService.java
View file @
45308987
...
...
@@ -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
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-knowledgebase-biz/src/main/java/com/yeejoin/amos/knowledgebase/face/service/TagInstanceService.java
View file @
45308987
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
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-knowledgebase-biz/src/main/java/com/yeejoin/amos/knowledgebase/face/service/TagValueService.java
View file @
45308987
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
);
}
}
amos-boot-system-jcs/src/main/resources/application.properties
View file @
45308987
...
...
@@ -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
#设置文件上传的大小限制
...
...
amos-boot-system-knowledgebase/src/main/java/com/yeejoin/amos/KnowledgebaseApplication.java
View file @
45308987
...
...
@@ -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*"
,
...
...
amos-boot-system-knowledgebase/src/main/resources/application-dev.properties
View file @
45308987
##开发环境配置文件
# 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment