|
@@ -0,0 +1,69 @@
|
|
|
+package com.zswl.cloud.springBtach.server.core.controller;
|
|
|
+
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
+import com.github.microservice.auth.client.constant.AuthConstant;
|
|
|
+import com.github.microservice.auth.client.content.ResultContent;
|
|
|
+import com.github.microservice.auth.client.content.ResultState;
|
|
|
+import com.github.microservice.auth.security.annotations.ResourceAuth;
|
|
|
+import com.github.microservice.auth.security.helper.AuthHelper;
|
|
|
+import com.github.microservice.auth.security.type.AuthType;
|
|
|
+import com.github.microservice.core.util.bean.BeanUtil;
|
|
|
+import com.zhongshu.payment.client.model.CountModel;
|
|
|
+import com.zhongshu.payment.client.model.order.*;
|
|
|
+import com.zhongshu.payment.client.model.order.v2.CreateOrder2Model;
|
|
|
+import com.zhongshu.payment.client.model.order.v2.OrderResult2Model;
|
|
|
+import com.zhongshu.payment.client.model.payment.CreateResponseModel;
|
|
|
+import com.zhongshu.payment.client.type.JobFlowMap;
|
|
|
+import com.zhongshu.payment.client.type.TransferOwner;
|
|
|
+import com.zhongshu.payment.client.type.TransferType;
|
|
|
+import com.zswl.cloud.shop.client.service.GoodsService;
|
|
|
+import com.zswl.cloud.shop.client.service.ShopService;
|
|
|
+import com.zswl.cloud.shop.client.vo.life.GoodsInfoVo;
|
|
|
+import com.zswl.cloud.shop.client.vo.life.ShopDetailVo;
|
|
|
+import com.zswl.cloud.springBtach.server.core.service.impl.OrderServiceImpl;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.SneakyThrows;
|
|
|
+import lombok.extern.log4j.Log4j2;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.http.MediaType;
|
|
|
+import org.springframework.util.Assert;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Log4j2
|
|
|
+@RestController
|
|
|
+@RequestMapping("studyOrder")
|
|
|
+public class StudyOrderController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ OrderServiceImpl orderServiceImp;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ GoodsService goodsService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ShopService shopService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ OrderController orderController;
|
|
|
+
|
|
|
+ @SneakyThrows
|
|
|
+ @ApiOperation("创建订单")
|
|
|
+ @ResourceAuth(value = AuthConstant.User, type = AuthType.User)
|
|
|
+ @RequestMapping(value = "creat", method = RequestMethod.POST)
|
|
|
+ public synchronized ResultContent creat(@RequestBody @Valid AddStudyOrderParamModel param) {
|
|
|
+ AddOrderParamModel paramModel = new AddOrderParamModel();
|
|
|
+ BeanUtils.copyProperties(param, paramModel);
|
|
|
+ List<String> goodsList = param.getGoodsList();
|
|
|
+ // 验证研学商品可以提交不
|
|
|
+
|
|
|
+ return orderController.creat(paramModel);
|
|
|
+ }
|
|
|
+}
|