Commit ad65461b by guojx

数据统计调整:时间参数格式

parent 9437255c
package com.gic.haoban.manage.web.controller.hm; package com.gic.haoban.manage.web.controller.hm;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
...@@ -648,14 +649,22 @@ public class HmLinkController { ...@@ -648,14 +649,22 @@ public class HmLinkController {
// 统计图表 // 统计图表
@RequestMapping("statistics/chart") @RequestMapping("statistics/chart")
public RestResponse<Object> statisticsChart(@RequestBody HmLinkChartQO qo) { public RestResponse<Object> statisticsChart(@RequestBody HmLinkChartQO qo) throws ParseException {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
Long linkId = qo.getLinkId(); Long linkId = qo.getLinkId();
Date startTime = qo.getStartTime(); String startTimeStr = qo.getStartTime();
Date endTime = qo.getEndTime(); String endTimeStr = qo.getEndTime();
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date startTime = null;
Date endTime = null;
if (StringUtils.isNotBlank(startTimeStr)) {
startTime = df.parse(startTimeStr);
}
if (StringUtils.isNotBlank(endTimeStr)) {
endTime = df.parse(endTimeStr);
}
jsonObject.put("enterpriseId", loginUser.getEnterpriseId()); jsonObject.put("enterpriseId", loginUser.getEnterpriseId());
jsonObject.put("linkId", linkId); jsonObject.put("linkId", linkId);
if (startTime == null) { if (startTime == null) {
...@@ -719,12 +728,6 @@ public class HmLinkController { ...@@ -719,12 +728,6 @@ public class HmLinkController {
public RestResponse<Object> statisticsClerk(@RequestBody HmLinkClerkListQO qo) { public RestResponse<Object> statisticsClerk(@RequestBody HmLinkClerkListQO qo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
qo.getInFields().setEnterpriseId(loginUser.getEnterpriseId()); qo.getInFields().setEnterpriseId(loginUser.getEnterpriseId());
if (qo.getInFields().getStartTime() != null) {
qo.getInFields().setStartTime(qo.getInFields().getStartTime() + " 00:00:00");
}
if (qo.getInFields().getEndTime() != null) {
qo.getInFields().setEndTime(qo.getInFields().getEndTime() + " 23:59:59");
}
return DataStatisticsParamUtils return DataStatisticsParamUtils
.responsePage(DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_link_detail, qo)); .responsePage(DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_link_detail, qo));
} }
......
...@@ -10,8 +10,8 @@ import java.util.Date; ...@@ -10,8 +10,8 @@ import java.util.Date;
public class HmLinkChartQO implements Serializable { public class HmLinkChartQO implements Serializable {
private Long linkId; private Long linkId;
private Date startTime; private String startTime;
private Date endTime; private String endTime;
public Long getLinkId() { public Long getLinkId() {
return linkId; return linkId;
...@@ -22,20 +22,20 @@ public class HmLinkChartQO implements Serializable { ...@@ -22,20 +22,20 @@ public class HmLinkChartQO implements Serializable {
return this; return this;
} }
public Date getStartTime() { public String getStartTime() {
return startTime; return startTime;
} }
public HmLinkChartQO setStartTime(Date startTime) { public HmLinkChartQO setStartTime(String startTime) {
this.startTime = startTime; this.startTime = startTime;
return this; return this;
} }
public Date getEndTime() { public String getEndTime() {
return endTime; return endTime;
} }
public HmLinkChartQO setEndTime(Date endTime) { public HmLinkChartQO setEndTime(String endTime) {
this.endTime = endTime; this.endTime = endTime;
return this; return this;
} }
......
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