igl hai 3 meses
pai
achega
a2ec9607d8

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

@@ -51,4 +51,6 @@ public interface MerchantAuthService extends IService<MerchantAuth> {
      * @param state 0-拒绝 1-通过
      */
     void certificationAudit(Long id,String state,String message );
+
+    int updateStatus(Long userId, Integer status);
 }

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

@@ -9,6 +9,7 @@ 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.MerchantAuthService;
 import com.chelvc.cloud.vehicle.server.service.MerchantRelationService;
 import com.chelvc.cloud.vehicle.server.service.UserAuthService;
 import com.upay.sdk.Constants;
@@ -26,6 +27,7 @@ public class MerchantApplyRecordServiceImpl extends
 
     private final MerchantRelationService merchantRelationService;
     private final UserAuthService userAuthService;
+    private final MerchantAuthService merchantAuthService;
 
     @Override
     public int insert(MerchantApplyRecord record) {
@@ -65,6 +67,10 @@ public class MerchantApplyRecordServiceImpl extends
             //更改个人认证状态
             userAuthService.updateStatus(record.getUserId(), MerchantApplyStatus.getStatus(status));
         }
+        if(type == 2){
+            //更改个人认证状态
+            merchantAuthService.updateStatus(record.getUserId(), MerchantApplyStatus.getStatus(status));
+        }
         if("SUCCESS".equals(status)){
             merchantRelationService.insert(record.getUserId(), record.getType(), subMerchantId);
         }

+ 15 - 3
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/MerchantAuthServiceImpl.java

@@ -1,5 +1,7 @@
 package com.chelvc.cloud.vehicle.server.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.chelvc.cloud.user.client.UserClient;
@@ -14,6 +16,7 @@ import com.chelvc.cloud.vehicle.server.copier.MerchantAuthCopier;
 import com.chelvc.cloud.vehicle.server.dao.MerchantAuthMapper;
 import com.chelvc.cloud.vehicle.server.entity.Merchant;
 import com.chelvc.cloud.vehicle.server.entity.MerchantAuth;
+import com.chelvc.cloud.vehicle.server.entity.UserAuth;
 import com.chelvc.cloud.vehicle.server.service.CategoryService;
 import com.chelvc.cloud.vehicle.server.service.MerchantAuthService;
 import com.chelvc.cloud.vehicle.server.service.MerchantRelationService;
@@ -67,7 +70,7 @@ public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, Mer
         }
         merchantAuth.setApplicationTime(new Date());
         merchantAuth.setApplicant(userId);
-        merchantAuth.setReviewStatus("2");
+        merchantAuth.setReviewStatus("1");
         this.save(merchantAuth);
         MerchantModifyParam param1 = new MerchantModifyParam();
         param1.setName(param.getStoreName());
@@ -93,7 +96,8 @@ public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, Mer
         }else{
             this.merchantService.updateMerchant(merchant.getId(),param1);
         }
-
+        //首信易个人子商户认证
+        merchantRelationService.registerMerchantId(merchantAuth);
         return merchantAuth.getId();
     }
 
@@ -104,7 +108,7 @@ public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, Mer
         }
         MerchantAuth merchantAuth = AssertUtils.nonnull(this.getById(id), "商家认证不存在");
         MerchantAuthCopier.INSTANCE.copying(param, merchantAuth);
-        merchantAuth.setReviewStatus("2");
+        merchantAuth.setReviewStatus("1");
         merchantAuth.setId(id);
         this.updateById(merchantAuth);
         MerchantModifyParam param1 = new MerchantModifyParam();
@@ -196,4 +200,12 @@ public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, Mer
             }
         });
     }
+
+    @Override
+    public int updateStatus(Long userId, Integer status) {
+        UpdateWrapper<MerchantAuth> update = Wrappers.update();
+        update.set("review_status", status);
+        update.eq("applicant", userId);
+        return baseMapper.update(null, update);
+    }
 }

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

@@ -55,7 +55,7 @@ public class MerchantRelationServiceImpl extends ServiceImpl<MerchantRelationMap
         //商户基本信息
         JSONObject baseInfo = new JSONObject();
         baseInfo.put("signedType", "BY_SPLIT_BILL");
-        baseInfo.put("signedName", merchantAuth.getLegalRepresentativeName());
+        baseInfo.put("signedName", merchantAuth.getAccountName());
         baseInfo.put("registerRole", "INDIVIDUAL_BUSINESS"); //个体工商户
         baseInfo.put("cerType", "INDIVIDUAL_BUSINESS_LICENCE"); //个体工商户营业执照
         baseInfo.put("signedShorthand", merchantAuth.getStoreName());
@@ -70,7 +70,7 @@ public class MerchantRelationServiceImpl extends ServiceImpl<MerchantRelationMap
 
         //结算信息
         JSONObject bankCardInfo = new JSONObject();
-        bankCardInfo.put("accountName", merchantAuth.getAccountName()); //开户名称
+        bankCardInfo.put("accountName", merchantAuth.getLegalRepresentativeName()); //开户名称
         bankCardInfo.put("bankCardNo", merchantAuth.getBankCardNo()); //开户账号
         bankCardInfo.put("accountType", "PRIVATE");
         bankCardInfo.put("liquidationType", "WITHDRAW");