更新10.9

This commit is contained in:
许允枞 2024-10-09 09:50:26 +08:00
parent 7ed57397c0
commit 127d1b7a8a
3 changed files with 63 additions and 31 deletions

View File

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

View File

@ -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);
}
@ -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());
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);

View File

@ -112,6 +112,7 @@
this.getList()
}
})
this.getList()
}
},
//