Commit f33dc319 by lijingjing

修改比较方式

parent 1f49eda3
...@@ -116,11 +116,11 @@ public class ItemComparisonServiceImpl extends BaseServiceImpl<ItemComparisonMap ...@@ -116,11 +116,11 @@ public class ItemComparisonServiceImpl extends BaseServiceImpl<ItemComparisonMap
try { try {
BigDecimal newVal = new BigDecimal(item.getTestValue()); BigDecimal newVal = new BigDecimal(item.getTestValue());
BigDecimal oldVal = new BigDecimal(item.getPrevTestValue()); BigDecimal oldVal = new BigDecimal(item.getPrevTestValue());
BigDecimal difVal = newVal.subtract(oldVal); BigDecimal difVal = newVal.subtract(oldVal).abs();
item.setDiffValue(difVal.abs().toPlainString()); item.setDiffValue(difVal.toPlainString());
BigDecimal limitValue = new BigDecimal(item.getLimitValue()); BigDecimal limitValue = new BigDecimal(item.getLimitValue());
// 差值与限定值相比,大于0需要重取 // 差值与限定值相比,大于0需要重取
if (difVal.abs().compareTo(limitValue) >= 0) { if (difVal.subtract(limitValue).doubleValue() >= 0) {
item.setReclaim(true); item.setReclaim(true);
} }
} catch (Exception e) { } catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment