修改批量出入库

This commit is contained in:
韩鹏辉 2024-07-09 10:57:10 +08:00
parent 497d0a7b12
commit c06c4cb867
1 changed files with 19 additions and 14 deletions

View File

@ -65,7 +65,6 @@ public interface TbOrderInfoRepository extends JpaRepository<TbOrderInfo, Intege
int isRefund(@Param("source") Integer source, @Param("shopId") String shopId);
/**
*
* @param shopId
* @param startTime
* @param endTime
@ -105,20 +104,21 @@ public interface TbOrderInfoRepository extends JpaRepository<TbOrderInfo, Intege
"AND ((status = 'closed') OR (status ='refund')) " +
"GROUP BY product_id,product_sku_id " +
"ORDER BY salesNum DESC " +
"Limit :currentPage, :currentSize",nativeQuery = true)
"Limit :currentPage, :currentSize", nativeQuery = true)
List<Object[]> queryTbOrderPayCountByDayExt(@Param("shopId") Integer shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime,
@Param("currentPage") Integer currentPage, @Param("currentSize")Integer currentSize);
@Param("currentPage") Integer currentPage, @Param("currentSize") Integer currentSize);
@Query(value = "SELECT ifnull( sum( order_amount ), 0 ) AS amount,trade_day as tradeDay " +
"FROM tb_order_info WHERE shop_id = :shopId AND ((status = 'closed') OR ( status ='refund' AND order_type != 'return' ))" +
"AND trade_day BETWEEN :startTime AND :endTime " +
"GROUP BY shop_id,trade_day",nativeQuery = true)
List<Object[]> queryTbOrderPaySumByDay(@Param("shopId") String shopId,@Param("startTime") Date startTime, @Param("endTime") Date endTime);
"GROUP BY shop_id,trade_day", nativeQuery = true)
List<Object[]> queryTbOrderPaySumByDay(@Param("shopId") String shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
@Query(value = "SELECT ifnull( sum( order_amount ), 0 )" +
"FROM tb_order_info WHERE shop_id = :shopId AND ((status = 'closed') OR ( status ='refund' AND order_type != 'return' ))" +
"AND created_at > :startTime AND created_at < :endTime " ,nativeQuery = true)
Tuple queryPaySumByDayAll(@Param("shopId") String shopId,@Param("startTime") Long startTime, @Param("endTime") Long endTime);
"AND created_at > :startTime AND created_at < :endTime ", nativeQuery = true)
Tuple queryPaySumByDayAll(@Param("shopId") String shopId, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
@Query("select count(1),sum (info.payAmount) FROM TbOrderInfo info WHERE info.shopId = :shopId AND info.status = 'closed' ")
@ -128,11 +128,12 @@ public interface TbOrderInfoRepository extends JpaRepository<TbOrderInfo, Intege
@Query(value = "select count(1), trade_day FROM tb_order_info WHERE shop_id = :shopId " +
"AND ((status = 'closed') OR ( status ='refund' AND order_type != 'return' ))" +
"AND trade_day BETWEEN :startTime AND :endTime " +
"GROUP BY shop_id,trade_day",nativeQuery = true)
List<Object[]> sumByDateOrderNum(@Param("shopId") String shopId,@Param("startTime") Date startTime, @Param("endTime") Date endTime);
"GROUP BY shop_id,trade_day", nativeQuery = true)
List<Object[]> sumByDateOrderNum(@Param("shopId") String shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
@Query(value = "select count(1), sum(pay_amount) FROM tb_order_info WHERE shop_id = :shopId AND status = 'closed' " +
"AND trade_day BETWEEN :startTime AND :endTime ",nativeQuery = true)
Tuple sumByShopIdToday(@Param("shopId") String shopId,@Param("startTime") Date startTime, @Param("endTime") Date endTime);
"AND trade_day BETWEEN :startTime AND :endTime ", nativeQuery = true)
Tuple sumByShopIdToday(@Param("shopId") String shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
@Query("SELECT new cn.ysk.cashier.vo.TbOrderPayCountByDayVo(" +
"info.tradeDay," +
@ -184,6 +185,10 @@ public interface TbOrderInfoRepository extends JpaRepository<TbOrderInfo, Intege
"WHERE info.shopId = :shopId " +
"AND info.createdAt > :startTime AND info.createdAt < :endTime " +
"AND ((info.status = 'closed') OR ( info.status ='refund' AND info.orderType != 'return' )) " +
"GROUP BY info.tableId")
List<ShopTableSaleInfoVo> queryShopTableSaleInfo(@Param("shopId") String shopId, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
}
"AND info.tableId = :qrcode ")
ShopTableSaleInfoVo queryShopTableSaleInfo(@Param("shopId") String shopId, @Param("qrcode") String qrcode,
@Param("startTime") Long startTime, @Param("endTime") Long endTime);
@Query("select table.qrcode from TbShopTable table where table.shopId = :shopId")
List<String> queryShopTableIds(@Param("shopId") Integer shopId);
}