|
@@ -3,12 +3,10 @@ package com.ruoyi.project.plant.controller;
|
|
|
import java.io.IOException;
|
|
|
import java.io.OutputStream;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.document.DocumentHandler;
|
|
|
import com.ruoyi.common.utils.document.PDFTemplateUtil;
|
|
|
import com.ruoyi.common.utils.file.ExcelUtils;
|
|
@@ -22,6 +20,7 @@ import com.ruoyi.project.system.domain.SysDictData;
|
|
|
import com.ruoyi.project.system.service.ISysDeptService;
|
|
|
import com.ruoyi.project.system.service.ISysDictTypeService;
|
|
|
import freemarker.template.Template;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -72,7 +71,19 @@ public class TTargetreviewController extends BaseController
|
|
|
public TableDataInfo list(TTargetreview tTargetreview)
|
|
|
{
|
|
|
startPage();
|
|
|
- List<TTargetreview> list = tTargetreviewService.selectTTargetreviewList(tTargetreview);
|
|
|
+
|
|
|
+ List<TTargetreview> list;
|
|
|
+ if (tTargetreview.getYear()== null) {
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ tTargetreview.setYear(Long.valueOf(calendar.get(Calendar.YEAR)));
|
|
|
+ list = tTargetreviewService.selectTTargetreviewList(tTargetreview);
|
|
|
+ if (CollectionUtils.isEmpty(list)){
|
|
|
+ tTargetreview.setYear(Long.valueOf(calendar.get(Calendar.YEAR)-1));
|
|
|
+ list = tTargetreviewService.selectTTargetreviewList(tTargetreview);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list = tTargetreviewService.selectTTargetreviewList(tTargetreview);
|
|
|
+ }
|
|
|
for (TTargetreview t : list) {
|
|
|
if (t.getPrincipal() != null) {
|
|
|
String[] principal = t.getPrincipal().split(",");
|