|
|
@ -70,9 +70,17 @@ public class ReportPartyController { |
|
|
|
//效验数据
|
|
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
|
if (StringUtils.isNotEmpty(dto.getIdCard()) && StringUtils.isNotEmpty(dto.getName())) { |
|
|
|
int sum = reportPartyService.findByIdCardAndName(dto.getIdCard(), dto.getName()); |
|
|
|
if (sum == 1) { |
|
|
|
throw new RenException("您已经报到,无需再次报道!"); |
|
|
|
ReportPartyDTO result = reportPartyService.getByIdCardAndName(dto.getIdCard(), dto.getName()); |
|
|
|
if (null != result && !dto.getCouplingCommunity().equals(result.getCouplingCommunity())) { |
|
|
|
result.setId(dto.getId()); |
|
|
|
result.setCouplingCommunity(dto.getCouplingCommunity()); |
|
|
|
result.setCouplingCommunityName(dto.getCouplingCommunityName()); |
|
|
|
reportPartyService.update(result); |
|
|
|
} else { |
|
|
|
int sum = reportPartyService.findByIdCardAndName(dto.getIdCard(), dto.getName()); |
|
|
|
if (sum == 1) { |
|
|
|
throw new RenException("您已经报到,无需再次报道!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
reportPartyService.save(dto); |
|
|
|