|
|
|
@@ -12,7 +12,9 @@ import lombok.EqualsAndHashCode; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
* 1. 每天登录首次给成长值 |
|
|
|
@@ -161,5 +163,30 @@ public class WxScoreRules extends BaseTenantEntity { |
|
|
|
String json = "{\"businessId\":"+businessId+",\"limit\":"+DEFAULT_LIMIT+",\"step\":"+DEFAULT_STEP+",\"score\":"+DEFAULT_SCORE+" ,\"desc\":\"线上交易1元\"}" ; |
|
|
|
return JSONObject.parseObject(json); |
|
|
|
} |
|
|
|
|
|
|
|
public boolean checkRules() { |
|
|
|
if (rules == null) |
|
|
|
return true; |
|
|
|
|
|
|
|
List<JSONObject> list = JSONObject.parseArray(rules, JSONObject.class); |
|
|
|
if (list == null) |
|
|
|
return true; |
|
|
|
if (list.size() == 0) |
|
|
|
return true; |
|
|
|
|
|
|
|
Map<Integer,Integer> rootIdCount = new HashMap<Integer,Integer>(); |
|
|
|
for (JSONObject jo:list) { |
|
|
|
Integer id = jo.getInteger(WxScoreRules.ID); |
|
|
|
if ( id!= null){ |
|
|
|
Integer idcont = rootIdCount.get(id); |
|
|
|
if (null != idcont && idcont > 0) { |
|
|
|
return false; |
|
|
|
}else { |
|
|
|
rootIdCount.put(id, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
} |