1
0

8 Коммитууд f30c0861e2 ... 4042253928

Эзэн SHA1 Мессеж Огноо
  wangming 4042253928 Merge remote-tracking branch 'origin/master' 5 өдөр өмнө
  wangming 6976cab7b7 add deliver 5 өдөр өмнө
  wangming 7019d8e9c4 add deliver 5 өдөр өмнө
  wangming 582db25d17 add deliver 6 өдөр өмнө
  wangming b03d8e296b Merge remote-tracking branch 'origin/master' 6 өдөр өмнө
  wangming 1e8c5e626a add deliver 6 өдөр өмнө
  wangming 0a77ed385d add deliver 6 өдөр өмнө
  wangming 464da9f31e add deliver 6 өдөр өмнө
26 өөрчлөгдсөн 774 нэмэгдсэн , 81 устгасан
  1. 39 10
      yami-shop-api/src/main/java/com/yami/shop/api/controller/MyOrderController.java
  2. 0 1
      yami-shop-api/src/main/java/com/yami/shop/api/controller/OrderController.java
  3. 3 6
      yami-shop-api/src/main/java/com/yami/shop/api/controller/OrderRefundController.java
  4. 2 2
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/OrderItem.java
  5. 21 0
      yami-shop-common/src/main/java/com/yami/shop/common/util/RefundSnUtils.java
  6. 49 16
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/OrderController.java
  7. 1 1
      yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderRefundServiceImpl.java
  8. 39 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/BankAccountInfo.java
  9. 23 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/BusinessInfo.java
  10. 39 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/BusinessLicense.java
  11. 8 3
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/ContactInfo.java
  12. 38 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/IdCardInfo.java
  13. 19 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/IdentityInfo.java
  14. 24 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/MiniProgramInfo.java
  15. 25 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/SalesInfo.java
  16. 20 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/SettlementInfo.java
  17. 37 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/StoreInfo.java
  18. 34 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/SubjectInfo.java
  19. 39 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/SubmitInfo.java
  20. 48 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/SubmitInfoForm.java
  21. 42 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/form/UBOInfoList.java
  22. 0 21
      yami-shop-wx/src/main/java/com/yami/shop/wx/po/SubjectInfoDto.java
  23. 39 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/po/TraceWaybill.java
  24. 25 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/po/TraceWaybillDetail.java
  25. 27 0
      yami-shop-wx/src/main/java/com/yami/shop/wx/po/TraceWaybillGoodsInfo.java
  26. 133 21
      yami-shop-wx/src/main/java/com/yami/shop/wx/service/impl/WxProviderServiceImpl.java

+ 39 - 10
yami-shop-api/src/main/java/com/yami/shop/api/controller/MyOrderController.java

@@ -13,7 +13,7 @@ package com.yami.shop.api.controller;
 import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.google.common.collect.Lists;
 import com.yami.shop.bean.app.dto.*;
 import com.yami.shop.bean.enums.OrderStatus;
 import com.yami.shop.bean.enums.RefundStatusEnum;
@@ -26,9 +26,15 @@ import com.yami.shop.common.util.PageParam;
 import com.yami.shop.config.ShopConfig;
 import com.yami.shop.dao.PointsRecordMapper;
 import com.yami.shop.security.api.util.SecurityUtils;
+import com.yami.shop.security.comment.dao.AppConnectMapper;
+import com.yami.shop.security.comment.model.AppConnect;
 import com.yami.shop.service.*;
 import com.yami.shop.service.hb.IHBOrderService;
 import com.yami.shop.utils.CullenUtils;
