| | |
| | | if (StringUtils.isNotBlank(s) && dataMap.containsKey(s)) { |
| | | // 对每个数加(),否则负值报错 |
| | | expression = expression.replace(s, "(" + dataMap.get(s).toString() + ")"); |
| | | } else if(StringUtils.isNotBlank(s) && s.contains(POINT_PREFIX)) { |
| | | log.info("包含计算点,先挂起"); |
| | | return PENDING_FLAG; |
| | | } |
| | | } |
| | | expression = expression.replace("&", "&&"); |
| | |
| | | expression = expression.replace("False", "false"); |
| | | expression = expression.replace("True", "true"); |
| | | log.info("PointNo=" + dto.getPointNo() + ";expression=" + expression); |
| | | if(expression.contains(POINT_PREFIX)) { |
| | | // 包含计算点,先挂起 |
| | | return PENDING_FLAG; |
| | | } |
| | | |
| | | String result = javaScriptHandler.eval(expression); |
| | | log.info("result=" + result); |
| | |
| | | if (count > MAX_RECURSION) { |
| | | return result; |
| | | } |
| | | this.singleCompute(pointMathList.get(0), count); |
| | | Object v = this.singleCompute(pointMathList.get(0), count); |
| | | dataMap.put(s, v); |
| | | count = count + 1; |
| | | } |
| | | if (dataMap.get(s) == null) { |