lyhzzz 9 bulan lalu
induk
melakukan
105b26a65e

+ 4 - 0
src/main/java/com/fdkankan/manage/service/IJyPlatformUserWaitService.java

@@ -3,6 +3,8 @@ package com.fdkankan.manage.service;
 import com.fdkankan.manage.entity.JyPlatformUserWait;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -16,4 +18,6 @@ public interface IJyPlatformUserWaitService extends IService<JyPlatformUserWait>
     JyPlatformUserWait getByName(String name);
 
     void del(Integer id);
+
+    List<JyPlatformUserWait> getByQueryKey(String queryKey);
 }

+ 9 - 0
src/main/java/com/fdkankan/manage/service/impl/JyPlatformUserWaitServiceImpl.java

@@ -8,6 +8,8 @@ import com.fdkankan.manage.service.IJyPlatformUserWaitService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务实现类
@@ -33,4 +35,11 @@ public class JyPlatformUserWaitServiceImpl extends ServiceImpl<IJyPlatformUserWa
         wrapper.set(JyPlatformUserWait::getRecStatus,id);
         this.update(wrapper);
     }
+
+    @Override
+    public List<JyPlatformUserWait> getByQueryKey(String queryKey) {
+        LambdaQueryWrapper<JyPlatformUserWait> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(JyPlatformUserWait::getName,queryKey);
+        return this.list(wrapper);
+    }
 }

+ 13 - 5
src/main/java/com/fdkankan/manage/service/impl/JyUserPlatformServiceImpl.java

@@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.manage.vo.request.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -45,6 +46,8 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
     ISysUserService sysUserService;
     @Autowired
     ISysRoleService sysRoleService;
+    @Autowired
+    IJyPlatformUserWaitService platformUserWaitService;
 
 
     @Override
@@ -150,6 +153,13 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
                 sysRoles.forEach(e -> roleMap.put(e.getId(),e));
             }
         }
+        JyPlatformUserWait jyPlatformUserWait = platformUserWaitService.getByName(param.getQueryKey());
+        if(jyPlatformUserWait != null){
+            JyUserPlatform jyUserPlatform = new JyUserPlatform();
+            BeanUtils.copyProperties(jyPlatformUserWait,jyUserPlatform);
+            jyUserPlatforms.add(jyUserPlatform);
+        }
+
         for (JyUserPlatform jyUserPlatform : jyUserPlatforms) {
             if(jyUserPlatform.getPlatformId()!=null){
                 JyPlatform jyPlatform =map.get(jyUserPlatform.getPlatformId());
@@ -191,13 +201,13 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
         List<Integer> updatePlatformUserList = new ArrayList<>();
         Integer index = 0;
         for (HashMap<Integer, String> map : excelRowList) {
+            if (index == 0 && !map.get(0).equals("平台用户模板")) {
+                throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
+            }
             index++;
             if (map.isEmpty()) {
                 continue;
             }
-            if (index == 0 && !map.get(0).equals("平台用户模板")) {
-                throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
-            }
             if (index < 4) {
                 continue;
             }
@@ -246,8 +256,6 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
         return count1 + count;
     }
 
-    @Autowired
-    IJyPlatformUserWaitService platformUserWaitService;
 
     private Integer addPlatformUsers(List<JyUserPlatformAddParam> params) {
         Integer count = 0;