修改bug
This commit is contained in:
parent
a529c7e67e
commit
93e3d51e5b
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -16,6 +17,7 @@ import java.io.Serializable;
|
||||
* @since 2023-11-06 14:14:17
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class CardExchange extends Model<CardExchange> {
|
||||
//主键id
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ -55,152 +57,5 @@ public class CardExchange extends Model<CardExchange> {
|
||||
//更新时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getChainStorId() {
|
||||
return chainStorId;
|
||||
}
|
||||
|
||||
public void setChainStorId(Integer chainStorId) {
|
||||
this.chainStorId = chainStorId;
|
||||
}
|
||||
|
||||
public Integer getStoreId() {
|
||||
return storeId;
|
||||
}
|
||||
|
||||
public void setStoreId(Integer storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
|
||||
public String getIsonline() {
|
||||
return isonline;
|
||||
}
|
||||
|
||||
public void setIsonline(String isonline) {
|
||||
this.isonline = isonline;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getGiftName() {
|
||||
return giftName;
|
||||
}
|
||||
|
||||
public void setGiftName(String giftName) {
|
||||
this.giftName = giftName;
|
||||
}
|
||||
|
||||
public Integer getValidity() {
|
||||
return validity;
|
||||
}
|
||||
|
||||
public void setValidity(Integer validity) {
|
||||
this.validity = validity;
|
||||
}
|
||||
|
||||
public String getUseInstructions() {
|
||||
return useInstructions;
|
||||
}
|
||||
|
||||
public void setUseInstructions(String useInstructions) {
|
||||
this.useInstructions = useInstructions;
|
||||
}
|
||||
|
||||
public String getQrCodeLink() {
|
||||
return qrCodeLink;
|
||||
}
|
||||
|
||||
public void setQrCodeLink(String qrCodeLink) {
|
||||
this.qrCodeLink = qrCodeLink;
|
||||
}
|
||||
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public Date getOutTime() {
|
||||
return outTime;
|
||||
}
|
||||
|
||||
public void setOutTime(Date outTime) {
|
||||
this.outTime = outTime;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
* @return 主键值
|
||||
*/
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,5 +40,12 @@ public interface CardExchangeRecordService extends IService<CardExchangeRecord>
|
||||
* @return
|
||||
*/
|
||||
IPage<CardExchangeRecordVO> selectCancelRecords (Page page, CardExchangeRecordDTO cardExchangeRecordDTO);
|
||||
|
||||
/**
|
||||
* 兑换券领取通用接口
|
||||
* @param cardExchangeRecord
|
||||
* @return
|
||||
*/
|
||||
boolean addCardExchangeRecord(CardExchangeRecord cardExchangeRecord);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.cardExchange.dto.CardExchangeRecordDTO;
|
||||
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
|
||||
import com.fuint.business.marketingActivity.cardExchange.mapper.CardExchangeRecordMapper;
|
||||
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.marketingActivity.cardExchange.vo.CardExchangeRecordVO;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
@ -15,6 +17,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -29,6 +32,8 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
|
||||
private StoreService storeService;
|
||||
@Resource
|
||||
private CardExchangeRecordMapper cardExchangeRecordMapper;
|
||||
@Resource
|
||||
private CardExchangeService cardExchangeService;
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page
|
||||
@ -108,5 +113,21 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
|
||||
cardExchangeRecordDTO.setMtUserId(TokenUtil.getNowAccountInfo().getId());
|
||||
return cardExchangeRecordMapper.selectCancelRecords(page,cardExchangeRecordDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 兑换券领取通用接口
|
||||
* @param cardExchangeRecord
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean addCardExchangeRecord(CardExchangeRecord cardExchangeRecord) {
|
||||
CardExchange cardExchange = cardExchangeService.getById(cardExchangeRecord.getCardExchangeId());
|
||||
cardExchangeRecord.setExchangeName(cardExchange.getName());
|
||||
cardExchangeRecord.setGiftName(cardExchange.getGiftName());
|
||||
cardExchangeRecord.setDescription(cardExchange.getUseInstructions());
|
||||
cardExchangeRecord.setStartTime(new Date());
|
||||
cardExchangeRecord.setOutTime(new Date(new Date().getTime() + cardExchange.getValidity() * 86400000));
|
||||
return save(cardExchangeRecord);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -713,14 +713,9 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
cardExchangeRecord.setMtStaffId(ljStaff.getId());
|
||||
cardExchangeRecord.setRealName(ljStaff.getRealName());
|
||||
cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
|
||||
cardExchangeRecord.setExchangeName(cardExchangeVoucher.getName());
|
||||
cardExchangeRecord.setExchangeFrom("充值送券");
|
||||
cardExchangeRecord.setGiftName(cardExchangeVoucher.getGiftName());
|
||||
cardExchangeRecord.setDescription(cardExchangeVoucher.getUseInstructions());
|
||||
cardExchangeRecord.setStatus("0");
|
||||
cardExchangeRecord.setStartTime(cardExchangeVoucher.getCreateTime());
|
||||
cardExchangeRecord.setEndTime(cardExchangeVoucher.getOutTime());
|
||||
cardExchangeRecordService.save(cardExchangeRecord);
|
||||
cardExchangeRecord.setExchangeFrom("充值送券");
|
||||
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user