From 4aec9d851cb10b9e3162102bc9973a2eb9a652b3 Mon Sep 17 00:00:00 2001 From: Rui_Li <877258667@qq.com> Date: Mon, 6 Jan 2025 14:34:20 +0800 Subject: [PATCH] =?UTF-8?q?ifs=20=E9=85=8D=E6=96=B9=20jar=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/spring/ifs/bean/BaseSearchBean.java | 2 +- .../com/spring/ifs/bean/BomServiceBean.java | 2 +- .../spring/ifs/bean/InventoryServiceBean.java | 32 +++++++++---------- .../spring/ifs/bean/MasterServiceBean.java | 6 ++-- .../spring/ifs/bean/RecipeServiceBean.java | 32 +++++++++---------- .../spring/ifs/bean/RoutingServiceBean.java | 30 ++++++++--------- .../spring/ifs/bean/TechnicalClassBean.java | 10 +++--- .../com/spring/ifs/bean/ToolServiceBean.java | 24 +++++++------- 8 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/main/java/com/spring/ifs/bean/BaseSearchBean.java b/src/main/java/com/spring/ifs/bean/BaseSearchBean.java index d79ca6f8..885b3f09 100644 --- a/src/main/java/com/spring/ifs/bean/BaseSearchBean.java +++ b/src/main/java/com/spring/ifs/bean/BaseSearchBean.java @@ -67,7 +67,7 @@ public class BaseSearchBean { int startIndex = i * pageSize; List tempList = BaseSearchApi.getWarehouseLocations(srv, siteCon, ifsRowVersion, startIndex, pageSize); //判断查询是否结束 - if(tempList != null && tempList.size() > 0) { + if(tempList.size() > 0) { resultList.addAll(tempList); }else { break; diff --git a/src/main/java/com/spring/ifs/bean/BomServiceBean.java b/src/main/java/com/spring/ifs/bean/BomServiceBean.java index a3e6d92a..58191da9 100644 --- a/src/main/java/com/spring/ifs/bean/BomServiceBean.java +++ b/src/main/java/com/spring/ifs/bean/BomServiceBean.java @@ -460,7 +460,7 @@ public class BomServiceBean { //查询结果集 List resultList = BomApi.getBomItems(srv, contract, partNo, engChgLevel, bomType, alternativeNo, lineItemNo); //判断是否查询数据 - if(resultList == null ||resultList.size() == 0 || resultList.isEmpty()) { + if(resultList.size() == 0 || resultList.isEmpty()) { throw new APException("不存在此bom组件信息!"); } returnMap.put("resultCode", "200"); diff --git a/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java b/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java index a0bf6197..2026b3e6 100644 --- a/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java +++ b/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java @@ -85,7 +85,7 @@ public class InventoryServiceBean { //获取数据 Map partMap = InventoryPartApi.getInventoryPartByPartNo(srv, contract, partNo); //判断是否需要插入到ifs - if(partMap == null || partMap.size() == 0) { + if(partMap == null || partMap.isEmpty()) { //调用api Map resultMap = InventoryPartApi.insertInventoryPart(srv, inData); //设置ifs 信息 @@ -123,7 +123,7 @@ public class InventoryServiceBean { //获取数据 Map partMap = InventoryPartApi.getInventoryPartByPartNo(srv, contract, partNo); //判断是否需要插入到ifs - if(partMap == null || partMap.size() == 0) { + if(partMap == null || partMap.isEmpty()) { throw new APException("域:"+contract+"库存件:"+partNo+"不存在!"); }else { //设置ifs 信息 @@ -199,7 +199,7 @@ public class InventoryServiceBean { //获取数据 Map partMap = InventoryPartApi.getInventoryPartConfig(srv, contract, partNo); //判断是否需要插入到ifs - if(partMap == null || partMap.size() == 0) { + if(partMap == null || partMap.isEmpty()) { throw new APException("域:"+contract+"库存件:"+partNo+"不存在!"); }else { //设置ifs 信息 @@ -238,7 +238,7 @@ public class InventoryServiceBean { //获取数据 Map partMap = InventoryPartApi.getInventoryPartByPartNo(srv, contract, partNo); //判断是否需要插入到ifs - if(partMap == null || partMap.size() == 0) { + if(partMap == null || partMap.isEmpty()) { throw new APException("域:"+contract+"库存件:"+partNo+"不存在!"); }else { //获取库存件Plan配置的信息 @@ -279,7 +279,7 @@ public class InventoryServiceBean { //获取数据 Map partMap = InventoryPartApi.getInventoryPartByPartNo(srv, contract, partNo); //判断是否需要插入到ifs - if(partMap == null || partMap.size() == 0) { + if(partMap == null || partMap.isEmpty()) { throw new APException("域:" + contract + "库存件:" + partNo + "不存在!"); } //编辑处理需要处理的数据 @@ -318,7 +318,7 @@ public class InventoryServiceBean { //获取数据 Map locationMap = InventoryPartApi.getInventoryPartLocation(srv, contract, partNo, locationNo); //判断是否需要插入到ifs - if(locationMap == null || locationMap.size() == 0) { + if(locationMap == null || locationMap.isEmpty()) { throw new APException("域:" + contract + "库存件:" + partNo + "库位编码:" + locationNo +"不存在!"); } //设置ifs 信息 @@ -357,7 +357,7 @@ public class InventoryServiceBean { //获取库存件Plan配置的信息 Map locationMap = InventoryPartApi.getInventoryPartLocation(srv, contract, partNo, locationNo); //判断是否需要插入到ifs - if(locationMap == null || locationMap.size() == 0) { + if(locationMap == null || locationMap.isEmpty()) { throw new APException("域:" + contract + "库存件:" + partNo + "库位编码:" + locationNo +"不存在!"); } //设置ifs 信息 @@ -394,7 +394,7 @@ public class InventoryServiceBean { //查询制造商信息 Map manufMap = InventoryPartApi.getInventoryManufacture(srv, contract, partNo); //判断是否需要插入到ifs - if(manufMap == null || manufMap.size() == 0) { + if(manufMap == null || manufMap.isEmpty()) { throw new APException("域:"+contract+"库存件:"+partNo+"不存在制造商信息!"); }else { //设置ifs 信息 @@ -434,7 +434,7 @@ public class InventoryServiceBean { //获取数据 Map revisionMap = InventoryPartApi.getInventoryPartRevision(srv, contract, partNo, engChgLevel); //判断是否需要插入到ifs - if(revisionMap == null || revisionMap.size() == 0) { + if(revisionMap == null || revisionMap.isEmpty()) { revisionMap.put("resultCode", "400"); revisionMap.put("resultMsg", "当前版本信息不存在!"); }else{ @@ -511,7 +511,7 @@ public class InventoryServiceBean { //获取数据 Map revisionMap = InventoryPartApi.getInventoryPartRevision(srv, contract, partNo, engChgLevel); //判断是否需要插入到ifs - if(revisionMap == null || revisionMap.size() == 0) { + if(revisionMap == null || revisionMap.isEmpty()) { throw new APException("当前版本信息不存在!"); } //设置ifs 信息 @@ -551,7 +551,7 @@ public class InventoryServiceBean { //获取数据 Map revisionMap = InventoryPartApi.getInventoryPartRevision(srv, contract, partNo, engChgLevel); //判断是否需要插入到ifs - if(revisionMap == null || revisionMap.size() == 0) { + if(revisionMap == null || revisionMap.isEmpty()) { throw new APException("当前版本信息不存在!"); } //设置ifs 信息 @@ -589,7 +589,7 @@ public class InventoryServiceBean { for(PartIfsInventoryProperty characteristic : inDatas) { String characteristicCode = characteristic.getCharacteristicCode(); Map characteristicMap = InventoryPartApi.getInventoryPartCharacteristicCode(srv, contract, partNo, characteristicCode); - if(characteristicMap != null && characteristicMap.size() > 0) { + if(characteristicMap != null && !characteristicMap.isEmpty()) { throw new APException("属性编码已存在!"); } //校验通过继续新增 @@ -627,7 +627,7 @@ public class InventoryServiceBean { //查询当前物料的属性 先删除物料属性 再删除库存件 List characteristicList = InventoryPartApi.getInventoryPartCharacteristicCodes(srv, contract, partNo); //如果存在就批量删掉数据 - if(characteristicList != null && characteristicList.size() > 0) { + if(!characteristicList.isEmpty()) { for(PartIfsInventoryProperty characteristic : characteristicList) { //一个一个删掉库存件的属性 InventoryPartApi.removeInventoryPartCharacteristic(srv, characteristic); @@ -662,7 +662,7 @@ public class InventoryServiceBean { //按照条件查询Bom的相关信息 按照海波的要求 删除Bom Header List bomHeaders = BomApi.getBomHeadersByPartNo(srv, contract, partNo); //判断是否存在 - if(bomHeaders != null && bomHeaders.size() > 0) { + if(!bomHeaders.isEmpty()) { for(BomIfsHeader bomHeader : bomHeaders) { //执行删除的操作 BomApi.removeBomHeader(srv, bomHeader); @@ -672,7 +672,7 @@ public class InventoryServiceBean { //按照条件查询Routing的相关信息 按照海波的要求 List routingHeaders = RoutingApi.getRoutingHeadersByPartNo(srv, contract, partNo); //判断是否存在 - if(routingHeaders != null && routingHeaders.size() > 0) { + if(!routingHeaders.isEmpty()) { for(RoutingIfsHeader routingHeader : routingHeaders) { //执行删除的操作 RoutingApi.removeRoutingHeader(srv, routingHeader); @@ -686,7 +686,7 @@ public class InventoryServiceBean { //查询当前物料的属性 先删除物料属性 再删除库存件 List characteristicCodes = InventoryPartApi.getInventoryPartCharacteristicCodes(srv, contract, partNo); //如果存在就批量删掉数据 - if(characteristicCodes.size() > 0) { + if(!characteristicCodes.isEmpty()) { for(PartIfsInventoryProperty characteristic : characteristicCodes) { //一个一个删掉库存件的属性 InventoryPartApi.removeInventoryPartCharacteristic(srv, characteristic); diff --git a/src/main/java/com/spring/ifs/bean/MasterServiceBean.java b/src/main/java/com/spring/ifs/bean/MasterServiceBean.java index 3efe2a95..dd14da2c 100644 --- a/src/main/java/com/spring/ifs/bean/MasterServiceBean.java +++ b/src/main/java/com/spring/ifs/bean/MasterServiceBean.java @@ -73,7 +73,7 @@ public class MasterServiceBean { try{ Map partMap = MasterPartApi.getMasterPart(srv, partNo); //判断是否需要插入到ifs - if(partMap == null || partMap.size() == 0) { + if(partMap == null || partMap.isEmpty()) { Map resultMap = MasterPartApi.insertMasterPart(srv, inData); //设置ifs 信息 inData.setIfsRowId(resultMap.get("OBJID")); @@ -109,7 +109,7 @@ public class MasterServiceBean { //查询数据 Map partMap = MasterPartApi.getMasterPart(srv, partNo); //判断是否需要插入到ifs - if (partMap == null && partMap.size() == 0) { + if (partMap == null || partMap.isEmpty()) { throw new APException("物料件不存在!"); } else { //设置ifs 信息 @@ -146,7 +146,7 @@ public class MasterServiceBean { try{ Map partMap = MasterPartApi.getMasterPart(srv, partNo); //判断是否需要插入到ifs - if(partMap == null && partMap.size() == 0) { + if(partMap == null || partMap.isEmpty()) { throw new APException("物料件不存在!"); }else { //设置ifs 信息 diff --git a/src/main/java/com/spring/ifs/bean/RecipeServiceBean.java b/src/main/java/com/spring/ifs/bean/RecipeServiceBean.java index 6659359a..cc6f241b 100644 --- a/src/main/java/com/spring/ifs/bean/RecipeServiceBean.java +++ b/src/main/java/com/spring/ifs/bean/RecipeServiceBean.java @@ -51,7 +51,7 @@ public class RecipeServiceBean { //查询数据 Map RecipeMap = RecipeApi.getRecipeHeader(srv, contract, partNo, engChgLevel, bomType); //判断是否需要插入到ifs - if(RecipeMap == null || RecipeMap.size() == 0) { + if(RecipeMap == null || RecipeMap.isEmpty()) { throw new RuntimeException("Recipe不存在!"); } //设置ifs 信息 @@ -88,7 +88,7 @@ public class RecipeServiceBean { //查询数据 Map RecipeMap = RecipeApi.getRecipeHeader(srv, contract, partNo, engChgLevel, bomType); //判断是否需要插入到ifs - if(RecipeMap != null && RecipeMap.size() > 0) { + if(RecipeMap != null && !RecipeMap.isEmpty()) { throw new APException("Recipe已存在!"); } @@ -128,7 +128,7 @@ public class RecipeServiceBean { //查询数据 Map RecipeMap = RecipeApi.getRecipeHeader(srv, contract, partNo, engChgLevel, bomType); //判断是否需要插入到ifs - if(RecipeMap == null || RecipeMap.size() == 0) { + if(RecipeMap == null || RecipeMap.isEmpty()) { throw new APException("Recipe不存在!"); } //设置ifs 信息 @@ -168,7 +168,7 @@ public class RecipeServiceBean { //查询数据 Map RecipeMap = RecipeApi.getRecipeHeader(srv, contract, partNo, engChgLevel, bomType); //判断是否需要插入到ifs - if(RecipeMap == null || RecipeMap.size() == 0) { + if(RecipeMap == null || RecipeMap.isEmpty()) { throw new APException("Recipe不存在!"); } //设置ifs 信息 @@ -245,7 +245,7 @@ public class RecipeServiceBean { //查询数据 Map alternativeMap = RecipeApi.getRecipeAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap != null && alternativeMap.size() > 0) { + if(alternativeMap != null && !alternativeMap.isEmpty()) { throw new APException("Recipe Alternative 已存在!"); } @@ -286,7 +286,7 @@ public class RecipeServiceBean { //查询数据 Map alternativeMap = RecipeApi.getRecipeAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Recipe Alternative不存在!"); } //设置ifs 信息 @@ -329,7 +329,7 @@ public class RecipeServiceBean { //查询数据 Map alternativeMap = RecipeApi.getRecipeAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Recipe Alternative不存在!"); } //设置ifs 信息 @@ -369,7 +369,7 @@ public class RecipeServiceBean { //查询数据 Map alternativeMap = RecipeApi.getRecipeAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Recipe Alternative不存在!"); } //设置ifs 信息 @@ -411,7 +411,7 @@ public class RecipeServiceBean { //查询数据 Map alternativeMap = RecipeApi.getRecipeAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Recipe Alternative不存在!"); } //设置ifs 信息 @@ -453,13 +453,13 @@ public class RecipeServiceBean { //查询数据 Map alternativeMap = RecipeApi.getRecipeAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Recipe Alternative不存在!"); } //查询结果集 List resultList = RecipeApi.getRecipeItems(srv, contract, partNo, engChgLevel, bomType, alternativeNo, lineItemNo); //判断是否查询数据 - if(resultList == null ||resultList.size() == 0 || resultList.isEmpty()) { + if(resultList.isEmpty()) { throw new APException("不存在此查Recipe组件信息!"); } returnMap.put("resultCode", "200"); @@ -495,7 +495,7 @@ public class RecipeServiceBean { //查询数据 Map alternativeMap = RecipeApi.getRecipeAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Recipe Alternative不存在!"); } //查询结果集 @@ -553,7 +553,7 @@ public class RecipeServiceBean { //查询结果集 List itemList = RecipeApi.getRecipeItems(srv, contract, partNo, engChgLevel, bomType, alternativeNo, lineItemNo); //打印查询出的日志 - if(itemList != null && itemList.size() > 0){ + if(!itemList.isEmpty()){ throw new APException("已存在此查Recipe组件信息!"); } //调用api @@ -594,13 +594,13 @@ public class RecipeServiceBean { //查询数据 Map alternativeMap = RecipeApi.getRecipeAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Recipe Alternative不存在!"); } //查询结果集 List resultList = RecipeApi.getRecipeItems(srv, contract, partNo, engChgLevel, bomType, alternativeNo, lineItemNo); //判断是否查询数据 - if(resultList.size() == 0 || resultList.isEmpty()) { + if(resultList.isEmpty()) { throw new APException("不存在此Recipe组件信息!"); } @@ -702,7 +702,7 @@ public class RecipeServiceBean { List itemList = RecipeApi.getRecipeItems(srv, contract, partNo, engChgLevel, bomType, alternativeNo, lineItemNo); // 判断是否已经存在 - if (itemList == null || itemList.isEmpty()) { + if (itemList.isEmpty()) { throw new APException("不存在此Recipe组件信息! LineItemNo:" + lineItemNo); } diff --git a/src/main/java/com/spring/ifs/bean/RoutingServiceBean.java b/src/main/java/com/spring/ifs/bean/RoutingServiceBean.java index e178a7bb..740f3b81 100644 --- a/src/main/java/com/spring/ifs/bean/RoutingServiceBean.java +++ b/src/main/java/com/spring/ifs/bean/RoutingServiceBean.java @@ -49,7 +49,7 @@ public class RoutingServiceBean { //查询相关 Map routingMap = RoutingApi.getRoutingHeader(srv, contract, partNo, routingRevision, routingType); //判断是否需要插入到ifs - if(routingMap == null || routingMap.size() == 0) { + if(routingMap == null || routingMap.isEmpty()) { throw new APException("Routing Header不存在!"); } //设置ifs 信息 @@ -86,7 +86,7 @@ public class RoutingServiceBean { //查询相关 Map routingMap = RoutingApi.getRoutingHeader(srv, contract, partNo, routingRevision, routingType); //判断是否需要插入到ifs - if(routingMap != null && routingMap.size() > 0) { + if(routingMap != null && !routingMap.isEmpty()) { throw new APException("Routing已存在!"); } @@ -126,7 +126,7 @@ public class RoutingServiceBean { //查询相关 Map routingMap = RoutingApi.getRoutingHeader(srv, contract, partNo, routingRevision, routingType); //判断是否需要插入到ifs - if(routingMap == null || routingMap.size() == 0) { + if(routingMap == null || routingMap.isEmpty()) { throw new APException("Routing不存在!"); } //设置ifs 信息 @@ -166,7 +166,7 @@ public class RoutingServiceBean { //查询相关 Map routingMap = RoutingApi.getRoutingHeader(srv, contract, partNo, routingRevision, routingType); //判断是否需要插入到ifs - if(routingMap == null || routingMap.size() == 0) { + if(routingMap == null || routingMap.isEmpty()) { throw new APException("Routing不存在!"); } //设置ifs 信息 @@ -205,7 +205,7 @@ public class RoutingServiceBean { //查询Alternative信息 Map alternativeMap = RoutingApi.getRoutingAlternative(srv, contract, partNo, routingRevision, routingType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Routing Alternative 不存在!"); } //设置ifs 信息 @@ -244,7 +244,7 @@ public class RoutingServiceBean { //查询Alternative信息 Map alternativeMap = RoutingApi.getRoutingAlternative(srv, contract, partNo, routingRevision, routingType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap != null && alternativeMap.size() > 0) { + if(alternativeMap != null && !alternativeMap.isEmpty()) { throw new APException("Routing Alternative 已存在!"); } //调用新增api @@ -285,7 +285,7 @@ public class RoutingServiceBean { //查询Alternative信息 Map alternativeMap = RoutingApi.getRoutingAlternative(srv, contract, partNo, routingRevision, routingType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Routing Alternative不存在!"); } //设置ifs 信息 @@ -327,7 +327,7 @@ public class RoutingServiceBean { //查询Alternative信息 Map alternativeMap = RoutingApi.getRoutingAlternative(srv, contract, partNo, routingRevision, routingType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Routing Alternative不存在!"); } //设置ifs 信息 @@ -366,7 +366,7 @@ public class RoutingServiceBean { //查询Alternative信息 Map alternativeMap = RoutingApi.getRoutingAlternative(srv, contract, partNo, routingRevision, routingType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Routing Alternative不存在!"); } //设置ifs 信息 @@ -408,7 +408,7 @@ public class RoutingServiceBean { //查询Alternative信息 Map alternativeMap = RoutingApi.getRoutingAlternative(srv, contract, partNo, routingRevision, routingType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Routing Alternative不存在!"); } //设置ifs 信息 @@ -450,13 +450,13 @@ public class RoutingServiceBean { //查询Alternative信息 Map alternativeMap = RoutingApi.getRoutingAlternative(srv, contract, partNo, routingRevision, routingType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Routing Alternative不存在!"); } //查询结果集 List resultList = RoutingApi.getRoutingItems(srv, contract, partNo, routingRevision, routingType, alternativeNo, operationNo); //判断是否查询数据 - if(resultList.size() == 0 || resultList.isEmpty()) { + if(resultList.isEmpty()) { throw new APException("不存在此Routing组件信息!"); } returnMap.put("resultCode", "200"); @@ -492,7 +492,7 @@ public class RoutingServiceBean { //查询制造商信息 Map alternativeMap = RoutingApi.getRoutingAlternative(srv, contract, partNo, routingRevision, routingType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Routing Alternative不存在!"); } //查询结果集 @@ -550,13 +550,13 @@ public class RoutingServiceBean { //查询制造商信息 Map alternativeMap = RoutingApi.getRoutingAlternative(srv, contract, partNo, routingRevision, routingType, alternativeNo); //判断是否需要插入到ifs - if(alternativeMap == null || alternativeMap.size() == 0) { + if(alternativeMap == null || alternativeMap.isEmpty()) { throw new APException("Routing Alternative不存在!"); } //查询结果集 List resultList = RoutingApi.getRoutingItems(srv, contract, partNo, routingRevision, routingType, alternativeNo, operationNo); //判断是否查询数据 - if(resultList.size() == 0 || resultList.isEmpty()) { + if(resultList.isEmpty()) { throw new APException("不存在此Routing组件信息!"); } diff --git a/src/main/java/com/spring/ifs/bean/TechnicalClassBean.java b/src/main/java/com/spring/ifs/bean/TechnicalClassBean.java index 0990473d..f2893717 100644 --- a/src/main/java/com/spring/ifs/bean/TechnicalClassBean.java +++ b/src/main/java/com/spring/ifs/bean/TechnicalClassBean.java @@ -82,7 +82,7 @@ public class TechnicalClassBean { //查询对象 Map technicalMap = TechnicalClassApi.getTechnicalClass(srv, luName, keyRef); //判断查询导数据 - if(technicalMap != null && technicalMap.size() > 0) { + if(technicalMap != null && !technicalMap.isEmpty()) { throw new APException("已存在此技术等级的信息!"); } @@ -119,7 +119,7 @@ public class TechnicalClassBean { //查询对象 Map technicalMap = TechnicalClassApi.getTechnicalClass(srv, luName, keyRef); //判断查询导数据 - if(technicalMap == null || technicalMap.size() == 0) { + if(technicalMap == null || technicalMap.isEmpty()) { throw new APException("不存在此技术等级的信息!"); } //设置IFS的信息 @@ -159,7 +159,7 @@ public class TechnicalClassBean { //查询对象 Map technicalMap = TechnicalClassApi.getTechnicalClass(srv, luName, keyRef); //判断查询导数据 - if(technicalMap == null || technicalMap.size() == 0) { + if(technicalMap == null || technicalMap.isEmpty()) { throw new APException("不存在此技术等级的信息!"); } //设置IFS的信息 @@ -198,7 +198,7 @@ public class TechnicalClassBean { Map technicalMap = TechnicalClassApi.getTechnicalClass(srv, luName, keyRef); //判断查询导数据 //判断查询导数据 - if(technicalMap == null || technicalMap.size() == 0) { + if(technicalMap == null || technicalMap.isEmpty()) { throw new APException("不存在此技术等级的信息!"); } //设置唯一键和版本 @@ -209,7 +209,7 @@ public class TechnicalClassBean { String attribute = tempData.getAttribute(); //查询属性信息 Map attributeMap = TechnicalClassApi.getTechnicalAttribute(srv, technicalSpecNo, technicalClass, attribute); - if(attributeMap == null || attributeMap.size() == 0) { + if(attributeMap == null || attributeMap.isEmpty()) { throw new APException("不存在此技术等级的属性信息!"); } //设置替代的ifs的key diff --git a/src/main/java/com/spring/ifs/bean/ToolServiceBean.java b/src/main/java/com/spring/ifs/bean/ToolServiceBean.java index d2042d96..279578fd 100644 --- a/src/main/java/com/spring/ifs/bean/ToolServiceBean.java +++ b/src/main/java/com/spring/ifs/bean/ToolServiceBean.java @@ -46,7 +46,7 @@ public class ToolServiceBean { try{ Map headerMap = ToolApi.getToolHeader(srv, contract, toolId); //判断是否需要插入到ifs - if(headerMap == null || headerMap.size() == 0) { + if(headerMap == null || headerMap.isEmpty()) { throw new APException("Tool Header不存在!"); } //设置ifs 信息 @@ -80,7 +80,7 @@ public class ToolServiceBean { try{ Map headerMap = ToolApi.getToolHeader(srv, contract, toolId); //判断是否需要插入到ifs - if(headerMap != null && headerMap.size() > 0) { + if(headerMap != null && !headerMap.isEmpty()) { throw new APException("Tool Header已存在!"); } //调用api @@ -117,7 +117,7 @@ public class ToolServiceBean { //查询 Map headerMap = ToolApi.getToolHeader(srv, contract, toolId); //判断是否需要插入到ifs - if(headerMap == null || headerMap.size() == 0) { + if(headerMap == null || headerMap.isEmpty()) { throw new APException("Tool Header不存在!"); } //设置ifs 信息 @@ -156,7 +156,7 @@ public class ToolServiceBean { //查询 Map headerMap = ToolApi.getToolHeader(srv, contract, toolId); //判断是否需要插入到ifs - if(headerMap == null || headerMap.size() == 0) { + if(headerMap == null || headerMap.isEmpty()) { throw new APException("Tool Header不存在!"); } //设置ifs 信息 @@ -229,7 +229,7 @@ public class ToolServiceBean { //查询工具实例的信息 Map instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); //判断是否需要插入到ifs - if(instanceMap != null && instanceMap.size() > 0) { + if(instanceMap != null && !instanceMap.isEmpty()) { throw new APException("Tool Instance 已存在!"); } //调用新增api @@ -267,7 +267,7 @@ public class ToolServiceBean { //查询工具实例的信息 Map instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); //判断是否需要插入到ifs - if(instanceMap == null || instanceMap.size() == 0) { + if(instanceMap == null || instanceMap.isEmpty()) { throw new APException("Tool Instance不存在!"); } //设置ifs 信息 @@ -307,7 +307,7 @@ public class ToolServiceBean { //查询工具实例的信息 Map instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); //判断是否需要插入到ifs - if(instanceMap == null || instanceMap.size() == 0) { + if(instanceMap == null || instanceMap.isEmpty()) { throw new APException("Tool Instance不存在!"); } //设置ifs 信息 @@ -345,13 +345,13 @@ public class ToolServiceBean { //查询制造商信息 Map instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); //判断是否需要插入到ifs - if(instanceMap == null || instanceMap.size() == 0) { + if(instanceMap == null || instanceMap.isEmpty()) { throw new APException("Tool Instance不存在!"); } //查询结果集 List resultList = ToolApi.getToolInstanceDateList(srv, contract, toolId, toolInstance); //判断是否查询数据 - if(resultList.size() == 0 || resultList.isEmpty()) { + if(resultList.isEmpty()) { throw new APException("工具实例不存在时间信息!"); } returnMap.put("resultCode", "200"); @@ -384,7 +384,7 @@ public class ToolServiceBean { //查询制造商信息 Map instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); //判断是否需要插入到ifs - if(instanceMap == null || instanceMap.size() == 0) { + if(instanceMap == null || instanceMap.isEmpty()) { throw new APException("Tool Instance不存在!"); } //调用api @@ -422,7 +422,7 @@ public class ToolServiceBean { //查询制造商信息 Map instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); //判断是否需要插入到ifs - if(instanceMap == null || instanceMap.size() == 0) { + if(instanceMap == null || instanceMap.isEmpty()) { throw new APException("Tool Instance不存在!"); } //调用api @@ -459,7 +459,7 @@ public class ToolServiceBean { //查询制造商信息 Map instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); //判断是否需要插入到ifs - if(instanceMap == null || instanceMap.size() == 0) { + if(instanceMap == null || instanceMap.isEmpty()) { throw new APException("Tool Instance不存在!"); } //调用api删除数据