移植v3疗休养到这个版本上

This commit is contained in:
2026-09-02 16:31:24 +08:00
parent 934eff12c4
commit 7b1e83d33b
76 changed files with 4093 additions and 633 deletions
@@ -0,0 +1,20 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.common;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
public class RecuperationCommon {
public static String getRemarkBySchoolTime(String schoolTime) {
if(StrUtil.isNotBlank(schoolTime)) {
DateTime schoolDate = DateUtil.parse(schoolTime);
DateTime time = DateUtil.parse(DateUtil.thisYear() + "-07-01");
int compareResult = DateUtil.compare(schoolDate, time);
return compareResult >= 0 ? ("入校时间为:" + schoolTime + ",疗休养额度为1500。") : "";
} else {
return "";
}
}
}
@@ -0,0 +1,24 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.constant;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* @FileName com.budwk.app.zhgh.staffbenefit.recuperation.constant.RecuperationJoinUserImportExcelMode
* @Description: 参加人员导入excel mode
* @Author zxc
* @Date 2022/6/14:11:10
* @Version V1.0
**/
@Data
public class RecuperationJoinUserImportExcelMode {
@Excel(name = "工号")
private String loginName;
@Excel(name = "参加时间", format = "yyyyMMdd")
private Date takePartInTime;
}
@@ -59,7 +59,7 @@ public class RecuperationAnnualAnalysisController {
public Result getNumData(@Param(value = "year") Integer year,
@Param(value = "lineType") String lineType) {
// 获取选择线路表的id,后面发现了,报名表里有线路id不在线路表的情况,这类人员要排除掉
Sql selectIdSql = Sqls.create("select id from recuperation_line_select");
Sql selectIdSql = Sqls.create("select id from the_rapy_recuperation_line_union_select");
selectIdSql.setCallback(Sqls.callback.strList());
dao.execute(selectIdSql);
List<String> selectIdList = selectIdSql.getList(String.class);
@@ -69,7 +69,7 @@ public class RecuperationAnnualAnalysisController {
SELECT
takePartInLineId
FROM
`recuperation_enroll`
`the_rapy_recuperation_enroll`
$condition
""");
Cnd cnd = Cnd.NEW();
@@ -167,9 +167,9 @@ public class RecuperationAnnualAnalysisController {
enroll.*,
line.lotId AS lineLotId
FROM
recuperation_enroll enroll
LEFT JOIN recuperation_line_select us ON us.id = enroll.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = us.lineId
the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
@@ -211,9 +211,9 @@ public class RecuperationAnnualAnalysisController {
SELECT
enroll.idCard
FROM
recuperation_enroll enroll
LEFT JOIN recuperation_line_select us ON us.id = enroll.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = us.lineId
the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
@@ -308,10 +308,10 @@ public class RecuperationAnnualAnalysisController {
ELSE NULL
END) > 45 THEN 1 ELSE 0 END) AS aboveFortyFive
FROM
recuperation_line_select us
LEFT JOIN recuperation_line line ON us.lineId = line.id
LEFT JOIN recuperation_enroll enroll ON enroll.takePartInLineId = us.id
LEFT JOIN recuperation_lot lot ON lot.id = line.lotId
the_rapy_recuperation_line_union_select us
LEFT JOIN the_rapy_recuperation_line line ON us.lineId = line.id
LEFT JOIN the_rapy_recuperation_enroll enroll ON enroll.takePartInLineId = us.id
LEFT JOIN the_rapy_recuperation_lot lot ON lot.id = line.lotId
LEFT JOIN sys_union su ON su.id = us.unionId
$condition
""").setParam("year", year == null ? DateUtil.thisYear() : year);
@@ -0,0 +1,77 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationAuditService;
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 javax.servlet.http.HttpServletRequest;
/**
* 旧版通用 audit 审核入口,不接入 wf。stage 支持 branch、lineUnion、school、travel
* pageData 的 data 为 Paginationaudit/recall 返回新版统一 Result。
*/
@IocBean
@At("/platform/recuperation/audit")
@Ok("json:full")
public class RecuperationAuditController {
@Inject
private RecuperationAuditService auditService;
@At("/branch")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/audit/index.html")
@SaCheckLogin
public void branch(HttpServletRequest request) { request.setAttribute("stage", "branch"); }
@At("/lineUnion")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/audit/index.html")
@SaCheckLogin
public void lineUnion(HttpServletRequest request) { request.setAttribute("stage", "lineUnion"); }
@At("/school")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/audit/index.html")
@SaCheckLogin
public void school(HttpServletRequest request) { request.setAttribute("stage", "school"); }
@At("/travel")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/audit/index.html")
@SaCheckLogin
public void travel(HttpServletRequest request) { request.setAttribute("stage", "travel"); }
/** pageForm 为分页信息;stage 为审核环节;year 为年度;audited 表示已审/待审;keyword 为姓名或工号。 */
@At
@SaCheckPermission("recuperation.audit")
public Result pageData(PageForm pageForm, String stage, Integer year, Boolean audited, String keyword) {
return Result.success(auditService.auditPage(pageForm, stage, year, audited, keyword));
}
@At
@SaCheckPermission("recuperation.audit")
public Result findOne(String id) {
return Result.success(auditService.findOne(id));
}
/** id 为报名记录,pass 为是否通过,auditOpinion 为意见;返回 success=true 表示 audit 和报名状态已在同一事务更新。 */
@At
@SaCheckPermission("recuperation.audit")
public Result audit(String id, Boolean pass, String auditOpinion) {
if (StrUtil.isBlank(id) || pass == null) return Result.error("审核参数不完整");
auditService.auditEnroll(id, pass, auditOpinion);
return Result.success();
}
@At
@SaCheckPermission("recuperation.audit")
public Result recall(String id) {
if (StrUtil.isBlank(id)) return Result.error("参数错误");
auditService.recallAudit(id);
return Result.success();
}
}
@@ -21,6 +21,7 @@ import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.recuperation.constant.RecuperationState;
import com.budwk.app.zhgh.staffbenefit.recuperation.mode.BaseManagerExcelMode;
import com.budwk.app.zhgh.staffbenefit.recuperation.mode.TravelAgencyExcelMode;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationBaseManagement;
@@ -89,6 +90,7 @@ public class RecuperationBaseManagerController {
public Result pageData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "lotId") String lotId,
@Param(value = "days") String days,
@Param(value = "baseName") String baseName,
@Param(value = "unionId") String unionId,
@Param(value = "travelAgencyId") String travelAgencyId,
@@ -101,8 +103,9 @@ public class RecuperationBaseManagerController {
tb.baseName,
tb.regionalNature,
tb.year,
tb.isDisabled,
tb.lotId,
tb.isDisabled,
tb.lotId,
tb.days,
tb.createUnionId,
tb.signUpStartTime,
tb.signUpEndTime,
@@ -110,10 +113,20 @@ public class RecuperationBaseManagerController {
tb.createMode,
tb.activityStartTime,
tb.activityEndTime,
tb.file,
tb.baseContactPerson,
tb.baseContactNumber,
tb.file AS fileId,
tb.files,
tb.baseContactPerson,
tb.baseContactNumber,
tb.baseContactPerson2,
tb.baseContactNumber2,
tb.baseContactPerson3,
tb.baseContactNumber3,
tb.maxSignUpNumber,
(select count(distinct enroll.loginName)
from the_rapy_recuperation_enroll enroll
where enroll.takePartInBaseManagementId = tb.id
and enroll.isNormal = true
and enroll.stateId not in ($auditFailStates)) as signUpUserNum,
tb.files AS fileId,
gh.name createUnionName,
u.username createUserName,
ta.travelAgencyName,
@@ -121,20 +134,26 @@ public class RecuperationBaseManagerController {
ta.contactMobileNumber,
ta.officialWebsite
FROM
`recuperation_base_management` tb
LEFT JOIN recuperation_travel_agency ta ON ta.id = tb.travelAgencyId
`the_rapy_recuperation_base_management` tb
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = tb.travelAgencyId
LEFT JOIN sys_union gh ON gh.id = tb.createUnionid
LEFT JOIN sys_user u ON u.id = tb.createdBy
LEFT JOIN sys_user u ON u.id = tb.opBy
$condition
""");
cnd.where().andEX("tb.`year`", "=", year);
cnd.where().andEX("tb.lotId", "=", lotId);
cnd.and(Cnd.likeEX("tb.days", days));
cnd.and(Cnd.likeEX("tb.baseName", baseName));
cnd.and(Cnd.likeEX("tb.travelAgencyId", travelAgencyId));
cnd.and(Cnd.likeEX("tb.regionalNature", regionalNature));
cnd.desc("tb.`year`");
cnd.asc("tb.sortNumber");
cnd.asc("tb.id");
sql.setVar("auditFailStates", String.join(",", Arrays.asList(
String.valueOf(RecuperationState.UNITFAIL),
String.valueOf(RecuperationState.LINEUNITFAIL),
String.valueOf(RecuperationState.SCHOOLFAIL)
)));
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
cnd.and("tb.createUnionId", "=", SecurityUtil.getUnionId());
@@ -220,6 +239,45 @@ public class RecuperationBaseManagerController {
return Result.success(nutMap);
}
/**
* 查询定点可选日期。
*
* @param id 定点 ID
* @param enrollId 编辑时排除的报名记录 ID
* @return Result.data 为日期范围、可用天数和已使用日期
*/
@At("/getTimeArray")
@SaCheckLogin
public Result getTimeArray(@Param("id") String id, @Param("enrollId") String enrollId) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
return Result.success(baseManagerService.selectBaseTimeArray(id, enrollId));
}
/** 校验定点报名名额,额度不足时返回具体原因。 */
@At("/validBaseManagementQuota")
@SaCheckLogin
public Result validBaseManagementQuota(@Param("id") String id, @Param("enrollId") String enrollId) {
Map<Boolean, String> result = baseManagerService.validBaseManagementQuota(id, enrollId);
return result.containsKey(false) ? Result.error(result.get(false)) : Result.success();
}
/** 批量设置选中定点的报名时间。 */
@At("/setGiveTimes")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.baseManagement")
public Result setGiveTimes(@Param("baseIds") String[] baseIds, @Param("base") RecuperationBaseManagement baseManagement) {
if (Lang.isEmpty(baseIds) || baseManagement == null) {
return Result.error("参数错误");
}
if (baseManagement.getSignUpStartTime() == null || baseManagement.getSignUpEndTime() == null || baseManagement.getChangeEndTime() == null) {
return Result.error("请选择完整报名时间");
}
baseManagerService.batchAssignSignUpTimes(baseIds, baseManagement.getSignUpStartTime(), baseManagement.getSignUpEndTime(), baseManagement.getChangeEndTime());
return Result.success();
}
@At
@Ok("void")
@SaCheckPermission("recuperation.baseManagement")
@@ -14,6 +14,8 @@ import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletRequest;
/**
* @ClassName RecuperationBranchUnionAuditController
* @Author JyuHsin
@@ -34,9 +36,11 @@ public class RecuperationBranchUnionAuditController {
private RecuperationAuditService auditService;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/branchUnionAudit/index.html")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/audit/index.html")
@SaCheckLogin
public void index() {}
public void index(HttpServletRequest request) {
request.setAttribute("stage", "branch");
}
@At
@ApiOperation("分页查询")
@@ -105,14 +105,14 @@ public class RecuperationBranchUnionUserQueryController {
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
$lotSql
FROM
`recuperation_enroll` enroll
LEFT JOIN recuperation_line_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = lineu.lineId
LEFT JOIN recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
LEFT JOIN recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
LEFT JOIN the_rapy_recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
$condition
""");
if (Strings.isNotBlank(pageForm.getSearchKeyword()) && Strings.isNotBlank(pageForm.getSearchName())) {
@@ -224,12 +224,12 @@ public class RecuperationBranchUnionUserQueryController {
enroll.*,
line.lineName,
if(enroll.takePartInUnionId!=enroll.selfUnionId,true,false) isTransferIn,
(SELECT COUNT(1) FROM recuperation_enroll_companion WHERE trreId=enroll.id and relation='亲属') isFamily
(SELECT COUNT(1) FROM the_rapy_recuperation_enroll_companion WHERE trreId=enroll.id and relation='亲属') isFamily
FROM
`recuperation_enroll` enroll
LEFT JOIN recuperation_line_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = lineu.lineId
LEFT JOIN recuperation_travel_agency lxs ON lxs.id = line.travelAgencyId
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = line.travelAgencyId
where enroll.id=@id
""");
sql.setParam("id", id);
@@ -262,9 +262,9 @@ public class RecuperationBranchUnionUserQueryController {
t3.lineName,
t4.name as unionName
FROM
recuperation_enroll t1
LEFT JOIN recuperation_line_select t2 ON t2.id = t1.takePartInLineId
LEFT JOIN recuperation_line t3 ON t3.id = t2.lineId
the_rapy_recuperation_enroll t1
LEFT JOIN the_rapy_recuperation_line_union_select t2 ON t2.id = t1.takePartInLineId
LEFT JOIN the_rapy_recuperation_line t3 ON t3.id = t2.lineId
LEFT JOIN sys_union t4 ON t4.id = t2.unionId
$condition
""");
@@ -314,14 +314,14 @@ public class RecuperationBranchUnionUserQueryController {
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
$lotSql
FROM
`recuperation_enroll` enroll
LEFT JOIN recuperation_line_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = lineu.lineId
LEFT JOIN recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
LEFT JOIN recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
LEFT JOIN the_rapy_recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
$condition
""");
// 年度
@@ -2,6 +2,7 @@ package com.budwk.app.zhgh.staffbenefit.recuperation.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;
@@ -68,8 +69,8 @@ public class RecuperationEvaluateStatisticsController {
@Param(value = "evaluateScore") String evaluateScore) {
Sql sql = Sqls.create("""
SELECT
we.evaluateText,
we.evaluateScore,
we.feedbackContent AS evaluateText,
we.evaluationForTravelAgency AS evaluateScore,
we.userName,
we.loginName,
u.unionname as unionName,
@@ -79,11 +80,10 @@ public class RecuperationEvaluateStatisticsController {
line.lineName,
us.playStartTime
FROM
`recuperation_evaluate` we
LEFT JOIN `vw_user` u ON u.id = we.userId
LEFT JOIN recuperation_enroll en ON en.takePartInLineId = we.lineId
LEFT JOIN recuperation_line_select us ON us.id = en.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = us.lineId
the_rapy_recuperation_enroll we
LEFT JOIN `vw_user` u ON u.loginname = we.loginName
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = we.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
@@ -96,17 +96,17 @@ public class RecuperationEvaluateStatisticsController {
if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), "ascending".equals(pageForm.getPageOrderBy()) ? "asc" : "desc");
} else {
cnd.desc("we.evaluateScore");
cnd.desc("we.evaluationForTravelAgency");
}
if (StrUtil.isNotBlank(lineId)) {
cnd.andEX("we.lineId", "in", lineId.split(","));
cnd.andEX("we.takePartInLineId", "in", lineId.split(","));
}
cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.personType", "=", personType);
cnd.andEX("u.userState", "=", userState);
cnd.andEX("we.evaluateScore", "=", evaluateScore);
cnd.groupBy("we.lineId");
cnd.andEX("we.evaluationForTravelAgency", "=", evaluateScore);
cnd.groupBy("we.id");
sql.setCondition(cnd);
Pagination pagination = enrollService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
@@ -122,8 +122,8 @@ public class RecuperationEvaluateStatisticsController {
line.lineName,
if(us.signUpMode = 2, '校工会', un.name) as unionName
FROM
recuperation_line_select us
LEFT JOIN recuperation_line line ON us.lineId = line.id
the_rapy_recuperation_line_union_select us
LEFT JOIN the_rapy_recuperation_line line ON us.lineId = line.id
LEFT JOIN sys_union un ON un.id = us.unionId
$condition
""");
@@ -135,6 +135,7 @@ public class RecuperationEvaluateStatisticsController {
}
@At
@Ok("void")
@ApiOperation("导出评价统计")
@SaCheckPermission("recuperation.statistics")
public void exportEvaluate(String lineId,
@@ -146,8 +147,8 @@ public class RecuperationEvaluateStatisticsController {
HttpServletResponse response) {
Sql sql = Sqls.create("""
SELECT
we.evaluateText,
we.evaluateScore,
we.feedbackContent AS evaluateText,
we.evaluationForTravelAgency AS evaluateScore,
we.userName,
we.loginName,
u.unionname,
@@ -157,11 +158,10 @@ public class RecuperationEvaluateStatisticsController {
line.lineName,
us.playStartTime
FROM
`recuperation_evaluate` we
LEFT JOIN `vw_user` u ON u.id = we.userId
LEFT JOIN recuperation_enroll en ON en.takePartInLineId = we.lineId
LEFT JOIN recuperation_line_select us ON us.id = en.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = us.lineId
the_rapy_recuperation_enroll we
LEFT JOIN `vw_user` u ON u.loginname = we.loginName
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = we.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
@@ -169,12 +169,12 @@ public class RecuperationEvaluateStatisticsController {
cnd.and(Cnd.likeEX(searchName, searchKeyword));
}
if (StrUtil.isNotBlank(lineId)) {
cnd.andEX("we.lineId", "in", lineId.split(","));
cnd.andEX("we.takePartInLineId", "in", lineId.split(","));
}
cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("we.evaluateScore", "=", evaluateScore);
cnd.groupBy("we.lineId");
cnd.andEX("we.evaluationForTravelAgency", "=", evaluateScore);
cnd.groupBy("we.id");
sql.setCondition(cnd);
List<NutMap> listMap = enrollService.listMap(sql);
@@ -192,7 +192,9 @@ public class RecuperationEvaluateStatisticsController {
entities.add(new ExcelExportEntity("评价", "evaluateText", 40));
try {
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), entities, listMap);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, listMap);
CommonDownloadUtil.download("评价人员名单.xlsx", workbook, response);
} catch (Exception ignored) {
}
@@ -0,0 +1,168 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.recuperation.constant.RecuperationType;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationConfig;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationBaseManagement;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationEnroll;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationProvinceFlexibleGroup;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationEnrollService;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
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 java.util.Map;
/**
* 旧版疗休养 H5 入口。页面仍使用旧业务分类和旧表,认证与权限切换为新版 Sa-Token。
* 查询接口返回 Result.data;提交接口返回 success、code、msg,供 Vant 页面统一提示。
*/
@IocBean
@At("/platform/h5/recuperation")
@Ok("json:full")
public class RecuperationH5Controller {
@Inject
private RecuperationEnrollService enrollService;
@At("")
@Ok("beetl:/platform/zhghh5/staffbenefit/recuperation/index.html")
@SaCheckLogin
public void index() {
}
@At("/lineList")
@Ok("beetl:/platform/zhghh5/staffbenefit/recuperation/lineList.html")
@SaCheckLogin
public void lineList() {
}
@At("/lineInfo")
@Ok("beetl:/platform/zhghh5/staffbenefit/recuperation/lineInfo.html")
@SaCheckLogin
public void lineInfo() {
}
@At("/signForm")
@Ok("beetl:/platform/zhghh5/staffbenefit/recuperation/signForm.html")
@SaCheckLogin
public void signForm() {
}
@At("/mine")
@Ok("beetl:/platform/zhghh5/staffbenefit/recuperation/mine.html")
@SaCheckLogin
public void mine() {
}
/**
* @param pageForm 分页信息;year 为年度;type 为旧版疗休养类型值;lineUnionType 为本工会、公开或校工会线路分类
* @return Result.data 为 Paginationlist 中保留旧版线路、旅行社或基地字段
*/
@At
@SaCheckPermission("h5.recuperation.enroll")
public Result pageData(PageForm pageForm, Integer year, Integer type, Integer lineUnionType) {
int businessType = type == null ? RecuperationType.provinceInLine.getValue() : type;
return Result.success(enrollService.enrollPageData(pageForm, year, SecurityUtil.getUnionId(), businessType, lineUnionType));
}
@At
@SaCheckPermission("h5.recuperation.enroll")
public Result lineInfoData(String id, String unionId, Integer type) {
if (StrUtil.isBlank(id)) {
return Result.error("线路参数不能为空");
}
if (type != null && type == RecuperationType.provinceInTravelAgency.getValue()) {
RecuperationProvinceFlexibleGroup flexibleGroup = enrollService.dao().fetch(RecuperationProvinceFlexibleGroup.class, id);
if (flexibleGroup == null) {
return Result.error("灵活组团信息不存在");
}
enrollService.dao().fetchLinks(flexibleGroup, "travelAgency");
return Result.success(flexibleGroup);
}
if (type != null && type == RecuperationType.provinceInHotel.getValue()) {
return Result.success(enrollService.dao().fetch(RecuperationBaseManagement.class, id));
}
return Result.success(enrollService.selectLineAllInfo(id, StrUtil.blankToDefault(unionId, SecurityUtil.getUnionId())));
}
@At
@SaCheckPermission("h5.recuperation.enroll")
public Result fetchEnroll(String id) {
if (StrUtil.isBlank(id)) {
return Result.success(new RecuperationEnroll());
}
return Result.success(enrollService.findSignUpInfoById(id));
}
/**
* @param enroll 报名表单,type 表示线路、旅行社或基地类型;id 非空时执行变更
* @return Result,校验失败时 msg 为旧版额度、时间或次数限制原因
*/
@At
@SaCheckPermission("h5.recuperation.enroll")
@Aop(TransAop.READ_COMMITTED)
public Result submit(RecuperationEnroll enroll, Integer type) {
if (enroll == null || type == null) {
return Result.error("报名参数不完整");
}
boolean edit = StrUtil.isNotBlank(enroll.getId());
// 三类报名统一先校验对应线路、旅行社或基地的年度名额,避免前端可选但提交时报数据库错误。
Map<Boolean, String> quotaValid = enrollService.validSubmitQuota(enroll);
if (quotaValid.containsKey(false)) {
return Result.error(quotaValid.get(false));
}
if (type == RecuperationType.provinceInLine.getValue() || type == RecuperationType.provinceOutLine.getValue()) {
Map<Boolean, String> valid = enrollService.validSignUpInfo(SecurityUtil.getUserLoginname(), enroll);
if (valid.containsKey(false)) {
return Result.error(valid.get(false));
}
if (edit) enrollService.updateSignUpLine(enroll); else enrollService.doSignUpForLine(enroll);
} else if (type == RecuperationType.provinceInTravelAgency.getValue()) {
if (edit) enrollService.updateSignUpTravelAgency(enroll); else enrollService.doSignUpForTravelAgency(enroll);
} else if (type == RecuperationType.provinceInHotel.getValue()) {
if (edit) enrollService.updateSignUpHotel(enroll); else enrollService.doSignUpForHotel(enroll);
} else {
return Result.error("不支持的疗休养类型");
}
return Result.success();
}
/** 我的报名分页;type 为旧版业务类型,year 为空时使用当前年度。 */
@At
@SaCheckPermission("h5.recuperation.mine")
public Result minePageData(PageForm pageForm, Integer type, Integer year) {
int businessType = type == null ? RecuperationType.provinceInLine.getValue() : type;
Cnd cnd = Cnd.where("e.loginName", "=", SecurityUtil.getUserLoginname());
return Result.success(enrollService.mySignUpPageData(pageForm, cnd, businessType, year == null ? DateUtil.thisYear() : year));
}
@At("/delete/?")
@SaCheckPermission("h5.recuperation.mine")
@Aop(TransAop.READ_COMMITTED)
public Result delete(String id) {
RecuperationEnroll enroll = enrollService.fetch(id);
if (enroll == null || !SecurityUtil.getUserLoginname().equals(enroll.getLoginName())) {
return Result.error("报名记录不存在或无权删除");
}
enrollService.deleteMyEnrollInfoById(id);
return Result.success();
}
@At
@SaCheckLogin
public Result config() {
return Result.success(enrollService.dao().fetch(RecuperationConfig.class));
}
}
@@ -0,0 +1,83 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.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.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationEnroll;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationEnrollJoinUserImportService;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
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.Date;
import java.util.List;
import java.util.Map;
/** 旧版实际参加人员导入,Excel 解析后由 Service 匹配并事务更新旧报名表。 */
@IocBean
@At("/platform/recuperation/joinUserImport")
@Ok("json:full")
public class RecuperationJoinUserImportController {
@Inject
private RecuperationEnrollJoinUserImportService importService;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/joinUserImport/index.html")
@SaCheckLogin
public void index() {}
@At
@SaCheckPermission("recuperation.joinUserImport")
public Result options(Integer year, String keyword) { return Result.success(importService.selectLineAndTravelAgencyList(year, keyword)); }
/** file 为 xls/xlsxlineId 与 travelAgencyId 二选一;data 返回 excelRows 和匹配到的 matchList。 */
@At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@SaCheckPermission("recuperation.joinUserImport")
public Result readExcel(@Param("file") TempFile tempFile, String lineId, String travelAgencyId) {
try {
if (tempFile == null || !List.of("XLS", "XLSX").contains(FileUtil.extName(tempFile.getFile()).toUpperCase())) return Result.error("请上传 Excel 文件");
if (StrUtil.isAllBlank(lineId, travelAgencyId)) return Result.error("请选择线路或旅行社");
List<RecuperationEnroll> rows = ExcelImportUtil.importExcel(tempFile.getFile(), RecuperationEnroll.class, new ImportParams());
return Result.success(Map.of("excelRows", rows, "matchList", importService.matchEnrolls(rows, lineId, travelAgencyId)));
} catch (Exception e) {
return Result.error(e.getMessage());
}
}
/** enrolls 为已确认匹配的报名记录数组;返回 success=true 表示实际参加状态和日期已更新。 */
@At
@SaCheckPermission("recuperation.joinUserImport")
public Result doImport(@Param("enrolls") RecuperationEnroll[] enrolls) {
importService.markParticipated(enrolls == null ? List.of() : List.of(enrolls));
return Result.success();
}
@At
@Ok("void")
@SaCheckPermission("recuperation.joinUserImport")
public void downloadTemplate(HttpServletResponse response) {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
List<RecuperationEnroll> examples = new ArrayList<>();
examples.add(new RecuperationEnroll().setLoginName("2000").setUserName("张三").setTakePartInTime(new Date()));
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, RecuperationEnroll.class, examples);
CommonDownloadUtil.download("参加人员.xlsx", workbook, response);
}
}
@@ -0,0 +1,60 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationLineAdjustmentService;
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;
/** 旧版报名人员调整接口。 */
@IocBean
@At("/platform/recuperation/lineAdjustment")
@Ok("json:full")
public class RecuperationLineAdjustmentController {
@Inject
private RecuperationLineAdjustmentService adjustmentService;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/lineAdjustment/index.html")
@SaCheckLogin
public void index() {
}
/** 接收年度、线路、工会、关键字、区域和标段条件,data 返回旧业务口径分页结果。 */
@At
@SaCheckPermission("recuperation.lineAdjustment")
public Result pageData(PageForm pageForm, Integer year, String lineId, String unionId, String keywords,
String regionalNature, String lotId) {
return Result.success(adjustmentService.pageData(pageForm, year, lineId, unionId, keywords, regionalNature, lotId));
}
@At
@SaCheckLogin
public Result findLineOptions(Integer year) {
return Result.success(adjustmentService.findLineOptions(year));
}
@At
@SaCheckPermission("recuperation.lineAdjustment")
public Result findUsers(String lineId, String unionId) {
return Result.success(adjustmentService.findUnionSignUpModeUserList(lineId, unionId));
}
/** lineId 为线路选择记录,loginNames 为需调入或调出的登录名数组;返回统一 Result。 */
@At
@SaCheckPermission("recuperation.lineAdjustment")
public Result adjustmentUsers(String lineId, @Param("loginNames") String[] loginNames) {
if (StrUtil.isBlank(lineId) || loginNames == null || loginNames.length == 0) {
return Result.error("请选择需要调整的人员");
}
adjustmentService.adjustmentUsers(lineId, loginNames);
return Result.success();
}
}
@@ -0,0 +1,58 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationCluster;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationLineClusterService;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.List;
/** 旧版线路组团接口,业务写入统一由 Service 的事务方法完成。 */
@IocBean
@At("/platform/recuperation/lineCluster")
@Ok("json:full")
public class RecuperationLineClusterController {
@Inject
private RecuperationLineClusterService lineClusterService;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/lineCluster/index.html")
@SaCheckLogin
public void index() {
}
/** pageForm 为分页信息,其余参数分别为年度、工会和线路关键字;data 返回 Pagination。 */
@At
@SaCheckPermission("recuperation.lineCluster")
public Result pageData(PageForm pageForm, Integer year, String unionId, String keywords) {
return Result.success(lineClusterService.pageData(pageForm, year, unionId, keywords));
}
@At
@SaCheckPermission("recuperation.lineCluster")
public Result findClusterInfo(String lineId, String usUnionId) {
return Result.success(lineClusterService.findClusterInfo(lineId, usUnionId));
}
/** clusters 为组团及 members 的 JSON 数组,lineId 为线路选择记录;返回统一 Result。 */
@At
@SaCheckPermission("recuperation.lineCluster")
public Result setClusterMembers(@Param("clusters") String clusters, String lineId) {
if (StrUtil.isBlank(lineId) || StrUtil.isBlank(clusters)) {
return Result.error("组团信息不能为空");
}
List<RecuperationCluster> clusterList = Json.fromJsonAsList(RecuperationCluster.class, clusters);
lineClusterService.setClusterMembers(clusterList, lineId);
return Result.success();
}
}
@@ -23,9 +23,11 @@ import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.recuperation.constant.RecuperationLineCreateMode;
import com.budwk.app.zhgh.staffbenefit.recuperation.mode.BaseManagerExcelMode;
import com.budwk.app.zhgh.staffbenefit.recuperation.mode.LineExcelMode;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationEnroll;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationLine;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationLot;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationEnrollService;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationLineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -70,6 +72,8 @@ public class RecuperationLineController {
private Dao dao;
@Inject
private RecuperationLineService lineService;
@Inject
private RecuperationEnrollService enrollService;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/line/index.html")
@@ -170,6 +174,38 @@ public class RecuperationLineController {
return Result.success(line);
}
/**
* 校验线路名额。
*
* @param id 分工会线路选择记录 ID
* @param enrollId 编辑时排除的报名记录 ID,新增时可为空
* @return 额度可用时返回成功,否则返回具体失败原因
*/
@At("/validLineQuota")
@SaCheckLogin
public Result validLineQuota(@Param("id") String id, @Param("enrollId") String enrollId) {
Map<Boolean, String> result = lineService.validLineQuota(id, enrollId);
return result.containsKey(false) ? Result.error(result.get(false)) : Result.success();
}
/**
* 编辑报名时校验线路。enroll 为报名 JSONloginName 为空时按当前登录人校验;返回 Result。
*/
@At("/enroll/validSignUpInfo")
@SaCheckLogin
public Result validSignUpInfo(@Param("enroll") RecuperationEnroll enroll) {
if (enroll == null || StrUtil.isBlank(enroll.getTakePartInLineId())) {
return Result.error("线路信息不能为空");
}
String loginName = StrUtil.blankToDefault(enroll.getLoginName(), SecurityUtil.getUserLoginname());
Map<Boolean, String> quotaResult = enrollService.validSubmitQuota(enroll);
if (quotaResult.containsKey(false)) {
return Result.error(quotaResult.get(false));
}
Map<Boolean, String> result = enrollService.validSignUpInfo(loginName, enroll);
return result.containsKey(false) ? Result.error(result.get(false)) : Result.success();
}
@At
@ApiOperation("根据分工会选择的线路id查询所该线路报名的人")
@SaCheckPermission("recuperation.line")
@@ -100,11 +100,11 @@ public class RecuperationLineSelectController {
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
cnd.and(Cnd.exps("line.createUnionId", "=", SecurityUtil.getUnionId()).or("createMode", "=", 2));
hasSelectLineSql = Sqls.createf("""
select lineId from recuperation_line_select where selectUserId = '%s' AND unionId = '%s' AND year(selectTime) = %s
select lineId from the_rapy_recuperation_line_union_select where selectUserId = '%s' AND unionId = '%s' AND year(selectTime) = %s
""", SecurityUtil.getUserId(), SecurityUtil.getUnionId(), year == null ? DateUtil.thisYear() : year);
} else {
hasSelectLineSql = Sqls.createf("""
select lineId from recuperation_line_select where year(selectTime) = %s
select lineId from the_rapy_recuperation_line_union_select where year(selectTime) = %s
""", year == null ? DateUtil.thisYear() : year);
}
@@ -303,7 +303,7 @@ public class RecuperationLineSelectController {
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"recuperation.branchUnionSelect", "recuperation.schoolUnionSelect"}, mode = SaMode.OR)
public Result getLineConfig(String id) {
Sql sql = Sqls.create("select lotId from recuperation_line where id = @lineId");
Sql sql = Sqls.create("select lotId from the_rapy_recuperation_line where id = @lineId");
sql.setParam("lineId", id);
String lotId = (String) Daos.query(dao, sql.toString(), Sqls.callback.str());
RecuperationLot lotInfo = dao.fetch(RecuperationLot.class, lotId);
@@ -0,0 +1,111 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.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.zhgh.staffbenefit.recuperation.model.RecuperationProvinceFlexibleGroup;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationProvinceFlexibleGroupService;
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;
import org.nutz.mvc.annotation.Param;
/**
* 旧版省内灵活组团入口。接口接收年度、组团名称、工会及旅行社筛选条件,
* 返回新版统一 Result,其中 data 为分页数据、详情或校验结果。
*/
@IocBean
@At("/platform/recuperation/provinceFlexibleGroup")
@Ok("json:full")
@Api("疗休养省内灵活组团")
public class RecuperationProvinceFlexibleGroupController {
@Inject
private RecuperationProvinceFlexibleGroupService flexibleGroupService;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/provinceFlexibleGroup/index.html")
@SaCheckLogin
public void index() {
}
/**
* @param pageForm 分页参数;year 为年度,days 为旧页面兼容参数,groupName 为名称,unionId 为工会,travelAgencyId 为旅行社
* @return Result.data 为 Pagination,包含 list、pageNumber、pageSize、totalCount
*/
@At
@ApiOperation("分页查询省内灵活组团")
@SaCheckPermission("recuperation.provinceFlexibleGroup")
public Result pageData(PageForm pageForm, Integer year, String days, String groupName, String unionId, String travelAgencyId) {
Pagination page = flexibleGroupService.pageData(pageForm, year, days, groupName, unionId, travelAgencyId);
return Result.success(page);
}
@At("/fetch/?")
@SaCheckPermission("recuperation.provinceFlexibleGroup")
public Result fetch(String id) {
return Result.success(flexibleGroupService.selectFlexibleGroupById(id));
}
/** 保存新增或编辑数据;返回 Result,success=true 表示旧表写入成功。 */
@At
@SaCheckPermission("recuperation.provinceFlexibleGroup")
public Result onSubmit(RecuperationProvinceFlexibleGroup flexibleGroup) {
if (flexibleGroup == null) {
return Result.error("组团信息不能为空");
}
flexibleGroupService.submitFlexibleGroup(flexibleGroup);
return Result.success();
}
@At("/toggle/?")
@SaCheckPermission("recuperation.provinceFlexibleGroup")
public Result toggle(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
flexibleGroupService.openClosedFlexibleGroup(id);
return Result.success();
}
@At("/delete/?")
@SaCheckPermission("recuperation.provinceFlexibleGroup")
public Result delete(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
flexibleGroupService.deleteFlexibleGroup(id);
return Result.success();
}
@At
@SaCheckPermission("recuperation.provinceFlexibleGroup")
public Result batchAssignSignUpTimes(@Param("ids") String[] ids, RecuperationProvinceFlexibleGroup form) {
flexibleGroupService.batchAssignSignUpTimes(ids, form.getSignUpStartTime(), form.getSignUpEndTime(), form.getChangeEndTime());
return Result.success();
}
@At
@SaCheckLogin
public Result getTimeArray(String id, String enrollId) {
return Result.success(flexibleGroupService.selectFlexibleGroupTimeArray(id, enrollId));
}
@At
@SaCheckLogin
public Result validFlexibleGroupQuota(String id, String enrollId) {
return Result.success(flexibleGroupService.validFlexibleGroupQuota(id, enrollId));
}
@At
@SaCheckLogin
public Result selectFlexibleTravelAgency(Integer year) {
return Result.success(flexibleGroupService.selectFlexibleTravelAgency(year));
}
}
@@ -111,14 +111,14 @@ public class RecuperationSchoolUnionUserQueryController {
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
$lotSql
FROM
`recuperation_enroll` enroll
LEFT JOIN recuperation_line_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = lineu.lineId
LEFT JOIN recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
LEFT JOIN recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
LEFT JOIN the_rapy_recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
$condition
""");
if (Strings.isNotBlank(pageForm.getSearchKeyword()) && Strings.isNotBlank(pageForm.getSearchName())) {
@@ -232,12 +232,12 @@ public class RecuperationSchoolUnionUserQueryController {
enroll.*,
line.lineName,
if(enroll.takePartInUnionId!=enroll.selfUnionId,true,false) isTransferIn,
(SELECT COUNT(1) FROM recuperation_enroll_companion WHERE trreId=enroll.id and relation='亲属') isFamily
(SELECT COUNT(1) FROM the_rapy_recuperation_enroll_companion WHERE trreId=enroll.id and relation='亲属') isFamily
FROM
`recuperation_enroll` enroll
LEFT JOIN recuperation_line_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = lineu.lineId
LEFT JOIN recuperation_travel_agency lxs ON lxs.id = line.travelAgencyId
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = line.travelAgencyId
where enroll.id=@id
""");
sql.setParam("id", id);
@@ -271,9 +271,9 @@ public class RecuperationSchoolUnionUserQueryController {
t3.lineName,
t4.name as unionName
FROM
recuperation_enroll t1
LEFT JOIN recuperation_line_select t2 ON t2.id = t1.takePartInLineId
LEFT JOIN recuperation_line t3 ON t3.id = t2.lineId
the_rapy_recuperation_enroll t1
LEFT JOIN the_rapy_recuperation_line_union_select t2 ON t2.id = t1.takePartInLineId
LEFT JOIN the_rapy_recuperation_line t3 ON t3.id = t2.lineId
LEFT JOIN sys_union t4 ON t4.id = t2.unionId
$condition
""");
@@ -315,9 +315,9 @@ public class RecuperationSchoolUnionUserQueryController {
if(rlus.signUpMode=1,'分工会','校工会') AS signUpMode,
lot.lotName
FROM
`recuperation_line_select` rlus
LEFT JOIN `recuperation_line` rl ON rlus.lineId = rl.id
LEFT JOIN `recuperation_lot` lot ON rl.lotId = lot.id
`the_rapy_recuperation_line_union_select` rlus
LEFT JOIN `the_rapy_recuperation_line` rl ON rlus.lineId = rl.id
LEFT JOIN `the_rapy_recuperation_lot` lot ON rl.lotId = lot.id
$condition
""");
Cnd cnd = Cnd.NEW();
@@ -355,14 +355,14 @@ public class RecuperationSchoolUnionUserQueryController {
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
$lotSql
FROM
`recuperation_enroll` enroll
LEFT JOIN recuperation_line_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = lineu.lineId
LEFT JOIN recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
LEFT JOIN recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
LEFT JOIN the_rapy_recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
$condition
""");
cnd.and("enroll.takePartInLineId", "is not", null);
@@ -470,7 +470,7 @@ public class RecuperationSchoolUnionUserQueryController {
""");
Cnd cnd = Cnd.NEW();
cnd.and("u.id", "in", activityBasicScopeService.buildGroupUserIdSubSql(config.getActivityGroupId()));
cnd.and(new Static(" u.loginname not in (select loginName from recuperation_enroll where year(signingUptime) = '%s' and isNormal = true)".formatted(DateUtil.thisYear())));
cnd.and(new Static(" u.loginname not in (select loginName from the_rapy_recuperation_enroll where year(signingUptime) = '%s' and isNormal = true)".formatted(DateUtil.thisYear())));
cnd.asc("unitcode");
sql.setCondition(cnd);
List<NutMap> listMap = enrollService.listMap(sql);
@@ -81,6 +81,11 @@ public class RecuperationTravelAgencyController {
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("contact", pageForm.getSearchKeyword());
seg.orLike("contact2", pageForm.getSearchKeyword());
seg.orLike("contact3", pageForm.getSearchKeyword());
seg.orLike("contactMobileNumber", pageForm.getSearchKeyword());
seg.orLike("contactMobileNumber2", pageForm.getSearchKeyword());
seg.orLike("contactMobileNumber3", pageForm.getSearchKeyword());
seg.orLike("travelAgencyName", pageForm.getSearchKeyword());
seg.orLike("serialNumber", pageForm.getSearchKeyword());
cnd.and(seg);
@@ -88,7 +93,7 @@ public class RecuperationTravelAgencyController {
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
} else {
cnd.asc("serialNumber");
cnd.asc("serialNumber * 1");
}
Pagination pagination = travelAgencyService.pageData(pageForm, cnd);
return Result.success(pagination);
@@ -153,10 +158,14 @@ public class RecuperationTravelAgencyController {
@At
@ApiOperation("年度区间查询旅行社")
@SaCheckPermission("recuperation")
public Result selectTravelAgencyByYears(Integer startYear, Integer endYear) {
public Result selectTravelAgencyByYears(Integer startYear, Integer endYear, Integer year) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", ">=", startYear);
cnd.andEX("year", "<=", endYear);
if (startYear != null && endYear != null) {
cnd.and("year", ">=", startYear);
cnd.and("year", "<=", endYear);
} else {
cnd.andEX("year", "=", year);
}
List<RecuperationTravelAgency> list = travelAgencyService.selectAllTravelAgencyByYear(cnd);
return Result.success(list);
}
@@ -1,22 +1,27 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.hutool.json.JSONObject;
import com.budwk.app.base.model.BaseModel;
import com.budwk.app.sys.models.Sys_file;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
import java.util.List;
/**
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.RecuperationBaseManagement
* @Description: TODO
* @Author zzr
* @Date 2023/6/5
* @Version V1.0
**/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_base_management")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养基地")
public class RecuperationBaseManagement extends BaseModel {
@Table("the_rapy_recuperation_base_management")
@Accessors(chain = true)
public class RecuperationBaseManagement {
@Name
@Comment("id")
@@ -59,12 +64,22 @@ public class RecuperationBaseManagement extends BaseModel {
@Excel(name = "时间标段")
private String lotId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("可选出行天数")
private String days;
@Column
@ColDefine(customType = "text")
@Comment("疗休养详情")
@Excel(name = "详细信息")
private String content;
@Column
@ColDefine(customType = "longtext")
@Comment("方案列表")
private String schemeList;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否禁用")
@@ -115,7 +130,7 @@ public class RecuperationBaseManagement extends BaseModel {
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("缩略图")
private String file;
private String files;
@Column
@ColDefine(type = ColType.INT)
@@ -123,18 +138,60 @@ public class RecuperationBaseManagement extends BaseModel {
@Excel(name = "组织形式(分工会/校工会)")
private int createMode;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("基地联系人")
@Excel(name = "目的地联系人")
private String baseContactPerson;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("基地联系人电话")
@Excel(name = "联系电话")
private String baseContactNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("基地联系人2")
@Excel(name = "目的地联系人2")
private String baseContactPerson2;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("基地联系人电话2")
@Excel(name = "联系电话2")
private String baseContactNumber2;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("基地联系人3")
@Excel(name = "目的地联系人3")
private String baseContactPerson3;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("基地联系人电话3")
@Excel(name = "联系电话3")
private String baseContactNumber3;
@Column
@ColDefine(type = ColType.INT)
@Comment("最大报名数")
private Integer maxSignUpNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("操作人")
private String opBy;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("操作时间")
private String opAt;
@One(field = "travelAgencyId")
private RecuperationTravelAgency travelAgency;
}
@@ -0,0 +1,40 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import lombok.Data;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List;
/**
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.RecuperationCluster
* @Description: TODO
* @Author zxc
* @Date 2022/6/17:09:30
* @Version V1.0
**/
@Data
@Table("the_rapy_recuperation_cluster")
@Accessors(chain = true)
public class RecuperationCluster {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("线路id")
private String lineId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("团名")
private String clusterName;
@Many(field = "clusterId")
private List<RecuperationClusterMember> members;
}
@@ -0,0 +1,60 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import lombok.Data;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.RecuperationClusterMember
* @Description: TODO
* @Author zxc
* @Date 2022/6/17:09:30
* @Version V1.0
**/
@Data
@Table("the_rapy_recuperation_cluster_member")
@Accessors(chain = true)
public class RecuperationClusterMember {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("线路id")
private String lineId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("团Id")
private String clusterId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("工号")
private String loginName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("姓名")
private String userName;
@Column
@ColDefine(type = ColType.CHAR, width = 1)
@Comment("性别")
private String sex;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("工会")
private String unionName;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否领队")
private Boolean isLeader;
}
@@ -1,21 +1,19 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import org.nutz.lang.util.NutMap;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_config")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养配置")
public class RecuperationConfig extends BaseModel {
@Table("the_rapy_recuperation_config")
@Accessors(chain = true)
public class RecuperationConfig {
@Name
@Comment("id")
@@ -32,11 +30,26 @@ public class RecuperationConfig extends BaseModel {
@Comment("参加人员范围")
private Integer activityGroupId;
@Column
@ColDefine(customType = "longtext")
@Comment("提醒")
private String remindContent;
@Column
@ColDefine(type = ColType.INT, width = 32)
@Comment("提醒可见人员范围")
private Integer remindVisibleGroupId;
@Column
@ColDefine(type = ColType.INT)
@Comment("省外名额分配")
@Comment("最少成团人数(含家属)")
private Integer outsideQuota;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("省外名额分配")
private String outsideQuotaMode;
@Column
@ColDefine(type = ColType.FLOAT, width = 3, precision = 2)
@Comment("省外名额分配比例")
@@ -67,21 +80,45 @@ public class RecuperationConfig extends BaseModel {
@Comment("可以修改几次")
private Integer modifyNumber;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("报名开始时间")
private Date signUpStartTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("报名结束时间")
private Date signUpEndTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("变更截至时间")
private Date changeEndTime;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("省内线路是否审核")
@Default(value = "0")
private Boolean isSnLine;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("省外线路是否审核")
@Default(value = "0")
private Boolean isSwLine;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("旅行社是否审核")
@Default(value = "0")
private Boolean travelAudit;
@Column
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("标段")
private List<NutMap> modifyBd;
@Many(field = "configId")
private List<RecuperationLot> lots;
@@ -97,16 +134,23 @@ public class RecuperationConfig extends BaseModel {
@Column
@ColDefine(type = ColType.INT)
@Comment("起始年份")
@Comment("起始年份")
private Integer provinceStartYear;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("床位信息")
@Default(value = "0")
private Boolean bedInfo;
@Column
@ColDefine(type = ColType.INT)
@Comment("家属信息")
@Default(value = "0")
private Integer familyInfo;
@Column
@Comment("分工会人数限制")
@ColDefine(type = ColType.MYSQL_JSON)
private List<NutMap> unionLimit;
}
@@ -12,17 +12,16 @@ import java.util.Date;
import java.util.List;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnroll
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.RecuperationEnroll
* @Description: 疗休养报名登记表
* @Author zxc
* @Date 2022/5/31:16:58
* @Version V1.0
**/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_enroll")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养报名登记表")
@Data
@Table("the_rapy_recuperation_enroll")
@Accessors(chain = true)
public class RecuperationEnroll extends BaseModel {
@Name
@@ -87,6 +86,26 @@ public class RecuperationEnroll extends BaseModel {
@Comment("参加酒店")
private String takePartInBaseManagementId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("灵活组团团长用户id")
private String groupLeaderUserId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("灵活组团团长工号")
private String groupLeaderLoginName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("灵活组团团长姓名")
private String groupLeaderUserName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 10)
@Comment("灵活组团团长口令")
private String groupLeaderPassword;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("报名时间")
@@ -158,10 +177,6 @@ public class RecuperationEnroll extends BaseModel {
private String lineId;
private Date playStartTime;
private Date playEndTime;
/**
* 床位信息
*/
@@ -184,8 +199,23 @@ public class RecuperationEnroll extends BaseModel {
private String evaluationForJourney;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("反馈内容")
@ColDefine(type = ColType.VARCHAR)
@Comment("对住宿的评价(几星)")
private String evaluationForAccommodation;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("对餐饮的评价(几星)")
private String evaluationForDining;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("对交通的评价(几星)")
private String evaluationForTransportation;
@Column
@ColDefine(type = ColType.VARCHAR, width = 500)
@Comment("评价建议(优化亮点、优化改进、后续期待)")
private String feedbackContent;
@Column
@@ -203,4 +233,20 @@ public class RecuperationEnroll extends BaseModel {
@Comment("家属数量")
private Integer familyNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 200)
@Comment("特殊身体情况备注")
private String remark;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否报销")
private Boolean isReimbursement;
/**
* 灵活组团同团队员信息,仅用于手机端修改和查看回显,不落库。
*/
private List<RecuperationEnroll> signUserList;
private String firstLetter;
}
@@ -3,21 +3,21 @@ package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnrollBed
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.RecuperationEnrollBed
* @Description: 报名拼床信息
* @Author zxc
* @Date 2022/6/2:14:44
* @Version V1.0
**/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_enroll_bed")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养报名床位表")
@Data
@Table("the_rapy_recuperation_enroll_bed")
@Accessors(chain = true)
public class RecuperationEnrollBed extends BaseModel {
@Name
@@ -1,36 +1,37 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
/**
* @ClassName RecuperationEnrollChangeRecord
* @Author JyuHsin
* @Date 2025/8/19 15:48
* @Version 1.0
* @Description TODO
*/
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.RecuperationEnrollChangeRecord
* @Description: 疗休养登记变更记录表
* @Author zxc
* @Date 2022/5/31:17:10
* @Version V1.0
**/
@Data
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养登记变更记录表")
@Table("the_rapy_recuperation_enroll_change_record")
@Accessors(chain = true)
public class RecuperationEnrollChangeRecord {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("变更记录id")
private String enrollId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("变更记录id")
private String enrollId;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("变更时间")
private Date changeTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("变更时间")
private Date changeTime;
}
@@ -3,21 +3,21 @@ package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnrollFamily
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.RecuperationEnrollFamily
* @Description: TODO
* @Author zxc
* @Date 2022/5/31:17:07
* @Version V1.0
**/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_enroll_companion")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养报名床位表")
@Data
@Table("the_rapy_recuperation_enroll_companion")
@Accessors(chain = true)
public class RecuperationEnrollCompanion extends BaseModel {
@Name
@@ -70,6 +70,11 @@ public class RecuperationEnrollCompanion extends BaseModel {
@Comment("床位信息id")
private String bedInfoId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 200)
@Comment("特殊身体情况备注")
private String remark;
/**
* 床位信息
*/
@@ -1,61 +0,0 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.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;
import java.io.Serializable;
import java.util.Date;
/**
* @author NINGMEI
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_evaluate")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养评价统计表")
public class RecuperationEvaluate extends BaseModel implements Serializable {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("参加线路id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String lineId;
@Column
@Comment("用户ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userId;
@Column
@Comment("姓名")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userName;
@Column
@Comment("工号")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String loginName;
@Column
@Comment("评分")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String evaluateScore;
@Column
@Comment("评价内容")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String evaluateText;
@Column
@Comment("评价时间")
@ColDefine(type = ColType.DATETIME)
private Date applyDate;
}
@@ -1,20 +1,25 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import cn.hutool.json.JSONObject;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
import java.util.List;
@Data
/**
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.RecuperationLine
* @Description: 疗休养线路管理
* @Author zxc
* @Date 2022/5/31:09:13
* @Version V1.0
**/
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_line")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养线路")
@Data
@Table("the_rapy_recuperation_line")
@Accessors(chain = true)
public class RecuperationLine extends BaseModel {
@Name
@@ -23,9 +28,9 @@ public class RecuperationLine extends BaseModel {
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@ColDefine(type = ColType.INT)
@Comment("编号")
private String serialNumber;
private Integer serialNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@@ -42,6 +47,11 @@ public class RecuperationLine extends BaseModel {
@Comment("区域性质")
private String regionalNature;
@Column
@ColDefine(type = ColType.INT)
@Comment("游玩天数")
private Integer playNumberOfDays;
@Column
@ColDefine(customType = "text")
@Comment("疗休养内容")
@@ -49,9 +59,14 @@ public class RecuperationLine extends BaseModel {
@Column
@ColDefine(type = ColType.INT)
@Comment("最少参与教工")
@Comment("最少成团人数(含家属)")
private Integer minimumGroupSize;
@Column
@ColDefine(type = ColType.INT)
@Comment("最大报名数")
private Integer maxSignUpNumber;
@Column
@ColDefine(type = ColType.INT)
@Comment("年度")
@@ -67,6 +82,31 @@ public class RecuperationLine extends BaseModel {
@Comment("哪个分工会创建的")
private String createUnionId;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("报名开始时间")
private Date signUpStartTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("报名截至时间")
private Date signUpEndTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("变更截至时间")
private Date changeEndTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("游玩开始时间")
private Date playStartTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("游玩结束时间")
private Date playEndTime;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("交通工具")
@@ -79,13 +119,13 @@ public class RecuperationLine extends BaseModel {
@Column
@ColDefine(type = ColType.INT)
@Comment("成团人数包括家属")
@Comment("最少成团人数(含家属")
private Integer estimatedFamilyNumbers;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@ColDefine(type = ColType.VARCHAR, width = 30)
@Comment("缩略图")
private String file;
private String files;
@Column
@ColDefine(type = ColType.INT)
@@ -112,6 +152,26 @@ public class RecuperationLine extends BaseModel {
@Comment("联系电话")
private String lineContactPhone;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("联系人2")
private String lineContact2;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("联系电话2")
private String lineContactPhone2;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("联系人3")
private String lineContact3;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("联系电话3")
private String lineContactPhone3;
@One(field = "travelAgencyId")
private RecuperationTravelAgency travelAgency;
@@ -3,6 +3,7 @@ package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
@@ -15,11 +16,10 @@ import java.util.Date;
* @author jug
* @date 2023/06/26
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_line_select")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养线路")
@Data
@Table("the_rapy_recuperation_line_union_select")
@Accessors(chain = true)
public class RecuperationLineSelect extends BaseModel {
@Name
@@ -47,6 +47,7 @@ public class RecuperationLineSelect extends BaseModel {
@Comment("选择用户")
private String selectUserId;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("报名开始时间")
@@ -95,9 +96,10 @@ public class RecuperationLineSelect extends BaseModel {
@Column
@ColDefine(type = ColType.INT)
@Comment("最少参与教工")
@Comment("最少成团人数(含家属)")
private Integer minimumGroupSize;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("交通工具")
@@ -110,7 +112,7 @@ public class RecuperationLineSelect extends BaseModel {
@Column
@ColDefine(type = ColType.INT)
@Comment("成团人数包括家属")
@Comment("最少成团人数(含家属")
private Integer estimatedFamilyNumbers;
@Column
@@ -123,4 +125,8 @@ public class RecuperationLineSelect extends BaseModel {
@Comment("是否启用")
private Boolean enable;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("旅行社id")
private String travelAgencyId;
}
@@ -1,18 +1,22 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.RecuperationLot
* @Description: TODO
* @Author zzr
* @Date 2023/6/6
* @Version V1.0
**/
@Table("the_rapy_recuperation_lot")
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_lot")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养标段")
public class RecuperationLot extends BaseModel {
@Accessors(chain = true)
public class RecuperationLot {
@Name
@Comment("id")
@@ -0,0 +1,145 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import lombok.Data;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
/**
* 省内灵活组团管理
*/
@Data
@Table("the_rapy_recuperation_province_flexible_group")
@Accessors(chain = true)
public class RecuperationProvinceFlexibleGroup {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.INT)
@Comment("年度")
private Integer year;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("排序编号")
private String sortNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("组团名称")
private String groupName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("旅行社Id")
private String travelAgencyId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("天数")
private String days;
@Column
@ColDefine(customType = "text")
@Comment("详细信息")
private String content;
@Column
@ColDefine(customType = "longtext")
@Comment("方案列表")
private String schemeList;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否禁用")
private Boolean isDisabled;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("创建分工会")
private String createUnionId;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("报名开始时间")
private Date signUpStartTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("报名截至时间")
private Date signUpEndTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("变更截至时间")
private Date changeEndTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("活动开始时间")
private Date activityStartTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("活动结束时间")
private Date activityEndTime;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("缩略图")
private String files;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("联系人")
private String contactPerson;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("联系人电话")
private String contactNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("联系人2")
private String contactPerson2;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("联系人电话2")
private String contactNumber2;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("联系人3")
private String contactPerson3;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("联系人电话3")
private String contactNumber3;
@Column
@ColDefine(type = ColType.INT)
@Comment("最大报名数")
private Integer maxSignUpNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("操作人")
private String opBy;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("操作时间")
private String opAt;
@One(field = "travelAgencyId")
private RecuperationTravelAgency travelAgency;
}
@@ -1,23 +1,26 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import cn.hutool.json.JSONObject;
import com.budwk.app.base.model.BaseModel;
import com.budwk.app.sys.models.Sys_file;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List;
@Data
/**
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.RecuperationTravelAgency
* @Description: 疗休养旅行社管理
* @Author zxc
* @Date 2022/5/31:14:39
* @Version V1.0
**/
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_travel_agency")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养旅行社")
@Data
@Table("the_rapy_recuperation_travel_agency")
@Accessors(chain = true)
public class RecuperationTravelAgency extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
@@ -43,6 +46,26 @@ public class RecuperationTravelAgency extends BaseModel {
@Comment("旅行社联系人手机")
private String contactMobileNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("旅行社联系人2")
private String contact2;
@Column
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("旅行社联系人电话2")
private String contactMobileNumber2;
@Column
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("旅行社联系人3")
private String contact3;
@Column
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("旅行社联系人电话3")
private String contactMobileNumber3;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("旅行社邮箱")
@@ -53,6 +76,11 @@ public class RecuperationTravelAgency extends BaseModel {
@Comment("旅行社官网")
private String officialWebsite;
@Column
@ColDefine(type = ColType.INT)
@Comment("最大报名数")
private Integer maxSignUpNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("备注")
@@ -71,5 +99,10 @@ public class RecuperationTravelAgency extends BaseModel {
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("缩略图")
private String file;
private String files;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否自由组团")
private Boolean signUpTravelAgency;
}
@@ -1,17 +1,51 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service;
import com.budwk.app.base.model.Audit;
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.recuperation.model.RecuperationEnroll;
import org.nutz.lang.util.NutMap;
/**
* @ClassName RecuperationAuditService
* @Author JyuHsin
* @Date 2025/8/20 14:38
* @Version 1.0
* @Description TODO
*/
public interface RecuperationAuditService extends BaseService<RecuperationEnroll> {
import java.util.List;
NutMap findOne(String id);
public interface RecuperationAuditService extends BaseService<Audit> {
/**
* 根据分工会查询线路
*
* @param
* @param unionId
* @param regionalNature 是否省内省外 可为空
* @param year 可为空
* @return
*/
List<NutMap> getXlByUnion(Integer state, String unionId, String regionalNature, String year,String endYear, Integer signUpMode);
/**
*
* @param id
* @return
*/
NutMap findOne(String id);
/**
* 校工会审核
* @param stateId
* @param loginName
* @param adjustment
* @param takePartInLineId
*/
void schoolAudit(Integer stateId, String loginName,Boolean adjustment, String takePartInLineId);
/** 按审核环节分页查询旧版报名记录。 */
Pagination auditPage(PageForm pageForm, String stage, Integer year, Boolean audited, String keyword);
/** 根据报名当前状态完成分工会、线路工会或校工会审核。 */
void auditEnroll(String id, boolean pass, String auditOpinion);
/** 撤回最近一次审核,将报名恢复到对应待审核状态。 */
void recallAudit(String id);
}
@@ -4,6 +4,9 @@ import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationBaseManagement;
import org.nutz.lang.util.NutMap;
import java.util.Date;
import java.util.Map;
/**
* @ClassName RecuperationBaseManagerService
* @Author JyuHsin
@@ -14,4 +17,19 @@ import org.nutz.lang.util.NutMap;
public interface RecuperationBaseManagerService extends BaseService<RecuperationBaseManagement> {
NutMap selectBaseAllInfo(String id);
/**
* 查询定点活动日期
*
* @param id 定点 ID
* @param enrollId 编辑时排除的报名记录 ID新增时可为空
* @return 日历范围可用天数和本人已使用日期
*/
NutMap selectBaseTimeArray(String id, String enrollId);
/** 校验定点报名名额,返回校验结果及提示信息。 */
Map<Boolean, String> validBaseManagementQuota(String id, String enrollId);
/** 批量设置定点报名开始、报名截止和变更截止时间。 */
void batchAssignSignUpTimes(String[] ids, Date signUpStartTime, Date signUpEndTime, Date changeEndTime);
}
@@ -0,0 +1,18 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationConfig;
import com.budwk.app.zhgh.staffbenefit.recuperation.constant.RecuperationType;
public interface RecuperationCommonService extends BaseService<RecuperationConfig> {
/**
* 可以报名吗
*
* @param loginName 用户名
* @return boolean
*/
boolean canSignUp(String loginName, RecuperationType theRapyRecuperationType);
}
@@ -0,0 +1,22 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationEnroll;
import org.nutz.lang.util.NutMap;
import java.util.List;
import java.util.Map;
public interface RecuperationEnrollJoinUserImportService extends BaseService<RecuperationEnroll> {
List<?> selectLineAndTravelAgencyList(Integer year, String keyword);
Map<String, List<NutMap>> selectLineOrTravelAgency(Integer year);
/** 将 Excel 行与指定线路或旅行社中的旧报名记录匹配。 */
List<RecuperationEnroll> matchEnrolls(List<RecuperationEnroll> rows, String lineId, String travelAgencyId);
/** 批量标记实际参加时间。 */
void markParticipated(List<RecuperationEnroll> enrolls);
}
@@ -77,6 +77,14 @@ public interface RecuperationEnrollService extends BaseService<RecuperationEnrol
*/
Map<Boolean, String> validSignUpInfo(String loginName, RecuperationEnroll enrollInfo);
/**
* 提交前统一校验线路灵活组团或定点名额
*
* @param enrollInfo 报名信息按三种 takePartIn 字段识别报名类型
* @return key 为校验结果value 为对应提示
*/
Map<Boolean, String> validSubmitQuota(RecuperationEnroll enrollInfo);
/**
* 我报名的页面数据
*
@@ -0,0 +1,23 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.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.recuperation.model.RecuperationEnroll;
import java.util.List;
public interface RecuperationLineAdjustmentService extends BaseService<RecuperationEnroll> {
Pagination pageData(PageForm pageForm, Integer year, String lineId, String unionId, String keywords, String regionalNature, String lotId);
List findUnionSignUpModeUserList(String lineId, String unionId);
/** 查询指定年度可进行人员调整的线路。 */
List<?> findLineOptions(Integer year);
/** 切换指定线路中报名人员的正常/调出状态。 */
void adjustmentUsers(String lineId, String[] loginNames);
}
@@ -0,0 +1,40 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.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.recuperation.model.RecuperationCluster;
import java.util.List;
public interface RecuperationLineClusterService extends BaseService<RecuperationCluster> {
/**
* 页面数据
*
* @param pageForm 分页参数
* @param year 年度
* @param unionId 工会id
* @param keywords 关键字
* @return {@link Pagination}
*/
Pagination pageData(PageForm pageForm, Integer year, String unionId, String keywords);
/**
* 查询组团信息
*
* @param lineId 线路id
* @param lineId 归属工会id
* @return {@link Object}
*/
Object findClusterInfo(String lineId, String usUnionId);
/**
* 设置组团成员
*
* @param clusters 集群
* @param lineId 行id
*/
void setClusterMembers(List<RecuperationCluster> clusters, String lineId);
}
@@ -8,6 +8,7 @@ import org.nutz.dao.Cnd;
import org.nutz.lang.util.NutMap;
import java.util.List;
import java.util.Map;
/**
* @ClassName RecuperationLineService
@@ -72,6 +73,15 @@ public interface RecuperationLineService extends BaseService<RecuperationLine> {
*/
Pagination selectLineUser(PageForm pageForm, String lineId, String unionId);
/**
* 校验线路报名名额
*
* @param lineUnionSelectId 分工会线路选择记录 ID
* @param enrollId 编辑报名时需要排除的报名记录 ID新增时可为空
* @return key 为校验结果value 为对应提示信息
*/
Map<Boolean, String> validLineQuota(String lineUnionSelectId, String enrollId);
/**
* 清除线路详细信息
*
@@ -0,0 +1,96 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.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.recuperation.model.RecuperationProvinceFlexibleGroup;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
import org.nutz.lang.util.NutMap;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 省内灵活组团管理
*/
public interface RecuperationProvinceFlexibleGroupService extends BaseService<RecuperationProvinceFlexibleGroup> {
/**
* 分页查询省内灵活组团列表
*
* @param pageForm 分页参数
* @param year 年度
* @param days 兼容旧页面参数当前不再参与筛选
* @param groupName 组团名称
* @param unionId 创建工会
* @param travelAgencyId 旅行社
* @return 分页数据
*/
Pagination pageData(PageForm pageForm, Integer year, String days, String groupName, String unionId, String travelAgencyId);
/**
* 查询省内灵活组团详情包含旅行社信息
*
* @param id 省内灵活组团id
* @return 省内灵活组团详情
*/
RecuperationProvinceFlexibleGroup selectFlexibleGroupById(String id);
/**
* 查询手机端省内灵活组团可选活动日期
*
* @param id 省内灵活组团id
* @param enrollId 当前编辑的报名记录id新增报名时为空
* @return 可选日期已满日期和选择范围
*/
NutMap selectFlexibleGroupTimeArray(String id, String enrollId);
/**
* 校验手机端灵活组团介绍页点击报名时是否还有名额
*
* @param id 省内灵活组团id
* @param enrollId 当前编辑的报名记录id新增报名时为空
* @return 校验结果
*/
Map<Boolean, String> validFlexibleGroupQuota(String id, String enrollId);
/**
* 保存省内灵活组团信息补齐操作人创建工会和操作时间
*
* @param flexibleGroup 省内灵活组团信息
*/
void submitFlexibleGroup(RecuperationProvinceFlexibleGroup flexibleGroup);
/**
* 切换省内灵活组团启用状态
*
* @param id 省内灵活组团id
*/
void openClosedFlexibleGroup(String id);
/**
* 删除省内灵活组团
*
* @param id 省内灵活组团id
*/
void deleteFlexibleGroup(String id);
/**
* 查询允许省内灵活组团报名的旅行社
*
* @param year 年度
* @return 旅行社列表
*/
List<RecuperationTravelAgency> selectFlexibleTravelAgency(Integer year);
/**
* 批量统赋省内灵活组团报名时间
*
* @param ids 省内灵活组团id数组
* @param signUpStartTime 报名开始时间
* @param signUpEndTime 报名结束时间
* @param changeEndTime 变更截至时间
*/
void batchAssignSignUpTimes(String[] ids, Date signUpStartTime, Date signUpEndTime, Date changeEndTime);
}
@@ -2,80 +2,248 @@ package com.budwk.app.zhgh.staffbenefit.recuperation.service.impl;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.model.Audit;
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.recuperation.model.RecuperationEnroll;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.zhgh.staffbenefit.recuperation.constant.RecuperationState;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationEnrollBed;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationEnrollCompanion;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationEnroll;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationLine;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationLineSelect;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationAuditService;
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 org.nutz.ioc.aop.Aop;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import java.util.List;
import java.util.Map;
import java.util.Date;
/**
* @ClassName RecuperationAuditServiceImpl
* @Author JyuHsin
* @Date 2025/8/20 14:38
* @Version 1.0
* @Description TODO
*/
@Slf4j
@IocBean(args = {"refer:dao"})
public class RecuperationAuditServiceImpl extends BaseServiceImpl<RecuperationEnroll> implements RecuperationAuditService {
public class RecuperationAuditServiceImpl extends BaseServiceImpl<Audit> implements RecuperationAuditService {
public RecuperationAuditServiceImpl(Dao dao) {
super(dao);
}
public RecuperationAuditServiceImpl(Dao dao) {
super(dao);
}
@Override
public List<NutMap> getXlByUnion(Integer state, String unionId, String regionalNature, String year,String endYear, Integer signUpMode) {
@Override
public NutMap findOne(String id) {
Sql sql = Sqls.create("""
Sql sql = Sqls.create("""
SELECT
line.*,
lineu.id as selectId,
un.name as unionname,
DATE_FORMAT(lineu.playStartTime,'%Y-%m-%d') as playStartTime1
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN sys_union un ON un.id = enroll.takePartInUnionId
$condition
""");
Cnd cnd = Cnd.NEW();
if (Strings.isNotBlank(unionId)) {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
}
if (state != null && (state == 3 || state == 1)) {
cnd.and("enroll.takePartInUnionId", "=", SecurityUtil.getUnionId());
}
if (state != null && state == 2) {
cnd.and("enroll.selfUnionId", "=", SecurityUtil.getUnionId());
cnd.and("enroll.takePartInUnionId", "!=", SecurityUtil.getUnionId());
}
cnd.andEX("lineu.signUpMode", "=", signUpMode);
cnd.andEX("line.regionalNature", "=", regionalNature);
if (StrUtil.isNotBlank(endYear)){
cnd.andEX("YEAR(enroll.signingUptime)", ">=", year);
cnd.andEX("YEAR(enroll.signingUptime)", "<=", endYear);
} else {
cnd.andEX("YEAR(enroll.signingUptime)", "=", year);
}
cnd.and("enroll.takePartInLineId", "is not", null);
cnd.and("enroll.takePartInLineId", "!=", "");
cnd.and("enroll.stateId", "=", RecuperationState.PASS);
cnd.groupBy("line.id");
cnd.having(Cnd.where("playStartTime1", "is not", null));
cnd.asc("un.name").asc("lineu.lineId").asc("lineu.playStartTime");
sql.setCondition(cnd);
return listMap(sql);
}
@Override
public NutMap findOne(String id) {
Sql sql = Sqls.create("""
SELECT
lxs.travelAgencyName,
ta.travelAgencyName as joinTravelAgencyName,
enroll.*,
line.lineName,
if(enroll.takePartInUnionId!=enroll.selfUnionId,true,false) isTransferIn,
(SELECT COUNT(1) FROM recuperation_enroll_companion WHERE trreId=enroll.id and relation='亲属') isFamily
(SELECT COUNT(1) FROM the_rapy_recuperation_enroll_companion WHERE trreId=enroll.id) isFamily
FROM
`recuperation_enroll` enroll
LEFT JOIN recuperation_line_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = lineu.lineId
LEFT JOIN recuperation_travel_agency lxs ON lxs.id = line.travelAgencyId
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = lineu.travelAgencyId
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = enroll.takePartInTravelAgencyId
where enroll.id=@id
""").setParam("id", id);
sql.setCallback(Sqls.callback.map());
this.dao().execute(sql);
NutMap fetch = sql.getObject(NutMap.class);
NutMap map = NutMap.NEW();
if (Strings.isNotBlank(fetch.getString("selfUnionAuditId"))) {
Audit selfUnionAudit = dao().fetch(Audit.class, fetch.getString("selfUnionAuditId"));
fetch.setv("selfUnionAudit", selfUnionAudit);
}
if (Strings.isNotBlank(fetch.getString("joinLineUnionAuditId"))) {
Audit joinLineUnionAudit = dao().fetch(Audit.class, fetch.getString("joinLineUnionAuditId"));
fetch.setv("joinLineUnionAudit", joinLineUnionAudit);
}
if (Strings.isNotBlank(fetch.getString("schoolUnionAuditId"))) {
Audit schoolUnionAudit = dao().fetch(Audit.class, fetch.getString("schoolUnionAuditId"));
fetch.setv("schoolUnionAudit", schoolUnionAudit);
}
if (Strings.isNotBlank(fetch.getString("bedInfoId"))) {
RecuperationEnrollBed bedInfo = dao().fetch(RecuperationEnrollBed.class, fetch.getString("bedInfoId"));
fetch.setv("bedInfo", bedInfo);
}
List<RecuperationEnrollCompanion> companionList = dao().query(RecuperationEnrollCompanion.class, Cnd.where("trreId", "=", id));
companionList.forEach(v -> {
if(StrUtil.isNotBlank(v.getBedInfoId())) {
v.setBedInfo(dao().fetch(RecuperationEnrollBed.class, v.getBedInfoId()));
}
});
map.addv("viewData", fetch.setv("companionList", companionList));
return map;
}
sql.setCallback(Sqls.callback.map());
dao().execute(sql);
NutMap fetch = sql.getObject(NutMap.class);
// 导入或补录的历史报名记录可能缺少证件号手机号查看时用用户表数据兜底展示
if (fetch != null && (Strings.isBlank(fetch.getString("idCard")) || Strings.isBlank(fetch.getString("mobile")))) {
Sys_user user = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", fetch.getString("loginName")));
if (user != null) {
if (Strings.isBlank(fetch.getString("idCard"))) {
fetch.setv("idCard", user.getIdCard());
}
if (Strings.isBlank(fetch.getString("mobile"))) {
fetch.setv("mobile", user.getMobile());
}
}
}
NutMap map = NutMap.NEW();
if (Strings.isNotBlank(fetch.getString("selfUnionAuditId"))) {
Audit selfUnionAudit = dao().fetch(Audit.class, fetch.getString("selfUnionAuditId"));
fetch.setv("selfUnionAudit", selfUnionAudit);
}
if (Strings.isNotBlank(fetch.getString("joinLineUnionAuditId"))) {
Audit joinLineUnionAudit = dao().fetch(Audit.class, fetch.getString("joinLineUnionAuditId"));
fetch.setv("joinLineUnionAudit", joinLineUnionAudit);
}
if (Strings.isNotBlank(fetch.getString("schoolUnionAuditId"))) {
Audit schoolUnionAudit = dao().fetch(Audit.class, fetch.getString("schoolUnionAuditId"));
fetch.setv("schoolUnionAudit", schoolUnionAudit);
}
if (Strings.isNotBlank(fetch.getString("bedInfoId"))) {
RecuperationEnrollBed bedInfo = dao().fetch(RecuperationEnrollBed.class, fetch.getString("bedInfoId"));
fetch.setv("bedInfo", bedInfo);
}
List<RecuperationEnrollCompanion> companionList = dao().query(RecuperationEnrollCompanion.class, Cnd.where("trreId", "=", id));
companionList.forEach(v -> {
v.setBedInfo(dao().fetch(RecuperationEnrollBed.class, v.getBedInfoId()));
});
map.addv("viewData", fetch.setv("companionList", companionList));
return map;
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void schoolAudit(Integer stateId, String loginName, Boolean adjustment, String takePartInLineId) {
Sys_user user = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", loginName));
RecuperationLineSelect unionSelect = dao().fetch(RecuperationLineSelect.class, Cnd.where("id", "=", takePartInLineId));
RecuperationLine theRapyRecuperationLine = dao().fetch(RecuperationLine.class, Cnd.where("id", "=", unionSelect.getLineId()));
String content = "【智慧工会】%s老师您好,您报名的%s线路因报名人数不足已取消,请尽快进入智慧工会重新选择线路。"
.formatted(user.getUsername(),theRapyRecuperationLine.getLineName());
List list = List.of(Map.of("type", "User", "userId", user.getLoginname(), "name", user.getUsername()));
if (stateId.equals(RecuperationState.PASS)) {
content = "【智慧工会】%s老师您好,您报名的%s线路已组团成功,请按约定出行。"
.formatted(user.getUsername(), theRapyRecuperationLine.getLineName());
}
//msgApi.sendMsg(content, list, "疗休养", " IntelligenceMode", MsgApi.sendMode.normal.name());
}
@Override
public Pagination auditPage(PageForm pageForm, String stage, Integer year, Boolean audited, String keyword) {
Sql sql = Sqls.create("""
SELECT enroll.*, line.lineName, ta.travelAgencyName,
self_union.name AS selfUnionName,
join_union.name AS joinUnionName
FROM the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = COALESCE(enroll.takePartInTravelAgencyId, line.travelAgencyId)
LEFT JOIN sys_union self_union ON self_union.id = enroll.selfUnionId
LEFT JOIN sys_union join_union ON join_union.id = enroll.takePartInUnionId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(enroll.signingUptime)", "=", year);
cnd.and("enroll.isNormal", "=", true);
if (StrUtil.isNotBlank(keyword)) {
cnd.and(Cnd.exps("enroll.userName", "like", "%" + keyword + "%")
.or("enroll.loginName", "like", "%" + keyword + "%"));
}
if ("school".equals(stage) || "travel".equals(stage)) {
cnd.and("enroll.stateId", audited == null || !audited ? "=" : "in",
audited == null || !audited ? RecuperationState.SCHOOL : new Integer[]{RecuperationState.SCHOOLFAIL, RecuperationState.PASS});
if ("travel".equals(stage)) cnd.and("enroll.takePartInTravelAgencyId", "is not", null);
} else if ("lineUnion".equals(stage)) {
cnd.and("enroll.takePartInUnionId", "=", SecurityUtil.getUnionId());
cnd.and("enroll.stateId", audited == null || !audited ? "=" : "in",
audited == null || !audited ? RecuperationState.LINEUNIT : new Integer[]{RecuperationState.LINEUNITFAIL, RecuperationState.PASS});
} else {
cnd.and("enroll.selfUnionId", "=", SecurityUtil.getUnionId());
cnd.and("enroll.stateId", audited == null || !audited ? "=" : "in",
audited == null || !audited ? RecuperationState.UNIT : new Integer[]{RecuperationState.UNITFAIL, RecuperationState.LINEUNIT, RecuperationState.PASS});
}
cnd.desc("enroll.signingUptime");
sql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void auditEnroll(String id, boolean pass, String auditOpinion) {
RecuperationEnroll enroll = dao().fetch(RecuperationEnroll.class, id);
if (enroll == null) throw new IllegalArgumentException("报名记录不存在");
Integer oldState = enroll.getStateId();
Audit audit = new Audit();
audit.setAuditOpinion(auditOpinion);
audit.setAuditPass(pass);
audit.setAuditTime(new Date());
Audit saved = insert(audit);
if (RecuperationState.UNIT.equals(oldState)) {
enroll.setSelfUnionAuditId(saved.getId());
if (!pass) enroll.setStateId(RecuperationState.UNITFAIL);
else if (StrUtil.equals(enroll.getSelfUnionId(), enroll.getTakePartInUnionId())) enroll.setStateId(RecuperationState.PASS);
else enroll.setStateId(RecuperationState.LINEUNIT);
} else if (RecuperationState.LINEUNIT.equals(oldState)) {
enroll.setJoinLineUnionAuditId(saved.getId());
enroll.setStateId(pass ? RecuperationState.PASS : RecuperationState.LINEUNITFAIL);
} else if (RecuperationState.SCHOOL.equals(oldState)) {
enroll.setSchoolUnionAuditId(saved.getId());
enroll.setStateId(pass ? RecuperationState.PASS : RecuperationState.SCHOOLFAIL);
} else {
throw new IllegalStateException("当前报名状态不可审核");
}
dao().updateIgnoreNull(enroll);
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void recallAudit(String id) {
RecuperationEnroll enroll = dao().fetch(RecuperationEnroll.class, id);
if (enroll == null) throw new IllegalArgumentException("报名记录不存在");
if (RecuperationState.UNITFAIL.equals(enroll.getStateId())) {
enroll.setStateId(RecuperationState.UNIT);
enroll.setSelfUnionAuditId(null);
} else if (RecuperationState.LINEUNITFAIL.equals(enroll.getStateId())) {
enroll.setStateId(RecuperationState.LINEUNIT);
enroll.setJoinLineUnionAuditId(null);
} else if (RecuperationState.SCHOOLFAIL.equals(enroll.getStateId())) {
enroll.setStateId(RecuperationState.SCHOOL);
enroll.setSchoolUnionAuditId(null);
} else {
throw new IllegalStateException("当前状态不可撤回");
}
dao().update(enroll, "^stateId|selfUnionAuditId|joinLineUnionAuditId|schoolUnionAuditId$");
}
}
@@ -1,18 +1,37 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.recuperation.constant.RecuperationState;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationBaseManagement;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationEnroll;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationLot;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationBaseManagerService;
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.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.ioc.aop.Aop;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* @ClassName RecuperationBaseManagerServiceImpl
* @Author JyuHsin
@@ -34,11 +53,14 @@ public class RecuperationBaseManagerServiceImpl extends BaseServiceImpl<Recupera
select
b.*,
l.lotName,
(select COUNT(1) FROM recuperation_enroll en WHERE isNormal=true AND en.loginName=@loginname and YEAR(en.signingUptime)=@year ) isNormal,
(select COUNT(1) FROM recuperation_enroll en WHERE isNormal=false AND en.loginName=@loginname and YEAR(en.signingUptime)=@year) isNormalFalse
l.lotValue,
ta.travelAgencyName,
(select COUNT(1) FROM the_rapy_recuperation_enroll en WHERE isNormal=true AND en.loginName=@loginname and YEAR(en.signingUptime)=@year ) isNormal,
(select COUNT(1) FROM the_rapy_recuperation_enroll en WHERE isNormal=false AND en.loginName=@loginname and YEAR(en.signingUptime)=@year) isNormalFalse
from
recuperation_base_management b
left join recuperation_lot l on l.id = b.lotId
the_rapy_recuperation_base_management b
left join the_rapy_recuperation_lot l on l.id = b.lotId
left join the_rapy_recuperation_travel_agency ta on ta.id = b.travelAgencyId
$condition
""");
sql.setParam("loginname", SecurityUtil.getUserLoginname());
@@ -50,4 +72,213 @@ public class RecuperationBaseManagerServiceImpl extends BaseServiceImpl<Recupera
dao().execute(sql);
return (NutMap) sql.getResult();
}
@Override
public NutMap selectBaseTimeArray(String id, String enrollId) {
RecuperationBaseManagement base = dao().fetch(RecuperationBaseManagement.class, id);
if (base == null || base.getActivityStartTime() == null || base.getActivityEndTime() == null) {
return emptyTimeArray();
}
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate startDate = LocalDate.parse(DateUtil.formatDate(base.getActivityStartTime()), formatter);
LocalDate endDate = LocalDate.parse(DateUtil.formatDate(base.getActivityEndTime()), formatter);
LocalDate currentDate = LocalDate.now().isAfter(startDate) ? LocalDate.now() : startDate;
List<String> calendarDays = new ArrayList<>();
while (!currentDate.isAfter(endDate)) {
calendarDays.add(currentDate.format(formatter));
currentDate = currentDate.plusDays(1);
}
List<String> configuredDays = getConfiguredBaseDays(base);
List<String> availableDays = getAvailableBaseManagementDays(SecurityUtil.getUserLoginname(), enrollId);
availableDays.removeIf(day -> !configuredDays.contains(day));
return NutMap.NEW()
.setv("days", calendarDays)
.setv("availableDays", availableDays)
.setv("holidays", Collections.emptyList())
.setv("fullDays", Collections.emptySet())
.setv("usedDays", getBaseUsedDays(base.getYear(), enrollId))
.setv("minDate", DateUtil.formatDate(base.getActivityStartTime()))
.setv("maxDate", DateUtil.formatDate(base.getActivityEndTime()));
}
/** 返回未配置活动范围时前端可直接消费的空日期结构。 */
private NutMap emptyTimeArray() {
return NutMap.NEW()
.setv("days", Collections.emptyList())
.setv("availableDays", Collections.emptyList())
.setv("holidays", Collections.emptyList())
.setv("fullDays", Collections.emptySet())
.setv("usedDays", Collections.emptySet())
.setv("minDate", "")
.setv("maxDate", "");
}
@Override
public Map<Boolean, String> validBaseManagementQuota(String id, String enrollId) {
if (StrUtil.isBlank(id)) {
return Map.of(false, "参数错误");
}
RecuperationBaseManagement base = dao().fetch(RecuperationBaseManagement.class, id);
if (base == null) {
return Map.of(false, "定点信息不存在");
}
if (base.getMaxSignUpNumber() == null || base.getMaxSignUpNumber() <= 0) {
return Map.of(true, "验证成功");
}
if (countBaseManagementSignUpUsers(id, enrollId) >= base.getMaxSignUpNumber()) {
return Map.of(false, "当前定点报名人数已满");
}
return Map.of(true, "验证成功");
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void batchAssignSignUpTimes(String[] ids, Date signUpStartTime, Date signUpEndTime, Date changeEndTime) {
if (Lang.isEmpty(ids)) {
return;
}
Chain chain = Chain.make("signUpStartTime", signUpStartTime)
.add("signUpEndTime", signUpEndTime)
.add("changeEndTime", changeEndTime);
dao().update(RecuperationBaseManagement.class, chain, Cnd.where("id", "in", ids));
}
/** 按工号统计定点有效报名人数,编辑时排除当前报名。 */
private int countBaseManagementSignUpUsers(String id, String excludeEnrollId) {
Sql sql = Sqls.create("""
SELECT COUNT(DISTINCT loginName)
FROM the_rapy_recuperation_enroll
WHERE takePartInBaseManagementId = @id
AND isNormal = true
AND stateId NOT IN ($auditFailStates)
$excludeEnrollCnd
""");
sql.setParam("id", id);
sql.setVar("auditFailStates", String.join(",", Arrays.asList(
String.valueOf(RecuperationState.UNITFAIL),
String.valueOf(RecuperationState.LINEUNITFAIL),
String.valueOf(RecuperationState.SCHOOLFAIL)
)));
sql.setVar("excludeEnrollCnd", StrUtil.isBlank(excludeEnrollId) ? "" : "AND id != @excludeEnrollId");
if (StrUtil.isNotBlank(excludeEnrollId)) {
sql.setParam("excludeEnrollId", excludeEnrollId);
}
sql.setCallback(Sqls.callback.integer());
dao().execute(sql);
return sql.getInt();
}
/** 新数据读取 days,旧数据通过标段名称或值推断可选天数。 */
private List<String> getConfiguredBaseDays(RecuperationBaseManagement base) {
Set<String> days = new HashSet<>();
if (StrUtil.isNotBlank(base.getDays())) {
for (String item : base.getDays().split(",")) {
String day = normalizeDay(item);
if (StrUtil.isNotBlank(day)) {
days.add(day);
}
}
}
if (days.isEmpty() && StrUtil.isNotBlank(base.getLotId())) {
RecuperationLot lot = dao().fetch(RecuperationLot.class, base.getLotId());
if (lot != null) {
String day = normalizeDay(StrUtil.blankToDefault(lot.getLotValue(), lot.getLotName()));
if (StrUtil.isNotBlank(day)) {
days.add(day);
}
}
}
return new ArrayList<>(days);
}
/** 计算当前年度仍可报名的定点天数组合。 */
private List<String> getAvailableBaseManagementDays(String loginName, String excludeEnrollId) {
List<String> options = List.of("两天", "三天", "五天");
List<RecuperationEnroll> enrolls = queryCurrentYearEnrolls(loginName, excludeEnrollId);
if (enrolls.isEmpty()) {
return new ArrayList<>(options);
}
boolean hasOtherMode = enrolls.stream().anyMatch(enroll -> StrUtil.isNotBlank(enroll.getTakePartInLineId())
|| StrUtil.isNotBlank(enroll.getTakePartInTravelAgencyId()));
if (hasOtherMode) {
return new ArrayList<>();
}
Set<String> signedDays = new HashSet<>();
for (RecuperationEnroll enroll : enrolls) {
if (StrUtil.isNotBlank(enroll.getTakePartInBaseManagementId())) {
signedDays.add(resolveEnrollDay(enroll));
}
}
if (signedDays.contains("五天") || signedDays.containsAll(List.of("两天", "三天"))) {
return new ArrayList<>();
}
if (signedDays.contains("两天")) {
return new ArrayList<>(List.of("三天"));
}
if (signedDays.contains("三天")) {
return new ArrayList<>(List.of("两天"));
}
return new ArrayList<>(options);
}
private List<RecuperationEnroll> queryCurrentYearEnrolls(String loginName, String excludeEnrollId) {
if (StrUtil.isBlank(loginName)) {
return Collections.emptyList();
}
List<RecuperationEnroll> enrolls = dao().query(RecuperationEnroll.class, Cnd.where("loginName", "=", loginName)
.and("isNormal", "=", true)
.and("stateId", "not in", Lang.array(RecuperationState.UNITFAIL, RecuperationState.LINEUNITFAIL, RecuperationState.SCHOOLFAIL))
.and("YEAR(signingUptime)", "=", DateUtil.thisYear()));
enrolls.removeIf(enroll -> StrUtil.isNotBlank(excludeEnrollId) && excludeEnrollId.equals(enroll.getId()));
return enrolls;
}
/** 查询本人定点报名覆盖日期,供移动端日历禁用冲突日期。 */
private Set<String> getBaseUsedDays(Integer year, String excludeEnrollId) {
List<RecuperationEnroll> enrolls = dao().query(RecuperationEnroll.class, Cnd.where("loginName", "=", SecurityUtil.getUserLoginname())
.and("isNormal", "=", true)
.and("takePartInBaseManagementId", "is not", null)
.and("stateId", "not in", Lang.array(RecuperationState.UNITFAIL, RecuperationState.LINEUNITFAIL, RecuperationState.SCHOOLFAIL))
.and("YEAR(signingUptime)", "=", year == null ? DateUtil.thisYear() : year));
Set<String> usedDays = new HashSet<>();
for (RecuperationEnroll enroll : enrolls) {
if ((StrUtil.isNotBlank(excludeEnrollId) && excludeEnrollId.equals(enroll.getId())) || enroll.getTakePartInTime() == null) {
continue;
}
int dayCount = dayCount(resolveEnrollDay(enroll));
LocalDate startDate = LocalDate.parse(DateUtil.formatDate(enroll.getTakePartInTime()));
for (int i = 0; i < dayCount; i++) {
usedDays.add(startDate.plusDays(i).toString());
}
}
return usedDays;
}
private String resolveEnrollDay(RecuperationEnroll enroll) {
String day = normalizeDay(enroll.getLotId());
if (StrUtil.isNotBlank(day)) {
return day;
}
RecuperationLot lot = StrUtil.isBlank(enroll.getLotId()) ? null : dao().fetch(RecuperationLot.class, enroll.getLotId());
return lot == null ? "" : normalizeDay(StrUtil.blankToDefault(lot.getLotValue(), lot.getLotName()));
}
private String normalizeDay(String text) {
if (StrUtil.isBlank(text)) {
return "";
}
if (text.contains("") || text.contains("2")) return "两天";
if (text.contains("") || text.contains("3")) return "三天";
if (text.contains("") || text.contains("5")) return "五天";
return "";
}
private int dayCount(String day) {
if ("两天".equals(day)) return 2;
if ("三天".equals(day)) return 3;
if ("五天".equals(day)) return 5;
return 0;
}
}
@@ -0,0 +1,66 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service.impl;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import cn.hutool.core.date.DateUtil;
import com.budwk.app.zhgh.staffbenefit.recuperation.constant.RecuperationType;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationConfig;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationEnroll;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationCommonService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.IocBean;
/**
* @FileName com.budwk.app.zhgh.staffbenefit.recuperation.service.impl.RecuperationCommonServiceImpl
* @Description: TODO
* @Author zxc
* @Date 2022/6/6:10:46
* @Version V1.0
**/
@IocBean(args = {"refer:dao"})
public class RecuperationCommonServiceImpl extends BaseServiceImpl<RecuperationConfig> implements RecuperationCommonService {
public RecuperationCommonServiceImpl(Dao dao) {
super(dao);
}
@Override
public boolean canSignUp(String loginName, RecuperationType trrt) {
RecuperationConfig config = dao().fetch(RecuperationConfig.class);
//每年旅行频率
Integer travelFrequency = config.getTravelFrequency();
//省外几年去一次
Integer outsideNumber = config.getOutsideNumber();
//今年是否参加了 旅游频率限制
Cnd cnd = Cnd.NEW();
cnd.and("loginName", "=", loginName);
cnd.and("YEAR(takePartInTime)", "=", DateUtil.thisYear());
cnd.and("isTakePartIn", "=", 1);
int joinCount = dao().count(RecuperationEnroll.class, cnd);
if (joinCount == travelFrequency) {
return false;
}
//省外 outsideNumber 年内是否去过
if (trrt.getValue() == RecuperationType.provinceOutLine.getValue()) {
Cnd lineCnd = cnd.clone();
lineCnd.and("takePartInLineId", "IS NOT", null);
lineCnd.and(new SqlExpressionGroup().andBetween("YEAR(takePartInTime)", DateUtil.thisYear() - 1, DateUtil.thisYear() - outsideNumber));
int lineJoinCount = dao().count(RecuperationEnroll.class, lineCnd);
return lineJoinCount <= 0;
}
return false;
}
}
@@ -0,0 +1,109 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service.impl;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationEnroll;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationEnrollJoinUserImportService;
import org.nutz.dao.Dao;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.ioc.aop.Aop;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.lang.util.NutMap;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
/**
* @FileName com.budwk.app.zhgh.staffbenefit.recuperation.service.impl.RecuperationEnrollJoinUserImportServiceImpl
* @Description: TODO
* @Author zxc
* @Date 2022/6/14:09:57
* @Version V1.0
**/
@IocBean(args = {"refer:dao"})
public class RecuperationEnrollJoinUserImportServiceImpl extends BaseServiceImpl<RecuperationEnroll> implements RecuperationEnrollJoinUserImportService {
public RecuperationEnrollJoinUserImportServiceImpl(Dao dao) {
super(dao);
}
@Override
public List<?> selectLineAndTravelAgencyList(Integer year, String keyword) {
Sql sql = Sqls.create("""
SELECT
id,
lineName AS label,
'线路' AS `type`
FROM
the_rapy_recuperation_line
UNION ALL
SELECT
id,
travelAgencyName AS label,
'旅行社' AS `type`
FROM
the_rapy_recuperation_travel_agency
""");
return listMap(sql);
}
@Override
public Map<String, List<NutMap>> selectLineOrTravelAgency(Integer year) {
Sql lineSql = Sqls.create("""
SELECT
id,
lineName AS label
FROM
the_rapy_recuperation_line
WHERE
`year` = @year
AND createUnionId = @unionId
UNION
SELECT
line.id,
line.lineName AS label
FROM
the_rapy_recuperation_line_union_select lus
LEFT JOIN the_rapy_recuperation_line line ON line.id = lus.lineId\s
WHERE
line.`year` = @year
AND lus.unionId = @unionId
""");
lineSql.setParam("year", year);
lineSql.setParam("unionId", SecurityUtil.getUnionId());
Sql travelSql = Sqls.create("SELECT id,travelAgencyName AS label FROM the_rapy_recuperation_travel_agency where year = @year");
travelSql.setParam("year", year);
return Map.of("lines", listMap(lineSql), "travels", listMap(travelSql));
}
@Override
public List<RecuperationEnroll> matchEnrolls(List<RecuperationEnroll> rows, String lineId, String travelAgencyId) {
List<RecuperationEnroll> result = new ArrayList<>();
for (RecuperationEnroll row : rows) {
Cnd cnd = Cnd.where("loginName", "=", row.getLoginName());
cnd.andEX("takePartInLineId", "=", lineId);
cnd.andEX("takePartInTravelAgencyId", "=", travelAgencyId);
RecuperationEnroll enroll = fetch(cnd);
if (enroll != null) {
enroll.setTakePartInTime(row.getTakePartInTime());
result.add(enroll);
}
}
return result;
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void markParticipated(List<RecuperationEnroll> enrolls) {
for (RecuperationEnroll enroll : enrolls) {
enroll.setTakePartIn(true);
dao().updateIgnoreNull(enroll);
}
}
}
@@ -14,6 +14,7 @@ import com.budwk.app.zhgh.activity.basic.service.ActivityBasicScopeService;
import com.budwk.app.zhgh.staffbenefit.recuperation.constant.*;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.*;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationEnrollService;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationBaseManagerService;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationLineService;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
@@ -31,6 +32,7 @@ import org.nutz.lang.util.NutMap;
import java.time.LocalDate;
import java.time.Period;
import java.text.Collator;
import java.util.*;
import java.util.stream.Collectors;
@@ -44,10 +46,17 @@ import java.util.stream.Collectors;
@Slf4j
@IocBean(args = {"refer:dao"})
public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationEnroll> implements RecuperationEnrollService {
private static final ThreadLocal<Collator> NATURAL_SORT_COLLATOR = ThreadLocal.withInitial(() -> {
Collator collator = Collator.getInstance(Locale.CHINA);
collator.setStrength(Collator.PRIMARY);
return collator;
});
@Inject
private RecuperationLineService lineService;
@Inject
private RecuperationBaseManagerService baseManagerService;
@Inject
private ActivityBasicScopeService activityBasicScopeService;
public RecuperationEnrollServiceImpl(Dao dao) {
@@ -62,6 +71,7 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
@Override
public Pagination enrollPageData(PageForm pageForm, Integer year, String unionId, int trrt, Integer lineUnionType) {
Cnd cnd = Cnd.NEW();
int unionType = lineUnionType == null ? 1 : lineUnionType;
if (List.of(RecuperationType.provinceInLine.getValue(), RecuperationType.provinceOutLine.getValue()).contains(trrt)) {
Sql lineSql = Sqls.create("""
SELECT
@@ -70,7 +80,7 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
line.serialNumber,
line.lineName,
line.regionalNature,
us.minimumGroupSize,
COALESCE((SELECT outsideQuota FROM the_rapy_recuperation_config LIMIT 1), 0) AS minimumGroupSize,
line.`year`,
us.enable,
us.signUpStartTime,
@@ -80,30 +90,41 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
us.playEndTime,
us.signUpMode,
us.estimatedFamilyNumbers,
line.file AS fileId,
line.files AS fileId,
usgh.name AS usUnionName,
usgh.id AS takePartInUnionId,
u.username AS createUserName,
ta.travelAgencyName,
ta.contact,
ta.contactMobileNumber,
ta.contact,
ta.contactMobileNumber,
ta.maxSignUpNumber,
lot.lotName,
lot.lotValue,
lot.activityCost as lotActivityCost,
count(us.id) as playCount,
(select count(1) from recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as signUpUserNum,
(select count(1) from recuperation_enroll_companion where trreId in (select id from recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year)) as signUpUserFamilyNum,
(select ifnull(sum(familyNumber),0) from recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as familyNumber
(select count(distinct enroll.loginName)
from the_rapy_recuperation_enroll enroll
left join the_rapy_recuperation_line_union_select enrollUs on enrollUs.id = enroll.takePartInLineId
left join the_rapy_recuperation_line enrollLine on enrollLine.id = enrollUs.lineId
left join the_rapy_recuperation_base_management enrollBase on enrollBase.id = enroll.takePartInBaseManagementId
where (enroll.takePartInTravelAgencyId = ta.id
or IFNULL(NULLIF(enrollUs.travelAgencyId, ''), enrollLine.travelAgencyId) = ta.id
or enrollBase.travelAgencyId = ta.id)
and enroll.isNormal = true
and enroll.stateId not in (2715,2725,2735)
and YEAR(enroll.signingUptime)=@year) as travelAgencySignUpUserNum,
(select count(1) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as signUpUserNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year)) as signUpUserFamilyNum,
(select ifnull(sum(familyNumber),0) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as familyNumber
FROM
`recuperation_line_select` us
LEFT JOIN recuperation_line line ON line.id = us.lineId
LEFT JOIN recuperation_lot lot on lot.id = line.lotId
`the_rapy_recuperation_line_union_select` us
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
LEFT JOIN the_rapy_recuperation_lot lot on lot.id = line.lotId
LEFT JOIN sys_union usgh ON usgh.id = us.unionId
LEFT JOIN sys_user u ON u.id = line.opBy
LEFT JOIN recuperation_travel_agency ta ON ta.id = line.travelAgencyId
$lineCnd
group by lineId
ORDER BY lotValue desc, us.lineId, playStartTime ASC
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = IFNULL(NULLIF(us.travelAgencyId, ''), line.travelAgencyId)
$lineCnd
group by lineId
ORDER BY serialNumber ASC
""").setParam("year", DateUtil.thisYear());
Cnd lineCnd = Cnd.NEW();
lineCnd.and("line.isDisabled", "=", false);
@@ -111,56 +132,156 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
lineCnd.and("line.regionalNature", "=", RecuperationType.typeMap.get(trrt));
lineCnd.andEX("year(us.selectTime)", "=", year != null ? year : DateUtil.thisYear());
//本公会
if (lineUnionType == 1) {
if (unionType == 1) {
lineCnd.and("us.signUpMode", "=", RecuperationSignUpMode.UNION.getValue());
// lineCnd.and("us.isOpen", "=", true);
lineCnd.and("us.unionId", "=", unionId);
} else if (lineUnionType == 2) {
} else if (unionType == 2) {
lineCnd.and("us.signUpMode", "=", RecuperationSignUpMode.UNION.getValue());
lineCnd.and("us.isOpen", "=", true);
lineCnd.and("us.unionId", "=", unionId);
} else if (lineUnionType == 3) {
} else if (unionType == 3) {
//校工会
lineCnd.and("us.signUpMode", "=", RecuperationSignUpMode.FREE.getValue());
}
lineSql.setVar("lineCnd", lineCnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), lineSql);
return listNaturalNamePageMap(pageForm, lineSql, "lineName", "lineId");
} else if (RecuperationType.provinceInTravelAgency.getValue() == trrt) {
cnd.andEX("year", "=", year != null ? year : DateUtil.thisYear());
cnd.and("isDisabled", "=", false);
// 省内灵活组团按独立配置表展示报名记录继续保存旅行社 ID
cnd.and("fg.`year`", "=", year != null ? year : DateUtil.thisYear());
cnd.and("fg.isDisabled", "=", false);
cnd.and("ta.signUpTravelAgency", "=", true);
cnd.and("ta.isDisabled", "=", false);
Sql taSql = Sqls.create("""
select
*,
file as fileId
fg.id,
fg.groupName,
fg.travelAgencyId,
fg.days,
fg.signUpStartTime,
fg.signUpEndTime,
fg.changeEndTime,
fg.activityStartTime,
fg.activityEndTime,
fg.files as fileId,
fg.contactPerson,
fg.contactNumber,
fg.contactPerson2,
fg.contactNumber2,
fg.contactPerson3,
fg.contactNumber3,
ta.travelAgencyName,
ta.contact,
ta.contactMobileNumber,
ta.email,
ta.officialWebsite,
ta.maxSignUpNumber,
(select count(distinct enroll.loginName)
from the_rapy_recuperation_enroll enroll
where enroll.takePartInTravelAgencyId = fg.travelAgencyId
and enroll.isNormal = true
and enroll.stateId not in (2715,2725,2735)
and YEAR(enroll.signingUptime)=@year) as signUpUserNum
from
recuperation_travel_agency $condition
""");
the_rapy_recuperation_province_flexible_group fg
left join the_rapy_recuperation_travel_agency ta on ta.id = fg.travelAgencyId
$condition
""").setParam("year", year != null ? year : DateUtil.thisYear());
cnd.asc("fg.groupName").asc("fg.id");
taSql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), taSql);
return listNaturalNamePageMap(pageForm, taSql, "groupName", "id");
} else if (RecuperationType.provinceInHotel.getValue() == trrt) {
cnd.andEX("b.year", "=", year != null ? year : DateUtil.thisYear());
Integer queryYear = year != null ? year : DateUtil.thisYear();
cnd.andEX("b.year", "=", queryYear);
cnd.and("b.isDisabled", "=", false);
Sql taSql = Sqls.create("""
select
b.*,
b.file as fileId,
l.lotName,
t.travelAgencyName
b.files as fileId,
t.travelAgencyName,
t.maxSignUpNumber,
(select count(1) from the_rapy_recuperation_enroll
where takePartInBaseManagementId=b.id and isNormal=true
and stateId not in (2715,2725,2735)
and YEAR(signingUptime)=@year) as signUpUserNum
from
recuperation_base_management b
left join recuperation_lot l on l.id = b.lotId
left join recuperation_travel_agency t on t.id = b.travelAgencyId
the_rapy_recuperation_base_management b
left join the_rapy_recuperation_lot l on l.id = b.lotId
left join the_rapy_recuperation_travel_agency t on t.id = b.travelAgencyId
$condition
""");
cnd.asc("sortNumber");
""").setParam("year", queryYear);
cnd.asc("b.baseName").asc("b.id");
taSql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), taSql);
return listNaturalNamePageMap(pageForm, taSql, "baseName", "id");
}
return new Pagination();
}
/** 名称含字母或数字时先自然排序再分页,避免数据库字符串排序出现 10 排在 2 前。 */
@SuppressWarnings("unchecked")
private Pagination listNaturalNamePageMap(PageForm pageForm, Sql sql, String nameKey, String idKey) {
sql.setCallback(Sqls.callback.maps());
dao().execute(sql);
List<Map<String, Object>> list = new ArrayList<>((List<Map<String, Object>>) (List<?>) sql.getList(Map.class));
list.sort((left, right) -> {
int nameCompare = compareNaturalName(getMapValue(left, nameKey), getMapValue(right, nameKey));
return nameCompare != 0 ? nameCompare : compareNaturalName(getMapValue(left, idKey), getMapValue(right, idKey));
});
int pageNumber = pageForm.getPageNumber() == null || pageForm.getPageNumber() < 1 ? 1 : pageForm.getPageNumber();
int pageSize = pageForm.getPageSize() == null || pageForm.getPageSize() < 1 ? 10 : pageForm.getPageSize();
int totalCount = list.size();
int fromIndex = Math.min((pageNumber - 1) * pageSize, totalCount);
int toIndex = Math.min(fromIndex + pageSize, totalCount);
return new Pagination(pageNumber, pageSize, totalCount, new ArrayList<>(list.subList(fromIndex, toIndex)));
}
private String getMapValue(Map<String, Object> map, String key) {
Object value = map == null ? null : map.get(key);
return value == null ? "" : value.toString().trim();
}
private int compareNaturalName(String left, String right) {
int leftIndex = 0;
int rightIndex = 0;
while (leftIndex < left.length() && rightIndex < right.length()) {
char leftChar = left.charAt(leftIndex);
char rightChar = right.charAt(rightIndex);
if (Character.isDigit(leftChar) && Character.isDigit(rightChar)) {
String leftNumber = readPart(left, leftIndex, true);
String rightNumber = readPart(right, rightIndex, true);
int numberCompare = compareNumberPart(leftNumber, rightNumber);
if (numberCompare != 0) return numberCompare;
leftIndex += leftNumber.length();
rightIndex += rightNumber.length();
} else {
String leftText = readPart(left, leftIndex, false);
String rightText = readPart(right, rightIndex, false);
int textCompare = NATURAL_SORT_COLLATOR.get().compare(leftText.toLowerCase(Locale.ROOT), rightText.toLowerCase(Locale.ROOT));
if (textCompare != 0) return textCompare;
leftIndex += leftText.length();
rightIndex += rightText.length();
}
}
return Integer.compare(left.length(), right.length());
}
private String readPart(String value, int startIndex, boolean digit) {
int endIndex = startIndex;
while (endIndex < value.length() && Character.isDigit(value.charAt(endIndex)) == digit) endIndex++;
return value.substring(startIndex, endIndex);
}
private int compareNumberPart(String left, String right) {
String leftValue = left.replaceFirst("^0+(?!$)", "");
String rightValue = right.replaceFirst("^0+(?!$)", "");
if (leftValue.length() != rightValue.length()) return Integer.compare(leftValue.length(), rightValue.length());
int compare = leftValue.compareTo(rightValue);
return compare != 0 ? compare : Integer.compare(left.length(), right.length());
}
@Override
public List<NutMap> getSelectLineById(String lineId, String unionId, int trrt, Integer lineUnionType) {
int unionType = lineUnionType == null ? 1 : lineUnionType;
Sql lineSql = Sqls.create("""
SELECT
us.id as usId,
@@ -179,7 +300,7 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
us.signUpMode,
us.estimatedFamilyNumbers,
line.files,
line.file AS fileId,
line.files AS fileId,
usgh.name AS usUnionName,
usgh.id AS takePartInUnionId,
u.username AS createUserName,
@@ -189,16 +310,16 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
lot.lotName,
lot.lotValue,
lot.activityCost as lotActivityCost,
(select count(1) from recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as signUpUserNum,
(select count(1) from recuperation_enroll_companion where trreId in (select id from recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year)) as signUpUserFamilyNum,
(select ifnull(sum(familyNumber),0) from recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as familyNumber
(select count(1) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as signUpUserNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year)) as signUpUserFamilyNum,
(select ifnull(sum(familyNumber),0) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as familyNumber
FROM
`recuperation_line_select` us
LEFT JOIN recuperation_line line ON line.id = us.lineId
LEFT JOIN recuperation_lot lot on lot.id = line.lotId
`the_rapy_recuperation_line_union_select` us
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
LEFT JOIN the_rapy_recuperation_lot lot on lot.id = line.lotId
LEFT JOIN sys_union usgh ON usgh.id = us.unionId
LEFT JOIN sys_user u ON u.id = line.opBy
LEFT JOIN recuperation_travel_agency ta ON ta.id = line.travelAgencyId
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = line.travelAgencyId
$lineCnd
ORDER BY us.lineId, playStartTime ASC
""").setParam("lineId", lineId).setParam("year", DateUtil.thisYear());
@@ -208,15 +329,15 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
lineCnd.and("year(us.selectTime)", "=", DateUtil.thisYear());
lineCnd.and("line.regionalNature", "=", RecuperationType.typeMap.get(trrt));
//本公会
if (lineUnionType == 1) {
if (unionType == 1) {
lineCnd.and("us.signUpMode", "=", RecuperationSignUpMode.UNION.getValue());
// lineCnd.and("us.isOpen", "=", true);
lineCnd.and("us.unionId", "=", unionId);
} else if (lineUnionType == 2) {
} else if (unionType == 2) {
lineCnd.and("us.signUpMode", "=", RecuperationSignUpMode.UNION.getValue());
lineCnd.and("us.isOpen", "=", true);
lineCnd.and("us.unionId", "=", unionId);
} else if (lineUnionType == 3) {
} else if (unionType == 3) {
//校工会
lineCnd.and("us.signUpMode", "=", RecuperationSignUpMode.FREE.getValue());
}
@@ -233,17 +354,23 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
@Aop(TransAop.READ_COMMITTED)
public void doSignUpForLine(RecuperationEnroll enrollInfo) {
RecuperationLineSelect lineUnionSelect = dao().fetch(RecuperationLineSelect.class, enrollInfo.getTakePartInLineId());
if (lineUnionSelect == null) {
throw new IllegalArgumentException("线路选择记录不存在");
}
RecuperationLine lineInfo = dao().fetch(RecuperationLine.class, lineUnionSelect.getLineId());
if (lineInfo == null) {
throw new IllegalArgumentException("线路信息不存在");
}
Sys_user user = dao().fetch(Sys_user.class, SecurityUtil.getUserId());
Sys_user user = getCurrentUserWithOrg();
enrollInfo.setLoginName(user.getLoginname());
enrollInfo.setUserName(user.getUsername());
enrollInfo.setSex(user.getSex());
enrollInfo.setUnitName(user.getUnit().getName());
enrollInfo.setUnionName(SecurityUtil.getUnionId());
enrollInfo.setSelfUnionId(user.getUnion().getId());
enrollInfo.setSelfUnitId(SecurityUtil.getUnitId());
enrollInfo.setUnionName(user.getUnion() == null ? "" : user.getUnion().getName());
enrollInfo.setSelfUnionId(SecurityUtil.getUnionId());
enrollInfo.setSelfUnitId(user.getUnitId());
enrollInfo.setSigningUptime(new Date());
enrollInfo.setTakePartIn(false);
enrollInfo.setNormal(true);
@@ -277,8 +404,14 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
enrollInfo.setStateId(RecuperationState.PASS);
}
if (recuperationConfig.getBedInfo() || recuperationConfig.getFamilyInfo() == 2) {
if (enrollInfo.getCompanionList() == null) {
enrollInfo.setCompanionList(Collections.emptyList());
}
if (Boolean.TRUE.equals(recuperationConfig.getBedInfo()) || Integer.valueOf(2).equals(recuperationConfig.getFamilyInfo())) {
for (RecuperationEnrollCompanion RecuperationEnrollCompanion : enrollInfo.getCompanionList()) {
if (RecuperationEnrollCompanion.getBedInfo() == null) {
RecuperationEnrollCompanion.setBedInfo(new RecuperationEnrollBed());
}
insertLinks(RecuperationEnrollCompanion, "bedInfo");
}
insertWith(enrollInfo, "companionList|bedInfo");
@@ -334,14 +467,15 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
* @param enrollInfo 登记信息
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public void doSignUpForTravelAgency(RecuperationEnroll enrollInfo) {
Sys_user user = dao().fetch(Sys_user.class, SecurityUtil.getUserId());
Sys_user user = getCurrentUserWithOrg();
enrollInfo.setLoginName(user.getLoginname());
enrollInfo.setUserName(user.getUsername());
enrollInfo.setSex(user.getSex());
enrollInfo.setUnitName(user.getUnit().getName());
enrollInfo.setUnionName(user.getUnion().getName());
enrollInfo.setSelfUnionId(user.getUnion().getId());
enrollInfo.setUnionName(user.getUnion() == null ? "" : user.getUnion().getName());
enrollInfo.setSelfUnionId(SecurityUtil.getUnionId());
enrollInfo.setSelfUnitId(user.getUnitId());
enrollInfo.setSigningUptime(new Date());
enrollInfo.setTakePartIn(false);
@@ -355,21 +489,28 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
* @param enrollInfo 登记信息
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public void doSignUpForHotel(RecuperationEnroll enrollInfo) {
Sys_user user = dao().fetch(Sys_user.class, SecurityUtil.getUserId());
Sys_user user = getCurrentUserWithOrg();
enrollInfo.setLoginName(user.getLoginname());
enrollInfo.setUserName(user.getUsername());
enrollInfo.setSex(user.getSex());
enrollInfo.setUnitName(user.getUnit().getName());
enrollInfo.setUnionName(user.getUnion().getName());
enrollInfo.setSelfUnionId(user.getUnion().getId());
enrollInfo.setUnionName(user.getUnion() == null ? "" : user.getUnion().getName());
enrollInfo.setSelfUnionId(SecurityUtil.getUnionId());
enrollInfo.setSelfUnitId(user.getUnitId());
enrollInfo.setSigningUptime(new Date());
enrollInfo.setTakePartIn(false);
enrollInfo.setNormal(true);
enrollInfo.setStateId(RecuperationState.PASS);
if (enrollInfo.getCompanionList() == null) {
enrollInfo.setCompanionList(Collections.emptyList());
}
for (RecuperationEnrollCompanion RecuperationEnrollCompanion : enrollInfo.getCompanionList()) {
if (RecuperationEnrollCompanion.getBedInfo() == null) {
RecuperationEnrollCompanion.setBedInfo(new RecuperationEnrollBed());
}
insertLinks(RecuperationEnrollCompanion, "bedInfo");
}
insertWith(enrollInfo, "companionList|bedInfo");
@@ -403,10 +544,29 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
* @param enrollInfo 登记信息
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public void updateSignUpTravelAgency(RecuperationEnroll enrollInfo) {
updateIgnoreNull(enrollInfo);
}
/**
* 获取当前用户及其单位工会信息Sys_user union 不是 Nutz 关联字段需按会话工会 ID 单独查询
*/
private Sys_user getCurrentUserWithOrg() {
Sys_user user = dao().fetch(Sys_user.class, SecurityUtil.getUserId());
if (user == null) {
throw new IllegalStateException("当前登录用户不存在");
}
dao().fetchLinks(user, "unit");
if (user.getUnit() == null) {
throw new IllegalStateException("当前用户未关联单位,无法报名");
}
if (StrUtil.isNotBlank(SecurityUtil.getUnionId())) {
user.setUnion(dao().fetch(Sys_union.class, SecurityUtil.getUnionId()));
}
return user;
}
/**
* 验证报名登记信息
*
@@ -419,8 +579,14 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
//配置信息
RecuperationConfig config = dao().fetch(RecuperationConfig.class);
if (config == null) {
return Map.of(false, "疗休养配置不存在");
}
Sys_user user = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", loginName));
if (user == null) {
return Map.of(false, "当前登录用户不存在");
}
//判断是否在报名范围内
if (!activityBasicScopeService.isUserInGroup(config.getActivityGroupId(), user.getId())) {
return Map.of(false, "抱歉,您不在报名范围内!");
@@ -441,11 +607,20 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
//线路信息
RecuperationLineSelect lineUnionSelect = dao().fetch(RecuperationLineSelect.class, enrollInfo.getTakePartInLineId());
if (lineUnionSelect == null) {
return Map.of(false, "线路选择记录不存在");
}
RecuperationLine lineInfo = dao().fetch(RecuperationLine.class, lineUnionSelect.getLineId());
if (lineInfo == null) {
return Map.of(false, "线路信息不存在");
}
Date signUpStartTime = lineUnionSelect.getSignUpStartTime();
Date signUpEndTime = lineUnionSelect.getSignUpEndTime();
Date changeEndTime = lineUnionSelect.getChangeEndTime();
if (signUpStartTime == null || signUpEndTime == null || changeEndTime == null) {
return Map.of(false, "线路报名时间配置不完整");
}
//线路人数省外线路最多报名数
// Integer estimatedFamilyNumbers = lineUnionSelect.getEstimatedFamilyNumbers();
Integer estimatedFamilyNumbers = config.getOutsideQuota();
@@ -457,23 +632,22 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
}
RecuperationType trrt = regionTypeLineMap.get(lineInfo.getRegionalNature());
if (trrt == null) {
return Map.of(false, "线路区域类型配置错误");
}
if (StrUtil.isBlank(enrollInfo.getId()) && StrUtil.isNotBlank(enrollInfo.getTakePartInLineId())) {
//2025-05-20 临时增加的代码
Record tempRecord = dao().fetch("recuperation_temp", Cnd.where("loginname", "=", loginName));
if(tempRecord != null) {
if(tempRecord.getInt("flag") != trrt.getValue()) {
return Map.of(false, "您只能报名" + tempRecord.getString("type") + "线路");
}
}
//获取标段中的最大费用
List<RecuperationLot> lotList = dao().query(RecuperationLot.class, Cnd.NEW());
//最大费用
OptionalInt optionalInt = lotList.stream().mapToInt(RecuperationLot::getActivityCost).max();
int maxCost = optionalInt.isPresent() ? optionalInt.getAsInt() : 0;
//获取当前报名线路对应的标段的费用
Integer currentLineCost = dao().fetch(RecuperationLot.class, lineInfo.getLotId()).getActivityCost();
RecuperationLot currentLot = dao().fetch(RecuperationLot.class, lineInfo.getLotId());
if (currentLot == null || currentLot.getActivityCost() == null) {
return Map.of(false, "线路标段费用配置不完整");
}
Integer currentLineCost = currentLot.getActivityCost();
//省外线路判断报名人数
if (trrt.getValue() == RecuperationType.provinceOutLine.getValue() && estimatedFamilyNumbers != null) {
@@ -488,11 +662,11 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
SELECT
r.*,
l.regionalNature,
(select activityCost from recuperation_lot where id = l.lotId) as activityCost
(select activityCost from the_rapy_recuperation_lot where id = l.lotId) as activityCost
FROM
recuperation_enroll r
LEFT JOIN recuperation_line_select us on us.id = r.takePartInLineId
LEFT JOIN recuperation_line l ON l.id = us.lineId
the_rapy_recuperation_enroll r
LEFT JOIN the_rapy_recuperation_line_union_select us on us.id = r.takePartInLineId
LEFT JOIN the_rapy_recuperation_line l ON l.id = us.lineId
$condition
""");
Sql twoYearInSql = sql;
@@ -622,6 +796,55 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
return Map.of(true, "验证成功");
}
@Override
public Map<Boolean, String> validSubmitQuota(RecuperationEnroll enrollInfo) {
if (enrollInfo == null) {
return Map.of(false, "报名参数不完整");
}
if (StrUtil.isNotBlank(enrollInfo.getTakePartInLineId())) {
return lineService.validLineQuota(enrollInfo.getTakePartInLineId(), enrollInfo.getId());
}
if (StrUtil.isNotBlank(enrollInfo.getTakePartInBaseManagementId())) {
return baseManagerService.validBaseManagementQuota(enrollInfo.getTakePartInBaseManagementId(), enrollInfo.getId());
}
if (StrUtil.isBlank(enrollInfo.getTakePartInTravelAgencyId())) {
return Map.of(false, "报名项目不存在");
}
RecuperationTravelAgency agency = dao().fetch(RecuperationTravelAgency.class, enrollInfo.getTakePartInTravelAgencyId());
if (agency == null) {
return Map.of(false, "旅行社信息不存在");
}
if (agency.getMaxSignUpNumber() == null || agency.getMaxSignUpNumber() <= 0) {
return Map.of(true, "验证成功");
}
Sql sql = Sqls.create("""
SELECT count(distinct enroll.loginName)
FROM the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select enrollUs ON enrollUs.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line enrollLine ON enrollLine.id = enrollUs.lineId
LEFT JOIN the_rapy_recuperation_base_management enrollBase ON enrollBase.id = enroll.takePartInBaseManagementId
WHERE (enroll.takePartInTravelAgencyId = @agencyId
OR IFNULL(NULLIF(enrollUs.travelAgencyId, ''), enrollLine.travelAgencyId) = @agencyId
OR enrollBase.travelAgencyId = @agencyId)
AND enroll.isNormal = true
AND enroll.stateId NOT IN ($auditFailStates)
AND YEAR(enroll.signingUptime) = @year
$excludeEnrollCnd
""");
sql.setParam("agencyId", agency.getId());
sql.setParam("year", agency.getYear() == null ? DateUtil.thisYear() : agency.getYear());
sql.setVar("auditFailStates", RecuperationState.UNITFAIL + "," + RecuperationState.LINEUNITFAIL + "," + RecuperationState.SCHOOLFAIL);
sql.setVar("excludeEnrollCnd", StrUtil.isBlank(enrollInfo.getId()) ? "" : "AND enroll.id != @excludeEnrollId");
if (StrUtil.isNotBlank(enrollInfo.getId())) {
sql.setParam("excludeEnrollId", enrollInfo.getId());
}
sql.setCallback(Sqls.callback.integer());
dao().execute(sql);
return sql.getInt() >= agency.getMaxSignUpNumber()
? Map.of(false, "当前旅行社报名人数已满")
: Map.of(true, "验证成功");
}
public Map<Boolean, String> validSignCount(RecuperationEnroll enrollInfo, RecuperationConfig config, int estimatedFamilyNumbers, String type) {
int hasSignNumber = 0;//已经报名的人数
int currentSignNumber = 1;//当前报名人数1表示自己下面的if是加家属人数
@@ -665,22 +888,22 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
List<RecuperationLine> inList = dao().query(RecuperationLine.class, Cnd.where("regionalNature", "=", "省内"));
List<RecuperationLine> outList = dao().query(RecuperationLine.class, Cnd.where("regionalNature", "=", "省外"));
//是否选择省外
int inCount = dao().count("recuperation_enroll", Cnd.where("loginName", "=", SecurityUtil.getUserLoginname())
int inCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", SecurityUtil.getUserLoginname())
.and("takePartInLineId", "in", inList.stream().map(RecuperationLine::getId).collect(Collectors.toList()))
.and("isNormal", "=", true)
.and("YEAR(signingUptime)", "=", DateUtil.thisYear()));
//是否报省外
int outCount = dao().count("recuperation_enroll", Cnd.where("loginName", "=", SecurityUtil.getUserLoginname())
int outCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", SecurityUtil.getUserLoginname())
.and("takePartInLineId", "in", outList.stream().map(RecuperationLine::getId).collect(Collectors.toList()))
.and("isNormal", "=", true)
.and("YEAR(signingUptime)", "=", DateUtil.thisYear()));
//是否报旅行社
int travelCount = dao().count("recuperation_enroll", Cnd.where("loginName", "=", SecurityUtil.getUserLoginname())
int travelCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", SecurityUtil.getUserLoginname())
.and("takePartInLineId", "is", null).and("isNormal", "=", true)
.and("takePartInTravelAgencyId", "is not", null)
.and("YEAR(signingUptime)", "=", DateUtil.thisYear()));
//是否报酒店
int hotelCount = dao().count("recuperation_enroll", Cnd.where("loginName", "=", SecurityUtil.getUserLoginname())
int hotelCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", SecurityUtil.getUserLoginname())
.and("takePartInLineId", "is", null).and("isNormal", "=", true)
.and("takePartInBaseManagementId", "is not", null)
.and("YEAR(signingUptime)", "=", DateUtil.thisYear()));
@@ -706,8 +929,8 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
SELECT
count(*)
FROM
recuperation_enroll ren
LEFT JOIN recuperation_line rl on ren.takePartInLineId = rl.id
the_rapy_recuperation_enroll ren
LEFT JOIN the_rapy_recuperation_line rl on ren.takePartInLineId = rl.id
$condition
""");
@@ -763,7 +986,7 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
us.playStartTime,
us.playEndTime,
us.signUpMode,
line.file AS fileId,
line.files AS fileId,
gh.name AS signUpUnionName,
ta.travelAgencyName,
ta.contact,
@@ -772,13 +995,13 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
GROUP_CONCAT(ec.userName) as companionUserNames,
l.lotName
FROM
recuperation_enroll e
the_rapy_recuperation_enroll e
LEFT JOIN sys_union gh ON gh.id = e.takePartInUnionId
LEFT JOIN recuperation_line_select us on us.id = e.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = us.lineId
LEFT JOIN recuperation_travel_agency ta ON ta.id = line.travelAgencyId
left join recuperation_enroll_companion ec on ec.trreId = e.id
left join recuperation_lot l on l.id = line.lotId
LEFT JOIN the_rapy_recuperation_line_union_select us on us.id = e.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = line.travelAgencyId
left join the_rapy_recuperation_enroll_companion ec on ec.trreId = e.id
left join the_rapy_recuperation_lot l on l.id = line.lotId
$condition
GROUP BY e.id
""");
@@ -798,10 +1021,10 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
ta.contact,
ta.contactMobileNumber,
ta.officialWebsite,
ta.file AS fileId
ta.files AS fileId
FROM
recuperation_enroll e
LEFT JOIN recuperation_travel_agency ta ON ta.id = e.takePartInTravelAgencyId
the_rapy_recuperation_enroll e
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = e.takePartInTravelAgencyId
$condition
""");
cnd.and("e.takePartInTravelAgencyId", "is not", null);
@@ -818,16 +1041,16 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
ta.baseName,
ta.baseContactPerson,
ta.baseContactNumber,
ta.file AS fileId,
ta.files AS fileId,
l.lotName,
ta.regionalNature,
t.travelAgencyName,
ta.changeEndTime
FROM
recuperation_enroll e
LEFT JOIN recuperation_base_management ta ON ta.id = e.takePartInBaseManagementId
LEFT JOIN recuperation_lot l on l.id = ta.lotId
LEFT JOIN recuperation_travel_agency t on t.id = ta.travelAgencyId
the_rapy_recuperation_enroll e
LEFT JOIN the_rapy_recuperation_base_management ta ON ta.id = e.takePartInBaseManagementId
LEFT JOIN the_rapy_recuperation_lot l on l.id = ta.lotId
LEFT JOIN the_rapy_recuperation_travel_agency t on t.id = ta.travelAgencyId
$condition
""");
cnd.and("e.takePartInBaseManagementId", "is not", null);
@@ -858,7 +1081,9 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
@Aop(TransAop.READ_COMMITTED)
public void deleteMyEnrollInfoById(String id) {
RecuperationEnroll enrollInfo = fetch(id);
RecuperationLineSelect lineUnionSelect = dao().fetch(RecuperationLineSelect.class, enrollInfo.getTakePartInLineId());
if (enrollInfo == null) {
return;
}
dao().clearLinks(enrollInfo, "companionList|bedInfo");
delete(id);
dao().clear(RecuperationEnrollChangeRecord.class, Cnd.where("enrollId", "=", id));
@@ -893,18 +1118,18 @@ public class RecuperationEnrollServiceImpl extends BaseServiceImpl<RecuperationE
us.estimatedFamilyNumbers,
line.content,
l.lotName,
(select COUNT(1) FROM recuperation_enroll en WHERE isNormal=true AND en.loginName=@loginname and YEAR(en.signingUptime)=@year) isNormal,
(select COUNT(1) FROM recuperation_enroll en WHERE isNormal=false AND en.loginName=@loginname and YEAR(en.signingUptime)=@year) isNormalFalse,
(select count(1) from recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and YEAR(signingUptime)=@year) as signUpUserNum,
(select count(1) from recuperation_enroll_companion where trreId in (select id from recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and YEAR(signingUptime)=@year)) as signUpUserFamilyNum,
(select ifnull(sum(familyNumber),0) from recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as familyNumber,
(select COUNT(1) FROM the_rapy_recuperation_enroll en WHERE isNormal=true AND en.loginName=@loginname and YEAR(en.signingUptime)=@year) isNormal,
(select COUNT(1) FROM the_rapy_recuperation_enroll en WHERE isNormal=false AND en.loginName=@loginname and YEAR(en.signingUptime)=@year) isNormalFalse,
(select count(1) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and YEAR(signingUptime)=@year) as signUpUserNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and YEAR(signingUptime)=@year)) as signUpUserFamilyNum,
(select ifnull(sum(familyNumber),0) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as familyNumber,
ta.travelAgencyName,
ta.contactMobileNumber
FROM
`recuperation_line_select` us
LEFT JOIN recuperation_line line ON line.id = us.lineId
LEFT JOIN recuperation_travel_agency ta on ta.id = line.travelAgencyId
LEFT JOIN recuperation_lot l on l.id = line.lotId
`the_rapy_recuperation_line_union_select` us
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
LEFT JOIN the_rapy_recuperation_travel_agency ta on ta.id = line.travelAgencyId
LEFT JOIN the_rapy_recuperation_lot l on l.id = line.lotId
WHERE if(us.signUpMode = 1, us.unionId = @usUnionId, 1=1) AND us.id = @id
""");
usLineSql.setParam("loginname", SecurityUtil.getUserLoginname());
@@ -0,0 +1,166 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service.impl;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.zhgh.staffbenefit.recuperation.constant.RecuperationState;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationEnroll;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationLineAdjustmentService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Chain;
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.loader.annotation.IocBean;
import org.nutz.ioc.aop.Aop;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import java.util.List;
/**
* @FileName com.budwk.app.zhgh.staffbenefit.recuperation.service.impl.RecuperationLineAdjustmentServiceImpl
* @Description: TODO
* @Author zxc
* @Date 2022/6/10:10:04
* @Version V1.0
**/
@IocBean(args = {"refer:dao"})
public class RecuperationLineAdjustmentServiceImpl extends BaseServiceImpl<RecuperationEnroll> implements RecuperationLineAdjustmentService {
public RecuperationLineAdjustmentServiceImpl(Dao dao) {
super(dao);
}
@Override
public Pagination pageData(PageForm pageForm, Integer year, String lineId, String unionId, String keywords, String regionalNature, String lotId) {
Sql sql = Sqls.create("""
SELECT
line.id,
line.serialNumber,
line.lineName,
line.regionalNature,
COALESCE((SELECT outsideQuota FROM the_rapy_recuperation_config LIMIT 1), 0) AS minimumGroupSize,
line.`year`,
line.isDisabled,
line.playNumberOfDays,
line.createUnionId,
line.signUpStartTime,
line.signUpEndTime,
line.changeEndTime,
line.signUpMode,
line.createMode,
us.id as usId,
us.playStartTime,
us.playEndTime,
line.files AS fileId,
create_gh.name AS createUnionName,
ta.travelAgencyName,
us.unionId,
select_gh.name AS selectUnionName,
(select count(DISTINCT loginName) from the_rapy_recuperation_enroll where if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) AND takePartInLineId = us.id and isNormal=true and stateId=2750 and YEAR(signingUptime)=@year) as signUpUserNum,
IF(
COALESCE((SELECT familyInfo FROM the_rapy_recuperation_config LIMIT 1), 1) = 2,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) AND takePartInLineId = us.id and isNormal=true and stateId=2750 and YEAR(signingUptime)=@year)),
(select ifnull(sum(familyNumber),0) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId=2750 and YEAR(signingUptime)=@year)
) as signUpUserFamilyNum
FROM
the_rapy_recuperation_line_union_select us
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = line.travelAgencyId
LEFT JOIN sys_union create_gh ON create_gh.id = line.createUnionid
LEFT JOIN sys_union select_gh ON select_gh.id = us.unionId
$condition
""");
sql.setParam("signUpSuccessCode", RecuperationState.PASS);
sql.setParam("year", year);
Cnd cnd = Cnd.NEW();
cnd.andEX("line.regionalNature","=",regionalNature);
cnd.andEX("line.lotId", "=", lotId);
//cnd.and("line.signUpMode", "=", RecuperationSignUpMode.UNION.getValue());
cnd.and("us.playStartTime", "is not", null);
//cnd.andEX("line.year", "=", year);
cnd.andEX("line.id", "=", lineId);
if (AuthUtil.hasRoleOr("sysadmin", "A06")) {
cnd.andEX("us.unionId", "=", unionId);
cnd.andEX("us.signUpMode", "=", Strings.isNotBlank(unionId) ? 1 : 2);
} else {
cnd.and("us.unionId", "=", SecurityUtil.getUnionId());
cnd.and("us.signUpMode", "=", 1);
}
if (StrUtil.isNotBlank(keywords)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("line.lineName", keywords);
seg.orLike("line.serialNumber", keywords);
cnd.and(seg);
}
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy());
}
cnd.and("year(selectTime)", "=", year);
sql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@Override
public List findUnionSignUpModeUserList(String lineId, String unionId) {
Sql sql = Sqls.create("""
SELECT
e.id,
e.loginName,
e.userName,
e.sex,
e.unitName,
e.unionName,
e.signingUptime,
e.isNormal,
count(c.id) as companionCount,
e.familyNumber
FROM
the_rapy_recuperation_enroll e
LEFT JOIN the_rapy_recuperation_enroll_companion c ON c.trreId = e.id
left join the_rapy_recuperation_line_union_select us on e.takePartInLineId = us.id
WHERE
e.takePartInLineId = @lineId
and if(us.signUpMode = 1, e.takePartInUnionId = @unionId, 1=1)
GROUP BY e.id
""");
// AND (e.stateId = @passStateCode or e.stateId is null)
sql.setParam("lineId", lineId);
sql.setParam("unionId", unionId);
sql.setParam("passStateCode", RecuperationState.PASS);
List<NutMap> list = listMap(sql);
for (NutMap rowMap : list) {
Sql companionSql = Sqls.create("select loginName,userName,sex,relation,idCard from the_rapy_recuperation_enroll_companion where trreId=@trreId");
companionSql.setParam("trreId", rowMap.getString("id"));
List companionList = listMap(companionSql);
rowMap.setv("companionList", companionList);
}
return list;
}
@Override
public List<?> findLineOptions(Integer year) {
Sql sql = Sqls.create("select id,lineName from the_rapy_recuperation_line $condition");
Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year);
cnd.and("isDisabled", "=", false);
cnd.asc("serialNumber");
sql.setCondition(cnd);
return listMap(sql);
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void adjustmentUsers(String lineId, String[] loginNames) {
Cnd cnd = Cnd.where("takePartInLineId", "=", lineId).and("loginName", "in", loginNames);
dao().update(RecuperationEnroll.class, Chain.makeSpecial("isNormal", "isNormal ^ 1"), cnd);
}
}
@@ -0,0 +1,263 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service.impl;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.zhgh.staffbenefit.recuperation.constant.RecuperationState;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationCluster;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationClusterMember;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationLineClusterService;
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.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @FileName com.budwk.app.zhgh.staffbenefit.recuperation.service.impl.RecuperationLineClusterServiceImpl
* @Description: 组团
* @Author zxc
* @Date 2022/6/17:09:04
* @Version V1.0
**/
@IocBean(args = {"refer:dao"})
public class RecuperationLineClusterServiceImpl extends BaseServiceImpl<RecuperationCluster> implements RecuperationLineClusterService {
public RecuperationLineClusterServiceImpl(Dao dao) {
super(dao);
}
/**
* 页面数据
*
* @param pageForm 分页参数
* @param year 年度
* @param unionId 工会id
* @param keywords 关键字
* @return {@link Pagination}
*/
@Override
public Pagination pageData(PageForm pageForm, Integer year, String unionId, String keywords) {
// Sql sql = Sqls.create("""
// SELECT
// line.id,
// line.serialNumber,
// line.lineName,
// line.regionalNature,
// line.minimumGroupSize,
// line.`year`,
// line.isDisabled,
// line.playNumberOfDays,
// line.createUnionId,
// line.signUpStartTime,
// line.signUpEndTime,
// line.changeEndTime,
// line.createMode,
// line.signUpMode,
// gh.unionname AS ascriptionUnionName,
// gh.id AS ascriptionUnionId,
// u.username AS createUserName,
// ta.travelAgencyName,
// ( SELECT count( 1 ) FROM the_rapy_recuperation_enroll WHERE takePartInUnionId = us.unionId AND takePartInLineId = line.id AND stateId = 2750 ) AS signUpUserNum,
// (
// SELECT
// count( 1 )\s
// FROM
// the_rapy_recuperation_enroll_companion\s
// WHERE
// trreId IN ( SELECT id FROM the_rapy_recuperation_enroll WHERE takePartInUnionId = us.unionId AND takePartInLineId = line.id AND stateId = 2750 )) AS signUpUserFamilyNum\s
// FROM
// the_rapy_recuperation_line_union_select us
// LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
// LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = line.travelAgencyId
// LEFT JOIN sys_union gh ON gh.id = us.unionId
// LEFT JOIN sys_user u ON u.id = line.opBy
// $usCnd
// UNION ALL
// (SELECT
// line.id,
// line.serialNumber,
// line.lineName,
// line.regionalNature,
// line.minimumGroupSize,
// line.`year`,
// line.isDisabled,
// line.playNumberOfDays,
// line.createUnionId,
// line.signUpStartTime,
// line.signUpEndTime,
// line.changeEndTime,
// line.createMode,
// line.signUpMode,
// gh.unionname AS ascriptionUnionName,
// gh.id AS ascriptionUnionId,
// u.username AS createUserName,
// ta.travelAgencyName,
// ( SELECT count( 1 ) FROM the_rapy_recuperation_enroll WHERE takePartInUnionId = line.createUnionId AND takePartInLineId = line.id AND stateId = 2750 ) AS signUpUserNum,
// (
// SELECT
// count( 1 )
// FROM
// the_rapy_recuperation_enroll_companion
// WHERE
// trreId IN ( SELECT id FROM the_rapy_recuperation_enroll WHERE takePartInUnionId = line.createUnionId AND takePartInLineId = line.id AND stateId = 2750 )) AS signUpUserFamilyNum
// FROM
// the_rapy_recuperation_line line
// LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = line.travelAgencyId
// LEFT JOIN sys_union gh ON gh.id = line.createUnionid
// LEFT JOIN sys_user u ON u.id = line.opBy
// $lineCnd)
// """);
// Cnd lineCnd = Cnd.NEW();
// //如果是超管 前端传工会id 就不查自由模式的线路 只查线路归属分工会的线路
// //如果是分工会管理员 不查不查自由模式的线路 由校工会去组团
// if (AuthUtil.hasRoleOr("sysadmin,A06")) {
// if (StrUtil.isNotBlank(unionId)) {
// sql.setVar("lineCnd", Cnd.where("1", "!=", "1"));
// } else {
// lineCnd.andEX("line.year", "=", year);
// lineCnd.andEX("line.createMode", "=", RecuperationLineCreateMode.SCHOOL.getValue());
// lineCnd.andEX("line.signUpMode", "=", RecuperationSignUpMode.FREE.getValue());
// lineCnd.and(Cnd.likeEX("line.lineName", keywords));
// sql.setVar("lineCnd", lineCnd);
// }
// } else {
// sql.setVar("lineCnd", Cnd.where("1", "!=", "1"));
// }
//
// Cnd usCnd = Cnd.NEW();
// usCnd.andEX("line.year", "=", year);
// usCnd.andEX("line.signUpMode", "=", RecuperationSignUpMode.UNION.getValue());
// usCnd.and(Cnd.likeEX("line.lineName", keywords));
// usCnd.andEX("us.unionId", "=", unionId);
//
// //如果只是分工会管理员 us表只查询自己选择的线路
// if (!AuthUtil.hasRoleOr("sysadmin")) {
// usCnd.andEX("us.unionId", "=", SecurityUtil.getUnionId());
// }
//
// sql.setVar("usCnd", usCnd);
Sql sql = Sqls.create("""
SELECT
line.id,
line.serialNumber,
line.lineName,
line.regionalNature,
COALESCE((SELECT outsideQuota FROM the_rapy_recuperation_config LIMIT 1), 0) AS minimumGroupSize,
line.`year`,
line.isDisabled,
line.createUnionId,
us.signUpStartTime,
us.signUpEndTime,
us.changeEndTime,
us.playStartTime,
us.playEndTime,
line.createMode,
line.signUpMode,
gh.name AS ascriptionUnionName,
gh.id AS ascriptionUnionId,
u.username AS createUserName,
ta.travelAgencyName,
( SELECT count( 1 ) FROM the_rapy_recuperation_enroll $summaryCnd ) AS signUpUserNum,
( SELECT count( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId IN ( SELECT id FROM the_rapy_recuperation_enroll $summaryCnd )) AS signUpUserFamilyNum
FROM
the_rapy_recuperation_line_union_select us
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = line.travelAgencyId
LEFT JOIN sys_union gh ON gh.id = us.unionId
LEFT JOIN sys_user u ON u.id = line.opBy
$condition
""");
Cnd cnd = Cnd.NEW();
Cnd summaryCnd = Cnd.NEW();
summaryCnd.and("isNormal", "=", true);
summaryCnd.and("takePartInLineId", "=", "us.id");
summaryCnd.and("stateId", "=", RecuperationState.PASS);
//如果是超级管理和校工会管理员查看校工会线路
if (AuthUtil.hasRoleOr("sysadmin,A06")) {
cnd.andEX("us.unionId", "=", unionId);
cnd.andEX("us.signUpMode", "=", Strings.isNotBlank(unionId) ? 1 : 2);
}else{
summaryCnd.and("takePartInUnionId", "=", "us.unionId");
cnd.andEX("us.signUpMode", "=", 1);
cnd.andEX("us.unionId", "=", SecurityUtil.getUnionId());
}
cnd.andEX("line.year", "=", year);
cnd.and(Cnd.likeEX("line.lineName", keywords));
sql.setVar("summaryCnd", summaryCnd);
cnd.asc("line.serialNumber");
sql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
/**
* 查询组团信息
*
* @param lineId 线路id
* @param lineId 归属工会id
* @return {@link Object}
*/
@Override
public Object findClusterInfo(String lineId, String usUnionId) {
NutMap resMap = NutMap.NEW();
Sql sql = Sqls.create("""
select
loginName,
userName,
sex,
unionName,
(select count(*) from the_rapy_recuperation_enroll_companion c where c.trreId = e.id) as companionCount
from
the_rapy_recuperation_enroll e
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("takePartInLineId", "=", lineId);
cnd.and("takePartInUnionId", "=", usUnionId);
cnd.and("isNormal", "=", 1);
cnd.and(Cnd.exps("stateId", "is", null).or("stateId", "=", RecuperationState.PASS));
cnd.and("loginName", "not in", Sqls.create("select loginName from the_rapy_recuperation_cluster_member where lineId = @lineId AND loginName is not null").setParam("lineId", lineId));
sql.setCondition(cnd);
List<NutMap> unSelectedUsers = listMap(sql);
resMap.put("unSelectedUsers", Map.of("clusterName", "线路未分配人员", "members", unSelectedUsers));
List<RecuperationCluster> clusters = dao().query(RecuperationCluster.class, Cnd.where("lineId", "=", lineId));
dao().fetchLinks(clusters, null);
if (Lang.isNotEmpty(clusters)) {
Map<String, RecuperationCluster> clusterMap = clusters.stream().collect(Collectors.toMap(v -> v.getId(), v -> v));
resMap.putAll(clusterMap);
}
return resMap;
}
/**
* 设置组团成员
*
* @param clusters 集群
* @param lineId 行id
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public void setClusterMembers(List<RecuperationCluster> clusters, String lineId) {
dao().clear(RecuperationCluster.class, Cnd.where("lineId", "=", lineId));
dao().clear(RecuperationClusterMember.class, Cnd.where("lineId", "=", lineId));
for (RecuperationCluster cluster : clusters) {
insertWith(cluster, "members");
}
}
}
@@ -79,15 +79,15 @@ public class RecuperationLineSelectServiceImpl extends BaseServiceImpl<Recuperat
us.unionId as usUnionId,
us.id as usId,
usUnion.name as belongUnionName,
(SELECT COUNT(*) FROM recuperation_enroll WHERE takePartInLineId=line.id AND takePartInUnionId=@unionId) applyCount
(SELECT COUNT(*) FROM the_rapy_recuperation_enroll WHERE takePartInLineId=line.id AND takePartInUnionId=@unionId) applyCount
from
recuperation_line line
LEFT JOIN recuperation_travel_agency ta on ta.id = line.travelAgencyId
the_rapy_recuperation_line line
LEFT JOIN the_rapy_recuperation_travel_agency ta on ta.id = line.travelAgencyId
LEFT JOIN sys_union gh ON gh.id = line.createUnionid
LEFT JOIN sys_user u ON u.id = line.createdBy
LEFT JOIN recuperation_line_select us on us.lineId = line.id and year(selectTime) = @year $us
LEFT JOIN sys_user u ON u.id = line.opBy
LEFT JOIN the_rapy_recuperation_line_union_select us on us.lineId = line.id and year(selectTime) = @year $us
LEFT JOIN sys_union usUnion on usUnion.id = us.unionId
LEFT JOIN recuperation_lot lot on lot.id = line.lotId
LEFT JOIN the_rapy_recuperation_lot lot on lot.id = line.lotId
$condition
""");
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
@@ -141,7 +141,7 @@ public class RecuperationLineSelectServiceImpl extends BaseServiceImpl<Recuperat
@Override
public List<String> getHasSelectLineIds() {
Sql sql = Sqls.create("""
select lineId from recuperation_line_select
select lineId from the_rapy_recuperation_line_union_select
where selectUserId = @userId
""");
sql.setParam("userId", SecurityUtil.getUserId());
@@ -176,7 +176,7 @@ public class RecuperationLineSelectServiceImpl extends BaseServiceImpl<Recuperat
signUpMode,
enable
from
recuperation_line_select
the_rapy_recuperation_line_union_select
where unionId = @unionId
and lineId = @lineId
and signUpMode = @mode
@@ -203,7 +203,7 @@ public class RecuperationLineSelectServiceImpl extends BaseServiceImpl<Recuperat
// contact,
// contactPhone
// from
// recuperation_line_select
// the_rapy_recuperation_line_union_select
// where unionId = @unionId
// and lineId = @lineId
// ORDER BY signUpStartTime ASC
@@ -221,7 +221,7 @@ public class RecuperationLineSelectServiceImpl extends BaseServiceImpl<Recuperat
// playStartTime,
// playEndTime
// from
// recuperation_line
// the_rapy_recuperation_line
// where id = @lineId
// """);
// sql.setParam("lineId", lineId);
@@ -236,6 +236,7 @@ public class RecuperationLineSelectServiceImpl extends BaseServiceImpl<Recuperat
* @param unionSelect 联盟选择
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public void setLineInfo(RecuperationLineSelect unionSelect) {
dao().updateIgnoreNull(unionSelect);
}
@@ -1,5 +1,6 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
@@ -16,16 +17,19 @@ import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationLineSelect
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationLineService;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Chain;
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.loader.annotation.IocBean;
import org.nutz.ioc.aop.Aop;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.plugins.wkcache.annotation.CacheRemove;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@@ -44,6 +48,7 @@ public class RecuperationLineServiceImpl extends BaseServiceImpl<RecuperationLin
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void deleteLine(String lineId) {
List<RecuperationLineSelect> unionSelectList = dao().query(RecuperationLineSelect.class, Cnd.where("lineId", "=", lineId));
if (Lang.isNotEmpty(unionSelectList)) {
@@ -61,6 +66,7 @@ public class RecuperationLineServiceImpl extends BaseServiceImpl<RecuperationLin
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void addLine(RecuperationLine line) {
boolean hasSchoolAdminRole = AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name());
@@ -76,12 +82,14 @@ public class RecuperationLineServiceImpl extends BaseServiceImpl<RecuperationLin
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void editLine(RecuperationLine line) {
update(line);
deleteLineInfoCache(line.getId());
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void openClosedLine(String lineId) {
update(Chain.makeSpecial("isDisabled", "isDisabled ^ 1"), Cnd.where("id", "=", lineId));
}
@@ -94,14 +102,23 @@ public class RecuperationLineServiceImpl extends BaseServiceImpl<RecuperationLin
line.serialNumber,
line.lineName,
line.regionalNature,
line.minimumGroupSize,
COALESCE((SELECT outsideQuota FROM the_rapy_recuperation_config LIMIT 1), 0) AS minimumGroupSize,
line.maxSignUpNumber,
(select count(distinct enroll.loginName)
from the_rapy_recuperation_enroll enroll
left join the_rapy_recuperation_line_union_select enrollUs on enrollUs.id = enroll.takePartInLineId
where enrollUs.lineId = line.id
and enroll.isNormal = true
and enroll.stateId not in (2715,2725,2735)
and YEAR(enroll.signingUptime) = line.year) as signUpUserNum,
line.year,
line.isDisabled,
line.playNumberOfDays,
line.createUnionId,
line.signUpMode,
line.createMode,
line.file AS fileId,
gh.name AS createUnionName,
line.files AS fileId,
ifnull(gh.name, '校工会') AS createUnionName,
u.username AS createUserName,
ta.travelAgencyName,
ta.contact,
@@ -109,11 +126,11 @@ public class RecuperationLineServiceImpl extends BaseServiceImpl<RecuperationLin
ta.officialWebsite,
lot.lotName
FROM
recuperation_line line
LEFT JOIN recuperation_travel_agency ta ON ta.id = line.travelAgencyId
the_rapy_recuperation_line line
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = line.travelAgencyId
LEFT JOIN sys_union gh ON gh.id = line.createUnionid
LEFT JOIN sys_user u ON u.id = line.createdBy
LEFT JOIN recuperation_lot lot on lot.id = line.lotId
LEFT JOIN sys_user u ON u.id = line.opBy
LEFT JOIN the_rapy_recuperation_lot lot on lot.id = line.lotId
$condition
""");
sql.setCondition(cnd);
@@ -136,18 +153,18 @@ public class RecuperationLineServiceImpl extends BaseServiceImpl<RecuperationLin
enroll.unionName,
enroll.unitName,
enroll.familyNumber,
( SELECT COUNT( 1 ) FROM recuperation_enroll_companion WHERE trreId = enroll.id) isFamily
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id) isFamily
FROM
`recuperation_enroll` enroll
LEFT JOIN recuperation_line_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = lineu.lineId
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
WHERE
lineu.id = @takePartInLineId
enroll.takePartInLineId = @takePartInLineId
and enroll.stateId=@stateId
$unionCnd
""").setParam("takePartInLineId", lineId).setParam("stateId", RecuperationState.PASS);
if (StrUtil.isNotBlank(unionId) && !AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
sql.setVar("unionCnd", "and enroll.selfUnionId='%s'".formatted(unionId));
sql.setVar("unionCnd", "and (enroll.takePartInUnionId='%s' or enroll.selfUnionId='%s')".formatted(unionId, unionId));
}
Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
List<NutMap> list = pagination.getList();
@@ -161,6 +178,82 @@ public class RecuperationLineServiceImpl extends BaseServiceImpl<RecuperationLin
return pagination;
}
@Override
public Map<Boolean, String> validLineQuota(String lineUnionSelectId, String enrollId) {
if (StrUtil.isBlank(lineUnionSelectId)) {
return Map.of(false, "参数错误");
}
RecuperationLineSelect unionSelect = dao().fetch(RecuperationLineSelect.class, lineUnionSelectId);
if (unionSelect == null || StrUtil.isBlank(unionSelect.getLineId())) {
return Map.of(false, "线路信息不存在");
}
RecuperationLine line = fetch(unionSelect.getLineId());
if (line == null) {
return Map.of(false, "线路信息不存在");
}
if (line.getMaxSignUpNumber() == null || line.getMaxSignUpNumber() <= 0) {
return Map.of(true, "验证成功");
}
String loginName = SecurityUtil.getUserLoginname();
Integer year = line.getYear() == null ? DateUtil.thisYear() : line.getYear();
if (StrUtil.isNotBlank(loginName) && hasCurrentUserLineSignUp(loginName, line.getId(), enrollId, year)) {
return Map.of(true, "验证成功");
}
if (countLineSignUpUsers(line.getId(), enrollId, year) >= line.getMaxSignUpNumber()) {
return Map.of(false, "当前线路报名人数已满");
}
return Map.of(true, "验证成功");
}
/** 判断当前用户是否已经占用该线路名额,编辑同一报名时不重复占用。 */
private boolean hasCurrentUserLineSignUp(String loginName, String lineId, String excludeEnrollId, Integer year) {
Sql sql = Sqls.create("""
SELECT count(1)
FROM the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = enroll.takePartInLineId
WHERE enroll.loginName = @loginName
AND us.lineId = @lineId
AND enroll.isNormal = true
AND enroll.stateId NOT IN ($auditFailStates)
AND YEAR(enroll.signingUptime) = @year
$excludeEnrollCnd
""");
fillLineQuotaSql(sql, lineId, excludeEnrollId, year);
sql.setParam("loginName", loginName);
sql.setCallback(Sqls.callback.integer());
dao().execute(sql);
return sql.getInt() > 0;
}
/** 按工号统计线路已报名人数,排除取消及审核失败记录。 */
private int countLineSignUpUsers(String lineId, String excludeEnrollId, Integer year) {
Sql sql = Sqls.create("""
SELECT count(distinct enroll.loginName)
FROM the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = enroll.takePartInLineId
WHERE us.lineId = @lineId
AND enroll.isNormal = true
AND enroll.stateId NOT IN ($auditFailStates)
AND YEAR(enroll.signingUptime) = @year
$excludeEnrollCnd
""");
fillLineQuotaSql(sql, lineId, excludeEnrollId, year);
sql.setCallback(Sqls.callback.integer());
dao().execute(sql);
return sql.getInt();
}
/** 统一填充线路名额统计 SQL 的状态、年度及编辑排除条件。 */
private void fillLineQuotaSql(Sql sql, String lineId, String excludeEnrollId, Integer year) {
sql.setParam("lineId", lineId);
sql.setParam("year", year);
sql.setVar("auditFailStates", RecuperationState.UNITFAIL + "," + RecuperationState.LINEUNITFAIL + "," + RecuperationState.SCHOOLFAIL);
sql.setVar("excludeEnrollCnd", StrUtil.isBlank(excludeEnrollId) ? "" : "AND enroll.id != @excludeEnrollId");
if (StrUtil.isNotBlank(excludeEnrollId)) {
sql.setParam("excludeEnrollId", excludeEnrollId);
}
}
@Override
@CacheRemove(cacheKey = "${args[0]}_selectLineInfoById")
public void deleteLineInfoCache(String lineId) {
@@ -171,6 +264,7 @@ public class RecuperationLineServiceImpl extends BaseServiceImpl<RecuperationLin
public List<NutMap> viewUnionSelectTimeInfo(String lineId) {
Sql sql = Sqls.create("""
SELECT
us.unionId,
us.signUpStartTime,
us.signUpEndTime,
us.changeEndTime,
@@ -178,10 +272,10 @@ public class RecuperationLineServiceImpl extends BaseServiceImpl<RecuperationLin
us.playEndTime,
gh.name AS selectUnionName
FROM
`recuperation_line_select` us
`the_rapy_recuperation_line_union_select` us
LEFT JOIN sys_union gh ON gh.id = us.unionId
WHERE us.lineId = @lineId
""");
""").setParam("lineId", lineId);
return listMap(sql);
}
}
@@ -0,0 +1,394 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service.impl;
import cn.hutool.core.date.DateUtil;
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.service.impl.BaseServiceImpl;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.recuperation.constant.RecuperationState;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationEnroll;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationProvinceFlexibleGroup;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationProvinceFlexibleGroupService;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
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.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.ioc.aop.Aop;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 省内灵活组团管理
*/
@IocBean(args = {"refer:dao"})
public class RecuperationProvinceFlexibleGroupServiceImpl extends BaseServiceImpl<RecuperationProvinceFlexibleGroup> implements RecuperationProvinceFlexibleGroupService {
public RecuperationProvinceFlexibleGroupServiceImpl(Dao dao) {
super(dao);
}
/**
* 分页查询省内灵活组团列表按当前登录角色限制分工会可见范围
*
* @param pageForm 分页参数
* @param year 年度
* @param days 兼容旧页面参数当前不再参与筛选
* @param groupName 组团名称
* @param unionId 创建工会
* @param travelAgencyId 旅行社
* @return 分页数据
*/
@Override
public Pagination pageData(PageForm pageForm, Integer year, String days, String groupName, String unionId, String travelAgencyId) {
Sql sql = Sqls.create("""
SELECT
fg.id,
fg.sortNumber,
fg.groupName,
fg.days,
fg.year,
fg.isDisabled,
fg.createUnionId,
fg.signUpStartTime,
fg.signUpEndTime,
fg.changeEndTime,
fg.activityStartTime,
fg.activityEndTime,
fg.files,
fg.contactPerson,
fg.contactNumber,
fg.contactPerson2,
fg.contactNumber2,
fg.contactPerson3,
fg.contactNumber3,
fg.maxSignUpNumber,
(select count(distinct enroll.loginName) from the_rapy_recuperation_enroll enroll where enroll.takePartInTravelAgencyId = fg.travelAgencyId and enroll.isNormal = true and enroll.stateId not in ($auditFailStates) and YEAR(enroll.signingUptime) = fg.year) as signUpUserNum,
gh.name createUnionName,
u.username createUserName,
ta.travelAgencyName,
ta.contact,
ta.contactMobileNumber,
ta.officialWebsite
FROM
the_rapy_recuperation_province_flexible_group fg
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = fg.travelAgencyId
LEFT JOIN sys_union gh ON gh.id = fg.createUnionId
LEFT JOIN sys_user u ON u.id = fg.opBy
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.where().andEX("fg.`year`", "=", year);
cnd.andEX("fg.travelAgencyId", "=", travelAgencyId);
cnd.and(Cnd.likeEX("fg.groupName", groupName));
if (!AuthUtil.hasRoleOr("sysadmin", "A06")) {
if (AuthUtil.hasRoleOr("H04")) {
cnd.and("fg.createUnionId", "=", SecurityUtil.getUnionId());
}
} else {
cnd.andEX("fg.createUnionId", "=", unionId);
}
cnd.desc("fg.`year`");
cnd.asc("fg.sortNumber");
cnd.asc("fg.id");
sql.setVar("auditFailStates", String.join(",", Arrays.asList(
String.valueOf(RecuperationState.UNITFAIL),
String.valueOf(RecuperationState.LINEUNITFAIL),
String.valueOf(RecuperationState.SCHOOLFAIL)
)));
sql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
/**
* 查询省内灵活组团详情包含旅行社信息
*
* @param id 省内灵活组团id
* @return 省内灵活组团详情
*/
@Override
public RecuperationProvinceFlexibleGroup selectFlexibleGroupById(String id) {
return fetchLinks(fetch(id), "travelAgency");
}
/**
* 查询手机端省内灵活组团可选择的活动日期供报名弹窗日历使用
*
* @param id 省内灵活组团id
* @param enrollId 当前编辑的报名记录id新增报名时为空
* @return 可选日期已满日期和活动范围
*/
@Override
public NutMap selectFlexibleGroupTimeArray(String id, String enrollId) {
RecuperationProvinceFlexibleGroup flexibleGroup = fetchLinks(fetch(id), "travelAgency");
if (flexibleGroup == null || flexibleGroup.getActivityStartTime() == null || flexibleGroup.getActivityEndTime() == null) {
return NutMap.NEW()
.setv("days", Collections.emptyList())
.setv("holidays", Collections.emptyList())
.setv("fullDays", Collections.emptySet())
.setv("usedDays", Collections.emptySet())
.setv("minDate", "")
.setv("maxDate", "");
}
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate startDate = LocalDate.parse(DateUtil.formatDate(flexibleGroup.getActivityStartTime()), formatter);
LocalDate endDate = LocalDate.parse(DateUtil.formatDate(flexibleGroup.getActivityEndTime()), formatter);
LocalDate currentDate = LocalDate.now().isAfter(startDate) ? LocalDate.now() : startDate;
List<String> resultDates = new ArrayList<>();
while (!currentDate.isAfter(endDate)) {
resultDates.add(currentDate.format(formatter));
currentDate = currentDate.plusDays(1);
}
Set<String> fullDays = getFlexibleGroupFullDays(flexibleGroup, resultDates, enrollId);
Set<String> usedDays = getFlexibleGroupUsedDays(flexibleGroup.getYear(), enrollId);
return NutMap.NEW()
.setv("days", resultDates)
.setv("availableDays", Collections.emptyList())
.setv("holidays", Collections.emptyList())
.setv("fullDays", fullDays)
.setv("usedDays", usedDays)
.setv("minDate", DateUtil.formatDate(flexibleGroup.getActivityStartTime()))
.setv("maxDate", DateUtil.formatDate(flexibleGroup.getActivityEndTime()));
}
/**
* 校验灵活组团最大报名数最大报名数为空或小于等于0时表示不限额同一人同年度同旅行社多条记录只占一个名额
*/
@Override
public Map<Boolean, String> validFlexibleGroupQuota(String id, String enrollId) {
if (StrUtil.isBlank(id)) {
return Map.of(false, "参数错误");
}
RecuperationProvinceFlexibleGroup flexibleGroup = fetch(id);
if (flexibleGroup == null) {
return Map.of(false, "灵活组团信息不存在");
}
if (flexibleGroup.getMaxSignUpNumber() == null || flexibleGroup.getMaxSignUpNumber() <= 0) {
return Map.of(true, "验证成功");
}
String loginName = SecurityUtil.getUserLoginname();
Integer year = flexibleGroup.getYear() == null ? DateUtil.thisYear() : flexibleGroup.getYear();
if (StrUtil.isNotBlank(loginName) && hasCurrentUserTravelAgencySignUp(loginName, flexibleGroup.getTravelAgencyId(), enrollId, year)) {
return Map.of(true, "验证成功");
}
int signUpCount = countTravelAgencySignUpUsers(flexibleGroup.getTravelAgencyId(), enrollId, year);
if (signUpCount >= flexibleGroup.getMaxSignUpNumber()) {
return Map.of(false, "当前灵活组团报名人数已满");
}
return Map.of(true, "验证成功");
}
/**
* 省内灵活组团使用组团自身最大报名数同一人在同年度同旅行社多条历史记录只占一个名额
*/
private Set<String> getFlexibleGroupFullDays(RecuperationProvinceFlexibleGroup flexibleGroup, List<String> resultDates, String excludeEnrollId) {
if (flexibleGroup.getMaxSignUpNumber() == null || flexibleGroup.getMaxSignUpNumber() <= 0) {
return Collections.emptySet();
}
String loginName = SecurityUtil.getUserLoginname();
Integer year = flexibleGroup.getYear() == null ? DateUtil.thisYear() : flexibleGroup.getYear();
if (StrUtil.isNotBlank(loginName) && hasCurrentUserTravelAgencySignUp(loginName, flexibleGroup.getTravelAgencyId(), excludeEnrollId, year)) {
return Collections.emptySet();
}
int signUpCount = countTravelAgencySignUpUsers(flexibleGroup.getTravelAgencyId(), excludeEnrollId, year);
if (signUpCount >= flexibleGroup.getMaxSignUpNumber()) {
return new HashSet<>(resultDates);
}
return Collections.emptySet();
}
/**
* 判断当前用户是否已在该旅行社占用名额兼容历史同年度多条灵活组团记录不重复占用
*/
private boolean hasCurrentUserTravelAgencySignUp(String loginName, String travelAgencyId, String excludeEnrollId, Integer year) {
Cnd cnd = Cnd.where("loginName", "=", loginName)
.and("takePartInTravelAgencyId", "=", travelAgencyId)
.and("isNormal", "=", true)
.and("stateId", "not in", Lang.array(RecuperationState.UNITFAIL, RecuperationState.LINEUNITFAIL, RecuperationState.SCHOOLFAIL))
.and("YEAR(signingUptime)", "=", year == null ? DateUtil.thisYear() : year);
if (StrUtil.isNotBlank(excludeEnrollId)) {
cnd.and("id", "!=", excludeEnrollId);
}
return dao().count(RecuperationEnroll.class, cnd) > 0;
}
/**
* 统计旅行社报名人数按工号去重避免两条灵活组团记录重复计算同一人
*/
private int countTravelAgencySignUpUsers(String travelAgencyId, String excludeEnrollId, Integer year) {
Sql sql = Sqls.create("""
SELECT
count(distinct loginName)
FROM
the_rapy_recuperation_enroll
WHERE
takePartInTravelAgencyId = @travelAgencyId
AND isNormal = true
AND stateId NOT IN ($auditFailStates)
AND YEAR(signingUptime) = @year
$excludeEnrollCnd
""");
sql.setParam("travelAgencyId", travelAgencyId);
sql.setParam("year", year == null ? DateUtil.thisYear() : year);
sql.setVar("auditFailStates", String.join(",", Arrays.asList(
String.valueOf(RecuperationState.UNITFAIL),
String.valueOf(RecuperationState.LINEUNITFAIL),
String.valueOf(RecuperationState.SCHOOLFAIL)
)));
sql.setVar("excludeEnrollCnd", StrUtil.isBlank(excludeEnrollId) ? "" : "AND id != @excludeEnrollId");
if (StrUtil.isNotBlank(excludeEnrollId)) {
sql.setParam("excludeEnrollId", excludeEnrollId);
}
sql.setCallback(Sqls.callback.integer());
dao().execute(sql);
return sql.getInt();
}
/**
* 查询当前登录人已报名省内灵活组团覆盖到的具体日期供手机端日历置灰
*/
private Set<String> getFlexibleGroupUsedDays(Integer year, String excludeEnrollId) {
String loginName = SecurityUtil.getUserLoginname();
if (StrUtil.isBlank(loginName)) {
return Collections.emptySet();
}
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
Set<String> usedDays = new HashSet<>();
Cnd cnd = Cnd.where("loginName", "=", loginName)
.and("isNormal", "=", true)
.and("takePartInTravelAgencyId", "is not", null)
.and("stateId", "not in", Lang.array(RecuperationState.UNITFAIL, RecuperationState.LINEUNITFAIL, RecuperationState.SCHOOLFAIL))
.and("YEAR(signingUptime)", "=", year == null ? DateUtil.thisYear() : year);
if (StrUtil.isNotBlank(excludeEnrollId)) {
cnd.and("id", "!=", excludeEnrollId);
}
List<RecuperationEnroll> signedEnrolls = dao().query(RecuperationEnroll.class, cnd);
for (RecuperationEnroll signedEnroll : signedEnrolls) {
if (signedEnroll.getTakePartInTime() == null || StrUtil.isBlank(signedEnroll.getLotId())) {
continue;
}
int dayCount = getFlexibleGroupDayCount(signedEnroll.getLotId());
if (dayCount <= 0) {
continue;
}
LocalDate startDate = LocalDate.parse(DateUtil.formatDate(signedEnroll.getTakePartInTime()), formatter);
for (int i = 0; i < dayCount; i++) {
usedDays.add(startDate.plusDays(i).format(formatter));
}
}
return usedDays;
}
/**
* 将中文天数转换为实际天数用于计算已报名日期范围
*/
private int getFlexibleGroupDayCount(String dayText) {
if (StrUtil.isBlank(dayText)) {
return 0;
}
if (dayText.contains("") || dayText.contains("2")) {
return 2;
}
if (dayText.contains("") || dayText.contains("3")) {
return 3;
}
if (dayText.contains("") || dayText.contains("5")) {
return 5;
}
try {
return Integer.parseInt(dayText.replace("", ""));
} catch (NumberFormatException e) {
return 0;
}
}
/**
* 批量统赋省内灵活组团报名时间只更新勾选组团的三个报名时间字段
*
* @param ids 省内灵活组团id数组
* @param signUpStartTime 报名开始时间
* @param signUpEndTime 报名结束时间
* @param changeEndTime 变更截至时间
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public void batchAssignSignUpTimes(String[] ids, Date signUpStartTime, Date signUpEndTime, Date changeEndTime) {
if (Lang.isEmpty(ids)) {
return;
}
Chain chain = Chain.make("signUpStartTime", signUpStartTime)
.add("signUpEndTime", signUpEndTime)
.add("changeEndTime", changeEndTime);
update(chain, Cnd.where("id", "in", ids));
}
/**
* 保存省内灵活组团信息服务层统一补齐创建人和操作时间
*
* @param flexibleGroup 省内灵活组团信息
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public void submitFlexibleGroup(RecuperationProvinceFlexibleGroup flexibleGroup) {
flexibleGroup.setOpBy(SecurityUtil.getUserId());
flexibleGroup.setCreateUnionId(SecurityUtil.getUnionId());
flexibleGroup.setOpAt(String.valueOf(new Date().getTime()));
insertOrUpdate(flexibleGroup);
}
/**
* 切换省内灵活组团启用状态
*
* @param id 省内灵活组团id
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public void openClosedFlexibleGroup(String id) {
update(Chain.makeSpecial("isDisabled", "isDisabled ^ 1"), Cnd.where("id", "=", id));
}
/**
* 删除省内灵活组团
*
* @param id 省内灵活组团id
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public void deleteFlexibleGroup(String id) {
delete(id);
}
/**
* 查询旅行社编辑页中是否灵活组团为是且未禁用的旅行社
*
* @param year 年度
* @return 旅行社列表
*/
@Override
public List<RecuperationTravelAgency> selectFlexibleTravelAgency(Integer year) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year);
cnd.and("isDisabled", "=", false);
cnd.and("signUpTravelAgency", "=", true);
cnd.asc("serialNumber * 1");
return dao().query(RecuperationTravelAgency.class, cnd);
}
}
@@ -3,15 +3,19 @@ package com.budwk.app.zhgh.staffbenefit.recuperation.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.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.recuperation.constant.RecuperationState;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationTravelAgencyService;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Chain;
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.loader.annotation.IocBean;
import org.nutz.ioc.aop.Aop;
import java.util.List;
@@ -31,21 +35,25 @@ public class RecuperationTravelAgencyServiceImpl extends BaseServiceImpl<Recuper
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void deleteTravelAgency(String travelAgencyId) {
delete(travelAgencyId);
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void addTravelAgency(RecuperationTravelAgency travelAgency) {
insert(travelAgency);
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void editTravelAgency(RecuperationTravelAgency travelAgency) {
update(travelAgency);
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void openTravelAgency(String travelAgencyId) {
update(Chain.makeSpecial("isDisabled", "isDisabled ^ 1"), Cnd.where("id", "=", travelAgencyId));
}
@@ -54,16 +62,39 @@ public class RecuperationTravelAgencyServiceImpl extends BaseServiceImpl<Recuper
public Pagination pageData(PageForm pageForm, Cnd cnd) {
Sql sql = Sqls.create("""
select
*,
file as fileId
agency.*,
agency.files as fileId,
(
select count(distinct enroll.loginName)
from the_rapy_recuperation_enroll enroll
left join the_rapy_recuperation_line_union_select enrollUs on enrollUs.id = enroll.takePartInLineId
left join the_rapy_recuperation_line enrollLine on enrollLine.id = enrollUs.lineId
left join the_rapy_recuperation_base_management enrollBase on enrollBase.id = enroll.takePartInBaseManagementId
where (
enroll.takePartInTravelAgencyId = agency.id
or IFNULL(NULLIF(enrollUs.travelAgencyId, ''), enrollLine.travelAgencyId) = agency.id
or enrollBase.travelAgencyId = agency.id
)
and enroll.isNormal = true
and enroll.stateId not in ($auditFailStates)
and YEAR(enroll.signingUptime) = agency.year
) as signUpUserNum
from
recuperation_travel_agency
$condition
the_rapy_recuperation_travel_agency agency $condition
""");
// 报名人数覆盖线路省外线路灵活组团定点四种来源并按工号去重
sql.setVar("auditFailStates", getAuditFailStates());
sql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
/**
* 旅行社报名人数统计只排除审核失败记录待审核和审核通过均计入已报名人数
*/
private String getAuditFailStates() {
return RecuperationState.UNITFAIL + "," + RecuperationState.LINEUNITFAIL + "," + RecuperationState.SCHOOLFAIL;
}
@Override
public List<RecuperationTravelAgency> selectAllTravelAgencyByYear(Cnd cnd) {
return dao().query(RecuperationTravelAgency.class, cnd);
@@ -79,13 +110,14 @@ public class RecuperationTravelAgencyServiceImpl extends BaseServiceImpl<Recuper
enroll.userName,
enroll.unionName,
enroll.unitName,
( SELECT COUNT( 1 ) FROM recuperation_enroll_companion WHERE trreId = enroll.id AND relation = '亲属' ) isFamily
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id AND relation = '亲属' ) isFamily
FROM
`recuperation_enroll` enroll
LEFT JOIN recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
WHERE
enroll.takePartInTravelAgencyId = @takePartInTravelAgencyId
""").setParam("takePartInTravelAgencyId", id);
and enroll.selfUnionId = @unionId
""").setParam("takePartInTravelAgencyId", id).setParam("unionId", SecurityUtil.getUnionId());
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1654505536065" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9027" width="48" height="48" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M752.736 431.063C757.159 140.575 520.41 8.97 504.518 0.41V0l-0.45 0.205-0.41-0.205v0.41c-15.934 8.56-252.723 140.165-248.259 430.653-48.21 31.457-98.713 87.368-90.685 184.074 8.028 96.666 101.007 160.768 136.601 157.287 35.595-3.482 25.232-30.31 25.232-30.31l12.206-50.095s52.47 80.569 69.304 80.528c15.114-1.23 87-0.123 95.6 0h0.82c8.602-0.123 80.486-1.23 95.6 0 16.794 0 69.305-80.528 69.305-80.528l12.165 50.094s-10.322 26.83 25.272 30.31c35.595 3.482 128.574-60.62 136.602-157.286 8.028-96.665-42.475-152.617-90.685-184.074z m-248.669-4.26c-6.758-0.123-94.781-3.359-102.891-107.192 2.95-98.714 95.97-107.438 102.891-107.93 6.964 0.492 99.943 9.216 102.892 107.93-8.11 103.833-96.174 107.07-102.892 107.192z m-52.019 500.531c0 11.838-9.42 21.382-21.012 21.382a21.217 21.217 0 0 1-21.054-21.34V821.74c0-11.797 9.421-21.382 21.054-21.382 11.591 0 21.012 9.585 21.012 21.382v105.635z m77.333 57.222a21.504 21.504 0 0 1-21.34 21.626 21.504 21.504 0 0 1-21.34-21.626V827.474c0-11.96 9.543-21.668 21.299-21.668 11.796 0 21.38 9.708 21.38 21.668v157.082z m71.147-82.043c0 11.796-9.42 21.34-21.053 21.34a21.217 21.217 0 0 1-21.013-21.34v-75.367c0-11.755 9.421-21.299 21.013-21.299 11.632 0 21.053 9.544 21.053 21.3v75.366z" fill="#1867b0" p-id="9028"></path></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,11 @@
<!--# layout("/layouts/platform.html"){ #-->
<div id="app" v-cloak>
<el-card shadow="never"><search @search="doSearch"><search-item label="年度"><el-date-picker v-model="pageForm.year" type="year" value-format="yyyy" @change="doSearch"></el-date-picker></search-item><search-item label="审核状态"><el-select v-model="pageForm.audited" @change="doSearch"><el-option label="待审核" :value="false"></el-option><el-option label="已审核" :value="true"></el-option></el-select></search-item><search-item label="姓名/工号"><el-input v-model="pageForm.keyword" clearable @keyup.enter.native="doSearch"></el-input></search-item></search></el-card>
<el-card shadow="never" class="mt20"><table-tool label="疗休养审核"></table-tool><el-table v-loading="tableLoading" :data="tableData" :size="tableSize"><el-table-column type="index" :index="indexMethod" label="序号" width="60"></el-table-column><el-table-column prop="loginName" label="工号"></el-table-column><el-table-column prop="userName" label="姓名"></el-table-column><el-table-column prop="unitName" label="单位"></el-table-column><el-table-column prop="lineName" label="线路" min-width="160"></el-table-column><el-table-column prop="travelAgencyName" label="旅行社"></el-table-column><el-table-column prop="stateId" label="状态"><template v-slot="{row}">{{stateText(row.stateId)}}</template></el-table-column><el-table-column label="操作" width="230"><template v-slot="{row}"><el-button size="mini" @click="view(row)">查看</el-button><el-button v-if="!pageForm.audited" size="mini" type="success" @click="openAudit(row,true)">通过</el-button><el-button v-if="!pageForm.audited" size="mini" type="danger" @click="openAudit(row,false)">驳回</el-button><el-button v-if="pageForm.audited" size="mini" @click="recall(row)">撤回</el-button></template></el-table-column></el-table><!--#include("/layouts/pagination.html"){}#--></el-card>
<el-dialog title="报名详情" :visible.sync="viewVisible" width="760px" append-to-body><el-descriptions :column="2" border><el-descriptions-item label="工号">{{viewData.loginName}}</el-descriptions-item><el-descriptions-item label="姓名">{{viewData.userName}}</el-descriptions-item><el-descriptions-item label="身份证">{{viewData.idCard}}</el-descriptions-item><el-descriptions-item label="手机">{{viewData.mobile}}</el-descriptions-item><el-descriptions-item label="线路">{{viewData.lineName}}</el-descriptions-item><el-descriptions-item label="旅行社">{{viewData.travelAgencyName}}</el-descriptions-item></el-descriptions></el-dialog>
<el-dialog title="审核意见" :visible.sync="auditVisible" width="520px" append-to-body><el-input type="textarea" :rows="4" v-model="auditForm.auditOpinion"></el-input><template slot="footer"><el-button @click="auditVisible=false">取消</el-button><el-button type="primary" :loading="formLoading" @click="submitAudit">确认</el-button></template></el-dialog>
</div>
<script nonce="${cspNonce!}">
new Vue({el:"#app",mixins:[initTableMixins],data(){return {pageForm:{pageNumber:1,pageSize:10,totalCount:0,year:new Date().getFullYear(),audited:false,stage:"${stage!}"},viewVisible:false,auditVisible:false,formLoading:false,viewData:{},auditForm:{}}},methods:{pageData(){this.tableLoading=true;this.$axios.post("/platform/recuperation/audit/pageData",this.pageForm).then((res)=>{if(res.code===0){this.$set(this,"tableData",res.data.list||[]);this.$set(this.pageForm,"totalCount",res.data.totalCount||0)}}).finally(()=>{this.tableLoading=false})},stateText(state){const map={2710:"分工会待审",2715:"分工会驳回",2720:"线路工会待审",2725:"线路工会驳回",2730:"校工会待审",2735:"校工会驳回",2750:"审核通过"};return map[state]||state},view(row){this.$axios.post("/platform/recuperation/audit/findOne",{id:row.id}).then((res)=>{if(res.code===0){this.$set(this,"viewData",res.data.viewData||{});this.$set(this,"viewVisible",true)}})},openAudit(row,pass){this.$set(this,"auditForm",{id:row.id,pass:pass,auditOpinion:""});this.$set(this,"auditVisible",true)},submitAudit(){this.formLoading=true;this.$axios.post("/platform/recuperation/audit/audit",this.auditForm).then((res)=>{if(res.code===0){this.$message.success(res.msg);this.$set(this,"auditVisible",false);this.pageData()}}).finally(()=>{this.formLoading=false})},recall(row){this.$confirm("确定撤回该审核吗?","提示").then(()=>{this.$axios.post("/platform/recuperation/audit/recall",{id:row.id}).then((res)=>{if(res.code===0)this.pageData()})}).catch(()=>{})}},created(){this.pageData()}})
</script>
<!--# } #-->
@@ -177,8 +177,8 @@ const basicForm = {
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="是否启用" prop="isDisabled">
<el-switch
:active-value="true"
:inactive-value="false"
:active-value="false"
:inactive-value="true"
active-color="#13ce66"
inactive-color="#ff4949"
v-model="formData.isDisabled">
@@ -188,8 +188,8 @@ const basicForm = {
</el-row>
<el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24">
<el-form-item label="移动端缩略图" prop="file">
<file-upload :value.sync="formData.file" accept=".jpg,.jpeg,.png"
<el-form-item label="移动端缩略图" prop="files">
<file-upload :value.sync="formData.files" accept=".jpg,.jpeg,.png"
:upload_number="1" upload_result_category="interval"
complete_result upload_mode="drag"></file-upload>
</el-form-item>
@@ -198,7 +198,7 @@ const basicForm = {
</el-form>
<el-row class="mt10" justify="end" type="flex">
<el-button @click="$emit('refresh')">取消</el-button>
<el-button @click="onSubmit" type="primary">提交</el-button>
<el-button :loading="formLoading" @click="onSubmit" type="primary">提交</el-button>
</el-row>
</div>
`,
@@ -263,10 +263,11 @@ const basicForm = {
callback()
}
return {
formLoading: false,
localTravelList: [...this.travelList],
localLotList: [...this.lotList],
formData: {
isDisabled: true
isDisabled: false
},
formRules: {
sortNumber: [{required: false, message: '请输入排序编号', trigger: ['change', 'blur']}],
@@ -292,13 +293,15 @@ const basicForm = {
const lot = this.localLotList.find(o => o.id === this.formData.lotId)
if (lot) this.$set(this.formData, 'estimatedCost', lot.estimatedCost)
},
async yearChange() {
yearChange() {
this.$set(this.formData, 'travelAgencyId', null)
await this.selectTravelAgencyList()
this.selectTravelAgencyList()
},
async selectTravelAgencyList() {
const resp = await this.$axios.post('/platform/recuperation/travelAgency/selectTravelAgency', {year: this.formData.year})
this.localTravelList = resp.data
selectTravelAgencyList() {
return this.$axios.post('/platform/recuperation/travelAgency/selectTravelAgency', {year: this.formData.year})
.then((resp) => {
this.localTravelList = resp.data
})
},
onOpen(row) {
if(row && row.id) {
@@ -317,14 +320,20 @@ const basicForm = {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
const resp = await this.$axios.post("/platform/recuperation/baseManagement/onSubmit", this.formData)
if (resp.code === 0) {
this.$message.success(resp.msg)
this.$emit('refresh')
} else {
this.$message.warning(resp.msg)
}
}).then(() => {
this.formLoading = true
this.$axios.post("/platform/recuperation/baseManagement/onSubmit", this.formData)
.then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.$emit('refresh')
} else {
this.$message.warning(resp.msg)
}
})
.finally(() => {
this.formLoading = false
})
})
}
})
@@ -75,7 +75,7 @@ layout("/layouts/platform.html"){
新增目的地
</el-button>
</table-tool>
<el-table :data="tableData" @sort-change="pageOrder" :size="tableSize">
<el-table v-loading="tableLoading" :data="tableData" @sort-change="pageOrder" :size="tableSize">
<el-table-column label="序号" type="index" :index="indexMethod" width="60"></el-table-column>
<el-table-column
:label="column.label"
@@ -168,23 +168,28 @@ layout("/layouts/platform.html"){
}
},
methods: {
async selectTravelAgencyList() {
const resp = await this.$axios.post('/platform/recuperation/travelAgency/selectTravelAgency', {year: this.formData.year})
this.travelAgencyList = resp.data
selectTravelAgencyList() {
const year = this.pageForm.year || new Date().getFullYear()
return this.$axios.post('/platform/recuperation/travelAgency/selectTravelAgency', {year: year}).then((resp) => {
this.travelAgencyList = resp.data
})
},
async getModifyBd() {
const res = await this.$axios.post('/platform/recuperation/config/fetchOne')
if (res.code === 0) {
this.modifyBdList = res.data.lots
}
getModifyBd() {
return this.$axios.post('/platform/recuperation/config/fetchOne').then((res) => {
if (res.code === 0) {
this.modifyBdList = res.data.lots
}
})
},
async baseStatusChange(id) {
const resp = await this.$axios.post(loc() + '/openClosedBase/' + id)
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
baseStatusChange(id) {
this.$axios.post(loc() + '/openClosedBase/' + id).then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.pageData()
} else {
this.$message.warning(resp.msg)
}
})
},
refresh() {
this.doSearch()
@@ -222,21 +227,26 @@ layout("/layouts/platform.html"){
.catch(() => {})
},
pageData() {
this.$axios.post(loc() + "/pageData", this.pageForm).then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
this.tableLoading = true
this.$axios.post(loc() + "/pageData", this.pageForm)
.then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
.finally(() => {
this.tableLoading = false
})
},
async initData() {
await this.getModifyBd()
await this.selectTravelAgencyList()
initData() {
return Promise.all([this.getModifyBd(), this.selectTravelAgencyList()])
},
},
async created() {
await this.initData()
this.pageData()
created() {
this.initData().then(() => {
this.pageData()
})
}
})
</script>
@@ -0,0 +1,9 @@
<!--# layout("/layouts/platform.html"){ #-->
<div id="app" v-cloak>
<el-card shadow="never"><el-form inline><el-form-item label="年度"><el-date-picker v-model="year" type="year" value-format="yyyy" @change="loadOptions"></el-date-picker></el-form-item><el-form-item label="线路/旅行社"><el-select v-model="targetId" filterable placeholder="请选择"><el-option v-for="item in options" :key="item.id" :label="item.lineName||item.travelAgencyName" :value="item.id"></el-option></el-select></el-form-item><el-form-item><el-upload action="/platform/recuperation/joinUserImport/readExcel" name="file" :data="uploadData" :show-file-list="false" :on-success="onUploadSuccess" accept=".xls,.xlsx"><el-button type="primary">上传参加人员 Excel</el-button></el-upload></el-form-item><el-form-item><el-button @click="downloadTemplate">下载模板</el-button></el-form-item></el-form></el-card>
<el-card shadow="never" class="mt20"><table-tool label="匹配到的报名人员"><el-button type="primary" :loading="formLoading" @click="doImport">确认标记参加</el-button></table-tool><el-table :data="matchList"><el-table-column prop="loginName" label="工号"></el-table-column><el-table-column prop="userName" label="姓名"></el-table-column><el-table-column prop="takePartInTime" label="参加时间"></el-table-column><el-table-column prop="lineName" label="线路"></el-table-column></el-table></el-card>
</div>
<script nonce="${cspNonce!}">
new Vue({el:"#app",data(){return {year:new Date().getFullYear(),targetId:null,options:[],matchList:[],formLoading:false}},computed:{uploadData(){return {lineId:this.targetId}}},methods:{loadOptions(){this.$axios.post(loc()+"/options",{year:this.year}).then((res)=>{if(res.code===0)this.$set(this,"options",res.data||[])})},onUploadSuccess(res){if(res.code===0){this.$set(this,"matchList",res.data.matchList||[]);this.$message.success("已匹配 "+this.matchList.length+" 人")}else this.$message.warning(res.msg)},doImport(){if(!this.matchList.length){this.$message.warning("暂无匹配人员");return}this.formLoading=true;this.$axios.post(loc()+"/doImport",{enrolls:JSON.stringify(this.matchList)}).then((res)=>{if(res.code===0){this.$message.success(res.msg);this.$set(this,"matchList",[])}}).finally(()=>{this.formLoading=false})},downloadTemplate(){window.open(loc()+"/downloadTemplate")}},created(){this.loadOptions()}})
</script>
<!--# } #-->
@@ -152,8 +152,8 @@ const basicForm = {
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="是否启用" prop="isDisabled">
<el-switch
:active-value="true"
:inactive-value="false"
:active-value="false"
:inactive-value="true"
active-color="#13ce66"
inactive-color="#ff4949"
v-model="formData.isDisabled">
@@ -163,8 +163,8 @@ const basicForm = {
</el-row>
<el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24">
<el-form-item label="移动端缩略图" prop="file">
<file-upload :value.sync="formData.file" accept=".jpg,.jpeg,.png"
<el-form-item label="移动端缩略图" prop="files">
<file-upload :value.sync="formData.files" accept=".jpg,.jpeg,.png"
:upload_number="1" upload_result_category="interval"
complete_result upload_mode="drag"></file-upload>
</el-form-item>
@@ -173,7 +173,7 @@ const basicForm = {
</el-form>
<el-row class="mt10" justify="end" type="flex">
<el-button @click="$emit('refresh')">取消</el-button>
<el-button @click="onSubmit" type="primary">提交</el-button>
<el-button :loading="formLoading" @click="onSubmit" type="primary">提交</el-button>
</el-row>
</div>
`,
@@ -231,13 +231,14 @@ const basicForm = {
callback()
}
return {
formLoading: false,
config: {},
regionalNatureList: [],
localTravelList: [...this.travelList],
localLotList: [...this.lotList],
signUpModeList: [...this.signList],
formData: {
isDisabled: true
isDisabled: false
},
formRules: {
serialNumber: [{required: true, message: '请输入排序号', trigger: ['change', 'blur']}],
@@ -268,27 +269,29 @@ const basicForm = {
return roles.some(r => r === 'BRANCH_UNION_ADMIN' || r === 'BRANCH_UNION_CHAIRMAN')
}
},
async getConfig() {
const resp = await $.get('/platform/recuperation/config/fetchOne')
if (resp.code === 0) {
this.config = resp.data
}
getConfig() {
return $.get('/platform/recuperation/config/fetchOne')
.then((resp) => {
if (resp.code === 0) {
this.config = resp.data
}
})
},
async yearChange() {
yearChange() {
this.$set(this.formData, 'travelAgencyId', null)
await this.selectTravelAgencyList()
this.selectTravelAgencyList()
},
async selectTravelAgencyList() {
const resp = await this.$axios.post('/platform/recuperation/travelAgency/selectTravelAgency', {year: this.formData.year})
this.localTravelList = resp.data
selectTravelAgencyList() {
return this.$axios.post('/platform/recuperation/travelAgency/selectTravelAgency', {year: this.formData.year})
.then((resp) => {
this.localTravelList = resp.data
})
},
async getCreateMode() {
const resp = await this.$axios.get(loc() + '/getCreateMode')
if (resp.code === 0) {
return resp.data
}
getCreateMode() {
return this.$axios.post(loc() + '/getCreateMode')
.then((resp) => resp.code === 0 ? resp.data : null)
},
async onOpen(row) {
onOpen(row) {
if (row && row.id) {
this.$axios.post(loc() + '/selectLineInfoById/' + row.id)
.then((resp) => {
@@ -297,16 +300,20 @@ const basicForm = {
this.formData = {...data}
})
} else {
await this.getNumber()
const createMode = await this.getCreateMode()
this.$set(this.formData, 'createMode', createMode)
if (createMode === 1) {
this.$set(this.formData, 'signUpMode', 1)
}
await this.getConfig()
if (this.config) {
this.$set(this.formData, 'minimumGroupSize', this.config.groupNumber)
}
this.getNumber()
.then(() => this.getCreateMode())
.then((createMode) => {
this.$set(this.formData, 'createMode', createMode)
if (createMode === 1) {
this.$set(this.formData, 'signUpMode', 1)
}
return this.getConfig()
})
.then(() => {
if (this.config) {
this.$set(this.formData, 'minimumGroupSize', this.config.groupNumber)
}
})
}
},
onSubmit() {
@@ -316,29 +323,40 @@ const basicForm = {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
const resp = await this.$axios.post("/platform/recuperation/line/onSubmit", this.formData)
if (resp.code === 0) {
this.$message.success(resp.msg)
this.$emit('refresh')
} else {
this.$message.warning(resp.msg)
}
}).then(() => {
this.formLoading = true
this.$axios.post("/platform/recuperation/line/onSubmit", this.formData)
.then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.$emit('refresh')
} else {
this.$message.warning(resp.msg)
}
})
.finally(() => {
this.formLoading = false
})
})
}
})
},
async getEnumOptions(enumName) {
const resp = await this.$axios.post("/open/common/dictEnumOptions", { name: enumName })
return resp.data
getEnumOptions(enumName) {
return this.$axios.post("/open/common/dictEnumOptions", { name: enumName })
.then((resp) => resp.data)
},
async getNumber() {
const resp = await this.$axios.post(loc() + '/getNo')
this.$set(this.formData, 'serialNumber', resp.data)
getNumber() {
return this.$axios.post(loc() + '/getNo')
.then((resp) => {
this.$set(this.formData, 'serialNumber', resp.data)
})
},
},
async created() {
this.regionalNatureList = await this.getEnumOptions('RecuperationProvinceType')
created() {
this.getEnumOptions('RecuperationProvinceType')
.then((data) => {
this.regionalNatureList = data
})
},
style: /*language=CSS*/ `
@@ -94,7 +94,7 @@ layout("/layouts/platform.html"){
新增线路
</el-button>
</table-tool>
<el-table :data="tableData" @sort-change="pageOrder" :size="tableSize">
<el-table v-loading="tableLoading" :data="tableData" @sort-change="pageOrder" :size="tableSize">
<el-table-column label="序号" type="index" :index="indexMethod" width="60"></el-table-column>
<el-table-column
:label="column.label"
@@ -189,31 +189,35 @@ layout("/layouts/platform.html"){
}
},
methods: {
async lineStatusChange(id) {
const resp = await this.$axios.post(loc() + '/openClosedLine/' + id)
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
lineStatusChange(id) {
this.$axios.post(loc() + '/openClosedLine/' + id).then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.pageData()
} else {
this.$message.warning(resp.msg)
}
})
},
async getEnumOptions(enumName) {
const resp = await this.$axios.post("/open/common/dictEnumOptions", { name: enumName })
return resp.data
getEnumOptions(enumName) {
return this.$axios.post("/open/common/dictEnumOptions", { name: enumName }).then((resp) => resp.data)
},
signUpModeName(val) {
const d = this.signUpModeList.find(v => v.value === val)
return d ? d.label : null
},
async selectTravelAgencyList() {
const resp = await this.$axios.post('/platform/recuperation/travelAgency/selectTravelAgency', {year: this.formData.year})
this.travelAgencyList = resp.data
selectTravelAgencyList() {
const year = this.pageForm.endYear || this.pageForm.startYear || new Date().getFullYear()
return this.$axios.post('/platform/recuperation/travelAgency/selectTravelAgency', {year: year}).then((resp) => {
this.travelAgencyList = resp.data
})
},
async getModifyBd() {
const res = await this.$axios.post('/platform/recuperation/config/fetchOne')
if (res.code === 0) {
this.lotList = res.data?.lots
}
getModifyBd() {
return this.$axios.post('/platform/recuperation/config/fetchOne').then((res) => {
if (res.code === 0) {
this.lotList = res.data ? res.data.lots : []
}
})
},
handleChangeYear(){
if (this.pageForm.startYear && this.pageForm.endYear){
@@ -223,13 +227,15 @@ layout("/layouts/platform.html"){
}
}
},
async travelAgencyStatusChange(id) {
const resp = await $.post(loc() + '/openClosedLine/' + id)
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
travelAgencyStatusChange(id) {
$.post(loc() + '/openClosedLine/' + id).then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.pageData()
} else {
this.$message.warning(resp.msg)
}
}).always(() => {})
},
refresh() {
this.doSearch()
@@ -267,23 +273,34 @@ layout("/layouts/platform.html"){
.catch(() => {})
},
pageData() {
this.$axios.post(loc() + "/pageData", this.pageForm).then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
this.tableLoading = true
this.$axios.post(loc() + "/pageData", this.pageForm)
.then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
.finally(() => {
this.tableLoading = false
})
},
async initData() {
await this.getModifyBd()
await this.selectTravelAgencyList()
this.signUpModeList = await this.getEnumOptions('RecuperationSignUpMode')
this.unionOptions = await this.$businessTool.listUnion()
initData() {
return Promise.all([
this.getModifyBd(),
this.selectTravelAgencyList(),
this.getEnumOptions('RecuperationSignUpMode'),
this.$businessTool.listUnion()
]).then((values) => {
this.signUpModeList = values[2]
this.unionOptions = values[3]
})
}
},
async created() {
await this.initData()
this.pageData()
created() {
this.initData().then(() => {
this.pageData()
})
}
})
</script>
@@ -53,23 +53,22 @@ const info = {
}
},
methods: {
async onOpen(lineId, usUnionId) {
await this.findOne(lineId, usUnionId)
onOpen(lineId, usUnionId) {
return this.findOne(lineId, usUnionId)
},
async findOne(id, unionId) {
const resp = await this.$axios.get('/platform/recuperation/line/selectLineInfoById/' + id)
if (resp.code === 0) {
this.viewData = resp.data
}
findOne(id, unionId) {
return this.$axios.get('/platform/recuperation/line/selectLineInfoById/' + id).then((resp) => {
if (resp.code === 0) {
this.viewData = resp.data
}
})
},
async findUnionSelectLineData(lineId, unionId) {
const resp = await this.$axios.post('/platform/recuperation/lineFghSelect/selectLineInfo', {
lineId: lineId,
unionId: unionId
findUnionSelectLineData(lineId, unionId) {
return this.$axios.post('/platform/recuperation/line/viewUnionSelectTimeInfo/' + lineId).then((resp) => {
if (resp.code === 0 && resp.data) {
this.times = unionId ? resp.data.filter((item) => item.unionId === unionId) : resp.data
}
})
if (resp.code === 0 && resp.data) {
this.times = resp.data
}
}
},
style: /*language=CSS*/ `
@@ -0,0 +1,10 @@
<!--# layout("/layouts/platform.html"){ #-->
<div id="app" v-cloak>
<el-card shadow="never"><search @search="doSearch"><search-item label="年度"><el-date-picker v-model="pageForm.year" type="year" value-format="yyyy" @change="doSearch"></el-date-picker></search-item><search-item label="关键字"><el-input v-model="pageForm.keywords" clearable></el-input></search-item></search></el-card>
<el-card shadow="never" class="mt20"><table-tool label="线路人员调整"></table-tool><el-table v-loading="tableLoading" :data="tableData" :size="tableSize"><el-table-column type="index" :index="indexMethod" label="序号" width="60"></el-table-column><el-table-column prop="serialNumber" label="线路编号"></el-table-column><el-table-column prop="lineName" label="线路名称" min-width="180"></el-table-column><el-table-column prop="selectUnionName" label="报名工会"></el-table-column><el-table-column prop="signUpUserNum" label="报名人数"></el-table-column><el-table-column label="操作" width="100"><template v-slot="{row}"><el-button type="primary" size="mini" @click="openUsers(row)">调整</el-button></template></el-table-column></el-table><!--#include("/layouts/pagination.html"){}#--></el-card>
<el-dialog title="报名人员调整" :visible.sync="usersVisible" width="900px" append-to-body><el-table :data="users" @selection-change="(rows)=>{selectedUsers=rows}"><el-table-column type="selection" width="50"></el-table-column><el-table-column prop="loginName" label="工号"></el-table-column><el-table-column prop="userName" label="姓名"></el-table-column><el-table-column prop="unitName" label="单位"></el-table-column><el-table-column prop="isNormal" label="状态"><template v-slot="{row}">{{row.isNormal?'正常':'已调出'}}</template></el-table-column></el-table><template slot="footer"><el-button @click="usersVisible=false">取消</el-button><el-button type="primary" :loading="formLoading" @click="toggleUsers">切换选中人员状态</el-button></template></el-dialog>
</div>
<script nonce="${cspNonce!}">
new Vue({el:"#app",mixins:[initTableMixins],data(){return {pageForm:{pageNumber:1,pageSize:10,totalCount:0,year:new Date().getFullYear(),keywords:null},usersVisible:false,formLoading:false,currentRow:{},users:[],selectedUsers:[]}},methods:{pageData(){this.tableLoading=true;this.$axios.post(loc()+"/pageData",this.pageForm).then((res)=>{if(res.code===0){this.$set(this,"tableData",res.data.list||[]);this.$set(this.pageForm,"totalCount",res.data.totalCount||0)}}).finally(()=>{this.tableLoading=false})},openUsers(row){this.$set(this,"currentRow",row);this.$axios.post(loc()+"/findUsers",{lineId:row.usId,unionId:row.unionId}).then((res)=>{if(res.code===0){this.$set(this,"users",res.data||[]);this.$set(this,"usersVisible",true)}})},toggleUsers(){const names=this.selectedUsers.map((item)=>item.loginName);if(!names.length){this.$message.warning("请选择人员");return}this.formLoading=true;this.$axios.post(loc()+"/adjustmentUsers",{lineId:this.currentRow.usId,loginNames:names}).then((res)=>{if(res.code===0){this.$message.success(res.msg);this.openUsers(this.currentRow);this.pageData()}}).finally(()=>{this.formLoading=false})}},created(){this.pageData()}})
</script>
<!--# } #-->
@@ -0,0 +1,15 @@
<!--# layout("/layouts/platform.html"){ #-->
<div id="app" v-cloak>
<el-card shadow="never"><search @search="doSearch"><search-item label="年度"><el-date-picker v-model="pageForm.year" type="year" value-format="yyyy" @change="doSearch"></el-date-picker></search-item><search-item label="线路"><el-input v-model="pageForm.keywords" clearable></el-input></search-item></search></el-card>
<el-card shadow="never" class="mt20"><table-tool label="线路组团"></table-tool>
<el-table v-loading="tableLoading" :data="tableData" :size="tableSize">
<el-table-column type="index" :index="indexMethod" label="序号" width="60"></el-table-column><el-table-column prop="serialNumber" label="线路编号"></el-table-column><el-table-column prop="lineName" label="线路名称" min-width="180"></el-table-column><el-table-column prop="ascriptionUnionName" label="工会"></el-table-column><el-table-column prop="signUpUserNum" label="报名人数"></el-table-column>
<el-table-column label="操作" width="100"><template v-slot="{row}"><el-button size="mini" type="primary" @click="openCluster(row)">组团</el-button></template></el-table-column>
</el-table><!--#include("/layouts/pagination.html"){}#-->
</el-card>
<el-dialog title="组团人员" :visible.sync="clusterVisible" width="900px" append-to-body><el-input type="textarea" :rows="18" v-model="clustersJson" placeholder="按旧版格式编辑组团 JSON"></el-input><template slot="footer"><el-button @click="clusterVisible=false">取消</el-button><el-button type="primary" :loading="formLoading" @click="saveCluster">保存</el-button></template></el-dialog>
</div>
<script nonce="${cspNonce!}">
new Vue({el:"#app",mixins:[initTableMixins],data(){return {pageForm:{pageNumber:1,pageSize:10,totalCount:0,year:new Date().getFullYear(),keywords:null},clusterVisible:false,formLoading:false,currentRow:{},clustersJson:"[]"}},methods:{pageData(){this.tableLoading=true;this.$axios.post(loc()+"/pageData",this.pageForm).then((res)=>{if(res.code===0){this.$set(this,"tableData",res.data.list||[]);this.$set(this.pageForm,"totalCount",res.data.totalCount||0)}}).finally(()=>{this.tableLoading=false})},openCluster(row){this.$set(this,"currentRow",row);this.$axios.post(loc()+"/findClusterInfo",{lineId:row.id,usUnionId:row.ascriptionUnionId}).then((res)=>{if(res.code===0){this.$set(this,"clustersJson",JSON.stringify(res.data,null,2));this.$set(this,"clusterVisible",true)}})},saveCluster(){this.formLoading=true;this.$axios.post(loc()+"/setClusterMembers",{lineId:this.currentRow.id,clusters:this.clustersJson}).then((res)=>{if(res.code===0){this.$message.success(res.msg);this.$set(this,"clusterVisible",false);this.pageData()}}).finally(()=>{this.formLoading=false})}},created(){this.pageData()}})
</script>
<!--# } #-->
@@ -0,0 +1,90 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度"><el-date-picker v-model="pageForm.year" type="year" value-format="yyyy" @change="doSearch"></el-date-picker></search-item>
<search-item label="组团名称"><el-input v-model="pageForm.groupName" clearable @keyup.enter.native="doSearch"></el-input></search-item>
</search>
</el-card>
<el-card shadow="never" class="mt20">
<table-tool label="省内灵活组团"><el-button type="primary" size="small" @click="onEdit()">新增组团</el-button></table-tool>
<el-table v-loading="tableLoading" :data="tableData" :size="tableSize">
<el-table-column type="index" label="序号" :index="indexMethod" width="60"></el-table-column>
<el-table-column prop="year" label="年度" width="90"></el-table-column>
<el-table-column prop="groupName" label="组团名称" min-width="180"></el-table-column>
<el-table-column prop="travelAgencyName" label="旅行社" min-width="160"></el-table-column>
<el-table-column prop="activityStartTime" label="活动开始"></el-table-column>
<el-table-column prop="activityEndTime" label="活动结束"></el-table-column>
<el-table-column prop="maxSignUpNumber" label="名额" width="80"></el-table-column>
<el-table-column label="操作" width="230">
<template v-slot="{row}">
<el-button size="mini" @click="onEdit(row)">编辑</el-button>
<el-button size="mini" @click="onToggle(row)">{{row.isDisabled ? '启用' : '停用'}}</el-button>
<el-button size="mini" type="danger" @click="onDelete(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<el-dialog :visible.sync="formVisible" title="灵活组团" width="760px" append-to-body>
<el-form ref="formRef" :model="formData" label-width="110px">
<el-row :gutter="16">
<el-col :span="12"><el-form-item label="年度"><el-input-number v-model="formData.year" :min="2000" :max="2100"></el-input-number></el-form-item></el-col>
<el-col :span="12"><el-form-item label="组团名称"><el-input v-model="formData.groupName"></el-input></el-form-item></el-col>
<el-col :span="12"><el-form-item label="最大报名数"><el-input-number v-model="formData.maxSignUpNumber" :min="0"></el-input-number></el-form-item></el-col>
<el-col :span="12"><el-form-item label="排序"><el-input-number v-model="formData.sortNumber" :min="0"></el-input-number></el-form-item></el-col>
<el-col :span="12"><el-form-item label="报名开始"><el-date-picker v-model="formData.signUpStartTime" type="datetime" value-format="timestamp"></el-date-picker></el-form-item></el-col>
<el-col :span="12"><el-form-item label="报名结束"><el-date-picker v-model="formData.signUpEndTime" type="datetime" value-format="timestamp"></el-date-picker></el-form-item></el-col>
<el-col :span="12"><el-form-item label="活动开始"><el-date-picker v-model="formData.activityStartTime" type="date" value-format="timestamp"></el-date-picker></el-form-item></el-col>
<el-col :span="12"><el-form-item label="活动结束"><el-date-picker v-model="formData.activityEndTime" type="date" value-format="timestamp"></el-date-picker></el-form-item></el-col>
<el-col :span="12"><el-form-item label="联系人"><el-input v-model="formData.contactPerson"></el-input></el-form-item></el-col>
<el-col :span="12"><el-form-item label="联系电话"><el-input v-model="formData.contactNumber"></el-input></el-form-item></el-col>
</el-row>
</el-form>
<template slot="footer"><el-button @click="formVisible=false">取消</el-button><el-button type="primary" :loading="formLoading" @click="onSubmit">保存</el-button></template>
</el-dialog>
</div>
<script nonce="${cspNonce!}">
new Vue({
el: "#app",
mixins: [initTableMixins],
data() {
return {formVisible:false,formLoading:false,formData:{},pageForm:{pageNumber:1,pageSize:10,totalCount:0,year:new Date().getFullYear(),groupName:null}}
},
methods: {
pageData() {
this.tableLoading = true
this.$axios.post(loc() + "/pageData", this.pageForm).then((res) => {
if (res.code === 0) {
this.$set(this, "tableData", res.data.list || [])
this.$set(this.pageForm, "totalCount", res.data.totalCount || 0)
}
}).finally(() => { this.tableLoading = false })
},
onEdit(row) {
this.$set(this, "formData", row ? clone(row) : {year:new Date().getFullYear(),isDisabled:false,sortNumber:0})
this.$set(this, "formVisible", true)
},
onSubmit() {
this.formLoading = true
this.$axios.post(loc() + "/onSubmit", this.formData).then((res) => {
if (res.code === 0) { this.$message.success(res.msg); this.$set(this, "formVisible", false); this.pageData() }
}).finally(() => { this.formLoading = false })
},
onToggle(row) {
this.$axios.post(loc() + "/toggle/" + row.id).then((res) => { if (res.code === 0) this.pageData() })
},
onDelete(row) {
this.$confirm("确定删除该组团吗?", "提示").then(() => {
this.$axios.post(loc() + "/delete/" + row.id).then((res) => { if (res.code === 0) this.pageData() })
}).catch(() => {})
}
},
created() { this.pageData() }
})
</script>
<!--#
}
#-->
@@ -15,18 +15,39 @@ const basicForm = {
<el-form-item label="旅行社名称" prop="travelAgencyName">
<el-input maxlength="50" v-model="formData.travelAgencyName" placeholder="请输入旅行社名称"></el-input>
</el-form-item>
<el-form-item label="是否灵活组团" prop="signUpTravelAgency">
<el-radio-group v-model="formData.signUpTravelAgency">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="旅行社联系人" prop="contact">
<el-input maxlength="10" v-model="formData.contact" placeholder="请输入旅行社联系人"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="contactMobileNumber">
<el-input v-model="formData.contactMobileNumber" placeholder="请输入联系电话"></el-input>
</el-form-item>
<el-form-item label="联系人2" prop="contact2">
<el-input maxlength="20" v-model="formData.contact2" placeholder="请输入第二联系人"></el-input>
</el-form-item>
<el-form-item label="联系电话2" prop="contactMobileNumber2">
<el-input maxlength="20" v-model="formData.contactMobileNumber2" placeholder="请输入第二联系人电话"></el-input>
</el-form-item>
<el-form-item label="联系人3" prop="contact3">
<el-input maxlength="20" v-model="formData.contact3" placeholder="请输入第三联系人"></el-input>
</el-form-item>
<el-form-item label="联系电话3" prop="contactMobileNumber3">
<el-input maxlength="20" v-model="formData.contactMobileNumber3" placeholder="请输入第三联系人电话"></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input maxlength="50" v-model="formData.email" placeholder="请输入邮箱"></el-input>
</el-form-item>
<el-form-item label="官网" prop="officialWebsite">
<el-input maxlength="100" v-model="formData.officialWebsite" placeholder="请输入官网"></el-input>
</el-form-item>
<el-form-item label="最大报名数" prop="maxSignUpNumber">
<el-input-number :min="0" :precision="0" :step="1" style="width: 100%" v-model="formData.maxSignUpNumber"></el-input-number>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input maxlength="100"
type="textarea"
@@ -35,33 +56,36 @@ const basicForm = {
</el-form-item>
<el-form-item label="是否启用" prop="isDisabled">
<el-switch
:active-value="true"
:inactive-value="false"
:active-value="false"
:inactive-value="true"
active-color="#13ce66"
inactive-color="#ff4949"
v-model="formData.isDisabled">
</el-switch>
</el-form-item>
<el-form-item label="移动端缩略图" prop="file">
<file-upload :value.sync="formData.file" accept=".jpg,.jpeg,.png"
<el-form-item label="移动端缩略图" prop="files">
<file-upload :value.sync="formData.files" accept=".jpg,.jpeg,.png"
:upload_number="1" upload_result_category="interval"
complete_result upload_mode="drag"></file-upload>
</el-form-item>
</el-form>
<el-row class="mt10" justify="end" type="flex">
<el-button @click="$emit('refresh')">取消</el-button>
<el-button @click="onSubmit" type="primary">提交</el-button>
<el-button :loading="formLoading" @click="onSubmit" type="primary">提交</el-button>
</el-row>
</div>
`,
data() {
return {
formLoading: false,
formData: {
isDisabled: true
isDisabled: false,
signUpTravelAgency: false
},
formRules: {
serialNumber: [{required: true, message: '请输入编号', trigger: ['change', 'blur']}],
travelAgencyName: [{required: true, message: '请输入旅行社名称', trigger: ['change', 'blur']}],
signUpTravelAgency: [{required: true, message: '请选择是否灵活组团', trigger: ['change', 'blur']}],
contact: [{required: true, message: '请输入联系人姓名', trigger: ['change', 'blur']}],
contactMobileNumber: [
{required: true, message: '请输入联系人电话', trigger: 'blur',},
@@ -98,14 +122,20 @@ const basicForm = {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
const resp = await this.$axios.post("/platform/recuperation/travelAgency/onSubmit", this.formData)
if (resp.code === 0) {
this.$message.success(resp.msg)
this.$emit('refresh')
} else {
this.$message.warning(resp.msg)
}
}).then(() => {
this.formLoading = true
this.$axios.post("/platform/recuperation/travelAgency/onSubmit", this.formData)
.then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.$emit('refresh')
} else {
this.$message.warning(resp.msg)
}
})
.finally(() => {
this.formLoading = false
})
})
}
})
@@ -39,7 +39,7 @@ layout("/layouts/platform.html"){
新增旅行社
</el-button>
</table-tool>
<el-table :data="tableData" @sort-change="pageOrder" :size="tableSize">
<el-table v-loading="tableLoading" :data="tableData" @sort-change="pageOrder" :size="tableSize">
<el-table-column label="序号" type="index" :index="indexMethod" width="60"></el-table-column>
<el-table-column
:label="column.label"
@@ -54,8 +54,8 @@ layout("/layouts/platform.html"){
>
<template v-slot="{ row }" v-if="column.prop === 'isDisabled'">
<el-switch
:active-value="true"
:inactive-value="false"
:active-value="false"
:inactive-value="true"
@change="(val)=>{travelAgencyStatusChange(row.id)}"
active-color="#13ce66"
inactive-color="#ff4949"
@@ -121,19 +121,27 @@ layout("/layouts/platform.html"){
{label: '旅行社编号', prop: 'serialNumber', sortable: true},
{label: '联系人', prop: 'contact'},
{label: '联系人手机', prop: 'contactMobileNumber'},
{label: '最大报名数', prop: 'maxSignUpNumber', sortable: true},
{label: '已报名人数', prop: 'signUpUserNum', sortable: true},
{label: '邮箱', prop: 'email'},
{label: '是否启用', prop: 'isDisabled'}
],
}
},
methods: {
async travelAgencyStatusChange(id) {
const resp = await $.post(loc() + '/openClosedTravelAgency/' + id)
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
travelAgencyStatusChange(id) {
this.tableLoading = true
$.post(loc() + '/openClosedTravelAgency/' + id)
.then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
})
.always(() => {
this.tableLoading = false
})
},
refresh() {
this.doSearch()
@@ -171,15 +179,20 @@ layout("/layouts/platform.html"){
.catch(() => {})
},
pageData() {
this.$axios.post(loc() + "/pageData", this.pageForm).then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
this.tableLoading = true
this.$axios.post(loc() + "/pageData", this.pageForm)
.then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
.finally(() => {
this.tableLoading = false
})
},
},
async created() {
created() {
this.pageData()
}
})
@@ -0,0 +1,15 @@
<!--# layout("/layouts/platform_h5.html"){ #-->
<style>.rec-banner{width:100%;height:180px;object-fit:cover}.rec-grid{margin:12px}.rec-notice{margin:12px;padding:14px;background:#fff;border-radius:8px;line-height:1.7}.rec-notice img{max-width:100%}</style>
<div id="app" v-cloak>
<van-nav-bar title="职工疗休养" left-text="返回" left-arrow @click-left="$pjaxReplace('/platform/h5/home')" fixed placeholder></van-nav-bar>
<img class="rec-banner" src="/assets/mobile/img/therapyRecuperation/index1.jpeg">
<van-grid class="rec-grid" :column-num="4" :border="false">
<van-grid-item v-for="item in entries" :key="item.type" :icon="item.icon" :text="item.label" @click="toList(item.type)"></van-grid-item>
</van-grid>
<div class="rec-notice"><van-image width="190" src="/assets/mobile/img/therapyRecuperation/title.png"></van-image><div v-html="configData.notice || '请按学校疗休养服务须知完成报名。'"></div></div>
<van-tabbar v-model="tab"><van-tabbar-item icon="home-o">首页</van-tabbar-item><van-tabbar-item icon="search" @click="toList(1)">线路</van-tabbar-item><van-tabbar-item icon="manager-o" @click="$pjaxReplace('/platform/h5/recuperation/mine')">我的报名</van-tabbar-item></van-tabbar>
</div>
<script nonce="${cspNonce!}">
new Vue({el:"#app",data(){return {tab:0,configData:{},entries:[{type:0,label:"省内线路",icon:"location-o"},{type:1,label:"省外线路",icon:"guide-o"},{type:2,label:"灵活组团",icon:"friends-o"},{type:3,label:"疗休养基地",icon:"hotel-o"}]}},methods:{toList(type){this.$pjaxReplace("/platform/h5/recuperation/lineList?type="+type)},loadConfig(){this.$axios.post("/platform/h5/recuperation/config").then((res)=>{if(res.code===0)this.$set(this,"configData",res.data||{})})}},created(){this.loadConfig()}})
</script>
<!--# } #-->
@@ -0,0 +1,11 @@
<!--# layout("/layouts/platform_h5.html"){ #-->
<style>.rec-info{margin:12px;padding:16px;background:#fff;border-radius:8px}.rec-content{line-height:1.7;word-break:break-all}.bottom-space{height:70px}</style>
<div id="app" v-cloak>
<van-nav-bar title="项目详情" left-text="返回" left-arrow @click-left="back" fixed placeholder></van-nav-bar>
<div class="rec-info"><van-cell-group><van-cell title="项目名称" :value="info.lineName||info.groupName||info.travelAgencyName||info.baseName"></van-cell><van-cell title="区域" :value="info.regionalNature"></van-cell><van-cell title="旅行社" :value="info.travelAgencyName||(info.travelAgency&&info.travelAgency.travelAgencyName)"></van-cell><van-cell title="联系人" :value="info.contactMobileNumber||info.contactNumber||info.baseContactNumber"></van-cell><van-cell title="报名时间" :label="formatRange(info.signUpStartTime,info.signUpEndTime)"></van-cell><van-cell title="出行时间" :label="formatRange(info.playStartTime||info.activityStartTime,info.playEndTime||info.activityEndTime)"></van-cell></van-cell-group><div class="rec-content" v-html="info.content||info.note"></div></div><div class="bottom-space"></div>
<van-submit-bar button-text="立即报名" @submit="toSign"></van-submit-bar>
</div>
<script nonce="${cspNonce!}">
new Vue({el:"#app",data(){const query=new URLSearchParams(location.search);return {id:query.get("id"),type:Number(query.get("type")||0),unionId:query.get("unionId")||"",travelAgencyId:query.get("travelAgencyId")||"",info:{}}},methods:{back(){this.$pjaxReplace("/platform/h5/recuperation/lineList?type="+this.type)},formatRange(start,end){return start&&end?this.$moment(start).format("YYYY-MM-DD")+" 至 "+this.$moment(end).format("YYYY-MM-DD"):"待定"},load(){this.$axios.post("/platform/h5/recuperation/lineInfoData",{id:this.id,unionId:this.unionId,type:this.type}).then((res)=>{if(res.code===0)this.$set(this,"info",res.data||{})})},toSign(){this.$pjaxReplace("/platform/h5/recuperation/signForm?id="+encodeURIComponent(this.id)+"&type="+this.type+"&unionId="+encodeURIComponent(this.unionId)+"&travelAgencyId="+encodeURIComponent(this.travelAgencyId))}},created(){this.load()}})
</script>
<!--# } #-->
@@ -0,0 +1,13 @@
<!--# layout("/layouts/platform_h5.html"){ #-->
<div id="app" v-cloak>
<van-nav-bar title="疗休养项目" left-text="返回" left-arrow @click-left="$pjaxReplace('/platform/h5/recuperation')" fixed placeholder></van-nav-bar>
<van-sticky offset-top="46px"><van-dropdown-menu><year-van-dropdown-item :num="5" v-model="pageForm.year" @change="doSearch"></year-van-dropdown-item><van-dropdown-item v-model="pageForm.lineUnionType" :options="unionModes" @change="doSearch"></van-dropdown-item></van-dropdown-menu></van-sticky>
<table-list api="/platform/h5/recuperation/pageData" :page_form.sync="pageForm" ref="tableListRef" title="lineName" @ready="doSearch">
<template v-slot="{row}"><table-column label="名称">{{row.lineName || row.groupName || row.travelAgencyName || row.baseName}}</table-column><table-column label="活动时间" v-if="row.playStartTime || row.activityStartTime">{{row.playStartTime || row.activityStartTime}} 至 {{row.playEndTime || row.activityEndTime}}</table-column><table-column label="联系人">{{row.contact || row.contactPerson || row.baseContactPerson}}</table-column></template>
<template #actions="{row}"><div class="action-btn" @click="onView(row)"><i class="fa fa-eye"></i><span>查看报名</span></div></template>
</table-list>
</div>
<script nonce="${cspNonce!}">
new Vue({el:"#app",data(){const query=new URLSearchParams(location.search);return {pageForm:{pageNumber:1,pageSize:10,totalCount:0,year:new Date().getFullYear(),type:Number(query.get("type")||0),lineUnionType:1},unionModes:[{text:"本工会线路",value:1},{text:"公开线路",value:2},{text:"校工会线路",value:3}]}},methods:{doSearch(){this.$nextTick(()=>{this.$set(this.pageForm,"pageNumber",1);this.$set(this.pageForm,"totalCount",0);this.$refs.tableListRef.doSearch()})},onView(row){const id=row.usId||row.id;this.$pjaxReplace("/platform/h5/recuperation/lineInfo?id="+encodeURIComponent(id)+"&type="+this.pageForm.type+"&unionId="+encodeURIComponent(row.takePartInUnionId||"")+"&travelAgencyId="+encodeURIComponent(row.travelAgencyId||""))}}})
</script>
<!--# } #-->
@@ -0,0 +1,11 @@
<!--# layout("/layouts/platform_h5.html"){ #-->
<div id="app" v-cloak>
<van-nav-bar title="我的疗休养" left-text="返回" left-arrow @click-left="back" fixed placeholder></van-nav-bar>
<van-sticky offset-top="46px"><van-dropdown-menu><year-van-dropdown-item :num="5" v-model="pageForm.year" @change="doSearch"></year-van-dropdown-item><van-dropdown-item v-model="pageForm.type" :options="types" @change="doSearch"></van-dropdown-item></van-dropdown-menu></van-sticky>
<table-list api="/platform/h5/recuperation/minePageData" :page_form.sync="pageForm" ref="tableListRef" title="lineName" @ready="doSearch"><template v-slot="{row}"><table-column label="项目">{{row.lineName||row.travelAgencyName||row.baseName}}</table-column><table-column label="报名时间">{{row.signingUptime}}</table-column><table-column label="状态">{{stateText(row.stateId)}}</table-column></template><template #actions="{row}"><div class="action-btn delete" @click="openDelete(row)"><i class="fa fa-trash"></i><span>撤销报名</span></div></template></table-list>
<van-popup v-model="deleteVisible" round position="bottom" :close-on-click-overlay="false"><div style="padding:20px"><h3>确认撤销报名</h3><p>撤销后该报名记录及关联家属、床位和变更记录将一并删除。</p><van-button block type="danger" :loading="formLoading" @click="deleteEnroll">确认撤销</van-button><van-button block style="margin-top:10px" @click="closeDelete">取消</van-button></div></van-popup>
</div>
<script nonce="${cspNonce!}">
new Vue({el:"#app",data(){return {pageForm:{pageNumber:1,pageSize:10,totalCount:0,year:new Date().getFullYear(),type:0},types:[{text:"省内线路",value:0},{text:"省外线路",value:1},{text:"灵活组团",value:2},{text:"基地",value:3}],deleteVisible:false,formLoading:false,currentRow:{},popupHistoryToken:null}},methods:{back(){if(this.deleteVisible){this.closeDelete();return}this.$pjaxReplace("/platform/h5/recuperation")},doSearch(){this.$nextTick(()=>{this.$set(this.pageForm,"pageNumber",1);this.$set(this.pageForm,"totalCount",0);this.$refs.tableListRef.doSearch()})},stateText(state){const map={2710:"分工会审核",2720:"线路工会审核",2730:"校工会审核",2750:"审核通过"};return map[state]||"待处理"},openDelete(row){this.$set(this,"currentRow",row);this.$set(this,"deleteVisible",true);window.h5PopupHistory.open(this.popupHistoryToken,"deleteConfirm")},closeDelete(){this.$set(this,"deleteVisible",false);window.h5PopupHistory.close(this.popupHistoryToken,"deleteConfirm")},closeDeleteState(){this.$set(this,"deleteVisible",false)},deleteEnroll(){this.formLoading=true;this.$axios.post("/platform/h5/recuperation/delete/"+this.currentRow.id).then((res)=>{if(res.code===0){this.$toast.success(res.msg);this.closeDelete();this.doSearch()}else this.$toast.fail(res.msg)}).finally(()=>{this.formLoading=false})}},mounted(){this.$set(this,"popupHistoryToken",window.h5PopupHistory.register((key)=>{if(key==="deleteConfirm")this.closeDeleteState()}))},beforeDestroy(){window.h5PopupHistory.unregister(this.popupHistoryToken)}})
</script>
<!--# } #-->
@@ -0,0 +1,10 @@
<!--# layout("/layouts/platform_h5.html"){ #-->
<div id="app" v-cloak>
<van-nav-bar title="疗休养报名" left-text="返回" left-arrow @click-left="back" fixed placeholder></van-nav-bar>
<van-form @submit="openConfirm"><van-field v-model="formData.mobile" name="mobile" label="手机号码" type="tel" required :rules="[{required:true,message:'请填写手机号码'}]"></van-field><van-field v-model="formData.idCard" name="idCard" label="身份证号" required :rules="[{required:true,message:'请填写身份证号'}]"></van-field><van-field v-model="formData.familyNumber" name="familyNumber" label="家属人数" type="digit"></van-field><van-field v-model="formData.remark" name="remark" label="身体情况备注" type="textarea" rows="3"></van-field><div style="margin:16px"><van-button round block type="info" native-type="submit" :loading="formLoading">提交报名</van-button></div></van-form>
<van-popup v-model="confirmVisible" round position="bottom" :close-on-click-overlay="false"><div style="padding:20px"><h3>确认报名</h3><p>请确认填写信息真实、完整。提交后如需调整,请在“我的报名”中操作。</p><van-button block type="info" :loading="formLoading" @click="submit">确认提交</van-button><van-button block style="margin-top:10px" @click="closeConfirm">取消</van-button></div></van-popup>
</div>
<script nonce="${cspNonce!}">
new Vue({el:"#app",data(){const query=new URLSearchParams(location.search);return {id:query.get("id"),type:Number(query.get("type")||0),unionId:query.get("unionId")||"",travelAgencyId:query.get("travelAgencyId")||"",formData:{familyNumber:0,isNormal:true},formLoading:false,confirmVisible:false,popupHistoryToken:null}},methods:{back(){if(this.confirmVisible){this.closeConfirm();return}this.$pjaxReplace("/platform/h5/recuperation/lineInfo?id="+encodeURIComponent(this.id)+"&type="+this.type+"&unionId="+encodeURIComponent(this.unionId)+"&travelAgencyId="+encodeURIComponent(this.travelAgencyId))},openConfirm(){this.$set(this,"confirmVisible",true);window.h5PopupHistory.open(this.popupHistoryToken,"signConfirm")},closeConfirm(){this.$set(this,"confirmVisible",false);window.h5PopupHistory.close(this.popupHistoryToken,"signConfirm")},closeConfirmState(){this.$set(this,"confirmVisible",false)},submit(){this.formLoading=true;const target={type:this.type};if(this.type===0||this.type===1){target.takePartInLineId=this.id;target.takePartInUnionId=this.unionId}else if(this.type===2){target.takePartInTravelAgencyId=this.travelAgencyId}else{target.takePartInBaseManagementId=this.id}const data=Object.assign({},this.formData,target);this.$axios.post("/platform/h5/recuperation/submit",data).then((res)=>{if(res.code===0){this.$toast.success(res.msg);return window.h5PopupHistory.clear(this.popupHistoryToken).then(()=>{this.$pjaxReplace("/platform/h5/recuperation/mine")})}this.$toast.fail(res.msg)}).finally(()=>{this.formLoading=false})}},mounted(){this.$set(this,"popupHistoryToken",window.h5PopupHistory.register((key)=>{if(key==="signConfirm")this.closeConfirmState()}))},beforeDestroy(){window.h5PopupHistory.unregister(this.popupHistoryToken)}})
</script>
<!--# } #-->