Sfoglia il codice sorgente

费用批量修改新增报错条件

Qchen 1 anno fa
parent
commit
0d0a7936d6

+ 3 - 3
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -1120,7 +1120,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 BigDecimal updatedValue = current.add(add);
                 // 检查更新后的值是否小于零
                 if (updatedValue.compareTo(BigDecimal.ZERO) < 0) {
-                    throw new SystemException(desc + "比例值不能小于零");
+                    throw new SystemException("id为"+ item.getId() + desc + "比例值不能小于零");
                 }
                 setter.accept(updatedValue.toString());
             } catch (NumberFormatException e) {
@@ -1139,7 +1139,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
 
                 // 检查更新后的值是否小于零
                 if (updatedValue.compareTo(BigDecimal.ZERO) < 0) {
-                    throw new SystemException(desc + "比例值不能小于零");
+                    throw new SystemException("id为"+ item.getId() + desc + "比例值不能小于零");
                 }
                 setter.accept(updatedValue.toString());
             } catch (NumberFormatException e) {
@@ -1175,7 +1175,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
 
             // 检查更新后的值是否小于零
             if (updatedValue.compareTo(BigDecimal.ZERO) < 0) {
-                throw new SystemException(desc + "比例值不能小于零");
+                throw new SystemException("id为"+ item.getCostsId() + desc + "比例值不能小于零");
             }
             setter.accept(updatedValue);
         }