Index: ssts-web/src/main/java/com/forgon/disinfectsystem/excel/service/CommonImportManagerImpl.java =================================================================== diff -u -r13835 -r14295 --- ssts-web/src/main/java/com/forgon/disinfectsystem/excel/service/CommonImportManagerImpl.java (.../CommonImportManagerImpl.java) (revision 13835) +++ ssts-web/src/main/java/com/forgon/disinfectsystem/excel/service/CommonImportManagerImpl.java (.../CommonImportManagerImpl.java) (revision 14295) @@ -229,37 +229,48 @@ && currentPropertyName == "containerName" && bResult == false && errType == com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_DUPLICATE) { - po = objectDao.getByProperty(Container.class.getSimpleName(), "containerName", value); - json.put("isSuccess", true); - json.put("errorType", com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_SUCCESS); + Container container = (Container)objectDao.getByProperty(Container.class.getSimpleName(), "containerName", value); + if(container != null){ + po = container; + json.put("isSuccess", true); + json.put("errorType", com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_SUCCESS); + } } - // // 如果是供应商名称重复,更新 if( po.getClass() == Supplier.class && currentPropertyName == "companyName" && bResult == false && errType == com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_DUPLICATE) { - po = objectDao.getByProperty(Supplier.class.getSimpleName(), "companyName", value); - json.put("isSuccess", true); - json.put("errorType", com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_SUCCESS); + Supplier supplier = (Supplier)objectDao.getByProperty(Supplier.class.getSimpleName(), "companyName", value); + if( supplier != null){ + po = supplier; + json.put("isSuccess", true); + json.put("errorType", com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_SUCCESS); + } } - // 如果是清洗程序名称重复,更新 + //如果是清洗程序名称重复,更新 if( po.getClass() == CleanMethod.class && currentPropertyName == "cleanMethod" && bResult == false && errType == com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_DUPLICATE) { - po = objectDao.getByProperty(CleanMethod.class.getSimpleName(), "cleanMethod", value); - json.put("isSuccess", true); - json.put("errorType", com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_SUCCESS); + CleanMethod cleanMethod = (CleanMethod)objectDao.getByProperty(CleanMethod.class.getSimpleName(), "cleanMethod", value); + if( cleanMethod != null){ + po = cleanMethod; + json.put("isSuccess", true); + json.put("errorType", com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_SUCCESS); + } } // 如果是灭菌程序名称重复,更新 if( po.getClass() == Sterilisation.class && currentPropertyName == "sterilisation" && bResult == false && errType == com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_DUPLICATE) { - po = objectDao.getByProperty(Sterilisation.class.getSimpleName(), "sterilisation", value); - json.put("isSuccess", true); - json.put("errorType", com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_SUCCESS); + Sterilisation sterilisation = (Sterilisation)objectDao.getByProperty(Sterilisation.class.getSimpleName(), "sterilisation", value); + if(sterilisation != null){ + po = sterilisation; + json.put("isSuccess", true); + json.put("errorType", com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_SUCCESS); + } } try { if (value != null && value.endsWith(".00")) {