|
@@ -6,15 +6,12 @@ import cn.com.ctop.kuaishou.modules.report.service.IAccountReportService;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @author yumeng
|
|
@@ -22,7 +19,7 @@ import java.util.Map;
|
|
|
*/
|
|
|
@Service
|
|
|
public class AccountReportServiceImpl implements IAccountReportService {
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private AccountReportMapper accountReportMapper;
|
|
|
|
|
|
/**
|
|
@@ -51,10 +48,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
|
|
|
String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
|
|
|
if (type == 1) {
|
|
|
// 今日汇总
|
|
|
- Integer maxHour = accountReportMapper.selectMaxHourByDate(nowDate);
|
|
|
- if (Check.isNull(maxHour) || maxHour == 0) {
|
|
|
- return null;
|
|
|
- }
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ int maxHour = calendar.get(Calendar.HOUR_OF_DAY);
|
|
|
String maxHourStr = String.valueOf(maxHour - 1);
|
|
|
// 今日 小时汇总数据
|
|
|
accountJson = accountReportMapper.selectSumDayHourlyByHourAndDate(nowDate, maxHourStr, accountIds);
|
|
@@ -268,7 +263,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
|
|
|
if (type == 1) {
|
|
|
// 今日汇总
|
|
|
if (Check.isNull(statHour)) {
|
|
|
- Integer maxHour = accountReportMapper.selectMaxHourByDate(nowDate);
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ int maxHour = calendar.get(Calendar.HOUR_OF_DAY);
|
|
|
hour = maxHour - 1;
|
|
|
} else {
|
|
|
hour = statHour;
|