6/19 实现了订单用户的显示
This commit is contained in:
parent
e7d9742cbb
commit
6599852bc9
@ -119,11 +119,12 @@ public class OrderDetailController {
|
|||||||
|
|
||||||
ExcelUtils.exportExcelToTarget(response, null, list, OrderDetailExcel.class);
|
ExcelUtils.exportExcelToTarget(response, null, list, OrderDetailExcel.class);
|
||||||
}
|
}
|
||||||
@GetMapping("detailInfo/{orderId}")
|
|
||||||
|
@GetMapping("detailInfo/{orderId}")
|
||||||
public Result Info(@PathVariable Long orderId,@ApiIgnore @RequestParam Map<String,Object> params){
|
public Result Info(@PathVariable Long orderId,@ApiIgnore @RequestParam Map<String,Object> params){
|
||||||
OrdersDTO ordersDTO = ordersService.get(orderId);
|
OrdersDTO ordersDTO = ordersService.get(orderId);
|
||||||
params.put("orderId",ordersDTO.getNumber());
|
params.put("orderId",ordersDTO.getNumber());
|
||||||
List<OrderDetailDTO> orderDetailDTOS=orderDetailService.list(params);
|
List<OrderDetailDTO> orderDetailDTOS=orderDetailService.list(params);
|
||||||
return new Result().ok(orderDetailDTOS);
|
return new Result().ok(orderDetailDTOS);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,8 +11,10 @@ import io.renren.common.validator.group.AddGroup;
|
|||||||
import io.renren.common.validator.group.DefaultGroup;
|
import io.renren.common.validator.group.DefaultGroup;
|
||||||
import io.renren.common.validator.group.UpdateGroup;
|
import io.renren.common.validator.group.UpdateGroup;
|
||||||
import io.renren.modules.takeout.dto.OrdersDTO;
|
import io.renren.modules.takeout.dto.OrdersDTO;
|
||||||
|
import io.renren.modules.takeout.dto.UserDTO;
|
||||||
import io.renren.modules.takeout.excel.OrdersExcel;
|
import io.renren.modules.takeout.excel.OrdersExcel;
|
||||||
import io.renren.modules.takeout.service.OrdersService;
|
import io.renren.modules.takeout.service.OrdersService;
|
||||||
|
import io.renren.modules.takeout.service.UserService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
@ -25,6 +27,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -39,19 +42,27 @@ import java.util.Map;
|
|||||||
public class OrdersController {
|
public class OrdersController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrdersService ordersService;
|
private OrdersService ordersService;
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@GetMapping("page")
|
@GetMapping("page")
|
||||||
@ApiOperation("分页")
|
@ApiOperation("分页")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
|
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
|
||||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
|
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
|
||||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
|
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
|
||||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
|
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
|
||||||
})
|
})
|
||||||
@RequiresPermissions("takeout:orders:page")
|
@RequiresPermissions("takeout:orders:page")
|
||||||
public Result<PageData<OrdersDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
public Result<PageData<OrdersDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||||
PageData<OrdersDTO> page = ordersService.page(params);
|
PageData<OrdersDTO> page = ordersService.page(params);
|
||||||
|
|
||||||
|
List<OrdersDTO> ordersDTOS = page.getList().stream().map(ordersDTO -> {
|
||||||
|
UserDTO userDTO = userService.get(ordersDTO.getUserId());
|
||||||
|
ordersDTO.setUserName(userDTO.getName());
|
||||||
|
return ordersDTO;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
page.setList(ordersDTOS);
|
||||||
return new Result<PageData<OrdersDTO>>().ok(page);
|
return new Result<PageData<OrdersDTO>>().ok(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class OrderDetailServiceImpl extends CrudServiceImpl<OrderDetailDao, OrderDetailEntity, OrderDetailDTO> implements OrderDetailService {
|
public class OrderDetailServiceImpl extends CrudServiceImpl<OrderDetailDao, OrderDetailEntity, OrderDetailDTO> implements OrderDetailService {
|
||||||
@Autowired
|
@Autowired
|
||||||
OrderDetailDao orderDetailDao;
|
OrderDetailDao orderDetailDao;
|
||||||
@Override
|
@Override
|
||||||
public QueryWrapper<OrderDetailEntity> getWrapper(Map<String, Object> params){
|
public QueryWrapper<OrderDetailEntity> getWrapper(Map<String, Object> params){
|
||||||
String id = (String)params.get("orderId");
|
String id = (String)params.get("orderId");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user