挂账需求和电话机预约需求
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
package cn.ysk.cashier.controller.booking;
|
package cn.ysk.cashier.controller.booking;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.map.MapProxy;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.ysk.cashier.dto.booking.ShopTableBookingDTO;
|
import cn.ysk.cashier.dto.booking.ShopTableBookingDTO;
|
||||||
import cn.ysk.cashier.mybatis.entity.TbShopTableBooking;
|
import cn.ysk.cashier.mybatis.entity.TbShopTableBooking;
|
||||||
import cn.ysk.cashier.mybatis.service.TbShopTableBookingService;
|
import cn.ysk.cashier.mybatis.service.TbShopTableBookingService;
|
||||||
@@ -97,8 +100,11 @@ public class TbShopTableBookingController {
|
|||||||
|
|
||||||
@PostMapping("summary")
|
@PostMapping("summary")
|
||||||
@ApiOperation("根据电话号码统计历史预订信息")
|
@ApiOperation("根据电话号码统计历史预订信息")
|
||||||
public ResponseEntity summary(@RequestBody String[] phoneNos) {
|
public ResponseEntity summary(@RequestBody Map<String, Object> params) {
|
||||||
Map<String, Object> data = tbShopTableBookingService.summary(phoneNos);
|
MapProxy proxy = MapUtil.createProxy(params);
|
||||||
|
Integer shopId = proxy.getInt("shopId");
|
||||||
|
String[] phoneNos = Convert.toStrArray(proxy.get("phoneNos"));
|
||||||
|
Map<String, Object> data = tbShopTableBookingService.summary(shopId, phoneNos);
|
||||||
return ResponseEntity.ok().body(data);
|
return ResponseEntity.ok().body(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,14 +9,14 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺台桌预订
|
* 店铺台桌预订
|
||||||
*
|
*
|
||||||
* @author Tankaikai tankaikai@aliyun.com
|
* @author Tankaikai tankaikai@aliyun.com
|
||||||
* @since 2.0 2024-11-21
|
* @since 2.0 2024-11-21
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface TbShopTableBookingMapper extends BaseMapper<TbShopTableBooking> {
|
public interface TbShopTableBookingMapper extends BaseMapper<TbShopTableBooking> {
|
||||||
|
|
||||||
List<Map<String,Object>> summaryByPhoneNos(@Param("phoneNoList") List<String> phoneNoList);
|
List<Map<String, Object>> summaryByPhoneNos(@Param("shopId") Integer shopId, @Param("phoneNoList") List<String> phoneNoList);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -36,6 +36,6 @@ public interface TbShopTableBookingService extends IService<TbShopTableBooking>
|
|||||||
|
|
||||||
List<ShopTableBookingDTO> findShopTableList(Map<String, Object> params);
|
List<ShopTableBookingDTO> findShopTableList(Map<String, Object> params);
|
||||||
|
|
||||||
Map<String, Object> summary(String[] phoneNos);
|
Map<String, Object> summary(Integer shopId,String[] phoneNos);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -265,8 +265,8 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl<TbShopTableBookin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> summary(String[] phoneNos) {
|
public Map<String, Object> summary(Integer shopId, String[] phoneNos) {
|
||||||
List<Map<String, Object>> list = baseMapper.summaryByPhoneNos(Arrays.asList(phoneNos));
|
List<Map<String, Object>> list = baseMapper.summaryByPhoneNos(shopId, Arrays.asList(phoneNos));
|
||||||
Map<String, Object> result = new HashMap<>(phoneNos.length);
|
Map<String, Object> result = new HashMap<>(phoneNos.length);
|
||||||
Map<String, Object> fillData = new HashMap<>(2);
|
Map<String, Object> fillData = new HashMap<>(2);
|
||||||
fillData.put("consumeOrders", 0);
|
fillData.put("consumeOrders", 0);
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
count( case when x.`status` = 10 then 1 end) AS consumeOrders,
|
count( case when x.`status` = 10 then 1 end) AS consumeOrders,
|
||||||
count( case when x.`status` = -1 or x.`status` = 999 then 1 end) AS cancelOrders
|
count( case when x.`status` = -1 or x.`status` = 999 then 1 end) AS cancelOrders
|
||||||
from tb_shop_table_booking x
|
from tb_shop_table_booking x
|
||||||
where x.phone_number in
|
where x.shopId = #{shopId}
|
||||||
|
and x.phone_number in
|
||||||
<foreach item="phoneNumber" collection="phoneNoList" open="(" separator="," close=")">
|
<foreach item="phoneNumber" collection="phoneNoList" open="(" separator="," close=")">
|
||||||
#{phoneNumber, jdbcType=VARCHAR}
|
#{phoneNumber, jdbcType=VARCHAR}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|||||||
Reference in New Issue
Block a user