From 68e750bf109efb0469704e54e48a29649512358c Mon Sep 17 00:00:00 2001 From: cjl <276999030@qq.com> Date: Mon, 18 Dec 2023 13:31:54 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into cjl --- screen-api/src/main/java/com/moral/api/service/impl/SpecialDeviceServiceImpl.java | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/screen-api/src/main/java/com/moral/api/service/impl/SpecialDeviceServiceImpl.java b/screen-api/src/main/java/com/moral/api/service/impl/SpecialDeviceServiceImpl.java index 2930b9a..44190f4 100644 --- a/screen-api/src/main/java/com/moral/api/service/impl/SpecialDeviceServiceImpl.java +++ b/screen-api/src/main/java/com/moral/api/service/impl/SpecialDeviceServiceImpl.java @@ -750,4 +750,35 @@ } + + /** + * + */ + private double getDivisor(String code,double num){ + double rs = 0.0; + if (code.contains("-")){ + String data = code.substring(1); + rs = num - Double.parseDouble(data); + } else if (code.contains("*")){ + String data = code.substring(1); + rs = num * Double.parseDouble(data); + } else if (code.contains("/")){ + String data = code.substring(1); + rs = num / Double.parseDouble(data); + } else if (code.contains(",")){ + String[] split = code.split(","); + for (String s : split) { + String[] split1 = s.split("<"); + double sp1 = Double.parseDouble(split1[0]); + double sp2 = Double.parseDouble(split1[1]); + double sp3 = Double.parseDouble(split1[2]); + if (num>=sp1 && num<=sp2){ + rs = num + sp3; + } + } + }else { + rs = num + Double.parseDouble(code); + } + return rs; + } } -- Gitblit v1.8.0