Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-standard-interfaces
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 874d2052
authored
Apr 12, 2022
by
王欣伟
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改帐号创建
1 parent
e2976ccb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
7 deletions
src/main/java/cn/com/glsx/stdinterface/config/FeignConfiguration.java
src/main/java/cn/com/glsx/stdinterface/modules/component/CreateNewAccountComponent.java
src/test/java/cn/com/glsx/stdinterface/modules/service/WorkOrderServiceTest.java
src/main/java/cn/com/glsx/stdinterface/config/FeignConfiguration.java
0 → 100644
View file @
874d205
package
cn
.
com
.
glsx
.
stdinterface
.
config
;
import
feign.RequestInterceptor
;
import
feign.RequestTemplate
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @BelongsProject: ne-shield-standard-interfaces
* @BelongsPackage: cn.com.glsx.stdinterface.config
* @Author: dell_xw
* @CreateTime: 2022-04-12 16:21
* @Description: TODO
* @Version: 1.0
*/
@Slf4j
@Configuration
public
class
FeignConfiguration
implements
RequestInterceptor
{
@Override
public
void
apply
(
RequestTemplate
requestTemplate
)
{
requestTemplate
.
header
(
"Authorization"
,
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXlsb2FkTWFwIjp7ImJlbG9uZyI6IjQ2MDIiLCJhcHBsaWNhdGlvbiI6Imdsc3gtbmUtc2hpZWxkLXVzZXJjZW50ZXIiLCJjbGF6eiI6ImNvbS5nbHN4LnBsYXQuand0LmJhc2UuQ29tSnd0VXNlciIsInVzZXJJZCI6IjgxNjAiLCJhY2NvdW50IjoiemxnaiIsInRlbmFudCI6Ijg2Iiwiand0SWQiOiJnbHN4LW5lLXNoaWVsZC11c2VyY2VudGVyOjY1ZGE2Mzg2LTdiMGMtNDk4Ni05OTliLTg4ZWZkNmQwOTlhM19KV1QtU0VTU0lPTi04MTYwIn0sInN1YiI6InpsZ2oiLCJleHAiOjE2NTgzOTE4NTcsImlhdCI6MTY0OTc1MTg1NywianRpIjoiZ2xzeC1uZS1zaGllbGQtdXNlcmNlbnRlcjo2NWRhNjM4Ni03YjBjLTQ5ODYtOTk5Yi04OGVmZDZkMDk5YTNfSldULVNFU1NJT04tODE2MCJ9.lwU-h9E5zMdqmEciO6hV9mIAxEY16Ti-2VpuslgVWhg"
);
log
.
info
(
"feign interceptor header:{}"
,
requestTemplate
);
}
}
src/main/java/cn/com/glsx/stdinterface/modules/component/CreateNewAccountComponent.java
View file @
874d205
...
@@ -50,6 +50,18 @@ public class CreateNewAccountComponent {
...
@@ -50,6 +50,18 @@ public class CreateNewAccountComponent {
return
;
return
;
}
}
try
{
doCreate
(
request
);
}
catch
(
Exception
e
)
{
log
.
error
(
"create account is exception:{}"
,
e
.
getMessage
(),
e
);
}
// unlock
boolean
unLockResutl
=
unLock
(
lockKey
);
log
.
info
(
"createNewAccountByOrgRelation_unlock result:{}"
,
unLockResutl
);
}
private
void
doCreate
(
CommonSyncApiRequest
request
)
{
String
tenantName
=
zhongliDepartmentMapper
.
getTenantName
(
request
.
getTenantId
());
String
tenantName
=
zhongliDepartmentMapper
.
getTenantName
(
request
.
getTenantId
());
if
(!
tenantName
.
equals
(
request
.
getOrganization
()))
{
if
(!
tenantName
.
equals
(
request
.
getOrganization
()))
{
log
.
info
(
"tenant id and name not equals:{}"
,
tenantName
);
log
.
info
(
"tenant id and name not equals:{}"
,
tenantName
);
...
@@ -77,6 +89,7 @@ public class CreateNewAccountComponent {
...
@@ -77,6 +89,7 @@ public class CreateNewAccountComponent {
DepartmentItem
departmentItem
=
departmentItemMap
.
get
(
userName
);
DepartmentItem
departmentItem
=
departmentItemMap
.
get
(
userName
);
if
(
departmentItem
==
null
)
{
if
(
departmentItem
==
null
)
{
log
.
info
(
"departmentInfo is empty:{}"
,
userName
);
log
.
info
(
"departmentInfo is empty:{}"
,
userName
);
continue
;
}
}
// 创建帐号
// 创建帐号
...
@@ -97,10 +110,6 @@ public class CreateNewAccountComponent {
...
@@ -97,10 +110,6 @@ public class CreateNewAccountComponent {
log
.
info
(
"zhongli department account info update{}"
,
userName
);
log
.
info
(
"zhongli department account info update{}"
,
userName
);
}
}
}
}
// unlock
boolean
unLockResutl
=
unLock
(
lockKey
);
log
.
info
(
"createNewAccountByOrgRelation_unlock result:{}"
,
unLockResutl
);
}
}
private
Map
<
String
,
DepartmentItem
>
getDepartmentMapper
(
Integer
tenantId
)
{
private
Map
<
String
,
DepartmentItem
>
getDepartmentMapper
(
Integer
tenantId
)
{
...
...
src/test/java/cn/com/glsx/stdinterface/modules/service/WorkOrderServiceTest.java
View file @
874d205
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
service
;
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
service
;
import
cn.com.glsx.Application
;
import
cn.com.glsx.Application
;
import
cn.com.glsx.notify.dto.MailTemplateMessageDTO
;
import
cn.com.glsx.stdinterface.dto.WorkOrderActivateBO
;
import
cn.com.glsx.notify.dto.request.MailMessageRequest
;
import
cn.com.glsx.notify.dto.request.MailMessageRequest
;
import
cn.com.glsx.notify.dto.request.SmsMessageRequest
;
import
cn.com.glsx.notify.dto.request.SmsMessageRequest
;
import
cn.com.glsx.stdinterface.dto.WorkOrderActivateBO
;
import
cn.com.glsx.stdinterface.dto.WorkOrderAddrVerifyBO
;
import
cn.com.glsx.stdinterface.dto.WorkOrderAddrVerifyBO
;
import
cn.com.glsx.stdinterface.dto.WorkOrderAddrVerifyDTO
;
import
cn.com.glsx.stdinterface.dto.WorkOrderAddrVerifyDTO
;
import
cn.com.glsx.stdinterface.modules.entity.Vehicle
;
import
cn.com.glsx.stdinterface.modules.entity.Vehicle
;
import
cn.com.glsx.stdinterface.modules.entity.WorkOrder
;
import
cn.com.glsx.stdinterface.modules.entity.WorkOrder
;
import
cn.com.glsx.stdinterface.modules.entity.WorkOrderDocs
;
import
cn.com.glsx.stdinterface.modules.entity.WorkOrderDocs
;
import
cn.com.glsx.stdinterface.modules.entity.WorkOrderVehicle
;
import
cn.com.glsx.stdinterface.modules.mapper.WorkOrderDocsMapper
;
import
cn.com.glsx.stdinterface.modules.mapper.WorkOrderDocsMapper
;
import
cn.com.glsx.stdinterface.modules.model.CommonApiRequest
;
import
cn.com.glsx.stdinterface.modules.model.CommonApiRequest
;
import
cn.com.glsx.stdinterface.modules.model.WorkOrderInfoBO
;
import
cn.com.glsx.stdinterface.modules.model.WorkOrderInfoBO
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment