Browse Source

注释社区自组织成员联系方式格式校验

feature/teamB_zz_wgh
zxc 3 years ago
parent
commit
ba8471b1ec
  1. 21
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

21
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

@ -200,13 +200,16 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
baseDao.insert(orgEntity); baseDao.insert(orgEntity);
if(CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){ if(CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){
// 号码校验 // 号码校验
formDTO.getOrganizationPersonnel().forEach(p -> { /**
* 2022-06-14 需求变动 去掉号码校验
*/
/*formDTO.getOrganizationPersonnel().forEach(p -> {
boolean m = PhoneValidatorUtils.isMobile(p.getPersonPhone()); boolean m = PhoneValidatorUtils.isMobile(p.getPersonPhone());
boolean t = PhoneValidatorUtils.isTel(p.getPersonPhone()); boolean t = PhoneValidatorUtils.isTel(p.getPersonPhone());
if (!m && !t){ if (!m && !t){
throw new EpmetException(EpmetErrorCode.CHECK_PHONE_ERROR.getCode()); throw new EpmetException(EpmetErrorCode.CHECK_PHONE_ERROR.getCode());
} }
}); });*/
List<IcCommunitySelfOrganizationPersonnelEntity> persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class); List<IcCommunitySelfOrganizationPersonnelEntity> persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class);
Map<String, List<IcCommunitySelfOrganizationPersonnelEntity>> groupPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone)); Map<String, List<IcCommunitySelfOrganizationPersonnelEntity>> groupPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone));
List<String> phones = new ArrayList<>(); List<String> phones = new ArrayList<>();
@ -263,13 +266,16 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
baseDao.updateCommunitySelfOrganization(e); baseDao.updateCommunitySelfOrganization(e);
personnelService.deleteByOrgId(formDTO.getOrgId()); personnelService.deleteByOrgId(formDTO.getOrgId());
if (CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){ if (CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){
formDTO.getOrganizationPersonnel().forEach(p -> { /**
* 2022-06-14 需求变动 去掉号码校验
*/
/*formDTO.getOrganizationPersonnel().forEach(p -> {
boolean mobile = PhoneValidatorUtils.isMobile(p.getPersonPhone()); boolean mobile = PhoneValidatorUtils.isMobile(p.getPersonPhone());
boolean tel = PhoneValidatorUtils.isTel(p.getPersonPhone()); boolean tel = PhoneValidatorUtils.isTel(p.getPersonPhone());
if (!mobile && !tel){ if (!mobile && !tel){
throw new EpmetException(EpmetErrorCode.CHECK_PHONE_ERROR.getCode()); throw new EpmetException(EpmetErrorCode.CHECK_PHONE_ERROR.getCode());
} }
}); });*/
List<IcCommunitySelfOrganizationPersonnelEntity> persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class); List<IcCommunitySelfOrganizationPersonnelEntity> persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class);
Map<String, List<IcCommunitySelfOrganizationPersonnelEntity>> groupPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone)); Map<String, List<IcCommunitySelfOrganizationPersonnelEntity>> groupPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone));
List<String> phones = new ArrayList<>(); List<String> phones = new ArrayList<>();
@ -540,13 +546,16 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
} }
}); });
//手机号不合规 //手机号不合规
boolean m = PhoneValidatorUtils.isMobile(obj.getPrincipalPhone()); /**
* 2022-06-14 需求变动 去掉号码校验
*/
/*boolean m = PhoneValidatorUtils.isMobile(obj.getPrincipalPhone());
boolean t = PhoneValidatorUtils.isTel(obj.getPrincipalPhone()); boolean t = PhoneValidatorUtils.isTel(obj.getPrincipalPhone());
if (!m && !t){ if (!m && !t){
errMsg.append("手机号码不合法;"); errMsg.append("手机号码不合法;");
bl.set(true); bl.set(true);
log.warn("手机号码不合法,自组织名称{}", obj.getOrganizationName()); log.warn("手机号码不合法,自组织名称{}", obj.getOrganizationName());
} }*/
if(bl.get()){ if(bl.get()){
excel = new CommunitySelfOrgImportExcel(); excel = new CommunitySelfOrgImportExcel();
//excel.setAgencyName(obj.getOrganizationName()); //excel.setAgencyName(obj.getOrganizationName());

Loading…
Cancel
Save