|
@@ -99,6 +99,8 @@ public class SiteUserImpl implements SiteUserService {
|
|
|
|
|
|
// 手机号查重
|
|
// 手机号查重
|
|
List<String> byMobileSiteId = pcSiteUserMapper.selectByMobile(data.mobile);
|
|
List<String> byMobileSiteId = pcSiteUserMapper.selectByMobile(data.mobile);
|
|
|
|
+ List<String> byUserNoSiteId = pcSiteUserMapper.selectByUserNo(data.userNo);
|
|
|
|
+ List<String> byIdCardSiteId = pcSiteUserMapper.selectByIdCard(data.idCard);
|
|
|
|
|
|
SiteUserVo record = get(data.siteUserID);
|
|
SiteUserVo record = get(data.siteUserID);
|
|
PcSiteUser dbData = record == null ? null : pcSiteUserMapper.selectByPrimaryKey(record.siteUserID);
|
|
PcSiteUser dbData = record == null ? null : pcSiteUserMapper.selectByPrimaryKey(record.siteUserID);
|
|
@@ -108,10 +110,16 @@ public class SiteUserImpl implements SiteUserService {
|
|
SysRoleExample roleExp = null;
|
|
SysRoleExample roleExp = null;
|
|
/*注意:这里的data.roleID为用户类型ID*/
|
|
/*注意:这里的data.roleID为用户类型ID*/
|
|
if (!isExist) {
|
|
if (!isExist) {
|
|
- // 添加时有重复手机号立即报错
|
|
|
|
|
|
+ // 添加时有重复数据立即报错
|
|
if (!byMobileSiteId.isEmpty()) {
|
|
if (!byMobileSiteId.isEmpty()) {
|
|
throw new BaseException("500", "该手机号已绑定其他驿站人员");
|
|
throw new BaseException("500", "该手机号已绑定其他驿站人员");
|
|
}
|
|
}
|
|
|
|
+ if (!byUserNoSiteId.isEmpty()) {
|
|
|
|
+ throw new BaseException("500", "该工号已绑定其他驿站人员");
|
|
|
|
+ }
|
|
|
|
+ if (!byIdCardSiteId.isEmpty()) {
|
|
|
|
+ throw new BaseException("500", "该身份证已绑定其他驿站人员");
|
|
|
|
+ }
|
|
|
|
|
|
//添加
|
|
//添加
|
|
//处理用户表
|
|
//处理用户表
|
|
@@ -146,6 +154,12 @@ public class SiteUserImpl implements SiteUserService {
|
|
if (!byMobileSiteId.isEmpty() && !byMobileSiteId.contains(data.siteUserID)) {
|
|
if (!byMobileSiteId.isEmpty() && !byMobileSiteId.contains(data.siteUserID)) {
|
|
throw new BaseException("500", "该手机号已绑定其他驿站人员");
|
|
throw new BaseException("500", "该手机号已绑定其他驿站人员");
|
|
}
|
|
}
|
|
|
|
+ if (!byUserNoSiteId.isEmpty() && !byUserNoSiteId.contains(data.siteUserID)) {
|
|
|
|
+ throw new BaseException("500", "该工号已绑定其他驿站人员");
|
|
|
|
+ }
|
|
|
|
+ if (!byIdCardSiteId.isEmpty() && !byIdCardSiteId.contains(data.siteUserID)) {
|
|
|
|
+ throw new BaseException("500", "该身份证已绑定其他驿站人员");
|
|
|
|
+ }
|
|
|
|
|
|
//修改
|
|
//修改
|
|
//处理用户表
|
|
//处理用户表
|
|
@@ -231,9 +245,13 @@ public class SiteUserImpl implements SiteUserService {
|
|
if (stringUtils.IsNullOrEmpty(item.userNo)) {
|
|
if (stringUtils.IsNullOrEmpty(item.userNo)) {
|
|
errorInfo += "请填写工号!";
|
|
errorInfo += "请填写工号!";
|
|
} else {
|
|
} else {
|
|
- String siteUserID = pcSiteUsers.stream().filter(it -> it.getUserNo() != null && it.getUserNo().equals(item.getUserNo().trim())).findFirst().orElse(new PcSiteUser()).getSiteUserID();
|
|
|
|
|
|
+ String siteUserID = pcSiteUsers.stream()
|
|
|
|
+ .filter(it -> it.getUserNo() != null && it.getUserNo().equals(item.getUserNo().trim()))
|
|
|
|
+ .findFirst()
|
|
|
|
+ .orElse(new PcSiteUser())
|
|
|
|
+ .getSiteUserID();
|
|
if (!stringUtils.IsNullOrEmpty(siteUserID)) {
|
|
if (!stringUtils.IsNullOrEmpty(siteUserID)) {
|
|
- errorInfo += "工号重复!";
|
|
|
|
|
|
+ errorInfo += "工号已绑定其他驿站人员!";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (stringUtils.IsNullOrEmpty(item.genderName)) {
|
|
if (stringUtils.IsNullOrEmpty(item.genderName)) {
|
|
@@ -248,19 +266,35 @@ public class SiteUserImpl implements SiteUserService {
|
|
if (stringUtils.IsNullOrEmpty(item.mobile)) {
|
|
if (stringUtils.IsNullOrEmpty(item.mobile)) {
|
|
errorInfo += "请填写联系电话!";
|
|
errorInfo += "请填写联系电话!";
|
|
} else {
|
|
} else {
|
|
- String siteUserID = pcSiteUsers.stream().filter(it -> it.getMobile() != null && it.getMobile().equals(item.getMobile().trim())).findFirst().orElse(new PcSiteUser()).getSiteUserID();
|
|
|
|
|
|
+ String siteUserID = pcSiteUsers.stream()
|
|
|
|
+ .filter(it -> it.getMobile() != null && it.getMobile().equals(item.getMobile().trim()))
|
|
|
|
+ .findFirst()
|
|
|
|
+ .orElse(new PcSiteUser())
|
|
|
|
+ .getSiteUserID();
|
|
if (!stringUtils.IsNullOrEmpty(siteUserID)) {
|
|
if (!stringUtils.IsNullOrEmpty(siteUserID)) {
|
|
- errorInfo += "联系电话重复!";
|
|
|
|
|
|
+ errorInfo += "联系电话已绑定其他驿站人员!";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (stringUtils.IsNullOrEmpty(item.idCard)) {
|
|
if (stringUtils.IsNullOrEmpty(item.idCard)) {
|
|
errorInfo += "请填写身份证号码!";
|
|
errorInfo += "请填写身份证号码!";
|
|
|
|
+ } else {
|
|
|
|
+ String siteUserID = pcSiteUsers.stream()
|
|
|
|
+ .filter(it -> it.getIDCard() != null && it.getIDCard().equals(item.getIdCard().trim()))
|
|
|
|
+ .findFirst()
|
|
|
|
+ .orElse(new PcSiteUser())
|
|
|
|
+ .getSiteUserID();
|
|
|
|
+ if (!stringUtils.IsNullOrEmpty(siteUserID)) {
|
|
|
|
+ errorInfo += "身份证已绑定其他驿站人员!";
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (stringUtils.IsNullOrEmpty(item.roleName)) {
|
|
if (stringUtils.IsNullOrEmpty(item.roleName)) {
|
|
errorInfo += "请填写用户类型!";
|
|
errorInfo += "请填写用户类型!";
|
|
} else {
|
|
} else {
|
|
- item.roleID = userTypeList.stream().filter(it -> it.getName().equals(item.getRoleName().trim()))
|
|
|
|
- .findFirst().orElse(new SysDictionaryItem()).getValue();
|
|
|
|
|
|
+ item.roleID = userTypeList.stream()
|
|
|
|
+ .filter(it -> it.getName().equals(item.getRoleName().trim()))
|
|
|
|
+ .findFirst()
|
|
|
|
+ .orElse(new SysDictionaryItem())
|
|
|
|
+ .getValue();
|
|
if (item.roleID == null) {
|
|
if (item.roleID == null) {
|
|
errorInfo += "用户类型不存在!";
|
|
errorInfo += "用户类型不存在!";
|
|
}
|
|
}
|
|
@@ -268,8 +302,11 @@ public class SiteUserImpl implements SiteUserService {
|
|
if (stringUtils.IsNullOrEmpty(item.siteName)) {
|
|
if (stringUtils.IsNullOrEmpty(item.siteName)) {
|
|
errorInfo += "请填写所属驿站!";
|
|
errorInfo += "请填写所属驿站!";
|
|
} else {
|
|
} else {
|
|
- item.siteID = siteList.stream().filter(it -> it.getSiteName().equals(item.getSiteName().trim()))
|
|
|
|
- .findFirst().orElse(new PcSite()).getSiteID();
|
|
|
|
|
|
+ item.siteID = siteList.stream()
|
|
|
|
+ .filter(it -> it.getSiteName().equals(item.getSiteName().trim()))
|
|
|
|
+ .findFirst()
|
|
|
|
+ .orElse(new PcSite())
|
|
|
|
+ .getSiteID();
|
|
if (stringUtils.IsNullOrEmpty(item.siteID)) {
|
|
if (stringUtils.IsNullOrEmpty(item.siteID)) {
|
|
errorInfo += "驿站不存在!";
|
|
errorInfo += "驿站不存在!";
|
|
}
|
|
}
|