Commit b740f7ed by lijingjing

添加比较日志;

parent f33dc319
......@@ -98,7 +98,9 @@ public class ItemComparisonServiceImpl extends BaseServiceImpl<ItemComparisonMap
if (null == queryDTO.getQueryDate()) {
queryDTO.setQueryDate(new Date());
}
logger.error("listCompare params: " + JacksonUtils.toJSONString(queryDTO));
List<ItemComparison> itemCompareVOList = baseMapper.selectCompareItems(queryDTO);
logger.error("listCompare items data: " + JacksonUtils.toJSONString(itemCompareVOList));
List<ItemComparison> itemList = new ArrayList<>();
......@@ -113,14 +115,21 @@ public class ItemComparisonServiceImpl extends BaseServiceImpl<ItemComparisonMap
}
item.setLimitValue(limitValueStr);
item.setReclaim(false);
logger.error("compare item data: ", JacksonUtils.toJSONString(item));
try {
BigDecimal newVal = new BigDecimal(item.getTestValue());
logger.error("newValue is :" + newVal.doubleValue());
BigDecimal oldVal = new BigDecimal(item.getPrevTestValue());
logger.error("oldVal is :" + oldVal.doubleValue());
BigDecimal difVal = newVal.subtract(oldVal).abs();
logger.error("difVal is :" + difVal.doubleValue());
item.setDiffValue(difVal.toPlainString());
BigDecimal limitValue = new BigDecimal(item.getLimitValue());
logger.error("limitValue is :" + difVal.doubleValue());
// 差值与限定值相比,大于0需要重取
if (difVal.subtract(limitValue).doubleValue() >= 0) {
double compareValue = difVal.subtract(limitValue).doubleValue();
logger.error("compare diff value and limit value subtract is: " + compareValue);
if (compareValue >= 0) {
item.setReclaim(true);
}
} catch (Exception e) {
......@@ -135,6 +144,7 @@ public class ItemComparisonServiceImpl extends BaseServiceImpl<ItemComparisonMap
itemList.addAll(list);
}
});
logger.error(JacksonUtils.toJSONString(itemList));
return itemList;
}
......
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