Преглед на файлове

Merge branch 'develop' of gitadmin/tuoheng_qmhh into release

release
wanjing преди 11 месеца
родител
ревизия
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 Целия файл

*/ */
public interface UserPointsDetailMapper extends BaseMapper<UserPointsDetail> { 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 Целия файл

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


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


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


Integer dailyLimitWestreamSubmit = 0; Integer dailyLimitWestreamSubmit = 0;
} }


String pointsTime = DateUtils.getDate(); 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 (ObjectUtil.isNotEmpty(totalPointsByToDay)) {
if (totalPointsByToDay >= dailyLimitWestreamSubmit) { if (totalPointsByToDay >= dailyLimitWestreamSubmit) {
log.info("领取积分,已超过每日积分上限,totalPointsByToDay:{}, dailyLimitWestreamSubmit:{}", totalPointsByToDay, dailyLimitWestreamSubmit); log.info("领取积分,已超过每日积分上限,totalPointsByToDay:{}, dailyLimitWestreamSubmit:{}", totalPointsByToDay, dailyLimitWestreamSubmit);
return JsonResult.success("已超过每日积分上限");
return JsonResult.error("已超过每日积分上限");
} }
} }


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


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

+ 2
- 1
tuoheng-api/src/main/resources/mapper/UserPointsDetailMapper.xml Целия файл

<where> <where>
<if test="1 == 1"> and mark = 1 and type = 1 </if> <if test="1 == 1"> and mark = 1 and type = 1 </if>
<if test="openid != null and openid != ''"> and openid = #{openid} </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> </where>
</select> </select>
</mapper> </mapper>

Loading…
Отказ
Запис