This commit is contained in:
=
2025-12-17 19:51:52 +08:00
parent 119a3235a2
commit 7ecf065ffc
3 changed files with 17 additions and 2 deletions
@@ -219,6 +219,9 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
Cnd cnd = Cnd.NEW();
cnd.and("t1.projectId", "=", pageForm.getProjectId());
cnd.groupBy("t1.id");
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_ADMIN.name())) {
cnd.and("t1.welfareUnionId", "=", SecurityUtil.getUnionId());
}
cnd.asc("t1.welfareUnitId");
sql.setCondition(cnd);
List<NutMap> list = listMap(sql);
@@ -7,11 +7,14 @@ import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.export.ExcelExportService;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.sys.models.Sys_union;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.welfare.model.WelfareProject;
import com.budwk.app.zhgh.welfare.model.WelfareProjectSubjectOption;
import com.budwk.app.zhgh.welfare.service.WelfareStatisticsService;
@@ -44,9 +47,15 @@ public class WelfareStatisticsServiceImpl extends BaseServiceImpl<WelfareProject
@Override
public NutMap pageData(String projectId, String unionId) {
// 分工会数据
List<Sys_union> unions = dao().query(Sys_union.class, Cnd.NEW().andEX(Sys_union::getId, "=", unionId).asc(Sys_union::getUnionCode));
List<Sys_union> unions;
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_ADMIN.name())) {
unions = dao().query(Sys_union.class, Cnd.NEW().andEX(Sys_union::getId, "=", SecurityUtil.getUnionId()).asc(Sys_union::getUnionCode));
}else {
unions = dao().query(Sys_union.class, Cnd.NEW().andEX(Sys_union::getId, "=", unionId).asc(Sys_union::getUnionCode));
}
List<NutMap> mapUnions = BeanUtil.copyToList(unions, NutMap.class);
// 表格动态列数据
List<NutMap> dynamicTableColumns = new ArrayList<>() {{
add(NutMap.NEW().addv("label", "分工会").addv("prop", "name"));
@@ -468,6 +477,7 @@ public class WelfareStatisticsServiceImpl extends BaseServiceImpl<WelfareProject
""");
Cnd cnd = Cnd.NEW();
cnd.and("t1.projectId", "=", projectId);
cnd.groupBy("t1.userId");
sql.setCondition(cnd);
List<NutMap> welfareSelectionList = listMap(sql);
@@ -483,6 +493,7 @@ public class WelfareStatisticsServiceImpl extends BaseServiceImpl<WelfareProject
""");
Cnd cnd2 = Cnd.NEW();
cnd2.and("t1.welfareId", "=", projectId);
sql2.setCondition(cnd2);
List<NutMap> userSelections = listMap(sql2);