|
@@ -1,6 +1,8 @@
|
|
|
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.security.annotations.ResourceAuth;
|
|
@@ -14,9 +16,12 @@ 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.OrderServiceImp;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.SneakyThrows;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
@@ -43,7 +48,11 @@ public class OrderController {
|
|
|
@Autowired
|
|
|
GoodsService goodsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ ShopService shopService;
|
|
|
+
|
|
|
|
|
|
+ @SneakyThrows
|
|
|
@ApiOperation("创建订单")
|
|
|
@ResourceAuth(value = AuthConstant.User, type = AuthType.User)
|
|
|
@RequestMapping(value = "creat", method = RequestMethod.POST)
|
|
@@ -55,9 +64,26 @@ public class OrderController {
|
|
|
createOrder2Model.setUserId(userId);
|
|
|
createOrder2Model.setShopId(orderParamModel.getShopId());
|
|
|
|
|
|
+
|
|
|
+ // 店铺详情
|
|
|
+ com.zswl.cloud.shop.client.ret.ResultContent<ShopDetailVo> detail1 = shopService.detail(createOrder2Model.getShopId());
|
|
|
+ log.info("店铺详情:{}", JSONUtil.toJsonStr(detail1));
|
|
|
+ ShopDetailVo shopDetailVo = detail1.getContent();
|
|
|
+ createOrder2Model.setShopInfo(JSONUtil.parseObj(shopDetailVo));
|
|
|
+ if (ObjectUtil.isEmpty(shopDetailVo.getAuthAccount())) {
|
|
|
+ return ResultContent.build(com.github.microservice.auth.client.content.ResultState.Fail, "分账账户未设置");
|
|
|
+ }
|
|
|
+ createOrder2Model.setAccesserUserId(shopDetailVo.getAuthAccount());
|
|
|
+
|
|
|
for (String goodsId : orderParamModel.getGoodsList()) {
|
|
|
- com.zswl.cloud.shop.client.ret.ResultContent<GoodsInfoVo> detail = goodsService.detail(goodsId, 1, userId);
|
|
|
- String goodsType = detail.getContent().getGoodsType();
|
|
|
+
|
|
|
+ com.zswl.cloud.shop.client.ret.ResultContent resultContent = shopService.goodsInfo(orderParamModel.getShopId(), goodsId, userId);
|
|
|
+
|
|
|
+ GoodsInfoVo detail = (GoodsInfoVo) resultContent.getContent();
|
|
|
+
|
|
|
+// com.zswl.cloud.shop.client.ret.ResultContent<GoodsInfoVo> detail = goodsService.detail(goodsId, 1, userId);
|
|
|
+
|
|
|
+ String goodsType = detail.getGoodsType();
|
|
|
|
|
|
CreateOrder2Model.Goods goods1 = new CreateOrder2Model.Goods();
|
|
|
goods1.setGoodsId(goodsId);
|