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
QianQiXiang
haoban-manage3.0
Commits
b639ede0
Commit
b639ede0
authored
Jun 03, 2020
by
fudahua
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
4292a7fc
700f0c47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
149 additions
and
210 deletions
+149
-210
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+43
-18
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+29
-16
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+77
-176
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
b639ede0
...
@@ -170,16 +170,30 @@ public class AuditApiServiceImpl implements AuditApiService{
...
@@ -170,16 +170,30 @@ public class AuditApiServiceImpl implements AuditApiService{
logger
.
info
(
"code已存在"
);
logger
.
info
(
"code已存在"
);
tab
.
setAuditStatus
(
5
);
tab
.
setAuditStatus
(
5
);
auditMapper
.
updateByPrimaryKeySelective
(
tab
);
auditMapper
.
updateByPrimaryKeySelective
(
tab
);
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
insertBatchLog
(
batchId
,
AuditRsultType
.
fail
.
getCode
(),
tab
);
}
return
"0"
;
return
"0"
;
}
else
{
}
else
{
staffClerkRelation
=
new
StaffClerkRelationDTO
();
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
obj
.
getClerkId
());
staffClerkRelation
.
setEnterpriseId
(
tab
.
getEnterpriseId
());
if
(
clerkDTO
==
null
){
staffClerkRelation
.
setClerkCode
(
obj
.
getClerkCode
());
tab
.
setAuditStatus
(
5
);
staffClerkRelation
.
setClerkId
(
obj
.
getClerkId
());
tab
.
setAuditReason
(
"gic已删除该导购"
);
staffClerkRelation
.
setStoreId
(
tab
.
getCommitStoreId
());
auditMapper
.
updateByPrimaryKeySelective
(
tab
);
staffClerkRelation
.
setWxEnterpriseId
(
tab
.
getWxEnterpriseId
());
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
staffClerkRelation
.
setWxUserId
(
obj
.
getWxUserId
());
insertBatchLog
(
batchId
,
AuditRsultType
.
fail
.
getCode
(),
tab
);
staffClerkRelationApiService
.
insert
(
staffClerkRelation
);
}
return
"0"
;
}
else
{
staffClerkRelation
=
new
StaffClerkRelationDTO
();
staffClerkRelation
.
setEnterpriseId
(
tab
.
getEnterpriseId
());
staffClerkRelation
.
setClerkCode
(
obj
.
getClerkCode
());
staffClerkRelation
.
setClerkId
(
obj
.
getClerkId
());
staffClerkRelation
.
setStoreId
(
tab
.
getCommitStoreId
());
staffClerkRelation
.
setWxEnterpriseId
(
tab
.
getWxEnterpriseId
());
staffClerkRelation
.
setWxUserId
(
obj
.
getWxUserId
());
staffClerkRelationApiService
.
insert
(
staffClerkRelation
);
}
}
}
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
insertBatchLog
(
batchId
,
AuditRsultType
.
success
.
getCode
(),
tab
);
insertBatchLog
(
batchId
,
AuditRsultType
.
success
.
getCode
(),
tab
);
...
@@ -190,21 +204,32 @@ public class AuditApiServiceImpl implements AuditApiService{
...
@@ -190,21 +204,32 @@ public class AuditApiServiceImpl implements AuditApiService{
//门店导购新增
//门店导购新增
String
oldValue
=
tab
.
getOldValue
();
String
oldValue
=
tab
.
getOldValue
();
AuditStaffDTO
obj
=
JSONObject
.
parseObject
(
oldValue
,
AuditStaffDTO
.
class
);
AuditStaffDTO
obj
=
JSONObject
.
parseObject
(
oldValue
,
AuditStaffDTO
.
class
);
boolean
flag
=
syncHaobanToGicServiceApi
.
syncClerkToGicClerkAdd
(
tab
.
getCommitStoreId
(),
obj
.
getClerkCode
(),
obj
.
getSex
(),
obj
.
getStaffName
(),
obj
.
getPhoneNumber
(),
obj
.
getNationCode
(),
null
);
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
obj
.
getClerkId
());
if
(!
flag
){
if
(
clerkDTO
==
null
){
//失败
tab
.
setAuditStatus
(
5
);
tab
.
setAuditStatus
(
5
);
tab
.
setAuditReason
(
"gic已删除该导购"
);
auditMapper
.
updateByPrimaryKeySelective
(
tab
);
auditMapper
.
updateByPrimaryKeySelective
(
tab
);
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
insertBatchLog
(
batchId
,
AuditRsultType
.
fail
.
getCode
(),
tab
);
insertBatchLog
(
batchId
,
AuditRsultType
.
fail
.
getCode
(),
tab
);
return
"0"
;
}
}
return
"0"
;
}
else
{
}
else
{
//成功
boolean
flag
=
syncHaobanToGicServiceApi
.
syncClerkToGicClerkAdd
(
tab
.
getCommitStoreId
(),
obj
.
getClerkCode
(),
obj
.
getSex
(),
obj
.
getStaffName
(),
obj
.
getPhoneNumber
(),
obj
.
getNationCode
(),
null
);
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
if
(!
flag
){
insertBatchLog
(
batchId
,
1
,
tab
);
//失败
tab
.
setAuditStatus
(
5
);
auditMapper
.
updateByPrimaryKeySelective
(
tab
);
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
insertBatchLog
(
batchId
,
AuditRsultType
.
fail
.
getCode
(),
tab
);
return
"0"
;
}
}
else
{
//成功
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
insertBatchLog
(
batchId
,
1
,
tab
);
}
staffDepartmentRelatedApiService
.
sendClerkAdd
(
obj
.
getClerkId
(),
obj
.
getClerkCode
(),
1
,
""
);
}
}
staffDepartmentRelatedApiService
.
sendClerkAdd
(
obj
.
getClerkId
(),
obj
.
getClerkCode
(),
1
,
""
);
}
}
}
else
if
(
auditType
==
AuditType
.
CLERK_DEL
.
getCode
()){
}
else
if
(
auditType
==
AuditType
.
CLERK_DEL
.
getCode
()){
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/AuditController.java
View file @
b639ede0
...
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
...
@@ -209,27 +210,39 @@ public class AuditController extends WebBaseController{
...
@@ -209,27 +210,39 @@ public class AuditController extends WebBaseController{
if
(
staffClerkRelation
!=
null
){
if
(
staffClerkRelation
!=
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_111117
);
return
resultResponse
(
HaoBanErrCode
.
ERR_111117
);
}
else
{
}
else
{
staffClerkRelation
=
new
StaffClerkRelationDTO
();
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
staffClerkRelation
.
setEnterpriseId
(
enterpriseId
);
if
(
clerkDTO
==
null
){
staffClerkRelation
.
setClerkCode
(
clerkCode
);
audit
.
setAuditStatus
(
5
);
staffClerkRelation
.
setClerkId
(
clerkId
);
audit
.
setAuditReason
(
"gic已删除该导购"
);
staffClerkRelation
.
setStoreId
(
storeId
);
}
else
{
staffClerkRelation
.
setWxEnterpriseId
(
wxEnterpriseId
);
staffClerkRelation
=
new
StaffClerkRelationDTO
();
staffClerkRelation
.
setWxUserId
(
wxUserId
);
staffClerkRelation
.
setEnterpriseId
(
enterpriseId
);
staffClerkRelationApiService
.
insert
(
staffClerkRelation
);
staffClerkRelation
.
setClerkCode
(
clerkCode
);
audit
.
setAuditStatus
(
1
);
staffClerkRelation
.
setClerkId
(
clerkId
);
staffClerkRelation
.
setStoreId
(
storeId
);
staffClerkRelation
.
setWxEnterpriseId
(
wxEnterpriseId
);
staffClerkRelation
.
setWxUserId
(
wxUserId
);
staffClerkRelationApiService
.
insert
(
staffClerkRelation
);
audit
.
setAuditStatus
(
1
);
//发送消息
staffDepartmentRelatedApiService
.
sendClerkBind
(
clerkId
,
clerkCode
,
auditStatus
,
auditReason
);
}
}
}
//发送消息
staffDepartmentRelatedApiService
.
sendClerkBind
(
clerkId
,
clerkCode
,
auditStatus
,
auditReason
);
}
}
if
(
audit
.
getAuditType
()
==
AuditType
.
CLERK_ADD
.
getCode
()){
if
(
audit
.
getAuditType
()
==
AuditType
.
CLERK_ADD
.
getCode
()){
//导购新增
//导购新增
boolean
flag
=
syncHaobanToGicServiceApi
.
syncClerkToGicClerkAdd
(
storeId
,
clerkCode
,
sex
,
staff
.
getStaffName
(),
phoneNumber
,
nationCode
,
null
);
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
if
(!
flag
){
if
(
clerkDTO
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10010
);
audit
.
setAuditStatus
(
5
);
audit
.
setAuditReason
(
"gic已删除该导购"
);
}
else
{
boolean
flag
=
syncHaobanToGicServiceApi
.
syncClerkToGicClerkAdd
(
storeId
,
clerkCode
,
sex
,
staff
.
getStaffName
(),
phoneNumber
,
nationCode
,
null
);
if
(!
flag
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10010
);
}
audit
.
setAuditStatus
(
1
);
staffDepartmentRelatedApiService
.
sendClerkAdd
(
clerkId
,
clerkCode
,
auditStatus
,
auditReason
);
}
}
audit
.
setAuditStatus
(
1
);
staffDepartmentRelatedApiService
.
sendClerkAdd
(
clerkId
,
clerkCode
,
auditStatus
,
auditReason
);
}
}
if
(
audit
.
getAuditType
()
==
AuditType
.
CLERK_DEL
.
getCode
()){
if
(
audit
.
getAuditType
()
==
AuditType
.
CLERK_DEL
.
getCode
()){
//导购删除
//导购删除
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
b639ede0
...
@@ -106,69 +106,6 @@ public class ClerkController extends WebBaseController{
...
@@ -106,69 +106,6 @@ public class ClerkController extends WebBaseController{
private
ClerkNewService
clerkNewService
;
private
ClerkNewService
clerkNewService
;
@Autowired
@Autowired
private
AuditSettingApiService
auditSettingApiService
;
private
AuditSettingApiService
auditSettingApiService
;
//导购列表
@RequestMapping
(
"/clerk-list"
)
public
HaobanResponse
clerkList
(
String
storeId
,
String
bindFlag
,
String
departmentId
)
{
List
<
StaffDepartmentRelatedDTO
>
list
=
staffDepartmentRelatedApiService
.
listByDepartmentId
(
departmentId
);
List
<
ClerkVo
>
result
=
new
ArrayList
<
ClerkVo
>();
// if(CollectionUtil.isNotEmpty(list)){
// if("1".equals(bindFlag)){
// List<StaffDepartmentRelatedDTO> bindList = list.stream().filter(s->s.getClerkCode() != null).collect(Collectors.toList());
// if(CollectionUtil.isNotEmpty(bindList)){
// result = EntityUtil.changeEntityListByJSON(ClerkVo.class, bindList);
// }
// }else{
//
// List<StaffDepartmentRelatedDTO> unBindList = list.stream().filter(s->s.getClerkCode() == null).collect(Collectors.toList());
// if(CollectionUtil.isNotEmpty(unBindList)){
// result = EntityUtil.changeEntityListByJSON(ClerkVo.class, unBindList);
// }
// }
// }
// return resultResponse(HaoBanErrCode.ERR_1,result);
if
(
StringUtils
.
isAnyBlank
(
storeId
,
bindFlag
,
departmentId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
//绑定的clerk
if
(
"1"
.
equals
(
bindFlag
)){
// 调陶接口获取详情数据
if
(
CollectionUtil
.
isNotEmpty
(
list
)){
List
<
String
>
clerkCodes
=
list
.
stream
().
filter
(
s
->
StringUtils
.
isNotBlank
(
s
.
getClerkCode
())).
map
(
s
->
s
.
getClerkCode
()).
collect
(
Collectors
.
toList
());
logger
.
info
(
"clerkCodes =============>为{}"
,
JSONObject
.
toJSONString
(
clerkCodes
));
if
(
CollectionUtil
.
isNotEmpty
(
clerkCodes
)){
List
<
ClerkDTO
>
clerkList
=
clerkService
.
listClerk
(
storeId
,
clerkCodes
,
true
);
result
=
EntityUtil
.
changeEntityListByJSON
(
ClerkVo
.
class
,
clerkList
);
}
}
}
else
{
//未绑定的clerk
// 调陶接口获取详情数据
if
(
CollectionUtil
.
isNotEmpty
(
list
)){
List
<
String
>
clerkCodes
=
list
.
stream
().
filter
(
s
->
StringUtils
.
isNotBlank
(
s
.
getClerkCode
())).
map
(
s
->
s
.
getClerkCode
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
clerkCodes
)){
List
<
ClerkDTO
>
clerkList
=
clerkService
.
listClerk
(
storeId
,
clerkCodes
,
false
);
result
=
EntityUtil
.
changeEntityListByJSON
(
ClerkVo
.
class
,
clerkList
);
}
else
{
clerkCodes
.
add
(
"xxxXXXX"
);
List
<
ClerkDTO
>
clerkList
=
clerkService
.
listClerk
(
storeId
,
clerkCodes
,
false
);
result
=
EntityUtil
.
changeEntityListByJSON
(
ClerkVo
.
class
,
clerkList
);
}
}
else
{
List
<
String
>
clerkCodes
=
new
ArrayList
();
clerkCodes
.
add
(
"xxxXXXX"
);
List
<
ClerkDTO
>
clerkList
=
clerkService
.
listClerk
(
storeId
,
clerkCodes
,
false
);
result
=
EntityUtil
.
changeEntityListByJSON
(
ClerkVo
.
class
,
clerkList
);
}
}
for
(
ClerkVo
vo:
result
){
if
(
StringUtils
.
isEmpty
(
vo
.
getNationCode
())){
vo
.
setNationCode
(
"86"
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
result
);
}
//选择成员列表
//选择成员列表
@RequestMapping
(
"/staff-list"
)
@RequestMapping
(
"/staff-list"
)
public
HaobanResponse
staffList
(
String
storeId
)
{
public
HaobanResponse
staffList
(
String
storeId
)
{
...
@@ -204,7 +141,7 @@ public class ClerkController extends WebBaseController{
...
@@ -204,7 +141,7 @@ public class ClerkController extends WebBaseController{
}
}
//
选择
成员列表
//
门店
成员列表
@RequestMapping
(
"/store-clerks"
)
@RequestMapping
(
"/store-clerks"
)
public
HaobanResponse
storeClerks
(
String
storeId
)
{
public
HaobanResponse
storeClerks
(
String
storeId
)
{
if
(
StringUtils
.
isAnyBlank
(
storeId
)){
if
(
StringUtils
.
isAnyBlank
(
storeId
)){
...
@@ -240,52 +177,6 @@ public class ClerkController extends WebBaseController{
...
@@ -240,52 +177,6 @@ public class ClerkController extends WebBaseController{
}
}
//成员绑定
@HttpLimit
@RequestMapping
(
"/staff-bind"
)
public
HaobanResponse
staffBind
(
String
departmentId
,
String
fromClerkCode
,
String
fromStaffDepartmentRelatedId
)
{
if
(
StringUtils
.
isAnyBlank
(
departmentId
,
fromClerkCode
,
fromStaffDepartmentRelatedId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
bindApiService
.
staffBind
(
departmentId
,
fromClerkCode
,
fromStaffDepartmentRelatedId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//成员解除绑定
@HttpLimit
@RequestMapping
(
"/clerk-single-unbind"
)
public
HaobanResponse
clerkSingleUnbind
(
String
fromClerkCode
,
String
departmentId
)
{
if
(
StringUtils
.
isAnyBlank
(
fromClerkCode
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
bindApiService
.
clerkSingleUnbind
(
fromClerkCode
,
departmentId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//成员换绑定
@HttpLimit
@RequestMapping
(
"/clerk-unbind"
)
public
HaobanResponse
clerkUnbind
(
String
departmentId
,
String
fromClerkCode
,
String
toStaffId
,
String
manager
)
{
if
(
StringUtils
.
isAnyBlank
(
fromClerkCode
,
toStaffId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
StaffDepartmentRelatedDTO
staffDepartmentRelatedDTO
=
staffDepartmentRelatedApiService
.
getOneByStaffIdAndDepartmentId
(
toStaffId
,
departmentId
);
if
(
staffDepartmentRelatedDTO
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_400017
);
}
bindApiService
.
clerkUnbind
(
departmentId
,
fromClerkCode
,
toStaffId
,
manager
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//店长转让
@HttpLimit
@RequestMapping
(
"/clerk-manager-tranfer"
)
public
HaobanResponse
clerkManagerTranfer
(
String
departmentId
,
String
fromClerkCode
,
String
toStaffDepartmentRelatedId
)
{
logger
.
info
(
"===========================》111111111111111"
);
if
(
StringUtils
.
isAnyBlank
(
fromClerkCode
,
toStaffDepartmentRelatedId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
bindApiService
.
clerkManagerTranfer
(
departmentId
,
fromClerkCode
,
toStaffDepartmentRelatedId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//新增店员
//新增店员
@HttpLimit
@HttpLimit
...
@@ -320,34 +211,38 @@ public class ClerkController extends WebBaseController{
...
@@ -320,34 +211,38 @@ public class ClerkController extends WebBaseController{
if
(
clerk
!=
null
){
if
(
clerk
!=
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10013
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10013
);
}
}
if
(
version
==
1
){
AuditSettingDTO
dto
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
AuditSettingDTO
dto
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
if
(
dto
.
getClerkChangeFlag
()
==
1
){
if
(
dto
.
getClerkChangeFlag
()
==
1
){
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkCode
,
AuditType
.
CLERK_ADD
.
getCode
());
//需要审核
if
(
auditDTO
!=
null
){
StaffDTO
staff
=
staffApiService
.
selectById
(
staffDTO
.
getStaffId
());
logger
.
info
(
"已经存在了审核记录,待审核{}"
,
clerkCode
);
AuditDTO
audit
=
new
AuditDTO
();
return
resultResponse
(
HaoBanErrCode
.
ERR_10018
);
audit
.
setCommitStaffName
(
commitName
);
audit
.
setCommitStaffId
(
staffDTO
.
getStaffId
());
audit
.
setCommitStaffImg
(
staff
.
getHeadImg
());
audit
.
setCommitStoreId
(
storeId
);
audit
.
setCommitStoreName
(
store
.
getStoreName
());
audit
.
setAuditStatus
(
0
);
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkCode"
,
clerkCode
);
json
.
put
(
"clerkName"
,
staffName
);
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
);
}
}
//需要审核
StaffDTO
staff
=
staffApiService
.
selectById
(
staffDTO
.
getStaffId
());
AuditDTO
audit
=
new
AuditDTO
();
audit
.
setCommitStaffName
(
commitName
);
audit
.
setCommitStaffId
(
staffDTO
.
getStaffId
());
audit
.
setCommitStaffImg
(
staff
.
getHeadImg
());
audit
.
setCommitStoreId
(
storeId
);
audit
.
setCommitStoreName
(
store
.
getStoreName
());
audit
.
setAuditStatus
(
0
);
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkCode"
,
clerkCode
);
json
.
put
(
"clerkName"
,
staffName
);
json
.
put
(
"headPic"
,
staff
.
getHeadImg
());
json
.
put
(
"sex"
,
sex
);
json
.
put
(
"postion"
,
postion
);
audit
.
setOldValue
(
json
.
toJSONString
());
audit
.
setCommitTime
(
new
Date
());
audit
.
setAuditType
(
3
);
audit
.
setRelatedId
(
clerkCode
);
auditApiService
.
insert
(
audit
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
//只新增gic那边的,不新增好办这边
//只新增gic那边的,不新增好办这边
boolean
flag
=
syncHaobanToGicServiceApi
.
syncClerkToGicClerkAdd
(
storeId
,
clerkCode
,
sex
,
staffName
,
phoneNumber
,
nationcode
,
postion
);
boolean
flag
=
syncHaobanToGicServiceApi
.
syncClerkToGicClerkAdd
(
storeId
,
clerkCode
,
sex
,
staffName
,
phoneNumber
,
nationcode
,
postion
);
...
@@ -361,42 +256,47 @@ public class ClerkController extends WebBaseController{
...
@@ -361,42 +256,47 @@ public class ClerkController extends WebBaseController{
@HttpLimit
@HttpLimit
@RequestMapping
(
"/staff-del"
)
@RequestMapping
(
"/staff-del"
)
public
HaobanResponse
staffDel
(
String
wxEnterpriseId
,
String
storeId
,
Integer
version
,
String
clerkIds
,
String
staffId
)
{
public
HaobanResponse
staffDel
(
String
wxEnterpriseId
,
String
storeId
,
Integer
version
,
String
clerkIds
,
String
staffId
)
{
if
(
version
!=
null
&&
version
==
1
){
AuditSettingDTO
dto
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
AuditSettingDTO
dto
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
if
(
dto
.
getClerkChangeFlag
()
==
1
){
if
(
dto
.
getClerkChangeFlag
()
==
1
){
//需要审核
//需要审核
com
.
gic
.
enterprise
.
api
.
dto
.
StoreDTO
store
=
storeService
.
getStoreByIdNoStatus
(
storeId
);
com
.
gic
.
enterprise
.
api
.
dto
.
StoreDTO
store
=
storeService
.
getStoreByIdNoStatus
(
storeId
);
//校验手机是否唯一
//校验手机是否唯一
if
(
store
==
null
)
{
if
(
store
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_400001
);
return
resultResponse
(
HaoBanErrCode
.
ERR_400001
);
}
}
StaffDTO
staff
=
staffApiService
.
selectById
(
staffId
);
StaffDTO
staff
=
staffApiService
.
selectById
(
staffId
);
String
[]
clerkIdArr
=
clerkIds
.
split
(
","
);
String
[]
clerkIdArr
=
clerkIds
.
split
(
","
);
for
(
String
clerkId
:
clerkIdArr
)
{
for
(
String
clerkId
:
clerkIdArr
)
{
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkId
,
AuditType
.
CLERK_DEL
.
getCode
());
AuditDTO
audit
=
new
AuditDTO
();
if
(
auditDTO
!=
null
){
audit
.
setCommitStaffName
(
staff
.
getStaffName
());
logger
.
info
(
"已经存在了审核记录,待审核{}"
,
clerkId
);
audit
.
setCommitStaffId
(
staffId
);
continue
;
audit
.
setCommitStaffImg
(
staff
.
getHeadImg
());
audit
.
setCommitStoreId
(
storeId
);
audit
.
setCommitStoreName
(
store
.
getStoreName
());
audit
.
setAuditStatus
(
0
);
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
audit
.
setOldValue
(
json
.
toJSONString
());
audit
.
setCommitTime
(
new
Date
());
audit
.
setAuditType
(
4
);
auditApiService
.
insert
(
audit
);
}
}
else
{
//只删除gic那边的
String
[]
clerkIdArr
=
clerkIds
.
split
(
","
);
for
(
String
clerkId
:
clerkIdArr
)
{
syncHaobanToGicServiceApi
.
delGicClerk
(
clerkId
);
}
}
AuditDTO
audit
=
new
AuditDTO
();
audit
.
setCommitStaffName
(
staff
.
getStaffName
());
audit
.
setCommitStaffId
(
staffId
);
audit
.
setCommitStaffImg
(
staff
.
getHeadImg
());
audit
.
setCommitStoreId
(
storeId
);
audit
.
setCommitStoreName
(
store
.
getStoreName
());
audit
.
setAuditStatus
(
0
);
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
audit
.
setRelatedId
(
clerkId
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
audit
.
setOldValue
(
json
.
toJSONString
());
audit
.
setCommitTime
(
new
Date
());
audit
.
setAuditType
(
4
);
auditApiService
.
insert
(
audit
);
}
}
else
{
//只删除gic那边的
String
[]
clerkIdArr
=
clerkIds
.
split
(
","
);
for
(
String
clerkId
:
clerkIdArr
)
{
syncHaobanToGicServiceApi
.
delGicClerk
(
clerkId
);
}
}
}
}
...
@@ -538,7 +438,7 @@ public class ClerkController extends WebBaseController{
...
@@ -538,7 +438,7 @@ public class ClerkController extends WebBaseController{
if
(
staff
==
null
){
if
(
staff
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10006
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10006
);
}
}
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerk
.
getStoreId
()
,
AuditType
.
CLERK_BIND
.
getCode
());
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerk
Id
,
AuditType
.
CLERK_BIND
.
getCode
());
if
(
auditDTO
!=
null
){
if
(
auditDTO
!=
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10018
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10018
);
}
}
...
@@ -573,7 +473,7 @@ public class ClerkController extends WebBaseController{
...
@@ -573,7 +473,7 @@ public class ClerkController extends WebBaseController{
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
audit
.
setStatusFlag
(
1
);
audit
.
setRelatedId
(
staff
Id
);
audit
.
setRelatedId
(
clerk
Id
);
JSONObject
json
=
new
JSONObject
();
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
json
.
put
(
"clerkId"
,
clerkId
);
...
@@ -602,7 +502,7 @@ public class ClerkController extends WebBaseController{
...
@@ -602,7 +502,7 @@ public class ClerkController extends WebBaseController{
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
audit
.
setStatusFlag
(
1
);
audit
.
setRelatedId
(
staff
Id
);
audit
.
setRelatedId
(
clerk
Id
);
JSONObject
json
=
new
JSONObject
();
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
json
.
put
(
"clerkId"
,
clerkId
);
...
@@ -662,7 +562,8 @@ public class ClerkController extends WebBaseController{
...
@@ -662,7 +562,8 @@ public class ClerkController extends WebBaseController{
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
audit
.
setStatusFlag
(
1
);
audit
.
setRelatedId
(
staffId
);
audit
.
setRelatedId
(
staffId
);
audit
.
setRelatedId
(
clerkId
);
JSONObject
json
=
new
JSONObject
();
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
json
.
put
(
"clerkId"
,
clerkId
);
json
.
put
(
"clerkCode"
,
clerkCode
);
json
.
put
(
"clerkCode"
,
clerkCode
);
...
...
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