From 13f1fc2d225c4d75a68c47cb407ac997db33953c Mon Sep 17 00:00:00 2001 From: A0010407 Date: Fri, 21 Jun 2024 14:51:48 +0800 Subject: [PATCH] =?UTF-8?q?2024-6-21=20=E8=AE=BE=E5=A4=87=E6=A8=A1?= =?UTF-8?q?=E5=9D=97-=E5=A4=87=E5=93=81=E5=A4=87=E4=BB=B6=E5=AF=BC?= =?UTF-8?q?=E5=85=A5-=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E5=8F=AA=E7=95=99=E4=B8=8B=E5=9B=9B=E4=B8=AA?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SparePartsLedgerServiceImpl.java | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) 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(); }