diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/controller/OrderDetailController.java b/renren-admin/src/main/java/io/renren/modules/takeout/controller/OrderDetailController.java index 746d5f7..f7dc15b 100644 --- a/renren-admin/src/main/java/io/renren/modules/takeout/controller/OrderDetailController.java +++ b/renren-admin/src/main/java/io/renren/modules/takeout/controller/OrderDetailController.java @@ -1,5 +1,6 @@ package io.renren.modules.takeout.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import io.renren.common.annotation.LogOperation; import io.renren.common.constant.Constant; import io.renren.common.page.PageData; @@ -11,8 +12,10 @@ import io.renren.common.validator.group.AddGroup; import io.renren.common.validator.group.DefaultGroup; import io.renren.common.validator.group.UpdateGroup; import io.renren.modules.takeout.dto.OrderDetailDTO; +import io.renren.modules.takeout.dto.OrdersDTO; import io.renren.modules.takeout.excel.OrderDetailExcel; import io.renren.modules.takeout.service.OrderDetailService; +import io.renren.modules.takeout.service.OrdersService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -23,6 +26,8 @@ import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -39,6 +44,8 @@ import java.util.Map; public class OrderDetailController { @Autowired private OrderDetailService orderDetailService; + @Autowired + private OrdersService ordersService; @GetMapping("page") @ApiOperation("分页") @@ -112,5 +119,11 @@ public class OrderDetailController { ExcelUtils.exportExcelToTarget(response, null, list, OrderDetailExcel.class); } - +@GetMapping("detailInfo/{orderId}") + public Result Info(@PathVariable Long orderId,@ApiIgnore @RequestParam Map params){ + OrdersDTO ordersDTO = ordersService.get(orderId); + params.put("orderId",ordersDTO.getNumber()); + List orderDetailDTOS=orderDetailService.list(params); + return new Result().ok(orderDetailDTOS); +} } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/OrderDetailServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/OrderDetailServiceImpl.java index ad811c9..728464a 100644 --- a/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/OrderDetailServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/OrderDetailServiceImpl.java @@ -1,5 +1,6 @@ package io.renren.modules.takeout.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.renren.common.service.impl.CrudServiceImpl; import io.renren.modules.takeout.dao.OrderDetailDao; @@ -7,8 +8,10 @@ import io.renren.modules.takeout.dto.OrderDetailDTO; import io.renren.modules.takeout.entity.OrderDetailEntity; import io.renren.modules.takeout.service.OrderDetailService; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; import java.util.Map; /** @@ -19,16 +22,16 @@ import java.util.Map; */ @Service public class OrderDetailServiceImpl extends CrudServiceImpl implements OrderDetailService { - +@Autowired +OrderDetailDao orderDetailDao; @Override public QueryWrapper getWrapper(Map params){ - String id = (String)params.get("id"); + String id = (String)params.get("orderId"); QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), "id", id); + wrapper.eq(StringUtils.isNotBlank(id), "order_id", id); return wrapper; } - } \ No newline at end of file