+import com.yami.shop.wx.po.TraceWaybill;
+import com.yami.shop.wx.po.TraceWaybillDetail;
+import com.yami.shop.wx.po.TraceWaybillGoodsInfo;
+import com.yami.shop.wx.service.impl.WxProviderServiceImpl;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -53,26 +59,49 @@ import java.util.Objects;
 public class MyOrderController {
 
     private final OrderService orderService;
-
     private final MapperFacade mapperFacade;
-
     private final UserAddrOrderService userAddrOrderService;
-
     private final ProductService productService;
-
     private final SkuService skuService;
-
     private final ShopConfig shopConfig;
-
     private final MyOrderService myOrderService;
-
     private final ShopDetailService shopDetailService;
-
     private final OrderItemService orderItemService;
     private final IHBOrderService ihbOrderService;
-
     private final OrderRefundService orderRefundService;
     private final PointsRecordMapper pointsRecordMapper;
+    private final OrderSettlementService orderSettlementService;
+    private final AppConnectMapper appConnectMapper;
+    private final DeliveryService deliveryService;
+
+    @SuppressWarnings("all")
+    @GetMapping("/getWaybillToken")
+    @ApiOperation(value = "微信物流-获取waybill_token")
+    public ResponseEntity<String> getWaybillToken(@RequestParam(value = "orderNumber") String orderNumber) {
+        CullenUtils.validateDataThrowException(orderNumber==null,"订单号不能为空...");
+        AppConnect connect = appConnectMapper.getByUserId(SecurityUtils.getUser().getUserId(), 1);
+        CullenUtils.validateDataThrowException(orderNumber==null,"openid不存在...");
+        Order order = orderService.getOrderByOrderNumber(orderNumber);
+        CullenUtils.validateDataThrowException(order==null,"订单不存在...");
+        UserAddrOrder userAddrOrder = userAddrOrderService.getById(order.getAddrOrderId());
+        CullenUtils.validateDataThrowException(userAddrOrder==null,"收货地址不存在...");
+        Delivery delivery = deliveryService.getById(order.getDvyId());
+        CullenUtils.validateDataThrowException(delivery==null,"订单未发货...");
+        List<OrderItem> orderItemList = orderItemService.getOrderItemsByOrderNumber(orderNumber);
+        CullenUtils.validateDataThrowException(orderItemList.isEmpty(),"订单项不存在...");
+        OrderSettlement settlement = orderSettlementService.getOne(new LambdaQueryWrapper<OrderSettlement>().eq(OrderSettlement::getOrderNumber, orderNumber));
+        CullenUtils.validateDataThrowException(settlement==null,"订单结算不存在...");
+        TraceWaybill traceWaybill = new TraceWaybill();
+        traceWaybill.setOpenid(connect.getBizUserId());
+        traceWaybill.setReceiverPhone(userAddrOrder.getMobile());
+        traceWaybill.setDeliveryId(delivery.getDvyNo());
+        traceWaybill.setWaybillId(order.getDvyFlowId());
+        List<TraceWaybillGoodsInfo> goodsInfoList = Lists.newArrayList();
+        orderItemList.forEach(item -> goodsInfoList.add(new TraceWaybillGoodsInfo(item.getProdName(),item.getPic())));
+        traceWaybill.setGoodsInfo(new TraceWaybillDetail(goodsInfoList));
+        traceWaybill.setTransId(settlement.getBizPayNo());
+        return ResponseEntity.ok(WxProviderServiceImpl.traceWaybill(traceWaybill));
+    }
 
 
     /**

+ 0 - 1
yami-shop-api/src/main/java/com/yami/shop/api/controller/OrderController.java

@@ -330,7 +330,6 @@ public class OrderController {
         return ResponseEntity.ok(new OrderNumbersDto(orderNumbers.toString(), mergerOrder.getNextPay()));
     }
 
-
     @GetMapping("/getOrderPayInfoByOrderNumber")
     @ApiOperation(value = "获取订单支付信息", notes = "获取订单支付的商品/地址信息")
     @ApiImplicitParam(name = "orderNumbers", value = "订单流水号", required = true, dataType = "String")

+ 3 - 6
yami-shop-api/src/main/java/com/yami/shop/api/controller/OrderRefundController.java

@@ -19,7 +19,7 @@ import com.yami.shop.common.config.Constant;
 import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.util.Arith;
 import com.yami.shop.common.util.PageParam;
-import com.yami.shop.common.util.R;
+import com.yami.shop.common.util.RefundSnUtils;
 import com.yami.shop.dao.OrderRefundRecordMapper;
 import com.yami.shop.dao.OrderRefundSkuMapper;
 import com.yami.shop.delivery.comment.api.paotui.PaoTuiApi;
@@ -185,7 +185,7 @@ public class OrderRefundController {
         newOrderRefund.setUserId(order.getUserId());
         newOrderRefund.setOrderId(order.getOrderId());
         newOrderRefund.setOrderNumber(order.getOrderNumber());
-        newOrderRefund.setRefundSn(String.valueOf(snowflake.nextId()));
+        newOrderRefund.setRefundSn(RefundSnUtils.generate());
         newOrderRefund.setRefundType(orderRefundParam.getRefundType());
 
         newOrderRefund.setRefundAmount(orderRefundParam.getRefundAmount());
@@ -273,11 +273,8 @@ public class OrderRefundController {
     public ResponseEntity<String> apply(@Valid @RequestBody OrderRefundParam orderRefundParam) {
         log.info("小程序申请退款参数:{}", JSONObject.toJSONString(orderRefundParam));
         List<OrderRefundSku> orderRefundSkuList = orderRefundParam.getOrderRefundSkuList();
-        System.out.println("orderRefundSkuList-------"+orderRefundSkuList);
         CullenUtils.validateDataThrowException(orderRefundSkuList.isEmpty(), "退款商品不能为空...");
-        System.out.println("过-------");
         String userId = SecurityUtils.getUser().getUserId();
-        System.out.println("userId-------"+userId);
 //        String userId = "36726893042d492aba446439c5f00584";
         // 获取订单信息
         Order order = orderService.getOrderByOrderNumberAndUserId(orderRefundParam.getOrderNumber(), userId, true);
@@ -338,7 +335,7 @@ public class OrderRefundController {
         newOrderRefund.setUserId(order.getUserId());
         newOrderRefund.setOrderId(order.getOrderId());
         newOrderRefund.setOrderNumber(order.getOrderNumber());
-        newOrderRefund.setRefundSn(String.valueOf(snowflake.nextId()));
+        newOrderRefund.setRefundSn(RefundSnUtils.generate());
         newOrderRefund.setRefundType(orderRefundParam.getRefundType());
 
         newOrderRefund.setRefundAmount(orderRefundParam.getRefundAmount());

+ 2 - 2
yami-shop-bean/src/main/java/com/yami/shop/bean/model/OrderItem.java

@@ -14,7 +14,9 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -196,6 +198,4 @@ public class OrderItem implements Serializable {
 
     @TableField(exist = false)
     private Integer refundCount;
-
-
 }

+ 21 - 0
yami-shop-common/src/main/java/com/yami/shop/common/util/RefundSnUtils.java

@@ -0,0 +1,21 @@
+package com.yami.shop.common.util;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.concurrent.ThreadLocalRandom;
+
+public final class RefundSnUtils {
+
+    private static final DateTimeFormatter FMT = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
+
+    /**
+     * 生成订单编号
+     * 格式:D + yyyyMMddHHmmss + 4位随机数字
+     */
+    public static String generate() {
+        String timestamp = LocalDateTime.now().format(FMT);
+        int random4 = ThreadLocalRandom.current().nextInt(1000, 10000); // 1000~9999
+        return "D" + timestamp + random4;
+    }
+
+}

+ 49 - 16
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/OrderController.java

@@ -12,6 +12,7 @@ package com.yami.shop.platform.controller;
 
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yami.shop.bean.enums.DvyType;
@@ -21,12 +22,20 @@ import com.yami.shop.bean.model.OrderItem;
 import com.yami.shop.bean.model.User;
 import com.yami.shop.bean.model.UserAddrOrder;
 import com.yami.shop.bean.param.*;
+import com.yami.shop.bean.model.*;
+import com.yami.shop.bean.param.BackendOrderParam;
+import com.yami.shop.bean.param.DeliveryOrderParam;
+import com.yami.shop.bean.param.OrderParam;
+import com.yami.shop.bean.param.OrderPayParam;
 import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.util.PageParam;
 import com.yami.shop.common.util.R;
 import com.yami.shop.coupon.comment.model.Coupon;
