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/fuintAdmin_zt/src/views/components/Service/payment.vue b/fuintAdmin_zt/src/views/components/Service/payment.vue
index b12eb6f52..afa47da87 100644
--- a/fuintAdmin_zt/src/views/components/Service/payment.vue
+++ b/fuintAdmin_zt/src/views/components/Service/payment.vue
@@ -400,6 +400,7 @@ export default {
submitOilConfig(){
this.$refs["form"].validate(valid => {
if (valid) {
+ this.form.storeId = this.merchantConfig.storeId
if (this.form.id) {
editOilConfig(this.form).then(response => {
this.$modal.msgSuccess("修改通道成功");
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/order/service/impl/OilOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java
index 1d976e09f..7fa18cd8c 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
@@ -242,7 +242,7 @@ public class OilOrderServiceImpl extends ServiceImpl i
// 支付状态
String payStatus = "unpaid";
- if (payType.equals("CASH")){
+ if (payType.equals("CASH") || map.get("allAmount").equals("0")){
payStatus = "paid";
}else {
payStatus = "unpaid";
@@ -482,8 +482,9 @@ public class OilOrderServiceImpl extends ServiceImpl i
*/
private Map updateUserBalanceAndInsetOrder(int userId,Map map,Double oilAmount,List oilOrders,Integer storeId){
Map res = new HashMap<>();
+ LJStore store = storeService.selectStoreByStoreId(storeId);
// 根据userId查询用户储值卡信息
- UserBalance balance = userBalanceService.selectUserBalanceByStorId(userId,storeId);
+ UserBalance balance = userBalanceService.selectUserBalance(userId,store.getChainStoreId());
// 根据用户id查询用户信息
LJUserVo userVo1 = userService.selectUserById(userId,storeId);
@@ -632,6 +633,44 @@ public class OilOrderServiceImpl extends ServiceImpl i
}else {
res.put("error","囤油卡或储值卡余额不足!");
}
+ }else {
+ Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
+ Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
+ flag = true;
+ status = "paid";
+ Double oilNum = amount / oilPrice;
+ oilLiters += oilNum;
+ if (i == 0) {
+ order.setOrderType("主订单");
+ order.setOrderAmount(amount);
+ order.setPayAmount(amount);
+ order.setOrderNo(orderNo);
+ } else {
+ order.setOrderType("子订单");
+ order.setOrderAmount(amount);
+ order.setPayAmount(0.0);
+ order.setOrderNo(orderNo + "1");
+ }
+ order.setStoreId(accountInfo.getStoreId());
+ order.setUserId(userId);
+ order.setCommissionAmount(Double.valueOf(map.get("commissionAmount")));
+ order.setStaffId(Integer.valueOf(map.get("staffId")));
+ order.setTerminal(map.get("terminal"));
+ order.setOils((String) oilOrders.get(i).get("oilName"));
+ order.setOilGunNum(oilOrders.get(i).get("gunName").toString());
+ order.setOilNum(oilNum);
+// order.setDiscountAmount(Double.valueOf(map.get("oilDiscount")));
+ order.setPayUser(userVo1.getMobile());
+ order.setPayType(map.get("payType"));
+ order.setInvoicing("未开票");
+ order.setOrderStatus("paid");
+ order.setPayTime(new Date());
+
+ this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId());
+ baseMapper.insert(order);
+
+ oilOrder = this.selectOilOrderByOrderNo(orderNo);
+ this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
}
}
@@ -725,65 +764,6 @@ public class OilOrderServiceImpl extends ServiceImpl i
res.put("error","储值卡余额不足!");
}
}
-// } else {
-//// 添加油品订单信息
-// OilOrder order = new OilOrder();
-// for (int i = 0;i < oilOrders.size();i++) {
-// Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
-// Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
-// Double oilNum = amount / oilPrice;
-// if (i == 0) {
-// order.setOrderType("主订单");
-// order.setOrderAmount(amount);
-// order.setPayAmount(0.0);
-// order.setOrderNo(orderNo);
-// } else {
-// order.setOrderType("子订单");
-// order.setOrderAmount(amount);
-// order.setPayAmount(0.0);
-// order.setOrderNo(orderNo + "1");
-// }
-// order.setStoreId(accountInfo.getStoreId());
-// order.setUserId(userId);
-// order.setCommissionAmount(Double.valueOf(map.get("commissionAmount")));
-// order.setStaffId(Integer.valueOf(map.get("staffId")));
-// order.setTerminal(map.get("terminal"));
-// order.setOils((String) oilOrders.get(i).get("oilName"));
-// order.setOilGunNum(oilOrders.get(i).get("gunName").toString());
-// order.setOilNum(oilNum);
-//// order.setDiscountAmount(Double.valueOf(map.get("oilDiscount")));
-// order.setPayUser(userVo1.getMobile());
-// order.setPayType(map.get("payType"));
-// order.setInvoicing("未开票");
-// order.setOrderStatus("paid");
-// order.setPayTime(new Date());
-//
-// this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId());
-// baseMapper.insert(order);
-// }
-// OilOrder oilOrder = this.selectOilOrderByOrderNo(orderNo);
-//
-//// 添加收银台订单信息
-// CashierOrder cashierOrder = new CashierOrder();
-// cashierOrder.setStaffId(Integer.valueOf(map.get("staffId")));
-// cashierOrder.setStoreId(accountInfo.getStoreId());
-// cashierOrder.setPayUser(userVo1.getMobile());
-// cashierOrder.setAmount(oilAmount);
-// cashierOrder.setPayAmount(oilAmount);
-// cashierOrder.setStatus("paid");
-// cashierOrder.setPayTime(new Date());
-// cashierOrder.setOrderNo(orderNo);
-// cashierOrder.setOilOrderAmount(oilAmount);
-//// cashierOrder.setOilDiscountAmount(Double.valueOf(map.get("oilDiscount")));
-// cashierOrder.setTerminal(map.get("terminal"));
-// cashierOrder.setOilOrderId(oilOrder.getId());
-// cashierOrderService.insertCashierOrder(cashierOrder);
-// this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId);
-// this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"PC","1","paid");
-//
-// res.put("success","success");
-// }
-
return res;
}
@@ -827,7 +807,8 @@ public class OilOrderServiceImpl extends ServiceImpl i
* @param refuelMoney 扣除的囤油卡升数
*/
private void updateGrowthValue1(Double oilActualPay,Integer userid,Integer oilId,Double refuelMoney,Integer storeId,String orderNo){
- UserBalance balance = userBalanceService.selectUserBalanceByStorId(userid,storeId);
+ LJStore store = storeService.selectStoreByStoreId(storeId);
+ UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId());
JSONArray refuelMoneys = JSONArray.parseArray(balance.getRefuelMoney());
if (ObjectUtil.isNotEmpty(refuelMoneys)){
List list = new ArrayList<>();
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/business/userManager/service/LJUserService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java
index cca95a4c9..c12ff8080 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java
@@ -111,6 +111,8 @@ public interface LJUserService extends IService {
*/
public int insertUser(LJUserVo user);
+ int addUser(LJUser user);
+
/**
* 修改会员信息
* @param user
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java
index afe716053..2afa48bb6 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java
@@ -353,6 +353,43 @@ public class LJUserServiceImpl extends ServiceImpl impleme
return row;
}
+ @Override
+ public int addUser(LJUser user) {
+// 生成会员号
+ if (StringUtils.isEmpty(user.getUserNo())){
+ Random random = new Random();
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < 7; i++) {
+ sb.append(random.nextInt(10));
+ }
+ String digits = sb.toString();
+
+ int sum = 0;
+ for (int i = 0; i < digits.length(); i++) {
+ int digit = Integer.parseInt(String.valueOf(digits.charAt(i)));
+ if (i % 2 == 0) {
+ sum += digit;
+ } else {
+ sum += digit * 3;
+ }
+ }
+ int checksum = (10 - (sum % 10)) % 10;
+
+ String number = digits + checksum;
+ user.setUserNo(number);
+ }
+ if (StringUtils.isEmpty(user.getName())){
+ String before = user.getMobile().substring(0, 3);
+ String after = user.getMobile().substring(7);
+ user.setName(before+"****"+after);
+ }else {
+ user.setName(user.getName());
+ }
+ user.setDescription("支付宝登录自动注册");
+ int row = baseMapper.insert(user);
+ return row;
+ }
+
/**
* 修改会员信息
* @param userVo
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/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/controller/AlipayController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/controller/AlipayController.java
index 788431292..2654e4f2b 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/controller/AlipayController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/controller/AlipayController.java
@@ -49,10 +49,14 @@ public class AlipayController extends BaseController {
logger.info("支付宝授权登录参数:{}", map);
String authCode = map.get("authCode");
String encryptedData = map.get("encryptedData");
-// alipayService.getUserMobile(encryptedData);
+ Map userMobile = alipayService.getUserMobile(encryptedData);
+ String mobile = "";
+ if (userMobile.get("msg").equals("Success")){
+ mobile = userMobile.get("mobile");
+ }
String storeId = map.get("storeId");
- if ("".equals(storeId)) return getFailureResult(0, "支付宝登录失败");
+// if ("".equals(storeId)) return getFailureResult(0, "支付宝登录失败");
// 根据storeId查找对应的连锁店id
LJStore ljStore = iljStoreService.selectStoreByIdUni(Integer.parseInt(storeId));
// 获取支付宝userid
@@ -63,19 +67,19 @@ public class AlipayController extends BaseController {
String userId = alipayProfile.getUserId();
// 根据手机号查询用户信息
- LJUser user = userService.selectUserByMobile(map.get("phone"));
+ LJUser user = userService.selectUserByMobile(mobile);
if (ObjectUtil.isNotEmpty(user)){
// 存在则修改用户的支付宝userid
user.setUserId(userId);
userService.updateById(user);
}else {
// 不存在则添加用户的支付宝userid
- LJUserVo ljUser = new LJUserVo();
- ljUser.setMobile(map.get("phone"));
+ LJUser ljUser = new LJUser();
+ ljUser.setMobile(mobile);
ljUser.setUserId(userId);
- userService.insertUser(ljUser);
+ userService.addUser(ljUser);
}
- LJUser ljUser = userService.selectUserByMobile(map.get("phone"));
+ LJUser ljUser = userService.selectUserByMobile(mobile);
String userAgent = request.getHeader("user-agent");
AccountInfo accountInfo = new AccountInfo();
@@ -89,7 +93,9 @@ public class AlipayController extends BaseController {
TokenUtil.saveAccountToken(accountInfo);
LoginResponse response = new LoginResponse();
response.setLogin(true);
- response.setChainStoreId(ljStore.getChainStoreId());
+ if (ObjectUtil.isNotEmpty(ljStore)){
+ response.setChainStoreId(ljStore.getChainStoreId());
+ }
response.setToken(token);
response.setTokenCreatedTime(new Date());
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/AlipayService1.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/AlipayService1.java
index 70b2df95c..3f509b1c4 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/AlipayService1.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/AlipayService1.java
@@ -3,6 +3,8 @@ package com.fuint.module.AlipayApi.service;
import com.alipay.api.AlipayApiException;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
+import java.util.Map;
+
public interface AlipayService1 {
/**
* 获取用户支付宝userId
@@ -12,5 +14,5 @@ public interface AlipayService1 {
*/
public AlipaySystemOauthTokenResponse getAlipayProfile(String code) throws AlipayApiException;
- void getUserMobile(String encryptedData) throws Exception;
+ Map getUserMobile(String encryptedData) throws Exception;
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/impl/AlipayServiceImpl1.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/impl/AlipayServiceImpl1.java
index 31e10c78d..4f4d9e132 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/impl/AlipayServiceImpl1.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/impl/AlipayServiceImpl1.java
@@ -3,6 +3,7 @@ package com.fuint.module.AlipayApi.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.Feature;
+import com.alibaba.fastjson2.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.AlipayConfig;
@@ -20,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
+import java.util.HashMap;
import java.util.Map;
@Service
@@ -69,8 +71,8 @@ public class AlipayServiceImpl1 implements AlipayService1 {
}
@Override
- public void getUserMobile(String encryptedData) throws Exception {
-
+ public Map getUserMobile(String encryptedData) throws Exception {
+ Map res = new HashMap<>();
//1. 获取验签和解密所需要的参数
Map openapiResult = JSON.parseObject(encryptedData,
new TypeReference
+
+
+
+ 关 闭
+
+
+
@@ -390,7 +397,7 @@