|
@@ -267,25 +267,30 @@ public class UserLogic {
|
|
|
throw new RemoteServiceException(errPrefix + "网点不存在");
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isBlank(workerNumber)) {
|
|
|
- throw new RemoteServiceException(errPrefix + "师傅编号不能为空");
|
|
|
- }
|
|
|
+
|
|
|
UserWait userWait = new UserWait();
|
|
|
userWait.setUserType(userTypeEnum.getKey());
|
|
|
userWait.setMobile(mobile);
|
|
|
+ userWait.setIdcard(idcard);
|
|
|
|
|
|
- if(websitUserService.lambdaQuery().eq(WebsitUser::getWebsitId,adminWebsit.getWebsitId())
|
|
|
- .eq(WebsitUser::getWorkerNumber,workerNumber).count() > 0)
|
|
|
- throw new RemoteServiceException(workerNumber+"该师傅已有入驻信息");
|
|
|
+ List<User> userList = userService.lambdaQuery().eq(User::getIdCard, idcard).list();
|
|
|
+
|
|
|
+ if (!CollectionUtils.isEmpty(userList)) {
|
|
|
+
|
|
|
+ User user = userList.get(0);
|
|
|
+ if (websitUserService.lambdaQuery().eq(WebsitUser::getWebsitId, adminWebsit.getWebsitId())
|
|
|
+ .eq(WebsitUser::getUserId, user.getUserId()).count() > 0)
|
|
|
+ throw new RemoteServiceException(idcard + "该师傅已有入驻信息");
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if (adminWebsit.getInsureType().equals("意外险,工伤险")) {
|
|
|
|
|
|
if (StringUtil.isEmpty(in_company))
|
|
|
- throw new RemoteServiceException(userWait.getWorkerNumber()+"必须导入工伤险");
|
|
|
+ throw new RemoteServiceException(userWait.getIdcard()+"必须导入工伤险");
|
|
|
}else {
|
|
|
if (StringUtil.isEmpty(em_company))
|
|
|
- throw new RemoteServiceException(userWait.getEmCompany()+"必须导入雇主险");
|
|
|
+ throw new RemoteServiceException(userWait.getIdcard()+"必须导入雇主险");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -295,7 +300,7 @@ public class UserLogic {
|
|
|
userWait.setPolicyEndTime(DateUtil.offsetSecond(DateUtil.endOfDay(DateUtil.parse(policy_end_time, "yyyy-MM-dd")),-1));
|
|
|
|
|
|
if (userWait.getPolicyEndTime().before(new Date()))
|
|
|
- throw new RemoteServiceException(userWait.getWorkerNumber()+"导入师傅保险已过期");
|
|
|
+ throw new RemoteServiceException(userWait.getIdcard()+"导入师傅保险已过期");
|
|
|
|
|
|
userWait.setPolicyName(policy_name);
|
|
|
userWait.setPolicyOrder(policy_order);
|
|
@@ -309,7 +314,7 @@ public class UserLogic {
|
|
|
userWait.setEmPolicyEndTime(DateUtil.offsetSecond(DateUtil.endOfDay(DateUtil.parse(em_policy_end_time, "yyyy-MM-dd")),-1));
|
|
|
|
|
|
if (userWait.getEmPolicyEndTime().before(new Date()))
|
|
|
- throw new RemoteServiceException(userWait.getWorkerNumber()+"导入师傅保险已过期");
|
|
|
+ throw new RemoteServiceException(userWait.getIdcard()+"导入师傅保险已过期");
|
|
|
userWait.setEmPolicyName(em_policy_name);
|
|
|
userWait.setEmPolicyOrder(em_policy_order);
|
|
|
}
|
|
@@ -319,7 +324,7 @@ public class UserLogic {
|
|
|
userWait.setInPolicyStartTime(DateUtil.parse(in_policy_start_time, "yyyy-MM-dd"));
|
|
|
userWait.setInPolicyEndTime(DateUtil.offsetSecond(DateUtil.endOfDay(DateUtil.parse(in_policy_end_time, "yyyy-MM-dd")),-1));
|
|
|
if (userWait.getInPolicyEndTime().before(new Date()))
|
|
|
- throw new RemoteServiceException(userWait.getWorkerNumber()+"导入师傅保险已过期");
|
|
|
+ throw new RemoteServiceException(userWait.getIdcard()+"导入师傅保险已过期");
|
|
|
userWait.setInPolicyName(in_policy_name);
|
|
|
userWait.setInPolicyOrder(in_policy_order);
|
|
|
}
|