推荐有礼

This commit is contained in:
齐天大圣 2024-02-28 17:06:16 +08:00
parent cc3441506b
commit 1fe8922e14

View File

@ -2,10 +2,14 @@ package com.fuint.business.marketingActivity.cardExchange.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardExchange.dto.CardExchangeRecordDTO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeService;
import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.order.entity.LJOrder;
import com.fuint.business.order.service.LJOrderService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController;
@ -15,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -33,6 +38,10 @@ public class CardExchangeRecordController extends BaseController {
private CardExchangeRecordService cardExchangeRecordService;
@Resource
private ILJStaffService iljStaffService;
@Resource
private CardExchangeService cardExchangeService;
@Resource
private LJOrderService ljOrderService;
/**
* 分页查询所有数据
@ -114,6 +123,20 @@ public class CardExchangeRecordController extends BaseController {
LJStaff ljStaff = iljStaffService.selectStaffById(nowAccountInfo.getStaffId());
cardExchangeRecord.setRealName(ljStaff.getRealName());
cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
Integer cardExchangeId = cardExchangeRecord.getCardExchangeId();
CardExchange cardExchange = cardExchangeService.getById(cardExchangeId);
Integer giftId = cardExchange.getGiftId();
LJOrder ljOrder = new LJOrder();
ljOrder.setTerminal("pc");
ljOrder.setPayUser(cardExchangeRecord.getMobile());
ljOrder.setStoreId(nowAccountInfo.getStoreId());
ljOrder.setUserId(cardExchangeRecord.getMtUserId());
ljOrder.setGoodsNum(1);
ljOrder.setPayType("0");
ljOrder.setStatus("paid");
ljOrder.setPayTime(new Date());
ljOrder.setStaffId(nowAccountInfo.getStaffId());
ljOrderService.addGoodOrder(ljOrder,giftId);
return getSuccessResult(this.cardExchangeRecordService.updateById(cardExchangeRecord));
}