|
@@ -12,7 +12,9 @@ import org.springframework.stereotype.Service;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author yumeng
|
|
* @author yumeng
|
|
@@ -257,6 +259,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Map<String, Object> queryMap = new HashMap<>();
|
|
|
|
+ queryMap.put("discount", discount);
|
|
String statDate = "";
|
|
String statDate = "";
|
|
List<JSONObject> accountDetail = new ArrayList<>();
|
|
List<JSONObject> accountDetail = new ArrayList<>();
|
|
Integer statHour = json.getInteger("statHour");
|
|
Integer statHour = json.getInteger("statHour");
|
|
@@ -495,42 +499,81 @@ public class AccountReportServiceImpl implements IAccountReportService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (type == 2) {
|
|
} else if (type == 2) {
|
|
|
|
+ queryMap.put("statDate", anotherDay);
|
|
|
|
+ queryMap.put("accountIds", accountIds);
|
|
|
|
+ JSONObject ratioJson;
|
|
if (Check.isNull(statHour)) {
|
|
if (Check.isNull(statHour)) {
|
|
- accountDetail = accountReportMapper.selectReportDetailGroupAccountId(anotherDay, accountIds, 23);
|
|
|
|
|
|
+ accountDetail = accountReportMapper.selectReportDetailGroupAccountIdByDate(anotherDay, accountIds);
|
|
statDate = anotherDay;
|
|
statDate = anotherDay;
|
|
|
|
+ ratioJson = accountReportMapper.selectSummaryByMap(queryMap);
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
accountDetail = accountReportMapper.selectReportDetailGroupAccountId(anotherDay, accountIds, statHour);
|
|
accountDetail = accountReportMapper.selectReportDetailGroupAccountId(anotherDay, accountIds, statHour);
|
|
|
|
+ queryMap.put("statHour", statHour);
|
|
statDate = anotherDay;
|
|
statDate = anotherDay;
|
|
|
|
+ ratioJson = accountReportMapper.selectHourSummaryByMap(queryMap);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ returnJson.put("ratioJson", ratioJson);
|
|
} else if (type == 3) {
|
|
} else if (type == 3) {
|
|
String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
|
|
String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
|
|
accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
|
|
accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
|
|
statDate = endDate + " ~ " + anotherDay;
|
|
statDate = endDate + " ~ " + anotherDay;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ queryMap.put("startDate", endDate);
|
|
|
|
+ queryMap.put("endDate", anotherDay);
|
|
|
|
+ queryMap.put("accountIds", accountIds);
|
|
|
|
+
|
|
|
|
+
|
|
} else if (type == 4) {
|
|
} else if (type == 4) {
|
|
String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
|
|
String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
|
|
accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
|
|
accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
|
|
statDate = endDate + " ~ " + anotherDay;
|
|
statDate = endDate + " ~ " + anotherDay;
|
|
|
|
+ queryMap.put("startDate", endDate);
|
|
|
|
+ queryMap.put("endDate", anotherDay);
|
|
|
|
+ queryMap.put("accountIds", accountIds);
|
|
|
|
+
|
|
} else if (type == 5) {
|
|
} else if (type == 5) {
|
|
String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -1);
|
|
String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -1);
|
|
accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
|
|
accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
|
|
statDate = endDate + " ~ " + anotherDay;
|
|
statDate = endDate + " ~ " + anotherDay;
|
|
|
|
+ queryMap.put("startDate", endDate);
|
|
|
|
+ queryMap.put("endDate", anotherDay);
|
|
|
|
+ queryMap.put("accountIds", accountIds);
|
|
} else if (type == 6) {
|
|
} else if (type == 6) {
|
|
String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -3);
|
|
String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -3);
|
|
accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
|
|
accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
|
|
statDate = endDate + " ~ " + anotherDay;
|
|
statDate = endDate + " ~ " + anotherDay;
|
|
|
|
+ queryMap.put("startDate", endDate);
|
|
|
|
+ queryMap.put("endDate", anotherDay);
|
|
|
|
+ queryMap.put("accountIds", accountIds);
|
|
} else if (type == 7) {
|
|
} else if (type == 7) {
|
|
String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -6);
|
|
String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -6);
|
|
accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
|
|
accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
|
|
statDate = endDate + " ~ " + anotherDay;
|
|
statDate = endDate + " ~ " + anotherDay;
|
|
|
|
+ queryMap.put("startDate", endDate);
|
|
|
|
+ queryMap.put("endDate", anotherDay);
|
|
|
|
+ queryMap.put("accountIds", accountIds);
|
|
} else if (type == 8) {
|
|
} else if (type == 8) {
|
|
accountDetail = accountReportMapper.selectAccountReport(accountIds, discount);
|
|
accountDetail = accountReportMapper.selectAccountReport(accountIds, discount);
|
|
statDate = "合计";
|
|
statDate = "合计";
|
|
|
|
+ queryMap.put("accountIds", accountIds);
|
|
} else if (type == 9) {
|
|
} else if (type == 9) {
|
|
String startDate = json.getString("startDate");
|
|
String startDate = json.getString("startDate");
|
|
String endDate = json.getString("endDate");
|
|
String endDate = json.getString("endDate");
|
|
accountDetail = accountReportMapper.selectAccountReportByDate(startDate, endDate, accountIds, discount);
|
|
accountDetail = accountReportMapper.selectAccountReportByDate(startDate, endDate, accountIds, discount);
|
|
- statDate = statDate + " ~ " + endDate;
|
|
|
|
|
|
+ statDate = endDate + " ~ " + startDate;
|
|
|
|
+ queryMap.put("startDate", endDate);
|
|
|
|
+ queryMap.put("endDate", startDate);
|
|
|
|
+ queryMap.put("accountIds", accountIds);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if ((type != 1 && type != 2) && type != null) {
|
|
|
|
+ JSONObject ratioJson = accountReportMapper.selectSummaryByMap(queryMap);
|
|
|
|
+ returnJson.put("ratioJson", ratioJson);
|
|
|
|
+ }
|
|
|
|
+
|
|
returnJson.put("statDate", statDate);
|
|
returnJson.put("statDate", statDate);
|
|
returnJson.put("accountDetail", accountDetail);
|
|
returnJson.put("accountDetail", accountDetail);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|