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
3fa49ad7
Commit
3fa49ad7
authored
Oct 30, 2023
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
巡检代码迁移
parent
949695f2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
297 additions
and
377 deletions
+297
-377
FeignConfiguration.java
...eejoin/amos/boot/biz/common/feign/FeignConfiguration.java
+1
-1
EquipFeignClient.java
...n/amos/boot/module/common/api/feign/EquipFeignClient.java
+36
-0
ElevatorController.java
...s/boot/module/jczs/biz/controller/ElevatorController.java
+0
-0
PatrolApplication.java
...biz/src/main/java/com/yeejoin/amos/PatrolApplication.java
+4
-1
CheckController.java
...join/amos/patrol/business/controller/CheckController.java
+3
-2
PointController.java
...join/amos/patrol/business/controller/PointController.java
+2
-2
UserController.java
...ejoin/amos/patrol/business/controller/UserController.java
+0
-3
Business.java
...java/com/yeejoin/amos/patrol/business/feign/Business.java
+2
-1
EquipFeign.java
...va/com/yeejoin/amos/patrol/business/feign/EquipFeign.java
+0
-53
FeignTzsConfiguration.java
...oin/amos/patrol/business/feign/FeignTzsConfiguration.java
+17
-6
IdxFeign.java
...java/com/yeejoin/amos/patrol/business/feign/IdxFeign.java
+2
-1
JcsFeignClient.java
...om/yeejoin/amos/patrol/business/feign/JcsFeignClient.java
+2
-1
TzsFeign.java
...java/com/yeejoin/amos/patrol/business/feign/TzsFeign.java
+2
-1
CheckServiceImpl.java
...n/amos/patrol/business/service/impl/CheckServiceImpl.java
+1
-3
LatentDangerServiceImpl.java
...patrol/business/service/impl/LatentDangerServiceImpl.java
+0
-0
MessageServiceImpl.java
...amos/patrol/business/service/impl/MessageServiceImpl.java
+80
-83
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+2
-1
PointServiceImpl.java
...n/amos/patrol/business/service/impl/PointServiceImpl.java
+20
-20
IAMOSSecurityServer.java
...eejoin/amos/patrol/common/remote/IAMOSSecurityServer.java
+1
-1
PersonIdentifyTzsAspect.java
...m/yeejoin/amos/patrol/config/PersonIdentifyTzsAspect.java
+1
-1
AsyncTask.java
...in/java/com/yeejoin/amos/patrol/core/async/AsyncTask.java
+0
-3
MultipartSupportConfig.java
...com/yeejoin/amos/patrol/feign/MultipartSupportConfig.java
+0
-37
PushFeign.java
...rc/main/java/com/yeejoin/amos/patrol/feign/PushFeign.java
+0
-39
AppMessagePushService.java
.../com/yeejoin/amos/patrol/jpush/AppMessagePushService.java
+111
-111
application-dev.properties
...spatrol-biz/src/main/resources/application-dev.properties
+10
-6
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/feign/FeignConfiguration.java
View file @
3fa49ad7
...
...
@@ -29,7 +29,7 @@ public class FeignConfiguration {
private
ObjectFactory
<
HttpMessageConverters
>
messageConverters
;
@Bean
public
Encoder
feignFormEncoder
()
{
public
Encoder
feign
Com
FormEncoder
()
{
return
new
SpringFormEncoder
(
new
SpringEncoder
(
messageConverters
));
}
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/feign/EquipFeignClient.java
View file @
3fa49ad7
...
...
@@ -5,6 +5,7 @@ import java.util.List;
import
java.util.Map
;
import
com.yeejoin.amos.boot.module.common.api.dto.CarInfoDto
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -386,4 +387,39 @@ public interface EquipFeignClient {
@RequestMapping
(
value
=
"/building/companyBuildingTree"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
<
Object
>
getCompanyBuildingTree
();
@RequestMapping
(
value
=
"/equipSpecific/getSourceNameByEquipSpeId"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getEquipDetail
(
@RequestParam
(
value
=
"id"
,
required
=
true
)
Long
id
);
@RequestMapping
(
value
=
"/equipSpecific/getSourceNameList"
,
method
=
RequestMethod
.
POST
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getEquipList
(
@RequestBody
Long
id
);
@RequestMapping
(
value
=
"/building/myTreeList"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
FeignClientResult
myTreeList
();
@RequestMapping
(
value
=
"/warehouse-structure/listAll"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
String
getStructureNameAll
();
/**
* 所属局域树
* @return
*/
@RequestMapping
(
value
=
"/area/treeToPartol"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
@RequestMapping
(
value
=
"/warehouse-structure/gettree/{id}"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
gettreeWarehouse
(
@PathVariable
Long
id
,
@RequestParam
(
value
=
"bizOrgCode"
,
required
=
true
)
String
bizOrgCode
,
@RequestParam
(
value
=
"buildingId"
,
required
=
false
)
String
buildingId
);
@RequestMapping
(
value
=
"/building/getOne"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
FeignClientResult
getBuildingTreeOne
(
@RequestParam
(
value
=
"instanceId"
,
required
=
true
)
String
instanceId
);
@RequestMapping
(
value
=
"/equipSpecific/status/equip"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
FeignClientResult
updateEquipSpecificStatus
(
@RequestParam
(
value
=
"status"
,
required
=
false
)
String
status
,
@RequestParam
(
value
=
"id"
,
required
=
false
)
String
id
,
@RequestParam
(
value
=
"sourceId"
,
required
=
false
)
String
sourceId
,
@RequestParam
(
value
=
"source"
,
required
=
false
)
String
source
);
}
amos-boot-system-tzs/amos-boot-module-jczs/amos-boot-module-jczs-biz/src/main/java/com/yeejoin/amos/boot/module/jczs/biz/controller/ElevatorController.java
View file @
3fa49ad7
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/PatrolApplication.java
View file @
3fa49ad7
...
...
@@ -52,7 +52,10 @@ import java.net.UnknownHostException;
@EnableEurekaClient
@ComponentScan
(
value
=
{
"org.typroject"
,
"com.yeejoin.amos"
},
excludeFilters
=
{
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
{
JsonSerializerManage
.
class
})})
@MapperScan
(
basePackages
=
{
"com.yeejoin.amos.patrol.business.dao.mapper"
,
"org.typroject.tyboot.core.auth.face.orm.dao"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
@MapperScan
(
basePackages
=
{
"com.yeejoin.amos.patrol.business.dao.mapper"
,
"org.typroject.tyboot.core.auth.face.orm.dao"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
,
"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"
})
public
class
PatrolApplication
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
PatrolApplication
.
class
);
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/CheckController.java
View file @
3fa49ad7
...
...
@@ -3,13 +3,13 @@ package com.yeejoin.amos.patrol.business.controller;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.patrol.business.constants.XJConstant
;
import
com.yeejoin.amos.patrol.business.dao.mapper.CheckMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.PointMapper
;
import
com.yeejoin.amos.patrol.business.dao.repository.ICheckInputDao
;
import
com.yeejoin.amos.patrol.business.dto.*
;
import
com.yeejoin.amos.patrol.business.feign.EquipFeign
;
import
com.yeejoin.amos.patrol.business.param.CheckInfoPageParam
;
import
com.yeejoin.amos.patrol.business.param.CheckRecordParam
;
import
com.yeejoin.amos.patrol.business.param.CheckStatisticalParam
;
...
...
@@ -79,8 +79,9 @@ public class CheckController extends AbstractBaseController {
@Autowired
private
AsyncTask
asyncTask
;
@Autowired
private
EquipFeign
equipFeign
;
private
EquipFeign
Client
equipFeign
;
@Autowired
private
IPlanTaskService
planTaskService
;
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/PointController.java
View file @
3fa49ad7
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.patrol.business.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.patrol.business.constants.XJConstant
;
...
...
@@ -10,7 +11,6 @@ import com.yeejoin.amos.patrol.business.dao.mapper.PointInputItemMapper;
import
com.yeejoin.amos.patrol.business.dao.mapper.PointMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.RoutePointItemMapper
;
import
com.yeejoin.amos.patrol.business.dao.repository.*
;
import
com.yeejoin.amos.patrol.business.feign.EquipFeign
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.param.*
;
import
com.yeejoin.amos.patrol.business.service.intfc.ICatalogTreeService
;
...
...
@@ -76,7 +76,7 @@ public class PointController extends AbstractBaseController {
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
EquipFeign
equipFeign
;
private
EquipFeign
Client
equipFeign
;
@Autowired
private
JcsFeignClient
jcsFeignClient
;
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/UserController.java
View file @
3fa49ad7
...
...
@@ -17,7 +17,6 @@ import com.yeejoin.amos.patrol.business.param.AppLoginUserParam;
import
com.yeejoin.amos.patrol.business.service.intfc.IAppService
;
import
com.yeejoin.amos.patrol.business.util.*
;
import
com.yeejoin.amos.patrol.feign.RemoteSecurityService
;
import
com.yeejoin.amos.patrol.jpush.AppMessagePushService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -56,8 +55,6 @@ public class UserController extends AbstractBaseController {
private
static
final
String
appType
=
"APP"
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
AppMessagePushService
appMessagePushService
;
@Value
(
"${Security.fegin.name}"
)
private
String
SecurityName
;
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/feign/Business.java
View file @
3fa49ad7
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
feign
;
import
com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration
;
import
com.yeejoin.amos.patrol.business.entity.mybatis.DangerResultBo
;
import
com.yeejoin.amos.patrol.business.util.CommonResponse
;
import
com.yeejoin.amos.patrol.core.common.response.PointCheckInfoBusinessRespone
;
import
com.yeejoin.amos.patrol.core.common.response.TaskInfoBusinessRespone
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
@FeignClient
(
name
=
"${Business.fegin.name}"
,
configuration
=
Feign
Configuration
.
class
)
@FeignClient
(
name
=
"${Business.fegin.name}"
,
configuration
=
FeignTzs
Configuration
.
class
)
public
interface
Business
{
@RequestMapping
(
value
=
"/fireAutoSys/api/risksource/data/patroldata"
,
method
=
RequestMethod
.
PUT
)
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/feign/EquipFeign.java
deleted
100644 → 0
View file @
949695f2
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
feign
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.LinkedHashMap
;
//装备
@FeignClient
(
name
=
"${equip.fegin.name}"
,
configuration
=
FeignConfiguration
.
class
)
public
interface
EquipFeign
{
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/equipSpecific/getSourceNameByEquipSpeId"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getEquipDetail
(
@RequestParam
(
value
=
"id"
,
required
=
true
)
Long
id
);
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/equipSpecific/getSourceNameList"
,
method
=
RequestMethod
.
POST
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getEquipList
(
@RequestBody
Long
id
);
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/building/myTreeList"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
FeignClientResult
myTreeList
();
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/warehouse-structure/listAll"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
String
getStructureNameAll
();
/**
* 消防建筑树
* @return
*/
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/building/tree"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getBuildingTree
();
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/building/getBuildingAbsolutePosition"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getBuildingAbsolutePosition
();
/**
* 所属局域树
* @return
*/
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/area/treeToPartol"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/warehouse-structure/gettree/{id}"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
gettreeWarehouse
(
@PathVariable
Long
id
,
@RequestParam
(
value
=
"bizOrgCode"
,
required
=
true
)
String
bizOrgCode
,
@RequestParam
(
value
=
"buildingId"
,
required
=
false
)
String
buildingId
);
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/building/getOne"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
FeignClientResult
getBuildingTreeOne
(
@RequestParam
(
value
=
"instanceId"
,
required
=
true
)
String
instanceId
);
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/equipSpecific/status/equip"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
FeignClientResult
updateEquipSpecificStatus
(
@RequestParam
(
value
=
"status"
,
required
=
false
)
String
status
,
@RequestParam
(
value
=
"id"
,
required
=
false
)
String
id
,
@RequestParam
(
value
=
"sourceId"
,
required
=
false
)
String
sourceId
,
@RequestParam
(
value
=
"source"
,
required
=
false
)
String
source
);
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/feign/FeignConfiguration.java
→
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/feign/Feign
Tzs
Configuration.java
View file @
3fa49ad7
...
...
@@ -7,19 +7,30 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.autoconfigure.http.HttpMessageConverters
;
import
org.springframework.cloud.openfeign.support.SpringEncoder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
public
class
FeignConfiguration
{
/**
* @author DELL
*/
@Configuration
public
class
FeignTzsConfiguration
{
/**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return
*/
@Bean
public
FeignBasicAuthRequestInterceptor
basicTzsAuthRequestInterceptor
()
{
return
new
FeignBasicAuthRequestInterceptor
();
}
@Autowired
private
ObjectFactory
<
HttpMessageConverters
>
messageConverters
;
@Bean
public
Encoder
feignFormEncoder
()
{
public
Encoder
feign
TzsCom
FormEncoder
()
{
return
new
SpringFormEncoder
(
new
SpringEncoder
(
messageConverters
));
}
@Bean
public
FeignBasicAuthRequestInterceptor
basicAuthRequestInterceptor
()
{
return
new
FeignBasicAuthRequestInterceptor
();
}
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/feign/IdxFeign.java
View file @
3fa49ad7
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
feign
;
import
com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -12,7 +13,7 @@ import java.util.List;
/**
* @author DELL
*/
@FeignClient
(
name
=
"${idx.feign.name}"
,
path
=
"idx"
,
configuration
=
{
FeignConfiguration
.
class
}
)
@FeignClient
(
name
=
"${idx.feign.name}"
,
path
=
"idx"
,
configuration
=
FeignTzsConfiguration
.
class
)
public
interface
IdxFeign
{
/***
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/feign/JcsFeignClient.java
View file @
3fa49ad7
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
feign
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
...
@@ -11,7 +12,7 @@ import java.util.List;
import
java.util.Map
;
// 机场服务
@FeignClient
(
name
=
"${jcs.fegin.name}"
,
path
=
"jcs"
,
configuration
=
Feign
Configuration
.
class
)
@FeignClient
(
name
=
"${jcs.fegin.name}"
,
path
=
"jcs"
,
configuration
=
FeignTzs
Configuration
.
class
)
public
interface
JcsFeignClient
{
/**
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/feign/TzsFeign.java
View file @
3fa49ad7
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
feign
;
import
com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration
;
import
com.yeejoin.amos.patrol.business.dto.UserDetailsDto
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -13,7 +14,7 @@ import java.util.Map;
/**
* @author DELL
*/
@FeignClient
(
name
=
"${tzs.feign.name}"
,
path
=
"tcm"
,
configuration
=
{
FeignConfiguration
.
class
}
)
@FeignClient
(
name
=
"${tzs.feign.name}"
,
path
=
"tcm"
,
configuration
=
FeignTzsConfiguration
.
class
)
public
interface
TzsFeign
{
/**
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/CheckServiceImpl.java
View file @
3fa49ad7
...
...
@@ -21,7 +21,6 @@ import com.yeejoin.amos.patrol.business.dao.mapper.*;
import
com.yeejoin.amos.patrol.business.dao.repository.*
;
import
com.yeejoin.amos.patrol.business.dto.CheckDto
;
import
com.yeejoin.amos.patrol.business.entity.mybatis.*
;
import
com.yeejoin.amos.patrol.business.feign.EquipFeign
;
import
com.yeejoin.amos.patrol.business.feign.IdxFeign
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.param.*
;
...
...
@@ -1589,8 +1588,7 @@ public class CheckServiceImpl implements ICheckService {
CommonPage
<
CheckInputBo
>
result
=
new
CommonPage
<>(
content
,
param
,
total
);
return
result
;
}
@Autowired
private
EquipFeign
equipment
;
@Override
public
List
<
HashMap
<
String
,
Object
>>
getEquipByCheckId
(
CheckDetailInputPageParam
param
)
{
// 如果不传巡检ID,则获取最新一条巡检点对应的巡检记录ID
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/LatentDangerServiceImpl.java
View file @
3fa49ad7
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/MessageServiceImpl.java
View file @
3fa49ad7
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.patrol.business.constants.XJConstant
;
...
...
@@ -11,7 +12,6 @@ import com.yeejoin.amos.patrol.business.dao.repository.IRouteDao;
import
com.yeejoin.amos.patrol.business.entity.mybatis.CheckMsgBo
;
import
com.yeejoin.amos.patrol.business.entity.mybatis.PushTargetBo
;
import
com.yeejoin.amos.patrol.business.entity.mybatis.TaskMsgBo
;
import
com.yeejoin.amos.patrol.business.feign.EquipFeign
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.param.MsgInfoPageParam
;
import
com.yeejoin.amos.patrol.business.param.NoticePublishParam
;
...
...
@@ -24,7 +24,6 @@ import com.yeejoin.amos.patrol.dao.entity.*;
import
com.yeejoin.amos.patrol.email.IEmailService
;
import
com.yeejoin.amos.patrol.feign.PushFeignServer
;
import
com.yeejoin.amos.patrol.feign.RemoteSecurityService
;
import
com.yeejoin.amos.patrol.jpush.AppMessagePushService
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -76,8 +75,6 @@ public class MessageServiceImpl implements IMessageService {
@Autowired
private
IEmailService
emailService
;
@Autowired
private
AppMessagePushService
appMessagePushService
;
@Autowired
private
PushFeignServer
pushFeignServer
;
...
...
@@ -86,7 +83,7 @@ public class MessageServiceImpl implements IMessageService {
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
EquipFeign
equipFeign
;
private
EquipFeign
Client
equipFeign
;
@Autowired
...
...
@@ -94,84 +91,84 @@ public class MessageServiceImpl implements IMessageService {
@Override
public
void
pushCheckMessage
(
String
toke
,
String
product
,
String
appKey
,
Long
checkId
)
{
try
{
//消息发送内容、执行人id,巡检点id,巡检线路id
CheckMsgBo
checkMsgBo
=
msgMapper
.
getCheckMsgBos
(
checkId
);
if
(
checkMsgBo
!=
null
){
PushMsgParam
pushMsgParam
=
new
PushMsgParam
();
pushMsgParam
.
setContent
(
checkMsgBo
.
getPushMsg
());
pushMsgParam
.
setSubject
(
MsgTypeEnum
.
CHECK
.
getName
());
//发送目标,执行人,巡检点责任人,巡检线路责任人,关注线路人
//获取建筑地址
if
(
StringUtils
.
isNotBlank
(
checkMsgBo
.
getRiskSourceId
())){
LinkedHashMap
<
String
,
Object
>
positionAll
=
equipFeign
.
getBuildingAbsolutePosition
();
LinkedHashMap
<
String
,
Object
>
position
=
new
LinkedHashMap
<>();
if
(
"200"
.
equals
(
positionAll
.
get
(
"status"
).
toString
())){
position
=
(
LinkedHashMap
<
String
,
Object
>)
positionAll
.
get
(
"result"
);
}
checkMsgBo
.
setPushMsg
(
checkMsgBo
.
getPushMsg
().
replace
(
"address"
,
position
.
get
(
checkMsgBo
.
getRiskSourceId
()).
toString
()));
checkMsgBo
.
setSaveMsg
(
checkMsgBo
.
getSaveMsg
().
replace
(
"address"
,
position
.
get
(
checkMsgBo
.
getRiskSourceId
()).
toString
()));
}
else
{
checkMsgBo
.
setPushMsg
(
checkMsgBo
.
getPushMsg
().
replace
(
"address"
,
"无"
));
checkMsgBo
.
setSaveMsg
(
checkMsgBo
.
getSaveMsg
().
replace
(
"address"
,
"无"
));
}
Set
<
String
>
needUserIds
=
new
HashSet
<>();
//执行人
needUserIds
.
add
(
checkMsgBo
.
getUserId
());
//获取点责任人
Optional
<
Point
>
point
=
iPointDao
.
findById
(
checkMsgBo
.
getPointId
());
needUserIds
.
add
(
point
.
get
().
getChargePersonId
());
//获取线路责任人
if
(
checkMsgBo
.
getRouteId
()
!=
0
){
Optional
<
Route
>
route
=
iRouteDao
.
findById
(
checkMsgBo
.
getRouteId
());
if
(
route
.
isPresent
()){
if
(
route
.
get
().
getBoss
()
!=
null
&&
route
.
get
().
getBoss
().
trim
()
!=
""
){
needUserIds
.
add
(
route
.
get
().
getBoss
());
}
}
}
//获取需要推送的app的用户 手机端暂时无订阅功能,暂时屏蔽
// List<PushTargetBo> jpushUser = msgMapper.getPushUserBo("app", String.join(",", needUserIds), checkMsgBo.getRouteId(),getAppPushConfig(checkMsgBo.getStatus()));
List
<
PushTargetBo
>
jpushUser
=
new
ArrayList
<>();
needUserIds
.
stream
().
forEach
(
action
->{
if
(!
ObjectUtils
.
isEmpty
(
action
)){
PushTargetBo
pb
=
new
PushTargetBo
();
pb
.
setUserId
(
action
);
jpushUser
.
add
(
pb
);
}
});
//获取需要推送的email的用户
List
<
PushTargetBo
>
emailUser
=
msgMapper
.
getPushUserBo
(
"email"
,
String
.
join
(
","
,
needUserIds
),
checkMsgBo
.
getRouteId
(),
getEmailPushConfig
(
checkMsgBo
.
getStatus
()));
//处理用户信息
List
<
PushTargetBo
>
tempList
=
new
ArrayList
<>();
tempList
.
addAll
(
jpushUser
);
tempList
.
addAll
(
emailUser
);
// 手机端暂时无订阅功能,暂时屏蔽
// List<String> userIds=tempList.stream().map(PushTargetBo::getUserId).distinct().collect(Collectors.toList());
Set
<
String
>
userIds
=
needUserIds
;
List
<
AgencyUserModel
>
agencyUserModelList
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
String
.
join
(
","
,
userIds
));
try
{
pushAppMsg
(
jpushUser
,
agencyUserModelList
,
pushMsgParam
,
checkMsgBo
,
toke
,
product
,
appKey
);
}
catch
(
InterruptedException
e
)
{
// TODO Auto-generated catch block
log
.
error
(
e
.
getMessage
(),
e
);
e
.
printStackTrace
();
}
try
{
pushEmailMsg
(
emailUser
,
agencyUserModelList
,
pushMsgParam
,
checkMsgBo
);
}
catch
(
InterruptedException
e
)
{
// TODO Auto-generated catch block
log
.
error
(
e
.
getMessage
(),
e
);
e
.
printStackTrace
();
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
e
.
printStackTrace
();
}
//
try{
//
//消息发送内容、执行人id,巡检点id,巡检线路id
//
CheckMsgBo checkMsgBo = msgMapper.getCheckMsgBos(checkId);
//
if(checkMsgBo != null){
//
PushMsgParam pushMsgParam = new PushMsgParam();
//
pushMsgParam.setContent(checkMsgBo.getPushMsg());
//
pushMsgParam.setSubject(MsgTypeEnum.CHECK.getName());
//
//发送目标,执行人,巡检点责任人,巡检线路责任人,关注线路人
//
//获取建筑地址
//
if(StringUtils.isNotBlank(checkMsgBo.getRiskSourceId())){
//
LinkedHashMap<String,Object> positionAll = equipFeign.getBuildingAbsolutePosition();
//
LinkedHashMap<String,Object> position = new LinkedHashMap<>();
//
if("200".equals(positionAll.get("status").toString())){
//
position = (LinkedHashMap<String, Object>) positionAll.get("result");
//
}
//
checkMsgBo.setPushMsg(checkMsgBo.getPushMsg().replace("address",position.get(checkMsgBo.getRiskSourceId()).toString()));
//
checkMsgBo.setSaveMsg(checkMsgBo.getSaveMsg().replace("address",position.get(checkMsgBo.getRiskSourceId()).toString()));
//
}else{
//
checkMsgBo.setPushMsg(checkMsgBo.getPushMsg().replace("address","无"));
//
checkMsgBo.setSaveMsg(checkMsgBo.getSaveMsg().replace("address","无"));
//
}
//
Set<String> needUserIds = new HashSet<>();
//
//执行人
//
needUserIds.add(checkMsgBo.getUserId());
//
//获取点责任人
//
Optional<Point> point = iPointDao.findById(checkMsgBo.getPointId());
//
needUserIds.add(point.get().getChargePersonId());
//
//获取线路责任人
//
if(checkMsgBo.getRouteId() != 0){
//
Optional<Route> route = iRouteDao.findById(checkMsgBo.getRouteId());
//
if(route.isPresent()){
//
if(route.get().getBoss() !=null && route.get().getBoss().trim() !=""){
//
needUserIds.add(route.get().getBoss());
//
}
//
}
//
}
//
//
//获取需要推送的app的用户 手机端暂时无订阅功能,暂时屏蔽
//
//
List<PushTargetBo> jpushUser = msgMapper.getPushUserBo("app", String.join(",", needUserIds), checkMsgBo.getRouteId(),getAppPushConfig(checkMsgBo.getStatus()));
//
List<PushTargetBo> jpushUser = new ArrayList<>();
//
needUserIds.stream().forEach(action->{
//
if(!ObjectUtils.isEmpty(action)){
//
PushTargetBo pb = new PushTargetBo();
//
pb.setUserId(action);
//
jpushUser.add(pb);
//
}
//
});
//
//获取需要推送的email的用户
//
List<PushTargetBo> emailUser = msgMapper.getPushUserBo("email", String.join(",", needUserIds), checkMsgBo.getRouteId(),getEmailPushConfig(checkMsgBo.getStatus()));
//
//
//
//处理用户信息
//
List<PushTargetBo> tempList = new ArrayList<>();
//
tempList.addAll(jpushUser);
//
tempList.addAll(emailUser);
//
// 手机端暂时无订阅功能,暂时屏蔽
//
//
List<String> userIds=tempList.stream().map(PushTargetBo::getUserId).distinct().collect(Collectors.toList());
//
Set<String> userIds = needUserIds;
//
List<AgencyUserModel> agencyUserModelList=remoteSecurityService.listUserByUserIds( toke,product,appKey,String.join(",", userIds));
//
try {
//
pushAppMsg(jpushUser,agencyUserModelList,pushMsgParam,checkMsgBo, toke, product, appKey);
//
} catch (InterruptedException e) {
//
// TODO Auto-generated catch block
//
log.error(e.getMessage(), e);
//
e.printStackTrace();
//
}
//
try {
//
pushEmailMsg(emailUser, agencyUserModelList, pushMsgParam,checkMsgBo);
//
} catch (InterruptedException e) {
//
// TODO Auto-generated catch block
//
log.error(e.getMessage(), e);
//
e.printStackTrace();
//
}
//
}
//
}catch (Exception e) {
//
log.error(e.getMessage(), e);
//
e.printStackTrace();
//
}
}
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PlanTaskServiceImpl.java
View file @
3fa49ad7
...
...
@@ -8,6 +8,7 @@ import com.google.common.base.Joiner;
import
com.yeejoin.amos.boot.biz.common.constants.RuleConstant
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
...
@@ -117,7 +118,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
private
Business
business
;
@Autowired
private
EquipFeign
equipFeign
;
private
EquipFeign
Client
equipFeign
;
@Autowired
private
RuleTrigger
ruleTrigger
;
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PointServiceImpl.java
View file @
3fa49ad7
...
...
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
...
...
@@ -17,7 +18,6 @@ import com.yeejoin.amos.patrol.business.dao.mapper.RoutePointItemMapper;
import
com.yeejoin.amos.patrol.business.dao.repository.*
;
import
com.yeejoin.amos.patrol.business.dto.PointClassifySynDto
;
import
com.yeejoin.amos.patrol.business.entity.mybatis.CheckPtListBo
;
import
com.yeejoin.amos.patrol.business.feign.EquipFeign
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.param.*
;
import
com.yeejoin.amos.patrol.business.service.intfc.IPatrolDataSyncService
;
...
...
@@ -107,7 +107,7 @@ public class PointServiceImpl implements IPointService {
@Autowired
private
IInputItemDao
inputItemDao
;
@Autowired
private
EquipFeign
equipFeign
;
private
EquipFeignClient
equipFeign
;
@Autowired
private
JcsFeignClient
jcsFeignClient
;
...
...
@@ -1961,15 +1961,15 @@ public class PointServiceImpl implements IPointService {
List
<
Map
<
String
,
Object
>>
list
=
Collections
.
EMPTY_LIST
;
// 传入riskSourceId为-2请求的是巡检点区域为空
if
(
riskSourceId
!=
null
&&
riskSourceId
!=
-
2
)
{
LinkedHashMap
<
String
,
Object
>
o
=
equipFeign
.
getBuildingTree
();
if
(
o
==
null
||!
"200"
.
equals
(
o
.
get
(
"status"
).
toString
()))
{
throw
new
YeeException
(
"获取建筑树出错"
);
}
List
<
Map
<
String
,
Object
>>
buildingTree
=
(
List
<
Map
<
String
,
Object
>>)
o
.
get
(
"result"
);
Map
<
String
,
Object
>
node
=
getAllNodes
(
buildingTree
).
stream
().
filter
(
map
->
riskSourceId
.
toString
().
equals
(
map
.
get
(
"id"
))).
findFirst
().
orElse
(
null
);
if
(
node
!=
null
)
{
structureIdList
=
findBuildChildrenIds
(
node
);
}
//
LinkedHashMap<String,Object> o = equipFeign.getBuildingTree();
//
if(o==null||!"200".equals(o.get("status").toString())) {
//
throw new YeeException("获取建筑树出错");
//
}
//
List<Map<String, Object>> buildingTree = (List<Map<String, Object>>) o.get("result");
//
Map<String, Object> node = getAllNodes(buildingTree).stream().filter(map -> riskSourceId.toString().equals(map.get("id"))).findFirst().orElse(null);
//
if (node != null) {
//
structureIdList = findBuildChildrenIds(node);
//
}
}
boolean
nullRiskSourceId
=
false
;
...
...
@@ -1991,15 +1991,15 @@ public class PointServiceImpl implements IPointService {
List
<
Map
<
String
,
Object
>>
list
=
Collections
.
EMPTY_LIST
;
// 传入riskSourceId为-2请求的是巡检点区域为空
if
(
riskSourceId
!=
null
&&
riskSourceId
!=
-
2
)
{
LinkedHashMap
<
String
,
Object
>
o
=
equipFeign
.
getBuildingTree
();
if
(
o
==
null
||!
"200"
.
equals
(
o
.
get
(
"status"
).
toString
()))
{
throw
new
YeeException
(
"获取建筑树出错"
);
}
List
<
Map
<
String
,
Object
>>
buildingTree
=
(
List
<
Map
<
String
,
Object
>>)
o
.
get
(
"result"
);
Map
<
String
,
Object
>
node
=
getAllNodes
(
buildingTree
).
stream
().
filter
(
map
->
riskSourceId
.
toString
().
equals
(
map
.
get
(
"id"
))).
findFirst
().
orElse
(
null
);
if
(
node
!=
null
)
{
structureIdList
=
findBuildChildrenIds
(
node
);
}
//
LinkedHashMap<String,Object> o = equipFeign.getBuildingTree();
//
if(o==null||!"200".equals(o.get("status").toString())) {
//
throw new YeeException("获取建筑树出错");
//
}
//
List<Map<String, Object>> buildingTree = (List<Map<String, Object>>) o.get("result");
//
Map<String, Object> node = getAllNodes(buildingTree).stream().filter(map -> riskSourceId.toString().equals(map.get("id"))).findFirst().orElse(null);
//
if (node != null) {
//
structureIdList = findBuildChildrenIds(node);
//
}
}
boolean
nullRiskSourceId
=
false
;
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/common/remote/IAMOSSecurityServer.java
View file @
3fa49ad7
package
com
.
yeejoin
.
amos
.
patrol
.
common
.
remote
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.
patrol.business
.feign.FeignConfiguration
;
import
com.yeejoin.amos.
boot.biz.common
.feign.FeignConfiguration
;
import
com.yeejoin.amos.patrol.business.util.CommonResponse
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/config/PersonIdentifyAspect.java
→
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/config/PersonIdentify
Tzs
Aspect.java
View file @
3fa49ad7
...
...
@@ -30,7 +30,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
@Component
@ResponseBody
@Order
(
value
=
1
)
public
class
PersonIdentifyAspect
{
public
class
PersonIdentify
Tzs
Aspect
{
@Autowired
RedisUtils
redisUtils
;
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/core/async/AsyncTask.java
View file @
3fa49ad7
...
...
@@ -19,7 +19,6 @@ import com.yeejoin.amos.patrol.common.enums.MsgSubscribeEnum;
import
com.yeejoin.amos.patrol.dao.entity.Msg
;
import
com.yeejoin.amos.patrol.email.IEmailService
;
import
com.yeejoin.amos.patrol.feign.RemoteSecurityService
;
import
com.yeejoin.amos.patrol.jpush.AppMessagePushService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -53,8 +52,6 @@ public class AsyncTask {
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
AppMessagePushService
appMessagePushService
;
@Autowired
private
MsgSubscribeMapper
msgSubscribeMapper
;
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/feign/MultipartSupportConfig.java
deleted
100644 → 0
View file @
949695f2
//package com.yeejoin.amos.patrol.feign;
//
//import feign.codec.Encoder;
//import feign.form.spring.SpringFormEncoder;
//import org.springframework.beans.factory.ObjectFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
//import org.springframework.cloud.openfeign.support.SpringEncoder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.context.request.RequestContextListener;
//
///**
// * @Author: xinglei
// * @Description:
// * @Date: 2020/3/30 16:26
// */
//@Configuration
//public class MultipartSupportConfig {
//
// @Autowired
// private ObjectFactory<HttpMessageConverters> messageConverters;
//
// @Bean
// public Encoder feignFormEncoder() {
// return new SpringFormEncoder(new SpringEncoder(messageConverters));
// }
//
// /**
// * 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
// * @return
// */
// @Bean
// public RequestContextListener requestInterceptor() {
// return new RequestContextListener();
// }
//}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/feign/PushFeign.java
deleted
100644 → 0
View file @
949695f2
package
com
.
yeejoin
.
amos
.
patrol
.
feign
;
import
com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig
;
import
com.yeejoin.amos.patrol.business.param.PushMsgParam
;
import
com.yeejoin.amos.patrol.business.util.CommonResponse
;
import
org.springframework.cloud.openfeign.FeignClient
;
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
;
//推送
@FeignClient
(
name
=
"${Push.fegin.name}"
,
configuration
={
MultipartSupportConfig
.
class
})
public
interface
PushFeign
{
//
// @RequestMapping(value = "/api/user/sendMessage", method = RequestMethod.POST)
// CommonResponse sendMessage( @RequestBody List<PushMsgParam> responses);
@RequestMapping
(
value
=
"/api/user/sendMessageone"
,
method
=
RequestMethod
.
POST
)
CommonResponse
sendMessageone
(
@RequestBody
PushMsgParam
responses
);
@RequestMapping
(
value
=
"/api/user/pushNoticeMany"
,
method
=
RequestMethod
.
POST
)
CommonResponse
pushNoticeMany
(
@RequestBody
PushMsgParam
responses
);
@RequestMapping
(
value
=
"/api/user/buildPushPayload"
,
method
=
RequestMethod
.
POST
)
CommonResponse
buildPushPayload
(
@RequestBody
PushMsgParam
responses
);
@RequestMapping
(
value
=
"/api/user/pushDevice"
,
method
=
RequestMethod
.
GET
)
CommonResponse
PushDevice
(
@RequestParam
(
"alias"
)
String
alias
);
@RequestMapping
(
value
=
"/api/user/PushDeviceRegistration"
,
method
=
RequestMethod
.
GET
)
CommonResponse
PushDeviceRegistration
(
@RequestParam
(
"registrationId"
)
String
registrationId
,
@RequestParam
(
"alias"
)
String
alias
);
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/jpush/AppMessagePushService.java
View file @
3fa49ad7
package
com
.
yeejoin
.
amos
.
patrol
.
jpush
;
import
cn.jpush.api.JPushClient
;
import
cn.jpush.api.push.model.PushPayload
;
import
com.yeejoin.amos.patrol.business.constants.XJConstant
;
import
com.yeejoin.amos.patrol.business.param.PushMsgParam
;
import
com.yeejoin.amos.patrol.business.util.CommonResponse
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
@Service
public
class
AppMessagePushService
{
protected
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
AppMessagePushService
.
class
);
@Autowired
private
com
.
yeejoin
.
amos
.
patrol
.
feign
.
PushFeign
PushFeign
;
// private static String APP_KEY;
//
// private static String MASTER_SECRET;
//
// @Value("${params.jpush.appKey}")
// public void setAppKey(String appKey) {
// this.APP_KEY = appKey;
// }
// @Value("${params.jpush.masterSecret}")
// public void setMasterSecret(String masterSecret) {
// this.MASTER_SECRET = masterSecret;
// }
@Value
(
"${params.isPush}"
)
private
String
isPush
;
protected
static
final
String
APP_KEY
=
"1b3f7b961200f4b236811dfe"
;
protected
static
final
String
MASTER_SECRET
=
"8b650e645fb3a43c96be02b2"
;
//
private
static
JPushClient
jpushClient
=
new
JPushClient
(
MASTER_SECRET
,
APP_KEY
);
public
static
String
buildJpushUserKey
(
String
userId
)
{
return
XJConstant
.
JPUSH_USER_KEY
+
"_"
+
userId
;
}
// private static JPushClient jpushClient = null;
//
// public static JPushClient getJPushClient(String APP_KEY, String MASTER_SECRET) {
// if (jpushClient == null) {
// return new JPushClient(MASTER_SECRET,
//package com.yeejoin.amos.patrol.jpush;
//
//import cn.jpush.api.JPushClient;
//import cn.jpush.api.push.model.PushPayload;
//import com.yeejoin.amos.patrol.business.constants.XJConstant;
//import com.yeejoin.amos.patrol.business.param.PushMsgParam;
//import com.yeejoin.amos.patrol.business.util.CommonResponse;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Service;
//
//
//
//@Service
//public class AppMessagePushService {
//
//
// protected static final Logger log = LoggerFactory
// .getLogger(AppMessagePushService.class);
//
////
// @Autowired
// private com.yeejoin.amos.patrol.feign.PushFeign PushFeign;
//// private static String APP_KEY;
////
//// private static String MASTER_SECRET;
////
//// @Value("${params.jpush.appKey}")
//// public void setAppKey(String appKey) {
//// this.APP_KEY = appKey;
//// }
//// @Value("${params.jpush.masterSecret}")
//// public void setMasterSecret(String masterSecret) {
//// this.MASTER_SECRET = masterSecret;
//// }
//
// @Value("${params.isPush}")
// private String isPush;
//
// protected static final String APP_KEY = "1b3f7b961200f4b236811dfe";
// protected static final String MASTER_SECRET = "8b650e645fb3a43c96be02b2";
// //
//
// private static JPushClient jpushClient = new JPushClient(MASTER_SECRET,
// APP_KEY);
// public static String buildJpushUserKey(String userId) {
// return XJConstant.JPUSH_USER_KEY + "_" + userId;
// }
//
//// private static JPushClient jpushClient = null;
////
//// public static JPushClient getJPushClient(String APP_KEY, String MASTER_SECRET) {
//// if (jpushClient == null) {
//// return new JPushClient(MASTER_SECRET,
//// APP_KEY);
//// }
//// return jpushClient;
//// }
//
//
// /*public void sendMessage(List<PushMsgParam> responses)
// {
// PushFeign.sendMessage(responses);
// try
// {
// if(responses!=null && "true".equals(isPush))
// {
// for(PushMsgParam response:responses)
// {
// PushPayload payload = buildPushPayload(response);
// jpushClient.sendPush(payload);
// }
// return jpushClient;
// }
/*public void sendMessage(List<PushMsgParam> responses)
{
PushFeign.sendMessage(responses);
try
{
if(responses!=null && "true".equals(isPush))
{
for(PushMsgParam response:responses)
{
PushPayload payload = buildPushPayload(response);
jpushClient.sendPush(payload);
}
}
}
catch (Exception e){
log.error(e.getMessage(),e);
e.printStackTrace();
}
}
*/
private
PushPayload
buildPushPayload
(
PushMsgParam
response
)
{
CommonResponse
commonResponse
=
PushFeign
.
buildPushPayload
(
response
);
return
(
PushPayload
)
commonResponse
.
getDataList
();
/*if(JPushTypeEnum.ALL.getCode().equals(response.getType())){
return PushPayload.newBuilder()
.setPlatform(Platform.android())
.setAudience(Audience.all())
.setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
.build();
}else if(JPushTypeEnum.TAG.getCode().equals(response.getType())){
return PushPayload.newBuilder().setPlatform(Platform.android())
.setAudience(Audience.tag(response.getRecivers()))
.setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
.build();
}else{
return PushPayload.newBuilder().setPlatform(Platform.android())
.setAudience(Audience.alias(response.getRecivers())).
setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
.build();
}*/
}
// public void sendMessage(PushMsgParam response){
//
// try {
// if(null!=response && "true".equals(isPush)){
// CommonResponse commonResponse = PushFeign.sendMessageone(response);
// }
//
} catch (Exception e)
{
//
catch (Exception e)
{
// log.error(e.getMessage(),e);
// e.printStackTrace();
//
// }
// }
}
//*/
// private PushPayload buildPushPayload(PushMsgParam response) {
// CommonResponse commonResponse = PushFeign.buildPushPayload(response);
// return (PushPayload)commonResponse.getDataList();
// /*if(JPushTypeEnum.ALL.getCode().equals(response.getType())){
// return PushPayload.newBuilder()
// .setPlatform(Platform.android())
// .setAudience(Audience.all())
// .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
// }else if(JPushTypeEnum.TAG.getCode().equals(response.getType())){
// return PushPayload.newBuilder().setPlatform(Platform.android())
// .setAudience(Audience.tag(response.getRecivers()))
// .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
// }else{
// return PushPayload.newBuilder().setPlatform(Platform.android())
// .setAudience(Audience.alias(response.getRecivers())).
// setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
// }*/
//
// }
//
//// public void sendMessage(PushMsgParam response){
////
//// try {
//// if(null!=response && "true".equals(isPush)){
//// CommonResponse commonResponse = PushFeign.sendMessageone(response);
//// }
//// } catch (Exception e) {
//// log.error(e.getMessage(),e);
//// e.printStackTrace();
////
//// }
//// }
//
//}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/resources/application-dev.properties
View file @
3fa49ad7
...
...
@@ -85,12 +85,12 @@ windows.img.path = D:\\
linux.img.path
=
/
## emqx
emqx.clean-session
=
tru
e
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
-3578
emqx.broker
=
tcp://
172.16.10.210
:1883
emqx.
user-name
=
admin
emqx.
password
=
public
emqx.
max-inflight
=
1000
emqx.clean-session
=
fals
e
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://
36.46.151.113
:1883
emqx.
client-user-name
=
super
emqx.
client-password
=
123456
emqx.
keepAliveInterval
=
1000
file.url
=
http://172.16.10.210:9000/
...
...
@@ -99,3 +99,6 @@ logic=false
#是否为中心级系统 true-中心级系统 false-站端系统
is.zxj
=
true
## \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u052E\uFFFD\uFFFD\uFFFD\u03F2\uFFFDID
fire-rescue
=
1432549862557130753
\ No newline at end of file
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