igl hai 3 meses
pai
achega
fa7fc4bce1
Modificáronse 16 ficheiros con 434 adicións e 23 borrados
  1. 7 9
      vehicle-client/src/main/java/com/chelvc/cloud/vehicle/client/MerchantClient.java
  2. 10 0
      vehicle-client/src/main/java/com/chelvc/cloud/vehicle/client/constant/TradeConstant.java
  3. 70 0
      vehicle-client/src/main/java/com/chelvc/cloud/vehicle/client/param/MerchantApplyRecordParam.java
  4. 10 9
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/controller/MerchantController.java
  5. 10 0
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/dao/MerchantApplyRecordMapper.java
  6. 2 0
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/dao/RegionMapper.java
  7. 111 0
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/entity/MerchantApplyRecord.java
  8. 12 0
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/MerchantApplyRecordService.java
  9. 5 0
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/MerchantRelationService.java
  10. 2 0
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/MerchantService.java
  11. 6 0
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/RegionService.java
  12. 46 0
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/MerchantApplyRecordServiceImpl.java
  13. 5 0
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/MerchantAuthServiceImpl.java
  14. 110 1
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/MerchantRelationServiceImpl.java
  15. 8 4
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/MerchantServiceImpl.java
  16. 20 0
      vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/RegionServiceImpl.java

+ 7 - 9
vehicle-client/src/main/java/com/chelvc/cloud/vehicle/client/MerchantClient.java

@@ -7,15 +7,7 @@ import com.chelvc.cloud.vehicle.client.constant.MerchantStatus;
 import com.chelvc.cloud.vehicle.client.dto.MerchantDTO;
 import com.chelvc.cloud.vehicle.client.dto.MerchantDetailDTO;
 import com.chelvc.cloud.vehicle.client.dto.MerchantRankDTO;
-import com.chelvc.cloud.vehicle.client.param.LocationQueryPagingParam;
-import com.chelvc.cloud.vehicle.client.param.LocationQueryParam;
-import com.chelvc.cloud.vehicle.client.param.MerchantModifyParam;
-import com.chelvc.cloud.vehicle.client.param.MerchantPagingParam;
-import com.chelvc.cloud.vehicle.client.param.MerchantQueryParam;
-import com.chelvc.cloud.vehicle.client.param.MerchantQueryParamPaging;
-import com.chelvc.cloud.vehicle.client.param.MerchantRankParam;
-import com.chelvc.cloud.vehicle.client.param.OmsCartItemPagingParam;
-import com.chelvc.cloud.vehicle.client.param.ReportModifyParam;
+import com.chelvc.cloud.vehicle.client.param.*;
 import com.chelvc.framework.common.model.Pagination;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.cloud.openfeign.SpringQueryMap;
@@ -234,6 +226,12 @@ public interface MerchantClient {
     @GetMapping("/merchant/getMerchantReportCount")
     Map<String, Object> getMerchantReportCount(@SpringQueryMap ReportModifyParam param);
 
+    /**
+     * 子商户入网回调接口
+     *
+     */
+    @PostMapping("/merchant/apply/notify")
+    void merchantApplyNotify(@RequestBody MerchantApplyRecordParam param);
 }
 
 

+ 10 - 0
vehicle-client/src/main/java/com/chelvc/cloud/vehicle/client/constant/TradeConstant.java

@@ -16,4 +16,14 @@ public interface TradeConstant {
      * 提现回调通知地址
      */
     static final String WITHDRAW_NOTIFY_URL = "https://demo.5upay.com/sdk/onlinepay/notify";
+
+    /**
+     * 商户入网回调地址
+     */
+    static final String MERCHANT_NET_IN_NOTIFY_URL = "https://apis.5upay.com/wallet/withdraw";
+
+    /**
+     * 被分账方入网
+     */
+    static final String DECLARE_URL = "https://apis.5upay.com/serviceprovider/declaration/declare";
 }

+ 70 - 0
vehicle-client/src/main/java/com/chelvc/cloud/vehicle/client/param/MerchantApplyRecordParam.java

