From 1f2646bdfcf72adf6677abc98a74afd11b439fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BD=90=E5=A4=A9=E5=A4=A7=E5=9C=A3?= <17615834396@163.com> Date: Mon, 18 Mar 2024 14:56:57 +0800 Subject: [PATCH 1/8] bug --- .../service/impl/CardFuelRecordServiceImpl.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 d84e1860c..c5a11a8a4 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 @@ -659,6 +659,20 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { oilBalanceChangeService.save(oilBalanceChange); //员工提成 staffCommissionService.countStaffCommission(cardFuleOrders.getStaffId(),cardFuleOrders.getStoreId(),cardFuleOrders.getAmount(),cardFuleOrders.getPayAmount(),"4",cardFuleOrders.getOrderNo()); + + //积分表变动 + if (ObjectUtils.isNotEmpty(userBalance) && ObjectUtils.isNotEmpty(userBalance.getPoints()) && ObjectUtils.isNotEmpty(cardFuleOrders.getPoints())) { + IntegralDetail integralDetail = new IntegralDetail(); + integralDetail.setStoreId(cardFuleOrders.getStoreId()); + integralDetail.setChainStoreId(cardFuleOrders.getChainStoreId()); + integralDetail.setPointsChange(Double.valueOf(cardFuleOrders.getPoints())); + integralDetail.setCurrentPoints(userBalance.getPoints() + cardFuleOrders.getPoints()); + integralDetail.setChangeType("1"); + integralDetail.setChangeReason("囤油卡充值"); + integralDetail.setUserId(cardFuleOrders.getMtUserId()); + IntegralDetail integralDetail1 = integralDetailService.insert2(integralDetail); + } + //生成充值记录 cardFuelRecord.setMtUserId(cardFuleOrders.getMtUserId()); cardFuelRecord.setName(cardFuleOrders.getName()); From 613995dd4e6da525f459f5f46d998ac565b0d684 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Mon, 18 Mar 2024 15:26:11 +0800 Subject: [PATCH 2/8] bug --- .../views/staffCommission/staffCommission.vue | 16 ++++++++-------- .../impl/CommissionRecordServiceImpl.java | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fuintAdmin/src/views/staffCommission/staffCommission.vue b/fuintAdmin/src/views/staffCommission/staffCommission.vue index c861cb3f6..41ddac50c 100644 --- a/fuintAdmin/src/views/staffCommission/staffCommission.vue +++ b/fuintAdmin/src/views/staffCommission/staffCommission.vue @@ -82,7 +82,7 @@ @@ -315,7 +315,7 @@ - - - + + + @@ -384,9 +384,9 @@ 油品订单提成 商品订单提成 储值卡充值提成 - 油品退款 - 商品退款 - 囤油卡充值提成 + + + 囤油卡充值提成 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/CommissionRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/CommissionRecordServiceImpl.java index d14f124cf..404f40748 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/CommissionRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/CommissionRecordServiceImpl.java @@ -89,7 +89,7 @@ public class CommissionRecordServiceImpl implements CommissionRecordService { staffPercentageVo.setGoodsCommission(commissionRecordMapper.selectAllCommissIon(commissionRecord)); commissionRecord.setType("3"); staffPercentageVo.setOilCardRecharge(commissionRecordMapper.selectAllCommissIon(commissionRecord)); - commissionRecord.setType("6"); + commissionRecord.setType("4"); staffPercentageVo.setOilStorageRecharge(commissionRecordMapper.selectAllCommissIon(commissionRecord)); list.add(staffPercentageVo); } From c4dda44f1523db6478b1d18eb06d02db4a8d39fe Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Mon, 18 Mar 2024 16:30:21 +0800 Subject: [PATCH 3/8] bug --- .../service/impl/AccountServiceImpl.java | 23 ++++++++++++++----- .../role/service/impl/DutyServiceImpl.java | 20 ++++++++++++++++ .../main/resources/mapper/TAccountMapper.xml | 8 ++++++- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java index 3e72896e5..cbe8de7b1 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java @@ -234,9 +234,7 @@ public class AccountServiceImpl extends ServiceImpl im String staffId = param.get("staffId") == null ? "0" : param.get("staffId").toString(); String deptId = param.get("deptId") == null ? "0" : param.get("deptId").toString(); - ChainStoreInfo chainStoreInfo = chainStoreInfoService.selectChainStoreByDeptId(Long.valueOf(deptId)); - if (ObjectUtil.isNotEmpty(chainStoreInfo) && ObjectUtil.isNotEmpty(chainStoreInfo.getId())) - merchantId = String.valueOf(chainStoreInfo.getId()); + // 获取角色code String code = param.get("code") == null ? "0" : param.get("code").toString(); @@ -257,6 +255,12 @@ public class AccountServiceImpl extends ServiceImpl im mtStore = mtStoreMapper.selectOne(lambdaQueryWrapper); } + if ("2".equals(deptType)) { + // 查出storeId + ChainStoreInfo chainStoreInfo = chainStoreInfoService.selectChainStoreByDeptId(Long.valueOf(deptId)); + if (ObjectUtil.isNotEmpty(chainStoreInfo) && ObjectUtil.isNotEmpty(chainStoreInfo.getId())) + merchantId = String.valueOf(chainStoreInfo.getId()); + } AccountInfo accountInfo = getAccountByName(accountName); if (accountInfo != null) { @@ -283,6 +287,7 @@ public class AccountServiceImpl extends ServiceImpl im tAccount.setLocked(0); if (ObjectUtil.isEmpty(mtStore)) mtStore.setId(0); tAccount.setStoreId(mtStore.getId()); + merchantId = ObjectUtil.isNotEmpty(mtStore) ? String.valueOf(mtStore.getChainStoreId()) : merchantId; tAccount.setMerchantId(Integer.parseInt(merchantId)); tAccount.setStaffId(Integer.parseInt(staffId)); tAccount.setDeptId(Long.parseLong(deptId)); @@ -373,9 +378,15 @@ public class AccountServiceImpl extends ServiceImpl im tAccount.setStaffId(Integer.parseInt(staffId)); } - ChainStoreInfo chainStoreInfo = chainStoreInfoService.selectChainStoreByDeptId(tAccount.getDeptId()); - if (ObjectUtil.isNotEmpty(chainStoreInfo) && ObjectUtil.isNotEmpty(chainStoreInfo.getId())) - merchantId = String.valueOf(chainStoreInfo.getId()); + if (param.get("deptType").equals("3")) { + MtStore store = mtStoreMapper.selectById(Integer.valueOf(param.get("storeId").toString())); + if (ObjectUtil.isNotEmpty(store)) merchantId = String.valueOf(store.getChainStoreId()); + } + if (param.get("deptType").equals("2")){ + ChainStoreInfo chainStoreInfo = chainStoreInfoService.selectChainStoreByDeptId(tAccount.getDeptId()); + if (ObjectUtil.isNotEmpty(chainStoreInfo) && ObjectUtil.isNotEmpty(chainStoreInfo.getId())) + merchantId = String.valueOf(chainStoreInfo.getId()); + } if (StringUtil.isNotEmpty(merchantId)) { tAccount.setMerchantId(Integer.parseInt(merchantId)); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/impl/DutyServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/impl/DutyServiceImpl.java index 7e903f9bd..098e6d1fd 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/impl/DutyServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/impl/DutyServiceImpl.java @@ -4,7 +4,11 @@ import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.common.dto.AccountInfo; import com.fuint.common.enums.StatusEnum; +import com.fuint.common.service.AccountService; +import com.fuint.common.util.TokenUtil; +import com.fuint.repository.model.TAccount; import com.fuint.system.role.service.DutyService; import com.fuint.framework.annoation.OperationServiceLog; import com.fuint.framework.exception.BusinessCheckException; @@ -23,6 +27,7 @@ import com.fuint.utils.StringUtil; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import org.apache.commons.lang.StringUtils; +import org.springframework.context.annotation.Lazy; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Service; @@ -47,6 +52,10 @@ public class DutyServiceImpl extends ServiceImpl implements @Resource private TDutySourceMapper tDutySourceMapper; + @Resource + @Lazy + private AccountService accountService; + @Override public List getAvailableRoles(Integer merchantId) { List result = tDutyMapper.findByStatus(merchantId, StatusEnum.ENABLED.getKey()); @@ -145,12 +154,18 @@ public class DutyServiceImpl extends ServiceImpl implements existsDuty.setDutyName(tduty.getDutyName()); existsDuty.setStatus(tduty.getStatus()); + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + TAccount byId = accountService.getById(nowAccountInfo.getId()); + Integer chainStoreId = null; + if (ObjectUtil.isNotEmpty(byId)) chainStoreId = byId.getMerchantId(); + if (sources != null && sources.size() > 0) { tDutySourceMapper.deleteSourcesByDutyId(tduty.getDutyId()); for (TSource tSource : sources) { TDutySource dutySource = new TDutySource(); dutySource.setDutyId(tduty.getDutyId()); dutySource.setSourceId(tSource.getSourceId()); + dutySource.setChainStoreId(chainStoreId); tDutySourceMapper.insert(dutySource); } } @@ -195,11 +210,16 @@ public class DutyServiceImpl extends ServiceImpl implements throw new BusinessCheckException("角色名称已经存在."); } this.tDutyMapper.insert(duty); + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + TAccount byId = accountService.getById(nowAccountInfo.getId()); + Integer chainStoreId = null; + if (ObjectUtil.isNotEmpty(byId)) chainStoreId = byId.getMerchantId(); if (sources != null && sources.size() > 0) { for (TSource tSource : sources) { TDutySource dutySource = new TDutySource(); dutySource.setDutyId(duty.getDutyId()); dutySource.setSourceId(tSource.getSourceId()); + dutySource.setChainStoreId(chainStoreId); tDutySourceMapper.insert(dutySource); } } diff --git a/fuintBackend/fuint-repository/src/main/resources/mapper/TAccountMapper.xml b/fuintBackend/fuint-repository/src/main/resources/mapper/TAccountMapper.xml index b29595e1f..a25239ac7 100644 --- a/fuintBackend/fuint-repository/src/main/resources/mapper/TAccountMapper.xml +++ b/fuintBackend/fuint-repository/src/main/resources/mapper/TAccountMapper.xml @@ -34,8 +34,14 @@ left join t_duty td ON ta.role_ids = td.duty_id where account_status != -1 + + AND ta.account_name like concat('%',#{accountInfo.accountName},'%') + + + AND ta.account_status = #{accountInfo.accountStatus} + - AND ta.real_name = like concat('%',#{accountInfo.realName},'%') + AND ta.real_name like concat('%',#{accountInfo.realName},'%') AND (ta.dept_id = #{accountInfo.deptId} or FIND_IN_SET(#{accountInfo.deptId}, sd.ancestors)) From c25d20b87bf8a09844a0cbbe27c11fda45acf066 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Mon, 18 Mar 2024 17:40:39 +0800 Subject: [PATCH 4/8] bug --- fuintAdmin_zt/src/views/system/role/index.vue | 13 +++++++++---- .../com/fuint/common/enums/AdminRoleEnum.java | 3 ++- .../fuint/common/service/SourceService.java | 7 +++++++ .../common/service/impl/SourceServiceImpl.java | 11 ++++++++++- .../role/controller/BackendDutyController.java | 1 + .../role/service/impl/DutyServiceImpl.java | 12 +++++++++++- .../pagination/PaginationRequest.java | 7 +++++++ .../fuint/repository/mapper/TSourceMapper.java | 2 ++ .../main/resources/mapper/TSourceMapper.xml | 18 +++++++++++++++++- 9 files changed, 66 insertions(+), 8 deletions(-) diff --git a/fuintAdmin_zt/src/views/system/role/index.vue b/fuintAdmin_zt/src/views/system/role/index.vue index 7de894c4d..2cb70f947 100644 --- a/fuintAdmin_zt/src/views/system/role/index.vue +++ b/fuintAdmin_zt/src/views/system/role/index.vue @@ -70,7 +70,11 @@