This commit is contained in:
齐天大圣 2024-03-06 10:04:25 +08:00
parent 1ea558d74b
commit f9be9ea02d
2 changed files with 23 additions and 3 deletions

View File

@ -5,8 +5,16 @@ import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardGift.entity.CardGift;
import com.fuint.business.marketingActivity.cardGift.service.CardGiftService;
import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.service.LJUserService;
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.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -36,6 +44,9 @@ public class CardGiftController extends BaseController {
@Resource
private CardGiftService cardGiftService;
@Resource
private ILJStaffService ljStaffService;
/**
* 分页查询所有数据
* @param pageNo
@ -97,6 +108,11 @@ public class CardGiftController extends BaseController {
@PutMapping
public ResponseObject update(@RequestBody CardGift cardGift) {
cardGift.setSailTime(new Date());
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStaff ljStaff = ljStaffService.selectStaffById(nowAccountInfo.getStoreId());
if (ObjectUtils.isNotEmpty(ljStaff) && StringUtils.isNotEmpty(ljStaff.getRealName())){
cardGift.setCreateBy(ljStaff.getRealName());
}
return getSuccessResult(this.cardGiftService.updateById(cardGift));
}

View File

@ -10,6 +10,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.cardGift.mapper.CardGiftMapper;
import com.fuint.business.marketingActivity.cardGift.entity.CardGift;
import com.fuint.business.marketingActivity.cardGift.service.CardGiftService;
import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.oilDepotConfiguration.entity.OilDepotConfig;
import com.fuint.business.oilDepotConfiguration.service.OilDepotConfigService;
import com.fuint.business.store.entity.MtStore;
@ -58,6 +60,8 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
private UserBalanceService userBalanceService;
@Resource
private LJUserService ljUserService;
@Resource
private ILJStaffService ljStaffService;
/**
* 新增数据
@ -265,9 +269,9 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
for (int i = 0; i < list.size(); i++) {
CardGift cardGift = (CardGift) list.get(i);
cardGift.setStoreId(nowAccountInfo.getStoreId());
LJUser user = ljUserService.getById(nowAccountInfo.getId());
if (ObjectUtils.isNotEmpty(user) && StringUtils.isNotEmpty(user.getName())){
cardGift.setCreateBy(user.getName());
LJStaff ljStaff = ljStaffService.selectStaffById(nowAccountInfo.getStoreId());
if (ObjectUtils.isNotEmpty(ljStaff) && StringUtils.isNotEmpty(ljStaff.getRealName())){
cardGift.setCreateBy(ljStaff.getRealName());
}
//去重
LambdaQueryWrapper<CardGift> queryWrapper = new LambdaQueryWrapper<>();