协会整改
This commit is contained in:
+3
-1
@@ -133,6 +133,9 @@ public class ClubExamineApplyController {
|
||||
.and("year", "=", year)
|
||||
.desc("year")
|
||||
);
|
||||
if (club == null) {
|
||||
return Result.success(0f);
|
||||
}
|
||||
Number number = ObjectUtil.defaultIfNull(club.getTotalQuota(), 0);
|
||||
return Result.success(number.floatValue());
|
||||
}
|
||||
@@ -154,7 +157,6 @@ public class ClubExamineApplyController {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.examine")
|
||||
public Result info(String id) {
|
||||
if(StrUtil.isBlank(id)) {
|
||||
return Result.error("id信息为空,请核查");
|
||||
|
||||
+57
@@ -1,17 +1,29 @@
|
||||
package com.budwk.app.zhgh.club.controller.examine;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubExamineService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubExamineVo;
|
||||
import com.budwk.app.zhgh.club.vo.ClubExaminePageVo;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ClubExamineSchoolLeaderAuditController
|
||||
@@ -39,4 +51,49 @@ public class ClubExamineSchoolLeaderAuditController {
|
||||
Pagination<ClubExaminePageVo> pagination = sysClubExamineService.schoolLeaderAuditPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("club.examine.schoolLeaderAudit")
|
||||
public void doExportPlan(String id, HttpServletResponse response) {
|
||||
ClubExamineVo examineVo = sysClubExamineService.findOne(id);
|
||||
if (Lang.isEmpty(examineVo)) {
|
||||
return;
|
||||
}
|
||||
// 导出下一年度活动计划,字段顺序与查看页列表保持一致。
|
||||
List<NutMap> exportData = sysClubExamineService.getPlanExportData(id);
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("活动主题/赛事名称", "activityName", 40));
|
||||
entityList.add(new ExcelExportEntity("活动/赛事主办单位", "activityUnit", 40));
|
||||
entityList.add(new ExcelExportEntity("活动地点", "activityAddress", 40));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, exportData);
|
||||
CommonDownloadUtil.download(examineVo.getClubName() + "下一年度活动计划.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("club.examine.schoolLeaderAudit")
|
||||
public void doExportActivity(String id, HttpServletResponse response) {
|
||||
ClubExamineVo examineVo = sysClubExamineService.findOne(id);
|
||||
if (Lang.isEmpty(examineVo)) {
|
||||
return;
|
||||
}
|
||||
// 导出本年度活动开展情况,字段与年审填报表格列保持一致。
|
||||
List<NutMap> exportData = sysClubExamineService.getYearActivityExportData(id);
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("活动时间", "activityTime", 20));
|
||||
entityList.add(new ExcelExportEntity("活动主题/赛事名称", "activityName", 40));
|
||||
entityList.add(new ExcelExportEntity("活动/赛事主办单位", "activityUnit", 40));
|
||||
entityList.add(new ExcelExportEntity("活动地点", "activityAddress", 40));
|
||||
entityList.add(new ExcelExportEntity("参加人数", "joinNum", 20));
|
||||
entityList.add(new ExcelExportEntity("获奖情况", "prize", 30));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, exportData);
|
||||
CommonDownloadUtil.download(examineVo.getClubName() + "本年度活动开展情况.xlsx", workbook, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,4 +30,20 @@ public interface SysClubExamineService extends BaseService<SysClubExamineRegiste
|
||||
Pagination<ClubExaminePageVo> schoolLeaderAuditPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
ClubExamineVo findOne(@Valid String id);
|
||||
|
||||
/**
|
||||
* 查询本年度活动开展情况导出数据。
|
||||
*
|
||||
* @param id 年审主键
|
||||
* @return 导出行数据
|
||||
*/
|
||||
List<NutMap> getYearActivityExportData(@Valid String id);
|
||||
|
||||
/**
|
||||
* 查询下一年度活动计划导出数据。
|
||||
*
|
||||
* @param id 年审主键
|
||||
* @return 导出行数据
|
||||
*/
|
||||
List<NutMap> getPlanExportData(@Valid String id);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.budwk.app.zhgh.club.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
@@ -308,7 +309,7 @@ public class SysClubExamineServiceImpl extends BaseServiceImpl<SysClubExamineReg
|
||||
""");
|
||||
// 构建基础分页查询条件
|
||||
buildPageBaseCondition(cnd, pageForm, "info");
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
// cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
cnd.groupBy("info.id");
|
||||
// cnd.desc("registerDate");
|
||||
cnd.asc("sc.foundTime");
|
||||
@@ -367,6 +368,41 @@ public class SysClubExamineServiceImpl extends BaseServiceImpl<SysClubExamineReg
|
||||
return clubExamineVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getYearActivityExportData(String id) {
|
||||
ClubExamineVo examineVo = this.findOne(id);
|
||||
if (Lang.isEmpty(examineVo) || Lang.isEmpty(examineVo.getYearActivityList())) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// 导出字段与前端表格字段保持一致,避免控制层再做字段转换。
|
||||
return examineVo.getYearActivityList().stream()
|
||||
.map(item -> Dict.create()
|
||||
.set("activityTime", item.getStr("activityTime"))
|
||||
.set("activityName", item.getStr("activityName"))
|
||||
.set("activityUnit", item.getStr("activityUnit"))
|
||||
.set("activityAddress", item.getStr("activityAddress"))
|
||||
.set("joinNum", item.getStr("joinNum"))
|
||||
.set("prize", item.getStr("prize")))
|
||||
.map(NutMap::new)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getPlanExportData(String id) {
|
||||
ClubExamineVo examineVo = this.findOne(id);
|
||||
if (Lang.isEmpty(examineVo) || Lang.isEmpty(examineVo.getPlans())) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// 下年度活动计划导出只保留页面已有的三个业务字段。
|
||||
return examineVo.getPlans().stream()
|
||||
.map(item -> Dict.create()
|
||||
.set("activityName", item.getStr("activityName"))
|
||||
.set("activityUnit", item.getStr("activityUnit"))
|
||||
.set("activityAddress", item.getStr("activityAddress")))
|
||||
.map(NutMap::new)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成审核分页通用SQL
|
||||
* @param pageForm 分页查询参数
|
||||
|
||||
Reference in New Issue
Block a user