优惠统计

This commit is contained in:
齐天大圣 2024-05-15 16:04:27 +08:00
parent be2258b6c7
commit 81f2dd4968
2 changed files with 25 additions and 99 deletions

View File

@ -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<FavorableRecords> {
//主键id
@TableId(type = IdType.AUTO)
private Integer id;
//所属连锁店id
private Integer chainStoreId;
@ -25,6 +29,7 @@ public class FavorableRecords extends Model<FavorableRecords> {
private String favType;
//优惠来源
private String favFrom;
private String orderNo;
//优惠金额
private Double favMoney;
//消费类型
@ -38,103 +43,5 @@ public class FavorableRecords extends Model<FavorableRecords> {
//更新时间
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;
}
}

View File

@ -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<FavorableRecordsMap
@Override
public Map<String, Object> selectCount(FavorableRecords favorableRecords) {
return null;
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Long deptId = nowAccountInfo.getDeptId();
LambdaQueryWrapper<FavorableRecords> 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;
}
}