|
|
@ -166,12 +166,12 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ |
|
|
|
baseDao.insert(centerEntity); |
|
|
|
if (CollectionUtils.isNotEmpty(formDTO.getMatterList())){ |
|
|
|
List<IcPartyServiceCenterMatterEntity> matters = ConvertUtils.sourceToTarget(formDTO.getMatterList(), IcPartyServiceCenterMatterEntity.class); |
|
|
|
Map<String, List<IcPartyServiceCenterMatterEntity>> groupByMatterName = matters.stream().collect(Collectors.groupingBy(IcPartyServiceCenterMatterEntity::getMatterName)); |
|
|
|
groupByMatterName.forEach((k,v) -> { |
|
|
|
if (v.size() > NumConstant.ONE){ |
|
|
|
List<String> paramMatterNames = matters.stream().map(m -> m.getMatterName()).collect(Collectors.toList()); |
|
|
|
Integer allSize = paramMatterNames.size(); |
|
|
|
Integer distinctSize = paramMatterNames.stream().distinct().collect(Collectors.toList()).size(); |
|
|
|
if (distinctSize < allSize){ |
|
|
|
throw new EpmetException(EpmetErrorCode.MATTER_NAME_EXISTS_APPOINTMENT_ERROR.getCode()); |
|
|
|
} |
|
|
|
}); |
|
|
|
matters.forEach(m -> { |
|
|
|
m.setCustomerId(customerId); |
|
|
|
m.setPartyServiceCenterId(centerEntity.getId()); |
|
|
|