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
1b614da7
Commit
1b614da7
authored
Aug 23, 2023
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.机器人
parent
19c5eb98
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
315 additions
and
555 deletions
+315
-555
BaseEnterpriseMqTtlListener.java
...le/elevator/biz/listener/BaseEnterpriseMqTtlListener.java
+0
-0
CarcylUnitInspectMqTtlListener.java
...elevator/biz/listener/CarcylUnitInspectMqTtlListener.java
+5
-8
PlatformUserTopicMessage.java
...odule/elevator/biz/listener/PlatformUserTopicMessage.java
+5
-11
PrivilegeCompanyUpdateAddListener.java
...vator/biz/listener/PrivilegeCompanyUpdateAddListener.java
+22
-26
StartPlatformTokenService.java
.../elevator/biz/service/impl/StartPlatformTokenService.java
+11
-31
TzBaseEnterpriseInfoServiceImpl.java
...tor/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+0
-0
application.properties
...odule-96333-biz/src/main/resources/application.properties
+1
-5
StartPlatformTokenService.java
...odule/app/biz/service/impl/StartPlatformTokenService.java
+11
-22
TzBaseEnterpriseInfoServiceImpl.java
...app/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+6
-45
application.properties
...-module-app-biz/src/main/resources/application.properties
+1
-5
StartPlatformTokenService.java
.../cylinder/biz/service/impl/StartPlatformTokenService.java
+9
-28
TzBaseEnterpriseInfoServiceImpl.java
...der/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+0
-0
application.properties
...le-cylinder-biz/src/main/resources/application.properties
+1
-5
PrivilegeCompanyUpdateAddListener.java
.../jczs/biz/listener/PrivilegeCompanyUpdateAddListener.java
+4
-7
StartPlatformTokenService.java
...dule/jczs/biz/service/impl/StartPlatformTokenService.java
+11
-31
TzBaseEnterpriseInfoServiceImpl.java
...czs/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+0
-0
application.properties
...module-jczs-biz/src/main/resources/application.properties
+1
-5
BaseEnterpriseMqTtlListener.java
.../module/tcm/biz/listener/BaseEnterpriseMqTtlListener.java
+0
-0
CarcylUnitInspectMqTtlListener.java
...dule/tcm/biz/listener/CarcylUnitInspectMqTtlListener.java
+75
-81
PlatformUserTopicMessage.java
...oot/module/tcm/biz/listener/PlatformUserTopicMessage.java
+5
-11
PrivilegeCompanyUpdateAddListener.java
...e/tcm/biz/listener/PrivilegeCompanyUpdateAddListener.java
+22
-25
application.properties
...-module-tcm-biz/src/main/resources/application.properties
+1
-5
BaseEnterpriseMqTtlListener.java
.../module/ymt/biz/listener/BaseEnterpriseMqTtlListener.java
+5
-8
CarcylUnitInspectMqTtlListener.java
...dule/ymt/biz/listener/CarcylUnitInspectMqTtlListener.java
+75
-81
PlatformUserTopicMessage.java
...oot/module/ymt/biz/listener/PlatformUserTopicMessage.java
+5
-11
PrivilegeCompanyUpdateAddListener.java
...e/ymt/biz/listener/PrivilegeCompanyUpdateAddListener.java
+22
-26
StartPlatformTokenService.java
...odule/ymt/biz/service/impl/StartPlatformTokenService.java
+10
-30
TzBaseEnterpriseInfoServiceImpl.java
...ymt/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+6
-43
application.properties
...-module-ymt-biz/src/main/resources/application.properties
+1
-5
No files found.
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/listener/BaseEnterpriseMqTtlListener.java
View file @
1b614da7
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/listener/CarcylUnitInspectMqTtlListener.java
View file @
1b614da7
...
@@ -6,6 +6,7 @@ import java.util.List;
...
@@ -6,6 +6,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.StartPlatformTokenService
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -36,16 +37,14 @@ public class CarcylUnitInspectMqTtlListener extends EmqxListener {
...
@@ -36,16 +37,14 @@ public class CarcylUnitInspectMqTtlListener extends EmqxListener {
@Value
(
"${amos.secret.key}"
)
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
String
secretKey
;
@Value
(
"${amos.system.user.product:AMOS_STUDIO_WEB}"
)
String
product
;
@Value
(
"${amos.system.user.app-key:AMOS_STUDIO}"
)
String
appkey
;
@Autowired
@Autowired
RedisUtil
redisUtil
;
RedisUtil
redisUtil
;
@Value
(
"${org.filter.group.seq}"
)
@Value
(
"${org.filter.group.seq}"
)
private
Long
groupSeq
;
private
Long
groupSeq
;
@Autowired
StartPlatformTokenService
platformTokenService
;
@Override
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
...
@@ -56,9 +55,7 @@ public class CarcylUnitInspectMqTtlListener extends EmqxListener {
...
@@ -56,9 +55,7 @@ public class CarcylUnitInspectMqTtlListener extends EmqxListener {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"公司同步消息解析失败"
);
throw
new
Exception
(
"公司同步消息解析失败"
);
}
}
RequestContext
.
setAppKey
(
appkey
);
platformTokenService
.
getToken
();
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
FeignClientResult
<
List
<
ApplicationModel
>>
aResult
=
Privilege
.
applicationClient
.
queryAgencyApplications
();
FeignClientResult
<
List
<
ApplicationModel
>>
aResult
=
Privilege
.
applicationClient
.
queryAgencyApplications
();
List
<
ApplicationModel
>
aList
=
aResult
.
getResult
();
List
<
ApplicationModel
>
aList
=
aResult
.
getResult
();
List
<
String
>
appCodes
=
aList
.
stream
().
filter
(
i
->
"监管端,企业端"
.
indexOf
(
i
.
getAppName
())
!=
-
1
)
List
<
String
>
appCodes
=
aList
.
stream
().
filter
(
i
->
"监管端,企业端"
.
indexOf
(
i
.
getAppName
())
!=
-
1
)
...
...
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/listener/PlatformUserTopicMessage.java
View file @
1b614da7
...
@@ -5,18 +5,16 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,18 +5,16 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.elevator.flc.api.service.IRegUnitInfoService
;
import
com.yeejoin.amos.boot.module.elevator.flc.api.service.IRegUnitInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
@Component
@Component
...
@@ -40,11 +38,6 @@ public class PlatformUserTopicMessage extends EmqxListener {
...
@@ -40,11 +38,6 @@ public class PlatformUserTopicMessage extends EmqxListener {
@Autowired
@Autowired
RedisUtils
redisUtil
;
RedisUtils
redisUtil
;
@Value
(
"${amos.system.user.product:AMOS_STUDIO_WEB}"
)
String
product
;
@Value
(
"${amos.system.user.app-key:AMOS_STUDIO}"
)
String
appKey
;
@Autowired
@Autowired
IEquipmentCategoryService
equipmentCategoryService
;
IEquipmentCategoryService
equipmentCategoryService
;
...
@@ -52,11 +45,12 @@ public class PlatformUserTopicMessage extends EmqxListener {
...
@@ -52,11 +45,12 @@ public class PlatformUserTopicMessage extends EmqxListener {
@Autowired
@Autowired
IRegUnitInfoService
regUnitInfoService
;
IRegUnitInfoService
regUnitInfoService
;
@Autowired
StartPlatformTokenService
platformTokenService
;
@Override
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
{
RequestContext
.
setAppKey
(
appKey
);
platformTokenService
.
getToken
();
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
JSONObject
jsonObject
=
JSON
.
parseObject
(
message
.
toString
());
JSONObject
jsonObject
=
JSON
.
parseObject
(
message
.
toString
());
JSONObject
result
=
jsonObject
.
getJSONObject
(
"result"
);
JSONObject
result
=
jsonObject
.
getJSONObject
(
"result"
);
JSONObject
dataResult
=
result
.
getJSONObject
(
"result"
);
JSONObject
dataResult
=
result
.
getJSONObject
(
"result"
);
...
...
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/listener/PrivilegeCompanyUpdateAddListener.java
View file @
1b614da7
...
@@ -5,10 +5,10 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,10 +5,10 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.TzBaseEnterpriseInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.TzBaseEnterpriseInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.elevator.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.elevator.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.elevator.flc.api.feign.AccessFeignService
;
import
com.yeejoin.amos.boot.module.elevator.flc.api.feign.AccessFeignService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -16,14 +16,15 @@ import org.eclipse.paho.client.mqttv3.MqttMessage;
...
@@ -16,14 +16,15 @@ import org.eclipse.paho.client.mqttv3.MqttMessage;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.Iterator
;
import
java.util.Map
;
@Component
@Component
@Slf4j
@Slf4j
...
@@ -40,11 +41,8 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -40,11 +41,8 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
@Autowired
@Autowired
RedisUtil
redisUtil
;
RedisUtil
redisUtil
;
@Value
(
"${amos.system.user.product:AMOS_STUDIO_WEB}"
)
@Autowired
String
product
;
StartPlatformTokenService
platformTokenService
;
@Value
(
"${amos.system.user.app-key:AMOS_STUDIO}"
)
String
appKey
;
@Override
@Override
public
void
processMessage
(
String
s
,
MqttMessage
message
)
throws
Exception
{
public
void
processMessage
(
String
s
,
MqttMessage
message
)
throws
Exception
{
...
@@ -58,15 +56,13 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -58,15 +56,13 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"公司同步消息解析失败"
);
throw
new
Exception
(
"公司同步消息解析失败"
);
}
}
RequestContext
.
setAppKey
(
appKey
);
platformTokenService
.
getToken
();
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
//判断库中业务tz_base_enterprise_info是否存在
//判断库中业务tz_base_enterprise_info是否存在
QueryWrapper
<
TzBaseEnterpriseInfo
>
queryWrapper
=
new
QueryWrapper
<
TzBaseEnterpriseInfo
>();
QueryWrapper
<
TzBaseEnterpriseInfo
>
queryWrapper
=
new
QueryWrapper
<
TzBaseEnterpriseInfo
>();
queryWrapper
.
eq
(
"use_code"
,
object
.
getString
(
"unit_code"
));
queryWrapper
.
eq
(
"use_code"
,
object
.
getString
(
"unit_code"
));
TzBaseEnterpriseInfo
tzBaseEnterprisePrivilegeInfo
=
tzBaseEnterpriseInfoService
.
getOne
(
queryWrapper
);
TzBaseEnterpriseInfo
tzBaseEnterprisePrivilegeInfo
=
tzBaseEnterpriseInfoService
.
getOne
(
queryWrapper
);
if
(!
ValidationUtil
.
isEmpty
(
tzBaseEnterprisePrivilegeInfo
))
{
if
(!
ValidationUtil
.
isEmpty
(
tzBaseEnterprisePrivilegeInfo
))
{
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
return
;
return
;
}
}
...
@@ -95,14 +91,14 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -95,14 +91,14 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
//业务表更新条件构造器
//业务表更新条件构造器
UpdateWrapper
<
TzBaseEnterpriseInfo
>
updateWrapper
=
new
UpdateWrapper
<>();
UpdateWrapper
<
TzBaseEnterpriseInfo
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"use_code"
,
object
.
getString
(
"unit_code"
));
updateWrapper
.
eq
(
"use_code"
,
object
.
getString
(
"unit_code"
));
String
regCode
=
object
.
getString
(
"reg_code"
);
String
regCode
=
object
.
getString
(
"reg_code"
);
CompanyModel
supervisePrivilegeCompanyModel
;
CompanyModel
supervisePrivilegeCompanyModel
;
if
(!
ValidationUtil
.
isEmpty
(
regCode
))
{
if
(!
ValidationUtil
.
isEmpty
(
regCode
))
{
supervisePrivilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
regCode
).
getResult
();
supervisePrivilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
regCode
).
getResult
();
if
(
ValidationUtil
.
isEmpty
(
supervisePrivilegeCompanyModel
))
{
if
(
ValidationUtil
.
isEmpty
(
supervisePrivilegeCompanyModel
))
{
supervisePrivilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
"610000"
).
getResult
();
supervisePrivilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
"610000"
).
getResult
();
if
(
ValidationUtil
.
isEmpty
(
supervisePrivilegeCompanyModel
))
{
if
(
ValidationUtil
.
isEmpty
(
supervisePrivilegeCompanyModel
))
{
...
@@ -120,37 +116,37 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -120,37 +116,37 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
tzBaseEnterpriseInfo
.
setSuperviseOrgCode
(
supervisePrivilegeCompanyModel
.
getOrgCode
());
tzBaseEnterpriseInfo
.
setSuperviseOrgCode
(
supervisePrivilegeCompanyModel
.
getOrgCode
());
tzBaseEnterpriseInfo
.
setSuperviseOrgName
(
supervisePrivilegeCompanyModel
.
getCompanyName
());
tzBaseEnterpriseInfo
.
setSuperviseOrgName
(
supervisePrivilegeCompanyModel
.
getCompanyName
());
if
(
ValidationUtil
.
isEmpty
(
tzBaseEnterpriseInfo
.
getUnitType
()))
{
if
(
ValidationUtil
.
isEmpty
(
tzBaseEnterpriseInfo
.
getUnitType
()))
{
tzBaseEnterpriseInfo
.
setUnitType
(
""
);
tzBaseEnterpriseInfo
.
setUnitType
(
""
);
}
}
try
{
try
{
if
(
tzBaseEnterprisePrivilegeInfo
==
null
)
{
if
(
tzBaseEnterprisePrivilegeInfo
==
null
)
{
tzBaseEnterpriseInfoService
.
save
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoService
.
save
(
tzBaseEnterpriseInfo
);
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
return
;
return
;
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"【"
+
object
.
getString
(
"unit_name"
)
+
"】许可信息同步【失败】:"
+
e
.
getMessage
());
logger
.
error
(
"【"
+
object
.
getString
(
"unit_name"
)
+
"】许可信息同步【失败】:"
+
e
.
getMessage
());
}
}
}
}
public
Map
<
String
,
CompanyModel
>
getCompanyInfoMap
(
Collection
companyModels
,
Map
<
String
,
CompanyModel
>
map
)
{
public
Map
<
String
,
CompanyModel
>
getCompanyInfoMap
(
Collection
companyModels
,
Map
<
String
,
CompanyModel
>
map
)
{
if
(
companyModels
==
null
)
{
if
(
companyModels
==
null
)
{
return
map
;
return
map
;
}
}
Iterator
iter
=
companyModels
.
iterator
();
Iterator
iter
=
companyModels
.
iterator
();
while
(
iter
.
hasNext
())
{
while
(
iter
.
hasNext
())
{
String
json
=
JSON
.
toJSONString
(
iter
.
next
());
String
json
=
JSON
.
toJSONString
(
iter
.
next
());
CompanyModel
companyModel
=
JSON
.
parseObject
(
json
,
CompanyModel
.
class
);
CompanyModel
companyModel
=
JSON
.
parseObject
(
json
,
CompanyModel
.
class
);
String
code
=
companyModel
.
getCompanyCode
();
String
code
=
companyModel
.
getCompanyCode
();
if
(
code
.
length
()
>=
6
)
{
if
(
code
.
length
()
>=
6
)
{
code
=
code
.
substring
(
0
,
6
);
code
=
code
.
substring
(
0
,
6
);
}
}
map
.
put
(
code
,
companyModel
);
map
.
put
(
code
,
companyModel
);
getCompanyInfoMap
(
companyModel
.
getChildren
(),
map
);
getCompanyInfoMap
(
companyModel
.
getChildren
(),
map
);
}
}
return
map
;
return
map
;
}
}
...
...
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/service/impl/StartPlatformTokenService.java
View file @
1b614da7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
elevator
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
elevator
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.elevator.biz.utils.RedisUtil
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.yeejoin.amos.boot.module.elevator.biz.utils.RedisUtil
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
@Service
@Service
public
class
StartPlatformTokenService
{
public
class
StartPlatformTokenService
{
@Value
(
"${admin.product}"
)
String
product
;
@Value
(
"${admin.appkey}"
)
String
appkey
;
@Value
(
"${admin.user}"
)
String
user
;
@Value
(
"${admin.password}"
)
String
password
;
@Value
(
"${amos.secret.key}"
)
@Autowired
String
secretKey
;
RedisUtil
redisUtil
;
@Autowired
@Autowired
RedisUtil
redisUtil
;
AmosRequestContext
amosRequestContext
;
@Autowired
AmosRequestContext
amosRequestContext
;
public
void
getToken
()
{
public
void
getToken
()
{
RequestContext
.
setProduct
(
product
);
RequestContext
.
setProduct
(
amosRequestContext
.
getProduct
());
RequestContext
.
setAppKey
(
appkey
);
RequestContext
.
setAppKey
(
amosRequestContext
.
getAppKey
());
String
token
=
amosRequestContext
.
getToken
();
RequestContext
.
setToken
(
amosRequestContext
.
getToken
());
System
.
out
.
println
(
"token:"
+
token
);
}
RequestContext
.
setToken
(
token
);
redisUtil
.
set
(
"platform_token"
,
token
);
}
}
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
1b614da7
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/resources/application.properties
View file @
1b614da7
...
@@ -124,11 +124,7 @@ tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
...
@@ -124,11 +124,7 @@ tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
tzs.wechat.test.userId
=
3393279
tzs.wechat.test.userId
=
3393279
admin.product
=
AMOS-SERVICE-ADMIN
admin.appkey
=
AMOS_ADMIN
admin.user
=
admin_tzs
admin.password
=
a1234560
admin.product.web
=
AMOS-WEB-ADMIN
amos.secret.key
=
qazknife4j.production=false
amos.secret.key
=
qazknife4j.production=false
knife4j.production
=
false
knife4j.production
=
false
...
...
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-biz/src/main/java/com/yeejoin/amos/boot/module/app/biz/service/impl/StartPlatformTokenService.java
View file @
1b614da7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
app
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
app
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.app.biz.utils.RedisUtil
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.yeejoin.amos.boot.module.app.biz.utils.RedisUtil
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
@Service
@Service
public
class
StartPlatformTokenService
{
public
class
StartPlatformTokenService
{
@Value
(
"${amos.system.user.product}"
)
@Autowired
String
product
;
RedisUtil
redisUtil
;
@Value
(
"${amos.system.user.app-key}"
)
@Autowired
String
appkey
;
AmosRequestContext
amosRequestContext
;
@Autowired
public
void
getToken
()
{
RedisUtil
redisUtil
;
RequestContext
.
setProduct
(
amosRequestContext
.
getProduct
());
RequestContext
.
setAppKey
(
amosRequestContext
.
getAppKey
());
@Autowired
RequestContext
.
setToken
(
amosRequestContext
.
getToken
());
AmosRequestContext
amosRequestContext
;
}
public
void
getToken
()
{
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appkey
);
String
token
=
amosRequestContext
.
getToken
();
System
.
out
.
println
(
"token:"
+
token
);
RequestContext
.
setToken
(
token
);
redisUtil
.
set
(
"platform_token"
,
token
);
}
}
}
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-biz/src/main/java/com/yeejoin/amos/boot/module/app/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
1b614da7
...
@@ -64,15 +64,6 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -64,15 +64,6 @@ public class TzBaseEnterpriseInfoServiceImpl
@Autowired
@Autowired
RedisUtil
redisUtil
;
RedisUtil
redisUtil
;
@Value
(
"${admin.product}"
)
String
product
;
@Value
(
"${admin.product.web}"
)
String
webProduct
;
@Value
(
"${admin.appkey}"
)
String
appkey
;
@Autowired
@Autowired
private
TzBaseEnterpriseInfoMapper
tzBaseEnterpriseInfoMapper
;
private
TzBaseEnterpriseInfoMapper
tzBaseEnterpriseInfoMapper
;
...
@@ -87,34 +78,20 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -87,34 +78,20 @@ public class TzBaseEnterpriseInfoServiceImpl
RegUnitInfoServiceImpl
regUnitInfoService
;
RegUnitInfoServiceImpl
regUnitInfoService
;
@Autowired
@Autowired
private
IBaseUnitLicenceService
iBaseUnitLicenceService
;
@Autowired
private
SpeUseUnitServiceImpl
speUseUnitService
;
private
SpeUseUnitServiceImpl
speUseUnitService
;
@Autowired
@Autowired
private
AccessFeignService
accessFeignService
;
private
AccessFeignService
accessFeignService
;
@Autowired
@Autowired
private
ITzBaseEnterpriseInfoService
tzBaseEnterpriseInfoService
;
@Autowired
DataDictionaryServiceImpl
iDataDictionaryService
;
DataDictionaryServiceImpl
iDataDictionaryService
;
@Autowired
@Autowired
RegUnitInfoMapper
regUnitInfoMapper
;
RegUnitInfoMapper
regUnitInfoMapper
;
@Value
(
"${tzs.admin.name:tzs_admin}"
)
private
String
tzsAdminName
;
@Value
(
"${tzs.admin.pwd:a1234567}"
)
private
String
tzsAdminPwd
;
@Value
(
"${redis.cache.failure.time}"
)
@Value
(
"${redis.cache.failure.time}"
)
private
Long
redisRegionTimeSecond
;
private
Long
redisRegionTimeSecond
;
/**机器人用户token缓存key */
public
static
final
String
TZS_USER_TOKEN
=
"TZS_USER_TOKEN"
;
/**
/**
* 企业管理员变更缓存key前缀
* 企业管理员变更缓存key前缀
*/
*/
...
@@ -122,6 +99,9 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -122,6 +99,9 @@ public class TzBaseEnterpriseInfoServiceImpl
@Autowired
@Autowired
private
EquipmentCategoryServiceImpl
equipmentCategoryService
;
private
EquipmentCategoryServiceImpl
equipmentCategoryService
;
@Autowired
StartPlatformTokenService
platformTokenService
;
@Override
@Override
public
List
<
EquEnterDto
>
getInfo
(
String
sequenceNbr
)
{
public
List
<
EquEnterDto
>
getInfo
(
String
sequenceNbr
)
{
return
tzBaseEnterpriseInfoMapper
.
getInfo
(
sequenceNbr
);
return
tzBaseEnterpriseInfoMapper
.
getInfo
(
sequenceNbr
);
...
@@ -315,9 +295,7 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -315,9 +295,7 @@ public class TzBaseEnterpriseInfoServiceImpl
@Override
@Override
public
String
syncEnterpriseInfo
()
{
public
String
syncEnterpriseInfo
()
{
RequestContext
.
setAppKey
(
appkey
);
platformTokenService
.
getToken
();
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
List
<
TzBaseEnterpriseInfo
>
baseEnterpriseInfoList
=
new
ArrayList
<>();
List
<
TzBaseEnterpriseInfo
>
baseEnterpriseInfoList
=
new
ArrayList
<>();
...
@@ -540,16 +518,11 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -540,16 +518,11 @@ public class TzBaseEnterpriseInfoServiceImpl
return
String
.
join
(
","
,
res
);
return
String
.
join
(
","
,
res
);
}
}
@Override
public
Map
<
String
,
Object
>
adminInfoUpdate
(
Map
<
String
,
Object
>
map
)
{
public
Map
<
String
,
Object
>
adminInfoUpdate
(
Map
<
String
,
Object
>
map
)
{
//每一个企业只有一个管理员,所以当前登录用户即管理员用户
//每一个企业只有一个管理员,所以当前登录用户即管理员用户
AgencyUserModel
me
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
AgencyUserModel
me
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
RequestContext
.
setAppKey
(
appkey
);
platformTokenService
.
getToken
();
RequestContext
.
setProduct
(
webProduct
);
//获取机器人的token,获取不到则去登录
if
(
ObjectUtils
.
isEmpty
(
redisUtil
.
get
(
TZS_USER_TOKEN
)))
{
loginCtiUser
();
}
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
TZS_USER_TOKEN
)));
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
if
(!
ObjectUtils
.
isEmpty
(
me
))
{
if
(!
ObjectUtils
.
isEmpty
(
me
))
{
RegUnitInfo
regUnitInfo
=
new
RegUnitInfo
();
RegUnitInfo
regUnitInfo
=
new
RegUnitInfo
();
...
@@ -574,18 +547,6 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -574,18 +547,6 @@ public class TzBaseEnterpriseInfoServiceImpl
return
resultMap
;
return
resultMap
;
}
}
//机器人用户登录
private
void
loginCtiUser
()
{
String
passwd
=
DesUtil
.
encode
(
tzsAdminPwd
,
"qaz"
);
IdPasswordAuthModel
loninData
=
new
IdPasswordAuthModel
();
loninData
.
setLoginId
(
tzsAdminName
);
loninData
.
setPassword
(
passwd
);
FeignClientResult
loginResult
=
Privilege
.
authClient
.
idpassword
(
loninData
);
if
(
loginResult
.
getStatus
()
==
200
)
{
HashMap
resultMap
=
(
HashMap
)
loginResult
.
getResult
();
redisUtil
.
set
(
TZS_USER_TOKEN
,
resultMap
.
get
(
"token"
).
toString
(),
redisRegionTimeSecond
);
}
}
public
void
setSpeUseUnitState
(
int
state
,
SpeUseUnit
speUseUnit
){
public
void
setSpeUseUnitState
(
int
state
,
SpeUseUnit
speUseUnit
){
...
...
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-biz/src/main/resources/application.properties
View file @
1b614da7
...
@@ -124,11 +124,7 @@ tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
...
@@ -124,11 +124,7 @@ tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
tzs.wechat.test.userId
=
3393279
tzs.wechat.test.userId
=
3393279
admin.product
=
AMOS-SERVICE-ADMIN
admin.appkey
=
AMOS_ADMIN
admin.user
=
admin_tzs
admin.password
=
a1234560
admin.product.web
=
AMOS-WEB-ADMIN
amos.secret.key
=
qazknife4j.production=false
amos.secret.key
=
qazknife4j.production=false
knife4j.production
=
false
knife4j.production
=
false
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/biz/service/impl/StartPlatformTokenService.java
View file @
1b614da7
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.cylinder.biz.service.impl;
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.cylinder.biz.service.impl;
import
com.yeejoin.amos.boot.module.cylinder.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.cylinder.biz.utils.RedisUtil
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
...
@@ -11,34 +10,16 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
...
@@ -11,34 +10,16 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
@Service
@Service
public
class
StartPlatformTokenService
{
public
class
StartPlatformTokenService
{
@Value
(
"${admin.product}"
)
@Autowired
String
product
;
RedisUtil
redisUtil
;
@Value
(
"${admin.appkey}"
)
String
appkey
;
@Value
(
"${admin.user}"
)
String
user
;
@Value
(
"${admin.password}"
)
String
password
;
@Value
(
"${amos.secret.key}"
)
@Autowired
String
secretKey
;
AmosRequestContext
amosRequestContext
;
@Autowired
RedisUtil
redisUtil
;
@Autowired
AmosRequestContext
amosRequestContext
;
public
void
getToken
()
{
public
void
getToken
()
{
RequestContext
.
setProduct
(
product
);
RequestContext
.
setProduct
(
amosRequestContext
.
getProduct
());
RequestContext
.
setAppKey
(
appkey
);
RequestContext
.
setAppKey
(
amosRequestContext
.
getAppKey
());
String
token
=
amosRequestContext
.
getToken
();
RequestContext
.
setToken
(
amosRequestContext
.
getToken
());
System
.
out
.
println
(
"token:"
+
token
);
}
RequestContext
.
setToken
(
token
);
redisUtil
.
set
(
"platform_token"
,
token
);
}
}
}
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
1b614da7
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/resources/application.properties
View file @
1b614da7
...
@@ -124,11 +124,7 @@ tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
...
@@ -124,11 +124,7 @@ tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
tzs.wechat.test.userId
=
3393279
tzs.wechat.test.userId
=
3393279
admin.product
=
AMOS-SERVICE-ADMIN
admin.appkey
=
AMOS_ADMIN
admin.user
=
admin_tzs
admin.password
=
a1234560
admin.product.web
=
AMOS-WEB-ADMIN
amos.secret.key
=
qazknife4j.production=false
amos.secret.key
=
qazknife4j.production=false
knife4j.production
=
false
knife4j.production
=
false
...
...
amos-boot-system-tzs/amos-boot-module-jczs/amos-boot-module-jczs-biz/src/main/java/com/yeejoin/amos/boot/module/jczs/biz/listener/PrivilegeCompanyUpdateAddListener.java
View file @
1b614da7
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.yeejoin.amos.boot.module.jczs.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.jczs.biz.service.impl.TzBaseEnterpriseInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.jczs.biz.service.impl.TzBaseEnterpriseInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.jczs.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.jczs.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.jczs.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.jczs.biz.utils.RedisUtil
;
...
@@ -40,11 +41,9 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -40,11 +41,9 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
@Autowired
@Autowired
RedisUtil
redisUtil
;
RedisUtil
redisUtil
;
@Value
(
"${amos.system.user.product:AMOS_STUDIO_WEB}"
)
String
product
;
@
Value
(
"${amos.system.user.app-key:AMOS_STUDIO}"
)
@
Autowired
St
ring
appKey
;
St
artPlatformTokenService
platformTokenService
;
@Override
@Override
public
void
processMessage
(
String
s
,
MqttMessage
message
)
throws
Exception
{
public
void
processMessage
(
String
s
,
MqttMessage
message
)
throws
Exception
{
...
@@ -58,9 +57,7 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -58,9 +57,7 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"公司同步消息解析失败"
);
throw
new
Exception
(
"公司同步消息解析失败"
);
}
}
RequestContext
.
setAppKey
(
appKey
);
platformTokenService
.
getToken
();
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
//判断库中业务tz_base_enterprise_info是否存在
//判断库中业务tz_base_enterprise_info是否存在
QueryWrapper
<
TzBaseEnterpriseInfo
>
queryWrapper
=
new
QueryWrapper
<
TzBaseEnterpriseInfo
>();
QueryWrapper
<
TzBaseEnterpriseInfo
>
queryWrapper
=
new
QueryWrapper
<
TzBaseEnterpriseInfo
>();
...
...
amos-boot-system-tzs/amos-boot-module-jczs/amos-boot-module-jczs-biz/src/main/java/com/yeejoin/amos/boot/module/jczs/biz/service/impl/StartPlatformTokenService.java
View file @
1b614da7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jczs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jczs
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jczs.biz.utils.RedisUtil
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.yeejoin.amos.boot.module.jczs.biz.utils.RedisUtil
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
@Service
@Service
public
class
StartPlatformTokenService
{
public
class
StartPlatformTokenService
{
@Value
(
"${admin.product}"
)
@Autowired
String
product
;
RedisUtil
redisUtil
;
@Value
(
"${admin.appkey}"
)
String
appkey
;
@Value
(
"${admin.user}"
)
String
user
;
@Value
(
"${admin.password}"
)
String
password
;
@Value
(
"${amos.secret.key}"
)
@Autowired
String
secretKey
;
AmosRequestContext
amosRequestContext
;
@Autowired
RedisUtil
redisUtil
;
@Autowired
AmosRequestContext
amosRequestContext
;
public
void
getToken
()
{
public
void
getToken
()
{
RequestContext
.
setProduct
(
product
);
RequestContext
.
setProduct
(
amosRequestContext
.
getProduct
());
RequestContext
.
setAppKey
(
appkey
);
RequestContext
.
setAppKey
(
amosRequestContext
.
getAppKey
());
String
token
=
amosRequestContext
.
getToken
();
RequestContext
.
setToken
(
amosRequestContext
.
getToken
());
System
.
out
.
println
(
"token:"
+
token
);
}
RequestContext
.
setToken
(
token
);
redisUtil
.
set
(
"platform_token"
,
token
);
}
}
}
amos-boot-system-tzs/amos-boot-module-jczs/amos-boot-module-jczs-biz/src/main/java/com/yeejoin/amos/boot/module/jczs/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
1b614da7
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-jczs/amos-boot-module-jczs-biz/src/main/resources/application.properties
View file @
1b614da7
...
@@ -122,11 +122,7 @@ tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
...
@@ -122,11 +122,7 @@ tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
tzs.wechat.test.userId
=
3393279
tzs.wechat.test.userId
=
3393279
admin.product
=
AMOS-SERVICE-ADMIN
admin.appkey
=
AMOS_ADMIN
admin.user
=
admin_tzs
admin.password
=
a1234560
admin.product.web
=
AMOS-WEB-ADMIN
amos.secret.key
=
qazknife4j.production=false
amos.secret.key
=
qazknife4j.production=false
knife4j.production
=
false
knife4j.production
=
false
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/listener/BaseEnterpriseMqTtlListener.java
View file @
1b614da7
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/listener/CarcylUnitInspectMqTtlListener.java
View file @
1b614da7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
listener
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
listener
;
import
java.util.ArrayList
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.HashMap
;
import
com.yeejoin.amos.boot.module.tcm.biz.service.impl.StartPlatformTokenService
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.tcm.biz.utils.DesUtil
;
import
com.yeejoin.amos.boot.module.tcm.biz.utils.DesUtil
;
import
com.yeejoin.amos.boot.module.tcm.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.tcm.biz.utils.RedisUtil
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.ApplicationModel
;
import
com.yeejoin.amos.feign.privilege.model.ApplicationModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* @Description: mqtt监听服务
* @Description: mqtt监听服务
...
@@ -33,78 +31,74 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -33,78 +31,74 @@ import lombok.extern.slf4j.Slf4j;
@Component
@Component
@Slf4j
@Slf4j
public
class
CarcylUnitInspectMqTtlListener
extends
EmqxListener
{
public
class
CarcylUnitInspectMqTtlListener
extends
EmqxListener
{
@Value
(
"${amos.secret.key}"
)
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
String
secretKey
;
@Value
(
"${amos.system.user.product:AMOS_STUDIO_WEB}"
)
String
product
;
@Value
(
"${amos.system.user.app-key:AMOS_STUDIO}"
)
@Autowired
String
appkey
;
@Autowired
RedisUtil
redisUtil
;
RedisUtil
redisUtil
;
@Value
(
"${org.filter.group.seq}"
)
@Value
(
"${org.filter.group.seq}"
)
private
Long
groupSeq
;
private
Long
groupSeq
;
@Override
@Autowired
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
StartPlatformTokenService
platformTokenService
;
System
.
out
.
println
(
message
);
JSONObject
object
=
null
;
@Override
try
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
object
=
JSONObject
.
parseObject
(
message
.
toString
());
System
.
out
.
println
(
message
);
}
catch
(
Exception
e
)
{
JSONObject
object
=
null
;
throw
new
Exception
(
"公司同步消息解析失败"
);
try
{
}
object
=
JSONObject
.
parseObject
(
message
.
toString
());
RequestContext
.
setAppKey
(
appkey
);
}
catch
(
Exception
e
)
{
RequestContext
.
setProduct
(
product
);
throw
new
Exception
(
"公司同步消息解析失败"
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
}
FeignClientResult
<
List
<
ApplicationModel
>>
aResult
=
Privilege
.
applicationClient
.
queryAgencyApplications
();
platformTokenService
.
setRequestContext
();
List
<
ApplicationModel
>
aList
=
aResult
.
getResult
();
FeignClientResult
<
List
<
ApplicationModel
>>
aResult
=
Privilege
.
applicationClient
.
queryAgencyApplications
();
List
<
String
>
appCodes
=
aList
.
stream
().
filter
(
i
->
"监管端,企业端"
.
indexOf
(
i
.
getAppName
())
!=
-
1
)
List
<
ApplicationModel
>
aList
=
aResult
.
getResult
();
.
map
(
i
->
i
.
getAppCode
()).
collect
(
Collectors
.
toList
());
List
<
String
>
appCodes
=
aList
.
stream
().
filter
(
i
->
"监管端,企业端"
.
indexOf
(
i
.
getAppName
())
!=
-
1
)
.
map
(
i
->
i
.
getAppCode
()).
collect
(
Collectors
.
toList
());
String
uuid
=
object
.
getString
(
"id"
);
String
uuid
=
object
.
getString
(
"id"
);
Long
id
=
Long
.
valueOf
(
uuid
.
replaceAll
(
"-"
,
""
).
hashCode
());
Long
id
=
Long
.
valueOf
(
uuid
.
replaceAll
(
"-"
,
""
).
hashCode
());
FeignClientResult
<
CompanyModel
>
cResult
=
Privilege
.
companyClient
.
seleteOne
(
id
);
FeignClientResult
<
CompanyModel
>
cResult
=
Privilege
.
companyClient
.
seleteOne
(
id
);
if
(
cResult
.
getResult
()
==
null
)
{
if
(
cResult
.
getResult
()
==
null
)
{
CompanyModel
companyModel
=
new
CompanyModel
();
CompanyModel
companyModel
=
new
CompanyModel
();
companyModel
.
setCompanyName
(
object
.
getString
(
"inspect_unit_name"
));
companyModel
.
setCompanyName
(
object
.
getString
(
"inspect_unit_name"
));
companyModel
.
setParentId
(
0L
);
companyModel
.
setParentId
(
0L
);
companyModel
.
setLevel
(
"company"
);
companyModel
.
setLevel
(
"company"
);
companyModel
.
setSequenceNbr
(
id
);
companyModel
.
setSequenceNbr
(
id
);
companyModel
.
setCompanyCode
(
object
.
getString
(
"org_unit_name"
));
companyModel
.
setCompanyCode
(
object
.
getString
(
"org_unit_name"
));
companyModel
.
setCompanyType
(
"检验单位"
);
companyModel
.
setCompanyType
(
"检验单位"
);
Privilege
.
companyClient
.
create
(
companyModel
);
Privilege
.
companyClient
.
create
(
companyModel
);
}
}
String
unitCode
=
object
.
getString
(
"org_unit_name"
);
String
unitCode
=
object
.
getString
(
"org_unit_name"
);
if
(
unitCode
==
null
||
unitCode
.
length
()
<
6
)
{
if
(
unitCode
==
null
||
unitCode
.
length
()
<
6
)
{
log
.
error
(
"公司统一信用代码长度不够6位"
);
log
.
error
(
"公司统一信用代码长度不够6位"
);
throw
new
Exception
(
"公司统一信用代码长度不够6位"
);
throw
new
Exception
(
"公司统一信用代码长度不够6位"
);
}
}
String
userName
=
unitCode
.
substring
(
unitCode
.
length
()
-
6
,
unitCode
.
length
());
String
userName
=
unitCode
.
substring
(
unitCode
.
length
()
-
6
,
unitCode
.
length
());
FeignClientResult
<
AgencyUserModel
>
uResult
=
Privilege
.
agencyUserClient
.
queryByUserName
(
userName
);
FeignClientResult
<
AgencyUserModel
>
uResult
=
Privilege
.
agencyUserClient
.
queryByUserName
(
userName
);
if
(
uResult
.
getResult
()
==
null
)
{
if
(
uResult
.
getResult
()
==
null
)
{
AgencyUserModel
userModel
=
new
AgencyUserModel
();
AgencyUserModel
userModel
=
new
AgencyUserModel
();
userModel
.
setUserName
(
userName
);
userModel
.
setUserName
(
userName
);
userModel
.
setRealName
(
userName
);
userModel
.
setRealName
(
userName
);
userModel
.
setPassword
(
DesUtil
.
encode
(
userName
,
secretKey
));
userModel
.
setPassword
(
DesUtil
.
encode
(
userName
,
secretKey
));
userModel
.
setRePassword
(
DesUtil
.
encode
(
userName
,
secretKey
));
userModel
.
setRePassword
(
DesUtil
.
encode
(
userName
,
secretKey
));
// userModel.setMobile(vo.getPhoneNo());
// userModel.setMobile(vo.getPhoneNo());
userModel
.
setLockStatus
(
"UNLOCK"
);
userModel
.
setLockStatus
(
"UNLOCK"
);
FeignClientResult
<
List
<
RoleModel
>>
list
=
Privilege
.
roleClient
.
queryRoleList
(
"检验单位"
,
"admin"
);
FeignClientResult
<
List
<
RoleModel
>>
list
=
Privilege
.
roleClient
.
queryRoleList
(
"检验单位"
,
"admin"
);
Map
<
Long
,
List
<
Long
>>
orgRoles
=
new
HashMap
<>();
Map
<
Long
,
List
<
Long
>>
orgRoles
=
new
HashMap
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
roleIds
.
add
(
list
.
getResult
().
get
(
0
).
getSequenceNbr
());
roleIds
.
add
(
list
.
getResult
().
get
(
0
).
getSequenceNbr
());
orgRoles
.
put
(
id
,
roleIds
);
orgRoles
.
put
(
id
,
roleIds
);
userModel
.
setAppCodes
(
appCodes
);
userModel
.
setAppCodes
(
appCodes
);
userModel
.
setOrgRoleSeqs
(
orgRoles
);
userModel
.
setOrgRoleSeqs
(
orgRoles
);
FeignClientResult
<
AgencyUserModel
>
userResult
=
Privilege
.
agencyUserClient
.
create
(
userModel
);
FeignClientResult
<
AgencyUserModel
>
userResult
=
Privilege
.
agencyUserClient
.
create
(
userModel
);
String
[]
userIds
=
{
userResult
.
getResult
().
getUserId
()};
String
[]
userIds
=
{
userResult
.
getResult
().
getUserId
()};
// if (groupSeq != null) {
// if (groupSeq != null) {
// Privilege.groupUserClient.create(groupSeq, Arrays.asList(userIds));
// Privilege.groupUserClient.create(groupSeq, Arrays.asList(userIds));
// }
// }
}
}
}
}
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/listener/PlatformUserTopicMessage.java
View file @
1b614da7
...
@@ -5,16 +5,15 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,16 +5,15 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.tcm.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.tcm.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.tcm.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.tcm.flc.api.service.IRegUnitInfoService
;
import
com.yeejoin.amos.boot.module.tcm.flc.api.service.IRegUnitInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -39,23 +38,18 @@ public class PlatformUserTopicMessage extends EmqxListener {
...
@@ -39,23 +38,18 @@ public class PlatformUserTopicMessage extends EmqxListener {
@Autowired
@Autowired
RedisUtils
redisUtil
;
RedisUtils
redisUtil
;
@Value
(
"${amos.system.user.product:AMOS_STUDIO_WEB}"
)
String
product
;
@Value
(
"${amos.system.user.app-key:AMOS_STUDIO}"
)
String
appKey
;
@Autowired
@Autowired
IEquipmentCategoryService
equipmentCategoryService
;
IEquipmentCategoryService
equipmentCategoryService
;
@Autowired
@Autowired
IRegUnitInfoService
regUnitInfoService
;
IRegUnitInfoService
regUnitInfoService
;
@Autowired
StartPlatformTokenService
platformTokenService
;
@Override
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
{
RequestContext
.
setAppKey
(
appKey
);
platformTokenService
.
setRequestContext
();
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
JSONObject
jsonObject
=
JSON
.
parseObject
(
message
.
toString
());
JSONObject
jsonObject
=
JSON
.
parseObject
(
message
.
toString
());
JSONObject
result
=
jsonObject
.
getJSONObject
(
"result"
);
JSONObject
result
=
jsonObject
.
getJSONObject
(
"result"
);
JSONObject
dataResult
=
result
.
getJSONObject
(
"result"
);
JSONObject
dataResult
=
result
.
getJSONObject
(
"result"
);
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/listener/PrivilegeCompanyUpdateAddListener.java
View file @
1b614da7
...
@@ -5,10 +5,10 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,10 +5,10 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tcm.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzBaseEnterpriseInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzBaseEnterpriseInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.tcm.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.tcm.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.tcm.flc.api.feign.AccessFeignService
;
import
com.yeejoin.amos.boot.module.tcm.flc.api.feign.AccessFeignService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -16,14 +16,16 @@ import org.eclipse.paho.client.mqttv3.MqttMessage;
...
@@ -16,14 +16,16 @@ import org.eclipse.paho.client.mqttv3.MqttMessage;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.Iterator
;
import
java.util.Map
;
@Component
@Component
@Slf4j
@Slf4j
...
@@ -40,11 +42,8 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -40,11 +42,8 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
@Autowired
@Autowired
RedisUtil
redisUtil
;
RedisUtil
redisUtil
;
@Value
(
"${amos.system.user.product:AMOS_STUDIO_WEB}"
)
@Autowired
String
product
;
StartPlatformTokenService
platformTokenService
;
@Value
(
"${amos.system.user.app-key:AMOS_STUDIO}"
)
String
appKey
;
@Override
@Override
public
void
processMessage
(
String
s
,
MqttMessage
message
)
throws
Exception
{
public
void
processMessage
(
String
s
,
MqttMessage
message
)
throws
Exception
{
...
@@ -58,15 +57,13 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -58,15 +57,13 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"公司同步消息解析失败"
);
throw
new
Exception
(
"公司同步消息解析失败"
);
}
}
RequestContext
.
setAppKey
(
appKey
);
platformTokenService
.
setRequestContext
();
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
//判断库中业务tz_base_enterprise_info是否存在
//判断库中业务tz_base_enterprise_info是否存在
QueryWrapper
<
TzBaseEnterpriseInfo
>
queryWrapper
=
new
QueryWrapper
<
TzBaseEnterpriseInfo
>();
QueryWrapper
<
TzBaseEnterpriseInfo
>
queryWrapper
=
new
QueryWrapper
<
TzBaseEnterpriseInfo
>();
queryWrapper
.
eq
(
"use_code"
,
object
.
getString
(
"unit_code"
));
queryWrapper
.
eq
(
"use_code"
,
object
.
getString
(
"unit_code"
));
TzBaseEnterpriseInfo
tzBaseEnterprisePrivilegeInfo
=
tzBaseEnterpriseInfoService
.
getOne
(
queryWrapper
);
TzBaseEnterpriseInfo
tzBaseEnterprisePrivilegeInfo
=
tzBaseEnterpriseInfoService
.
getOne
(
queryWrapper
);
if
(!
ValidationUtil
.
isEmpty
(
tzBaseEnterprisePrivilegeInfo
))
{
if
(!
ValidationUtil
.
isEmpty
(
tzBaseEnterprisePrivilegeInfo
))
{
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
return
;
return
;
}
}
...
@@ -95,14 +92,14 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -95,14 +92,14 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
//业务表更新条件构造器
//业务表更新条件构造器
UpdateWrapper
<
TzBaseEnterpriseInfo
>
updateWrapper
=
new
UpdateWrapper
<>();
UpdateWrapper
<
TzBaseEnterpriseInfo
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"use_code"
,
object
.
getString
(
"unit_code"
));
updateWrapper
.
eq
(
"use_code"
,
object
.
getString
(
"unit_code"
));
String
regCode
=
object
.
getString
(
"reg_code"
);
String
regCode
=
object
.
getString
(
"reg_code"
);
CompanyModel
supervisePrivilegeCompanyModel
;
CompanyModel
supervisePrivilegeCompanyModel
;
if
(!
ValidationUtil
.
isEmpty
(
regCode
))
{
if
(!
ValidationUtil
.
isEmpty
(
regCode
))
{
supervisePrivilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
regCode
).
getResult
();
supervisePrivilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
regCode
).
getResult
();
if
(
ValidationUtil
.
isEmpty
(
supervisePrivilegeCompanyModel
))
{
if
(
ValidationUtil
.
isEmpty
(
supervisePrivilegeCompanyModel
))
{
supervisePrivilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
"610000"
).
getResult
();
supervisePrivilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
"610000"
).
getResult
();
if
(
ValidationUtil
.
isEmpty
(
supervisePrivilegeCompanyModel
))
{
if
(
ValidationUtil
.
isEmpty
(
supervisePrivilegeCompanyModel
))
{
...
@@ -120,37 +117,37 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -120,37 +117,37 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
tzBaseEnterpriseInfo
.
setSuperviseOrgCode
(
supervisePrivilegeCompanyModel
.
getOrgCode
());
tzBaseEnterpriseInfo
.
setSuperviseOrgCode
(
supervisePrivilegeCompanyModel
.
getOrgCode
());
tzBaseEnterpriseInfo
.
setSuperviseOrgName
(
supervisePrivilegeCompanyModel
.
getCompanyName
());
tzBaseEnterpriseInfo
.
setSuperviseOrgName
(
supervisePrivilegeCompanyModel
.
getCompanyName
());
if
(
ValidationUtil
.
isEmpty
(
tzBaseEnterpriseInfo
.
getUnitType
()))
{
if
(
ValidationUtil
.
isEmpty
(
tzBaseEnterpriseInfo
.
getUnitType
()))
{
tzBaseEnterpriseInfo
.
setUnitType
(
""
);
tzBaseEnterpriseInfo
.
setUnitType
(
""
);
}
}
try
{
try
{
if
(
tzBaseEnterprisePrivilegeInfo
==
null
)
{
if
(
tzBaseEnterprisePrivilegeInfo
==
null
)
{
tzBaseEnterpriseInfoService
.
save
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoService
.
save
(
tzBaseEnterpriseInfo
);
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
return
;
return
;
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"【"
+
object
.
getString
(
"unit_name"
)
+
"】许可信息同步【失败】:"
+
e
.
getMessage
());
logger
.
error
(
"【"
+
object
.
getString
(
"unit_name"
)
+
"】许可信息同步【失败】:"
+
e
.
getMessage
());
}
}
}
}
public
Map
<
String
,
CompanyModel
>
getCompanyInfoMap
(
Collection
companyModels
,
Map
<
String
,
CompanyModel
>
map
)
{
public
Map
<
String
,
CompanyModel
>
getCompanyInfoMap
(
Collection
companyModels
,
Map
<
String
,
CompanyModel
>
map
)
{
if
(
companyModels
==
null
)
{
if
(
companyModels
==
null
)
{
return
map
;
return
map
;
}
}
Iterator
iter
=
companyModels
.
iterator
();
Iterator
iter
=
companyModels
.
iterator
();
while
(
iter
.
hasNext
())
{
while
(
iter
.
hasNext
())
{
String
json
=
JSON
.
toJSONString
(
iter
.
next
());
String
json
=
JSON
.
toJSONString
(
iter
.
next
());
CompanyModel
companyModel
=
JSON
.
parseObject
(
json
,
CompanyModel
.
class
);
CompanyModel
companyModel
=
JSON
.
parseObject
(
json
,
CompanyModel
.
class
);
String
code
=
companyModel
.
getCompanyCode
();
String
code
=
companyModel
.
getCompanyCode
();
if
(
code
.
length
()
>=
6
)
{
if
(
code
.
length
()
>=
6
)
{
code
=
code
.
substring
(
0
,
6
);
code
=
code
.
substring
(
0
,
6
);
}
}
map
.
put
(
code
,
companyModel
);
map
.
put
(
code
,
companyModel
);
getCompanyInfoMap
(
companyModel
.
getChildren
(),
map
);
getCompanyInfoMap
(
companyModel
.
getChildren
(),
map
);
}
}
return
map
;
return
map
;
}
}
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/resources/application.properties
View file @
1b614da7
...
@@ -132,11 +132,7 @@ tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
...
@@ -132,11 +132,7 @@ tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
tzs.wechat.test.userId
=
3393279
tzs.wechat.test.userId
=
3393279
admin.product
=
AMOS-SERVICE-ADMIN
admin.appkey
=
AMOS_ADMIN
admin.user
=
admin_tzs
admin.password
=
a1234560
admin.product.web
=
AMOS-WEB-ADMIN
amos.secret.key
=
qazknife4j.production=false
amos.secret.key
=
qazknife4j.production=false
knife4j.production
=
false
knife4j.production
=
false
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/listener/BaseEnterpriseMqTtlListener.java
View file @
1b614da7
...
@@ -11,6 +11,7 @@ import java.util.Map;
...
@@ -11,6 +11,7 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.ymt.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.ymt.biz.utils.DesUtil
;
import
com.yeejoin.amos.boot.module.ymt.biz.utils.DesUtil
;
import
com.yeejoin.amos.boot.module.ymt.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.ymt.biz.utils.RedisUtil
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
...
@@ -44,11 +45,6 @@ public class BaseEnterpriseMqTtlListener extends EmqxListener {
...
@@ -44,11 +45,6 @@ public class BaseEnterpriseMqTtlListener extends EmqxListener {
@Value
(
"${amos.secret.key}"
)
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
String
secretKey
;
@Value
(
"${amos.system.user.product:AMOS_STUDIO_WEB}"
)
String
product
;
@Value
(
"${amos.system.user.app-key:AMOS_STUDIO}"
)
String
appkey
;
@Autowired
@Autowired
RedisUtil
redisUtil
;
RedisUtil
redisUtil
;
...
@@ -58,6 +54,9 @@ public class BaseEnterpriseMqTtlListener extends EmqxListener {
...
@@ -58,6 +54,9 @@ public class BaseEnterpriseMqTtlListener extends EmqxListener {
@Value
(
"${org.filter.group.seq}"
)
@Value
(
"${org.filter.group.seq}"
)
private
Long
groupSeq
;
private
Long
groupSeq
;
@Autowired
StartPlatformTokenService
platformTokenService
;
@Override
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
System
.
out
.
println
(
message
);
System
.
out
.
println
(
message
);
...
@@ -67,9 +66,7 @@ public class BaseEnterpriseMqTtlListener extends EmqxListener {
...
@@ -67,9 +66,7 @@ public class BaseEnterpriseMqTtlListener extends EmqxListener {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"公司同步消息解析失败"
);
throw
new
Exception
(
"公司同步消息解析失败"
);
}
}
RequestContext
.
setAppKey
(
appkey
);
platformTokenService
.
getToken
();
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
FeignClientResult
<
List
<
ApplicationModel
>>
aResult
=
Privilege
.
applicationClient
.
queryAgencyApplications
();
FeignClientResult
<
List
<
ApplicationModel
>>
aResult
=
Privilege
.
applicationClient
.
queryAgencyApplications
();
List
<
ApplicationModel
>
aList
=
aResult
.
getResult
();
List
<
ApplicationModel
>
aList
=
aResult
.
getResult
();
// List<String> appCodes = aList.stream().filter(i -> "监管端,企业端".indexOf(i.getAppName()) != -1)
// List<String> appCodes = aList.stream().filter(i -> "监管端,企业端".indexOf(i.getAppName()) != -1)
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/listener/CarcylUnitInspectMqTtlListener.java
View file @
1b614da7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
biz
.
listener
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
biz
.
listener
;
import
java.util.ArrayList
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.HashMap
;
import
com.yeejoin.amos.boot.module.ymt.biz.service.impl.StartPlatformTokenService
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.ymt.biz.utils.DesUtil
;
import
com.yeejoin.amos.boot.module.ymt.biz.utils.DesUtil
;
import
com.yeejoin.amos.boot.module.ymt.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.ymt.biz.utils.RedisUtil
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.ApplicationModel
;
import
com.yeejoin.amos.feign.privilege.model.ApplicationModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* @Description: mqtt监听服务
* @Description: mqtt监听服务
...
@@ -33,78 +31,74 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -33,78 +31,74 @@ import lombok.extern.slf4j.Slf4j;
@Component
@Component
@Slf4j
@Slf4j
public
class
CarcylUnitInspectMqTtlListener
extends
EmqxListener
{
public
class
CarcylUnitInspectMqTtlListener
extends
EmqxListener
{
@Value
(
"${amos.secret.key}"
)
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
String
secretKey
;
@Value
(
"${amos.system.user.product:AMOS_STUDIO_WEB}"
)
String
product
;
@Value
(
"${amos.system.user.app-key:AMOS_STUDIO}"
)
@Autowired
String
appkey
;
@Autowired
RedisUtil
redisUtil
;
RedisUtil
redisUtil
;
@Value
(
"${org.filter.group.seq}"
)
@Value
(
"${org.filter.group.seq}"
)
private
Long
groupSeq
;
private
Long
groupSeq
;
@Override
@Autowired
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
StartPlatformTokenService
platformTokenService
;
System
.
out
.
println
(
message
);
JSONObject
object
=
null
;
@Override
try
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
object
=
JSONObject
.
parseObject
(
message
.
toString
());
System
.
out
.
println
(
message
);
}
catch
(
Exception
e
)
{
JSONObject
object
=
null
;
throw
new
Exception
(
"公司同步消息解析失败"
);
try
{
}
object
=
JSONObject
.
parseObject
(
message
.
toString
());
RequestContext
.
setAppKey
(
appkey
);
}
catch
(
Exception
e
)
{
RequestContext
.
setProduct
(
product
);
throw
new
Exception
(
"公司同步消息解析失败"
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
}
FeignClientResult
<
List
<
ApplicationModel
>>
aResult
=
Privilege
.
applicationClient
.
queryAgencyApplications
();
platformTokenService
.
getToken
();
List
<
ApplicationModel
>
aList
=
aResult
.
getResult
();
FeignClientResult
<
List
<
ApplicationModel
>>
aResult
=
Privilege
.
applicationClient
.
queryAgencyApplications
();
List
<
String
>
appCodes
=
aList
.
stream
().
filter
(
i
->
"监管端,企业端"
.
indexOf
(
i
.
getAppName
())
!=
-
1
)
List
<
ApplicationModel
>
aList
=
aResult
.
getResult
();
.
map
(
i
->
i
.
getAppCode
()).
collect
(
Collectors
.
toList
());
List
<
String
>
appCodes
=
aList
.
stream
().
filter
(
i
->
"监管端,企业端"
.
indexOf
(
i
.
getAppName
())
!=
-
1
)
.
map
(
i
->
i
.
getAppCode
()).
collect
(
Collectors
.
toList
());
String
uuid
=
object
.
getString
(
"id"
);
String
uuid
=
object
.
getString
(
"id"
);
Long
id
=
Long
.
valueOf
(
uuid
.
replaceAll
(
"-"
,
""
).
hashCode
());
Long
id
=
Long
.
valueOf
(
uuid
.
replaceAll
(
"-"
,
""
).
hashCode
());
FeignClientResult
<
CompanyModel
>
cResult
=
Privilege
.
companyClient
.
seleteOne
(
id
);
FeignClientResult
<
CompanyModel
>
cResult
=
Privilege
.
companyClient
.
seleteOne
(
id
);
if
(
cResult
.
getResult
()
==
null
)
{
if
(
cResult
.
getResult
()
==
null
)
{
CompanyModel
companyModel
=
new
CompanyModel
();
CompanyModel
companyModel
=
new
CompanyModel
();
companyModel
.
setCompanyName
(
object
.
getString
(
"inspect_unit_name"
));
companyModel
.
setCompanyName
(
object
.
getString
(
"inspect_unit_name"
));
companyModel
.
setParentId
(
0L
);
companyModel
.
setParentId
(
0L
);
companyModel
.
setLevel
(
"company"
);
companyModel
.
setLevel
(
"company"
);
companyModel
.
setSequenceNbr
(
id
);
companyModel
.
setSequenceNbr
(
id
);
companyModel
.
setCompanyCode
(
object
.
getString
(
"org_unit_name"
));
companyModel
.
setCompanyCode
(
object
.
getString
(
"org_unit_name"
));
companyModel
.
setCompanyType
(
"检验单位"
);
companyModel
.
setCompanyType
(
"检验单位"
);
Privilege
.
companyClient
.
create
(
companyModel
);
Privilege
.
companyClient
.
create
(
companyModel
);
}
}
String
unitCode
=
object
.
getString
(
"org_unit_name"
);
String
unitCode
=
object
.
getString
(
"org_unit_name"
);
if
(
unitCode
==
null
||
unitCode
.
length
()
<
6
)
{
if
(
unitCode
==
null
||
unitCode
.
length
()
<
6
)
{
log
.
error
(
"公司统一信用代码长度不够6位"
);
log
.
error
(
"公司统一信用代码长度不够6位"
);
throw
new
Exception
(
"公司统一信用代码长度不够6位"
);
throw
new
Exception
(
"公司统一信用代码长度不够6位"
);
}
}
String
userName
=
unitCode
.
substring
(
unitCode
.
length
()
-
6
,
unitCode
.
length
());
String
userName
=
unitCode
.
substring
(
unitCode
.
length
()
-
6
,
unitCode
.
length
());
FeignClientResult
<
AgencyUserModel
>
uResult
=
Privilege
.
agencyUserClient
.
queryByUserName
(
userName
);
FeignClientResult
<
AgencyUserModel
>
uResult
=
Privilege
.
agencyUserClient
.
queryByUserName
(
userName
);
if
(
uResult
.
getResult
()
==
null
)
{
if
(
uResult
.
getResult
()
==
null
)
{
AgencyUserModel
userModel
=
new
AgencyUserModel
();
AgencyUserModel
userModel
=
new
AgencyUserModel
();
userModel
.
setUserName
(
userName
);
userModel
.
setUserName
(
userName
);
userModel
.
setRealName
(
userName
);
userModel
.
setRealName
(
userName
);
userModel
.
setPassword
(
DesUtil
.
encode
(
userName
,
secretKey
));
userModel
.
setPassword
(
DesUtil
.
encode
(
userName
,
secretKey
));
userModel
.
setRePassword
(
DesUtil
.
encode
(
userName
,
secretKey
));
userModel
.
setRePassword
(
DesUtil
.
encode
(
userName
,
secretKey
));
// userModel.setMobile(vo.getPhoneNo());
// userModel.setMobile(vo.getPhoneNo());
userModel
.
setLockStatus
(
"UNLOCK"
);
userModel
.
setLockStatus
(
"UNLOCK"
);
FeignClientResult
<
List
<
RoleModel
>>
list
=
Privilege
.
roleClient
.
queryRoleList
(
"检验单位"
,
"admin"
);
FeignClientResult
<
List
<
RoleModel
>>
list
=
Privilege
.
roleClient
.
queryRoleList
(
"检验单位"
,
"admin"
);
Map
<
Long
,
List
<
Long
>>
orgRoles
=
new
HashMap
<>();
Map
<
Long
,
List
<
Long
>>
orgRoles
=
new
HashMap
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
roleIds
.
add
(
list
.
getResult
().
get
(
0
).
getSequenceNbr
());
roleIds
.
add
(
list
.
getResult
().
get
(
0
).
getSequenceNbr
());
orgRoles
.
put
(
id
,
roleIds
);
orgRoles
.
put
(
id
,
roleIds
);
userModel
.
setAppCodes
(
appCodes
);
userModel
.
setAppCodes
(
appCodes
);
userModel
.
setOrgRoleSeqs
(
orgRoles
);
userModel
.
setOrgRoleSeqs
(
orgRoles
);
FeignClientResult
<
AgencyUserModel
>
userResult
=
Privilege
.
agencyUserClient
.
create
(
userModel
);
FeignClientResult
<
AgencyUserModel
>
userResult
=
Privilege
.
agencyUserClient
.
create
(
userModel
);
String
[]
userIds
=
{
userResult
.
getResult
().
getUserId
()};
String
[]
userIds
=
{
userResult
.
getResult
().
getUserId
()};
// if (groupSeq != null) {
// if (groupSeq != null) {
// Privilege.groupUserClient.create(groupSeq, Arrays.asList(userIds));
// Privilege.groupUserClient.create(groupSeq, Arrays.asList(userIds));
// }
// }
}
}
}
}
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/listener/PlatformUserTopicMessage.java
View file @
1b614da7
...
@@ -5,16 +5,15 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,16 +5,15 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.ymt.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.ymt.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.ymt.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.service.IRegUnitInfoService
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.service.IRegUnitInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -39,23 +38,18 @@ public class PlatformUserTopicMessage extends EmqxListener {
...
@@ -39,23 +38,18 @@ public class PlatformUserTopicMessage extends EmqxListener {
@Autowired
@Autowired
RedisUtils
redisUtil
;
RedisUtils
redisUtil
;
@Value
(
"${amos.system.user.product:AMOS_STUDIO_WEB}"
)
String
product
;
@Value
(
"${amos.system.user.app-key:AMOS_STUDIO}"
)
String
appKey
;
@Autowired
@Autowired
IEquipmentCategoryService
equipmentCategoryService
;
IEquipmentCategoryService
equipmentCategoryService
;
@Autowired
@Autowired
IRegUnitInfoService
regUnitInfoService
;
IRegUnitInfoService
regUnitInfoService
;
@Autowired
StartPlatformTokenService
platformTokenService
;
@Override
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
{
RequestContext
.
setAppKey
(
appKey
);
platformTokenService
.
getToken
();
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
JSONObject
jsonObject
=
JSON
.
parseObject
(
message
.
toString
());
JSONObject
jsonObject
=
JSON
.
parseObject
(
message
.
toString
());
JSONObject
result
=
jsonObject
.
getJSONObject
(
"result"
);
JSONObject
result
=
jsonObject
.
getJSONObject
(
"result"
);
JSONObject
dataResult
=
result
.
getJSONObject
(
"result"
);
JSONObject
dataResult
=
result
.
getJSONObject
(
"result"
);
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/listener/PrivilegeCompanyUpdateAddListener.java
View file @
1b614da7
...
@@ -5,10 +5,10 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,10 +5,10 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.ymt.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.ymt.biz.service.impl.TzBaseEnterpriseInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.ymt.biz.service.impl.TzBaseEnterpriseInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.ymt.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.ymt.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.feign.AccessFeignService
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.feign.AccessFeignService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -16,14 +16,15 @@ import org.eclipse.paho.client.mqttv3.MqttMessage;
...
@@ -16,14 +16,15 @@ import org.eclipse.paho.client.mqttv3.MqttMessage;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.Iterator
;
import
java.util.Map
;
@Component
@Component
@Slf4j
@Slf4j
...
@@ -40,11 +41,8 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -40,11 +41,8 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
@Autowired
@Autowired
RedisUtil
redisUtil
;
RedisUtil
redisUtil
;
@Value
(
"${amos.system.user.product:AMOS_STUDIO_WEB}"
)
@Autowired
String
product
;
StartPlatformTokenService
platformTokenService
;
@Value
(
"${amos.system.user.app-key:AMOS_STUDIO}"
)
String
appKey
;
@Override
@Override
public
void
processMessage
(
String
s
,
MqttMessage
message
)
throws
Exception
{
public
void
processMessage
(
String
s
,
MqttMessage
message
)
throws
Exception
{
...
@@ -58,15 +56,13 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -58,15 +56,13 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"公司同步消息解析失败"
);
throw
new
Exception
(
"公司同步消息解析失败"
);
}
}
RequestContext
.
setAppKey
(
appKey
);
platformTokenService
.
getToken
();
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
//判断库中业务tz_base_enterprise_info是否存在
//判断库中业务tz_base_enterprise_info是否存在
QueryWrapper
<
TzBaseEnterpriseInfo
>
queryWrapper
=
new
QueryWrapper
<
TzBaseEnterpriseInfo
>();
QueryWrapper
<
TzBaseEnterpriseInfo
>
queryWrapper
=
new
QueryWrapper
<
TzBaseEnterpriseInfo
>();
queryWrapper
.
eq
(
"use_code"
,
object
.
getString
(
"unit_code"
));
queryWrapper
.
eq
(
"use_code"
,
object
.
getString
(
"unit_code"
));
TzBaseEnterpriseInfo
tzBaseEnterprisePrivilegeInfo
=
tzBaseEnterpriseInfoService
.
getOne
(
queryWrapper
);
TzBaseEnterpriseInfo
tzBaseEnterprisePrivilegeInfo
=
tzBaseEnterpriseInfoService
.
getOne
(
queryWrapper
);
if
(!
ValidationUtil
.
isEmpty
(
tzBaseEnterprisePrivilegeInfo
))
{
if
(!
ValidationUtil
.
isEmpty
(
tzBaseEnterprisePrivilegeInfo
))
{
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
return
;
return
;
}
}
...
@@ -95,14 +91,14 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -95,14 +91,14 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
//业务表更新条件构造器
//业务表更新条件构造器
UpdateWrapper
<
TzBaseEnterpriseInfo
>
updateWrapper
=
new
UpdateWrapper
<>();
UpdateWrapper
<
TzBaseEnterpriseInfo
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"use_code"
,
object
.
getString
(
"unit_code"
));
updateWrapper
.
eq
(
"use_code"
,
object
.
getString
(
"unit_code"
));
String
regCode
=
object
.
getString
(
"reg_code"
);
String
regCode
=
object
.
getString
(
"reg_code"
);
CompanyModel
supervisePrivilegeCompanyModel
;
CompanyModel
supervisePrivilegeCompanyModel
;
if
(!
ValidationUtil
.
isEmpty
(
regCode
))
{
if
(!
ValidationUtil
.
isEmpty
(
regCode
))
{
supervisePrivilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
regCode
).
getResult
();
supervisePrivilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
regCode
).
getResult
();
if
(
ValidationUtil
.
isEmpty
(
supervisePrivilegeCompanyModel
))
{
if
(
ValidationUtil
.
isEmpty
(
supervisePrivilegeCompanyModel
))
{
supervisePrivilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
"610000"
).
getResult
();
supervisePrivilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
"610000"
).
getResult
();
if
(
ValidationUtil
.
isEmpty
(
supervisePrivilegeCompanyModel
))
{
if
(
ValidationUtil
.
isEmpty
(
supervisePrivilegeCompanyModel
))
{
...
@@ -120,37 +116,37 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
...
@@ -120,37 +116,37 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
tzBaseEnterpriseInfo
.
setSuperviseOrgCode
(
supervisePrivilegeCompanyModel
.
getOrgCode
());
tzBaseEnterpriseInfo
.
setSuperviseOrgCode
(
supervisePrivilegeCompanyModel
.
getOrgCode
());
tzBaseEnterpriseInfo
.
setSuperviseOrgName
(
supervisePrivilegeCompanyModel
.
getCompanyName
());
tzBaseEnterpriseInfo
.
setSuperviseOrgName
(
supervisePrivilegeCompanyModel
.
getCompanyName
());
if
(
ValidationUtil
.
isEmpty
(
tzBaseEnterpriseInfo
.
getUnitType
()))
{
if
(
ValidationUtil
.
isEmpty
(
tzBaseEnterpriseInfo
.
getUnitType
()))
{
tzBaseEnterpriseInfo
.
setUnitType
(
""
);
tzBaseEnterpriseInfo
.
setUnitType
(
""
);
}
}
try
{
try
{
if
(
tzBaseEnterprisePrivilegeInfo
==
null
)
{
if
(
tzBaseEnterprisePrivilegeInfo
==
null
)
{
tzBaseEnterpriseInfoService
.
save
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoService
.
save
(
tzBaseEnterpriseInfo
);
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
return
;
return
;
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"【"
+
object
.
getString
(
"unit_name"
)
+
"】许可信息同步【失败】:"
+
e
.
getMessage
());
logger
.
error
(
"【"
+
object
.
getString
(
"unit_name"
)
+
"】许可信息同步【失败】:"
+
e
.
getMessage
());
}
}
}
}
public
Map
<
String
,
CompanyModel
>
getCompanyInfoMap
(
Collection
companyModels
,
Map
<
String
,
CompanyModel
>
map
)
{
public
Map
<
String
,
CompanyModel
>
getCompanyInfoMap
(
Collection
companyModels
,
Map
<
String
,
CompanyModel
>
map
)
{
if
(
companyModels
==
null
)
{
if
(
companyModels
==
null
)
{
return
map
;
return
map
;
}
}
Iterator
iter
=
companyModels
.
iterator
();
Iterator
iter
=
companyModels
.
iterator
();
while
(
iter
.
hasNext
())
{
while
(
iter
.
hasNext
())
{
String
json
=
JSON
.
toJSONString
(
iter
.
next
());
String
json
=
JSON
.
toJSONString
(
iter
.
next
());
CompanyModel
companyModel
=
JSON
.
parseObject
(
json
,
CompanyModel
.
class
);
CompanyModel
companyModel
=
JSON
.
parseObject
(
json
,
CompanyModel
.
class
);
String
code
=
companyModel
.
getCompanyCode
();
String
code
=
companyModel
.
getCompanyCode
();
if
(
code
.
length
()
>=
6
)
{
if
(
code
.
length
()
>=
6
)
{
code
=
code
.
substring
(
0
,
6
);
code
=
code
.
substring
(
0
,
6
);
}
}
map
.
put
(
code
,
companyModel
);
map
.
put
(
code
,
companyModel
);
getCompanyInfoMap
(
companyModel
.
getChildren
(),
map
);
getCompanyInfoMap
(
companyModel
.
getChildren
(),
map
);
}
}
return
map
;
return
map
;
}
}
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/service/impl/StartPlatformTokenService.java
View file @
1b614da7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.ymt.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.ymt.biz.utils.RedisUtil
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
@Service
@Service
public
class
StartPlatformTokenService
{
public
class
StartPlatformTokenService
{
@Value
(
"${admin.product}"
)
@Autowired
String
product
;
RedisUtil
redisUtil
;
@Value
(
"${admin.appkey}"
)
String
appkey
;
@Value
(
"${admin.user}"
)
String
user
;
@Value
(
"${admin.password}"
)
String
password
;
@Value
(
"${amos.secret.key}"
)
@Autowired
String
secretKey
;
AmosRequestContext
amosRequestContext
;
@Autowired
RedisUtil
redisUtil
;
@Autowired
AmosRequestContext
amosRequestContext
;
public
void
getToken
()
{
public
void
getToken
()
{
RequestContext
.
setProduct
(
product
);
RequestContext
.
setProduct
(
amosRequestContext
.
getProduct
());
RequestContext
.
setAppKey
(
appkey
);
RequestContext
.
setAppKey
(
amosRequestContext
.
getAppKey
());
String
token
=
amosRequestContext
.
getToken
();
RequestContext
.
setToken
(
amosRequestContext
.
getToken
());
System
.
out
.
println
(
"token:"
+
token
);
}
RequestContext
.
setToken
(
token
);
redisUtil
.
set
(
"platform_token"
,
token
);
}
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
1b614da7
...
@@ -41,7 +41,6 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -41,7 +41,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
@@ -63,15 +62,6 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -63,15 +62,6 @@ public class TzBaseEnterpriseInfoServiceImpl
@Autowired
@Autowired
RedisUtil
redisUtil
;
RedisUtil
redisUtil
;
@Value
(
"${admin.product}"
)
String
product
;
@Value
(
"${admin.product.web}"
)
String
webProduct
;
@Value
(
"${admin.appkey}"
)
String
appkey
;
@Autowired
@Autowired
private
TzBaseEnterpriseInfoMapper
tzBaseEnterpriseInfoMapper
;
private
TzBaseEnterpriseInfoMapper
tzBaseEnterpriseInfoMapper
;
...
@@ -84,8 +74,6 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -84,8 +74,6 @@ public class TzBaseEnterpriseInfoServiceImpl
@Autowired
@Autowired
RegUnitInfoServiceImpl
regUnitInfoService
;
RegUnitInfoServiceImpl
regUnitInfoService
;
@Autowired
private
IBaseUnitLicenceService
iBaseUnitLicenceService
;
@Autowired
@Autowired
private
SpeUseUnitServiceImpl
speUseUnitService
;
private
SpeUseUnitServiceImpl
speUseUnitService
;
...
@@ -94,29 +82,23 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -94,29 +82,23 @@ public class TzBaseEnterpriseInfoServiceImpl
private
AccessFeignService
accessFeignService
;
private
AccessFeignService
accessFeignService
;
@Autowired
@Autowired
private
ITzBaseEnterpriseInfoService
tzBaseEnterpriseInfoService
;
@Autowired
DataDictionaryServiceImpl
iDataDictionaryService
;
DataDictionaryServiceImpl
iDataDictionaryService
;
@Autowired
@Autowired
RegUnitInfoMapper
regUnitInfoMapper
;
RegUnitInfoMapper
regUnitInfoMapper
;
@Value
(
"${tzs.admin.name:tzs_admin}"
)
@Autowired
private
String
tzsAdminName
;
StartPlatformTokenService
platformTokenService
;
@Value
(
"${tzs.admin.pwd:a1234567}"
)
private
String
tzsAdminPwd
;
@Value
(
"${redis.cache.failure.time}"
)
@Value
(
"${redis.cache.failure.time}"
)
private
Long
redisRegionTimeSecond
;
private
Long
redisRegionTimeSecond
;
/**机器人用户token缓存key */
public
static
final
String
TZS_USER_TOKEN
=
"TZS_USER_TOKEN"
;
/**
/**
* 企业管理员变更缓存key前缀
* 企业管理员变更缓存key前缀
*/
*/
private
final
String
adminChange
=
"ADMIN_CHANGE_"
;
private
final
String
adminChange
=
"ADMIN_CHANGE_"
;
@Autowired
@Autowired
private
EquipmentCategoryServiceImpl
equipmentCategoryService
;
private
EquipmentCategoryServiceImpl
equipmentCategoryService
;
...
@@ -313,9 +295,7 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -313,9 +295,7 @@ public class TzBaseEnterpriseInfoServiceImpl
@Override
@Override
public
String
syncEnterpriseInfo
()
{
public
String
syncEnterpriseInfo
()
{
RequestContext
.
setAppKey
(
appkey
);
platformTokenService
.
getToken
();
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
List
<
TzBaseEnterpriseInfo
>
baseEnterpriseInfoList
=
new
ArrayList
<>();
List
<
TzBaseEnterpriseInfo
>
baseEnterpriseInfoList
=
new
ArrayList
<>();
...
@@ -538,16 +518,11 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -538,16 +518,11 @@ public class TzBaseEnterpriseInfoServiceImpl
return
String
.
join
(
","
,
res
);
return
String
.
join
(
","
,
res
);
}
}
@Override
public
Map
<
String
,
Object
>
adminInfoUpdate
(
Map
<
String
,
Object
>
map
)
{
public
Map
<
String
,
Object
>
adminInfoUpdate
(
Map
<
String
,
Object
>
map
)
{
//每一个企业只有一个管理员,所以当前登录用户即管理员用户
//每一个企业只有一个管理员,所以当前登录用户即管理员用户
AgencyUserModel
me
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
AgencyUserModel
me
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
RequestContext
.
setAppKey
(
appkey
);
platformTokenService
.
getToken
();
RequestContext
.
setProduct
(
webProduct
);
//获取机器人的token,获取不到则去登录
if
(
ObjectUtils
.
isEmpty
(
redisUtil
.
get
(
TZS_USER_TOKEN
)))
{
loginCtiUser
();
}
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
TZS_USER_TOKEN
)));
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
if
(!
ObjectUtils
.
isEmpty
(
me
))
{
if
(!
ObjectUtils
.
isEmpty
(
me
))
{
RegUnitInfo
regUnitInfo
=
new
RegUnitInfo
();
RegUnitInfo
regUnitInfo
=
new
RegUnitInfo
();
...
@@ -572,18 +547,6 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -572,18 +547,6 @@ public class TzBaseEnterpriseInfoServiceImpl
return
resultMap
;
return
resultMap
;
}
}
//机器人用户登录
private
void
loginCtiUser
()
{
String
passwd
=
DesUtil
.
encode
(
tzsAdminPwd
,
"qaz"
);
IdPasswordAuthModel
loninData
=
new
IdPasswordAuthModel
();
loninData
.
setLoginId
(
tzsAdminName
);
loninData
.
setPassword
(
passwd
);
FeignClientResult
loginResult
=
Privilege
.
authClient
.
idpassword
(
loninData
);
if
(
loginResult
.
getStatus
()
==
200
)
{
HashMap
resultMap
=
(
HashMap
)
loginResult
.
getResult
();
redisUtil
.
set
(
TZS_USER_TOKEN
,
resultMap
.
get
(
"token"
).
toString
(),
redisRegionTimeSecond
);
}
}
public
void
setSpeUseUnitState
(
int
state
,
SpeUseUnit
speUseUnit
){
public
void
setSpeUseUnitState
(
int
state
,
SpeUseUnit
speUseUnit
){
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/resources/application.properties
View file @
1b614da7
...
@@ -122,11 +122,7 @@ tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
...
@@ -122,11 +122,7 @@ tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
tzs.wechat.test.userId
=
3393279
tzs.wechat.test.userId
=
3393279
admin.product
=
AMOS-SERVICE-ADMIN
admin.appkey
=
AMOS_ADMIN
admin.user
=
admin_tzs
admin.password
=
a1234560
admin.product.web
=
AMOS-WEB-ADMIN
amos.secret.key
=
qazknife4j.production=false
amos.secret.key
=
qazknife4j.production=false
knife4j.production
=
false
knife4j.production
=
false
...
...
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