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
39030b0a
Commit
39030b0a
authored
Apr 29, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
8313f86c
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
407 additions
and
85 deletions
+407
-85
ApplicationApiService.java
.../gic/haoban/manage/api/service/ApplicationApiService.java
+2
-0
TabHaobanWxEnterpriseApplicationRelatedMapper.java
...mapper/TabHaobanWxEnterpriseApplicationRelatedMapper.java
+25
-0
TabHaobanWxEnterpriseApplicationRelated.java
...rvice/entity/TabHaobanWxEnterpriseApplicationRelated.java
+69
-0
WxEnterpriseApplicationRelatedService.java
...ervice/service/WxEnterpriseApplicationRelatedService.java
+14
-0
WxEnterpriseApplicationRelatedServiceImpl.java
...rvice/impl/WxEnterpriseApplicationRelatedServiceImpl.java
+51
-0
ApplicationApiServiceImpl.java
...e/service/service/out/impl/ApplicationApiServiceImpl.java
+26
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+89
-82
TabHaobanWxEnterpriseApplicationRelatedMapper.xml
.../mapper/TabHaobanWxEnterpriseApplicationRelatedMapper.xml
+126
-0
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+4
-2
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+1
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/ApplicationApiService.java
View file @
39030b0a
...
@@ -10,4 +10,6 @@ public interface ApplicationApiService {
...
@@ -10,4 +10,6 @@ public interface ApplicationApiService {
List
<
ApplicationDTO
>
listByApplications
(
List
<
String
>
applicationIds
);
List
<
ApplicationDTO
>
listByApplications
(
List
<
String
>
applicationIds
);
List
<
ApplicationDTO
>
listApplicationByWxEnterpriseId
(
String
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanWxEnterpriseApplicationRelatedMapper.java
0 → 100644
View file @
39030b0a
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
java.util.List
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated
;
public
interface
TabHaobanWxEnterpriseApplicationRelatedMapper
{
int
deleteByPrimaryKey
(
String
wxEnterpriseApplicationRelatedId
);
int
insert
(
TabHaobanWxEnterpriseApplicationRelated
record
);
int
insertSelective
(
TabHaobanWxEnterpriseApplicationRelated
record
);
TabHaobanWxEnterpriseApplicationRelated
selectByPrimaryKey
(
String
wxEnterpriseApplicationRelatedId
);
int
updateByPrimaryKeySelective
(
TabHaobanWxEnterpriseApplicationRelated
record
);
int
updateByPrimaryKey
(
TabHaobanWxEnterpriseApplicationRelated
record
);
TabHaobanWxEnterpriseApplicationRelated
selectByApplicationIdAndWxEnterpriseId
(
String
applicationId
,
String
wxEnterpriseId
);
List
<
TabHaobanWxEnterpriseApplicationRelated
>
listByWxEnterpriseId
(
String
wxEnterpriseId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanWxEnterpriseApplicationRelated.java
0 → 100644
View file @
39030b0a
package
com
.
gic
.
haoban
.
manage
.
service
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
public
class
TabHaobanWxEnterpriseApplicationRelated
implements
Serializable
{
private
String
wxEnterpriseApplicationRelatedId
;
private
String
applicationId
;
private
String
wxEnterpriseId
;
private
Integer
statusFlag
;
private
Date
createTime
;
private
Date
updateTime
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getWxEnterpriseApplicationRelatedId
()
{
return
wxEnterpriseApplicationRelatedId
;
}
public
void
setWxEnterpriseApplicationRelatedId
(
String
wxEnterpriseApplicationRelatedId
)
{
this
.
wxEnterpriseApplicationRelatedId
=
wxEnterpriseApplicationRelatedId
==
null
?
null
:
wxEnterpriseApplicationRelatedId
.
trim
();
}
public
String
getApplicationId
()
{
return
applicationId
;
}
public
void
setApplicationId
(
String
applicationId
)
{
this
.
applicationId
=
applicationId
==
null
?
null
:
applicationId
.
trim
();
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
==
null
?
null
:
wxEnterpriseId
.
trim
();
}
public
Integer
getStatusFlag
()
{
return
statusFlag
;
}
public
void
setStatusFlag
(
Integer
statusFlag
)
{
this
.
statusFlag
=
statusFlag
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxEnterpriseApplicationRelatedService.java
0 → 100644
View file @
39030b0a
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
import
java.util.List
;
import
java.util.Set
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated
;
public
interface
WxEnterpriseApplicationRelatedService
{
void
saveEnterpriseApplicationRelateds
(
Set
<
String
>
applicationSet
,
String
wxEnterpriseId
);
List
<
TabHaobanWxEnterpriseApplicationRelated
>
listByWxEnterpriseId
(
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseApplicationRelatedServiceImpl.java
0 → 100644
View file @
39030b0a
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Set
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanWxEnterpriseApplicationRelatedMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated
;
import
com.gic.haoban.manage.service.service.WxEnterpriseApplicationRelatedService
;
@Service
public
class
WxEnterpriseApplicationRelatedServiceImpl
implements
WxEnterpriseApplicationRelatedService
{
@Autowired
private
TabHaobanWxEnterpriseApplicationRelatedMapper
mapper
;
@Override
public
void
saveEnterpriseApplicationRelateds
(
Set
<
String
>
applicationSet
,
String
wxEnterpriseId
){
List
<
TabHaobanWxEnterpriseApplicationRelated
>
list
=
mapper
.
listByWxEnterpriseId
(
wxEnterpriseId
);
//删除已经设置过的 这次不设置的应用
for
(
TabHaobanWxEnterpriseApplicationRelated
tabHaobanWxEnterpriseApplicationRelated
:
list
)
{
if
(!
applicationSet
.
contains
(
tabHaobanWxEnterpriseApplicationRelated
.
getApplicationId
())){
mapper
.
deleteByPrimaryKey
(
tabHaobanWxEnterpriseApplicationRelated
.
getWxEnterpriseApplicationRelatedId
());
}
}
//新增设置的应用
for
(
String
applicationId
:
applicationSet
)
{
TabHaobanWxEnterpriseApplicationRelated
tab
=
mapper
.
selectByApplicationIdAndWxEnterpriseId
(
applicationId
,
wxEnterpriseId
);
if
(
tab
!=
null
){
tab
=
new
TabHaobanWxEnterpriseApplicationRelated
();
tab
.
setApplicationId
(
applicationId
);
tab
.
setCreateTime
(
new
Date
());
tab
.
setUpdateTime
(
tab
.
getCreateTime
());
tab
.
setStatusFlag
(
1
);
tab
.
setWxEnterpriseId
(
wxEnterpriseId
);
tab
.
setWxEnterpriseApplicationRelatedId
(
StringUtil
.
randomUUID
());
mapper
.
insert
(
tab
);
}
}
}
@Override
public
List
<
TabHaobanWxEnterpriseApplicationRelated
>
listByWxEnterpriseId
(
String
wxEnterpriseId
)
{
return
mapper
.
listByWxEnterpriseId
(
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/ApplicationApiServiceImpl.java
View file @
39030b0a
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -11,7 +14,9 @@ import com.gic.haoban.manage.api.dto.ApplicationDTO;
...
@@ -11,7 +14,9 @@ import com.gic.haoban.manage.api.dto.ApplicationDTO;
import
com.gic.haoban.manage.api.service.ApplicationApiService
;
import
com.gic.haoban.manage.api.service.ApplicationApiService
;
import
com.gic.haoban.manage.service.dao.mapper.ApplicationMapper
;
import
com.gic.haoban.manage.service.dao.mapper.ApplicationMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanApplication
;
import
com.gic.haoban.manage.service.entity.TabHaobanApplication
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated
;
import
com.gic.haoban.manage.service.service.ApplicationService
;
import
com.gic.haoban.manage.service.service.ApplicationService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseApplicationRelatedService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -22,6 +27,8 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
...
@@ -22,6 +27,8 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
private
ApplicationService
applicationService
;
private
ApplicationService
applicationService
;
@Autowired
@Autowired
private
ApplicationMapper
applicationMapper
;
private
ApplicationMapper
applicationMapper
;
@Autowired
private
WxEnterpriseApplicationRelatedService
wxEnterpriseApplicationRelatedService
;
@Override
@Override
public
List
<
ApplicationDTO
>
listApplication
()
{
public
List
<
ApplicationDTO
>
listApplication
()
{
List
<
TabHaobanApplication
>
list
=
applicationService
.
listApplication
();
List
<
TabHaobanApplication
>
list
=
applicationService
.
listApplication
();
...
@@ -37,5 +44,24 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
...
@@ -37,5 +44,24 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
List
<
ApplicationDTO
>
result
=
EntityUtil
.
changeEntityListByJSON
(
ApplicationDTO
.
class
,
list
);
List
<
ApplicationDTO
>
result
=
EntityUtil
.
changeEntityListByJSON
(
ApplicationDTO
.
class
,
list
);
return
result
;
return
result
;
}
}
void
saveEnterpriseApplicationRelateds
(
Set
<
String
>
applicationSet
,
String
wxEnterpriseId
){
wxEnterpriseApplicationRelatedService
.
saveEnterpriseApplicationRelateds
(
applicationSet
,
wxEnterpriseId
);
}
@Override
public
List
<
ApplicationDTO
>
listApplicationByWxEnterpriseId
(
String
wxEnterpriseId
)
{
List
<
TabHaobanApplication
>
list
=
applicationService
.
listApplication
();
List
<
TabHaobanWxEnterpriseApplicationRelated
>
relatedList
=
wxEnterpriseApplicationRelatedService
.
listByWxEnterpriseId
(
wxEnterpriseId
);
List
<
String
>
applicationIds
=
relatedList
.
stream
().
map
(
s
->
s
.
getApplicationId
()).
collect
(
Collectors
.
toList
());
List
<
TabHaobanApplication
>
result
=
new
ArrayList
<
TabHaobanApplication
>();
for
(
TabHaobanApplication
tabHaobanApplication
:
list
)
{
if
(
applicationIds
.
contains
(
tabHaobanApplication
.
getApplicationId
())){
result
.
add
(
tabHaobanApplication
);
}
}
return
EntityUtil
.
changeEntityListByJSON
(
ApplicationDTO
.
class
,
result
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
39030b0a
...
@@ -541,62 +541,9 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -541,62 +541,9 @@ public class StaffApiServiceImpl implements StaffApiService {
related
.
setStaffName
(
staffName
);
related
.
setStaffName
(
staffName
);
staffDepartmentRelatedMapper
.
updateByPrimaryKeySelective
(
related
);
staffDepartmentRelatedMapper
.
updateByPrimaryKeySelective
(
related
);
}
}
if
(!
syncGic
)
{
logger
.
info
(
"【员工修改】related={}"
,
JSON
.
toJSONString
(
related
));
updateGicClerk
(
oldStaff
,
staffDTO
,
addId
,
related
);
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
related
.
getClerkCode
())){
}
logger
.
info
(
"【员工修改】oldName={},name={},oldPhoneNumber={},phoneNumber={}"
,
oldStaff
.
getStaffName
(),
staffDTO
.
getStaffName
(),
related
.
getPhoneNumber
(),
staffDTO
.
getPhoneNumber
());
logger
.
info
(
"【员工修复】-------------------"
);
TabHaobanDepartment
department
=
departmentService
.
selectById
(
addId
);
if
(
department
==
null
){
return
;
}
String
enterpriseId
=
""
;
if
(
department
.
getIsStore
()
==
null
||
department
.
getIsStore
()
==
0
){
com
.
gic
.
enterprise
.
api
.
dto
.
DepartmentDTO
dto
=
gicDepartmentService
.
getDeptment
(
department
.
getRelatedId
());
if
(
dto
==
null
){
StoreGroupDTO
group
=
storeGroupService
.
getStoreGroupById
(
department
.
getRelatedId
());
if
(
group
!=
null
){
enterpriseId
=
group
.
getEnterpriseId
();
}
}
else
{
enterpriseId
=
dto
.
getEnterpriseId
();
}
}
else
{
StoreDTO
store
=
storeService
.
getStore
(
department
.
getRelatedId
());
if
(
store
==
null
){
return
;
}
enterpriseId
=
store
.
getEnterpriseId
();
}
if
(!
syncGic
)
{
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByCodeNoStatus
(
enterpriseId
,
related
.
getClerkCode
());
//if(!staffDTO.getPhoneNumber().equals(related.getPhoneNumber())||!staffDTO.getStaffName().equals(clerkDTO.getStaffName())){
logger
.
info
(
"clerkDto:{}"
,
JSONObject
.
toJSONString
(
clerkDTO
));
String
headPic
=
staffDTO
.
getHeadImg
();
if
(
StringUtils
.
isBlank
(
staffDTO
.
getPhoneNumber
()))
{
staffDTO
.
setPhoneNumber
(
""
);
}
if
(
StringUtils
.
isBlank
(
clerkDTO
.
getPhoneNumber
()))
{
clerkDTO
.
setPhoneNumber
(
""
);
}
if
(
clerkDTO
!=
null
&&
(
StringUtils
.
isNotBlank
(
staffName
)
&&
!
clerkDTO
.
getClerkName
().
equals
(
staffName
)
||
!
staffDTO
.
getPhoneNumber
().
equals
(
clerkDTO
.
getPhoneNumber
()))
||
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
headPic
)
&&
!
headPic
.
equals
(
clerkDTO
.
getHeadImgUrl
()))
||
!
staffDTO
.
getSex
().
equals
(
Integer
.
valueOf
(
clerkDTO
.
getClerkGender
())))
{
logger
.
info
(
"【员工修改】clerkDTO={}"
,
JSON
.
toJSONString
(
clerkDTO
));
logger
.
info
(
"【员工修改】{},修改地方:name:{},{};num:{},{};pic:{},{};sex:{},{}"
,
clerkDTO
.
getClerkId
(),
staffName
,
clerkDTO
.
getClerkName
(),
staffDTO
.
getPhoneNumber
(),
clerkDTO
.
getPhoneNumber
(),
headPic
,
clerkDTO
.
getHeadImgUrl
()
,
staffDTO
.
getSex
(),
clerkDTO
.
getClerkGender
());
clerkDTO
.
setClerkName
(
staffDTO
.
getStaffName
());
clerkDTO
.
setPhoneNumber
(
staffDTO
.
getPhoneNumber
());
clerkDTO
.
setHeadImgUrl
(
staffDTO
.
getHeadImg
());
clerkDTO
.
setClerkGender
(
staffDTO
.
getSex
().
toString
());
clerkService
.
updateClerk
(
clerkDTO
);
}
}
//}
}
}
}
}
}
}
}
...
@@ -612,41 +559,101 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -612,41 +559,101 @@ public class StaffApiServiceImpl implements StaffApiService {
staffDepartmentRelatedService
.
del
(
related
);
staffDepartmentRelatedService
.
del
(
related
);
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
tab1
.
getClerkCode
())){
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
tab1
.
getClerkCode
())){
cleanGicClerk
(
tab1
.
getClerkCode
(),
tab1
.
getDepartmentId
());
cleanGicClerk
(
tab1
.
getClerkCode
(),
tab1
.
getDepartmentId
());
}
}
}
}
}
}
Boolean
weixinPush
=
staffDTO
.
getWeixinPush
();
Boolean
weixinPush
=
staffDTO
.
getWeixinPush
();
if
(
weixinPush
==
null
||
!
weixinPush
){
if
(
weixinPush
==
null
||
!
weixinPush
){
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
oldStaff
.
getWxEnterpriseId
()
);
updateWxMessage
(
oldStaff
,
staffDTO
,
departmentIds
);
if
(
enterpriseDTO
!=
null
)
{
}
UserDTO
userDTO
=
new
UserDTO
();
}
userDTO
.
setCorpid
(
enterpriseDTO
.
getCorpid
());
userDTO
.
setAlias
(
staffDTO
.
getNickName
());
private
void
wxStaffEdit
(
StaffDTO
staffDTO
,
String
departmentIds
){
staffDTO
.
setWeixinPush
(
true
);
String
[]
departmentIdArr
=
departmentIds
.
split
(
","
);
staffEditDeal
(
staffDTO
,
departmentIds
,
false
);
Integer
[]
wxDepartmentIdArrIntegers
=
new
Integer
[
departmentIdArr
.
length
];
}
int
index
=
0
;
for
(
String
string
:
departmentIdArr
)
{
TabHaobanDepartment
tabs
=
departmentService
.
selectById
(
string
);
private
void
updateGicClerk
(
TabHaobanStaff
oldStaff
,
StaffDTO
staffDTO
,
String
departmentId
,
TabHaobanStaffDepartmentRelated
related
){
wxDepartmentIdArrIntegers
[
index
]
=
Integer
.
parseInt
(
tabs
.
getWxDepartmentId
());
logger
.
info
(
"【员工修改】oldName={},name={},oldPhoneNumber={},phoneNumber={}"
,
oldStaff
.
getStaffName
(),
staffDTO
.
getStaffName
(),
oldStaff
.
getPhoneNumber
(),
staffDTO
.
getPhoneNumber
());
index
++
;
String
staffName
=
staffDTO
.
getStaffName
()
;
}
TabHaobanDepartment
department
=
departmentService
.
selectById
(
departmentId
);
userDTO
.
setDepartment
(
wxDepartmentIdArrIntegers
);
if
(
department
==
null
){
userDTO
.
setGender
(
staffDTO
.
getSex
()
==
null
?
""
:
staffDTO
.
getSex
().
toString
())
;
return
;
userDTO
.
setMobile
(
staffDTO
.
getPhoneNumber
());
}
userDTO
.
setName
(
staffDTO
.
getStaffName
())
;
String
enterpriseId
=
""
;
userDTO
.
setUserid
(
oldStaff
.
getWxUserId
());
if
(
department
.
getIsStore
()
==
null
||
department
.
getIsStore
()
==
0
){
userDTO
.
setPosition
(
staffDTO
.
getPostion
());
com
.
gic
.
enterprise
.
api
.
dto
.
DepartmentDTO
dto
=
gicDepartmentService
.
getDeptment
(
department
.
getRelatedId
());
userDTO
.
setExternal_position
(
staffDTO
.
getExtendPostion
());
if
(
dto
==
null
){
JSONResponse
jp
=
qywxUserApiService
.
updateSelfWorkWxUser
(
userDTO
,
enterpriseDTO
.
getCorpid
(),
enterpriseDTO
.
getContactSecret
());
StoreGroupDTO
group
=
storeGroupService
.
getStoreGroupById
(
department
.
getRelatedId
());
if
(
jp
.
getErrorCode
()
!=
0
)
{
if
(
group
!=
null
)
{
throw
new
RuntimeException
(
"微信新增失败"
);
enterpriseId
=
group
.
getEnterpriseId
(
);
}
}
}
else
{
enterpriseId
=
dto
.
getEnterpriseId
();
}
}
}
else
{
StoreDTO
store
=
storeService
.
getStore
(
department
.
getRelatedId
());
if
(
store
==
null
){
return
;
}
enterpriseId
=
store
.
getEnterpriseId
();
}
}
}
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByCodeNoStatus
(
enterpriseId
,
related
.
getClerkCode
());
logger
.
info
(
"clerkDto:{}"
,
JSONObject
.
toJSONString
(
clerkDTO
));
String
headPic
=
staffDTO
.
getHeadImg
();
if
(
StringUtils
.
isBlank
(
staffDTO
.
getPhoneNumber
()))
{
staffDTO
.
setPhoneNumber
(
""
);
}
if
(
StringUtils
.
isBlank
(
clerkDTO
.
getPhoneNumber
()))
{
clerkDTO
.
setPhoneNumber
(
""
);
}
if
(
clerkDTO
!=
null
&&
(
StringUtils
.
isNotBlank
(
staffName
)
&&
!
clerkDTO
.
getClerkName
().
equals
(
staffName
)
||
!
staffDTO
.
getPhoneNumber
().
equals
(
clerkDTO
.
getPhoneNumber
()))
||
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
headPic
)
&&
!
headPic
.
equals
(
clerkDTO
.
getHeadImgUrl
()))
||
!
staffDTO
.
getSex
().
equals
(
Integer
.
valueOf
(
clerkDTO
.
getClerkGender
())))
{
logger
.
info
(
"【员工修改】clerkDTO={}"
,
JSON
.
toJSONString
(
clerkDTO
));
logger
.
info
(
"【员工修改】{},修改地方:name:{},{};num:{},{};pic:{},{};sex:{},{}"
,
clerkDTO
.
getClerkId
(),
staffName
,
clerkDTO
.
getClerkName
(),
staffDTO
.
getPhoneNumber
(),
clerkDTO
.
getPhoneNumber
(),
headPic
,
clerkDTO
.
getHeadImgUrl
()
,
staffDTO
.
getSex
(),
clerkDTO
.
getClerkGender
());
clerkDTO
.
setClerkName
(
staffDTO
.
getStaffName
());
clerkDTO
.
setPhoneNumber
(
staffDTO
.
getPhoneNumber
());
clerkDTO
.
setHeadImgUrl
(
staffDTO
.
getHeadImg
());
clerkDTO
.
setClerkGender
(
staffDTO
.
getSex
().
toString
());
clerkService
.
updateClerk
(
clerkDTO
);
}
}
private
void
updateWxMessage
(
TabHaobanStaff
oldStaff
,
StaffDTO
staffDTO
,
String
departmentIds
){
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
oldStaff
.
getWxEnterpriseId
());
if
(
enterpriseDTO
!=
null
)
{
UserDTO
userDTO
=
new
UserDTO
();
userDTO
.
setCorpid
(
enterpriseDTO
.
getCorpid
());
userDTO
.
setAlias
(
staffDTO
.
getNickName
());
String
[]
departmentIdArr
=
departmentIds
.
split
(
","
);
Integer
[]
wxDepartmentIdArrIntegers
=
new
Integer
[
departmentIdArr
.
length
];
int
index
=
0
;
for
(
String
string
:
departmentIdArr
)
{
TabHaobanDepartment
tabs
=
departmentService
.
selectById
(
string
);
wxDepartmentIdArrIntegers
[
index
]
=
Integer
.
parseInt
(
tabs
.
getWxDepartmentId
());
index
++;
}
userDTO
.
setDepartment
(
wxDepartmentIdArrIntegers
);
userDTO
.
setGender
(
staffDTO
.
getSex
()
==
null
?
""
:
staffDTO
.
getSex
().
toString
());
userDTO
.
setMobile
(
staffDTO
.
getPhoneNumber
());
userDTO
.
setName
(
staffDTO
.
getStaffName
());
userDTO
.
setUserid
(
oldStaff
.
getWxUserId
());
userDTO
.
setPosition
(
staffDTO
.
getPostion
());
userDTO
.
setExternal_position
(
staffDTO
.
getExtendPostion
());
JSONResponse
jp
=
qywxUserApiService
.
updateSelfWorkWxUser
(
userDTO
,
enterpriseDTO
.
getCorpid
(),
enterpriseDTO
.
getContactSecret
());
if
(
jp
.
getErrorCode
()
!=
0
)
{
throw
new
RuntimeException
(
"微信新增失败"
);
}
}
}
@Override
@Override
public
void
staffEdit
(
StaffDTO
staffDTO
,
String
departmentIds
)
{
public
void
staffEdit
(
StaffDTO
staffDTO
,
String
departmentIds
)
{
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanWxEnterpriseApplicationRelatedMapper.xml
0 → 100644
View file @
39030b0a
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.gic.haoban.manage.service.dao.mapper.TabHaobanWxEnterpriseApplicationRelatedMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated"
>
<id
column=
"wx_enterprise_application_related_id"
property=
"wxEnterpriseApplicationRelatedId"
jdbcType=
"VARCHAR"
/>
<result
column=
"application_id"
property=
"applicationId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
wx_enterprise_application_related_id, application_id, wx_enterprise_id, status_flag,
create_time, update_time
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_wx_enterprise_application_related
where wx_enterprise_application_related_id = #{wxEnterpriseApplicationRelatedId,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from tab_haoban_wx_enterprise_application_related
where wx_enterprise_application_related_id = #{wxEnterpriseApplicationRelatedId,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated"
>
insert into tab_haoban_wx_enterprise_application_related (wx_enterprise_application_related_id, application_id,
wx_enterprise_id, status_flag, create_time,
update_time)
values (#{wxEnterpriseApplicationRelatedId,jdbcType=VARCHAR}, #{applicationId,jdbcType=VARCHAR},
#{wxEnterpriseId,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated"
>
insert into tab_haoban_wx_enterprise_application_related
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"wxEnterpriseApplicationRelatedId != null"
>
wx_enterprise_application_related_id,
</if>
<if
test=
"applicationId != null"
>
application_id,
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id,
</if>
<if
test=
"statusFlag != null"
>
status_flag,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"wxEnterpriseApplicationRelatedId != null"
>
#{wxEnterpriseApplicationRelatedId,jdbcType=VARCHAR},
</if>
<if
test=
"applicationId != null"
>
#{applicationId,jdbcType=VARCHAR},
</if>
<if
test=
"wxEnterpriseId != null"
>
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"statusFlag != null"
>
#{statusFlag,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated"
>
update tab_haoban_wx_enterprise_application_related
<set
>
<if
test=
"applicationId != null"
>
application_id = #{applicationId,jdbcType=VARCHAR},
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"statusFlag != null"
>
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where wx_enterprise_application_related_id = #{wxEnterpriseApplicationRelatedId,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated"
>
update tab_haoban_wx_enterprise_application_related
set application_id = #{applicationId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where wx_enterprise_application_related_id = #{wxEnterpriseApplicationRelatedId,jdbcType=VARCHAR}
</update>
<select
id=
selectByApplicationIdAndWxEnterpriseId
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_wx_enterprise_application_related
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and application_id = #{applicationId}
and status_flag = 1
</select>
<select
id=
listByWxEnterpriseId
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_wx_enterprise_application_related
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag = 1
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/ApplicationController.java
View file @
39030b0a
...
@@ -63,7 +63,9 @@ public class ApplicationController extends WebBaseController{
...
@@ -63,7 +63,9 @@ public class ApplicationController extends WebBaseController{
@RequestMapping
(
"application-list"
)
@RequestMapping
(
"application-list"
)
public
HaobanResponse
applicationList
()
{
public
HaobanResponse
applicationList
()
{
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplication
();
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplicationByWxEnterpriseId
(
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
}
@IgnoreLogin
@IgnoreLogin
...
@@ -73,7 +75,7 @@ public class ApplicationController extends WebBaseController{
...
@@ -73,7 +75,7 @@ public class ApplicationController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplication
(
);
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplication
ByWxEnterpriseId
(
wxEnterpriseId
);
List
<
String
>
applicationIds
=
list
.
stream
().
map
(
s
->
s
.
getApplicationId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
applicationIds
=
list
.
stream
().
map
(
s
->
s
.
getApplicationId
()).
collect
(
Collectors
.
toList
());
List
<
ApplicationSettingDTO
>
result
=
applicationSettingApiService
.
listOpenByWxEnterpriseIdAndApplicationIds
(
wxEnterpriseId
,
applicationIds
);
List
<
ApplicationSettingDTO
>
result
=
applicationSettingApiService
.
listOpenByWxEnterpriseIdAndApplicationIds
(
wxEnterpriseId
,
applicationIds
);
//开启
//开启
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ApplicationController.java
View file @
39030b0a
...
@@ -30,7 +30,7 @@ public class ApplicationController extends WebBaseController{
...
@@ -30,7 +30,7 @@ public class ApplicationController extends WebBaseController{
@RequestMapping
(
"application-list"
)
@RequestMapping
(
"application-list"
)
public
HaobanResponse
applicationList
(
String
wxEnterpriseId
)
{
public
HaobanResponse
applicationList
(
String
wxEnterpriseId
)
{
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplication
(
);
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplication
ByWxEnterpriseId
(
wxEnterpriseId
);
List
<
String
>
applicationIds
=
list
.
stream
().
map
(
s
->
s
.
getApplicationId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
applicationIds
=
list
.
stream
().
map
(
s
->
s
.
getApplicationId
()).
collect
(
Collectors
.
toList
());
List
<
ApplicationSettingDTO
>
settings
=
applicationSettingApiService
.
listOpenByWxEnterpriseIdAndApplicationIds
(
wxEnterpriseId
,
applicationIds
);
List
<
ApplicationSettingDTO
>
settings
=
applicationSettingApiService
.
listOpenByWxEnterpriseIdAndApplicationIds
(
wxEnterpriseId
,
applicationIds
);
...
...
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