|
|
@@ -281,8 +281,10 @@ public class WxOfflineActivityRecordServiceImpl implements WxOfflineActivityReco |
|
|
} |
|
|
} |
|
|
creditHistory.setCUserId(cuser.getId()); |
|
|
creditHistory.setCUserId(cuser.getId()); |
|
|
creditHistory.setCreditType(EnumScoreType.POINT_CHANGE.getCode()); |
|
|
creditHistory.setCreditType(EnumScoreType.POINT_CHANGE.getCode()); |
|
|
|
|
|
|
|
|
|
|
|
Integer increasedPoints = record.getIncreasedPoints(); |
|
|
if(EnumOfflineActivityRecordStatus.AUDI_SUCCESS.getCode().equals(record.getAuditStatus())){ |
|
|
if(EnumOfflineActivityRecordStatus.AUDI_SUCCESS.getCode().equals(record.getAuditStatus())){ |
|
|
if(record.getIncreasedPoints() > 0){ |
|
|
|
|
|
|
|
|
if(increasedPoints > 0){ |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
//计算积分 |
|
|
//计算积分 |
|
|
@@ -290,7 +292,6 @@ public class WxOfflineActivityRecordServiceImpl implements WxOfflineActivityReco |
|
|
Double priceCondition = creditObject.getDouble(WxScoreRules.STEP); |
|
|
Double priceCondition = creditObject.getDouble(WxScoreRules.STEP); |
|
|
int baseScore = creditObject.getInteger(WxScoreRules.SCORE); |
|
|
int baseScore = creditObject.getInteger(WxScoreRules.SCORE); |
|
|
|
|
|
|
|
|
Integer increasedPoints = 0; |
|
|
|
|
|
if (record.getOrderMoney().compareTo(BigDecimal.valueOf(priceCondition)) > 0) { |
|
|
if (record.getOrderMoney().compareTo(BigDecimal.valueOf(priceCondition)) > 0) { |
|
|
increasedPoints = record.getOrderMoney().divide(BigDecimal.valueOf(priceCondition),0, RoundingMode.DOWN) |
|
|
increasedPoints = record.getOrderMoney().divide(BigDecimal.valueOf(priceCondition),0, RoundingMode.DOWN) |
|
|
.multiply(BigDecimal.valueOf(baseScore)).intValue(); |
|
|
.multiply(BigDecimal.valueOf(baseScore)).intValue(); |
|
|
@@ -300,10 +301,10 @@ public class WxOfflineActivityRecordServiceImpl implements WxOfflineActivityReco |
|
|
} |
|
|
} |
|
|
creditHistory.setCreditNum(increasedPoints); |
|
|
creditHistory.setCreditNum(increasedPoints); |
|
|
}else if(EnumOfflineActivityRecordStatus.INVALID.getCode().equals(record.getAuditStatus())){ |
|
|
}else if(EnumOfflineActivityRecordStatus.INVALID.getCode().equals(record.getAuditStatus())){ |
|
|
if(record.getIncreasedPoints() == 0){ |
|
|
|
|
|
|
|
|
if(increasedPoints == 0){ |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
creditHistory.setCreditNum(record.getIncreasedPoints()); |
|
|
|
|
|
|
|
|
creditHistory.setCreditNum(increasedPoints); |
|
|
} |
|
|
} |
|
|
if(creditHistory.getCreditNum() > 0){ |
|
|
if(creditHistory.getCreditNum() > 0){ |
|
|
creditHistory.setChangePurpose("活动订单("+record.getOrderNo()+")新增积分"+creditHistory.getCreditNum()); |
|
|
creditHistory.setChangePurpose("活动订单("+record.getOrderNo()+")新增积分"+creditHistory.getCreditNum()); |
|
|
@@ -312,7 +313,7 @@ public class WxOfflineActivityRecordServiceImpl implements WxOfflineActivityReco |
|
|
} |
|
|
} |
|
|
creditHistory = wxCreditHistoryService.saveOrUpdate(creditHistory,record); |
|
|
creditHistory = wxCreditHistoryService.saveOrUpdate(creditHistory,record); |
|
|
|
|
|
|
|
|
record.setIncreasedPoints(creditHistory.getCreditNum()); |
|
|
|
|
|
|
|
|
record.setIncreasedPoints(increasedPoints); |
|
|
wxOfflineActivityRecordMapper.updateIncreasedPoints(record); |
|
|
wxOfflineActivityRecordMapper.updateIncreasedPoints(record); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|