|
@@ -0,0 +1,92 @@
|
|
|
+package com.chelvc.cloud.maintain.controller;
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.ConfirmOrderResultDTO;
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.OmsOrderDTO;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.OmsOrderModifyParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.OrderPagingParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.service.IOmsOrderService;
|
|
|
+import com.chelvc.framework.base.annotation.ResponseWrapping;
|
|
|
+import com.chelvc.framework.common.model.Pagination;
|
|
|
+import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import javax.validation.constraints.Min;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 订单接口
|
|
|
+ *
|
|
|
+ * @author liude
|
|
|
+ * @Date 2023/11/19
|
|
|
+ **/
|
|
|
+@Validated
|
|
|
+@RestController
|
|
|
+@ResponseWrapping
|
|
|
+public class OmsOrderController {
|
|
|
+ @DubboReference
|
|
|
+ private IOmsOrderService omsOrderService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据购物车信息生成确认单信息
|
|
|
+ * @param orderParam
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/generateConfirmOrder")
|
|
|
+ public ConfirmOrderResultDTO generateConfirmOrder(OmsOrderModifyParam orderParam) {
|
|
|
+ return this.omsOrderService.generateConfirmOrder(orderParam);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *根据购物车信息生成订单
|
|
|
+ * @param orderParam
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/generateOrder")
|
|
|
+ public Map<String, Object> generateOrder(@Valid OmsOrderModifyParam orderParam) {
|
|
|
+ Map<String, Object> result = omsOrderService.generateOrder(orderParam);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询订单分页
|
|
|
+ *
|
|
|
+ * @param param 查询参数
|
|
|
+ * @return 订单分页信息
|
|
|
+ */
|
|
|
+ @GetMapping("/order/paging")
|
|
|
+ public Pagination<OmsOrderDTO> getOrderPaging(@Valid OrderPagingParam param) {
|
|
|
+ return this.omsOrderService.getOrderPaging(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 确认订单
|
|
|
+ * @param id 查询参数
|
|
|
+ */
|
|
|
+ @GetMapping("/confirmReceiveOrder/{id}")
|
|
|
+ public void confirmReceiveOrder(@PathVariable("id") @Min(value = 1, message = "商家ID不能小于1") Long id) {
|
|
|
+ this.omsOrderService.confirmReceiveOrder(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除订单
|
|
|
+ * @param id 查询参数
|
|
|
+ */
|
|
|
+ @GetMapping("/deleteOrder/{id}")
|
|
|
+ public void deleteOrder(@PathVariable("id") @Min(value = 1, message = "商家ID不能小于1") Long id) {
|
|
|
+ this.omsOrderService.deleteOrder(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 支付成功回调
|
|
|
+ * @param id 查询参数
|
|
|
+ */
|
|
|
+ @GetMapping("/paySuccess/{id}")
|
|
|
+ public void paySuccess(@PathVariable("id") @Min(value = 1, message = "商家ID不能小于1") Long id,
|
|
|
+ Integer payType) {
|
|
|
+ this.omsOrderService.paySuccess(id,payType);
|
|
|
+ }
|
|
|
+}
|