|
@@ -65,8 +65,31 @@ public class StandarOrderJob {
|
|
|
|
|
|
CreateOrder2Model createOrder2Model = getParameter().get();
|
|
|
|
|
|
+
|
|
|
+ // 店铺详情
|
|
|
+ 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())) {
|
|
|
+ resultContent.set(ResultContent.build(com.github.microservice.auth.client.content.ResultState.Fail, "分账账户未设置"));
|
|
|
+ stop.set(true);
|
|
|
+ return RepeatStatus.FINISHED;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
for (CreateOrder2Model.Goods goods : createOrder2Model.getGoodsList()) {
|
|
|
|
|
|
+ // 商品详情
|
|
|
+ com.zswl.cloud.shop.client.ret.ResultContent<GoodsInfoVo> detail = goodsService.detail(goods.getGoodsId(), 1, createOrder2Model.getUserId());
|
|
|
+ log.info("商品详情:{}", JSONUtil.toJsonStr(detail));
|
|
|
+ GoodsInfoVo goodsInfoVo = detail.getContent();
|
|
|
+ SharePlatformVo sharePlatformVo = goodsInfoVo.getSharePlatformVo();
|
|
|
+ if (ObjectUtil.isEmpty(sharePlatformVo)) {
|
|
|
+ stop.set(true);
|
|
|
+ getResultContent().set(ResultContent.build(com.github.microservice.auth.client.content.ResultState.Fail, "分账规则未配置"));
|
|
|
+ return RepeatStatus.FINISHED;
|
|
|
+ }
|
|
|
|
|
|
OperateStockDto operateStockDto = new OperateStockDto();
|
|
|
operateStockDto.setUserId(createOrder2Model.getUserId());
|
|
@@ -99,31 +122,10 @@ public class StandarOrderJob {
|
|
|
|
|
|
goods.setPayAmount(calculateVo.getPrice());
|
|
|
|
|
|
- // 店铺详情
|
|
|
- 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())) {
|
|
|
- resultContent.set(ResultContent.build(com.github.microservice.auth.client.content.ResultState.Fail, "分账账户未设置"));
|
|
|
- stop.set(true);
|
|
|
- return RepeatStatus.FINISHED;
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
- // 设置分账账户
|
|
|
+ // 设置分账账户
|
|
|
createOrder2Model.setAccesserUserId(shopDetailVo.getAuthAccount());
|
|
|
|
|
|
- // 商品详情
|
|
|
- com.zswl.cloud.shop.client.ret.ResultContent<GoodsInfoVo> detail = goodsService.detail(goods.getGoodsId(), 1, createOrder2Model.getUserId());
|
|
|
- log.info("商品详情:{}", JSONUtil.toJsonStr(detail));
|
|
|
- GoodsInfoVo goodsInfoVo = detail.getContent();
|
|
|
- SharePlatformVo sharePlatformVo = goodsInfoVo.getSharePlatformVo();
|
|
|
- if (ObjectUtil.isEmpty(sharePlatformVo)) {
|
|
|
- stop.set(true);
|
|
|
- getResultContent().set(ResultContent.build(com.github.microservice.auth.client.content.ResultState.Fail, "分账规则未配置"));
|
|
|
- return RepeatStatus.FINISHED;
|
|
|
- }
|
|
|
|
|
|
// 设置有效期
|
|
|
createOrder2Model.setValidDay(goodsInfoVo.getValidDay());
|
|
@@ -131,17 +133,17 @@ public class StandarOrderJob {
|
|
|
|
|
|
// 设置分账规则
|
|
|
goods.setTransferType(sharePlatformVo.getShareType() == 1 ? TransferType.RATIO : TransferType.FIXED);
|
|
|
- // 平台
|
|
|
+ // 平台
|
|
|
CreateOrder2Model.Owner platform = new CreateOrder2Model.Owner();
|
|
|
platform.setOwner(TransferOwner.PLATFORM);
|
|
|
platform.setValue(sharePlatformVo.getPlatformRate());
|
|
|
|
|
|
- // 购买店铺
|
|
|
+ // 购买店铺
|
|
|
CreateOrder2Model.Owner byShop = new CreateOrder2Model.Owner();
|
|
|
byShop.setOwner(TransferOwner.BUY_SHOP);
|
|
|
byShop.setValue(sharePlatformVo.getBuyShopRate());
|
|
|
|
|
|
- // 使用店铺
|
|
|
+ // 使用店铺
|
|
|
CreateOrder2Model.Owner useShop = new CreateOrder2Model.Owner();
|
|
|
useShop.setOwner(TransferOwner.USE_SHOP);
|
|
|
useShop.setValue(sharePlatformVo.getCheckShopRate());
|