@@ -0,0 +1,70 @@
+package com.chelvc.cloud.vehicle.client.param;
+
+import lombok.Data;
+import java.io.Serializable;
+
+@Data
+public class MerchantApplyRecordParam implements Serializable {
+
+    private static final long serialVersionUID = -2573234532369937880L;
+
+    private String merchantId;
+
+    /**
+     * 请求号
+     */
+    private String requestId;
+
+    /**
+     * 子商户审核状态
+     * PROCESSING 审核中(ocr校验失败时返回该状态,子商户审核备注信息中可查看详情)
+     * PASS 审核通过
+     * NO_PASS 审核不通过
+     * REFUSE 审核拒绝
+     * ESIGN_PROCESS 待签约
+     * ESIGN_PROCESSING 签约中
+     * ESIGN_FAIL 签约失败(电子签签约状态)
+     * ESIGN_SUCCESS 签约成功(电子签签约状态)
+     * SUCCESS 入网完成
+     */
+    private String subMerchantReviewStatus;
+
+    /**
+     * 审核备注
+     */
+    private String subMerchantReviewRemarks;
+
+    /**
+     * 子商户编号
+     */
+    private String subMerchantId;
+
+    /**
+     * 电子签约链接
+     */
+    private String electronicContractingUrl;
+
+    /**
+     * 核查状态
+     * INIT 初始化
+     * SUCCESS 核查通过
+     * FAIL 核查不通过
+     * COMPLEMENT 核查补充
+     */
+    private String postReviewStatus;
+
+    /**
+     * 核查补充链接
+     */
+    private String certificateSupplementUrl;
+
+    /**
+     * 	核查备注
+     */
+    private String postReviewRemark;
+
+    /**
+     * 签名
+     */
+    private String hmac;
+}

+ 10 - 9
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/controller/MerchantController.java

@@ -7,15 +7,7 @@ import com.chelvc.cloud.vehicle.client.constant.MerchantStatus;
 import com.chelvc.cloud.vehicle.client.dto.MerchantDTO;
 import com.chelvc.cloud.vehicle.client.dto.MerchantDetailDTO;
 import com.chelvc.cloud.vehicle.client.dto.MerchantRankDTO;
-import com.chelvc.cloud.vehicle.client.param.LocationQueryPagingParam;
-import com.chelvc.cloud.vehicle.client.param.LocationQueryParam;
-import com.chelvc.cloud.vehicle.client.param.MerchantModifyParam;
-import com.chelvc.cloud.vehicle.client.param.MerchantPagingParam;
-import com.chelvc.cloud.vehicle.client.param.MerchantQueryParam;
-import com.chelvc.cloud.vehicle.client.param.MerchantQueryParamPaging;
-import com.chelvc.cloud.vehicle.client.param.MerchantRankParam;
-import com.chelvc.cloud.vehicle.client.param.OmsCartItemPagingParam;
-import com.chelvc.cloud.vehicle.client.param.ReportModifyParam;
+import com.chelvc.cloud.vehicle.client.param.*;
 import com.chelvc.cloud.vehicle.server.service.MerchantService;
 import com.chelvc.framework.common.model.Pagination;
 import lombok.RequiredArgsConstructor;
@@ -287,6 +279,15 @@ public class MerchantController {
     public Map<String, Object> getMerchantReportCount(ReportModifyParam param) {
         return merchantService.getMerchantReportCount(param);
     }
+
+    /**
+     * 子商户入网回调接口
+     *
+     */
+    @PostMapping("/merchant/apply/notify")
+    public void merchantApplyNotify(@RequestBody MerchantApplyRecordParam param) {
+        merchantService.merchantApplyNotify(param);
+    }
 }
 
 

+ 10 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/dao/MerchantApplyRecordMapper.java

@@ -0,0 +1,10 @@
+package com.chelvc.cloud.vehicle.server.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.chelvc.cloud.vehicle.server.entity.MerchantApplyRecord;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface MerchantApplyRecordMapper extends BaseMapper<MerchantApplyRecord> {
+
+}

+ 2 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/dao/RegionMapper.java

@@ -21,4 +21,6 @@ public interface RegionMapper extends BaseMapper<Region> {
     List<Integer> queryPageIdsByLevel(Integer level, int pageNum, int pageSize);
 
     List<RegionDTO> getRegionByLevel(@Param("level")Integer level);
+    @Select("select name from region where id = #{id}")
+    String getRegionNameById(@Param("id")Integer id);
 }

