OrderController.java 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package com.dk.mdm.controller.sale;
  2. import com.dk.common.model.pojo.PageList;
  3. import com.dk.common.response.ResponseResultVO;
  4. import com.dk.mdm.model.pojo.sale.Order;
  5. import com.dk.common.service.BaseService;
  6. import com.dk.mdm.model.query.sale.OrderQuery;
  7. import com.dk.mdm.model.response.sale.OrderResponse;
  8. import com.dk.mdm.model.vo.sale.OrderVO;
  9. import io.swagger.annotations.ApiOperation;
  10. import org.springframework.web.bind.annotation.*;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import io.swagger.annotations.Api;
  13. import com.dk.mdm.service.sale.OrderService;
  14. import java.util.Map;
  15. @Api(tags = "销售订单API接口")
  16. @RestController
  17. @RequestMapping("/sale/order")
  18. public class OrderController {
  19. public BaseService<Order> getService() {
  20. return orderService;
  21. }
  22. @Autowired
  23. private OrderService orderService;
  24. /**
  25. * @desc : 条件查询
  26. * @author : 付斌
  27. * @date : 2023/1/9 10:36
  28. */
  29. @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
  30. @PostMapping({"list_by"})
  31. public ResponseResultVO<PageList<OrderResponse>> selectByCond(@RequestBody OrderQuery orderQuery) {
  32. return orderService.selectByCond(orderQuery);
  33. }
  34. /**
  35. * @desc :查询订单明细(货物、收款、附件)
  36. * @author : 付斌
  37. * @date : 2024-02-28 13:24
  38. */
  39. @PostMapping({"select_order_item_by_id/{id}"})
  40. public ResponseResultVO<Map<String, Object>> selectOrderItemById(@PathVariable String id) {
  41. return orderService.selectOrderItemById(id);
  42. }
  43. /**
  44. * @desc : 通过ID查询
  45. * @author : 付斌
  46. * @date : 2023/1/9 10:41
  47. */
  48. @PostMapping({"/{id}"})
  49. public ResponseResultVO selectById(@PathVariable String id) {
  50. return orderService.selectById(id);
  51. }
  52. /**
  53. * @desc : 新建员工
  54. * @author : 付斌
  55. * @date : 2023/1/9 10:48
  56. */
  57. @ApiOperation(value = "新建员工", notes = "新建员工")
  58. @PostMapping({"insert"})
  59. public ResponseResultVO<?> insert(@RequestBody OrderVO orderVO) {
  60. return orderService.insert(orderVO);
  61. }
  62. /**
  63. * @desc : 编辑员工
  64. * @author : 付斌
  65. * @date : 2023/1/9 10:49
  66. */
  67. @ApiOperation(value = "编辑员工", notes = "编辑员工")
  68. @PostMapping({"update"})
  69. public ResponseResultVO<Boolean> update(@RequestBody OrderVO orderVO) {
  70. return orderService.update(orderVO);
  71. }
  72. }