Parcourir la source

Merge branch 'develop' of gitadmin/tuoheng_qmhh into release

release
wanjing il y a 11 mois
Parent
révision
d79d10a482
3 fichiers modifiés avec 10 ajouts et 8 suppressions
  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 Voir le fichier

@@ -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 Voir le fichier

@@ -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 Voir le fichier

@@ -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>

Chargement…
Annuler
Enregistrer