diff --git a/fuintAdmin/src/views/member/userInfo.vue b/fuintAdmin/src/views/member/userInfo.vue
index 075fad93a..88856531e 100644
--- a/fuintAdmin/src/views/member/userInfo.vue
+++ b/fuintAdmin/src/views/member/userInfo.vue
@@ -167,7 +167,6 @@
赠送{{ item.giftBalance }}元
-
@@ -421,6 +420,13 @@
+
+
+
+ 关 闭
+
+
+
@@ -876,6 +882,7 @@ export default {
isPay: true,
isPaySuccess: false,
+ isAwait: false,
isQuery: true,
payList: [],
@@ -1113,7 +1120,7 @@ export default {
this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance);
// console.log("this.grade.name",this.grade)
})
- // console.log("this.cardValueList", this.grade)
+ console.log("123123123123123123123t")
if (this.cardValueList.length > 0) {
// 过滤
@@ -1126,8 +1133,12 @@ export default {
this.cardValueList = this.cardValueList.filter(item => {
return item.groupOriented === "1";
});
+ if (this.cardValueList.length > 0) {
+ this.rechargeCard(0);
+ }
}
}
+ this.$forceUpdate();
},
valueAmoutChange(data) {
@@ -1264,13 +1275,13 @@ export default {
// 查询员工
// 会员充值
- userRecharge() {
+ async userRecharge() {
- this.getCardFuelDieselList()
- this.getCardValueList()
- this.getCountOilType()
+ await this.getCardFuelDieselList()
+ await this.getCardValueList()
+ await this.getCountOilType()
- this.getPayList();
+ await this.getPayList();
this.openRecharge = true;
this.title = '会员充值'
@@ -1307,9 +1318,6 @@ export default {
this.openConfirm = true;
this.isPay = true
- // console.log("11111",this.isPay)
- // this.isPaySuccess=false
-
this.title = this.payment
},
// 支付方式
@@ -1433,8 +1441,8 @@ export default {
},
+ // 最终支付
async collection() {
-
let userForm = this.form
if (this.flag === 1) {
@@ -1493,9 +1501,10 @@ export default {
clearInterval(timer);
this_.loading = false;
this_.isPay = false;
- this.isPaySuccess = false;
+ this_.isPaySuccess = false;
+ this_.isAwait = true;
console.log("t3")
- }, 10000)
+ }, 15000)
} else if (this.flag === 2) {
if (!this.authCode && this.cardFuelDieselForm.paymentType !== "CASH") {
@@ -1551,9 +1560,10 @@ export default {
clearInterval(timer);
this_.loading = false;
this_.isPay = false;
- this.isPaySuccess = false;
+ this_.isPaySuccess = false;
+ this_.isAwait = true;
- }, 30000)
+ }, 15000)
let this_ = this
}
@@ -1600,13 +1610,26 @@ export default {
points: '', //赠送积分
growthValue: '', // 赠送成长值
remark: '',
- paymentType: '', // 支付方式
+ paymentType: 'WECHAT', // 支付方式
royaltyType: '',// 提成类型
percentageCommissions: null,
amountCommission: null,
rechargeType: '0'
}
-
+ this.cardFuelDieselForm = {
+ mtStaffId: '',
+ realName: '',
+ staffMobile: '',
+ points: '',
+ remark: '',
+ rechargeBalance: '', //实际支付
+ paymentType: 'WECHAT',
+ payType:'',
+ oilType: '',
+ type: '',
+ chainStorId: '',
+ incomeLitres: '',
+ },
// 刷新页面
this.getUserInfo();
this.getInformation();
@@ -1656,6 +1679,7 @@ export default {
this.cardValueForm = {}
this.cardFuelDieselForm = {}
+ this.iniz()
},
cancelCollection() {
this.openConfirm = false;
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/MerchantConfigServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/MerchantConfigServiceImpl.java
index 522ae1642..f434f9316 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/MerchantConfigServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/MerchantConfigServiceImpl.java
@@ -195,7 +195,6 @@ public class MerchantConfigServiceImpl extends ServiceImpl {
boolean editGoodsInventory(LJGoodsDto goods);
boolean subtractGoodesStockByLock(@Param("id") Integer id, @Param("stock") Integer stock);
+
+ boolean determineTheInventoryOfTheProduct(@Param("id") Integer id, @Param("stock") Integer stock);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/LJGoodsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/LJGoodsServiceImpl.java
index 8b99b5df7..59cb5f6a4 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/LJGoodsServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/LJGoodsServiceImpl.java
@@ -287,4 +287,15 @@ public class LJGoodsServiceImpl extends ServiceImpl impl
return true;
}
+
+ // 判断商品库存是否足够
+ @Override
+ public boolean determineTheInventoryOfTheProduct(@Param("id") Integer id, @Param("stock") Integer stock) {
+ LJGoods ljGoods = baseMapper.selectById(id);
+ if (stock.compareTo(ljGoods.getStock())>0) {
+ return false;
+ }
+ return true;
+ }
+
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralGiftServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralGiftServiceImpl.java
index c1ee3e5b1..dfd2be2b2 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralGiftServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralGiftServiceImpl.java
@@ -1,8 +1,12 @@
package com.fuint.business.integral.service.impl;
+import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fuint.business.convenienceSore.entity.LJGoods;
+import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.integral.entity.IntegralGift;
+import com.fuint.business.integral.entity.IntegralGiftCategory;
import com.fuint.business.integral.mapper.IntegralGiftMapper;
import com.fuint.business.integral.service.IntegralGiftService;
import com.fuint.business.integral.service.IntegralOrdersService;
@@ -79,6 +83,7 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
*/
@Override
public IntegralGift insert(IntegralGift integralGift) {
+ determineTheInventoryOfTheProduct(integralGift);
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
integralGift.setStoreId(nowAccountInfo.getStoreId());
integralGift.setCreateBy(nowAccountInfo.getStaffId().toString());
@@ -94,10 +99,31 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
*/
@Override
public IntegralGift update(IntegralGift integralGift) {
+ determineTheInventoryOfTheProduct(integralGift);
+
this.integralGiftDao.update(integralGift);
return this.queryById(integralGift.getId());
}
+ @Resource
+ LJGoodsService ljGoodsService;
+ /**
+ * 判断商品库存是否足够
+ */
+ public boolean determineTheInventoryOfTheProduct(IntegralGift integralGift) {
+ if ("实物商品".equals(integralGift.getGiftType())) {
+ if (ObjectUtil.isNotEmpty(integralGift.getGoodsId())) {
+ LJGoods byId = ljGoodsService.getById(integralGift.getGoodsId());
+
+ if (integralGift.getTotalInventory().compareTo(byId.getStock())>0){
+ throw new RuntimeException("该商品库存不足,可用库存“"+byId.getStock()+"”");
+ }
+ }
+ }
+ return true;
+ }
+
+
/**
* 通过主键删除数据
*
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 df8d0a40f..92bd46b4a 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
@@ -190,6 +190,10 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
}
// 插入订单
List integralOrdersList1 = integralOrdersList.getIntegralOrdersList();
+
+
+ // 当积分兑换为商品是需要判断库存是否足够
+
if (integralOrdersList1.size() < 0) return null;
@@ -315,13 +319,13 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
@Transactional
public IntegralOrders checkTheStatusOfYourPaymentByIntegral(String orderNo) {
- AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// 查询订单信息
// List listByOrderNo = integralOrdersDao.getListByOrderNo2(orderNo, nowAccountInfo.getStoreId());
List listByOrderNo = integralOrdersDao.getListByOrderNo2(orderNo);
// 加锁 processing_status
- String lockKey = "IntegralOrders"+nowAccountInfo.getStoreId()+orderNo;
+ String lockKey = "IntegralOrders"+orderNo;
Boolean isLock = redisLock.tryLock(lockKey, 5000, TimeUnit.MILLISECONDS);
if (isLock && "paid".equals(listByOrderNo.get(0).getStatus()) && "0".equals(listByOrderNo.get(0).getProcessingStatus()) ) {
// 查询用户信息
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilGunServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilGunServiceImpl.java
index 3ee073db5..33026ba8e 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilGunServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilGunServiceImpl.java
@@ -1,5 +1,6 @@
package com.fuint.business.petrolStationManagement.service.impl;
+import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -131,6 +132,11 @@ public class OilGunServiceImpl implements OilGunService {
return oilGunList.size();
}
+ public List checkData2(OilGun oilGun) {
+ List oilGunList = oilGunDao.checkData(oilGun);
+ return oilGunList;
+ }
+
/**
* 修改数据
*
@@ -141,10 +147,16 @@ public class OilGunServiceImpl implements OilGunService {
public boolean update(OilGun oilGun) {
AccountInfo accountInfo = TokenUtil.getNowAccountInfo();
oilGun.setStoreId(accountInfo.getStoreId());
- int i = checkData(oilGun);
- if (i>1) {
- return false;
+ List oilGuns = checkData2(oilGun);
+ if (ObjectUtil.isNotEmpty(oilGuns)) {
+ if (oilGuns.size()>1) {
+ return false;
+ }
+ if (!oilGuns.get(0).getId().equals(oilGun.getId())) {
+ return false;
+ }
}
+
oilGun.setUpdateBy(accountInfo.getId().toString());
return this.oilGunDao.update(oilGun)>0;
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/LJStoreServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/LJStoreServiceImpl.java
index 705d738cd..f9696a691 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/LJStoreServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/LJStoreServiceImpl.java
@@ -71,6 +71,7 @@ public class LJStoreServiceImpl extends ServiceImpl impl
// 经度
Double lon = Double.valueOf(map.get("lon"));
Double lat = Double.valueOf(map.get("lat"));
+ String isLogin = ObjectUtil.isEmpty(map.get("isLogin"))?"1":map.get("isLogin");
String storeId = map.get("storeId");
LJStore ljStore = new LJStore();
Double distance = 0.0;
@@ -131,13 +132,16 @@ public class LJStoreServiceImpl extends ServiceImpl impl
}
// 判断当前店铺是否存在此用户的会员信息,没有的话进行添加
- AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
- LJStore store = this.selectStoreByStoreId(Integer.valueOf(storeId));
- UserBalance balance = userBalanceService.selectUserBalance(nowAccountInfo.getId(), store.getChainStoreId());
- if (ObjectUtil.isEmpty(balance)){
- userBalanceService.initBalance(nowAccountInfo.getId(),store.getChainStoreId());
+ if ("0".equals(isLogin)) { // 判断是否登录
+ AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+ LJStore store = this.selectStoreByStoreId(Integer.valueOf(storeId));
+ UserBalance balance = userBalanceService.selectUserBalance(nowAccountInfo.getId(), store.getChainStoreId());
+ if (ObjectUtil.isEmpty(balance)){
+ userBalanceService.initBalance(nowAccountInfo.getId(),store.getChainStoreId());
+ }
}
+
Map map1 = new HashMap<>();
map1.put("distance",distance);
map1.put("store",ljStore);
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/shiroConfig/ShiroConfig.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/shiroConfig/ShiroConfig.java
index 00392f9b6..c6f73fefc 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/shiroConfig/ShiroConfig.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/shiroConfig/ShiroConfig.java
@@ -52,7 +52,27 @@ public class ShiroConfig {
filterMap.put("/backendApi/store/loginVerification","anon");
//小程序支付回调地址
filterMap.put("/api/fyPay/notify","anon");
+
+
+
+
+
+ // 小程序主页免登录配置
+ filterMap.put("/business/petrolStationManagement/oilNumber/getList2","anon"); // 主页油号获取
+ filterMap.put("/business/petrolStationManagement/oilGun/selectByNumber/**","anon"); // 获取油站的油号
+ filterMap.put("/business/member/staff/queryStaffList/**","anon"); // 获取员工信息
+ filterMap.put("/business/indexBanner/list/**","anon"); // 获取员工信息
+ filterMap.put("/business/storeInformation/store/queryStores","anon"); // 切换站点
+
+
+
filterMap.put("/**","commonFilter");
+
+
+
+
+
+
filter.setFilterChainDefinitionMap(filterMap);
filter.setLoginUrl("/login");
return filter;
diff --git a/fuintCashierWeb/src/api/cashier/integral.js b/fuintCashierWeb/src/api/cashier/integral.js
index c02ff1b32..ec3026dac 100644
--- a/fuintCashierWeb/src/api/cashier/integral.js
+++ b/fuintCashierWeb/src/api/cashier/integral.js
@@ -34,3 +34,11 @@ export function getCheckTheStatusOfYourPaymentByIntegralApi(query) {
params: query
})
}
+// 判断库存是否足够
+export function getDetermineTheInventoryOfTheProductApi(query) {
+ return request({
+ url: 'business/convenience/goods/determineTheInventoryOfTheProduct',
+ method: 'get',
+ params: query
+ })
+}
diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/Integral.vue b/fuintCashierWeb/src/views/cashier/NewComponents/Integral.vue
index c3f18694f..23dbcb327 100644
--- a/fuintCashierWeb/src/views/cashier/NewComponents/Integral.vue
+++ b/fuintCashierWeb/src/views/cashier/NewComponents/Integral.vue
@@ -372,6 +372,13 @@
+
+
+
+ 关 闭
+
+
+
@@ -390,7 +397,7 @@