This commit is contained in:
2025-08-28 11:29:13 +08:00
parent 0df2345b11
commit f364119414
116 changed files with 10189 additions and 850 deletions
@@ -0,0 +1,150 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
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.staffbenefit.excellentRecuperation.model.ExcellentRecuperationActivity;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationLine;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationQuotaAllocation;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationLineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
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.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* @author zhf
* @date 2025/8/26 20:13
* @description 活动管理
*/
@Slf4j
@IocBean
@At("/platform/excellentRecuperation/activityList")
@Api("优秀教职工疗休养管理")
@Ok("json:full")
public class ExcellentRecuperationActivityListController {
@Inject
private ExcellentRecuperationLineService excellentRecuperationLineService;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/excellentRecuperation/activityList/index.html")
@SaCheckLogin
public void index() {
}
@At
@ApiOperation("分页")
@SaCheckPermission("excellentRecuperation.activityList")
public Result pageData(PageForm pageForm, String year) {
Sql sql = Sqls.create("""
select * from excellent_recuperation_activity $condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(signUpStartTime)", "=", year);
sql.setCondition(cnd);
Pagination pagination = excellentRecuperationLineService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ApiOperation("获取线路列表")
@SaCheckPermission("excellentRecuperation.activityList")
public Result onSubmit(@Param("data") ExcellentRecuperationActivity excellentRecuperationActivity) {
if (StrUtil.isNotBlank(excellentRecuperationActivity.getId())) {
dao.clear(ExcellentRecuperationQuotaAllocation.class, Cnd.where("activityId", "=", excellentRecuperationActivity.getId()));
excellentRecuperationActivity.getUnionQuotaAllocationList().stream().forEach(v->{
v.setActivityId(excellentRecuperationActivity.getId());
});
dao.insert(excellentRecuperationActivity.getUnionQuotaAllocationList());
dao.update(excellentRecuperationActivity);
}else{
dao.insertWith(excellentRecuperationActivity, "unionQuotaAllocationList");
}
return Result.success();
}
@At
@ApiOperation("获取线路列表")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("excellentRecuperation.activityList")
@SLog(type = "excellentRecuperation", tag = "优秀教职工疗休养-活动管理", msg = "删除线路")
public Result onDelete(@Param("id") String id) {
dao.delete(ExcellentRecuperationActivity.class, id);
dao.clear(ExcellentRecuperationQuotaAllocation.class, Cnd.where("activityId", "=", id));
return Result.success();
}
@At
@ApiOperation("获取活动详细信息")
@SaCheckLogin
public Result findOne(String id) {
ExcellentRecuperationActivity recuperationActivity = dao.fetchLinks(dao.fetch(ExcellentRecuperationActivity.class, id), "unionQuotaAllocationList", Cnd.NEW().asc("unionCode"));
List<ExcellentRecuperationLine> lineList = excellentRecuperationLineService.query(Cnd.where("id", "in", recuperationActivity.getLinIds()));
List<String> lingNames = lineList.stream().map(ExcellentRecuperationLine::getLineName).toList();
recuperationActivity.setLinNames(StrUtil.join(",", lingNames));
return Result.success(recuperationActivity);
}
@At
@ApiOperation("获取线路列表")
@SaCheckPermission("excellentRecuperation.activityList")
public Result listLineListByThisYear() {
List<ExcellentRecuperationLine> excellentRecuperationLines = excellentRecuperationLineService.listLineListByThisYear();
return Result.success(excellentRecuperationLines);
}
@At
@ApiOperation("获取分工会以及分工会的会员数")
@SaCheckPermission("excellentRecuperation.activityList")
public Result listUnion() {
Sql sql = Sqls.create("""
SELECT
un.id unionId,
un.`name` unionName,
un.unionCode,
COUNT(u.id) memberNum
FROM
`sys_union` un
LEFT JOIN vw_user u ON u.unionId = un.id
AND u.member = 1
GROUP BY
un.id
ORDER BY
un.unionCode
""");
List<NutMap> list = excellentRecuperationLineService.listMap(sql);
return Result.success(list);
}
}
@@ -0,0 +1,262 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
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.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.flow.constant.FlowConst;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.enrollmentRegistration.model.EnrollmentRegistration;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationActivity;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationLine;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationSignUpUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* @author zhf
* @date 2025/8/27 11:12
* @description 活动报名
*/
@Slf4j
@IocBean
@At("/platform/excellentRecuperation/activitySignUp")
@Api("优秀教职工疗休养报名")
@Ok("json:full")
public class ExcellentRecuperationActivitySignUpController {
@Inject
private BaseService baseService;
@Inject
private Dao dao;
@Inject
private FlowEngine flowEngine;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/excellentRecuperation/activitySignUp/index.html")
@SaCheckLogin
public void index() {
}
@At
@ApiOperation("分页")
@SaCheckPermission("excellentRecuperation.activitySignUp")
public Result pageData(PageForm pageForm, String year, String unionId, String activityId) {
Sql sql = Sqls.create("""
SELECT
erqa.*,
era.activityName,
era.signUpStartTime,
era.signUpEndTIme
FROM
`excellent_recuperation_quota_allocation` erqa
LEFT JOIN excellent_recuperation_activity era ON era.id = erqa.activityId
$condition
""");
Cnd cnd = Cnd.NEW();
if (!AuthUtil.hasRoleOr(RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SYSADMIN.name())) {
cnd.and("erqa.unionId", "=", SecurityUtil.getUnionId());
}
cnd.andEX("YEAR(era.signUpStartTime)", "=", year);
cnd.andEX("erqa.unionId", "=", unionId);
cnd.and("erqa.activityId", "=", activityId);
cnd.asc("erqa.unionCode");
sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ApiOperation("保存")
@SaCheckPermission("excellentRecuperation.activitySignUp")
@SLog(type = "excellentRecuperationActivitySignUp", tag = "优秀教职工疗休养-活动报名", msg = "保存疗休养报名")
public Result save(@Param("data") ExcellentRecuperationSignUpUser signUpUser) {
List<ExcellentRecuperationSignUpUser> userList = dao.query(ExcellentRecuperationSignUpUser.class, Cnd.where("activityId", "=", signUpUser.getActivityId()));
List<String> userIds = userList.stream().map(ExcellentRecuperationSignUpUser::getUserId).toList();
if (StrUtil.isBlank(signUpUser.getId()) && userIds.contains(signUpUser.getUserId())) {
return Result.error("该用户已报名");
}
signUpUser.setSignUpTime(DateUtil.now());
baseService.insertOrUpdate(signUpUser);
return Result.success();
}
@At
@SaCheckPermission("enrollmentRegistration.apply")
@ApiOperation("提交")
@Aop(TransAop.READ_COMMITTED)
@SLog(type = "excellentRecuperationActivitySignUp", tag = "优秀教职工疗休养-活动报名", msg = "提交疗休养报名")
public Result submit(@Param("data") ExcellentRecuperationSignUpUser signUpUser) {
List<ExcellentRecuperationSignUpUser> userList = dao.query(ExcellentRecuperationSignUpUser.class, Cnd.where("activityId", "=", signUpUser.getActivityId()));
List<String> userIds = userList.stream().map(ExcellentRecuperationSignUpUser::getUserId).toList();
if (StrUtil.isBlank(signUpUser.getId()) && userIds.contains(signUpUser.getUserId())) {
return Result.error("该用户已报名");
}
if (StrUtil.isBlank(signUpUser.getId())) {
signUpUser.setSignUpTime(DateUtil.now());
}
baseService.insertOrUpdate(signUpUser);
// 开启流程实例
Dict args = Dict.create();
args.set(FlowConst.FORM_DATA, signUpUser);
ProcessInstance instance = flowEngine.startProcessInstanceByKey("YXJZGLXY", signUpUser.getId(), SecurityUtil.getUserId(), args);
// 自动完成第一个申请任务
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
for (ProcessTask task : doingTaskList) {
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
}
return Result.success();
}
@At
@ApiOperation("删除报名信息")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("enrollmentRegistration.summary")
@SLog(tag = "优秀教职工疗休养-活动报名", type = "excellentRecuperationActivitySignUp", msg = "删除id: ${args[0]}")
public Result doDelete(String id) {
dao.delete(ExcellentRecuperationSignUpUser.class, id);
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
return Result.success();
}
@At
@ApiOperation("查询当前工会当前活动报名的人员")
@SaCheckPermission("excellentRecuperation.activitySignUp")
public Result listQuotaAllocation(String unionId, String activityId) {
Sql sql = Sqls.create("""
SELECT
info.*,
line.lineName,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariale,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariale,
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
(SELECT MAX(id) FROM wf_process_task WHERE processInstanceId = ins.id AND taskName = 'startTask' AND taskState IN (10, 20)) AS startTaskId
FROM
excellent_recuperation_sign_user info
LEFT JOIN excellent_recuperation_line line ON line.id = info.lineId
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
AND t.taskState = 10
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("info.activityId", "=", activityId);
cnd.and("info.unionId", "=", unionId);
sql.setCondition(cnd);
List<NutMap> map = baseService.listMap(sql);
return Result.success(map);
}
@At
@ApiOperation("根据年份获取疗休养活动")
@SaCheckPermission("excellentRecuperation.activitySignUp")
public Result listActivityByYear(String year) {
List<ExcellentRecuperationActivity> activityList = dao.query(ExcellentRecuperationActivity.class,
Cnd.where("YEAR(signUpStartTime)", "=", year).desc("signUpStartTime"));
return Result.success(activityList);
}
@At
@ApiOperation("根据活动id获取线路")
@SaCheckPermission("excellentRecuperation.activitySignUp")
public Result listLineByActivityId(String id) {
ExcellentRecuperationActivity activity = dao.fetch(ExcellentRecuperationActivity.class, id);
List<ExcellentRecuperationLine> lineList = dao.query(ExcellentRecuperationLine.class, Cnd.where("id", "in", activity.getLinIds()));
return Result.success(lineList);
}
@At
@ApiOperation("查询用户")
@SaCheckPermission("excellentRecuperation.activitySignUp")
public Object listUser(String keyword, String unionId) {
Sql sql = Sqls.create("""
select
id,
username userName,
loginname loginName,
sex,
mobile,
IFNULL(unitname, '暂无') as unitName,
unitId,
unionId,
unionName,
idCard
from
vw_user
$condition
""");
Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(keyword)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or(View_user::getLoginname, "like", "%" + keyword + "%");
seg.or(View_user::getUsername, "like", "%" + keyword + "%");
cnd.and(seg);
}
cnd.and(View_user::getUnionId, "=", unionId);
sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(1, 50, sql);
return Result.success(pagination.getList());
}
@At
@ApiOperation("查询单个报名信息")
@SaCheckLogin
public Result findUserSignUp(String id){
return Result.success(dao.fetch(ExcellentRecuperationSignUpUser.class, id));
}
}
@@ -0,0 +1,145 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
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.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationLine;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationLineService;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationLine;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
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;
import org.nutz.mvc.annotation.Param;
import java.util.Objects;
/**
* @author zhf
* @date 2025/8/26 18:59
* @description 线路管理
*/
@Slf4j
@IocBean
@At("/platform/excellentRecuperation/line")
@Api("疗休养线路管理")
@Ok("json:full")
public class ExcellentRecuperationLineController {
@Inject
private Dao dao;
@Inject
private ExcellentRecuperationLineService lineService;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/excellentRecuperation/line/index.html")
@SaCheckLogin
public void index() {
}
@At
@ApiOperation("分页查询")
@SaCheckPermission("excellentRecuperation.line")
public Result pageData(PageForm pageForm,
@Param(value = "startYear") Integer startYear,
@Param(value = "endYear") Integer endYear,
@Param(value = "travelAgencyId") String travelAgencyId,
@Param(value = "lineName") String lineName,
@Param(value = "unionId") String unionId,
@Param(value = "lotId") String lotId) {
Cnd cnd = Cnd.NEW();
cnd.andEX("line.`year`", ">=", startYear);
cnd.andEX("line.`year`", "<=", endYear);
cnd.andEX("line.travelAgencyId", "=", travelAgencyId);
cnd.andEX("line.lotId", "=", lotId);
cnd.and(Cnd.likeEX("line.lineName", lineName));
cnd.desc("year").asc("serialNumber").asc("line.createdAt");
Pagination pagination = lineService.pageData(pageForm, cnd);
return Result.success(pagination);
}
@At
@ApiOperation("获取编号")
@SaCheckPermission("excellentRecuperation.line")
public Result getNo() {
Object serialNumber = dao.func2(ExcellentRecuperationLine.class, "max", "serialNumber");
serialNumber = Objects.requireNonNullElse(serialNumber, 0);
return Result.success(Integer.parseInt(serialNumber.toString()) + 1);
}
@At
@ApiOperation("新增/编辑疗休养线路")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("excellentRecuperation.line")
@SLog(type = "excellentRecuperation", tag = "新增/编辑疗休养线路", msg = "新增/编辑疗休养线路")
public Result onSubmit(ExcellentRecuperationLine line) {
if (StrUtil.isBlank(line.getId())) {
if (lineService.count(Cnd.where("serialNumber", "=", line.getSerialNumber())) > 0) {
return Result.error("编号已存在");
}
lineService.insert( line);
} else {
if (lineService.count(Cnd.where("serialNumber", "=", line.getSerialNumber()).and("id", "!=", line.getId())) > 0) {
return Result.error("编号已存在");
}
lineService.update( line);
}
return Result.success();
}
@At("/openClosedLine/?")
@ApiOperation("开启或关闭线路")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("excellentRecuperation.line")
@SLog(type = "excellentRecuperation", tag = "开启或关闭线路", msg = "开启或关闭线路")
public Result openClosedLine(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
lineService.update(Chain.makeSpecial("isDisabled", "isDisabled ^ 1"), Cnd.where("id", "=", id));
return Result.success();
}
@At
@ApiOperation("删除线路")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("excellentRecuperation.line")
@SLog(type = "excellentRecuperation", tag = "删除线路", msg = "删除线路")
public Result onDelete(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
lineService.delete(id);
return Result.success();
}
@At("/selectLineInfoById/?")
@ApiOperation("查询线路")
@SaCheckPermission("excellentRecuperation.line")
public Result selectLineInfoById(String id) {
Assert.notBlank(id);
ExcellentRecuperationLine line = lineService.fetchLinks(lineService.fetch(id), "travelAgency");
return Result.success(line);
}
}
@@ -0,0 +1,140 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
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.base.service.BaseService;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationActivity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
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.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* @author zhf
* @date 2025/8/28 08:42
* @description 校工会审核
*/
@Slf4j
@IocBean
@At("/platform/excellentRecuperation/schoolAudit")
@Api("疗休养校工会审核报名人员")
@Ok("json:full")
public class ExcellentRecuperationSchoolAuditController {
@Inject
private BaseService baseService;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/excellentRecuperation/schoolAudit/index.html")
@SaCheckLogin
public void index() {
}
@At
@ApiOperation("分页查询")
@SaCheckPermission("excellentRecuperation.schoolAudit")
public Result pageData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "unionId") String unionId,
@Param(value = "activityId") String activityId,
@Param(value = "unitId") String unitId,
@Param(value = "approval") Boolean approval) {
Sql sql = Sqls.create("""
SELECT
info.*,
line.lineName,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariale,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariable,
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
FROM
wf_process_task t
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
LEFT JOIN excellent_recuperation_sign_user info ON info.id = ins.businessNo
LEFT JOIN excellent_recuperation_line line ON line.id = info.lineId
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(info.signUpTime)", "=", year);
cnd.andEX("info.activityId", "=", activityId);
cnd.andEX("info.unionId", "=", unionId);
cnd.andEX("info.unitId", "=", unitId);
cnd.and("t.taskName", "=", "0a8a7e2f-bc0d-4849-8c97-5ef61ac0478b");
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
if (approval) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
} else {
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
}
if (StrUtil.isNotBlank(pageForm.getSearchName())&& StrUtil.isNotBlank(pageForm.getSearchKeyword())){
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
}
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.desc("info.signUpTime");
} else {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
}
cnd.groupBy("t.id");
sql.setCondition(cnd);
Pagination<NutMap> pageVO = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pageVO);
}
@At
@ApiOperation("根据年份获取疗休养活动")
@SaCheckPermission("excellentRecuperation.schoolAudit")
public Result listActivityByYear(String year) {
List<ExcellentRecuperationActivity> activityList = dao.query(ExcellentRecuperationActivity.class,
Cnd.where("YEAR(signUpStartTime)", "=", year).desc("signUpStartTime"));
return Result.success(activityList);
}
}
@@ -0,0 +1,125 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.annotation.SLog;
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.base.service.BaseService;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.sys.models.Sys_dict;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.enrollmentRegistration.model.EnrollmentRegistration;
import com.budwk.app.zhgh.enrollmentRegistration.vo.EnrollmentRegistrationPageForm;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationActivity;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationSummaryService;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.vo.ExcellentRecuperationPageForm;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.aop.interceptor.ioc.TransAop;
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.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhf
* @date 2025/8/28 10:11
* @description 查询统计
*/
@Slf4j
@IocBean
@At("/platform/excellentRecuperation/summary")
@Api("疗休养查询统计")
@Ok("json:full")
public class ExcellentRecuperationSummaryController {
@Inject
private ExcellentRecuperationSummaryService excellentRecuperationSummaryService;
@Inject
private FlowEngine flowEngine;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/excellentRecuperation/summary/index.html")
@SaCheckLogin
public void index() {
}
@At
@ApiOperation("分页查询")
@SaCheckPermission("enrollmentRegistration.summary")
public Result pageData(ExcellentRecuperationPageForm pageForm) {
Sql sql = excellentRecuperationSummaryService.getsql(pageForm);
Pagination pagination = excellentRecuperationSummaryService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ApiOperation("删除疗休养报名人员")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("enrollmentRegistration.summary")
@SLog(tag = "优秀教职工疗休养", msg = "删除疗休养报名人员id: ${args[0]}")
public Result doDelete(String id) {
excellentRecuperationSummaryService.dao().delete(EnrollmentRegistration.class, id);
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
return Result.success();
}
@At
@Ok("void")
@SaCheckPermission("enrollmentRegistration.summary")
public void doExportExcel(@Param("data") ExcellentRecuperationPageForm pageForm, HttpServletResponse response) {
try {
ExcellentRecuperationActivity activity = excellentRecuperationSummaryService.dao().fetch(ExcellentRecuperationActivity.class, pageForm.getActivityId());
Sql sql = excellentRecuperationSummaryService.getsql(pageForm);
List<NutMap> map = excellentRecuperationSummaryService.listMap(sql);
List<ExcelExportEntity> entityList = new ArrayList<>();
ExcelExportEntity no = new ExcelExportEntity("序号", "no", 10);
no.setFormat("isAddIndex");
entityList.add(no);
entityList.add(new ExcelExportEntity("姓名", "userName", 20));
entityList.add(new ExcelExportEntity("工号", "loginName", 20));
entityList.add(new ExcelExportEntity("手机号码", "mobile", 20));
entityList.add(new ExcelExportEntity("身份证号", "idCard", 20));
entityList.add(new ExcelExportEntity("线路", "lineName", 20));
entityList.add(new ExcelExportEntity("所属工会", "unionName", 20));
entityList.add(new ExcelExportEntity("所属单位", "unitName", 20));
entityList.add(new ExcelExportEntity("报名时间", "signUpTime", 20));
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(activity.getActivityName() + "疗休养报名人员汇总.xlsx", "UTF-8"));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, map);
workbook.write(response.getOutputStream());
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -0,0 +1,269 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.model.ExcelImportRes;
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.base.utils.CommonDownloadUtil;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationTravelAgency;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationTravelAgencyService;
import com.budwk.app.zhgh.staffbenefit.recuperation.mode.TravelAgencyExcelMode;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author zhf
* @date 2025/8/26 18:10
* @description
*/
@Slf4j
@IocBean
@At("/platform/excellentRecuperation/travelAgency")
@Api("疗休养旅行社管理")
@Ok("json:full")
public class ExcellentRecuperationTravelAgencyController {
@Inject
private Dao dao;
@Inject
private ExcellentRecuperationTravelAgencyService travelAgencyService;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/excellentRecuperation/travelAgency/index.html")
@SaCheckLogin
public void index() {}
@At
@ApiOperation("分页查询")
@SaCheckPermission("excellentRecuperation.travelAgency")
public Result pageData(PageForm pageForm,
@Param(value = "year") Integer year) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year);
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("contact", pageForm.getSearchKeyword());
seg.orLike("travelAgencyName", pageForm.getSearchKeyword());
seg.orLike("serialNumber", pageForm.getSearchKeyword());
cnd.and(seg);
}
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
} else {
cnd.asc("serialNumber");
}
Pagination pagination = travelAgencyService.pageData(pageForm, cnd);
return Result.success(pagination);
}
@At
@ApiOperation("新增/编辑疗休养旅行社")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("excellentRecuperation.travelAgency")
@SLog(type = "excellentRecuperation", tag = "新增/编辑疗休养旅行社", msg = "新增/编辑疗休养旅行社")
public Result onSubmit(ExcellentRecuperationTravelAgency travelAgency) {
if (StrUtil.isBlank(travelAgency.getId())) {
if (travelAgencyService.count(Cnd.where("serialNumber", "=", travelAgency.getSerialNumber())) > 0) {
return Result.error("编号已存在");
}
travelAgencyService.addTravelAgency(travelAgency);
} else {
if (travelAgencyService.count(Cnd.where("serialNumber", "=", travelAgency.getSerialNumber()).and("id", "!=", travelAgency.getId())) > 0) {
return Result.error("编号已存在");
}
travelAgencyService.editTravelAgency(travelAgency);
}
return Result.success();
}
@At("/openClosedTravelAgency/?")
@ApiOperation("开启或关闭旅行社")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("excellentRecuperation.travelAgency")
@SLog(type = "excellentRecuperation", tag = "开启或关闭旅行社", msg = "开启或关闭旅行社")
public Result openClosedTravelAgency(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
travelAgencyService.openTravelAgency(id);
return Result.success();
}
@At
@ApiOperation("删除旅行社")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("excellentRecuperation.travelAgency")
@SLog(type = "excellentRecuperation", tag = "删除旅行社", msg = "删除旅行社")
public Result onDelete(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
travelAgencyService.deleteTravelAgency(id);
return Result.success();
}
@At
@ApiOperation("查询旅行社")
@SaCheckPermission("excellentRecuperation.travelAgency")
public Result selectTravelAgency(Integer year) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year);
List<ExcellentRecuperationTravelAgency> list = travelAgencyService.selectAllTravelAgencyByYear(cnd);
return Result.success(list);
}
@At
@ApiOperation("年度区间查询旅行社")
@SaCheckPermission("excellentRecuperation.travelAgency")
public Result selectTravelAgencyByYears(Integer startYear, Integer endYear) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", ">=", startYear);
cnd.andEX("year", "<=", endYear);
List<ExcellentRecuperationTravelAgency> list = travelAgencyService.selectAllTravelAgencyByYear(cnd);
return Result.success(list);
}
@At
@ApiOperation("根据旅行社id查线路")
@SaCheckPermission("excellentRecuperation.travelAgency")
public Result selectLineByAgencyId(String agencyId) {
Sql sql = Sqls.create("""
SELECT id,lineName FROM `the_rapy_recuperation_line` WHERE travelAgencyId=@travelAgencyId
""").setParam("travelAgencyId", agencyId);
List<NutMap> listMap = travelAgencyService.listMap(sql);
return Result.success(listMap);
}
@At
@Ok("void")
@SaCheckPermission("excellentRecuperation.travelAgency")
public void downloadTemplate(HttpServletResponse response) {
List<NutMap> list = new ArrayList<>();
NutMap map = new NutMap();
map.put("year", 2025);
map.put("serialNumber", 1);
map.put("travelAgencyName", "杭州海外旅游有限公司");
map.put("contact", "张三");
map.put("contactMobileNumber", "17867895678");
map.put("email", "123@qq.com");
map.put("isDisabled", "");
list.add(map);
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("年度", "year", 20));
entities.add(new ExcelExportEntity("排序编号", "serialNumber", 20));
entities.add(new ExcelExportEntity("旅行社名称", "travelAgencyName", 20));
entities.add(new ExcelExportEntity("旅行社联系人", "contact", 20));
entities.add(new ExcelExportEntity("联系电话", "contactMobileNumber", 20));
entities.add(new ExcelExportEntity("邮箱", "email", 20));
entities.add(new ExcelExportEntity("官网", "officialWebsite", 20));
entities.add(new ExcelExportEntity("备注", "note", 20));
ExcelExportEntity excelExport = new ExcelExportEntity("是否启用(是/否)", "isDisabled", 20);
String[] options = {"是_1", "否_0"};
excelExport.setReplace(options);
excelExport.setAddressList(true);
entities.add(excelExport);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list);
CommonDownloadUtil.download("旅行社导入模板.xlsx", workbook, response);
}
@At
@ApiOperation("旅行社导入")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("excellentRecuperation.travelAgency")
@SLog(type = "excellentRecuperation", tag = "旅行社导入", msg = "旅行社导入")
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Result travelAgencyImport(@Param("file") TempFile file) {
List<TravelAgencyExcelMode> travelAgency = ExcelImportUtil.importExcel(file.getFile(), TravelAgencyExcelMode.class, new ImportParams());
// 创建结果集
ExcelImportRes<TravelAgencyExcelMode> excelImportRes = new ExcelImportRes<>();
excelImportRes.setTotalRecords(travelAgency.size());
List<RecuperationTravelAgency> travelAgencyList = dao.query(RecuperationTravelAgency.class, Cnd.NEW().desc("id"));
Map<String, String> map = travelAgencyList.stream().collect(Collectors.toMap(RecuperationTravelAgency::getTravelAgencyName, RecuperationTravelAgency::getId));
for (int i = 0; i < travelAgency.size(); i++) {
TravelAgencyExcelMode travel = travelAgency.get(i);
if(travel.getYear() == null) {
travel.setErrInfo("年度为空", i + 1);
continue;
}
if (StrUtil.isBlank(travel.getTravelAgencyName())) {
travel.setErrInfo("旅行社名称为空", i + 1);
continue;
}
RecuperationTravelAgency agency = new RecuperationTravelAgency();
if (Strings.isNotBlank(map.get(travel.getTravelAgencyName()))){
agency.setId(map.get(travel.getTravelAgencyName()));
}
if ("".equals(travel.getIsDisabled())) {
agency.setDisabled(false);
} else if ("".equals(travel.getIsDisabled())) {
agency.setDisabled(true);
}
agency.setContact(travel.getContact());
agency.setTravelAgencyName(travel.getTravelAgencyName());
agency.setSerialNumber(travel.getSerialNumber());
agency.setEmail(travel.getEmail());
agency.setContactMobileNumber(travel.getContactMobileNumber());
agency.setNote(travel.getNote());
agency.setYear(travel.getYear());
agency.setOfficialWebsite(travel.getOfficialWebsite());
try {
dao.insertOrUpdate(agency);
} catch (Exception e) {
log.error("导入旅行社失败:{}", e.getMessage());
travel.setErrInfo("添加失败", i + 1);
}
}
// 添加错误记录
excelImportRes.setErrorDetails(travelAgency.stream().filter(s -> StrUtil.isNotBlank(s.getErrMsg())).collect(Collectors.toList()));
excelImportRes.setFailedCount(excelImportRes.getErrorDetails().size());
excelImportRes.setSuccessCount(Math.max(travelAgency.size() - excelImportRes.getFailedCount(), 0));
return Result.success(excelImportRes);
}
}
@@ -0,0 +1,66 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model;
import cn.hutool.json.JSONObject;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List;
/**
* @author zhf
* @date 2025/8/26 21:26
* @description 疗休养活动
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("excellent_recuperation_activity")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养活动")
public class ExcellentRecuperationActivity extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("名称")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String activityName;
@Column
@Comment("报名开始时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String signUpStartTime;
@Column
@Comment("报名截止时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String signUpEndTIme;
@Column
@Comment("活动内容")
@ColDefine(type = ColType.TEXT)
private String activityContent;
@Column
@Comment("附件")
@ColDefine(type = ColType.MYSQL_JSON)
private List<JSONObject> files;
@Column
@Comment("活动线路")
@ColDefine(type = ColType.MYSQL_JSON)
private List<String> linIds;
private String linNames;
@Many(field = "activityId")
private List<ExcellentRecuperationQuotaAllocation> unionQuotaAllocationList;
}
@@ -0,0 +1,75 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model;
import com.budwk.app.base.model.BaseModel;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @author zhf
* @date 2025/8/26 18:36
* @description 线路管理
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("excellent_recuperation_line")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养旅行社")
public class ExcellentRecuperationLine extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("编号")
private String serialNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("线路名称")
private String lineName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("旅行社Id")
private String travelAgencyId;
@Column
@ColDefine(customType = "text")
@Comment("疗休养内容")
private String content;
@Column
@ColDefine(type = ColType.INT)
@Comment("年度")
private Integer year;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否禁用")
private boolean isDisabled;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("缩略图")
private String file;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("联系人")
private String lineContact;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("联系电话")
private String lineContactPhone;
@One(field = "travelAgencyId")
private ExcellentRecuperationTravelAgency travelAgency;
}
@@ -0,0 +1,59 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @author zhf
* @date 2025/8/27 08:49
* @description 疗休养分配名额
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("excellent_recuperation_quota_allocation")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养活动")
public class ExcellentRecuperationQuotaAllocation extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("活动Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String activityId;
@Column
@Comment("工会Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionId;
@Column
@Comment("工会名称")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionName;
@Column
@Comment("工会编码")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionCode;
@Column
@Comment("名额分配数")
@ColDefine(type = ColType.INT, width = 4)
@Default("0")
private Integer allocationNum;
@Column
@Comment("会员数量")
@ColDefine(type = ColType.INT, width = 4)
@Default("0")
private Integer memberNum;
}
@@ -0,0 +1,94 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model;
import cn.hutool.json.JSONObject;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List;
/**
* @author zhf
* @date 2025/8/27 16:13
* @description 疗休养报名人员
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("excellent_recuperation_sign_user")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养报名人员")
public class ExcellentRecuperationSignUpUser extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("姓名Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userId;
@Column
@Comment("活动Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String activityId;
@Column
@Comment("线路Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String lineId;
@Column
@Comment("姓名")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String userName;
@Column
@Comment("联系电话")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String mobile;
@Column
@Comment("身份证号")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String idCard;
@Column
@Comment("工号")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String loginName;
@Column
@Comment("工会Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionId;
@Column
@Comment("工会名称")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String unionName;
@Column
@Comment("单位Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unitId;
@Column
@Comment("单位名称")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String unitName;
@Column
@Comment("附件")
@ColDefine(type = ColType.MYSQL_JSON)
private List<JSONObject> files;
@Column
@Comment("报名时间")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String signUpTime;
}
@@ -0,0 +1,77 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @author zhf
* @date 2025/8/26 18:06
* @description 旅行社管理
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("excellent_recuperation_travel_agency")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养旅行社")
public class ExcellentRecuperationTravelAgency extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("旅行社编号")
private String serialNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("旅行社名称")
private String travelAgencyName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("旅行社联系人")
private String contact;
@Column
@ColDefine(type = ColType.VARCHAR, width = 11)
@Comment("旅行社联系人手机")
private String contactMobileNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("旅行社邮箱")
private String email;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("旅行社官网")
private String officialWebsite;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("备注")
private String note;
@Column
@ColDefine(type = ColType.INT)
@Comment("年度")
private Integer year;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否禁用")
private boolean isDisabled;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("缩略图")
private String file;
}
@@ -0,0 +1,28 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationLine;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Cnd;
import org.nutz.ioc.loader.annotation.IocBean;
import java.util.List;
public interface ExcellentRecuperationLineService extends BaseService<ExcellentRecuperationLine> {
Pagination pageData(PageForm pageForm, Cnd cnd);
/**
* 获取当前年度的线路列表
* @return
*/
List<ExcellentRecuperationLine> listLineListByThisYear();
}
@@ -0,0 +1,10 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.vo.ExcellentRecuperationPageForm;
import org.nutz.dao.sql.Sql;
public interface ExcellentRecuperationSummaryService extends BaseService {
Sql getsql(ExcellentRecuperationPageForm pageForm);
}
@@ -0,0 +1,65 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationTravelAgency;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
import org.nutz.dao.Cnd;
import org.nutz.lang.util.NutMap;
import java.util.List;
public interface ExcellentRecuperationTravelAgencyService extends BaseService<ExcellentRecuperationTravelAgency> {
/**
* 删除旅行社
*
* @param travelAgencyId 旅行社 ID
*/
void deleteTravelAgency(String travelAgencyId);
/**
* 添加旅行社
*
* @param travelAgency 旅行社
*/
void addTravelAgency(ExcellentRecuperationTravelAgency travelAgency);
/**
* 编辑旅行社
*
* @param travelAgency 旅行社
*/
void editTravelAgency(ExcellentRecuperationTravelAgency travelAgency);
/**
* 开启或关闭旅行社
*
* @param travelAgencyId 旅行社id
*/
void openTravelAgency(String travelAgencyId);
/**
* 页面数据
*
* @param pageForm 分页参数
* @param cnd cnd
* @return {@link Pagination}
*/
Pagination pageData(PageForm pageForm, Cnd cnd);
/**
* 查询旅行社
*
* @param cnd cnd
* @return {@link List}<{@link RecuperationTravelAgency}>
*/
List<ExcellentRecuperationTravelAgency> selectAllTravelAgencyByYear(Cnd cnd);
}
@@ -0,0 +1,61 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.impl;
import cn.hutool.core.date.DateUtil;
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.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationLine;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationLineService;
import lombok.extern.slf4j.Slf4j;
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;
import java.util.List;
/**
* @author zhf
* @date 2025/8/26 19:09
* @description
*/
@Slf4j
@IocBean(args = {"refer:dao"})
public class ExcellentRecuperationLineServiceImpl extends BaseServiceImpl<ExcellentRecuperationLine> implements ExcellentRecuperationLineService {
public ExcellentRecuperationLineServiceImpl(Dao dao) {
super(dao);
}
@Override
public Pagination pageData(PageForm pageForm, Cnd cnd) {
Sql sql = Sqls.create("""
SELECT
line.id,
line.serialNumber,
line.lineName,
line.year,
line.isDisabled,
line.file AS fileId,
u.username AS createUserName,
ta.travelAgencyName,
ta.contact,
ta.contactMobileNumber,
ta.officialWebsite
FROM
excellent_recuperation_line line
LEFT JOIN excellent_recuperation_travel_agency ta ON ta.id = line.travelAgencyId
LEFT JOIN sys_user u ON u.id = line.createdBy
$condition
""");
sql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@Override
public List<ExcellentRecuperationLine> listLineListByThisYear() {
List<ExcellentRecuperationLine> lineList = query(Cnd.where("isDisabled", "=", true).and("year", "=", DateUtil.thisYear()));
return lineList;
}
}
@@ -0,0 +1,70 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.impl;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationSummaryService;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.vo.ExcellentRecuperationPageForm;
import lombok.extern.slf4j.Slf4j;
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;
/**
* @author zhf
* @date 2025/8/28 10:24
* @description
*/
@Slf4j
@IocBean(args = {"refer:dao"})
public class ExcellentRecuperationSummaryServiceImpl extends BaseServiceImpl implements ExcellentRecuperationSummaryService {
public ExcellentRecuperationSummaryServiceImpl(Dao dao) {
super(dao);
}
@Override
public Sql getsql(ExcellentRecuperationPageForm pageForm) {
Sql sql = Sqls.create("""
SELECT
info.*,
line.lineName,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariale,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariale,
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
(SELECT MAX(id) FROM wf_process_task WHERE processInstanceId = ins.id AND taskName = 'startTask' AND taskState IN (10, 20)) AS startTaskId
FROM
excellent_recuperation_sign_user info
LEFT JOIN excellent_recuperation_line line ON line.id = info.lineId
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
AND t.taskState = 10
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(info.signUpTime)", "=", pageForm.getYear());
cnd.andEX("info.activityId", "=", pageForm.getActivityId());
cnd.andEX("info.unionId", "=", pageForm.getUnionId());
cnd.andEX("info.unitId", "=", pageForm.getUnitId());
cnd.and("ins.state", "=", ProcessTaskStateEnum.FINISHED.getCode());
if (StrUtil.isNotBlank(pageForm.getSearchName())&& StrUtil.isNotBlank(pageForm.getSearchKeyword())){
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
}
sql.setCondition(cnd);
return sql;
}
}
@@ -0,0 +1,67 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.impl;
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.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationTravelAgency;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationTravelAgencyService;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Chain;
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;
import java.util.List;
@Slf4j
@IocBean(args = {"refer:dao"})
public class ExcellentRecuperationTravelAgencyServiceImpl extends BaseServiceImpl<ExcellentRecuperationTravelAgency> implements ExcellentRecuperationTravelAgencyService {
public ExcellentRecuperationTravelAgencyServiceImpl(Dao dao) {
super(dao);
}
@Override
public void deleteTravelAgency(String travelAgencyId) {
delete(travelAgencyId);
}
@Override
public void addTravelAgency(ExcellentRecuperationTravelAgency travelAgency) {
insert(travelAgency);
}
@Override
public void editTravelAgency(ExcellentRecuperationTravelAgency travelAgency) {
update(travelAgency);
}
@Override
public void openTravelAgency(String travelAgencyId) {
update(Chain.makeSpecial("isDisabled", "isDisabled ^ 1"), Cnd.where("id", "=", travelAgencyId));
}
@Override
public Pagination pageData(PageForm pageForm, Cnd cnd) {
Sql sql = Sqls.create("""
select
*,
file as fileId
from
excellent_recuperation_travel_agency
$condition
""");
sql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@Override
public List<ExcellentRecuperationTravelAgency> selectAllTravelAgencyByYear(Cnd cnd) {
return dao().query(ExcellentRecuperationTravelAgency.class, cnd);
}
}
@@ -0,0 +1,18 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.vo;
import com.budwk.app.base.param.PageForm;
import lombok.Data;
/**
* @author zhf
* @date 2025/8/28 10:23
* @description
*/
@Data
public class ExcellentRecuperationPageForm extends PageForm {
private String year;
private String unionId;
private String unitId;
private String activityId;
}