diff --git a/fuintAdmin/src/views/integral/gift/index.vue b/fuintAdmin/src/views/integral/gift/index.vue index b5f5725a3..0bf7d426a 100644 --- a/fuintAdmin/src/views/integral/gift/index.vue +++ b/fuintAdmin/src/views/integral/gift/index.vue @@ -908,6 +908,7 @@ export default { console.log(" this.dataForm", this.dataForm) + this.title = '修改礼品' this.open = true; this.getList(); diff --git a/fuintAdmin/src/views/integral/order/pointsCashier.vue b/fuintAdmin/src/views/integral/order/pointsCashier.vue index 1371578a0..02f19dbf6 100644 --- a/fuintAdmin/src/views/integral/order/pointsCashier.vue +++ b/fuintAdmin/src/views/integral/order/pointsCashier.vue @@ -61,13 +61,13 @@ 商品数量 - {{statisticsForm.exchangeQuantity}} + {{statisticsForm.exchangeQuantity?statisticsForm.exchangeQuantity:0}} 积分 - {{statisticsForm.integral}} + {{statisticsForm.integral?statisticsForm.integral:0}} @@ -78,7 +78,7 @@ - {{statisticsForm.amount}} + {{statisticsForm.amount?statisticsForm.amount:0}} @@ -88,7 +88,8 @@ + :default-sort="defaultSort" + > @@ -196,10 +197,10 @@ export default { this.$forceUpdate() }, getStatistics() { - getStatisticsApi().then(res=>{ + + getStatisticsApi({orderType: 1}).then(res=>{ this.statisticsForm = res.data }) - console.log("123123123",this.statisticsForm) }, handleUpdate(){}, 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 13720b978..0b5f99da2 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 @@ -123,8 +123,8 @@ public class IntegralOrdersController extends BaseController { * @return */ @GetMapping("/statistics") - public ResponseObject statistics() { - return getSuccessResult(this.integralOrdersService.statistics()); + public ResponseObject statistics(Integer orderType) { + return getSuccessResult(this.integralOrdersService.statistics(orderType)); } 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 be958e9f9..396dbf123 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 @@ -94,7 +94,7 @@ public interface IntegralOrdersMapper { * 统计数据 * @return */ - Map statistics(@Param("storeId") Integer storeId); + Map statistics(@Param("storeId") Integer storeId, @Param("orderType") Integer orderType); List getListByOrderNo(@Param("orderNumber") String orderNumber,@Param("storeId") Integer storeId); 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 11dccdd86..3d1702b64 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 @@ -131,7 +131,7 @@ and io.status = #{integralOrders.status} - + and io.order_type = #{integralOrders.orderType} @@ -303,6 +303,9 @@ SUM(CASE WHEN order_status IN ('已拒绝', '已退款') THEN 1 ELSE 0 END) AS refuse from integral_orders where store_id = #{storeId} + + and order_type = #{orderType} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralOrdersService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralOrdersService.java index 96b99a790..e8556578d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralOrdersService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralOrdersService.java @@ -64,7 +64,7 @@ public interface IntegralOrdersService { * @return 是否成功 */ boolean deleteById(Integer id); - Map statistics(); + Map statistics(Integer orderType); IntegralOrders integralOrdersProcessing(IntegralOrdersRequest integralOrdersList); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java index 7b975976f..c8454d6ff 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java @@ -93,7 +93,9 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService { public IPage queryByPage(@Param("page") Page page, @Param("integralOrders") IntegralOrdersDTO integralOrders) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); integralOrders.setStoreId(nowAccountInfo.getStoreId()); - return integralOrdersDao.queryAllByLimit(page, integralOrders); + IPage integralOrdersVOIPage = integralOrdersDao.queryAllByLimit(page, integralOrders); + + return integralOrdersVOIPage; } @@ -149,9 +151,9 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService { } @Override - public Map statistics() { + public Map statistics(Integer orderType) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); - return this.integralOrdersDao.statistics(nowAccountInfo.getStoreId()); + return this.integralOrdersDao.statistics(nowAccountInfo.getStoreId(),orderType); } /** @@ -166,7 +168,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService { double epsilon = 1e-10; // 阈值 AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); // 当为小程序下单时 - if (ObjectUtil.isNotEmpty(integralOrdersList.getOrderChannel()) & integralOrdersList.getOrderChannel() == -1) { + if (ObjectUtil.isNotEmpty(integralOrdersList.getOrderChannel()) && integralOrdersList.getOrderChannel() == -1) { nowAccountInfo.setChainStoreId(integralOrdersList.getChainStoreId()); nowAccountInfo.setStoreId(integralOrdersList.getStoreId()); integralOrdersList.getIntegralOrdersList().get(0).setUserId(nowAccountInfo.getId()); @@ -174,6 +176,13 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService { } // 首先判断是否足够积分 LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(integralOrdersList.getIntegralOrdersList().get(0).getUserId(), nowAccountInfo.getChainStoreId()); + if (ObjectUtil.isEmpty(ljUserVos)) { + // 个人信息为空时,初始化 +// return +// userBalanceService.initBalance(integralOrdersList.getIntegralOrdersList().get(0).getUserId(), nowAccountInfo.getChainStoreId()); +// ljUserVos = ljUserMapper.selectAllInfoById2(integralOrdersList.getIntegralOrdersList().get(0).getUserId(), nowAccountInfo.getChainStoreId()); + } + if (ljUserVos.getPoints() < integralOrdersList.getAllPoints()) { integralOrdersList.getIntegralOrdersList().get(0).setStatus("un"); return integralOrdersList.getIntegralOrdersList().get(0); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/WeixinServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/WeixinServiceImpl.java index 50e02c109..7b10a27df 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/WeixinServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/WeixinServiceImpl.java @@ -1,5 +1,6 @@ package com.fuint.common.service.impl; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONArray; @@ -292,6 +293,7 @@ public class WeixinServiceImpl implements WeixinService { try { String response = HttpRESTDataClient.requestGet(url); JSONObject json = (JSONObject) JSONObject.parse(response); + if (!json.containsKey("errcode")) { logger.error("拿到code信息:code = " + json); @@ -314,6 +316,8 @@ public class WeixinServiceImpl implements WeixinService { String wxAccessUrl = "https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code"; String url = String.format(wxAccessUrl, wxAppId, wxAppSecret, code); try { +// JSONObject wxProfile = getWxProfile(null, code); + String response = HttpRESTDataClient.requestGet(url); JSONObject json = (JSONObject) JSONObject.parse(response); if (!json.containsKey("errcode")) { diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/response/LoginResponse.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/response/LoginResponse.java index ab89bdd36..9b2653b94 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/response/LoginResponse.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/response/LoginResponse.java @@ -17,4 +17,5 @@ public class LoginResponse implements Serializable { private Date tokenExpiryTime; private String token; private Integer chainStoreId; + private String phone; } 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 6a8251e90..e37e21038 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 @@ -31,6 +31,7 @@ import com.fuint.utils.StringUtil; import io.lettuce.core.ScriptOutputType; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.subject.Subject; @@ -55,6 +56,7 @@ import java.util.Map; @Api(tags="会员端-登录相关接口") @RestController @RequestMapping(value = "/clientApi/sign") +@Slf4j public class ClientSignController extends BaseController { /** @@ -135,13 +137,15 @@ public class ClientSignController extends BaseController { if (loginInfo == null) { return getFailureResult(0, "微信登录失败"); } + // 获取用户的个人信息 + String phoneNumber = weixinService.getPhoneNumber(param.get("encryptedData").toString(), loginInfo.get("session_key").toString(), param.get("encryptedIv").toString()); + userInfo.put("phone",phoneNumber); MtUser mtUser = memberService.queryMemberByOpenId2(loginInfo.get("openid").toString(), userInfo); if (mtUser == null) { return getFailureResult(0, "用户状态异常"); } - - + logger.error("loginInfo{}",loginInfo.toString()); String userAgent = request.getHeader("user-agent"); AccountInfo accountInfo = new AccountInfo(); @@ -158,6 +162,7 @@ public class ClientSignController extends BaseController { response.setChainStoreId(ljStore.getChainStoreId()); response.setToken(token); response.setTokenCreatedTime(new Date()); +// response.setPhone(phoneNumber); return getSuccessResult("登录成功", response); } diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue index ea3ca8cd8..e8f166074 100644 --- a/gasStation-uni/pages/index/index.vue +++ b/gasStation-uni/pages/index/index.vue @@ -223,7 +223,7 @@ if (uni.getStorageSync("storeId")) { this.storeId = uni.getStorageSync("storeId") } else { - let storeId = "12"; + let storeId = "34"; uni.setStorageSync("storeId", storeId) } diff --git a/gasStation-uni/pagesHome/PointsMall/PointsMall.vue b/gasStation-uni/pagesHome/PointsMall/PointsMall.vue index 1a058f7a9..041f53efa 100644 --- a/gasStation-uni/pagesHome/PointsMall/PointsMall.vue +++ b/gasStation-uni/pagesHome/PointsMall/PointsMall.vue @@ -98,7 +98,7 @@ 积分不足 + item.exchangePoints>myPoints" style="color: darkgray;">积分不足 达到兑换上限 立即兑换 @@ -212,13 +212,15 @@ async godetails(data) { let flag = await this.checkTheRedemptionLimit(data.giftId) + console.log("data.remainingInventory", data.exchangePoints) + console.log("this.myPoints", this.myPoints) if (data.remainingInventory == 0) { uni.showToast({ title: "该商品库存不足!", icon: "none" }) - } else if (data.remainingInventory > this.myPoints && ( + } else if (data.exchangePoints > this.myPoints && ( data.exchangeMethod == '积分' || data.exchangeMethod == '积分+金额')) { uni.showToast({ diff --git a/gasStation-uni/pagesLogin/login/login.vue b/gasStation-uni/pagesLogin/login/login.vue index 05675eb60..106e68f2e 100644 --- a/gasStation-uni/pagesLogin/login/login.vue +++ b/gasStation-uni/pagesLogin/login/login.vue @@ -71,7 +71,7 @@ authCode: authCode, storeId: 0, staffId: "", - phone: "18457621459", + phone: "16548796325", }, }).then((resp) => { console.log(resp) @@ -347,4 +347,4 @@ border: 1px solid #0078FF; color: white; } - + \ No newline at end of file diff --git a/out/production/oilSystem/pom.xml b/out/production/oilSystem/pom.xml index 901074ed5..364791d65 100644 --- a/out/production/oilSystem/pom.xml +++ b/out/production/oilSystem/pom.xml @@ -35,6 +35,22 @@ + + + + + + + + + + + net.java.dev.jna + jna + 5.10.0 + + + cn.hutool hutool-all @@ -85,12 +101,20 @@ 3.1.0 + io.swagger swagger-annotations 1.5.21 + + + org.redisson + redisson-spring-boot-starter + 3.16.2 + + io.swagger swagger-models @@ -184,6 +208,12 @@ 2.2.1 + + + + + + com.github.wxpay