莫名的问题
This commit is contained in:
parent
d33e177e29
commit
70b7d38bad
|
|
@ -44,7 +44,7 @@ public class DataSummaryController {
|
||||||
@SaAdminCheckPermission(value = "dataSummary:trade", name = "营业板块-上半部分")
|
@SaAdminCheckPermission(value = "dataSummary:trade", name = "营业板块-上半部分")
|
||||||
public CzgResult<ShopOrderStatistic> getTradeData(DataSummaryTradeParam param) {
|
public CzgResult<ShopOrderStatistic> getTradeData(DataSummaryTradeParam param) {
|
||||||
ValidatorUtil.validateEntity(param, DefaultGroup.class);
|
ValidatorUtil.validateEntity(param, DefaultGroup.class);
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId();
|
||||||
if (param.getShopId() == null) {
|
if (param.getShopId() == null) {
|
||||||
param.setShopId(shopId);
|
param.setShopId(shopId);
|
||||||
}
|
}
|
||||||
|
|
@ -61,7 +61,7 @@ public class DataSummaryController {
|
||||||
@SaAdminCheckPermission(value = "dataSummary:productSaleData", name = "商品销售-右下")
|
@SaAdminCheckPermission(value = "dataSummary:productSaleData", name = "商品销售-右下")
|
||||||
public CzgResult<Page<DataSummaryProductSaleRankingVo>> getProductSaleData(DataSummaryProductSaleParam param) {
|
public CzgResult<Page<DataSummaryProductSaleRankingVo>> getProductSaleData(DataSummaryProductSaleParam param) {
|
||||||
ValidatorUtil.validateEntity(param, DefaultGroup.class);
|
ValidatorUtil.validateEntity(param, DefaultGroup.class);
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId();
|
||||||
if (param.getShopId() == null) {
|
if (param.getShopId() == null) {
|
||||||
param.setShopId(shopId);
|
param.setShopId(shopId);
|
||||||
}
|
}
|
||||||
|
|
@ -82,7 +82,7 @@ public class DataSummaryController {
|
||||||
public CzgResult<DataSummaryDateAmountVo> getDateAmount(@RequestParam Integer day, @RequestParam(required = false) Long shopId) {
|
public CzgResult<DataSummaryDateAmountVo> getDateAmount(@RequestParam Integer day, @RequestParam(required = false) Long shopId) {
|
||||||
AssertUtil.isNull(day, "天数不能为空");
|
AssertUtil.isNull(day, "天数不能为空");
|
||||||
if (shopId == null) {
|
if (shopId == null) {
|
||||||
shopId = StpKit.USER.getShopId(0L);
|
shopId = StpKit.USER.getShopId();
|
||||||
}
|
}
|
||||||
DataSummaryDateAmountVo data = dataSummaryService.getSummaryAmountData(shopId, day);
|
DataSummaryDateAmountVo data = dataSummaryService.getSummaryAmountData(shopId, day);
|
||||||
return CzgResult.success(data);
|
return CzgResult.success(data);
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@ import java.util.Date;
|
||||||
* @author zs
|
* @author zs
|
||||||
* @since 2025-03-07
|
* @since 2025-03-07
|
||||||
*/
|
*/
|
||||||
@Data
|
|
||||||
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Table("tb_shop_table_order_statistic")
|
@Table("tb_shop_table_order_statistic")
|
||||||
|
|
@ -74,5 +72,94 @@ public class ShopTableOrderStatistic implements Serializable {
|
||||||
* 退款金额
|
* 退款金额
|
||||||
*/
|
*/
|
||||||
private BigDecimal refundAmount;
|
private BigDecimal refundAmount;
|
||||||
|
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTableId() {
|
||||||
|
return tableId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTableId(Long tableId) {
|
||||||
|
this.tableId = tableId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTableCode() {
|
||||||
|
return tableCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTableCode(String tableCode) {
|
||||||
|
this.tableCode = tableCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTableName() {
|
||||||
|
return tableName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTableName(String tableName) {
|
||||||
|
this.tableName = tableName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAreaName() {
|
||||||
|
return areaName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAreaName(String areaName) {
|
||||||
|
this.areaName = areaName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOrderCount() {
|
||||||
|
return orderCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderCount(Long orderCount) {
|
||||||
|
this.orderCount = orderCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getOrderAmount() {
|
||||||
|
return orderAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderAmount(BigDecimal orderAmount) {
|
||||||
|
this.orderAmount = orderAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getShopId() {
|
||||||
|
return shopId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShopId(Long shopId) {
|
||||||
|
this.shopId = shopId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreateDay() {
|
||||||
|
return createDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateDay(Date createDay) {
|
||||||
|
this.createDay = createDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRefundCount() {
|
||||||
|
return refundCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRefundCount(Long refundCount) {
|
||||||
|
this.refundCount = refundCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getRefundAmount() {
|
||||||
|
return refundAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRefundAmount(BigDecimal refundAmount) {
|
||||||
|
this.refundAmount = refundAmount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,10 @@ public class ShopOrderStatisticServiceImpl extends ServiceImpl<ShopOrderStatisti
|
||||||
) {
|
) {
|
||||||
log.info("店铺:{},{},没有要存档的订单统计数据", shopId, dateTime.toDateStr());
|
log.info("店铺:{},{},没有要存档的订单统计数据", shopId, dateTime.toDateStr());
|
||||||
} else {
|
} else {
|
||||||
ShopOrderStatistic entity = getMapper().selectOneByQuery(query().eq(ShopOrderStatistic::getShopId, shopId).eq(ShopOrderStatistic::getCreateDay, dateTime.toDateStr()));
|
ShopOrderStatistic entity =
|
||||||
|
getMapper()
|
||||||
|
.selectOneByQuery(query().eq("shop_id", shopId)
|
||||||
|
.eq("create_day", dateTime.toDateStr()));
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
statistic.setId(entity.getId());
|
statistic.setId(entity.getId());
|
||||||
updateById(statistic);
|
updateById(statistic);
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,10 @@ public class ShopProdStatisticServiceImpl extends ServiceImpl<ShopProdStatisticM
|
||||||
param.setBeginDate(startOfDay.toStringDefaultTimeZone());
|
param.setBeginDate(startOfDay.toStringDefaultTimeZone());
|
||||||
param.setEndDate(endOfDay.toStringDefaultTimeZone());
|
param.setEndDate(endOfDay.toStringDefaultTimeZone());
|
||||||
// 删除之前统计数据
|
// 删除之前统计数据
|
||||||
getMapper().deleteByQuery(QueryWrapper.create().eq(ShopProdStatistic::getShopId, shopId).eq(ShopProdStatistic::getCreateDay, dateTime.toDateStr()));
|
getMapper().deleteByQuery(
|
||||||
|
QueryWrapper.create()
|
||||||
|
.eq("shop_id", shopId)
|
||||||
|
.eq("create_day", dateTime.toDateStr()));
|
||||||
// 重新统计数据
|
// 重新统计数据
|
||||||
List<DataSummaryProductSaleRankingVo> list = shopProdStatisticMapper.findProdRandingSummaryPage2(param);
|
List<DataSummaryProductSaleRankingVo> list = shopProdStatisticMapper.findProdRandingSummaryPage2(param);
|
||||||
for (DataSummaryProductSaleRankingVo dto : list) {
|
for (DataSummaryProductSaleRankingVo dto : list) {
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,11 @@ public class ShopTableOrderStatisticServiceImpl extends ServiceImpl<ShopTableOrd
|
||||||
param.setBeginDate(startOfDay.toStringDefaultTimeZone());
|
param.setBeginDate(startOfDay.toStringDefaultTimeZone());
|
||||||
param.setEndDate(endOfDay.toStringDefaultTimeZone());
|
param.setEndDate(endOfDay.toStringDefaultTimeZone());
|
||||||
// 删除之前统计数据
|
// 删除之前统计数据
|
||||||
getMapper().deleteByQuery(new QueryWrapper().eq(ShopTableOrderStatistic::getShopId, shopId).eq(ShopTableOrderStatistic::getCreateDay, dateTime.toDateStr()));
|
getMapper()
|
||||||
|
.deleteByQuery(
|
||||||
|
new QueryWrapper()
|
||||||
|
.eq("shop_id", shopId)
|
||||||
|
.eq("create_day", dateTime.toDateStr()));
|
||||||
// 重新统计数据
|
// 重新统计数据
|
||||||
List<TableSummaryInfoVo> list = shopTableOrderStatisticMapper.findSummaryList2(param);
|
List<TableSummaryInfoVo> list = shopTableOrderStatisticMapper.findSummaryList2(param);
|
||||||
for (TableSummaryInfoVo dto : list) {
|
for (TableSummaryInfoVo dto : list) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue