Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/assestmanagement/DisposableGoods.java =================================================================== diff -u -r14960 -r15560 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/assestmanagement/DisposableGoods.java (.../DisposableGoods.java) (revision 14960) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/assestmanagement/DisposableGoods.java (.../DisposableGoods.java) (revision 15560) @@ -132,8 +132,10 @@ static { ColumnNameAndPoPropertyNameMap.put("物品名称", "name"); - ColumnNameAndPoPropertyNameMap.put("类别", "type"); ColumnNameAndPoPropertyNameMap.put("规格", "specification"); + ColumnNameAndPoPropertyNameMap.put("类型", "type"); + ColumnNameAndPoPropertyNameMap.put("类别", "grade"); + ColumnNameAndPoPropertyNameMap.put("物品类型", "goodsType"); ColumnNameAndPoPropertyNameMap.put("外部编码", "externalCode"); ColumnNameAndPoPropertyNameMap.put("单位", "unit"); // ColumnNameAndPoPropertyNameMap.put("拼音码", "spelling"); @@ -143,6 +145,8 @@ ColumnNameAndPoPropertyNameMap.put("参考价", "referencePrice"); ColumnNameAndPoPropertyNameMap.put("能否作为器械包材料", "isPartOfTousseMaterial"); ColumnNameAndPoPropertyNameMap.put("能否被科室申请", "isApplicationMaterial"); + ColumnNameAndPoPropertyNameMap.put("是否消毒中心物品", "isSupplyRoomGoods"); + ColumnNameAndPoPropertyNameMap.put("是否打印标签", "printInLabel"); } @Id Index: ssts-maintain/src/main/java/com/forgon/disinfectsystem/maintain/importbasedata/service/ImportBasedataManagerImpl.java =================================================================== diff -u -r15536 -r15560 --- ssts-maintain/src/main/java/com/forgon/disinfectsystem/maintain/importbasedata/service/ImportBasedataManagerImpl.java (.../ImportBasedataManagerImpl.java) (revision 15536) +++ ssts-maintain/src/main/java/com/forgon/disinfectsystem/maintain/importbasedata/service/ImportBasedataManagerImpl.java (.../ImportBasedataManagerImpl.java) (revision 15560) @@ -944,7 +944,12 @@ } int lastRowNum = diposableGoodsSheet.getLastRowNum(); int successCount = 0, failureCount = 0; - String yesOrNo = ";能;否;"; + String canOrNo = ";能;否;"; + String yesOrNo = ";是;否;"; + // 类别 一、二、三类 + String grades = ";一类;二类;三类;"; + // 物品类型 普通物品或者高值耗材 + String goodsTypes = ";普通物品;高值耗材;"; List typeList = httpOptionManager .getHttpOptionTextById(HttpOption.SYSTEMSETTING_DIPOSABLEGOODS_TYPE); for (int i = 1; i <= lastRowNum; i++) { @@ -962,27 +967,48 @@ continue; } - // 类别 - String type = ParerUtils.getCellFormatValue(row, 1); - + // 规格 + String specification = ParerUtils.getCellFormatValue(row, 1); + + // 类型 + String type = ParerUtils.getCellFormatValue(row, 2); if (!typeList.contains(type)) { failureCount = appendFailureRowNumAndRecordFailureNum( failureCount, sb, currentRowNum,1,com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_NOT_DEFINED); continue; } + // 类别 一类二类三类 导入字段可以为空 + String grade = ParerUtils.getCellFormatValue(row, 3); + if(StringUtils.isNotBlank(grade)){ + if (grades.indexOf(";" + grade + ";") == -1) { + failureCount = appendFailureRowNumAndRecordFailureNum( + failureCount, sb, currentRowNum,1,com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_NOT_DEFINED); + continue; + } + } + + // 物品类型 普通物品或者高值耗材 默认为普通物品 + String goodsType = ParerUtils.getCellFormatValue(row, 4); + if (StringUtils.isNotBlank(goodsType)) { + if (goodsTypes.indexOf(";" + goodsType + ";") == -1) { + failureCount = appendFailureRowNumAndRecordFailureNum( + failureCount, sb, currentRowNum,8,com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_NOT_DEFINED); + continue; + } + } else { + goodsType = "普通物品"; + } + - // 规格 - String specification = ParerUtils.getCellFormatValue(row, 2); - // 外部编码 - String externalCode = ParerUtils.getCellFormatValue(row, 3); + String externalCode = ParerUtils.getCellFormatValue(row, 5); // 最小单位 - String unit = ParerUtils.getCellFormatValue(row, 4); + String unit = ParerUtils.getCellFormatValue(row, 6); // 参考价 Double referencePrice = null; - String referencePriceStr = ParerUtils.getCellFormatValue(row, 5); + String referencePriceStr = ParerUtils.getCellFormatValue(row, 7); if (StringUtils.isNotBlank(referencePriceStr)) { try { referencePrice = Double.parseDouble(referencePriceStr); @@ -995,7 +1021,7 @@ // 最小库存 Integer minStorage = null; - String minStorageStr = ParerUtils.getCellFormatValue(row, 6); + String minStorageStr = ParerUtils.getCellFormatValue(row, 8); if (StringUtils.isNotBlank(minStorageStr)) { try { minStorage = Integer.parseInt(minStorageStr); @@ -1008,7 +1034,7 @@ // 最大库存 Integer maxStorage = null; - String maxStorageStr = ParerUtils.getCellFormatValue(row, 7); + String maxStorageStr = ParerUtils.getCellFormatValue(row, 9); if (StringUtils.isNotBlank(maxStorageStr)) { try { maxStorage = Integer.parseInt(maxStorageStr); @@ -1020,9 +1046,9 @@ } // 能否作为器械包材料 - String isPartOfTousseMaterial = ParerUtils.getCellFormatValue(row, 8); + String isPartOfTousseMaterial = ParerUtils.getCellFormatValue(row, 10); if (StringUtils.isNotBlank(isPartOfTousseMaterial)) { - if (yesOrNo.indexOf(";" + isPartOfTousseMaterial + ";") == -1) { + if (canOrNo.indexOf(";" + isPartOfTousseMaterial + ";") == -1) { failureCount = appendFailureRowNumAndRecordFailureNum( failureCount, sb, currentRowNum,8,com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_VALUE_INVALID); continue; @@ -1032,16 +1058,40 @@ } // 能否被科室申请 - String isApplicationMaterial = ParerUtils.getCellFormatValue(row, 9); + String isApplicationMaterial = ParerUtils.getCellFormatValue(row, 11); if (StringUtils.isNotBlank(isApplicationMaterial)) { - if (yesOrNo.indexOf(";" + isApplicationMaterial + ";") == -1) { + if (canOrNo.indexOf(";" + isApplicationMaterial + ";") == -1) { failureCount = appendFailureRowNumAndRecordFailureNum( failureCount, sb, currentRowNum,9,com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_VALUE_INVALID); continue; } } else { isApplicationMaterial = "能"; } + + // 是否消毒中心物品 + String isSupplyRoomGoods = ParerUtils.getCellFormatValue(row, 12); + if (StringUtils.isNotBlank(isSupplyRoomGoods)) { + if (yesOrNo.indexOf(";" + isSupplyRoomGoods + ";") == -1) { + failureCount = appendFailureRowNumAndRecordFailureNum( + failureCount, sb, currentRowNum,8,com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_VALUE_INVALID); + continue; + } + } else { + isSupplyRoomGoods = "是"; + } + // 是否打印标签 + String printInLabel = ParerUtils.getCellFormatValue(row, 13); + if (StringUtils.isNotBlank(printInLabel)) { + if (yesOrNo.indexOf(";" + printInLabel + ";") == -1) { + failureCount = appendFailureRowNumAndRecordFailureNum( + failureCount, sb, currentRowNum,8,com.forgon.disinfectsystem.common.Constants.ERROR_TYPE_VALUE_INVALID); + continue; + } + } else { + printInLabel = "是"; + } + DisposableGoods diposableGoods = diposableGoodsManager .getDisposableGoodsByName(name, specification); @@ -1063,8 +1113,12 @@ diposableGoods.setMinStorage(minStorage); diposableGoods.setReferencePrice(referencePrice); diposableGoods.setType(type); + diposableGoods.setGrade(grade); + diposableGoods.setGoodsType(goodsType); diposableGoods.setUnit(unit); diposableGoods.setExternalCode(externalCode); + diposableGoods.setIsSupplyRoomGoods(isSupplyRoomGoods); + diposableGoods.setPrintInLabel(printInLabel); totalCount = saveOrUpdateAndClearCache(totalCount, diposableGoods); successCount++; Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/importbasedata/basedataDemo.xls =================================================================== diff -u -r14595 -r15560 Binary files differ