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
80c84e18
Commit
80c84e18
authored
Apr 21, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
24bd27f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+29
-3
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+4
-0
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
80c84e18
...
...
@@ -26,6 +26,8 @@ import com.gic.commons.util.EntityUtil;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.app.customer.service.api.service.DistributeApiService
;
import
com.gic.haoban.base.api.common.ShowFrontMessageException
;
import
com.gic.haoban.common.utils.GooglePhoneNumberUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
...
...
@@ -46,6 +48,7 @@ import com.gic.haoban.manage.web.interceptor.WebInterceptor;
import
com.gic.haoban.manage.web.vo.ClerkVo
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.google.i18n.phonenumbers.PhoneNumberUtil
;
@RestController
public
class
ClerkController
extends
WebBaseController
{
...
...
@@ -267,13 +270,36 @@ public class ClerkController extends WebBaseController{
if
(
StringUtils
.
isBlank
(
staffName
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10004
);
}
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
);
}
boolean
flag
=
syncHaobanToGicServiceApi
.
syncClerkToGicClerkAdd
(
storeId
,
clerkCode
,
sex
,
staffName
,
phoneNumber
,
nationcode
,
postion
);
if
(!
flag
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10010
);
com
.
gic
.
enterprise
.
api
.
dto
.
StoreDTO
store
=
storeService
.
getStoreByIdNoStatus
(
storeId
);
//校验手机是否唯一
if
(
store
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_400001
);
}
ClerkDTO
clerk
=
clerkService
.
getClerkByCodeNoDel
(
store
.
getEnterpriseId
(),
clerkCode
);
if
(
clerk
!=
null
){
DepartmentDTO
department
=
departmentApiService
.
selectByRelatedId
(
storeId
);
if
(
department
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_400001
);
}
StaffDepartmentRelatedDTO
staffRelated
=
staffApiService
.
getDepartmentIdAndCode
(
department
.
getDepartmentId
(),
clerkCode
);
if
(
staffRelated
!=
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10013
);
}
}
if
(
clerk
!=
null
&&
StringUtils
.
isNotBlank
(
clerk
.
getPhoneNumber
())){
syncHaobanToGicServiceApi
.
syncHaobanClerkPhoneNumberToGic
(
clerk
.
getClerkId
(),
clerk
.
getPhoneNumber
());
}
else
{
boolean
flag
=
syncHaobanToGicServiceApi
.
syncClerkToGicClerkAdd
(
storeId
,
clerkCode
,
sex
,
staffName
,
phoneNumber
,
nationcode
,
postion
);
if
(!
flag
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10010
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
80c84e18
...
...
@@ -194,9 +194,13 @@ public enum HaoBanErrCode {
ERR_10009
(
10009
,
"门店不存在"
),
ERR_10010
(
10010
,
"gic新增失败"
),
ERR_10011
(
10011
,
"每月最多可刷新4次"
),
ERR_10012
(
10012
,
"手机号格式不正确"
),
ERR_10013
(
10013
,
"code已经存在"
),
ERR_999
(
999
,
"操作失败"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
ERR_OTHER
(-
999
,
"未知错误code"
);
private
int
code
;
private
String
msg
;
...
...
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