|
@@ -11,6 +11,7 @@ import com.management.platform.util.HttpRespMsg;
|
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -89,13 +90,17 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
|
|
|
nameList.add(row.getCell(1).toString());
|
|
|
CustomerInfo customerInfo=new CustomerInfo();
|
|
|
List<CustomerInfo> collect = allCustomerInfo.stream().filter(sv -> sv.getCustomerName().equals(row.getCell(1).toString())).collect(Collectors.toList());
|
|
|
- customerInfo.setCustomerCode(row.getCell(0).toString());
|
|
|
- customerInfo.setCustomerName(row.getCell(1).toString());
|
|
|
- customerInfo.setContactName(row.getCell(2).toString());
|
|
|
- row.getCell(3).setCellType(CellType.STRING);
|
|
|
- customerInfo.setContactPhone(row.getCell(3).getStringCellValue());
|
|
|
- customerInfo.setEmail(row.getCell(4).toString());
|
|
|
- customerInfo.setAddress(row.getCell(5).toString());
|
|
|
+ customerInfo.setCustomerCode(StringUtils.isEmpty(row.getCell(0))?"":row.getCell(0).toString());
|
|
|
+ customerInfo.setCustomerName(StringUtils.isEmpty(row.getCell(1))?"":row.getCell(1).toString());
|
|
|
+ customerInfo.setContactName(StringUtils.isEmpty(row.getCell(2))?"":row.getCell(2).toString());
|
|
|
+ if(StringUtils.isEmpty(row.getCell(3))){
|
|
|
+ customerInfo.setContactPhone("");
|
|
|
+ }else {
|
|
|
+ row.getCell(3).setCellType(CellType.STRING);
|
|
|
+ customerInfo.setContactPhone(row.getCell(3).getStringCellValue());
|
|
|
+ }
|
|
|
+ customerInfo.setEmail(StringUtils.isEmpty(row.getCell(3))?"":row.getCell(3).toString());
|
|
|
+ customerInfo.setAddress(StringUtils.isEmpty(row.getCell(4))?"":row.getCell(4).toString());
|
|
|
customerInfo.setCompanyId(companyId);
|
|
|
if(collect.size()>0){
|
|
|
Integer id=collect.get(0).getId();
|