Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/assestmanagement/ApplicationSpecificationHelper.java =================================================================== diff -u -r17757 -r17762 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/assestmanagement/ApplicationSpecificationHelper.java (.../ApplicationSpecificationHelper.java) (revision 17757) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/assestmanagement/ApplicationSpecificationHelper.java (.../ApplicationSpecificationHelper.java) (revision 17762) @@ -40,7 +40,49 @@ return calculateApplicationSpecificationAmount(amountInt, transferScaleInt); } + public static int calculateApplicationSpecificationAmount(Long amount, + Long transferScale) { + if (amount == null) { + return 0; + } + if (transferScale == null) { + return amount.intValue(); + } + int amountInt = amount.intValue(); + int transferScaleInt = transferScale.intValue(); + return calculateApplicationSpecificationAmount(amountInt, + transferScaleInt); + } + public static int calculateApplicationSpecificationAmount(Long amount, + Integer transferScale) { + if (amount == null) { + return 0; + } + if (transferScale == null) { + return amount.intValue(); + } + int amountInt = amount.intValue(); + int transferScaleInt = transferScale.intValue(); + + return calculateApplicationSpecificationAmount(amountInt, + transferScaleInt); + } + public static int calculateApplicationSpecificationAmount(Integer amount, + Long transferScale) { + if (amount == null) { + return 0; + } + if (transferScale == null) { + return amount.intValue(); + } + int amountInt = amount.intValue(); + int transferScaleInt = transferScale.intValue(); + + return calculateApplicationSpecificationAmount(amountInt, + transferScaleInt); + } + public static int calculateApplicationSpecificationAmount(long amount, long transferScale) { if (transferScale == 0) { @@ -66,6 +108,48 @@ return calculateAmount(applicationSpecificationAmountInt, transferScaleInt); } + public static int calculateAmount(Long applicationSpecificationAmount, + Long transferScale) { + if (applicationSpecificationAmount == null) { + return 0; + } + if (transferScale == null) { + return applicationSpecificationAmount.intValue(); + } + int applicationSpecificationAmountInt = applicationSpecificationAmount.intValue(); + int transferScaleInt = transferScale.intValue(); + + return calculateAmount(applicationSpecificationAmountInt, + transferScaleInt); + } + public static int calculateAmount(Long applicationSpecificationAmount, + Integer transferScale) { + if (applicationSpecificationAmount == null) { + return 0; + } + if (transferScale == null) { + return applicationSpecificationAmount.intValue(); + } + int applicationSpecificationAmountInt = applicationSpecificationAmount.intValue(); + int transferScaleInt = transferScale.intValue(); + + return calculateAmount(applicationSpecificationAmountInt, + transferScaleInt); + } + public static int calculateAmount(Integer applicationSpecificationAmount, + Long transferScale) { + if (applicationSpecificationAmount == null) { + return 0; + } + if (transferScale == null) { + return applicationSpecificationAmount; + } + int applicationSpecificationAmountInt = applicationSpecificationAmount.intValue(); + int transferScaleInt = transferScale.intValue(); + + return calculateAmount(applicationSpecificationAmountInt, + transferScaleInt); + } public static int calculateAmount(long applicationSpecificationAmount, long transferScale) { if (transferScale == 0) {