From 078a770a83dba4c360b268bfb484bffc650886b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BD=90=E5=A4=A9=E5=A4=A7=E5=9C=A3?= <17615834396@163.com> Date: Mon, 15 Jan 2024 14:02:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=A4=E6=B2=B9=E4=BD=99=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/xml/CardFavorableRecordMapper.xml | 11 ++++++----- .../impl/CardFavorableRecordServiceImpl.java | 16 +++++++++++++++- .../cardFavorable/vo/CouponVO.java | 8 ++++++-- .../service/impl/CardFuelRecordServiceImpl.java | 10 +++++----- 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml index ca17cfaa6..b77d312e3 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml @@ -62,11 +62,12 @@ card_favorables.id, card_favorables.couponAmount, card_favorables.couponContent, - card_favorables.cardRecordId + card_favorables.cardRecordId, + card_favorables.endTime from (SELECT '优惠券' AS couponType, - cf.NAME couponName ,cf.id id,cf.discount_amount couponAmount,cf.satisfied_amount couponContent,cfr.id cardRecordId + cf.NAME couponName ,cf.id id,cf.discount_amount couponAmount,cf.satisfied_amount couponContent,cfr.id cardRecordId, cfr.end_time endTime FROM card_favorable cf LEFT JOIN card_favorable_record cfr ON cf.id = cfr.card_favorable_id @@ -76,7 +77,7 @@ and cfr.store_id = #{cardFavorableDTOS.storeId} UNION ALL SELECT '兑换券' AS couponType, - ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId + ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId, cer.out_time endTime FROM card_exchange_record cer LEFT JOIN card_exchange ce ON cer.card_exchange_id = ce.id @@ -87,7 +88,7 @@ and cer.store_id = #{cardFavorableDTOS.storeId} UNION ALL SELECT '洗车券' AS couponType, - ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId + ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId, cer.out_time endTime FROM card_exchange_record cer LEFT JOIN card_exchange ce ON cer.card_exchange_id = ce.id @@ -98,7 +99,7 @@ and cer.store_id = #{cardFavorableDTOS.storeId} UNION ALL SELECT '洗车卡' AS couponType, - ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId + ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId, cer.out_time endTime FROM card_exchange_record cer LEFT JOIN card_exchange ce ON cer.card_exchange_id = ce.id diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java index 1eddf1e86..41b85e133 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java @@ -12,6 +12,7 @@ import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRe import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService; import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO; +import com.fuint.business.petrolStationManagement.service.OilNameService; import com.fuint.business.userManager.service.LJUserService; import com.fuint.business.userManager.vo.LJUserVo; import com.fuint.common.dto.AccountInfo; @@ -40,6 +41,8 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl getCardFavorableList(Page page, CardFavorableRecord cardFavorableRecord) { - return cardFavorableRecordMapper.getCardFavorableList(page,cardFavorableRecord); + IPage cardFavorableList = cardFavorableRecordMapper.getCardFavorableList(page, cardFavorableRecord); + List records = cardFavorableList.getRecords(); + for (CardFavorableRecordVO record : records) { + String oilName = ""; + String[] split = record.getOilType().split(","); + for (String s : split) { + oilName += oilNameService.selectOilNameById(Integer.parseInt(s)).getOilName(); + } + record.setOilName(oilName); + } + cardFavorableList.setRecords(records); + return cardFavorableList; } /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CouponVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CouponVO.java index bf8bb8400..bd6f9170c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CouponVO.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CouponVO.java @@ -1,8 +1,10 @@ package com.fuint.business.marketingActivity.cardFavorable.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; @Data public class CouponVO implements Serializable { @@ -23,7 +25,9 @@ public class CouponVO implements Serializable { //券有效期 private String couponTime; //券开始时间 - private String startTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; //券结束时间 - private String endTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTime; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java index bdd155820..185b25f5e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java @@ -577,10 +577,10 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { if (oilTypeList.contains(cardFuleOrders.getOilType())) { for (JSONObject jsonObject : jsonObjectList) { if (cardFuleOrders.getOilType().equals(jsonObject.getString("oilType"))) { - double incomeLitres = jsonObject.getDouble("incomeLitres"); + double incomeLitres = jsonObject.getDouble("refuelMoney"); BigDecimal add = BigDecimal.valueOf(cardFuleOrders.getIncomeLitres()).add(BigDecimal.valueOf(incomeLitres)); incomeLitres = add.doubleValue(); - jsonObject.put("incomeLitres", incomeLitres); + jsonObject.put("refuelMoney", incomeLitres); String userBnlancce = jsonObjectList.toString(); userBalance.setRefuelMoney(userBnlancce); break; @@ -590,7 +590,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { JSONObject jsonObject1 = new JSONObject(); jsonObject1.put("type", cardFuleOrders.getType()); jsonObject1.put("oilType", cardFuleOrders.getOilType()); - jsonObject1.put("incomeLitres", cardFuleOrders.getIncomeLitres()); + jsonObject1.put("refuelMoney", cardFuleOrders.getIncomeLitres()); jsonObject1.put("oilName", cardFuleOrders.getOilName()); jsonObjectList.add(jsonObject1); String userBnlancce = jsonObjectList.toString(); @@ -601,7 +601,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { JSONObject jsonObject = new JSONObject(); jsonObject.put("type", cardFuleOrders.getType()); jsonObject.put("oilType", cardFuleOrders.getOilType()); - jsonObject.put("incomeLitres", cardFuleOrders.getIncomeLitres()); + jsonObject.put("refuelMoney", cardFuleOrders.getIncomeLitres()); jsonObject.put("oilName", cardFuleOrders.getOilName()); jsonObjects.add(jsonObject); userBalance.setRefuelMoney(jsonObjects.toString()); @@ -613,7 +613,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { JSONObject jsonObject = new JSONObject(); jsonObject.put("type",cardFuleOrders.getType()); jsonObject.put("oilType",cardFuleOrders.getOilType()); - jsonObject.put("incomeLitres",cardFuleOrders.getIncomeLitres()); + jsonObject.put("refuelMoney",cardFuleOrders.getIncomeLitres()); jsonObject.put("oilName",cardFuleOrders.getOilName()); jsonObjects.add(jsonObject); userBalance1.setRefuelMoney(jsonObjects.toString());