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})