+ 111 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/entity/MerchantApplyRecord.java

@@ -0,0 +1,111 @@
+package com.chelvc.cloud.vehicle.server.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.chelvc.framework.database.entity.Entity;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+@Data
+@SuperBuilder
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString(callSuper = true)
+@TableName(autoResultMap = true)
+public class MerchantApplyRecord implements Entity<Long> {
+
+    private static final long serialVersionUID = -2573290632369937880L;
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.ASSIGN_ID)
+    private Long id;
+
+    private Long userId;
+
+    /**
+     * 类型:1-用户;2-商家
+     */
+    private Integer type;
+
+    /**
+     * 申请状态:0-申请中;1-成功;2-失败
+     */
+    private Integer status;
+
+    /**
+     * 请求号
+     */
+    private String requestId;
+
+    /**
+     * 操作类型:CREATE 创建;MODIFY 更新
+     */
+    private String operationType;
+
+    /**
+     * 子商户审核状态
+     * PROCESSING 审核中(ocr校验失败时返回该状态,子商户审核备注信息中可查看详情)
+     * PASS 审核通过
+     * NO_PASS 审核不通过
+     * REFUSE 审核拒绝
+     * ESIGN_PROCESS 待签约
+     * ESIGN_PROCESSING 签约中
+     * ESIGN_FAIL 签约失败(电子签签约状态)
+     * ESIGN_SUCCESS 签约成功(电子签签约状态)
+     * SUCCESS 入网完成
+     */
+    private String examineStatus;
+
+    /**
+     * 子商户编号
+     */
+    private String subMerchantId;
+
+    /**
+     * 审核备注
+     */
+    private String merchantReviewRemarks;
+
+    /**
+     * 电子签约链接
+     */
+    private String electronicContractingUrl;
+
+    /**
+     * 核查状态
+     * INIT 初始化
+     * SUCCESS 核查通过
+     * FAIL 核查不通过
+     * COMPLEMENT 核查补充
+     */
+    private String postReviewStatus;
+
+    /**
+     * 核查补充链接
+     */
+    private String certificateSupplementUrl;
+
+    /**
+     * 	核查备注
+     */
+    private String postReviewRemark;
+
+    /**
+     * 提现时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+}

+ 12 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/MerchantApplyRecordService.java

@@ -0,0 +1,12 @@
+package com.chelvc.cloud.vehicle.server.service;
+
+
+import com.chelvc.cloud.vehicle.client.param.MerchantApplyRecordParam;
+import com.chelvc.cloud.vehicle.server.entity.MerchantApplyRecord;
+
+public interface MerchantApplyRecordService {
+
+    int insert(MerchantApplyRecord record);
+
+    void updateByNotify(MerchantApplyRecordParam param);
+}

+ 5 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/MerchantRelationService.java

@@ -1,7 +1,12 @@
 package com.chelvc.cloud.vehicle.server.service;
 
+import com.chelvc.cloud.vehicle.server.entity.MerchantAuth;
 import com.chelvc.cloud.vehicle.server.entity.MerchantRelation;
 
 public interface MerchantRelationService {
     MerchantRelation queryByUserIdAndType(Long userId, Integer type);
+
+    void registerMerchantId(MerchantAuth merchantAuth);
+
+    int insert(Long userId, Integer type, String sxyMerchantId);
 }

+ 2 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/MerchantService.java

@@ -235,4 +235,6 @@ public interface MerchantService extends IService<Merchant> {
     Map<String,Object> getMerchantReportCount(ReportModifyParam param);
 
     MerchantDTO queryCheck(Long merchantId, Long userId);
+
+    void merchantApplyNotify(MerchantApplyRecordParam param);
 }

+ 6 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/RegionService.java

@@ -0,0 +1,6 @@
+package com.chelvc.cloud.vehicle.server.service;
+
+public interface RegionService {
+
+    String getRegionNameById(Integer id);
+}

+ 46 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/MerchantApplyRecordServiceImpl.java

@@ -0,0 +1,46 @@
+package com.chelvc.cloud.vehicle.server.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.chelvc.cloud.vehicle.client.param.MerchantApplyRecordParam;
+import com.chelvc.cloud.vehicle.server.dao.MerchantApplyRecordMapper;
+import com.chelvc.cloud.vehicle.server.entity.MerchantApplyRecord;
+import com.chelvc.cloud.vehicle.server.service.MerchantApplyRecordService;
+import com.chelvc.cloud.vehicle.server.service.MerchantRelationService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+@Service
+@RequiredArgsConstructor(onConstructor = @__(@Autowired))
+public class MerchantApplyRecordServiceImpl extends
+        ServiceImpl<MerchantApplyRecordMapper, MerchantApplyRecord> implements MerchantApplyRecordService {
+
+    private final MerchantRelationService merchantRelationService;
+
+    @Override
+    public int insert(MerchantApplyRecord record) {
+        return baseMapper.insert(record);
+    }
+
+    @Override
+    public void updateByNotify(MerchantApplyRecordParam param) {
+        String requestId = param.getRequestId();
+        LambdaQueryWrapper<MerchantApplyRecord> wrapper = Wrappers.lambdaQuery();
+        wrapper.eq(MerchantApplyRecord::getRequestId, requestId);
+        MerchantApplyRecord record = baseMapper.selectOne(wrapper);
+        record.setExamineStatus(param.getSubMerchantReviewStatus());
+        record.setCertificateSupplementUrl(param.getCertificateSupplementUrl());
+        record.setElectronicContractingUrl(param.getElectronicContractingUrl());
+        record.setMerchantReviewRemarks(param.getSubMerchantReviewRemarks());
+        record.setPostReviewRemark(param.getPostReviewRemark());
+        record.setPostReviewStatus(param.getPostReviewStatus());
+        record.setSubMerchantId(param.getSubMerchantId());
+        record.setUpdateTime(new Date());
+        baseMapper.updateById(record);
+        merchantRelationService.insert(record.getUserId(), record.getType(), param.getSubMerchantId());
+    }
+}

+ 5 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/MerchantAuthServiceImpl.java

@@ -16,6 +16,7 @@ import com.chelvc.cloud.vehicle.server.entity.Merchant;
 import com.chelvc.cloud.vehicle.server.entity.MerchantAuth;
 import com.chelvc.cloud.vehicle.server.service.CategoryService;
 import com.chelvc.cloud.vehicle.server.service.MerchantAuthService;
+import com.chelvc.cloud.vehicle.server.service.MerchantRelationService;
 import com.chelvc.cloud.vehicle.server.service.MerchantService;
 import com.chelvc.framework.base.context.SessionContextHolder;
 import com.chelvc.framework.common.model.Pagination;
@@ -48,6 +49,8 @@ public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, Mer
     private final UserClient userClient;
 
     private final CategoryService categoryService;
+
+    private final MerchantRelationService merchantRelationService;
     @Override
     public Long addMerchantAuth(@NonNull MerchantAuthModifyParam param) {
         Long userId = SessionContextHolder.getId();
@@ -186,6 +189,8 @@ public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, Mer
         this.updateById(merchantAuth);
         if (StringUtils.notEmpty(state) && "1".equals(state)){
             this.userClient.updateUserRole(merchantAuth.getApplicant());
+            //注册商家号
+            merchantRelationService.registerMerchantId(merchantAuth);
         }
     }
 }

+ 110 - 1
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/MerchantRelationServiceImpl.java

@@ -1,21 +1,33 @@
 package com.chelvc.cloud.vehicle.server.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.chelvc.cloud.vehicle.client.constant.TradeConstant;
 import com.chelvc.cloud.vehicle.server.dao.MerchantRelationMapper;
+import com.chelvc.cloud.vehicle.server.entity.Merchant;
+import com.chelvc.cloud.vehicle.server.entity.MerchantApplyRecord;
+import com.chelvc.cloud.vehicle.server.entity.MerchantAuth;
 import com.chelvc.cloud.vehicle.server.entity.MerchantRelation;
+import com.chelvc.cloud.vehicle.server.handle.TradeHandle;
+import com.chelvc.cloud.vehicle.server.service.MerchantApplyRecordService;
 import com.chelvc.cloud.vehicle.server.service.MerchantRelationService;
+import com.chelvc.cloud.vehicle.server.service.MerchantService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
+import java.util.UUID;
+
 @Service
 @RequiredArgsConstructor(onConstructor = @__({@Autowired,@Lazy}))
 public class MerchantRelationServiceImpl extends ServiceImpl<MerchantRelationMapper,
         MerchantRelation> implements MerchantRelationService {
-
+    private final MerchantService merchantService;
+    private final MerchantApplyRecordService merchantApplyRecordService;
     @Override
     public MerchantRelation queryByUserIdAndType(Long userId, Integer type) {
         LambdaQueryWrapper<MerchantRelation> wrapper = Wrappers.lambdaQuery();
@@ -23,4 +35,101 @@ public class MerchantRelationServiceImpl extends ServiceImpl<MerchantRelationMap
         wrapper.eq(MerchantRelation::getType, type);
         return baseMapper.selectOne(wrapper);
     }
+
+    @Override
+    public void registerMerchantId(MerchantAuth merchantAuth) {
+        Merchant merchant = merchantService.getById(merchantAuth.getId());
+        String requestId = UUID.randomUUID().toString().replaceAll("-", "");
+        JSONObject jsonObject = new JSONObject();
+        String operationType = "CREATE";
+        jsonObject.put("merchantId", TradeConstant.PARTNER_ID);
+        jsonObject.put("requestId", requestId);
+        jsonObject.put("operationType", operationType);
+        jsonObject.put("notifyUrl", TradeConstant.MERCHANT_NET_IN_NOTIFY_URL);
+        jsonObject.put("extendedParameters", "sendActiveEmail:FALSE,sendExpressPayMsg:FALSE");
+
+        //商户基本信息
+        JSONObject baseInfo = new JSONObject();
+        baseInfo.put("signedType", "BY_SPLIT_BILL");
+        baseInfo.put("signedName", merchantAuth.getLegalRepresentativeName());
+        baseInfo.put("registerRole", "INDIVIDUAL_BUSINESS"); //个体工商户
+        baseInfo.put("cerType", "INDIVIDUAL_BUSINESS_LICENCE "); //个体工商户营业执照
+        baseInfo.put("signedShorthand", merchantAuth.getStoreName());
+        baseInfo.put("businessAddressProvince", merchant.getProvince());
+        baseInfo.put("businessAddressCity", merchant.getCity());
+        baseInfo.put("businessAddressArea", merchant.getDistrict());
+        baseInfo.put("businessAddress", merchant.getAddress());
+        baseInfo.put("contactName", merchant.getLiaison());
+        baseInfo.put("contactEmail", merchantAuth.getEmail());
+        baseInfo.put("contactPhone", merchant.getMobile());
+        jsonObject.put("baseInfo", baseInfo);
+
+        //结算信息
+        JSONObject bankCardInfo = new JSONObject();
+        //bankCardInfo.put("bankName", ""); //开户行名称
+        //bankCardInfo.put("bankBranchName", ""); //支行名称
+        bankCardInfo.put("accountName", "");
+        bankCardInfo.put("bankCardNo", "");
+        bankCardInfo.put("accountType", "PRIVATE");
+        bankCardInfo.put("liquidationType", "WITHDRAW");
+        bankCardInfo.put("withdrawRateType", "SINGLE");
+        bankCardInfo.put("withdrawRate", "0.00");
+        bankCardInfo.put("reservedPhoneNo", ""); //银行预留手机号
+        jsonObject.put("bankCardInfo", bankCardInfo);
+
+        //商户资质信息
+        JSONObject certificateInfo = new JSONObject();
+        certificateInfo.put("legalPersonName", merchantAuth.getLegalRepresentativeName());
+        certificateInfo.put("legalPersonPhone", merchantAuth.getMobileNumber());
+        certificateInfo.put("legalPersonIdType", "IDCARD");
+        certificateInfo.put("legalPersonIdNo", merchantAuth.getIdCardNumber());
+        certificateInfo.put("idEffectiveDateStart", "");  //身份证号有效期开始
+        certificateInfo.put("idEffectiveDateEnd", merchantAuth.getIdCardExpirationDate());
+        certificateInfo.put("cerNo", merchantAuth.getBusinessLicenseId());
+        certificateInfo.put("sellingArea", "C");
+        certificateInfo.put("staffSize", "C");
+        certificateInfo.put("businessLicensePath", ""); //营业执照照片路径
+        certificateInfo.put("openAccountPath", "");  //	开户许可证照片路径
+        certificateInfo.put("legalIdCardProsPath", "");  //	法人证件人像面路径
+        certificateInfo.put("legalIdCardConsPath", "");  //	法人证件国徽面路径
+        certificateInfo.put("legalPersonBankCardPath", "");  //	法人银行卡图影印件路径
+        jsonObject.put("certificateInfo", certificateInfo);
+
+        //商户合同信息
+        JSONObject contractInfo = new JSONObject();
+        contractInfo.put("receiverName", merchant.getLiaison());
+        contractInfo.put("receiverPhone", merchant.getMobile());
+        contractInfo.put("receiverAddress", merchant.getAddress());
+        jsonObject.put("contractInfo", contractInfo);
+
+        JSONObject json = TradeHandle.handle(String.valueOf(jsonObject), TradeConstant.DECLARE_URL,
+                TradeConstant.PARTNER_ID, null);
+        String status = json.getString("status");
+        int recordStatus = 0;
+        if("SUCCESS".equals(status)){
+            recordStatus = 2;
+        } else {
+            recordStatus = 1;
+        }
+        String subMerchantId = json.getString("subMerchantId");
+        MerchantApplyRecord record = new MerchantApplyRecord();
+        record.setUserId(merchantAuth.getId());
+        record.setType(2);
+        record.setRequestId(requestId);
+        record.setStatus(recordStatus);
+        record.setOperationType("CREATE");
+        record.setExamineStatus("PROCESSING");
+        record.setSubMerchantId(subMerchantId);
+        record.setCreateTime(new Date());
+        merchantApplyRecordService.insert(record);
+    }
+
+    @Override
+    public int insert(Long userId, Integer type, String sxyMerchantId) {
+        MerchantRelation relation = new MerchantRelation();
+        relation.setType(type);
+        relation.setUserId(userId);
+        relation.setSxyMerchantId(sxyMerchantId);
+        return baseMapper.insert(relation);
+    }
 }

+ 8 - 4
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/MerchantServiceImpl.java

@@ -18,10 +18,7 @@ import com.chelvc.cloud.vehicle.server.dao.RegionMapper;
 import com.chelvc.cloud.vehicle.server.entity.Category;
 import com.chelvc.cloud.vehicle.server.entity.Merchant;
 import com.chelvc.cloud.vehicle.server.entity.Region;
-import com.chelvc.cloud.vehicle.server.service.CategoryService;
-import com.chelvc.cloud.vehicle.server.service.GoodsService;
-import com.chelvc.cloud.vehicle.server.service.MerchantService;
-import com.chelvc.cloud.vehicle.server.service.OmsCartItemService;
+import com.chelvc.cloud.vehicle.server.service.*;
 import com.chelvc.cloud.vehicle.server.task.DateUtil;
 import com.chelvc.framework.base.context.SessionContextHolder;
 import com.chelvc.framework.common.model.Pagination;
@@ -68,6 +65,8 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
 
     private final UserClient userService;
 
+    private final MerchantApplyRecordService merchantApplyRecordService;
+
     @Override
     public List<MerchantDTO> listNearbyMerchants(@NonNull LocationQueryParam param, int size) {
         List<MerchantDTO> list = this.baseMapper.listNearbyMerchants(param, size);
@@ -560,4 +559,9 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
         return this.baseMapper.queryCheck(merchantId, userId);
     }
 
+    @Override
+    public void merchantApplyNotify(MerchantApplyRecordParam param) {
+        merchantApplyRecordService.updateByNotify(param);
+    }
+
 }

+ 20 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/RegionServiceImpl.java

@@ -0,0 +1,20 @@
+package com.chelvc.cloud.vehicle.server.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.chelvc.cloud.vehicle.server.dao.RegionMapper;
+import com.chelvc.cloud.vehicle.server.entity.Region;
+import com.chelvc.cloud.vehicle.server.service.RegionService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+@RequiredArgsConstructor(onConstructor = @__(@Autowired))
+public class RegionServiceImpl extends
+        ServiceImpl<RegionMapper, Region> implements RegionService {
+
+    @Override
+    public String getRegionNameById(Integer id) {
+        return baseMapper.getRegionNameById(id);
+    }
+}