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
c211c576
Commit
c211c576
authored
Aug 17, 2023
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.bug修改
parent
545f110a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
75 deletions
+26
-75
AmosTcmApplication.java
...iz/src/main/java/com/yeejoin/amos/AmosTcmApplication.java
+2
-1
TzBaseEnterpriseInfoController.java
...le/tcm/biz/controller/TzBaseEnterpriseInfoController.java
+1
-8
TzBaseEnterpriseInfoServiceImpl.java
...tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+23
-66
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/AmosTcmApplication.java
View file @
c211c576
...
@@ -37,6 +37,7 @@ import org.springframework.core.env.Environment;
...
@@ -37,6 +37,7 @@ import org.springframework.core.env.Environment;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc
;
import
java.net.InetAddress
;
import
java.net.InetAddress
;
...
@@ -107,7 +108,7 @@ public class AmosTcmApplication {
...
@@ -107,7 +108,7 @@ public class AmosTcmApplication {
String
ip
=
InetAddress
.
getLocalHost
().
getHostAddress
();
String
ip
=
InetAddress
.
getLocalHost
().
getHostAddress
();
String
port
=
env
.
getProperty
(
"server.port"
);
String
port
=
env
.
getProperty
(
"server.port"
);
String
path
=
oConvertUtils
.
getString
(
env
.
getProperty
(
"server.servlet.context-path"
));
String
path
=
oConvertUtils
.
getString
(
env
.
getProperty
(
"server.servlet.context-path"
));
GlobalExceptionHandler
.
setAlwaysOk
(
true
);
logger
.
info
(
"\n----------------------------------------------------------\n\t"
logger
.
info
(
"\n----------------------------------------------------------\n\t"
+
"Application Amos-Biz-Boot is running! Access URLs:\n\t"
+
"Swagger文档: \thttp://"
+
ip
+
":"
+
port
+
"Application Amos-Biz-Boot is running! Access URLs:\n\t"
+
"Swagger文档: \thttp://"
+
ip
+
":"
+
port
+
path
+
"/doc.html\n"
+
"----------------------------------------------------------"
);
+
path
+
"/doc.html\n"
+
"----------------------------------------------------------"
);
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/TzBaseEnterpriseInfoController.java
View file @
c211c576
...
@@ -201,14 +201,7 @@ public class TzBaseEnterpriseInfoController {
...
@@ -201,14 +201,7 @@ public class TzBaseEnterpriseInfoController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"修改企业信息"
,
notes
=
"修改企业信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"修改企业信息"
,
notes
=
"修改企业信息"
)
public
ResponseModel
<
Object
>
adminInfoUpdate
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
Object
>
adminInfoUpdate
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
Map
<
String
,
Object
>
result
=
iTzBaseEnterpriseInfoService
.
adminInfoUpdate
(
map
);
Map
<
String
,
Object
>
result
=
iTzBaseEnterpriseInfoService
.
adminInfoUpdate
(
map
);
if
(
result
.
containsKey
(
"fail"
))
{
return
ResponseHelper
.
buildResponse
(
result
);
ResponseModel
responseModel
=
new
ResponseModel
();
responseModel
.
setStatus
(
500
);
responseModel
.
setDevMessage
(
result
.
get
(
"fail"
).
toString
());
return
responseModel
;
}
else
{
return
ResponseHelper
.
buildResponse
(
result
.
get
(
"success"
));
}
}
}
/**
/**
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
c211c576
...
@@ -30,6 +30,7 @@ import com.yeejoin.amos.boot.module.tcm.flc.api.feign.AccessFeignService;
...
@@ -30,6 +30,7 @@ import com.yeejoin.amos.boot.module.tcm.flc.api.feign.AccessFeignService;
import
com.yeejoin.amos.boot.module.tcm.flc.api.mapper.RegUnitInfoMapper
;
import
com.yeejoin.amos.boot.module.tcm.flc.api.mapper.RegUnitInfoMapper
;
import
com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.RegUnitIcServiceImpl
;
import
com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.RegUnitIcServiceImpl
;
import
com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.RegUnitInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.RegUnitInfoServiceImpl
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
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
;
...
@@ -44,6 +45,7 @@ import org.springframework.util.ObjectUtils;
...
@@ -44,6 +45,7 @@ import org.springframework.util.ObjectUtils;
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
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.*
;
...
@@ -63,15 +65,6 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -63,15 +65,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
;
...
@@ -85,7 +78,7 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -85,7 +78,7 @@ public class TzBaseEnterpriseInfoServiceImpl
RegUnitInfoServiceImpl
regUnitInfoService
;
RegUnitInfoServiceImpl
regUnitInfoService
;
@Autowired
@Autowired
private
IBaseUnitLicenceService
iBaseUnitLicence
Service
;
private
StartPlatformTokenService
platformToken
Service
;
@Autowired
@Autowired
private
SpeUseUnitServiceImpl
speUseUnitService
;
private
SpeUseUnitServiceImpl
speUseUnitService
;
...
@@ -101,18 +94,6 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -101,18 +94,6 @@ public class TzBaseEnterpriseInfoServiceImpl
@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}"
)
private
Long
redisRegionTimeSecond
;
/**机器人用户token缓存key */
public
static
final
String
TZS_USER_TOKEN
=
"TZS_USER_TOKEN"
;
/**
/**
* 企业管理员变更缓存key前缀
* 企业管理员变更缓存key前缀
*/
*/
...
@@ -313,10 +294,7 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -313,10 +294,7 @@ public class TzBaseEnterpriseInfoServiceImpl
@Override
@Override
public
String
syncEnterpriseInfo
()
{
public
String
syncEnterpriseInfo
()
{
RequestContext
.
setAppKey
(
appkey
);
platformTokenService
.
setRequestContext
();
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
List
<
TzBaseEnterpriseInfo
>
baseEnterpriseInfoList
=
new
ArrayList
<>();
List
<
TzBaseEnterpriseInfo
>
baseEnterpriseInfoList
=
new
ArrayList
<>();
//获取平台企业表企业名称及sequence_code,并装入map中
//获取平台企业表企业名称及sequence_code,并装入map中
...
@@ -536,54 +514,33 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -536,54 +514,33 @@ 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
);
//自己不能修改自己 所以需要设置为机器人
RequestContext
.
setProduct
(
webProduct
);
platformTokenService
.
setRequestContext
();
//获取机器人的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
))
{
RegUnitInfo
regUnitInfo
=
new
RegUnitInfo
();
RegUnitInfo
regUnitInfo
=
new
RegUnitInfo
();
String
unitCode
=
String
.
valueOf
(
map
.
get
(
"unitCode"
));
String
unitCode
=
String
.
valueOf
(
map
.
get
(
"unitCode"
));
regUnitInfo
.
setAdminName
(
String
.
valueOf
(
map
.
get
(
"adminName"
)));
regUnitInfo
.
setAdminName
(
String
.
valueOf
(
map
.
get
(
"adminName"
)));
regUnitInfo
.
setAdminIdNumber
(
String
.
valueOf
(
map
.
get
(
"adminIdNumber"
)));
regUnitInfo
.
setAdminIdNumber
(
String
.
valueOf
(
map
.
get
(
"adminIdNumber"
)));
regUnitInfo
.
setAdminIdCardPhoto
(
JSON
.
toJSONString
(
map
.
get
(
"adminIdCardPhoto"
)));
regUnitInfo
.
setAdminIdCardPhoto
(
JSON
.
toJSONString
(
map
.
get
(
"adminIdCardPhoto"
)));
regUnitInfo
.
setAdminTel
(
String
.
valueOf
(
map
.
get
(
"adminTel"
)));
regUnitInfo
.
setAdminTel
(
String
.
valueOf
(
map
.
get
(
"adminTel"
)));
me
.
setMobile
(
regUnitInfo
.
getAdminTel
());
me
.
setMobile
(
String
.
valueOf
(
map
.
get
(
"adminTel"
)));
me
.
setRealName
(
String
.
valueOf
(
map
.
get
(
"adminName"
)));
me
.
setRealName
(
String
.
valueOf
(
map
.
get
(
"adminName"
)));
try
{
FeignClientResult
<
AgencyUserModel
>
updateResult
=
Privilege
.
agencyUserClient
.
update
(
me
,
String
.
valueOf
(
map
.
get
(
"adminUserId"
)));
Privilege
.
agencyUserClient
.
update
(
me
,
me
.
getUserId
());
if
(
200
==
updateResult
.
getStatus
())
{
regUnitInfoService
.
update
(
regUnitInfo
,
new
LambdaQueryWrapper
<
RegUnitInfo
>().
eq
(
RegUnitInfo:
:
getUnitCode
,
unitCode
));
regUnitInfoService
.
update
(
regUnitInfo
,
new
QueryWrapper
<
RegUnitInfo
>().
eq
(
"unit_code"
,
unitCode
));
}
catch
(
Exception
e
)
{
resultMap
.
put
(
"success"
,
regUnitInfo
);
log
.
error
(
e
.
getMessage
(),
e
);
redisUtil
.
del
(
adminChange
+
map
.
get
(
"adminTel"
));
throw
new
BadRequest
(
e
.
getMessage
());
}
else
{
resultMap
.
put
(
"fail"
,
"平台用户修改失败,请联系管理员"
);
}
}
else
{
resultMap
.
put
(
"fail"
,
"平台用户不存在"
);
}
}
resultMap
.
put
(
"success"
,
regUnitInfo
);
redisUtil
.
del
(
adminChange
+
map
.
get
(
"adminTel"
));
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
){
speUseUnit
.
setSyncState
(
state
);
speUseUnit
.
setSyncState
(
state
);
speUseUnitService
.
updateById
(
speUseUnit
);
speUseUnitService
.
updateById
(
speUseUnit
);
...
...
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