|
@@ -28,8 +28,6 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
-import java.rmi.RemoteException;
|
|
|
import java.util.*;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -184,7 +182,7 @@ public class WorkerTeamLogic {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
- public void importData(MultipartFile file) throws IOException {
|
|
|
+ public void importData(MultipartFile file) throws Exception {
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
|
|
|
String companyWechatId = Objects.nonNull(adminUser.getAdminCompanyWechat()) ? adminUser.getAdminCompanyWechat().getCompanyWechatId() : null;
|
|
@@ -258,13 +256,13 @@ public class WorkerTeamLogic {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void checkImportWorkerWebsit(WorkerTeam workerTeam) throws RemoteException {
|
|
|
+ private void checkImportWorkerWebsit(WorkerTeam workerTeam) throws Exception {
|
|
|
final User user = userService.lambdaQuery()
|
|
|
.eq(User::getCompanyWechatId, workerTeam.getCompanyWechatId())
|
|
|
.eq(User::getMobile, workerTeam.getMasterWorkerId())
|
|
|
.one();
|
|
|
if (Objects.isNull(user)) {
|
|
|
- throw new RemoteException("师傅" + workerTeam.getMasterWorkerId() + "不存在");
|
|
|
+ throw new RemoteServiceException("师傅" + workerTeam.getMasterWorkerId() + "不存在");
|
|
|
}
|
|
|
final Integer count = websitUserService.lambdaQuery()
|
|
|
.eq(WebsitUser::getCompanyWechatId, workerTeam.getCompanyWechatId())
|
|
@@ -273,14 +271,14 @@ public class WorkerTeamLogic {
|
|
|
.in(WebsitUser::getExamineStatus, ExamineWorkerStatusEnum.OK.getKey(), ExamineWorkerStatusEnum.EXPIRED.getKey())
|
|
|
.count();
|
|
|
if (count == 0) {
|
|
|
- throw new RemoteException("师傅" + workerTeam.getMasterWorkerId() + "未入驻成功");
|
|
|
+ throw new RemoteServiceException("师傅" + workerTeam.getMasterWorkerId() + "未入驻成功");
|
|
|
}
|
|
|
final User user2 = userService.lambdaQuery()
|
|
|
.eq(User::getCompanyWechatId, workerTeam.getCompanyWechatId())
|
|
|
.eq(User::getMobile, workerTeam.getAssistantWorkerId())
|
|
|
.one();
|
|
|
if (Objects.isNull(user2)) {
|
|
|
- throw new RemoteException("师傅" + workerTeam.getAssistantWorkerId() + "不存在");
|
|
|
+ throw new RemoteServiceException("师傅" + workerTeam.getAssistantWorkerId() + "不存在");
|
|
|
}
|
|
|
final Integer count2 = websitUserService.lambdaQuery()
|
|
|
.eq(WebsitUser::getCompanyWechatId, workerTeam.getCompanyWechatId())
|
|
@@ -289,7 +287,7 @@ public class WorkerTeamLogic {
|
|
|
.in(WebsitUser::getExamineStatus, ExamineWorkerStatusEnum.OK.getKey(), ExamineWorkerStatusEnum.EXPIRED.getKey())
|
|
|
.count();
|
|
|
if (count2 == 0) {
|
|
|
- throw new RemoteException("师傅" + workerTeam.getAssistantWorkerId() + "未入驻成功");
|
|
|
+ throw new RemoteServiceException("师傅" + workerTeam.getAssistantWorkerId() + "未入驻成功");
|
|
|
}
|
|
|
}
|
|
|
}
|