|
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import com.xunmei.common.core.constant.SecurityConstants;
|
|
import com.xunmei.common.core.constant.SecurityConstants;
|
|
|
import com.xunmei.common.core.utils.DateUtils;
|
|
import com.xunmei.common.core.utils.DateUtils;
|
|
|
|
|
+import com.xunmei.common.core.utils.StringUtils;
|
|
|
import com.xunmei.common.core.web.controller.BaseController;
|
|
import com.xunmei.common.core.web.controller.BaseController;
|
|
|
import com.xunmei.common.core.web.domain.AjaxResult;
|
|
import com.xunmei.common.core.web.domain.AjaxResult;
|
|
|
import com.xunmei.common.core.web.page.TableDataInfo;
|
|
import com.xunmei.common.core.web.page.TableDataInfo;
|
|
@@ -20,6 +21,7 @@ import com.xunmei.core.evaluate.service.ICoreEvaluateTaskService;
|
|
|
import com.xunmei.core.evaluate.vo.CoreEvaluatePlanVO;
|
|
import com.xunmei.core.evaluate.vo.CoreEvaluatePlanVO;
|
|
|
import com.xunmei.core.evaluate.vo.CoreEvaluateTaskVO;
|
|
import com.xunmei.core.evaluate.vo.CoreEvaluateTaskVO;
|
|
|
import com.xunmei.core.reportForms.monitor.dto.MonitoringAccessDTO;
|
|
import com.xunmei.core.reportForms.monitor.dto.MonitoringAccessDTO;
|
|
|
|
|
+import com.xunmei.core.reportForms.resumption.service.impl.ResumptionReportServiceImpl;
|
|
|
import com.xunmei.core.retrieval.service.impl.CoreMonitoringRetrievalTaskServiceImpl;
|
|
import com.xunmei.core.retrieval.service.impl.CoreMonitoringRetrievalTaskServiceImpl;
|
|
|
import com.xunmei.system.api.RemoteOrgService;
|
|
import com.xunmei.system.api.RemoteOrgService;
|
|
|
import com.xunmei.system.api.domain.SysOrg;
|
|
import com.xunmei.system.api.domain.SysOrg;
|
|
@@ -31,6 +33,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -54,6 +57,9 @@ public class CoreEvaluateTaskController extends BaseController {
|
|
|
private CoreMonitoringRetrievalTaskServiceImpl coreMonitoringRetrievalTaskService;
|
|
private CoreMonitoringRetrievalTaskServiceImpl coreMonitoringRetrievalTaskService;
|
|
|
@Resource
|
|
@Resource
|
|
|
private RemoteOrgService remoteOrgService;
|
|
private RemoteOrgService remoteOrgService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ResumptionReportServiceImpl resumptionReportService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询外包评价任务列表
|
|
* 查询外包评价任务列表
|
|
|
*/
|
|
*/
|
|
@@ -68,7 +74,7 @@ public class CoreEvaluateTaskController extends BaseController {
|
|
|
* 查询外包评价任务列表app
|
|
* 查询外包评价任务列表app
|
|
|
*/
|
|
*/
|
|
|
@ApiOperation(value = "查询评价任务列表app")
|
|
@ApiOperation(value = "查询评价任务列表app")
|
|
|
- @RequiresPermissions("core:evaluateTask:list")
|
|
|
|
|
|
|
+
|
|
|
@GetMapping("/appList")
|
|
@GetMapping("/appList")
|
|
|
public TableDataInfo<CoreEvaluateTaskVO> appList(EvaluateTaskDTO coreEvaluateTask) {
|
|
public TableDataInfo<CoreEvaluateTaskVO> appList(EvaluateTaskDTO coreEvaluateTask) {
|
|
|
return coreEvaluateTaskService.selectAPPPage(coreEvaluateTask);
|
|
return coreEvaluateTaskService.selectAPPPage(coreEvaluateTask);
|
|
@@ -114,31 +120,71 @@ public class CoreEvaluateTaskController extends BaseController {
|
|
|
AjaxResult ajaxResult = AjaxResult.success();
|
|
AjaxResult ajaxResult = AjaxResult.success();
|
|
|
SysOrg sysOrg = remoteOrgService.selectSysOrgById(evaluateTaskStatisticsDTO.getOrgId(), SecurityConstants.INNER);
|
|
SysOrg sysOrg = remoteOrgService.selectSysOrgById(evaluateTaskStatisticsDTO.getOrgId(), SecurityConstants.INNER);
|
|
|
ajaxResult.put("orgName", sysOrg.getShortName());
|
|
ajaxResult.put("orgName", sysOrg.getShortName());
|
|
|
|
|
+
|
|
|
if (null != evaluateTaskStatisticsDTO.getPlanId()) {
|
|
if (null != evaluateTaskStatisticsDTO.getPlanId()) {
|
|
|
CoreEvaluatePlanVO coreEvaluatePlanVO = coreEvaluatePlanService.selectCoreEvaluatePlanById(evaluateTaskStatisticsDTO.getPlanId());
|
|
CoreEvaluatePlanVO coreEvaluatePlanVO = coreEvaluatePlanService.selectCoreEvaluatePlanById(evaluateTaskStatisticsDTO.getPlanId());
|
|
|
LocalDate localDate = LocalDate.now();
|
|
LocalDate localDate = LocalDate.now();
|
|
|
String dateTitle = null;
|
|
String dateTitle = null;
|
|
|
|
|
+ String year;
|
|
|
|
|
+ String month;
|
|
|
try {
|
|
try {
|
|
|
switch (coreEvaluatePlanVO.getEvaluateCycle()) {
|
|
switch (coreEvaluatePlanVO.getEvaluateCycle()) {
|
|
|
case "0":
|
|
case "0":
|
|
|
- dateTitle = localDate.getYear() + "年" + localDate.getMonthValue() + "月)";
|
|
|
|
|
- evaluateTaskStatisticsDTO.setStartTime(DateUtils.parseDate(localDate.getYear() + "-" + localDate.getMonthValue() + "-01 00:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
|
|
|
|
|
- String lastDay = coreMonitoringRetrievalTaskService.getLastDay(localDate.getYear(), localDate.getMonthValue(), "yyyy-MM-dd");
|
|
|
|
|
- evaluateTaskStatisticsDTO.setEndTime(DateUtils.parseDate(lastDay + " 23:59:59", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
|
|
|
|
|
|
|
+ if (StringUtils.isEmpty(evaluateTaskStatisticsDTO.getSearchTime())) {
|
|
|
|
|
+ evaluateTaskStatisticsDTO.setStartTime(DateUtils.parseDate(localDate.getYear() + "-" + localDate.getMonthValue() + "-01 00:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
|
|
|
|
|
+ String lastDay = coreMonitoringRetrievalTaskService.getLastDay(localDate.getYear(), localDate.getMonthValue(), "yyyy-MM-dd");
|
|
|
|
|
+ evaluateTaskStatisticsDTO.setEndTime(DateUtils.parseDate(lastDay + " 23:59:59", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
|
|
|
|
|
+ year = String.valueOf(localDate.getYear());
|
|
|
|
|
+ month = String.valueOf(localDate.getMonthValue());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ evaluateTaskStatisticsDTO.setStartTime(DateUtils.parseDate(evaluateTaskStatisticsDTO.getSearchTime() + "-01 00:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
|
|
|
|
|
+ String[] split = evaluateTaskStatisticsDTO.getSearchTime().split("-");
|
|
|
|
|
+ String lastDay = coreMonitoringRetrievalTaskService.getLastDay(Integer.parseInt(split[0]), Integer.parseInt(split[1]), "yyyy-MM-dd");
|
|
|
|
|
+ evaluateTaskStatisticsDTO.setEndTime(DateUtils.parseDate(lastDay + " 23:59:59", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
|
|
|
|
|
+ year = split[0];
|
|
|
|
|
+ month = split[1];
|
|
|
|
|
+ }
|
|
|
|
|
+ dateTitle = year + "年" + month + "月)";
|
|
|
break;
|
|
break;
|
|
|
case "1":
|
|
case "1":
|
|
|
- DateTime beginOfQuarter = DateUtil.beginOfQuarter(new java.util.Date());
|
|
|
|
|
- DateTime endOfQuarter = DateUtil.endOfQuarter(new Date());
|
|
|
|
|
- evaluateTaskStatisticsDTO.setStartTime(beginOfQuarter);
|
|
|
|
|
- evaluateTaskStatisticsDTO.setEndTime(endOfQuarter);
|
|
|
|
|
- int month = localDate.getMonthValue();
|
|
|
|
|
- int quarter = (month - 1) / 3 + 1;
|
|
|
|
|
- dateTitle = localDate.getYear() + "年第" + quarter + "季度)";
|
|
|
|
|
|
|
+ if (StringUtils.isEmpty(evaluateTaskStatisticsDTO.getSearchTime())) {
|
|
|
|
|
+ DateTime beginOfQuarter = DateUtil.beginOfQuarter(new java.util.Date());
|
|
|
|
|
+ DateTime endOfQuarter = DateUtil.endOfQuarter(new Date());
|
|
|
|
|
+ evaluateTaskStatisticsDTO.setStartTime(beginOfQuarter);
|
|
|
|
|
+ evaluateTaskStatisticsDTO.setEndTime(endOfQuarter);
|
|
|
|
|
+ int month1 = localDate.getMonthValue();
|
|
|
|
|
+ int quarter = (month1 - 1) / 3 + 1;
|
|
|
|
|
+ dateTitle = localDate.getYear() + "年第" + quarter + "季度)";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ String[] split = evaluateTaskStatisticsDTO.getSearchTime().split("-");
|
|
|
|
|
+ Integer s = Integer.valueOf(split[1]);
|
|
|
|
|
+ String end = split[0] + "-" + (s + 2) + "-01";
|
|
|
|
|
+ Date startTime = new Date();
|
|
|
|
|
+ Date endTime = new Date();
|
|
|
|
|
+ try {
|
|
|
|
|
+ startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(evaluateTaskStatisticsDTO.getSearchTime() + "-01 00:00:00");
|
|
|
|
|
+ String lastDay = resumptionReportService.getLastDay(end);
|
|
|
|
|
+ endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(lastDay + " 23:59:59");
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ evaluateTaskStatisticsDTO.setStartTime(startTime);
|
|
|
|
|
+ evaluateTaskStatisticsDTO.setEndTime(endTime);
|
|
|
|
|
+ Integer month1 = (Integer.valueOf(split[1]) - 1) / 3 + 1;
|
|
|
|
|
+ dateTitle = split[0] + "年第" + month1 + "季度)";
|
|
|
|
|
+ }
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
- evaluateTaskStatisticsDTO.setStartTime(DateUtils.parseDate(localDate.getYear() + "-01-01 00:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
|
|
|
|
|
- evaluateTaskStatisticsDTO.setEndTime(DateUtils.parseDate(localDate.getYear() + "-12-31 23:59:59", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
|
|
|
|
|
- dateTitle = localDate.getYear() + "年)";
|
|
|
|
|
|
|
+ if (StringUtils.isEmpty(evaluateTaskStatisticsDTO.getSearchTime())) {
|
|
|
|
|
+ evaluateTaskStatisticsDTO.setStartTime(DateUtils.parseDate(localDate.getYear() + "-01-01 00:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
|
|
|
|
|
+ evaluateTaskStatisticsDTO.setEndTime(DateUtils.parseDate(localDate.getYear() + "-12-31 23:59:59", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
|
|
|
|
|
+ year = String.valueOf(localDate.getYear());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ evaluateTaskStatisticsDTO.setStartTime(DateUtils.parseDate(evaluateTaskStatisticsDTO.getSearchTime() + "-01-01 00:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
|
|
|
|
|
+ evaluateTaskStatisticsDTO.setEndTime(DateUtils.parseDate(evaluateTaskStatisticsDTO.getSearchTime() + "-12-31 23:59:59", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
|
|
|
|
|
+ year = evaluateTaskStatisticsDTO.getSearchTime();
|
|
|
|
|
+ }
|
|
|
|
|
+ dateTitle = year + "年)";
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -147,7 +193,6 @@ public class CoreEvaluateTaskController extends BaseController {
|
|
|
ajaxResult.put("tittle", coreEvaluatePlanVO.getEvaluateName() + "(" + dateTitle);
|
|
ajaxResult.put("tittle", coreEvaluatePlanVO.getEvaluateName() + "(" + dateTitle);
|
|
|
}
|
|
}
|
|
|
ajaxResult.put(AjaxResult.DATA_TAG, coreEvaluateTaskService.statistics(evaluateTaskStatisticsDTO));
|
|
ajaxResult.put(AjaxResult.DATA_TAG, coreEvaluateTaskService.statistics(evaluateTaskStatisticsDTO));
|
|
|
-
|
|
|
|
|
return ajaxResult;
|
|
return ajaxResult;
|
|
|
}
|
|
}
|
|
|
|
|
|