订单导入修改

product
杨世强 1 year ago
parent 72f609f124
commit a6735a7302

@ -3,7 +3,10 @@ package jnpf.util;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.result.ExcelVerifyHandlerResult;
import io.netty.util.internal.ObjectUtil;
import lombok.Cleanup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
@ -19,6 +22,7 @@ import java.util.List;
*/
public class ExcelUtil {
/**
* excel
* @param filePath
@ -60,6 +64,7 @@ public class ExcelUtil {
ImportParams params = new ImportParams();
params.setTitleRows(titleRows);
params.setHeadRows(headerRows);
// params.setVerifyHandler(verifyHandler);
List<T> list = null;
try {
list = ExcelImportUtil.importExcel(file, pojoClass, params);

@ -276,6 +276,10 @@ public class PoundlistServiceImpl extends ServiceImpl<PoundlistMapper, Poundlist
for (int i = 0; i < personList.size(); i++) {
Map<String, Object> dataRowMap = new HashMap<>();
PoundlistEntity model = personList.get(i);
if (StringUtils.isBlank(model.getCustomerName()) && StringUtils.isBlank(model.getVehicleName()) && model.getGrossWeight() == null
&& model.getTareWeight() == null && model.getSettlement() == null && StringUtils.isBlank(model.getUnit())
&& model.getSalesPrice()==null && StringUtils.isBlank(model.getSalesAmount())) {
}else{
dataRowMap.put("customerName", model.getCustomerName());
dataRowMap.put("vehicleName", model.getVehicleName());
dataRowMap.put("grossWeight", model.getGrossWeight());
@ -286,6 +290,7 @@ public class PoundlistServiceImpl extends ServiceImpl<PoundlistMapper, Poundlist
dataRowMap.put("salesAmount", model.getSalesAmount());
dataRow.add(dataRowMap);
}
}
for (int i = 1; i < 10; i++) {
Map<String, Object> columnsMap = new HashMap<>();
columnsMap.put("AllowDBNull", true);

Loading…
Cancel
Save