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
4fc3f831
Commit
4fc3f831
authored
May 28, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
27f81b1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
6 deletions
+75
-6
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+75
-6
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
4fc3f831
...
...
@@ -277,7 +277,8 @@ public class ClerkController extends WebBaseController{
//新增店员
@HttpLimit
@RequestMapping
(
"/staff-add"
)
public
HaobanResponse
staffAdd
(
StaffDTO
staffDTO
,
String
storeId
,
String
clerkCode
)
{
public
HaobanResponse
staffAdd
(
StaffDTO
staffDTO
,
String
storeId
,
String
clerkCode
,
Integer
version
)
{
String
wxEnterpriseId
=
staffDTO
.
getWxEnterpriseId
();
String
staffName
=
staffDTO
.
getStaffName
();
String
phoneNumber
=
staffDTO
.
getPhoneNumber
();
...
...
@@ -294,9 +295,11 @@ public class ClerkController extends WebBaseController{
if
(!
GooglePhoneNumberUtil
.
checkPhoneNumber
(
phoneNumber
,
nationcode
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
StaffDTO
staff
=
staffApiService
.
selectByNationcodeAndPhoneNumber
(
wxEnterpriseId
,
nationcode
,
phoneNumber
);
if
(
staff
!=
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10005
);
if
(
version
==
null
){
StaffDTO
staff
=
staffApiService
.
selectByNationcodeAndPhoneNumber
(
wxEnterpriseId
,
nationcode
,
phoneNumber
);
if
(
staff
!=
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10005
);
}
}
com
.
gic
.
enterprise
.
api
.
dto
.
StoreDTO
store
=
storeService
.
getStoreByIdNoStatus
(
storeId
);
//校验手机是否唯一
...
...
@@ -315,6 +318,35 @@ public class ClerkController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_10013
);
}
}
if
(
version
==
1
){
boolean
needAudit
=
true
;
if
(
needAudit
){
StaffDTO
staff
=
staffApiService
.
selectById
(
staffDTO
.
getStaffId
());
//是否需要审核
AuditDTO
audit
=
new
AuditDTO
();
audit
.
setCommitName
(
clerk
.
getClerkName
());
audit
.
setCommitStaffId
(
staffDTO
.
getStaffId
());
audit
.
setCommitStaffImg
(
staff
.
getHeadImg
());
audit
.
setCommitStoreId
(
clerk
.
getStoreId
());
audit
.
setCommitStoreName
(
store
.
getStoreName
());
audit
.
setAuditStatus
(
0
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkCode"
,
clerkCode
);
json
.
put
(
"clerkName"
,
clerk
.
getClerkName
());
json
.
put
(
"headPic"
,
staff
.
getHeadImg
());
json
.
put
(
"sex"
,
sex
);
json
.
put
(
"postion"
,
postion
);
audit
.
setOldValue
(
json
.
toJSONString
());
audit
.
setCommitTime
(
new
Date
());
audit
.
setAuditType
(
3
);
auditApiService
.
insert
(
audit
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
// if(clerk != null && StringUtils.isNotBlank(clerk.getPhoneNumber())){
// syncHaobanToGicServiceApi.syncHaobanClerkPhoneNumberToGic(clerk.getClerkId(), phoneNumber);
// }else{
...
...
@@ -329,7 +361,44 @@ public class ClerkController extends WebBaseController{
//删除店员
@HttpLimit
@RequestMapping
(
"/staff-del"
)
public
HaobanResponse
staffDel
(
String
staffDepartmentRelatedIds
,
String
storeId
)
{
public
HaobanResponse
staffDel
(
String
staffDepartmentRelatedIds
,
String
storeId
,
Integer
version
,
String
clerkIds
,
String
staffId
)
{
boolean
needAudit
=
true
;
//是否需要审核
if
(
version
!=
null
&&
version
==
1
){
if
(
needAudit
){
com
.
gic
.
enterprise
.
api
.
dto
.
StoreDTO
store
=
storeService
.
getStoreByIdNoStatus
(
storeId
);
//校验手机是否唯一
if
(
store
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_400001
);
}
StaffDTO
staff
=
staffApiService
.
selectById
(
staffId
);
String
[]
clerkIdArr
=
clerkIds
.
split
(
","
);
for
(
String
clerkId
:
clerkIdArr
)
{
AuditDTO
audit
=
new
AuditDTO
();
audit
.
setCommitName
(
staff
.
getStaffName
());
audit
.
setCommitStaffId
(
staffId
);
audit
.
setCommitStaffImg
(
staff
.
getHeadImg
());
audit
.
setCommitStoreId
(
storeId
);
audit
.
setCommitStoreName
(
store
.
getStoreName
());
audit
.
setAuditStatus
(
0
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
audit
.
setOldValue
(
json
.
toJSONString
());
audit
.
setCommitTime
(
new
Date
());
audit
.
setAuditType
(
4
);
auditApiService
.
insert
(
audit
);
}
}
else
{
String
[]
clerkIdArr
=
clerkIds
.
split
(
","
);
for
(
String
clerkId
:
clerkIdArr
)
{
syncHaobanToGicServiceApi
.
delGicClerk
(
clerkId
);
}
}
}
DepartmentDTO
departmentDTO
=
departmentApiService
.
selectByRelatedId
(
storeId
);
if
(
departmentDTO
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10009
);
...
...
@@ -585,7 +654,7 @@ public class ClerkController extends WebBaseController{
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
0009
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
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