|
@@ -3,9 +3,11 @@ package com.ruoyi.project.plant.controller;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.io.OutputStream;
|
|
import java.io.OutputStream;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.Calendar;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.document.DocumentHandler;
|
|
import com.ruoyi.common.utils.document.DocumentHandler;
|
|
import com.ruoyi.common.utils.document.PDFTemplateUtil;
|
|
import com.ruoyi.common.utils.document.PDFTemplateUtil;
|
|
import com.ruoyi.framework.config.RuoYiConfig;
|
|
import com.ruoyi.framework.config.RuoYiConfig;
|
|
@@ -26,6 +28,7 @@ import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
|
|
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
|
|
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
|
|
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
|
|
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
|
|
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
|
|
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
|
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -77,7 +80,18 @@ public class TTargetagreementController extends BaseController
|
|
public TableDataInfo list(TTargetagreement tTargetagreement)
|
|
public TableDataInfo list(TTargetagreement tTargetagreement)
|
|
{
|
|
{
|
|
startPage();
|
|
startPage();
|
|
- List<TTargetagreement> list = tTargetagreementService.selectTTargetagreementList(tTargetagreement);
|
|
|
|
|
|
+ List<TTargetagreement> list;
|
|
|
|
+ if (StringUtils.isEmpty(tTargetagreement.getYear())) {
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
+ tTargetagreement.setYear(String.valueOf(calendar.get(Calendar.YEAR)));
|
|
|
|
+ list = tTargetagreementService.selectTTargetagreementList(tTargetagreement);
|
|
|
|
+ if (CollectionUtils.isEmpty(list)){
|
|
|
|
+ tTargetagreement.setYear(String.valueOf(calendar.get(Calendar.YEAR)-1));
|
|
|
|
+ list = tTargetagreementService.selectTTargetagreementList(tTargetagreement);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ list = tTargetagreementService.selectTTargetagreementList(tTargetagreement);
|
|
|
|
+ }
|
|
List<SysDictData> partnersDict = iSysDictTypeService.selectDictDataByType("PARTNERS");
|
|
List<SysDictData> partnersDict = iSysDictTypeService.selectDictDataByType("PARTNERS");
|
|
for (TTargetagreement t : list) {
|
|
for (TTargetagreement t : list) {
|
|
List<TTargetyardstick> tTargetyardsticks = tTargetyardstickService.selectTTargetyardstickByAgreementId(t.getId());
|
|
List<TTargetyardstick> tTargetyardsticks = tTargetyardstickService.selectTTargetyardstickByAgreementId(t.getId());
|