From dd1a564f609829970f6ea27935510945c52b59a1 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Sat, 23 Dec 2023 18:17:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BA=8C=E7=BB=B4=E7=A0=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fuyou/service/impl/FyPayServiceImpl.java | 2 +- .../controller/CardValueOrdersController.java | 17 +++ .../mapper/CardValueOrdersMapper.java | 11 +- .../mapper/xml/CardValueOrdersMapper.xml | 20 ++++ .../service/CardValueOrdersService.java | 10 +- .../impl/CardValueOrdersServiceImpl.java | 10 ++ .../order/mapper/xml/OilOrderMapper.xml | 2 + .../service/impl/OilOrderServiceImpl.java | 6 ++ .../qrCode/controller/QrCodeController.java | 37 +++++++ .../qrCode/service/QrCodeService.java | 15 +++ .../service/impl/QrCodeServiceImpl.java | 67 ++++++++++++ .../views/cashier/NewComponents/homeindex.vue | 5 +- gasStation-uni/pages/index/index.vue | 20 ++++ gasStation-uni/pagesHome/QRcode/QRcode.vue | 28 ++++- gasStation-uni/pagesMy/myorder/myorder.vue | 102 ++++++++++++++++-- 15 files changed, 337 insertions(+), 15 deletions(-) create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/mapper/xml/CardValueOrdersMapper.xml create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/qrCode/controller/QrCodeController.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/qrCode/service/QrCodeService.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/qrCode/service/impl/QrCodeServiceImpl.java diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java index 9c5e75067..2ec27ff8f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java @@ -315,7 +315,7 @@ public class FyPayServiceImpl implements FyPayService { } @Override - public Map applet(ReceiveParameter receiveParameter) throws Exception { + public Map applet(ReceiveParameter receiveParameter) { Map res = new HashMap<>(); try { // 查询商户配置信息 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/controller/CardValueOrdersController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/controller/CardValueOrdersController.java index 45ea5e5e3..0aa2cdc9c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/controller/CardValueOrdersController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/controller/CardValueOrdersController.java @@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders; import com.fuint.business.marketingActivity.cardValueOrders.service.CardValueOrdersService; +import com.fuint.common.dto.AccountInfo; +import com.fuint.common.util.TokenUtil; import com.fuint.framework.web.BaseController; import com.fuint.framework.web.ResponseObject; import org.apache.ibatis.annotations.Param; @@ -45,6 +47,21 @@ public class CardValueOrdersController extends BaseController { return getSuccessResult(this.cardValueOrdersService.page(page, new QueryWrapper<>(cardValueOrders))); } + /** + * 根据用户id分页查询所有数据 + * @param pageNo + * @param pageSize + * @param cardValueOrders + * @return + */ + @GetMapping("/list") + public ResponseObject selectAllByUserId(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, + @Param("cardValueOrders") CardValueOrders cardValueOrders) { + Page page = new Page(pageNo, pageSize); + return getSuccessResult(this.cardValueOrdersService.selectCardValueOrders(page, cardValueOrders)); + } + /** * 通过主键查询单条数据 * diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/mapper/CardValueOrdersMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/mapper/CardValueOrdersMapper.java index 379e7e494..72b3b151d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/mapper/CardValueOrdersMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/mapper/CardValueOrdersMapper.java @@ -1,7 +1,10 @@ package com.fuint.business.marketingActivity.cardValueOrders.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders; +import org.apache.ibatis.annotations.Param; /** * 储值卡订单表(CardValueOrders)表数据库访问层 @@ -10,6 +13,12 @@ import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrde * @since 2023-12-22 15:57:44 */ public interface CardValueOrdersMapper extends BaseMapper { - + /** + * 根据用户id分页查询储值卡订单信息 + * @param page + * @param order + * @return + */ + IPage selectCardValueOrders(Page page,@Param("order") CardValueOrders order); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/mapper/xml/CardValueOrdersMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/mapper/xml/CardValueOrdersMapper.xml new file mode 100644 index 000000000..420468f78 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/mapper/xml/CardValueOrdersMapper.xml @@ -0,0 +1,20 @@ + + + + + select * from card_value_orders + + + \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/service/CardValueOrdersService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/service/CardValueOrdersService.java index a7ac987cc..dc2139220 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/service/CardValueOrdersService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/service/CardValueOrdersService.java @@ -1,5 +1,7 @@ package com.fuint.business.marketingActivity.cardValueOrders.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders; @@ -10,6 +12,12 @@ import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrde * @since 2023-12-22 15:57:44 */ public interface CardValueOrdersService extends IService { - + /** + * 根据用户id分页查询储值卡订单信息 + * @param page + * @param order + * @return + */ + IPage selectCardValueOrders(Page page, CardValueOrders order); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/service/impl/CardValueOrdersServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/service/impl/CardValueOrdersServiceImpl.java index 6ab471326..473c81079 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/service/impl/CardValueOrdersServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/service/impl/CardValueOrdersServiceImpl.java @@ -1,9 +1,13 @@ package com.fuint.business.marketingActivity.cardValueOrders.service.impl; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.marketingActivity.cardValueOrders.mapper.CardValueOrdersMapper; import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders; import com.fuint.business.marketingActivity.cardValueOrders.service.CardValueOrdersService; +import com.fuint.common.dto.AccountInfo; +import com.fuint.common.util.TokenUtil; import org.springframework.stereotype.Service; /** @@ -15,5 +19,11 @@ import org.springframework.stereotype.Service; @Service("cardValueOrdersService") public class CardValueOrdersServiceImpl extends ServiceImpl implements CardValueOrdersService { + @Override + public IPage selectCardValueOrders(Page page, CardValueOrders order) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + order.setUserId(nowAccountInfo.getId()); + return baseMapper.selectCardValueOrders(page,order); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml index 7d65eaaea..5b7203076 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml @@ -39,6 +39,7 @@ and date_format(pay_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d') + order by pay_time desc diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java index 7e0f12efd..7a202462a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java @@ -534,6 +534,7 @@ public class OilOrderServiceImpl extends ServiceImpl i oilOrder.setOrderStatus(status); if (status.equals("paid")){ oilOrder.setPayTime(new Date()); + this.updateGrowthValue(oilOrder.getPayAmount(),oilOrder.getUserId(), Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId()); } row = baseMapper.updateById(oilOrder); } @@ -617,6 +618,11 @@ public class OilOrderServiceImpl extends ServiceImpl i /** * 修改用户成长值信息 + * @param oilActualPay 实付金额 + * @param userid 用户id + * @param oilId 油号 + * @param refuelMoney 加油金信息 + * @param storeId 店铺id */ private void updateGrowthValue(Double oilActualPay,Integer userid,Integer oilId,String refuelMoney,Integer storeId){ if (oilId!=null){ diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/qrCode/controller/QrCodeController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/qrCode/controller/QrCodeController.java new file mode 100644 index 000000000..42a124676 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/qrCode/controller/QrCodeController.java @@ -0,0 +1,37 @@ +package com.fuint.business.qrCode.controller; + +import com.fuint.business.qrCode.service.QrCodeService; +import com.fuint.framework.web.BaseController; +import com.fuint.framework.web.ResponseObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 二维码信息 controller层 + */ +@RestController +@RequestMapping("/business/qrCode") +public class QrCodeController extends BaseController { + @Autowired + private QrCodeService qrCodeService; + + /** + * 生成条形码信息 + * @return + */ + @GetMapping("/createBarCode") + public ResponseObject createBarCode(){ + return getSuccessResult(qrCodeService.createUserBarCode()); + } + + /** + * 生成二维码信息 + * @return + */ + @GetMapping("/createQrCode") + public ResponseObject createQrCode(){ + return getSuccessResult(qrCodeService.createUserQrCode()); + } +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/qrCode/service/QrCodeService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/qrCode/service/QrCodeService.java new file mode 100644 index 000000000..821b5d041 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/qrCode/service/QrCodeService.java @@ -0,0 +1,15 @@ +package com.fuint.business.qrCode.service; + +public interface QrCodeService { + /** + * 生成条形码字符串信息 + * @return + */ + String createUserBarCode(); + + /** + * 生成二维码字符串信息 + * @return + */ + String createUserQrCode(); +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/qrCode/service/impl/QrCodeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/qrCode/service/impl/QrCodeServiceImpl.java new file mode 100644 index 000000000..36c7e65e3 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/qrCode/service/impl/QrCodeServiceImpl.java @@ -0,0 +1,67 @@ +package com.fuint.business.qrCode.service.impl; + +import com.fuint.business.qrCode.service.QrCodeService; +import com.fuint.common.dto.AccountInfo; +import com.fuint.common.util.TokenUtil; +import org.apache.commons.lang3.RandomStringUtils; +import org.springframework.stereotype.Service; + +import java.util.Random; + +@Service +public class QrCodeServiceImpl implements QrCodeService { + /** + * 生成条码18位随机数 数字 第7位放用户id + * @return + */ + @Override + public String createUserBarCode() { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + Random random = new Random(); + StringBuilder sb1 = new StringBuilder(); + StringBuilder sb2 = new StringBuilder(); + for (int i = 0; i < 6; i++) { + sb1.append(random.nextInt(4)); + } + for (int i = 0; i < 7; i++) { + sb2.append(random.nextInt(5)); + } + String digits1 = sb1.toString(); + String digits2 = sb2.toString(); + + int sum1 = 0; + int sum2 = 0; + for (int i = 0; i < digits1.length(); i++) { + int digit1 = Integer.parseInt(String.valueOf(digits1.charAt(i))); + if (i % 2 == 0) { + sum1 += digit1; + } else { + sum1 += digit1 * 3; + } + } + for (int i = 0; i < digits2.length(); i++) { + int digit2 = Integer.parseInt(String.valueOf(digits2.charAt(i))); + if (i % 2 == 0) { + sum2 += digit2; + } else { + sum2 += digit2 * 3; + } + } + int checksum1 = (4 - (sum1 % 4)) % 4; + int checksum2 = (5 - (sum2 % 5)) % 5; + + String number = digits1 + checksum1 + "19" + nowAccountInfo.getId() + "19" + digits2 + checksum2; + return number; + } + + @Override + public String createUserQrCode() { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + + String start = RandomStringUtils.randomAlphanumeric(20); + String end = RandomStringUtils.randomAlphanumeric(22); + + String number = start + "9E" + nowAccountInfo.getId() + "9E" + end; + return number; + } +} diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue index 7027e602f..98ddcdd02 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue @@ -206,8 +206,9 @@
- {{ item.dictLabel }} + :value="item.dictValue" + @click="payMethod(item.dictValue)"> + {{ item.dictLabel }}
挂账 diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue index b40e119e6..a4913c556 100644 --- a/gasStation-uni/pages/index/index.vue +++ b/gasStation-uni/pages/index/index.vue @@ -4,6 +4,17 @@ + + + 出行服务 优惠加油 @@ -122,6 +133,10 @@ export default { data() { return { + indicatorDots: true, + autoplay: true, + interval: 2000, + duration: 500, joinmsg: '', msg: "1", show: false, @@ -137,6 +152,11 @@ gbPrice: '0' }, + list1: [ + 'http://47.95.206.185:83/topbj.png', + 'http://47.95.206.185:83/centerbj.png', + 'https://cdn.uviewui.com/uview/swiper/swiper1.png', + ], list3: [ 'http://47.95.206.185:83/topbj.png', 'http://47.95.206.185:83/centerbj.png', diff --git a/gasStation-uni/pagesHome/QRcode/QRcode.vue b/gasStation-uni/pagesHome/QRcode/QRcode.vue index be000e2b2..d92351567 100644 --- a/gasStation-uni/pagesHome/QRcode/QRcode.vue +++ b/gasStation-uni/pagesHome/QRcode/QRcode.vue @@ -84,6 +84,7 @@