import ignore blank customer id

This commit is contained in:
东皇 2017-10-11 14:17:51 +08:00
parent 248ebf4931
commit 75c5f982ac
2 changed files with 8 additions and 1 deletions

View File

@ -192,8 +192,11 @@ public class CustomerServiceSupport
@Override
public void read(final CSVRecord record) {
final String customerId = record.get(0).trim();
if (StringUtils.isBlank(customerId)) {
log.info("Blank customer id found, ignore.");
return;
}
customer.setId(customerId);
customer.setName(record.get(1).trim());
customer.setCountryCode(record.get(2).trim());
customer.setState(record.get(3).trim());

View File

@ -90,6 +90,10 @@ public class CustomerYearToDateSaleServiceSupport
@Override
public void read(final CSVRecord record) {
final String customerId = StringUtils.trim(record.get(0));
if (StringUtils.isBlank(customerId)) {
log.info("Blank customer id found, ignore.");
return;
}
customerYtdSale.setCustomerId(customerId);
customerYtdSale.setYear(StringUtils.trim(record.get(3)));
customerYtdSale.setYtdSale(Long.parseLong(StringUtils.trim(record.get(6)).replace(",", "")));