|
|
@@ -8,6 +8,7 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Optional;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import com.itextpdf.kernel.geom.PageSize;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
@@ -15,6 +16,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
|
|
import jakarta.validation.constraints.*;
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import org.dromara.backstage.cardCenter.domain.bo.PtSubsidyReportBo;
|
|
|
+import org.dromara.backstage.cardCenter.domain.vo.PtSubsidyFirstPageVo;
|
|
|
import org.dromara.backstage.cardCenter.domain.vo.PtSubsidyReportVo;
|
|
|
import org.dromara.common.core.utils.DateUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
@@ -132,6 +134,36 @@ public class PtSubsidyitemController extends BaseController {
|
|
|
return ptSubsidyitemService.queryPageReportList(bo, pageQuery);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 首页查询 每月的补助报表
|
|
|
+ * @param bo
|
|
|
+ * @param pageQuery
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/queryReportByManager")
|
|
|
+ public R<List<PtSubsidyFirstPageVo>> queryReportByManager() {
|
|
|
+
|
|
|
+
|
|
|
+ // todo 待完善: 获取当前登录用户的角色,如果角色是管理员、补助管理员、补助发放、补助审核人员则返回数据,否则返回个人的补助列表信息
|
|
|
+ //dict_first_page_show_role
|
|
|
+
|
|
|
+ // todo 提取到service类中
|
|
|
+
|
|
|
+ PtSubsidyReportBo bo = new PtSubsidyReportBo();
|
|
|
+ bo.setCountType("1");
|
|
|
+ PageQuery pageQuery = new PageQuery();
|
|
|
+ pageQuery.setPageNum(1);
|
|
|
+ pageQuery.setPageSize(12);
|
|
|
+
|
|
|
+ TableDataInfo<PtSubsidyReportVo> result = ptSubsidyitemService.queryPageReportList(bo, pageQuery);
|
|
|
+
|
|
|
+ List<PtSubsidyFirstPageVo> list = result.getRows().stream().map(item -> {
|
|
|
+ return new PtSubsidyFirstPageVo(item.getFillDate(), item.getFillMoney(), item.getCountNumber());
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
+ return R.ok(list);
|
|
|
+ }
|
|
|
+
|
|
|
//补助报表导出
|
|
|
@SaCheckPermission("subsidy:ptSubsidyitem:ptSubsidyitemReport")
|
|
|
@Log(title = "补助报表导出", businessType = BusinessType.EXPORT)
|
|
|
@@ -179,7 +211,7 @@ public class PtSubsidyitemController extends BaseController {
|
|
|
response.setContentType("application/pdf; charset=UTF-8");
|
|
|
response.setHeader("Content-Disposition", URLEncoder.encode(fileName, StandardCharsets.UTF_8));
|
|
|
|
|
|
- PdfUtil.renderPdf("PtSubsidyReport.html",hashMap, response.getOutputStream(), PageSize.A4);
|
|
|
+ PdfUtil.renderPdf("PtSubsidyReport.html",hashMap, response.getOutputStream(), PageSize.A4.rotate());
|
|
|
} catch (IOException e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|