Commit ccac072e authored by zhangfeng's avatar zhangfeng

订单V值删除单次获取最高积分逻辑

parent b2238b69
......@@ -107,9 +107,7 @@ public class OderVStrategy implements ScoreRuleStrategy {
BigDecimal orgWVolume = order.getOrgWVolume();
scoreCount = computeScoreCount(orgWVolume, orderVRules);
}
if (scoreCount > scoreRuleDO.getGetScoreOnce()) {
scoreCount = scoreRuleDO.getGetScoreOnce();
} else if (scoreCount <= 0) {
if (scoreCount <= 0) {
log.info("Order in shipping listener: The score count is less than or equal to 0,orderId:{}", orderId);
return;
}
......@@ -177,6 +175,7 @@ public class OderVStrategy implements ScoreRuleStrategy {
try {
HashMap<String, Object> map = new HashMap<>();
map.put("orderId", orderId);
// TODO:增加订单号和唯一键
memberUserScoreApi.operateScore(MemberUserScoreOperateReqDTO.builder()
.memberId(userId)
.scoreCount(scoreCount)
......
......@@ -58,10 +58,10 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
private void verifyCommon(ScoreRuleBaseVO scoreRuleIn) {
//校验公共入参
if (scoreRuleIn.getGetScoreOnce() <= 0) {
if (scoreRuleIn.getType() != ScoreRuleTypeEnum.ORDER_V.getValue() && scoreRuleIn.getGetScoreOnce() <= 0) {
throw exception(SCORE_RULE_FIELD_ERROR);
}
if (scoreRuleIn.getMaxScoreTotal() <= 0) {
if (scoreRuleIn.getType() != ScoreRuleTypeEnum.RECOMMEND.getValue() && scoreRuleIn.getMaxScoreTotal() <= 0) {
throw exception(SCORE_RULE_FIELD_ERROR);
}
if (scoreRuleIn.getStartTime().after((scoreRuleIn.getEndTime())) || scoreRuleIn.getEndTime().before(Date.from(Instant.now()))) {
......
......@@ -45,12 +45,11 @@ public class ScoreRuleBaseVO {
@ApiModelProperty(value = "封面图英文")
private String coverImageEn;
@ApiModelProperty(value = "单次获取积分数,订单V值中代表单次最高获取积分数", required = true)
@NotNull(message = "单次获取积分数不能为空")
private Integer getScoreOnce;
@ApiModelProperty(value = "单次获取积分数(订单V值不传)", required = true)
private Integer getScoreOnce = 0;
@ApiModelProperty(value = "累积最高积分(注册直接传null)", required = true)
private Integer maxScoreTotal;
@ApiModelProperty(value = "累积最高积分(注册不传)", required = true)
private Integer maxScoreTotal = 0;
@ApiModelProperty(value = "活动开始时间", required = true)
@NotNull(message = "活动开始时间不能为空")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment