Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
383327b5
Commit
383327b5
authored
Oct 10, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/release' into release
parents
744dd2ef
f8e4d3d6
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
224 additions
and
59 deletions
+224
-59
CustomerApiImpl.java
...er/yudao/module/customer/service/api/CustomerApiImpl.java
+2
-2
CustomerApi.java
...cn/iocoder/yudao/module/ecw/api/customer/CustomerApi.java
+3
-1
UserRespDTO.java
...iocoder/yudao/module/member/api/user/dto/UserRespDTO.java
+1
-0
ScoreRuleShareRecordController.java
...oller/admin/scoreRule/ScoreRuleShareRecordController.java
+4
-4
AppScoreRuleController.java
...mber/controller/app/scoreRule/AppScoreRuleController.java
+10
-3
ScoreRuleShareFailTriggerDO.java
...ect/ScoreRuleShareRecord/ScoreRuleShareFailTriggerDO.java
+45
-0
ScoreRuleShareFailTriggerMapper.java
...ScoreRuleShareRecord/ScoreRuleShareFailTriggerMapper.java
+14
-0
OrderVStrategy.java
.../module/member/mq/consumer/score/core/OrderVStrategy.java
+21
-18
RegisterStrategy.java
...odule/member/mq/consumer/score/core/RegisterStrategy.java
+1
-1
ScoreRuleShareRecordService.java
...ice/ScoreRuleShareRecord/ScoreRuleShareRecordService.java
+5
-0
ScoreRuleShareRecordServiceImpl.java
...ScoreRuleShareRecord/ScoreRuleShareRecordServiceImpl.java
+41
-2
MemberUserServiceImpl.java
...dao/module/member/service/user/MemberUserServiceImpl.java
+1
-1
ScoreRuleShareRecordDetailVO.java
...vo/ScoreRuleShareRecord/ScoreRuleShareRecordDetailVO.java
+3
-0
ScoreRuleOrderVExtraVO.java
...ule/member/vo/scoreRule/extra/ScoreRuleOrderVExtraVO.java
+1
-1
ScoreRuleShareRecordMapper.xml
...main/resources/mapper/user/ScoreRuleShareRecordMapper.xml
+47
-11
OrderServiceImpl.java
...dao/module/order/service/order/impl/OrderServiceImpl.java
+2
-2
OrderWarehouseInServiceImpl.java
...service/orderWarehouseIn/OrderWarehouseInServiceImpl.java
+7
-6
AppRedeemRewardController.java
...ward/controller/app/redeem/AppRedeemRewardController.java
+3
-0
RewardRedeemServiceImpl.java
...module/reward/service/redeem/RewardRedeemServiceImpl.java
+12
-6
OfferServiceImpl.java
...udao/module/sale/service/offer/impl/OfferServiceImpl.java
+1
-1
No files found.
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/service/api/CustomerApiImpl.java
View file @
383327b5
...
...
@@ -32,7 +32,7 @@ public class CustomerApiImpl implements CustomerApi {
@Resource
private
CountryService
countryService
;
public
void
associateCustomerAuto
(
String
areaCode
,
String
phone
,
Long
memberUserId
,
String
newName
)
{
public
void
associateCustomerAuto
(
String
areaCode
,
String
phone
,
Long
memberUserId
,
String
newName
,
String
memberCode
)
{
//先查询此用户是否有关联老客户
CustomerContactsDO
customerContactsDO
=
customerContactsService
.
getUniqueOneAndValidate
(
areaCode
,
phone
,
null
);
...
...
@@ -85,7 +85,7 @@ public class CustomerApiImpl implements CustomerApi {
customerCreateReqVO
.
setCustomerContacts
(
Arrays
.
asList
(
customerContactsCreateReqVO
));
customerCreateReqVO
.
setCustomerOperateLogRemark
(
"会员注册关联创建客户. 会员
id:"
+
memberUserId
+
"; 电话:"
+
phone
);
customerCreateReqVO
.
setCustomerOperateLogRemark
(
"会员注册关联创建客户. 会员
编号:"
+
memberCode
+
"; 电话:"
+
phone
);
// app创建
customerCreateReqVO
.
setCreateFrom
(
CustomerCreateFromEnum
.
APP_REGISTER
.
getValue
());
...
...
yudao-module-ecw/yudao-module-ecw-api/src/main/java/cn/iocoder/yudao/module/ecw/api/customer/CustomerApi.java
View file @
383327b5
...
...
@@ -4,8 +4,10 @@ import java.util.Date;
public
interface
CustomerApi
{
void
associateCustomerAuto
(
String
areaCode
,
String
phone
,
Long
userId
,
String
newName
);
void
associateCustomerAuto
(
String
areaCode
,
String
phone
,
Long
userId
,
String
newName
,
String
memberCode
);
void
approvalCustomerDelay
(
String
approveId
,
Integer
result
);
void
approvalCustomerTransfer
(
String
approveId
,
Integer
result
);
void
fillFirstDealTimeIfNull
(
Long
customerId
,
Date
firstDealTime
);
...
...
yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/dto/UserRespDTO.java
View file @
383327b5
...
...
@@ -50,5 +50,6 @@ public class UserRespDTO {
private
Integer
country
;
private
Integer
city
;
private
String
code
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/admin/scoreRule/ScoreRuleShareRecordController.java
View file @
383327b5
...
...
@@ -2,18 +2,18 @@ package cn.iocoder.yudao.module.member.controller.admin.scoreRule;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.ScoreRuleShareRecord.ScoreRuleShareRecordDO
;
import
cn.iocoder.yudao.module.member.service.ScoreRuleShareRecord.ScoreRuleShareRecordService
;
import
cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordDetailReqVO
;
import
cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordDetailVO
;
import
cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordPageVO
;
import
cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordQueryVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/scoreRule/AppScoreRuleController.java
View file @
383327b5
...
...
@@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.member.controller.app.scoreRule.vo.AppScoreRuleBa
import
cn.iocoder.yudao.module.member.controller.app.scoreRule.vo.AppScoreRuleListBackVO
;
import
cn.iocoder.yudao.module.member.controller.app.scoreRule.vo.AppScoreRuleListReqVO
;
import
cn.iocoder.yudao.module.member.enums.ScoreRuleTypeEnum
;
import
cn.iocoder.yudao.module.member.service.ScoreRuleShareRecord.ScoreRuleShareRecordService
;
import
cn.iocoder.yudao.module.member.service.scoreRule.ScoreRuleService
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.IdReqVo
;
import
io.swagger.annotations.Api
;
...
...
@@ -36,11 +37,13 @@ public class AppScoreRuleController {
private
ApplicationContext
applicationContext
;
@Resource
private
ScoreProducerApi
scoreProducerApi
;
@Resource
private
ScoreRuleShareRecordService
scoreRuleShareRecordService
;
@PostMapping
(
"/get"
)
@ApiOperation
(
"客户端获得积分规则详情"
)
@Idempotent
(
timeout
=
5
)
@Idempotent
(
timeout
=
1
)
public
CommonResult
<
AppScoreRuleBackDetailVO
>
getScoreRule
(
@Valid
@RequestBody
IdReqVo
idReqVo
)
{
AppScoreRuleBackDetailVO
scoreRuleBackDetailVO
=
scoreRuleService
.
appGetScoreRule
(
idReqVo
.
getId
());
return
success
(
scoreRuleBackDetailVO
);
...
...
@@ -48,7 +51,7 @@ public class AppScoreRuleController {
@PostMapping
(
"/list"
)
@ApiOperation
(
"客户端获得积分规则列表"
)
@Idempotent
(
timeout
=
5
)
@Idempotent
(
timeout
=
1
,
message
=
"页面加载中"
)
public
CommonResult
<
List
<
AppScoreRuleListBackVO
>>
getScoreRuleList
(
@Valid
@RequestBody
AppScoreRuleListReqVO
reqVO
)
{
List
<
AppScoreRuleListBackVO
>
list
=
scoreRuleService
.
appGetScoreRuleList
(
reqVO
);
return
success
(
list
);
...
...
@@ -61,7 +64,11 @@ public class AppScoreRuleController {
if
(
ruleId
==
null
||
userId
==
null
)
{
return
;
}
scoreProducerApi
.
sendShareMessage
(
ScoreRuleTypeEnum
.
SHARE
,
userId
,
ruleId
,
IPHelper
.
getIpAddr
(
request
));
String
ipAddr
=
IPHelper
.
getIpAddr
(
request
);
if
(!
scoreRuleShareRecordService
.
verifyTriggerIp
(
userId
,
ruleId
,
ipAddr
))
{
return
;
}
scoreProducerApi
.
sendShareMessage
(
ScoreRuleTypeEnum
.
SHARE
,
userId
,
ruleId
,
ipAddr
);
}
//@PostMapping("/page")
//@ApiOperation("获得积分规则分页")
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/ScoreRuleShareRecord/ScoreRuleShareFailTriggerDO.java
0 → 100644
View file @
383327b5
package
cn
.
iocoder
.
yudao
.
module
.
member
.
dal
.
dataobject
.
ScoreRuleShareRecord
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
/**
* 分享规则失败点击记录 DO
*
* @author 系统管理员
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName
(
"score_rule_share_fail_trigger"
)
public
class
ScoreRuleShareFailTriggerDO
{
/**
* 主键
*/
@TableId
private
Long
id
;
/**
* 分享记录id
*/
private
Long
shareRecordId
;
/**
* 点击时间
*/
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
Date
triggerTime
;
/**
* 点击ip
*/
private
String
ipAddress
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/ScoreRuleShareRecord/ScoreRuleShareFailTriggerMapper.java
0 → 100644
View file @
383327b5
package
cn
.
iocoder
.
yudao
.
module
.
member
.
dal
.
mysql
.
ScoreRuleShareRecord
;
import
cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper
;
import
cn.iocoder.yudao.module.member.dal.dataobject.ScoreRuleShareRecord.ScoreRuleShareFailTriggerDO
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* 分享失败点击记录 Mapper
*
* @author 系统管理员
*/
@Mapper
public
interface
ScoreRuleShareFailTriggerMapper
extends
AbstractMapper
<
ScoreRuleShareFailTriggerDO
>
{
}
\ No newline at end of file
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/mq/consumer/score/core/OrderVStrategy.java
View file @
383327b5
...
...
@@ -100,7 +100,14 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy {
}
else
{
lockKey1
=
"score:rule:order:lock:"
+
order
.
getOrderConsignorDO
().
getCustomerId
();
}
String
lockKey2
=
"score:rule:order:lock:"
+
order
.
getOrderConsigneeDO
().
getCustomerId
();
// 增加订单无收货人时校验
long
consigneeId
=
0
;
if
(
Objects
.
isNull
(
order
.
getOrderConsigneeDO
())
||
Objects
.
isNull
(
order
.
getOrderConsigneeDO
().
getCustomerId
()))
{
log
.
info
(
"Order in shipping listener: The order consignee is empty,orderID:{}"
,
orderId
);
}
else
{
consigneeId
=
order
.
getOrderConsigneeDO
().
getCustomerId
();
}
String
lockKey2
=
"score:rule:order:lock:"
+
consigneeId
;
RLock
lock1
=
redissonClient
.
getLock
(
lockKey1
);
RLock
lock2
=
redissonClient
.
getLock
(
lockKey2
);
RedissonMultiLock
multiLock
=
new
RedissonMultiLock
(
lock1
,
lock2
);
...
...
@@ -110,7 +117,7 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy {
log
.
error
(
"Order in shipping listener: get lock error, orderId:{}"
,
orderId
);
}
// 获取需要添加积分的用户 发货人
List
<
Long
>
userIds
=
getAddScoreUser
(
order
,
extraInfo
,
scoreRuleDO
);
List
<
Long
>
userIds
=
getAddScoreUser
(
order
.
getUserId
(),
order
.
getOrderConsignorDO
().
getCustomerId
(),
consigneeId
,
extraInfo
,
scoreRuleDO
);
if
(
CollectionUtil
.
isEmpty
(
userIds
))
{
log
.
info
(
"Order in shipping listener: consignor and consignee are not bound to the member, orderId:{}"
,
orderId
);
return
;
...
...
@@ -159,7 +166,7 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy {
* @param orderId
* @return
*/
private
Integer
getScoreCount
(
Integer
transportId
,
Long
channelId
,
String
allowChannels
,
List
<
ScoreRuleOrderVExtraVO
.
OrderVRule
>
orderVRules
,
Long
orderId
)
{
private
Integer
getScoreCount
(
Integer
transportId
,
Long
channelId
,
List
<
Long
>
allowChannels
,
List
<
ScoreRuleOrderVExtraVO
.
OrderVRule
>
orderVRules
,
Long
orderId
)
{
Integer
scoreCount
=
0
;
List
<
OrderItemRespDTO
>
orderItems
=
orderApi
.
getOrderItemsByOrderId
(
orderId
);
if
(
orderItems
==
null
)
{
...
...
@@ -178,8 +185,7 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy {
}
else
if
(
transportId
==
TransportTypeEnum
.
SPECIAL_LINE_AIR_FREIGHT
.
getValue
())
{
// 空运校验渠道
// 渠道id
String
[]
channels
=
allowChannels
.
split
(
","
);
if
(!
ArrayUtil
.
contains
(
channels
,
channelId
.
toString
()))
{
if
(!
allowChannels
.
contains
(
channelId
))
{
return
0
;
}
// 空运算重量
...
...
@@ -190,18 +196,10 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy {
/**
* 获取需要加分的用户
*
* @param order
* @param extraInfo
* @param scoreRuleDO
* @return
*/
private
List
<
Long
>
getAddScoreUser
(
OrderRespDTO
order
,
ScoreRuleOrderVExtraVO
extraInfo
,
ScoreRuleDO
scoreRuleDO
)
{
private
List
<
Long
>
getAddScoreUser
(
Long
userId
,
Long
consignorId
,
Long
consigneeId
,
ScoreRuleOrderVExtraVO
extraInfo
,
ScoreRuleDO
scoreRuleDO
)
{
ArrayList
<
Long
>
users
=
new
ArrayList
<>();
// 发货人和收货人都要判断给分
Long
userId
=
order
.
getUserId
();
Long
consigneeId
=
order
.
getOrderConsigneeDO
().
getCustomerId
();
Long
consigneeMemberId
;
boolean
isBackendOrder
=
userId
<=
0
;
// 校验订单入口
if
(!
isOrderEntryValid
(
extraInfo
.
getOrderEntry
(),
isBackendOrder
))
{
...
...
@@ -209,7 +207,7 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy {
}
// 如果是后台下单,重新获取发货人用户ID
if
(
isBackendOrder
)
{
userId
=
getCustomerMemberId
(
order
.
getOrderConsignorDO
().
getCustomerId
()
);
userId
=
getCustomerMemberId
(
consignorId
);
if
(
userId
==
null
)
{
userId
=
0L
;
}
...
...
@@ -224,7 +222,12 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy {
}
else
{
addValidUser
(
users
,
userId
);
}
consigneeMemberId
=
getCustomerMemberId
(
consigneeId
);
// 判断收货人
if
(
consigneeId
==
null
||
consigneeId
<=
0
)
{
return
users
;
}
Long
consigneeMemberId
=
getCustomerMemberId
(
consigneeId
);
if
(
consigneeMemberId
!=
null
&&
consigneeMemberId
>
0
)
{
if
(
consigneeMemberId
.
equals
(
userId
))
{
log
.
info
(
"Order in shipping listener: The consignee is the same as the sender, userId:{}"
,
userId
);
...
...
@@ -330,11 +333,11 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy {
int
wOrV
=
weightOrVolume
.
setScale
(
0
,
RoundingMode
.
HALF_UP
).
intValue
();
ScoreRuleOrderVExtraVO
.
OrderVRule
lastRule
=
orderVRules
.
get
(
orderVRules
.
size
()
-
1
);
if
(
wOrV
>=
lastRule
.
getHigh
())
{
return
lastRule
.
getScore
();
return
lastRule
.
getScore
()
*
wOrV
;
}
for
(
ScoreRuleOrderVExtraVO
.
OrderVRule
rule
:
orderVRules
)
{
if
(
rule
.
getLow
()
<=
wOrV
&&
wOrV
<
rule
.
getHigh
())
{
return
rule
.
getScore
();
return
rule
.
getScore
()
*
wOrV
;
}
}
return
0
;
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/mq/consumer/score/core/RegisterStrategy.java
View file @
383327b5
...
...
@@ -47,7 +47,7 @@ public class RegisterStrategy extends AbstractScoreRuleStrategy {
}
// 校验注册平台
ScoreRuleRegisterExtraVO
scoreRuleRegisterExtraVO
=
JsonUtils
.
parseObject
(
scoreRuleDO
.
getExtra
(),
ScoreRuleRegisterExtraVO
.
class
);
if
(
scoreRuleRegisterExtraVO
!=
null
&&
!
"2,3"
.
equals
(
scoreRuleRegisterExtraVO
.
getRegisterPlatform
())
)
{
if
(
scoreRuleRegisterExtraVO
!=
null
)
{
if
(!
scoreRuleRegisterExtraVO
.
getRegisterPlatform
().
contains
(
String
.
valueOf
(
message
.
getRegisterPlatform
())))
{
log
.
info
(
"Register listener: The register platform does not match,userID:{}"
,
userId
);
return
;
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/ScoreRuleShareRecord/ScoreRuleShareRecordService.java
View file @
383327b5
...
...
@@ -34,4 +34,9 @@ public interface ScoreRuleShareRecordService extends IService<ScoreRuleShareReco
* @return 分享记录分页
*/
PageResult
<
ScoreRuleShareRecordPageVO
>
getRuleShareRecordPage
(
ScoreRuleShareRecordQueryVO
query
);
/**
* 分享规则触发ip校验
*/
boolean
verifyTriggerIp
(
Long
userId
,
Long
ruleId
,
String
ipAddr
);
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/ScoreRuleShareRecord/ScoreRuleShareRecordServiceImpl.java
View file @
383327b5
...
...
@@ -4,14 +4,21 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import
cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
import
cn.iocoder.yudao.module.member.dal.dataobject.ScoreRuleShareRecord.ScoreRuleShareFailTriggerDO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.ScoreRuleShareRecord.ScoreRuleShareRecordDO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.scoreLog.MemberUserScoreLogDO
;
import
cn.iocoder.yudao.module.member.dal.mysql.ScoreRuleShareRecord.ScoreRuleShareFailTriggerMapper
;
import
cn.iocoder.yudao.module.member.dal.mysql.ScoreRuleShareRecord.ScoreRuleShareRecordMapper
;
import
cn.iocoder.yudao.module.member.enums.ScoreSourceTypeEnum
;
import
cn.iocoder.yudao.module.member.service.scoreLog.MemberUserScoreLogService
;
import
cn.iocoder.yudao.module.member.util.ScoreRuleGenCodeUtils
;
import
cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.annotation.Validated
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -21,12 +28,17 @@ import java.util.List;
*/
@Service
@Validated
@Slf4j
public
class
ScoreRuleShareRecordServiceImpl
extends
AbstractService
<
ScoreRuleShareRecordMapper
,
ScoreRuleShareRecordDO
>
implements
ScoreRuleShareRecordService
{
@Resource
private
ScoreRuleShareRecordMapper
scoreRuleShareRecordMapper
;
@Resource
private
ScoreRuleGenCodeUtils
scoreRuleGenCodeUtils
;
@Resource
private
MemberUserScoreLogService
logService
;
@Resource
private
ScoreRuleShareFailTriggerMapper
scoreRuleShareFailTriggerMapper
;
@Override
public
Long
createRuleShareRecord
(
ScoreRuleShareRecordCreateReqVO
createReqVO
)
{
...
...
@@ -55,7 +67,12 @@ public class ScoreRuleShareRecordServiceImpl extends AbstractService<ScoreRuleSh
if
(
list
.
isEmpty
())
{
return
PageResult
.
empty
();
}
list
.
stream
().
forEach
(
item
->
{
list
.
forEach
(
item
->
{
// 有效记录中ip取的是积分记录中的幂等key,需要提取出ip
if
(
item
.
getIpAddress
().
contains
(
"SHARE"
))
{
String
[]
split
=
item
.
getIpAddress
().
split
(
"_"
);
item
.
setIpAddress
(
split
[
split
.
length
-
1
]);
}
item
.
setTypeZh
(
DictFrameworkUtils
.
getDictDataFromCache
(
"score_rule_type"
,
item
.
getType
().
toString
()).
getLabel
());
item
.
setTypeEn
(
DictFrameworkUtils
.
getDictDataFromCache
(
"score_rule_type"
,
item
.
getType
().
toString
()).
getLabelEn
());
});
...
...
@@ -78,4 +95,26 @@ public class ScoreRuleShareRecordServiceImpl extends AbstractService<ScoreRuleSh
int
total
=
scoreRuleShareRecordMapper
.
countScoreRuleShareRecord
(
query
);
return
new
PageResult
<>(
list
,
total
,
size
,
query
.
getPage
(),
(
total
+
size
-
1
)
/
size
);
}
}
@Override
public
boolean
verifyTriggerIp
(
Long
userId
,
Long
ruleId
,
String
ipAddr
)
{
// 根据分享人和规则id获取分享记录
ScoreRuleShareRecordDO
scoreRuleShareRecordDO
=
selectOne
(
"member_id"
,
userId
,
"rule_id"
,
ruleId
);
if
(
scoreRuleShareRecordDO
==
null
)
{
log
.
info
(
"Share listener: The user not share the activity,userId:{},ruleId:{}"
,
userId
,
ruleId
);
return
false
;
}
String
uniqueId
=
userId
+
"_"
+
ruleId
+
"_"
+
ipAddr
;
MemberUserScoreLogDO
memberUserScoreLogDO
=
logService
.
getByUniqueId
(
ScoreSourceTypeEnum
.
SHARE
+
"_"
+
uniqueId
);
if
(
memberUserScoreLogDO
!=
null
)
{
// 增加触发失败记录
ScoreRuleShareFailTriggerDO
failTriggerDO
=
new
ScoreRuleShareFailTriggerDO
();
failTriggerDO
.
setShareRecordId
(
scoreRuleShareRecordDO
.
getId
());
failTriggerDO
.
setIpAddress
(
ipAddr
);
failTriggerDO
.
setTriggerTime
(
new
Date
());
scoreRuleShareFailTriggerMapper
.
insert
(
failTriggerDO
);
return
false
;
}
return
true
;
}
}
\ No newline at end of file
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java
View file @
383327b5
...
...
@@ -236,7 +236,7 @@ public class MemberUserServiceImpl implements MemberUserService {
clientInternalMessageApi
.
createInternalMessage
(
dto
);
//关联或创建后端客户
customerApi
.
associateCustomerAuto
(
areacode
,
mobile
,
user
.
getId
(),
englishName
);
customerApi
.
associateCustomerAuto
(
areacode
,
mobile
,
user
.
getId
(),
englishName
,
user
.
getCode
()
);
applicationContext
.
publishEvent
(
new
MemberRegEvent
(
user
.
getId
()));
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/ScoreRuleShareRecord/ScoreRuleShareRecordDetailVO.java
View file @
383327b5
...
...
@@ -53,4 +53,7 @@ public class ScoreRuleShareRecordDetailVO {
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"点击时间"
)
private
Date
triggerTime
;
@ApiModelProperty
(
value
=
"点击ip"
)
private
String
ipAddress
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/scoreRule/extra/ScoreRuleOrderVExtraVO.java
View file @
383327b5
...
...
@@ -22,7 +22,7 @@ public class ScoreRuleOrderVExtraVO {
@ApiModelProperty
(
value
=
"提货点列表(第一级提货点,第二级国家,城市,仓库id)"
,
required
=
true
)
private
List
<
List
<
Long
>>
receiveAddrList
;
@ApiModelProperty
(
value
=
"渠道,运输方式选择海运时,渠道隐藏,可多选,逗号拼接"
)
private
String
channel
;
private
List
<
Long
>
channel
;
@ApiModelProperty
(
value
=
"积分规则列表"
,
required
=
true
)
private
List
<
OrderVRule
>
orderVRule
;
@ApiModelProperty
(
value
=
"订单入口(1后台,2APP,3WEB)可多选,逗号拼"
,
required
=
true
)
...
...
yudao-module-member/yudao-module-member-impl/src/main/resources/mapper/user/ScoreRuleShareRecordMapper.xml
View file @
383327b5
...
...
@@ -41,6 +41,7 @@
srsr.create_time AS createTime,
msul.score_count AS score,
msul.create_time AS triggerTime,
msul.unique_id AS ipAddress,
mu.nickname AS memberName,
sr.type,
sr.title_zh AS titleZh,
...
...
@@ -55,22 +56,57 @@
AND srsr.id = #{query.id}
</if>
<include
refid=
"shareRecordDetailCondition"
/>
order by srsr.create_time desc
<if
test=
"query.id == null and query.relationSymbol == null"
>
UNION
SELECT
srsr.id,
srsr.code,
srsr.create_time AS createTime,
0 AS score,
srsf.trigger_time AS triggerTime,
srsf.ip_address AS ipAddress,
mu.nickname AS memberName,
sr.type,
sr.title_zh AS titleZh,
sr.title_en AS titleEn
FROM
score_rule_share_fail_trigger srsf
LEFT JOIN score_rule_share_record srsr ON srsf.share_record_id = srsr.id
LEFT JOIN member_user mu ON srsr.member_id = mu.id
LEFT JOIN score_rule sr ON srsr.rule_id = sr.id
where srsr.deleted = 0
<include
refid=
"shareRecordDetailCondition"
/>
</if>
order by createTime desc, triggerTime desc
limit #{start}, #{size}
</select>
<select
id=
"countScoreRuleShareRecordDetail"
resultType=
"java.lang.Integer"
>
SELECT
count(*)
FROM
member_user_score_log msul
LEFT JOIN score_rule_share_record srsr ON msul.member_id = srsr.member_id AND msul.rule_id = srsr.rule_id
LEFT JOIN member_user mu ON srsr.member_id = mu.id
LEFT JOIN score_rule sr ON srsr.rule_id = sr.id
where srsr.deleted = 0
<if
test=
"query.id != null"
>
AND srsr.id = #{query.id}
</if>
<include
refid=
"shareRecordDetailCondition"
/>
FROM (
SELECT srsr.id
FROM member_user_score_log msul
LEFT JOIN score_rule_share_record srsr ON msul.member_id = srsr.member_id AND msul.rule_id = srsr.rule_id
LEFT JOIN member_user mu ON srsr.member_id = mu.id
LEFT JOIN score_rule sr ON srsr.rule_id = sr.id
where srsr.deleted = 0
<if
test=
"query.id != null"
>
AND srsr.id = #{query.id}
</if>
<include
refid=
"shareRecordDetailCondition"
/>
<if
test=
"query.id == null and query.relationSymbol == null"
>
UNION ALL
SELECT srsr.id
FROM score_rule_share_fail_trigger srsf
LEFT JOIN score_rule_share_record srsr ON srsf.share_record_id = srsr.id
LEFT JOIN member_user mu ON srsr.member_id = mu.id
LEFT JOIN score_rule sr ON srsr.rule_id = sr.id
where srsr.deleted = 0
<include
refid=
"shareRecordDetailCondition"
/>
</if>
) subquery
</select>
<select
id=
"getCurrentMaxShareRecordCode"
resultType=
"java.lang.String"
>
SELECT code FROM score_rule_share_record ORDER BY code desc LIMIT 1
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderServiceImpl.java
View file @
383327b5
...
...
@@ -516,7 +516,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 如果客户联系人为空,则创建新的客户信息,重新查询
customerApi
.
associateCustomerAuto
(
memberUserDO
.
getAreaCode
(),
memberUserDO
.
getMobile
(),
memberUserDO
.
getId
(),
memberUserDO
.
getNickname
());
memberUserDO
.
getNickname
()
,
memberUserDO
.
getCode
()
);
customerContacts
=
customerContactsService
.
getOne
(
new
LambdaQueryWrapper
<
CustomerContactsDO
>()
.
and
(
we
->
we
.
eq
(
CustomerContactsDO:
:
getUserid
,
memberUserDO
.
getId
())
.
or
()
...
...
@@ -3090,7 +3090,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsignorDO
.
setUpdater
(
updater
);
if
(
Objects
.
isNull
(
customerContacts
))
{
// 如果客户联系人为空,则创建新的客户信息,重新查询
customerApi
.
associateCustomerAuto
(
memberUserDO
.
getAreaCode
(),
memberUserDO
.
getMobile
(),
memberUserDO
.
getId
(),
memberUserDO
.
getNickname
());
customerApi
.
associateCustomerAuto
(
memberUserDO
.
getAreaCode
(),
memberUserDO
.
getMobile
(),
memberUserDO
.
getId
(),
memberUserDO
.
getNickname
()
,
memberUserDO
.
getCode
()
);
customerContacts
=
customerContactsService
.
getOne
(
new
LambdaQueryWrapper
<
CustomerContactsDO
>()
.
and
(
we
->
we
.
eq
(
CustomerContactsDO:
:
getUserid
,
memberUserDO
.
getId
())
.
or
()
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderWarehouseIn/OrderWarehouseInServiceImpl.java
View file @
383327b5
...
...
@@ -6,7 +6,6 @@ import cn.hutool.core.date.DateTime;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.iocoder.yudao.framework.apollo.core.event.BoxCheckOrderSchedulingEvent
;
import
cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderVValueEvent
;
import
cn.iocoder.yudao.framework.apollo.core.event.QueryChannelInfoEvent
;
import
cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
...
...
@@ -1220,7 +1219,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
orderItemDOList
,
isNotRollbackIn
,
orderWarehouseInDOList
,
zhongPaoBest
,
channelPackagingOverWeightAdditionalBoList
);
channelPackagingOverWeightAdditionalBoList
,
false
);
if
(
CollectionUtil
.
isNotEmpty
(
channelPackagingOverWeightAdditionalBoList
))
{
channelPackagingOverWeightAdditionalBoList
=
...
...
@@ -1903,7 +1902,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
private
void
processOrderItemException
(
Long
orderId
,
OrderDO
orderDO
,
List
<
OrderItemDO
>
orderItemDOList
,
boolean
isNotRollbackIn
,
List
<
OrderWarehouseInDO
>
orderWarehouseInDOList
,
ZhongPaoBestVO
zhongPaoBest
,
List
<
ChannelPackagingOverWeightAdditionalBo
>
channelPackagingOverWeightAdditionalBoList
)
{
List
<
ChannelPackagingOverWeightAdditionalBo
>
channelPackagingOverWeightAdditionalBoList
,
boolean
isFinishStocked
)
{
// 处理异常
for
(
OrderItemDO
orderItemDO
:
orderItemDOList
)
{
...
...
@@ -1934,8 +1933,10 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
// orderItem 设置warehouseInInfoVo
WarehouseInInfoVO
warehouseInInfoVO
=
this
.
orderItemSetWarehouseInInfoVO
(
orderItemDO
,
orderWarehouseInDOListFilter
);
// 处理空运订单 商品重量超限异常 和 商品路线重量超限异常
this
.
processAirOrderOverWeightException
(
orderId
,
orderDO
,
orderItemDO
,
warehouseInInfoVO
,
channelPackagingOverWeightAdditionalBoList
);
// 处理空运订单 商品重量超限异常 和 商品路线重量超限异常 (完成入仓时才需要,备货完成时不需要处理)
if
(!
isFinishStocked
)
{
this
.
processAirOrderOverWeightException
(
orderId
,
orderDO
,
orderItemDO
,
warehouseInInfoVO
,
channelPackagingOverWeightAdditionalBoList
);
}
this
.
setOrderItemZhongPao
(
zhongPaoBest
,
orderItemDO
,
warehouseInInfoVO
.
getWeight
(),
warehouseInInfoVO
.
getVolume
());
...
...
@@ -4727,7 +4728,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
ZhongPaoBestVO
zhongPaoBest
=
getZhongPaoBest
(
orderDO
);
// 根据订单项产生异常,多箱,少箱,新增商品异常,入仓特性不符异常
processOrderItemException
(
orderId
,
orderDO
,
orderItemDOList
,
isNotRollbackIn
,
orderWarehouseInDOList
,
zhongPaoBest
,
channelPackagingOverWeightAdditionalBoList
);
processOrderItemException
(
orderId
,
orderDO
,
orderItemDOList
,
isNotRollbackIn
,
orderWarehouseInDOList
,
zhongPaoBest
,
channelPackagingOverWeightAdditionalBoList
,
true
);
if
(
CollectionUtil
.
isNotEmpty
(
channelPackagingOverWeightAdditionalBoList
))
{
channelPackagingOverWeightAdditionalBoList
=
channelPackagingOverWeightAdditionalBoList
.
stream
().
filter
(
t
->
!
t
.
isMerged
()).
collect
(
Collectors
.
toList
());
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/controller/app/redeem/AppRedeemRewardController.java
View file @
383327b5
...
...
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
java.util.Date
;
import
java.util.List
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
...
...
@@ -65,6 +66,8 @@ public class AppRedeemRewardController {
@Idempotent
(
timeout
=
5
)
//@PreAuthenticated
public
CommonResult
<
Boolean
>
redeemReward
(
@Valid
@RequestBody
AppRedeemRewardReqVO
redeemRewardReqVO
)
{
// APP/WEB兑换设置兑换时间
redeemRewardReqVO
.
setRedemptionTime
(
new
Date
());
return
success
(
redeemRewardApi
.
redeemReward
(
redeemRewardReqVO
));
}
@PostMapping
(
"/send-sms-code"
)
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/service/redeem/RewardRedeemServiceImpl.java
View file @
383327b5
...
...
@@ -15,6 +15,7 @@ import cn.iocoder.yudao.module.ecw.api.express.dto.ExpressRespDTO;
import
cn.iocoder.yudao.module.member.api.score.MemberUserScoreApi
;
import
cn.iocoder.yudao.module.member.api.score.dto.MemberUserScoreOperateReqDTO
;
import
cn.iocoder.yudao.module.member.api.score.dto.ReleationScoreExpireInfoDTO
;
import
cn.iocoder.yudao.module.member.enums.PlatformTypeEnum
;
import
cn.iocoder.yudao.module.member.enums.ScoreSourceTypeEnum
;
import
cn.iocoder.yudao.module.reward.controller.app.redeem.vo.AppRewardRedeemListRespVO
;
import
cn.iocoder.yudao.module.reward.dal.dataobject.redeem.RewardRedeemDO
;
...
...
@@ -80,6 +81,11 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
int
start
=
(
reqVO
.
getPageNo
()
-
1
)
*
reqVO
.
getPageSize
();
int
size
=
reqVO
.
getPageSize
();
List
<
RewardRedeemPageRespVO
>
result
=
rewardRedeemMapper
.
pageInfo
(
start
,
size
,
reqVO
);
result
.
forEach
(
respVO
->
{
if
(
respVO
.
getEntrance
()
!=
PlatformTypeEnum
.
BACKEND
.
getValue
())
{
respVO
.
setCreatorName
(
respVO
.
getMemberNameZh
());
}
});
int
total
=
rewardRedeemMapper
.
pageCount
(
reqVO
);
return
new
PageResult
<>(
result
,
total
,
reqVO
.
getPageSize
(),
reqVO
.
getPageNo
(),
(
total
+
reqVO
.
getPageSize
()
-
1
)
/
reqVO
.
getPageSize
());
}
...
...
@@ -159,7 +165,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
if
(
CollectionUtils
.
isEmpty
(
request
.
getIds
()))
{
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_NOT_EXIST
);
}
List
<
Lo
ng
>
errorIds
=
checkBatchVerifyParam
(
request
);
List
<
Stri
ng
>
errorIds
=
checkBatchVerifyParam
(
request
);
if
(
CollectionUtils
.
isNotEmpty
(
errorIds
))
{
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_BATCH_VERIFY_ERROR
,
errorIds
);
}
...
...
@@ -407,13 +413,13 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
return
failedInfoMap
;
}
private
List
<
Lo
ng
>
checkBatchVerifyParam
(
RewardRedeemBatchVerifyReqVO
request
)
{
private
List
<
Stri
ng
>
checkBatchVerifyParam
(
RewardRedeemBatchVerifyReqVO
request
)
{
LambdaUpdateWrapper
<
RewardRedeemDO
>
wrapper
=
Wrappers
.
lambdaUpdate
();
wrapper
.
in
(
RewardRedeemDO:
:
getId
,
request
.
getIds
());
Map
<
Lo
ng
,
RewardRedeemDO
>
idRewardRedeemMap
=
this
.
list
(
wrapper
).
stream
()
.
collect
(
Collectors
.
toMap
(
RewardRedeemDO:
:
get
Id
,
Function
.
identity
(),
(
c1
,
c2
)
->
c1
));
return
idRewardRedeemMap
.
keySet
().
stream
().
filter
(
id
->
{
RewardRedeemDO
rewardRedeemDO
=
idRewardRedeemMap
.
get
(
id
);
Map
<
Stri
ng
,
RewardRedeemDO
>
idRewardRedeemMap
=
this
.
list
(
wrapper
).
stream
()
.
collect
(
Collectors
.
toMap
(
RewardRedeemDO:
:
get
RedemptionNumber
,
Function
.
identity
(),
(
c1
,
c2
)
->
c1
));
return
idRewardRedeemMap
.
keySet
().
stream
().
filter
(
coder
->
{
RewardRedeemDO
rewardRedeemDO
=
idRewardRedeemMap
.
get
(
coder
);
if
(
rewardRedeemDO
==
null
)
{
return
true
;
}
...
...
yudao-module-sale/yudao-module-sale-core/src/main/java/cn/iocoder/yudao/module/sale/service/offer/impl/OfferServiceImpl.java
View file @
383327b5
...
...
@@ -1433,7 +1433,7 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
customerContactsDOList
=
customerContactsService
.
getByPhone
(
userRespDTO
.
getAreaCode
(),
userRespDTO
.
getMobile
());
// 当此客户端用户不存在绑定的有效客户信息时需要去关联创建
if
(
CollectionUtil
.
isEmpty
(
customerContactsDOList
)
||
customerContactsDOList
.
size
()
==
0
)
{
customerApi
.
associateCustomerAuto
(
userRespDTO
.
getAreaCode
(),
userRespDTO
.
getMobile
(),
userRespDTO
.
getId
(),
userRespDTO
.
getNickname
());
customerApi
.
associateCustomerAuto
(
userRespDTO
.
getAreaCode
(),
userRespDTO
.
getMobile
(),
userRespDTO
.
getId
(),
userRespDTO
.
getNickname
()
,
userRespDTO
.
getCode
()
);
customerContactsDOList
=
customerContactsService
.
getByMemberUserId
(
loginUser
.
getId
());
}
else
{
customerContactsService
.
update
(
new
LambdaUpdateWrapper
<
CustomerContactsDO
>()
...
...
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