This commit is contained in:
齐天大圣 2024-03-07 11:23:56 +08:00
parent 5da7530631
commit 470fed9d7c
6 changed files with 41 additions and 2 deletions

View File

@ -78,6 +78,9 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
ActiveDiscount activeDiscount = new ActiveDiscount();
if (ObjectUtils.isNotEmpty(activeDiscountDTO)){
BeanUtils.copyProperties(activeDiscountDTO,activeDiscount);
TAccount accountInfoById = accountService.getAccountInfoById(TokenUtil.getNowAccountInfo().getId());
if (ObjectUtil.isNotEmpty(accountInfoById)) activeDiscount.setCreateBy(accountInfoById.getRealName());
//适用油号
activeDiscount.setAdaptOil(arrayToString(activeDiscountDTO.getAdaptOil()));
//柴油会员等级
@ -215,6 +218,9 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
//更新折扣营销
ActiveDiscount activeDiscount = new ActiveDiscount();
BeanUtils.copyProperties(activeDiscountDTO,activeDiscount);
TAccount accountInfoById = accountService.getAccountInfoById(TokenUtil.getNowAccountInfo().getId());
if (ObjectUtil.isNotEmpty(accountInfoById)) activeDiscount.setCreateBy(accountInfoById.getRealName());
//柴油会员等级
activeDiscount.setDieselUserLevel(arrayToString(activeDiscountDTO.getDieselUserLevel()));
//汽油会员等级

View File

@ -73,6 +73,8 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
ActiveFullminus activeFullminus = new ActiveFullminus();
if (ObjectUtils.isNotEmpty(activeFullminusDTO)){
BeanUtils.copyProperties(activeFullminusDTO,activeFullminus);
TAccount accountInfoById = accountService.getAccountInfoById(TokenUtil.getNowAccountInfo().getId());
if (ObjectUtil.isNotEmpty(accountInfoById)) activeFullminus.setCreateBy(accountInfoById.getRealName());
//适用油号
activeFullminus.setAdaptOil(arrayToString(activeFullminusDTO.getAdaptOil()));
//柴油会员等级
@ -202,6 +204,8 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
//更新折扣营销
ActiveFullminus activeFullminus = new ActiveFullminus();
BeanUtils.copyProperties(activeFullminusDTO,activeFullminus);
TAccount accountInfoById = accountService.getAccountInfoById(TokenUtil.getNowAccountInfo().getId());
if (ObjectUtil.isNotEmpty(accountInfoById)) activeFullminus.setCreateBy(accountInfoById.getRealName());
//柴油会员等级
activeFullminus.setDieselUserLevel(arrayToString(activeFullminusDTO.getDieselUserLevel()));
//汽油会员等级

View File

@ -1,5 +1,6 @@
package com.fuint.business.marketingActivity.activeNewlyweds.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;
@ -23,7 +24,9 @@ import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRec
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.store.service.StoreService;
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.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -52,6 +55,8 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
@Resource
private AccountService accountService;
/**
*
* @param activeNewlywedsDTO
@ -77,6 +82,8 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
ActiveNewlyweds activeNewlyweds = new ActiveNewlyweds();
if (ObjectUtils.isNotEmpty(activeNewlywedsDTO)){
BeanUtils.copyProperties(activeNewlywedsDTO,activeNewlyweds);
TAccount accountInfoById = accountService.getAccountInfoById(TokenUtil.getNowAccountInfo().getId());
if (ObjectUtil.isNotEmpty(accountInfoById)) activeNewlyweds.setCreateBy(accountInfoById.getRealName());
//有礼奖励
activeNewlyweds.setCourtesyReward(arrayToString(activeNewlywedsDTO.getCourtesyReward()));
save = save(activeNewlyweds);
@ -392,6 +399,8 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
//更新新人有礼活动
ActiveNewlyweds activeNewlyweds = new ActiveNewlyweds();
BeanUtils.copyProperties(activeNewlywedsDTO,activeNewlyweds);
TAccount accountInfoById = accountService.getAccountInfoById(TokenUtil.getNowAccountInfo().getId());
if (ObjectUtil.isNotEmpty(accountInfoById)) activeNewlyweds.setCreateBy(accountInfoById.getRealName());
//奖励类型
activeNewlyweds.setCourtesyReward(arrayToString(activeNewlywedsDTO.getCourtesyReward()));

View File

@ -1,5 +1,6 @@
package com.fuint.business.marketingActivity.activeOneCoupon.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -25,10 +26,12 @@ import com.fuint.business.marketingActivity.cardFavorable.vo.LJUserVos;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.service.AccountService;
import com.fuint.common.util.TokenUtil;
import com.fuint.repository.mapper.MtUserGradeMapper;
import com.fuint.repository.model.MtUserGrade;
import com.fuint.repository.model.MtUserGradeVO;
import com.fuint.repository.model.TAccount;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -62,6 +65,8 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
@Resource
private AccountService accountService;
@Override
@Transactional
@ -84,6 +89,8 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
activeOneCoupon.setStoreId(nowAccountInfo.getStoreId());
activeOneCoupon.setConditions(activeOneCouponDTO.getCondition());
activeOneCoupon.setActiveName(activeOneCouponDTO.getActiveName());
TAccount accountInfoById = accountService.getAccountInfoById(TokenUtil.getNowAccountInfo().getId());
if (ObjectUtil.isNotEmpty(accountInfoById)) activeOneCoupon.setCreateBy(accountInfoById.getRealName());
flag = save(activeOneCoupon);
//优惠券
List<Integer> cardFavorableIds = activeOneCouponDTO.getCardFavorableIds();
@ -224,6 +231,8 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
boolean flag = false;
ActiveOneCoupon activeOneCoupon = new ActiveOneCoupon();
TAccount accountInfoById = accountService.getAccountInfoById(TokenUtil.getNowAccountInfo().getId());
if (ObjectUtil.isNotEmpty(accountInfoById)) activeOneCoupon.setCreateBy(accountInfoById.getRealName());
BeanUtils.copyProperties(activeOneCouponDTO,activeOneCoupon);
activeOneCoupon.setConditions(activeOneCouponDTO.getCondition());

View File

@ -1,5 +1,6 @@
package com.fuint.business.marketingActivity.activeRecommend.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;
@ -20,7 +21,9 @@ import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRe
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.business.store.service.StoreService;
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.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -52,6 +55,8 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
@Resource
private AccountService accountService;
/**
* 新增数据
* @param activeRecommendDTO
@ -79,6 +84,8 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
ActiveRecommend activeRecommend = new ActiveRecommend();
if (ObjectUtils.isNotEmpty(activeRecommendDTO)) {
BeanUtils.copyProperties(activeRecommendDTO, activeRecommend);
TAccount accountInfoById = accountService.getAccountInfoById(TokenUtil.getNowAccountInfo().getId());
if (ObjectUtil.isNotEmpty(accountInfoById)) activeRecommend.setCreateBy(accountInfoById.getRealName());
//邀请人礼品类型
activeRecommend.setInviterGiftType(arrayToString(activeRecommendDTO.getInviterGiftType()));
activeRecommend.setId(null);
@ -222,6 +229,8 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
//更新推荐有礼活动
ActiveRecommend activeRecommend = new ActiveRecommend();
BeanUtils.copyProperties(activeRecommendDTO,activeRecommend);
TAccount accountInfoById = accountService.getAccountInfoById(TokenUtil.getNowAccountInfo().getId());
if (ObjectUtil.isNotEmpty(accountInfoById)) activeRecommend.setCreateBy(accountInfoById.getRealName());
//柴油会员等级
activeRecommend.setInviterGiftType(arrayToString(activeRecommendDTO.getInviterGiftType()));

View File

@ -117,8 +117,10 @@ public class CardFuelDieselController extends BaseController {
@PutMapping
public ResponseObject update(@RequestBody CardFuelDiesel cardFuelDiesel) {
cardFuelDiesel.setStatus(cardFuelDiesel.getStatus().equals("true") ? "1" : "2");
String substring = cardFuelDiesel.getType().substring(0, 3);
cardFuelDiesel.setType(substring);
if (cardFuelDiesel.getType().length() > 2){
String substring = cardFuelDiesel.getType().substring(0, 3);
cardFuelDiesel.setType(substring);
}
return getSuccessResult(this.cardFuelDieselService.updateById(cardFuelDiesel));
}