This commit is contained in:
cun-nan 2024-03-06 17:26:37 +08:00
parent 519155c263
commit 3429ec8cbb
3 changed files with 29 additions and 1 deletions

View File

@ -54,7 +54,7 @@
<el-table-column label="活动名称" align="center" prop="name" />
<el-table-column label="适用油品" align="center" prop="adaptOil" >
<template slot-scope="scope">
<span v-for="item in scope.row.adaptOil">{{ item }}, </span>
<span v-for="item in scope.row.adaptOils">{{ item }}, </span>
</template>
</el-table-column>
<el-table-column label="满足金额" align="center" prop="participationConditionMoney" >

View File

@ -1,5 +1,6 @@
package com.fuint.business.marketingActivity.activeConsumption.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@ -27,12 +28,15 @@ import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableS
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO;
import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.petrolStationManagement.entity.OilName;
import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.service.AccountService;
import com.fuint.common.util.TokenUtil;
import com.fuint.repository.model.TAccount;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@ -83,6 +87,10 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
@Resource
private CardExchangeMapper cardExchangeMapper;
@Resource
private ILJStaffService staffService;
@Resource
private AccountService accountService;
@ -151,9 +159,24 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
List<ActiveConsumptionVO> activeConsumptionVOList = records.stream().map(s ->{
ActiveConsumptionVO activeConsumptionVO = new ActiveConsumptionVO();
BeanUtils.copyProperties(s,activeConsumptionVO);
Integer[] array = Arrays.stream(s.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new);
String[] adaptOil = new String[array.length];
if (array.length>0) {
for (int i = 0;i<array.length;i++) {
OilName oilName = oilNameService.selectOilNameById(array[i]);
if (ObjectUtil.isNotEmpty(oilName)){
adaptOil[i] = oilName.getOilName();
}
}
}
activeConsumptionVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
activeConsumptionVO.setAdaptOils(adaptOil);
activeConsumptionVO.setActiveGift(s.getActiveGift().split(","));
//获取会员等级
String str = "";
@ -199,6 +222,9 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
}
activeConsumptionVO.setYouhuiTotaled(youhuiTed);
activeConsumptionVO.setDuihuanTotaled(duihuanTed);
TAccount accountInfoById = accountService.getAccountInfoById(Integer.parseInt(s.getCreateBy()));
if (ObjectUtil.isNotEmpty(accountInfoById)) activeConsumption.setCreateBy(accountInfoById.getRealName());
return activeConsumptionVO;
}).collect(Collectors.toList());
activeConsumptionVOSIPage.setRecords(activeConsumptionVOList);

View File

@ -274,6 +274,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
if (tAccount.getAccountName().matches("\\d+")) {
tAccount.setAccountName(staff.getMobile());
}
tAccount.setRealName(staff.getRealName());
try {
accountService.editAccount(tAccount, null);
} catch (Exception e) {
@ -286,6 +287,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
if (tAccount.getAccountName().matches("\\d+")) {
tAccount.setAccountName(staff.getMobile());
}
tAccount.setRealName(staff.getRealName());
try {
accountService.editAccount(tAccount, null);
} catch (Exception e) {