|
|
@@ -23,6 +23,7 @@ import org.springblade.core.secure.utils.SecureUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
+import org.springblade.core.tool.utils.StringUtil;
|
|
|
import org.springblade.factory.annotation.VersionControl;
|
|
|
import org.springblade.factory.dto.TireSalesPolicyDto;
|
|
|
import org.springblade.factory.entity.TireDealerOrderItem;
|
|
|
@@ -44,6 +45,7 @@ import javax.validation.Valid;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
@@ -190,6 +192,23 @@ public class TireSalesPolicyController extends BladeController {
|
|
|
if (CollectionUtils.isEmpty(excelList)) {
|
|
|
return R.fail("数据不能为空");
|
|
|
}
|
|
|
+ for (SalesPolicyTemplateExcel item : excelList) {
|
|
|
+ if (Objects.nonNull(item.getSize())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(item.getSpecification())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ int index = item.getSpecification().indexOf("R");
|
|
|
+ if (index == -1) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ item.setSize(Integer.parseInt(item.getSpecification().substring(index + 1, index + 3)));
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ // 忽略解析错误
|
|
|
+ }
|
|
|
+ }
|
|
|
List<SalesPolicyTemplateExcel> notNullList = excelList.stream()
|
|
|
.filter(this::hasAnyKeyField)
|
|
|
.collect(Collectors.toList());
|