|
@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -36,7 +37,15 @@ public class TFivesMonthlyInspectionController extends BaseController {
|
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo list(TFivesMonthlyInspection tFivesMonthlyInspection) {
|
|
|
startPage();
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
+ if (tFivesMonthlyInspection.getYear() == null) {
|
|
|
+ tFivesMonthlyInspection.setYear((long) cal.get(Calendar.YEAR));
|
|
|
+ }
|
|
|
List<TFivesMonthlyInspection> list = tFivesMonthlyInspectionService.selectTFivesMonthlyInspectionList(tFivesMonthlyInspection);
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
+ tFivesMonthlyInspection.setYear((long) (cal.get(Calendar.YEAR) - 1));
|
|
|
+ list = tFivesMonthlyInspectionService.selectTFivesMonthlyInspectionList(tFivesMonthlyInspection);
|
|
|
+ }
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|