Jelajahi Sumber

机构审核

yuanliang 8 bulan lalu
induk
melakukan
d3890ab93d

+ 11 - 8
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantApplyRecordServiceImpl.java

@@ -296,11 +296,9 @@ public class TenantApplyRecordServiceImpl extends ServiceImpl<TenantApplyRecordM
         tenantApplyRecord.setVerifyUserId(verifyUserId);
         tenantApplyRecord.setReason(entry.getReason());
         tenantApplyRecord.setBriefIntroduction(applyRecord.getBriefIntroduction());
-
-        applyRecord.setStatus(Boolean.TRUE.equals(ifPass) ? AuthStatusEnum.PASS : AuthStatusEnum.UNPASS);
-        applyRecord.setVerifyUserId(verifyUserId);
-        applyRecord.setReason(entry.getReason());
         if (ifPass == true){
+            tenantApplyRecord.setStatus(AuthStatusEnum.PASS);
+
 
             //机构账户新增逻辑
             TenantInfo tenantInfo = new TenantInfo();
@@ -315,14 +313,19 @@ public class TenantApplyRecordServiceImpl extends ServiceImpl<TenantApplyRecordM
             tenantInfo.setBriefIntroduction(applyRecord.getBriefIntroduction());
             if (tenantInfoService.add(tenantInfo)) {
                 applyRecord.setUserId(tenantInfo.getUserId());
+                tenantApplyRecordMapper.updateById(applyRecord);
             }
+            //更改当前记录的审核状态
+            tenantApplyRecordMapper.updateStatusById(id);
+        } else {
+            tenantApplyRecord.setStatus(AuthStatusEnum.UNPASS);
+            tenantApplyRecordMapper.updateUnpassStatusById(id);
         }
-        tenantApplyRecordMapper.updateById(applyRecord);
-
 
+        String name = tenantEntryRecordMapper.selectName(verifyUserId);
+        tenantApplyRecord.setVerifyUserName(name);
 
-        TenantEntryRecord tenantEntryRecord = JSON.parseObject(JSON.toJSONString(applyRecord), TenantEntryRecord.class);
-        tenantEntryRecord.setTenantApplyRecordId(applyRecord.getId());
+        TenantEntryRecord tenantEntryRecord = JSON.parseObject(JSON.toJSONString(tenantApplyRecord), TenantEntryRecord.class);
          tenantEntryRecordMapper.insert(tenantEntryRecord);