Merge branch 'ww' into test
This commit is contained in:
commit
c824146e1c
|
|
@ -1,6 +1,5 @@
|
|||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousPostMapping;
|
||||
import cn.ysk.cashier.dto.ShopSummaryDto;
|
||||
import cn.ysk.cashier.service.SummaryService;
|
||||
import cn.ysk.cashier.vo.TbOrderPayCountVo;
|
||||
|
|
@ -9,16 +8,15 @@ import lombok.RequiredArgsConstructor;
|
|||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* 数据报表
|
||||
* @author ww
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
|
|
|
|||
|
|
@ -25,53 +25,39 @@ public class SummaryController {
|
|||
private SummaryService summaryService;
|
||||
|
||||
|
||||
//营业板块 上
|
||||
@PostMapping("/trade")
|
||||
@AnonymousPostMapping
|
||||
private Object shopSummaryDate(@RequestBody BaseQueryDto param) {
|
||||
return summaryService.trade(param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @GetMapping
|
||||
// private Object shopSummary(@RequestParam Integer shopId) {
|
||||
// return summaryService.selectSummary(shopId);
|
||||
// }
|
||||
|
||||
@GetMapping("/date")
|
||||
private Object shopSummaryDate(@RequestParam Integer shopId, @RequestParam Integer day) {
|
||||
return summaryService.selectSummaryDate(shopId, day);
|
||||
}
|
||||
|
||||
@GetMapping("/today")
|
||||
private Object shopSummaryDate(@RequestParam Integer shopId) {
|
||||
return summaryService.selectSummaryToday(shopId);
|
||||
}
|
||||
|
||||
//销售趋势柱状图 左下
|
||||
@GetMapping("/dateAmount")
|
||||
private Object shopSummaryAmount(@RequestParam Integer shopId, @RequestParam Integer day) {
|
||||
return summaryService.selectSummaryAmount(shopId, day);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/dateProduct")
|
||||
private Object shopSummaryProduct(@RequestParam Integer shopId, @RequestParam Integer day,
|
||||
@RequestParam Integer page, @RequestParam Integer size) {
|
||||
return summaryService.selectSummaryProduct(shopId, day, page, size);
|
||||
}
|
||||
|
||||
//支付占比饼图 左下
|
||||
@GetMapping("/datePayType")
|
||||
private Object shopSummaryPayType(@RequestParam Integer shopId, @RequestParam Integer day) {
|
||||
return summaryService.selectSummaryPayType(shopId, day);
|
||||
}
|
||||
|
||||
//商品销售 右下
|
||||
@GetMapping("/productSaleDate")
|
||||
private Object productSaleDate(
|
||||
@RequestParam Integer shopId, @RequestParam Integer day ,@RequestParam Integer page,@RequestParam Integer size) {
|
||||
return summaryService.productSaleDate(shopId, day, page, size);
|
||||
}
|
||||
|
||||
//台桌统计
|
||||
@GetMapping("/table")
|
||||
private Object shopSummaryTable(@RequestParam Integer shopId,
|
||||
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
|
||||
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
|
||||
return summaryService.selectSummaryTable(shopId, startTime, endTime);
|
||||
}
|
||||
|
||||
//台桌统计导出
|
||||
@PostMapping("/table/download")
|
||||
private void downloadShopSummaryTable(HttpServletResponse response, @RequestBody ShopTableSaleInfoDto exportRequest) throws IOException {
|
||||
summaryService.downloadTableSaleInfo(exportRequest, response);
|
||||
|
|
|
|||
|
|
@ -1,24 +1,9 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.dto.shop;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
|
|
@ -112,4 +97,6 @@ public class TbShopUserDto implements Serializable {
|
|||
|
||||
/** 小程序openId */
|
||||
private String miniOpenId;
|
||||
|
||||
private Timestamp joinTime;
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package cn.ysk.cashier.mybatis.entity;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import lombok.Data;
|
||||
|
|
@ -159,6 +160,8 @@ public class TbShopUser implements Serializable {
|
|||
*/
|
||||
private String dynamic_code;
|
||||
|
||||
private Timestamp joinTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ public interface TbShopUserFlowMapper extends BaseMapper<TbShopUserFlow> {
|
|||
* @return 用户流水总金额
|
||||
*/
|
||||
@Select("<script>" +
|
||||
" SELECT \n" +
|
||||
" COALESCE(SUM(flow.total_amount), 0) AS chageTotal\n" +
|
||||
"FROM \n" +
|
||||
" tb_shop_user AS a\n" +
|
||||
" LEFT JOIN (\n" +
|
||||
" SELECT shop_user_id, SUM(amount) AS total_amount \n" +
|
||||
" FROM tb_shop_user_flow \n" +
|
||||
" WHERE biz_code IN ('cashMemberIn','scanMemberIn', 'scanMemberAwardIn') \n" +
|
||||
" AND create_time BETWEEN #{startTime} AND #{endTime} \n" +
|
||||
" GROUP BY shop_user_id\n" +
|
||||
" ) AS flow ON flow.shop_user_id = a.id\n" +
|
||||
"WHERE \n" +
|
||||
" SELECT " +
|
||||
" COALESCE(SUM(flow.total_amount), 0) AS chageTotal " +
|
||||
"FROM " +
|
||||
" tb_shop_user AS a " +
|
||||
" LEFT JOIN ( " +
|
||||
" SELECT shop_user_id, SUM(amount) AS total_amount " +
|
||||
" FROM tb_shop_user_flow " +
|
||||
" WHERE biz_code IN ('cashMemberIn','scanMemberIn', 'scanMemberAwardIn') " +
|
||||
" AND create_time BETWEEN #{startTime} AND #{endTime} " +
|
||||
" GROUP BY shop_user_id " +
|
||||
" ) AS flow ON flow.shop_user_id = a.id " +
|
||||
"WHERE " +
|
||||
" a.shop_id = #{shopId}" +
|
||||
"</script>")
|
||||
BigDecimal sumUserFlowAmountByConditions(@Param("shopId") Long shopId,
|
||||
|
|
|
|||
|
|
@ -1,18 +1,3 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.pojo.shop;
|
||||
|
||||
import lombok.Data;
|
||||
|
|
@ -23,7 +8,7 @@ import javax.persistence.*;
|
|||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
|
|
@ -154,6 +139,9 @@ public class TbShopUser implements Serializable {
|
|||
@Column(name = "`dynamic_code`")
|
||||
private String dynamicCode;
|
||||
|
||||
@Column(name = "`join_time`")
|
||||
private Timestamp joinTime;
|
||||
|
||||
|
||||
public void copy(TbShopUser source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
|
|
|
|||
|
|
@ -31,40 +31,40 @@ import java.util.List;
|
|||
**/
|
||||
public interface TbShopPayTypeRepository extends JpaRepository<TbShopPayType, Integer>, JpaSpecificationExecutor<TbShopPayType> {
|
||||
@Modifying
|
||||
@Query(value = "INSERT INTO `tb_shop_pay_type` ( shop_id, `pay_type`, `pay_name`, `is_show_shortcut`, `is_refundable`, `is_open_cash_drawer`, `is_system`, `is_ideal`, `is_display`, `icon` )\n" +
|
||||
"VALUES\n" +
|
||||
"\t( :shopId, 'cash', '现金', 1, 0, 1, 0, 1, 1, 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240302/2dab947729d640fba7709b7c0b42bfef.png' ),(\n" +
|
||||
"\t\t:shopId,\n" +
|
||||
"\t\t'bank',\n" +
|
||||
"\t\t'银行卡',\n" +
|
||||
"\t\t1,\n" +
|
||||
"\t\t0,\n" +
|
||||
"\t\t1,\n" +
|
||||
"\t\t0,\n" +
|
||||
"\t\t1,\n" +
|
||||
"\t\t1,\n" +
|
||||
"\t\t'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240302/14b20cf721304b7fa2f01e6e75fab403.png' \n" +
|
||||
"\t\t),(:shopId,\n" +
|
||||
"\t\t'scanCode',\n" +
|
||||
"\t\t'扫码支付',\n" +
|
||||
"\t\t1,\n" +
|
||||
"\t\t0,\n" +
|
||||
"\t\t1,\n" +
|
||||
"\t\t0,\n" +
|
||||
"\t\t1,\n" +
|
||||
"\t\t1,\n" +
|
||||
"\t\t'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240302/9ff08224680446c8b3978844da99bbaa.png' \n" +
|
||||
"\t\t),(:shopId,\n" +
|
||||
"\t\t'deposit',\n" +
|
||||
"\t\t'储值卡',\n" +
|
||||
"\t\t1,\n" +
|
||||
"\t\t0,\n" +
|
||||
"\t\t1,\n" +
|
||||
"\t\t0,\n" +
|
||||
"\t\t1,\n" +
|
||||
"\t\t1,\n" +
|
||||
"\t'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240302/18d40f471a924d55b4eb13e5f553734d.png' \n" +
|
||||
"\t)",nativeQuery = true)
|
||||
@Query(value = "INSERT INTO `tb_shop_pay_type` ( shop_id, `pay_type`, `pay_name`, `is_show_shortcut`, `is_refundable`, `is_open_cash_drawer`, `is_system`, `is_ideal`, `is_display`, `icon` ) " +
|
||||
"VALUES " +
|
||||
" ( :shopId, 'cash', '现金', 1, 0, 1, 0, 1, 1, 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240302/2dab947729d640fba7709b7c0b42bfef.png' ),( " +
|
||||
" :shopId, " +
|
||||
" 'bank', " +
|
||||
" '银行卡', " +
|
||||
" 1, " +
|
||||
" 0, " +
|
||||
" 1, " +
|
||||
" 0, " +
|
||||
" 1, " +
|
||||
" 1, " +
|
||||
" 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240302/14b20cf721304b7fa2f01e6e75fab403.png' " +
|
||||
" ),(:shopId, " +
|
||||
" 'scanCode', " +
|
||||
" '扫码支付', " +
|
||||
" 1, " +
|
||||
" 0, " +
|
||||
" 1, " +
|
||||
" 0, " +
|
||||
" 1, " +
|
||||
" 1, " +
|
||||
" 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240302/9ff08224680446c8b3978844da99bbaa.png' " +
|
||||
" ),(:shopId, " +
|
||||
" 'deposit', " +
|
||||
" '储值卡', " +
|
||||
" 1, " +
|
||||
" 0, " +
|
||||
" 1, " +
|
||||
" 0, " +
|
||||
" 1, " +
|
||||
" 1, " +
|
||||
" 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240302/18d40f471a924d55b4eb13e5f553734d.png' " +
|
||||
" )",nativeQuery = true)
|
||||
Integer creatPayType(@Param("shopId") String shopId);
|
||||
|
||||
@Query("select t from TbShopPayType t where t.payType=:payType and t.shopId=:shopId")
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
package cn.ysk.cashier.repository.order;
|
||||
|
||||
import cn.ysk.cashier.dto.product.StockCountDTO;
|
||||
import cn.ysk.cashier.pojo.order.TbFullOrderDetail;
|
||||
import cn.ysk.cashier.pojo.order.TbOrderDetail;
|
||||
import cn.ysk.cashier.vo.TbOrderPayCountVo;
|
||||
import cn.ysk.cashier.vo.TbOrderSaleVO;
|
||||
import cn.ysk.cashier.vo.CountStockByDayVo;
|
||||
import cn.ysk.cashier.vo.TbOrderSalesCountByDayV2Vo;
|
||||
import cn.ysk.cashier.vo.TbOrderSalesCountByDayVo;
|
||||
import cn.ysk.cashier.vo.TbOrderSalesCountByTable;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -15,10 +13,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
|
||||
import javax.persistence.Tuple;
|
||||
import java.sql.Time;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -41,6 +35,62 @@ public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, In
|
|||
@Query("SELECT cart FROM TbOrderDetail cart WHERE cart.orderId in :ids")
|
||||
List<TbOrderDetail> searchDetailByOrderIds(@Param("ids")List<Integer> ids);
|
||||
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderSalesCountByDayV2Vo(" +
|
||||
"info.productName,pro.id, cate.name,'', " +
|
||||
"SUM(CASE WHEN orders.orderType!='return' THEN info.num ELSE 0 END) as salesNum, " +
|
||||
"SUM(CASE WHEN orders.orderType='return' THEN info.num ELSE 0 END), " +
|
||||
"SUM(CASE WHEN orders.orderType!='return' THEN info.priceAmount ELSE 0 END), " +
|
||||
"SUM(CASE WHEN orders.orderType='return' THEN info.priceAmount ELSE 0 END)) " +
|
||||
"FROM TbOrderInfo orders " +
|
||||
"LEFT JOIN TbOrderDetail info on orders.id=info.orderId " +
|
||||
"LEFT JOIN TbProduct pro ON info.productId = pro.id " +
|
||||
"LEFT JOIN TbShopCategory cate ON cate.id = pro.categoryId " +
|
||||
"WHERE info.shopId = :shopId " +
|
||||
"AND (:cateId IS NULL OR pro.categoryId = :cateId) " +
|
||||
"AND (:proName IS NULL OR info.productName LIKE %:proName%) " +
|
||||
"AND info.createTime > :startTime AND info.createTime < :endTime " +
|
||||
"AND (info.status = 'closed' OR info.status = 'refund') " +
|
||||
"GROUP BY info.productId " +
|
||||
"ORDER BY salesNum DESC")
|
||||
Page<TbOrderSalesCountByDayV2Vo> queryTbOrderSalesCountByProduct(@Param("shopId") Integer shopId,@Param("cateId")String cateId,@Param("proName")String proName, @Param("startTime") Date startTime, @Param("endTime") Date endTime, Pageable pageable);
|
||||
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderSalesCountByDayV2Vo(" +
|
||||
"info.productName,pro.id, cate.name,pro.typeEnum, " +
|
||||
"SUM(CASE WHEN orders.orderType!='return' THEN info.num ELSE 0 END) as salesNum, " +
|
||||
"SUM(CASE WHEN orders.orderType='return' THEN info.num ELSE 0 END), " +
|
||||
"SUM(CASE WHEN orders.orderType!='return' THEN info.priceAmount ELSE 0 END), " +
|
||||
"SUM(CASE WHEN orders.orderType='return' THEN info.priceAmount ELSE 0 END)) " +
|
||||
"FROM TbOrderInfo orders " +
|
||||
"LEFT JOIN TbOrderDetail info on orders.id=info.orderId " +
|
||||
"LEFT JOIN TbProduct pro ON info.productId = pro.id " +
|
||||
"LEFT JOIN TbShopCategory cate ON cate.id = pro.categoryId " +
|
||||
"WHERE info.shopId = :shopId " +
|
||||
"AND (:cateId IS NULL OR pro.categoryId = :cateId) " +
|
||||
"AND (:proName IS NULL OR info.productName LIKE %:proName%) " +
|
||||
"AND info.createTime > :startTime AND info.createTime < :endTime " +
|
||||
"AND (info.status = 'closed' OR info.status = 'refund') " +
|
||||
"GROUP BY info.productId " +
|
||||
"ORDER BY salesNum DESC")
|
||||
List<TbOrderSalesCountByDayV2Vo> queryTbOrderSalesCountByProduct(@Param("shopId") Integer shopId,@Param("cateId")String cateId,@Param("proName")String proName, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderSalesCountByDayV2Vo(" +
|
||||
"info.productSkuName,pro.id, '',''," +
|
||||
"SUM(CASE WHEN orders.orderType!='return' THEN info.num ELSE 0 END) as salesNum, " +
|
||||
"SUM(CASE WHEN orders.orderType='return' THEN info.num ELSE 0 END), " +
|
||||
"SUM(CASE WHEN orders.orderType!='return' THEN info.priceAmount ELSE 0 END), " +
|
||||
"SUM(CASE WHEN orders.orderType='return' THEN info.priceAmount ELSE 0 END)) " +
|
||||
"FROM TbOrderInfo orders " +
|
||||
"LEFT JOIN TbOrderDetail info on orders.id=info.orderId " +
|
||||
"INNER JOIN TbProduct pro ON info.productId = pro.id AND pro.id= :proId " +
|
||||
"LEFT JOIN TbShopCategory cate ON cate.id = pro.categoryId " +
|
||||
"WHERE info.shopId = :shopId " +
|
||||
"AND info.createTime > :startTime AND info.createTime < :endTime " +
|
||||
"AND (info.status = 'closed' OR info.status = 'refund') " +
|
||||
"GROUP BY info.productId, info.productSkuId " +
|
||||
"ORDER BY salesNum DESC")
|
||||
List<TbOrderSalesCountByDayV2Vo> queryTbOrderSalesCountBySku(@Param("shopId") Integer shopId,@Param("proId")Integer proId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderSalesCountByDayVo(" +
|
||||
"info.productName, info.productSkuName, cate.name, unit.name,info.price," +
|
||||
"SUM(CASE WHEN orders.orderType!='return' THEN info.num ELSE 0 END) as salesNum, " +
|
||||
|
|
@ -62,24 +112,6 @@ public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, In
|
|||
"ORDER BY salesNum DESC")
|
||||
Page<TbOrderSalesCountByDayVo> queryTbOrderSalesCountByDay(@Param("shopId") Integer shopId,@Param("cateId")String cateId,@Param("proName")String proName, @Param("startTime") Date startTime, @Param("endTime") Date endTime, Pageable pageable);
|
||||
|
||||
@Query(value = "SELECT pro.shop_id as shop_id, pro.id as pro_id, info.product_name as pro_name, info.product_sku_id as sku_id, pro.is_stock as is_stock," +
|
||||
" info.product_sku_name as sku_name, unit.NAME as unit_name ," +
|
||||
"SUM( CASE WHEN orders.order_type != 'return' THEN info.num ELSE 0 END )- SUM( CASE WHEN orders.order_type = 'return' THEN info.num ELSE 0 END ) as stock_count " +
|
||||
"FROM " +
|
||||
"tb_order_info orders " +
|
||||
"LEFT JOIN tb_order_detail info ON orders.id = info.order_id " +
|
||||
"LEFT JOIN tb_product pro ON info.product_id = pro.id " +
|
||||
"LEFT JOIN tb_shop_unit unit ON unit.id = pro.unit_id " +
|
||||
"WHERE " +
|
||||
"info.create_time > :startTime " +
|
||||
"AND info.create_time < :endTime " +
|
||||
"AND ( info.STATUS = 'closed' OR info.STATUS = 'refund' ) " +
|
||||
"GROUP BY " +
|
||||
"info.product_id, " +
|
||||
"info.product_sku_id ",nativeQuery = true)
|
||||
List<StockCountDTO> countStock(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
|
||||
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderSalesCountByDayVo(" +
|
||||
"info.productName, info.productSkuName, cate.name, unit.name,info.price," +
|
||||
|
|
@ -104,19 +136,22 @@ public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, In
|
|||
"ORDER BY salesNum DESC")
|
||||
List<TbOrderSalesCountByDayVo> queryTbOrderSalesCountByDay(@Param("shopId") Integer shopId,@Param("cateId")String cateId,@Param("proName")String proName, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
@Query(value = "SELECT " +
|
||||
"new cn.ysk.cashier.vo.TbOrderSaleVO(oi.orderNo, od.num, od.price, od.status,od.productSkuId)\n" +
|
||||
"FROM\n" +
|
||||
"TbOrderInfo oi\n" +
|
||||
"LEFT JOIN TbOrderDetail od ON oi.id = od.orderId \n" +
|
||||
"WHERE\n" +
|
||||
"od.shopId = :shopId \n" +
|
||||
"AND ( od.status = 'closed' OR od.status = 'refund' ) \n" +
|
||||
"AND od.createTime > :startTime \n" +
|
||||
"AND od.createTime < :endTime \n" +
|
||||
"AND (:productId is null or od.productId = :productId)\n" +
|
||||
"AND (:productSkuId is null or od.productSkuId = :productSkuId)")
|
||||
List<TbOrderSaleVO> querySaleOrderInfo(@Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime, @Param("productId") Integer productId, @Param("productSkuId") Integer productSkuId, @Param("shopId") Integer shopId);
|
||||
@Query(value = "SELECT" +
|
||||
" SUM( CASE WHEN orders.order_type != 'return' THEN info.price_amount ELSE 0 END )-SUM( CASE WHEN orders.order_type = 'return' THEN info.price_amount ELSE 0 END ) as sale_amount," +
|
||||
" SUM( CASE WHEN orders.order_type != 'return' THEN info.num ELSE 0 END )-SUM( CASE WHEN orders.order_type = 'return' THEN info.num ELSE 0 END ), as sale_num" +
|
||||
" orders.trade_day " +
|
||||
"FROM" +
|
||||
" tb_order_info orders" +
|
||||
" LEFT JOIN tb_order_detail info ON orders.id = info.order_id" +
|
||||
"WHERE" +
|
||||
" info.shop_id = :shopId" +
|
||||
" AND info.create_time > :startTime" +
|
||||
" AND info.create_time < :endTime" +
|
||||
" AND ( info.STATUS = 'closed' OR info.STATUS = 'refund' ) " +
|
||||
"GROUP BY orders.trade_day " +
|
||||
"ORDER BY orders.trade_day DESC",nativeQuery = true)
|
||||
List<CountStockByDayVo> countStockByDay(@Param("shopId") Integer shopId,@Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderSalesCountByDayVo(" +
|
||||
"SUM(CASE WHEN orders.orderType!='return' THEN info.num ELSE 0 END)," +
|
||||
"SUM(CASE WHEN orders.orderType='return' THEN info.num ELSE 0 END), " +
|
||||
|
|
@ -144,35 +179,6 @@ public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, In
|
|||
"AND (info.status = 'closed' OR info.status = 'refund') ")
|
||||
TbOrderSalesCountByDayVo queryTbOrderSalesCount(@Param("shopId") Integer shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderPayCountVo(" +
|
||||
"info.status," +
|
||||
"SUM( info.num )) " +
|
||||
"FROM TbOrderDetail info " +
|
||||
"WHERE info.shopId = :shopId " +
|
||||
"AND info.createTime > :startTime AND info.createTime < :endTime " +
|
||||
"AND ((info.status = 'closed') OR ( info.status ='refund')) " )
|
||||
TbOrderPayCountVo queryTbOrderSalesCountExt(@Param("shopId") Integer shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
|
||||
@Query(value = "select sum(num),count(1) from tb_order_detail where shop_id = :shopId " +
|
||||
"AND ((status = 'closed') OR (status ='refund')) " +
|
||||
"AND create_time > :startTime AND create_time < :endTime",nativeQuery = true)
|
||||
Tuple sumByShopId(@Param("shopId") Integer shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
@Query(value = "select sum(num),count(1),DATE(create_time) from tb_order_detail where shop_id = :shopId AND status = 'closed' " +
|
||||
"AND create_time > :startTime AND create_time < :endTime " +
|
||||
"GROUP BY DATE(create_time)",nativeQuery = true)
|
||||
List<Object[]> sumByShopIdGroup(@Param("shopId") Integer shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
@Query(value = "SELECT COUNT( 0 ) FROM ( SELECT product_id FROM tb_order_detail WHERE shop_id = :shopId " +
|
||||
"AND create_time > :startTime AND create_time < :endTime AND (( STATUS = 'closed' ) \n" +
|
||||
"\t\tOR ( STATUS = 'refund' )) \n" +
|
||||
"\tGROUP BY\n" +
|
||||
"\t\tproduct_id,\n" +
|
||||
"\t\tproduct_sku_id \n" +
|
||||
"\t) AS total ", nativeQuery = true)
|
||||
Tuple searchCount(@Param("shopId") Integer shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
@Query(value = "SELECT d.order_id \n" +
|
||||
" FROM tb_order_detail d \n" +
|
||||
" WHERE d.product_name LIKE %:productName% \n" +
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ import java.util.Map;
|
|||
* @date 2024-03-02
|
||||
**/
|
||||
public interface TbOrderInfoRepository extends JpaRepository<TbOrderInfo, Integer>, JpaSpecificationExecutor<TbOrderInfo> {
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderPayCountVo(info.payType, SUM(info.orderAmount)) " +
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderPayCountVo(info.payType, SUM(info.orderAmount),sum(info.discountAmount)) " +
|
||||
"FROM TbOrderInfo info " +
|
||||
"WHERE 1=1 and (:tableName is null or info.tableName=:tableName ) and info.shopId = :shopId " +
|
||||
"AND info.createdAt>:start AND info.createdAt<:end " +
|
||||
|
|
@ -48,6 +48,7 @@ public interface TbOrderInfoRepository extends JpaRepository<TbOrderInfo, Intege
|
|||
List<TbOrderPayCountVo> queryTbOrderPayCount(@Param("shopId")String shopId,@Param("tableName") String tableName ,@Param("start") Long start, @Param("end") Long end);
|
||||
|
||||
|
||||
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderPayCountVo('refund', SUM(info.orderAmount)) " +
|
||||
"FROM TbOrderInfo info " +
|
||||
"WHERE 1=1 and (:tableName is null or info.tableName=:tableName ) and info.shopId = :shopId " +
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ public interface TbShopUserRepository extends JpaRepository<TbShopUser, Integer>
|
|||
@Query("SELECT user.userId from TbShopUser user where user.shopId = :shopId")
|
||||
List<Integer> getUserIdByShopId(String shopId);
|
||||
|
||||
|
||||
|
||||
@Query("SELECT count(1) from TbShopUser user where user.shopId = :shopId and user.joinTime BETWEEN :startTime AND :endTime")
|
||||
Integer newFlow(@Param("shopId") String shopId, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
@Query(value = "select IFNULL(sum(amount),0) from tb_shop_user_flow where shop_user_id=:userId and biz_code in ('cashMemberIn','scanMemberIn')",nativeQuery = true)
|
||||
BigDecimal sumAmount(Integer userId);
|
||||
|
|
|
|||
|
|
@ -20,13 +20,10 @@ import java.util.Map;
|
|||
public interface SummaryService {
|
||||
Map<String,Object> trade(BaseQueryDto param);
|
||||
|
||||
// SummaryVO selectSummary(Integer shop);
|
||||
Map<String,Object> selectSummaryDate(Integer shopId, Integer day);
|
||||
Map<String,Object> productSaleDate(Integer shopId, Integer day,Integer page,Integer size);
|
||||
|
||||
Map<String,Object> selectSummaryToday(Integer shopId);
|
||||
|
||||
Map<String,Object> selectSummaryAmount(Integer shopId, Integer day);
|
||||
Map<String,Object> selectSummaryProduct(Integer shopId, Integer day,Integer page,Integer size);
|
||||
|
||||
Map<String,Object> selectSummaryPayType(Integer shopId, Integer day);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ import org.springframework.data.domain.Pageable;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.persistence.Tuple;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -71,6 +70,7 @@ public class SummaryServiceImpl implements SummaryService {
|
|||
if (ObjectUtil.isNull(param.getShopId())) {
|
||||
throw new BadRequestException("参数不合法");
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
Map<String, Object> sale = new HashMap<>();
|
||||
Map<String, Object> vip = new HashMap<>();
|
||||
|
|
@ -83,7 +83,8 @@ public class SummaryServiceImpl implements SummaryService {
|
|||
//会员 充值金额 inAmount /退款金额 outAmount /会员消费金额 useAmount /会员消费笔数 useNum
|
||||
Map<String, Object> flowMap = tbShopUserFlowMapper.tradeIndexFlow(param.getShopId(), DateUtil.getStrTime(param.getStartTime()), DateUtil.getStrTime(param.getEndTime()));
|
||||
// 新增会员数
|
||||
Integer newFlow = tbShopUserFlowMapper.tradeIndexNewFlow(param.getShopId(), DateUtil.getStrTime(param.getStartTime()), DateUtil.getStrTime(param.getEndTime()));
|
||||
Integer newFlow = tbShopUserRepository.newFlow(param.getShopId().toString(), DateUtil.getStrTime(param.getStartTime()), DateUtil.getStrTime(param.getEndTime()));
|
||||
// Integer newFlow = tbShopUserFlowMapper.tradeIndexNewFlow(param.getShopId(), DateUtil.getStrTime(param.getStartTime()), DateUtil.getStrTime(param.getEndTime()));
|
||||
//台桌数
|
||||
int tables = tbShopTableRepository.countAllByShopId(param.getShopId());
|
||||
//收款金额
|
||||
|
|
@ -96,14 +97,55 @@ public class SummaryServiceImpl implements SummaryService {
|
|||
sale.put("inAmount", flowMap.get("inAmount")); //会员 充值金额
|
||||
sale.put("outAmount", flowMap.get("outAmount"));//会员 退款金额
|
||||
|
||||
sale.put("incomeAmountAll",incomeAmount.add(new BigDecimal(flowMap.get("inAmount").toString())));//总实收 销售实收+会员实收
|
||||
|
||||
sale.put("incomeAmountAll",incomeAmount);//总实收 销售实收
|
||||
List<TbOrderPayCountVo> payCountVos = initPaysCount();
|
||||
List<TbOrderPayCountVo> payCounts = tbOrderInfoRepository.queryTbOrderPayCount(
|
||||
param.getShopId().toString(), null, param.getStartTime().getTime(), param.getEndTime().getTime());
|
||||
Map<String, BigDecimal> payCountMap = payCounts.stream()
|
||||
.collect(Collectors.toMap(
|
||||
TbOrderPayCountVo::getPayType,
|
||||
vo -> {
|
||||
BigDecimal payAmount = new BigDecimal(vo.getPayAmount().toString());
|
||||
BigDecimal saveAmount = new BigDecimal(vo.getSaveAmount().toString());
|
||||
return payAmount.subtract(saveAmount);
|
||||
},
|
||||
BigDecimal::add
|
||||
));
|
||||
BigDecimal vipSaveAmount = tbShopUserFlowService.sumUserFlowAmountByConditions(
|
||||
param.getShopId().longValue(), DateUtil.getStrTime(param.getStartTime()), DateUtil.getStrTime(param.getEndTime()));
|
||||
for (TbOrderPayCountVo payCountVo : payCountVos) {
|
||||
BigDecimal payAmount = new BigDecimal(payCountVo.getPayAmount().toString());
|
||||
switch (payCountVo.getPayType()){
|
||||
case "微信小程序":
|
||||
payCountVo.setPayAmount(payAmount.add(payCountMap.get("wx_lite")));
|
||||
break;
|
||||
case "支付宝小程序":
|
||||
payCountVo.setPayAmount(payAmount.add(payCountMap.get("ali_lite")));
|
||||
break;
|
||||
case "主扫收款":
|
||||
payCountVo.setPayAmount(payAmount.add(payCountMap.get("scanCode")));
|
||||
break;
|
||||
case "收款码收款":
|
||||
payCountVo.setPayAmount(payAmount.add(payCountMap.get("ALIPAY")).add(payCountMap.get("WECHAT")));
|
||||
break;
|
||||
case "现金":
|
||||
payCountVo.setPayAmount(payAmount.add(payCountMap.get("cash")));
|
||||
break;
|
||||
case "会员":
|
||||
payCountVo.setPayAmount(payAmount.add(payCountMap.get("deposit")));
|
||||
break;
|
||||
case "充值":
|
||||
payCountVo.setPayAmount(payAmount.add(vipSaveAmount));
|
||||
break;
|
||||
}
|
||||
}
|
||||
sale.put("payCount",payCountVos);
|
||||
result.put("sale",sale);
|
||||
vip.put("useAmount", flowMap.get("useAmount"));//会员消费金额
|
||||
vip.put("newFlow",newFlow);//新增会员数
|
||||
vip.put("useNum",flowMap.get("useNum"));//会员消费笔数
|
||||
result.put("vip",vip);
|
||||
BigDecimal saleAmount = new BigDecimal(orderMap.get("saleAmount").toString()).add(refundAmount);
|
||||
BigDecimal saleAmount = new BigDecimal(orderMap.get("saleAmount").toString()).subtract(new BigDecimal(orderMap.get("saveAmount").toString()));
|
||||
//客单价
|
||||
if(saleAmount.compareTo(BigDecimal.ZERO) == 0){
|
||||
count.put("unitPrice",BigDecimal.ZERO);
|
||||
|
|
@ -122,103 +164,23 @@ public class SummaryServiceImpl implements SummaryService {
|
|||
return result;
|
||||
}
|
||||
|
||||
public List<TbOrderPayCountVo> initPaysCount(){
|
||||
List<TbOrderPayCountVo> payCountVos = new ArrayList<>();
|
||||
payCountVos.add(new TbOrderPayCountVo("https://cashier-oss.oss-cn-beijing.aliyuncs.com/static/wx.png","微信小程序","1",BigDecimal.ZERO));
|
||||
payCountVos.add(new TbOrderPayCountVo("https://cashier-oss.oss-cn-beijing.aliyuncs.com/static/ali.png","支付宝小程序","1",BigDecimal.ZERO));
|
||||
payCountVos.add(new TbOrderPayCountVo("https://cashier-oss.oss-cn-beijing.aliyuncs.com/static/scan.png","主扫收款","1",BigDecimal.ZERO));
|
||||
payCountVos.add(new TbOrderPayCountVo("https://cashier-oss.oss-cn-beijing.aliyuncs.com/static/bscan.png","收款码收款","1",BigDecimal.ZERO));
|
||||
payCountVos.add(new TbOrderPayCountVo("https://cashier-oss.oss-cn-beijing.aliyuncs.com/static/cash.png","现金","1",BigDecimal.ZERO));
|
||||
payCountVos.add(new TbOrderPayCountVo("https://cashier-oss.oss-cn-beijing.aliyuncs.com/static/vipIn.png","充值","1",BigDecimal.ZERO));
|
||||
// payCountVos.add(new TbOrderPayCountVo("","会员支付","1",BigDecimal.ZERO));
|
||||
return payCountVos;
|
||||
};
|
||||
|
||||
|
||||
// @Override
|
||||
// public SummaryVO selectSummary(Integer shopId) {
|
||||
// SummaryVO summaryVO = new SummaryVO();
|
||||
// //支付笔数,
|
||||
// Tuple result = tbOrderInfoRepository.countByShopId(shopId.toString());
|
||||
// summaryVO.setPaymentsNumber(result.get(0, Long.class) == null ? 0L : result.get(0, Long.class));
|
||||
// summaryVO.setTotalSales(result.get(1, BigDecimal.class) == null ? new BigDecimal("0") : result.get(1, BigDecimal.class));
|
||||
// if (summaryVO.getPaymentsNumber() == 0) {
|
||||
// summaryVO.setAverageSales(new BigDecimal("0"));
|
||||
// } else {
|
||||
// summaryVO.setAverageSales(summaryVO.getTotalSales().divide(new BigDecimal(summaryVO.getPaymentsNumber()), 2, RoundingMode.DOWN));
|
||||
// }
|
||||
// //用户数
|
||||
// Tuple count = tbShopUserRepository.searchByCount(shopId.toString());
|
||||
// summaryVO.setTotalUser(count == null ? 0L : count.get(0, Long.class));
|
||||
// //支付笔数柱形图
|
||||
// List<Object[]> objects = tbOrderInfoRepository.sumByDateOrderNum(shopId.toString(), DateUtil.getDate30DaysAgo(), DateUtil.getDayEnd());
|
||||
// List<CountDateVO> countDateList = new ArrayList<>();
|
||||
// for (Object[] o : objects) {
|
||||
// CountDateVO countDateVO = new CountDateVO();
|
||||
// BigInteger integers = (BigInteger) o[0];
|
||||
// countDateVO.setCount(new BigDecimal(integers.toString()));
|
||||
// countDateVO.setTradeDay((String) o[1]);
|
||||
// countDateList.add(countDateVO);
|
||||
// }
|
||||
// //填充日期
|
||||
// Map<String, CountDateVO> dataMap = new HashMap<>();
|
||||
// for (CountDateVO entry : countDateList) {
|
||||
// String tradeDay = entry.getTradeDay();
|
||||
// BigDecimal countOrder = entry.getCount();
|
||||
// dataMap.put(tradeDay, new CountDateVO(tradeDay, countOrder));
|
||||
// }
|
||||
// // 获取今天的日期
|
||||
// LocalDate today = LocalDate.now();
|
||||
// // 定义日期格式
|
||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
// // 转换为字符串
|
||||
// List<CountDateVO> countDateLists = new ArrayList<>();
|
||||
// for (int i = 0; i < 30; i++) {
|
||||
// LocalDate tradeDayLocalDate = today.minusDays(i);
|
||||
// String tradeDayString = tradeDayLocalDate.format(formatter);
|
||||
// CountDateVO countDateVO;
|
||||
// // 检查数据Map中是否存在该日期的数据
|
||||
// if (dataMap.containsKey(tradeDayString)) {
|
||||
// countDateVO = dataMap.get(tradeDayString);
|
||||
// } else {
|
||||
// // 如果不存在,则创建新的SumDateVO对象,amount设为0
|
||||
// countDateVO = new CountDateVO(tradeDayString, BigDecimal.ZERO);
|
||||
// }
|
||||
// // 将SumDateVO对象添加到列表中
|
||||
// countDateLists.add(countDateVO);
|
||||
// }
|
||||
// countDateLists.sort((a, b) -> a.getTradeDay().compareTo(b.getTradeDay()));
|
||||
// summaryVO.setCountDateList(countDateLists);
|
||||
// //访问量
|
||||
// Tuple tuple = tbTokenRepository.countByAccountId(shopId);
|
||||
// summaryVO.setTotalVisits(tuple == null ? 0L : tuple.get(0, Long.class));
|
||||
// //访问量柱状图
|
||||
// List<Object[]> objectsVisits = tbTokenRepository.countByMonth(shopId, DateUtil.getDate30DaysAgo(), DateUtil.getDayEnd());
|
||||
// List<CountVisitsVO> visitsList = new ArrayList<>();
|
||||
// for (Object[] o : objectsVisits) {
|
||||
// CountVisitsVO countDateVO = new CountVisitsVO();
|
||||
// countDateVO.setCount((BigInteger) o[0]);
|
||||
// countDateVO.setTradeDay((String) o[1]);
|
||||
// visitsList.add(countDateVO);
|
||||
// }
|
||||
// //填充日期
|
||||
// Map<String, CountVisitsVO> dataVisitsMap = new HashMap<>();
|
||||
// for (CountVisitsVO entry : visitsList) {
|
||||
// String tradeDay = entry.getTradeDay();
|
||||
// BigInteger countOrder = entry.getCount();
|
||||
// dataVisitsMap.put(tradeDay, new CountVisitsVO(tradeDay, countOrder));
|
||||
// }
|
||||
// // 转换为字符串
|
||||
// List<CountVisitsVO> countVisitsLists = new ArrayList<>();
|
||||
// for (int i = 0; i < 30; i++) {
|
||||
// LocalDate tradeDayLocalDate = today.minusDays(i);
|
||||
// String tradeDayString = tradeDayLocalDate.format(formatter);
|
||||
// CountVisitsVO countDateVO;
|
||||
// // 检查数据Map中是否存在该日期的数据
|
||||
// if (dataVisitsMap.containsKey(tradeDayString)) {
|
||||
// countDateVO = dataVisitsMap.get(tradeDayString);
|
||||
// } else {
|
||||
// // 如果不存在,则创建新的SumDateVO对象,amount设为0
|
||||
// countDateVO = new CountVisitsVO(tradeDayString, BigInteger.ZERO);
|
||||
// }
|
||||
// // 将SumDateVO对象添加到列表中
|
||||
// countVisitsLists.add(countDateVO);
|
||||
// }
|
||||
// countVisitsLists.sort((a, b) -> a.getTradeDay().compareTo(b.getTradeDay()));
|
||||
// summaryVO.setVisitsCountList(countVisitsLists);
|
||||
// return summaryVO;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectSummaryDate(Integer shopId, Integer day) {
|
||||
public Map<String, Object> productSaleDate(Integer shopId, Integer day,Integer page,Integer size) {
|
||||
Pageable pageable = PageRequest.of(page, size);
|
||||
Date startTime = new Date();
|
||||
Date endTime = new Date();
|
||||
if (day == 7) {
|
||||
|
|
@ -235,86 +197,18 @@ public class SummaryServiceImpl implements SummaryService {
|
|||
endTime = DateUtil.getDayEnd();
|
||||
}
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
Tuple tuple = detailRepository.sumByShopId(shopId, startTime, endTime);
|
||||
List<Object[]> objects = detailRepository.sumByShopIdGroup(shopId, startTime, endTime);
|
||||
//List<Object[]> objects = shopUserDutyDetailRepository.searchByDutyGroup(shopId, DateUtil.getDate30DaysAgo(), DateUtil.getDayEnd());
|
||||
List<CountDateVO> numList = new ArrayList<>();
|
||||
for (Object[] o : objects) {
|
||||
CountDateVO countDateVO = new CountDateVO();
|
||||
BigDecimal integers = (BigDecimal) o[0];
|
||||
countDateVO.setCount(new BigDecimal(integers.toString()));
|
||||
Date date = (Date) o[2];
|
||||
countDateVO.setTradeDay(date.toString());
|
||||
numList.add(countDateVO);
|
||||
}
|
||||
List<Object[]> objects2 = tbOrderInfoRepository.queryTbOrderPaySumByDay(shopId.toString(), startTime, endTime);
|
||||
List<CountDateVO> amountList = new ArrayList<>();
|
||||
for (Object[] o : objects2) {
|
||||
CountDateVO countDateVO = new CountDateVO();
|
||||
countDateVO.setCount((BigDecimal) o[0]);
|
||||
countDateVO.setTradeDay((String) o[1]);
|
||||
amountList.add(countDateVO);
|
||||
}
|
||||
map.put("productCount", tuple == null ? 0 : tuple.get(0, BigDecimal.class));
|
||||
map.put("productSum", tuple == null ? 0 : tuple.get(1, BigInteger.class));
|
||||
map.put("numList", numList);
|
||||
map.put("amountList", amountList);
|
||||
Page<TbOrderSalesCountByDayVo> tbOrderSalesCountByDayVos = detailRepository.queryTbOrderSalesCountByDay(shopId, null, null, startTime, endTime,pageable);
|
||||
TbOrderSalesCountByDayVo tbOrderSalesCountByDayVo = detailRepository.queryTbOrderSalesCountByDaysummaryCount(shopId, null, null, startTime, endTime);
|
||||
TbOrderPayCountVo zong =new TbOrderPayCountVo("el-icon-coin","总金额","1",tbOrderSalesCountByDayVo.getSalesAmount());
|
||||
TbOrderPayCountVo xiaoliang =new TbOrderPayCountVo("el-icon-goods","销售量","0",tbOrderSalesCountByDayVo.getSalesNum());
|
||||
List<CountStockByDayVo> countStockByDayVos = tbOrderDetailRepository.countStockByDay(shopId, startTime, endTime);
|
||||
map.put("productCount", xiaoliang);
|
||||
map.put("productSum", zong);
|
||||
map.put("countList", countStockByDayVos) ;
|
||||
map.put("productList", tbOrderSalesCountByDayVos);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectSummaryProduct(Integer shopId, Integer day, Integer currentPage, Integer currentSize) {
|
||||
//根据时间商品排行
|
||||
currentPage = (currentPage - 1) * currentSize;
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
Date startTime;
|
||||
Date endTime;
|
||||
if (day == 7) {
|
||||
startTime = DateUtil.getDate7DaysAgo();
|
||||
endTime = DateUtil.getDayEnd();
|
||||
} else if (day == 30) {
|
||||
startTime = DateUtil.getDate30DaysAgo();
|
||||
endTime = DateUtil.getDayEnd();
|
||||
} else if (day == 360) {
|
||||
startTime = DateUtil.getBeginDayOfYear();
|
||||
endTime = DateUtil.getEndDayOfYear();
|
||||
} else if (day == 1) {
|
||||
|
||||
startTime = DateUtil.getDayBegin();
|
||||
log.info("1天时间" + startTime.toString());
|
||||
endTime = DateUtil.getDayEnd();
|
||||
log.info("1天时间末" + endTime.toString());
|
||||
} else {
|
||||
throw new BadRequestException("日期有误");
|
||||
}
|
||||
Pageable pageable = PageRequest.of(0, 5);
|
||||
List<Object[]> objects = tbOrderInfoRepository.queryTbOrderPayCountByDayExt(shopId, startTime, endTime, currentPage, currentSize);
|
||||
|
||||
List<ProductExtVO> list = new ArrayList<>();
|
||||
for (Object[] o : objects) {
|
||||
ProductExtVO productVO = new ProductExtVO();
|
||||
productVO.setProductId((BigInteger) o[0]);
|
||||
productVO.setProductName((String) o[1]);
|
||||
productVO.setProductNum((BigDecimal) o[2]);
|
||||
productVO.setAmount((BigDecimal) o[3]);
|
||||
list.add(productVO);
|
||||
}
|
||||
|
||||
//分页数据
|
||||
Tuple tuple1 = detailRepository.searchCount(shopId, startTime, endTime);
|
||||
//销售数量
|
||||
Tuple payCount = detailRepository.sumByShopId(shopId, startTime, endTime);
|
||||
//销售金额
|
||||
Long startTimeLong = DateUtil.convertDateToTimestamp(startTime);
|
||||
Long endTimeLong = DateUtil.convertDateToTimestamp(endTime);
|
||||
Tuple paySum = tbOrderInfoRepository.queryPaySumByDayAll(shopId.toString(), startTimeLong, endTimeLong);
|
||||
|
||||
map.put("productCount", payCount == null ? 0 : payCount.get(0, BigDecimal.class));
|
||||
map.put("productSum", paySum == null ? 0 : paySum.get(0, BigDecimal.class));
|
||||
map.put("totalProduct", list);
|
||||
map.put("total", tuple1 == null ? 0 : tuple1.get(0, BigInteger.class));
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectSummaryAmount(Integer shopId, Integer day) {
|
||||
|
|
@ -373,18 +267,6 @@ public class SummaryServiceImpl implements SummaryService {
|
|||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectSummaryToday(Integer shopId) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
Tuple tuple = tbOrderInfoRepository.sumByShopIdToday(shopId.toString(), DateUtil.getDayBegin(), DateUtil.getDayEnd());
|
||||
map.put("paymentsNumberToday", tuple == null ? 0L : tuple.get(0, BigInteger.class));
|
||||
map.put("totalSalesToday", tuple == null ? new BigDecimal("0") : tuple.get(1, BigDecimal.class));
|
||||
Tuple tuple1 = tbShopUserRepository.searchByCountToday(shopId.toString(), DateUtil.getTodayStartTimestamp(), DateUtil.getTodayEndTimestamp());
|
||||
map.put("userToday", tuple1.get(0, Long.class));
|
||||
Tuple tupleToday = tbTokenRepository.countByAccountId(shopId, DateUtil.getDayBegin(), DateUtil.getDayEnd());
|
||||
map.put("totalVisitsToday", tupleToday == null ? 0 : tupleToday.get(0, Long.class));
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectSummaryPayType(Integer shopId, Integer day) {
|
||||
|
|
@ -416,142 +298,94 @@ public class SummaryServiceImpl implements SummaryService {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<TbOrderPayCountVo> summaryCount(ShopSummaryDto summaryDto) {
|
||||
List<TbOrderPayCountVo> list = new ArrayList<>();
|
||||
|
||||
summaryDto.setStartTime(DateUtil.toDate(DateUtil.fromTimeStamp(1704038400L)));
|
||||
summaryDto.setEndTime(new Date());
|
||||
|
||||
TbOrderSalesCountByDayVo tbOrderSalesCountByDayVo = detailRepository.queryTbOrderSalesCountByDaysummaryCount(Integer.valueOf(summaryDto.getShopId()), summaryDto.getCateId(), summaryDto.getProName(), summaryDto.getStartTime(), summaryDto.getEndTime());
|
||||
TbOrderPayCountVo zongShuLiang = new TbOrderPayCountVo("el-icon-goods", "总数量", "0", tbOrderSalesCountByDayVo.getSalesNum() + tbOrderSalesCountByDayVo.getRefNum());
|
||||
TbOrderPayCountVo zong = new TbOrderPayCountVo("el-icon-coin", "总金额", "1", tbOrderSalesCountByDayVo.getSalesAmount());
|
||||
TbOrderPayCountVo tuidan = new TbOrderPayCountVo("el-icon-goods", "退单量", "0", tbOrderSalesCountByDayVo.getRefNum());
|
||||
TbOrderPayCountVo tuikuan = new TbOrderPayCountVo("el-icon-money", "退款金额", "1", tbOrderSalesCountByDayVo.getRefAmount());
|
||||
// TbOrderPayCountVo xiaoliang =new TbOrderPayCountVo("el-icon-goods","销售量","0",tbOrderSalesCountByDayVo.getSalesNum());
|
||||
|
||||
list.add(zong);
|
||||
list.add(tuikuan);
|
||||
// list.add(xiaoliang);
|
||||
list.add(zongShuLiang);
|
||||
list.add(tuidan);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Page<T> selectSummaryByDay(ShopSummaryDto summaryDto, Integer page, Integer size) {
|
||||
Pageable pageable = PageRequest.of(page, size);
|
||||
if (StringUtils.isBlank(summaryDto.getCateId())) {
|
||||
summaryDto.setCateId(null);
|
||||
}
|
||||
if (summaryDto.getType() != null && summaryDto.getType() == 1) {//金额
|
||||
Long start = 1704038400000L;
|
||||
Long end = Instant.now().toEpochMilli();
|
||||
if (summaryDto.getStartTime() != null && summaryDto.getEndTime() != null) {
|
||||
start = summaryDto.getStartTime().getTime();
|
||||
end = summaryDto.getEndTime().getTime();
|
||||
}
|
||||
Page<T> tPage = (Page<T>) tbOrderInfoRepository.queryTbOrderPayCountByDay(summaryDto.getShopId(), start, end, pageable);
|
||||
|
||||
tPage.getContent().forEach(t -> {
|
||||
TbOrderPayCountByDayVo tbOrderPayCountByDayVo = (TbOrderPayCountByDayVo) t;
|
||||
|
||||
BigDecimal recharge = tbShopUserFlowService.sumUserFlowAmountByConditions(Long.valueOf(summaryDto.getShopId()),
|
||||
tbOrderPayCountByDayVo.getTradeDay() + " 00:00:00",
|
||||
tbOrderPayCountByDayVo.getTradeDay() + " 23:59:59");
|
||||
tbOrderPayCountByDayVo.setRecharge(recharge);
|
||||
|
||||
BigDecimal decimal = tbOrderInfoRepository.queryRefundOrderAmountByTradeDay(summaryDto.getShopId(), tbOrderPayCountByDayVo.getTradeDay());
|
||||
tbOrderPayCountByDayVo.setRefund(decimal == null ? new BigDecimal("0.00") : decimal);
|
||||
|
||||
BigDecimal total = (BigDecimal) tbOrderPayCountByDayVo.getTotal();
|
||||
BigDecimal refund = (BigDecimal) tbOrderPayCountByDayVo.getRefund();
|
||||
tbOrderPayCountByDayVo.setTotal(total.subtract(refund));
|
||||
});
|
||||
|
||||
return tPage;
|
||||
} else {//销量
|
||||
if (summaryDto.getStartTime() == null || summaryDto.getEndTime() == null) {
|
||||
summaryDto.setStartTime(DateUtil.toDate(DateUtil.fromTimeStamp(1704038400L)));
|
||||
summaryDto.setEndTime(new Date());
|
||||
}
|
||||
return (Page<T>) detailRepository.queryTbOrderSalesCountByDay(Integer.valueOf(summaryDto.getShopId()), summaryDto.getCateId(), summaryDto.getProName(), summaryDto.getStartTime(), summaryDto.getEndTime(), pageable);
|
||||
if (summaryDto.getStartTime() == null || summaryDto.getEndTime() == null) {
|
||||
summaryDto.setStartTime(DateUtil.toDate(DateUtil.fromTimeStamp(1704038400L)));
|
||||
summaryDto.setEndTime(new Date());
|
||||
}
|
||||
Page<TbOrderSalesCountByDayV2Vo> products = detailRepository.queryTbOrderSalesCountByProduct(Integer.valueOf(summaryDto.getShopId()), summaryDto.getCateId(), summaryDto.getProName(), summaryDto.getStartTime(), summaryDto.getEndTime(), pageable);
|
||||
for (TbOrderSalesCountByDayV2Vo product : products) {
|
||||
List<TbOrderSalesCountByDayV2Vo> skus = detailRepository.queryTbOrderSalesCountBySku(Integer.valueOf(summaryDto.getShopId()), product.getProductId(), summaryDto.getStartTime(), summaryDto.getEndTime());
|
||||
product.setSkus(skus);
|
||||
}
|
||||
return (Page<T>)products;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void download(ShopSummaryDto summaryDto, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
if (StringUtils.isBlank(summaryDto.getCateId())) {
|
||||
summaryDto.setCateId(null);
|
||||
}
|
||||
if (summaryDto.getStartTime() == null || summaryDto.getEndTime() == null) {
|
||||
summaryDto.setStartTime(DateUtil.toDate(DateUtil.fromTimeStamp(1704038400L)));
|
||||
summaryDto.setEndTime(new Date());
|
||||
}
|
||||
|
||||
if (summaryDto.getType() != null && summaryDto.getType() == 1) {//金额
|
||||
Long start = 1704038400000L;
|
||||
Long end = Instant.now().toEpochMilli();
|
||||
if (summaryDto.getStartTime() != null && summaryDto.getEndTime() != null) {
|
||||
start = summaryDto.getStartTime().getTime();
|
||||
end = summaryDto.getEndTime().getTime();
|
||||
List<TbOrderSalesCountByDayV2Vo> products = detailRepository.queryTbOrderSalesCountByProduct(Integer.valueOf(summaryDto.getShopId()), summaryDto.getCateId(), summaryDto.getProName(), summaryDto.getStartTime(), summaryDto.getEndTime());
|
||||
for (TbOrderSalesCountByDayV2Vo product : products) {
|
||||
if(product.getTypeEnum().equals("sku")){
|
||||
List<TbOrderSalesCountByDayV2Vo> skus = detailRepository.queryTbOrderSalesCountBySku(Integer.valueOf(summaryDto.getShopId()), product.getProductId(), summaryDto.getStartTime(), summaryDto.getEndTime());
|
||||
product.setSkus(skus);
|
||||
}
|
||||
List<TbOrderPayCountByDayVo> tbOrderPayCountByDayVos = tbOrderInfoRepository.queryTbOrderPayCountByDay(summaryDto.getShopId(), start, end);
|
||||
for (TbOrderPayCountByDayVo all : tbOrderPayCountByDayVos) {
|
||||
}
|
||||
for (TbOrderSalesCountByDayV2Vo product : products) {
|
||||
if(product.getTypeEnum().equals("sku")){
|
||||
for (TbOrderSalesCountByDayV2Vo skus : product.getSkus()) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("商品分类", product.getCateName());
|
||||
map.put("商品名称", product.getName());
|
||||
map.put("商品规格", StringUtils.isBlank(skus.getName()) ? "" : skus.getName());
|
||||
map.put("销 售 额", skus.getSalesAmount());
|
||||
map.put("退 单 额", skus.getRefAmount().compareTo(BigDecimal.ZERO) == 0 ? skus.getRefAmount() : "-" + skus.getRefAmount());
|
||||
map.put("实际销量", skus.getSalesNum());
|
||||
map.put("退 单 量", skus.getRefNum());
|
||||
list.add(map);
|
||||
}
|
||||
}else {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("总金额", all.getTotal());
|
||||
map.put("现金", all.getCash());
|
||||
map.put("储值卡支付", all.getDeposit());
|
||||
map.put("扫码支付", all.getScanCode());
|
||||
map.put("微信小程序支付", all.getWxLite());
|
||||
map.put("日期", all.getTradeDay());
|
||||
map.put("商品分类", product.getCateName());
|
||||
map.put("商品名称", product.getName());
|
||||
map.put("商品规格", "");
|
||||
map.put("销 售 额", product.getSalesAmount());
|
||||
map.put("退 单 额", product.getRefAmount().compareTo(BigDecimal.ZERO) == 0 ? product.getRefAmount() : "-" + product.getRefAmount());
|
||||
map.put("实际销量", product.getSalesNum());
|
||||
map.put("退 单 量", product.getRefNum());
|
||||
list.add(map);
|
||||
}
|
||||
} else {//销量
|
||||
if (summaryDto.getStartTime() == null || summaryDto.getEndTime() == null) {
|
||||
summaryDto.setStartTime(DateUtil.toDate(DateUtil.fromTimeStamp(1704038400L)));
|
||||
summaryDto.setEndTime(new Date());
|
||||
}
|
||||
List<TbOrderSalesCountByDayVo> tbOrderSalesCountByDayVos = detailRepository
|
||||
.queryTbOrderSalesCountByDay(Integer.valueOf(summaryDto.getShopId()), summaryDto.getCateId(), summaryDto.getProName(), summaryDto.getStartTime(), summaryDto.getEndTime());
|
||||
tbOrderSalesCountByDayVos.forEach(all -> {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("商品分类", all.getCateName());
|
||||
map.put("商品名称", all.getProductName());
|
||||
map.put("单 位", all.getUnitName());
|
||||
map.put("商品规格", StringUtils.isBlank(all.getProductSkuName()) ? "" : all.getProductSkuName());
|
||||
map.put("单 价", all.getPrice());
|
||||
map.put("销 售 额", all.getSalesAmount());
|
||||
map.put("退 单 额", all.getRefAmount().compareTo(BigDecimal.ZERO) == 0 ? all.getRefAmount() : "-" + all.getRefAmount());
|
||||
map.put("总 销 量", all.getNum() - all.getRefNum());
|
||||
map.put("实际销量", all.getSalesNum());
|
||||
map.put("退 单 量", all.getRefNum());
|
||||
list.add(map);
|
||||
});
|
||||
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbOrderPayCountVo> summaryCount(ShopSummaryDto summaryDto) {
|
||||
List<TbOrderPayCountVo> list = new ArrayList<>();
|
||||
Long start = 1704038400000L;
|
||||
Long end = Instant.now().toEpochMilli();
|
||||
if (summaryDto.getStartTime() != null || summaryDto.getEndTime() != null) {
|
||||
start = summaryDto.getStartTime().getTime();
|
||||
end = summaryDto.getEndTime().getTime();
|
||||
} else {
|
||||
summaryDto.setStartTime(DateUtil.toDate(DateUtil.fromTimeStamp(1704038400L)));
|
||||
summaryDto.setEndTime(new Date());
|
||||
}
|
||||
if (summaryDto.getType() != null && summaryDto.getType() == 1) {
|
||||
TbOrderPayCountVo payCount = tbOrderInfoRepository.queryOrderPayCount(summaryDto.getShopId(), start, end);
|
||||
TbOrderPayCountVo refCount = tbOrderInfoRepository.queryTbOrderRefund(summaryDto.getShopId(), null,start, end);
|
||||
payCount.setPayAmount(new BigDecimal(payCount.getPayAmount().toString()).subtract(new BigDecimal(refCount.getPayAmount().toString())));
|
||||
payCount.setIcon("el-icon-coin");
|
||||
list.add(payCount);
|
||||
TbOrderPayCountVo cashCount = tbOrderInfoRepository.queryOrderPayCash(summaryDto.getShopId(), start, end);
|
||||
cashCount.setIcon("el-icon-circle-check");
|
||||
list.add(cashCount);
|
||||
refCount.setPayType("退款金额");
|
||||
refCount.setIcon("el-icon-money");
|
||||
list.add(refCount);
|
||||
|
||||
TbOrderSalesCountByDayVo numCount = detailRepository.queryTbOrderSalesCount(Integer.valueOf(summaryDto.getShopId()), summaryDto.getStartTime(), summaryDto.getEndTime());
|
||||
TbOrderPayCountVo salesNum =new TbOrderPayCountVo("el-icon-goods","销售量","0",numCount.getSalesNum()-numCount.getRefNum());
|
||||
TbOrderPayCountVo refNum =new TbOrderPayCountVo("el-icon-goods","退单量","0",numCount.getRefNum());
|
||||
list.add(salesNum);
|
||||
list.add(refNum);
|
||||
}else {
|
||||
TbOrderSalesCountByDayVo tbOrderSalesCountByDayVo = detailRepository.queryTbOrderSalesCountByDaysummaryCount(Integer.valueOf(summaryDto.getShopId()), summaryDto.getCateId(), summaryDto.getProName(), summaryDto.getStartTime(), summaryDto.getEndTime());
|
||||
TbOrderPayCountVo zong =new TbOrderPayCountVo("el-icon-coin","总金额","1",tbOrderSalesCountByDayVo.getSalesAmount());
|
||||
TbOrderPayCountVo tuikuan =new TbOrderPayCountVo("el-icon-money","退款金额","1",tbOrderSalesCountByDayVo.getRefAmount());
|
||||
TbOrderPayCountVo xiaoliang =new TbOrderPayCountVo("el-icon-goods","销售量","0",tbOrderSalesCountByDayVo.getSalesNum());
|
||||
TbOrderPayCountVo tuidan =new TbOrderPayCountVo("el-icon-goods","退单量","0",tbOrderSalesCountByDayVo.getRefNum());
|
||||
list.add(zong);
|
||||
list.add(tuikuan);
|
||||
list.add(xiaoliang);
|
||||
list.add(tuidan);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopTableSaleInfoVo> selectSummaryTable(Integer shopId, Date startTime, Date endTime) {
|
||||
|
|
|
|||
|
|
@ -355,12 +355,12 @@ public class StockServiceImpl implements StockService {
|
|||
TbProduct product = new TbProduct();
|
||||
for (StockUpdateValueVO updateValueVO : updateValueVOs) {
|
||||
if (!updateValueVO.isSku()) {
|
||||
if (product.getId()!=null) {
|
||||
if (product.getId() == null) {
|
||||
product = tbProductRepository.getById(Integer.valueOf(updateValueVO.getId()));
|
||||
}
|
||||
productUp(updateValueVO, product);
|
||||
} else {
|
||||
if (product.getId()!=null) {
|
||||
if (product.getId() == null) {
|
||||
product = tbProductRepository.selectBySkuId(Integer.valueOf(updateValueVO.getId()));
|
||||
}
|
||||
productSkuUp(updateValueVO, product);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package cn.ysk.cashier.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
@Data
|
||||
public class CountStockByDayVo {
|
||||
private String tradeDay;
|
||||
|
||||
private Integer saleNum;
|
||||
private BigDecimal saleAmount;
|
||||
}
|
||||
|
|
@ -1,44 +1,17 @@
|
|||
package cn.ysk.cashier.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TbOrderPayCountVo {
|
||||
private String icon;
|
||||
private String payType;
|
||||
//是否展示金额标识
|
||||
private String isAmount="1";
|
||||
private Object payAmount;
|
||||
private Object saveAmount;
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getPayType() {
|
||||
return payType;
|
||||
}
|
||||
|
||||
public void setPayType(String payType) {
|
||||
this.payType = payType;
|
||||
}
|
||||
|
||||
public Object getPayAmount() {
|
||||
return payAmount;
|
||||
}
|
||||
|
||||
public void setPayAmount(Object payAmount) {
|
||||
this.payAmount = payAmount;
|
||||
}
|
||||
|
||||
|
||||
public String getIsAmount() {
|
||||
return isAmount;
|
||||
}
|
||||
|
||||
public void setIsAmount(String isAmount) {
|
||||
this.isAmount = isAmount;
|
||||
public TbOrderPayCountVo() {
|
||||
}
|
||||
|
||||
public TbOrderPayCountVo(String payType, Object payAmount) {
|
||||
|
|
@ -49,6 +22,18 @@ public class TbOrderPayCountVo {
|
|||
}
|
||||
}
|
||||
|
||||
public TbOrderPayCountVo(String payType, Object payAmount, Object saveAmount) {
|
||||
this.payType = payType;
|
||||
this.payAmount = payAmount;
|
||||
this.saveAmount = saveAmount;
|
||||
if (payAmount == null) {
|
||||
this.payAmount = 0;
|
||||
}
|
||||
if (saveAmount == null) {
|
||||
this.saveAmount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public TbOrderPayCountVo(String icon, String payType, String isAmount, Object payAmount) {
|
||||
this.icon = icon;
|
||||
this.payType = payType;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
package cn.ysk.cashier.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class TbOrderSalesCountByDayV2Vo {
|
||||
private String name;
|
||||
private Integer productId;
|
||||
private String cateName;
|
||||
private String typeEnum;
|
||||
|
||||
private Long salesNum;
|
||||
private Long refNum;
|
||||
private BigDecimal salesAmount;
|
||||
private BigDecimal refAmount;
|
||||
|
||||
List<TbOrderSalesCountByDayV2Vo> skus = new ArrayList<>();
|
||||
|
||||
public TbOrderSalesCountByDayV2Vo(String name, Integer productId, String cateName,String typeEnum, Long salesNum, Long refNum, BigDecimal salesAmount, BigDecimal refAmount) {
|
||||
this.name = name;
|
||||
this.productId = productId;
|
||||
this.typeEnum = typeEnum;
|
||||
this.cateName = cateName;
|
||||
this.salesNum = salesNum;
|
||||
this.refNum = refNum;
|
||||
this.salesAmount = salesAmount;
|
||||
this.refAmount = refAmount;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,11 @@
|
|||
package cn.ysk.cashier.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class TbOrderSalesCountByDayVo {
|
||||
private String productName;
|
||||
private String productSkuName;
|
||||
|
|
@ -17,103 +20,6 @@ public class TbOrderSalesCountByDayVo {
|
|||
private Integer productId;
|
||||
private Integer productSkuId;
|
||||
|
||||
public Integer getProductId() {
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setProductId(Integer productId) {
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public Integer getProductSkuId() {
|
||||
return productSkuId;
|
||||
}
|
||||
|
||||
public void setProductSkuId(Integer productSkuId) {
|
||||
this.productSkuId = productSkuId;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductSkuName() {
|
||||
return productSkuName;
|
||||
}
|
||||
|
||||
public void setProductSkuName(String productSkuName) {
|
||||
this.productSkuName = productSkuName;
|
||||
}
|
||||
|
||||
public String getCateName() {
|
||||
return cateName;
|
||||
}
|
||||
|
||||
public void setCateName(String cateName) {
|
||||
this.cateName = cateName;
|
||||
}
|
||||
|
||||
public Long getSalesNum() {
|
||||
return salesNum;
|
||||
}
|
||||
|
||||
public void setSalesNum(Long salesNum) {
|
||||
this.salesNum = salesNum;
|
||||
}
|
||||
|
||||
public Long getRefNum() {
|
||||
return refNum;
|
||||
}
|
||||
|
||||
public void setRefNum(Long refNum) {
|
||||
this.refNum = refNum;
|
||||
}
|
||||
|
||||
public Long getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Long num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public BigDecimal getSalesAmount() {
|
||||
return salesAmount;
|
||||
}
|
||||
|
||||
public void setSalesAmount(BigDecimal salesAmount) {
|
||||
this.salesAmount = salesAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getRefAmount() {
|
||||
return refAmount;
|
||||
}
|
||||
|
||||
public void setRefAmount(BigDecimal refAmount) {
|
||||
this.refAmount = refAmount;
|
||||
}
|
||||
|
||||
public String getUnitName() {
|
||||
return unitName;
|
||||
}
|
||||
|
||||
public void setUnitName(String unitName) {
|
||||
this.unitName = unitName;
|
||||
}
|
||||
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public TbOrderSalesCountByDayVo(Long salesNum, Long refNum) {
|
||||
this.salesNum = salesNum;
|
||||
this.refNum = refNum;
|
||||
|
|
|
|||
Loading…
Reference in New Issue