diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/favorableRecords/entity/FavorableRecords.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/favorableRecords/entity/FavorableRecords.java index 6874a9f6d..834a37eb9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/favorableRecords/entity/FavorableRecords.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/favorableRecords/entity/FavorableRecords.java @@ -1,6 +1,9 @@ package com.fuint.business.marketingActivity.favorableRecords.entity; import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.extension.activerecord.Model; import lombok.Data; @@ -16,6 +19,7 @@ import java.io.Serializable; @Data public class FavorableRecords extends Model { //主键id + @TableId(type = IdType.AUTO) private Integer id; //所属连锁店id private Integer chainStoreId; @@ -25,6 +29,7 @@ public class FavorableRecords extends Model { private String favType; //优惠来源 private String favFrom; + private String orderNo; //优惠金额 private Double favMoney; //消费类型 @@ -38,103 +43,5 @@ public class FavorableRecords extends Model { //更新时间 private Date updateTime; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getChainStoreId() { - return chainStoreId; - } - - public void setChainStoreId(Integer chainStoreId) { - this.chainStoreId = chainStoreId; - } - - public Integer getStoreId() { - return storeId; - } - - public void setStoreId(Integer storeId) { - this.storeId = storeId; - } - - public String getFavType() { - return favType; - } - - public void setFavType(String favType) { - this.favType = favType; - } - - public String getFavFrom() { - return favFrom; - } - - public void setFavFrom(String favFrom) { - this.favFrom = favFrom; - } - - public Double getFavMoney() { - return favMoney; - } - - public void setFavMoney(Double favMoney) { - this.favMoney = favMoney; - } - - public String getFavConsumptionType() { - return favConsumptionType; - } - - public void setFavConsumptionType(String favConsumptionType) { - this.favConsumptionType = favConsumptionType; - } - - 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; - } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/favorableRecords/service/impl/FavorableRecordsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/favorableRecords/service/impl/FavorableRecordsServiceImpl.java index 7adf5d0bf..856550a4e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/favorableRecords/service/impl/FavorableRecordsServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/favorableRecords/service/impl/FavorableRecordsServiceImpl.java @@ -9,8 +9,12 @@ import com.fuint.business.marketingActivity.favorableRecords.entity.FavorableRec import com.fuint.business.marketingActivity.favorableRecords.service.FavorableRecordsService; import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; +import com.sun.org.apache.bcel.internal.generic.NEW; +import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.HashMap; import java.util.Map; /** @@ -46,7 +50,22 @@ public class FavorableRecordsServiceImpl extends ServiceImpl selectCount(FavorableRecords favorableRecords) { - return null; + HashMap objectObjectHashMap = new HashMap<>(); + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + Long deptId = nowAccountInfo.getDeptId(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(FavorableRecords::getStoreId, nowAccountInfo.getStoreId()); + queryWrapper.eq(FavorableRecords::getChainStoreId, nowAccountInfo.getChainStoreId()); + if (ObjectUtils.isNotEmpty(favorableRecords.getFavFrom())){ + queryWrapper.eq(FavorableRecords::getFavFrom, favorableRecords.getFavFrom()); + } + if (ObjectUtils.isNotEmpty(favorableRecords.getFavType())){ + queryWrapper.eq(FavorableRecords::getFavType, favorableRecords.getFavType()); + } + if (ObjectUtils.isNotEmpty(favorableRecords.getFavConsumptionType())){ + queryWrapper.eq(FavorableRecords::getFavConsumptionType, favorableRecords.getFavConsumptionType()); + } + return objectObjectHashMap; } }