From 9f17dcafbbe2e4a56329920b3d226c4784b96bf3 Mon Sep 17 00:00:00 2001 From: Chopper711 Date: Fri, 21 Jul 2023 18:45:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=AF=BC=E5=85=A5=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E4=B8=8D=E5=A4=9F=E6=98=8E=E7=A1=AE=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods/serviceimpl/GoodsImportServiceImpl.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsImportServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsImportServiceImpl.java index 349ac5d9..bcf056c2 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsImportServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsImportServiceImpl.java @@ -175,14 +175,24 @@ public class GoodsImportServiceImpl implements GoodsImportService { } } - String categoryId = objects.get(2).toString().substring(0, objects.get(2).toString().indexOf("-")); + String categoryId = null; + try { + categoryId = objects.get(2).toString().substring(0, objects.get(2).toString().indexOf("-")); + } catch (Exception e) { + throw new ServiceException("请选择商品分类"); + } Category category = categoryService.getCategoryById(categoryId); if (category == null) { throw new ServiceException("商品分类不存在:" + objects.get(2).toString().substring(objects.get(2).toString().indexOf("-"))); } - String templateId = objects.get(3).toString().substring(0, objects.get(3).toString().indexOf("-")); + String templateId = null; + try { + templateId = objects.get(3).toString().substring(0, objects.get(3).toString().indexOf("-")); + } catch (Exception e) { + throw new ServiceException("请选择物流模板"); + } FreightTemplateVO freightTemplateVO = freightTemplateService.getFreightTemplate(templateId); if (freightTemplateVO == null) { throw new ServiceException("配送模板不存在:" + objects.get(3).toString().substring(objects.get(3).toString().indexOf("-")));