|
@@ -16,7 +16,9 @@ import com.zhongshu.payment.client.type.TransferOwner;
|
|
|
import com.zhongshu.payment.client.type.TransferType;
|
|
|
import com.zswl.cloud.shop.client.dto.life.TripartiteShopDto;
|
|
|
import com.zswl.cloud.shop.client.service.ShopService;
|
|
|
+import com.zswl.cloud.shop.client.vo.life.AccountDetailVo;
|
|
|
import com.zswl.cloud.shop.client.vo.life.ShopDetailVo;
|
|
|
+import com.zswl.cloud.shop.client.vo.life.ShopInfoSimpleVo;
|
|
|
import com.zswl.cloud.springBatch.client.model.dfy.Ticket.request.*;
|
|
|
import com.zswl.cloud.springBatch.client.model.dfy.Ticket.response.*;
|
|
|
import com.zswl.cloud.springBatch.client.service.DfyTicketService;
|
|
@@ -91,6 +93,19 @@ public class DfyTicketServiceImpl implements DfyTicketService {
|
|
|
|
|
|
public ResultContent<CreatOrderResultModel> createOrderNew(CreateOrderNewRequest createOrderNewRequest) {
|
|
|
|
|
|
+
|
|
|
+ com.zswl.cloud.shop.client.ret.ResultContent<AccountDetailVo> shopSetting = shopService.shopSetting("景区");
|
|
|
+ if (!shopSetting.getState().equals(com.zswl.cloud.shop.client.ret.ResultState.Success)) {
|
|
|
+ return ResultContent.build(ResultState.Fail, "景区商户信息未配置");
|
|
|
+ }
|
|
|
+ AccountDetailVo accountDetailVo = shopSetting.getContent();
|
|
|
+ List<ShopInfoSimpleVo> shops =accountDetailVo.getShops();
|
|
|
+ if (shops.isEmpty()){
|
|
|
+ return ResultContent.build(ResultState.Fail, "景区店铺未创建");
|
|
|
+ }
|
|
|
+ ShopInfoSimpleVo shopInfoSimpleVo = shops.get(0);
|
|
|
+
|
|
|
+
|
|
|
String orderNo = snowflake.nextIdStr();
|
|
|
createOrderNewRequest.setSourceOrderId(orderNo);
|
|
|
|
|
@@ -104,8 +119,8 @@ public class DfyTicketServiceImpl implements DfyTicketService {
|
|
|
BigDecimal salePrice = collect.get(0).getSalePrice();
|
|
|
BigDecimal payAmount = salePrice.multiply(BigDecimal.valueOf(createOrderNewRequest.getBookNumber()));
|
|
|
|
|
|
- ShopDetailVo shopDetailVo = shopService.detail(createOrderNewRequest.getEpId()).getContent();
|
|
|
- String authAccount = shopDetailVo.getAuthAccount();
|
|
|
+// ShopDetailVo shopDetailVo = shopService.detail(createOrderNewRequest.getEpId()).getContent();
|
|
|
+ String authAccount = accountDetailVo.getAuthAccount();
|
|
|
if (ObjectUtil.isEmpty(authAccount)) {
|
|
|
return ResultContent.build(ResultState.Fail, "分账账户未设置");
|
|
|
}
|
|
@@ -127,8 +142,9 @@ public class DfyTicketServiceImpl implements DfyTicketService {
|
|
|
CreateOrder2Model createOrder2Model = new CreateOrder2Model();
|
|
|
createOrder2Model.setOrderNo(orderNo);
|
|
|
createOrder2Model.setUserId(authHelper.getCurrentUser().getUserId());
|
|
|
- createOrder2Model.setShopId(createOrderNewRequest.getEpId());
|
|
|
- createOrder2Model.setShopInfo(JSONUtil.parseObj(shopDetailVo));
|
|
|
+ createOrder2Model.setShopId(shopInfoSimpleVo.getShopId());
|
|
|
+ JSONObject shopInfo = JSONUtil.parseObj(shopInfoSimpleVo);
|
|
|
+ createOrder2Model.setShopInfo(shopInfo);
|
|
|
createOrder2Model.setTotalAmount(payAmount);
|
|
|
createOrder2Model.setDiscountAmount(BigDecimal.ZERO);
|
|
|
createOrder2Model.setPayAmount(payAmount);
|
|
@@ -148,18 +164,18 @@ public class DfyTicketServiceImpl implements DfyTicketService {
|
|
|
goods.setGoodsInfo(goodsInfo);
|
|
|
goods.setPayAmount(payAmount);
|
|
|
goods.setValidDay(30);
|
|
|
- goods.setTransferType(shopDetailVo.getShareType().equals(1) ? TransferType.RATIO : TransferType.FIXED);
|
|
|
+ goods.setTransferType(accountDetailVo.getSharePlatformVo().getShareType().equals(1) ? TransferType.RATIO : TransferType.FIXED);
|
|
|
|
|
|
List<CreateOrder2Model.Owner> ownerList = new ArrayList<>();
|
|
|
|
|
|
CreateOrder2Model.Owner platfor = new CreateOrder2Model.Owner();
|
|
|
platfor.setOwner(TransferOwner.PLATFORM);
|
|
|
- platfor.setValue(shopDetailVo.getPlatformRate());
|
|
|
+ platfor.setValue(accountDetailVo.getSharePlatformVo().getPlatformRate());
|
|
|
|
|
|
CreateOrder2Model.Owner buy = new CreateOrder2Model.Owner();
|
|
|
buy.setOwner(TransferOwner.BUY_SHOP);
|
|
|
- buy.setValue(shopDetailVo.getBuyShopRate());
|
|
|
- buy.setShopId(createOrderNewRequest.getEpId());
|
|
|
+ buy.setValue(accountDetailVo.getSharePlatformVo().getBuyShopRate());
|
|
|
+ buy.setShopId(shopInfoSimpleVo.getShopId());
|
|
|
|
|
|
ownerList.add(platfor);
|
|
|
ownerList.add(buy);
|