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
20127ca8
Commit
20127ca8
authored
Jul 05, 2023
by
王祖波
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-content3' into 'master'
Feature content3 See merge request
!1345
parents
2c475469
d1adb4e2
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
691 additions
and
14 deletions
+691
-14
ClerkCashListQDTO.java
...haoban/manage/api/dto/qdto/content/ClerkCashListQDTO.java
+34
-0
ClerkCashNotifyQDTO.java
...oban/manage/api/dto/qdto/content/ClerkCashNotifyQDTO.java
+42
-0
ClerkCommissionStaticsDTO.java
.../dto/statistics/commission/ClerkCommissionStaticsDTO.java
+65
-0
AlertTypeEnum.java
...n/java/com/gic/haoban/manage/api/enums/AlertTypeEnum.java
+1
-1
NoticeMessageTypeEnum.java
...om/gic/haoban/manage/api/enums/NoticeMessageTypeEnum.java
+5
-1
CommissionTaskApiService.java
...ge/api/service/content/task/CommissionTaskApiService.java
+26
-0
SecretSettingApiService.java
...aoban/manage/api/service/out/SecretSettingApiService.java
+15
-0
SecretSettingMapper.java
...haoban/manage/service/dao/mapper/SecretSettingMapper.java
+11
-0
ClerkCommissionStaticsBO.java
.../service/pojo/bo/commission/ClerkCommissionStaticsBO.java
+36
-0
SecretSettingService.java
...c/haoban/manage/service/service/SecretSettingService.java
+8
-2
CommissionNotifyInnerService.java
...vice/service/commission/CommissionNotifyInnerService.java
+129
-0
SecretSettingServiceImpl.java
...manage/service/service/impl/SecretSettingServiceImpl.java
+7
-0
NoticeMessageHandler.java
.../manage/service/service/message/NoticeMessageHandler.java
+35
-5
CheckQywxSettingApiServiceImpl.java
...vice/service/out/impl/CheckQywxSettingApiServiceImpl.java
+2
-0
SecretSettingApiServiceImpl.java
...service/service/out/impl/SecretSettingApiServiceImpl.java
+10
-0
CommissionTaskApiServiceImpl.java
...e/out/impl/content/task/CommissionTaskApiServiceImpl.java
+55
-0
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+4
-0
SecretSettingMapper.xml
...service/src/main/resources/mapper/SecretSettingMapper.xml
+16
-0
CommissionClerkTest.java
...an-manage3-service/src/test/java/CommissionClerkTest.java
+28
-0
HmLinkTest.java
haoban-manage3-service/src/test/java/HmLinkTest.java
+1
-1
pom.xml
haoban-manage3-wx/pom.xml
+6
-0
CommissionManager.java
...n/manage/web/controller/commission/CommissionManager.java
+97
-0
ContentMaterialController.java
...age/web/controller/content/ContentMaterialController.java
+17
-3
GoodsInfoAdaptor.java
.../haoban/manage/web/controller/goods/GoodsInfoAdaptor.java
+27
-1
ContentMaterialShareInfoVO.java
...ban/manage/web/vo/content/ContentMaterialShareInfoVO.java
+5
-0
SimpleGoodsInfoVO.java
...m/gic/haoban/manage/web/vo/content/SimpleGoodsInfoVO.java
+5
-0
dubbo-haoban-manage-wx.xml
...ge3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
+4
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/qdto/content/ClerkCashListQDTO.java
0 → 100644
View file @
20127ca8
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
qdto
.
content
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
public
class
ClerkCashListQDTO
implements
Serializable
{
/**
* 导购id
*/
private
String
clerkId
;
/**
* 佣金金额
*/
private
BigDecimal
applyAmount
;
public
String
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
BigDecimal
getApplyAmount
()
{
return
applyAmount
;
}
public
void
setApplyAmount
(
BigDecimal
applyAmount
)
{
this
.
applyAmount
=
applyAmount
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/qdto/content/ClerkCashNotifyQDTO.java
0 → 100644
View file @
20127ca8
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
qdto
.
content
;
import
com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
ClerkCashNotifyQDTO
implements
Serializable
{
/**
* 企业id
*/
private
String
enterpriseId
;
private
List
<
ClerkCashListQDTO
>
cashList
;
private
NoticeMessageTypeEnum
cashTypeEnum
;
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
List
<
ClerkCashListQDTO
>
getCashList
()
{
return
cashList
;
}
public
void
setCashList
(
List
<
ClerkCashListQDTO
>
cashList
)
{
this
.
cashList
=
cashList
;
}
public
NoticeMessageTypeEnum
getCashTypeEnum
()
{
return
cashTypeEnum
;
}
public
void
setCashTypeEnum
(
NoticeMessageTypeEnum
cashTypeEnum
)
{
this
.
cashTypeEnum
=
cashTypeEnum
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/statistics/commission/ClerkCommissionStaticsDTO.java
0 → 100644
View file @
20127ca8
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
statistics
.
commission
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* @Author MUSI
* @Date 2023/6/9 9:49 AM
* @Description
* @Version
**/
public
class
ClerkCommissionStaticsDTO
implements
Serializable
{
/**
* 企业id
*/
private
String
enterpriseId
;
/**
* 导购id
*/
private
String
clerkId
;
/**
* 客户数量
*/
private
Integer
memberCount
;
/**
* 佣金金额
*/
private
BigDecimal
commissionAmount
;
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
Integer
getMemberCount
()
{
return
memberCount
;
}
public
void
setMemberCount
(
Integer
memberCount
)
{
this
.
memberCount
=
memberCount
;
}
public
BigDecimal
getCommissionAmount
()
{
return
commissionAmount
;
}
public
void
setCommissionAmount
(
BigDecimal
commissionAmount
)
{
this
.
commissionAmount
=
commissionAmount
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/AlertTypeEnum.java
View file @
20127ca8
...
@@ -10,7 +10,7 @@ public enum AlertTypeEnum {
...
@@ -10,7 +10,7 @@ public enum AlertTypeEnum {
CLOUD_STORE_CHANGE
(
4
,
"观云台门店进回收站"
,
null
),
CLOUD_STORE_CHANGE
(
4
,
"观云台门店进回收站"
,
null
),
ES_BID_PAGE
(
5
,
"es查询存在大分页"
,
"https://oapi.dingtalk.com/robot/send?access_token=04b381d2b95816d28ed37c73d300537cbd2e67dc6670258ab85a6b3ef227d3b3"
),
ES_BID_PAGE
(
5
,
"es查询存在大分页"
,
"https://oapi.dingtalk.com/robot/send?access_token=04b381d2b95816d28ed37c73d300537cbd2e67dc6670258ab85a6b3ef227d3b3"
),
GET_NEW_EXTERNAL_USERID
(
6
,
"转换外部联系人id"
,
null
),
GET_NEW_EXTERNAL_USERID
(
6
,
"转换外部联系人id"
,
null
),
WEWORK_PAY
(
7
,
"向员工付款"
,
null
),
WEWORK_PAY
(
7
,
"向员工付款"
,
"https://oapi.dingtalk.com/robot/send?access_token=c5b67bc21d943eca362b951c9a7030822cec63b7220feb8cdcdfbc88b6438172"
),
FEE_ALARM
(
8
,
"30天后接口许可证即将到期"
,
"https://oapi.dingtalk.com/robot/send?access_token=8bff312a35700ae99a4b8a26d90038fe6bddc5e3e6a0a0d348c9c84c0473979a"
),
FEE_ALARM
(
8
,
"30天后接口许可证即将到期"
,
"https://oapi.dingtalk.com/robot/send?access_token=8bff312a35700ae99a4b8a26d90038fe6bddc5e3e6a0a0d348c9c84c0473979a"
),
;
;
private
Integer
type
;
private
Integer
type
;
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/NoticeMessageTypeEnum.java
View file @
20127ca8
...
@@ -75,11 +75,15 @@ public enum NoticeMessageTypeEnum {
...
@@ -75,11 +75,15 @@ public enum NoticeMessageTypeEnum {
//
//
MATERIAL_NEW_NOTIFY
(
6001
,
"素材上新通知"
,
NoticeMessageCategoryTypeEnum
.
MATERIAL
.
getType
(),
"material_new_notify"
,
"/pages/route/index?pageType="
,
"hbapp_material_center"
,
"materialsNotice"
,
"clerkMaterialsNotice"
),
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_WEEK
(
6002
,
"素材周报通知"
,
NoticeMessageCategoryTypeEnum
.
MATERIAL
.
getType
(),
"material_week_notify"
,
"/pages/route/index?pageType="
,
"hbapp_mate_report"
,
"materialWeek"
,
"clerkMaterialsReport"
),
POTENTIAL_CUSTOMER_NOTIFY
(
6003
,
"销售线索通知"
,
NoticeMessageCategoryTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
(),
"potential_customer_notify"
,
"/pages/route/index?pageType="
,
"hbapp_sales_clue_center"
,
"salesLeadNotice"
,
"haobanNotice"
),
MATERIAL_REPORT_NOTIFY_MONTH
(
6004
,
"素材月报通知"
,
NoticeMessageCategoryTypeEnum
.
MATERIAL
.
getType
(),
"material_month_notify"
,
"/pages/route/index?pageType="
,
"hbapp_mate_report"
,
"materialMonth"
,
"clerkMaterialsReport"
),
MATERIAL_REPORT_NOTIFY_MONTH
(
6004
,
"素材月报通知"
,
NoticeMessageCategoryTypeEnum
.
MATERIAL
.
getType
(),
"material_month_notify"
,
"/pages/route/index?pageType="
,
"hbapp_mate_report"
,
"materialMonth"
,
"clerkMaterialsReport"
),
CLERK_COMMISSION_NOTIFY
(
6005
,
"客户下单通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"clerk_commission_notify"
,
"/pages/route/index?pageType="
,
"hbapp_withdraw_list"
,
"clerkCommissionNotify"
,
"haobanNotice"
),
POTENTIAL_CUSTOMER_NOTIFY
(
6003
,
"销售线索通知"
,
NoticeMessageCategoryTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
(),
"potential_customer_notify"
,
"/pages/route/index?pageType="
,
"hbapp_sales_clue_center"
,
"salesLeadNotice"
,
"haobanNotice"
);
CASH_APPLY_REFUSE_NOTIFY
(
7001
,
"提现通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"cash_apply_refuse_notify"
,
"/pages/route/index?pageType="
,
"hbapp_withdraw_list"
,
"cashApplyRefuseNotify"
,
"haobanNotice"
),
CASH_APPLY_FAIL_NOTIFY
(
7002
,
"提现通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"cash_apply_fail_notify"
,
"/pages/route/index?pageType="
,
"hbapp_withdraw_list"
,
"cashApplyFailNotify"
,
"haobanNotice"
),
CASH_APPLY_OFFLINE_SUCCESS_NOTIFY
(
7003
,
"提现通知"
,
NoticeMessageCategoryTypeEnum
.
OTHER
.
getType
(),
"cash_apply_offline_success_notify"
,
"/pages/route/index?pageType="
,
"hbapp_withdraw_list"
,
"cashApplyOfflineSuccessNotify"
,
"haobanNotice"
);
/**
/**
* 消息类型
* 消息类型
*/
*/
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/content/task/CommissionTaskApiService.java
0 → 100644
View file @
20127ca8
package
com
.
gic
.
haoban
.
manage
.
api
.
service
.
content
.
task
;
import
com.gic.api.base.commons.ServiceResponse
;
/**
* @Author MUSI
* @Date 2023/6/7 2:15 PM
* @Description
* @Version
* 佣金统计接口
**/
public
interface
CommissionTaskApiService
{
/**
* 处理佣金消息通知
* @param prams
*/
ServiceResponse
<
Void
>
handlerCommissionNotify
(
String
prams
);
/**
* 处理提现消息通知
* @param params
* @return
*/
ServiceResponse
<
Void
>
handlerCashNotify
(
String
params
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/out/SecretSettingApiService.java
View file @
20127ca8
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.api.service.out;
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.api.service.out;
import
java.util.List
;
import
java.util.List
;
import
com.gic.haoban.manage.api.dto.SecretSettingDTO
;
import
com.gic.haoban.manage.api.dto.SecretSettingDTO
;
import
org.hibernate.event.spi.SaveOrUpdateEvent
;
/**
/**
* @author mozhu
* @author mozhu
...
@@ -17,5 +18,19 @@ public interface SecretSettingApiService {
...
@@ -17,5 +18,19 @@ public interface SecretSettingApiService {
*/
*/
SecretSettingDTO
getSecretSetting
(
String
wxEnterpriseId
,
int
secretType
);
SecretSettingDTO
getSecretSetting
(
String
wxEnterpriseId
,
int
secretType
);
/**
* 获取SecretSetting列表
* @param wxEnterpriseIdList
* @param secretType
* @return
*/
List
<
SecretSettingDTO
>
getSecretSettingList
(
List
<
String
>
wxEnterpriseIdList
,
int
secretType
);
/**
* 保存或更新配置
* @param secretSetting
*/
void
saveOrUpdateSecretSetting
(
SecretSettingDTO
secretSetting
);
public
List
<
SecretSettingDTO
>
exsitGicEidMemberApp
(
String
wxEnterpriseId
);
public
List
<
SecretSettingDTO
>
exsitGicEidMemberApp
(
String
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/SecretSettingMapper.java
View file @
20127ca8
...
@@ -42,6 +42,17 @@ public interface SecretSettingMapper {
...
@@ -42,6 +42,17 @@ public interface SecretSettingMapper {
@Param
(
"enterpriseId"
)
String
enterpriseId
);
@Param
(
"enterpriseId"
)
String
enterpriseId
);
/**
/**
* 批量获取配置
* @param wxEnterpriseIdList
* @param secretType
* @param enterpriseId
* @return
*/
List
<
TabSecretSetting
>
getSecretSettingList
(
@Param
(
"wxEnterpriseIdList"
)
List
<
String
>
wxEnterpriseIdList
,
@Param
(
"secretType"
)
int
secretType
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
/**
*
*
* @Title: isExsitGicMemberApp
* @Title: isExsitGicMemberApp
* @Description: 是否已经存在配置的gic会员小程序
* @Description: 是否已经存在配置的gic会员小程序
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/commission/ClerkCommissionStaticsBO.java
0 → 100644
View file @
20127ca8
package
com
.
gic
.
haoban
.
manage
.
service
.
pojo
.
bo
.
commission
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* @Author MUSI
* @Date 2023/6/7 2:26 PM
* @Description
* @Version
**/
@Data
public
class
ClerkCommissionStaticsBO
implements
Serializable
{
/**
* 企业id
*/
private
String
enterpriseId
;
/**
* 导购id
*/
private
String
clerkId
;
/**
* 客户数量
*/
private
Integer
memberCount
;
/**
* 佣金金额
*/
private
BigDecimal
commissionAmount
;
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/SecretSettingService.java
View file @
20127ca8
...
@@ -4,8 +4,6 @@ import com.gic.haoban.manage.api.dto.SecretSettingDTO;
...
@@ -4,8 +4,6 @@ import com.gic.haoban.manage.api.dto.SecretSettingDTO;
import
java.util.List
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
/**
/**
* Created 2020/6/3.
* Created 2020/6/3.
*
*
...
@@ -42,6 +40,14 @@ public interface SecretSettingService {
...
@@ -42,6 +40,14 @@ public interface SecretSettingService {
public
SecretSettingDTO
getSecretSetting
(
String
wxEnterpriseId
,
int
secretType
);
public
SecretSettingDTO
getSecretSetting
(
String
wxEnterpriseId
,
int
secretType
);
/**
/**
* 通过wx企业id获取密钥设置列表
* @param wxEnterpriseIdList
* @param secretType
* @return
*/
public
List
<
SecretSettingDTO
>
getSecretSettingList
(
List
<
String
>
wxEnterpriseIdList
,
int
secretType
);
/**
* 根据会员小程序类型获取
* 根据会员小程序类型获取
* @param wxEnterpriseId
* @param wxEnterpriseId
* @param enterpriseId
* @param enterpriseId
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/commission/CommissionNotifyInnerService.java
0 → 100644
View file @
20127ca8
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
commission
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum
;
import
com.gic.haoban.manage.api.util.notify.NoticeMessageUtil
;
import
com.gic.haoban.manage.api.dto.qdto.content.ClerkCashListQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.content.ClerkCashNotifyQDTO
;
import
com.gic.haoban.manage.service.pojo.bo.commission.ClerkCommissionStaticsBO
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.message.NoticeMessageHandler
;
import
com.gic.message.center.api.subscribe.model.NoticeMessageForm
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @Author MUSI
* @Date 2023/6/7 2:31 PM
* @Description
* @Version
* 佣金服务内部服务
**/
@Slf4j
@Component
public
class
CommissionNotifyInnerService
{
@Autowired
private
StaffClerkRelationService
staffClerkRelationService
;
@Autowired
private
NoticeMessageHandler
noticeMessageHandler
;
/**
* 处理导购佣金
* @param commissionStaticsBo
*/
public
void
handlerCommissionNotify
(
ClerkCommissionStaticsBO
commissionStaticsBo
)
{
log
.
info
(
"handlerCommissionNotify params:{}"
,
JSONObject
.
toJSONString
(
commissionStaticsBo
));
String
clerkId
=
commissionStaticsBo
.
getClerkId
();
StaffClerkRelationDTO
staffClerkRelationDTO
=
staffClerkRelationService
.
getByClerkId
(
clerkId
);
if
(
staffClerkRelationDTO
==
null
)
{
log
.
info
(
"handlerCommissionNotify 处理导购佣金消息,导购不存在 {}"
,
clerkId
);
return
;
}
if
(
staffClerkRelationDTO
.
getClerkType
()
!=
null
&&
staffClerkRelationDTO
.
getClerkType
()
==
2
)
{
log
.
info
(
"导购为区经角色 {}, 不发送消息"
,
JSON
.
toJSONString
(
staffClerkRelationDTO
));
return
;
}
String
staffId
=
staffClerkRelationDTO
.
getStaffId
();
String
uniqueKey
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"currentTab"
,
"0"
);
params
.
put
(
"commissAmount"
,
commissionStaticsBo
.
getCommissionAmount
().
toPlainString
());
params
.
put
(
"memberNum"
,
commissionStaticsBo
.
getMemberCount
()
+
""
);
JSONObject
innerParams
=
new
JSONObject
();
innerParams
.
put
(
"currentTab"
,
"0"
);
String
pageUrl
=
NoticeMessageUtil
.
buildMiniAppUrl
(
NoticeMessageTypeEnum
.
CLERK_COMMISSION_NOTIFY
,
innerParams
.
toJSONString
());
params
.
put
(
"page"
,
pageUrl
);
params
.
put
(
"pageParams"
,
innerParams
.
toJSONString
());
NoticeMessageForm
noticeMessageForm
=
NoticeMessageForm
.
builder
()
.
businessId
(
clerkId
)
.
messageCode
(
NoticeMessageTypeEnum
.
CLERK_COMMISSION_NOTIFY
.
getMessageCode
())
.
mqRouterCode
(
NoticeMessageTypeEnum
.
CLERK_COMMISSION_NOTIFY
.
getRouterCode
())
.
enterpriseId
(
commissionStaticsBo
.
getEnterpriseId
())
.
uniqueKey
(
uniqueKey
)
.
createTime
(
new
Date
())
.
userIdList
(
Collections
.
singletonList
(
clerkId
))
.
variableMap
(
params
)
.
build
();
noticeMessageForm
.
setStaffIdList
(
Collections
.
singletonList
(
staffId
));
noticeMessageHandler
.
sendMessage
(
noticeMessageForm
);
}
/**
* 处理提现消息
* @param clerkCashNotifyQDTO
*/
public
void
handlerCashNotify
(
ClerkCashNotifyQDTO
clerkCashNotifyQDTO
)
{
log
.
info
(
"handlerCashNotify params:{}"
,
JSONObject
.
toJSONString
(
clerkCashNotifyQDTO
));
List
<
ClerkCashListQDTO
>
cashList
=
clerkCashNotifyQDTO
.
getCashList
();
if
(
CollectionUtils
.
isEmpty
(
cashList
))
{
log
.
info
(
"导购提现消息列表为空"
);
return
;
}
List
<
String
>
clerkIdList
=
cashList
.
stream
().
map
(
ClerkCashListQDTO:
:
getClerkId
).
collect
(
Collectors
.
toList
());
List
<
StaffClerkRelationDTO
>
list
=
staffClerkRelationService
.
listByClerkIds
(
clerkIdList
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
log
.
info
(
"handlerCashNotify 处理导购提现消息,导购不存在 {}"
,
JSON
.
toJSONString
(
clerkIdList
));
return
;
}
Map
<
String
,
BigDecimal
>
cashMap
=
cashList
.
stream
().
collect
(
Collectors
.
toMap
(
ClerkCashListQDTO:
:
getClerkId
,
ClerkCashListQDTO:
:
getApplyAmount
));
for
(
StaffClerkRelationDTO
staffClerkRelationDTO
:
list
)
{
String
staffId
=
staffClerkRelationDTO
.
getStaffId
();
String
clerkId
=
staffClerkRelationDTO
.
getClerkId
();
String
uniqueKey
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"currentTab"
,
"1"
);
BigDecimal
applyAmount
=
cashMap
.
get
(
clerkId
);
params
.
put
(
"applyAmount"
,
applyAmount
.
toPlainString
());
JSONObject
innerParams
=
new
JSONObject
();
innerParams
.
put
(
"currentTab"
,
"1"
);
NoticeMessageTypeEnum
cashTypeEnum
=
clerkCashNotifyQDTO
.
getCashTypeEnum
();
String
pageUrl
=
NoticeMessageUtil
.
buildMiniAppUrl
(
cashTypeEnum
,
innerParams
.
toJSONString
());
params
.
put
(
"page"
,
pageUrl
);
params
.
put
(
"pageParams"
,
innerParams
.
toJSONString
());
NoticeMessageForm
noticeMessageForm
=
NoticeMessageForm
.
builder
()
.
businessId
(
clerkId
)
.
messageCode
(
cashTypeEnum
.
getMessageCode
())
.
mqRouterCode
(
cashTypeEnum
.
getRouterCode
())
.
enterpriseId
(
clerkCashNotifyQDTO
.
getEnterpriseId
())
.
uniqueKey
(
uniqueKey
)
.
createTime
(
new
Date
())
.
userIdList
(
Collections
.
singletonList
(
clerkId
))
.
variableMap
(
params
)
.
build
();
noticeMessageForm
.
setStaffIdList
(
Collections
.
singletonList
(
staffId
));
noticeMessageHandler
.
sendMessage
(
noticeMessageForm
,
true
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/SecretSettingServiceImpl.java
View file @
20127ca8
...
@@ -85,6 +85,13 @@ public class SecretSettingServiceImpl implements SecretSettingService {
...
@@ -85,6 +85,13 @@ public class SecretSettingServiceImpl implements SecretSettingService {
}
}
@Override
@Override
public
List
<
SecretSettingDTO
>
getSecretSettingList
(
List
<
String
>
wxEnterpriseIdList
,
int
secretType
)
{
List
<
TabSecretSetting
>
secretSettingList
=
secretSettingMapper
.
getSecretSettingList
(
wxEnterpriseIdList
,
secretType
,
null
);
return
EntityUtil
.
changeEntityListByJSON
(
SecretSettingDTO
.
class
,
secretSettingList
);
}
@Override
public
SecretSettingDTO
getMemberSecretSetting
(
String
wxEnterpriseId
,
String
enterpriseId
)
{
public
SecretSettingDTO
getMemberSecretSetting
(
String
wxEnterpriseId
,
String
enterpriseId
)
{
if
(
StringUtils
.
isNotBlank
(
enterpriseId
)
&&
!
"-1"
.
equals
(
enterpriseId
))
{
if
(
StringUtils
.
isNotBlank
(
enterpriseId
)
&&
!
"-1"
.
equals
(
enterpriseId
))
{
TabSecretSetting
secretSetting
=
secretSettingMapper
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
MEMBER_WAPP
.
getVal
(),
enterpriseId
);
TabSecretSetting
secretSetting
=
secretSettingMapper
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
MEMBER_WAPP
.
getVal
(),
enterpriseId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/message/NoticeMessageHandler.java
View file @
20127ca8
...
@@ -3,15 +3,14 @@ package com.gic.haoban.manage.service.service.message;
...
@@ -3,15 +3,14 @@ package com.gic.haoban.manage.service.service.message;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.GICMQClientUtil
;
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.message.center.api.subscribe.model.NoticeMessageForm
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.mq.sdk.GicMQClient
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.
util.ArrayList
;
import
java.
time.LocalDateTime
;
import
java.
util.Dat
e
;
import
java.
time.LocalTim
e
;
import
java.
util.HashMap
;
import
java.
time.temporal.ChronoUnit
;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
...
@@ -28,6 +27,10 @@ public class NoticeMessageHandler {
...
@@ -28,6 +27,10 @@ public class NoticeMessageHandler {
* 发送小程序消息
* 发送小程序消息
*/
*/
public
void
sendMessage
(
NoticeMessageForm
noticeMessageForm
){
public
void
sendMessage
(
NoticeMessageForm
noticeMessageForm
){
sendMessage
(
noticeMessageForm
,
false
);
}
public
void
sendMessage
(
NoticeMessageForm
noticeMessageForm
,
boolean
delay
){
logger
.
info
(
"消息中心发送消息实体:{}"
,
JSONObject
.
toJSONString
(
noticeMessageForm
));
logger
.
info
(
"消息中心发送消息实体:{}"
,
JSONObject
.
toJSONString
(
noticeMessageForm
));
if
(
ObjectUtil
.
isEmpty
(
noticeMessageForm
.
getMessageCode
())
||
ObjectUtil
.
isEmpty
(
noticeMessageForm
.
getMqRouterCode
()))
{
if
(
ObjectUtil
.
isEmpty
(
noticeMessageForm
.
getMessageCode
())
||
ObjectUtil
.
isEmpty
(
noticeMessageForm
.
getMqRouterCode
()))
{
...
@@ -35,9 +38,36 @@ public class NoticeMessageHandler {
...
@@ -35,9 +38,36 @@ public class NoticeMessageHandler {
}
}
GicMQClient
client
=
GICMQClientUtil
.
getClientInstance
();
GicMQClient
client
=
GICMQClientUtil
.
getClientInstance
();
try
{
try
{
client
.
sendMessage
(
noticeMessageForm
.
getMqRouterCode
(),
JSONObject
.
toJSONString
(
noticeMessageForm
));
client
.
sendMessage
(
noticeMessageForm
.
getMqRouterCode
(),
JSONObject
.
toJSONString
(
noticeMessageForm
)
,
sendDelayValue
(
delay
)
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"消息中心发送消息实体发送异常 "
,
e
);
logger
.
error
(
"消息中心发送消息实体发送异常 "
,
e
);
}
}
}
}
private
int
sendDelayValue
(
boolean
delay
)
{
if
(!
delay
)
{
return
0
;
}
LocalDateTime
currentDateTime
=
LocalDateTime
.
now
();
// 设置当天的8点
LocalDateTime
dateTime8AM
=
LocalDateTime
.
of
(
currentDateTime
.
toLocalDate
(),
LocalTime
.
of
(
8
,
0
,
0
));
// 设置当天的22点
LocalDateTime
dateTime10PM
=
LocalDateTime
.
of
(
currentDateTime
.
toLocalDate
(),
LocalTime
.
of
(
22
,
0
,
0
));
// 设置明天的8点
LocalDateTime
nextDay8AM
=
dateTime8AM
.
plusDays
(
1
);
long
secondsDiff
;
if
(
currentDateTime
.
isAfter
(
dateTime8AM
)
&&
currentDateTime
.
isBefore
(
dateTime10PM
))
{
secondsDiff
=
0
;
}
else
if
(
currentDateTime
.
isAfter
(
dateTime10PM
)
&&
currentDateTime
.
isBefore
(
nextDay8AM
))
{
secondsDiff
=
dateTime10PM
.
until
(
nextDay8AM
,
ChronoUnit
.
SECONDS
);
}
else
{
secondsDiff
=
currentDateTime
.
until
(
dateTime8AM
,
ChronoUnit
.
SECONDS
);
}
return
(
int
)
secondsDiff
;
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/CheckQywxSettingApiServiceImpl.java
View file @
20127ca8
...
@@ -21,6 +21,7 @@ import org.slf4j.Logger;
...
@@ -21,6 +21,7 @@ import org.slf4j.Logger;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.net.URL
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
...
@@ -208,6 +209,7 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic
...
@@ -208,6 +209,7 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic
text
.
append
(
"链路:["
).
append
(
messageDTO
.
getTraceId
()).
append
(
"]("
).
append
(
traceUrl
).
append
(
")"
);
text
.
append
(
"链路:["
).
append
(
messageDTO
.
getTraceId
()).
append
(
"]("
).
append
(
traceUrl
).
append
(
")"
);
}
}
markdownMap
.
put
(
"text"
,
text
.
toString
());
markdownMap
.
put
(
"text"
,
text
.
toString
());
logger
.
info
(
"dingding推送Url:{}"
,
dingUrl
);
String
post
=
HttpUtil
.
post
(
dingUrl
,
JSONObject
.
toJSONString
(
dingMap
));
String
post
=
HttpUtil
.
post
(
dingUrl
,
JSONObject
.
toJSONString
(
dingMap
));
logger
.
info
(
"dingding推送alert:{}"
,
post
);
logger
.
info
(
"dingding推送alert:{}"
,
post
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/SecretSettingApiServiceImpl.java
View file @
20127ca8
...
@@ -24,6 +24,16 @@ public class SecretSettingApiServiceImpl implements SecretSettingApiService {
...
@@ -24,6 +24,16 @@ public class SecretSettingApiServiceImpl implements SecretSettingApiService {
}
}
@Override
@Override
public
List
<
SecretSettingDTO
>
getSecretSettingList
(
List
<
String
>
wxEnterpriseIdList
,
int
secretType
)
{
return
secretSettingService
.
getSecretSettingList
(
wxEnterpriseIdList
,
secretType
);
}
@Override
public
void
saveOrUpdateSecretSetting
(
SecretSettingDTO
secretSetting
)
{
secretSettingService
.
saveSecretSetting
(
secretSetting
);
}
@Override
public
List
<
SecretSettingDTO
>
exsitGicEidMemberApp
(
String
wxEnterpriseId
)
{
public
List
<
SecretSettingDTO
>
exsitGicEidMemberApp
(
String
wxEnterpriseId
)
{
return
this
.
secretSettingService
.
exsitGicEidMemberApp
(
wxEnterpriseId
);
return
this
.
secretSettingService
.
exsitGicEidMemberApp
(
wxEnterpriseId
);
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/content/task/CommissionTaskApiServiceImpl.java
0 → 100644
View file @
20127ca8
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
.
content
.
task
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.service.content.task.CommissionTaskApiService
;
import
com.gic.haoban.manage.api.dto.qdto.content.ClerkCashNotifyQDTO
;
import
com.gic.haoban.manage.service.pojo.bo.commission.ClerkCommissionStaticsBO
;
import
com.gic.haoban.manage.service.service.commission.CommissionNotifyInnerService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
/**
* @Author MUSI
* @Date 2023/6/7 2:16 PM
* @Description
* @Version
**/
@Component
(
"commissionTaskApiService"
)
public
class
CommissionTaskApiServiceImpl
implements
CommissionTaskApiService
{
@Autowired
private
CommissionNotifyInnerService
commissionNotifyInnerService
;
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
CommissionTaskApiService
.
class
);
/**
* 处理佣金消息通知
*
* @param params
*/
@Override
public
ServiceResponse
<
Void
>
handlerCommissionNotify
(
String
params
)
{
if
(
StringUtils
.
isBlank
(
params
))
{
log
.
info
(
"处理导购佣金消息通知, 参数为空 {}"
,
params
);
return
ServiceResponse
.
success
();
}
ClerkCommissionStaticsBO
commissionStaticsBO
=
JSON
.
parseObject
(
params
,
ClerkCommissionStaticsBO
.
class
);
commissionNotifyInnerService
.
handlerCommissionNotify
(
commissionStaticsBO
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Void
>
handlerCashNotify
(
String
params
)
{
if
(
StringUtils
.
isBlank
(
params
))
{
log
.
info
(
"处理导购提现消息通知, 参数为空 {}"
,
params
);
return
ServiceResponse
.
success
();
}
ClerkCashNotifyQDTO
clerkCashNotifyQDTO
=
JSON
.
parseObject
(
params
,
ClerkCashNotifyQDTO
.
class
);
commissionNotifyInnerService
.
handlerCashNotify
(
clerkCashNotifyQDTO
);
return
ServiceResponse
.
success
();
}
}
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
20127ca8
...
@@ -227,4 +227,7 @@
...
@@ -227,4 +227,7 @@
<dubbo:reference
interface=
"com.gic.member.api.service.MemberOutApiService"
id=
"memberOutApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.member.api.service.MemberOutApiService"
id=
"memberOutApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.operating.api.service.HaobanWxEnterpriseApiService"
id=
"haobanWxEnterpriseApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.operating.api.service.HaobanWxEnterpriseApiService"
id=
"haobanWxEnterpriseApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.content.task.CommissionTaskApiService"
ref=
"commissionTaskApiService"
timeout=
"10000"
/>
</beans>
</beans>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/SecretSettingMapper.xml
View file @
20127ca8
...
@@ -97,6 +97,22 @@
...
@@ -97,6 +97,22 @@
ORDER BY create_time desc LIMIT 1
ORDER BY create_time desc LIMIT 1
</select>
</select>
<select
id=
"getSecretSettingList"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_secret_setting
where wx_enterprise_id in
<foreach
collection=
"wxEnterpriseIdList"
item=
"wxEnterpriseId"
open=
"("
separator=
","
close=
")"
>
#{wxEnterpriseId,jdbcType=VARCHAR}
</foreach>
and status_flag=1
and secret_type=#{secretType}
<if
test=
"enterpriseId!=null"
>
and enterprise_id=#{enterpriseId,jdbcType=VARCHAR}
</if>
ORDER BY create_time desc
</select>
<select
id=
"exsitGicEidMemberApp"
resultType=
"com.gic.haoban.manage.api.dto.SecretSettingDTO"
>
<select
id=
"exsitGicEidMemberApp"
resultType=
"com.gic.haoban.manage.api.dto.SecretSettingDTO"
>
select enterprise_id enterpriseId , secret_id secretId from tab_haoban_secret_setting where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
select enterprise_id enterpriseId , secret_id secretId from tab_haoban_secret_setting where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag = 1 and secret_type = 4 and enterprise_id is not null
and status_flag = 1 and secret_type = 4 and enterprise_id is not null
...
...
haoban-manage3-service/src/test/java/CommissionClerkTest.java
0 → 100644
View file @
20127ca8
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.service.content.task.CommissionTaskApiService
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
/**
* @Author MUSI
* @Date 2023/6/7 4:34 PM
* @Description
* @Version
**/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@ContextConfiguration
(
locations
=
{
"classpath:applicationContext-conf.xml"
})
public
class
CommissionClerkTest
{
@Autowired
private
CommissionTaskApiService
commissionTaskApiService
;
@Test
public
void
clerkCommission
()
{
ServiceResponse
<
Void
>
serviceResponse
=
commissionTaskApiService
.
handlerCommissionNotify
(
""
);
System
.
out
.
println
(
JSON
.
toJSONString
(
serviceResponse
));
}
}
haoban-manage3-service/src/test/java/HmLinkTest.java
View file @
20127ca8
...
@@ -66,7 +66,7 @@ public class HmLinkTest {
...
@@ -66,7 +66,7 @@ public class HmLinkTest {
HmBatchModifyQDTO
qdto
=
new
HmBatchModifyQDTO
();
HmBatchModifyQDTO
qdto
=
new
HmBatchModifyQDTO
();
qdto
.
setHmIdList
(
Arrays
.
asList
(
517064205447217236L
,
457922550308036636L
));
qdto
.
setHmIdList
(
Arrays
.
asList
(
517064205447217236L
,
457922550308036636L
));
qdto
.
setWxEnterpriseId
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
);
qdto
.
setWxEnterpriseId
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
);
qdto
.
setOptStaffId
(
"fefd1c81641711e69d0818c58a146fd2"
);
//
qdto.setOptStaffId("fefd1c81641711e69d0818c58a146fd2");
qdto
.
setOptName
(
"达摩管理员"
);
qdto
.
setOptName
(
"达摩管理员"
);
qdto
.
setOptType
(
1
);
qdto
.
setOptType
(
1
);
qdto
.
setClerkIdList
(
Arrays
.
asList
(
"4a566818111a45bbae9f962580df82c0"
));
qdto
.
setClerkIdList
(
Arrays
.
asList
(
"4a566818111a45bbae9f962580df82c0"
));
...
...
haoban-manage3-wx/pom.xml
View file @
20127ca8
...
@@ -246,6 +246,12 @@
...
@@ -246,6 +246,12 @@
<artifactId>
haoban-task-api
</artifactId>
<artifactId>
haoban-task-api
</artifactId>
<version>
${haoban-task-api}
</version>
<version>
${haoban-task-api}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
haoban-commission-api
</artifactId>
<version>
${haoban-commission-api}
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/commission/CommissionManager.java
0 → 100644
View file @
20127ca8
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
commission
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.commission.api.dto.commissiondetail.CommissionSettleDetailDTO
;
import
com.gic.haoban.commission.api.qdto.commissiondetail.CommissionSettleOrderItemQDTO
;
import
com.gic.haoban.commission.api.qdto.commissiondetail.CommissionSettleOrderQDTO
;
import
com.gic.haoban.commission.api.service.local.CommissionSettleDetailApiService
;
import
com.gic.haoban.manage.web.controller.goods.GoodsInfoAdaptor
;
import
com.gic.store.goods.dto.goods.GoodsSpuInfoDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
/**
* @Author MUSI
* @Date 2023/6/16 4:30 PM
* @Description
* @Version
* 佣金管理
**/
@Slf4j
@Component
public
class
CommissionManager
{
@Autowired
private
GoodsInfoAdaptor
goodsInfoAdaptor
;
@Autowired
private
CommissionSettleDetailApiService
commissionSettleDetailApiService
;
/**
* 查询商品佣金
* @param enterpriseId
* @param storeId
* @param clerkId
* @param goodsIds
* @return
*/
public
Map
<
String
,
BigDecimal
>
calcGoodsCommission
(
String
enterpriseId
,
String
storeId
,
String
clerkId
,
List
<
String
>
goodsIds
)
{
if
(
CollectionUtils
.
isEmpty
(
goodsIds
))
{
return
Collections
.
emptyMap
();
}
if
(
StringUtils
.
isAnyBlank
(
storeId
,
clerkId
,
enterpriseId
))
{
log
.
info
(
"查询商品佣金异常 参数缺失 storeId:{} clerkID:{}"
,
storeId
,
clerkId
);
return
Collections
.
emptyMap
();
}
Map
<
String
,
GoodsSpuInfoDTO
>
minPriceMap
=
goodsInfoAdaptor
.
queryGoodsMinPrice
(
enterpriseId
,
goodsIds
);
if
(
MapUtils
.
isEmpty
(
minPriceMap
))
{
log
.
info
(
"计算商品佣金 参数异常"
);
return
Collections
.
emptyMap
();
}
List
<
CommissionSettleOrderItemQDTO
>
settleOrderItems
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
GoodsSpuInfoDTO
>
entry
:
minPriceMap
.
entrySet
())
{
String
goodsId
=
entry
.
getKey
();
GoodsSpuInfoDTO
goodsSpuInfoDTO
=
entry
.
getValue
();
CommissionSettleOrderItemQDTO
commissionSettleOrderItemQDTO
=
new
CommissionSettleOrderItemQDTO
();
commissionSettleOrderItemQDTO
.
setGoodsId
(
goodsId
);
commissionSettleOrderItemQDTO
.
setGoodsCode
(
goodsSpuInfoDTO
.
getGoodsCode
());
commissionSettleOrderItemQDTO
.
setGoodsNum
(
1
);
commissionSettleOrderItemQDTO
.
setGoodsPayAmount
(
goodsSpuInfoDTO
.
getMinPrice
().
doubleValue
());
settleOrderItems
.
add
(
commissionSettleOrderItemQDTO
);
}
CommissionSettleOrderQDTO
commissionSettleOrderQDTO
=
new
CommissionSettleOrderQDTO
();
commissionSettleOrderQDTO
.
setIsOrder
(
0
);
commissionSettleOrderQDTO
.
setOrderChannel
(
1
);
commissionSettleOrderQDTO
.
setEnterpriseId
(
enterpriseId
);
commissionSettleOrderQDTO
.
setOrderStoreId
(
storeId
);
commissionSettleOrderQDTO
.
setOrderClerkId
(
clerkId
);
commissionSettleOrderQDTO
.
setItems
(
settleOrderItems
);
log
.
info
(
"计算商品佣金参数: {}"
,
JSON
.
toJSONString
(
commissionSettleOrderQDTO
));
ServiceResponse
<
List
<
CommissionSettleDetailDTO
>>
serviceResponse
=
commissionSettleDetailApiService
.
calcDetailByOrder
(
commissionSettleOrderQDTO
);
log
.
info
(
"计算商品佣金结果: {}"
,
JSON
.
toJSONString
(
serviceResponse
));
if
(!
serviceResponse
.
isSuccess
()
||
CollectionUtils
.
isEmpty
(
serviceResponse
.
getResult
()))
{
log
.
info
(
"计算商品佣金, 商品佣金为空 {}"
,
JSON
.
toJSONString
(
serviceResponse
));
return
Collections
.
emptyMap
();
}
return
serviceResponse
.
getResult
()
.
stream
()
.
collect
(
Collectors
.
toMap
(
CommissionSettleDetailDTO:
:
getGoodsId
,
item
->
{
Double
commissionAmount
=
item
.
getCommissionAmount
();
return
Optional
.
ofNullable
(
commissionAmount
).
map
(
BigDecimal:
:
new
).
orElse
(
BigDecimal
.
ZERO
);
},
(
v1
,
v2
)
->
v1
));
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/ContentMaterialController.java
View file @
20127ca8
...
@@ -17,6 +17,7 @@ import com.gic.content.api.service.ContentMaterialApiService;
...
@@ -17,6 +17,7 @@ import com.gic.content.api.service.ContentMaterialApiService;
import
com.gic.content.api.service.ContentMaterialShareApiService
;
import
com.gic.content.api.service.ContentMaterialShareApiService
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.web.controller.commission.CommissionManager
;
import
com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor
;
import
com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor
;
import
com.gic.haoban.manage.web.controller.goods.GoodsInfoAdaptor
;
import
com.gic.haoban.manage.web.controller.goods.GoodsInfoAdaptor
;
import
com.gic.haoban.manage.web.qo.content.ContentColumnClerkViewQO
;
import
com.gic.haoban.manage.web.qo.content.ContentColumnClerkViewQO
;
...
@@ -36,10 +37,12 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -36,10 +37,12 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -56,11 +59,12 @@ public class ContentMaterialController {
...
@@ -56,11 +59,12 @@ public class ContentMaterialController {
private
ContentMaterialApiService
contentMaterialApiService
;
private
ContentMaterialApiService
contentMaterialApiService
;
@Autowired
@Autowired
private
ContentMaterialShareApiService
contentMaterialShareApiService
;
private
ContentMaterialShareApiService
contentMaterialShareApiService
;
@Autowired
@Autowired
private
ClerkStoreAdaptor
clerkStoreAdaptor
;
private
ClerkStoreAdaptor
clerkStoreAdaptor
;
@Autowired
@Autowired
private
GoodsInfoAdaptor
goodsInfoAdaptor
;
private
GoodsInfoAdaptor
goodsInfoAdaptor
;
@Autowired
private
CommissionManager
commissionManager
;
/**
/**
...
@@ -141,8 +145,16 @@ public class ContentMaterialController {
...
@@ -141,8 +145,16 @@ public class ContentMaterialController {
Page
<
ContentMaterialFrontDTO
>
responseResult
=
serviceResponse
.
getResult
();
Page
<
ContentMaterialFrontDTO
>
responseResult
=
serviceResponse
.
getResult
();
Page
<
ContentMaterialInfoVO
>
result
=
new
Page
<>();
Page
<
ContentMaterialInfoVO
>
result
=
new
Page
<>();
result
.
setTotalCount
(
responseResult
.
getTotalCount
());
result
.
setTotalCount
(
responseResult
.
getTotalCount
());
List
<
String
>
goodsIds
=
responseResult
.
getResult
()
.
stream
()
.
filter
(
item
->
CollectionUtils
.
isNotEmpty
(
item
.
getContentGoodsList
()))
.
map
(
item
->
item
.
getContentGoodsList
().
get
(
0
).
getGoodsId
())
.
distinct
()
.
collect
(
Collectors
.
toList
());
Map
<
String
,
BigDecimal
>
commissionMap
=
commissionManager
.
calcGoodsCommission
(
contentMaterialQO
.
getEnterpriseId
(),
contentMaterialQO
.
getStoreId
(),
contentMaterialQO
.
getClerkId
(),
goodsIds
);
List
<
ContentMaterialInfoVO
>
contentMaterialInfos
=
responseResult
.
getResult
().
stream
()
List
<
ContentMaterialInfoVO
>
contentMaterialInfos
=
responseResult
.
getResult
().
stream
()
.
map
(
item
->
getContentMaterialInfoVO
(
goodsShowStatus
,
item
))
.
map
(
item
->
getContentMaterialInfoVO
(
goodsShowStatus
,
item
,
commissionMap
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
result
.
setResult
(
contentMaterialInfos
);
result
.
setResult
(
contentMaterialInfos
);
result
.
setCurrentPage
(
contentMaterialQO
.
getPageNum
());
result
.
setCurrentPage
(
contentMaterialQO
.
getPageNum
());
...
@@ -156,7 +168,7 @@ public class ContentMaterialController {
...
@@ -156,7 +168,7 @@ public class ContentMaterialController {
* @param item
* @param item
* @return
* @return
*/
*/
private
ContentMaterialInfoVO
getContentMaterialInfoVO
(
List
<
Integer
>
goodsShowStatus
,
ContentMaterialFrontDTO
item
)
{
private
ContentMaterialInfoVO
getContentMaterialInfoVO
(
List
<
Integer
>
goodsShowStatus
,
ContentMaterialFrontDTO
item
,
Map
<
String
,
BigDecimal
>
commissionMap
)
{
ContentMaterialInfoVO
contentMaterialInfoVO
=
new
ContentMaterialInfoVO
();
ContentMaterialInfoVO
contentMaterialInfoVO
=
new
ContentMaterialInfoVO
();
BeanUtils
.
copyProperties
(
item
,
contentMaterialInfoVO
);
BeanUtils
.
copyProperties
(
item
,
contentMaterialInfoVO
);
if
(
CollectionUtils
.
isNotEmpty
(
item
.
getContentGoodsList
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
item
.
getContentGoodsList
()))
{
...
@@ -167,6 +179,8 @@ public class ContentMaterialController {
...
@@ -167,6 +179,8 @@ public class ContentMaterialController {
SimpleGoodsInfoVO
simpleGoodsInfoVO
=
new
SimpleGoodsInfoVO
();
SimpleGoodsInfoVO
simpleGoodsInfoVO
=
new
SimpleGoodsInfoVO
();
BeanUtils
.
copyProperties
(
temp
,
simpleGoodsInfoVO
);
BeanUtils
.
copyProperties
(
temp
,
simpleGoodsInfoVO
);
simpleGoodsInfoVO
.
setGoodsImg
(
temp
.
getGoodsImageUrl
());
simpleGoodsInfoVO
.
setGoodsImg
(
temp
.
getGoodsImageUrl
());
BigDecimal
commission
=
commissionMap
.
get
(
temp
.
getGoodsId
());
simpleGoodsInfoVO
.
setCommission
(
commission
);
return
simpleGoodsInfoVO
;
return
simpleGoodsInfoVO
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
goodsInfoVOS
))
{
if
(
CollectionUtils
.
isNotEmpty
(
goodsInfoVOS
))
{
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/goods/GoodsInfoAdaptor.java
View file @
20127ca8
...
@@ -5,9 +5,9 @@ import com.gic.api.base.commons.Page;
...
@@ -5,9 +5,9 @@ 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.app.aggregation.api.dto.GoodsSettingDTO
;
import
com.gic.haoban.app.aggregation.api.dto.GoodsSettingDTO
;
import
com.gic.haoban.app.aggregation.api.service.SettingApiService
;
import
com.gic.haoban.app.aggregation.api.service.SettingApiService
;
import
com.gic.haoban.manage.web.qo.content.ContentMaterialQO
;
import
com.gic.store.goods.dto.goods.GoodsSpuInfoDTO
;
import
com.gic.store.goods.dto.goods.GoodsSpuInfoDTO
;
import
com.gic.store.goods.dto.qdto.GoodsListQDTO
;
import
com.gic.store.goods.dto.qdto.GoodsListQDTO
;
import
com.gic.store.goods.service.GoodsCenterApiService
;
import
com.gic.store.goods.service.GoodsInfoOutApiService
;
import
com.gic.store.goods.service.GoodsInfoOutApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -19,6 +19,8 @@ import org.springframework.stereotype.Component;
...
@@ -19,6 +19,8 @@ import org.springframework.stereotype.Component;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -37,6 +39,8 @@ public class GoodsInfoAdaptor {
...
@@ -37,6 +39,8 @@ public class GoodsInfoAdaptor {
private
SettingApiService
settingApiService
;
private
SettingApiService
settingApiService
;
@Autowired
@Autowired
private
GoodsInfoOutApiService
goodsInfoOutApiService
;
private
GoodsInfoOutApiService
goodsInfoOutApiService
;
@Autowired
private
GoodsCenterApiService
goodsCenterApiService
;
public
List
<
String
>
queryGoodsIdWithSearch
(
String
enterpriseId
,
String
search
)
{
public
List
<
String
>
queryGoodsIdWithSearch
(
String
enterpriseId
,
String
search
)
{
// 根据关键字查询1000个商品
// 根据关键字查询1000个商品
...
@@ -101,4 +105,26 @@ public class GoodsInfoAdaptor {
...
@@ -101,4 +105,26 @@ public class GoodsInfoAdaptor {
}
}
return
showStatus
;
return
showStatus
;
}
}
/**
* 查询商品最小价格
* @param enterpriseId
* @param goodsIds
* @return
*/
public
Map
<
String
,
GoodsSpuInfoDTO
>
queryGoodsMinPrice
(
String
enterpriseId
,
List
<
String
>
goodsIds
)
{
if
(
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
goodsIds
))
{
return
Collections
.
emptyMap
();
}
ServiceResponse
<
List
<
GoodsSpuInfoDTO
>>
serviceResponse
=
goodsCenterApiService
.
queryGoodsMinPrice
(
enterpriseId
,
goodsIds
);
if
(!
serviceResponse
.
isSuccess
()
||
com
.
alibaba
.
dubbo
.
common
.
utils
.
CollectionUtils
.
isEmpty
(
serviceResponse
.
getResult
()))
{
log
.
info
(
"查询商品最小价格异常 {}"
,
JSON
.
toJSONString
(
serviceResponse
));
return
Collections
.
emptyMap
();
}
return
serviceResponse
.
getResult
()
.
stream
()
.
collect
(
Collectors
.
toMap
(
GoodsSpuInfoDTO:
:
getGoodsId
,
Function
.
identity
()));
}
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/content/ContentMaterialShareInfoVO.java
View file @
20127ca8
...
@@ -25,6 +25,11 @@ public class ContentMaterialShareInfoVO implements Serializable {
...
@@ -25,6 +25,11 @@ public class ContentMaterialShareInfoVO implements Serializable {
private
String
goodsShortLink
;
private
String
goodsShortLink
;
/**
/**
* 短链错误信息
*/
private
String
linkErrMsg
;
/**
* 商品二维码
* 商品二维码
*/
*/
private
String
goodsQrcode
;
private
String
goodsQrcode
;
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/content/SimpleGoodsInfoVO.java
View file @
20127ca8
...
@@ -61,5 +61,10 @@ public class SimpleGoodsInfoVO implements Serializable {
...
@@ -61,5 +61,10 @@ public class SimpleGoodsInfoVO implements Serializable {
*/
*/
private
Integer
status
;
private
Integer
status
;
/**
* 商品佣金
*/
private
BigDecimal
commission
;
}
}
haoban-manage3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
View file @
20127ca8
...
@@ -145,5 +145,9 @@
...
@@ -145,5 +145,9 @@
<dubbo:reference
interface=
"com.gic.haoban.task.api.service.TelTaskApiService"
id=
"telTaskApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.task.api.service.TelTaskApiService"
id=
"telTaskApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"dataTargetConfigNewVersionsApiService"
interface=
"com.gic.enterprise.api.service.target.DataTargetConfigNewVersionsApiService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"dataTargetConfigNewVersionsApiService"
interface=
"com.gic.enterprise.api.service.target.DataTargetConfigNewVersionsApiService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"storeGroupService"
interface=
"com.gic.enterprise.api.service.StoreGroupService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"storeGroupService"
interface=
"com.gic.enterprise.api.service.StoreGroupService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.store.goods.service.GoodsCenterApiService"
id=
"goodsCenterApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.commission.api.service.local.CommissionSettleDetailApiService"
id=
"commissionSettleDetailApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
</beans>
</beans>
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