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
a8e926e0
Commit
a8e926e0
authored
Sep 02, 2021
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:删除无效代码,代码优化
parent
f19b4781
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
54 deletions
+57
-54
StaffDepartmentRelatedApiService.java
.../manage/api/service/StaffDepartmentRelatedApiService.java
+27
-19
StaffDepartmentRelatedApiServiceImpl.java
...ervice/out/impl/StaffDepartmentRelatedApiServiceImpl.java
+30
-35
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffDepartmentRelatedApiService.java
View file @
a8e926e0
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
public
interface
StaffDepartmentRelatedApiService
{
public
interface
StaffDepartmentRelatedApiService
{
...
@@ -25,41 +25,49 @@ public interface StaffDepartmentRelatedApiService {
...
@@ -25,41 +25,49 @@ public interface StaffDepartmentRelatedApiService {
*/
*/
StaffDepartmentRelatedDTO
getByStaffDepartmentRelatedId
(
String
staffDepartmentRelatedId
);
StaffDepartmentRelatedDTO
getByStaffDepartmentRelatedId
(
String
staffDepartmentRelatedId
);
void
deleteCode
(
StaffDepartmentRelatedDTO
dto
);
void
deleteCode
(
StaffDepartmentRelatedDTO
dto
);
StaffDepartmentRelatedDTO
getOneByClerkCodeAndDepartmentId
(
String
clerkCode
,
String
departmentId
);
StaffDepartmentRelatedDTO
getOneByClerkCodeAndDepartmentId
(
String
clerkCode
,
String
departmentId
);
StaffDepartmentRelatedDTO
getOneByStaffIdAndDepartmentId
(
String
staffId
,
String
departmentId
);
StaffDepartmentRelatedDTO
getOneByStaffIdAndDepartmentId
(
String
staffId
,
String
departmentId
);
Map
<
String
,
String
>
getWxUserIdByClerkId
(
String
clerkId
);
Map
<
String
,
String
>
getWxUserIdByClerkId
(
String
clerkId
);
String
getPageUrl
(
int
type
,
String
data
);
String
getPageUrl
(
int
type
,
String
data
);
//发送消息,单人发送
/**
boolean
sendSingleMessage
(
String
clerkId
,
String
title
,
String
content
,
String
pageUrl
);
* 发送消息,单人发送
*
* @param clerkId
* @param title
* @param content
* @param pageUrl
* @return
*/
boolean
sendSingleMessage
(
String
clerkId
,
String
title
,
String
content
,
String
pageUrl
);
/**
/**
* 单人消息发送通用方法
* 单人消息发送通用方法
*
*
* @param clerkId : 接收人id
* @param clerkId
: 接收人id
* @param title : 通知标题
* @param title
: 通知标题
* @param contentMap : 时间集合, key 为类型, value : 内容(例如 接收事件 : 事件内容)
* @param contentMap : 时间集合, key 为类型, value : 内容(例如 接收事件 : 事件内容)
* @param pageUrl : 跳转地址
* @param pageUrl
: 跳转地址
* @return : 返回是否发送成功
* @return : 返回是否发送成功
*/
*/
Boolean
sendSingleMessage
(
String
clerkId
,
String
title
,
Map
<
String
,
String
>
contentMap
,
String
pageUrl
);
Boolean
sendSingleMessage
(
String
clerkId
,
String
title
,
Map
<
String
,
String
>
contentMap
,
String
pageUrl
);
//发送消息,带审核理由
//发送消息,带审核理由
public
boolean
sendAuditMessage
(
String
clerkId
,
String
title
,
String
content
,
String
pageUrl
,
int
auditStatus
,
String
auditReason
);
boolean
sendAuditMessage
(
String
clerkId
,
String
title
,
String
content
,
String
pageUrl
,
int
auditStatus
,
String
auditReason
);
List
<
StaffDepartmentRelatedDTO
>
listByStaffIds
(
List
<
String
>
staffIds
);
List
<
StaffDepartmentRelatedDTO
>
listByStaffIds
(
List
<
String
>
staffIds
);
public
void
sendClerkBind
(
String
staffId
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
);
public
void
sendStaffBind
(
String
staffId
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
);
public
void
sendClerkAdd
(
String
clerkName
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
);
void
sendClerkBind
(
String
staffId
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
);
void
sendStaffBind
(
String
staffId
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
);
void
sendClerkAdd
(
String
clerkName
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
);
public
void
sendClerkDel
(
String
clerkName
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
);
void
sendClerkDel
(
String
clerkName
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffDepartmentRelatedApiServiceImpl.java
View file @
a8e926e0
...
@@ -14,11 +14,9 @@ import com.gic.haoban.manage.service.config.Config;
...
@@ -14,11 +14,9 @@ import com.gic.haoban.manage.service.config.Config;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.service.DepartmentService
;
import
com.gic.haoban.manage.service.service.StaffDepartmentRelatedService
;
import
com.gic.haoban.manage.service.service.StaffDepartmentRelatedService
;
import
com.gic.wechat.api.dto.qywx.ItemDTO
;
import
com.gic.wechat.api.dto.qywx.ItemDTO
;
import
com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO
;
import
com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO
;
...
@@ -37,7 +35,7 @@ import java.util.*;
...
@@ -37,7 +35,7 @@ import java.util.*;
@Service
@Service
public
class
StaffDepartmentRelatedApiServiceImpl
implements
StaffDepartmentRelatedApiService
{
public
class
StaffDepartmentRelatedApiServiceImpl
implements
StaffDepartmentRelatedApiService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
StaffDepartmentRelatedApiServiceImpl
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
StaffDepartmentRelatedApiServiceImpl
.
class
);
@Autowired
@Autowired
private
StaffDepartmentRelatedService
staffDepartmentRelatedService
;
private
StaffDepartmentRelatedService
staffDepartmentRelatedService
;
...
@@ -50,10 +48,6 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
...
@@ -50,10 +48,6 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
@Autowired
@Autowired
private
WxEnterpriseMapper
wxEnterpriseMapper
;
private
WxEnterpriseMapper
wxEnterpriseMapper
;
@Autowired
@Autowired
private
WxEnterpriseRelatedMapper
wxEnterpriseRelatedMapper
;
@Autowired
private
DepartmentService
departmentService
;
@Autowired
private
Config
config
;
private
Config
config
;
@Autowired
@Autowired
private
TabHaobanStaffClerkRelationMapper
tabHaobanStaffClerkRelationMapper
;
private
TabHaobanStaffClerkRelationMapper
tabHaobanStaffClerkRelationMapper
;
...
@@ -61,20 +55,19 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
...
@@ -61,20 +55,19 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
private
StaffApiService
staffApiService
;
private
StaffApiService
staffApiService
;
@Override
@Override
public
List
<
StaffDepartmentRelatedDTO
>
listByDepartmentId
(
public
List
<
StaffDepartmentRelatedDTO
>
listByDepartmentId
(
String
departmentId
)
{
String
departmentId
)
{
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedService
.
listByDepartmentId
(
departmentId
);
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedService
.
listByDepartmentId
(
departmentId
);
List
<
StaffDepartmentRelatedDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
List
<
StaffDepartmentRelatedDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
return
resultList
;
return
resultList
;
}
}
@Override
@Override
public
List
<
StaffDepartmentRelatedDTO
>
listByDepartmentIds
(
public
List
<
StaffDepartmentRelatedDTO
>
listByDepartmentIds
(
List
<
String
>
departmentIds
)
{
List
<
String
>
departmentIds
)
{
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedMapper
.
listByDepartmentIds
(
departmentIds
);
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedMapper
.
listByDepartmentIds
(
departmentIds
);
List
<
StaffDepartmentRelatedDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
List
<
StaffDepartmentRelatedDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
return
resultList
;
return
resultList
;
}
}
@Override
@Override
public
void
updateById
(
StaffDepartmentRelatedDTO
dto
)
{
public
void
updateById
(
StaffDepartmentRelatedDTO
dto
)
{
TabHaobanStaffDepartmentRelated
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaffDepartmentRelated
.
class
,
dto
);
TabHaobanStaffDepartmentRelated
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaffDepartmentRelated
.
class
,
dto
);
...
@@ -187,13 +180,13 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
...
@@ -187,13 +180,13 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
String
wxUserId
=
staffDTO
.
getWxUserId
();
String
wxUserId
=
staffDTO
.
getWxUserId
();
String
corpId
=
tabHaobanWxEnterprise
.
getCorpid
();
String
corpId
=
tabHaobanWxEnterprise
.
getCorpid
();
String
name
=
staffDTO
.
getStaffName
();
String
name
=
staffDTO
.
getStaffName
();
if
(
content
.
length
()>
30
)
{
if
(
content
.
length
()
>
30
)
{
content
=
content
.
substring
(
0
,
26
);
content
=
content
.
substring
(
0
,
26
);
content
=
content
+
"..."
;
content
=
content
+
"..."
;
}
}
//先发送下,试试
//先发送下,试试
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
List
<
ItemDTO
>
items
=
new
ArrayList
();
;
List
<
ItemDTO
>
items
=
new
ArrayList
();
ItemDTO
dto1
=
new
ItemDTO
();
ItemDTO
dto1
=
new
ItemDTO
();
ItemDTO
dto2
=
new
ItemDTO
();
ItemDTO
dto2
=
new
ItemDTO
();
ItemDTO
dto3
=
new
ItemDTO
();
ItemDTO
dto3
=
new
ItemDTO
();
...
@@ -269,17 +262,18 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
...
@@ -269,17 +262,18 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
}
}
//导购删除,,审核记录,,消息发送
//导购删除,,审核记录,,消息发送
public
void
sendClerkDel
(
String
clerkName
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
){
@Override
//TODO huang 发送店长,门店关联记录列表
public
void
sendClerkDel
(
String
clerkName
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
)
{
String
messageTitle
=
"门店导购变更"
;
//TODO huang 发送店长,门店关联记录列表
String
messageContent
=
"删除导购:"
+
clerkName
+
"("
+
clerkCode
+
")"
;
String
messageTitle
=
"门店导购变更"
;
String
messageContent
=
"删除导购:"
+
clerkName
+
"("
+
clerkCode
+
")"
;
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"storeId"
,
storeId
);
jsonObject
.
put
(
"storeId"
,
storeId
);
String
data
=
jsonObject
.
toJSONString
();
String
data
=
jsonObject
.
toJSONString
();
ClerkDTO
gicClerk
=
clerkService
.
getClerkLeaderByStoreId
(
storeId
);
ClerkDTO
gicClerk
=
clerkService
.
getClerkLeaderByStoreId
(
storeId
);
if
(
gicClerk
==
null
)
{
if
(
gicClerk
==
null
)
{
logger
.
info
(
"店长不存在,发送消息失败{}"
,
storeId
);
logger
.
info
(
"店长不存在,发送消息失败{}"
,
storeId
);
return
;
return
;
}
}
TabHaobanStaffClerkRelation
tab
=
tabHaobanStaffClerkRelationMapper
.
getOneByClerkId
(
gicClerk
.
getClerkId
());
TabHaobanStaffClerkRelation
tab
=
tabHaobanStaffClerkRelationMapper
.
getOneByClerkId
(
gicClerk
.
getClerkId
());
if
(
tab
==
null
){
if
(
tab
==
null
){
...
@@ -301,17 +295,17 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
...
@@ -301,17 +295,17 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
String
corpId
=
map
.
get
(
"corpId"
);
String
corpId
=
map
.
get
(
"corpId"
);
String
name
=
map
.
get
(
"clerkName"
);
String
name
=
map
.
get
(
"clerkName"
);
if
(
jodd
.
util
.
StringUtil
.
isEmpty
(
wxUserId
))
{
if
(
jodd
.
util
.
StringUtil
.
isEmpty
(
wxUserId
))
{
logger
.
info
(
"wxUserId不存在============clerkId={}"
,
clerkId
);
logger
.
info
(
"wxUserId不存在============clerkId={}"
,
clerkId
);
return
false
;
return
false
;
}
}
if
(
content
.
length
()>
30
)
{
if
(
content
.
length
()
>
30
)
{
content
=
content
.
substring
(
0
,
26
);
content
=
content
.
substring
(
0
,
26
);
content
=
content
+
"..."
;
content
=
content
+
"..."
;
}
}
//先发送下,试试
//先发送下,试试
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
List
<
ItemDTO
>
items
=
new
ArrayList
();
;
List
<
ItemDTO
>
items
=
new
ArrayList
();
ItemDTO
dto1
=
new
ItemDTO
();
ItemDTO
dto1
=
new
ItemDTO
();
ItemDTO
dto2
=
new
ItemDTO
();
ItemDTO
dto2
=
new
ItemDTO
();
dto1
.
setKey
(
"接收人"
);
dto1
.
setKey
(
"接收人"
);
...
@@ -320,8 +314,8 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
...
@@ -320,8 +314,8 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
dto2
.
setValue
(
content
);
dto2
.
setValue
(
content
);
items
.
add
(
dto1
);
items
.
add
(
dto1
);
items
.
add
(
dto2
);
items
.
add
(
dto2
);
ArrayList
<
String
>
list
=
new
ArrayList
<>();
ArrayList
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
wxUserId
);
list
.
add
(
wxUserId
);
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setPage
(
pageUrl
);
...
@@ -391,22 +385,22 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
...
@@ -391,22 +385,22 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
@Override
@Override
public
boolean
sendAuditMessage
(
String
staffId
,
String
title
,
public
boolean
sendAuditMessage
(
String
staffId
,
String
title
,
String
content
,
String
pageUrl
,
int
auditStatus
,
String
auditReason
)
{
String
content
,
String
pageUrl
,
int
auditStatus
,
String
auditReason
)
{
Map
<
String
,
String
>
map
=
getWxUserIdByStaffId
(
staffId
);
Map
<
String
,
String
>
map
=
getWxUserIdByStaffId
(
staffId
);
String
wxUserId
=
map
.
get
(
"wxUserId"
);
String
wxUserId
=
map
.
get
(
"wxUserId"
);
String
corpId
=
map
.
get
(
"corpId"
);
String
corpId
=
map
.
get
(
"corpId"
);
String
name
=
map
.
get
(
"staffName"
);
String
name
=
map
.
get
(
"staffName"
);
if
(
jodd
.
util
.
StringUtil
.
isEmpty
(
wxUserId
))
{
if
(
StringUtils
.
isEmpty
(
wxUserId
))
{
logger
.
info
(
"wxUserId不存在============clerkId={}"
,
staffId
);
logger
.
info
(
"wxUserId不存在============clerkId={}"
,
staffId
);
return
false
;
return
false
;
}
}
if
(
content
.
length
()>
30
)
{
if
(
content
.
length
()
>
30
)
{
content
=
content
.
substring
(
0
,
26
);
content
=
content
.
substring
(
0
,
26
);
content
=
content
+
"..."
;
content
=
content
+
"..."
;
}
}
//先发送下,试试
//先发送下,试试
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
List
<
ItemDTO
>
items
=
new
ArrayList
();
;
List
<
ItemDTO
>
items
=
new
ArrayList
();
ItemDTO
dto1
=
new
ItemDTO
();
ItemDTO
dto1
=
new
ItemDTO
();
ItemDTO
dto2
=
new
ItemDTO
();
ItemDTO
dto2
=
new
ItemDTO
();
ItemDTO
dto3
=
new
ItemDTO
();
ItemDTO
dto3
=
new
ItemDTO
();
...
@@ -440,6 +434,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
...
@@ -440,6 +434,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
logger
.
info
(
"发送===============》{}"
,
b
);
logger
.
info
(
"发送===============》{}"
,
b
);
return
b
;
return
b
;
}
}
@Override
@Override
public
String
getPageUrl
(
int
type
,
String
data
)
{
public
String
getPageUrl
(
int
type
,
String
data
)
{
String
baseUrl
=
"/pages/route/index"
;
String
baseUrl
=
"/pages/route/index"
;
...
...
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