|
@@ -44,8 +44,6 @@ public class EmployeeImportListener extends AnalysisEventListener<EmployeeImport
|
|
|
|
|
|
|
|
private final String password;
|
|
private final String password;
|
|
|
|
|
|
|
|
- private final Boolean isUpdateSupport;
|
|
|
|
|
-
|
|
|
|
|
private final String operName;
|
|
private final String operName;
|
|
|
|
|
|
|
|
private int successNum = 0;
|
|
private int successNum = 0;
|
|
@@ -58,9 +56,7 @@ public class EmployeeImportListener extends AnalysisEventListener<EmployeeImport
|
|
|
this.employeeService = SpringUtils.getBean(IEmployeeService.class);
|
|
this.employeeService = SpringUtils.getBean(IEmployeeService.class);
|
|
|
this.agentService = SpringUtils.getBean(IAgentService.class);
|
|
this.agentService = SpringUtils.getBean(IAgentService.class);
|
|
|
this.shopService = SpringUtils.getBean(IShopService.class);
|
|
this.shopService = SpringUtils.getBean(IShopService.class);
|
|
|
-
|
|
|
|
|
this.password = BCrypt.hashpw(initPassword);
|
|
this.password = BCrypt.hashpw(initPassword);
|
|
|
- this.isUpdateSupport = isUpdateSupport;
|
|
|
|
|
this.operName = LoginHelper.getUsername();
|
|
this.operName = LoginHelper.getUsername();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -80,35 +76,38 @@ public class EmployeeImportListener extends AnalysisEventListener<EmployeeImport
|
|
|
}
|
|
}
|
|
|
if(ObjectUtil.isEmpty(agentName)){
|
|
if(ObjectUtil.isEmpty(agentName)){
|
|
|
failureNum++;
|
|
failureNum++;
|
|
|
- failureMsg.append("<br/>").append(failureNum).append("、所属代理商 ").append(" 不能为空");
|
|
|
|
|
|
|
+ failureMsg.append("<br/>").append(failureNum).append("、姓名 ").append(employeeName).append("、所属代理商 ").append(" 不能为空");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if(ObjectUtil.isEmpty(shopName)){
|
|
if(ObjectUtil.isEmpty(shopName)){
|
|
|
failureNum++;
|
|
failureNum++;
|
|
|
- failureMsg.append("<br/>").append(failureNum).append("、所属门店 ").append(" 不能为空");
|
|
|
|
|
|
|
+ failureMsg.append("<br/>").append(failureNum).append("、姓名 ").append(employeeName).append("、所属门店 ").append(" 不能为空");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if(ObjectUtil.isEmpty(phonenumber)){
|
|
if(ObjectUtil.isEmpty(phonenumber)){
|
|
|
failureNum++;
|
|
failureNum++;
|
|
|
- failureMsg.append("<br/>").append(failureNum).append("、手机号码 ").append(" 不能为空");
|
|
|
|
|
|
|
+ failureMsg.append("<br/>").append(failureNum).append("、姓名 ").append(employeeName).append("、手机号码 ").append(" 不能为空");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
Agent agent = agentService.getAgentByName(agentName);
|
|
Agent agent = agentService.getAgentByName(agentName);
|
|
|
if(ObjectUtil.isEmpty(agent)){
|
|
if(ObjectUtil.isEmpty(agent)){
|
|
|
failureNum++;
|
|
failureNum++;
|
|
|
- failureMsg.append("<br/>").append(failureNum).append("、所属代理商 ").append(agentName).append(" 不存在");
|
|
|
|
|
|
|
+ failureMsg.append("<br/>").append(failureNum).append("、姓名 ").append(employeeName).append("、所属代理商 ").append(agentName).append(" 不存在");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
Shop shop = shopService.getShopByName(shopName);
|
|
Shop shop = shopService.getShopByName(shopName);
|
|
|
if(ObjectUtil.isEmpty(shop)){
|
|
if(ObjectUtil.isEmpty(shop)){
|
|
|
failureNum++;
|
|
failureNum++;
|
|
|
- failureMsg.append("<br/>").append(failureNum).append("、所属门店 ").append(shopName).append(" 不存在");
|
|
|
|
|
|
|
+ failureMsg.append("<br/>").append(failureNum).append("、姓名 ").append(employeeName).append("、所属门店 ").append(shopName).append(" 不存在");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ Long shopAgentId = shop.getAgentId();
|
|
|
|
|
+ if(!shopAgentId.equals(agent.getAgentId())){
|
|
|
|
|
+ failureNum++;
|
|
|
|
|
+ failureMsg.append("<br/>").append(failureNum).append("、姓名 ").append(employeeName).append("、所属门店 ").append(shopName).append(" 不属于所属代理商 ").append(agentName);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
Employee user = this.employeeService.selectUserByUserName(phonenumber);
|
|
Employee user = this.employeeService.selectUserByUserName(phonenumber);
|
|
|
-
|
|
|
|
|
// 验证是否存在这个用户
|
|
// 验证是否存在这个用户
|
|
|
if (ObjectUtil.isNull(user)) {
|
|
if (ObjectUtil.isNull(user)) {
|
|
|
EmployeeBo employeeBo = new EmployeeBo();
|
|
EmployeeBo employeeBo = new EmployeeBo();
|