diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java index 79736b69b..14d070e6c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java @@ -44,6 +44,9 @@ public class Const { //机构公钥 public static String INS_PUBLIC_KEY=""; + //富友回调公钥 + public static String INS_PUBLIC_KEYS="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCj1SsMt4S9SMcNpXrcQ9ET4hHdX0UX/1RTdD9GzxzSDwTEsLQuUNaX0VP8NQ7NWvMdgCYnST74oV81ht0GQd3aax6fyXjDETYC5tq0sHkJxwtiynTcssPBjM2LipTeY6Sv8cUS1MPnvRX2Cs1RXkB8ZdUp9dCaNnTxFOPJGB1E4wIDAQAB"; + //异步通知(回调地址) // public static String notify_url = "https://www.fuint.cn/fuint-application/clientApi/pay/aliPayCallback"; public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify"; @@ -64,7 +67,15 @@ public class Const { public static String fuiou_28_url = "https://fundwx.fuiou.com/queryFeeAmt"; //提现 public static String fuiou_29_url = "https://fundwx.fuiou.com/withdraw"; - //查询 public static String fuiou_30_url = "https://fundwx.fuiou.com/commonQuery"; + +// 生产地址 扫码 + public static String fuiou_31_url = "https://spay-cloud.fuioupay.com/micropay"; + //生产地址 公众号/服务窗/小程序统一下单 + public static String fuiou_32_url = "https://spay-cloud.fuioupay.com/wxPreCreate"; + //生产地址 退款 + public static String fuiou_33_url = "https://spay-cloud.fuioupay.com/commonRefund"; + //生产地址 查询 + public static String fuiou_34_url = "https://spay-cloud.fuioupay.com/commonQuery"; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Message.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Message.java index e88533e03..d41c181d1 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Message.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Message.java @@ -27,6 +27,7 @@ public class Message { root.addElement(key).addText(value); } String reqBody = "" + doc.getRootElement().asXML(); + System.out.println(reqBody); reqBody = URLEncoder.encode(reqBody, Const.charset); return reqBody; } 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 1e6eae96b..a6d8ee0e2 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 @@ -78,7 +78,7 @@ public class FyPayServiceImpl implements FyPayService { // 请求报文 String reqBody = Message.requestMsg(map); // 响应报文 - String rspXml = Message.responseMsg(reqBody,Const.fuiou_22_url); + String rspXml = Message.responseMsg(reqBody,Const.fuiou_31_url); //响应报文验签 Map resMap = Utils.xmlStr2Map(rspXml); @@ -90,16 +90,16 @@ public class FyPayServiceImpl implements FyPayService { timer.schedule(new TimerTask() { @Override public void run() { - try { - Map orderQueryRes = queryOrder(map1); - if(!orderQueryRes.get("msg").equals("unpaid")){ - timer.cancel(); + try { + Map orderQueryRes = queryOrder(map1); + if(!orderQueryRes.get("msg").equals("unpaid")){ + timer.cancel(); + } + } catch (Exception e) { + throw new RuntimeException(e); } - } catch (Exception e) { - throw new RuntimeException(e); } - } - //定时器 立即开始 0.5s一次 + //定时器 不延时 立即开始 0.5s一次 }, 0, 500); Thread.currentThread().interrupt(); }); @@ -144,7 +144,7 @@ public class FyPayServiceImpl implements FyPayService { // 请求报文 String reqBody = Message.requestMsg(map); // 响应报文 - String rspXml = Message.responseMsg(reqBody,Const.fuiou_30_url); + String rspXml = Message.responseMsg(reqBody,Const.fuiou_34_url); //响应报文验签 Map reqMap = Utils.xmlStr2Map(rspXml); @@ -165,7 +165,8 @@ public class FyPayServiceImpl implements FyPayService { // 修改油罐容量 List jsonObjects = JSONArray.parseArray(map1.get("oilOrder"), JSONObject.class); if (jsonObjects.size()<=1) { - Integer tankId = Integer.valueOf(jsonObjects.get(1).get("tankId").toString()); + + Integer tankId = Integer.valueOf(jsonObjects.get(0).get("tankId").toString()); oilOrder.setTankId(tankId); oilOrderService.addOilTracks(oilOrder, oilOrder.getStoreId()); } @@ -342,7 +343,7 @@ public class FyPayServiceImpl implements FyPayService { // 请求报文 String reqBody = Message.requestMsg(map); // 响应报文 - String rspXml = Message.responseMsg(reqBody,Const.fuiou_23_url); + String rspXml = Message.responseMsg(reqBody,Const.fuiou_32_url); //响应报文验签 Map resMap = Utils.xmlStr2Map(rspXml); @@ -375,7 +376,7 @@ public class FyPayServiceImpl implements FyPayService { // 请求报文 String reqBody = Message.requestMsg(map); // 响应报文 - String rspXml = Message.responseMsg(reqBody,Const.fuiou_24_url); + String rspXml = Message.responseMsg(reqBody,Const.fuiou_33_url); //响应报文验签 Map resMap = Utils.xmlStr2Map(rspXml); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/util/Utils.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/util/Utils.java index 15240f256..36da50bc6 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/util/Utils.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/util/Utils.java @@ -103,8 +103,8 @@ public class Utils { Map mapNew = paraFilter(map); String preSignStr = createLinkString(mapNew); - - return Sign.verify(preSignStr.getBytes(Const.charset), Const.INS_PUBLIC_KEY, sign); +// System.out.println(Sign.verify(preSignStr.getBytes(Const.charset), Const.INS_PUBLIC_KEY, sign)); + return Sign.verify(preSignStr.getBytes(Const.charset), Const.INS_PUBLIC_KEYS, sign); } /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java index 48f05e37b..9c18d2138 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java @@ -2,9 +2,9 @@ package com.fuint.business.marketingActivity.cardFavorable.controller; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTO; +import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTOS; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService; import com.fuint.framework.web.BaseController; @@ -60,7 +60,7 @@ public class CardFavorableController extends BaseController { /** * 新增数据 * - * @param cardFavorable 实体对象 + * @param cardFavorableDTO 实体对象 * @return 新增结果 */ @PostMapping @@ -89,5 +89,21 @@ public class CardFavorableController extends BaseController { public ResponseObject delete(@RequestParam("idList") List idList) { return getSuccessResult(this.cardFavorableService.removeByIds(idList)); } + + + /** + *查询优惠券接口(小程序端) + * @param pageNo + * @param pageSize + * @param cardFavorable + * @return + */ + @GetMapping("applet") + public ResponseObject selectAllByCondition(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, + @Param("cardFuelDiesel") CardFavorableDTOS cardFavorableDTOS) { + Page page = new Page(pageNo, pageSize); + return getSuccessResult(this.cardFavorableService.selectAllByCondition(page,cardFavorableDTOS)); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/dto/CardFavorableDTOS.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/dto/CardFavorableDTOS.java new file mode 100644 index 000000000..9227ea969 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/dto/CardFavorableDTOS.java @@ -0,0 +1,13 @@ +package com.fuint.business.marketingActivity.cardFavorable.dto; + +import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CardFavorableDTOS extends CardFavorable implements Serializable { + + private String couponType; + private Integer useStatus; +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/dto/QueryDTO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/dto/QueryDTO.java new file mode 100644 index 000000000..b874761ad --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/dto/QueryDTO.java @@ -0,0 +1,11 @@ +package com.fuint.business.marketingActivity.cardFavorable.dto; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class QueryDTO implements Serializable { + //券名称 + private String couponName; +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/CardFavorableRecordMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/CardFavorableRecordMapper.java index 0db22f768..8de67897e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/CardFavorableRecordMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/CardFavorableRecordMapper.java @@ -3,10 +3,15 @@ package com.fuint.business.marketingActivity.cardFavorable.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.cardFavorable.dto.CardFavorableDTOS; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord; +import com.fuint.business.marketingActivity.cardFavorable.vo.CouponVO; import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO; import org.apache.ibatis.annotations.Param; import java.util.HashMap; +import java.util.List; /** * (CardFavorableRecord)表数据库访问层 @@ -24,5 +29,11 @@ public interface CardFavorableRecordMapper extends BaseMapper getCardFavorableList(@Param("page")Page page,@Param("cardFavorableRecord") CardFavorableRecord cardFavorableRecord); + /** + * 查询优惠券接口(小程序) + * @param cardFavorableDTOS + */ + // List selectAllByCondition(Integer id); + IPage selectAllByCondition(@Param("page") Page page, @Param("cardFavorableDTOS") CardFavorableDTOS cardFavorableDTOS); } 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 d913983ce..3da638087 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 @@ -54,5 +54,55 @@ order by cfr.create_time DESC + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/CardFavorableService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/CardFavorableService.java index b40f24d08..6c98b3de8 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/CardFavorableService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/CardFavorableService.java @@ -4,6 +4,7 @@ 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.cardFavorable.dto.CardFavorableDTO; +import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTOS; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable; import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO; @@ -45,5 +46,13 @@ public interface CardFavorableService extends IService { * @return */ Boolean updateOneById(CardFavorableDTO cardFavorableDTO); + + /** + * 查询优惠券接口(小程序) + * @param page + * @param cardFavorable + * @return + */ + IPage selectAllByCondition(Page page, CardFavorableDTOS cardFavorableDTOS); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java index 339cd88ce..7c0dace8e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java @@ -5,11 +5,15 @@ 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.cardFavorable.dto.CardFavorableDTO; +import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTOS; import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableMapper; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable; +import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableRecordMapper; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService; import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO; +import com.fuint.business.marketingActivity.cardFavorable.vo.CouponVO; import com.fuint.business.store.service.StoreService; +import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.BeanUtils; @@ -17,6 +21,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.io.Serializable; +import java.util.List; /** * (CardFavorable)表服务实现类 @@ -29,6 +34,8 @@ public class CardFavorableServiceImpl extends ServiceImpl couponVOS = cardFavorableRecordMapper.selectAllByCondition(page,cardFavorableDTOS); + return couponVOS; + } } 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 new file mode 100644 index 000000000..20c4e3e21 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CouponVO.java @@ -0,0 +1,27 @@ +package com.fuint.business.marketingActivity.cardFavorable.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CouponVO implements Serializable { + //券id + private Integer id; + //券类型 + private String couponType; + //券金额 + private String couponAmount; + //券名称 + private String couponName; + //券内容 + private String couponContent; + //使用状态 0:未使用 1:已使用 2:已失效 + private String useStatus; + //券有效期 + private String couponTime; + //券开始时间 + private String startTime; + //券结束时间 + private String endTime; +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HangBillServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HangBillServiceImpl.java index 96c2bd115..22a653a41 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HangBillServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HangBillServiceImpl.java @@ -91,7 +91,7 @@ public class HangBillServiceImpl extends ServiceImpl i SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); String timestamp = dateFormat.format(new Date()); String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6); - String orderNo = timestamp+randomString; + String orderNo = "2345"+timestamp+randomString; Integer staffId = nowAccountInfo.getStaffId(); hangBill.setStaffId(staffId); 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 5374325ae..9391850fc 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 @@ -214,7 +214,7 @@ public class OilOrderServiceImpl extends ServiceImpl i SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); String timestamp = dateFormat.format(new Date()); String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6); - String orderNo = timestamp+randomString; + String orderNo = "2345"+timestamp+randomString; Map orders = new HashMap<>(); @@ -390,7 +390,7 @@ public class OilOrderServiceImpl extends ServiceImpl i SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); String timestamp = dateFormat.format(new Date()); String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6); - String orderNo = timestamp+randomString; + String orderNo = "2345"+timestamp+randomString; // 添加油品订单信息 oilOrder.setOrderNo(orderNo); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/ReturnRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/ReturnRecordServiceImpl.java index 3e43cc32d..557ecc8cd 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/ReturnRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/ReturnRecordServiceImpl.java @@ -46,7 +46,7 @@ public class ReturnRecordServiceImpl extends ServiceImpl 一键加油 - - - diff --git a/gasStation-uni/pagesHome/Activity/index.vue b/gasStation-uni/pagesHome/Activity/index.vue index 9169d7960..2a5b0beae 100644 --- a/gasStation-uni/pagesHome/Activity/index.vue +++ b/gasStation-uni/pagesHome/Activity/index.vue @@ -58,9 +58,9 @@ }) }, getData() { - /*uni.showLoading({ - //title: '加载中' - });*/ + uni.showLoading({ + title: '加载中' + }); request({ url: 'business/marketingActivity/activeExchange/applet', method: 'get', @@ -183,4 +183,4 @@ position: fixed; top: 0px; } - \ No newline at end of file + diff --git a/gasStation-uni/pagesHome/PointsMall/PointsMall.vue b/gasStation-uni/pagesHome/PointsMall/PointsMall.vue index c71d2c8db..30b059c5f 100644 --- a/gasStation-uni/pagesHome/PointsMall/PointsMall.vue +++ b/gasStation-uni/pagesHome/PointsMall/PointsMall.vue @@ -9,13 +9,19 @@ - - {{myPoints}} - - - {{storeName}} - + + + {{myPoints}} 积分 + + + {{storeName}} + + + + + + @@ -44,49 +50,51 @@ 我的订单 - - - - - 全部 - - - - {{item.categoryName}} - - - - - - - + + + + 全部 + - - {{item.giftName}} + + {{item.categoryName}} + - - - - - - - {{item.exchangePoints}} - + - ¥{{item.exchangeAmount}} + + + + + + + + {{item.giftName}} + + + + + + + + {{item.exchangePoints}} + + + ¥{{item.exchangeAmount}} + + + + 库存:{{item.remainingInventory === -1?"不限":item.remainingInventory}} - 库存:{{item.remainingInventory === -1?"不限":item.remainingInventory}} + + 立即兑换 - - 立即兑换 - + @@ -247,22 +255,20 @@ \ No newline at end of file diff --git a/gasStation-uni/pagesMy/Coupons/Coupons.vue b/gasStation-uni/pagesMy/Coupons/Coupons.vue index 3628d867f..54c52302a 100644 --- a/gasStation-uni/pagesMy/Coupons/Coupons.vue +++ b/gasStation-uni/pagesMy/Coupons/Coupons.vue @@ -16,14 +16,14 @@ {{item.name}} - + - ¥120 - 优惠券 + ¥{{item.couponAmount}} + {{item.couponType}} - 新用户专享5折券 - 部分产品可用、满240可用、此券定期可用... + {{item.couponName}} + {{item.couponContent}} 有效期:2023-11-30 @@ -39,9 +39,18 @@