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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
118 deletions
+57
-118
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+25
-0
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+14
-1
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+18
-117
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
b639ede0
...
...
@@ -170,6 +170,19 @@ public class AuditApiServiceImpl implements AuditApiService{
logger
.
info
(
"code已存在"
);
tab
.
setAuditStatus
(
5
);
auditMapper
.
updateByPrimaryKeySelective
(
tab
);
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
insertBatchLog
(
batchId
,
AuditRsultType
.
fail
.
getCode
(),
tab
);
}
return
"0"
;
}
else
{
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
obj
.
getClerkId
());
if
(
clerkDTO
==
null
){
tab
.
setAuditStatus
(
5
);
tab
.
setAuditReason
(
"gic已删除该导购"
);
auditMapper
.
updateByPrimaryKeySelective
(
tab
);
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
insertBatchLog
(
batchId
,
AuditRsultType
.
fail
.
getCode
(),
tab
);
}
return
"0"
;
}
else
{
staffClerkRelation
=
new
StaffClerkRelationDTO
();
...
...
@@ -181,6 +194,7 @@ public class AuditApiServiceImpl implements AuditApiService{
staffClerkRelation
.
setWxUserId
(
obj
.
getWxUserId
());
staffClerkRelationApiService
.
insert
(
staffClerkRelation
);
}
}
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
insertBatchLog
(
batchId
,
AuditRsultType
.
success
.
getCode
(),
tab
);
}
...
...
@@ -190,6 +204,16 @@ public class AuditApiServiceImpl implements AuditApiService{
//门店导购新增
String
oldValue
=
tab
.
getOldValue
();
AuditStaffDTO
obj
=
JSONObject
.
parseObject
(
oldValue
,
AuditStaffDTO
.
class
);
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
obj
.
getClerkId
());
if
(
clerkDTO
==
null
){
tab
.
setAuditStatus
(
5
);
tab
.
setAuditReason
(
"gic已删除该导购"
);
auditMapper
.
updateByPrimaryKeySelective
(
tab
);
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
batchId
)){
insertBatchLog
(
batchId
,
AuditRsultType
.
fail
.
getCode
(),
tab
);
}
return
"0"
;
}
else
{
boolean
flag
=
syncHaobanToGicServiceApi
.
syncClerkToGicClerkAdd
(
tab
.
getCommitStoreId
(),
obj
.
getClerkCode
(),
obj
.
getSex
(),
obj
.
getStaffName
(),
obj
.
getPhoneNumber
(),
obj
.
getNationCode
(),
null
);
if
(!
flag
){
//失败
...
...
@@ -206,6 +230,7 @@ public class AuditApiServiceImpl implements AuditApiService{
}
staffDepartmentRelatedApiService
.
sendClerkAdd
(
obj
.
getClerkId
(),
obj
.
getClerkCode
(),
1
,
""
);
}
}
}
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;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
...
...
@@ -209,6 +210,11 @@ public class AuditController extends WebBaseController{
if
(
staffClerkRelation
!=
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_111117
);
}
else
{
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
if
(
clerkDTO
==
null
){
audit
.
setAuditStatus
(
5
);
audit
.
setAuditReason
(
"gic已删除该导购"
);
}
else
{
staffClerkRelation
=
new
StaffClerkRelationDTO
();
staffClerkRelation
.
setEnterpriseId
(
enterpriseId
);
staffClerkRelation
.
setClerkCode
(
clerkCode
);
...
...
@@ -218,12 +224,18 @@ public class AuditController extends WebBaseController{
staffClerkRelation
.
setWxUserId
(
wxUserId
);
staffClerkRelationApiService
.
insert
(
staffClerkRelation
);
audit
.
setAuditStatus
(
1
);
}
//发送消息
staffDepartmentRelatedApiService
.
sendClerkBind
(
clerkId
,
clerkCode
,
auditStatus
,
auditReason
);
}
}
}
if
(
audit
.
getAuditType
()
==
AuditType
.
CLERK_ADD
.
getCode
()){
//导购新增
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
if
(
clerkDTO
==
null
){
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
);
...
...
@@ -231,6 +243,7 @@ public class AuditController extends WebBaseController{
audit
.
setAuditStatus
(
1
);
staffDepartmentRelatedApiService
.
sendClerkAdd
(
clerkId
,
clerkCode
,
auditStatus
,
auditReason
);
}
}
if
(
audit
.
getAuditType
()
==
AuditType
.
CLERK_DEL
.
getCode
()){
//导购删除
syncHaobanToGicServiceApi
.
delGicClerk
(
clerkId
);
...
...
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{
private
ClerkNewService
clerkNewService
;
@Autowired
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"
)
public
HaobanResponse
staffList
(
String
storeId
)
{
...
...
@@ -204,7 +141,7 @@ public class ClerkController extends WebBaseController{
}
//
选择
成员列表
//
门店
成员列表
@RequestMapping
(
"/store-clerks"
)
public
HaobanResponse
storeClerks
(
String
storeId
)
{
if
(
StringUtils
.
isAnyBlank
(
storeId
)){
...
...
@@ -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
...
...
@@ -320,9 +211,13 @@ public class ClerkController extends WebBaseController{
if
(
clerk
!=
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10013
);
}
if
(
version
==
1
){
AuditSettingDTO
dto
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
if
(
dto
.
getClerkChangeFlag
()
==
1
){
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkCode
,
AuditType
.
CLERK_ADD
.
getCode
());
if
(
auditDTO
!=
null
){
logger
.
info
(
"已经存在了审核记录,待审核{}"
,
clerkCode
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10018
);
}
//需要审核
StaffDTO
staff
=
staffApiService
.
selectById
(
staffDTO
.
getStaffId
());
AuditDTO
audit
=
new
AuditDTO
();
...
...
@@ -345,10 +240,10 @@ public class ClerkController extends WebBaseController{
audit
.
setOldValue
(
json
.
toJSONString
());
audit
.
setCommitTime
(
new
Date
());
audit
.
setAuditType
(
3
);
audit
.
setRelatedId
(
clerkCode
);
auditApiService
.
insert
(
audit
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
//只新增gic那边的,不新增好办这边
boolean
flag
=
syncHaobanToGicServiceApi
.
syncClerkToGicClerkAdd
(
storeId
,
clerkCode
,
sex
,
staffName
,
phoneNumber
,
nationcode
,
postion
);
if
(!
flag
){
...
...
@@ -361,7 +256,6 @@ public class ClerkController extends WebBaseController{
@HttpLimit
@RequestMapping
(
"/staff-del"
)
public
HaobanResponse
staffDel
(
String
wxEnterpriseId
,
String
storeId
,
Integer
version
,
String
clerkIds
,
String
staffId
)
{
if
(
version
!=
null
&&
version
==
1
){
AuditSettingDTO
dto
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
if
(
dto
.
getClerkChangeFlag
()
==
1
){
//需要审核
...
...
@@ -373,6 +267,12 @@ public class ClerkController extends WebBaseController{
StaffDTO
staff
=
staffApiService
.
selectById
(
staffId
);
String
[]
clerkIdArr
=
clerkIds
.
split
(
","
);
for
(
String
clerkId
:
clerkIdArr
)
{
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkId
,
AuditType
.
CLERK_DEL
.
getCode
());
if
(
auditDTO
!=
null
){
logger
.
info
(
"已经存在了审核记录,待审核{}"
,
clerkId
);
continue
;
}
AuditDTO
audit
=
new
AuditDTO
();
audit
.
setCommitStaffName
(
staff
.
getStaffName
());
audit
.
setCommitStaffId
(
staffId
);
...
...
@@ -383,6 +283,7 @@ public class ClerkController extends WebBaseController{
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
audit
.
setRelatedId
(
clerkId
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
...
...
@@ -398,7 +299,6 @@ public class ClerkController extends WebBaseController{
syncHaobanToGicServiceApi
.
delGicClerk
(
clerkId
);
}
}
}
// DepartmentDTO departmentDTO = departmentApiService.selectByRelatedId(storeId);
...
...
@@ -538,7 +438,7 @@ public class ClerkController extends WebBaseController{
if
(
staff
==
null
){
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
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10018
);
}
...
...
@@ -573,7 +473,7 @@ public class ClerkController extends WebBaseController{
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
audit
.
setRelatedId
(
staff
Id
);
audit
.
setRelatedId
(
clerk
Id
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
...
...
@@ -602,7 +502,7 @@ public class ClerkController extends WebBaseController{
audit
.
setWxEnterpriseId
(
wxEnterpriseId
);
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
audit
.
setRelatedId
(
staff
Id
);
audit
.
setRelatedId
(
clerk
Id
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
...
...
@@ -662,6 +562,7 @@ public class ClerkController extends WebBaseController{
audit
.
setEnterpriseId
(
store
.
getEnterpriseId
());
audit
.
setStatusFlag
(
1
);
audit
.
setRelatedId
(
staffId
);
audit
.
setRelatedId
(
clerkId
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clerkId"
,
clerkId
);
...
...
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