|
@@ -491,9 +491,17 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
resultMap.put("todayCost", todayCost);
|
|
resultMap.put("todayCost", todayCost);
|
|
|
resultMap.put("todayCompare", formatRate(todayCost, yesterdayCost, decimalFormat));
|
|
resultMap.put("todayCompare", formatRate(todayCost, yesterdayCost, decimalFormat));
|
|
|
|
|
|
|
|
- JSONObject periodSummary = materialStareMapper.getKuaiShouPeriodCostSummary(stratDate, endDate, lastTimeStart, lastTimeEnd, userSet);
|
|
|
|
|
- double timeCost = getJsonDouble(periodSummary, "currentCost");
|
|
|
|
|
- double lastCost = getJsonDouble(periodSummary, "lastCost");
|
|
|
|
|
|
|
+ boolean currentDayOnly = stratDate == endDate && endDate == nowDate;
|
|
|
|
|
+ double timeCost;
|
|
|
|
|
+ double lastCost;
|
|
|
|
|
+ if (currentDayOnly) {
|
|
|
|
|
+ timeCost = todayCost;
|
|
|
|
|
+ lastCost = yesterdayCost;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ JSONObject periodSummary = materialStareMapper.getKuaiShouPeriodCostSummary(stratDate, endDate, lastTimeStart, lastTimeEnd, userSet);
|
|
|
|
|
+ timeCost = getJsonDouble(periodSummary, "currentCost");
|
|
|
|
|
+ lastCost = getJsonDouble(periodSummary, "lastCost");
|
|
|
|
|
+ }
|
|
|
resultMap.put("timeCost", timeCost);
|
|
resultMap.put("timeCost", timeCost);
|
|
|
resultMap.put("timeCompare", formatRate(timeCost, lastCost, decimalFormat));
|
|
resultMap.put("timeCompare", formatRate(timeCost, lastCost, decimalFormat));
|
|
|
|
|
|
|
@@ -547,9 +555,17 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
resultMap.put("todayCost", todayCost);
|
|
resultMap.put("todayCost", todayCost);
|
|
|
resultMap.put("todayCompare", formatRate(todayCost, yesterdayCost, decimalFormat));
|
|
resultMap.put("todayCompare", formatRate(todayCost, yesterdayCost, decimalFormat));
|
|
|
|
|
|
|
|
- JSONObject periodSummary = materialStareMapper.getBytedancePeriodCostSummary(stratDate, endDate, lastTimeStart, lastTimeEnd, userSet);
|
|
|
|
|
- double timeCost = getJsonDouble(periodSummary, "currentCost");
|
|
|
|
|
- double lastCost = getJsonDouble(periodSummary, "lastCost");
|
|
|
|
|
|
|
+ boolean currentDayOnly = stratDate == endDate && endDate == nowDate;
|
|
|
|
|
+ double timeCost;
|
|
|
|
|
+ double lastCost;
|
|
|
|
|
+ if (currentDayOnly) {
|
|
|
|
|
+ timeCost = todayCost;
|
|
|
|
|
+ lastCost = yesterdayCost;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ JSONObject periodSummary = materialStareMapper.getBytedancePeriodCostSummary(stratDate, endDate, lastTimeStart, lastTimeEnd, userSet);
|
|
|
|
|
+ timeCost = getJsonDouble(periodSummary, "currentCost");
|
|
|
|
|
+ lastCost = getJsonDouble(periodSummary, "lastCost");
|
|
|
|
|
+ }
|
|
|
resultMap.put("timeCost", timeCost);
|
|
resultMap.put("timeCost", timeCost);
|
|
|
resultMap.put("timeCompare", formatRate(timeCost, lastCost, decimalFormat));
|
|
resultMap.put("timeCompare", formatRate(timeCost, lastCost, decimalFormat));
|
|
|
|
|
|
|
@@ -598,9 +614,17 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
resultMap.put("todayCost", todayCost);
|
|
resultMap.put("todayCost", todayCost);
|
|
|
resultMap.put("todayCompare", formatRate(todayCost, yesterdayCost, decimalFormat));
|
|
resultMap.put("todayCompare", formatRate(todayCost, yesterdayCost, decimalFormat));
|
|
|
|
|
|
|
|
- JSONObject periodSummary = materialStareMapper.getAdqPeriodCostSummary(stratDate, endDate, lastTimeStart, lastTimeEnd, userSet);
|
|
|
|
|
- double timeCost = getJsonDouble(periodSummary, "currentCost");
|
|
|
|
|
- double lastCost = getJsonDouble(periodSummary, "lastCost");
|
|
|
|
|
|
|
+ boolean currentDayOnly = stratDate == endDate && endDate == nowDate;
|
|
|
|
|
+ double timeCost;
|
|
|
|
|
+ double lastCost;
|
|
|
|
|
+ if (currentDayOnly) {
|
|
|
|
|
+ timeCost = todayCost;
|
|
|
|
|
+ lastCost = yesterdayCost;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ JSONObject periodSummary = materialStareMapper.getAdqPeriodCostSummary(stratDate, endDate, lastTimeStart, lastTimeEnd, userSet);
|
|
|
|
|
+ timeCost = getJsonDouble(periodSummary, "currentCost");
|
|
|
|
|
+ lastCost = getJsonDouble(periodSummary, "lastCost");
|
|
|
|
|
+ }
|
|
|
resultMap.put("timeCost", timeCost);
|
|
resultMap.put("timeCost", timeCost);
|
|
|
resultMap.put("timeCompare", formatRate(timeCost, lastCost, decimalFormat));
|
|
resultMap.put("timeCompare", formatRate(timeCost, lastCost, decimalFormat));
|
|
|
resultMap.put("directCharged", "0");
|
|
resultMap.put("directCharged", "0");
|
|
@@ -2080,6 +2104,9 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
}
|
|
}
|
|
|
return materialStareMapper.getAdqOperateInfo(startDate, endDate, userIds);
|
|
return materialStareMapper.getAdqOperateInfo(startDate, endDate, userIds);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (startDate == nowDate) {
|
|
|
|
|
+ return materialStareMapper.getKuaiShouOperateInfoHourly(nowDate, nowDate, userIds);
|
|
|
|
|
+ }
|
|
|
return materialStareMapper.getKuaiShouOperateInfo(startDate, endDate, userIds);
|
|
return materialStareMapper.getKuaiShouOperateInfo(startDate, endDate, userIds);
|
|
|
}
|
|
}
|
|
|
|
|
|