From 78034bb3554377b40b8631021d572bfc82fe5ec2 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Mon, 18 Nov 2024 19:48:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E9=80=89=E5=85=A5?= =?UTF-8?q?=20=E8=80=97=E6=9D=90=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../req/thrsys/AddThrDiProductsRequest.java | 1 + .../thrsys/impl/ThrProductsAddDiService.java | 34 +++++++++++++++---- .../mapper/thrsys/ThrProductsAddDiDao.xml | 4 +-- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/glxp/api/req/thrsys/AddThrDiProductsRequest.java b/src/main/java/com/glxp/api/req/thrsys/AddThrDiProductsRequest.java index 71a73457..192b034c 100644 --- a/src/main/java/com/glxp/api/req/thrsys/AddThrDiProductsRequest.java +++ b/src/main/java/com/glxp/api/req/thrsys/AddThrDiProductsRequest.java @@ -99,5 +99,6 @@ public class AddThrDiProductsRequest { private Integer sourceType; + private Integer productsType; } diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsAddDiService.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsAddDiService.java index 4f6523e0..e25124f6 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsAddDiService.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsAddDiService.java @@ -151,16 +151,36 @@ public class ThrProductsAddDiService extends ServiceImpl= 7) { - Integer catalogcode1 = Integer.valueOf(catalogcode.substring(1, 3)); - Integer catalogcode2 = Integer.valueOf(catalogcode1 + catalogcode.substring(3, 5)); - Integer catalogcode3 = Integer.valueOf(catalogcode2 + catalogcode.substring(5, 7)); - thrProductsAddDiEntity.setCatalogCode1(catalogcode1); - thrProductsAddDiEntity.setCatalogCode2(catalogcode2); - thrProductsAddDiEntity.setCatalogCode3(catalogcode3); + + try { + if (StrUtil.isNotEmpty(catalogcode) && catalogcode.length() >= 7) { + Integer catalogcode1 = Integer.valueOf(catalogcode.substring(1, 3)); + Integer catalogcode2 = Integer.valueOf(catalogcode1 + catalogcode.substring(3, 5)); + Integer catalogcode3 = Integer.valueOf(catalogcode2 + catalogcode.substring(5, 7)); + thrProductsAddDiEntity.setCatalogCode1(catalogcode1); + thrProductsAddDiEntity.setCatalogCode2(catalogcode2); + thrProductsAddDiEntity.setCatalogCode3(catalogcode3); + } + } catch (Exception e) { + + } +// if (StrUtil.isNotEmpty(catalogcode) && catalogcode.length() >= 7) { +// Integer catalogcode1 = Integer.valueOf(catalogcode.substring(1, 3)); +// Integer catalogcode2 = Integer.valueOf(catalogcode1 + catalogcode.substring(3, 5)); +// Integer catalogcode3 = Integer.valueOf(catalogcode2 + catalogcode.substring(5, 7)); +// thrProductsAddDiEntity.setCatalogCode1(catalogcode1); +// thrProductsAddDiEntity.setCatalogCode2(catalogcode2); +// thrProductsAddDiEntity.setCatalogCode3(catalogcode3); +// } String internalMaterialCode = this.getInternalMaterialCode("10","66"); thrProductsAddDiEntity.setInternalMaterialCode(internalMaterialCode); list.add(thrProductsAddDiEntity); diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrProductsAddDiDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrProductsAddDiDao.xml index b77d02e3..3db68b93 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThrProductsAddDiDao.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThrProductsAddDiDao.xml @@ -25,7 +25,7 @@ catalogCode1, catalogCode2, catalogCode3, - matrial, addStatus) + matrial, addStatus,productsType) values (#{item.uuid}, @@ -58,7 +58,7 @@ #{item.catalogCode1}, #{item.catalogCode2}, #{item.catalogCode3}, - #{item.matrial}, #{item.addStatus}) + #{item.matrial}, #{item.addStatus},#{item.productsType})