+import com.yami.shop.security.comment.dao.AppConnectMapper;
+import com.yami.shop.security.comment.model.AppConnect;
 import com.yami.shop.service.*;
 import com.yami.shop.utils.CullenUtils;
+import com.yami.shop.wx.service.impl.WxProviderServiceImpl;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -39,6 +48,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
  * 订单信息管理实现
@@ -59,6 +69,8 @@ public class OrderController {
     private final SkuService skuService;
     private final UserService userService;
     private final DeliveryService deliveryService;
+    private final OrderSettlementService orderSettlementService;
+    private final AppConnectMapper appConnectMapper;
 
 
     /**
@@ -80,7 +92,7 @@ public class OrderController {
 
     @GetMapping("/deliverListStatusNum")
     @ApiOperation("后管端-快递订单列表-订单状态数量")
-    public R<Map<String,Integer>> deliverListStatusNum() {
+    public R<Map<String, Integer>> deliverListStatusNum() {
         return R.SUCCESS(orderService.deliverListStatusNum());
     }
 
@@ -89,9 +101,9 @@ public class OrderController {
      */
     @GetMapping("/orderPayByShopId")
     @ApiOperation(value = "根据商家id获取支付信息")
-    public R<OrderPayParam> orderPayByShopId(@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")@RequestParam("startTime") Date startTime,
-                                             @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")@RequestParam("endTime") Date endTime) {
-        OrderPayParam actualTotal = orderService.getPayUserCountByshopId(null,startTime,endTime);
+    public R<OrderPayParam> orderPayByShopId(@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @RequestParam("startTime") Date startTime,
+                                             @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @RequestParam("endTime") Date endTime) {
+        OrderPayParam actualTotal = orderService.getPayUserCountByshopId(null, startTime, endTime);
         return R.SUCCESS(actualTotal);
     }
 
@@ -108,15 +120,15 @@ public class OrderController {
         UserAddrOrder userAddrOrder = userAddrOrderService.getById(order.getAddrOrderId());
         order.setUserAddrOrder(userAddrOrder);
         List<OrderItem> orderItems = orderItemService.getOrderItemsByOrderNumber(orderNumber);
-        if (!orderItems.isEmpty()){
-            orderItems.forEach(c->{
+        if (!orderItems.isEmpty()) {
+            orderItems.forEach(c -> {
                 c.setRefundIngCount(orderItemService.refundIngCount(c.getOrderItemId()));
                 c.setRefundSuccessCount(orderItemService.refundSuccessCount(c.getOrderItemId()));
             });
         }
         order.setOrderItems(orderItems);
         User user = userService.getById(order.getUserId());
-        if (user!=null) {
+        if (user != null) {
             order.setNickName(user.getNickName());
             order.setUserMobile(user.getUserMobile());
         }
@@ -133,7 +145,7 @@ public class OrderController {
     @PreAuthorize("@pms.hasPermission('platform:order:exportExcel')")
     public void soldExcel(OrderParam orderParam, HttpServletResponse response) {
 //        orderParam.setIsPayed(1);
-        orderService.soldExcel(orderParam,response);
+        orderService.soldExcel(orderParam, response);
 //
     }
 
@@ -142,21 +154,20 @@ public class OrderController {
     @Transactional(rollbackFor = Exception.class)
     public R<Void> delivery(@RequestBody DeliveryOrderParam deliveryOrderParam) {
         Order order = orderService.getOne(new LambdaUpdateWrapper<Order>().eq(Order::getOrderNumber, deliveryOrderParam.getOrderNumber()));
-        if (!Objects.equals(order.getHbOrderStatus(), OrderStatus.PADYED.value()) && Objects.equals(order.getDvyType(), DvyType.FETCH.value())){
+        if (!Objects.equals(order.getHbOrderStatus(), OrderStatus.PADYED.value()) && Objects.equals(order.getDvyType(), DvyType.FETCH.value())) {
             throw new GlobalException("订单不处于待入库状态,无法进行入库");
-        }else if (!Objects.equals(order.getHbOrderStatus(), 1)){
+        } else if (!Objects.equals(order.getHbOrderStatus(), 1)) {
             throw new GlobalException("订单不处于待发货状态,无法进行发货");
         }
 
         List<OrderItem> orderItems = orderItemService.getOrderItemsByOrderNumber(deliveryOrderParam.getOrderNumber());
         if (!orderItems.isEmpty()) {
-            orderItems.forEach(orderItem->
-                    CullenUtils.validateDataThrowException(orderItemService.refundIngCount(orderItem.getOrderItemId())!=0,"该订单存在售后中商品,请处理后发货..."));
+            orderItems.forEach(orderItem ->
+                    CullenUtils.validateDataThrowException(orderItemService.refundIngCount(orderItem.getOrderItemId()) != 0, "该订单存在售后中商品,请处理后发货..."));
         }
 
-        //Delivery delivery = deliveryService.getById(deliveryOrderParam.getDvyId());
         Order orderParam = new Order();
-        if (deliveryOrderParam.getDvyType().equals(2)){
+        if (deliveryOrderParam.getDvyType().equals(2)) {
             orderParam.setOrderId(order.getOrderId());
             orderParam.setDvyType(2);
             orderService.updateById(orderParam);
@@ -164,7 +175,7 @@ public class OrderController {
         }
 
         orderParam.setOrderId(order.getOrderId());
-        if (!Objects.equals(order.getDvyType(), DvyType.FETCH.value()) || !Objects.equals(order.getDvyType(), DvyType.NOT_DELIVERY.value())){
+        if (!Objects.equals(order.getDvyType(), DvyType.FETCH.value()) || !Objects.equals(order.getDvyType(), DvyType.NOT_DELIVERY.value())) {
             orderParam.setDvyId(deliveryOrderParam.getDvyId());
             orderParam.setDvyFlowId(deliveryOrderParam.getDvyFlowId());
         }
@@ -177,8 +188,21 @@ public class OrderController {
 
         for (OrderItem orderItem : orderItems) {
             productService.removeProductCacheByProdId(orderItem.getProdId());
-            skuService.removeSkuCacheBySkuId(orderItem.getSkuId(),orderItem.getProdId());
+            skuService.removeSkuCacheBySkuId(orderItem.getSkuId(), orderItem.getProdId());
         }
+
+        OrderSettlement settlement = orderSettlementService.getOne(new LambdaQueryWrapper<OrderSettlement>().eq(OrderSettlement::getOrderNumber, deliveryOrderParam.getOrderNumber()));
+        UserAddrOrder userAddrOrder = userAddrOrderService.getById(order.getAddrOrderId());
+        AppConnect connect = appConnectMapper.getByUserId(order.getUserId(), 1);
+        Delivery delivery = deliveryService.getById(deliveryOrderParam.getDvyId());
+        WxProviderServiceImpl.uploadShippingInfo(
+                deliveryOrderParam.getDvyFlowId(),
+                settlement.getBizPayNo(),
+                toOrderStr(orderItems),
+                userAddrOrder.getMobile(),
+                connect.getBizUserId(),
+                delivery.getDvyNo(), 1
+        );
         return R.SUCCESS();
     }
 
@@ -202,4 +226,13 @@ public class OrderController {
         return R.SUCCESS(orderCount);
     }
 
+    public static String toOrderStr(List<OrderItem> items) {
+        if (items == null || items.isEmpty()) {
+            return "";
+        }
+        return items.stream()
+                .map(item -> item.getProdName() + "*" + item.getProdCount())
+                .collect(Collectors.joining(" "));
+    }
+
 }

+ 1 - 1
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderRefundServiceImpl.java

@@ -278,7 +278,7 @@ public class OrderRefundServiceImpl extends ServiceImpl<OrderRefundMapper, Order
         if (Objects.equals(refundType, RefundType.ALL.value())) {
             order.setRefundStatus(RefundStatusEnum.APPLY.value());
         } else {
-            order.setRefundStatus(RefundStatusEnum.PARTIAL_SUCCESS.value());
+            order.setRefundStatus(RefundStatusEnum.APPLY.value());
         }
         orderService.updateById(order);
         return orderRefund;

+ 39 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/BankAccountInfo.java

@@ -0,0 +1,39 @@
+package com.yami.shop.wx.form;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "结算银行账户")
+public class BankAccountInfo {
+
+    @SerializedName("bank_account_type")
+    @ApiModelProperty(value = "账户类型 BANK_ACCOUNT_TYPE_CORPORATE-对公银行账户 BANK_ACCOUNT_TYPE_PERSONAL- 经营者个人银行卡")
+    public String bankAccountType;
+
+    @SerializedName("account_name")
+    @ApiModelProperty(value = "开户名称")
+    public String accountName;
+
+    @SerializedName("account_bank")
+    @ApiModelProperty(value = "开户银行")
+    public String accountBank;
+
+    @SerializedName("bank_address_code")
+    @ApiModelProperty(value = "开户银行省市编码")
+    public String bankAddressCode;
+
+    @SerializedName("bank_branch_id")
+    @ApiModelProperty(value = "开户银行银行号")
+    public String bankBranchId;
+
+    @SerializedName("bank_name")
+    @ApiModelProperty(value = "开户银行全称(含支行)")
+    public String bankName;
+
+    @SerializedName("account_number")
+    @ApiModelProperty(value = "银行账号")
+    public String accountNumber;
+}

+ 23 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/BusinessInfo.java

@@ -0,0 +1,23 @@
+package com.yami.shop.wx.form;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "经营资料")
+public class BusinessInfo {
+
+    @SerializedName("merchant_shortname")
+    @ApiModelProperty(value = "商户简称")
+    public String merchantShortname;
+
+    @SerializedName("service_phone")
+    @ApiModelProperty(value = "客服电话")
+    public String servicePhone;
+
+    @SerializedName("sales_info")
+    @ApiModelProperty(value = "经营场景")
+    public SalesInfo salesInfo;
+}

+ 39 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/BusinessLicense.java

@@ -0,0 +1,39 @@
+package com.yami.shop.wx.form;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+@Data
+@ApiModel(value = "营业执照")
+public class BusinessLicense {
+    @SerializedName("license_copy")
+    @ApiModelProperty(value = "营业执照照片")
+    public String licenseCopy;
+
+    @SerializedName("license_number")
+    @ApiModelProperty(value = "注册号/统一社会信用代码")
+    public String licenseNumber;
+
+    @SerializedName("merchant_name")
+    @ApiModelProperty(value = "商户名称")
+    public String merchantName;
+
+    @SerializedName("legal_person")
+    @ApiModelProperty(value = "个体户经营者/法定代表人姓名")
+    public String legalPerson;
+
+    @SerializedName("license_address")
+    @ApiModelProperty(value = "注册地址")
+    public String licenseAddress;
+
+    @SerializedName("period_begin")
+    @ApiModelProperty(value = "有效期限开始日期")
+    public String periodBegin;
+
+    @SerializedName("period_end")
+    @ApiModelProperty(value = "有效期限结束日期")
+    public String periodEnd;
+}

+ 8 - 3
yami-shop-wx/src/main/java/com/yami/shop/wx/po/ContactInfoDto.java → yami-shop-wx/src/main/java/com/yami/shop/wx/form/ContactInfo.java

@@ -1,5 +1,6 @@
-package com.yami.shop.wx.po;
+package com.yami.shop.wx.form;
 
+import com.google.gson.annotations.SerializedName;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -9,17 +10,21 @@ import lombok.Data;
  */
 @Data
 @ApiModel(value = "超级管理员信息")
-public class ContactInfoDto {
+public class ContactInfo {
 
-    @ApiModelProperty(value = "超级管理员类型 1.LEGAL-经营者/法定代表人  2.SUPER-经办人")
+    @SerializedName("contact_type")
+    @ApiModelProperty(value = "超级管理员类型 LEGAL-经营者/法定代表人")
     private String contactType;
 
+    @SerializedName("contact_name")
     @ApiModelProperty(value = "超级管理员姓名-需加密")
     private String contactName;
 
+    @SerializedName("mobile_phone")
     @ApiModelProperty(value = "联系手机-需加密")
     private String mobilePhone;
 
+    @SerializedName("contact_email")
     @ApiModelProperty(value = "联系邮箱-需加密")
     private String contactEmail;
 

+ 38 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/IdCardInfo.java

@@ -0,0 +1,38 @@
+package com.yami.shop.wx.form;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "身份证信息")
+public class IdCardInfo {
+    @SerializedName("id_card_copy")
+    @ApiModelProperty(value = "身份证人像面照片")
+    public String idCardCopy;
+
+    @SerializedName("id_card_national")
+    @ApiModelProperty(value = "身份证国徽面照片")
+    public String idCardNational;
+
+    @SerializedName("id_card_name")
+    @ApiModelProperty(value = "身份证姓名")
+    public String idCardName;
+
+    @SerializedName("id_card_number")
+    @ApiModelProperty(value = "身份证号码")
+    public String idCardNumber;
+
+    @SerializedName("id_card_address")
+    @ApiModelProperty(value = "身份证居住地址-主体类型为企业时,需要填写。其他主体类型,无需上传")
+    public String idCardAddress;
+
+    @SerializedName("card_period_begin")
+    @ApiModelProperty(value = "身份证有效期开始时间")
+    public String cardPeriodBegin;
+
+    @SerializedName("card_period_end")
+    @ApiModelProperty(value = "身份证有效期结束时间")
+    public String cardPeriodEnd;
+}

+ 19 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/IdentityInfo.java

@@ -0,0 +1,19 @@
+package com.yami.shop.wx.form;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "经营者/法定代表人身份证件")
+public class IdentityInfo {
+
+    @SerializedName("id_doc_type")
+    @ApiModelProperty(value = "IDENTIFICATION_TYPE_IDCARD-中国大陆居民-身份证")
+    public String idDocType;
+
+    @SerializedName("id_card_info")
+    @ApiModelProperty(value = "身份证信息")
+    public IdCardInfo idCardInfo;
+}

+ 24 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/MiniProgramInfo.java

@@ -0,0 +1,24 @@
+package com.yami.shop.wx.form;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@ApiModel(value = "小程序场景")
+public class MiniProgramInfo {
+    @SerializedName("mini_program_appid")
+    @ApiModelProperty(value = "服务商小程序AppID")
+    public String miniProgramAppid;
+
+    @SerializedName("mini_program_sub_appid")
+    @ApiModelProperty(value = "商家小程序AppID")
+    public String miniProgramSubAppid;
+
+    @SerializedName("mini_program_pics")
+    @ApiModelProperty(value = "小程序截图")
+    public List<String> miniProgramPics;
+}

+ 25 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/SalesInfo.java

@@ -0,0 +1,25 @@
+package com.yami.shop.wx.form;
+
+import com.google.common.collect.Lists;
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@ApiModel(value = "经营场景")
+public class SalesInfo {
+    @SerializedName("sales_scenes_type")
+    @ApiModelProperty(value = "经营场景类型")
+    public List<String> salesScenesType = Lists.newArrayList("SALES_SCENES_STORE","SALES_SCENES_MINI_PROGRAM");
+
+    @SerializedName("biz_store_info")
+    @ApiModelProperty(value = "线下场所场景")
+    public StoreInfo bizStoreInfo;
+
+    @SerializedName("mini_program_info")
+    @ApiModelProperty(value = "小程序场景")
+    public MiniProgramInfo miniProgramInfo;
+}

+ 20 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/SettlementInfo.java

@@ -0,0 +1,20 @@
+package com.yami.shop.wx.form;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "结算规则")
+public class SettlementInfo {
+
+    @SerializedName("settlement_id")
+    @ApiModelProperty(value = "入驻结算规则ID")
+    public String settlementId;
+
+    @SerializedName("qualification_type")
+    @ApiModelProperty(value = "所属行业-填写指定行业名称")
+    public String qualificationType;
+
+}

+ 37 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/StoreInfo.java

@@ -0,0 +1,37 @@
+package com.yami.shop.wx.form;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@ApiModel(value = "线下场所场景")
+public class StoreInfo {
+
+    @SerializedName("biz_store_name")
+    @ApiModelProperty(value = "线下场所名称")
+    public String bizStoreName;
+
+    @SerializedName("biz_address_code")
+    @ApiModelProperty(value = "线下场所省市编码")
+    public String bizAddressCode;
+
+    @SerializedName("biz_store_address")
+    @ApiModelProperty(value = "线下场所地址")
+    public String bizStoreAddress;
+
+    @SerializedName("store_entrance_pic")
+    @ApiModelProperty(value = "线下场所门头照片")
+    public List<String> storeEntrancePic;
+
+    @SerializedName("indoor_pic")
+    @ApiModelProperty(value = "线下场所内部照片")
+    public List<String> indoorPic;
+
+    @SerializedName("biz_sub_appid")
+    @ApiModelProperty(value = "线下场所对应的商家AppID")
+    public String bizSubAppid;
+}

+ 34 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/SubjectInfo.java

@@ -0,0 +1,34 @@
+package com.yami.shop.wx.form;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@ApiModel(value = "主体资料")
+public class SubjectInfo {
+
+    @SerializedName("subject_type")
+    @ApiModelProperty(value = "主体类型 SUBJECT_TYPE_INDIVIDUAL-个体户 SUBJECT_TYPE_ENTERPRISE-企业")
+    public String subjectType;
+
+    @SerializedName("finance_institution")
+    @ApiModelProperty(value = "是否金融机构")
+    public Boolean financeInstitution;
+
+    @SerializedName("business_license_info")
+    @ApiModelProperty(value = "营业执照")
+    public BusinessLicense businessLicenseInfo;
+
+    @SerializedName("identity_info")
+    @ApiModelProperty(value = "经营者/法定代表人身份证件")
+    public IdentityInfo identityInfo;
+
+    @SerializedName("ubo_info_list")
+    @ApiModelProperty(value = "最终受益人信息列表(UBO) 主体类型为企业时,需填写")
+    public List<UBOInfoList> uboInfoList;
+
+}

+ 39 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/SubmitInfo.java

@@ -0,0 +1,39 @@
+package com.yami.shop.wx.form;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author kaur
+ */
+@Data
+@ApiModel(value = "超级管理员信息")
+public class SubmitInfo {
+
+    @SerializedName("business_code")
+    @ApiModelProperty(value = "业务申请编号")
+    public String businessCode;
+
+    @SerializedName("contact_info")
+    @ApiModelProperty(value = "超级管理员信息")
+    public ContactInfo contactInfo;
+
+    @SerializedName("subject_info")
+    @ApiModelProperty(value = "主体资料")
+    public SubjectInfo subjectInfo;
+
+    @SerializedName("business_info")
+    @ApiModelProperty(value = "经营资料")
+    public BusinessInfo businessInfo;
+
+    @SerializedName("settlement_info")
+    @ApiModelProperty(value = "结算规则")
+    public SettlementInfo settlementInfo;
+
+    @SerializedName("bank_account_info")
+    @ApiModelProperty(value = "结算银行账户")
+    public BankAccountInfo bankAccountInfo;
+
+}

+ 48 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/SubmitInfoForm.java

@@ -0,0 +1,48 @@
+package com.yami.shop.wx.form;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author kaur
+ */
+@Data
+@ApiModel(value = "提交")
+public class SubmitInfoForm {
+
+    @ApiModelProperty(value = "超级管理员姓名-需加密")
+    private String contactName;
+
+    @ApiModelProperty(value = "联系手机-需加密")
+    private String mobilePhone;
+
+    @ApiModelProperty(value = "联系邮箱-需加密")
+    private String contactEmail;
+
+    @ApiModelProperty(value = "主体类型 SUBJECT_TYPE_INDIVIDUAL-个体户 SUBJECT_TYPE_ENTERPRISE-企业")
+    public String subjectType;
+
+    @ApiModelProperty(value = "营业执照照片")
+    public String licenseCopy;
+
+    @ApiModelProperty(value = "注册号/统一社会信用代码")
+    public String licenseNumber;
+
+    @ApiModelProperty(value = "商户名称")
+    public String merchantName;
+
+    @ApiModelProperty(value = "个体户经营者/法定代表人姓名")
+    public String legalPerson;
+
+    @ApiModelProperty(value = "注册地址")
+    public String licenseAddress;
+
+    @ApiModelProperty(value = "有效期限开始日期")
+    public String periodBegin;
+
+    @ApiModelProperty(value = "有效期限结束日期")
+    public String periodEnd;
+
+}

+ 42 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/form/UBOInfoList.java

@@ -0,0 +1,42 @@
+package com.yami.shop.wx.form;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "最终受益人信息列表(UBO) 主体类型为企业时,需填写")
+public class UBOInfoList {
+    @SerializedName("ubo_id_doc_type")
+    @ApiModelProperty(value = "IDENTIFICATION_TYPE_IDCARD- 中国大陆居民-身份证")
+    public String uboIdDocType;
+
+    @SerializedName("ubo_id_doc_copy")
+    @ApiModelProperty(value = "证件正面照片")
+    public String uboIdDocCopy;
+
+    @SerializedName("ubo_id_doc_copy_back")
+    @ApiModelProperty(value = "证件反面照片")
+    public String uboIdDocCopyBack;
+
+    @SerializedName("ubo_id_doc_name")
+    @ApiModelProperty(value = "证件姓名")
+    public String uboIdDocName;
+
+    @SerializedName("ubo_id_doc_number")
+    @ApiModelProperty(value = "证件号码")
+    public String uboIdDocNumber;
+
+    @SerializedName("ubo_id_doc_address")
+    @ApiModelProperty(value = "证件居住地址")
+    public String uboIdDocAddress;
+
+    @SerializedName("ubo_period_begin")
+    @ApiModelProperty(value = "证件有效期开始时间")
+    public String uboPeriodBegin;
+
+    @SerializedName("ubo_period_end")
+    @ApiModelProperty(value = "证件有效期结束时间")
+    public String uboPeriodEnd;
+}

+ 0 - 21
yami-shop-wx/src/main/java/com/yami/shop/wx/po/SubjectInfoDto.java

@@ -1,21 +0,0 @@
-package com.yami.shop.wx.po;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-/**
- * @author kaur
- */
-@Data
-@ApiModel(value = "主体资料")
-public class SubjectInfoDto {
-
-    @ApiModelProperty(value = "主体类型 1.SUBJECT_TYPE_INDIVIDUAL-(个体户) " +
-            "2.SUBJECT_TYPE_ENTERPRISE-(企业)" +
-            "3.SUBJECT_TYPE_GOVERNMENT-(政府机关)" +
-            "4.SUBJECT_TYPE_INSTITUTIONS-(事业单位)" +
-            "5.SUBJECT_TYPE_OTHERS-(社会组织)")
-    private String subjectType;
-
-}

+ 39 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/po/TraceWaybill.java

@@ -0,0 +1,39 @@
+package com.yami.shop.wx.po;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author kaur
+ */
+@Data
+@ApiModel(value = "trace_waybill")
+public class TraceWaybill {
+
+    @ApiModelProperty(value = "openid")
+    @SerializedName("openid")
+    private String openid;
+
+    @ApiModelProperty(value = "收件人手机号")
+    @SerializedName("receiver_phone")
+    private String receiverPhone;
+
+    @ApiModelProperty(value = "运力id SF")
+    @SerializedName("delivery_id")
+    private String deliveryId;
+
+    @ApiModelProperty(value = "运单号")
+    @SerializedName("waybill_id")
+    private String waybillId;
+
+    @ApiModelProperty(value = "商品信息")
+    @SerializedName("goods_info")
+    private TraceWaybillDetail goodsInfo;
+
+    @ApiModelProperty(value = "交易单号")
+    @SerializedName("trans_id")
+    private String transId;
+
+}

+ 25 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/po/TraceWaybillDetail.java

@@ -0,0 +1,25 @@
+package com.yami.shop.wx.po;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * @author kaur
+ */
+@Data
+@ApiModel(value = "TraceWaybillDetailList")
+@NoArgsConstructor
+@AllArgsConstructor
+public class TraceWaybillDetail {
+
+    @ApiModelProperty(value = "商品信息")
+    @SerializedName("detail_list")
+    private List<TraceWaybillGoodsInfo> detailList;
+
+}

+ 27 - 0
yami-shop-wx/src/main/java/com/yami/shop/wx/po/TraceWaybillGoodsInfo.java

@@ -0,0 +1,27 @@
+package com.yami.shop.wx.po;
+
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author kaur
+ */
+@Data
+@ApiModel(value = "TraceWaybillGoodsInfo")
+@AllArgsConstructor
+@NoArgsConstructor
+public class TraceWaybillGoodsInfo {
+
+    @ApiModelProperty(value = "goods_name")
+    @SerializedName("goods_name")
+    private String goodsName;
+
+    @ApiModelProperty(value = "goods_img_url")
+    @SerializedName("goods_img_url")
+    private String goodsImgUrl;
+
+}

+ 133 - 21
yami-shop-wx/src/main/java/com/yami/shop/wx/service/impl/WxProviderServiceImpl.java

@@ -1,8 +1,11 @@
 package com.yami.shop.wx.service.impl;
+import com.yami.shop.wx.po.*;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.alibaba.fastjson2.TypeReference;
+import com.google.common.collect.Lists;
+import com.google.gson.Gson;
 import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
 import com.wechat.pay.contrib.apache.httpclient.auth.PrivateKeySigner;
 import com.wechat.pay.contrib.apache.httpclient.auth.Verifier;
@@ -13,12 +16,10 @@ import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
 import com.yami.shop.bean.bo.PayInfoBo;
 import com.yami.shop.wx.config.CombinePayUrlEnum;
 import com.yami.shop.wx.config.WechatPayServiceConfig;
-import com.yami.shop.wx.po.JsapiPayInfoPo;
-import com.yami.shop.wx.po.RefundInfoPo;
+import com.yami.shop.wx.config.WxConstants;
+import com.yami.shop.wx.form.*;
 import com.yami.shop.wx.service.WxProviderService;
-import com.yami.shop.wx.utils.DateUtils;
-import com.yami.shop.wx.utils.OrderUtils;
-import com.yami.shop.wx.utils.WechatPayValidator;
+import com.yami.shop.wx.utils.*;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.http.HttpEntity;
@@ -441,8 +442,9 @@ public class WxProviderServiceImpl implements WxProviderService {
      *                       2、同城配送 3、虚拟商品,虚拟商品,例如话费充值,点卡等,无实体配送形式 4、用户自提
      */
     public static void uploadShippingInfo(String trackingNo, String transactionId, String itemDesc,
-                                           String phone, String openid, String expressCompany, Integer type, String accessToken) {
-        String url = "https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?access_token=" + accessToken;
+                                           String phone, String openid, String expressCompany, Integer type) {
+        AccessToken accessToken = AccessTokenApi.getAccessToken(WxConstants.APPLET_APPID, WxConstants.APPLET_SECRET);
+        String url = "https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?access_token=" + accessToken.getToken();
         // 定义日期时间格式化对象
         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
         // 格式化日期时间
@@ -492,7 +494,6 @@ public class WxProviderServiceImpl implements WxProviderService {
             httpPost.addHeader("Content-Type", "application/json");
             StringEntity requestBody = new StringEntity(requestDataJson.toJSONString(), ContentType.APPLICATION_JSON);
             httpPost.setEntity(requestBody);
-
             CloseableHttpResponse response = httpClient.execute(httpPost);
             HttpEntity responseEntity = response.getEntity();
             String responseString = EntityUtils.toString(responseEntity);
@@ -504,28 +505,139 @@ public class WxProviderServiceImpl implements WxProviderService {
         }
     }
 
+
+    public static String traceWaybill(TraceWaybill traceWaybill) {
+        AccessToken accessToken = AccessTokenApi.getAccessToken(WxConstants.APPLET_APPID, WxConstants.APPLET_SECRET);
+        String url = "https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/trace_waybill?access_token=" + accessToken.getToken();
+        try {
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            HttpPost httpPost = new HttpPost(url);
+            httpPost.addHeader("Content-Type", "application/json");
+            StringEntity requestBody = new StringEntity(new Gson().toJson(traceWaybill),  ContentType.APPLICATION_JSON.withCharset("UTF-8"));
+            httpPost.setEntity(requestBody);
+            CloseableHttpResponse response = httpClient.execute(httpPost);
+            HttpEntity responseEntity = response.getEntity();
+            String responseString = EntityUtils.toString(responseEntity,"UTF-8");
+            log.info(responseString);
+            response.close();
+            httpClient.close();
+            return responseString;
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+
+
+
     //测试
-    public static void serviceAddMerchant() {
-        Map<String, Object> parameters = new TreeMap<>();
-        //业务申请编号
-        parameters.put("business_code", "业务申请编号");
+    public static void serviceAddMerchant(SubmitInfoForm form) {
+        SubmitInfo submitInfo = new SubmitInfo();
+        submitInfo.setBusinessCode("业务申请编号");
 
         //超级管理员信息
-        parameters.put("contact_info", "");
+        ContactInfo contactInfo = new ContactInfo();
+        contactInfo.setContactType("LEGAL");
+        contactInfo.setContactName(rsaEncryptData(form.getContactName()));
+        contactInfo.setMobilePhone(rsaEncryptData(form.getMobilePhone()));
+        contactInfo.setContactEmail(rsaEncryptData(form.getContactEmail()));
+        submitInfo.setContactInfo(contactInfo);
 
         //主体资料
-        parameters.put("subject_info", "");
+        SubjectInfo subjectInfo = new SubjectInfo();
+        subjectInfo.setSubjectType(form.getSubjectType());
+        subjectInfo.setFinanceInstitution(false);
+
+        //营业执照
+        BusinessLicense businessLicense = new BusinessLicense();
+        businessLicense.setLicenseCopy(wxUploadImg(form.getLicenseCopy()));
+        businessLicense.setLicenseNumber(form.getLicenseNumber());
+        businessLicense.setMerchantName(form.getMerchantName());
+        businessLicense.setLegalPerson(form.getLegalPerson());
+        businessLicense.setLicenseAddress(form.getLicenseAddress());
+        businessLicense.setPeriodBegin(form.getPeriodBegin());
+        businessLicense.setPeriodEnd(form.getPeriodEnd());
+        subjectInfo.setBusinessLicenseInfo(businessLicense);
+
+        //经营者/法定代表人身份证件
+        IdentityInfo identityInfo = new IdentityInfo();
+        identityInfo.setIdDocType("IDENTIFICATION_TYPE_IDCARD");
+
+        //身份证信息
+        IdCardInfo idCardInfo = new IdCardInfo();
+        idCardInfo.setIdCardCopy("身份证人像面照片");
+        idCardInfo.setIdCardNational("身份证国徽面照片");
+        idCardInfo.setIdCardName("身份证姓名");
+        idCardInfo.setIdCardNumber("身份证号码");
+        idCardInfo.setIdCardAddress("身份证居住地址-主体类型为企业时,需要填写。其他主体类型,无需上传");
+        idCardInfo.setCardPeriodBegin("身份证有效期开始时间");
+        idCardInfo.setCardPeriodEnd("身份证有效期结束时间");
+        identityInfo.setIdCardInfo(idCardInfo);
+        subjectInfo.setIdentityInfo(identityInfo);
+        List<UBOInfoList> uboInfoList = Lists.newArrayList();
+
+        //最终受益人信息列表(UBO) 主体类型为企业时,需填写
+        UBOInfoList uboInfo = new UBOInfoList();
+        uboInfo.setUboIdDocType("IDENTIFICATION_TYPE_IDCARD");
+        uboInfo.setUboIdDocCopy("证件正面照片");
+        uboInfo.setUboIdDocCopyBack("证件反面照片");
+        uboInfo.setUboIdDocName("证件姓名");
+        uboInfo.setUboIdDocNumber("证件号码");
+        uboInfo.setUboIdDocAddress("证件居住地址");
+        uboInfo.setUboPeriodBegin("证件有效期开始时间");
+        uboInfo.setUboPeriodEnd("证件有效期结束时间");
+        uboInfoList.add(uboInfo);
+        subjectInfo.setUboInfoList(uboInfoList);
+        submitInfo.setSubjectInfo(subjectInfo);
 
         //经营资料
-        parameters.put("business_info", "");
-
-        //结算规则
-        parameters.put("settlement_info", "");
+        BusinessInfo businessInfo = new BusinessInfo();
+        businessInfo.setMerchantShortname("商户简称");
+        businessInfo.setServicePhone("客服电话");
+        SalesInfo salesInfo = new SalesInfo();
+        StoreInfo storeInfo = new StoreInfo();
+        storeInfo.setBizStoreName("线下场所名称");
+        storeInfo.setBizAddressCode("线下场所省市编码");
+        storeInfo.setBizStoreAddress("线下场所地址");
+        storeInfo.setStoreEntrancePic(Lists.newArrayList("线下场所门头照片"));
+        storeInfo.setIndoorPic(Lists.newArrayList("线下场所内部照片"));
+        storeInfo.setBizSubAppid("线下场所对应的商家AppID");
+        salesInfo.setBizStoreInfo(storeInfo);
+        MiniProgramInfo miniProgramInfo = new MiniProgramInfo();
+        miniProgramInfo.setMiniProgramAppid("服务商小程序AppID");
+        miniProgramInfo.setMiniProgramSubAppid("商家小程序AppID");
+        miniProgramInfo.setMiniProgramPics(Lists.newArrayList("小程序截图"));
+        salesInfo.setMiniProgramInfo(miniProgramInfo);
+        businessInfo.setSalesInfo(salesInfo);
+        submitInfo.setBusinessInfo(businessInfo);
+
+        SettlementInfo settlementInfo = new SettlementInfo();
+        settlementInfo.setSettlementId("入驻结算规则ID");
+        settlementInfo.setQualificationType("所属行业-填写指定行业名称");
+        submitInfo.setSettlementInfo(settlementInfo);
+
+        BankAccountInfo bankAccountInfo = new BankAccountInfo();
+        bankAccountInfo.setBankAccountType("对公银行账户/经营者个人银行卡");
+        bankAccountInfo.setAccountName("开户名称");
+        bankAccountInfo.setAccountBank("开户银行");
+        bankAccountInfo.setBankAddressCode("开户银行省市编码");
+        bankAccountInfo.setBankBranchId("开户银行银行号");
+        bankAccountInfo.setBankName("开户银行全称(含支行)");
+        bankAccountInfo.setAccountNumber("银行账号");
+        submitInfo.setBankAccountInfo(bankAccountInfo);
+        Gson gson = new Gson();
+        String json = gson.toJson(submitInfo);
+        System.out.println(json);
+    }
 
-        //结算银行账户
-        parameters.put("bank_account_info", "");
+    private static String rsaEncryptData(String data) {
+        return data;
+    }
 
-        System.out.println(parameters);
+    private static String wxUploadImg(String data) {
+        return data;
     }
 
+    public static void main(String[] args) {
+    }
 }