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
7621d26a
Commit
7621d26a
authored
Oct 28, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改联系人的方法,以及获取地址方法,删除对于的定时器
parent
7c1fe64d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
210 additions
and
189 deletions
+210
-189
OrgUsrMapper.java
...join/amos/boot/module/common/api/mapper/OrgUsrMapper.java
+1
-0
OrgUsrMapper.xml
...ule-common-api/src/main/resources/mapper/OrgUsrMapper.xml
+26
-1
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+60
-48
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+123
-107
GetContactNameSchedulerJob.java
...dule/jcs/biz/service/impl/GetContactNameSchedulerJob.java
+0
-31
AmosJcsApplication.java
...cs/src/main/java/com/yeejoin/amos/AmosJcsApplication.java
+0
-2
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/mapper/OrgUsrMapper.java
View file @
7621d26a
...
...
@@ -88,4 +88,5 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
void
updatelistByParentId
(
String
codex
,
String
code
);
List
<
Map
<
String
,
String
>>
getPersonSimpleDetail
();
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
7621d26a
...
...
@@ -633,5 +633,30 @@ GROUP BY
</update>
<select
id =
'getPersonSimpleDetail'
resultType=
'Map'
>
SELECT
person.biz_org_name as name,
cdf.field_value as phone
FROM
(
SELECT
sequence_nbr,
biz_org_name
FROM
cb_org_usr
WHERE
biz_org_type = 'PERSON'
AND is_delete = 0
) person
LEFT JOIN (
SELECT
field_value,
instance_id
FROM
cb_dynamic_form_instance
WHERE
group_code = '246'
AND field_code = 'telephone'
) cdf ON person.sequence_nbr = cdf.instance_id
</select>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
7621d26a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.io.Serializable
;
import
java.lang.reflect.Method
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
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
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -43,33 +72,6 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
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
javax.annotation.Resource
;
import
java.io.Serializable
;
import
java.lang.reflect.Method
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* 机构/部门/人员表 服务实现类
...
...
@@ -499,7 +501,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr
.
setRecUserName
(
user
.
getRealName
());
orgUsr
.
setRecUserId
(
user
.
getUserId
());
OrgUsrDto
orgUsrDto
=
new
OrgUsrDto
();
BeanUtils
.
copyProperties
(
orgUsr
,
orgUsrDto
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgUsrDto
);
// 单位新增情况
OrgUsrDto
model
=
createWithModel
(
orgUsrDto
);
// save(orgUsr);
...
...
@@ -1191,11 +1193,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
public
List
<
OrgUsrExcelDto
>
exportToExcel
(
Map
par
)
{
String
parentId
=
par
.
containsKey
(
"parentId"
)?
par
.
get
(
"parentId"
).
toString
():
null
;
String
bizOrgName
=
par
.
containsKey
(
"bizOrgName"
)?
par
.
get
(
"bizOrgName"
).
toString
():
null
;
String
internalPositionCode
=
par
.
containsKey
(
"internalPositionCode"
)?
par
.
get
(
"internalPositionCode"
).
toString
():
null
;
String
positionType
=
par
.
containsKey
(
"positionType"
)?
par
.
get
(
"positionType"
).
toString
():
null
;
return
orgUsrMapper
.
exportToExcel
(
parentId
,
bizOrgName
,
internalPositionCode
,
positionType
);
String
parentId
=
par
.
containsKey
(
"parentId"
)
?
par
.
get
(
"parentId"
).
toString
()
:
null
;
String
bizOrgName
=
par
.
containsKey
(
"bizOrgName"
)
?
par
.
get
(
"bizOrgName"
).
toString
()
:
null
;
String
internalPositionCode
=
par
.
containsKey
(
"internalPositionCode"
)
?
par
.
get
(
"internalPositionCode"
).
toString
()
:
null
;
String
positionType
=
par
.
containsKey
(
"positionType"
)
?
par
.
get
(
"positionType"
).
toString
()
:
null
;
return
orgUsrMapper
.
exportToExcel
(
parentId
,
bizOrgName
,
internalPositionCode
,
positionType
);
}
@Override
...
...
@@ -1542,6 +1546,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
wrapper
.
eq
(
OrgUsr:
:
getBizOrgType
,
OrgPersonEnum
.
人员
.
getKey
());
return
this
.
baseMapper
.
selectList
(
wrapper
);
}
/**
* 查询组织机构下面的人员信息
*
...
...
@@ -1656,7 +1661,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
break
;
}
}
if
(!
map
.
containsKey
(
"postType"
)
||
map
.
get
(
"postType"
)
==
null
||
StringUtils
.
isBlank
(
map
.
get
(
"postType"
).
toString
()))
{
if
(!
map
.
containsKey
(
"postType"
)
||
map
.
get
(
"postType"
)
==
null
||
StringUtils
.
isBlank
(
map
.
get
(
"postType"
).
toString
()))
{
continue
;
}
map
.
put
(
"userName"
,
orgUsr
.
getBizOrgName
());
...
...
@@ -1690,13 +1696,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
public
List
<
OrgUsr
>
selectCompanyUsers
(
Long
orgUnitId
)
{
OrgUsr
orgUsr
=
this
.
getById
(
orgUnitId
);
if
(
null
==
orgUnitId
)
{
if
(
null
==
orgUnitId
)
{
return
null
;
}
LambdaQueryWrapper
<
OrgUsr
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
like
(
OrgUsr:
:
getBizOrgCode
,
orgUsr
.
getBizOrgCode
());
queryWrapper
.
eq
(
OrgUsr:
:
getBizOrgType
,
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
queryWrapper
.
eq
(
OrgUsr:
:
getIsDelete
,
false
);
queryWrapper
.
like
(
OrgUsr:
:
getBizOrgCode
,
orgUsr
.
getBizOrgCode
());
queryWrapper
.
eq
(
OrgUsr:
:
getBizOrgType
,
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
queryWrapper
.
eq
(
OrgUsr:
:
getIsDelete
,
false
);
List
<
OrgUsr
>
list
=
this
.
list
(
queryWrapper
);
return
list
;
}
...
...
@@ -1705,7 +1711,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public
OrgUsr
selectByAmosOrgId
(
Long
id
)
{
QueryWrapper
<
OrgUsr
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"amos_org_id"
,
id
);
queryWrapper
.
eq
(
"amos_org_id"
,
id
);
OrgUsr
orgUsr
=
orgUsrMapper
.
selectOne
(
queryWrapper
);
return
orgUsr
;
...
...
@@ -1713,8 +1719,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
public
AgencyUserModel
getAmosIdByOrgUserId
(
String
orgUserId
)
throws
Exception
{
OrgUsr
orgUsr
=
this
.
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getSequenceNbr
,
orgUserId
));
OrgUsr
orgUsr
=
this
.
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getSequenceNbr
,
orgUserId
));
if
(
ValidationUtil
.
isEmpty
(
orgUsr
))
{
throw
new
Exception
(
"账号不存在"
);
}
...
...
@@ -1731,13 +1737,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
throw
new
Exception
(
"账号不存在"
);
}
List
<
String
>
orgUserIdList
=
Lists
.
newArrayList
(
orgUserIds
.
split
(
","
));
List
<
OrgUsr
>
orgUsrList
=
this
.
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
OrgUsr
>().
in
(
OrgUsr:
:
getSequenceNbr
,
orgUserIdList
));
List
<
OrgUsr
>
orgUsrList
=
this
.
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
OrgUsr
>().
in
(
OrgUsr:
:
getSequenceNbr
,
orgUserIdList
));
if
(
ValidationUtil
.
isEmpty
(
orgUsrList
))
{
throw
new
Exception
(
"账号不存在"
);
}
List
<
AgencyUserModel
>
amosUserList
=
Privilege
.
agencyUserClient
.
queryByIds
(
Joiner
.
on
(
","
).
join
(
orgUsrList
.
stream
().
map
(
OrgUsr:
:
getAmosOrgId
).
collect
(
Collectors
.
toList
())),
false
).
getResult
();
List
<
AgencyUserModel
>
amosUserList
=
Privilege
.
agencyUserClient
.
queryByIds
(
Joiner
.
on
(
","
).
join
(
orgUsrList
.
stream
().
map
(
OrgUsr:
:
getAmosOrgId
).
collect
(
Collectors
.
toList
())),
false
)
.
getResult
();
if
(
ValidationUtil
.
isEmpty
(
amosUserList
))
{
throw
new
Exception
(
"账号不存在"
);
}
...
...
@@ -1748,7 +1755,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
public
List
<
OrgUsrFormDto
>
getUnSyncOrgCompanyList
(
List
<
Long
>
companyIdList
)
{
LambdaQueryWrapper
<
OrgUsr
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
notIn
(
OrgUsr:
:
getSequenceNbr
,
companyIdList
).
eq
(
OrgUsr:
:
getIsDelete
,
false
).
eq
(
OrgUsr:
:
getBizOrgType
,
"COMPANY"
);
queryWrapper
.
notIn
(
OrgUsr:
:
getSequenceNbr
,
companyIdList
).
eq
(
OrgUsr:
:
getIsDelete
,
false
)
.
eq
(
OrgUsr:
:
getBizOrgType
,
"COMPANY"
);
List
<
OrgUsr
>
unSyncCompanyList
=
this
.
baseMapper
.
selectList
(
queryWrapper
);
List
<
OrgUsrFormDto
>
allUnSyncCompanyList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
unSyncCompanyList
))
{
...
...
@@ -1764,11 +1772,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return
allUnSyncCompanyList
;
}
public
OrgUsr
getDetailById
(
Long
id
){
public
OrgUsr
getDetailById
(
Long
id
)
{
LambdaQueryWrapper
<
OrgUsr
>
queryWrapper
=
new
LambdaQueryWrapper
<
OrgUsr
>();
queryWrapper
.
eq
(
OrgUsr:
:
getIsDelete
,
false
);
queryWrapper
.
eq
(
OrgUsr:
:
getSequenceNbr
,
id
);
return
this
.
baseMapper
.
selectOne
(
queryWrapper
);
}
public
List
<
Map
<
String
,
String
>>
getPersonSimpleDetail
()
{
return
orgUsrMapper
.
getPersonSimpleDetail
();
}
}
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 @
7621d26a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -73,7 +74,8 @@ import com.yeejoin.amos.component.rule.config.RuleConfig;
* @date 2021-06-17
*/
@Service
public
class
AlertCalledServiceImpl
extends
BaseService
<
AlertCalledDto
,
AlertCalled
,
AlertCalledMapper
>
implements
IAlertCalledService
{
public
class
AlertCalledServiceImpl
extends
BaseService
<
AlertCalledDto
,
AlertCalled
,
AlertCalledMapper
>
implements
IAlertCalledService
{
@Autowired
RedisUtils
redisUtils
;
...
...
@@ -123,6 +125,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
@Autowired
AlertFormValueServiceImpl
alertFormValueService
;
@Autowired
OrgUsrServiceImpl
orgUsrServiceImpl
;
private
static
int
comparingByGroupVal
(
Map
<
String
,
Object
>
map
,
Map
<
String
,
Object
>
map2
,
String
key
)
{
int
result
=
0
;
if
(
map
.
get
(
key
)
instanceof
DateTime
)
{
...
...
@@ -149,10 +154,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return
alertCalledMapper
.
alertCalledListByAlertStatusCount
(
par
);
}
/**
* 接警记录 列表分页查询
**/
/* bug2407 筛选参数解析异常 修改筛选条件方法 XML中添加了selectAllPage 方法 data代表排序条件 lift 升降序 陈召 2021-09-03 开始*/
**/
/*
* bug2407 筛选参数解析异常 修改筛选条件方法 XML中添加了selectAllPage 方法 data代表排序条件 lift 升降序 陈召
* 2021-09-03 开始
*/
// public IPage<AlertCalled> queryForCalledList(Page pageBean, Integer alertStatus,
// String alertTypeCode,
// String alertSourceCode,
...
...
@@ -169,17 +176,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
//
// List<AlertCalled> list = alertCalledMapper.selectAllPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus, alertTypeCode, alertSourceCode, startTime, endTime, data, lift);
// }
public
IPage
<
AlertCalled
>
queryForCalledList
(
Page
pageBean
,
Integer
alertStatus
,
String
alertTypeCode
,
String
alertSourceCode
,
String
startTime
,
String
endTime
,
String
sort
)
{
public
IPage
<
AlertCalled
>
queryForCalledList
(
Page
pageBean
,
Integer
alertStatus
,
String
alertTypeCode
,
String
alertSourceCode
,
String
startTime
,
String
endTime
,
String
sort
)
{
String
[]
split
=
sort
!=
null
?
sort
.
split
(
","
)
:
null
;
/*2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 start
*/
if
(
split
!=
null
)
{
/* 2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 start
*/
if
(
split
!=
null
)
{
if
(
split
[
0
]
!=
null
)
{
if
(
split
[
0
].
equals
(
"alertType"
)
||
split
[
0
].
equals
(
"alertSource"
)
||
split
[
0
].
equals
(
"alarmType"
))
{
split
[
0
]
=
split
[
0
]
+
"Code"
;
...
...
@@ -188,29 +190,30 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
split
[
0
]
=
"alertStatus"
;
}
}
if
(
split
[
1
]
!=
null
)
{
if
(
split
[
1
].
equals
(
"ascend"
))
{
if
(
split
[
1
]
!=
null
)
{
if
(
split
[
1
].
equals
(
"ascend"
))
{
split
[
1
]
=
"ASC"
;
}
if
(
split
[
1
].
equals
(
"descend"
))
{
if
(
split
[
1
].
equals
(
"descend"
))
{
split
[
1
]
=
"DESC"
;
}
}
}
String
data
=
split
!=
null
?
RedisKey
.
humpToLine
(
split
[
0
])
:
null
;
/*2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 end
*/
/* 2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 end
*/
String
lift
=
split
!=
null
?
split
[
1
]
:
null
;
List
<
AlertCalled
>
list
=
alertCalledMapper
.
selectAllPage
(
pageBean
.
getCurrent
(),
pageBean
.
getSize
(),
alertStatus
,
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
,
data
,
lift
);
List
<
AlertCalled
>
list
=
alertCalledMapper
.
selectAllPage
(
pageBean
.
getCurrent
(),
pageBean
.
getSize
(),
alertStatus
,
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
,
data
,
lift
);
IPage
<
AlertCalled
>
iPage
=
new
Page
<>();
iPage
.
setRecords
(
list
);
iPage
.
setTotal
(
alertCalledMapper
.
selectAllCount
(
alertStatus
,
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
));
iPage
.
setTotal
(
alertCalledMapper
.
selectAllCount
(
alertStatus
,
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
));
return
iPage
;
/* bug2407 表头筛选失效 补充条件方法 XML中添加了排序条件判断 data代表排序条件 lift 升降序 陈召 2021-09-03 结束
*/
/* bug2407 表头筛选失效 补充条件方法 XML中添加了排序条件判断 data代表排序条件 lift 升降序 陈召 2021-09-03 结束
*/
}
/**
* 根据灾情id 查询灾情详情
**/
...
...
@@ -229,7 +232,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
);
}
}
...
...
@@ -260,15 +264,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
alertCalled
.
setCoordinateY
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LATITUDE
)));
}
alertCalled
.
setCallTime
(
new
Date
());
if
(
AlertStageEnums
.
RG
.
getValue
().
equals
(
alertCalled
.
getAlertSourceCode
())
||
AlertStageEnums
.
RG
.
getValue
().
equals
(
alertCalled
.
getAlertSourceCode
()))
{
if
(
AlertStageEnums
.
RG
.
getValue
().
equals
(
alertCalled
.
getAlertSourceCode
())
||
AlertStageEnums
.
RG
.
getValue
().
equals
(
alertCalled
.
getAlertSourceCode
()))
{
alertCalled
.
setType
(
"0"
);
}
else
{
alertCalled
.
setType
(
"1"
);
}
// 动态表单
List
<
AlertFormValue
>
alertFormValuelist
=
alertCalledObjsDto
.
getAlertFormValue
();
//
判断是否航空器救援 如果为航空器救援则保存冗余字段 response_level_code bug2542 bykongfm
//
判断是否航空器救援 如果为航空器救援则保存冗余字段 response_level_code bug2542 bykongfm
if
(
AlertStageEnums
.
HKJY
.
getCode
().
equals
(
alertCalled
.
getAlertTypeCode
()))
{
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
if
(
alertFormValue
.
getFieldCode
().
equals
(
"responseLevel"
))
{
...
...
@@ -312,14 +316,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
alertCalledObjsDto
.
setAlertCalled
(
alertCalled
);
alertCalledObjsDto
.
setAlertFormValue
(
alertFormValuelist
);
//
警情报送
//
调用规则
//
警情报送
//
调用规则
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledObjsDto
);
//
通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
//
通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
}
/**
* 同步保存ES
*/
...
...
@@ -333,8 +336,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
/**
* 根据id 修改警情
* type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
* 根据id 修改警情 type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
*/
@Override
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
...
...
@@ -343,8 +345,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
try
{
switch
(
code
)
{
case
"314"
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"alert_status"
,
1
).
set
(
"alert_stage"
,
AlertStageEnums
.
ZBQJ
.
getValue
()).
set
(
"alarm_type"
,
AlertStageEnums
.
FJQ
.
getValue
()).
set
(
"alarm_type_code"
,
AlertStageEnums
.
FJQ
.
getCode
()));
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
).
set
(
"alert_status"
,
1
)
.
set
(
"alert_stage"
,
AlertStageEnums
.
ZBQJ
.
getValue
())
.
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
)
...
...
@@ -358,14 +363,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
AlertCalled
alertCalled
=
this
.
getById
(
id
);
//
删除缓存
//
删除缓存
redisUtils
.
del
(
RedisKey
.
ALERTCALLED_ID
+
id
);
/**
* 同步更新存ES
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
//
通知实战指挥页面发送mqtt 默认发送 String 类型 0新警情, 1警情状态变化
//
通知实战指挥页面发送mqtt 默认发送 String 类型 0新警情, 1警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"1"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
return
true
;
...
...
@@ -383,24 +388,24 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
public
List
<
Map
<
String
,
Object
>>
listByDateRange
(
String
beginDate
,
String
endDate
)
{
// 查询指定日期内的警情列表
List
<
AlertCalled
>
alertCalledList
=
this
.
list
(
new
LambdaQueryWrapper
<
AlertCalled
>().
apply
(!
ValidationUtil
.
isEmpty
(
beginDate
),
"call_time >= '"
+
beginDate
+
"'"
)
.
le
(
true
,
AlertCalled:
:
getCallTime
,
endDate
));
List
<
AlertCalled
>
alertCalledList
=
this
.
list
(
new
LambdaQueryWrapper
<
AlertCalled
>()
.
apply
(!
ValidationUtil
.
isEmpty
(
beginDate
),
"call_time >= '"
+
beginDate
+
"'"
)
.
le
(
true
,
AlertCalled:
:
getCallTime
,
endDate
));
Map
<
String
,
String
>
queryParams
=
Maps
.
newHashMap
();
queryParams
.
put
(
"beginDate"
,
beginDate
);
queryParams
.
put
(
"endDate"
,
endDate
);
List
<
Map
<
String
,
Object
>>
allList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
alertCalledList
))
{
Map
<
String
,
List
<
AlertCalled
>>
alertCalledMap
=
alertCalledList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
AlertCalled:
:
getAlertTypeCode
));
Map
<
Long
,
AlertCalled
>
calledMap
=
alertCalledList
.
stream
()
.
collect
(
Collectors
.
toMap
(
AlertCalled:
:
getSequenceNbr
,
Function
.
identity
()));
Map
<
String
,
List
<
AlertCalled
>>
alertCalledMap
=
alertCalledList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
AlertCalled:
:
getAlertTypeCode
));
Map
<
Long
,
AlertCalled
>
calledMap
=
alertCalledList
.
stream
()
.
collect
(
Collectors
.
toMap
(
AlertCalled:
:
getSequenceNbr
,
Function
.
identity
()));
alertCalledMap
.
forEach
((
alertTypeCode
,
list
)
->
{
allList
.
addAll
(
iAlertFormValueService
.
listAll
(
alertTypeCode
,
queryParams
));
});
allList
.
forEach
(
i
->
{
//
增加非空判断 cz 2021-10-08
//
增加非空判断 cz 2021-10-08
if
(
calledMap
.
get
(
Long
.
parseLong
(
i
.
get
(
"instanceId"
).
toString
()))
!=
null
)
{
AlertCalled
alertCalled
=
calledMap
.
get
(
Long
.
parseLong
(
i
.
get
(
"instanceId"
).
toString
()));
i
.
putAll
(
Bean
.
BeantoMap
(
alertCalled
));
...
...
@@ -412,28 +417,28 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return
allList
;
}
public
Map
<
String
,
Object
>
getAlertInfoList
(
String
beginDate
,
String
endDate
)
{
Map
<
String
,
Object
>
result
=
Maps
.
newHashMap
();
List
<
Map
<
String
,
Object
>>
list
=
listByDateRange
(
beginDate
,
endDate
);
// 获取接警情况模板
List
<
Template
>
templateList
=
templateMapper
.
selectList
(
new
LambdaQueryWrapper
<
Template
>().
eq
(
Template:
:
getFormat
,
false
).
like
(
Template:
:
getTypeCode
,
DutyInfoEnum
.
接警情况
.
getKey
()
+
"-"
));
Map
<
String
,
Template
>
templateMap
=
templateList
.
stream
().
collect
(
Collectors
.
toMap
(
Template:
:
getTypeCode
,
Function
.
identity
()));
List
<
Template
>
templateList
=
templateMapper
.
selectList
(
new
LambdaQueryWrapper
<
Template
>()
.
eq
(
Template:
:
getFormat
,
false
).
like
(
Template:
:
getTypeCode
,
DutyInfoEnum
.
接警情况
.
getKey
()
+
"-"
));
Map
<
String
,
Template
>
templateMap
=
templateList
.
stream
()
.
collect
(
Collectors
.
toMap
(
Template:
:
getTypeCode
,
Function
.
identity
()));
List
<
String
>
contentList
=
Lists
.
newArrayList
();
//
增加非空判断 cz 2021-10-08
//
增加非空判断 cz 2021-10-08
list
.
forEach
(
i
->
{
if
(
i
.
get
(
"alertTypeCode"
)
!=
null
)
{
String
tempContent
=
templateMap
.
get
(
DutyInfoEnum
.
接警情况
.
getKey
()
+
"-"
+
i
.
get
(
"alertTypeCode"
))
.
getContent
();
String
tempContent
=
templateMap
.
get
(
DutyInfoEnum
.
接警情况
.
getKey
()
+
"-"
+
i
.
get
(
"alertTypeCode"
))
.
getContent
();
contentList
.
add
(
replaceTemplate
(
tempContent
,
i
));
}
});
Map
<
String
,
Integer
>
statusCountMap
=
alertCalledMapper
.
queryAlertStatusCount
(
beginDate
,
endDate
);
Integer
unFinishedCount
=
this
.
count
(
new
LambdaQueryWrapper
<
AlertCalled
>().
eq
(
AlertCalled:
:
getAlertStatus
,
false
));
//bug2532 未结案警情统计错误 bykongfm
Integer
unFinishedCount
=
this
.
count
(
new
LambdaQueryWrapper
<
AlertCalled
>().
eq
(
AlertCalled:
:
getAlertStatus
,
false
));
// bug2532
// 未结案警情统计错误
// bykongfm
result
.
put
(
"alertInfoList"
,
contentList
);
result
.
putAll
(
statusCountMap
);
...
...
@@ -490,12 +495,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
listdate
.
add
(
new
KeyValueLabel
(
"联系电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
// listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
list
.
stream
().
forEach
(
alertFormValue
->
{
/*
2661 灾情详情中字典类数据错误显示为code 改为value值 2021-09-23 陈召 开始 */
/*
2661 灾情详情中字典类数据错误显示为code 改为value值 2021-09-23 陈召 开始 */
String
valueCode
=
alertFormValue
.
getFieldValue
();
/*
2661 灾情详情中字典类数据错误显示为code 改为value值 2021-09-23 陈召 结束 */
/*if(null == valueCode) {
valueCode = alertFormValue.getFieldValue();
}
*/
/*
2661 灾情详情中字典类数据错误显示为code 改为value值 2021-09-23 陈召 结束 */
/*
* if(null == valueCode) { valueCode = alertFormValue.getFieldValue(); }
*/
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
valueCode
));
});
map
.
put
(
"data"
,
listdate
);
...
...
@@ -519,12 +524,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
Map
<
String
,
Integer
>
map
=
powerTransferMapper
.
getCarNum
(
id
);
// Map<String,Integer> mapc=powerTransferMapper.getCompanyNum(id);
// Map<String,Integer> mapu= alertSubmittedMapper.getUseNum(id);
//
统计参与人员
//
统计参与人员
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
listdate
.
add
(
new
KeyValueLabel
(
"调动人力"
,
"useNum"
,
"0"
,
"人"
));
//
统计参与车辆
//
统计参与车辆
listdate
.
add
(
new
KeyValueLabel
(
"调动人力"
,
"carNum"
,
map
.
get
(
"carNum"
),
"辆"
));
//
统计参与队伍
//
统计参与队伍
listdate
.
add
(
new
KeyValueLabel
(
"调动单位"
,
"companyNum"
,
map
.
get
(
"companyNum"
),
"个"
));
return
listdate
;
...
...
@@ -573,7 +578,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
StringBuilder
bellNumSb
=
new
StringBuilder
();
StringBuilder
broadcastNumSb
=
new
StringBuilder
();
for
(
ControllerDto
controllerDto
:
controllerDtoList
)
{
//
消防警铃
//
消防警铃
if
(
controllerDto
.
getType
().
equals
(
ControllerTypeEnum
.
BELL
.
getCode
()))
{
List
<
String
>
bellNumList
=
controllerEquipMap
.
get
(
controllerDto
.
getSequenceNbr
());
if
(!
ValidationUtil
.
isEmpty
(
bellNumList
))
{
...
...
@@ -582,7 +587,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
}
}
//
广播
//
广播
if
(
controllerDto
.
getType
().
equals
(
ControllerTypeEnum
.
BROADCAST
.
getCode
()))
{
List
<
String
>
broadcastList
=
controllerEquipMap
.
get
(
controllerDto
.
getSequenceNbr
());
if
(!
ValidationUtil
.
isEmpty
(
broadcastList
))
{
...
...
@@ -614,9 +619,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
List
<
ControllerDto
>
northDoor
=
controllerService
.
queryForList
(
"3"
,
ControllerTypeEnum
.
DOOR
.
getCode
());
if
(!
ValidationUtil
.
isEmpty
(
northDoor
))
{
ControllerDto
controllerDto
=
northDoor
.
get
(
0
);
//
打开北站车库门
//
打开北站车库门
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
100
,
"1,1,1,1"
);
//
打开北站车库门弱电警铃
//
打开北站车库门弱电警铃
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
107
,
"1"
);
}
/**
...
...
@@ -625,9 +630,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
List
<
ControllerDto
>
southDoor
=
controllerService
.
queryForList
(
"2"
,
ControllerTypeEnum
.
DOOR
.
getCode
());
if
(!
ValidationUtil
.
isEmpty
(
southDoor
))
{
ControllerDto
controllerDto
=
southDoor
.
get
(
0
);
//
打开南站车库门
//
打开南站车库门
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
100
,
"1"
);
//
打开南站车库门弱电警铃
//
打开南站车库门弱电警铃
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
107
,
"1"
);
}
...
...
@@ -712,7 +717,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return
map
;
}
//
未结案警情统计
//
未结案警情统计
@Override
public
Integer
AlertCalledcount
(
int
type
)
{
return
alertCalledMapper
.
AlertCalledcount
(
0
);
...
...
@@ -723,7 +728,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return
alertCalledMapper
.
AlertCalledStatusPage
(
current
,
size
);
}
@Override
public
List
<
JSONObject
>
queryDisposalObjectList
(
String
alertId
)
{
AlertCalled
alertCalled
=
this
.
getById
(
Long
.
valueOf
(
alertId
));
...
...
@@ -754,22 +758,25 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
List
<
OrgUsrzhDto
>
unitInvolvedDto
=
iOrgUsrService
.
getOrgUsrzhDto
(
alertCalled
.
getUnitInvolved
());
JSONObject
a1
=
new
JSONObject
();
a1
.
put
(
"name"
,
"单位名称"
);
a1
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getBizOrgName
()
:
""
);
a1
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getBizOrgName
()
:
""
);
JSONObject
a2
=
new
JSONObject
();
a2
.
put
(
"name"
,
"单位性质"
);
a2
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getCompanyNature
()
:
""
);
a2
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getCompanyNature
()
:
""
);
JSONObject
a3
=
new
JSONObject
();
a3
.
put
(
"name"
,
"单位电话"
);
a3
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getCompanyPhone
()
:
""
);
a3
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getCompanyPhone
()
:
""
);
JSONObject
a4
=
new
JSONObject
();
a4
.
put
(
"name"
,
"单位地址"
);
a4
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getCompanyLocation
()
:
""
);
a4
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getCompanyLocation
()
:
""
);
JSONObject
a5
=
new
JSONObject
();
a5
.
put
(
"name"
,
"重点部位数量"
);
a5
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getKeySiteCount
()!=
null
?
unitInvolvedDto
.
get
(
0
).
getKeySiteCount
():
0
:
0
+
"个"
);
a5
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getKeySiteCount
()
!=
null
?
unitInvolvedDto
.
get
(
0
).
getKeySiteCount
()
:
0
:
0
+
"个"
);
resultList
.
add
(
a1
);
resultList
.
add
(
a2
);
resultList
.
add
(
a3
);
...
...
@@ -816,24 +823,30 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return
resultList
;
}
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始*/
public
List
<
Map
<
String
,
String
>>
getContactName
()
{
List
<
Map
<
String
,
String
>>
firefightersName
=
firefightersService
.
getFirefightersName
();
firefightersName
.
forEach
(
r
->{
String
phone
=
r
.
get
(
"phone"
);
phone
=
QRCodeUtil
.
generateQRCode
()+
"@"
+
phone
;
r
.
put
(
"phone"
,
phone
);
}
);
List
<
Map
<
String
,
String
>>
contactNames
=
alertCalledMapper
.
getContactName
();
contactNames
.
forEach
(
r
->{
String
phone
=
r
.
get
(
"phone"
);
phone
=
QRCodeUtil
.
generateQRCode
()+
"@"
+
phone
;
r
.
put
(
"phone"
,
phone
);
}
);
firefightersName
.
addAll
(
contactNames
);
return
firefightersName
;
/* 2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始 */
public
List
<
Map
<
String
,
String
>>
getContactName
()
{
// List<Map<String,String>> firefightersName =
// firefightersService.getFirefightersName();
// firefightersName.forEach(r->{
// String phone = r.get("phone");
// phone = QRCodeUtil.generateQRCode()+"@"+phone;
// r.put("phone",phone);
// }
// );
// List<Map<String,String>> contactNames = alertCalledMapper.getContactName();
// contactNames.forEach(r->{
// String phone = r.get("phone");
// phone = QRCodeUtil.generateQRCode()+"@"+phone;
// r.put("phone",phone);
// }
// );
// firefightersName.addAll(contactNames);
List
<
Map
<
String
,
String
>>
list
=
orgUsrServiceImpl
.
getPersonSimpleDetail
();
list
.
stream
().
forEach
(
i
->{
String
phone
=
QRCodeUtil
.
generateQRCode
()+
"@"
+
i
.
get
(
"phone"
).
toString
();
i
.
replace
(
"phone"
,
phone
);
});
return
list
;
}
public
List
<
String
>
getCalledAddress
()
{
...
...
@@ -843,16 +856,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return
keyAddress
;
}
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束*/
public
List
<
Map
<
String
,
Object
>>
getLocationLike
(
String
locationt
)
{
List
<
Map
<
String
,
Object
>>
orgUserLocation
=
alertCalledMapper
.
getOrgUserLocation
(
locationt
);
List
<
Map
<
String
,
Object
>>
alertCalledLocation
=
alertCalledMapper
.
getAlertCalledLocation
(
locationt
);
List
<
Map
<
String
,
Object
>>
keySiteLocation
=
alertCalledMapper
.
getKeySiteLocation
(
locationt
);
List
<
Map
<
String
,
Object
>>
airportLocation
=
alertCalledMapper
.
getAirportLocation
(
locationt
);
orgUserLocation
.
addAll
(
alertCalledLocation
);
orgUserLocation
.
addAll
(
keySiteLocation
);
orgUserLocation
.
addAll
(
airportLocation
);
return
orgUserLocation
;
/* 2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束 */
public
Set
<
Map
<
String
,
Object
>>
getLocationLike
(
String
locationt
)
{
Set
<
Map
<
String
,
Object
>>
set
=
new
HashSet
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
orgUserLocation
=
alertCalledMapper
.
getOrgUserLocation
(
locationt
);
List
<
Map
<
String
,
Object
>>
alertCalledLocation
=
alertCalledMapper
.
getAlertCalledLocation
(
locationt
);
List
<
Map
<
String
,
Object
>>
keySiteLocation
=
alertCalledMapper
.
getKeySiteLocation
(
locationt
);
List
<
Map
<
String
,
Object
>>
airportLocation
=
alertCalledMapper
.
getAirportLocation
(
locationt
);
set
.
addAll
(
alertCalledLocation
);
set
.
addAll
(
keySiteLocation
);
set
.
addAll
(
airportLocation
);
set
.
addAll
(
orgUserLocation
);
set
.
remove
(
null
);
return
set
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/GetContactNameSchedulerJob.java
deleted
100644 → 0
View file @
7c1fe64d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
@Component
public
class
GetContactNameSchedulerJob
{
@Autowired
RedisUtils
redisUtils
;
@Autowired
AlertCalledServiceImpl
alertCalledServiceImpl
;
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
/**
* 每天凌晨12:01执行方法,更新联系人在缓存中的数据
*/
@Scheduled
(
cron
=
"0 01 00 ? * *"
)
public
void
excuteJob
()
{
List
<
Map
<
String
,
String
>>
contactName
=
alertCalledServiceImpl
.
getContactName
();
redisUtils
.
set
(
RedisKey
.
CONTACT_USER
,
contactName
,
time
);
}
}
amos-boot-system-jcs/src/main/java/com/yeejoin/amos/AmosJcsApplication.java
View file @
7621d26a
...
...
@@ -19,7 +19,6 @@ import org.springframework.core.env.Environment;
import
org.springframework.data.redis.connection.RedisConnection
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler
;
...
...
@@ -39,7 +38,6 @@ import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
@EnableFeignClients
@EnableAsync
@EnableEurekaClient
@EnableScheduling
@MapperScan
({
"org.typroject.tyboot.demo.face.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"com.yeejoin.amos.boot.module.*.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
...
...
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