This commit is contained in:
zhouhefeng
2026-06-02 08:17:07 +08:00
parent 268cbd6a49
commit 449428b762
3 changed files with 409 additions and 82 deletions
@@ -7,6 +7,8 @@ import com.alibaba.excel.EasyExcel;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.sys.models.Sys_union;
import com.budwk.app.sys.models.Sys_union_cadre;
import com.budwk.app.zhgh.staffmanage.member.models.MemberHistory;
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberInfoPageForm;
import com.budwk.app.zhgh.staffmanage.member.service.MemberInfoService;
@@ -14,6 +16,7 @@ import com.budwk.app.zhgh.staffmanage.member.vo.MemberImportVo;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
@@ -30,6 +33,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.stream.Collectors;
/**
* @version 1.0
@@ -72,6 +76,58 @@ public class MemberInfoGroupController {
return Result.success(pagination);
}
@At
@SaCheckPermission("member.info.group")
public Result unionOverview(String unionId) {
Sys_union union = memberInfoService.dao().fetch(Sys_union.class, unionId);
if (union == null) {
return Result.success(NutMap.NEW());
}
int staffTotal = memberInfoService.count(Sqls.create("""
select count(1)
from vw_user u
where u.unionId = @unionId
and u.personType in (
select dict.code
from sys_dict dict
left join sys_dict parent on parent.id = dict.parentId
where parent.code = 'USER_PERSON_TYPE'
and dict.name = '教职工'
)
""")
.setParam("unionId", unionId));
int memberTotal = memberInfoService.count(Sqls.create("select count(1) from vw_user where unionId = @unionId and member = 1")
.setParam("unionId", unionId));
int maleTotal = memberInfoService.count(Sqls.create("select count(1) from vw_user where unionId = @unionId and member = 1 and (sex = '男' or sex = '男性')")
.setParam("unionId", unionId));
int femaleTotal = memberInfoService.count(Sqls.create("select count(1) from vw_user where unionId = @unionId and member = 1 and (sex = '女' or sex = '女性')")
.setParam("unionId", unionId));
java.util.List<Sys_union_cadre> chairmen = memberInfoService.dao().query(Sys_union_cadre.class,
Cnd.where("unionId", "=", unionId)
.and("roleCode", "=", "BRANCH_UNION_CHAIRMAN")
.and(Cnd.exps("isServing", "=", true).or("isServing", "is", null)));
String chairman = chairmen.stream()
.map(item -> item.getUserName() + "(" + item.getLoginName() + ")")
.collect(Collectors.joining(""));
String chairmanMobile = chairmen.stream()
.map(Sys_union_cadre::getMobile)
.filter(mobile -> mobile != null && !mobile.isBlank())
.collect(Collectors.joining(""));
return Result.success(NutMap.NEW()
.addv("unionName", union.getName())
.addv("unionCode", union.getUnionCode())
.addv("chairman", chairman)
.addv("telephone", union.getTelephone())
.addv("chairmanMobile", chairmanMobile)
.addv("memberTotal", memberTotal)
.addv("staffTotal", staffTotal)
.addv("maleTotal", maleTotal)
.addv("femaleTotal", femaleTotal));
}
@At
@SaCheckPermission("member.info.group")