bug--修复后台近七天统计数

This commit is contained in:
taozi
2020-09-08 16:48:39 +08:00
parent b673cbac23
commit 136e32810e
4 changed files with 40 additions and 10 deletions

View File

@ -60,7 +60,6 @@ import java.util.List;
public class AuthService { public class AuthService {
private final YxUserService userService; private final YxUserService userService;
private final RedisUtils redisUtil;
private final RedisUtils redisUtils; private final RedisUtils redisUtils;
private static Integer expiredTimeIn; private static Integer expiredTimeIn;
@ -86,8 +85,8 @@ public class AuthService {
String spread = loginParam.getSpread(); String spread = loginParam.getSpread();
try { try {
//读取redis配置 //读取redis配置
String appId = redisUtil.getY(ShopKeyUtils.getWxAppAppId()); String appId = redisUtils.getY(ShopKeyUtils.getWxAppAppId());
String secret = redisUtil.getY(ShopKeyUtils.getWxAppSecret()); String secret = redisUtils.getY(ShopKeyUtils.getWxAppSecret());
if (StrUtil.isBlank(appId) || StrUtil.isBlank(secret)) { if (StrUtil.isBlank(appId) || StrUtil.isBlank(secret)) {
throw new YshopException("请先配置小程序"); throw new YshopException("请先配置小程序");
} }

View File

@ -1162,6 +1162,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
Date today = DateUtil.beginOfDay(new Date()); Date today = DateUtil.beginOfDay(new Date());
Date yesterday = DateUtil.beginOfDay(DateUtil.yesterday()); Date yesterday = DateUtil.beginOfDay(DateUtil.yesterday());
Date nowMonth = DateUtil.beginOfMonth(new Date()); Date nowMonth = DateUtil.beginOfMonth(new Date());
Date lastWeek = DateUtil.beginOfDay(DateUtil.lastWeek());
ShoperOrderTimeDataVo orderTimeDataVo = new ShoperOrderTimeDataVo(); ShoperOrderTimeDataVo orderTimeDataVo = new ShoperOrderTimeDataVo();
@ -1196,6 +1197,17 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
//本月订单数 //本月订单数
orderTimeDataVo.setMonthCount(yxStoreOrderMapper.selectCount(wrapperThree)); orderTimeDataVo.setMonthCount(yxStoreOrderMapper.selectCount(wrapperThree));
//上周成交额
QueryWrapper<YxStoreOrder> wrapperLastWeek = new QueryWrapper<>();
wrapperLastWeek.lambda()
.lt(YxStoreOrder::getPayTime,today)
.ge(YxStoreOrder::getPayTime,lastWeek)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
orderTimeDataVo.setLastWeekPrice(yxStoreOrderMapper.todayPrice(wrapperLastWeek));
//上周订单数
orderTimeDataVo.setLastWeekCount(yxStoreOrderMapper.selectCount(wrapperLastWeek));
return orderTimeDataVo; return orderTimeDataVo;
} }

View File

@ -11,10 +11,28 @@ import java.io.Serializable;
**/ **/
@Data @Data
public class ShoperOrderTimeDataVo implements Serializable { public class ShoperOrderTimeDataVo implements Serializable {
private Double todayPrice; //今日成交额
private Integer todayCount; //今日订单数 /**今日成交额*/
private Double proPrice; //昨日成交额 private Double todayPrice;
private Integer proCount;//昨日订单数
private Double monthPrice;//本月成交额 /**今日订单数*/
private Integer monthCount;//本月订单数 private Integer todayCount;
/**昨日成交额*/
private Double proPrice;
/**昨日订单数*/
private Integer proCount;
/**本月成交额*/
private Double monthPrice;
/**本月订单数*/
private Integer monthCount;
/**上周订单数*/
private Integer lastWeekCount;
/**上周成交额*/
private Double lastWeekPrice;
} }

View File

@ -16,6 +16,7 @@ import co.yixiang.tools.service.dto.LocalStorageDto;
import co.yixiang.tools.service.dto.LocalStorageQueryCriteria; import co.yixiang.tools.service.dto.LocalStorageQueryCriteria;
import co.yixiang.tools.service.mapper.LocalStorageMapper; import co.yixiang.tools.service.mapper.LocalStorageMapper;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.utils.SecurityUtils;
import co.yixiang.utils.StringUtils; import co.yixiang.utils.StringUtils;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -101,7 +102,7 @@ public class LocalStorageServiceImpl extends BaseServiceImpl<LocalStorageMapper,
file.getPath(), file.getPath(),
type, type,
FileUtil.getSize(multipartFile.getSize()), FileUtil.getSize(multipartFile.getSize()),
"yshop" SecurityUtils.getUsername()
); );
this.save(localStorage); this.save(localStorage);
return generator.convert(localStorage,LocalStorageDto.class); return generator.convert(localStorage,LocalStorageDto.class);