Showing
1 changed file
with
51 additions
and
32 deletions
| @@ -28,38 +28,38 @@ public class CustomerCreditChangeImportListener extends ExcelImportListener<Cust | @@ -28,38 +28,38 @@ public class CustomerCreditChangeImportListener extends ExcelImportListener<Cust | ||
| 28 | throw new DefaultClientException( | 28 | throw new DefaultClientException( |
| 29 | "第" + context.readRowHolder().getRowIndex() + "行“编号”不能为空"); | 29 | "第" + context.readRowHolder().getRowIndex() + "行“编号”不能为空"); |
| 30 | } | 30 | } |
| 31 | - if (StringUtil.isBlank(data.getAnnualTotalSales())) { | ||
| 32 | - throw new DefaultClientException( | ||
| 33 | - "第" + context.readRowHolder().getRowIndex() + "行“年度总销量”不能为空"); | ||
| 34 | - } | ||
| 35 | - if (StringUtil.isBlank(data.getMainIndustry())) { | ||
| 36 | - throw new DefaultClientException( | ||
| 37 | - "第" + context.readRowHolder().getRowIndex() + "行“主要行业”不能为空"); | ||
| 38 | - } | ||
| 39 | - if (StringUtil.isBlank(data.getOccupationDays())) { | ||
| 40 | - throw new DefaultClientException( | ||
| 41 | - "第" + context.readRowHolder().getRowIndex() + "行“占用天数”不能为空"); | ||
| 42 | - } | ||
| 43 | - if (StringUtil.isBlank(data.getProfitPerTon())) { | ||
| 44 | - throw new DefaultClientException( | ||
| 45 | - "第" + context.readRowHolder().getRowIndex() + "行“吨盈利”不能为空"); | ||
| 46 | - } | ||
| 47 | - if (StringUtil.isBlank(data.getCompanySettlementPeriod())) { | ||
| 48 | - throw new DefaultClientException( | ||
| 49 | - "第" + context.readRowHolder().getRowIndex() + "行“结算期限”不能为空"); | ||
| 50 | - } | ||
| 51 | - if (StringUtil.isBlank(data.getCompanyCreditLimit())) { | ||
| 52 | - throw new DefaultClientException( | ||
| 53 | - "第" + context.readRowHolder().getRowIndex() + "行“授信额度”不能为空"); | ||
| 54 | - } | ||
| 55 | - if (StringUtil.isBlank(data.getCompanyMaterialSupplyPlan())) { | ||
| 56 | - throw new DefaultClientException( | ||
| 57 | - "第" + context.readRowHolder().getRowIndex() + "行“加工操作方案”不能为空"); | ||
| 58 | - } | ||
| 59 | - if (StringUtil.isBlank(data.getCompanySuggestedCategory())) { | ||
| 60 | - throw new DefaultClientException( | ||
| 61 | - "第" + context.readRowHolder().getRowIndex() + "行“客户分类”不能为空"); | ||
| 62 | - } | 31 | +// if (StringUtil.isBlank(data.getAnnualTotalSales())) { |
| 32 | +// throw new DefaultClientException( | ||
| 33 | +// "第" + context.readRowHolder().getRowIndex() + "行“年度总销量”不能为空"); | ||
| 34 | +// } | ||
| 35 | +// if (StringUtil.isBlank(data.getMainIndustry())) { | ||
| 36 | +// throw new DefaultClientException( | ||
| 37 | +// "第" + context.readRowHolder().getRowIndex() + "行“主要行业”不能为空"); | ||
| 38 | +// } | ||
| 39 | +// if (StringUtil.isBlank(data.getOccupationDays())) { | ||
| 40 | +// throw new DefaultClientException( | ||
| 41 | +// "第" + context.readRowHolder().getRowIndex() + "行“占用天数”不能为空"); | ||
| 42 | +// } | ||
| 43 | +// if (StringUtil.isBlank(data.getProfitPerTon())) { | ||
| 44 | +// throw new DefaultClientException( | ||
| 45 | +// "第" + context.readRowHolder().getRowIndex() + "行“吨盈利”不能为空"); | ||
| 46 | +// } | ||
| 47 | +// if (StringUtil.isBlank(data.getCompanySettlementPeriod())) { | ||
| 48 | +// throw new DefaultClientException( | ||
| 49 | +// "第" + context.readRowHolder().getRowIndex() + "行“结算期限”不能为空"); | ||
| 50 | +// } | ||
| 51 | +// if (StringUtil.isBlank(data.getCompanyCreditLimit())) { | ||
| 52 | +// throw new DefaultClientException( | ||
| 53 | +// "第" + context.readRowHolder().getRowIndex() + "行“授信额度”不能为空"); | ||
| 54 | +// } | ||
| 55 | +// if (StringUtil.isBlank(data.getCompanyMaterialSupplyPlan())) { | ||
| 56 | +// throw new DefaultClientException( | ||
| 57 | +// "第" + context.readRowHolder().getRowIndex() + "行“加工操作方案”不能为空"); | ||
| 58 | +// } | ||
| 59 | +// if (StringUtil.isBlank(data.getCompanySuggestedCategory())) { | ||
| 60 | +// throw new DefaultClientException( | ||
| 61 | +// "第" + context.readRowHolder().getRowIndex() + "行“客户分类”不能为空"); | ||
| 62 | +// } | ||
| 63 | //客户分类 | 63 | //客户分类 |
| 64 | if (StringUtil.isNotEmpty(data.getCompanySuggestedCategory()) && !validValues.contains(data.getCompanySuggestedCategory())) { | 64 | if (StringUtil.isNotEmpty(data.getCompanySuggestedCategory()) && !validValues.contains(data.getCompanySuggestedCategory())) { |
| 65 | throw new DefaultClientException( | 65 | throw new DefaultClientException( |
| @@ -79,6 +79,25 @@ public class CustomerCreditChangeImportListener extends ExcelImportListener<Cust | @@ -79,6 +79,25 @@ public class CustomerCreditChangeImportListener extends ExcelImportListener<Cust | ||
| 79 | throw new DefaultClientException( | 79 | throw new DefaultClientException( |
| 80 | "第" + context.readRowHolder().getRowIndex() + "行“编号”系统中不存在或未审核通过"); | 80 | "第" + context.readRowHolder().getRowIndex() + "行“编号”系统中不存在或未审核通过"); |
| 81 | } | 81 | } |
| 82 | + CustomerCredit customerCredit = query.get(0); | ||
| 83 | + if (StringUtil.isBlank(data.getAnnualTotalSales())) { | ||
| 84 | + data.setAnnualTotalSales(customerCredit.getAnnualTotalSales()); | ||
| 85 | + } | ||
| 86 | + if (StringUtil.isBlank(data.getMainIndustry())) { | ||
| 87 | + data.setMainIndustry(customerCredit.getMainIndustry()); | ||
| 88 | + } | ||
| 89 | + if (StringUtil.isBlank(data.getCompanySettlementPeriod())) { | ||
| 90 | + data.setCompanySettlementPeriod(customerCredit.getCompanySettlementPeriod()); | ||
| 91 | + } | ||
| 92 | + if (StringUtil.isBlank(data.getCompanyCreditLimit())) { | ||
| 93 | + data.setCompanyCreditLimit(customerCredit.getCompanyCreditLimit()); | ||
| 94 | + } | ||
| 95 | + if (StringUtil.isBlank(data.getCompanyMaterialSupplyPlan())) { | ||
| 96 | + data.setCompanyMaterialSupplyPlan(customerCredit.getCompanyMaterialSupplyPlan()); | ||
| 97 | + } | ||
| 98 | + if (StringUtil.isBlank(data.getCompanySuggestedCategory())) { | ||
| 99 | + data.setCompanySuggestedCategory(customerCredit.getCompanySuggestedCategory()); | ||
| 100 | + } | ||
| 82 | 101 | ||
| 83 | } | 102 | } |
| 84 | 103 |