From f50982f0e69b6dd492da87c86d442861744b994b Mon Sep 17 00:00:00 2001 From: wangh <9483> Date: Thu, 7 Dec 2023 10:22:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=85=E5=80=BC=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fuintAdmin/src/views/member/userInfo.vue | 6 +- .../controller/IntegralOrdersController.java | 9 + .../integral/mapper/IntegralOrdersMapper.java | 3 + .../mapper/xml/IntegralDetailMapper.xml | 3 + .../mapper/xml/IntegralOrdersMapper.xml | 75 +++++++- .../service/IntegralOrdersService.java | 3 + .../impl/IntegralDetailServiceImpl.java | 2 + .../impl/IntegralOrdersServiceImpl.java | 8 + .../controller/CardFuelRecordController.java | 14 ++ .../cardFule/dto/CardFuelRecordDTO.java | 3 + .../cardFule/mapper/CardFuelRecordMapper.java | 11 ++ .../mapper/xml/CardFuelRecordMapper.xml | 8 + .../service/CardFuelRecordService.java | 6 + .../impl/CardFuelRecordServiceImpl.java | 11 ++ .../controller/CardValueRecordController.java | 30 ++++ .../cardValue/dto/CardValueRecordDTO.java | 2 + .../cardValue/entity/CardValueRecord.java | 10 ++ .../mapper/CardValueRecordMapper.java | 9 + .../mapper/xml/CardValueRecordMapper.xml | 41 +++++ .../service/CardValueRecordService.java | 11 ++ .../impl/CardValueRecordServiceImpl.java | 20 ++- .../controller/LJStoreController.java | 2 +- .../ChainStoreConfigController.java | 10 ++ .../userManager/entity/ChainStoreConfig.java | 6 + .../service/ChainStoreConfigService.java | 2 + .../impl/ChainStoreConfigServiceImpl.java | 12 ++ .../controller/ClientSignController.java | 25 ++- .../src/test/java/UserSeriviceTest.java | 161 +++++++++++++----- .../pagesHome/PointsMall/PointsMall.vue | 21 ++- .../pagesHome/myPointsOrder/myPointsOrder.vue | 63 +++++-- gasStation-uni/pagesHome/order/order.vue | 26 ++- gasStation-uni/pagesMy/Recharge/Recharge.vue | 87 ++++++++-- 32 files changed, 614 insertions(+), 86 deletions(-) create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml diff --git a/fuintAdmin/src/views/member/userInfo.vue b/fuintAdmin/src/views/member/userInfo.vue index 950f4b6a9..7151eea4a 100644 --- a/fuintAdmin/src/views/member/userInfo.vue +++ b/fuintAdmin/src/views/member/userInfo.vue @@ -130,9 +130,9 @@ - - - + + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralOrdersController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralOrdersController.java index 51f459d41..45c90b98b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralOrdersController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralOrdersController.java @@ -48,6 +48,15 @@ public class IntegralOrdersController extends BaseController { return getSuccessResult(integralOrdersIPage); } + @GetMapping("queryByPageUni") + public ResponseObject queryByPageUni(@RequestParam(value = "page",defaultValue = "1") Integer page, + @RequestParam(value = "pageSize",defaultValue = "1000") Integer pageSize, + @Param("integralOrders") IntegralOrdersDTO integralOrders) { + Page pages = new Page(page, pageSize); + IPage integralOrdersIPage = this.integralOrdersService.queryByPageUni(pages, integralOrders); + return getSuccessResult(integralOrdersIPage); + } + /** * 通过主键查询单条数据 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralOrdersMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralOrdersMapper.java index 8576dfdda..190a443ba 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralOrdersMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralOrdersMapper.java @@ -38,6 +38,9 @@ public interface IntegralOrdersMapper { */ IPage queryAllByLimit(@Param("page") Page page, @Param("integralOrders") IntegralOrdersDTO integralOrders); + + IPage queryByPageUni(@Param("page") Page page, @Param("integralOrders") IntegralOrdersDTO integralOrders); + /** * 统计总行数 * diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralDetailMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralDetailMapper.xml index 2178c46f8..fe9aa54ac 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralDetailMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralDetailMapper.xml @@ -37,6 +37,9 @@ and store_id = #{integralDetail.storeId} + + and user_id = #{integralDetail.userId} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml index 3c048fc01..bd5adcba4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml @@ -85,7 +85,6 @@ left join integral_gift ig ON io.gift_id = ig.id left join mt_user_express_address ea ON io.address_id = ea.id - io.store_id = #{integralOrders.storeId} and ig.gift_name like CONCAT ('%',#{integralOrders.giftName},'%') @@ -105,6 +104,7 @@ and io.shipping_type = #{integralOrders.shippingType} + and ( (#{integralOrders.orderStatus} = 1 and (io.order_status = '待处理' or io.order_status = '待发货')) or @@ -146,6 +146,79 @@ + + + + + insert into card_fuel_record(mt_user_id, name, mobile, mt_staff_id, real_name, staff_mobile, card_fuel_id, recharge_balance, income_litres, payment_type, remark, points, growth_value, royalty_type, percentage_commissions, amount_commission, create_by, create_time, update_by, update_time, pay_status, store_id, payment_no, type, oil_type,chain_store_id) @@ -348,5 +349,12 @@ delete from card_fuel_record where id = #{id} + + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/CardFuelRecordService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/CardFuelRecordService.java index 35a2f51fe..838661fc7 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/CardFuelRecordService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/CardFuelRecordService.java @@ -33,6 +33,8 @@ public interface CardFuelRecordService { */ IPage queryByPage(@Param("page") Page page, CardFuelRecord cardFuelRecord); + + /** * 新增数据 * @@ -73,5 +75,9 @@ public interface CardFuelRecordService { boolean editPayStatus(Integer id, String payStatus); + /** + * 查询用户屯油卡充值记录 + */ + IPage selectFuelRecord(@Param("page") Page page, CardFuelRecord cardFuelRecord); } 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 63de57574..f13f0f6d9 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 @@ -309,4 +309,15 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { return integralDetail; } + + /** + * 查询用户屯油卡充值记录 + */ + @Override + public IPage selectFuelRecord(@Param("page") Page page, CardFuelRecord cardFuelRecord) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + cardFuelRecord.setStoreId(nowAccountInfo.getStoreId()); + return this.cardFuelRecordMapper.selectFuelRecord(page, cardFuelRecord); + } + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/controller/CardValueRecordController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/controller/CardValueRecordController.java index ae63debbc..e5974c845 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/controller/CardValueRecordController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/controller/CardValueRecordController.java @@ -112,5 +112,35 @@ public class CardValueRecordController extends BaseController { public ResponseObject checkTheStatusOfYourPayment(Integer id) { return getSuccessResult(this.cardValueRecordService.checkTheStatusOfYourPayment(id)); } + + /** + * 查询用户的储值充值记录 + * @param pageNo + * @param pageSize + * @param cardValueRecord + * @return + */ + @GetMapping("selectCardRecord") + public ResponseObject selectCardRecord(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, + @Param("cardValueRecord") CardValueRecordDTO cardValueRecord) { + Page page = new Page(pageNo, pageSize); + return getSuccessResult(this.cardValueRecordService.selectCardRecord(page, cardValueRecord)); + } + + /** + * 查询用户的储值充值记录 和囤油充值记录 + * @param pageNo + * @param pageSize + * @param cardValueRecord + * @return + */ + @GetMapping("selectAllRecord") + public ResponseObject selectAllRecord(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, + @Param("cardValueRecord") CardValueRecordDTO cardValueRecord) { + Page page = new Page(pageNo, pageSize); + return getSuccessResult(this.cardValueRecordService.selectAllRecord(page, cardValueRecord)); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/dto/CardValueRecordDTO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/dto/CardValueRecordDTO.java index eb1232b5f..eb33a95a0 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/dto/CardValueRecordDTO.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/dto/CardValueRecordDTO.java @@ -8,6 +8,8 @@ import lombok.Data; */ @Data public class CardValueRecordDTO extends CardValueRecord { + private String recordName; + private String obtain; private String authCode; private Double realyPayBills; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/entity/CardValueRecord.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/entity/CardValueRecord.java index 1ba77d386..a8d5fda61 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/entity/CardValueRecord.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/entity/CardValueRecord.java @@ -82,6 +82,16 @@ public class CardValueRecord extends Model { // 支付编号 private String paymentNo; + // + private Integer chainStoreId; + + public Integer getChainStoreId() { + return chainStoreId; + } + + public void setChainStoreId(Integer chainStoreId) { + this.chainStoreId = chainStoreId; + } public String getPaymentNo() { return paymentNo; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/CardValueRecordMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/CardValueRecordMapper.java index a5a19382f..dd6e8c9a2 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/CardValueRecordMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/CardValueRecordMapper.java @@ -1,6 +1,10 @@ package com.fuint.business.marketingActivity.cardValue.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.integral.entity.IntegralDetail; +import com.fuint.business.marketingActivity.cardValue.dto.CardValueRecordDTO; import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord; import org.apache.ibatis.annotations.Param; @@ -12,5 +16,10 @@ import org.apache.ibatis.annotations.Param; */ public interface CardValueRecordMapper extends BaseMapper { + IPage selectCardRecord(@Param("page") Page page,@Param("cardValueRecord") CardValueRecordDTO cardValueRecord); + + IPage selectAllRecord(@Param("page") Page page, @Param("cardValueRecord") CardValueRecordDTO cardValueRecord); + + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml new file mode 100644 index 000000000..f43bf0aaf --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/CardValueRecordService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/CardValueRecordService.java index 21d9f7134..735bfb20c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/CardValueRecordService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/CardValueRecordService.java @@ -1,9 +1,13 @@ package com.fuint.business.marketingActivity.cardValue.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.integral.entity.IntegralDetail; import com.fuint.business.marketingActivity.cardValue.dto.CardValueRecordDTO; import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord; import com.fuint.business.petrolStationManagement.entity.OilGun; +import io.lettuce.core.dynamic.annotation.Param; /** * 储值充值表(CardValueRecord)表服务接口 @@ -33,4 +37,11 @@ public interface CardValueRecordService extends IService { CardValueRecord checkTheStatusOfYourPayment(Integer id); boolean editPayStatus(Integer id, String payStatus); + + + IPage selectCardRecord(@Param("page") Page page, CardValueRecordDTO cardValueRecord); + + IPage selectAllRecord(@Param("page") Page page, CardValueRecordDTO cardValueRecord); + + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java index 1814e765f..edf506678 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java @@ -2,6 +2,8 @@ package com.fuint.business.marketingActivity.cardValue.service.impl; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +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.api.fuyou.entity.MerchantConfig; import com.fuint.api.fuyou.service.FyPayService; @@ -24,8 +26,8 @@ import com.fuint.business.userManager.service.UserBalanceService; import com.fuint.business.userManager.vo.LJUserVo; import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; +import io.lettuce.core.dynamic.annotation.Param; import lombok.extern.slf4j.Slf4j; -import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -65,6 +67,9 @@ public class CardValueRecordServiceImpl extends ServiceImpl0; } + + + @Override + public IPage selectCardRecord(@Param("page") Page page, CardValueRecordDTO cardValueRecord) { + return this.cardValueRecordMapper.selectCardRecord(page, cardValueRecord); + } + + @Override + public IPage selectAllRecord(@Param("page") Page page, CardValueRecordDTO cardValueRecord) { + return this.cardValueRecordMapper.selectAllRecord(page, cardValueRecord); + } + + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/controller/LJStoreController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/controller/LJStoreController.java index 44889fb82..95361d4ec 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/controller/LJStoreController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/controller/LJStoreController.java @@ -28,7 +28,7 @@ public class LJStoreController extends BaseController { return getSuccessResult(store); } - @GetMapping("storeInfoUni") + @GetMapping("storeInfoUni") public ResponseObject storeInfoUni(Integer storeId){ LJStore store = storeService.selectStoreByIdUni(storeId); return getSuccessResult(store); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/ChainStoreConfigController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/ChainStoreConfigController.java index e8b370abb..545649453 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/ChainStoreConfigController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/ChainStoreConfigController.java @@ -27,6 +27,16 @@ public class ChainStoreConfigController extends BaseController { return getSuccessResult(chainStoreConfig); } + + /** + * 根据id查询连锁店配置信息 + * @return + */ + @GetMapping("chainStoreConfigInfoByChainId") + public ResponseObject chainStoreConfigInfoByChainId(ChainStoreConfig chainStoreConfig){ + return getSuccessResult(chainStoreConfigService.chainStoreConfigInfoByChainId(chainStoreConfig)); + } + /** * 修改连锁店配置信息 * @param chainStoreConfig diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/entity/ChainStoreConfig.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/entity/ChainStoreConfig.java index 7333ed4f0..b64c5084a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/entity/ChainStoreConfig.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/entity/ChainStoreConfig.java @@ -34,4 +34,10 @@ public class ChainStoreConfig extends BaseEntity implements Serializable { @ApiModelProperty("等级清算规则") private String levelClearRule; + + /** + * 微信小程序 (配置信息) + */ + private String wxAppId; + private String wxAppSecret; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/ChainStoreConfigService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/ChainStoreConfigService.java index 878c4e661..bb08e3aee 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/ChainStoreConfigService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/ChainStoreConfigService.java @@ -13,6 +13,8 @@ public interface ChainStoreConfigService extends IService { */ public ChainStoreConfig selectChainStoreConfigById(); + public ChainStoreConfig chainStoreConfigInfoByChainId(ChainStoreConfig chainStoreConfig); + /** * 根据id修改连锁店配置信息 * @param chainStoreConfig diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/ChainStoreConfigServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/ChainStoreConfigServiceImpl.java index de5e1eb2d..fd8457e9a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/ChainStoreConfigServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/ChainStoreConfigServiceImpl.java @@ -1,5 +1,6 @@ package com.fuint.business.userManager.service.impl; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.member.entity.LJStaff; @@ -28,6 +29,17 @@ public class ChainStoreConfigServiceImpl extends ServiceImpl(); + queryWrapper.eq("chain_store_id", chainStoreConfig.getChainStoreId()); + return baseMapper.selectOne(queryWrapper); + } + /** * 根据id修改连锁店配置信息 * @param chainStoreConfig diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/clientApi/controller/ClientSignController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/clientApi/controller/ClientSignController.java index 4bb135f8e..6a8251e90 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/clientApi/controller/ClientSignController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/clientApi/controller/ClientSignController.java @@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject; import com.fuint.business.store.service.StoreService; import com.fuint.business.storeInformation.entity.LJStore; import com.fuint.business.storeInformation.service.ILJStoreService; +import com.fuint.business.userManager.entity.ChainStoreConfig; +import com.fuint.business.userManager.service.ChainStoreConfigService; import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.TokenDto; import com.fuint.common.dto.UserInfo; @@ -94,6 +96,12 @@ public class ClientSignController extends BaseController { @Resource ILJStoreService iljStoreService; + /** + * 连锁店配置信息 + */ + @Resource + ChainStoreConfigService chainStoreConfigService; + @Autowired private Environment env; @@ -113,9 +121,17 @@ public class ClientSignController extends BaseController { logger.info("微信授权登录参数:{}", param); JSONObject userInfo = paramsObj.getJSONObject("userInfo"); String storeId = ObjectUtil.isEmpty(userInfo.get("storeId"))? "" : userInfo.get("storeId").toString(); -// String staffId = ObjectUtil.isEmpty(userInfo.get("staffId"))? "" : userInfo.get("staffId").toString(); -// String inviterId = ObjectUtil.isEmpty(userInfo.get("inviterId"))? "" : userInfo.get("inviterId").toString(); - JSONObject loginInfo = weixinService.getWxProfile2(param.get("code").toString()); // 发起的登录请求 merchantId(用来获取商户的appid 目前用不到) + if ("".equals(storeId)) return getFailureResult(0, "微信登录失败"); + + // 根据storeId查找对应的连锁店id + LJStore ljStore = iljStoreService.selectStoreByIdUni(Integer.parseInt(storeId)); + // todo 获取微信小程序配置信息 + ChainStoreConfig chainStoreConfig = new ChainStoreConfig(); + chainStoreConfig.setChainStoreId(ljStore.getChainStoreId()); + ChainStoreConfig wxConfig = chainStoreConfigService.chainStoreConfigInfoByChainId(chainStoreConfig); + System.out.println("wxConfig"+wxConfig); + // 发起的登录请求 + JSONObject loginInfo = weixinService.getWxProfile2(param.get("code").toString()); if (loginInfo == null) { return getFailureResult(0, "微信登录失败"); } @@ -125,8 +141,7 @@ public class ClientSignController extends BaseController { return getFailureResult(0, "用户状态异常"); } - // 根据storeId查找对应的连锁店id - LJStore ljStore = iljStoreService.selectStoreByIdUni(Integer.parseInt(storeId)); + String userAgent = request.getHeader("user-agent"); AccountInfo accountInfo = new AccountInfo(); diff --git a/fuintBackend/fuint-application/src/test/java/UserSeriviceTest.java b/fuintBackend/fuint-application/src/test/java/UserSeriviceTest.java index 5f53bde8f..c891c1fc4 100644 --- a/fuintBackend/fuint-application/src/test/java/UserSeriviceTest.java +++ b/fuintBackend/fuint-application/src/test/java/UserSeriviceTest.java @@ -9,6 +9,7 @@ import org.apache.rocketmq.client.exception.MQClientException; import org.apache.rocketmq.client.producer.DefaultMQProducer; import org.apache.rocketmq.client.producer.SendResult; import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.remoting.common.RemotingHelper; import org.apache.rocketmq.remoting.exception.RemotingException; import org.junit.Test; import org.junit.runner.RunWith; @@ -27,63 +28,129 @@ import java.util.List; public class UserSeriviceTest { @Test public void test() throws MQClientException, UnsupportedEncodingException, MQBrokerException, RemotingException, InterruptedException { - //1.创建一个发送消息的对象Producer,指定分组(生产者分组) 等会讲 - DefaultMQProducer producer = new DefaultMQProducer("group1"); - - //2.设定发送的命名服务器地址,连接上ns之后,才能拿到broker地址,发送消息 - producer.setNamesrvAddr("39.104.58.101:9876"); - - //3.1启动发送的服务 - producer.start(); - - //4.创建要发送的消息对象,指定topic,指定内容body - Message msg = new Message("topic1","hello rocketmq".getBytes("UTF-8")); - //3.2发送消息。这里是同步请求,如果broker没有给出响应,就拿不到返回值并且卡死在当前行代码 - SendResult result = producer.send(msg); - System.out.println("返回结果:"+result); - //5.关闭连接 +// //1.创建一个发送消息的对象Producer,指定分组(生产者分组) 等会讲 +// DefaultMQProducer producer = new DefaultMQProducer("group1"); +// +// //2.设定发送的命名服务器地址,连接上ns之后,才能拿到broker地址,发送消息 +// producer.setNamesrvAddr("47.95.206.185:9876"); +// +// //3.1启动发送的服务 +// producer.start(); +// +// //4.创建要发送的消息对象,指定topic,指定内容body +// Message msg = new Message("topic1","hello rocketmq".getBytes("UTF-8")); +// //3.2发送消息。这里是同步请求,如果broker没有给出响应,就拿不到返回值并且卡死在当前行代码 +// SendResult result = producer.send(msg); +// System.out.println("返回结果:"+result); +// //5.关闭连接 // producer.shutdown(); + //Instantiate with a producer group name. + DefaultMQProducer producer = new + DefaultMQProducer("please_rename_unique_group_name"); + // Specify name server addresses. + producer.setNamesrvAddr("47.95.206.185:9876"); + //Launch the instance. + producer.start(); + for (int i = 0; i < 100; i++) { + //Create a message instance, specifying topic, tag and message body. + Message msg = new Message("TopicTest" /* Topic */, + "TagA" /* Tag */, + ("Hello RocketMQ " + + i).getBytes(RemotingHelper.DEFAULT_CHARSET) /* Message body */ + ); + //Call send message to deliver message to one of brokers. + SendResult sendResult = producer.send(msg); + System.out.printf("%s%n", sendResult); + } + //Shut down once the producer instance is not longer in use. + producer.shutdown(); + + + } @Test public void consumer() throws MQClientException { - //1.创建一个接收消息的对象Consumer - DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("group1"); - //2.设定接收的命名服务器地址 - consumer.setNamesrvAddr("39.104.58.101:9876"); - //3.设置接收消息对应的topic,对应的sub标签为任意* - // 如果想接收之前topic1的生产者发送的消息,这里的就要订阅相同的topic才可以 - try { - consumer.subscribe("topic1", "*"); - } catch (MQClientException e) { - e.printStackTrace(); - } - //4.开启监听,用于接收消息 - consumer.registerMessageListener(new MessageListenerConcurrently() { - /** - * 设置好监听之后,只要有消息出现,就会调用 consumeMessage方法 - * @param list 所有的消息都会存入该集合,供消费者消费 - * @param consumeConcurrentlyContext 同时并行消费(多线程)的上下文 - * @return - */ - @Override - public ConsumeConcurrentlyStatus consumeMessage(List list, ConsumeConcurrentlyContext consumeConcurrentlyContext) { - //遍历消息 - for (MessageExt msg : list) { -// System.out.println("收到消息:"+msg); - System.out.println("消息:" + new String(msg.getBody())); - } - return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; - } - }); - //5.启动接收消息的服务 - consumer.start(); - System.out.println("接收消息服务已开启运行"); +// //1.创建一个接收消息的对象Consumer +// DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("group1"); +// //2.设定接收的命名服务器地址 +// consumer.setNamesrvAddr("47.95.206.185:9876"); +// //3.设置接收消息对应的topic,对应的sub标签为任意* +// // 如果想接收之前topic1的生产者发送的消息,这里的就要订阅相同的topic才可以 +// try { +// consumer.subscribe("topic1", "*"); +// } catch (MQClientException e) { +// e.printStackTrace(); +// } +// //4.开启监听,用于接收消息 +// consumer.registerMessageListener(new MessageListenerConcurrently() { +// /** +// * 设置好监听之后,只要有消息出现,就会调用 consumeMessage方法 +// * @param list 所有的消息都会存入该集合,供消费者消费 +// * @param consumeConcurrentlyContext 同时并行消费(多线程)的上下文 +// * @return +// */ +// @Override +// public ConsumeConcurrentlyStatus consumeMessage(List list, ConsumeConcurrentlyContext consumeConcurrentlyContext) { +// //遍历消息 +// for (MessageExt msg : list) { +//// System.out.println("收到消息:"+msg); +// System.out.println("消息:" + new String(msg.getBody())); +// } +// return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; +// } +// }); +// //5.启动接收消息的服务 +// consumer.start(); +// System.out.println("接收消息服务已开启运行"); // 不能关闭消费者端服务器,因为对broker中topic设置了监听; // 该topic中只要有了新消息,就要通知消费者消费 // consumer.shutdown(); + + + + // Instantiate with specified consumer group name. + DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("please_rename_unique_group_name"); + + // Specify name server addresses. + consumer.setNamesrvAddr("47.95.206.185:9876"); + + // Subscribe one more more topics to consume. + consumer.subscribe("TopicTest", "*"); + // Register callback to execute on arrival of messages fetched from brokers. + consumer.registerMessageListener(new MessageListenerConcurrently() { + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, + ConsumeConcurrentlyContext context) { + System.out.printf("%s Receive New Messages: %s %n", Thread.currentThread().getName(), msgs); + + + for (MessageExt msg : msgs) { + byte[] body = msg.getBody(); + String messageBody = null; + try { + messageBody = new String(body, RemotingHelper.DEFAULT_CHARSET); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + System.out.printf("%s 转成之后的信息: %s%n", Thread.currentThread().getName(), messageBody); + + // 在这里添加你的业务逻辑,处理消息 + } + + + + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + }); + + //Launch the consumer instance. + consumer.start(); + + System.out.printf("Consumer Started.%n"); } } diff --git a/gasStation-uni/pagesHome/PointsMall/PointsMall.vue b/gasStation-uni/pagesHome/PointsMall/PointsMall.vue index 1cd5088e2..c71d2c8db 100644 --- a/gasStation-uni/pagesHome/PointsMall/PointsMall.vue +++ b/gasStation-uni/pagesHome/PointsMall/PointsMall.vue @@ -13,8 +13,8 @@ {{myPoints}} - 蓝鲸加油站(总站) - + {{storeName}} + @@ -103,6 +103,7 @@ data() { return { myPoints: 0, + storeName: '', categoryList: {}, integralGiftList: {}, title: '', @@ -130,6 +131,8 @@ }, onShow() { this.getUserInfoList() + // 获取店铺信息 + this.getInfoByStoreId() }, methods: { transferIndex(index, categoryId) { @@ -222,6 +225,20 @@ } }) }, + // 根据storeId查询店铺信息 + getInfoByStoreId() { + request({ + url: '/business/storeInformation/store/storeInfoUni', + method: 'get', + params: { + storeId: uni.getStorageSync('storeId') + } + }).then((res) => { + if (res.code == 200) { + this.storeName = res.data.name + } + }) + } }, onUnload() { uni.$off('goodsInfo') diff --git a/gasStation-uni/pagesHome/myPointsOrder/myPointsOrder.vue b/gasStation-uni/pagesHome/myPointsOrder/myPointsOrder.vue index 523d92e75..0bfc5966d 100644 --- a/gasStation-uni/pagesHome/myPointsOrder/myPointsOrder.vue +++ b/gasStation-uni/pagesHome/myPointsOrder/myPointsOrder.vue @@ -14,17 +14,21 @@ - + + - + - 这是我用积分买的老婆啊啊啊啊啊啊啊啊 - 165 - 90 嗨丝儿 + {{item.giftName}} + {{item.createTime}} - ¥648.00 - X8 + {{item.amount?"¥"+item.amount:''}} + {{item.amount && item.integral ? '+':''}} + {{item.integral?item.integral+'积分':''}} + + X{{item.exchangeQuantity}} @@ -53,10 +57,21 @@ @@ -101,7 +140,7 @@ .container { width: 100%; - height: 100vh; + height: 100%; box-sizing: border-box; padding-top: 88px; } diff --git a/gasStation-uni/pagesHome/order/order.vue b/gasStation-uni/pagesHome/order/order.vue index 67cac1e59..83fb11eb7 100644 --- a/gasStation-uni/pagesHome/order/order.vue +++ b/gasStation-uni/pagesHome/order/order.vue @@ -20,9 +20,9 @@ - 蓝鲸加油站(总站) + {{storeName}} - 山东省济南市槐荫区兴福路 + {{storeAddress}} @@ -111,7 +111,7 @@ @@ -88,7 +153,7 @@ .container { width: 100%; - height: 100vh; + height: 100%; box-sizing: border-box; padding-top: 88px; }