export customer ID 2

This commit is contained in:
Shaun Chyxion 2020-11-19 22:32:32 +08:00
parent 5c843c837c
commit 071055a74b
2 changed files with 10 additions and 2 deletions

View File

@ -488,7 +488,7 @@ public class CustomerServiceSupport
try {
log.info("Export Customer [{}].", c);
printer.printRecord(c.getId(),
printer.printRecord(c.getId2(),
c.getName(),
c.getSumYtdSales(),
joinYtdSales(c.getYears(), c.getYtdSales()),

View File

@ -90,6 +90,12 @@ public class CustomerYearToDateSaleServiceSupport
*/
@Override
public void read(final CSVRecord record) {
val customerId2 = StringUtils.trim(record.get(0));
if (StringUtils.isBlank(customerId2)) {
log.info("Blank customer id found, ignore.");
return;
}
val customerName = StringUtils.trim(record.get(1));
if (StringUtils.isBlank(customerName)) {
log.warn("Record [{}] blank customer name found, ignore.", record);
@ -97,7 +103,9 @@ public class CustomerYearToDateSaleServiceSupport
}
val customer = customerMapper.find(
new Search(Customer.NAME, customerName));
new Search(Customer.ID2, customerId2)
.eq(Customer.NAME, customerName));
if (customer == null) {
log.warn("No customer [{}] found, ignore.", customerName);
return;