Commit 3759d55c authored by zhangfeng's avatar zhangfeng

客户端积分日志

parent 75e7e80c
......@@ -18,6 +18,8 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@NoArgsConstructor
@AllArgsConstructor
public class AppMemberUserScoreLogRespVO {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "积分数量")
private Integer scoreCount;
@ApiModelProperty(value = "操作类型")
......@@ -28,12 +30,12 @@ public class AppMemberUserScoreLogRespVO {
private String sourceTypeZh;
@ApiModelProperty(value = "积分来源英文")
private String sourceTypeEn;
@ApiModelProperty(value = "积分规则id")
private Long ruleId;
@ApiModelProperty(value = "积分规则名称中文")
private String ruleNameZh;
@ApiModelProperty(value = "积分规则名称英文")
private String ruleNameEn;
//@ApiModelProperty(value = "积分规则id")
//private Long ruleId;
//@ApiModelProperty(value = "积分规则名称中文")
//private String ruleNameZh;
//@ApiModelProperty(value = "积分规则名称英文")
//private String ruleNameEn;
@ApiModelProperty(value = "日志时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date createTime;
......@@ -43,4 +45,6 @@ public class AppMemberUserScoreLogRespVO {
private String descEn = "";
@ApiModelProperty(value = "礼品兑换数量")
private Integer rewardCount;
@ApiModelProperty(value = "是否过期")
private Boolean expired = false;
}
......@@ -94,6 +94,33 @@ public class MemberUserScoreLogServiceImpl extends AbstractService<MemberUserSco
}
ArrayList<AppMemberUserScoreLogRespVO> appMemberUserScoreLogRespVOS = new ArrayList<>();
for (MemberUserScoreLogDO userScoreLogDO : userScoreLogDOS) {
if (userScoreLogDO.getSourceType() == ScoreSourceTypeEnum.SYSTEM_EXPIRED.getValue()) {
HashMap hashMap = JsonUtils.parseObject(userScoreLogDO.getExtParam(), HashMap.class);
Object scoreLogIds = hashMap.get("scoreLogIds");
List<Long> scoreLogIdList = JsonUtils.parseArray(scoreLogIds.toString(), Long.class);
for (Long scoreLogId : scoreLogIdList) {
for (MemberUserScoreLogDO scoreLogDO : userScoreLogDOS) {
if (scoreLogDO.getId().equals(scoreLogId) && scoreLogDO.getRuleId() != null) {
ScoreRuleBackDetailVO scoreRule = scoreRuleService.getScoreRule(scoreLogDO.getRuleId());
if (scoreRule != null) {
AppMemberUserScoreLogRespVO appMemberUserScoreLogRespVO =
new AppMemberUserScoreLogRespVO(userScoreLogDO.getId(),userScoreLogDO.getScoreCount()
,"-",scoreLogDO.getSourceType()
,DictFrameworkUtils.getDictDataFromCache("member_score_source", scoreLogDO.getSourceType().toString()).getLabel()
,DictFrameworkUtils.getDictDataFromCache("member_score_source", scoreLogDO.getSourceType().toString()).getLabelEn()
,userScoreLogDO.getCreateTime()
,scoreRule.getDescEn()
,scoreRule.getDescZh()
,userScoreLogDO.getScoreCount()
,true
);
appMemberUserScoreLogRespVOS.add(appMemberUserScoreLogRespVO);
}
}
}
}
continue;
}
setScoreRuleLogDetail(userScoreLogDO, appMemberUserScoreLogRespVOS);
}
return appMemberUserScoreLogRespVOS;
......@@ -101,6 +128,7 @@ public class MemberUserScoreLogServiceImpl extends AbstractService<MemberUserSco
private void setScoreRuleLogDetail(MemberUserScoreLogDO userScoreLogDO, ArrayList<AppMemberUserScoreLogRespVO> appMemberUserScoreLogRespVOS) {
AppMemberUserScoreLogRespVO appMemberUserScoreLogRespVO = new AppMemberUserScoreLogRespVO();
appMemberUserScoreLogRespVO.setId(userScoreLogDO.getId());
appMemberUserScoreLogRespVO.setSourceType(userScoreLogDO.getSourceType());
appMemberUserScoreLogRespVO.setScoreCount(userScoreLogDO.getScoreCount());
appMemberUserScoreLogRespVO.setOperateType(userScoreLogDO.getOperateType() == 1 ? "+" : "-");
......@@ -115,14 +143,6 @@ public class MemberUserScoreLogServiceImpl extends AbstractService<MemberUserSco
appMemberUserScoreLogRespVO.setDescZh("人工积分");
appMemberUserScoreLogRespVO.setDescEn("Manually add points");
break;
// 撤销兑换
case 4:
appMemberUserScoreLogRespVO.setSourceTypeZh(DictFrameworkUtils.getDictDataFromCache("member_score_source", "4").getLabel());
appMemberUserScoreLogRespVO.setSourceTypeEn(DictFrameworkUtils.getDictDataFromCache("member_score_source", "4").getLabelEn());
// TODO:补充描述
appMemberUserScoreLogRespVO.setDescZh(DictFrameworkUtils.getDictDataFromCache("member_score_source", "4").getLabel());
appMemberUserScoreLogRespVO.setDescEn(DictFrameworkUtils.getDictDataFromCache("member_score_source", "4").getLabelEn());
break;
// 活动积分
case 5:
case 6:
......@@ -133,9 +153,6 @@ public class MemberUserScoreLogServiceImpl extends AbstractService<MemberUserSco
appMemberUserScoreLogRespVO.setSourceTypeEn(DictFrameworkUtils.getDictDataFromCache("member_score_source", String.valueOf(scoreSourceTypeEnum.getValue())).getLabelEn());
ScoreRuleBackDetailVO scoreRule = scoreRuleService.getScoreRule(userScoreLogDO.getRuleId());
if (scoreRule != null) {
appMemberUserScoreLogRespVO.setRuleId(userScoreLogDO.getRuleId());
appMemberUserScoreLogRespVO.setRuleNameEn(scoreRule.getTitleEn());
appMemberUserScoreLogRespVO.setRuleNameZh(scoreRule.getTitleZh());
appMemberUserScoreLogRespVO.setDescEn(scoreRule.getDescEn());
appMemberUserScoreLogRespVO.setDescZh(scoreRule.getDescZh());
}
......@@ -167,12 +184,6 @@ public class MemberUserScoreLogServiceImpl extends AbstractService<MemberUserSco
}
}
break;
// 系统过期
case 3:
appMemberUserScoreLogRespVO.setSourceTypeZh(DictFrameworkUtils.getDictDataFromCache("member_score_source", "3").getLabel());
appMemberUserScoreLogRespVO.setSourceTypeEn(DictFrameworkUtils.getDictDataFromCache("member_score_source", "3").getLabelEn());
appMemberUserScoreLogRespVO.setDescZh("系统过期");
appMemberUserScoreLogRespVO.setDescEn("System expiration");
}
}
appMemberUserScoreLogRespVOS.add(appMemberUserScoreLogRespVO);
......
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