更新10.9
This commit is contained in:
parent
7ed57397c0
commit
127d1b7a8a
@ -39,7 +39,7 @@
|
||||
|
||||
<select id="getByStoreId" resultMap="IntegralSettingsMap">
|
||||
select
|
||||
id, refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_time, update_time, create_by, update_by, chain_store_id
|
||||
id, refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_time, update_time, create_by, update_by, chain_store_id, sign_applicable_rules, sign_cycle
|
||||
from integral_settings
|
||||
where store_id = #{storeId}
|
||||
</select>
|
||||
|
@ -286,7 +286,7 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
List<IntegralDetail> signInGifts = integralDetailMapper.signInGiftsYesterday("签到赠送", ljUserVos.getId(), ljUserVos.getChainStoreId());
|
||||
|
||||
if (ObjectUtil.isEmpty(signInGifts)) {
|
||||
extracted(ljUserVos, jsonArray, 0);
|
||||
extracted(integralSetting, ljUserVos, jsonArray, 0);
|
||||
} else {
|
||||
String changeReason = signInGifts.get(0).getChangeReason();
|
||||
|
||||
@ -310,7 +310,7 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
// if (dayInt > 8 && 8< jsonArray.size()) {
|
||||
// extracted(ljUserVos, jsonArray, dayInt);
|
||||
// } else if (dayInt >= 1 && dayInt <= jsonArray.size()) {
|
||||
extracted(ljUserVos, jsonArray, dayInt);
|
||||
extracted(integralSetting, ljUserVos, jsonArray, dayInt - 1);
|
||||
// }
|
||||
}
|
||||
}
|
||||
@ -366,13 +366,13 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
integralSettingsList.add(integralSettings1);
|
||||
}
|
||||
integralSettingsVo.setIntegralSettings(integralSettingsList);
|
||||
}else if (integralSettings.getSignApplicableRules() == 1) {
|
||||
} else if (integralSettings.getSignApplicableRules() == 1) {
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
String day = jsonArray.getJSONObject(i).get("day").toString();
|
||||
Integer points = Integer.parseInt(jsonArray.getJSONObject(i).get("integral").toString());
|
||||
IntegralSettingsBo integralSettings1 = new IntegralSettingsBo();
|
||||
// integralSettings1.setIntegralName(day);
|
||||
integralSettings1.setIntegralName("第" +( i + 1 )+ "天");
|
||||
integralSettings1.setIntegralName("第" + (i + 1) + "天");
|
||||
integralSettings1.setIntegral(points);
|
||||
integralSettingsList.add(integralSettings1);
|
||||
}
|
||||
@ -391,27 +391,27 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
|
||||
// if (CollUtil.isNotEmpty(day)) {
|
||||
// IntegralDetail integralDetail = day.get(0);
|
||||
if (ObjectUtil.isNotEmpty(integralDetail)) {
|
||||
// 正则表达式,匹配数字
|
||||
Pattern pattern = Pattern.compile("\\d+");
|
||||
Matcher matcher = pattern.matcher(integralDetail.getChangeReason());
|
||||
StringBuilder numbers = new StringBuilder();
|
||||
StringBuilder classColor = new StringBuilder();
|
||||
numbers.append(0);
|
||||
while (matcher.find()) {
|
||||
numbers.append(matcher.group());
|
||||
classColor.append(matcher.group());
|
||||
}
|
||||
if (StrUtil.isEmpty(numbers)) {
|
||||
integralSettingsVo.setSignInDays("0");
|
||||
}
|
||||
String str = numbers.toString();
|
||||
if (Integer.parseInt(str) >= 10) {
|
||||
numbers.deleteCharAt(0);
|
||||
}
|
||||
integralSettingsVo.setSignInDays(numbers.toString());
|
||||
integralSettingsVo.setClassColor(Integer.parseInt(classColor.toString()));
|
||||
} else {
|
||||
if (ObjectUtil.isNotEmpty(integralDetail)) {
|
||||
// 正则表达式,匹配数字
|
||||
Pattern pattern = Pattern.compile("\\d+");
|
||||
Matcher matcher = pattern.matcher(integralDetail.getChangeReason());
|
||||
StringBuilder numbers = new StringBuilder();
|
||||
StringBuilder classColor = new StringBuilder();
|
||||
numbers.append(0);
|
||||
while (matcher.find()) {
|
||||
numbers.append(matcher.group());
|
||||
classColor.append(matcher.group());
|
||||
}
|
||||
if (StrUtil.isEmpty(numbers)) {
|
||||
integralSettingsVo.setSignInDays("0");
|
||||
}
|
||||
String str = numbers.toString();
|
||||
if (Integer.parseInt(str) >= 10) {
|
||||
numbers.deleteCharAt(0);
|
||||
}
|
||||
integralSettingsVo.setSignInDays(numbers.toString());
|
||||
integralSettingsVo.setClassColor(Integer.parseInt(classColor.toString()));
|
||||
} else {
|
||||
integralSettingsVo.setSignInDays("0");
|
||||
}
|
||||
// }
|
||||
@ -474,17 +474,48 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
}
|
||||
}
|
||||
|
||||
private void extracted(LJUserVo ljUserVos, JSONArray jsonArray, int dayInt) {
|
||||
private void extracted(IntegralSettings integralSetting, LJUserVo ljUserVos, JSONArray jsonArray, int dayInt) {
|
||||
IntegralDetail integralDetail = new IntegralDetail();
|
||||
integralDetail.setStoreId(ljUserVos.getStoreId());
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
if (dayInt >= 8) {
|
||||
jsonObject = jsonArray.getJSONObject(7);
|
||||
//判断有没有规则
|
||||
if (integralSetting.getSignApplicableRules() == 0) {
|
||||
jsonObject = jsonArray.getJSONObject(0);
|
||||
} else if (integralSetting.getSignApplicableRules() == 1) {
|
||||
switch (integralSetting.getSignCycle()) {
|
||||
case 0:
|
||||
// System.out.println("dayInt: " + dayInt);
|
||||
// System.out.println("jsonArray size: " + jsonArray.size());
|
||||
|
||||
} else {
|
||||
jsonObject = jsonArray.getJSONObject(dayInt);
|
||||
if (dayInt >= 6) {
|
||||
jsonObject = jsonArray.getJSONObject(6);
|
||||
} else {
|
||||
jsonObject = jsonArray.getJSONObject(dayInt);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (dayInt >= 13) {
|
||||
jsonObject = jsonArray.getJSONObject(13);
|
||||
}else {
|
||||
jsonObject = jsonArray.getJSONObject(dayInt);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (dayInt >= 29) {
|
||||
jsonObject = jsonArray.getJSONObject(29);
|
||||
}else {
|
||||
jsonObject = jsonArray.getJSONObject(dayInt);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if (dayInt >= 8) {
|
||||
// jsonObject = jsonArray.getJSONObject(7);
|
||||
//
|
||||
// } else {
|
||||
// jsonObject = jsonArray.getJSONObject(dayInt);
|
||||
// }
|
||||
|
||||
Map<String, Object> map = new HashMap<>(jsonObject);
|
||||
|
||||
|
@ -112,6 +112,7 @@
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
// 判断是否签到
|
||||
|
Loading…
Reference in New Issue
Block a user