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
df59ae34
Commit
df59ae34
authored
Mar 26, 2020
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导购新增接口
parent
7ac036d6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
219 additions
and
112 deletions
+219
-112
GicClerkDTO.java
.../main/java/com/gic/haoban/manage/api/dto/GicClerkDTO.java
+111
-0
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+3
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+104
-111
ServiceTest.java
haoban-manage3-service/src/test/java/ServiceTest.java
+1
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/GicClerkDTO.java
0 → 100644
View file @
df59ae34
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
public
class
GicClerkDTO
implements
Serializable
{
private
String
storeId
;
private
String
clerkCode
;
private
String
clerkName
;
private
String
phoneNumber
;
private
String
nationcode
;
private
Integer
clerkGender
;
private
String
headImgUrl
;
private
String
postionName
;
private
String
enterpriseId
;
private
Integer
status
;
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
private
static
final
long
serialVersionUID
=
1L
;
public
String
getStoreId
()
{
return
storeId
;
}
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
}
public
String
getClerkCode
()
{
return
clerkCode
;
}
public
void
setClerkCode
(
String
clerkCode
)
{
this
.
clerkCode
=
clerkCode
;
}
public
String
getClerkName
()
{
return
clerkName
;
}
public
void
setClerkName
(
String
clerkName
)
{
this
.
clerkName
=
clerkName
;
}
public
String
getPhoneNumber
()
{
return
phoneNumber
;
}
public
void
setPhoneNumber
(
String
phoneNumber
)
{
this
.
phoneNumber
=
phoneNumber
;
}
public
String
getNationcode
()
{
return
nationcode
;
}
public
void
setNationcode
(
String
nationcode
)
{
this
.
nationcode
=
nationcode
;
}
public
Integer
getClerkGender
()
{
return
clerkGender
;
}
public
void
setClerkGender
(
Integer
clerkGender
)
{
this
.
clerkGender
=
clerkGender
;
}
public
String
getHeadImgUrl
()
{
return
headImgUrl
;
}
public
void
setHeadImgUrl
(
String
headImgUrl
)
{
this
.
headImgUrl
=
headImgUrl
;
}
public
String
getPostionName
()
{
return
postionName
;
}
public
void
setPostionName
(
String
postionName
)
{
this
.
postionName
=
postionName
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
df59ae34
...
...
@@ -5,6 +5,7 @@ import java.util.List;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.GicClerkDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.UserLoginLogDTO
;
...
...
@@ -42,6 +43,8 @@ public interface StaffApiService {
public
void
syncGicClerk
(
String
fieldListString
);
public
void
addGicClerk
(
GicClerkDTO
clerkDTO
);
StaffDepartmentRelatedDTO
getDepartmentIdAndCode
(
String
departmentId
,
String
code
);
void
initWxUser
(
String
corpid
,
String
suiteid
,
String
wxEnterpriseId
,
Integer
wxDepartmentId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
df59ae34
...
...
@@ -10,6 +10,8 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.manage.api.dto.*
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -35,12 +37,6 @@ import com.gic.haoban.common.utils.HaobanResponse;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.SyncJsonColumnDTO
;
import
com.gic.haoban.manage.api.dto.UserLoginLogDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
...
...
@@ -506,120 +502,117 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public
void
addGicClerk
(
GicClerkDTO
clerkDTO
)
{
logger
.
info
(
"同步gic店员:{}"
,
JSONObject
.
toJSONString
(
clerkDTO
));
addClerkByGic
(
clerkDTO
);
}
@Override
public
void
syncGicClerk
(
String
fieldListString
)
{
logger
.
info
(
"【同步店员】fieldList={}"
,
fieldListString
);
List
<
SyncJsonColumnDTO
>
fieldList
=
JSONArray
.
parseArray
(
fieldListString
,
SyncJsonColumnDTO
.
class
);
if
(
fieldList
.
isEmpty
()){
return
;
}
String
gicStoreId
=
""
;
String
code
=
""
;
String
staffName
=
""
;
String
phoneNumber
=
""
;
String
nationcode
=
""
;
Integer
sex
=
null
;
String
headPic
=
""
;
Integer
status
=
null
;
String
postion
=
""
;
String
gicClerkId
=
""
;
String
enterpriseId
=
""
;
for
(
SyncJsonColumnDTO
syncJsonColumnDTO:
fieldList
){
String
name
=
StringUtil
.
camelName
(
syncJsonColumnDTO
.
getName
());
String
value
=
syncJsonColumnDTO
.
getValue
();
if
(
"clerkId"
.
equals
(
name
)){
gicClerkId
=
value
;
if
(
StringUtils
.
isBlank
(
gicClerkId
)){
return
;
}
continue
;
}
if
(
"enterpriseId"
.
equals
(
name
)){
enterpriseId
=
value
;
if
(
StringUtils
.
isBlank
(
enterpriseId
)){
return
;
}
continue
;
}
if
(
"storeId"
.
equals
(
name
)){
gicStoreId
=
value
;
if
(
StringUtils
.
isBlank
(
gicStoreId
)){
return
;
}
continue
;
}
if
(
"clerkName"
.
equals
(
name
)){
staffName
=
value
;
continue
;
}
if
(
"clerkCode"
.
equals
(
name
)){
code
=
value
;
continue
;
}
if
(
"clerkGender"
.
equals
(
name
)){
sex
=
value
==
null
?
null
:
Integer
.
parseInt
(
value
);
continue
;
}
if
(
"status"
.
equals
(
name
)){
status
=
value
==
null
?
null
:
Integer
.
parseInt
(
value
);
continue
;
}
if
(
"headImgUrl"
.
equals
(
name
)){
headPic
=
value
;
continue
;
}
if
(
"phoneNumber"
.
equals
(
name
)){
phoneNumber
=
value
;
continue
;
}
if
(
"postionName"
.
equals
(
postion
)){
postion
=
value
;
continue
;
}
if
(
"nationcode"
.
equals
(
name
)){
if
(
StringUtils
.
isBlank
(
value
)){
nationcode
=
"86"
;
}
else
{
nationcode
=
value
;
}
continue
;
}
}
if
(
StringUtils
.
isBlank
(
gicStoreId
)){
logger
.
info
(
"【同步店员】fieldList={}"
,
fieldListString
);
List
<
SyncJsonColumnDTO
>
fieldList
=
JSONArray
.
parseArray
(
fieldListString
,
SyncJsonColumnDTO
.
class
);
if
(
fieldList
.
isEmpty
())
{
return
;
}
GicClerkDTO
clerkMid
=
new
GicClerkDTO
();
for
(
SyncJsonColumnDTO
syncJsonColumnDTO
:
fieldList
)
{
String
name
=
StringUtil
.
camelName
(
syncJsonColumnDTO
.
getName
());
String
value
=
syncJsonColumnDTO
.
getValue
();
if
(
"enterpriseId"
.
equals
(
name
))
{
if
(
StringUtils
.
isBlank
(
value
))
{
return
;
}
clerkMid
.
setEnterpriseId
(
value
);
continue
;
}
if
(
"storeId"
.
equals
(
name
))
{
if
(
StringUtils
.
isBlank
(
value
))
{
return
;
}
clerkMid
.
setStoreId
(
value
);
continue
;
}
if
(
"clerkName"
.
equals
(
name
))
{
clerkMid
.
setClerkName
(
value
);
continue
;
}
if
(
"clerkCode"
.
equals
(
name
))
{
clerkMid
.
setClerkCode
(
value
);
continue
;
}
if
(
"clerkGender"
.
equals
(
name
))
{
clerkMid
.
setClerkGender
((
value
==
null
?
null
:
Integer
.
parseInt
(
value
)));
continue
;
}
if
(
"status"
.
equals
(
name
))
{
clerkMid
.
setStatus
((
value
==
null
?
null
:
Integer
.
parseInt
(
value
)));
continue
;
}
if
(
"headImgUrl"
.
equals
(
name
))
{
clerkMid
.
setHeadImgUrl
(
value
);
continue
;
}
if
(
"phoneNumber"
.
equals
(
name
))
{
clerkMid
.
setPhoneNumber
(
value
);
continue
;
}
if
(
"postionName"
.
equals
(
name
))
{
clerkMid
.
setPostionName
(
value
);
continue
;
}
if
(
"nationcode"
.
equals
(
name
))
{
clerkMid
.
setNationcode
((
StringUtils
.
isBlank
(
value
)
?
"86"
:
value
));
continue
;
}
}
addClerkByGic
(
clerkMid
);
}
private
void
addClerkByGic
(
GicClerkDTO
clerkDTO
)
{
String
gicStoreId
=
clerkDTO
.
getStoreId
();
String
code
=
clerkDTO
.
getClerkCode
();
String
staffName
=
clerkDTO
.
getClerkName
();
String
phoneNumber
=
clerkDTO
.
getPhoneNumber
();
String
nationcode
=
clerkDTO
.
getNationcode
();
Integer
sex
=
clerkDTO
.
getClerkGender
();
String
headPic
=
clerkDTO
.
getHeadImgUrl
();
Integer
status
=
1
;
String
postion
=
clerkDTO
.
getPostionName
();
String
enterpriseId
=
clerkDTO
.
getEnterpriseId
();
if
(
StringUtils
.
isBlank
(
gicStoreId
)){
logger
.
info
(
"【店员同步】gicStoreId为空"
);
return
;
}
TabHaobanDepartment
department
=
departmentService
.
selectByRelatedId
(
gicStoreId
);
if
(
department
==
null
){
// try {
// Thread.sleep(3 * 1000);
// department = departmentService.selectByRelatedId(gicStoreId);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// if(department == null){
logger
.
info
(
"【店员同步】department为空"
);
return
;
// }
logger
.
info
(
"【店员同步】失败====department为空"
);
return
;
}
String
departmentId
=
department
.
getDepartmentId
();
String
wxEnterpriseId
=
department
.
getWxEnterpriseId
();
StaffDTO
staff
=
this
.
selectByNationcodeAndPhoneNumber
(
wxEnterpriseId
,
nationcode
,
phoneNumber
);
if
(
staff
==
null
){
if
(
staff
==
null
){
if
(
status
!=
1
){
return
;
}
else
{
...
...
@@ -697,7 +690,7 @@ public class StaffApiServiceImpl implements StaffApiService {
staffRelated
.
setClerkCode
(
code
);
staffDepartmentRelatedMapper
.
updateByPrimaryKey
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaffDepartmentRelated
.
class
,
staffRelated
));
}
// ClerkDTO clerkDTO= clerkService.getClerkByCodeNoStatus(enterpriseId,code);
// if(clerkDTO != null && (!clerkDTO.getClerkName().equals(staffName) || !staff.getPhoneNumber().equals(clerkDTO.getPhoneNumber()))){
// logger.info("【员工修改】clerkDTO={}",JSON.toJSONString(clerkDTO));
...
...
haoban-manage3-service/src/test/java/ServiceTest.java
View file @
df59ae34
...
...
@@ -26,7 +26,7 @@ public class ServiceTest {
@Test
public
void
test1
()
{
String
corpSelfExternalUseridInfo
=
qywxUserApiService
.
getCorpSelfExternalUseridInfo
(
"ww50d418adce14b4a9"
,
"1azg6LG5Vj_YKFO-X27to4S4x_y-f6APR0fwE9YnQd8"
,
"wm
59NLDQAAC2w0nEhwp20s24xSRYgQDA
"
);
,
"1azg6LG5Vj_YKFO-X27to4S4x_y-f6APR0fwE9YnQd8"
,
"wm
-0J8CQAAbGIhtnLd51B97OO_0gf3zw
"
);
System
.
out
.
println
(
corpSelfExternalUseridInfo
);
}
...
...
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