From 944b5bbb87a616569a81550fc0ac422163b6afed Mon Sep 17 00:00:00 2001
From: cun-nan <19819293608@163.com>
Date: Thu, 18 Jan 2024 15:01:26 +0800
Subject: [PATCH 1/2] bug
---
fuintAdmin/src/views/power/payment/index.vue | 6 ++---
.../fuyou/controller/OilConfigController.java | 5 +++-
.../api/fuyou/mapper/xml/OilConfigMapper.xml | 2 +-
.../api/fuyou/service/OilConfigService.java | 2 +-
.../fuyou/service/impl/FyPayServiceImpl.java | 4 +--
.../impl/MerchantConfigServiceImpl.java | 11 ++++++++
.../service/impl/OilConfigServiceImpl.java | 8 +++---
.../com/fuint/api/fuyou/vo/OilConfigVo.java | 1 +
.../impl/CommissionRecordServiceImpl.java | 9 +++++++
.../impl/StaffCommissionServiceImpl.java | 4 ++-
.../ActiveNewlywedsRecordsServiceImpl.java | 2 +-
.../impl/CardFavorableRecordServiceImpl.java | 3 ++-
.../service/impl/HangBillServiceImpl.java | 2 +-
.../service/impl/OilOrderServiceImpl.java | 22 +++++++++++++---
.../controller/OilGunController.java | 6 +++++
.../mapper/xml/OilGunMapper.xml | 3 ++-
.../mapper/xml/OilNumberMapper.xml | 2 +-
.../service/OilGunService.java | 2 ++
.../service/impl/OilGunServiceImpl.java | 24 +++++++++++++++++
.../petrolStationManagement/vo/OilGunVO.java | 2 +-
.../vo/OilNumberNameVo.java | 2 ++
.../service/impl/LJStoreServiceImpl.java | 22 ++++++++++++++--
.../controller/LJUserController.java | 2 +-
.../userManager/service/LJUserService.java | 2 +-
.../service/impl/LJUserServiceImpl.java | 9 ++++---
gasStation-uni/pages/index/index.vue | 18 ++++++-------
gasStation-uni/pages/my/my.vue | 19 ++++++++++++--
gasStation-uni/pages/refuel/refuel.vue | 26 ++++++++++++-------
28 files changed, 170 insertions(+), 50 deletions(-)
diff --git a/fuintAdmin/src/views/power/payment/index.vue b/fuintAdmin/src/views/power/payment/index.vue
index f4b1cf33e..76e0e88d8 100644
--- a/fuintAdmin/src/views/power/payment/index.vue
+++ b/fuintAdmin/src/views/power/payment/index.vue
@@ -20,7 +20,7 @@
-
添加商户信息
+
@@ -75,7 +75,7 @@
{{index + 1}}.通道
-
{{ item.merchantName }}
+
{{ item.merchantName }}({{ item.remark }})
商户号
{{ item.mchntCd }}
@@ -161,7 +161,7 @@
-
(111({{ item.remark ? item.remark : "--" }}))
+
({{ item.remark ? item.remark : "--" }})
{{ item.mchntCd }}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/OilConfigController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/OilConfigController.java
index 7045d4c2d..d2f6008f2 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/OilConfigController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/OilConfigController.java
@@ -4,6 +4,8 @@ import com.fuint.api.fuyou.entity.OilConfig;
import com.fuint.api.fuyou.service.MerchantConfigService;
import com.fuint.api.fuyou.service.OilConfigService;
import com.fuint.api.fuyou.vo.OilConfigVo;
+import com.fuint.common.dto.AccountInfo;
+import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
@@ -52,7 +54,8 @@ public class OilConfigController extends BaseController {
if (isOpen.equals("1")){
result = oilConfigService.judgmentProportion();
if (result==1){
- oilConfigService.oilRule();
+ AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+ oilConfigService.oilRule(nowAccountInfo.getStoreId());
// 开启定时关闭规则
oilConfigService.ruleCycle(ruleCycle);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/mapper/xml/OilConfigMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/mapper/xml/OilConfigMapper.xml
index c7a4e7eb6..64a6019eb 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/mapper/xml/OilConfigMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/mapper/xml/OilConfigMapper.xml
@@ -2,7 +2,7 @@
- select oc.*,mc.mchnt_cd,mc.merchant_name from oil_config oc
+ select oc.*,mc.mchnt_cd,mc.merchant_name,mc.remark from oil_config oc
inner join merchant_config mc on oc.merch_config_id = mc.id
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/OilConfigService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/OilConfigService.java
index 0d0609d3f..802d4f197 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/OilConfigService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/OilConfigService.java
@@ -13,7 +13,7 @@ public interface OilConfigService extends IService {
/**
* 规则配置
*/
- public void oilRule();
+ public void oilRule(Integer storeId);
/**
* 判断占比相加是否为100% 是返回1 不是返回0
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 4f528a342..df17dc36a 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
@@ -274,7 +274,7 @@ public class FyPayServiceImpl implements FyPayService {
}
// 修改商户账号余额信息
Double amount = merchantConfig.getAmount();
- merchantConfig.setAmount(amount+allAmount);
+ merchantConfig.setAmount(amount+allAmount/100);
merchantConfigService.updateMerch(merchantConfig);
resMap.put("msg","success");
}else if (reqMap.get("trans_stat").equals("USERPAYING")){
@@ -411,7 +411,7 @@ public class FyPayServiceImpl implements FyPayService {
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId());
// MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(16);
// 查询用户信息
- LJUserVo userVo = userService.selectUserById(receiveParameter.getUserId());
+ LJUserVo userVo = userService.selectUserById(receiveParameter.getUserId(), receiveParameter.getStoreId());
// 公钥
Const.INS_PUBLIC_KEY = merchantConfig.getPublicKey();
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 ceb9357e8..0f30cbd88 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
@@ -7,8 +7,11 @@ import com.fuint.api.fuyou.entity.FuYouPublicMerchant;
import com.fuint.api.fuyou.entity.MerchantConfig;
import com.fuint.api.fuyou.mapper.MerchantConfigMapper;
import com.fuint.api.fuyou.service.MerchantConfigService;
+import com.fuint.api.fuyou.service.OilConfigService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -18,6 +21,10 @@ import java.util.List;
*/
@Service
public class MerchantConfigServiceImpl extends ServiceImpl implements MerchantConfigService {
+ @Autowired
+ @Lazy
+ private OilConfigService oilConfigService;
+
@Override
public MerchantConfig selectMeChByIsUse(String isUse) {
QueryWrapper queryWrapper = new QueryWrapper<>();
@@ -28,6 +35,10 @@ public class MerchantConfigServiceImpl extends ServiceImpl list = this.selectMeChByIsOpen(storeId);
+ if (list.size()>0){
+ oilConfigService.oilRule(storeId);
+ }
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_use","1");
queryWrapper.eq("store_id",storeId);
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/OilConfigServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/OilConfigServiceImpl.java
index 505fe7d5d..bdba470bc 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/OilConfigServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/OilConfigServiceImpl.java
@@ -27,10 +27,10 @@ public class OilConfigServiceImpl extends ServiceImpl();
- queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
+ queryWrapper.eq("store_id",storeId);
List list = baseMapper.selectList(queryWrapper);
Double amountAll = 0.0;
// 百分占比
@@ -54,7 +54,7 @@ public class OilConfigServiceImpl extends ServiceImpl();
+ queryWrapper.eq("staff_id",commissionRecord.getStaffId());
+ queryWrapper.eq("store_id",commissionRecord.getStoreId());
+ queryWrapper.eq("type",commissionRecord.getType());
+ queryWrapper.eq("order_no",commissionRecord.getOrderNo());
+ CommissionRecord commissionRecord1 = commissionRecordMapper.selectOne(queryWrapper);
+ if (ObjectUtil.isNotEmpty(commissionRecord1)){
+ return 0;
+ }
return commissionRecordMapper.insert(commissionRecord);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/StaffCommissionServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/StaffCommissionServiceImpl.java
index fa1436587..efc9132fe 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/StaffCommissionServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/StaffCommissionServiceImpl.java
@@ -128,6 +128,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl i
// 判断是否开启支付规则
List list = merchantConfigService.selectMeChByIsOpen(storeId);
if (list.size()>0){
- oilConfigService.oilRule();
+ oilConfigService.oilRule(storeId);
}
// 根据店铺id查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId);
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 4eb901d72..b01596215 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
@@ -398,7 +398,7 @@ public class OilOrderServiceImpl extends ServiceImpl i
// 判断是否开启支付规则
List list = merchantConfigService.selectMeChByIsOpen(storeId);
if (list.size()>0){
- oilConfigService.oilRule();
+ oilConfigService.oilRule(storeId);
}
// 处理支付需要的数据
@@ -485,7 +485,7 @@ public class OilOrderServiceImpl extends ServiceImpl i
// 根据userId查询用户储值卡信息
UserBalance balance = userBalanceService.selectUserBalanceByStorId(userId,storeId);
// 根据用户id查询用户信息
- LJUserVo userVo1 = userService.selectUserById(userId);
+ LJUserVo userVo1 = userService.selectUserById(userId,storeId);
// 根据日期生成订单信息
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
@@ -867,7 +867,14 @@ public class OilOrderServiceImpl extends ServiceImpl i
oilOrder.setInvoicing("未开票");
oilOrder.setRemark("未评价");
oilOrder.setUserId(nowAccountInfo.getId());
- LJUserVo userVo = userService.selectUserById(nowAccountInfo.getId());
+ // 判断当前店铺是否存在此用户的会员信息,没有的话进行添加
+ LJStore store = storeService.selectStoreByStoreId(oilOrder.getStoreId());
+ UserBalance balance = userBalanceService.selectUserBalance(oilOrder.getUserId(), store.getChainStoreId());
+ if (ObjectUtil.isEmpty(balance)){
+ userBalanceService.initBalance(oilOrder.getUserId(),store.getChainStoreId());
+ }
+
+ LJUserVo userVo = userService.selectUserById(oilOrder.getUserId(),oilOrder.getStoreId());
oilOrder.setPayUser(userVo.getMobile());
baseMapper.insert(oilOrder);
@@ -1083,6 +1090,13 @@ public class OilOrderServiceImpl extends ServiceImpl i
this.updateGrowthValue(oilOrder.getPayAmount(),userId, Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId(),orderNo);
this.addOilTracks(oilOrder,oilOrder.getStoreId());
staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),oilOrder.getOilNum(),"1",orderNo);
+// 修改配置收款账户余额信息
+ MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(oilOrder.getStoreId());
+ Double beforeAmount = merchantConfig.getAmount();
+ Double afterAmount = beforeAmount + oilOrder.getPayAmount();
+ merchantConfig.setAmount(afterAmount);
+ merchantConfigService.updateMerch(merchantConfig);
+
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
if (ObjectUtil.isNotEmpty(cashierOrder)){
cashierOrder.setOilOrderId(oilOrder.getId());
@@ -1195,7 +1209,7 @@ public class OilOrderServiceImpl extends ServiceImpl i
int growth = balance.getGrowthValue();
if (refuelMoney==null){
String refuelMoney1 = balance.getRefuelMoney();
- if (StringUtils.isNotEmpty(refuelMoney1) && !"null".equals(refuelMoney1)){
+ if (StringUtils.isNotEmpty(refuelMoney1) && !"null".equals(refuelMoney1) && StringUtils.isNotEmpty(refuelMoney)){
JSONArray objects = JSONArray.parseArray(refuelMoney);
JSONArray objects1 = JSONArray.parseArray(refuelMoney1);
List list = new ArrayList<>();
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilGunController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilGunController.java
index 3660ca759..0087d5a7a 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilGunController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilGunController.java
@@ -52,6 +52,12 @@ public class OilGunController extends BaseController {
return getSuccessResult(oilGunVOS);
}
+ @GetMapping("selectByNumber/{storeId}")
+ public ResponseObject selectByNumberTGUn(@PathVariable Integer storeId) {
+ List oilGunVOS = this.oilGunService.selectByNumberTGUn2(storeId);
+ return getSuccessResult(oilGunVOS);
+ }
+
/**
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilGunMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilGunMapper.xml
index 6a4d9fc35..d0ee3eb87 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilGunMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilGunMapper.xml
@@ -103,7 +103,8 @@