|
@@ -5,10 +5,11 @@ import org.fouram.core.base.controller.BaseController;
|
|
import org.fouram.core.util.AppUtil;
|
|
import org.fouram.core.util.AppUtil;
|
|
import org.fouram.core.util.AppUtil.ResultConstant;
|
|
import org.fouram.core.util.AppUtil.ResultConstant;
|
|
import org.fouram.core.util.LoggerUtil;
|
|
import org.fouram.core.util.LoggerUtil;
|
|
|
|
+import org.fouram.service.CheckTaskService;
|
|
import org.fouram.service.SapCheckService;
|
|
import org.fouram.service.SapCheckService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
@@ -18,18 +19,41 @@ public class ReportController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private SapCheckService sapCheckService;
|
|
private SapCheckService sapCheckService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private CheckTaskService checkTaskService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * http://localhost:8080/sapcms/report/saveReportData?checkinDay=2020-07-27
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping(value = "/saveReportData", produces = "application/json;charset=utf-8")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public Object saveReportData() {
|
|
|
|
+ try {
|
|
|
|
+ String checkinDay = getPageData().getString("checkinDay");
|
|
|
|
+ if (StringUtils.isBlank(checkinDay)) {
|
|
|
|
+ return AppUtil.error("参数checkinDay为空");
|
|
|
|
+ }
|
|
|
|
+ checkTaskService.executeBiz(checkinDay);
|
|
|
|
+ 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
|
|
* http://localhost:8080/sapcms/report/updateReportResultData?checkinDay=2020-06-15
|
|
*
|
|
*
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @PostMapping(value = "/updateReportResultData", produces = "application/json;charset=utf-8")
|
|
|
|
|
|
+ @GetMapping(value = "/updateReportResultData", produces = "application/json;charset=utf-8")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public Object updateReportResultData() {
|
|
public Object updateReportResultData() {
|
|
try {
|
|
try {
|
|
String checkinDay = getPageData().getString("checkinDay");
|
|
String checkinDay = getPageData().getString("checkinDay");
|
|
- if(StringUtils.isBlank(checkinDay)) {
|
|
|
|
|
|
+ if (StringUtils.isBlank(checkinDay)) {
|
|
return AppUtil.error("参数checkinDay为空");
|
|
return AppUtil.error("参数checkinDay为空");
|
|
}
|
|
}
|
|
sapCheckService.updateReportResultData(checkinDay, checkinDay);
|
|
sapCheckService.updateReportResultData(checkinDay, checkinDay);
|