diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/SparePartsLedgerServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/SparePartsLedgerServiceImpl.java index 9ecfd3d10..5f6a91156 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/SparePartsLedgerServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/SparePartsLedgerServiceImpl.java @@ -1,5 +1,6 @@ package com.op.device.service.impl; +import java.math.BigDecimal; import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; @@ -171,49 +172,49 @@ public class SparePartsLedgerServiceImpl implements ISparePartsLedgerService { return error(500, "备品备件名称不能为空!信息导入失败!"); } // 所属设备编码 - if (table.getOwnEquipmentCode().isEmpty() || table.getOwnEquipmentCode() == null) { - return error(500, "所属设备编码不能为空!信息导入失败!"); - } +// if (table.getOwnEquipmentCode().isEmpty() || table.getOwnEquipmentCode() == null) { +// return error(500, "所属设备编码不能为空!信息导入失败!"); +// } // 所属设备名称 - if (table.getOwnEquipmentName().isEmpty() || table.getOwnEquipmentName() == null) { - return error(500, "所属设备名称不能为空!信息导入失败!"); - } +// if (table.getOwnEquipmentName().isEmpty() || table.getOwnEquipmentName() == null) { +// return error(500, "所属设备名称不能为空!信息导入失败!"); +// } // 设备厂家 - if (table.getSpareSupplier().isEmpty() || table.getSpareSupplier() == null) { - return error(500, "设备厂家不能为空!信息导入失败!"); - } +// if (table.getSpareSupplier().isEmpty() || table.getSpareSupplier() == null) { +// return error(500, "设备厂家不能为空!信息导入失败!"); +// } // 规格型号 - if (table.getSpareMode().isEmpty() || table.getSpareMode() == null) { - return error(500, "规格型号不能为空!信息导入失败!"); - } +// if (table.getSpareMode().isEmpty() || table.getSpareMode() == null) { +// return error(500, "规格型号不能为空!信息导入失败!"); +// } // 单机装配数量 - if (table.getUnitQuantity().isEmpty() || table.getUnitQuantity() == null) { - return error(500, "单机装配数量不能为空!信息导入失败!"); - } +// if (table.getUnitQuantity().isEmpty() || table.getUnitQuantity() == null) { +// return error(500, "单机装配数量不能为空!信息导入失败!"); +// } // 单价 - if (table.getUnitPrice().toString().isEmpty() || table.getUnitPrice() == null) { - return error(500, "单价不能为空!信息导入失败!"); - } +// if (table.getUnitPrice().toString().isEmpty() || table.getUnitPrice() == null) { +// return error(500, "单价不能为空!信息导入失败!"); +// } // 安全库存 - if (table.getSafeStock().isEmpty() || table.getSafeStock() == null) { - return error(500, "安全库存不能为空!信息导入失败!"); - } +// if (table.getSafeStock().isEmpty() || table.getSafeStock() == null) { +// return error(500, "安全库存不能为空!信息导入失败!"); +// } // 现有库存 - if (table.getAmount().toString().isEmpty() || table.getAmount() == null) { - return error(500, "现有库存不能为空!信息导入失败!"); + if (table.getAmount() == null || table.getAmount().compareTo(BigDecimal.ZERO) < 0) { + return error(500, "现有库存不能为空,或者小于0!信息导入失败!"); } // 采购方式 if (table.getProcurementMethod().isEmpty() || table.getProcurementMethod() == null) { return error(500, "采购方式不能为空!信息导入失败!"); } // 更换周期(月) - if (table.getSpareReplacementCycle().toString().isEmpty() || table.getSpareReplacementCycle() == null) { - return error(500, "更换周期不能为空!信息导入失败!"); - } +// if (table.getSpareReplacementCycle().toString().isEmpty() || table.getSpareReplacementCycle() == null) { +// return error(500, "更换周期不能为空!信息导入失败!"); +// } // 采购周期(天) - if (table.getProcurementCycle().toString().isEmpty() || table.getProcurementCycle() == null) { - return error(500, "采购周期不能为空!信息导入失败!"); - } +// if (table.getProcurementCycle().toString().isEmpty() || table.getProcurementCycle() == null) { +// return error(500, "采购周期不能为空!信息导入失败!"); +// } } return success(); }