Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
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
haoban3.0
haoban-manage3.0
Commits
48f6e5a1
Commit
48f6e5a1
authored
Mar 17, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:删除无效代码
parent
1d2bc45f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
88 deletions
+0
-88
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+0
-30
TestController.java
.../com/gic/haoban/manage/web/controller/TestController.java
+0
-26
SyncDepartmentThread.java
...om/gic/haoban/manage/web/thread/SyncDepartmentThread.java
+0
-32
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
48f6e5a1
...
@@ -28,8 +28,6 @@ import com.gic.haoban.manage.api.service.DepartmentApiService;
...
@@ -28,8 +28,6 @@ import com.gic.haoban.manage.api.service.DepartmentApiService;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.SyncDepartmentQO
;
import
com.gic.haoban.manage.web.thread.SyncDepartmentThread
;
import
com.gic.haoban.manage.web.vo.DepartmentChainVO
;
import
com.gic.haoban.manage.web.vo.DepartmentChainVO
;
import
com.gic.haoban.manage.web.vo.DepartmentVO
;
import
com.gic.haoban.manage.web.vo.DepartmentVO
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
...
@@ -37,9 +35,7 @@ import org.apache.commons.lang.StringUtils;
...
@@ -37,9 +35,7 @@ import org.apache.commons.lang.StringUtils;
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.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
import
java.util.*
;
...
@@ -181,32 +177,6 @@ public class DepartmentContoller extends WebBaseController {
...
@@ -181,32 +177,6 @@ public class DepartmentContoller extends WebBaseController {
}
}
@RequestMapping
(
"department-batch-sync"
)
@ResponseBody
public
HaobanResponse
departmentBatchSync
(
@RequestBody
SyncDepartmentQO
args
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
key
=
"haoban-sync-department-"
+
wxEnterpriseId
;
if
(
RedisUtil
.
getCache
(
key
)
!=
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10011
);
}
Object
editDepartmentObject
=
null
;
Object
addDepartmentObject
=
null
;
String
editDepartment
=
""
;
String
addDepartment
=
""
;
String
delDepartmentIds
=
""
;
logger
.
info
(
"【部门同步】args={}"
,
JSON
.
toJSONString
(
args
));
if
(
args
!=
null
)
{
editDepartmentObject
=
args
.
getEditDepartment
();
addDepartmentObject
=
args
.
getAddDepartment
();
editDepartment
=
JSON
.
toJSONString
(
editDepartmentObject
);
addDepartment
=
JSON
.
toJSONString
(
addDepartmentObject
);
}
RedisUtil
.
setCache
(
key
,
1
,
3600L
);
new
SyncDepartmentThread
(
this
,
editDepartment
,
delDepartmentIds
,
addDepartment
,
key
).
start
();
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
key
);
}
@RequestMapping
(
"department-chain"
)
@RequestMapping
(
"department-chain"
)
public
HaobanResponse
departmentChain
(
String
departmentId
)
{
public
HaobanResponse
departmentChain
(
String
departmentId
)
{
if
(
StringUtils
.
isBlank
(
departmentId
))
{
if
(
StringUtils
.
isBlank
(
departmentId
))
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/TestController.java
View file @
48f6e5a1
...
@@ -30,7 +30,6 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -30,7 +30,6 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.TreeMap
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -118,31 +117,6 @@ public class TestController extends WebBaseController {
...
@@ -118,31 +117,6 @@ public class TestController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
@RequestMapping
(
"/del-department-batch"
)
public
HaobanResponse
departmentDel
(
String
departmentId
)
{
String
key
=
"del-department-batch"
;
Object
cache
=
RedisUtil
.
getCache
(
key
);
if
(
null
!=
cache
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_0
);
}
RedisUtil
.
setCache
(
key
,
1
,
120L
,
TimeUnit
.
SECONDS
);
DepartmentDTO
departmentDTO
=
departmentApiService
.
selectById
(
departmentId
);
if
(
null
==
departmentDTO
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_0
);
}
List
<
DepartmentDTO
>
departmentDTOS
=
departmentApiService
.
listByChainId
(
departmentDTO
.
getChainId
(),
departmentDTO
.
getWxEnterpriseId
());
TreeMap
<
Integer
,
List
<
DepartmentDTO
>>
treeMap
=
departmentDTOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
DepartmentDTO:
:
getLevel
,
TreeMap:
:
new
,
Collectors
.
toList
()));
treeMap
.
descendingMap
().
forEach
((
midKey
,
val
)
->
{
val
.
forEach
(
departmentDTO1
->
{
departmentApiService
.
del
(
departmentDTO1
.
getDepartmentId
());
});
});
RedisUtil
.
delCache
(
key
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
@RequestMapping
(
"/lock"
)
@RequestMapping
(
"/lock"
)
public
HaobanResponse
lock
(
String
name
,
Long
time
,
int
ty
)
{
public
HaobanResponse
lock
(
String
name
,
Long
time
,
int
ty
)
{
RedisUtil
.
lock
(
name
,
time
,
TimeUnit
.
SECONDS
,
0L
);
RedisUtil
.
lock
(
name
,
time
,
TimeUnit
.
SECONDS
,
0L
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/thread/SyncDepartmentThread.java
deleted
100644 → 0
View file @
1d2bc45f
package
com
.
gic
.
haoban
.
manage
.
web
.
thread
;
import
com.gic.haoban.manage.web.controller.DepartmentContoller
;
import
com.gic.redis.data.util.RedisUtil
;
public
class
SyncDepartmentThread
extends
Thread
{
DepartmentContoller
departmentController
;
String
editDepartment
;
String
delDepartmentIds
;
String
addDepartment
;
String
key
;
@Override
public
void
run
()
{
System
.
out
.
println
(
"【开始同步】"
+
System
.
currentTimeMillis
());
departmentController
.
syncDepartment
(
editDepartment
,
delDepartmentIds
,
addDepartment
);
RedisUtil
.
delCache
(
key
);
System
.
out
.
println
(
"【结束同步】"
+
System
.
currentTimeMillis
());
}
public
SyncDepartmentThread
(
DepartmentContoller
departmentController
,
String
editDepartment
,
String
delDepartmentIds
,
String
addDepartment
,
String
key
){
this
.
departmentController
=
departmentController
;
this
.
editDepartment
=
editDepartment
;
this
.
delDepartmentIds
=
delDepartmentIds
;
this
.
addDepartment
=
addDepartment
;
this
.
key
=
key
;
}
}
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