Browse Source

小组等级工具类

master
jianjun 5 years ago
parent
commit
8441914372
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  2. 53
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/support/GroupAchievementUtils.java

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java

@ -40,6 +40,7 @@ public interface NumConstant {
int FIFTY_ONE = 51;
int SIXTY = 60;
int ONE_HUNDRED = 100;
int FIVE_HUNDRED = 500;
BigDecimal ONE_HUNDRED_DECIMAL = new BigDecimal(100);
BigDecimal ZERO_DECIMAL = new BigDecimal(0);
int ONE_THOUSAND = 1000;

53
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/support/GroupAchievementUtils.java

@ -0,0 +1,53 @@
package com.epmet.modules.support;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
/**
* desc:小组成就下一等级规则工具类
*
* @author: LiuJanJun
* @date: 2021/4/19 4:11 下午
* @version: 1.0
* @remark 利用此工具类生成下一等级的目标值
*/
public class GroupAchievementUtils {
//小组人数、话题数、转议题数、小组内问题解决数
/**
* desc:获取下一等级的话题数目标值 步长500 起始值 500
*
* @param currentValue
*/
public static Integer getNextTopicTargetValue(Integer currentValue) {
if (currentValue < NumConstant.FIVE_HUNDRED) {
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode());
}
return currentValue + NumConstant.FIVE_HUNDRED;
}
/**
* desc:获取下一等级的转议题数目标值 步长50 起始值 100
*
* @param currentValue
*/
public static Integer getNextToIssueTargetValue(Integer currentValue) {
if (currentValue < NumConstant.ONE_HUNDRED) {
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode());
}
return currentValue + NumConstant.FIFTY;
}
/**
* desc:获取下一等级的话题解决数目标值 步长100 起始值 100
*
* @param currentValue
*/
public static Integer getNextResolveTopicTargetValue(Integer currentValue) {
if (currentValue < NumConstant.ONE_HUNDRED) {
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode());
}
return currentValue + NumConstant.ONE_HUNDRED;
}
}
Loading…
Cancel
Save