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
e28e43a0
Commit
e28e43a0
authored
May 24, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into feature-0524-home-change
parents
17137c74
f3f69e52
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
3170 additions
and
2439 deletions
+3170
-2439
NoticeMessageQDTO.java
...com/gic/haoban/manage/api/dto/qdto/NoticeMessageQDTO.java
+350
-0
NoticeMessageTypeEnum.java
...om/gic/haoban/manage/api/enums/NoticeMessageTypeEnum.java
+84
-50
NoticeMessageApiService.java
...an/manage/api/service/notify/NoticeMessageApiService.java
+10
-0
pom.xml
haoban-manage3-service/pom.xml
+6
-0
MaterialReportContext.java
...ervice/pojo/bo/content/context/MaterialReportContext.java
+12
-4
MaterialReportBuilder.java
...ervice/service/content/adaptor/MaterialReportBuilder.java
+5
-1
PotentialCustomerNotifyBuilder.java
...rvice/content/adaptor/PotentialCustomerNotifyBuilder.java
+29
-3
MaterialReportServiceImpl.java
...rvice/service/content/impl/MaterialReportServiceImpl.java
+72
-4
PotentialCustomerServiceImpl.java
...ce/service/content/impl/PotentialCustomerServiceImpl.java
+8
-1
StaffClerkRelationServiceImpl.java
...e/service/service/impl/StaffClerkRelationServiceImpl.java
+10
-14
NoticeMessageHandler.java
.../manage/service/service/message/NoticeMessageHandler.java
+43
-0
NoticeMessageApiServiceImpl.java
...rvice/service/notify/out/NoticeMessageApiServiceImpl.java
+159
-4
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+6
-1
StaffDepartmentRelatedApiServiceImpl.java
...ervice/out/impl/StaffDepartmentRelatedApiServiceImpl.java
+1
-1
HaobanQywxFeeApiServiceImpl.java
...ice/service/out/impl/fee/HaobanQywxFeeApiServiceImpl.java
+25
-21
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+0
-5
ApolloUtils.java
.../java/com/gic/haoban/manage/service/util/ApolloUtils.java
+17
-0
TabHaobanExternalClerkRelatedMapper.xml
.../resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
+797
-794
GroupMessageServiceTest.java
...anage3-service/src/test/java/GroupMessageServiceTest.java
+2
-2
MaterialReportServiceTest.java
...age3-service/src/test/java/MaterialReportServiceTest.java
+1
-1
NotityTest.java
haoban-manage3-service/src/test/java/NotityTest.java
+3
-3
test.java
haoban-manage3-service/src/test/java/test.java
+1
-1
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+765
-765
GicOrderController.java
...aoban/manage/web/controller/order/GicOrderController.java
+764
-764
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/qdto/NoticeMessageQDTO.java
0 → 100644
View file @
e28e43a0
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
qdto
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
* 好办消息通知
*
* @author fdh
*/
public
class
NoticeMessageQDTO
implements
Serializable
{
/**
*
*/
private
Long
noticeMessageId
;
/**
* 企业id
*/
private
String
enterpriseId
;
/**
* 门店id
*/
private
String
storeId
;
/**
* 导购id
*/
private
String
clerkId
;
/**
* 类别 0客户相关、1任务相关、2活动相关、3其他
*/
private
Integer
categoryType
;
/**
* 消息类型
*/
private
Integer
messageType
;
private
String
templateCode
;
/**
* 标题
*/
private
String
title
;
/**
* 描述
*/
private
String
description
;
/**
* 关联的具体业务消息id
*/
private
String
relationId
;
/**
* 消息带的参数信息
*/
private
String
messageContent
;
/**
* 0 未读 1已读
*/
private
Integer
readFlag
;
/**
* 状态 0删除 1正常
*/
private
Integer
deleteFlag
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
*/
private
static
final
long
serialVersionUID
=
1L
;
public
String
getTemplateCode
()
{
return
templateCode
;
}
public
void
setTemplateCode
(
String
templateCode
)
{
this
.
templateCode
=
templateCode
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.notice_message_id
*
* @return the value of tab_haoban_notice_message.notice_message_id
*/
public
Long
getNoticeMessageId
()
{
return
noticeMessageId
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.notice_message_id
*
* @param noticeMessageId the value for tab_haoban_notice_message.notice_message_id
*/
public
void
setNoticeMessageId
(
Long
noticeMessageId
)
{
this
.
noticeMessageId
=
noticeMessageId
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.enterprise_id
*
* @return the value of tab_haoban_notice_message.enterprise_id
*/
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.enterprise_id
*
* @param enterpriseId the value for tab_haoban_notice_message.enterprise_id
*/
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.store_id
*
* @return the value of tab_haoban_notice_message.store_id
*/
public
String
getStoreId
()
{
return
storeId
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.store_id
*
* @param storeId the value for tab_haoban_notice_message.store_id
*/
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.clerk_id
*
* @return the value of tab_haoban_notice_message.clerk_id
*/
public
String
getClerkId
()
{
return
clerkId
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.clerk_id
*
* @param clerkId the value for tab_haoban_notice_message.clerk_id
*/
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.category_type
*
* @return the value of tab_haoban_notice_message.category_type
*/
public
Integer
getCategoryType
()
{
return
categoryType
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.category_type
*
* @param categoryType the value for tab_haoban_notice_message.category_type
*/
public
void
setCategoryType
(
Integer
categoryType
)
{
this
.
categoryType
=
categoryType
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.message_type
*
* @return the value of tab_haoban_notice_message.message_type
*/
public
Integer
getMessageType
()
{
return
messageType
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.message_type
*
* @param messageType the value for tab_haoban_notice_message.message_type
*/
public
void
setMessageType
(
Integer
messageType
)
{
this
.
messageType
=
messageType
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.title
*
* @return the value of tab_haoban_notice_message.title
*/
public
String
getTitle
()
{
return
title
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.title
*
* @param title the value for tab_haoban_notice_message.title
*/
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.description
*
* @return the value of tab_haoban_notice_message.description
*/
public
String
getDescription
()
{
return
description
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.description
*
* @param description the value for tab_haoban_notice_message.description
*/
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.relation_id
*
* @return the value of tab_haoban_notice_message.relation_id
*/
public
String
getRelationId
()
{
return
relationId
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.relation_id
*
* @param relationId the value for tab_haoban_notice_message.relation_id
*/
public
void
setRelationId
(
String
relationId
)
{
this
.
relationId
=
relationId
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.message_content
*
* @return the value of tab_haoban_notice_message.message_content
*/
public
String
getMessageContent
()
{
return
messageContent
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.message_content
*
* @param messageContent the value for tab_haoban_notice_message.message_content
*/
public
void
setMessageContent
(
String
messageContent
)
{
this
.
messageContent
=
messageContent
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.read_flag
*
* @return the value of tab_haoban_notice_message.read_flag
*/
public
Integer
getReadFlag
()
{
return
readFlag
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.read_flag
*
* @param readFlag the value for tab_haoban_notice_message.read_flag
*/
public
void
setReadFlag
(
Integer
readFlag
)
{
this
.
readFlag
=
readFlag
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.delete_flag
*
* @return the value of tab_haoban_notice_message.delete_flag
*/
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.delete_flag
*
* @param deleteFlag the value for tab_haoban_notice_message.delete_flag
*/
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.create_time
*
* @return the value of tab_haoban_notice_message.create_time
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.create_time
*
* @param createTime the value for tab_haoban_notice_message.create_time
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.update_time
*
* @return the value of tab_haoban_notice_message.update_time
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.update_time
*
* @param updateTime the value for tab_haoban_notice_message.update_time
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/NoticeMessageTypeEnum.java
View file @
e28e43a0
...
@@ -3,109 +3,127 @@ package com.gic.haoban.manage.api.enums;
...
@@ -3,109 +3,127 @@ package com.gic.haoban.manage.api.enums;
/**
/**
* Created by hua on 2021/12/17.
* Created by hua on 2021/12/17.
*/
*/
@Deprecated
public
enum
NoticeMessageTypeEnum
{
public
enum
NoticeMessageTypeEnum
{
ACTIVITY_START
(
1001
,
"活动开始通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_start"
,
"/pages/route/index?pageType="
,
"hbapp_activity_detail"
),
ACTIVITY_START
(
1001
,
"活动开始通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_start"
,
"/pages/route/index?pageType="
,
"hbapp_activity_detail"
,
"activityStart"
,
"haobanNotice"
),
ACTIVITY_NEW
(
1002
,
"活动上新通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_new"
,
"/pages/route/index?pageType="
,
"hbapp_activity_detail"
),
ACTIVITY_NEW
(
1002
,
"活动上新通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_new"
,
"/pages/route/index?pageType="
,
"hbapp_activity_detail"
,
"activityNew"
,
"haobanNotice"
),
ACTIVITY_DEL
(
1003
,
"活动删除通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_del"
,
"/pages/route/index"
,
""
),
ACTIVITY_DEL
(
1003
,
"活动删除通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_del"
,
"/pages/route/index"
,
""
,
"activityDelete"
,
"haobanNotice"
),
ACTIVITY_OFFLINE
(
1004
,
"活动下线通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_offline"
,
"/pages/route/index?pageType="
,
"hbapp_activity_ranking"
),
ACTIVITY_OFFLINE
(
1004
,
"活动下线通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_offline"
,
"/pages/route/index?pageType="
,
"hbapp_activity_ranking"
,
"activityDown"
,
"haobanNotice"
),
ACTIVITY_END
(
1005
,
"活动结束通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_end"
,
"/pages/route/index?pageType="
,
"hbapp_activity_ranking"
),
ACTIVITY_END
(
1005
,
"活动结束通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_end"
,
"/pages/route/index?pageType="
,
"hbapp_activity_ranking"
,
"activityEnd"
,
"haobanNotice"
),
ACTIVITY_RANK
(
1006
,
"活动排名通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_rank"
,
"/pages/route/index?pageType="
,
"hbapp_activity_ranking"
),
ACTIVITY_RANK
(
1006
,
"活动排名通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_rank"
,
"/pages/route/index?pageType="
,
"hbapp_activity_ranking"
,
"activityRank"
,
"haobanNotice"
),
ACTIVITY_AWARD
(
1007
,
"活动奖励通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_award"
,
"/pages/route/index?pageType="
,
"hbapp_activity_ranking"
),
ACTIVITY_AWARD
(
1007
,
"活动奖励通知"
,
NoticeMessageCategoryTypeEnum
.
ACTIVITY
.
getType
(),
"activity_award"
,
"/pages/route/index?pageType="
,
"hbapp_activity_ranking"
,
"activityReward"
,
"haobanNotice"
),
TEL_TASK_CREATE
(
2001
,
"话务任务通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"task_create"
,
"/pages/route/index?pageType="
,
"hbapp_task_list_new"
),
TEL_TASK_CREATE
(
2001
,
"话务任务通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"task_create"
,
"/pages/route/index?pageType="
,
"hbapp_task_list_new"
,
"TelServiceTask"
,
"haobanNotice"
),
TEL_TASK_OVERDUE
(
2002
,
"话务任务逾期推送"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"task_overdue"
,
"/pages/route/index?pageType="
,
"hbapp_marketing_task_list"
),
TEL_TASK_OVERDUE
(
2002
,
"话务任务逾期推送"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"task_overdue"
,
"/pages/route/index?pageType="
,
"hbapp_marketing_task_list"
,
"TelServiceTaskExceedTime"
,
"haobanNotice"
),
//没集成 还没有
//没集成 还没有
TEL_TASK_INVALID
(
2003
,
"话务任务逾期失效通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"task_nvalid"
,
"/pages/route/index?pageType="
,
"hbapp_marketing_task_list"
),
TEL_TASK_INVALID
(
2003
,
"话务任务逾期失效通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"task_nvalid"
,
"/pages/route/index?pageType="
,
"hbapp_marketing_task_list"
,
"TelServiceTaskExceedTimeLoseEfficacy"
,
"haobanNotice"
),
GROUP_TASK_CREATE
(
2004
,
"群发任务通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"group_task_create"
,
"/pages/route/index?pageType="
,
"hbapp_marketing_task_list"
),
GROUP_TASK_CREATE
(
2004
,
"群发任务通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"group_task_create"
,
"/pages/route/index?pageType="
,
"hbapp_marketing_task_list"
,
"groupTask"
,
"haobanNotice"
),
GROUP_TASK_OVERDUE
(
2005
,
"群发任务逾期通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"group_task_overdue"
,
"/pages/route/index?pageType="
,
"hbapp_marketing_task_list"
),
GROUP_TASK_OVERDUE
(
2005
,
"群发任务逾期通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"group_task_overdue"
,
"/pages/route/index?pageType="
,
"hbapp_marketing_task_list"
,
"groupTaskExceedTime"
,
"haobanNotice"
),
//没集成 还没有
//没集成 还没有
GROUP_TASK_INVALID
(
2006
,
"群发任务逾期失效通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"group_task_invalid"
,
"/pages/route/index?pageType="
,
"hbapp_marketing_task_list"
),
GROUP_TASK_INVALID
(
2006
,
"群发任务逾期失效通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"group_task_invalid"
,
"/pages/route/index?pageType="
,
"hbapp_marketing_task_list"
,
"groupTaskExceedTimeLoseEfficacy"
,
"haobanNotice"
),
PERFORMANCE_TASK_CREATE
(
2007
,
"指标任务通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"performance_task_create"
,
"/pages/route/index?pageType="
,
"hbapp_task_kpi_detail"
),
PERFORMANCE_TASK_CREATE
(
2007
,
"指标任务通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"performance_task_create"
,
"/pages/route/index?pageType="
,
"hbapp_task_kpi_detail"
,
"targetTask"
,
"haobanNotice"
),
EVALUATE_TASK_CREATE
(
2008
,
"不良评价通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"evaluate_task_create"
,
"/pages/route/index?pageType="
,
"hbapp_task_detail"
),
EVALUATE_TASK_CREATE
(
2008
,
"不良评价通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"evaluate_task_create"
,
"/pages/route/index?pageType="
,
"hbapp_task_detail"
,
"badEvaluate"
,
"haobanNotice"
),
PERFORMANCE_TASK_CHANGE
(
2009
,
"指标任务通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"performance_task_change"
,
"/pages/route/index?pageType="
,
"hbapp_task_kpi_detail"
),
PERFORMANCE_TASK_CHANGE
(
2009
,
"指标任务通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"performance_task_change"
,
"/pages/route/index?pageType="
,
"hbapp_task_kpi_detail"
,
"targetTaskByStoreManage"
,
"haobanNotice"
),
TASK_TRANS
(
2010
,
"话务任务通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"task_trans"
,
"/pages/route/index?pageType="
,
"hbapp_task_list_new"
),
TASK_TRANS
(
2010
,
"话务任务通知"
,
NoticeMessageCategoryTypeEnum
.
TASK
.
getType
(),
"task_trans"
,
"/pages/route/index?pageType="
,
"hbapp_task_list_new"
,
"TelServiceTaskByStoreManage"
,
"haobanNotice"
),
STORE_ACCOUNT
(
3001
,
"账号申请"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"store_account"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
),
STORE_ACCOUNT
(
3001
,
"账号申请"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"store_account"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
,
"accountApplication"
,
"haobanNotice"
),
MEMBER_FACE
(
3002
,
"账号申请"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"member_face"
,
"/pages/route/index?pageType="
,
"hbapp_customer_edit_tag"
),
//
STORE_ACCOUNT_REFUSE
(
3010
,
"账号申请"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"store_account_refuse"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
),
MEMBER_FACE
(
3002
,
"账号申请"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"member_face"
,
"/pages/route/index?pageType="
,
"hbapp_customer_edit_tag"
,
""
,
"haobanNotice"
),
STORE_ACCOUNT_AGREE
(
3011
,
"账号申请"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"store_account_agree"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
),
CLERK_ADD_REFUSE
(
3020
,
"导购新增通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"clerk_add_refuse"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
),
//下面两个使用staff发送
CLERK_ADD_AGREE
(
3021
,
"导购新增通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"clerk_add_agree"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
),
STORE_ACCOUNT_REFUSE
(
3010
,
"账号申请"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"store_account_refuse"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
,
"refuseAccountApplication"
,
"haobanNotice"
),
CLERK_DEL_REFUSE
(
3022
,
"导购删除通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"clerk_del_refuse"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
),
STORE_ACCOUNT_AGREE
(
3011
,
"账号申请"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"store_account_agree"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
,
"agreeAccountApplication"
,
"haobanNotice"
),
CLERK_DEL_AGREE
(
3023
,
"导购删除通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"clerk_del_agree"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
),
STORE_EDIT_REFUSE
(
3024
,
"门店信息修改通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"store_edit_refuse"
,
"/pages/route/index?pageType="
,
"store_detail"
),
STORE_EDIT_AGREE
(
3025
,
"门店信息修改通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"store_edit_agree"
,
"/pages/route/index?pageType="
,
"store_detail"
),
DAILY_REPORT
(
3031
,
"云日报通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"daily_report"
,
"/pages/route/index?pageType="
,
"hbapp_task_daily_report_detail"
),
DAILY_REPORT_TRANS
(
3033
,
"云日报通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"daily_report_trans"
,
"/pages/route/index?pageType="
,
"hbapp_task_daily_report_detail"
),
CASH_OUT_REFUSE
(
3040
,
"提现通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"cash_out_refuse"
,
"/pages/route/index?pageType="
,
"hbapp_withdraw_list"
),
CLERK_ADD_REFUSE
(
3020
,
"导购新增通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"clerk_add_refuse"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
,
"refuseAddClerk"
,
"haobanNotice"
),
CLERK_ADD_AGREE
(
3021
,
"导购新增通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"clerk_add_agree"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
,
"agreeAddClerk"
,
"haobanNotice"
),
//
CLERK_DEL_REFUSE
(
3022
,
"导购删除通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"clerk_del_refuse"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
,
"refuseDeleteClerk"
,
"haobanNotice"
),
CLERK_DEL_AGREE
(
3023
,
"导购删除通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"clerk_del_agree"
,
"/pages/route/index?pageType="
,
"store_relate_store_record_list"
,
"agreeDeleteClerk"
,
"haobanNotice"
),
STORE_EDIT_REFUSE
(
3024
,
"门店信息修改通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"store_edit_refuse"
,
"/pages/route/index?pageType="
,
"store_detail"
,
"refuseStoreInfoUpdate"
,
"haobanNotice"
),
STORE_EDIT_AGREE
(
3025
,
"门店信息修改通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"store_edit_agree"
,
"/pages/route/index?pageType="
,
"store_detail"
,
"agreeStoreInfoUpdate"
,
"haobanNotice"
),
DAILY_REPORT
(
3031
,
"云日报通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"daily_report"
,
"/pages/route/index?pageType="
,
"hbapp_task_daily_report_detail"
,
"cloudDailyForStoreManage"
,
"haobanNotice"
),
DAILY_REPORT_TRANS
(
3033
,
"云日报通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"daily_report_trans"
,
"/pages/route/index?pageType="
,
"hbapp_task_daily_report_detail"
,
"cloudDailyForClerk"
,
"haobanNotice"
),
CASH_OUT_REFUSE
(
3040
,
"提现通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"cash_out_refuse"
,
"/pages/route/index?pageType="
,
"hbapp_withdraw_list"
,
"CashWithdrawal"
,
"haobanNotice"
),
OFFLINE_PRE
(
3041
,
"预约提醒"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"task_overdue"
,
"/pages/route/index?pageType="
,
"hbapp_appointment_list"
),
OFFLINE_PRE
(
3041
,
"预约提醒"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"task_overdue"
,
"/pages/route/index?pageType="
,
"hbapp_appointment_list"
,
"offlinePre"
,
"haobanNotice"
),
CUSTOMER_MOVE
(
3052
,
"客户变动通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"customer_move"
,
"/pages/route/index?pageType="
,
"hbapp_customer_list"
),
CUSTOMER_MOVE
(
3052
,
"客户变动通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"customer_move"
,
"/pages/route/index?pageType="
,
"hbapp_customer_list"
,
"assignCustomers"
,
"haobanNotice"
),
CUSTOMER_MOVED
(
3053
,
"客户变动通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"customer_moved"
,
"/pages/route/index?pageType="
,
"hbapp_customer_list"
),
CUSTOMER_MOVED
(
3053
,
"客户变动通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"customer_moved"
,
"/pages/route/index?pageType="
,
"hbapp_customer_list"
,
"removeCustomer"
,
"haobanNotice"
),
CUSTOMER_UNBIND
(
3054
,
"客户变动通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"customer_unbind"
,
"/pages/route/index?pageType="
,
"hbapp_customer_list"
),
CUSTOMER_UNBIND
(
3054
,
"客户变动通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"customer_unbind"
,
"/pages/route/index?pageType="
,
"hbapp_customer_list"
,
""
,
""
),
CUSTOMER_ORDER_CREATE
(
4001
,
"客户下单通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_order_create"
,
"/pages/route/index?pageType="
,
"hbapp_customer_order_detail"
),
CUSTOMER_ORDER_CREATE
(
4001
,
"客户下单通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_order_create"
,
"/pages/route/index?pageType="
,
"hbapp_customer_order_detail"
,
"customerBuyOrder"
,
"haobanNotice"
),
CUSTOMER_ORDER_REFUND
(
4002
,
"客户退单通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_order_refund"
,
"/pages/route/index?pageType="
,
"hbapp_withdraw_list"
),
//
CUSTOMER_ORDER_LOOK
(
4003
,
"客户浏览通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_order_look"
,
"/pages/route/index?pageType="
,
"hbapp_customer_look_goods"
),
CUSTOMER_ORDER_REFUND
(
4002
,
"客户退单通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_order_refund"
,
"/pages/route/index?pageType="
,
"hbapp_withdraw_list"
,
"customerChargebackOrder"
,
"haobanNotice"
),
CUSTOMER_GET_COUPON
(
4004
,
"客户领券通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_get_coupon"
,
"/pages/route/index?pageType="
,
"hbapp_customer_detail"
),
CUSTOMER_ORDER_LOOK
(
4003
,
"客户浏览通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_order_look"
,
"/pages/route/index?pageType="
,
"hbapp_customer_look_goods"
,
"customerBrowsing"
,
"haobanNotice"
),
CUSTOMER_APPLY_ORDER_REFUND
(
4005
,
"客户申请退单通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_apply_order_refund"
,
"/pages/route/index?pageType="
,
"hbapp_customer_order_detail"
),
CUSTOMER_GET_COUPON
(
4004
,
"客户领券通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_get_coupon"
,
"/pages/route/index?pageType="
,
"hbapp_customer_detail"
,
"customerGetCoupon"
,
"haobanNotice"
),
CUSTOMER_SUCCESS_ORDER_REFUND
(
4006
,
"客户成功退单通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_success_order_refund"
,
"/pages/route/index?pageType="
,
"hbapp_user_bill_detail"
),
CUSTOMER_APPLY_ORDER_REFUND
(
4005
,
"客户申请退单通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_apply_order_refund"
,
"/pages/route/index?pageType="
,
"hbapp_customer_order_detail"
,
"customerApplyChargebackOrder"
,
"haobanNotice"
),
CUSTOMER_SUCCESS_ORDER_REFUND
(
4006
,
"客户成功退单通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_success_order_refund"
,
"/pages/route/index?pageType="
,
"hbapp_user_bill_detail"
,
"customerChargebackOrderSuccess"
,
"haobanNotice"
),
// 订单- 待发货订单提醒
// 订单- 待发货订单提醒
ORDER_TAKE
(
5000
,
"待自提订单提醒"
,
NoticeMessageCategoryTypeEnum
.
ORDER
.
getType
(),
"order_take"
,
"/pages/route/index?pageType="
,
"hbapp_order_verfication"
),
ORDER_TAKE
(
5000
,
"待自提订单提醒"
,
NoticeMessageCategoryTypeEnum
.
ORDER
.
getType
(),
"order_take"
,
"/pages/route/index?pageType="
,
"hbapp_order_verfication"
,
"toBePickUpOrderRemind"
,
"haobanNotice"
),
ORDER_PAY
(
5001
,
"待发货订单提醒"
,
NoticeMessageCategoryTypeEnum
.
ORDER
.
getType
(),
"order_pay"
,
"/pages/route/index?pageType="
,
"hbapp_order_center"
),
ORDER_PAY
(
5001
,
"待发货订单提醒"
,
NoticeMessageCategoryTypeEnum
.
ORDER
.
getType
(),
"order_pay"
,
"/pages/route/index?pageType="
,
"hbapp_order_center"
,
"reminderForPendingOrders"
,
"haobanNotice"
),
REFUND_AUDIT
(
5010
,
"售后待审核提醒"
,
NoticeMessageCategoryTypeEnum
.
REFUND
.
getType
(),
"refund_audit"
,
"/pages/route/index?pageType="
,
"hbapp_order_center"
),
REFUND_AUDIT
(
5010
,
"新增售后提醒"
,
NoticeMessageCategoryTypeEnum
.
REFUND
.
getType
(),
"refund_audit"
,
"/pages/route/index?pageType="
,
"hbapp_order_center"
,
"afterSalesReviewReminder"
,
"haobanNotice"
),
REFUND_MEMBER_CANCEL
(
5011
,
"买家取消售后提醒"
,
NoticeMessageCategoryTypeEnum
.
REFUND
.
getType
(),
"refund_member_cancel"
,
"/pages/route/index?pageType="
,
"hbapp_order_center"
),
REFUND_MEMBER_CANCEL
(
5011
,
"买家取消售后提醒"
,
NoticeMessageCategoryTypeEnum
.
REFUND
.
getType
(),
"refund_member_cancel"
,
"/pages/route/index?pageType="
,
"hbapp_order_center"
,
"afterSalesCancelReminder"
,
"haobanNotice"
),
REFUND_DELIVER
(
5013
,
"买家寄出退换货提醒"
,
NoticeMessageCategoryTypeEnum
.
REFUND
.
getType
(),
"refund_deliver"
,
"/pages/route/index?pageType="
,
"hbapp_order_center"
),
REFUND_DELIVER
(
5013
,
"买家寄出退换货提醒"
,
NoticeMessageCategoryTypeEnum
.
REFUND
.
getType
(),
"refund_deliver"
,
"/pages/route/index?pageType="
,
"hbapp_order_center"
,
"buyerSendsBackRemind"
,
"haobanNotice"
),
MATERIAL_NEW_NOTIFY
(
6001
,
"素材上新通知"
,
NoticeMessageCategoryTypeEnum
.
MATERIAL
.
getType
(),
"material_new_notify"
,
"/pages/route/index?pageType="
,
"hbapp_material_center"
),
//
MATERIAL_REPORT_NOTIFY
(
6002
,
"素材周报/月报通知"
,
NoticeMessageCategoryTypeEnum
.
MATERIAL
.
getType
(),
"material_week_notify"
,
"/pages/route/index?pageType="
,
"hbapp_mate_report"
),
MATERIAL_NEW_NOTIFY
(
6001
,
"素材上新通知"
,
NoticeMessageCategoryTypeEnum
.
MATERIAL
.
getType
(),
"material_new_notify"
,
"/pages/route/index?pageType="
,
"hbapp_material_center"
,
"materialsNotice"
,
"clerkMaterialsNotice"
),
MATERIAL_REPORT_NOTIFY_WEEK
(
6002
,
"素材周报通知"
,
NoticeMessageCategoryTypeEnum
.
MATERIAL
.
getType
(),
"material_week_notify"
,
"/pages/route/index?pageType="
,
"hbapp_mate_report"
,
"materialWeek"
,
"clerkMaterialsReport"
),
MATERIAL_REPORT_NOTIFY_MONTH
(
6004
,
"素材月报通知"
,
NoticeMessageCategoryTypeEnum
.
MATERIAL
.
getType
(),
"material_month_notify"
,
"/pages/route/index?pageType="
,
"hbapp_mate_report"
,
"materialMonth"
,
"clerkMaterialsReport"
),
POTENTIAL_CUSTOMER_NOTIFY
(
6003
,
"销售线索通知"
,
NoticeMessageCategoryTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
(),
"potential_customer_notify"
,
"/pages/route/index?pageType="
,
"hbapp_sales_clue_center"
);
POTENTIAL_CUSTOMER_NOTIFY
(
6003
,
"销售线索通知"
,
NoticeMessageCategoryTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
(),
"potential_customer_notify"
,
"/pages/route/index?pageType="
,
"hbapp_sales_clue_center"
,
"salesLeadNotice"
,
"haobanNotice"
);
/**
/**
* 消息类型
* 消息类型
*/
*/
@Deprecated
private
int
type
;
private
int
type
;
/**
/**
* 消息名称
* 消息名称
*/
*/
@Deprecated
private
String
name
;
private
String
name
;
/**
/**
* 大类
* 大类
*/
*/
@Deprecated
private
int
category
;
private
int
category
;
/**
/**
* 模板类型
* 模板类型
*/
*/
@Deprecated
private
String
templateCode
;
private
String
templateCode
;
/**
/**
* 活动页面
* 活动页面
*/
*/
@Deprecated
private
String
pageUrl
;
private
String
pageUrl
;
/**
/**
* 前端的页面类型
* 前端的页面类型
*/
*/
@Deprecated
private
String
pageType
;
private
String
pageType
;
NoticeMessageTypeEnum
(
int
type
,
String
name
,
int
category
,
String
templateCode
,
String
pageUrl
,
String
pageType
)
{
private
String
messageCode
;
private
String
routerCode
;
NoticeMessageTypeEnum
(
int
type
,
String
name
,
int
category
,
String
templateCode
,
String
pageUrl
,
String
pageType
,
String
messageCode
,
String
routerCode
)
{
this
.
type
=
type
;
this
.
type
=
type
;
this
.
name
=
name
;
this
.
name
=
name
;
this
.
category
=
category
;
this
.
category
=
category
;
this
.
templateCode
=
templateCode
;
this
.
templateCode
=
templateCode
;
this
.
pageUrl
=
pageUrl
;
this
.
pageUrl
=
pageUrl
;
this
.
pageType
=
pageType
;
this
.
pageType
=
pageType
;
this
.
messageCode
=
messageCode
;
this
.
routerCode
=
routerCode
;
}
}
...
@@ -165,4 +183,20 @@ public enum NoticeMessageTypeEnum {
...
@@ -165,4 +183,20 @@ public enum NoticeMessageTypeEnum {
}
}
return
null
;
return
null
;
}
}
public
String
getMessageCode
()
{
return
messageCode
;
}
public
void
setMessageCode
(
String
messageCode
)
{
this
.
messageCode
=
messageCode
;
}
public
String
getRouterCode
()
{
return
routerCode
;
}
public
void
setRouterCode
(
String
routerCode
)
{
this
.
routerCode
=
routerCode
;
}
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/notify/NoticeMessageApiService.java
View file @
e28e43a0
...
@@ -5,6 +5,7 @@ import com.gic.api.base.commons.Page;
...
@@ -5,6 +5,7 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.notify.dto.NoticeMessageInfoDTO
;
import
com.gic.haoban.manage.api.dto.notify.dto.NoticeMessageInfoDTO
;
import
com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO
;
import
com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.NoticeMessageQDTO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -82,4 +83,12 @@ public interface NoticeMessageApiService {
...
@@ -82,4 +83,12 @@ public interface NoticeMessageApiService {
*/
*/
public
ServiceResponse
<
Boolean
>
updateWriteFlagByClerkId
(
String
enterpriseId
,
String
clerkId
,
int
categoryType
);
public
ServiceResponse
<
Boolean
>
updateWriteFlagByClerkId
(
String
enterpriseId
,
String
clerkId
,
int
categoryType
);
/**
* 新增好办内部通知
*
* @param qdto
* @return
*/
public
ServiceResponse
<
Boolean
>
addOrCreateNoticeMessage
(
List
<
NoticeMessageQDTO
>
qdto
);
}
}
\ No newline at end of file
haoban-manage3-service/pom.xml
View file @
e28e43a0
...
@@ -196,6 +196,12 @@
...
@@ -196,6 +196,12 @@
<artifactId>
gic-order-api
</artifactId>
<artifactId>
gic-order-api
</artifactId>
<version>
${gic-order-api}
</version>
<version>
${gic-order-api}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-message-center-api
</artifactId>
<version>
${gic-message-center-api}
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/content/context/MaterialReportContext.java
View file @
e28e43a0
...
@@ -2,8 +2,10 @@ package com.gic.haoban.manage.service.pojo.bo.content.context;
...
@@ -2,8 +2,10 @@ package com.gic.haoban.manage.service.pojo.bo.content.context;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum
;
import
com.gic.haoban.manage.api.enums.content.MaterialReportType
;
import
com.gic.haoban.manage.api.enums.content.MaterialReportType
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO
;
import
com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO
;
...
@@ -13,11 +15,11 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -13,11 +15,11 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
gic
.
haoban
.
manage
.
api
.
enums
.
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY
;
/**
/**
* @Author MUSI
* @Author MUSI
...
@@ -106,16 +108,22 @@ public class MaterialReportContext {
...
@@ -106,16 +108,22 @@ public class MaterialReportContext {
log
.
info
(
"成员{}为区经角色, 不发送小程序消息通知 "
,
this
.
staffId
);
log
.
info
(
"成员{}为区经角色, 不发送小程序消息通知 "
,
this
.
staffId
);
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
}
final
NoticeMessageTypeEnum
noticeMessageTypeEnum
=
MaterialReportType
.
WEEK
.
getCode
().
equals
(
this
.
getReportType
())
?
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY_WEEK
:
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY_MONTH
;
if
(
ObjectUtil
.
isNull
(
noticeMessageTypeEnum
)){
return
new
ArrayList
<>();
}
return
this
.
staffClerkRelations
return
this
.
staffClerkRelations
.
stream
()
.
stream
()
.
map
(
item
->
{
.
map
(
item
->
{
NoticeMessageBO
noticeMessageBO
=
new
NoticeMessageBO
();
NoticeMessageBO
noticeMessageBO
=
new
NoticeMessageBO
();
noticeMessageBO
.
setCategoryType
(
MATERIAL_REPORT_NOTIFY
.
getCategory
());
noticeMessageBO
.
setCategoryType
(
noticeMessageTypeEnum
.
getCategory
());
noticeMessageBO
.
setMessageType
(
MATERIAL_REPORT_NOTIFY
.
getType
());
noticeMessageBO
.
setMessageType
(
noticeMessageTypeEnum
.
getType
());
noticeMessageBO
.
setClerkId
(
StringUtils
.
isNotBlank
(
item
.
getClerkId
())
?
item
.
getClerkId
()
:
"-1"
);
noticeMessageBO
.
setClerkId
(
StringUtils
.
isNotBlank
(
item
.
getClerkId
())
?
item
.
getClerkId
()
:
"-1"
);
noticeMessageBO
.
setStoreId
(
StringUtils
.
isNotBlank
(
item
.
getStoreId
())
?
item
.
getStoreId
()
:
"-1"
);
noticeMessageBO
.
setStoreId
(
StringUtils
.
isNotBlank
(
item
.
getStoreId
())
?
item
.
getStoreId
()
:
"-1"
);
noticeMessageBO
.
setTitle
(
this
.
getMessageTitle
());
noticeMessageBO
.
setTitle
(
this
.
getMessageTitle
());
noticeMessageBO
.
setTemplateCode
(
MATERIAL_REPORT_NOTIFY
.
getTemplateCode
());
noticeMessageBO
.
setTemplateCode
(
noticeMessageTypeEnum
.
getTemplateCode
());
noticeMessageBO
.
setDescription
(
this
.
getMessageDesc
());
noticeMessageBO
.
setDescription
(
this
.
getMessageDesc
());
noticeMessageBO
.
setEnterpriseId
(
this
.
enterpriseId
);
noticeMessageBO
.
setEnterpriseId
(
this
.
enterpriseId
);
noticeMessageBO
.
setRelationId
(
this
.
clerkId
);
noticeMessageBO
.
setRelationId
(
this
.
clerkId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/adaptor/MaterialReportBuilder.java
View file @
e28e43a0
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
content
.
adaptor
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
content
.
adaptor
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
...
@@ -22,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -22,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Optional
;
...
@@ -198,7 +200,9 @@ public class MaterialReportBuilder {
...
@@ -198,7 +200,9 @@ public class MaterialReportBuilder {
articleInfo
.
setTitle
(
context
.
getMessageTitle
());
articleInfo
.
setTitle
(
context
.
getMessageTitle
());
articleInfo
.
setDescription
(
context
.
getMessageDesc
());
articleInfo
.
setDescription
(
context
.
getMessageDesc
());
String
extendParams
=
StringUtils
.
isNotBlank
(
context
.
getMainStoreId
())
?
context
.
getMainStoreId
()
:
context
.
getEnterpriseId
();
String
extendParams
=
StringUtils
.
isNotBlank
(
context
.
getMainStoreId
())
?
context
.
getMainStoreId
()
:
context
.
getEnterpriseId
();
articleInfo
.
setPagepath
(
NoticeMessageUtil
.
buildMiniAppUrl
(
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY
,
context
.
extendParams
(
extendParams
)));
final
NoticeMessageTypeEnum
noticeMessageTypeEnum
=
MaterialReportType
.
WEEK
.
getCode
().
equals
(
context
.
getReportType
())
?
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY_WEEK
:
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY_MONTH
;
articleInfo
.
setPagepath
(
NoticeMessageUtil
.
buildMiniAppUrl
(
noticeMessageTypeEnum
,
context
.
extendParams
(
extendParams
)));
articleInfo
.
setPicurl
(
context
.
getMaterialReportUrl
());
articleInfo
.
setPicurl
(
context
.
getMaterialReportUrl
());
newsSendMessage
.
setArticleMessages
(
Collections
.
singletonList
(
articleInfo
));
newsSendMessage
.
setArticleMessages
(
Collections
.
singletonList
(
articleInfo
));
return
newsSendMessage
;
return
newsSendMessage
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/adaptor/PotentialCustomerNotifyBuilder.java
View file @
e28e43a0
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
content
.
adaptor
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
content
.
adaptor
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
...
@@ -15,7 +16,10 @@ import com.gic.haoban.manage.service.pojo.bo.content.context.PotentialCustomerNo
...
@@ -15,7 +16,10 @@ import com.gic.haoban.manage.service.pojo.bo.content.context.PotentialCustomerNo
import
com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService
;
import
com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.message.NoticeMessageHandler
;
import
com.gic.haoban.manage.service.service.notify.NoticeMessageService
;
import
com.gic.haoban.manage.service.service.notify.NoticeMessageService
;
import
com.gic.haoban.manage.service.util.ApolloUtils
;
import
com.gic.message.center.api.subscribe.model.NoticeMessageForm
;
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
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
...
@@ -28,6 +32,7 @@ import org.springframework.stereotype.Component;
...
@@ -28,6 +32,7 @@ import org.springframework.stereotype.Component;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -60,6 +65,8 @@ public class PotentialCustomerNotifyBuilder {
...
@@ -60,6 +65,8 @@ public class PotentialCustomerNotifyBuilder {
private
Config
config
;
private
Config
config
;
@Autowired
@Autowired
private
StaffApiService
staffApiService
;
private
StaffApiService
staffApiService
;
@Autowired
private
NoticeMessageHandler
noticeMessageHandler
;
/**
/**
* 获取企业下所有导购id
* 获取企业下所有导购id
...
@@ -189,10 +196,29 @@ public class PotentialCustomerNotifyBuilder {
...
@@ -189,10 +196,29 @@ public class PotentialCustomerNotifyBuilder {
log
.
info
(
"企业信息不存在 {}"
,
staffClerkRelation
.
getWxEnterpriseId
());
log
.
info
(
"企业信息不存在 {}"
,
staffClerkRelation
.
getWxEnterpriseId
());
continue
;
continue
;
}
}
QywxXcxSendMessageDTO
messageDTO
=
this
.
buildApplicationMessage
(
staffClerkRelation
,
wxEnterpriseQwDTO
,
if
(!
ApolloUtils
.
useMessageCenter
()){
log
.
info
(
"消息中心-走老版消息通知"
);
/* 消息中心修改此处*/
QywxXcxSendMessageDTO
messageDTO
=
this
.
buildApplicationMessage
(
staffClerkRelation
,
wxEnterpriseQwDTO
,
customerStaticsBOMap
.
get
(
staffClerkRelation
.
getClerkId
()).
getNum
(),
context
.
buildExtendParams
(
staffClerkRelation
.
getStoreId
(),
staffClerkRelation
.
getClerkId
()));
customerStaticsBOMap
.
get
(
staffClerkRelation
.
getClerkId
()).
getNum
(),
context
.
buildExtendParams
(
staffClerkRelation
.
getStoreId
(),
staffClerkRelation
.
getClerkId
()));
boolean
sendMessage
=
qywxSuiteApiService
.
sendMessage
(
wxEnterpriseQwDTO
.
getThirdCorpid
(),
wxEnterpriseQwDTO
.
getSelf3thSecret
(),
messageDTO
,
wxEnterpriseQwDTO
.
isSelf
(),
wxEnterpriseQwDTO
.
getUrlHost
());
boolean
sendMessage
=
qywxSuiteApiService
.
sendMessage
(
wxEnterpriseQwDTO
.
getThirdCorpid
(),
wxEnterpriseQwDTO
.
getSelf3thSecret
(),
messageDTO
,
wxEnterpriseQwDTO
.
isSelf
(),
wxEnterpriseQwDTO
.
getUrlHost
());
log
.
info
(
"发送销售线索应用消息结果 {}"
,
sendMessage
);
log
.
info
(
"发送销售线索应用消息结果 {}"
,
sendMessage
);
}
else
{
Map
<
String
,
String
>
variableMap
=
new
HashMap
<>();
variableMap
.
put
(
"memberNum"
,
customerStaticsBOMap
.
get
(
staffClerkRelation
.
getClerkId
()).
getNum
().
toString
());
variableMap
.
put
(
"page"
,
NoticeMessageUtil
.
buildMiniAppUrl
(
NoticeMessageTypeEnum
.
POTENTIAL_CUSTOMER_NOTIFY
,
context
.
buildExtendParams
(
staffClerkRelation
.
getStoreId
(),
staffClerkRelation
.
getClerkId
())));
noticeMessageHandler
.
sendMessage
(
NoticeMessageForm
.
builder
()
.
messageCode
(
NoticeMessageTypeEnum
.
POTENTIAL_CUSTOMER_NOTIFY
.
getMessageCode
())
.
mqRouterCode
(
NoticeMessageTypeEnum
.
POTENTIAL_CUSTOMER_NOTIFY
.
getRouterCode
())
.
businessId
(
"-1"
)
.
createTime
(
new
Date
())
.
enterpriseId
(
context
.
getEnterpriseId
())
.
uniqueKey
(
UniqueIdUtils
.
uniqueLongHex
())
.
userIdList
(
Collections
.
singletonList
(
staffClerkRelation
.
getClerkId
()))
.
variableMap
(
variableMap
).
build
());
}
}
}
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/impl/MaterialReportServiceImpl.java
View file @
e28e43a0
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
content
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
content
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum
;
import
com.gic.haoban.manage.api.enums.content.MaterialReportType
;
import
com.gic.haoban.manage.api.util.notify.NoticeMessageUtil
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO
;
import
com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO
;
...
@@ -12,7 +18,11 @@ import com.gic.haoban.manage.service.service.StaffService;
...
@@ -12,7 +18,11 @@ import com.gic.haoban.manage.service.service.StaffService;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.content.MaterialReportService
;
import
com.gic.haoban.manage.service.service.content.MaterialReportService
;
import
com.gic.haoban.manage.service.service.content.adaptor.MaterialReportBuilder
;
import
com.gic.haoban.manage.service.service.content.adaptor.MaterialReportBuilder
;
import
com.gic.haoban.manage.service.service.message.NoticeMessageHandler
;
import
com.gic.haoban.manage.service.service.notify.NoticeMessageService
;
import
com.gic.haoban.manage.service.service.notify.NoticeMessageService
;
import
com.gic.haoban.manage.service.util.ApolloUtils
;
import
com.gic.message.center.api.subscribe.model.NoticeMessageForm
;
import
com.gic.wechat.api.dto.qywx.QywxNewsArticleMessageDTO
;
import
com.gic.wechat.api.dto.qywx.QywxNewsSendMessageDTO
;
import
com.gic.wechat.api.dto.qywx.QywxNewsSendMessageDTO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -21,7 +31,12 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -21,7 +31,12 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @Author MUSI
* @Author MUSI
...
@@ -49,6 +64,9 @@ public class MaterialReportServiceImpl implements MaterialReportService {
...
@@ -49,6 +64,9 @@ public class MaterialReportServiceImpl implements MaterialReportService {
@Autowired
@Autowired
private
Config
config
;
private
Config
config
;
@Autowired
private
NoticeMessageHandler
noticeMessageHandler
;
/**
/**
* 素材周报/月报
* 素材周报/月报
...
@@ -87,13 +105,24 @@ public class MaterialReportServiceImpl implements MaterialReportService {
...
@@ -87,13 +105,24 @@ public class MaterialReportServiceImpl implements MaterialReportService {
materialReportBuilder
.
buildMaterialReportData
(
context
);
materialReportBuilder
.
buildMaterialReportData
(
context
);
// 保存小程序消息
// 保存小程序消息
List
<
NoticeMessageBO
>
noticeMessageBos
=
context
.
buildNotifyMessageBos
();
List
<
NoticeMessageBO
>
noticeMessageBos
=
context
.
buildNotifyMessageBos
();
if
(
CollectionUtils
.
isNotEmpty
(
noticeMessageBos
))
{
noticeMessageService
.
addNoticeMessageBatch
(
noticeMessageBos
);
if
(!
ApolloUtils
.
useMessageCenter
()){
log
.
info
(
"消息中心-走老版消息通知"
);
/*消息中心修改此处*/
if
(
CollectionUtils
.
isNotEmpty
(
noticeMessageBos
))
{
noticeMessageService
.
addNoticeMessageBatch
(
noticeMessageBos
);
}
}
}
if
(
StringUtils
.
isBlank
(
context
.
getClerkId
()))
{
if
(
StringUtils
.
isBlank
(
context
.
getClerkId
()))
{
log
.
info
(
"成员{}在企业{}中不存在主门店, 不推送企微应用消息"
,
staffId
,
enterpriseId
);
log
.
info
(
"成员{}在企业{}中不存在主门店, 不推送企微应用消息"
,
staffId
,
enterpriseId
);
if
(
ApolloUtils
.
useMessageCenter
())
{
noticeMessageService
.
addNoticeMessageBatch
(
noticeMessageBos
);
}
return
;
return
;
}
}
// 发送企微消息
// 发送企微消息
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
staffInfo
.
getWxEnterpriseId
());
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
staffInfo
.
getWxEnterpriseId
());
QywxNewsSendMessageDTO
newsSendMessageDTO
=
materialReportBuilder
.
buildQywxNewsMessage
(
context
,
qwDTO
);
QywxNewsSendMessageDTO
newsSendMessageDTO
=
materialReportBuilder
.
buildQywxNewsMessage
(
context
,
qwDTO
);
...
@@ -102,7 +131,46 @@ public class MaterialReportServiceImpl implements MaterialReportService {
...
@@ -102,7 +131,46 @@ public class MaterialReportServiceImpl implements MaterialReportService {
return
;
return
;
}
}
log
.
info
(
"发送企业图文消息参数{}"
,
JSON
.
toJSONString
(
newsSendMessageDTO
));
log
.
info
(
"发送企业图文消息参数{}"
,
JSON
.
toJSONString
(
newsSendMessageDTO
));
boolean
result
=
qywxSuiteApiService
.
sendMessage
(
qwDTO
.
getThirdCorpid
(),
qwDTO
.
getSelf3thSecret
(),
newsSendMessageDTO
,
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
());
log
.
info
(
"成员{}发送素材企微使用报告结果 {}"
,
staffId
,
result
);
if
(!
ApolloUtils
.
useMessageCenter
()){
log
.
info
(
"消息中心-走老版消息通知"
);
/*消息中心修改此处*/
boolean
result
=
qywxSuiteApiService
.
sendMessage
(
qwDTO
.
getThirdCorpid
(),
qwDTO
.
getSelf3thSecret
(),
newsSendMessageDTO
,
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
());
log
.
info
(
"成员{}发送素材企微使用报告结果 {}"
,
staffId
,
result
);
return
;
}
else
{
Map
<
String
,
String
>
variableMap
=
new
HashMap
<>();
QywxNewsArticleMessageDTO
qywxNewsArticleMessageDTO
=
newsSendMessageDTO
.
getArticleMessages
().
get
(
0
);
variableMap
.
put
(
"image"
,
qywxNewsArticleMessageDTO
.
getPicurl
());
variableMap
.
put
(
"page"
,
qywxNewsArticleMessageDTO
.
getPagepath
());
variableMap
.
put
(
"templateTitle"
,
qywxNewsArticleMessageDTO
.
getTitle
());
variableMap
.
put
(
"templateDescription"
,
qywxNewsArticleMessageDTO
.
getDescription
());
variableMap
.
put
(
"haobanNoticeMessageList"
,
JSONObject
.
toJSONString
(
noticeMessageBos
));
NoticeMessageTypeEnum
noticeMessageTypeEnum
=
null
;
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
context
.
getReportType
()))
{
noticeMessageTypeEnum
=
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY_WEEK
;
}
else
if
(
MaterialReportType
.
MONTH
.
getCode
().
equals
(
context
.
getReportType
()))
{
noticeMessageTypeEnum
=
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY_MONTH
;
}
if
(
ObjectUtil
.
isNull
(
noticeMessageTypeEnum
)){
log
.
info
(
"枚举不存在 context:{}"
,
JSONObject
.
toJSONString
(
context
));
return
;
}
noticeMessageHandler
.
sendMessage
(
NoticeMessageForm
.
builder
()
.
messageCode
(
noticeMessageTypeEnum
.
getMessageCode
())
.
mqRouterCode
(
noticeMessageTypeEnum
.
getRouterCode
())
.
businessId
(
"-1"
)
.
createTime
(
new
Date
())
.
enterpriseId
(
context
.
getEnterpriseId
())
.
uniqueKey
(
UniqueIdUtils
.
uniqueLongHex
())
.
userIdList
(
context
.
getClerkId
()
==
null
?
new
ArrayList
<>()
:
Collections
.
singletonList
(
context
.
getClerkId
()))
.
variableMap
(
variableMap
).
build
());
}
/*boolean result = qywxSuiteApiService.sendMessage(qwDTO.getThirdCorpid(), qwDTO.getSelf3thSecret(), newsSendMessageDTO,qwDTO.isSelf(),qwDTO.getUrlHost());
log.info("成员{}发送素材企微使用报告结果 {}", staffId, result);*/
}
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/impl/PotentialCustomerServiceImpl.java
View file @
e28e43a0
...
@@ -21,6 +21,7 @@ import com.gic.haoban.manage.service.service.content.InteractRecordService;
...
@@ -21,6 +21,7 @@ import com.gic.haoban.manage.service.service.content.InteractRecordService;
import
com.gic.haoban.manage.service.service.content.PotentialCustomerService
;
import
com.gic.haoban.manage.service.service.content.PotentialCustomerService
;
import
com.gic.haoban.manage.service.service.content.adaptor.InteractRecordMessageBuilder
;
import
com.gic.haoban.manage.service.service.content.adaptor.InteractRecordMessageBuilder
;
import
com.gic.haoban.manage.service.service.content.adaptor.PotentialCustomerNotifyBuilder
;
import
com.gic.haoban.manage.service.service.content.adaptor.PotentialCustomerNotifyBuilder
;
import
com.gic.haoban.manage.service.util.ApolloUtils
;
import
com.gic.member.api.dto.es.MemberDataDTO
;
import
com.gic.member.api.dto.es.MemberDataDTO
;
import
com.gic.member.api.service.MemberOutApiService
;
import
com.gic.member.api.service.MemberOutApiService
;
import
com.gic.search.engine.api.constant.MemberDataEnum
;
import
com.gic.search.engine.api.constant.MemberDataEnum
;
...
@@ -263,7 +264,13 @@ public class PotentialCustomerServiceImpl implements PotentialCustomerService {
...
@@ -263,7 +264,13 @@ public class PotentialCustomerServiceImpl implements PotentialCustomerService {
// 区经 忽略
// 区经 忽略
potentialCustomerNotifyBuilder
.
filterAreaManage
(
context
);
potentialCustomerNotifyBuilder
.
filterAreaManage
(
context
);
// 构建应用内消息
// 构建应用内消息
potentialCustomerNotifyBuilder
.
sendHaoBanNotifyMessage
(
context
);
/*消息中心修改此处*/
if
(!
ApolloUtils
.
useMessageCenter
()){
log
.
info
(
"消息中心-走老版消息通知"
);
/*消息中心修改此处*/
potentialCustomerNotifyBuilder
.
sendHaoBanNotifyMessage
(
context
);
}
// 如果该导购id是成员在主门店时的导购id 发送应用消息
// 如果该导购id是成员在主门店时的导购id 发送应用消息
// 如果本批数据中无成员主门店数据 则不发送
// 如果本批数据中无成员主门店数据 则不发送
potentialCustomerNotifyBuilder
.
sendApplicationMessage
(
context
);
potentialCustomerNotifyBuilder
.
sendApplicationMessage
(
context
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
View file @
e28e43a0
...
@@ -296,20 +296,16 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
...
@@ -296,20 +296,16 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
this
.
clerkMainStoreRelatedService
.
reflushExternal
(
wxEnterpriseId
,
staffId
);
this
.
clerkMainStoreRelatedService
.
reflushExternal
(
wxEnterpriseId
,
staffId
);
}
}
//有活码权限的企业
//有活码权限的企业
boolean
flag
=
rightService
.
hasRightForAdmin
(
enterpriseId
,
"hb_m0206"
);
HmQrcodeQDTO
hmQrcodeQDTO
=
new
HmQrcodeQDTO
();
if
(
flag
)
{
hmQrcodeQDTO
.
setHmType
(
1
);
// 绑定自动创建活码
hmQrcodeQDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
HmQrcodeQDTO
hmQrcodeQDTO
=
new
HmQrcodeQDTO
();
hmQrcodeQDTO
.
setEnterpriseId
(
enterpriseId
);
hmQrcodeQDTO
.
setHmType
(
1
);
hmQrcodeQDTO
.
setName
(
tabHaobanStaff
.
getStaffName
());
hmQrcodeQDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
hmQrcodeQDTO
.
setPassFlag
(
1
);
hmQrcodeQDTO
.
setEnterpriseId
(
enterpriseId
);
hmQrcodeQDTO
.
setStoreId
(
dto
.
getStoreId
());
hmQrcodeQDTO
.
setName
(
tabHaobanStaff
.
getStaffName
());
hmQrcodeQDTO
.
setClerkIdList
(
Collections
.
singletonList
(
dto
.
getClerkId
()));
hmQrcodeQDTO
.
setPassFlag
(
1
);
hmQrcodeQDTO
.
setInvokingType
(
channelCode
);
hmQrcodeQDTO
.
setStoreId
(
dto
.
getStoreId
());
hmQrcodeApiService
.
add
(
hmQrcodeQDTO
);
hmQrcodeQDTO
.
setClerkIdList
(
Collections
.
singletonList
(
dto
.
getClerkId
()));
hmQrcodeQDTO
.
setInvokingType
(
channelCode
);
hmQrcodeApiService
.
add
(
hmQrcodeQDTO
);
}
}
}
//推入日志
//推入日志
staffClerkBindLogService
.
pushToMq
(
staffId
,
optStaffId
,
BindTypeEnum
.
BIND
.
getVal
(),
channelCode
,
staffClerkRelationId
);
staffClerkBindLogService
.
pushToMq
(
staffId
,
optStaffId
,
BindTypeEnum
.
BIND
.
getVal
(),
channelCode
,
staffClerkRelationId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/message/NoticeMessageHandler.java
0 → 100644
View file @
e28e43a0
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
message
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.haoban.manage.service.service.notify.out.NoticeMessageApiServiceImpl
;
import
com.gic.message.center.api.subscribe.model.NoticeMessageForm
;
import
com.gic.mq.sdk.GicMQClient
;
import
org.slf4j.Logger
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
/**
* @description: 企业微信通知消息发送处理类
* @author: 巴弗
* @createDate: 2023/4/21 14:03
*/
@Service
public
class
NoticeMessageHandler
{
private
static
final
Logger
logger
=
getLogger
(
NoticeMessageHandler
.
class
);
/**
* 发送小程序消息
*/
public
void
sendMessage
(
NoticeMessageForm
noticeMessageForm
){
logger
.
info
(
"消息中心发送消息实体:{}"
,
JSONObject
.
toJSONString
(
noticeMessageForm
));
if
(
ObjectUtil
.
isEmpty
(
noticeMessageForm
.
getMessageCode
())
||
ObjectUtil
.
isEmpty
(
noticeMessageForm
.
getMqRouterCode
()))
{
logger
.
info
(
"消息中心发送消息实体 messageCode 或 mqRouterCode 不存在"
);
}
GicMQClient
client
=
GICMQClientUtil
.
getClientInstance
();
try
{
client
.
sendMessage
(
noticeMessageForm
.
getMqRouterCode
(),
JSONObject
.
toJSONString
(
noticeMessageForm
));
}
catch
(
Exception
e
)
{
logger
.
error
(
"消息中心发送消息实体发送异常 "
,
e
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/notify/out/NoticeMessageApiServiceImpl.java
View file @
e28e43a0
...
@@ -9,18 +9,25 @@ import java.util.*;
...
@@ -9,18 +9,25 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.clerk.api.dto.ClerkListDTO
;
import
com.gic.clerk.api.dto.ClerkListDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.notify.dto.NotifyMessageMQDTO
;
import
com.gic.haoban.manage.api.dto.notify.dto.NotifyMessageMQDTO
;
import
com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO
;
import
com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.util.notify.NoticeMessageUtil
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.service.WxEnterpriseRelatedService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseRelatedService
;
import
com.gic.haoban.manage.service.service.message.NoticeMessageHandler
;
import
com.gic.haoban.manage.service.util.ApolloUtils
;
import
com.gic.message.center.api.subscribe.model.NoticeMessageForm
;
import
com.gic.wechat.api.dto.qywx.QywxTemplateCardSendMessageDTO
;
import
com.gic.wechat.api.dto.qywx.QywxTemplateCardSendMessageDTO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.collections.MapUtils
;
...
@@ -92,8 +99,12 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
...
@@ -92,8 +99,12 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
@Autowired
@Autowired
private
ClerkService
clerkService
;
private
ClerkService
clerkService
;
@Override
@Autowired
public
void
noticeMessageMq
(
String
json
)
{
private
NoticeMessageHandler
noticeMessageHandler
;
/*消息中心修改此处
@Override*/
public
void
noticeMessageMq_old
(
String
json
)
{
logger
.
info
(
"通知消息:{}"
,
json
);
logger
.
info
(
"通知消息:{}"
,
json
);
NoticeMessageQDTO
messageQDTO
=
JSONObject
.
parseObject
(
json
,
NoticeMessageQDTO
.
class
);
NoticeMessageQDTO
messageQDTO
=
JSONObject
.
parseObject
(
json
,
NoticeMessageQDTO
.
class
);
NoticeMessageTypeEnum
messageTypeEnum
=
NoticeMessageTypeEnum
.
getByType
(
messageQDTO
.
getMessageType
());
NoticeMessageTypeEnum
messageTypeEnum
=
NoticeMessageTypeEnum
.
getByType
(
messageQDTO
.
getMessageType
());
...
@@ -147,6 +158,68 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
...
@@ -147,6 +158,68 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
}
}
@Override
@Override
public
void
noticeMessageMq
(
String
json
)
{
if
(!
ApolloUtils
.
useMessageCenter
()){
logger
.
info
(
"消息中心-走老版消息通知"
);
this
.
noticeMessageMq_old
(
json
);
return
;
}
NoticeMessageQDTO
messageQDTO
=
JSONObject
.
parseObject
(
json
,
NoticeMessageQDTO
.
class
);
logger
.
info
(
"messageType:{},消息中心测试通知消息:{}"
,
messageQDTO
.
getMessageType
(),
json
);
String
staffId
=
null
;
StaffClerkRelationDTO
clerkRelationDTO
=
null
;
if
(
StringUtils
.
isNotBlank
(
messageQDTO
.
getStaffId
()))
{
TabHaobanStaff
haobanStaff
=
staffService
.
selectById
(
messageQDTO
.
getStaffId
());
staffId
=
haobanStaff
!=
null
?
haobanStaff
.
getStaffId
()
:
null
;
}
if
(
StringUtils
.
isNotEmpty
(
messageQDTO
.
getClerkId
()))
{
clerkRelationDTO
=
staffClerkRelationService
.
getByClerkId
(
messageQDTO
.
getClerkId
());
}
if
(
staffId
==
null
&&
clerkRelationDTO
==
null
)
{
logger
.
info
(
"没有导购:{}"
,
messageQDTO
.
getClerkId
());
return
;
}
try
{
Map
<
String
,
String
>
variableMap
=
ObjectUtil
.
isNotNull
(
messageQDTO
.
getContentMap
())
?
messageQDTO
.
getContentMap
()
:
new
HashMap
<>();
if
(
ObjectUtil
.
isNotEmpty
(
messageQDTO
.
getExtendContent
()))
{
variableMap
.
put
(
"pageParams"
,
JSONObject
.
toJSONString
(
messageQDTO
.
getExtendContent
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
messageQDTO
.
getTitle
()))
{
variableMap
.
put
(
"templateTitle"
,
messageQDTO
.
getTitle
());
}
NoticeMessageTypeEnum
noticeMessageTypeEnum
=
NoticeMessageTypeEnum
.
getByType
(
messageQDTO
.
getMessageType
());
if
(
ObjectUtil
.
isNull
(
noticeMessageTypeEnum
))
{
return
;
}
NoticeMessageForm
build
=
NoticeMessageForm
.
builder
()
.
messageCode
(
noticeMessageTypeEnum
.
getMessageCode
())
.
mqRouterCode
(
noticeMessageTypeEnum
.
getRouterCode
())
.
businessId
(
messageQDTO
.
getOptTargetId
())
.
createTime
(
new
Date
())
.
enterpriseId
(
messageQDTO
.
getEnterpriseId
())
.
uniqueKey
(
UniqueIdUtils
.
uniqueLongHex
())
.
variableMap
(
variableMap
).
build
();
if
(
clerkRelationDTO
!=
null
){
build
.
setUserIdList
(
Collections
.
singletonList
(
clerkRelationDTO
.
getClerkId
()));
}
else
{
build
.
setStaffIdList
(
Collections
.
singletonList
(
staffId
));
}
noticeMessageHandler
.
sendMessage
(
build
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送消息通知失败"
,
e
);
}
}
@Override
public
void
run
(
String
json
)
{
public
void
run
(
String
json
)
{
this
.
noticeMessageMq
(
json
);
this
.
noticeMessageMq
(
json
);
}
}
...
@@ -154,11 +227,17 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
...
@@ -154,11 +227,17 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
@Override
@Override
public
void
noticeMessageBatchMq
(
String
json
)
{
public
void
noticeMessageBatchMq
(
String
json
)
{
NotifyMessageBatchQDTO
notifyMessageBatchQDTO
=
JSONObject
.
parseObject
(
json
,
NotifyMessageBatchQDTO
.
class
);
NotifyMessageBatchQDTO
notifyMessageBatchQDTO
=
JSONObject
.
parseObject
(
json
,
NotifyMessageBatchQDTO
.
class
);
if
(!
ApolloUtils
.
useMessageCenter
()){
logger
.
info
(
"消息中心-走老版消息通知"
);
this
.
batchSendMessage_old
(
notifyMessageBatchQDTO
);
return
;
}
batchSendMessage
(
notifyMessageBatchQDTO
);
batchSendMessage
(
notifyMessageBatchQDTO
);
}
}
@Override
/*消息中心修改此处
public
ServiceResponse
<
Void
>
batchSendMessage
(
NotifyMessageBatchQDTO
notifyMessageBatchQDTO
)
{
@Override*/
public
ServiceResponse
<
Void
>
batchSendMessage_old
(
NotifyMessageBatchQDTO
notifyMessageBatchQDTO
)
{
String
enterpriseId
=
notifyMessageBatchQDTO
.
getEnterpriseId
();
String
enterpriseId
=
notifyMessageBatchQDTO
.
getEnterpriseId
();
List
<
String
>
storeIdList
=
notifyMessageBatchQDTO
.
getStoreIdList
();
List
<
String
>
storeIdList
=
notifyMessageBatchQDTO
.
getStoreIdList
();
if
(
CollectionUtils
.
isEmpty
(
storeIdList
))
{
if
(
CollectionUtils
.
isEmpty
(
storeIdList
))
{
...
@@ -209,7 +288,76 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
...
@@ -209,7 +288,76 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
();
}
}
@Override
public
ServiceResponse
<
Void
>
batchSendMessage
(
NotifyMessageBatchQDTO
notifyMessageBatchQDTO
)
{
logger
.
info
(
"消息中心测试通知消息:{}"
,
JSONObject
.
toJSONString
(
notifyMessageBatchQDTO
));
String
enterpriseId
=
notifyMessageBatchQDTO
.
getEnterpriseId
();
List
<
String
>
storeIdList
=
notifyMessageBatchQDTO
.
getStoreIdList
();
if
(
CollectionUtils
.
isEmpty
(
storeIdList
))
{
logger
.
info
(
"门店列表为空"
);
return
ServiceResponse
.
success
();
}
int
count
=
wxEnterpriseRelatedService
.
getRelationCount
(
enterpriseId
);
if
(
count
==
0
)
{
logger
.
info
(
"商户未关联好办或都已停用enterpriseId={}"
,
enterpriseId
);
return
ServiceResponse
.
success
();
}
List
<
String
>
clerkIdList
=
clerkService
.
getclerkListByStoreIds
(
storeIdList
);
if
(
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
logger
.
info
(
"门店导购列表为空"
);
return
ServiceResponse
.
success
();
}
List
<
StaffClerkRelationDTO
>
relationList
=
staffClerkRelationService
.
listByClerkIds
(
clerkIdList
);
if
(
CollectionUtils
.
isEmpty
(
relationList
))
{
logger
.
info
(
"成员关联列表为空"
);
return
ServiceResponse
.
success
();
}
try
{
//TODO 这里有个回调未处理
Map
<
String
,
String
>
variableMap
=
notifyMessageBatchQDTO
.
getContentMap
();
variableMap
.
put
(
"pageParams"
,
JSONObject
.
toJSONString
(
notifyMessageBatchQDTO
.
getExtendContent
()));
variableMap
.
put
(
"extendContent"
,
JSONObject
.
toJSONString
(
notifyMessageBatchQDTO
.
getExtendContent
()));
variableMap
.
put
(
"templateTitle"
,
notifyMessageBatchQDTO
.
getTitle
());
NoticeMessageTypeEnum
noticeMessageTypeEnum
=
NoticeMessageTypeEnum
.
getByType
(
notifyMessageBatchQDTO
.
getMessageType
());
if
(
ObjectUtil
.
isNull
(
noticeMessageTypeEnum
))
{
return
ServiceResponse
.
failure
(
"-1"
,
"模版枚举不存在"
);
}
noticeMessageHandler
.
sendMessage
(
NoticeMessageForm
.
builder
()
.
messageCode
(
noticeMessageTypeEnum
.
getMessageCode
())
.
mqRouterCode
(
noticeMessageTypeEnum
.
getRouterCode
())
.
businessId
(
notifyMessageBatchQDTO
.
getOptTargetId
())
.
createTime
(
new
Date
())
.
enterpriseId
(
notifyMessageBatchQDTO
.
getEnterpriseId
())
.
uniqueKey
(
UniqueIdUtils
.
uniqueLongHex
())
.
userIdList
(
relationList
.
stream
().
map
(
StaffClerkRelationDTO:
:
getClerkId
).
distinct
().
collect
(
Collectors
.
toList
()))
.
variableMap
(
variableMap
).
build
());
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送消息通知失败"
,
e
);
}
return
ServiceResponse
.
success
();
}
private
String
getUrlParams
(
Map
<
String
,
Object
>
extendContent
)
{
String
data
=
extendContent
!=
null
?
JSONObject
.
toJSONString
(
extendContent
)
:
null
;
if
(
StringUtils
.
isNotBlank
(
data
))
{
try
{
data
=
URLEncoder
.
encode
(
data
,
StandardCharsets
.
UTF_8
.
name
());
}
catch
(
UnsupportedEncodingException
e
)
{
logger
.
error
(
e
.
getMessage
());
}
}
return
data
;
}
private
void
sendMessage
(
NotifyMessageBatchQDTO
notifyMessageBatchQDTO
,
List
<
StaffClerkRelationDTO
>
list
,
Set
<
String
>
userIdSet
,
WxEnterpriseQwDTO
qwDTO
)
{
private
void
sendMessage
(
NotifyMessageBatchQDTO
notifyMessageBatchQDTO
,
List
<
StaffClerkRelationDTO
>
list
,
Set
<
String
>
userIdSet
,
WxEnterpriseQwDTO
qwDTO
)
{
//企业微信模板
//企业微信模板
List
<
TemplateContentBO
>
contentList
=
getDescriotion
(
notifyMessageBatchQDTO
);
List
<
TemplateContentBO
>
contentList
=
getDescriotion
(
notifyMessageBatchQDTO
);
//好办模板
//好办模板
...
@@ -324,6 +472,13 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
...
@@ -324,6 +472,13 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
return
ServiceResponse
.
success
(
true
);
return
ServiceResponse
.
success
(
true
);
}
}
@Override
public
ServiceResponse
<
Boolean
>
addOrCreateNoticeMessage
(
List
<
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
qdto
.
NoticeMessageQDTO
>
qdto
)
{
noticeMessageService
.
addNoticeMessageBatch
(
EntityUtil
.
changeEntityListByJSON
(
NoticeMessageBO
.
class
,
qdto
));
return
ServiceResponse
.
success
();
}
/**
/**
* 获取详情
* 获取详情
*
*
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
e28e43a0
...
@@ -574,6 +574,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -574,6 +574,7 @@ public class MessageApiServiceImpl implements MessageApiService {
}
}
@Override
@Override
@Deprecated
public
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
Void
>
sendPreMessage
(
String
enterpriseId
,
String
storeId
,
public
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
Void
>
sendPreMessage
(
String
enterpriseId
,
String
storeId
,
String
message
)
{
String
message
)
{
log
.
info
(
"线下预约通知,storeId={}"
,
storeId
);
log
.
info
(
"线下预约通知,storeId={}"
,
storeId
);
...
@@ -680,7 +681,11 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -680,7 +681,11 @@ public class MessageApiServiceImpl implements MessageApiService {
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
valueList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
valueList
))
{
for
(
int
i
=
0
;
i
<
valueList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
valueList
.
size
();
i
++)
{
map
.
put
(
""
+
(
i
+
1
),
valueList
.
get
(
i
));
String
key
=
""
+
(
i
+
1
);
map
.
put
(
key
,
valueList
.
get
(
i
));
if
(
key
.
equals
(
"1"
))
{
map
.
put
(
"goodsName"
,
valueList
.
get
(
i
));
}
}
}
}
}
MemberDataDTO
member
=
this
.
findMember
(
enterpriseId
,
memberId
);
MemberDataDTO
member
=
this
.
findMember
(
enterpriseId
,
memberId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffDepartmentRelatedApiServiceImpl.java
View file @
e28e43a0
...
@@ -213,7 +213,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
...
@@ -213,7 +213,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
,
NoticeMessageTypeEnum
.
CLERK_DEL_AGREE
.
getType
(),
null
,
params
,
jsonObject
);
,
NoticeMessageTypeEnum
.
CLERK_DEL_AGREE
.
getType
(),
null
,
params
,
jsonObject
);
}
else
{
}
else
{
NoticeMessageUtil
.
sendNoticeMessage
(
tab
.
getEnterpriseId
(),
tab
.
getClerkId
()
NoticeMessageUtil
.
sendNoticeMessage
(
tab
.
getEnterpriseId
(),
tab
.
getClerkId
()
,
NoticeMessageTypeEnum
.
CLERK_DEL_
AGRE
E
.
getType
(),
null
,
params
,
jsonObject
);
,
NoticeMessageTypeEnum
.
CLERK_DEL_
REFUS
E
.
getType
(),
null
,
params
,
jsonObject
);
}
}
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/fee/HaobanQywxFeeApiServiceImpl.java
View file @
e28e43a0
...
@@ -25,7 +25,6 @@ import com.gic.haoban.common.utils.PageUtil;
...
@@ -25,7 +25,6 @@ import com.gic.haoban.common.utils.PageUtil;
import
com.gic.haoban.manage.api.constants.Manage3Constants
;
import
com.gic.haoban.manage.api.constants.Manage3Constants
;
import
com.gic.haoban.manage.api.dto.AlertMessageDTO
;
import
com.gic.haoban.manage.api.dto.AlertMessageDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeAccountInterceptLogDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeAccountInterceptLogDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDetailDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDetailDTO
;
...
@@ -90,11 +89,19 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
...
@@ -90,11 +89,19 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
@Override
@Override
public
void
run
(
String
param
)
{
public
void
run
(
String
param
)
{
List
<
TabHaobanWxEnterprise
>
tabHaobanWxEnterprises
=
wxEnterpriseService
.
listAll
();
GicMQClient
instance
=
GICMQClientUtil
.
getClientInstance
();
for
(
TabHaobanWxEnterprise
wxEnterprise
:
tabHaobanWxEnterprises
)
{
if
(
"-1"
.
equals
(
param
))
{
GicMQClient
instance
=
GICMQClientUtil
.
getClientInstance
();
List
<
TabHaobanWxEnterprise
>
tabHaobanWxEnterprises
=
wxEnterpriseService
.
listAll
();
for
(
TabHaobanWxEnterprise
wxEnterprise
:
tabHaobanWxEnterprises
)
{
try
{
instance
.
sendMessage
(
"qywxAddFeeMq"
,
wxEnterprise
.
getWxEnterpriseId
());
}
catch
(
Exception
e
)
{
logger
.
info
(
"发送消息处理异常:{}"
,
e
.
getMessage
(),
e
);
}
}
}
else
{
try
{
try
{
instance
.
sendMessage
(
"qywxAddFeeMq"
,
wxEnterprise
.
getWxEnterpriseId
()
);
instance
.
sendMessage
(
"qywxAddFeeMq"
,
param
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
"发送消息处理异常:{}"
,
e
.
getMessage
(),
e
);
logger
.
info
(
"发送消息处理异常:{}"
,
e
.
getMessage
(),
e
);
}
}
...
@@ -162,8 +169,8 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
...
@@ -162,8 +169,8 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
}
}
String
serviceCorpid
=
config
.
getCorpid
();
String
serviceCorpid
=
config
.
getCorpid
();
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
.
getWxSecurityType
()
<=
0
)
{
if
(
wxEnterpriseDTO
.
getWxSecurityType
()
<=
0
||
wxEnterpriseDTO
.
getWxSecurityType
()
==
5
)
{
logger
.
info
(
"WxSecurityType=0,wxEnterpriseId={}"
,
wxEnterpriseId
);
logger
.
info
(
"WxSecurityType=0
/5
,wxEnterpriseId={}"
,
wxEnterpriseId
);
return
;
return
;
}
}
String
corpid
=
wxEnterpriseDTO
.
getOpenCorpid
();
String
corpid
=
wxEnterpriseDTO
.
getOpenCorpid
();
...
@@ -227,11 +234,7 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
...
@@ -227,11 +234,7 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
// 成员的激活码信息
// 成员的激活码信息
this
.
staffService
.
activedAccountTimer
(
wxEnterpriseId
);
this
.
staffService
.
activedAccountTimer
(
wxEnterpriseId
);
// 更新企业的激活数量统计
this
.
wxEnterpriseActiveDataService
.
saveOrUpdate
(
wxEnterpriseId
);
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
if
(!
qwDTO
.
isSelf
())
{
this
.
wxEnterpriseActiveDataService
.
saveOrUpdate
(
wxEnterpriseId
);
}
// 统计 haobanQywxFeeDetailDTO 30天内最新过期的时间和人数
// 统计 haobanQywxFeeDetailDTO 30天内最新过期的时间和人数
HaobanQywxFeeDetailDTO
haobanQywxFeeDetailDTO
=
haobanQywxFeeAccountStaffService
.
feeIntercept
(
wxEnterpriseId
);
HaobanQywxFeeDetailDTO
haobanQywxFeeDetailDTO
=
haobanQywxFeeAccountStaffService
.
feeIntercept
(
wxEnterpriseId
);
...
@@ -254,8 +257,9 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
...
@@ -254,8 +257,9 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
tabHaobanQywxFee
.
setInterceptFlag
(
0
);
tabHaobanQywxFee
.
setInterceptFlag
(
0
);
haobanQywxFeeService
.
insert
(
tabHaobanQywxFee
);
haobanQywxFeeService
.
insert
(
tabHaobanQywxFee
);
// 判断今天是否是本月最后一天
// 判断今天是否是本月最后一天
if
(
DateUtil
.
isSameDay
(
DateUtil
.
endOfMonth
(
new
Date
()),
new
Date
())
||
"ca66a01b79474c40b3e7c7f93daf1a3b"
.
equals
(
wxEnterpriseId
))
{
if
(
DateUtil
.
isSameDay
(
DateUtil
.
endOfMonth
(
new
Date
()),
new
Date
())
int
monthWillInterceptNum
=
haobanQywxFeeDetailDTO
.
getInterceptUserNum
()
;
||
"ca66a01b79474c40b3e7c7f93daf1a3b"
.
equals
(
wxEnterpriseId
))
{
int
monthWillInterceptNum
=
haobanQywxFeeDetailDTO
.
getInterceptUserNum
();
String
content
=
"30天将有"
+
monthWillInterceptNum
+
"个接口许可证即将过期,您总共还剩余"
+
permissionUserNum
String
content
=
"30天将有"
+
monthWillInterceptNum
+
"个接口许可证即将过期,您总共还剩余"
+
permissionUserNum
+
"个可用的接口许可证,请保证数量充足,如需增加请及时联系相关人员续费,避免影响使用"
;
+
"个可用的接口许可证,请保证数量充足,如需增加请及时联系相关人员续费,避免影响使用"
;
messageAlert
(
wxEnterpriseId
,
corpName
,
corpid
,
AlertTypeEnum
.
FEE_ALARM
.
getName
(),
content
);
messageAlert
(
wxEnterpriseId
,
corpName
,
corpid
,
AlertTypeEnum
.
FEE_ALARM
.
getName
(),
content
);
...
@@ -300,13 +304,13 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
...
@@ -300,13 +304,13 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
TabHaobanQywxFeeOrderAccount
activeAccount
=
new
TabHaobanQywxFeeOrderAccount
();
TabHaobanQywxFeeOrderAccount
activeAccount
=
new
TabHaobanQywxFeeOrderAccount
();
// 查询激活码的详情
// 查询激活码的详情
List
<
ActiveInfoCodeResponseDTO
>
respList
=
qywxUserApiService
.
getActiveInfoByCodeList
(
corpid
,
serviceCorpid
,
List
<
List
<
String
>>
list
=
Lists
.
partition
(
codeList
,
1000
);
codeList
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
CollectionUtils
.
isNotEmpty
(
respList
))
{
List
<
String
>
subCodeList
=
list
.
get
(
i
);
List
<
List
<
ActiveInfoCodeResponseDTO
>>
list
=
Lists
.
partition
(
respList
,
800
);
List
<
ActiveInfoCodeResponseDTO
>
respList
=
qywxUserApiService
.
getActiveInfoByCodeList
(
corpid
,
serviceCorpid
,
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
subCodeList
);
List
<
ActiveInfoCodeResponseDTO
>
subList
=
list
.
get
(
i
);
if
(
CollectionUtils
.
isNotEmpty
(
respList
))
{
for
(
ActiveInfoCodeResponseDTO
activeDetail
:
sub
List
)
{
for
(
ActiveInfoCodeResponseDTO
activeDetail
:
resp
List
)
{
String
userid
=
activeDetail
.
getUserid
();
String
userid
=
activeDetail
.
getUserid
();
String
activeCode
=
activeDetail
.
getActiveCode
();
String
activeCode
=
activeDetail
.
getActiveCode
();
activeAccount
.
setWxUserId
(
userid
);
activeAccount
.
setWxUserId
(
userid
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
e28e43a0
...
@@ -787,11 +787,6 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
...
@@ -787,11 +787,6 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
String
enterpriseId
=
wxEnterpriseDTO
.
getEnterpriseId
();
String
enterpriseId
=
wxEnterpriseDTO
.
getEnterpriseId
();
//查询出所有正常的导购
//查询出所有正常的导购
String
wxEnterpriseId
=
wxEnterpriseDTO
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
wxEnterpriseDTO
.
getWxEnterpriseId
();
boolean
flag
=
rightService
.
hasRightForAdmin
(
enterpriseId
,
"hb_m0206"
);
if
(!
flag
)
{
logger
.
info
(
"该企业未与gic关联,无需开启:enterpriseId:{},wxEnterpriseId:{}"
,
enterpriseId
,
wxEnterpriseId
);
continue
;
}
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"wxEnterpriseId"
,
wxEnterpriseId
);
jsonObject
.
put
(
"wxEnterpriseId"
,
wxEnterpriseId
);
jsonObject
.
put
(
"enterpriseId"
,
enterpriseId
);
jsonObject
.
put
(
"enterpriseId"
,
enterpriseId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/ApolloUtils.java
0 → 100644
View file @
e28e43a0
package
com
.
gic
.
haoban
.
manage
.
service
.
util
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigService
;
public
class
ApolloUtils
{
/**
* 旧的调用发送,是否采用新的消息中心开关1:是 0:否
* @return
*/
public
static
boolean
useMessageCenter
()
{
Config
config
=
ConfigService
.
getConfig
(
"COMMON.gic-properties"
);
String
messageCenterSwitch
=
config
.
getProperty
(
"messageCenterSwitch"
,
"0"
);
return
"1"
.
equals
(
messageCenterSwitch
);
}
}
haoban-manage3-service/src/main/resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
View file @
e28e43a0
<?xml version="1.0" encoding="UTF-8" ?>
<?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" >
<!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.TabHaobanExternalClerkRelatedMapper"
>
<mapper
namespace=
"com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
<id
column=
"external_clerk_related_id"
property=
"externalClerkRelatedId"
jdbcType=
"VARCHAR"
/>
<id
column=
"external_clerk_related_id"
property=
"externalClerkRelatedId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"store_id"
property=
"storeId"
jdbcType=
"VARCHAR"
/>
<result
column=
"store_id"
property=
"storeId"
jdbcType=
"VARCHAR"
/>
<result
column=
"member_id"
property=
"memberId"
jdbcType=
"VARCHAR"
/>
<result
column=
"member_id"
property=
"memberId"
jdbcType=
"VARCHAR"
/>
<result
column=
"unionid"
property=
"unionid"
jdbcType=
"VARCHAR"
/>
<result
column=
"unionid"
property=
"unionid"
jdbcType=
"VARCHAR"
/>
<result
column=
"external_name"
property=
"externalName"
jdbcType=
"VARCHAR"
/>
<result
column=
"external_name"
property=
"externalName"
jdbcType=
"VARCHAR"
/>
<result
column=
"head_url"
property=
"headUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"head_url"
property=
"headUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"external_user_id"
property=
"externalUserId"
jdbcType=
"VARCHAR"
/>
<result
column=
"external_user_id"
property=
"externalUserId"
jdbcType=
"VARCHAR"
/>
<result
column=
"add_create_time"
property=
"addCreateTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"add_create_time"
property=
"addCreateTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"member_unionid_related_id"
property=
"memberUnionidRelatedId"
jdbcType=
"VARCHAR"
/>
<result
column=
"member_unionid_related_id"
property=
"memberUnionidRelatedId"
jdbcType=
"VARCHAR"
/>
<result
column=
"clerk_id"
property=
"clerkId"
jdbcType=
"VARCHAR"
/>
<result
column=
"clerk_id"
property=
"clerkId"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_id"
property=
"staffId"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_id"
property=
"staffId"
jdbcType=
"VARCHAR"
/>
<result
column=
"relation_key"
property=
"relationKey"
jdbcType=
"VARCHAR"
/>
<result
column=
"relation_key"
property=
"relationKey"
jdbcType=
"VARCHAR"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
external_clerk_related_id, wx_enterprise_id, enterprise_id, store_id, member_id,
external_clerk_related_id, wx_enterprise_id, enterprise_id, store_id, member_id,
unionid, head_url,external_name, add_create_time, member_unionid_related_id, clerk_id, staff_id,
unionid, head_url,external_name, add_create_time, member_unionid_related_id, clerk_id, staff_id,
relation_key, status_flag, create_time, update_time,external_user_id
relation_key, status_flag, create_time, update_time,external_user_id
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where external_clerk_related_id = #{externalClerkRelatedId,jdbcType=VARCHAR}
where external_clerk_related_id = #{externalClerkRelatedId,jdbcType=VARCHAR}
</select>
</select>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
insert into tab_haoban_external_clerk_related
insert into tab_haoban_external_clerk_related
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"externalClerkRelatedId != null"
>
<if
test=
"externalClerkRelatedId != null"
>
external_clerk_related_id,
external_clerk_related_id,
</if>
</if>
<if
test=
"wxEnterpriseId != null"
>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id,
wx_enterprise_id,
</if>
</if>
<if
test=
"enterpriseId != null"
>
<if
test=
"enterpriseId != null"
>
enterprise_id,
enterprise_id,
</if>
</if>
<if
test=
"storeId != null"
>
<if
test=
"storeId != null"
>
store_id,
store_id,
</if>
</if>
<if
test=
"memberId != null"
>
<if
test=
"memberId != null"
>
member_id,
member_id,
</if>
</if>
<if
test=
"unionid != null"
>
<if
test=
"unionid != null"
>
unionid,
unionid,
</if>
</if>
<if
test=
"headUrl != null"
>
<if
test=
"headUrl != null"
>
head_url,
head_url,
</if>
</if>
<if
test=
"externalName != null"
>
<if
test=
"externalName != null"
>
external_name,
external_name,
</if>
</if>
<if
test=
"externalUserId != null"
>
<if
test=
"externalUserId != null"
>
external_user_id,
external_user_id,
</if>
</if>
<if
test=
"addCreateTime != null"
>
<if
test=
"addCreateTime != null"
>
add_create_time,
add_create_time,
</if>
</if>
<if
test=
"memberUnionidRelatedId != null"
>
<if
test=
"memberUnionidRelatedId != null"
>
member_unionid_related_id,
member_unionid_related_id,
</if>
</if>
<if
test=
"clerkId != null"
>
<if
test=
"clerkId != null"
>
clerk_id,
clerk_id,
</if>
</if>
<if
test=
"staffId != null"
>
<if
test=
"staffId != null"
>
staff_id,
staff_id,
</if>
</if>
<if
test=
"pushTimes != null"
>
<if
test=
"pushTimes != null"
>
push_times,
push_times,
</if>
</if>
<if
test=
"relationKey != null"
>
<if
test=
"relationKey != null"
>
relation_key,
relation_key,
</if>
</if>
<if
test=
"statusFlag != null"
>
<if
test=
"statusFlag != null"
>
status_flag,
status_flag,
</if>
</if>
<if
test=
"createTime != null"
>
<if
test=
"createTime != null"
>
create_time,
create_time,
</if>
</if>
<if
test=
"updateTime != null"
>
<if
test=
"updateTime != null"
>
update_time,
update_time,
</if>
</if>
<if
test=
"selfExternalUserid != null"
>
<if
test=
"selfExternalUserid != null"
>
self_external_userid,
self_external_userid,
</if>
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"externalClerkRelatedId != null"
>
<if
test=
"externalClerkRelatedId != null"
>
#{externalClerkRelatedId,jdbcType=VARCHAR},
#{externalClerkRelatedId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"wxEnterpriseId != null"
>
<if
test=
"wxEnterpriseId != null"
>
#{wxEnterpriseId,jdbcType=VARCHAR},
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"enterpriseId != null"
>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=VARCHAR},
#{enterpriseId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"storeId != null"
>
<if
test=
"storeId != null"
>
#{storeId,jdbcType=VARCHAR},
#{storeId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"memberId != null"
>
<if
test=
"memberId != null"
>
#{memberId,jdbcType=VARCHAR},
#{memberId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"unionid != null"
>
<if
test=
"unionid != null"
>
#{unionid,jdbcType=VARCHAR},
#{unionid,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"headUrl != null"
>
<if
test=
"headUrl != null"
>
#{headUrl,jdbcType=VARCHAR},
#{headUrl,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"externalName != null"
>
<if
test=
"externalName != null"
>
#{externalName,jdbcType=VARCHAR},
#{externalName,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"externalUserId != null"
>
<if
test=
"externalUserId != null"
>
#{externalUserId,jdbcType=VARCHAR},
#{externalUserId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"addCreateTime != null"
>
<if
test=
"addCreateTime != null"
>
#{addCreateTime,jdbcType=VARCHAR},
#{addCreateTime,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"memberUnionidRelatedId != null"
>
<if
test=
"memberUnionidRelatedId != null"
>
#{memberUnionidRelatedId,jdbcType=VARCHAR},
#{memberUnionidRelatedId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"clerkId != null"
>
<if
test=
"clerkId != null"
>
#{clerkId,jdbcType=VARCHAR},
#{clerkId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"staffId != null"
>
<if
test=
"staffId != null"
>
#{staffId,jdbcType=VARCHAR},
#{staffId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"pushTimes != null"
>
<if
test=
"pushTimes != null"
>
#{pushTimes},
#{pushTimes},
</if>
</if>
<if
test=
"relationKey != null"
>
<if
test=
"relationKey != null"
>
#{relationKey,jdbcType=VARCHAR},
#{relationKey,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"statusFlag != null"
>
<if
test=
"statusFlag != null"
>
#{statusFlag,jdbcType=INTEGER},
#{statusFlag,jdbcType=INTEGER},
</if>
</if>
<if
test=
"createTime != null"
>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"updateTime != null"
>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"selfExternalUserid != null"
>
<if
test=
"selfExternalUserid != null"
>
#{selfExternalUserid},
#{selfExternalUserid},
</if>
</if>
</trim>
</trim>
</insert>
</insert>
<update
id=
"updateByPrimaryKeySelective"
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
update tab_haoban_external_clerk_related
update tab_haoban_external_clerk_related
<set>
<set>
<if
test=
"wxEnterpriseId != null"
>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"enterpriseId != null"
>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"storeId != null"
>
<if
test=
"storeId != null"
>
store_id = #{storeId,jdbcType=VARCHAR},
store_id = #{storeId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"memberId != null"
>
<if
test=
"memberId != null"
>
member_id = #{memberId,jdbcType=VARCHAR},
member_id = #{memberId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"unionid != null"
>
<if
test=
"unionid != null"
>
unionid = #{unionid,jdbcType=VARCHAR},
unionid = #{unionid,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"headUrl != null"
>
<if
test=
"headUrl != null"
>
head_url = #{headUrl,jdbcType=VARCHAR},
head_url = #{headUrl,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"externalName != null"
>
<if
test=
"externalName != null"
>
external_name = #{externalName,jdbcType=VARCHAR},
external_name = #{externalName,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"externalUserId != null"
>
<if
test=
"externalUserId != null"
>
external_user_id = #{externalUserId,jdbcType=VARCHAR},
external_user_id = #{externalUserId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"addCreateTime != null"
>
<if
test=
"addCreateTime != null"
>
add_create_time = #{addCreateTime,jdbcType=VARCHAR},
add_create_time = #{addCreateTime,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"memberUnionidRelatedId != null"
>
<if
test=
"memberUnionidRelatedId != null"
>
member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR},
member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"clerkId != null"
>
<if
test=
"clerkId != null"
>
clerk_id = #{clerkId,jdbcType=VARCHAR},
clerk_id = #{clerkId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"staffId != null"
>
<if
test=
"staffId != null"
>
staff_id = #{staffId,jdbcType=VARCHAR},
staff_id = #{staffId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"relationKey != null"
>
<if
test=
"relationKey != null"
>
relation_key = #{relationKey,jdbcType=VARCHAR},
relation_key = #{relationKey,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"statusFlag != null"
>
<if
test=
"statusFlag != null"
>
status_flag = #{statusFlag,jdbcType=INTEGER},
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
</if>
<if
test=
"updateTime != null"
>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</if>
</set>
</set>
where external_clerk_related_id = #{externalClerkRelatedId,jdbcType=VARCHAR}
where external_clerk_related_id = #{externalClerkRelatedId,jdbcType=VARCHAR}
</update>
</update>
<select
id=
"selectByClerkIdAndExternalUserId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByClerkIdAndExternalUserId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where clerk_id = #{clerkId,jdbcType=VARCHAR}
where clerk_id = #{clerkId,jdbcType=VARCHAR}
and external_user_id = #{externalUserId}
and external_user_id = #{externalUserId}
and status_flag = 1
and status_flag = 1
</select>
</select>
<update
id=
"delByUserIdAndExternalUserId"
>
<update
id=
"delByUserIdAndExternalUserId"
>
update tab_haoban_external_clerk_related
update tab_haoban_external_clerk_related
set status_flag = 2,
set status_flag = 2,
update_time = now()
update_time = now()
where external_user_id = #{externalUserId}
where external_user_id = #{externalUserId}
and staff_id = #{staffId}
and staff_id = #{staffId}
and status_flag in (1, 3, 4)
and status_flag in (1, 3, 4)
</update>
</update>
<update
id=
"delByUserIdAndExternalUserIdBatch"
<update
id=
"delByUserIdAndExternalUserIdBatch"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
update tab_haoban_external_clerk_related
update tab_haoban_external_clerk_related
set
set
status_flag = 2,
status_flag = 2,
update_time = now()
update_time = now()
where
where
wx_enterprise_id=#{wxEnterpriseId}
wx_enterprise_id=#{wxEnterpriseId}
and staff_id = #{staffId}
and staff_id = #{staffId}
and status_flag in(1,3,4)
and status_flag in(1,3,4)
and external_user_id in
and external_user_id in
<foreach
collection=
"externalUserIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"externalUserIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
#{item}
</foreach>
</foreach>
</update>
</update>
<update
id=
"delByClerkIdAndStaffId"
<update
id=
"delByClerkIdAndStaffId"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
update tab_haoban_external_clerk_related
update tab_haoban_external_clerk_related
set status_flag = 2,
set status_flag = 2,
update_time = now()
update_time = now()
where clerk_id = #{clerkId,jdbcType=VARCHAR}
where clerk_id = #{clerkId,jdbcType=VARCHAR}
and staff_id = #{staffId}
and staff_id = #{staffId}
and status_flag in (1, 3, 4)
and status_flag in (1, 3, 4)
</update>
</update>
<update
id=
"delByStoreIdAndStaffId"
<update
id=
"delByStoreIdAndStaffId"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
update tab_haoban_external_clerk_related
update tab_haoban_external_clerk_related
set status_flag = 2,
set status_flag = 2,
update_time = now()
update_time = now()
where store_id = #{storeId,jdbcType=VARCHAR}
where store_id = #{storeId,jdbcType=VARCHAR}
and staff_id = #{staffId}
and staff_id = #{staffId}
and status_flag in (1, 3, 4)
and status_flag in (1, 3, 4)
</update>
</update>
<update
id=
"delByStoreIds"
<update
id=
"delByStoreIds"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
update tab_haoban_external_clerk_related
update tab_haoban_external_clerk_related
set
set
status_flag = 2,
status_flag = 2,
update_time = now()
update_time = now()
where store_id IN
where store_id IN
<foreach
collection=
"storeIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
<foreach
collection=
"storeIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
#{item}
</foreach>
</foreach>
and status_flag in(1,3,4)
and status_flag in(1,3,4)
</update>
</update>
<update
id=
"cleanStaffRelated"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
<update
id=
"cleanStaffRelated"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated"
>
update tab_haoban_external_clerk_related
update tab_haoban_external_clerk_related
set
set
status_flag = 2,
status_flag = 2,
update_time = now()
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and staff_id IN
and staff_id IN
<foreach
collection=
"staffIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"staffIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
#{id,jdbcType=VARCHAR}
</foreach>
</foreach>
and status_flag = 1
and status_flag = 1
</update>
</update>
<select
id=
"listByExTernalUseridAndWxUserId"
resultMap=
"BaseResultMap"
>
<select
id=
"listByExTernalUseridAndWxUserId"
resultMap=
"BaseResultMap"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where staff_id = #{staffId,jdbcType=VARCHAR}
where staff_id = #{staffId,jdbcType=VARCHAR}
and external_user_id = #{externalUserid}
and external_user_id = #{externalUserid}
and status_flag = #{statusFlag}
and status_flag = #{statusFlag}
</select>
</select>
<select
id=
"listByExternalUseridAndWxEnterpriseId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"listByExternalUseridAndWxEnterpriseId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where external_user_id = #{externalUserid} and wx_enterprise_id = #{wxEnterpriseId}
where external_user_id = #{externalUserid} and wx_enterprise_id = #{wxEnterpriseId}
<if
test=
"statusFlags != null"
>
<if
test=
"statusFlags != null"
>
and status_flag IN
and status_flag IN
<foreach
collection=
"statusFlags"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"statusFlags"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
#{id,jdbcType=VARCHAR}
</foreach>
</foreach>
</if>
</if>
</select>
</select>
<select
id=
"listByExTernalUseridAndWxUserIdAllStatus"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"listByExTernalUseridAndWxUserIdAllStatus"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where staff_id = #{staffId,jdbcType=VARCHAR}
where staff_id = #{staffId,jdbcType=VARCHAR}
and external_user_id = #{externalUserid}
and external_user_id = #{externalUserid}
and wx_enterprise_id = #{wxEnterpriseId}
and wx_enterprise_id = #{wxEnterpriseId}
and status_flag in(1,3,4)
and status_flag in(1,3,4)
</select>
</select>
<select
id=
"listByEnterpriseIdAndDate"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"listByEnterpriseIdAndDate"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where status_flag = 1
where status_flag = 1
and enterprise_id = #{enterpriseId}
and enterprise_id = #{enterpriseId}
<if
test=
"date != null"
>
<if
test=
"date != null"
>
and TO_DAYS(create_time)
<![CDATA[ >= ]]>
TO_DAYS(#{date,jdbcType=TIMESTAMP})
and TO_DAYS(create_time)
<![CDATA[ >= ]]>
TO_DAYS(#{date,jdbcType=TIMESTAMP})
</if>
</if>
</select>
</select>
<select
id=
"pageMemberUnionByParams"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"pageMemberUnionByParams"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where enterprise_id = #{enterpriseId}
where enterprise_id = #{enterpriseId}
and status_flag = 1
and status_flag = 1
and member_id in
and member_id in
<foreach
item=
"memberId"
index=
"index"
collection=
"sendMemberIds"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"memberId"
index=
"index"
collection=
"sendMemberIds"
open=
"("
separator=
","
close=
")"
>
#{memberId, jdbcType=CHAR}
#{memberId, jdbcType=CHAR}
</foreach>
</foreach>
and staff_id in
and staff_id in
<foreach
item=
"staffId"
index=
"index"
collection=
"staffIdList"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"staffId"
index=
"index"
collection=
"staffIdList"
open=
"("
separator=
","
close=
")"
>
#{staffId, jdbcType=CHAR}
#{staffId, jdbcType=CHAR}
</foreach>
</foreach>
and member_id is not null
and member_id is not null
group by external_user_id
group by external_user_id
</select>
</select>
<select
id=
"listByWxEnterpriseIdAndWxUserId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"listByWxEnterpriseIdAndWxUserId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where staff_id = #{staffId,jdbcType=VARCHAR}
where staff_id = #{staffId,jdbcType=VARCHAR}
and wx_enterprise_id = #{wxEnterpriseId}
and wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
and status_flag = 1
</select>
</select>
<select
id=
"listByWxEnterpriseIdAndWxUserIds"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"listByWxEnterpriseIdAndWxUserIds"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where staff_id in
where staff_id in
<foreach
item=
"staffId"
index=
"index"
collection=
"staffIdList"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"staffId"
index=
"index"
collection=
"staffIdList"
open=
"("
separator=
","
close=
")"
>
#{staffId, jdbcType=CHAR}
#{staffId, jdbcType=CHAR}
</foreach>
</foreach>
and wx_enterprise_id = #{wxEnterpriseId}
and wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
and status_flag = 1
</select>
</select>
<select
id=
"getByMemberId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"getByMemberId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where staff_id = #{staffId}
where staff_id = #{staffId}
and member_id = #{memberId}
and member_id = #{memberId}
and status_flag = 1
and status_flag = 1
and external_user_id is not null
and external_user_id is not null
order by update_time desc
order by update_time desc
limit 1
limit 1
</select>
</select>
<select
id=
"listExternalByUnionId"
resultMap=
"BaseResultMap"
>
<select
id=
"listExternalByUnionId"
resultMap=
"BaseResultMap"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where enterprise_id = #{enterpriseId}
where enterprise_id = #{enterpriseId}
and unionid = #{unionId}
and unionid = #{unionId}
and status_flag = 1
and status_flag = 1
</select>
</select>
<select
id=
"getByRelationKey"
resultMap=
"BaseResultMap"
>
<select
id=
"getByRelationKey"
resultMap=
"BaseResultMap"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where
where
relation_key = #{relationKey}
relation_key = #{relationKey}
<if
test=
"filterMember==1"
>
<if
test=
"filterMember==1"
>
and member_id is null
and member_id is null
</if>
</if>
and status_flag != 2
and status_flag != 2
order by create_time desc limit 1
order by create_time desc limit 1
</select>
</select>
<select
id=
"listByWxEnterpriseIdAndWxUserIdAndStatus"
resultMap=
"BaseResultMap"
>
<select
id=
"listByWxEnterpriseIdAndWxUserIdAndStatus"
resultMap=
"BaseResultMap"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where staff_id = #{staffId,jdbcType=VARCHAR}
where staff_id = #{staffId,jdbcType=VARCHAR}
and wx_enterprise_id = #{wxEnterpriseId}
and wx_enterprise_id = #{wxEnterpriseId}
and status_flag in
and status_flag in
<foreach
collection=
"statusFlags"
item=
"item"
separator=
","
open=
"("
close=
")"
>
<foreach
collection=
"statusFlags"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
#{item}
</foreach>
</foreach>
</select>
</select>
<update
id=
"pushExternalByRelationKey"
>
<update
id=
"pushExternalByRelationKey"
>
update tab_haoban_external_clerk_related
update tab_haoban_external_clerk_related
set status_flag = 4,
set status_flag = 4,
push_times =push_times + 1,
push_times =push_times + 1,
update_time = now()
update_time = now()
where relation_key = #{relationKey,jdbcType=VARCHAR}
where relation_key = #{relationKey,jdbcType=VARCHAR}
and status_flag in (3, 4)
and status_flag in (3, 4)
</update>
</update>
<select
id=
"getExternalClerkByWxUserIdAncExternalUserId"
resultMap=
"BaseResultMap"
>
<select
id=
"getExternalClerkByWxUserIdAncExternalUserId"
resultMap=
"BaseResultMap"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where staff_id = #{staffId,jdbcType=VARCHAR}
where staff_id = #{staffId,jdbcType=VARCHAR}
and wx_enterprise_id = #{wxEnterpriseId}
and wx_enterprise_id = #{wxEnterpriseId}
and enterprise_id = #{enterpriseId}
and enterprise_id = #{enterpriseId}
and external_user_id = #{externalUserId}
and external_user_id = #{externalUserId}
and status_flag in(1,3,4)
and status_flag in(1,3,4)
order by update_time desc limit 1
order by update_time desc limit 1
</select>
</select>
<select
id=
"listByMemberIdAndWxEnterpriseId"
resultMap=
"BaseResultMap"
>
<select
id=
"listByMemberIdAndWxEnterpriseId"
resultMap=
"BaseResultMap"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where wx_enterprise_id = #{wxEnterpriseId}
where wx_enterprise_id = #{wxEnterpriseId}
and enterprise_id = #{enterpriseId}
and enterprise_id = #{enterpriseId}
and member_id = #{memberId}
and member_id = #{memberId}
and status_flag = 1
and status_flag = 1
</select>
</select>
<select
id=
"listByMemberIdList"
resultType=
"com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO"
>
<select
id=
"listByMemberIdList"
resultType=
"com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO"
>
select
select
member_id memberId , external_user_id externalUserId
member_id memberId , external_user_id externalUserId
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where member_id in
where member_id in
<foreach
collection=
"memberIdList"
open=
"("
close=
")"
separator=
","
item=
"item"
>
<foreach
collection=
"memberIdList"
open=
"("
close=
")"
separator=
","
item=
"item"
>
#{item}
#{item}
</foreach>
</foreach>
and wx_enterprise_id = #{wxEnterpriseId}
and wx_enterprise_id = #{wxEnterpriseId}
and enterprise_id = #{enterpriseId}
and enterprise_id = #{enterpriseId}
and status_flag = 1 and external_status = 1 group by member_id
and status_flag = 1 and external_status = 1
</select>
and external_user_id is not null
group by member_id
<select
id=
"getLastByExTernalUseridAndWxUserIdNoStatus"
resultMap=
"BaseResultMap"
>
</select>
select
<include
refid=
"Base_Column_List"
/>
<select
id=
"getLastByExTernalUseridAndWxUserIdNoStatus"
resultMap=
"BaseResultMap"
>
from tab_haoban_external_clerk_related
select
where wx_enterprise_id = #{wxEnterpriseId}
<include
refid=
"Base_Column_List"
/>
and staff_id = #{staffId}
from tab_haoban_external_clerk_related
and external_user_id = #{externalUserid}
where wx_enterprise_id = #{wxEnterpriseId}
order by create_time desc limit 1
and staff_id = #{staffId}
</select>
and external_user_id = #{externalUserid}
<select
id=
"listByIds"
resultMap=
"BaseResultMap"
>
order by create_time desc limit 1
select
</select>
<include
refid=
"Base_Column_List"
/>
<select
id=
"listByIds"
resultMap=
"BaseResultMap"
>
from tab_haoban_external_clerk_related
select
where wx_enterprise_id = #{wxEnterpriseId}
<include
refid=
"Base_Column_List"
/>
and external_clerk_related_id in
from tab_haoban_external_clerk_related
<foreach
collection=
"ids"
open=
"("
close=
")"
separator=
","
item=
"item"
>
where wx_enterprise_id = #{wxEnterpriseId}
#{item}
and external_clerk_related_id in
</foreach>
<foreach
collection=
"ids"
open=
"("
close=
")"
separator=
","
item=
"item"
>
</select>
#{item}
<select
id=
"listMemberIdByEnterpriseId"
resultType=
"String"
>
</foreach>
select member_id
</select>
from tab_haoban_external_clerk_related
<select
id=
"listMemberIdByEnterpriseId"
resultType=
"String"
>
where wx_enterprise_id = #{wxEnterpriseId}
select member_id
and enterprise_id = #{enterpriseId}
from tab_haoban_external_clerk_related
and status_flag in (1, 3, 4)
where wx_enterprise_id = #{wxEnterpriseId}
order by create_time
and enterprise_id = #{enterpriseId}
</select>
and status_flag in (1, 3, 4)
order by create_time
<select
id=
"listMemberIdsByMemberIds"
resultType=
"String"
>
</select>
select
member_id
<select
id=
"listMemberIdsByMemberIds"
resultType=
"String"
>
from tab_haoban_external_clerk_related
select
where wx_enterprise_id = #{wxEnterpriseId}
member_id
and member_id in
from tab_haoban_external_clerk_related
<foreach
collection=
"memberIds"
open=
"("
separator=
","
close=
")"
item=
"item"
>
where wx_enterprise_id = #{wxEnterpriseId}
#{item}
and member_id in
</foreach>
<foreach
collection=
"memberIds"
open=
"("
separator=
","
close=
")"
item=
"item"
>
and status_flag = 1
#{item}
</select>
</foreach>
and status_flag = 1
<select
id=
"listByMemberId"
resultMap=
"BaseResultMap"
>
</select>
select
<include
refid=
"Base_Column_List"
/>
<select
id=
"listByMemberId"
resultMap=
"BaseResultMap"
>
from tab_haoban_external_clerk_related
select
where member_id = #{memberId}
<include
refid=
"Base_Column_List"
/>
and status_flag = 1
from tab_haoban_external_clerk_related
<if
test=
"enterpriseId != null and enterpriseId != ''"
>
where member_id = #{memberId}
and enterprise_id = #{enterpriseId}
and status_flag = 1
</if>
<if
test=
"enterpriseId != null and enterpriseId != ''"
>
</select>
and enterprise_id = #{enterpriseId}
</if>
<select
id=
"listStoreIdByMemberId"
resultType=
"string"
>
</select>
select
store_id
<select
id=
"listStoreIdByMemberId"
resultType=
"string"
>
from tab_haoban_external_clerk_related
select
where member_id = #{memberId}
store_id
and status_flag = 1
from tab_haoban_external_clerk_related
</select>
where member_id = #{memberId}
and status_flag = 1
<select
id=
"listByExternalUserId"
resultMap=
"BaseResultMap"
>
</select>
select
<include
refid=
"Base_Column_List"
/>
<select
id=
"listByExternalUserId"
resultMap=
"BaseResultMap"
>
from tab_haoban_external_clerk_related
select
where wx_enterprise_id = #{wxEnterpriseId}
<include
refid=
"Base_Column_List"
/>
and status_flag = 1
from tab_haoban_external_clerk_related
and external_user_id = #{externalUserId}
where wx_enterprise_id = #{wxEnterpriseId}
</select>
and status_flag = 1
and external_user_id = #{externalUserId}
<update
id=
"updateMemberIdByMemberId"
>
</select>
UPDATE
tab_haoban_external_clerk_related
<update
id=
"updateMemberIdByMemberId"
>
SET member_id=#{memberId},
UPDATE
update_time = now()
tab_haoban_external_clerk_related
where member_id = #{oldMemberId}
SET member_id=#{memberId},
and enterprise_id = #{enterpriseId} and status_flag = 1
update_time = now()
</update>
where member_id = #{oldMemberId}
and enterprise_id = #{enterpriseId} and status_flag = 1
<update
id=
"updateStatusByMemberId"
>
</update>
UPDATE
tab_haoban_external_clerk_related
<update
id=
"updateStatusByMemberId"
>
SET status_flag = 2,
UPDATE
update_time = now()
tab_haoban_external_clerk_related
where member_id = #{memberId}
SET status_flag = 2,
and enterprise_id = #{enterpriseId}
update_time = now()
</update>
where member_id = #{memberId}
and enterprise_id = #{enterpriseId}
</update>
<select
id=
"getByMemberIdAndStaffId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
<select
id=
"getByMemberIdAndStaffId"
resultMap=
"BaseResultMap"
>
from tab_haoban_external_clerk_related
select
where
<include
refid=
"Base_Column_List"
/>
member_id = #{memberId}
from tab_haoban_external_clerk_related
and enterprise_id = #{enterpriseId}
where
AND staff_id = #{staffId}
member_id = #{memberId}
AND status_flag = 1 limit 1
and enterprise_id = #{enterpriseId}
</select>
AND staff_id = #{staffId}
AND status_flag = 1 limit 1
<select
id=
"getByUnionIdAndStaffId"
resultMap=
"BaseResultMap"
>
</select>
select
<include
refid=
"Base_Column_List"
/>
<select
id=
"getByUnionIdAndStaffId"
resultMap=
"BaseResultMap"
>
from tab_haoban_external_clerk_related
select
where
<include
refid=
"Base_Column_List"
/>
member_id = #{memberId}
from tab_haoban_external_clerk_related
and enterprise_id = #{enterpriseId}
where
AND unionid = #{unionid}
member_id = #{memberId}
AND status_flag = 1 limit 1
and enterprise_id = #{enterpriseId}
</select>
AND unionid = #{unionid}
AND status_flag = 1 limit 1
</select>
<select
id=
"pageExternalByEnterpriseId"
resultMap=
"BaseResultMap"
>
select wx_enterprise_id,
enterprise_id,
<select
id=
"pageExternalByEnterpriseId"
resultMap=
"BaseResultMap"
>
external_user_id
select wx_enterprise_id,
from tab_haoban_external_clerk_related
enterprise_id,
where wx_enterprise_id = #{wxEnterpriseId}
external_user_id
AND status_flag = 1
from tab_haoban_external_clerk_related
and external_user_id is not null
where wx_enterprise_id = #{wxEnterpriseId}
</select>
AND status_flag = 1
and external_user_id is not null
</select>
<update
id=
"updateExternalUserIdByOldExternalUserId"
>
UPDATE
tab_haoban_external_clerk_related
<update
id=
"updateExternalUserIdByOldExternalUserId"
>
SET external_user_id = #{newExternalUserId},
UPDATE
update_time = now()
tab_haoban_external_clerk_related
where external_user_id = #{oldExternalUserId}
SET external_user_id = #{newExternalUserId},
and wx_enterprise_id = #{wxEnterpriseId}
update_time = now()
</update>
where external_user_id = #{oldExternalUserId}
and wx_enterprise_id = #{wxEnterpriseId}
<select
id=
"countByClerkId"
resultType=
"Integer"
>
</update>
select count(*)
from tab_haoban_external_clerk_related
<select
id=
"countByClerkId"
resultType=
"Integer"
>
where wx_enterprise_id = #{wxEnterpriseId}
select count(*)
and enterprise_id = #{enterpriseId}
from tab_haoban_external_clerk_related
and staff_id = #{staffId}
where wx_enterprise_id = #{wxEnterpriseId}
and clerk_id = #{clerkId}
and enterprise_id = #{enterpriseId}
AND status_flag = 1
and staff_id = #{staffId}
</select>
and clerk_id = #{clerkId}
AND status_flag = 1
</select>
<select
id=
"getByEnterpriseIdAndExternalUserId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
<select
id=
"getByEnterpriseIdAndExternalUserId"
resultMap=
"BaseResultMap"
>
from tab_haoban_external_clerk_related
select
where staff_id = #{staffId,jdbcType=VARCHAR}
<include
refid=
"Base_Column_List"
/>
and wx_enterprise_id = #{wxEnterpriseId}
from tab_haoban_external_clerk_related
and enterprise_id = #{enterpriseId}
where staff_id = #{staffId,jdbcType=VARCHAR}
and external_user_id = #{externalUserId}
and wx_enterprise_id = #{wxEnterpriseId}
and status_flag in (3, 4)
and enterprise_id = #{enterpriseId}
order by update_time desc limit 1
and external_user_id = #{externalUserId}
</select>
and status_flag in (3, 4)
order by update_time desc limit 1
</select>
<select
id=
"getByWxUserIdAndWxEnterpriseId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
<select
id=
"getByWxUserIdAndWxEnterpriseId"
resultMap=
"BaseResultMap"
>
from tab_haoban_external_clerk_related
select
where staff_id = #{staffId,jdbcType=VARCHAR}
<include
refid=
"Base_Column_List"
/>
and wx_enterprise_id = #{wxEnterpriseId} and status_flag in(1,3,4)
from tab_haoban_external_clerk_related
</select>
where staff_id = #{staffId,jdbcType=VARCHAR}
and wx_enterprise_id = #{wxEnterpriseId} and status_flag in(1,3,4)
<select
id=
"getByWxEnterpriseIdAndUnionId"
resultMap=
"BaseResultMap"
>
</select>
select
<include
refid=
"Base_Column_List"
/>
<select
id=
"getByWxEnterpriseIdAndUnionId"
resultMap=
"BaseResultMap"
>
from tab_haoban_external_clerk_related
select
where staff_id = #{staffId}
<include
refid=
"Base_Column_List"
/>
and wx_enterprise_id = #{wxEnterpriseId}
from tab_haoban_external_clerk_related
and unionid = #{unionid}
where staff_id = #{staffId}
and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
order by update_time desc limit 1
and unionid = #{unionid}
</select>
and status_flag = 1
order by update_time desc limit 1
</select>
<select
id=
"getByEnterpriseIdAndMemberId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
<select
id=
"getByEnterpriseIdAndMemberId"
resultMap=
"BaseResultMap"
>
from tab_haoban_external_clerk_related
select
where enterprise_id = #{enterpriseId}
<include
refid=
"Base_Column_List"
/>
and member_id = #{memberId}
from tab_haoban_external_clerk_related
<if
test=
"statusFlag != null and statusFlag == 1"
>
where enterprise_id = #{enterpriseId}
and status_flag in (1,3,4)
and member_id = #{memberId}
</if>
<if
test=
"statusFlag != null and statusFlag == 1"
>
and status_flag in (1,3,4)
<if
test=
"statusFlag != null and statusFlag == 2"
>
</if>
and status_flag in (0,2)
</if>
<if
test=
"statusFlag != null and statusFlag == 2"
>
order by create_time desc limit 1
and status_flag in (0,2)
</select>
</if>
order by create_time desc limit 1
</select>
<select
id=
"countByMemberId"
resultType=
"int"
>
select count(*)
from tab_haoban_external_clerk_related
<select
id=
"countByMemberId"
resultType=
"int"
>
where enterprise_id = #{enterpriseId}
select count(*)
and member_id = #{memberId}
from tab_haoban_external_clerk_related
and status_flag = 1
where enterprise_id = #{enterpriseId}
</select>
and member_id = #{memberId}
and status_flag = 1
<select
id=
"getIdList"
resultType=
"string"
>
</select>
select external_clerk_related_id from tab_haoban_external_clerk_related
where enterprise_id = #{enterpriseId} and member_id = #{memberId} and status_flag = 1
<select
id=
"getIdList"
resultType=
"string"
>
</select>
select external_clerk_related_id from tab_haoban_external_clerk_related
where enterprise_id = #{enterpriseId} and member_id = #{memberId} and status_flag = 1
<update
id=
"updateMemberByIdList"
>
</select>
UPDATE
tab_haoban_external_clerk_related
<update
id=
"updateMemberByIdList"
>
SET member_id=#{memberId},
UPDATE
update_time = now()
tab_haoban_external_clerk_related
where external_clerk_related_id in
SET member_id=#{memberId},
<foreach
collection=
"list"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
update_time = now()
#{id}
where external_clerk_related_id in
</foreach>
<foreach
collection=
"list"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
and status_flag = 1
#{id}
</update>
</foreach>
and status_flag = 1
<select
id=
"listPageByWxenterpriseId"
resultMap=
"BaseResultMap"
>
</update>
select DISTINCT(external_user_id) external_user_id , create_time from tab_haoban_external_clerk_related where wx_enterprise_id = #{wxEnterpriseId} and
<if
test=
"type==0"
>
<select
id=
"listPageByWxenterpriseId"
resultMap=
"BaseResultMap"
>
status_flag in (1)
select DISTINCT(external_user_id) external_user_id , create_time from tab_haoban_external_clerk_related where wx_enterprise_id = #{wxEnterpriseId} and
</if>
<if
test=
"type==0"
>
<if
test=
"type==1"
>
status_flag in (1)
status_flag in (3,4)
</if>
</if>
<if
test=
"type==1"
>
limit ${startItem},${pageSize}
status_flag in (3,4)
</select>
</if>
limit ${startItem},${pageSize}
</select>
<select
id=
"getByStoreIdAndStaffId"
resultType=
"java.lang.String"
>
select member_id
from tab_haoban_external_clerk_related
<select
id=
"getByStoreIdAndStaffId"
resultType=
"java.lang.String"
>
where store_id = #{storeId,jdbcType=VARCHAR}
select member_id
and staff_id = #{staffId}
from tab_haoban_external_clerk_related
and status_flag in (1, 3, 4)
where store_id = #{storeId,jdbcType=VARCHAR}
</select>
and staff_id = #{staffId}
and status_flag in (1, 3, 4)
<select
id=
"listMemberAndClerk"
resultType=
"java.lang.String"
>
</select>
select member_id
from tab_haoban_external_clerk_related
<select
id=
"listMemberAndClerk"
resultType=
"java.lang.String"
>
where member_id in
select member_id
<foreach
collection=
"memberIdList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
from tab_haoban_external_clerk_related
#{item}
where member_id in
</foreach>
<foreach
collection=
"memberIdList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
and clerk_id in
#{item}
<foreach
collection=
"clerkIdList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
</foreach>
#{item}
and clerk_id in
</foreach>
<foreach
collection=
"clerkIdList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
and enterprise_id = #{enterpriseId}
#{item}
AND status_flag = 1
</foreach>
</select>
and enterprise_id = #{enterpriseId}
AND status_flag = 1
<select
id=
"getCountExternalClerk"
resultType=
"java.lang.Integer"
>
</select>
select count(*)
from tab_haoban_external_clerk_related
<select
id=
"getCountExternalClerk"
resultType=
"java.lang.Integer"
>
where
select count(*)
wx_enterprise_id = #{wxEnterpriseId}
from tab_haoban_external_clerk_related
and staff_id = #{staffId}
where
and status_flag in
wx_enterprise_id = #{wxEnterpriseId}
<foreach
collection=
"statusFlags"
open=
"("
close=
")"
separator=
","
item=
"item"
>
and staff_id = #{staffId}
#{item}
and status_flag in
</foreach>
<foreach
collection=
"statusFlags"
open=
"("
close=
")"
separator=
","
item=
"item"
>
</select>
#{item}
</foreach>
<select
id=
"getCountByMemberId"
resultType=
"java.lang.Integer"
parameterType=
"java.lang.String"
>
</select>
select
count(*)
<select
id=
"getCountByMemberId"
resultType=
"java.lang.Integer"
parameterType=
"java.lang.String"
>
from tab_haoban_external_clerk_related
select
where
count(*)
member_id = #{memberId} and status_flag in (1,3,4)
from tab_haoban_external_clerk_related
</select>
where
member_id = #{memberId} and status_flag in (1,3,4)
<update
id=
"updateClerkInfo"
>
</select>
UPDATE
tab_haoban_external_clerk_related
<update
id=
"updateClerkInfo"
>
SET clerk_id = #{newClerkId},
UPDATE
store_id = #{storeId},
tab_haoban_external_clerk_related
update_time = now()
SET clerk_id = #{newClerkId},
where staff_id = #{staffId}
store_id = #{storeId},
and clerk_id = #{oldClerkId}
update_time = now()
and status_flag in (1,3,4)
where staff_id = #{staffId}
</update>
and clerk_id = #{oldClerkId}
and status_flag in (1,3,4)
<select
id=
"listByClerkId"
resultType=
"String"
>
</update>
select member_id from tab_haoban_external_clerk_related
where staff_id = #{staffId}
<select
id=
"listByClerkId"
resultType=
"String"
>
and clerk_id = #{clerkId}
select member_id from tab_haoban_external_clerk_related
and status_flag = 1
where staff_id = #{staffId}
</select>
and clerk_id = #{clerkId}
and status_flag = 1
<update
id=
"updateExternalStatus"
>
</select>
update tab_haoban_external_clerk_related set external_status = #{status} where
external_user_id = #{externalUserid} and wx_enterprise_id = #{wxEnterpriseId}
<update
id=
"updateExternalStatus"
>
</update>
update tab_haoban_external_clerk_related set external_status = #{status} where
external_user_id = #{externalUserid} and wx_enterprise_id = #{wxEnterpriseId}
<select
id=
"getMemberForExternalId"
resultMap=
"BaseResultMap"
>
</update>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related where wx_enterprise_id = #{wxEnterpriseId}
<select
id=
"getMemberForExternalId"
resultMap=
"BaseResultMap"
>
and external_user_id = #{externalUserId} and status_flag in (1,3,4) and member_id
<![CDATA[ <> '' ]]>
select
<include
refid=
"Base_Column_List"
/>
limit 1
from tab_haoban_external_clerk_related where wx_enterprise_id = #{wxEnterpriseId}
</select>
and external_user_id = #{externalUserId} and status_flag in (1,3,4) and member_id
<![CDATA[ <> '' ]]>
limit 1
<select
id=
"queryExternalUserIdWithStaffId"
resultType=
"java.lang.String"
>
</select>
SELECT external_user_id from tab_haoban_external_clerk_related
WHERE staff_id = #{staffId}
<select
id=
"queryExternalUserIdWithStaffId"
resultType=
"java.lang.String"
>
and status_flag in (1, 3, 4);
SELECT external_user_id from tab_haoban_external_clerk_related
</select>
WHERE staff_id = #{staffId}
and status_flag in (1, 3, 4);
<select
id=
"queryClerkMemberRelations"
resultMap=
"BaseResultMap"
>
</select>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
<select
id=
"queryClerkMemberRelations"
resultMap=
"BaseResultMap"
>
where staff_id = #{staffId}
select
<include
refid=
"Base_Column_List"
/>
and status_flag in (1, 3, 4)
from tab_haoban_external_clerk_related
and member_id in
where staff_id = #{staffId}
<foreach
collection=
"memberIds"
item=
"memberId"
open=
"("
close=
")"
separator=
","
>
and status_flag in (1, 3, 4)
#{memberId}
and member_id in
</foreach>
<foreach
collection=
"memberIds"
item=
"memberId"
open=
"("
close=
")"
separator=
","
>
</select>
#{memberId}
</foreach>
<select
id=
"listMemberAndStaff"
resultType=
"java.lang.String"
>
</select>
select member_id
from tab_haoban_external_clerk_related
<select
id=
"listMemberAndStaff"
resultType=
"java.lang.String"
>
where member_id in
select member_id
<foreach
collection=
"memberIdList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
from tab_haoban_external_clerk_related
#{item}
where member_id in
</foreach>
<foreach
collection=
"memberIdList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
and staff_id = #{staffId}
#{item}
and enterprise_id = #{enterpriseId}
</foreach>
AND status_flag = 1
and staff_id = #{staffId}
</select>
and enterprise_id = #{enterpriseId}
AND status_flag = 1
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/test/java/GroupMessageServiceTest.java
View file @
e28e43a0
...
@@ -116,8 +116,8 @@ public class GroupMessageServiceTest {
...
@@ -116,8 +116,8 @@ public class GroupMessageServiceTest {
qywxMomentInfoQDTO
.
setEndTime
(
1681906519L
);
qywxMomentInfoQDTO
.
setEndTime
(
1681906519L
);
qywxMomentInfoQDTO
.
setCreatorId
(
"wo59NLDQAAbjSBA575NouC1pUYQgCOtw"
);
qywxMomentInfoQDTO
.
setCreatorId
(
"wo59NLDQAAbjSBA575NouC1pUYQgCOtw"
);
qywxMomentInfoQDTO
.
setPageSize
(
20
);
qywxMomentInfoQDTO
.
setPageSize
(
20
);
ServiceResponse
<
QywxMomentRespDTO
>
serviceResponse
=
qywxSuiteApiService
.
queryQywxMomentList
(
qywxMomentInfoQDTO
);
//
ServiceResponse<QywxMomentRespDTO> serviceResponse = qywxSuiteApiService.queryQywxMomentList(qywxMomentInfoQDTO);
System
.
out
.
println
(
JSON
.
toJSONString
(
serviceResponse
));
//
System.out.println(JSON.toJSONString(serviceResponse));
}
}
@Test
@Test
...
...
haoban-manage3-service/src/test/java/MaterialReportServiceTest.java
View file @
e28e43a0
...
@@ -103,7 +103,7 @@ public class MaterialReportServiceTest {
...
@@ -103,7 +103,7 @@ public class MaterialReportServiceTest {
// params.put("t", 1);
// params.put("t", 1);
// params.put("d", "04");
// params.put("d", "04");
String
s
=
params
.
toJSONString
();
String
s
=
params
.
toJSONString
();
String
s1
=
NoticeMessageUtil
.
buildMiniAppUrl
(
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY
,
s
);
String
s1
=
NoticeMessageUtil
.
buildMiniAppUrl
(
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY
_MONTH
,
s
);
System
.
out
.
println
(
"/pages/route/index?pageType=hbapp_material_report&data="
.
length
());
System
.
out
.
println
(
"/pages/route/index?pageType=hbapp_material_report&data="
.
length
());
System
.
out
.
println
(
s1
);
System
.
out
.
println
(
s1
);
System
.
out
.
println
(
s1
.
length
());
System
.
out
.
println
(
s1
.
length
());
...
...
haoban-manage3-service/src/test/java/NotityTest.java
View file @
e28e43a0
...
@@ -124,8 +124,8 @@ public class NotityTest {
...
@@ -124,8 +124,8 @@ public class NotityTest {
articleInfo
.
setPicurl
(
"https://platform-1251519181.cos.ap-shanghai.myqcloud.com/image/newdmwltest/enterprise_common-e1e8b3d46fdb4486ad545aae6cba67a1.png"
);
articleInfo
.
setPicurl
(
"https://platform-1251519181.cos.ap-shanghai.myqcloud.com/image/newdmwltest/enterprise_common-e1e8b3d46fdb4486ad545aae6cba67a1.png"
);
messageDTO
.
setArticleMessages
(
Arrays
.
asList
(
articleInfo
));
messageDTO
.
setArticleMessages
(
Arrays
.
asList
(
articleInfo
));
boolean
b
=
qywxSuiteApiService
.
sendMessage
(
corpid
,
config
.
getWxSuiteid
(),
messageDTO
);
/*
boolean b = qywxSuiteApiService.sendMessage(corpid, config.getWxSuiteid(), messageDTO);
System
.
out
.
println
(
b
);
System.out.println(b);
*/
}
}
@Test
@Test
...
@@ -138,7 +138,7 @@ public class NotityTest {
...
@@ -138,7 +138,7 @@ public class NotityTest {
search
.
setSuiteid
(
config
.
getWxSuiteid
());
search
.
setSuiteid
(
config
.
getWxSuiteid
());
search
.
setChatType
(
"single"
);
search
.
setChatType
(
"single"
);
Date
date
=
DateUtils
.
addDays
(
new
Date
(),
-
1
);
Date
date
=
DateUtils
.
addDays
(
new
Date
(),
-
1
);
ServiceResponse
<
QywxGroupMsgResp
>
serviceResponse
=
qywxSuiteApiService
.
queryQywxGroupMessageList
(
search
);
//
ServiceResponse<QywxGroupMsgResp> serviceResponse = qywxSuiteApiService.queryQywxGroupMessageList(search);
}
}
...
...
haoban-manage3-service/src/test/java/test.java
View file @
e28e43a0
...
@@ -69,7 +69,7 @@ public class test {
...
@@ -69,7 +69,7 @@ public class test {
// params.put("t", 1);
// params.put("t", 1);
// params.put("d", "04");
// params.put("d", "04");
String
s
=
params
.
toJSONString
();
String
s
=
params
.
toJSONString
();
String
s1
=
NoticeMessageUtil
.
buildMiniAppUrl
(
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY
,
s
);
String
s1
=
NoticeMessageUtil
.
buildMiniAppUrl
(
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY
_MONTH
,
s
);
System
.
out
.
println
(
"/pages/route/index?pageType=hbapp_material_report&data="
.
length
());
System
.
out
.
println
(
"/pages/route/index?pageType=hbapp_material_report&data="
.
length
());
System
.
out
.
println
(
s1
);
System
.
out
.
println
(
s1
);
System
.
out
.
println
(
s1
.
length
());
System
.
out
.
println
(
s1
.
length
());
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
e28e43a0
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.api.dto.*
;
import
com.gic.enterprise.api.dto.*
;
import
com.gic.enterprise.api.service.AuthorizeService
;
import
com.gic.enterprise.api.service.AuthorizeService
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.anno.IgnoreLogin
;
import
com.gic.haoban.common.anno.IgnoreLogin
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.service.fee.HaobanQywxFeeApiService
;
import
com.gic.haoban.manage.api.service.fee.HaobanQywxFeeApiService
;
import
com.gic.haoban.manage.api.service.out.SecretSettingApiService
;
import
com.gic.haoban.manage.api.service.out.SecretSettingApiService
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.MiniprogramSettingQo
;
import
com.gic.haoban.manage.web.qo.MiniprogramSettingQo
;
import
com.gic.haoban.manage.web.vo.StoreVo
;
import
com.gic.haoban.manage.web.vo.StoreVo
;
import
com.gic.haoban.manage.web.vo.*
;
import
com.gic.haoban.manage.web.vo.*
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.token.api.dto.QywxCorpInfoDTO
;
import
com.gic.wechat.token.api.dto.QywxCorpInfoDTO
;
import
com.gic.wechat.token.api.service.QywxTokenManageService
;
import
com.gic.wechat.token.api.service.QywxTokenManageService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@RestController
@RestController
public
class
WxEnterpriseController
extends
WebBaseController
{
public
class
WxEnterpriseController
extends
WebBaseController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
WxEnterpriseController
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
WxEnterpriseController
.
class
);
@Autowired
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@Autowired
@Autowired
private
EnterpriseService
enterpriseService
;
private
EnterpriseService
enterpriseService
;
@Autowired
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
@Autowired
private
DepartmentApiService
departmentApiService
;
private
DepartmentApiService
departmentApiService
;
@Autowired
@Autowired
private
StoreService
storeService
;
private
StoreService
storeService
;
@Autowired
@Autowired
private
QywxTokenManageService
qywxTokenManageService
;
private
QywxTokenManageService
qywxTokenManageService
;
@Autowired
@Autowired
private
Config
config
;
private
Config
config
;
@Autowired
@Autowired
private
QywxCorpApiService
qywxCorpApiService
;
private
QywxCorpApiService
qywxCorpApiService
;
@Autowired
@Autowired
private
DealSyncOperationApiService
dealSyncOperationApiService
;
private
DealSyncOperationApiService
dealSyncOperationApiService
;
@Autowired
@Autowired
private
MaterialApiService
materialApiService
;
private
MaterialApiService
materialApiService
;
@Autowired
@Autowired
private
AuthorizeService
authorizeService
;
private
AuthorizeService
authorizeService
;
@Autowired
@Autowired
private
HaobanUserApiService
haobanUserApiService
;
private
HaobanUserApiService
haobanUserApiService
;
@Autowired
@Autowired
private
HaobanQywxFeeApiService
haobanQywxFeeApiService
;
private
HaobanQywxFeeApiService
haobanQywxFeeApiService
;
@Autowired
@Autowired
private
SecretSettingApiService
secretSettingApiService
;
private
SecretSettingApiService
secretSettingApiService
;
@Autowired
@Autowired
private
ClerkService
clerkService
;
private
ClerkService
clerkService
;
//授权企业列表
//授权企业列表
@RequestMapping
(
"wxa-enterprise-list"
)
@RequestMapping
(
"wxa-enterprise-list"
)
public
HaobanResponse
wxEnterpriseList
()
{
public
HaobanResponse
wxEnterpriseList
()
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
phoneNumber
=
login
.
getPhoneNumber
()
;
String
phoneNumber
=
login
.
getPhoneNumber
()
;
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
,
phoneNumber
,
true
);
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
,
phoneNumber
,
true
);
List
<
EnterpriseDetailVO
>
detailVOS
=
EntityUtil
.
changeEntityListByOrika
(
EnterpriseDetailVO
.
class
,
list
);
List
<
EnterpriseDetailVO
>
detailVOS
=
EntityUtil
.
changeEntityListByOrika
(
EnterpriseDetailVO
.
class
,
list
);
if
(
CollectionUtil
.
isNotEmpty
(
detailVOS
))
{
if
(
CollectionUtil
.
isNotEmpty
(
detailVOS
))
{
List
<
String
>
enterpriseIds
=
detailVOS
.
stream
().
map
(
s
->
s
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
enterpriseIds
=
detailVOS
.
stream
().
map
(
s
->
s
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
EnterpriseDTO
>
enterpriseList
=
enterpriseService
.
listEnterpriseByIds
(
enterpriseIds
);
List
<
EnterpriseDTO
>
enterpriseList
=
enterpriseService
.
listEnterpriseByIds
(
enterpriseIds
);
Map
<
String
,
EnterpriseDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
enterpriseList
,
"enterpriseId"
);
Map
<
String
,
EnterpriseDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
enterpriseList
,
"enterpriseId"
);
for
(
EnterpriseDetailVO
dto
:
detailVOS
)
{
for
(
EnterpriseDetailVO
dto
:
detailVOS
)
{
List
<
EnterpriseWxaRelationDTO
>
relationDTOS
=
authorizeService
.
queryList
(
dto
.
getEnterpriseId
());
List
<
EnterpriseWxaRelationDTO
>
relationDTOS
=
authorizeService
.
queryList
(
dto
.
getEnterpriseId
());
EnterpriseDTO
enterpriseDTO
=
map
.
get
(
dto
.
getEnterpriseId
());
EnterpriseDTO
enterpriseDTO
=
map
.
get
(
dto
.
getEnterpriseId
());
EnterpriseWxaRelationDTO
wxaRelationDTO
=
relationDTOS
.
stream
().
filter
(
mid
->
mid
.
getWxaAppkey
().
equals
(
enterpriseDTO
.
getMallMiniprogramAppid
())).
findFirst
().
orElse
(
null
);
EnterpriseWxaRelationDTO
wxaRelationDTO
=
relationDTOS
.
stream
().
filter
(
mid
->
mid
.
getWxaAppkey
().
equals
(
enterpriseDTO
.
getMallMiniprogramAppid
())).
findFirst
().
orElse
(
null
);
if
(
wxaRelationDTO
!=
null
)
{
if
(
wxaRelationDTO
!=
null
)
{
dto
.
setEnterpriseName
(
enterpriseDTO
.
getEnterpriseName
());
dto
.
setEnterpriseName
(
enterpriseDTO
.
getEnterpriseName
());
dto
.
setImageUrl
(
wxaRelationDTO
.
getAuthImg
());
dto
.
setImageUrl
(
wxaRelationDTO
.
getAuthImg
());
dto
.
setAppId
(
wxaRelationDTO
.
getWxaAppkey
());
dto
.
setAppId
(
wxaRelationDTO
.
getWxaAppkey
());
dto
.
setMiniprogramName
(
wxaRelationDTO
.
getAuthName
());
dto
.
setMiniprogramName
(
wxaRelationDTO
.
getAuthName
());
dto
.
setTitle
(
wxaRelationDTO
.
getAuthName
());
dto
.
setTitle
(
wxaRelationDTO
.
getAuthName
());
}
}
}
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
detailVOS
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
detailVOS
);
}
}
//授权企业列表 filteRight 是否过滤无登录权限的列表
//授权企业列表 filteRight 是否过滤无登录权限的列表
@RequestMapping
(
"wx-enterprise-list"
)
@RequestMapping
(
"wx-enterprise-list"
)
public
HaobanResponse
wxaEnterpriseList
(
@RequestParam
(
defaultValue
=
"0"
)
int
filteRight
)
{
public
HaobanResponse
wxaEnterpriseList
(
@RequestParam
(
defaultValue
=
"0"
)
int
filteRight
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
phoneNumber
=
login
.
getPhoneNumber
()
;
String
phoneNumber
=
login
.
getPhoneNumber
()
;
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
,
phoneNumber
,
filteRight
==
1
);
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
,
phoneNumber
,
filteRight
==
1
);
String
userId
=
login
.
getHanbaoUserId
()
;
String
userId
=
login
.
getHanbaoUserId
()
;
HaobanUserDTO
dto
=
this
.
haobanUserApiService
.
selectById
(
userId
)
;
HaobanUserDTO
dto
=
this
.
haobanUserApiService
.
selectById
(
userId
)
;
if
(
null
!=
dto
)
{
if
(
null
!=
dto
)
{
String
eid
=
dto
.
getDefaultGicEid
()
;
String
eid
=
dto
.
getDefaultGicEid
()
;
for
(
EnterpriseDetailDTO
item
:
list
)
{
for
(
EnterpriseDetailDTO
item
:
list
)
{
if
(
null
!=
eid
&&
eid
.
equals
(
item
.
getEnterpriseId
()))
{
if
(
null
!=
eid
&&
eid
.
equals
(
item
.
getEnterpriseId
()))
{
item
.
setDefaultFlag
(
1
);
item
.
setDefaultFlag
(
1
);
}
}
}
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
}
//企业信息
//企业信息
@IgnoreLogin
@IgnoreLogin
@RequestMapping
(
"wxEnterprise-detail"
)
@RequestMapping
(
"wxEnterprise-detail"
)
public
HaobanResponse
enterpriseDetail
(
String
wxEnterpriseId
)
{
public
HaobanResponse
enterpriseDetail
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isEmpty
(
wxEnterpriseId
))
{
if
(
StringUtils
.
isEmpty
(
wxEnterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
==
null
)
{
if
(
wxEnterpriseDTO
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_100018
);
return
resultResponse
(
HaoBanErrCode
.
ERR_100018
);
}
}
wxEnterpriseDTO
.
setSmallVersion
(
"免费版"
);
wxEnterpriseDTO
.
setSmallVersion
(
"免费版"
);
wxEnterpriseDTO
.
setStoreTotal
(
departmentApiService
.
totalStoreCountByEnterpriseId
(
wxEnterpriseId
));
wxEnterpriseDTO
.
setStoreTotal
(
departmentApiService
.
totalStoreCountByEnterpriseId
(
wxEnterpriseId
));
WxEnterpriseVO
vo
=
com
.
gic
.
commons
.
util
.
EntityUtil
.
changeEntityNew
(
WxEnterpriseVO
.
class
,
wxEnterpriseDTO
)
;
WxEnterpriseVO
vo
=
com
.
gic
.
commons
.
util
.
EntityUtil
.
changeEntityNew
(
WxEnterpriseVO
.
class
,
wxEnterpriseDTO
)
;
vo
.
setCorpid
(
getCorpid
(
wxEnterpriseDTO
));
vo
.
setCorpid
(
getCorpid
(
wxEnterpriseDTO
));
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
vo
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
vo
);
}
}
//企业信息
//企业信息
@IgnoreLogin
@IgnoreLogin
@RequestMapping
(
"wxEnterprise-refresh"
)
@RequestMapping
(
"wxEnterprise-refresh"
)
public
HaobanResponse
enterpriseRefresh
(
String
wxEnterpriseId
)
{
public
HaobanResponse
enterpriseRefresh
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isEmpty
(
wxEnterpriseId
))
{
if
(
StringUtils
.
isEmpty
(
wxEnterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
==
null
)
{
if
(
wxEnterpriseDTO
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
}
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
)
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
)
;
if
(
qwDTO
.
isSelf
())
{
if
(
qwDTO
.
isSelf
())
{
return
this
.
fail
(
"
自建应用不能刷新"
);
return
this
.
fail
(
"
已刷新"
);
}
}
QywxCorpInfoDTO
dto
=
qywxTokenManageService
.
getCorpInfo
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
());
QywxCorpInfoDTO
dto
=
qywxTokenManageService
.
getCorpInfo
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
());
if
(
dto
==
null
)
{
if
(
dto
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
}
Long
verifiedEndTime
=
dto
.
getVerifiedEndTime
();
Long
verifiedEndTime
=
dto
.
getVerifiedEndTime
();
logger
.
info
(
"【企业同步】dto={}"
,
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"【企业同步】dto={}"
,
JSON
.
toJSONString
(
dto
));
WxEnterpriseDTO
wxDTO
=
EntityUtil
.
changeEntityByJSON
(
WxEnterpriseDTO
.
class
,
dto
);
WxEnterpriseDTO
wxDTO
=
EntityUtil
.
changeEntityByJSON
(
WxEnterpriseDTO
.
class
,
dto
);
if
(
verifiedEndTime
!=
null
)
{
if
(
verifiedEndTime
!=
null
)
{
wxDTO
.
setVerifiedEndTime
(
new
Date
(
verifiedEndTime
*
1000
));
wxDTO
.
setVerifiedEndTime
(
new
Date
(
verifiedEndTime
*
1000
));
}
}
wxDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
wxDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
Integer
contactFlag
=
wxEnterpriseDTO
.
getContactFlag
();
Integer
contactFlag
=
wxEnterpriseDTO
.
getContactFlag
();
if
(
contactFlag
==
0
)
{
if
(
contactFlag
==
0
)
{
wxDTO
.
setContactFlag
(
1
);
wxDTO
.
setContactFlag
(
1
);
}
}
wxEnterpriseApiService
.
update
(
wxDTO
);
wxEnterpriseApiService
.
update
(
wxDTO
);
WxEnterpriseVO
vo
=
com
.
gic
.
commons
.
util
.
EntityUtil
.
changeEntityNew
(
WxEnterpriseVO
.
class
,
wxEnterpriseDTO
)
;
WxEnterpriseVO
vo
=
com
.
gic
.
commons
.
util
.
EntityUtil
.
changeEntityNew
(
WxEnterpriseVO
.
class
,
wxEnterpriseDTO
)
;
vo
.
setCorpid
(
getCorpid
(
wxEnterpriseDTO
));
vo
.
setCorpid
(
getCorpid
(
wxEnterpriseDTO
));
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
vo
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
vo
);
}
}
private
String
getCorpid
(
WxEnterpriseDTO
wxEnterpriseDTO
)
{
private
String
getCorpid
(
WxEnterpriseDTO
wxEnterpriseDTO
)
{
Integer
wxType
=
wxEnterpriseDTO
.
getWxSecurityType
()
;
Integer
wxType
=
wxEnterpriseDTO
.
getWxSecurityType
()
;
String
wxEnterpriseId
=
wxEnterpriseDTO
.
getWxEnterpriseId
()
;
String
wxEnterpriseId
=
wxEnterpriseDTO
.
getWxEnterpriseId
()
;
if
(
null
==
wxType
||
0
==
wxType
)
{
if
(
null
==
wxType
||
0
==
wxType
)
{
this
.
wxEnterpriseApiService
.
updateWxSecurityType
(
wxEnterpriseId
);
this
.
wxEnterpriseApiService
.
updateWxSecurityType
(
wxEnterpriseId
);
wxType
=
this
.
wxEnterpriseApiService
.
calcSecretType
(
wxEnterpriseId
)
;
wxType
=
this
.
wxEnterpriseApiService
.
calcSecretType
(
wxEnterpriseId
)
;
}
}
String
desc
=
" (企微加密方式待确认,请联系运营人员) "
;
String
desc
=
" (企微加密方式待确认,请联系运营人员) "
;
if
(
wxType
==
1
)
{
if
(
wxType
==
1
)
{
desc
=
"(全明文)"
;
desc
=
"(全明文)"
;
}
}
if
(
wxType
==
2
)
{
if
(
wxType
==
2
)
{
desc
=
"(全密文)"
;
desc
=
"(全密文)"
;
}
}
if
(
wxType
==
3
)
{
if
(
wxType
==
3
)
{
desc
=
"(第三方密文,代开明文)"
;
desc
=
"(第三方密文,代开明文)"
;
}
}
if
(
wxType
==
4
)
{
if
(
wxType
==
4
)
{
desc
=
"(第三方明文,代开密文)"
;
desc
=
"(第三方明文,代开密文)"
;
}
}
if
(
wxType
==
5
)
{
if
(
wxType
==
5
)
{
desc
=
" ( "
+
wxEnterpriseDTO
.
getWxaAppid
()
+
" / "
+
wxEnterpriseDTO
.
getUrlHost
()+
") "
;
desc
=
" ( "
+
wxEnterpriseDTO
.
getWxaAppid
()
+
" / "
+
wxEnterpriseDTO
.
getUrlHost
()+
") "
;
}
}
int
newType
=
this
.
wxEnterpriseApiService
.
calcSecretType
(
wxEnterpriseId
)
;
int
newType
=
this
.
wxEnterpriseApiService
.
calcSecretType
(
wxEnterpriseId
)
;
String
diff
=
""
;
String
diff
=
""
;
if
(
null
!=
wxType
&&
wxType
.
intValue
()
!=
newType
&&
wxType
!=
5
)
{
if
(
null
!=
wxType
&&
wxType
.
intValue
()
!=
newType
&&
wxType
!=
5
)
{
diff
=
"*"
;
diff
=
"*"
;
}
}
return
Arrays
.
asList
(
wxEnterpriseDTO
.
getWxCorpid
(),
wxEnterpriseDTO
.
getOpenCorpid
()).
stream
().
filter
(
str
->
StringUtils
.
isNotBlank
(
str
)).
collect
(
Collectors
.
joining
(
" / "
))
+
desc
+
diff
;
return
Arrays
.
asList
(
wxEnterpriseDTO
.
getWxCorpid
(),
wxEnterpriseDTO
.
getOpenCorpid
()).
stream
().
filter
(
str
->
StringUtils
.
isNotBlank
(
str
)).
collect
(
Collectors
.
joining
(
" / "
))
+
desc
+
diff
;
}
}
//gic企业列表
//gic企业列表
@IgnoreLogin
@IgnoreLogin
@RequestMapping
(
"enterprise-search"
)
@RequestMapping
(
"enterprise-search"
)
public
HaobanResponse
gicEnterpriseDetail
(
String
enterpriseId
)
{
public
HaobanResponse
gicEnterpriseDetail
(
String
enterpriseId
)
{
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isEmpty
(
enterpriseId
))
{
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isEmpty
(
enterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
EnterpriseSearchVO
vo
=
new
EnterpriseSearchVO
();
EnterpriseSearchVO
vo
=
new
EnterpriseSearchVO
();
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseById
(
enterpriseId
);
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseById
(
enterpriseId
);
if
(
enterprise
!=
null
)
{
if
(
enterprise
!=
null
)
{
vo
.
setEnterpriseId
(
enterpriseId
);
vo
.
setEnterpriseId
(
enterpriseId
);
vo
.
setEnterpriseName
(
enterprise
.
getEnterpriseName
());
vo
.
setEnterpriseName
(
enterprise
.
getEnterpriseName
());
vo
.
setBrandName
(
enterprise
.
getBrandName
());
vo
.
setBrandName
(
enterprise
.
getBrandName
());
ClerkDTO
clerk
=
clerkService
.
getSuperAdminByEnterpriseId
(
enterpriseId
);
ClerkDTO
clerk
=
clerkService
.
getSuperAdminByEnterpriseId
(
enterpriseId
);
if
(
clerk
!=
null
)
{
if
(
clerk
!=
null
)
{
vo
.
setClerkId
(
clerk
.
getClerkId
());
vo
.
setClerkId
(
clerk
.
getClerkId
());
vo
.
setClerkCode
(
clerk
.
getClerkCode
());
vo
.
setClerkCode
(
clerk
.
getClerkCode
());
vo
.
setClerkName
(
clerk
.
getClerkName
());
vo
.
setClerkName
(
clerk
.
getClerkName
());
vo
.
setPhoneNumber
(
clerk
.
getPhoneNumber
());
vo
.
setPhoneNumber
(
clerk
.
getPhoneNumber
());
vo
.
setNationCode
(
clerk
.
getNationcode
());
vo
.
setNationCode
(
clerk
.
getNationcode
());
}
}
}
else
{
}
else
{
//enterpriseId 参数可以是企业id,也可以是企业名称
//enterpriseId 参数可以是企业id,也可以是企业名称
//按名称去查
//按名称去查
EnterpriseAndUserDTO
dto
=
enterpriseService
.
getEnterpriseAndUserByName
(
enterpriseId
);
EnterpriseAndUserDTO
dto
=
enterpriseService
.
getEnterpriseAndUserByName
(
enterpriseId
);
vo
=
EntityUtil
.
changeEntityByJSON
(
EnterpriseSearchVO
.
class
,
dto
);
vo
=
EntityUtil
.
changeEntityByJSON
(
EnterpriseSearchVO
.
class
,
dto
);
if
(
vo
!=
null
)
{
if
(
vo
!=
null
)
{
EnterpriseDTO
enterprise1
=
enterpriseService
.
getEnterpriseById
(
vo
.
getEnterpriseId
());
EnterpriseDTO
enterprise1
=
enterpriseService
.
getEnterpriseById
(
vo
.
getEnterpriseId
());
if
(
enterprise1
!=
null
)
{
if
(
enterprise1
!=
null
)
{
vo
.
setBrandName
(
enterprise1
.
getBrandName
());
vo
.
setBrandName
(
enterprise1
.
getBrandName
());
}
}
}
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
vo
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
vo
);
}
}
//溢出门店列表
//溢出门店列表
@RequestMapping
(
"store-full-list"
)
@RequestMapping
(
"store-full-list"
)
public
HaobanResponse
storeFullList
(
BasePageInfo
basePageInfo
,
String
keyWord
)
{
public
HaobanResponse
storeFullList
(
BasePageInfo
basePageInfo
,
String
keyWord
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
int
maxVersionCount
=
0
;
int
maxVersionCount
=
0
;
List
<
EnterpriseDetailDTO
>
enterpriseList
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
EnterpriseDetailDTO
>
enterpriseList
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtil
.
isEmpty
(
enterpriseList
))
{
if
(
CollectionUtil
.
isEmpty
(
enterpriseList
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10010
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10010
);
}
}
List
<
String
>
enterpriseIds
=
enterpriseList
.
stream
().
map
(
s
->
s
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
enterpriseIds
=
enterpriseList
.
stream
().
map
(
s
->
s
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
//获取门店列表
//获取门店列表
Page
page1
=
new
Page
<>();
Page
page1
=
new
Page
<>();
page1
.
setCurrentPage
(
1
);
page1
.
setCurrentPage
(
1
);
page1
.
setPageSize
(
Integer
.
MAX_VALUE
);
page1
.
setPageSize
(
Integer
.
MAX_VALUE
);
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseIdList
(
enterpriseIds
);
storeSearchDTO
.
setEnterpriseIdList
(
enterpriseIds
);
storeSearchDTO
.
setSearchName
(
keyWord
);
storeSearchDTO
.
setSearchName
(
keyWord
);
Page
storePage
=
storeService
.
storeListPage
(
page1
,
storeSearchDTO
);
Page
storePage
=
storeService
.
storeListPage
(
page1
,
storeSearchDTO
);
if
(
storePage
==
null
||
storePage
.
getResult
()
==
null
)
{
if
(
storePage
==
null
||
storePage
.
getResult
()
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10009
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10009
);
}
}
List
<
StoreDTO
>
t_list
=
storePage
.
getResult
();
List
<
StoreDTO
>
t_list
=
storePage
.
getResult
();
List
<
String
>
storeIds
=
t_list
.
stream
().
map
(
s
->
s
.
getStoreId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
storeIds
=
t_list
.
stream
().
map
(
s
->
s
.
getStoreId
()).
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isEmpty
(
keyWord
))
{
if
(
StringUtils
.
isEmpty
(
keyWord
))
{
storeIds
=
null
;
storeIds
=
null
;
}
}
Page
<
DepartmentDTO
>
page
=
departmentApiService
.
pageFullStoreByWxEnterpriseId
(
wxEnterpriseId
,
keyWord
,
storeIds
,
maxVersionCount
,
basePageInfo
);
Page
<
DepartmentDTO
>
page
=
departmentApiService
.
pageFullStoreByWxEnterpriseId
(
wxEnterpriseId
,
keyWord
,
storeIds
,
maxVersionCount
,
basePageInfo
);
List
<
DepartmentDTO
>
list
=
page
.
getResult
();
List
<
DepartmentDTO
>
list
=
page
.
getResult
();
List
<
StoreVo
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StoreVo
.
class
,
list
);
List
<
StoreVo
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StoreVo
.
class
,
list
);
List
<
String
>
t_storeIds
=
list
.
stream
().
map
(
s
->
s
.
getRelatedId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
t_storeIds
=
list
.
stream
().
map
(
s
->
s
.
getRelatedId
()).
collect
(
Collectors
.
toList
());
String
[]
storeIdArr
=
t_storeIds
.
toArray
(
new
String
[
t_storeIds
.
size
()]);
String
[]
storeIdArr
=
t_storeIds
.
toArray
(
new
String
[
t_storeIds
.
size
()]);
List
<
StoreDTO
>
storeList
=
storeService
.
getStores
(
storeIdArr
);
List
<
StoreDTO
>
storeList
=
storeService
.
getStores
(
storeIdArr
);
Map
<
String
,
StoreDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
storeList
,
"storeId"
);
Map
<
String
,
StoreDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
storeList
,
"storeId"
);
for
(
StoreVo
vo
:
resultList
)
{
for
(
StoreVo
vo
:
resultList
)
{
if
(
map
.
get
(
vo
.
getRelatedId
())
!=
null
)
{
if
(
map
.
get
(
vo
.
getRelatedId
())
!=
null
)
{
vo
.
setStoreCode
(
map
.
get
(
vo
.
getRelatedId
()).
getStoreCode
());
vo
.
setStoreCode
(
map
.
get
(
vo
.
getRelatedId
()).
getStoreCode
());
vo
.
setStoreId
(
map
.
get
(
vo
.
getRelatedId
()).
getStoreId
());
vo
.
setStoreId
(
map
.
get
(
vo
.
getRelatedId
()).
getStoreId
());
vo
.
setStoreName
(
map
.
get
(
vo
.
getRelatedId
()).
getStoreName
());
vo
.
setStoreName
(
map
.
get
(
vo
.
getRelatedId
()).
getStoreName
());
}
}
}
}
Page
resultPage
=
new
Page
<>();
Page
resultPage
=
new
Page
<>();
resultPage
.
setCurrentPage
(
page
.
getCurrentPage
());
resultPage
.
setCurrentPage
(
page
.
getCurrentPage
());
resultPage
.
setPageSize
(
page
.
getPageSize
());
resultPage
.
setPageSize
(
page
.
getPageSize
());
resultPage
.
setTotalCount
(
page
.
getTotalCount
());
resultPage
.
setTotalCount
(
page
.
getTotalCount
());
resultPage
.
setResult
(
resultList
);
resultPage
.
setResult
(
resultList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
resultPage
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
resultPage
);
}
}
//微信企业是否设置key
//微信企业是否设置key
@RequestMapping
(
"is-wx-enterprise-secret-set"
)
@RequestMapping
(
"is-wx-enterprise-secret-set"
)
public
HaobanResponse
isWxEnterpriseSecretSet
()
{
public
HaobanResponse
isWxEnterpriseSecretSet
()
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
SecretSettingDTO
>
listSecret
=
wxEnterpriseApiService
.
listSecret
(
wxEnterpriseId
);
List
<
SecretSettingDTO
>
listSecret
=
wxEnterpriseApiService
.
listSecret
(
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
listSecret
))
{
if
(
CollectionUtils
.
isEmpty
(
listSecret
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
}
}
Set
<
Integer
>
secretTypeList
=
listSecret
.
stream
().
filter
(
secretSettingDTO
->
secretSettingDTO
.
getCheckFlag
()
==
1
).
map
(
secretSettingDTO
->
secretSettingDTO
.
getSecretType
()).
collect
(
Collectors
.
toSet
());
Set
<
Integer
>
secretTypeList
=
listSecret
.
stream
().
filter
(
secretSettingDTO
->
secretSettingDTO
.
getCheckFlag
()
==
1
).
map
(
secretSettingDTO
->
secretSettingDTO
.
getSecretType
()).
collect
(
Collectors
.
toSet
());
if
(
CollectionUtils
.
isEmpty
(
secretTypeList
))
{
if
(
CollectionUtils
.
isEmpty
(
secretTypeList
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
}
}
// 如果是第三方校验待开发
// 如果是第三方校验待开发
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
)
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
)
;
if
(
qwDTO
.
isSelf
())
{
if
(
qwDTO
.
isSelf
())
{
if
((
secretTypeList
.
contains
(
SecretTypeEnum
.
SELF_APP
.
getVal
())))
{
if
((
secretTypeList
.
contains
(
SecretTypeEnum
.
SELF_APP
.
getVal
())))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
}
}
}
else
{
}
else
{
if
((
secretTypeList
.
contains
(
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
())))
{
if
((
secretTypeList
.
contains
(
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
())))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
}
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
}
}
/**
/**
* 微信企业绑定接口绑定通讯录key
* 微信企业绑定接口绑定通讯录key
*
*
* @param wxSecretKey
* @param wxSecretKey
* @return
* @return
*/
*/
@RequestMapping
(
"wx-enterprise-wx-secret-set"
)
@RequestMapping
(
"wx-enterprise-wx-secret-set"
)
public
HaobanResponse
wxEnterpriseWxSecretSet
(
String
wxSecretKey
)
{
public
HaobanResponse
wxEnterpriseWxSecretSet
(
String
wxSecretKey
)
{
if
(
StringUtils
.
isAnyBlank
(
wxSecretKey
))
{
if
(
StringUtils
.
isAnyBlank
(
wxSecretKey
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
)
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
)
;
if
(
qwDTO
==
null
)
{
if
(
qwDTO
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
}
wxSecretKey
=
wxSecretKey
.
trim
();
wxSecretKey
=
wxSecretKey
.
trim
();
String
token
=
this
.
qywxCorpApiService
.
getToken
(
qwDTO
.
getDkCorpid
(),
wxSecretKey
);
String
token
=
this
.
qywxCorpApiService
.
getToken
(
qwDTO
.
getDkCorpid
(),
wxSecretKey
);
logger
.
info
(
"查询token={}"
,
token
)
;
logger
.
info
(
"查询token={}"
,
token
)
;
if
(
StringUtils
.
isEmpty
(
token
)
||
token
.
length
()
<
10
)
{
if
(
StringUtils
.
isEmpty
(
token
)
||
token
.
length
()
<
10
)
{
return
this
.
fail
(
"请确认secret是否正确"
)
;
return
this
.
fail
(
"请确认secret是否正确"
)
;
}
}
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
SELF_APP
.
getVal
(),
null
);
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
SELF_APP
.
getVal
(),
null
);
if
(
null
==
secretSetting
)
{
if
(
null
==
secretSetting
)
{
secretSetting
=
new
SecretSettingDTO
();
secretSetting
=
new
SecretSettingDTO
();
}
}
secretSetting
.
setSecretType
(
SecretTypeEnum
.
SELF_APP
.
getVal
());
secretSetting
.
setSecretType
(
SecretTypeEnum
.
SELF_APP
.
getVal
());
secretSetting
.
setSecretName
(
SecretTypeEnum
.
SELF_APP
.
getName
());
secretSetting
.
setSecretName
(
SecretTypeEnum
.
SELF_APP
.
getName
());
secretSetting
.
setWxEnterpriseId
(
wxEnterpriseId
);
secretSetting
.
setWxEnterpriseId
(
wxEnterpriseId
);
secretSetting
.
setEnterpriseId
(
"-1"
);
secretSetting
.
setEnterpriseId
(
"-1"
);
secretSetting
.
setSecretVal
(
wxSecretKey
);
secretSetting
.
setSecretVal
(
wxSecretKey
);
secretSetting
.
setCheckFlag
(
1
);
secretSetting
.
setCheckFlag
(
1
);
wxEnterpriseApiService
.
saveSecretSetting
(
secretSetting
);
wxEnterpriseApiService
.
saveSecretSetting
(
secretSetting
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
}
}
/**
/**
* 微信企业会员小程序
* 微信企业会员小程序
*
*
* @param memberSecret
* @param memberSecret
* @param enterpriseId
* @param enterpriseId
* @param secretName
* @param secretName
* @return
* @return
*/
*/
@RequestMapping
(
"wx-enterprise-member-secret-set"
)
@RequestMapping
(
"wx-enterprise-member-secret-set"
)
public
HaobanResponse
wxEnterpriseMemberSecretSet
(
String
secretId
,
String
memberSecret
,
String
enterpriseId
,
String
secretName
)
{
public
HaobanResponse
wxEnterpriseMemberSecretSet
(
String
secretId
,
String
memberSecret
,
String
enterpriseId
,
String
secretName
)
{
if
(
StringUtils
.
isAnyBlank
(
memberSecret
,
enterpriseId
))
{
if
(
StringUtils
.
isAnyBlank
(
memberSecret
,
enterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterprise
==
null
)
{
if
(
wxEnterprise
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
}
memberSecret
=
memberSecret
.
trim
();
memberSecret
=
memberSecret
.
trim
();
SecretSettingDTO
secretSetting
=
null
;
SecretSettingDTO
secretSetting
=
null
;
if
(
StringUtils
.
isNotBlank
(
secretId
))
{
if
(
StringUtils
.
isNotBlank
(
secretId
))
{
secretSetting
=
wxEnterpriseApiService
.
getSecretSettingById
(
secretId
);
secretSetting
=
wxEnterpriseApiService
.
getSecretSettingById
(
secretId
);
}
}
if
(
null
==
secretSetting
)
{
if
(
null
==
secretSetting
)
{
secretSetting
=
new
SecretSettingDTO
();
secretSetting
=
new
SecretSettingDTO
();
}
}
List
<
SecretSettingDTO
>
enList
=
this
.
secretSettingApiService
.
exsitGicEidMemberApp
(
wxEnterpriseId
)
;
List
<
SecretSettingDTO
>
enList
=
this
.
secretSettingApiService
.
exsitGicEidMemberApp
(
wxEnterpriseId
)
;
if
(
CollectionUtils
.
isNotEmpty
(
enList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
enList
))
{
Map
<
String
,
SecretSettingDTO
>
map
=
enList
.
stream
().
collect
(
Collectors
.
toMap
(
SecretSettingDTO:
:
getEnterpriseId
,
dto
->
dto
,(
k1
,
k2
)->
k1
));
Map
<
String
,
SecretSettingDTO
>
map
=
enList
.
stream
().
collect
(
Collectors
.
toMap
(
SecretSettingDTO:
:
getEnterpriseId
,
dto
->
dto
,(
k1
,
k2
)->
k1
));
if
(
StringUtils
.
isEmpty
(
secretId
))
{
if
(
StringUtils
.
isEmpty
(
secretId
))
{
if
(
null
!=
map
.
get
(
enterpriseId
))
{
if
(
null
!=
map
.
get
(
enterpriseId
))
{
return
this
.
fail
(
"此商户小程序已存在"
)
;
return
this
.
fail
(
"此商户小程序已存在"
)
;
}
}
}
else
{
}
else
{
if
(
null
!=
map
.
get
(
enterpriseId
)
&&
!
secretId
.
equals
(
map
.
get
(
enterpriseId
).
getSecretId
()))
{
if
(
null
!=
map
.
get
(
enterpriseId
)
&&
!
secretId
.
equals
(
map
.
get
(
enterpriseId
).
getSecretId
()))
{
return
this
.
fail
(
"此商户小程序已存在"
)
;
return
this
.
fail
(
"此商户小程序已存在"
)
;
}
}
}
}
}
}
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
)
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
)
;
String
token
=
this
.
qywxCorpApiService
.
getToken
(
qwDTO
.
getMemberCorpid
(),
memberSecret
);
String
token
=
this
.
qywxCorpApiService
.
getToken
(
qwDTO
.
getMemberCorpid
(),
memberSecret
);
logger
.
info
(
"查询token"
,
token
)
;
logger
.
info
(
"查询token"
,
token
)
;
if
(
StringUtils
.
isEmpty
(
token
)
||
token
.
length
()
<
10
)
{
if
(
StringUtils
.
isEmpty
(
token
)
||
token
.
length
()
<
10
)
{
return
this
.
fail
(
"请确认secret是否正确"
)
;
return
this
.
fail
(
"请确认secret是否正确"
)
;
}
}
secretSetting
.
setSecretType
(
SecretTypeEnum
.
MEMBER_WAPP
.
getVal
());
secretSetting
.
setSecretType
(
SecretTypeEnum
.
MEMBER_WAPP
.
getVal
());
secretSetting
.
setSecretName
(
secretName
);
secretSetting
.
setSecretName
(
secretName
);
secretSetting
.
setEnterpriseId
(
enterpriseId
);
secretSetting
.
setEnterpriseId
(
enterpriseId
);
secretSetting
.
setWxEnterpriseId
(
wxEnterpriseId
);
secretSetting
.
setWxEnterpriseId
(
wxEnterpriseId
);
secretSetting
.
setSecretVal
(
memberSecret
);
secretSetting
.
setSecretVal
(
memberSecret
);
secretSetting
.
setCheckFlag
(
1
);
secretSetting
.
setCheckFlag
(
1
);
wxEnterpriseApiService
.
saveSecretSetting
(
secretSetting
);
wxEnterpriseApiService
.
saveSecretSetting
(
secretSetting
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
}
}
/**
/**
* 企微相关密钥列表
* 企微相关密钥列表
*
*
* @return
* @return
*/
*/
@RequestMapping
(
"secret-list"
)
@RequestMapping
(
"secret-list"
)
public
HaobanResponse
secretList
()
{
public
HaobanResponse
secretList
()
{
String
wxEnterpriseId
=
""
;
String
wxEnterpriseId
=
""
;
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterprise
==
null
)
{
if
(
wxEnterprise
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
}
List
<
SecretSettingDTO
>
listSecret
=
wxEnterpriseApiService
.
listSecret
(
wxEnterpriseId
);
List
<
SecretSettingDTO
>
listSecret
=
wxEnterpriseApiService
.
listSecret
(
wxEnterpriseId
);
List
<
SecretSettingVO
>
listRet
=
EntityUtil
.
changeEntityListByJSON
(
SecretSettingVO
.
class
,
listSecret
);
List
<
SecretSettingVO
>
listRet
=
EntityUtil
.
changeEntityListByJSON
(
SecretSettingVO
.
class
,
listSecret
);
if
(
CollectionUtils
.
isNotEmpty
(
listRet
))
{
if
(
CollectionUtils
.
isNotEmpty
(
listRet
))
{
listRet
.
forEach
(
secretSettingVO
->
{
listRet
.
forEach
(
secretSettingVO
->
{
if
((!
StringUtils
.
isEmpty
(
secretSettingVO
.
getEnterpriseId
()))
&&
(!
secretSettingVO
.
getEnterpriseId
().
equals
(
"-1"
)))
{
if
((!
StringUtils
.
isEmpty
(
secretSettingVO
.
getEnterpriseId
()))
&&
(!
secretSettingVO
.
getEnterpriseId
().
equals
(
"-1"
)))
{
EnterpriseDTO
enterpriseDTO
=
enterpriseService
.
getEnterpriseById
(
secretSettingVO
.
getEnterpriseId
());
EnterpriseDTO
enterpriseDTO
=
enterpriseService
.
getEnterpriseById
(
secretSettingVO
.
getEnterpriseId
());
secretSettingVO
.
setEnterpriseName
(
enterpriseDTO
==
null
?
""
:
enterpriseDTO
.
getBrandName
());
secretSettingVO
.
setEnterpriseName
(
enterpriseDTO
==
null
?
""
:
enterpriseDTO
.
getBrandName
());
}
}
});
});
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
listRet
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
listRet
);
}
}
//微信企业会员小程序
//微信企业会员小程序
@RequestMapping
(
"member-secret-del"
)
@RequestMapping
(
"member-secret-del"
)
public
HaobanResponse
delMemberSecret
(
String
secretId
)
{
public
HaobanResponse
delMemberSecret
(
String
secretId
)
{
if
(
StringUtils
.
isAnyBlank
(
secretId
))
{
if
(
StringUtils
.
isAnyBlank
(
secretId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
boolean
b
=
wxEnterpriseApiService
.
delSecretSetting
(
secretId
);
boolean
b
=
wxEnterpriseApiService
.
delSecretSetting
(
secretId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
b
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
b
);
}
}
/**
/**
* 刷新企业微信好友
* 刷新企业微信好友
*
*
* @return
* @return
*/
*/
@RequestMapping
(
"/fresh-wx-friend"
)
@RequestMapping
(
"/fresh-wx-friend"
)
public
HaobanResponse
freshWxFriend
()
{
public
HaobanResponse
freshWxFriend
()
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
dayKey
=
"haoban_fresh-wx-friend-day"
+
wxEnterpriseId
+
DateUtil
.
dateToStr
(
new
Date
(),
"yyyy-MM-dd"
);
String
dayKey
=
"haoban_fresh-wx-friend-day"
+
wxEnterpriseId
+
DateUtil
.
dateToStr
(
new
Date
(),
"yyyy-MM-dd"
);
String
monthKey
=
"haoban_fresh-wx-friend-month"
+
wxEnterpriseId
+
DateUtil
.
dateToStr
(
new
Date
(),
"yyyy-MM"
);
String
monthKey
=
"haoban_fresh-wx-friend-month"
+
wxEnterpriseId
+
DateUtil
.
dateToStr
(
new
Date
(),
"yyyy-MM"
);
String
dateKey
=
"haoban_fresh-wx-friend-date"
+
wxEnterpriseId
;
String
dateKey
=
"haoban_fresh-wx-friend-date"
+
wxEnterpriseId
;
Integer
dayCount
=
RedisUtil
.
getCache
(
dayKey
)
==
null
?
0
:
Integer
.
parseInt
(
RedisUtil
.
getCache
(
dayKey
).
toString
());
Integer
dayCount
=
RedisUtil
.
getCache
(
dayKey
)
==
null
?
0
:
Integer
.
parseInt
(
RedisUtil
.
getCache
(
dayKey
).
toString
());
Integer
monthCount
=
RedisUtil
.
getCache
(
monthKey
)
==
null
?
0
:
Integer
.
parseInt
(
RedisUtil
.
getCache
(
monthKey
).
toString
());
Integer
monthCount
=
RedisUtil
.
getCache
(
monthKey
)
==
null
?
0
:
Integer
.
parseInt
(
RedisUtil
.
getCache
(
monthKey
).
toString
());
if
(
dayCount
>=
1
)
{
if
(
dayCount
>=
1
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_100019
);
return
resultResponse
(
HaoBanErrCode
.
ERR_100019
);
}
}
if
(
monthCount
>=
3
)
{
if
(
monthCount
>=
3
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_100020
);
return
resultResponse
(
HaoBanErrCode
.
ERR_100020
);
}
}
String
taskId
=
dealSyncOperationApiService
.
createWxFriendTask
(
wxEnterpriseId
,
"刷新企微好友"
,
login
.
getClerkId
(),
"刷新企微好友"
);
String
taskId
=
dealSyncOperationApiService
.
createWxFriendTask
(
wxEnterpriseId
,
"刷新企微好友"
,
login
.
getClerkId
(),
"刷新企微好友"
);
if
(
StringUtils
.
isEmpty
(
taskId
))
{
if
(
StringUtils
.
isEmpty
(
taskId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_100021
);
return
resultResponse
(
HaoBanErrCode
.
ERR_100021
);
}
}
RedisUtil
.
setCache
(
dayKey
,
dayCount
+
1
);
RedisUtil
.
setCache
(
dayKey
,
dayCount
+
1
);
RedisUtil
.
setCache
(
monthKey
,
monthCount
+
1
);
RedisUtil
.
setCache
(
monthKey
,
monthCount
+
1
);
RedisUtil
.
setCache
(
dateKey
,
DateUtil
.
dateToStr
(
new
Date
(),
DateUtil
.
FORMAT_DATETIME_19
));
RedisUtil
.
setCache
(
dateKey
,
DateUtil
.
dateToStr
(
new
Date
(),
DateUtil
.
FORMAT_DATETIME_19
));
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
/**
/**
* 获取企业微信好友刷新时间
* 获取企业微信好友刷新时间
*
*
* @return
* @return
*/
*/
@RequestMapping
(
"/get-fresh-detail"
)
@RequestMapping
(
"/get-fresh-detail"
)
public
HaobanResponse
getFreshDetail
()
{
public
HaobanResponse
getFreshDetail
()
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
dateKey
=
"haoban_fresh-wx-friend-date"
+
wxEnterpriseId
;
String
dateKey
=
"haoban_fresh-wx-friend-date"
+
wxEnterpriseId
;
RedisUtil
.
getCache
(
dateKey
);
RedisUtil
.
getCache
(
dateKey
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
RedisUtil
.
getCache
(
dateKey
));
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
RedisUtil
.
getCache
(
dateKey
));
}
}
/**
/**
* 微信企业绑定详情
* 微信企业绑定详情
*
*
* @param enterpriseId
* @param enterpriseId
* @return
* @return
*/
*/
@RequestMapping
(
"wx-enterprise-bind-detail"
)
@RequestMapping
(
"wx-enterprise-bind-detail"
)
public
HaobanResponse
wxEnterpriseBindDetail
(
String
enterpriseId
)
{
public
HaobanResponse
wxEnterpriseBindDetail
(
String
enterpriseId
)
{
if
(
StringUtils
.
isAnyBlank
(
enterpriseId
))
{
if
(
StringUtils
.
isAnyBlank
(
enterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseRelationDetailDTO
bindInfo
=
wxEnterpriseRelatedApiService
.
getEnterpriseBindInfo
(
wxEnterpriseId
,
enterpriseId
);
WxEnterpriseRelationDetailDTO
bindInfo
=
wxEnterpriseRelatedApiService
.
getEnterpriseBindInfo
(
wxEnterpriseId
,
enterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
bindInfo
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
bindInfo
);
}
}
/**
/**
* 绑定门店列表
* 绑定门店列表
*
*
* @param enterpriseId
* @param enterpriseId
* @return
* @return
*/
*/
@RequestMapping
(
"bind-store-list"
)
@RequestMapping
(
"bind-store-list"
)
public
HaobanResponse
bindStoreList
(
String
enterpriseId
,
String
search
,
BasePageInfo
basePageInfo
)
{
public
HaobanResponse
bindStoreList
(
String
enterpriseId
,
String
search
,
BasePageInfo
basePageInfo
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
Page
<
BindStoreInfoDTO
>
retPage
=
wxEnterpriseRelatedApiService
.
pageBindStoreByEnterpriseId
(
wxEnterpriseId
,
enterpriseId
,
search
,
basePageInfo
);
Page
<
BindStoreInfoDTO
>
retPage
=
wxEnterpriseRelatedApiService
.
pageBindStoreByEnterpriseId
(
wxEnterpriseId
,
enterpriseId
,
search
,
basePageInfo
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retPage
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retPage
);
}
}
/**
/**
* 绑定门店列表
* 绑定门店列表
*
*
* @param enterpriseId
* @param enterpriseId
* @return
* @return
*/
*/
@RequestMapping
(
"flush-bind-store-list"
)
@RequestMapping
(
"flush-bind-store-list"
)
public
HaobanResponse
flushBindStoreList
(
String
enterpriseId
)
{
public
HaobanResponse
flushBindStoreList
(
String
enterpriseId
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
ServiceResponse
response
=
wxEnterpriseRelatedApiService
.
flushBindStoreByEnterpriseId
(
enterpriseId
,
wxEnterpriseId
,
login
.
getClerkId
(),
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
ServiceResponse
response
=
wxEnterpriseRelatedApiService
.
flushBindStoreByEnterpriseId
(
enterpriseId
,
wxEnterpriseId
,
login
.
getClerkId
(),
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
logger
.
info
(
"返回信息:{}"
,
JSONObject
.
toJSONString
(
response
));
logger
.
info
(
"返回信息:{}"
,
JSONObject
.
toJSONString
(
response
));
if
(
response
.
getCode
()
!=
1
)
{
if
(
response
.
getCode
()
!=
1
)
{
HaoBanErrCode
.
ERR_DEFINE
.
setMsg
(
response
.
getMessage
());
HaoBanErrCode
.
ERR_DEFINE
.
setMsg
(
response
.
getMessage
());
return
resultResponse
(
HaoBanErrCode
.
ERR_DEFINE
);
return
resultResponse
(
HaoBanErrCode
.
ERR_DEFINE
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
/**
/**
* 绑定小程序配置列表
* 绑定小程序配置列表
*
*
* @return
* @return
*/
*/
@RequestMapping
(
"list-miniprogram-setting"
)
@RequestMapping
(
"list-miniprogram-setting"
)
public
HaobanResponse
miniprogramList
()
{
public
HaobanResponse
miniprogramList
()
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
MiniprogramSettingDTO
>
settingDTOS
=
wxEnterpriseApiService
.
listMiniprogramSetting
(
wxEnterpriseId
);
List
<
MiniprogramSettingDTO
>
settingDTOS
=
wxEnterpriseApiService
.
listMiniprogramSetting
(
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
settingDTOS
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
settingDTOS
);
}
}
/**
/**
* 保存小程序配置列表
* 保存小程序配置列表
*
*
* @return
* @return
*/
*/
@RequestMapping
(
"save-miniprogram-setting"
)
@RequestMapping
(
"save-miniprogram-setting"
)
public
HaobanResponse
saveMiniprogram
(
MiniprogramSettingQo
settingDTO
)
{
public
HaobanResponse
saveMiniprogram
(
MiniprogramSettingQo
settingDTO
)
{
if
(
StringUtils
.
isAnyBlank
(
settingDTO
.
getAppId
(),
if
(
StringUtils
.
isAnyBlank
(
settingDTO
.
getAppId
(),
settingDTO
.
getImageUrl
(),
settingDTO
.
getMiniprogramName
(),
settingDTO
.
getTitle
()))
{
settingDTO
.
getImageUrl
(),
settingDTO
.
getMiniprogramName
(),
settingDTO
.
getTitle
()))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
settingDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
settingDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
settingDTO
.
setEnterpriseId
(
login
.
getEnterpriseId
());
settingDTO
.
setEnterpriseId
(
login
.
getEnterpriseId
());
MiniprogramSettingDTO
miniprogramSettingDTO
=
wxEnterpriseApiService
.
getMiniprogramSettingByAppId
(
wxEnterpriseId
,
settingDTO
.
getAppId
());
MiniprogramSettingDTO
miniprogramSettingDTO
=
wxEnterpriseApiService
.
getMiniprogramSettingByAppId
(
wxEnterpriseId
,
settingDTO
.
getAppId
());
if
(
null
!=
miniprogramSettingDTO
if
(
null
!=
miniprogramSettingDTO
&&
(!
miniprogramSettingDTO
.
getMiniprogramSettingId
().
equals
(
settingDTO
.
getMiniprogramSettingId
())))
{
&&
(!
miniprogramSettingDTO
.
getMiniprogramSettingId
().
equals
(
settingDTO
.
getMiniprogramSettingId
())))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_100031
);
return
resultResponse
(
HaoBanErrCode
.
ERR_100031
);
}
}
wxEnterpriseApiService
.
saveMiniprogramSetting
(
EntityUtil
.
changeEntityByOrika
(
MiniprogramSettingDTO
.
class
,
settingDTO
));
wxEnterpriseApiService
.
saveMiniprogramSetting
(
EntityUtil
.
changeEntityByOrika
(
MiniprogramSettingDTO
.
class
,
settingDTO
));
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
/**
/**
* 获取小程序配置
* 获取小程序配置
*
*
* @return
* @return
*/
*/
@RequestMapping
(
"get-miniprogram-setting"
)
@RequestMapping
(
"get-miniprogram-setting"
)
public
HaobanResponse
getMiniprogram
(
String
enterpriseId
)
{
public
HaobanResponse
getMiniprogram
(
String
enterpriseId
)
{
if
(
StringUtils
.
isEmpty
(
enterpriseId
))
{
if
(
StringUtils
.
isEmpty
(
enterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
MiniprogramSettingDTO
settingDTO
=
wxEnterpriseApiService
.
getMiniprogramSettingByEid
(
wxEnterpriseId
,
enterpriseId
);
MiniprogramSettingDTO
settingDTO
=
wxEnterpriseApiService
.
getMiniprogramSettingByEid
(
wxEnterpriseId
,
enterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
settingDTO
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
settingDTO
);
}
}
/**
/**
* 删除小程序配置
* 删除小程序配置
*
*
* @return
* @return
*/
*/
@RequestMapping
(
"del-miniprogram-setting"
)
@RequestMapping
(
"del-miniprogram-setting"
)
public
HaobanResponse
delMiniprogram
(
String
id
)
{
public
HaobanResponse
delMiniprogram
(
String
id
)
{
if
(
StringUtils
.
isEmpty
(
id
))
{
if
(
StringUtils
.
isEmpty
(
id
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
wxEnterpriseApiService
.
delMiniprogramSettingByEid
(
id
);
wxEnterpriseApiService
.
delMiniprogramSettingByEid
(
id
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
/**
/**
* 分析素材
* 分析素材
*
*
* @return
* @return
*/
*/
@RequestMapping
(
"/agent-wx-enterprise-list"
)
@RequestMapping
(
"/agent-wx-enterprise-list"
)
public
HaobanResponse
materialShare
(
String
materialId
)
{
public
HaobanResponse
materialShare
(
String
materialId
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
List
<
EnterpriseDetailDTO
>
detailDTOS
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
EnterpriseDetailDTO
>
detailDTOS
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
String
>
enterpriseIds
=
detailDTOS
.
stream
().
filter
(
dto
->
dto
.
getWxEnterpriseType
()
==
0
).
map
(
dto
->
dto
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
enterpriseIds
=
detailDTOS
.
stream
().
filter
(
dto
->
dto
.
getWxEnterpriseType
()
==
0
).
map
(
dto
->
dto
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
EnterpriseDetailDTO
>
retList
=
wxEnterpriseRelatedApiService
.
listEnterpriseByEnterpriseIds
(
enterpriseIds
);
List
<
EnterpriseDetailDTO
>
retList
=
wxEnterpriseRelatedApiService
.
listEnterpriseByEnterpriseIds
(
enterpriseIds
);
Map
<
String
,
EnterpriseDetailDTO
>
detailDTOMap
=
retList
.
stream
().
filter
(
dto
->
dto
.
getWxEnterpriseType
()
==
1
).
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getWxEnterpriseId
(),
dto
->
dto
,
(
ne
,
ol
)
->
ol
));
Map
<
String
,
EnterpriseDetailDTO
>
detailDTOMap
=
retList
.
stream
().
filter
(
dto
->
dto
.
getWxEnterpriseType
()
==
1
).
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getWxEnterpriseId
(),
dto
->
dto
,
(
ne
,
ol
)
->
ol
));
Collection
<
EnterpriseDetailDTO
>
values
=
detailDTOMap
.
values
();
Collection
<
EnterpriseDetailDTO
>
values
=
detailDTOMap
.
values
();
List
<
AgentEnterpriseDTO
>
enterpriseList
=
EntityUtil
.
changeEntityListByOrika
(
AgentEnterpriseDTO
.
class
,
values
);
List
<
AgentEnterpriseDTO
>
enterpriseList
=
EntityUtil
.
changeEntityListByOrika
(
AgentEnterpriseDTO
.
class
,
values
);
if
(
CollectionUtils
.
isNotEmpty
(
values
))
{
if
(
CollectionUtils
.
isNotEmpty
(
values
))
{
List
<
MaterialDTO
>
materialDTOS
=
materialApiService
.
listByFromMaterialId
(
materialId
);
List
<
MaterialDTO
>
materialDTOS
=
materialApiService
.
listByFromMaterialId
(
materialId
);
List
<
String
>
wxEids
=
new
ArrayList
<>();
List
<
String
>
wxEids
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
materialDTOS
))
{
if
(
CollectionUtils
.
isNotEmpty
(
materialDTOS
))
{
wxEids
=
materialDTOS
.
stream
().
map
(
dto
->
dto
.
getWxEnterpriseId
()).
collect
(
Collectors
.
toList
());
wxEids
=
materialDTOS
.
stream
().
map
(
dto
->
dto
.
getWxEnterpriseId
()).
collect
(
Collectors
.
toList
());
}
}
List
<
String
>
finalWxEids
=
wxEids
;
List
<
String
>
finalWxEids
=
wxEids
;
for
(
AgentEnterpriseDTO
dto
:
enterpriseList
)
{
for
(
AgentEnterpriseDTO
dto
:
enterpriseList
)
{
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
dto
.
getWxEnterpriseId
());
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
dto
.
getWxEnterpriseId
());
if
(
null
==
wxEnterpriseDTO
)
{
if
(
null
==
wxEnterpriseDTO
)
{
continue
;
continue
;
}
}
logger
.
info
(
"wxEnterpriseDTO={},dto={}"
,
JSON
.
toJSONString
(
wxEnterpriseDTO
),
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"wxEnterpriseDTO={},dto={}"
,
JSON
.
toJSONString
(
wxEnterpriseDTO
),
JSON
.
toJSONString
(
dto
));
dto
.
setEnterpriseName
(
wxEnterpriseDTO
.
getCorpName
());
dto
.
setEnterpriseName
(
wxEnterpriseDTO
.
getCorpName
());
if
(
finalWxEids
.
contains
(
dto
.
getWxEnterpriseId
()))
{
if
(
finalWxEids
.
contains
(
dto
.
getWxEnterpriseId
()))
{
dto
.
setBindFlag
(
1
);
dto
.
setBindFlag
(
1
);
}
else
{
}
else
{
dto
.
setBindFlag
(
0
);
dto
.
setBindFlag
(
0
);
}
}
}
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
enterpriseList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
enterpriseList
);
}
}
/**
/**
* 删除欢迎语
* 删除欢迎语
*
*
* @return
* @return
*/
*/
@RequestMapping
(
"del-welcome"
)
@RequestMapping
(
"del-welcome"
)
public
HaobanResponse
delWelcome
()
{
public
HaobanResponse
delWelcome
()
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
wxEnterpriseApiService
.
delWelcome
(
wxEnterpriseId
);
wxEnterpriseApiService
.
delWelcome
(
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
/**
/**
* 欢迎语开启关闭
* 欢迎语开启关闭
*
*
* @return
* @return
*/
*/
@RequestMapping
(
"set-welcome"
)
@RequestMapping
(
"set-welcome"
)
public
HaobanResponse
setWelcome
(
int
openFlag
)
{
public
HaobanResponse
setWelcome
(
int
openFlag
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
wxEnterpriseApiService
.
setWelcome
(
wxEnterpriseId
,
openFlag
);
wxEnterpriseApiService
.
setWelcome
(
wxEnterpriseId
,
openFlag
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
/**
/**
* 授权绑定-设置导购编辑权限
* 授权绑定-设置导购编辑权限
*
*
* @return
* @return
*/
*/
@IgnoreLogin
@IgnoreLogin
@RequestMapping
(
"set-clerk-edit"
)
@RequestMapping
(
"set-clerk-edit"
)
public
HaobanResponse
setClerkEdit
(
String
wxEnterprieseRelatedId
,
int
clerkEditFlag
)
{
public
HaobanResponse
setClerkEdit
(
String
wxEnterprieseRelatedId
,
int
clerkEditFlag
)
{
if
(
StringUtils
.
isBlank
(
wxEnterprieseRelatedId
))
{
if
(
StringUtils
.
isBlank
(
wxEnterprieseRelatedId
))
{
logger
.
info
(
"缺少参数"
);
logger
.
info
(
"缺少参数"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
boolean
b
=
wxEnterpriseRelatedApiService
.
setClerkEditFlag
(
wxEnterprieseRelatedId
,
clerkEditFlag
);
boolean
b
=
wxEnterpriseRelatedApiService
.
setClerkEditFlag
(
wxEnterprieseRelatedId
,
clerkEditFlag
);
if
(
b
)
{
if
(
b
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
else
{
}
else
{
return
resultResponse
(
HaoBanErrCode
.
ERR_100032
);
return
resultResponse
(
HaoBanErrCode
.
ERR_100032
);
}
}
}
}
/**
/**
* 是否同意授权
* 是否同意授权
*
*
* @param openFlag
* @param openFlag
* @return
* @return
*/
*/
@RequestMapping
(
"agree_external_userid_flag"
)
@RequestMapping
(
"agree_external_userid_flag"
)
public
HaobanResponse
agreeExternalUseridFlag
(
Integer
openFlag
)
{
public
HaobanResponse
agreeExternalUseridFlag
(
Integer
openFlag
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
wxEnterpriseApiService
.
agreeExternalUseridFlag
(
wxEnterpriseId
,
openFlag
);
wxEnterpriseApiService
.
agreeExternalUseridFlag
(
wxEnterpriseId
,
openFlag
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
@RequestMapping
(
path
=
"/current/enterprise/info"
)
@RequestMapping
(
path
=
"/current/enterprise/info"
)
public
RestResponse
<?>
queryCurrentInfo
(){
public
RestResponse
<?>
queryCurrentInfo
(){
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
EnterpriseDetailDTO
>
serviceResponse
=
wxEnterpriseRelatedApiService
.
queryEnterpriseDetail
(
loginUser
.
getWxEnterpriseId
(),
loginUser
.
getEnterpriseId
());
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
EnterpriseDetailDTO
>
serviceResponse
=
wxEnterpriseRelatedApiService
.
queryEnterpriseDetail
(
loginUser
.
getWxEnterpriseId
(),
loginUser
.
getEnterpriseId
());
if
(
serviceResponse
.
isSuccess
()){
if
(
serviceResponse
.
isSuccess
()){
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
}
}
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
}
/**
/**
* 最新一条将要被拦截记录
* 最新一条将要被拦截记录
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"qywx-fee-wxEnterprise-detail"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"qywx-fee-wxEnterprise-detail"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
qywxFeeWxEnterpriseListDetail
()
{
public
RestResponse
qywxFeeWxEnterpriseListDetail
()
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
HaobanQywxFeeDTO
haobanQywxFeeDTO
=
haobanQywxFeeApiService
.
queryByWxEnterpriseId
(
wxEnterpriseId
);
HaobanQywxFeeDTO
haobanQywxFeeDTO
=
haobanQywxFeeApiService
.
queryByWxEnterpriseId
(
wxEnterpriseId
);
if
(
haobanQywxFeeDTO
==
null
)
{
if
(
haobanQywxFeeDTO
==
null
)
{
return
RestResponse
.
successResult
();
return
RestResponse
.
successResult
();
}
}
List
<
EnterpriseDetailDTO
>
enterpriseDetailDTOS
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
EnterpriseDetailDTO
>
enterpriseDetailDTOS
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
enterpriseDetailDTOS
))
{
if
(
CollectionUtils
.
isNotEmpty
(
enterpriseDetailDTOS
))
{
StringBuffer
stringBuffer
=
new
StringBuffer
();
StringBuffer
stringBuffer
=
new
StringBuffer
();
for
(
EnterpriseDetailDTO
enterpriseDetailDTO
:
enterpriseDetailDTOS
)
{
for
(
EnterpriseDetailDTO
enterpriseDetailDTO
:
enterpriseDetailDTOS
)
{
stringBuffer
.
append
(
enterpriseDetailDTO
.
getEnterpriseName
()).
append
(
" "
);
stringBuffer
.
append
(
enterpriseDetailDTO
.
getEnterpriseName
()).
append
(
" "
);
}
}
haobanQywxFeeDTO
.
setEnterpriseNames
(
stringBuffer
.
toString
());
haobanQywxFeeDTO
.
setEnterpriseNames
(
stringBuffer
.
toString
());
}
}
return
RestResponse
.
successResult
(
haobanQywxFeeDTO
);
return
RestResponse
.
successResult
(
haobanQywxFeeDTO
);
}
}
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/order/GicOrderController.java
View file @
e28e43a0
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
order
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
order
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.business.order.dto.member.MemberStoreInfoDTO
;
import
com.gic.business.order.dto.member.MemberStoreInfoDTO
;
import
com.gic.business.order.dto.ordermanage.ListOrderDTO
;
import
com.gic.business.order.dto.ordermanage.ListOrderDTO
;
import
com.gic.business.order.dto.ordermanage.ListOrderItemDTO
;
import
com.gic.business.order.dto.ordermanage.ListOrderItemDTO
;
import
com.gic.business.order.dto.ordermanage.OrderDetailDTO
;
import
com.gic.business.order.dto.ordermanage.OrderDetailDTO
;
import
com.gic.business.order.dto.ordermanage.OrderInfoDTO
;
import
com.gic.business.order.dto.ordermanage.OrderInfoDTO
;
import
com.gic.business.order.dto.ordermanage.OrderNodeDTO
;
import
com.gic.business.order.dto.ordermanage.OrderNodeDTO
;
import
com.gic.business.order.dto.ordermanage.OrderStatusDTO
;
import
com.gic.business.order.dto.ordermanage.OrderStatusDTO
;
import
com.gic.business.order.dto.setting.MallOrderSettingDTO
;
import
com.gic.business.order.dto.setting.MallOrderSettingDTO
;
import
com.gic.business.order.enums.OrderEnum
;
import
com.gic.business.order.enums.OrderEnum
;
import
com.gic.business.order.enums.OrderEnum.DeliveryOptTypeEnum
;
import
com.gic.business.order.enums.OrderEnum.DeliveryOptTypeEnum
;
import
com.gic.business.order.enums.OrderEnum.SearchOrderTypeEnum
;
import
com.gic.business.order.enums.OrderEnum.SearchOrderTypeEnum
;
import
com.gic.business.order.qdto.ordermanage.CountOrderStatusQDTO
;
import
com.gic.business.order.qdto.ordermanage.CountOrderStatusQDTO
;
import
com.gic.business.order.qdto.ordermanage.ListOrderManageQDTO
;
import
com.gic.business.order.qdto.ordermanage.ListOrderManageQDTO
;
import
com.gic.business.order.qdto.ordermanage.OrderItemShipmentQDTO
;
import
com.gic.business.order.qdto.ordermanage.OrderItemShipmentQDTO
;
import
com.gic.business.order.qdto.ordermanage.OrderShipmentQDTO
;
import
com.gic.business.order.qdto.ordermanage.OrderShipmentQDTO
;
import
com.gic.business.order.qdto.ordermanage.QueryOrderDetailQDTO
;
import
com.gic.business.order.qdto.ordermanage.QueryOrderDetailQDTO
;
import
com.gic.business.order.qdto.ordermanage.SelfPickOffQDTO
;
import
com.gic.business.order.qdto.ordermanage.SelfPickOffQDTO
;
import
com.gic.business.order.qdto.ordermanage.UpdateOrderLogisticsQDTO
;
import
com.gic.business.order.qdto.ordermanage.UpdateOrderLogisticsQDTO
;
import
com.gic.business.order.service.activity.MemberReferClerkApiService
;
import
com.gic.business.order.service.activity.MemberReferClerkApiService
;
import
com.gic.business.order.service.ordermanage.WebOrderManageApiService
;
import
com.gic.business.order.service.ordermanage.WebOrderManageApiService
;
import
com.gic.business.order.service.setting.OrderSettingApiService
;
import
com.gic.business.order.service.setting.OrderSettingApiService
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.evaluate.manage.api.dto.EvaluateRuleScoreDTO
;
import
com.gic.evaluate.manage.api.dto.EvaluateRuleScoreDTO
;
import
com.gic.evaluate.manage.api.dto.StoreEvaluateInfoDTO
;
import
com.gic.evaluate.manage.api.dto.StoreEvaluateInfoDTO
;
import
com.gic.evaluate.manage.api.service.EvaluateDataApiService
;
import
com.gic.evaluate.manage.api.service.EvaluateDataApiService
;
import
com.gic.haoban.app.aggregation.api.dto.evaluation.CreateRecordRequest
;
import
com.gic.haoban.app.aggregation.api.dto.evaluation.CreateRecordRequest
;
import
com.gic.haoban.app.aggregation.api.dto.evaluation.OrderProductRequest
;
import
com.gic.haoban.app.aggregation.api.dto.evaluation.OrderProductRequest
;
import
com.gic.haoban.app.aggregation.api.dto.evaluation.OrderVerificationRecordDTO
;
import
com.gic.haoban.app.aggregation.api.dto.evaluation.OrderVerificationRecordDTO
;
import
com.gic.haoban.app.aggregation.api.service.evaluation.OrderVerificationRecordApiService
;
import
com.gic.haoban.app.aggregation.api.service.evaluation.OrderVerificationRecordApiService
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.order.integral.ClerkQo
;
import
com.gic.haoban.manage.web.qo.order.integral.ClerkQo
;
import
com.gic.haoban.manage.web.vo.order.EvaluateVO
;
import
com.gic.haoban.manage.web.vo.order.EvaluateVO
;
import
com.gic.haoban.manage.web.vo.order.MemberInfoVO
;
import
com.gic.haoban.manage.web.vo.order.MemberInfoVO
;
import
com.gic.haoban.manage.web.vo.order.OrderCountVO
;
import
com.gic.haoban.manage.web.vo.order.OrderCountVO
;
import
com.gic.haoban.manage.web.vo.order.OrderDetailItemVO
;
import
com.gic.haoban.manage.web.vo.order.OrderDetailItemVO
;
import
com.gic.haoban.manage.web.vo.order.OrderDetailVO
;
import
com.gic.haoban.manage.web.vo.order.OrderDetailVO
;
import
com.gic.haoban.manage.web.vo.order.OrderListItemVO
;
import
com.gic.haoban.manage.web.vo.order.OrderListItemVO
;
import
com.gic.haoban.manage.web.vo.order.OrderListVO
;
import
com.gic.haoban.manage.web.vo.order.OrderListVO
;
import
com.gic.haoban.manage.web.vo.order.integral.CheckVO
;
import
com.gic.haoban.manage.web.vo.order.integral.CheckVO
;
import
com.gic.haoban.manage.web.vo.order.integral.HxOrderCountVO
;
import
com.gic.haoban.manage.web.vo.order.integral.HxOrderCountVO
;
import
com.gic.haoban.manage.web.vo.order.integral.ProductSku
;
import
com.gic.haoban.manage.web.vo.order.integral.ProductSku
;
import
com.gic.haoban.manage.web.vo.order.integral.ProductVO
;
import
com.gic.haoban.manage.web.vo.order.integral.ProductVO
;
import
com.gic.haoban.manage.web.vo.order.integral.ScanVO
;
import
com.gic.haoban.manage.web.vo.order.integral.ScanVO
;
import
com.gic.integralmall.api.dto.IntegralMallExchangeLogDTO
;
import
com.gic.integralmall.api.dto.IntegralMallExchangeLogDTO
;
import
com.gic.integralmall.api.enums.IntegralMallExchangeLogStatusEnums
;
import
com.gic.integralmall.api.enums.IntegralMallExchangeLogStatusEnums
;
import
com.gic.integralmall.api.service.IntegralmallService
;
import
com.gic.integralmall.api.service.IntegralmallService
;
import
com.gic.integralmall.api.service.result.DubboResult
;
import
com.gic.integralmall.api.service.result.DubboResult
;
import
com.gic.store.goods.dto.stock.GoodsStockBaseQDTO
;
import
com.gic.store.goods.dto.stock.GoodsStockBaseQDTO
;
import
com.gic.store.goods.enums.ProductStockChannelType
;
import
com.gic.store.goods.enums.ProductStockChannelType
;
import
com.gic.store.goods.service.ProductStockApiService
;
import
com.gic.store.goods.service.ProductStockApiService
;
@RestController
@RestController
@RequestMapping
(
"/order"
)
@RequestMapping
(
"/order"
)
public
class
GicOrderController
{
public
class
GicOrderController
{
private
static
final
org
.
apache
.
logging
.
log4j
.
Logger
logger
=
LogManager
.
getLogger
(
GicOrderController
.
class
);
private
static
final
org
.
apache
.
logging
.
log4j
.
Logger
logger
=
LogManager
.
getLogger
(
GicOrderController
.
class
);
@Autowired
@Autowired
private
WebOrderManageApiService
webOrderManageApiService
;
private
WebOrderManageApiService
webOrderManageApiService
;
@Autowired
@Autowired
private
ClerkService
clerkService
;
private
ClerkService
clerkService
;
@Autowired
@Autowired
private
MemberReferClerkApiService
memberReferClerkApiService
;
private
MemberReferClerkApiService
memberReferClerkApiService
;
@Autowired
@Autowired
private
IntegralmallService
integralmallService
;
private
IntegralmallService
integralmallService
;
@Autowired
@Autowired
private
OrderVerificationRecordApiService
orderVerificationRecordApiService
;
private
OrderVerificationRecordApiService
orderVerificationRecordApiService
;
@Autowired
@Autowired
private
ProductStockApiService
productStockApiService
;
private
ProductStockApiService
productStockApiService
;
@Autowired
@Autowired
private
OrderSettingApiService
orderSettingApiService
;
private
OrderSettingApiService
orderSettingApiService
;
@Autowired
@Autowired
private
EvaluateDataApiService
evaluateDataApiService
;
private
EvaluateDataApiService
evaluateDataApiService
;
// 发货订单列表 (0全部,待发货2+待收货3,部分发货7)
// 发货订单列表 (0全部,待发货2+待收货3,部分发货7)
@RequestMapping
(
"list-order"
)
@RequestMapping
(
"list-order"
)
public
RestResponse
<
Object
>
orderList
(
String
enterpriseId
,
String
storeId
,
String
clerkId
,
String
search
,
public
RestResponse
<
Object
>
orderList
(
String
enterpriseId
,
String
storeId
,
String
clerkId
,
String
search
,
@RequestParam
(
defaultValue
=
"0"
)
int
status
,
BasePageInfo
pageInfo
)
{
@RequestParam
(
defaultValue
=
"0"
)
int
status
,
BasePageInfo
pageInfo
)
{
String
strStatus
=
""
+
status
;
String
strStatus
=
""
+
status
;
if
(
status
==
0
)
{
if
(
status
==
0
)
{
strStatus
=
"2,3,7"
;
strStatus
=
"2,3,7"
;
}
}
if
(
status
==
2
)
{
if
(
status
==
2
)
{
strStatus
=
"2,7"
;
strStatus
=
"2,7"
;
}
}
// 查询门店
// 查询门店
ListOrderManageQDTO
qdto
=
new
ListOrderManageQDTO
();
ListOrderManageQDTO
qdto
=
new
ListOrderManageQDTO
();
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setOrderStep
(
strStatus
);
qdto
.
setOrderStep
(
strStatus
);
// 微商城
// 微商城
qdto
.
setBusinessType
(
OrderEnum
.
BusinessTypeEnum
.
MICRO_MALL
.
getType
());
qdto
.
setBusinessType
(
OrderEnum
.
BusinessTypeEnum
.
MICRO_MALL
.
getType
());
// 配送方式 -1:所有 2:门店自提 1:快递发货
// 配送方式 -1:所有 2:门店自提 1:快递发货
qdto
.
setDeliveryChannel
(
1
);
qdto
.
setDeliveryChannel
(
1
);
// 库存 - 门店库存2
// 库存 - 门店库存2
qdto
.
setDeliveryMode
(
2
);
qdto
.
setDeliveryMode
(
2
);
if
(
StringUtils
.
isNotEmpty
(
search
))
{
if
(
StringUtils
.
isNotEmpty
(
search
))
{
qdto
.
setSearchOrderType
(
SearchOrderTypeEnum
.
GOODS_NAME_OR_ORDER_NUMBER
.
getType
());
qdto
.
setSearchOrderType
(
SearchOrderTypeEnum
.
GOODS_NAME_OR_ORDER_NUMBER
.
getType
());
qdto
.
setSearchOrderParam
(
search
);
qdto
.
setSearchOrderParam
(
search
);
}
}
qdto
.
setBelongStoreId
(
storeId
);
qdto
.
setBelongStoreId
(
storeId
);
logger
.
info
(
"发货订单查询,qdto={}"
,
JSON
.
toJSONString
(
qdto
));
logger
.
info
(
"发货订单查询,qdto={}"
,
JSON
.
toJSONString
(
qdto
));
return
this
.
orderListSelect
(
qdto
,
pageInfo
,
false
);
return
this
.
orderListSelect
(
qdto
,
pageInfo
,
false
);
}
}
// 数量查询(待发货+待收货)
// 数量查询(待发货+待收货)
// orderType:2待发货 3待收货
// orderType:2待发货 3待收货
@RequestMapping
(
"order-deliver-count"
)
@RequestMapping
(
"order-deliver-count"
)
public
RestResponse
<
Object
>
orderCount
(
String
enterpriseId
,
String
storeId
)
{
public
RestResponse
<
Object
>
orderCount
(
String
enterpriseId
,
String
storeId
)
{
OrderCountVO
vo
=
new
OrderCountVO
();
OrderCountVO
vo
=
new
OrderCountVO
();
if
(
StringUtils
.
isEmpty
(
storeId
))
{
if
(
StringUtils
.
isEmpty
(
storeId
))
{
return
RestResponse
.
successResult
(
vo
);
return
RestResponse
.
successResult
(
vo
);
}
}
CountOrderStatusQDTO
qdto
=
new
CountOrderStatusQDTO
();
CountOrderStatusQDTO
qdto
=
new
CountOrderStatusQDTO
();
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setBusinessType
(
OrderEnum
.
BusinessTypeEnum
.
MICRO_MALL
.
getType
());
qdto
.
setBusinessType
(
OrderEnum
.
BusinessTypeEnum
.
MICRO_MALL
.
getType
());
// 配送方式 -1:所有 2:门店自提 1:快递发货
// 配送方式 -1:所有 2:门店自提 1:快递发货
qdto
.
setDeliveryChannel
(
1
);
qdto
.
setDeliveryChannel
(
1
);
// 库存 - 门店库存2
// 库存 - 门店库存2
qdto
.
setDeliveryMode
(
2
);
qdto
.
setDeliveryMode
(
2
);
qdto
.
setBelongStoreId
(
storeId
);
qdto
.
setBelongStoreId
(
storeId
);
ServiceResponse
<
List
<
OrderStatusDTO
>>
resp
=
this
.
webOrderManageApiService
.
countOrderStatus
(
qdto
);
ServiceResponse
<
List
<
OrderStatusDTO
>>
resp
=
this
.
webOrderManageApiService
.
countOrderStatus
(
qdto
);
List
<
OrderStatusDTO
>
list
=
resp
.
getResult
();
List
<
OrderStatusDTO
>
list
=
resp
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
long
noDeliver
=
0
,
deliver
=
0
;
long
noDeliver
=
0
,
deliver
=
0
;
for
(
OrderStatusDTO
item
:
list
)
{
for
(
OrderStatusDTO
item
:
list
)
{
if
(
item
.
getOrderStep
()
==
3
)
{
if
(
item
.
getOrderStep
()
==
3
)
{
deliver
=
item
.
getTotal
();
deliver
=
item
.
getTotal
();
}
}
if
(
item
.
getOrderStep
()
==
2
||
item
.
getOrderStep
()
==
7
)
{
if
(
item
.
getOrderStep
()
==
2
||
item
.
getOrderStep
()
==
7
)
{
noDeliver
=
noDeliver
+
item
.
getTotal
();
noDeliver
=
noDeliver
+
item
.
getTotal
();
}
}
}
}
vo
.
setDeliverCount
((
int
)
deliver
);
vo
.
setDeliverCount
((
int
)
deliver
);
vo
.
setNoDeliverCount
((
int
)
noDeliver
);
vo
.
setNoDeliverCount
((
int
)
noDeliver
);
vo
.
setTotal
((
int
)
(
deliver
+
noDeliver
));
vo
.
setTotal
((
int
)
(
deliver
+
noDeliver
));
}
}
return
RestResponse
.
successResult
(
vo
);
return
RestResponse
.
successResult
(
vo
);
}
}
// 核销订单查询
// 核销订单查询
// status 0全部 1待核销 2已核销
// status 0全部 1待核销 2已核销
@RequestMapping
(
"list-verification-order"
)
@RequestMapping
(
"list-verification-order"
)
public
RestResponse
<
Object
>
mallOrderList
(
String
enterpriseId
,
String
storeId
,
String
clerkId
,
public
RestResponse
<
Object
>
mallOrderList
(
String
enterpriseId
,
String
storeId
,
String
clerkId
,
@RequestParam
(
defaultValue
=
"0"
)
int
status
,
String
search
,
BasePageInfo
pageInfo
)
{
@RequestParam
(
defaultValue
=
"0"
)
int
status
,
String
search
,
BasePageInfo
pageInfo
)
{
// 查询门店
// 查询门店
ListOrderManageQDTO
qdto
=
new
ListOrderManageQDTO
();
ListOrderManageQDTO
qdto
=
new
ListOrderManageQDTO
();
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setEnterpriseId
(
enterpriseId
);
// 配送方式 -1:所有 2:门店自提 1:快递发货
// 配送方式 -1:所有 2:门店自提 1:快递发货
qdto
.
setDeliveryChannel
(
2
);
qdto
.
setDeliveryChannel
(
2
);
qdto
.
setPickUpStoreId
(
storeId
);
qdto
.
setPickUpStoreId
(
storeId
);
if
(
status
==
1
)
{
if
(
status
==
1
)
{
qdto
.
setOrderStep
(
"2"
);
qdto
.
setOrderStep
(
"2"
);
}
}
if
(
status
==
2
)
{
if
(
status
==
2
)
{
qdto
.
setWriteOffClerkId
(
clerkId
);
qdto
.
setWriteOffClerkId
(
clerkId
);
qdto
.
setOrderStep
(
"4"
);
qdto
.
setOrderStep
(
"4"
);
qdto
.
setDeliveryOptType
(
1
);
qdto
.
setDeliveryOptType
(
1
);
}
}
qdto
.
setBusinessType
(
OrderEnum
.
BusinessTypeEnum
.
MICRO_MALL
.
getType
());
qdto
.
setBusinessType
(
OrderEnum
.
BusinessTypeEnum
.
MICRO_MALL
.
getType
());
qdto
.
setSearchOrderParam
(
search
);
qdto
.
setSearchOrderParam
(
search
);
return
this
.
orderListSelect
(
qdto
,
pageInfo
,
false
);
return
this
.
orderListSelect
(
qdto
,
pageInfo
,
false
);
}
}
// 订单详情 (客户信息+收货地址+商品详情+订单信息 + 订单状态)
// 订单详情 (客户信息+收货地址+商品详情+订单信息 + 订单状态)
@RequestMapping
(
"order-detail"
)
@RequestMapping
(
"order-detail"
)
public
RestResponse
<
Object
>
orderDetail
(
String
enterpriseId
,
String
clerkId
,
String
searchParams
,
public
RestResponse
<
Object
>
orderDetail
(
String
enterpriseId
,
String
clerkId
,
String
searchParams
,
@RequestParam
(
defaultValue
=
"1"
)
int
orderType
,
String
orderId
,
String
storeId
)
{
@RequestParam
(
defaultValue
=
"1"
)
int
orderType
,
String
orderId
,
String
storeId
)
{
QueryOrderDetailQDTO
queryOrderDetailQDTO
=
new
QueryOrderDetailQDTO
();
QueryOrderDetailQDTO
queryOrderDetailQDTO
=
new
QueryOrderDetailQDTO
();
queryOrderDetailQDTO
.
setOrderId
(
orderId
);
queryOrderDetailQDTO
.
setOrderId
(
orderId
);
queryOrderDetailQDTO
.
setEnterpriseId
(
enterpriseId
);
queryOrderDetailQDTO
.
setEnterpriseId
(
enterpriseId
);
ServiceResponse
<
OrderDetailDTO
>
ret
=
webOrderManageApiService
.
getOrderDetail
(
queryOrderDetailQDTO
);
ServiceResponse
<
OrderDetailDTO
>
ret
=
webOrderManageApiService
.
getOrderDetail
(
queryOrderDetailQDTO
);
if
(!
ret
.
isSuccess
())
{
if
(!
ret
.
isSuccess
())
{
return
RestResponse
.
failure
(
ret
.
getCode
(),
ret
.
getMessage
());
return
RestResponse
.
failure
(
ret
.
getCode
(),
ret
.
getMessage
());
}
}
logger
.
info
(
"订单信息={}"
,
JSON
.
toJSONString
(
ret
,
true
));
logger
.
info
(
"订单信息={}"
,
JSON
.
toJSONString
(
ret
,
true
));
OrderDetailVO
detail
=
this
.
getOrderDetail
(
enterpriseId
,
ret
.
getResult
().
getOrderInfo
(),
OrderDetailVO
detail
=
this
.
getOrderDetail
(
enterpriseId
,
ret
.
getResult
().
getOrderInfo
(),
ret
.
getResult
().
getOrderItemList
(),
storeId
);
ret
.
getResult
().
getOrderItemList
(),
storeId
);
if
(
CollectionUtils
.
isNotEmpty
(
ret
.
getResult
().
getOrderWrapList
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
ret
.
getResult
().
getOrderWrapList
()))
{
List
<
String
>
idList
=
ret
.
getResult
().
getOrderWrapList
().
stream
().
map
(
o
->
o
.
getMallOrderLogisticsId
())
List
<
String
>
idList
=
ret
.
getResult
().
getOrderWrapList
().
stream
().
map
(
o
->
o
.
getMallOrderLogisticsId
())
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
detail
.
setOrderLogisticsIdList
(
idList
);
detail
.
setOrderLogisticsIdList
(
idList
);
}
}
detail
.
setCreateTime
(
OrderDetailDTO
.
getNodeTimeStatic
(
OrderEnum
.
OrderNodeEnum
.
PLACE_AN_ORDER
,
detail
.
setCreateTime
(
OrderDetailDTO
.
getNodeTimeStatic
(
OrderEnum
.
OrderNodeEnum
.
PLACE_AN_ORDER
,
ret
.
getResult
().
getOrderNodeList
()));
ret
.
getResult
().
getOrderNodeList
()));
detail
.
setPayTime
(
OrderDetailDTO
.
getNodeTimeStatic
(
OrderEnum
.
OrderNodeEnum
.
PAY_ORDER
,
detail
.
setPayTime
(
OrderDetailDTO
.
getNodeTimeStatic
(
OrderEnum
.
OrderNodeEnum
.
PAY_ORDER
,
ret
.
getResult
().
getOrderNodeList
()));
ret
.
getResult
().
getOrderNodeList
()));
// 如果是自提
// 如果是自提
if
(
null
!=
detail
.
getDeliveryChannel
()
&&
detail
.
getDeliveryChannel
()
==
2
)
{
if
(
null
!=
detail
.
getDeliveryChannel
()
&&
detail
.
getDeliveryChannel
()
==
2
)
{
detail
.
setPickUpTime
(
OrderDetailDTO
.
getNodeTimeStatic
(
OrderEnum
.
OrderNodeEnum
.
SUCCESSFUL
,
detail
.
setPickUpTime
(
OrderDetailDTO
.
getNodeTimeStatic
(
OrderEnum
.
OrderNodeEnum
.
SUCCESSFUL
,
ret
.
getResult
().
getOrderNodeList
()));
ret
.
getResult
().
getOrderNodeList
()));
}
}
// 自动收货时间
// 自动收货时间
List
<
OrderNodeDTO
>
stepList
=
ret
.
getResult
().
getOrderNodeList
();
List
<
OrderNodeDTO
>
stepList
=
ret
.
getResult
().
getOrderNodeList
();
if
(
CollectionUtils
.
isNotEmpty
(
stepList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
stepList
))
{
stepList
.
forEach
(
item
->
{
stepList
.
forEach
(
item
->
{
if
(
item
.
getOrderStep
()
==
3
)
{
if
(
item
.
getOrderStep
()
==
3
)
{
ServiceResponse
<
MallOrderSettingDTO
>
setResp
=
this
.
orderSettingApiService
ServiceResponse
<
MallOrderSettingDTO
>
setResp
=
this
.
orderSettingApiService
.
getOrderSetting
(
enterpriseId
);
.
getOrderSetting
(
enterpriseId
);
int
autoDay
=
setResp
.
getResult
().
getAutoConfirm
();
int
autoDay
=
setResp
.
getResult
().
getAutoConfirm
();
if
(
0
!=
autoDay
)
{
if
(
0
!=
autoDay
)
{
detail
.
setAutoTaskOverTime
(
DateUtil
.
addNumForDay
(
item
.
getCreateTime
(),
autoDay
));
detail
.
setAutoTaskOverTime
(
DateUtil
.
addNumForDay
(
item
.
getCreateTime
(),
autoDay
));
return
;
return
;
}
}
}
}
});
});
}
}
return
RestResponse
.
successResult
(
detail
);
return
RestResponse
.
successResult
(
detail
);
}
}
/**
/**
* 扫码二维码
* 扫码二维码
*/
*/
@RequestMapping
(
"/scan"
)
@RequestMapping
(
"/scan"
)
public
RestResponse
<
Object
>
scan
(
String
enterpriseId
,
String
writeOffCode
,
String
storeId
)
{
public
RestResponse
<
Object
>
scan
(
String
enterpriseId
,
String
writeOffCode
,
String
storeId
)
{
if
(
StringUtils
.
isEmpty
(
writeOffCode
))
{
if
(
StringUtils
.
isEmpty
(
writeOffCode
))
{
return
RestResponse
.
failure
(
"9999"
,
"核销码为空"
);
return
RestResponse
.
failure
(
"9999"
,
"核销码为空"
);
}
}
// 微商城
// 微商城
if
(
writeOffCode
.
startsWith
(
"M"
))
{
if
(
writeOffCode
.
startsWith
(
"M"
))
{
// 通过核销码查询
// 通过核销码查询
QueryOrderDetailQDTO
qdto
=
new
QueryOrderDetailQDTO
();
QueryOrderDetailQDTO
qdto
=
new
QueryOrderDetailQDTO
();
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setWriteOffCode
(
writeOffCode
);
qdto
.
setWriteOffCode
(
writeOffCode
);
ServiceResponse
<
OrderDetailDTO
>
ret
=
webOrderManageApiService
.
getOrderDetail
(
qdto
);
ServiceResponse
<
OrderDetailDTO
>
ret
=
webOrderManageApiService
.
getOrderDetail
(
qdto
);
OrderDetailDTO
detail
=
ret
.
getResult
();
OrderDetailDTO
detail
=
ret
.
getResult
();
logger
.
info
(
"订单信息={}"
,
JSON
.
toJSONString
(
ret
,
true
));
logger
.
info
(
"订单信息={}"
,
JSON
.
toJSONString
(
ret
,
true
));
if
(
ret
.
isSuccess
())
{
if
(
ret
.
isSuccess
())
{
// 已核销,且不是好办核销的
// 已核销,且不是好办核销的
if
(
null
!=
detail
.
getOrderInfo
().
getDeliveryOptType
()
if
(
null
!=
detail
.
getOrderInfo
().
getDeliveryOptType
()
&&
detail
.
getOrderInfo
().
getDeliveryOptType
()
!=
1
)
{
&&
detail
.
getOrderInfo
().
getDeliveryOptType
()
!=
1
)
{
logger
.
info
(
"已核销,且不是好办核销的={}"
,
writeOffCode
);
logger
.
info
(
"已核销,且不是好办核销的={}"
,
writeOffCode
);
return
RestResponse
.
failure
(
"9999"
,
"此自提点无法核销"
);
return
RestResponse
.
failure
(
"9999"
,
"此自提点无法核销"
);
}
}
if
(!
storeId
.
equals
(
detail
.
getOrderInfo
().
getPickUpStoreId
()))
{
if
(!
storeId
.
equals
(
detail
.
getOrderInfo
().
getPickUpStoreId
()))
{
return
RestResponse
.
failure
(
"9999"
,
"此自提点无法核销"
);
return
RestResponse
.
failure
(
"9999"
,
"此自提点无法核销"
);
}
}
OrderDetailVO
orderDetailVO
=
this
.
getOrderDetail
(
enterpriseId
,
ret
.
getResult
().
getOrderInfo
(),
OrderDetailVO
orderDetailVO
=
this
.
getOrderDetail
(
enterpriseId
,
ret
.
getResult
().
getOrderInfo
(),
ret
.
getResult
().
getOrderItemList
(),
storeId
);
ret
.
getResult
().
getOrderItemList
(),
storeId
);
return
RestResponse
.
successResult
(
orderDetailVO
);
return
RestResponse
.
successResult
(
orderDetailVO
);
}
else
{
}
else
{
return
RestResponse
.
failure
(
"9999"
,
ret
.
getMessage
());
return
RestResponse
.
failure
(
"9999"
,
ret
.
getMessage
());
}
}
}
else
{
}
else
{
// 积分商城
// 积分商城
DubboResult
<
IntegralMallExchangeLogDTO
>
integralResult
=
integralmallService
DubboResult
<
IntegralMallExchangeLogDTO
>
integralResult
=
integralmallService
.
getIntegralMallExchangeLogByWriteOffCode
(
enterpriseId
,
writeOffCode
);
.
getIntegralMallExchangeLogByWriteOffCode
(
enterpriseId
,
writeOffCode
);
if
(
null
!=
integralResult
&&
null
!=
integralResult
.
getData
())
{
if
(
null
!=
integralResult
&&
null
!=
integralResult
.
getData
())
{
ScanVO
vo
=
integralMallScan
(
integralResult
.
getData
());
ScanVO
vo
=
integralMallScan
(
integralResult
.
getData
());
return
RestResponse
.
successResult
(
vo
);
return
RestResponse
.
successResult
(
vo
);
}
}
}
}
return
RestResponse
.
failure
(
"9999"
,
"订单查询不到"
);
return
RestResponse
.
failure
(
"9999"
,
"订单查询不到"
);
}
}
// 单笔订单发货商品列表
// 单笔订单发货商品列表
@RequestMapping
(
"order-deliver-list"
)
@RequestMapping
(
"order-deliver-list"
)
public
RestResponse
<
Object
>
orderDeliverList
(
String
enterpriseId
,
String
storeId
,
String
orderId
)
{
public
RestResponse
<
Object
>
orderDeliverList
(
String
enterpriseId
,
String
storeId
,
String
orderId
)
{
QueryOrderDetailQDTO
qdto
=
new
QueryOrderDetailQDTO
();
QueryOrderDetailQDTO
qdto
=
new
QueryOrderDetailQDTO
();
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setOrderId
(
orderId
);
qdto
.
setOrderId
(
orderId
);
ServiceResponse
<
OrderDetailDTO
>
resp
=
webOrderManageApiService
.
getOrderDetail
(
qdto
);
ServiceResponse
<
OrderDetailDTO
>
resp
=
webOrderManageApiService
.
getOrderDetail
(
qdto
);
List
<
ListOrderItemDTO
>
list
=
resp
.
getResult
().
getOrderItemList
();
List
<
ListOrderItemDTO
>
list
=
resp
.
getResult
().
getOrderItemList
();
List
<
OrderListItemVO
>
voList
=
new
ArrayList
<>();
List
<
OrderListItemVO
>
voList
=
new
ArrayList
<>();
for
(
ListOrderItemDTO
item
:
list
)
{
for
(
ListOrderItemDTO
item
:
list
)
{
if
(
StringUtils
.
isEmpty
(
item
.
getLogisticsId
()))
{
if
(
StringUtils
.
isEmpty
(
item
.
getLogisticsId
()))
{
OrderListItemVO
vo
=
EntityUtil
.
changeEntityByJSON
(
OrderListItemVO
.
class
,
item
);
OrderListItemVO
vo
=
EntityUtil
.
changeEntityByJSON
(
OrderListItemVO
.
class
,
item
);
GoodsStockBaseQDTO
stockQDTO
=
new
GoodsStockBaseQDTO
();
GoodsStockBaseQDTO
stockQDTO
=
new
GoodsStockBaseQDTO
();
stockQDTO
.
setEnterpriseId
(
enterpriseId
);
stockQDTO
.
setEnterpriseId
(
enterpriseId
);
stockQDTO
.
setGoodsId
(
vo
.
getMallProId
());
stockQDTO
.
setGoodsId
(
vo
.
getMallProId
());
stockQDTO
.
setSkuId
(
vo
.
getMallProSkuId
());
stockQDTO
.
setSkuId
(
vo
.
getMallProSkuId
());
stockQDTO
.
setStoreId
(
storeId
);
stockQDTO
.
setStoreId
(
storeId
);
stockQDTO
.
setChannelType
(
ProductStockChannelType
.
MALL
.
getCode
());
stockQDTO
.
setChannelType
(
ProductStockChannelType
.
MALL
.
getCode
());
ServiceResponse
<
Integer
>
stockResp
=
this
.
productStockApiService
.
queryGoodsStock
(
stockQDTO
);
ServiceResponse
<
Integer
>
stockResp
=
this
.
productStockApiService
.
queryGoodsStock
(
stockQDTO
);
logger
.
info
(
"门店库存查询orderId={},qdto={},result={}"
,
orderId
,
JSON
.
toJSONString
(
stockQDTO
),
logger
.
info
(
"门店库存查询orderId={},qdto={},result={}"
,
orderId
,
JSON
.
toJSONString
(
stockQDTO
),
JSON
.
toJSONString
(
stockResp
));
JSON
.
toJSONString
(
stockResp
));
if
(
stockResp
.
isSuccess
()
&&
null
!=
stockResp
.
getResult
())
{
if
(
stockResp
.
isSuccess
()
&&
null
!=
stockResp
.
getResult
())
{
vo
.
setStoreStock
(
stockResp
.
getResult
());
vo
.
setStoreStock
(
stockResp
.
getResult
());
}
}
voList
.
add
(
vo
);
voList
.
add
(
vo
);
}
}
}
}
return
RestResponse
.
successResult
(
voList
);
return
RestResponse
.
successResult
(
voList
);
}
}
// 订单-发货
// 订单-发货
@RequestMapping
(
"order-logistics-deliver"
)
@RequestMapping
(
"order-logistics-deliver"
)
public
RestResponse
<
Object
>
orderDeliver
(
String
enterpriseId
,
String
orderId
,
String
storeId
,
String
orderItemIds
,
public
RestResponse
<
Object
>
orderDeliver
(
String
enterpriseId
,
String
orderId
,
String
storeId
,
String
orderItemIds
,
String
companyCode
,
String
logisticsNo
,
String
companyId
,
String
companyName
)
{
String
companyCode
,
String
logisticsNo
,
String
companyId
,
String
companyName
)
{
OrderShipmentQDTO
qdto
=
new
OrderShipmentQDTO
();
OrderShipmentQDTO
qdto
=
new
OrderShipmentQDTO
();
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setLogisticsCompanyCode
(
companyCode
);
qdto
.
setLogisticsCompanyCode
(
companyCode
);
qdto
.
setLogisticsCompanyName
(
companyName
);
qdto
.
setLogisticsCompanyName
(
companyName
);
qdto
.
setLogisticsCompanyId
(
companyId
);
qdto
.
setLogisticsCompanyId
(
companyId
);
qdto
.
setCourierNumber
(
logisticsNo
);
qdto
.
setCourierNumber
(
logisticsNo
);
qdto
.
setOrderId
(
orderId
);
qdto
.
setOrderId
(
orderId
);
// 门店发货
// 门店发货
qdto
.
setDeliveryMode
(
2
);
qdto
.
setDeliveryMode
(
2
);
// 好办后台发货
// 好办后台发货
qdto
.
setSource
(
DeliveryOptTypeEnum
.
HAOBAN
.
getCode
());
qdto
.
setSource
(
DeliveryOptTypeEnum
.
HAOBAN
.
getCode
());
List
<
String
>
orderItemIdList
=
Arrays
.
asList
(
orderItemIds
.
split
(
","
));
List
<
String
>
orderItemIdList
=
Arrays
.
asList
(
orderItemIds
.
split
(
","
));
List
<
OrderItemShipmentQDTO
>
list
=
new
ArrayList
<>();
List
<
OrderItemShipmentQDTO
>
list
=
new
ArrayList
<>();
orderItemIdList
.
forEach
(
o
->
{
orderItemIdList
.
forEach
(
o
->
{
OrderItemShipmentQDTO
item
=
new
OrderItemShipmentQDTO
();
OrderItemShipmentQDTO
item
=
new
OrderItemShipmentQDTO
();
item
.
setOrderItemId
(
o
);
item
.
setOrderItemId
(
o
);
item
.
setStoreId
(
storeId
);
item
.
setStoreId
(
storeId
);
list
.
add
(
item
);
list
.
add
(
item
);
});
});
qdto
.
setOrderItemShipment
(
list
);
qdto
.
setOrderItemShipment
(
list
);
ServiceResponse
<
Boolean
>
resp
=
webOrderManageApiService
.
orderShipment
(
qdto
);
ServiceResponse
<
Boolean
>
resp
=
webOrderManageApiService
.
orderShipment
(
qdto
);
if
(!
resp
.
isSuccess
())
{
if
(!
resp
.
isSuccess
())
{
/*
/*
* String code = resp.getCode(); if (Arrays.asList("900001",
* String code = resp.getCode(); if (Arrays.asList("900001",
* "300105", "200001").contains(code)) { return
* "300105", "200001").contains(code)) { return
* RestResponse.failure(HaoBanErrCode.ERR_9600.getCode() + "",
* RestResponse.failure(HaoBanErrCode.ERR_9600.getCode() + "",
* "请刷新页面"); }
* "请刷新页面"); }
*/
*/
return
RestResponse
.
failure
(
HaoBanErrCode
.
ERR_9600
.
getCode
()
+
""
,
"请刷新页面"
);
return
RestResponse
.
failure
(
HaoBanErrCode
.
ERR_9600
.
getCode
()
+
""
,
"请刷新页面"
);
}
}
return
RestResponse
.
successResult
(
resp
.
getResult
());
return
RestResponse
.
successResult
(
resp
.
getResult
());
}
}
// 我的客户-会员订单列表
// 我的客户-会员订单列表
// deliveryChannel 0全部 1快递 2自提
// deliveryChannel 0全部 1快递 2自提
// -1全部 1待付款 2待发货 7部分发货 4已完成 0已取消 5售后中
// -1全部 1待付款 2待发货 7部分发货 4已完成 0已取消 5售后中
// orderType -1 全部 0:会员自行购买 1导购推荐订单
// orderType -1 全部 0:会员自行购买 1导购推荐订单
@RequestMapping
(
"list-member-order"
)
@RequestMapping
(
"list-member-order"
)
public
RestResponse
<
Object
>
orderList
(
String
enterpriseId
,
String
memberId
,
String
search
,
public
RestResponse
<
Object
>
orderList
(
String
enterpriseId
,
String
memberId
,
String
search
,
@RequestParam
(
defaultValue
=
"-1"
)
int
status
,
@RequestParam
(
defaultValue
=
"0"
)
int
deliveryChannel
,
@RequestParam
(
defaultValue
=
"-1"
)
int
status
,
@RequestParam
(
defaultValue
=
"0"
)
int
deliveryChannel
,
@RequestParam
(
defaultValue
=
"-1"
)
int
orderType
,
BasePageInfo
pageInfo
,
String
startTime
,
String
endTime
)
{
@RequestParam
(
defaultValue
=
"-1"
)
int
orderType
,
BasePageInfo
pageInfo
,
String
startTime
,
String
endTime
)
{
if
(
StringUtils
.
isEmpty
(
memberId
))
{
if
(
StringUtils
.
isEmpty
(
memberId
))
{
return
RestResponse
.
failure
(
"9999"
,
"memberId为空"
);
return
RestResponse
.
failure
(
"9999"
,
"memberId为空"
);
}
}
String
strStatus
=
""
+
status
;
String
strStatus
=
""
+
status
;
// 全部
// 全部
if
(
status
==
-
1
)
{
if
(
status
==
-
1
)
{
strStatus
=
null
;
strStatus
=
null
;
}
}
// 售后中
// 售后中
if
(
status
==
5
)
{
if
(
status
==
5
)
{
strStatus
=
"11"
;
strStatus
=
"11"
;
}
}
Date
startDate
=
null
;
Date
startDate
=
null
;
if
(
StringUtils
.
isNotEmpty
(
startTime
))
{
if
(
StringUtils
.
isNotEmpty
(
startTime
))
{
startDate
=
DateUtil
.
strToDate
(
startTime
,
"yyyy-MM-dd"
);
startDate
=
DateUtil
.
strToDate
(
startTime
,
"yyyy-MM-dd"
);
}
}
Date
endDate
=
null
;
Date
endDate
=
null
;
if
(
StringUtils
.
isNotEmpty
(
endTime
))
{
if
(
StringUtils
.
isNotEmpty
(
endTime
))
{
endDate
=
DateUtil
.
strToDate
(
endTime
,
"yyyy-MM-dd"
);
endDate
=
DateUtil
.
strToDate
(
endTime
,
"yyyy-MM-dd"
);
endDate
=
DateUtil
.
getEndTimeOfDay
(
endDate
);
endDate
=
DateUtil
.
getEndTimeOfDay
(
endDate
);
}
}
// 查询门店
// 查询门店
ListOrderManageQDTO
qdto
=
new
ListOrderManageQDTO
();
ListOrderManageQDTO
qdto
=
new
ListOrderManageQDTO
();
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setOrderStep
(
strStatus
);
qdto
.
setOrderStep
(
strStatus
);
qdto
.
setMemberId
(
memberId
);
qdto
.
setMemberId
(
memberId
);
qdto
.
setStartDate
(
startDate
);
qdto
.
setStartDate
(
startDate
);
qdto
.
setEndDate
(
endDate
);
qdto
.
setEndDate
(
endDate
);
qdto
.
setBusinessType
(
OrderEnum
.
BusinessTypeEnum
.
MICRO_MALL
.
getType
());
qdto
.
setBusinessType
(
OrderEnum
.
BusinessTypeEnum
.
MICRO_MALL
.
getType
());
if
(
StringUtils
.
isNotEmpty
(
search
))
{
if
(
StringUtils
.
isNotEmpty
(
search
))
{
qdto
.
setSearchOrderType
(
SearchOrderTypeEnum
.
ORDER_NUMBER
.
getType
());
qdto
.
setSearchOrderType
(
SearchOrderTypeEnum
.
ORDER_NUMBER
.
getType
());
qdto
.
setSearchOrderParam
(
search
);
qdto
.
setSearchOrderParam
(
search
);
}
}
return
this
.
orderListSelect
(
qdto
,
pageInfo
,
true
);
return
this
.
orderListSelect
(
qdto
,
pageInfo
,
true
);
}
}
// 修改物流
// 修改物流
// type : 1: 下单 2:换货
// type : 1: 下单 2:换货
@RequestMapping
(
"modify-order-logistics"
)
@RequestMapping
(
"modify-order-logistics"
)
public
RestResponse
<
Object
>
modifyOrderDeliver
(
String
memberId
,
String
enterpriseId
,
String
orderId
,
String
storeId
,
public
RestResponse
<
Object
>
modifyOrderDeliver
(
String
memberId
,
String
enterpriseId
,
String
orderId
,
String
storeId
,
String
logisticsId
,
String
companyCode
,
String
logisticsNo
,
String
companyId
,
String
companyName
,
String
logisticsId
,
String
companyCode
,
String
logisticsNo
,
String
companyId
,
String
companyName
,
@RequestParam
(
defaultValue
=
"1"
)
int
type
)
{
@RequestParam
(
defaultValue
=
"1"
)
int
type
)
{
logger
.
info
(
"修改物流={},{}"
,
orderId
,
type
);
logger
.
info
(
"修改物流={},{}"
,
orderId
,
type
);
UpdateOrderLogisticsQDTO
qdto
=
new
UpdateOrderLogisticsQDTO
();
UpdateOrderLogisticsQDTO
qdto
=
new
UpdateOrderLogisticsQDTO
();
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setLogisticsCompanyCode
(
companyCode
);
qdto
.
setLogisticsCompanyCode
(
companyCode
);
qdto
.
setLogisticsCompanyName
(
companyName
);
qdto
.
setLogisticsCompanyName
(
companyName
);
qdto
.
setLogisticsCompanyId
(
companyId
);
qdto
.
setLogisticsCompanyId
(
companyId
);
qdto
.
setCourierNumber
(
logisticsNo
);
qdto
.
setCourierNumber
(
logisticsNo
);
qdto
.
setOrderId
(
orderId
);
qdto
.
setOrderId
(
orderId
);
qdto
.
setLogisticsId
(
logisticsId
);
qdto
.
setLogisticsId
(
logisticsId
);
qdto
.
setType
(
type
);
qdto
.
setType
(
type
);
this
.
webOrderManageApiService
.
updateOrderLogistics
(
qdto
);
this
.
webOrderManageApiService
.
updateOrderLogistics
(
qdto
);
return
RestResponse
.
successResult
();
return
RestResponse
.
successResult
();
}
}
/**
/**
* 核销订单
* 核销订单
*/
*/
@RequestMapping
(
"/verification"
)
@RequestMapping
(
"/verification"
)
public
RestResponse
<
Object
>
verification
(
String
enterpriseId
,
String
clerkId
,
String
writeOffCode
,
String
orderId
)
{
public
RestResponse
<
Object
>
verification
(
String
enterpriseId
,
String
clerkId
,
String
writeOffCode
,
String
orderId
)
{
if
(
StringUtils
.
isEmpty
(
writeOffCode
))
{
if
(
StringUtils
.
isEmpty
(
writeOffCode
))
{
return
RestResponse
.
failure
(
"9999"
,
"核销码为空"
);
return
RestResponse
.
failure
(
"9999"
,
"核销码为空"
);
}
}
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
if
(
null
==
clerkDTO
)
{
if
(
null
==
clerkDTO
)
{
return
RestResponse
.
failure
(
"9999"
,
"核销人不存在"
);
return
RestResponse
.
failure
(
"9999"
,
"核销人不存在"
);
}
}
// 微商城核销
// 微商城核销
if
(
writeOffCode
.
startsWith
(
"M"
))
{
if
(
writeOffCode
.
startsWith
(
"M"
))
{
if
(
StringUtils
.
isEmpty
(
orderId
))
{
if
(
StringUtils
.
isEmpty
(
orderId
))
{
return
RestResponse
.
failure
(
"9999"
,
"订单ID为空"
);
return
RestResponse
.
failure
(
"9999"
,
"订单ID为空"
);
}
}
SelfPickOffQDTO
qdto
=
new
SelfPickOffQDTO
();
SelfPickOffQDTO
qdto
=
new
SelfPickOffQDTO
();
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setWriteOffClerkId
(
clerkId
);
qdto
.
setWriteOffClerkId
(
clerkId
);
qdto
.
setWriteOffCode
(
writeOffCode
);
qdto
.
setWriteOffCode
(
writeOffCode
);
qdto
.
setSource
(
1
);
qdto
.
setSource
(
1
);
qdto
.
setWriteOffClerkCode
(
clerkDTO
.
getClerkCode
());
qdto
.
setWriteOffClerkCode
(
clerkDTO
.
getClerkCode
());
qdto
.
setOrderId
(
orderId
);
qdto
.
setOrderId
(
orderId
);
ServiceResponse
<
Boolean
>
response
=
webOrderManageApiService
.
selfPickOff
(
qdto
);
ServiceResponse
<
Boolean
>
response
=
webOrderManageApiService
.
selfPickOff
(
qdto
);
if
(!
response
.
isSuccess
())
{
if
(!
response
.
isSuccess
())
{
return
RestResponse
.
failure
(
response
.
getCode
(),
response
.
getMessage
());
return
RestResponse
.
failure
(
response
.
getCode
(),
response
.
getMessage
());
}
}
return
RestResponse
.
successResult
(
response
.
getResult
());
return
RestResponse
.
successResult
(
response
.
getResult
());
}
else
{
}
else
{
ClerkQo
clerkQo
=
new
ClerkQo
();
ClerkQo
clerkQo
=
new
ClerkQo
();
clerkQo
.
setClerkCode
(
clerkDTO
.
getClerkCode
());
clerkQo
.
setClerkCode
(
clerkDTO
.
getClerkCode
());
clerkQo
.
setClerkId
(
clerkDTO
.
getClerkId
());
clerkQo
.
setClerkId
(
clerkDTO
.
getClerkId
());
clerkQo
.
setStoreId
(
clerkDTO
.
getStoreId
());
clerkQo
.
setStoreId
(
clerkDTO
.
getStoreId
());
clerkQo
.
setClerkName
(
clerkDTO
.
getClerkName
());
clerkQo
.
setClerkName
(
clerkDTO
.
getClerkName
());
clerkQo
.
setEnterpriseId
(
enterpriseId
);
clerkQo
.
setEnterpriseId
(
enterpriseId
);
logger
.
info
(
"积分商城订单核销开始,核销码:{} ,核销人:{} "
,
writeOffCode
,
clerkQo
.
getClerkId
());
logger
.
info
(
"积分商城订单核销开始,核销码:{} ,核销人:{} "
,
writeOffCode
,
clerkQo
.
getClerkId
());
enterpriseId
=
clerkDTO
.
getEnterpriseId
();
enterpriseId
=
clerkDTO
.
getEnterpriseId
();
DubboResult
<
Boolean
>
check
=
integralmallService
.
haobanVerificationExchangeLog
(
enterpriseId
,
writeOffCode
,
DubboResult
<
Boolean
>
check
=
integralmallService
.
haobanVerificationExchangeLog
(
enterpriseId
,
writeOffCode
,
clerkQo
.
getClerkCode
(),
clerkQo
.
getClerkName
(),
clerkQo
.
getStoreId
());
clerkQo
.
getClerkCode
(),
clerkQo
.
getClerkName
(),
clerkQo
.
getStoreId
());
logger
.
info
(
"核销结果:{} "
,
JSON
.
toJSONString
(
check
));
logger
.
info
(
"核销结果:{} "
,
JSON
.
toJSONString
(
check
));
CheckVO
checkVO
=
new
CheckVO
();
CheckVO
checkVO
=
new
CheckVO
();
if
(
check
.
getSuccess
())
{
if
(
check
.
getSuccess
())
{
// 积分商城核销成功-添加核销记录
// 积分商城核销成功-添加核销记录
String
recordId
=
createIntegralRecord
(
enterpriseId
,
1
,
clerkQo
,
writeOffCode
);
String
recordId
=
createIntegralRecord
(
enterpriseId
,
1
,
clerkQo
,
writeOffCode
);
checkVO
.
setId
(
recordId
);
checkVO
.
setId
(
recordId
);
checkVO
.
setSuccess
(
Boolean
.
TRUE
);
checkVO
.
setSuccess
(
Boolean
.
TRUE
);
checkVO
.
setCode
(
HaoBanErrCode
.
ERR_1
.
getCode
());
checkVO
.
setCode
(
HaoBanErrCode
.
ERR_1
.
getCode
());
return
RestResponse
.
successResult
(
checkVO
);
return
RestResponse
.
successResult
(
checkVO
);
}
}
/*
/*
* 核销失败情况 10001 兑换记录不存在 10002 当前订单状态无法核销 10003 该订单已经核销 10004 订单已经取消
* 核销失败情况 10001 兑换记录不存在 10002 当前订单状态无法核销 10003 该订单已经核销 10004 订单已经取消
* 10005 10006 超期核销
* 10005 10006 超期核销
*/
*/
checkVO
.
setCode
(
check
.
getErrorCode
());
checkVO
.
setCode
(
check
.
getErrorCode
());
checkVO
.
setMessage
(
check
.
getErrMessage
());
checkVO
.
setMessage
(
check
.
getErrMessage
());
checkVO
.
setSuccess
(
Boolean
.
FALSE
);
checkVO
.
setSuccess
(
Boolean
.
FALSE
);
if
(
check
.
getErrorCode
()
==
HaoBanErrCode
.
ERR_100010
.
getCode
())
{
if
(
check
.
getErrorCode
()
==
HaoBanErrCode
.
ERR_100010
.
getCode
())
{
// 订单已核销
// 订单已核销
OrderVerificationRecordDTO
record
=
orderVerificationRecordApiService
OrderVerificationRecordDTO
record
=
orderVerificationRecordApiService
.
getRecordByClerkIdAndWriteOffCode
(
clerkQo
.
getClerkId
(),
writeOffCode
);
.
getRecordByClerkIdAndWriteOffCode
(
clerkQo
.
getClerkId
(),
writeOffCode
);
if
(
Objects
.
nonNull
(
record
))
{
if
(
Objects
.
nonNull
(
record
))
{
checkVO
.
setSuccess
(
Boolean
.
TRUE
);
checkVO
.
setSuccess
(
Boolean
.
TRUE
);
checkVO
.
setId
(
record
.
getRecordId
());
checkVO
.
setId
(
record
.
getRecordId
());
return
RestResponse
.
successResult
(
checkVO
);
return
RestResponse
.
successResult
(
checkVO
);
}
}
// 超期核销
// 超期核销
checkVO
.
setCode
(
HaoBanErrCode
.
ERR_100014
.
getCode
());
checkVO
.
setCode
(
HaoBanErrCode
.
ERR_100014
.
getCode
());
checkVO
.
setMessage
(
HaoBanErrCode
.
ERR_100014
.
getMsg
());
checkVO
.
setMessage
(
HaoBanErrCode
.
ERR_100014
.
getMsg
());
}
}
if
(!
checkVO
.
getSuccess
())
{
if
(!
checkVO
.
getSuccess
())
{
HaobanResponse
response
=
new
HaobanResponse
();
HaobanResponse
response
=
new
HaobanResponse
();
response
.
setMessage
(
checkVO
.
getMessage
());
response
.
setMessage
(
checkVO
.
getMessage
());
response
.
setErrorCode
(
checkVO
.
getCode
());
response
.
setErrorCode
(
checkVO
.
getCode
());
response
.
setResult
(
checkVO
.
getId
());
response
.
setResult
(
checkVO
.
getId
());
response
.
setDetailError
(
""
);
response
.
setDetailError
(
""
);
return
RestResponse
.
successResult
(
checkVO
);
return
RestResponse
.
failure
(
"9999"
,
checkVO
.
getMessage
());
}
}
}
return
RestResponse
.
successResult
(
checkVO
)
;
return
null
;
}
}
}
// 核销数量
// 核销数量
@RequestMapping
(
"/verification-count"
)
@RequestMapping
(
"/verification-count"
)
public
RestResponse
<
Object
>
verificationCountNew
(
String
enterpriseId
,
String
storeId
,
String
clerkId
)
{
public
RestResponse
<
Object
>
verificationCountNew
(
String
enterpriseId
,
String
storeId
,
String
clerkId
)
{
Page
<
IntegralMallExchangeLogDTO
>
page
=
new
Page
<
IntegralMallExchangeLogDTO
>();
Page
<
IntegralMallExchangeLogDTO
>
page
=
new
Page
<
IntegralMallExchangeLogDTO
>();
page
.
setPageSize
(
1
);
page
.
setPageSize
(
1
);
page
.
setCurrentPage
(
1
);
page
.
setCurrentPage
(
1
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"enterpriseId"
,
enterpriseId
);
params
.
put
(
"enterpriseId"
,
enterpriseId
);
params
.
put
(
"proType"
,
2
);
params
.
put
(
"proType"
,
2
);
params
.
put
(
"changeType"
,
4
);
params
.
put
(
"changeType"
,
4
);
// 订单状态
// 订单状态
params
.
put
(
"orderStatus"
,
1
);
params
.
put
(
"orderStatus"
,
1
);
params
.
put
(
"goodsPointStoreId"
,
storeId
);
params
.
put
(
"goodsPointStoreId"
,
storeId
);
page
.
setParams
(
params
);
page
.
setParams
(
params
);
page
=
integralmallService
.
listOnlineByPage
(
page
);
page
=
integralmallService
.
listOnlineByPage
(
page
);
int
integralUndoneCount
=
page
.
getTotalCount
();
int
integralUndoneCount
=
page
.
getTotalCount
();
int
integralDoneCount
=
this
.
orderVerificationRecordApiService
.
countByGicClerkId
(
clerkId
);
int
integralDoneCount
=
this
.
orderVerificationRecordApiService
.
countByGicClerkId
(
clerkId
);
// 查询微商城
// 查询微商城
int
mallDoneCount
=
this
.
count
(
enterpriseId
,
storeId
,
clerkId
,
4
);
int
mallDoneCount
=
this
.
count
(
enterpriseId
,
storeId
,
clerkId
,
4
);
int
mallUndoneCount
=
this
.
count
(
enterpriseId
,
storeId
,
clerkId
,
2
);
int
mallUndoneCount
=
this
.
count
(
enterpriseId
,
storeId
,
clerkId
,
2
);
HxOrderCountVO
vo
=
new
HxOrderCountVO
();
HxOrderCountVO
vo
=
new
HxOrderCountVO
();
vo
.
setIntegralDoneCount
(
integralDoneCount
);
vo
.
setIntegralDoneCount
(
integralDoneCount
);
vo
.
setIntegralUndoneCount
(
integralUndoneCount
);
vo
.
setIntegralUndoneCount
(
integralUndoneCount
);
vo
.
setMallDoneCount
(
mallDoneCount
);
vo
.
setMallDoneCount
(
mallDoneCount
);
vo
.
setMallUndoneCount
(
mallUndoneCount
);
vo
.
setMallUndoneCount
(
mallUndoneCount
);
vo
.
setTotalDoneCount
(
integralDoneCount
+
mallDoneCount
);
vo
.
setTotalDoneCount
(
integralDoneCount
+
mallDoneCount
);
vo
.
setTotalUndownCount
(
integralUndoneCount
+
mallUndoneCount
);
vo
.
setTotalUndownCount
(
integralUndoneCount
+
mallUndoneCount
);
return
RestResponse
.
successResult
(
vo
);
return
RestResponse
.
successResult
(
vo
);
}
}
private
int
count
(
String
enterpriseId
,
String
storeId
,
String
clerkId
,
int
step
)
{
private
int
count
(
String
enterpriseId
,
String
storeId
,
String
clerkId
,
int
step
)
{
// 查询门店
// 查询门店
ListOrderManageQDTO
qdto
=
new
ListOrderManageQDTO
();
ListOrderManageQDTO
qdto
=
new
ListOrderManageQDTO
();
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setEnterpriseId
(
enterpriseId
);
// 配送方式 -1:所有 2:门店自提 1:快递发货
// 配送方式 -1:所有 2:门店自提 1:快递发货
qdto
.
setDeliveryChannel
(
2
);
qdto
.
setDeliveryChannel
(
2
);
qdto
.
setPickUpStoreId
(
storeId
);
qdto
.
setPickUpStoreId
(
storeId
);
if
(
step
==
4
)
{
if
(
step
==
4
)
{
qdto
.
setWriteOffClerkId
(
clerkId
);
qdto
.
setWriteOffClerkId
(
clerkId
);
qdto
.
setDeliveryOptType
(
1
);
qdto
.
setDeliveryOptType
(
1
);
}
}
qdto
.
setOrderStep
(
""
+
step
);
qdto
.
setOrderStep
(
""
+
step
);
qdto
.
setBusinessType
(
OrderEnum
.
BusinessTypeEnum
.
MICRO_MALL
.
getType
());
qdto
.
setBusinessType
(
OrderEnum
.
BusinessTypeEnum
.
MICRO_MALL
.
getType
());
qdto
.
setPageNum
(
1
);
qdto
.
setPageNum
(
1
);
qdto
.
setPageSize
(
1
);
qdto
.
setPageSize
(
1
);
ServiceResponse
<
Page
<
ListOrderDTO
>>
ret
=
webOrderManageApiService
.
listOrder
(
qdto
);
ServiceResponse
<
Page
<
ListOrderDTO
>>
ret
=
webOrderManageApiService
.
listOrder
(
qdto
);
logger
.
info
(
"核销订单数={}"
);
logger
.
info
(
"核销订单数={}"
);
return
ret
.
getResult
().
getTotalCount
();
return
ret
.
getResult
().
getTotalCount
();
}
}
// 订单详情
// 订单详情
private
OrderDetailVO
getOrderDetail
(
String
enterpriseId
,
OrderInfoDTO
orderInfo
,
private
OrderDetailVO
getOrderDetail
(
String
enterpriseId
,
OrderInfoDTO
orderInfo
,
List
<
ListOrderItemDTO
>
orderItemDTOList
,
String
storeId
)
{
List
<
ListOrderItemDTO
>
orderItemDTOList
,
String
storeId
)
{
OrderDetailVO
orderDetailVO
=
EntityUtil
.
changeEntityByJSON
(
OrderDetailVO
.
class
,
orderInfo
);
OrderDetailVO
orderDetailVO
=
EntityUtil
.
changeEntityByJSON
(
OrderDetailVO
.
class
,
orderInfo
);
orderDetailVO
.
setBuyerRemark
(
orderInfo
.
getRemarks
());
orderDetailVO
.
setBuyerRemark
(
orderInfo
.
getRemarks
());
List
<
OrderDetailItemVO
>
orderItemList
=
EntityUtil
.
changeEntityListNew
(
OrderDetailItemVO
.
class
,
List
<
OrderDetailItemVO
>
orderItemList
=
EntityUtil
.
changeEntityListNew
(
OrderDetailItemVO
.
class
,
orderItemDTOList
);
orderItemDTOList
);
orderDetailVO
.
setOrderItemList
(
orderItemList
);
orderDetailVO
.
setOrderItemList
(
orderItemList
);
String
memberId
=
orderInfo
.
getMemberId
();
String
memberId
=
orderInfo
.
getMemberId
();
MemberInfoVO
member
=
new
MemberInfoVO
();
MemberInfoVO
member
=
new
MemberInfoVO
();
member
.
setMemberId
(
memberId
);
member
.
setMemberId
(
memberId
);
if
(
StringUtils
.
isNotEmpty
(
memberId
))
{
if
(
StringUtils
.
isNotEmpty
(
memberId
))
{
ServiceResponse
<
MemberStoreInfoDTO
>
memberResp
=
this
.
memberReferClerkApiService
.
getMemberInfo
(
enterpriseId
,
ServiceResponse
<
MemberStoreInfoDTO
>
memberResp
=
this
.
memberReferClerkApiService
.
getMemberInfo
(
enterpriseId
,
memberId
);
memberId
);
MemberStoreInfoDTO
memberInfo
=
memberResp
.
getResult
();
MemberStoreInfoDTO
memberInfo
=
memberResp
.
getResult
();
if
(
null
!=
memberInfo
)
{
if
(
null
!=
memberInfo
)
{
member
=
EntityUtil
.
changeEntityByJSON
(
MemberInfoVO
.
class
,
memberInfo
);
member
=
EntityUtil
.
changeEntityByJSON
(
MemberInfoVO
.
class
,
memberInfo
);
}
}
}
}
member
.
setAddressPhone
(
orderInfo
.
getBuyerPhone
());
member
.
setAddressPhone
(
orderInfo
.
getBuyerPhone
());
member
.
setAddressName
(
orderInfo
.
getBuyerName
());
member
.
setAddressName
(
orderInfo
.
getBuyerName
());
member
.
setAddressDetail
(
orderInfo
.
getFullName
()
+
orderInfo
.
getAddressInfo
());
member
.
setAddressDetail
(
orderInfo
.
getFullName
()
+
orderInfo
.
getAddressInfo
());
orderDetailVO
.
setAddressInfo
(
orderInfo
.
getFullName
()
+
orderInfo
.
getAddressInfo
());
orderDetailVO
.
setAddressInfo
(
orderInfo
.
getFullName
()
+
orderInfo
.
getAddressInfo
());
orderDetailVO
.
setMember
(
member
);
orderDetailVO
.
setMember
(
member
);
// 判断能否发货
// 判断能否发货
// 导购发货,一笔订单仅允许单门店发货
// 导购发货,一笔订单仅允许单门店发货
boolean
canDeliverFlag
=
false
;
boolean
canDeliverFlag
=
false
;
// 发货操作类型(0后台/1好办门店):用于判断好办操作发货还是后台,防止双边发货
// 发货操作类型(0后台/1好办门店):用于判断好办操作发货还是后台,防止双边发货
Integer
deliveryOptType
=
orderInfo
.
getDeliveryOptType
();
Integer
deliveryOptType
=
orderInfo
.
getDeliveryOptType
();
logger
.
info
(
"发货类型1好办={},orderId={}"
,
deliveryOptType
,
orderInfo
.
getOrderId
());
logger
.
info
(
"发货类型1好办={},orderId={}"
,
deliveryOptType
,
orderInfo
.
getOrderId
());
if
(
null
==
deliveryOptType
)
{
if
(
null
==
deliveryOptType
)
{
canDeliverFlag
=
true
;
canDeliverFlag
=
true
;
}
else
if
(
deliveryOptType
==
1
)
{
}
else
if
(
deliveryOptType
==
1
)
{
canDeliverFlag
=
true
;
canDeliverFlag
=
true
;
}
}
orderDetailVO
.
setCanDeliverFlag
(
canDeliverFlag
);
orderDetailVO
.
setCanDeliverFlag
(
canDeliverFlag
);
// 核销导购
// 核销导购
String
verificationClerkName
=
orderInfo
.
getWriteOffClerkName
();
String
verificationClerkName
=
orderInfo
.
getWriteOffClerkName
();
orderDetailVO
.
setVerificationClerkName
(
verificationClerkName
);
orderDetailVO
.
setVerificationClerkName
(
verificationClerkName
);
return
orderDetailVO
;
return
orderDetailVO
;
}
}
// 订单列表
// 订单列表
private
RestResponse
<
Object
>
orderListSelect
(
ListOrderManageQDTO
qdto
,
BasePageInfo
pageInfo
,
boolean
evaluteFlag
)
{
private
RestResponse
<
Object
>
orderListSelect
(
ListOrderManageQDTO
qdto
,
BasePageInfo
pageInfo
,
boolean
evaluteFlag
)
{
qdto
.
setPageNum
(
pageInfo
.
getPageNum
());
qdto
.
setPageNum
(
pageInfo
.
getPageNum
());
qdto
.
setPageSize
(
pageInfo
.
getPageSize
());
qdto
.
setPageSize
(
pageInfo
.
getPageSize
());
ServiceResponse
<
Page
<
ListOrderDTO
>>
ret
=
webOrderManageApiService
.
listOrder
(
qdto
);
ServiceResponse
<
Page
<
ListOrderDTO
>>
ret
=
webOrderManageApiService
.
listOrder
(
qdto
);
logger
.
info
(
"订单信息={}"
,
JSON
.
toJSONString
(
ret
,
true
));
logger
.
info
(
"订单信息={}"
,
JSON
.
toJSONString
(
ret
,
true
));
if
(
ret
.
isSuccess
())
{
if
(
ret
.
isSuccess
())
{
Page
<
ListOrderDTO
>
page
=
ret
.
getResult
();
Page
<
ListOrderDTO
>
page
=
ret
.
getResult
();
List
<
OrderListVO
>
voList
=
new
ArrayList
<>();
List
<
OrderListVO
>
voList
=
new
ArrayList
<>();
List
<
String
>
orderIdList
=
new
ArrayList
<>();
List
<
String
>
orderIdList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
page
.
getResult
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
page
.
getResult
()))
{
List
<
ListOrderDTO
>
orderList
=
page
.
getResult
();
List
<
ListOrderDTO
>
orderList
=
page
.
getResult
();
for
(
ListOrderDTO
order
:
orderList
)
{
for
(
ListOrderDTO
order
:
orderList
)
{
orderIdList
.
add
(
order
.
getOrderId
());
orderIdList
.
add
(
order
.
getOrderId
());
OrderListVO
vo
=
EntityUtil
.
changeEntityByJSON
(
OrderListVO
.
class
,
order
);
OrderListVO
vo
=
EntityUtil
.
changeEntityByJSON
(
OrderListVO
.
class
,
order
);
List
<
ListOrderItemDTO
>
itemList
=
order
.
getOrderItemDTOList
();
List
<
ListOrderItemDTO
>
itemList
=
order
.
getOrderItemDTOList
();
List
<
OrderListItemVO
>
voItemList
=
EntityUtil
.
changeEntityListNew
(
OrderListItemVO
.
class
,
itemList
);
List
<
OrderListItemVO
>
voItemList
=
EntityUtil
.
changeEntityListNew
(
OrderListItemVO
.
class
,
itemList
);
vo
.
setOrderItemList
(
voItemList
);
vo
.
setOrderItemList
(
voItemList
);
vo
.
setPickUpTime
(
order
.
getWriteOffTime
());
vo
.
setPickUpTime
(
order
.
getWriteOffTime
());
// 核销导购
// 核销导购
String
verificationClerkName
=
order
.
getWriteOffClerkName
();
String
verificationClerkName
=
order
.
getWriteOffClerkName
();
vo
.
setVerificationClerkName
(
verificationClerkName
);
vo
.
setVerificationClerkName
(
verificationClerkName
);
String
clerkId
=
order
.
getBelongClerkId
();
String
clerkId
=
order
.
getBelongClerkId
();
if
(
StringUtils
.
isNotEmpty
(
clerkId
))
{
if
(
StringUtils
.
isNotEmpty
(
clerkId
))
{
ClerkDTO
clerkDTO
=
this
.
clerkService
.
getclerkById
(
clerkId
);
ClerkDTO
clerkDTO
=
this
.
clerkService
.
getclerkById
(
clerkId
);
if
(
null
!=
clerkDTO
)
{
if
(
null
!=
clerkDTO
)
{
vo
.
setBelongClerkName
(
clerkDTO
.
getClerkName
());
vo
.
setBelongClerkName
(
clerkDTO
.
getClerkName
());
}
}
}
}
voList
.
add
(
vo
);
voList
.
add
(
vo
);
}
}
}
}
String
enterpriseId
=
qdto
.
getEnterpriseId
();
String
enterpriseId
=
qdto
.
getEnterpriseId
();
// 评价
// 评价
if
(
evaluteFlag
&&
CollectionUtils
.
isNotEmpty
(
orderIdList
))
{
if
(
evaluteFlag
&&
CollectionUtils
.
isNotEmpty
(
orderIdList
))
{
ServiceResponse
<
List
<
StoreEvaluateInfoDTO
>>
evaluateResp
=
evaluateDataApiService
ServiceResponse
<
List
<
StoreEvaluateInfoDTO
>>
evaluateResp
=
evaluateDataApiService
.
getEvaluateScoreAndContent
(
enterpriseId
,
orderIdList
);
.
getEvaluateScoreAndContent
(
enterpriseId
,
orderIdList
);
Map
<
String
,
List
<
EvaluateVO
>>
evaluateMap
=
Optional
.
ofNullable
(
evaluateResp
)
Map
<
String
,
List
<
EvaluateVO
>>
evaluateMap
=
Optional
.
ofNullable
(
evaluateResp
)
.
map
(
ServiceResponse:
:
getResult
).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
data
->
{
.
map
(
ServiceResponse:
:
getResult
).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
data
->
{
EvaluateVO
evaluateVO
=
new
EvaluateVO
();
EvaluateVO
evaluateVO
=
new
EvaluateVO
();
String
evaluateContent
=
data
.
getEvaluateContent
();
String
evaluateContent
=
data
.
getEvaluateContent
();
evaluateVO
.
setEvaluateScoreList
(
new
ArrayList
<>());
evaluateVO
.
setEvaluateScoreList
(
new
ArrayList
<>());
if
(
CollectionUtils
.
isNotEmpty
(
data
.
getEvaluateRuleScores
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
data
.
getEvaluateRuleScores
()))
{
for
(
EvaluateRuleScoreDTO
evaluateScoresDTO
:
data
.
getEvaluateRuleScores
())
{
for
(
EvaluateRuleScoreDTO
evaluateScoresDTO
:
data
.
getEvaluateRuleScores
())
{
EvaluateVO
.
EvaluateScore
evaluateScore
=
new
EvaluateVO
.
EvaluateScore
();
EvaluateVO
.
EvaluateScore
evaluateScore
=
new
EvaluateVO
.
EvaluateScore
();
evaluateScore
.
setName
(
evaluateScoresDTO
.
getRuleName
());
evaluateScore
.
setName
(
evaluateScoresDTO
.
getRuleName
());
evaluateScore
.
setValue
(
evaluateScoresDTO
.
getScore
());
evaluateScore
.
setValue
(
evaluateScoresDTO
.
getScore
());
evaluateVO
.
getEvaluateScoreList
().
add
(
evaluateScore
);
evaluateVO
.
getEvaluateScoreList
().
add
(
evaluateScore
);
}
}
}
}
evaluateVO
.
setReviews
(
evaluateContent
);
evaluateVO
.
setReviews
(
evaluateContent
);
evaluateVO
.
setOrderId
(
data
.
getOrderId
());
evaluateVO
.
setOrderId
(
data
.
getOrderId
());
return
evaluateVO
;
return
evaluateVO
;
}).
collect
(
Collectors
.
groupingBy
(
EvaluateVO:
:
getOrderId
));
}).
collect
(
Collectors
.
groupingBy
(
EvaluateVO:
:
getOrderId
));
voList
.
forEach
(
item
->
{
voList
.
forEach
(
item
->
{
if
(
null
!=
evaluateMap
.
get
(
item
.
getOrderId
()))
{
if
(
null
!=
evaluateMap
.
get
(
item
.
getOrderId
()))
{
item
.
setEvaluateVO
(
evaluateMap
.
get
(
item
.
getOrderId
()).
get
(
0
));
item
.
setEvaluateVO
(
evaluateMap
.
get
(
item
.
getOrderId
()).
get
(
0
));
}
}
});
});
}
}
Page
<
OrderListVO
>
retPage
=
PageHelperUtils
.
changePageToCurrentPage
(
ret
.
getResult
(),
OrderListVO
.
class
);
Page
<
OrderListVO
>
retPage
=
PageHelperUtils
.
changePageToCurrentPage
(
ret
.
getResult
(),
OrderListVO
.
class
);
retPage
.
setResult
(
voList
);
retPage
.
setResult
(
voList
);
return
RestResponse
.
successResult
(
retPage
);
return
RestResponse
.
successResult
(
retPage
);
}
}
return
RestResponse
.
failure
(
ret
.
getCode
(),
ret
.
getMessage
());
return
RestResponse
.
failure
(
ret
.
getCode
(),
ret
.
getMessage
());
}
}
private
String
createIntegralRecord
(
String
enterpriseId
,
int
status
,
ClerkQo
clerkDTO
,
String
writeOffCode
)
{
private
String
createIntegralRecord
(
String
enterpriseId
,
int
status
,
ClerkQo
clerkDTO
,
String
writeOffCode
)
{
DubboResult
<
IntegralMallExchangeLogDTO
>
integralResult
=
integralmallService
DubboResult
<
IntegralMallExchangeLogDTO
>
integralResult
=
integralmallService
.
getIntegralMallExchangeLogByWriteOffCode
(
enterpriseId
,
writeOffCode
);
.
getIntegralMallExchangeLogByWriteOffCode
(
enterpriseId
,
writeOffCode
);
IntegralMallExchangeLogDTO
data
=
integralResult
.
getData
();
IntegralMallExchangeLogDTO
data
=
integralResult
.
getData
();
CreateRecordRequest
record
=
new
CreateRecordRequest
();
CreateRecordRequest
record
=
new
CreateRecordRequest
();
record
.
setRecordId
(
data
.
getIntegralMallProExchangeId
());
record
.
setRecordId
(
data
.
getIntegralMallProExchangeId
());
record
.
setStatus
(
status
);
record
.
setStatus
(
status
);
record
.
setEnterpriseId
(
data
.
getEnterpriseId
());
record
.
setEnterpriseId
(
data
.
getEnterpriseId
());
record
.
setExchangeId
(
data
.
getIntegralMallProExchangeId
());
record
.
setExchangeId
(
data
.
getIntegralMallProExchangeId
());
record
.
setFinishTime
(
data
.
getFinishTime
());
record
.
setFinishTime
(
data
.
getFinishTime
());
record
.
setWriteOffCode
(
data
.
getWriteOffCode
());
record
.
setWriteOffCode
(
data
.
getWriteOffCode
());
// 提货人
// 提货人
record
.
setConsignee
(
data
.
getGoodsPerson
());
record
.
setConsignee
(
data
.
getGoodsPerson
());
record
.
setConsigneePhone
(
data
.
getGoodsPhone
());
record
.
setConsigneePhone
(
data
.
getGoodsPhone
());
record
.
setPoint
(
data
.
getGoodsPoint
());
record
.
setPoint
(
data
.
getGoodsPoint
());
record
.
setAddress
(
data
.
getGoodsAddress
());
record
.
setAddress
(
data
.
getGoodsAddress
());
record
.
setTakeTime
(
data
.
getGoodsTime
());
record
.
setTakeTime
(
data
.
getGoodsTime
());
record
.
setFetchCode
(
writeOffCode
);
record
.
setFetchCode
(
writeOffCode
);
// 核销人
// 核销人
record
.
setClerkId
(
clerkDTO
.
getClerkId
());
record
.
setClerkId
(
clerkDTO
.
getClerkId
());
record
.
setClerkCode
(
clerkDTO
.
getClerkCode
());
record
.
setClerkCode
(
clerkDTO
.
getClerkCode
());
record
.
setClerkName
(
clerkDTO
.
getClerkName
());
record
.
setClerkName
(
clerkDTO
.
getClerkName
());
record
.
setHaobanClerkId
(
clerkDTO
.
getHaobanClerkId
());
record
.
setHaobanClerkId
(
clerkDTO
.
getHaobanClerkId
());
record
.
setHaobanEnterpriseId
(
clerkDTO
.
getHaobanEnterpriseId
());
record
.
setHaobanEnterpriseId
(
clerkDTO
.
getHaobanEnterpriseId
());
// 商品信息
// 商品信息
OrderProductRequest
productDTO
=
new
OrderProductRequest
();
OrderProductRequest
productDTO
=
new
OrderProductRequest
();
productDTO
.
setProName
(
data
.
getProName
());
productDTO
.
setProName
(
data
.
getProName
());
productDTO
.
setProImage
(
data
.
getPhotoUrl
());
productDTO
.
setProImage
(
data
.
getPhotoUrl
());
productDTO
.
setProCode
(
data
.
getProCode
());
productDTO
.
setProCode
(
data
.
getProCode
());
productDTO
.
setProNumber
(
data
.
getGoodsNum
());
productDTO
.
setProNumber
(
data
.
getGoodsNum
());
productDTO
.
setProSku
(
productDTO
.
setProSku
(
StringUtils
.
isBlank
(
data
.
getSku
())
?
"[]"
:
JSONArray
.
parseArray
(
data
.
getSku
()).
toJSONString
());
StringUtils
.
isBlank
(
data
.
getSku
())
?
"[]"
:
JSONArray
.
parseArray
(
data
.
getSku
()).
toJSONString
());
productDTO
.
setProPrice
((
data
.
getCashShouldPay
()
/
data
.
getGoodsNum
()));
productDTO
.
setProPrice
((
data
.
getCashShouldPay
()
/
data
.
getGoodsNum
()));
productDTO
.
setProIntegral
((
data
.
getIntegralShouldPay
()
/
data
.
getGoodsNum
()));
productDTO
.
setProIntegral
((
data
.
getIntegralShouldPay
()
/
data
.
getGoodsNum
()));
List
<
OrderProductRequest
>
productDTOS
=
new
ArrayList
<>(
2
);
List
<
OrderProductRequest
>
productDTOS
=
new
ArrayList
<>(
2
);
productDTOS
.
add
(
productDTO
);
productDTOS
.
add
(
productDTO
);
record
.
setProducts
(
productDTOS
);
record
.
setProducts
(
productDTOS
);
record
.
setCreateTime
(
data
.
getCreateTime
());
record
.
setCreateTime
(
data
.
getCreateTime
());
record
.
setUpdateTime
(
new
Date
());
record
.
setUpdateTime
(
new
Date
());
// 订单信息
// 订单信息
record
.
setAllCostIntegral
(
data
.
getAllCostIntegral
());
record
.
setAllCostIntegral
(
data
.
getAllCostIntegral
());
record
.
setPayCost
(
data
.
getPayCost
());
record
.
setPayCost
(
data
.
getPayCost
());
record
.
setOrderNo
(
data
.
getDefinedCode
());
record
.
setOrderNo
(
data
.
getDefinedCode
());
record
.
setPayNumber
(
data
.
getPayNumber
());
record
.
setPayNumber
(
data
.
getPayNumber
());
record
.
setPayTime
(
data
.
getPayTime
());
record
.
setPayTime
(
data
.
getPayTime
());
record
.
setOrigin
(
2
);
record
.
setOrigin
(
2
);
return
orderVerificationRecordApiService
.
createRecord
(
record
);
return
orderVerificationRecordApiService
.
createRecord
(
record
);
}
}
private
ScanVO
integralMallScan
(
IntegralMallExchangeLogDTO
exchangeLogDTO
)
{
private
ScanVO
integralMallScan
(
IntegralMallExchangeLogDTO
exchangeLogDTO
)
{
ScanVO
scanVO
=
new
ScanVO
();
ScanVO
scanVO
=
new
ScanVO
();
scanVO
.
setHasOrder
(
1
);
scanVO
.
setHasOrder
(
1
);
scanVO
.
setOrderNo
(
exchangeLogDTO
.
getDefinedCode
());
scanVO
.
setOrderNo
(
exchangeLogDTO
.
getDefinedCode
());
scanVO
.
setEnterpriseId
(
exchangeLogDTO
.
getEnterpriseId
());
scanVO
.
setEnterpriseId
(
exchangeLogDTO
.
getEnterpriseId
());
scanVO
.
setExchangeId
(
exchangeLogDTO
.
getIntegralMallProExchangeId
());
scanVO
.
setExchangeId
(
exchangeLogDTO
.
getIntegralMallProExchangeId
());
scanVO
.
setAllCostIntegral
(
exchangeLogDTO
.
getAllCostIntegral
());
scanVO
.
setAllCostIntegral
(
exchangeLogDTO
.
getAllCostIntegral
());
scanVO
.
setPayCost
(
exchangeLogDTO
.
getPayCost
());
scanVO
.
setPayCost
(
exchangeLogDTO
.
getPayCost
());
scanVO
.
setPayNumber
(
exchangeLogDTO
.
getPayNumber
());
scanVO
.
setPayNumber
(
exchangeLogDTO
.
getPayNumber
());
scanVO
.
setPayTime
(
exchangeLogDTO
.
getPayTime
());
scanVO
.
setPayTime
(
exchangeLogDTO
.
getPayTime
());
ProductVO
productVO
=
new
ProductVO
();
ProductVO
productVO
=
new
ProductVO
();
productVO
.
setProName
(
exchangeLogDTO
.
getProName
());
productVO
.
setProName
(
exchangeLogDTO
.
getProName
());
productVO
.
setProCode
(
exchangeLogDTO
.
getProCode
());
productVO
.
setProCode
(
exchangeLogDTO
.
getProCode
());
productVO
.
setProSku
(
StringUtils
.
isBlank
(
exchangeLogDTO
.
getSku
())
?
new
ArrayList
<>()
productVO
.
setProSku
(
StringUtils
.
isBlank
(
exchangeLogDTO
.
getSku
())
?
new
ArrayList
<>()
:
JSONArray
.
parseArray
(
exchangeLogDTO
.
getSku
(),
ProductSku
.
class
));
:
JSONArray
.
parseArray
(
exchangeLogDTO
.
getSku
(),
ProductSku
.
class
));
productVO
.
setProNumber
(
exchangeLogDTO
.
getGoodsNum
());
productVO
.
setProNumber
(
exchangeLogDTO
.
getGoodsNum
());
productVO
.
setProImage
(
exchangeLogDTO
.
getPhotoUrl
());
productVO
.
setProImage
(
exchangeLogDTO
.
getPhotoUrl
());
productVO
.
setProPrice
((
exchangeLogDTO
.
getCashShouldPay
()
/
exchangeLogDTO
.
getGoodsNum
()));
productVO
.
setProPrice
((
exchangeLogDTO
.
getCashShouldPay
()
/
exchangeLogDTO
.
getGoodsNum
()));
productVO
.
setProIntegral
((
exchangeLogDTO
.
getIntegralShouldPay
()
/
exchangeLogDTO
.
getGoodsNum
()));
productVO
.
setProIntegral
((
exchangeLogDTO
.
getIntegralShouldPay
()
/
exchangeLogDTO
.
getGoodsNum
()));
scanVO
.
pushProduct
(
productVO
);
scanVO
.
pushProduct
(
productVO
);
scanVO
.
setWriteOffCode
(
exchangeLogDTO
.
getWriteOffCode
());
scanVO
.
setWriteOffCode
(
exchangeLogDTO
.
getWriteOffCode
());
scanVO
.
setFetchCode
(
exchangeLogDTO
.
getWriteOffCode
());
scanVO
.
setFetchCode
(
exchangeLogDTO
.
getWriteOffCode
());
scanVO
.
setConsignee
(
exchangeLogDTO
.
getGoodsPerson
());
scanVO
.
setConsignee
(
exchangeLogDTO
.
getGoodsPerson
());
scanVO
.
setConsigneePhone
(
exchangeLogDTO
.
getGoodsPhone
());
scanVO
.
setConsigneePhone
(
exchangeLogDTO
.
getGoodsPhone
());
scanVO
.
setPoint
(
exchangeLogDTO
.
getGoodsPoint
());
scanVO
.
setPoint
(
exchangeLogDTO
.
getGoodsPoint
());
scanVO
.
setAddress
(
exchangeLogDTO
.
getGoodsAddress
());
scanVO
.
setAddress
(
exchangeLogDTO
.
getGoodsAddress
());
scanVO
.
setTakeTime
(
exchangeLogDTO
.
getGoodsTime
());
scanVO
.
setTakeTime
(
exchangeLogDTO
.
getGoodsTime
());
scanVO
.
setCreateTime
(
exchangeLogDTO
.
getCreateTime
());
scanVO
.
setCreateTime
(
exchangeLogDTO
.
getCreateTime
());
// 兑换状态 -2兑换取消(退货) -1兑换无效 0兑换取消(礼品未付款) 11兑换中(加钱购待支付) 3已发货(礼品) 1兑换功成
// 兑换状态 -2兑换取消(退货) -1兑换无效 0兑换取消(礼品未付款) 11兑换中(加钱购待支付) 3已发货(礼品) 1兑换功成
// 2领取(卡券) 4成功
// 2领取(卡券) 4成功
// 其实只需要 1 2 4
// 其实只需要 1 2 4
scanVO
.
setStatus
(
exchangeLogDTO
.
getStatus
()
==
4
?
1
:
0
);
scanVO
.
setStatus
(
exchangeLogDTO
.
getStatus
()
==
4
?
1
:
0
);
scanVO
.
setChecked
(
0
);
scanVO
.
setChecked
(
0
);
if
(
scanVO
.
getStatus
()
==
1
)
{
if
(
scanVO
.
getStatus
()
==
1
)
{
scanVO
.
setRecordId
(
exchangeLogDTO
.
getIntegralMallProExchangeId
());
scanVO
.
setRecordId
(
exchangeLogDTO
.
getIntegralMallProExchangeId
());
OrderVerificationRecordDTO
info
=
orderVerificationRecordApiService
.
recordInfo
(
scanVO
.
getRecordId
());
OrderVerificationRecordDTO
info
=
orderVerificationRecordApiService
.
recordInfo
(
scanVO
.
getRecordId
());
if
(
null
!=
info
)
{
if
(
null
!=
info
)
{
// 说明已经核销了
// 说明已经核销了
scanVO
.
setFinishTime
(
info
.
getFinishTime
());
scanVO
.
setFinishTime
(
info
.
getFinishTime
());
scanVO
.
setChecked
(
1
);
scanVO
.
setChecked
(
1
);
}
}
if
(
exchangeLogDTO
.
getStatus
()
==
IntegralMallExchangeLogStatusEnums
.
CONFIRM
.
getStatus
())
{
if
(
exchangeLogDTO
.
getStatus
()
==
IntegralMallExchangeLogStatusEnums
.
CONFIRM
.
getStatus
())
{
scanVO
.
setFinishTime
(
exchangeLogDTO
.
getFinishTime
());
scanVO
.
setFinishTime
(
exchangeLogDTO
.
getFinishTime
());
scanVO
.
setChecked
(
1
);
scanVO
.
setChecked
(
1
);
}
}
}
}
return
scanVO
;
return
scanVO
;
}
}
}
}
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