|
@@ -1,6 +1,7 @@
|
|
|
package com.management.platform.controller;
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -25,6 +26,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -46,14 +48,19 @@ public class FinancialAuditController {
|
|
|
|
|
|
@RequestMapping("/list")
|
|
|
public HttpRespMsg list(Integer pageIndex, Integer pageSize, String startDate, String endDate, Integer status, HttpServletRequest request) throws ParseException {
|
|
|
- HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
- Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
|
- QueryWrapper<FinancialAudit> queryWrapper = new QueryWrapper<FinancialAudit>()
|
|
|
- .eq("company_id", companyId)
|
|
|
- .eq("review_status", status)
|
|
|
- .ge("report_yrMnth", startDate)
|
|
|
- .le("report_yrMnth", endDate);
|
|
|
- IPage<FinancialAudit> auditIPage = financialAuditService.page(new Page<FinancialAudit>(pageIndex, pageSize), queryWrapper);
|
|
|
+ HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
+ DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
|
+ LambdaQueryWrapper<FinancialAudit> financialAuditLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ financialAuditLambdaQueryWrapper.eq(FinancialAudit::getCompanyId,companyId).between(FinancialAudit::getReportYrmnth,startDate,endDate).eq(status!=0,FinancialAudit::getReviewStatus,status);
|
|
|
+
|
|
|
+// QueryWrapper<FinancialAudit> queryWrapper = new QueryWrapper<FinancialAudit>()
|
|
|
+// .eq("company_id", companyId)
|
|
|
+// .eq("review_status", status)
|
|
|
+// .ge("report_yrMnth", startDate)
|
|
|
+// .le("report_yrMnth", endDate);
|
|
|
+
|
|
|
+ IPage<FinancialAudit> auditIPage = financialAuditService.page(new Page<FinancialAudit>(pageIndex, pageSize), financialAuditLambdaQueryWrapper);
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("records", auditIPage.getRecords());
|
|
|
map.put("total", auditIPage.getTotal());
|