diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/controller/HealthCheckupListController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/controller/HealthCheckupListController.java index 90397725..1568595b 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/controller/HealthCheckupListController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/controller/HealthCheckupListController.java @@ -189,11 +189,17 @@ public class HealthCheckupListController { .add("auditTime", DateUtil.date()) .add("auditUser", SecurityUtil.getUserId()), Cnd.where("projectId", "=", projectId).and("unionId", "=", unionId)); + + dao.update(HealthCheckupUser.class, Chain.make("isAudit", true), + Cnd.where("projectId", "=", projectId).and("unionId", "=", unionId)); } else { dao.update(HealthCheckupUnionConfirm.class, Chain.make("isAudit", null) .add("auditTime", null) .add("auditUser", null), Cnd.where("projectId", "=", projectId).and("unionId", "=", unionId)); + + dao.update(HealthCheckupUser.class, Chain.make("isAudit", null), + Cnd.where("projectId", "=", projectId).and("unionId", "=", unionId)); } return Result.success(); } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/controller/HealthCheckupPersonConfirmStatisticsController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/controller/HealthCheckupPersonConfirmStatisticsController.java new file mode 100644 index 00000000..13bebfb2 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/controller/HealthCheckupPersonConfirmStatisticsController.java @@ -0,0 +1,44 @@ +package com.budwk.app.zhgh.dayofficework.healthCheckup.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.param.PageForm; +import com.budwk.app.base.result.Result; +import com.budwk.app.zhgh.dayofficework.healthCheckup.service.HealthCheckupPersonConfirmStatisticsService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; + +/** + * @ClassName HealthCheckupPersonConfirmStatisticsController + * @Description 工会确认情况统计 + * @Author Codex + * @Date 2026/4/28 + */ +@IocBean +@Ok("json:full") +@Api(tags = "体检人员确认情况统计") +@At("/platform/healthCheckup/statistics/personconfirm") +public class HealthCheckupPersonConfirmStatisticsController { + + @Inject + private HealthCheckupPersonConfirmStatisticsService healthCheckupPersonConfirmStatisticsService; + + @At("") + @Ok("beetl:/platform/zhgh/dayofficework/healthCheckup/personconfirm/index.html") + @SaCheckPermission("healthCheckup.personconfirm") + public void index() { + } + + @At + @ApiOperation("工会确认情况分页统计") + @SaCheckPermission("healthCheckup.personconfirm") + public Result pageData(PageForm pageForm, Integer year, String projectId, String unionId) { + // 统计报表按年度、体检项目查询,工会条件选填,统一返回分页结果供前端表格展示。 + Pagination statistics = healthCheckupPersonConfirmStatisticsService.personConfirmPageData(pageForm.getPageNumber(), pageForm.getPageSize(), year, projectId, unionId); + return Result.success(statistics); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/controller/HealthCheckupSingleController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/controller/HealthCheckupSingleController.java index eb8bcf20..4e9263dc 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/controller/HealthCheckupSingleController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/controller/HealthCheckupSingleController.java @@ -73,7 +73,6 @@ public class HealthCheckupSingleController { public void index() { } - @At @ApiOperation("首页查询") @SaCheckPermission("healthCheckup.statisticsSingle") @@ -445,4 +444,7 @@ public class HealthCheckupSingleController { return Result.success("不存在未体检人员"); } } + + + } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/model/HealthCheckupUser.java b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/model/HealthCheckupUser.java index 3442dc77..81af236e 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/model/HealthCheckupUser.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/model/HealthCheckupUser.java @@ -101,7 +101,7 @@ public class HealthCheckupUser extends BaseModel implements Serializable { private String personType; @Column - @Comment("确认状态") + @Comment("确认状态(用户选择体检医院确认)") @ColDefine(type = ColType.CHAR) @Default("0") private String confirmStatus; @@ -122,5 +122,8 @@ public class HealthCheckupUser extends BaseModel implements Serializable { @ColDefine(type = ColType.TEXT) private String bz; - + @Column + @Comment("是否确认") + @ColDefine(type = ColType.BOOLEAN) + private Boolean isAudit; } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/service/HealthCheckupPersonConfirmStatisticsService.java b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/service/HealthCheckupPersonConfirmStatisticsService.java new file mode 100644 index 00000000..5cf0a979 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/service/HealthCheckupPersonConfirmStatisticsService.java @@ -0,0 +1,26 @@ +package com.budwk.app.zhgh.dayofficework.healthCheckup.service; + +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.service.BaseService; +import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupUser; + +/** + * @ClassName HealthCheckupPersonConfirmStatisticsService + * @Description 工会人员确认情况统计 + * @Author Codex + * @Date 2026/4/28 + */ +public interface HealthCheckupPersonConfirmStatisticsService extends BaseService { + + /** + * 工会确认情况分页统计 + * + * @param pageNumber 页码 + * @param pageSize 页大小 + * @param year 年度 + * @param projectId 体检项目 + * @param unionId 工会 + * @return 统计分页结果 + */ + Pagination personConfirmPageData(Integer pageNumber, Integer pageSize, Integer year, String projectId, String unionId); +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/service/impl/HealthCheckupPersonConfirmStatisticsServiceImpl.java b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/service/impl/HealthCheckupPersonConfirmStatisticsServiceImpl.java new file mode 100644 index 00000000..5d11af6f --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/service/impl/HealthCheckupPersonConfirmStatisticsServiceImpl.java @@ -0,0 +1,60 @@ +package com.budwk.app.zhgh.dayofficework.healthCheckup.service.impl; + +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupUser; +import com.budwk.app.zhgh.dayofficework.healthCheckup.service.HealthCheckupPersonConfirmStatisticsService; +import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +import org.nutz.ioc.loader.annotation.IocBean; + +/** + * @ClassName HealthCheckupPersonConfirmStatisticsServiceImpl + * @Description 工会人员确认情况统计实现 + * @Author Codex + * @Date 2026/4/28 + */ +@IocBean(args = {"refer:dao"}) +public class HealthCheckupPersonConfirmStatisticsServiceImpl extends BaseServiceImpl implements HealthCheckupPersonConfirmStatisticsService { + + public HealthCheckupPersonConfirmStatisticsServiceImpl(Dao dao) { + super(dao); + } + + @Override + public Pagination personConfirmPageData(Integer pageNumber, Integer pageSize, Integer year, String projectId, String unionId) { + // 统计以系统工会为主表,保证未报名的工会也会显示在列表中。 + Sql sql = Sqls.create(""" + SELECT + su.id AS unionId, + su.name AS unionName, + COUNT(CASE WHEN hcp.id IS NOT NULL THEN hcu.id END) AS totalCount, + SUM(CASE WHEN hcp.id IS NOT NULL AND hcu.isAudit = '1' THEN 1 ELSE 0 END) AS confirmedCount, + SUM(CASE WHEN hcp.id IS NOT NULL AND hcu.id IS NOT NULL AND (hcu.isAudit IS NULL OR hcu.isAudit <> '1') THEN 1 ELSE 0 END) AS unconfirmedCount, + CASE + WHEN COUNT(CASE WHEN hcp.id IS NOT NULL THEN hcu.id END) > 0 + AND COUNT(CASE WHEN hcp.id IS NOT NULL THEN hcu.id END) = SUM(CASE WHEN hcp.id IS NOT NULL AND hcu.isAudit = '1' THEN 1 ELSE 0 END) THEN '已完成' + ELSE '未完成' + END AS completeStatus + FROM sys_union su + LEFT JOIN health_checkup_user hcu ON hcu.unionId = su.id + AND hcu.delFlag = 0 + AND hcu.projectId = @projectId + LEFT JOIN health_checkup_project hcp ON hcp.id = hcu.projectId + AND hcp.delFlag = 0 + AND hcp.year = @year + $condition + """).setParam("projectId", projectId).setParam("year", year); + Cnd cnd = Cnd.NEW(); + cnd.andEX("su.id", "=", unionId); + cnd.groupBy("su.id,su.name"); + cnd.asc("completeStatus"); + cnd.asc("su.unionCode"); + sql.setCondition(cnd); + // isAudit 存在于 health_checkup_user 中,只要还有未确认人员,该工会状态就显示未完成。 + // 排序按报名总人数倒序,人数相同时再按工会编码升序,保证列表顺序稳定。 + return listPageMap(pageNumber, pageSize, sql); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/service/impl/HealthCheckupSingleServiceImpl.java b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/service/impl/HealthCheckupSingleServiceImpl.java index 46defe1e..8f4487d1 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/service/impl/HealthCheckupSingleServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/healthCheckup/service/impl/HealthCheckupSingleServiceImpl.java @@ -127,7 +127,6 @@ public class HealthCheckupSingleServiceImpl extends BaseServiceImpl receivePageDataColumns(String projectId) { List labelList = new ArrayList<>(); diff --git a/src/main/resources/views/platform/zhgh/dayofficework/healthCheckup/personconfirm/index.html b/src/main/resources/views/platform/zhgh/dayofficework/healthCheckup/personconfirm/index.html new file mode 100644 index 00000000..0acabedc --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/healthCheckup/personconfirm/index.html @@ -0,0 +1,165 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +