wzy
2022-08-14 b141df9bf9764db8567efebed48006e12ab1f657
gc-order/src/main/java/com/xzx/gc/order/controller/ApiJhyOrderController.java
@@ -3,6 +3,7 @@
import com.github.pagehelper.PageInfo;
import com.xzx.gc.common.Result;
import com.xzx.gc.common.request.BaseController;
import com.xzx.gc.entity.JhyInfo;
import com.xzx.gc.model.JsonResult;
import com.xzx.gc.order.dto.AddJhyOrderDto;
import com.xzx.gc.order.dto.JhyOrderConfirmDto;
@@ -17,12 +18,10 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@Slf4j
@@ -36,9 +35,11 @@
    @ApiOperation("下单")
    @PostMapping(value = "/jhy/order/add")
    public Result<String> addJhyOrder(@RequestBody AddJhyOrderDto addJhyOrderDto, HttpServletRequest request) {
        addJhyOrderDto.setUserId(getUserId(request));
        jhyOrderService.addJhyOrder(addJhyOrderDto);
        return Result.success();
//        addJhyOrderDto.setUserId(getUserId(request));
//        jhyOrderService.addJhyOrder(addJhyOrderDto);
//        return Result.success();
        return Result.error("停止下单");
    }
    @ApiOperation("集物员订单列表")
@@ -84,9 +85,16 @@
    }
    @ApiOperation("订单状态数量")
    @PostMapping(value = "/jhy/order/orderStatusCnt")
    public JsonResult<Map<Integer, Integer>> orderStatusCnt(HttpServletRequest request) {
        return JsonResult.success(jhyOrderService.orderStatusCount(getUserId(request)));
    @PostMapping(value = "/jhy/order/orderStatusCnt/{type}")
    public JsonResult<Map<Integer, Integer>> orderStatusCnt(@PathVariable("type") Integer type, HttpServletRequest request) {
        return JsonResult.success(jhyOrderService.orderStatusCount(type, getUserId(request)));
    }
    @ApiOperation("地址范围是否有集货员")
    @PostMapping(value = "/jhy/order/hasJhy/{addressId}")
    public Result<List<JhyInfo>> hasJhy(@PathVariable("addressId") Long addressId) {
        List<JhyInfo> inRange = jhyOrderService.findJhyInfoInRange(addressId);
        return Result.success(inRange);
    }
}