소스 검색

Merge branch 'develop' of gitadmin/tuoheng_qmhh into release

release
wanjing 9 달 전
부모
커밋
d79d10a482
3개의 변경된 파일10개의 추가작업 그리고 8개의 파일을 삭제
  1. +1
    -1
      tuoheng-api/src/main/java/com/tuoheng/api/mapper/UserPointsDetailMapper.java
  2. +7
    -6
      tuoheng-api/src/main/java/com/tuoheng/api/service/points/receive/ReceivePonitsService.java
  3. +2
    -1
      tuoheng-api/src/main/resources/mapper/UserPointsDetailMapper.xml

+ 1
- 1
tuoheng-api/src/main/java/com/tuoheng/api/mapper/UserPointsDetailMapper.java 파일 보기

@@ -14,6 +14,6 @@ import java.util.Date;
*/
public interface UserPointsDetailMapper extends BaseMapper<UserPointsDetail> {

Integer selectTotalPointsByToDay(@Param("openid") String openid, @Param("pointsTime") String pointsTime);
Integer selectTotalPointsByToDay(@Param("openid") String openid, @Param("pointsTime") String pointsTime, @Param("changeName") String changeName);

}

+ 7
- 6
tuoheng-api/src/main/java/com/tuoheng/api/service/points/receive/ReceivePonitsService.java 파일 보기

@@ -54,7 +54,7 @@ public class ReceivePonitsService {
.eq(ThDict::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isEmpty(dict)) {
log.info("领取积分,该字典类型不存在,tenantId:{}, dictCode:{}", request.getTenantId(), DictEnum.POINTS_RULE.getCode());
return JsonResult.success("积分规则未设置");
return JsonResult.error("积分规则未设置");
}

ThDictData dictData = dictDataMapper.selectOne(new LambdaQueryWrapper<ThDictData>()
@@ -64,7 +64,7 @@ public class ReceivePonitsService {
.eq(ThDictData::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isEmpty(dictData)) {
log.info("领取积分,该字典项不存在,tenantId:{}, dictDataName:{}", request.getTenantId(), DictDataEnum.WESTREAM_KNOW.getCode());
return JsonResult.success("积分规则未设置");
return JsonResult.error("积分规则未设置");
}

ThDictData dailyLimitWestreamSubmitDictData = dictDataMapper.selectOne(new LambdaQueryWrapper<ThDictData>()
@@ -74,7 +74,7 @@ public class ReceivePonitsService {
.eq(ThDictData::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isEmpty(dailyLimitWestreamSubmitDictData)) {
log.info("领取积分,每日上报最大限额字典项不存在,tenantId:{}, dictDataName:{}", request.getTenantId(), DictDataEnum.DAILY_LIMIT_WESTREAM_SUBMIT.getCode());
return JsonResult.success("积分规则未设置");
return JsonResult.error("积分规则未设置");
}

Integer dailyLimitWestreamSubmit = 0;
@@ -83,11 +83,12 @@ public class ReceivePonitsService {
}

String pointsTime = DateUtils.getDate();
Integer totalPointsByToDay = userPointsDetailMapper.selectTotalPointsByToDay(request.getOpenid(), pointsTime);
String changeName = "阅读知识";
Integer totalPointsByToDay = userPointsDetailMapper.selectTotalPointsByToDay(request.getOpenid(), pointsTime, changeName);
if (ObjectUtil.isNotEmpty(totalPointsByToDay)) {
if (totalPointsByToDay >= dailyLimitWestreamSubmit) {
log.info("领取积分,已超过每日积分上限,totalPointsByToDay:{}, dailyLimitWestreamSubmit:{}", totalPointsByToDay, dailyLimitWestreamSubmit);
return JsonResult.success("已超过每日积分上限");
return JsonResult.error("已超过每日积分上限");
}
}

@@ -97,7 +98,7 @@ public class ReceivePonitsService {
.eq(WestreamUser::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isEmpty(westreamUser)) {
log.info("领取积分,该用户不存在,tenantId:{}, openid:{}", request.getTenantId(), request.getOpenid());
return JsonResult.success("该用户不存在");
return JsonResult.error("该用户不存在");
}

WestreamKnowUser westreamKnowUser = westreamKnowUserMapper.selectOne(new LambdaQueryWrapper<WestreamKnowUser>()

+ 2
- 1
tuoheng-api/src/main/resources/mapper/UserPointsDetailMapper.xml 파일 보기

@@ -38,7 +38,8 @@
<where>
<if test="1 == 1"> and mark = 1 and type = 1 </if>
<if test="openid != null and openid != ''"> and openid = #{openid} </if>
<if test="pointsTime != null "> and points_time = #{pointsTime} </if>
<if test="pointsTime != null and pointsTime != '' "> and points_time = #{pointsTime} </if>
<if test="changeName != null and changeName != ''"> and change_name = #{changeName} </if>
</where>
</select>
</mapper>

Loading…
취소
저장