员工接取订单查询

This commit is contained in:
attiya 2025-11-27 15:22:19 +08:00
parent b2e6cc0180
commit fc993b1861
2 changed files with 24 additions and 4 deletions

View File

@ -1,5 +1,6 @@
package com.cdzy.operations.controller;
import cn.dev33.satoken.stp.StpUtil;
import com.cdzy.common.enums.Message;
import com.cdzy.common.model.request.PageParam;
import com.cdzy.common.model.response.JsonResult;
@ -56,6 +57,26 @@ public class EbikeBikeOrderController {
return JsonResult.success(orderPage);
}
/**
* 分页查询当前员工接取的工单信息
*
* @param page 分页对象
* @return 分页对象
*/
@GetMapping("pageByStaff")
public JsonResult<?> pageByStaff(PageParam page, Integer orderType, String bikeCode) {
QueryWrapper queryWrapper = QueryWrapper.create()
.select(EBIKE_BIKE_INFO.LOCATION, EBIKE_BIKE_ORDER.ALL_COLUMNS)
.where(EBIKE_BIKE_ORDER.HANDLE_STATE.eq(BikeOrderHandleState.RECEIVED))
.where(EBIKE_BIKE_ORDER.ORDER_TYPE.eq(orderType, Objects.nonNull(orderType)))
.where(EBIKE_BIKE_ORDER.BIKE_CODE.like(bikeCode, StringUtil.hasText(bikeCode)))
.where(EBIKE_BIKE_ORDER.RECEIVER_ID.eq(StpUtil.getLoginIdAsLong()))
.leftJoin(EBIKE_BIKE_INFO).on(EBIKE_BIKE_INFO.BIKE_CODE.eq(EBIKE_BIKE_ORDER.BIKE_CODE))
.orderBy(EBIKE_BIKE_ORDER.CREATED_AT.desc());
Page<EbikeBikeOrderPageDto> orderPage = ebikeBikeOrderService.pageAs(page.getPage(), queryWrapper, EbikeBikeOrderPageDto.class);
return JsonResult.success(orderPage);
}
/**
* 工单详情
*

View File

@ -6,7 +6,6 @@ import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
@SpringBootTest
@ -17,15 +16,15 @@ class EbikeOperationsApplicationTests {
@Test
void contextLoads() throws IOException {
void contextLoads(){
SnowFlakeIDKeyGenerator generator = new SnowFlakeIDKeyGenerator();
long nextId = generator.nextId();
redisUtil.saveDispatchOrder(nextId, "2", 16L, TimeUnit.HOURS);
redisUtil.saveDispatchOrder(nextId, "2", 5L, TimeUnit.MINUTES);
System.out.println(nextId);
}
@Test
void deleteDispatchOrder() throws IOException {
void deleteDispatchOrder(){
redisUtil.deleteDispatchOrder(351467314753310720L);
}