|
@@ -3,11 +3,9 @@ package org.fouram.controller;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.fouram.core.base.controller.BaseController;
|
|
|
import org.fouram.core.util.AppUtil;
|
|
|
-import org.fouram.core.util.DateUtil;
|
|
|
import org.fouram.core.util.AppUtil.ResultConstant;
|
|
|
import org.fouram.core.util.LoggerUtil;
|
|
|
import org.fouram.job.CheckTaskSchedule;
|
|
|
-import org.fouram.service.WxCheckService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -20,8 +18,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
public class ReportController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
- private WxCheckService wxCheckService;
|
|
|
- @Autowired
|
|
|
private CheckTaskSchedule checkTaskSchedule;
|
|
|
|
|
|
/**
|
|
@@ -55,34 +51,16 @@ public class ReportController extends BaseController {
|
|
|
*/
|
|
|
@GetMapping(value = "/reloadReportData", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
- public Object reloadReportData() {
|
|
|
+ public Object reloadReportData(@RequestParam("checkinDay") String checkinDay) {
|
|
|
try {
|
|
|
- for (String day : DateUtil.getSubDateList(DateUtil.getAfterDay(-30), DateUtil.getDay())) {
|
|
|
- LoggerUtil.info(day + "执行开始:" + DateUtil.getTime());
|
|
|
- checkTaskSchedule.reloadBiz(day);
|
|
|
- LoggerUtil.info(day + "执行结束:" + DateUtil.getTime());
|
|
|
- }
|
|
|
- return AppUtil.success();
|
|
|
- } catch (Exception e) {
|
|
|
- LoggerUtil.error(e);
|
|
|
- return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * http://localhost:8080/sapcms/report/updateReportResultData?checkinDay=2020-06-15
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping(value = "/updateReportResultData", produces = "application/json;charset=utf-8")
|
|
|
- @ResponseBody
|
|
|
- public Object updateReportResultData() {
|
|
|
- try {
|
|
|
- String checkinDay = getPageData().getString("checkinDay");
|
|
|
if (StringUtils.isBlank(checkinDay)) {
|
|
|
return AppUtil.error("参数checkinDay为空");
|
|
|
}
|
|
|
- wxCheckService.updateReportResultData(checkinDay);
|
|
|
+ for(String day : checkinDay.split(",")) {
|
|
|
+ LoggerUtil.info("reloadReportData开始->" + day);
|
|
|
+ checkTaskSchedule.reloadBiz(day);
|
|
|
+ LoggerUtil.info("reloadReportData结束->" + day);
|
|
|
+ }
|
|
|
return AppUtil.success();
|
|
|
} catch (Exception e) {
|
|
|
LoggerUtil.error(e);
|