|
@@ -3,9 +3,11 @@ package com.fdkankan.manage.service.impl;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.fdkankan.manage.common.ExcelErrorUtil;
|
|
|
import com.fdkankan.manage.common.PageInfo;
|
|
|
import com.fdkankan.manage.common.ResultCode;
|
|
|
import com.fdkankan.manage.entity.JyPlatform;
|
|
|
+import com.fdkankan.manage.entity.JyPlatformUserWait;
|
|
|
import com.fdkankan.manage.entity.JyUser;
|
|
|
import com.fdkankan.manage.entity.SysUser;
|
|
|
import com.fdkankan.manage.service.*;
|
|
@@ -158,33 +160,44 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
|
|
|
continue;
|
|
|
}
|
|
|
String name = map.get(0);
|
|
|
- String idCard = map.get(1);
|
|
|
- if(StringUtils.isBlank(name) || StringUtils.isBlank(idCard)){
|
|
|
+ if(StringUtils.isBlank(name) ){
|
|
|
+ errorIndex.add(index -3 );
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ JyUser user = jyUserService.getByNickName(name);
|
|
|
+ if(user != null ){
|
|
|
+ errorIndex.add(index -3 );
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ JyPlatformUserWait jyPlatformUserWait = platformUserWaitService.getByName(name);
|
|
|
+ if(jyPlatformUserWait != null ){
|
|
|
errorIndex.add(index -3 );
|
|
|
continue;
|
|
|
}
|
|
|
JyUserPlatformAddParam param = new JyUserPlatformAddParam();
|
|
|
param.setName(name);
|
|
|
- param.setIdCard(idCard);
|
|
|
params.add(param);
|
|
|
}
|
|
|
- excelService.toExcelError(errorIndex);
|
|
|
+ if(!errorIndex.isEmpty()){
|
|
|
+ excelService.toExcelError(errorIndex);
|
|
|
+ }
|
|
|
if(params.size() <=0){
|
|
|
throw new BusinessException(ResultCode.TEMPLATE_EMPTY);
|
|
|
}
|
|
|
return this.addPlatformUsers(params);
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ IJyPlatformUserWaitService platformUserWaitService;
|
|
|
+
|
|
|
private Integer addPlatformUsers(List<JyUserPlatformAddParam> params) {
|
|
|
Integer count = 0;
|
|
|
for (JyUserPlatformAddParam param : params) {
|
|
|
- JyUser byIdCard = jyUserService.getByIdCard(param.getIdCard());
|
|
|
- if(byIdCard == null){
|
|
|
- continue;
|
|
|
- }
|
|
|
+ JyPlatformUserWait jyPlatformUserWait = new JyPlatformUserWait();
|
|
|
+ jyPlatformUserWait.setName(param.getName());
|
|
|
+ jyPlatformUserWait.setPlatformId(this.getLoginPlatformId());
|
|
|
+ platformUserWaitService.save(jyPlatformUserWait);
|
|
|
count ++;
|
|
|
- param.setId(byIdCard.getId());
|
|
|
- this.addByParam(param);
|
|
|
}
|
|
|
return count;
|
|
|
}
|