This commit is contained in:
@jyuhsin
2025-07-31 17:40:26 +08:00
parent bcca78d121
commit c3e2365f39
43 changed files with 5108 additions and 94 deletions
@@ -9,6 +9,7 @@ import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
@@ -19,10 +20,12 @@ import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
import com.budwk.app.zhgh.staffbenefit.psychology.model.PsychologyDoctor;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
@@ -48,6 +51,8 @@ public class CondolenceApplyController {
@Inject
private CondolenceService condolenceService;
@Inject
private FlowEngine flowEngine;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/apply/index.html")
@@ -72,7 +77,7 @@ public class CondolenceApplyController {
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariale,
ins.variable instanceVariable,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
@@ -81,7 +86,9 @@ public class CondolenceApplyController {
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariale
t.variable taskVariable,
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
FROM
condolence info
LEFT JOIN condolence_type type ON info.type = type.id
@@ -148,10 +155,13 @@ public class CondolenceApplyController {
}
@At
@ApiOperation("删除")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("condolence.apply")
@ApiOperation("职工慰问详情")
public Result fetchOne(@Valid String id) {
Condolence condolence = condolenceService.fetch(id);
return Result.success(condolence);
@SLog(type = "condolence", tag = "删除职工慰问", msg = "删除职工慰问")
public Result delete(@Param("id") String id) {
condolenceService.delete(id);
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
return Result.success();
}
}
@@ -1,46 +0,0 @@
package com.budwk.app.zhgh.staffbenefit.condolence.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
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;
/**
* @ClassName CondolenceStatisticsController
* @Author JyuHsin
* @Date 2025/7/30 14:51
* @Version 1.0
* @Description TODO
*/
@IocBean
@At("/platform/condolence/statistics")
@Api("职工慰问统计")
@Ok("json:full")
public class CondolenceStatisticsController {
@Inject
private CondolenceService condolenceService;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/statistics/index.html")
@SaCheckLogin
public void index() {}
@At
@ApiOperation("分页查询")
@SaCheckPermission("condolence.statistics")
public Result pageData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "type") String type) {
return null;
}
}
@@ -0,0 +1,33 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.constant;
import com.budwk.app.base.annotation.DictEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationSignUpMode
* @Description: 线路创建模式
* @Author zxc
* @Date 2022/6/2:15:22
* @Version V1.0
**/
@Getter
@DictEnum(key = "RecuperationLineCreateMode", name = "线路创建模式")
@AllArgsConstructor
public enum RecuperationLineCreateMode {
/**
* 分工会
*/
UNION(1, "分工会"),
/**
* 校工会
*/
SCHOOL(2, "校工会");
private final int value;
private final String label;
}
@@ -0,0 +1,31 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.constant;
import com.budwk.app.base.annotation.DictEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationProvinceType
* @Description: TODO
* @Author zxc
* @Date 2022/6/2:14:08
* @Version V1.0
**/
@Getter
@DictEnum(key = "RecuperationProvinceType", name = "出行模式")
@AllArgsConstructor
public enum RecuperationProvinceType {
/**
* 省内
*/
provinceIn("省内线路", "省内"),
/**
* 省外
*/
provinceOut("省外线路", "省外");
private final String label;
private final String value;
}
@@ -0,0 +1,34 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.constant;
import com.budwk.app.base.annotation.DictEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationSignUpMode
* @Description: 报名模式
* @Author zxc
* @Date 2022/6/2:15:22
* @Version V1.0
**/
@Getter
@DictEnum(key = "RecuperationSignUpMode", name = "报名模式")
@AllArgsConstructor
public enum RecuperationSignUpMode {
/**
* 分工会模式
*/
UNION(1, "分工会组织", new String[]{"H04", "A06", "sysadmin"}),
/**
* 自由模式
*/
FREE(2, "校工会组织", new String[]{"A06", "sysadmin"});
private final int value;
private final String label;
private final String[] roles;
}
@@ -0,0 +1,39 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.constant;
/**
* 审核状态
*/
public interface RecuperationState {
/**
* 待分工会审核
*/
Integer UNIT = 2710;
/**
* 分工会审核不通过
*/
Integer UNITFAIL = 2715;
/**
* 待选择线路分工会审核
*/
Integer LINEUNIT = 2720;
/**
* 选择线路分工会不通过
*/
Integer LINEUNITFAIL = 2725;
/**
* 待校工会审核
*/
Integer SCHOOL = 2730;
/**
* 校工会审核不通过
*/
Integer SCHOOLFAIL = 2735;
/**
* 审核通过
*/
Integer PASS = 2750;
}
@@ -0,0 +1,359 @@
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.annotation.Excel;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.model.ExcelImportRes;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
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;
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.RecuperationBaseManagerService;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationTravelAgencyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.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.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
/**
* @ClassName RecuperationBaseManagerController
* @Author JyuHsin
* @Date 2025/7/31 10:41
* @Version 1.0
* @Description TODO
*/
@Slf4j
@IocBean
@At("/platform/recuperation/baseManagement")
@Api("疗休养目的地管理")
@Ok("json:full")
public class RecuperationBaseManagerController {
@Inject
private Dao dao;
@Inject
private RecuperationBaseManagerService baseManagerService;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/baseManagement/index.html")
@SaCheckLogin
public void index() {}
@At
@ApiOperation("分页查询")
@SaCheckPermission("recuperation.baseManagement")
public Result pageData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "lotId") String lotId,
@Param(value = "baseName") String baseName,
@Param(value = "unionId") String unionId,
@Param(value = "travelAgencyId") String travelAgencyId,
@Param(value = "regionalNature") String regionalNature) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
tb.id,
tb.sortNumber,
tb.baseName,
tb.regionalNature,
tb.year,
tb.isDisabled,
tb.lotId,
tb.createUnionId,
tb.signUpStartTime,
tb.signUpEndTime,
tb.changeEndTime,
tb.createMode,
tb.activityStartTime,
tb.activityEndTime,
tb.file,
tb.baseContactPerson,
tb.baseContactNumber,
tb.file AS fileId,
gh.name createUnionName,
u.username createUserName,
ta.travelAgencyName,
ta.contact,
ta.contactMobileNumber,
ta.officialWebsite
FROM
`recuperation_base_management` tb
LEFT JOIN 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
$condition
""");
cnd.where().andEX("tb.`year`", "=", year);
cnd.where().andEX("tb.lotId", "=", lotId);
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");
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());
}
} else {
cnd.andEX("tb.createUnionId", "=", unionId);
}
sql.setCondition(cnd);
Pagination pagination = baseManagerService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ApiOperation("新增/编辑疗休养基地")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.baseManagement")
@SLog(type = "recuperation", tag = "新增/编辑疗休养基地", msg = "新增/编辑疗休养基地")
public Result onSubmit(RecuperationBaseManagement baseManagement) {
baseManagement.setCreateUnionId(SecurityUtil.getUnionId());
dao.insertOrUpdate(baseManagement);
return Result.success();
}
@At("/openClosedBase/?")
@ApiOperation("开启或关闭基地")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.baseManagement")
@SLog(type = "recuperation", tag = "开启或关闭基地", msg = "开启或关闭基地")
public Result openClosedBase(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
dao.update(RecuperationBaseManagement.class, Chain.makeSpecial("isDisabled", "isDisabled ^ 1"), Cnd.where("id", "=", id));
return Result.success();
}
@At
@ApiOperation("删除基地")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.baseManagement")
@SLog(type = "recuperation", tag = "删除基地", msg = "删除基地")
public Result onDelete(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
dao.delete(RecuperationBaseManagement.class, id);
return Result.success();
}
@At("/selectBaseManageById/?")
@ApiOperation("查询一条基地线路")
@SaCheckPermission("recuperation.baseManagement")
public Result selectBaseManageById(String id) {
Assert.notBlank(id);
RecuperationBaseManagement base = dao.fetchLinks(dao.fetch(RecuperationBaseManagement.class, id), "travelAgency");
RecuperationLot lot = dao.fetch(RecuperationLot.class, base.getLotId());
NutMap nutMap = Lang.obj2nutmap(base);
nutMap.put("lotName", lot.getLotName());
return Result.success(nutMap);
}
@At
@ApiOperation("查询所有酒店")
@SaCheckPermission("recuperation.baseManagement")
public Result listAllBase(String startYear, String endYear, String year) {
Sql sql = Sqls.create("select * from `the_rapy_recuperation_base_management` tb left join `the_rapy_recuperation_lot` lot on lot.id=tb.lotId $condition");
Cnd cnd = Cnd.NEW();
cnd.andEX("tb.`year`", ">=", startYear);
cnd.andEX("tb.`year`", "<=", endYear);
cnd.andEX("tb.`year`", "=", year);
sql.setCondition(cnd);
List<NutMap> listMap = baseManagerService.listMap(sql);
return Result.success(listMap);
}
@At
@ApiOperation("手机端酒店介绍所有信息")
@SaCheckPermission("recuperation.baseManagement")
public Result selectBaseAllInfo(String id) {
Assert.notBlank(id);
NutMap nutMap = baseManagerService.selectBaseAllInfo(id);
return Result.success(nutMap);
}
@At
@Ok("void")
@SaCheckPermission("recuperation.baseManagement")
public void downloadTemplate(HttpServletResponse response) {
try {
//查旅行社,转数组
List<RecuperationTravelAgency> travelAgencys = dao.query(RecuperationTravelAgency.class, Cnd.NEW().desc("serialNumber"));
List<String> excelTravelAgencyList = travelAgencys.stream().map(v -> v.getTravelAgencyName() + "_" + v.getId()).toList();
String[] excelTravelAgencyArrs = excelTravelAgencyList.toArray(new String[excelTravelAgencyList.size()]);
//查标段,转数组
List<RecuperationLot> lots = dao.query(RecuperationLot.class, Cnd.NEW().asc("id"));
List<String> excelLotList = lots.stream().map(v -> v.getLotName() + "_" + v.getId()).toList();
String[] excelLotArrs = excelLotList.toArray(new String[excelLotList.size()]);
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("年度", "year", 20));
entities.add(new ExcelExportEntity("排序编号", "sortNumber", 20));
entities.add(new ExcelExportEntity("目的地名称", "baseName", 20));
ExcelExportEntity travelEntity = new ExcelExportEntity("所属旅行社", "travelAgencyId", 20);
travelEntity.setReplace(excelTravelAgencyArrs);
travelEntity.setAddressList(true);
entities.add(travelEntity);
ExcelExportEntity regionalEntity = new ExcelExportEntity("活动范围(省内/省外)", "regionalNature", 20);
regionalEntity.setReplace(new String[]{"省内_省内", "省外_省外"});
regionalEntity.setAddressList(true);
entities.add(regionalEntity);
ExcelExportEntity lotEntity = new ExcelExportEntity("时间标段", "lotId", 20);
lotEntity.setReplace(excelLotArrs);
lotEntity.setAddressList(true);
entities.add(lotEntity);
entities.add(new ExcelExportEntity("详细信息", "content", 20));
ExcelExportEntity ableEntity = new ExcelExportEntity("是否启用(是/否)", "isDisabled", 20);
ableEntity.setReplace(new String[]{"是_1", "否_0"});
ableEntity.setAddressList(true);
entities.add(ableEntity);
entities.add(new ExcelExportEntity("报名开始时间", "signUpStartTime", 20));
entities.add(new ExcelExportEntity("报名截至时间", "signUpEndTime", 20));
entities.add(new ExcelExportEntity("变更截至时间", "changeEndTime", 20));
entities.add(new ExcelExportEntity("活动开始时间", "activityStartTime", 20));
entities.add(new ExcelExportEntity("活动结束时间", "activityEndTime", 20));
entities.add(new ExcelExportEntity("预计费用", "estimatedCost", 20));
ExcelExportEntity createEntity = new ExcelExportEntity("组织形式(分工会/校工会)", "createMode", 20);
createEntity.setReplace(new String[]{"校工会_1", "分工会_2"});
createEntity.setAddressList(true);
entities.add(createEntity);
entities.add(new ExcelExportEntity("目的地联系人", "baseContactPerson", 20));
entities.add(new ExcelExportEntity("联系电话", "baseContactNumber", 20));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, new ArrayList<>());
CommonDownloadUtil.download("目的地导入模板.xlsx", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
}
@At
@ApiOperation("目的地导入")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.baseManagement")
@SLog(type = "recuperation", tag = "目的地导入", msg = "目的地导入")
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Result baseManagementImport(@Param("file") TempFile file) {
List<BaseManagerExcelMode> excelList = ExcelImportUtil.importExcel(file.getFile(), BaseManagerExcelMode.class, new ImportParams());
// 创建结果集
ExcelImportRes<BaseManagerExcelMode> excelImportRes = new ExcelImportRes<>();
excelImportRes.setTotalRecords(excelList.size());
List<RecuperationTravelAgency> travelList = dao.query(RecuperationTravelAgency.class, Cnd.NEW());
Map<String, String> travelMap = travelList.stream().collect(Collectors.toMap(RecuperationTravelAgency::getTravelAgencyName, RecuperationTravelAgency::getId));
List<RecuperationLot> lotList = dao.query(RecuperationLot.class, Cnd.NEW());
Map<String, String> lotMap = lotList.stream().collect(Collectors.toMap(RecuperationLot::getLotName, RecuperationLot::getId));
for (int i = 0; i < excelList.size(); i++) {
BaseManagerExcelMode management = excelList.get(i);
if(management.getYear() == null) {
management.setErrInfo("年度为空", i + 1);
continue;
}
if (StrUtil.isBlank(management.getBaseName())) {
management.setErrInfo("目的地名称为空", i + 1);
continue;
}
if (StrUtil.isBlank(management.getTravelAgencyId())) {
management.setErrInfo("旅行社名称为空", i + 1);
continue;
}
if (StrUtil.isBlank(management.getLotId())) {
management.setErrInfo("时间标段为空", i + 1);
continue;
}
if (StrUtil.isBlank(management.getRegionalNature())) {
management.setErrInfo("活动范围为空", i + 1);
continue;
}
RecuperationBaseManagement baseManagement = new RecuperationBaseManagement();
if("校工会".equals(management.getCreateMode())) {
management.setCreateMode("1");
} else if("分工会".equals(management.getCreateMode())) {
management.setCreateMode("2");
}
BeanUtil.copyProperties(management, baseManagement);
if("".equals(management.getIsDisabled())) {
baseManagement.setIsDisabled(true);
} else if("".equals(management.getIsDisabled())) {
baseManagement.setIsDisabled(false);
}
baseManagement.setTravelAgencyId(travelMap.get(management.getTravelAgencyId()));
baseManagement.setLotId(lotMap.get(management.getLotId()));
try {
dao.insertOrUpdate(baseManagement);
} catch (Exception e) {
log.error("导入目的地失败:{}", e.getMessage());
management.setErrInfo("添加失败", i + 1);
}
}
// 添加错误记录
excelImportRes.setErrorDetails(excelList.stream().filter(s -> StrUtil.isNotBlank(s.getErrMsg())).collect(Collectors.toList()));
excelImportRes.setFailedCount(excelImportRes.getErrorDetails().size());
excelImportRes.setSuccessCount(Math.max(excelList.size() - excelImportRes.getFailedCount(), 0));
return Result.success(excelImportRes);
}
}
@@ -0,0 +1,121 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationBaseManagement;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationConfig;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationLine;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationLot;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @ClassName RecuperationConfigController
* @Author JyuHsin
* @Date 2025/7/30 16:04
* @Version 1.0
* @Description TODO
*/
@IocBean
@At("/platform/recuperation/config")
@Api("疗休养配置管理")
@Ok("json:full")
public class RecuperationConfigController {
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/config/index.html")
@SaCheckLogin
public void index() {}
@At
@ApiOperation("新增/编辑疗休养配置")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.config")
@SLog(type = "recuperation", tag = "新增/编辑疗休养配置", msg = "新增/编辑疗休养配置")
public Result onSubmit(RecuperationConfig config, String[] lotDeleteList) {
if (Strings.isNotBlank(config.getId())) {
if (Lang.isNotEmpty(lotDeleteList)) {
dao.clear(RecuperationLot.class, Cnd.where("id", "in", lotDeleteList));
}
dao.updateWith(config, "lots");
List<RecuperationLot> collect = config.getLots().stream().filter(v -> v.getConfigId() == null).collect(Collectors.toList());
for (RecuperationLot obj : collect) {
obj.setConfigId(config.getId());
}
dao.insert(collect);
} else {
dao.insertWith(config, "lots");
}
return Result.success();
}
@At
@ApiOperation("查询配置")
@SaCheckLogin
public Result fetchOne() {
RecuperationConfig config = dao.fetchLinks(dao.fetch(RecuperationConfig.class), "lots", Cnd.NEW().desc("lotValue"));
return Result.success(config);
}
@At
@ApiOperation("查使用该标段的线路和目的地")
@SaCheckLogin
public Result getLotsById(String lotId) {
List<String> lineNames = new ArrayList<>();
List<String> baseNames = new ArrayList<>();
Map<String, List<String>> map = new HashMap<>();
List<RecuperationLine> lineList = dao.query(RecuperationLine.class, Cnd.where("lotId", "=", lotId));
if (!CollectionUtils.isEmpty(lineList)){
lineList.forEach(v-> lineNames.add(v.getLineName()));
map.put("line",lineNames);
}
List<RecuperationBaseManagement> managementList = dao.query(RecuperationBaseManagement.class, Cnd.where("lotId", "=", lotId));
if (!CollectionUtils.isEmpty(managementList)){
managementList.forEach(v-> baseNames.add(v.getBaseName()));
map.put("base",baseNames);
}
return Result.success(map);
}
@At
@ApiOperation("强制删除标段时长,会删除已绑定的线路和目的地")
@SaCheckLogin
@Aop(TransAop.READ_COMMITTED)
@SLog(type = "recuperation", tag = "删除标段", msg = "删除标段")
public Result deleteLotById(String lotId) {
dao.clear(RecuperationLot.class, Cnd.where("id","=",lotId));
List<RecuperationLine> lineList = dao.query(RecuperationLine.class, Cnd.where("lotId", "=", lotId));
if (!CollectionUtils.isEmpty(lineList)) {
lineList.forEach(v -> v.setLotId(null));
dao.update(lineList);
}
List<RecuperationBaseManagement> managementList = dao.query(RecuperationBaseManagement.class, Cnd.where("lotId", "=", lotId));
if (!CollectionUtils.isEmpty(managementList)) {
managementList.forEach(v -> v.setLotId(null));
dao.update(managementList);
}
return Result.success();
}
}
@@ -0,0 +1,95 @@
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* @ClassName RecuperationEvaluateStatisticsController
* @Author JyuHsin
* @Date 2025/7/31 15:55
* @Version 1.0
* @Description TODO
*/
@Slf4j
@IocBean
@At("/platform/recuperation/statistics")
@Api("疗休养评价统计")
@Ok("json:full")
public class RecuperationEvaluateStatisticsController {
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/statistics/index.html")
@SaCheckLogin
public void index() {}
@At
@ApiOperation("分页查询")
@SaCheckPermission("recuperation.statistics")
public Result pageData(PageForm pageForm,
@Param(value = "lineId") String lineId,
@Param(value = "unionId") String unionId,
@Param(value = "unitId") String unitId,
@Param(value = "personType") String personType,
@Param(value = "userState") String userState,
@Param(value = "evaluateScore") String evaluateScore) {
Sql sql = Sqls.create("""
SELECT
we.evaluateText,
we.evaluateScore,
we.userName,
we.loginName,
u.unionname,
u.unitname,
u.userState,
u.personType,
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_union_select us ON us.id = en.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(pageForm.getSearchName()) && StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
}
if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), "ascending".equals(pageForm.getPageOrderBy()) ? "asc" : "desc");
} else {
cnd.desc("we.evaluateScore");
}
if(StrUtil.isNotBlank(lineId)) {
cnd.andEX("we.lineId", "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");
sql.setCondition(cnd);
//enrollService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success();
}
}
@@ -0,0 +1,318 @@
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.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.model.ExcelImportRes;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
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.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.RecuperationLineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @ClassName RecuperationLineController
* @Author JyuHsin
* @Date 2025/7/31 15:58
* @Version 1.0
* @Description TODO
*/
@Slf4j
@IocBean
@At("/platform/recuperation/line")
@Api("疗休养线路管理")
@Ok("json:full")
public class RecuperationLineController {
@Inject
private Dao dao;
@Inject
private RecuperationLineService lineService;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/line/index.html")
@SaCheckLogin
public void index() {}
@At
@ApiOperation("分页查询")
@SaCheckPermission("recuperation.line")
public Result pageData(PageForm pageForm,
@Param(value = "startYear") Integer startYear ,
@Param(value = "endYear") Integer endYear,
@Param(value = "travelAgencyId") String travelAgencyId,
@Param(value = "lineName") String lineName,
@Param(value = "unionId") String unionId,
@Param(value = "lotId") String lotId) {
Cnd cnd = Cnd.NEW();
cnd.andEX("line.`year`", ">=", startYear);
cnd.andEX("line.`year`", "<=", endYear);
cnd.andEX("line.travelAgencyId", "=", travelAgencyId);
cnd.andEX("line.lotId", "=", lotId);
cnd.and(Cnd.likeEX("line.lineName", lineName));
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
cnd.and("line.createUnionId", "=", SecurityUtil.getUnionId());
}
} else {
cnd.andEX("line.createUnionId", "=", unionId);
}
cnd.desc("year").desc("regionalNature").asc("serialNumber").asc("line.createdAt");
Pagination pagination = lineService.pageData(pageForm, cnd);
return Result.success(pagination);
}
@At
@ApiOperation("获取编号")
@SaCheckPermission("recuperation.line")
public Result getNo() {
Object serialNumber = dao.func2(RecuperationLine.class, "max", "serialNumber");
serialNumber = Objects.requireNonNullElse(serialNumber, 0);
return Result.success(Integer.parseInt(serialNumber.toString()) + 1);
}
@At
@ApiOperation("新增/编辑疗休养线路")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.line")
@SLog(type = "recuperation", tag = "新增/编辑疗休养线路", msg = "新增/编辑疗休养线路")
public Result onSubmit(RecuperationLine line) {
if (StrUtil.isBlank(line.getId())) {
if (lineService.count(Cnd.where("serialNumber", "=", line.getSerialNumber())) > 0) {
return Result.error("编号已存在");
}
lineService.addLine(line);
} else {
if (lineService.count(Cnd.where("serialNumber", "=", line.getSerialNumber()).and("id", "!=", line.getId())) > 0) {
return Result.error("编号已存在");
}
lineService.editLine(line);
}
return Result.success();
}
@At("/openClosedLine/?")
@ApiOperation("开启或关闭线路")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.line")
@SLog(type = "recuperation", tag = "开启或关闭线路", msg = "开启或关闭线路")
public Result openClosedLine(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
lineService.openClosedLine(id);
return Result.success();
}
@At
@ApiOperation("删除线路")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.line")
@SLog(type = "recuperation", tag = "删除线路", msg = "删除线路")
public Result onDelete(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
lineService.deleteLine(id);
return Result.success();
}
@At("/selectLineInfoById/?")
@ApiOperation("查询线路")
@SaCheckPermission("recuperation.line")
public Result selectLineInfoById(String id) {
Assert.notBlank(id);
RecuperationLine line = lineService.selectLineInfoById(id);
return Result.success(line);
}
@At
@ApiOperation("根据分工会选择的线路id查询所该线路报名的人")
@SaCheckPermission("recuperation.line")
public Result selectLineUser(PageForm pageForm, String id, String unionId) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
Pagination pagination = lineService.selectLineUser(pageForm, id, unionId);
return Result.success(pagination);
}
@At
@SaCheckPermission("recuperation.line")
public Result getCreateMode() {
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
return Result.success(RecuperationLineCreateMode.SCHOOL.getValue());
}
return Result.success(RecuperationLineCreateMode.UNION.getValue());
}
@At("/viewUnionSelectTimeInfo/?")
@ApiOperation("查看各个分工会设置的时间信息")
@SaCheckPermission("recuperation.line")
public Result viewUnionSelectTimeInfo(String id) {
Assert.notBlank(id);
List<NutMap> listMap = lineService.viewUnionSelectTimeInfo(id);
return Result.success(listMap);
}
@At
@Ok("void")
@SaCheckPermission("recuperation.line")
public void downloadTemplate(HttpServletResponse response) {
//查旅行社,转数组
List<RecuperationTravelAgency> travelAgencys = dao.query(RecuperationTravelAgency.class, Cnd.NEW().desc("serialNumber"));
List<String> excelTravelAgencyList = travelAgencys.stream().map(v -> v.getTravelAgencyName() + "_" + v.getId()).toList();
String[] excelTravelAgencyArrs = excelTravelAgencyList.toArray(new String[excelTravelAgencyList.size()]);
//查标段,转数组
List<RecuperationLot> lots = dao.query(RecuperationLot.class, Cnd.NEW().asc("id"));
List<String> excelLotList = lots.stream().map(v -> v.getLotName() + "_" + v.getId()).toList();
String[] excelLotArrs = excelLotList.toArray(new String[excelLotList.size()]);
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("年度", "year", 20));
entities.add(new ExcelExportEntity("排序编号", "serialNumber", 20));
entities.add(new ExcelExportEntity("线路名称", "lineName", 20));
ExcelExportEntity travelEntity = new ExcelExportEntity("所属旅行社", "travelAgencyId", 20);
travelEntity.setReplace(excelTravelAgencyArrs);
travelEntity.setAddressList(true);
entities.add(travelEntity);
ExcelExportEntity regionalEntity = new ExcelExportEntity("活动范围", "regionalNature", 20);
regionalEntity.setReplace(new String[]{"省内_省内", "省外_省外"});
regionalEntity.setAddressList(true);
entities.add(regionalEntity);
entities.add(new ExcelExportEntity("最少参与教工", "minimumGroupSize", 20));
ExcelExportEntity lotEntity = new ExcelExportEntity("时间标段", "lotId", 20);
lotEntity.setReplace(excelLotArrs);
lotEntity.setAddressList(true);
entities.add(lotEntity);
entities.add(new ExcelExportEntity("预计费用", "estimatedCost", 20));
entities.add(new ExcelExportEntity("详细信息", "content", 20));
ExcelExportEntity ableEntity = new ExcelExportEntity("是否启用(是/否)", "isDisabled", 20);
ableEntity.setReplace(new String[]{"是_1", "否_0"});
ableEntity.setAddressList(true);
entities.add(ableEntity);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, new ArrayList<>());
CommonDownloadUtil.download("目的地导入模板.xlsx", workbook, response);
}
@At
@ApiOperation("线路导入")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.line")
@SLog(type = "recuperation", tag = "线路导入", msg = "线路导入")
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Result lineImport(@Param("file") TempFile file) {
List<LineExcelMode> excelList = ExcelImportUtil.importExcel(file.getFile(), LineExcelMode.class, new ImportParams());
// 创建结果集
ExcelImportRes<LineExcelMode> excelImportRes = new ExcelImportRes<>();
excelImportRes.setTotalRecords(excelList.size());
List<RecuperationTravelAgency> travelList = dao.query(RecuperationTravelAgency.class, Cnd.NEW());
Map<String, String> travelMap = travelList.stream().collect(Collectors.toMap(RecuperationTravelAgency::getTravelAgencyName, RecuperationTravelAgency::getId));
List<RecuperationLot> lotList = dao.query(RecuperationLot.class, Cnd.NEW());
Map<String, String> lotMap = lotList.stream().collect(Collectors.toMap(RecuperationLot::getLotName, RecuperationLot::getId));
for (int i = 0; i < excelList.size(); i++) {
LineExcelMode excelMode = excelList.get(i);
if(excelMode.getYear() == null) {
excelMode.setErrInfo("年度为空", i + 1);
continue;
}
if (StrUtil.isBlank(excelMode.getLineName())) {
excelMode.setErrInfo("线路名称为空", i + 1);
continue;
}
if (StrUtil.isBlank(excelMode.getTravelAgencyId())) {
excelMode.setErrInfo("旅行社名称为空", i + 1);
continue;
}
if (StrUtil.isBlank(excelMode.getLotId())) {
excelMode.setErrInfo("时间标段为空", i + 1);
continue;
}
if (StrUtil.isBlank(excelMode.getRegionalNature())) {
excelMode.setErrInfo("活动范围为空", i + 1);
continue;
}
RecuperationLine line = new RecuperationLine();
BeanUtil.copyProperties(excelMode, line);
if("".equals(excelMode.getIsDisabled())) {
line.setDisabled(true);
} else if("".equals(excelMode.getIsDisabled())) {
line.setDisabled(false);
}
line.setTravelAgencyId(travelMap.get(excelMode.getTravelAgencyId()));
line.setLotId(lotMap.get(excelMode.getLotId()));
try {
dao.insertOrUpdate(line);
} catch (Exception e) {
log.error("导入目的地失败:{}", e.getMessage());
excelMode.setErrInfo("添加失败", i + 1);
}
}
// 添加错误记录
excelImportRes.setErrorDetails(excelList.stream().filter(s -> StrUtil.isNotBlank(s.getErrMsg())).collect(Collectors.toList()));
excelImportRes.setFailedCount(excelImportRes.getErrorDetails().size());
excelImportRes.setSuccessCount(Math.max(excelList.size() - excelImportRes.getFailedCount(), 0));
return Result.success(excelImportRes);
}
}
@@ -0,0 +1,268 @@
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.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.model.ExcelImportRes;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.zhgh.staffbenefit.recuperation.mode.TravelAgencyExcelMode;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationTravelAgencyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @ClassName RecuperationTravelAgencyController
* @Author JyuHsin
* @Date 2025/7/31 9:21
* @Version 1.0
* @Description TODO
*/
@Slf4j
@IocBean
@At("/platform/recuperation/travelAgency")
@Api("疗休养旅行社管理")
@Ok("json:full")
public class RecuperationTravelAgencyController {
@Inject
private Dao dao;
@Inject
private RecuperationTravelAgencyService travelAgencyService;
@At("")
@Ok("beetl:/platform/zhgh/staffbenefit/recuperation/travelAgency/index.html")
@SaCheckLogin
public void index() {}
@At
@ApiOperation("分页查询")
@SaCheckPermission("recuperation.travelAgency")
public Result pageData(PageForm pageForm,
@Param(value = "year") Integer year) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year);
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("contact", pageForm.getSearchKeyword());
seg.orLike("travelAgencyName", pageForm.getSearchKeyword());
seg.orLike("serialNumber", pageForm.getSearchKeyword());
cnd.and(seg);
}
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
} else {
cnd.asc("serialNumber");
}
Pagination pagination = travelAgencyService.pageData(pageForm, cnd);
return Result.success(pagination);
}
@At
@ApiOperation("新增/编辑疗休养旅行社")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.travelAgency")
@SLog(type = "recuperation", tag = "新增/编辑疗休养旅行社", msg = "新增/编辑疗休养旅行社")
public Result onSubmit(RecuperationTravelAgency travelAgency) {
if (StrUtil.isBlank(travelAgency.getId())) {
if (travelAgencyService.count(Cnd.where("serialNumber", "=", travelAgency.getSerialNumber())) > 0) {
return Result.error("编号已存在");
}
travelAgencyService.addTravelAgency(travelAgency);
} else {
if (travelAgencyService.count(Cnd.where("serialNumber", "=", travelAgency.getSerialNumber()).and("id", "!=", travelAgency.getId())) > 0) {
return Result.error("编号已存在");
}
travelAgencyService.editTravelAgency(travelAgency);
}
return Result.success();
}
@At("/openClosedTravelAgency/?")
@ApiOperation("开启或关闭旅行社")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.travelAgency")
@SLog(type = "recuperation", tag = "开启或关闭旅行社", msg = "开启或关闭旅行社")
public Result openClosedTravelAgency(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
travelAgencyService.openTravelAgency(id);
return Result.success();
}
@At
@ApiOperation("删除旅行社")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.travelAgency")
@SLog(type = "recuperation", tag = "删除旅行社", msg = "删除旅行社")
public Result onDelete(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
travelAgencyService.deleteTravelAgency(id);
return Result.success();
}
@At
@ApiOperation("查询旅行社")
@SaCheckPermission("recuperation.travelAgency")
public Result selectTravelAgency(Integer year) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year);
List<RecuperationTravelAgency> list = travelAgencyService.selectAllTravelAgencyByYear(cnd);
return Result.success(list);
}
@At
@ApiOperation("年度区间查询旅行社")
@SaCheckPermission("recuperation.travelAgency")
public Result selectTravelAgencyByYears(Integer startYear, Integer endYear) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", ">=", startYear);
cnd.andEX("year", "<=", endYear);
List<RecuperationTravelAgency> list = travelAgencyService.selectAllTravelAgencyByYear(cnd);
return Result.success(list);
}
@At
@ApiOperation("根据旅行社id查线路")
@SaCheckPermission("recuperation.travelAgency")
public Result selectLineByAgencyId(String agencyId) {
Sql sql = Sqls.create("""
SELECT id,lineName FROM `the_rapy_recuperation_line` WHERE travelAgencyId=@travelAgencyId
""").setParam("travelAgencyId", agencyId);
List<NutMap> listMap = travelAgencyService.listMap(sql);
return Result.success(listMap);
}
@At
@Ok("void")
@SaCheckPermission("recuperation.travelAgency")
public void downloadTemplate(HttpServletResponse response) {
List<NutMap> list = new ArrayList<>();
NutMap map = new NutMap();
map.put("year", 2025);
map.put("serialNumber", 1);
map.put("travelAgencyName", "杭州海外旅游有限公司");
map.put("contact", "张三");
map.put("contactMobileNumber", "17867895678");
map.put("email", "123@qq.com");
map.put("isDisabled", "");
list.add(map);
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("年度", "year", 20));
entities.add(new ExcelExportEntity("排序编号", "serialNumber", 20));
entities.add(new ExcelExportEntity("旅行社名称", "travelAgencyName", 20));
entities.add(new ExcelExportEntity("旅行社联系人", "contact", 20));
entities.add(new ExcelExportEntity("联系电话", "contactMobileNumber", 20));
entities.add(new ExcelExportEntity("邮箱", "email", 20));
entities.add(new ExcelExportEntity("官网", "officialWebsite", 20));
entities.add(new ExcelExportEntity("备注", "note", 20));
ExcelExportEntity excelExport = new ExcelExportEntity("是否启用(是/否)", "isDisabled", 20);
String[] options = {"是_1", "否_0"};
excelExport.setReplace(options);
excelExport.setAddressList(true);
entities.add(excelExport);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list);
CommonDownloadUtil.download("旅行社导入模板.xlsx", workbook, response);
}
@At
@ApiOperation("旅行社导入")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("recuperation.travelAgency")
@SLog(type = "recuperation", tag = "旅行社导入", msg = "旅行社导入")
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Result travelAgencyImport(@Param("file") TempFile file) {
List<TravelAgencyExcelMode> travelAgency = ExcelImportUtil.importExcel(file.getFile(), TravelAgencyExcelMode.class, new ImportParams());
// 创建结果集
ExcelImportRes<TravelAgencyExcelMode> excelImportRes = new ExcelImportRes<>();
excelImportRes.setTotalRecords(travelAgency.size());
List<RecuperationTravelAgency> travelAgencyList = dao.query(RecuperationTravelAgency.class, Cnd.NEW().desc("id"));
Map<String, String> map = travelAgencyList.stream().collect(Collectors.toMap(RecuperationTravelAgency::getTravelAgencyName, RecuperationTravelAgency::getId));
for (int i = 0; i < travelAgency.size(); i++) {
TravelAgencyExcelMode travel = travelAgency.get(i);
if(travel.getYear() == null) {
travel.setErrInfo("年度为空", i + 1);
continue;
}
if (StrUtil.isBlank(travel.getTravelAgencyName())) {
travel.setErrInfo("旅行社名称为空", i + 1);
continue;
}
RecuperationTravelAgency agency = new RecuperationTravelAgency();
if (Strings.isNotBlank(map.get(travel.getTravelAgencyName()))){
agency.setId(map.get(travel.getTravelAgencyName()));
}
if ("".equals(travel.getIsDisabled())) {
agency.setDisabled(false);
} else if ("".equals(travel.getIsDisabled())) {
agency.setDisabled(true);
}
agency.setContact(travel.getContact());
agency.setTravelAgencyName(travel.getTravelAgencyName());
agency.setSerialNumber(travel.getSerialNumber());
agency.setEmail(travel.getEmail());
agency.setContactMobileNumber(travel.getContactMobileNumber());
agency.setNote(travel.getNote());
agency.setYear(travel.getYear());
agency.setOfficialWebsite(travel.getOfficialWebsite());
try {
dao.insertOrUpdate(agency);
} catch (Exception e) {
log.error("导入旅行社失败:{}", e.getMessage());
travel.setErrInfo("添加失败", i + 1);
}
}
// 添加错误记录
excelImportRes.setErrorDetails(travelAgency.stream().filter(s -> StrUtil.isNotBlank(s.getErrMsg())).collect(Collectors.toList()));
excelImportRes.setFailedCount(excelImportRes.getErrorDetails().size());
excelImportRes.setSuccessCount(Math.max(travelAgency.size() - excelImportRes.getFailedCount(), 0));
return Result.success(excelImportRes);
}
}
@@ -0,0 +1,69 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.mode;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.budwk.app.base.model.ExcelImportError;
import lombok.Data;
import java.util.Date;
/**
* @ClassName BaseManagerExcelMode
* @Author JyuHsin
* @Date 2025/7/31 15:25
* @Version 1.0
* @Description TODO
*/
@Data
public class BaseManagerExcelMode extends ExcelImportError {
@Excel(name = "年度")
private Integer year;
@Excel(name = "排序编号")
private String sortNumber;
@Excel(name = "目的地名称")
private String baseName;
@Excel(name = "所属旅行社")
private String travelAgencyId;
@Excel(name = "活动范围(省内/省外)")
private String regionalNature;
@Excel(name = "时间标段")
private String lotId;
@Excel(name = "详细信息")
private String content;
@Excel(name = "是否启用(是/否)")
private String isDisabled;
@Excel(name = "报名开始时间")
private Date signUpStartTime;
@Excel(name = "报名截至时间")
private Date signUpEndTime;
@Excel(name = "变更截至时间")
private Date changeEndTime;
@Excel(name = "活动开始时间")
private Date activityStartTime;
@Excel(name = "活动结束时间")
private Date activityEndTime;
@Excel(name = "预计费用")
private String estimatedCost;
@Excel(name = "组织形式(分工会/校工会)")
private String createMode;
@Excel(name = "目的地联系人")
private String baseContactPerson;
@Excel(name = "联系电话")
private String baseContactNumber;
}
@@ -0,0 +1,40 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.mode;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.budwk.app.base.model.ExcelImportError;
import lombok.Data;
@Data
public class LineExcelMode extends ExcelImportError {
@Excel(name = "年度")
private Integer year;
@Excel(name = "排序编号")
private String serialNumber;
@Excel(name = "线路名称")
private String lineName;
@Excel(name = "旅行社名称")
private String travelAgencyId;
@Excel(name = "活动范围")
private String regionalNature;
@Excel(name = "最少参与教工")
private Integer minimumGroupSize;
@Excel(name = "时间标段")
private String lotId;
@Excel(name = "预计费用")
private String estimatedCost;
@Excel(name = "详细信息")
private String content;
@Excel(name = "是否启用(是/否)")
private String isDisabled;
}
@@ -0,0 +1,22 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.mode;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
@Data
public class RecuperationEnrollExcelMode {
@Excel(name = "工号")
private String loginName;
@Excel(name = "姓名")
private String userName;
@Excel(name = "参加时间")
private Date takePartInTime;
@Excel(name = "标段时间")
private String lotId;
}
@@ -0,0 +1,37 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.mode;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.budwk.app.base.model.ExcelImportError;
import lombok.Data;
@Data
public class TravelAgencyExcelMode extends ExcelImportError {
@Excel(name = "年度")
private Integer year;
@Excel(name = "排序编号")
private String serialNumber;
@Excel(name = "旅行社名称")
private String travelAgencyName;
@Excel(name = "旅行社联系人")
private String contact;
@Excel(name = "联系电话")
private String contactMobileNumber;
@Excel(name = "邮箱")
private String email;
@Excel(name = "官网")
private String officialWebsite;
@Excel(name = "备注")
private String note;
@Excel(name = "是否启用(是/否)")
private String isDisabled;
}
@@ -0,0 +1,140 @@
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 lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_base_management")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养基地")
public class RecuperationBaseManagement extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.INT)
@Comment("年度")
@Excel(name = "年度")
private Integer year;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("排序编号")
@Excel(name = "排序编号")
private String sortNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("基地名称")
@Excel(name = "目的地名称")
private String baseName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("旅行社Id")
@Excel(name = "所属旅行社")
private String travelAgencyId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 10)
@Comment("区域")
@Excel(name = "活动范围(省内/省外)")
private String regionalNature;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("标段Id")
@Excel(name = "时间标段")
private String lotId;
@Column
@ColDefine(customType = "text")
@Comment("疗休养详情")
@Excel(name = "详细信息")
private String content;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否禁用")
@Excel(name = "是否启用(是/否)")
private Boolean isDisabled;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("哪个分工会创建的")
private String createUnionId;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("报名开始时间")
@Excel(name = "报名开始时间")
private Date signUpStartTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("报名截至时间")
@Excel(name = "报名截至时间")
private Date signUpEndTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("变更截至时间")
@Excel(name = "变更截至时间")
private Date changeEndTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("活动开始时间")
@Excel(name = "活动开始时间")
private Date activityStartTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("活动结束时间")
@Excel(name = "活动结束时间")
private Date activityEndTime;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("预计费用")
@Excel(name = "预计费用")
private String estimatedCost;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("缩略图")
private String file;
@Column
@ColDefine(type = ColType.INT)
@Comment("创建模式(1.校工会 2.分工会)")
@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;
@One(field = "travelAgencyId")
private RecuperationTravelAgency travelAgency;
}
@@ -0,0 +1,112 @@
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.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_config")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养配置")
public class RecuperationConfig extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 30)
@Comment("配置名称")
private String configName;
@Column
@ColDefine(type = ColType.INT, width = 32)
@Comment("参加人员范围")
private Integer activityGroupId;
@Column
@ColDefine(type = ColType.INT)
@Comment("省外名额分配")
private Integer outsideQuota;
@Column
@ColDefine(type = ColType.FLOAT, width = 3, precision = 2)
@Comment("省外名额分配比例")
private Double outsideQuotaProportion;
@Column
@ColDefine(type = ColType.INT)
@Comment("省外几年去一次")
private Integer outsideNumber;
@Column
@ColDefine(type = ColType.INT)
@Comment("每年旅行频率")
private Integer travelFrequency;
@Column
@ColDefine(type = ColType.INT)
@Comment("组团人数")
private Integer groupNumber;
@Column
@ColDefine(type = ColType.INT)
@Comment("不可取消修改天数")
private Integer modifyDays;
@Column
@ColDefine(type = ColType.INT)
@Comment("可以修改几次")
private Integer modifyNumber;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("省内线路是否审核")
private Boolean isSnLine;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("省外线路是否审核")
private Boolean isSwLine;
@Column
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("标段")
private List<NutMap> modifyBd;
@Many(field = "configId")
private List<RecuperationLot> lots;
@Column
@ColDefine(type = ColType.INT)
@Comment("全批次最多教职工报名人数")
private Integer allLineSignUpNumber;
@Column
@ColDefine(customType = "longtext")
@Comment("疗休养服务须知")
private String notice;
@Column
@ColDefine(type = ColType.INT)
@Comment("省内起始年份")
private Integer provinceStartYear;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("床位信息")
private Boolean bedInfo;
@Column
@ColDefine(type = ColType.INT)
@Comment("家属信息")
private Integer familyInfo;
}
@@ -0,0 +1,206 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.model;
import cn.afterturn.easypoi.excel.annotation.Excel;
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;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnroll
* @Description: 疗休养报名登记表
* @Author zxc
* @Date 2022/5/31:16:58
* @Version V1.0
**/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_enroll")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养报名登记表")
public class RecuperationEnroll extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("工号")
@Excel(name = "工号")
private String loginName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("姓名")
@Excel(name = "姓名")
private String userName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 1)
@Comment("性别")
private String sex;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("本人单位")
private String unitName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("本人分工会")
private String unionName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("本人单位")
private String selfUnitId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("本人分工会Id")
private String selfUnionId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("参加的分工会")
private String takePartInUnionId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("参加线路")
private String takePartInLineId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("参加旅行社")
private String takePartInTravelAgencyId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("参加酒店")
private String takePartInBaseManagementId;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("报名时间")
private Date signingUptime;
@Column
@ColDefine(type = ColType.DATE)
@Comment("参加时间")
@Excel(name = "参加时间", format = "yyyy-MM-dd")
private Date takePartInTime;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否参加")
private boolean isTakePartIn;
@Column
@ColDefine(type = ColType.INT)
@Comment("审核状态")
private Integer stateId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("本人分工会审核Id")
private String selfUnionAuditId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("床位信息id")
private String bedInfoId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("参加的线路分工会审核Id")
private String joinLineUnionAuditId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 18)
@Comment("身份证号")
private String idCard;
@Column
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("手机号")
private String mobile;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否正常(true正常 false该报名记录已被管理员废弃)")
private boolean isNormal;
/**
* 同伴信息
*/
@Many(field = "trreId")
private List<RecuperationEnrollCompanion> companionList;
/**
* 酒店信息
*/
@One(field = "takePartInBaseManagementId")
private RecuperationBaseManagement managementInfo;
/**
* 线路信息
*/
// @One(field = "takePartInLineId")
private RecuperationLine lineInfo;
private String lineId;
private Date playStartTime;
private Date playEndTime;
/**
* 床位信息
*/
@One(field = "bedInfoId")
private RecuperationEnrollBed bedInfo;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("对旅行社的评价(几星)")
private String evaluationForTravelAgency;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("对线路的评价(几星)")
private String evaluationForLine;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("对旅途的评价(几星)")
private String evaluationForJourney;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("反馈内容")
private String feedbackContent;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("标段时间")
private String lotId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("校工会审核Id")
private String schoolUnionAuditId;
@Column
@ColDefine(type = ColType.INT)
@Comment("家属数量")
private Integer familyNumber;
}
@@ -0,0 +1,48 @@
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;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnrollBed
* @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("疗休养报名床位表")
public class RecuperationEnrollBed extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 10)
@Comment("床型")
private String bedType;
@Column
@ColDefine(type = ColType.INT)
@Comment("床位数")
private Integer bedNum;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("一起睡吗 搞基")
private boolean isSleepTogether;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("意向拼房人")
private String otherSleepUser;
}
@@ -0,0 +1,79 @@
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;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnrollFamily
* @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("疗休养报名床位表")
public class RecuperationEnrollCompanion extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("报名记录表Id")
private String trreId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("工号")
private String loginName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("姓名")
private String userName;
@Column
@ColDefine(type = ColType.CHAR, width = 1)
@Comment("性别")
private String sex;
@Column
@ColDefine(type = ColType.INT)
@Comment("年龄")
private Integer age;
@Column
@ColDefine(type = ColType.VARCHAR, width = 10)
@Comment("关系")
private String relation;
@Column
@ColDefine(type = ColType.VARCHAR, width = 18)
@Comment("身份证号")
private String idCard;
@Column
@ColDefine(type = ColType.VARCHAR, width = 18)
@Comment("手机号")
private String mobile;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("床位信息id")
private String bedInfoId;
/**
* 床位信息
*/
@One(field = "bedInfoId")
private RecuperationEnrollBed bedInfo;
}
@@ -0,0 +1,118 @@
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 org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_line")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养线路")
public class RecuperationLine extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("编号")
private String serialNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("线路名称")
private String lineName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("旅行社Id")
private String travelAgencyId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 10)
@Comment("区域性质")
private String regionalNature;
@Column
@ColDefine(customType = "text")
@Comment("疗休养内容")
private String content;
@Column
@ColDefine(type = ColType.INT)
@Comment("最少参与教工")
private Integer minimumGroupSize;
@Column
@ColDefine(type = ColType.INT)
@Comment("年度")
private Integer year;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否禁用")
private boolean isDisabled;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("哪个分工会创建的")
private String createUnionId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("交通工具")
private String trafficTools;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("预计费用")
private String estimatedCost;
@Column
@ColDefine(type = ColType.INT)
@Comment("成团人数包括家属")
private Integer estimatedFamilyNumbers;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("缩略图")
private String file;
@Column
@ColDefine(type = ColType.INT)
@Comment("报名模式(1.分工会 2.自由)")
private Integer signUpMode;
@Column
@ColDefine(type = ColType.INT)
@Comment("创建模式(1.分工会 2.校工会)")
private int createMode;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("标段")
private String lotId;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("联系人")
private String lineContact;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("联系电话")
private String lineContactPhone;
@One(field = "travelAgencyId")
private RecuperationTravelAgency travelAgency;
}
@@ -0,0 +1,126 @@
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.util.Date;
/**
* 疗休养线工会选择
*
* @author jug
* @date 2023/06/26
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_line_union_select")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养线路")
public class RecuperationLineUnionSelect extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("分工会id")
private String unionId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("线路id")
private String lineId;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("选择时间")
private Date selectTime;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("选择用户")
private String selectUserId;
@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;
/**
* 线路信息
*/
@One(field = "lineId")
private RecuperationLine lineInfo;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("联系人")
private String contact;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("联系方式")
private String contactPhone;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否公开")
private Boolean isOpen;
@Column
@ColDefine(type = ColType.INT)
@Comment("最少参与教工")
private Integer minimumGroupSize;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("交通工具")
private String trafficTools;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("预计费用")
private String estimatedCost;
@Column
@ColDefine(type = ColType.INT)
@Comment("成团人数包括家属")
private Integer estimatedFamilyNumbers;
@Column
@ColDefine(type = ColType.INT)
@Comment("报名模式、组织形式(1.分工会 2.校工会)")
private Integer signUpMode;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否启用")
private Boolean enable;
}
@@ -0,0 +1,43 @@
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;
@Data
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_lot")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养标段")
public class RecuperationLot extends BaseModel {
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 10)
@Comment("标段")
private String lotName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 10)
@Comment("标段值")
private String lotValue;
@Column
@ColDefine(type = ColType.VARCHAR, width = 10)
@Comment("费用")
private Integer activityCost;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("配置ID")
private String configId;
}
@@ -0,0 +1,75 @@
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
@EqualsAndHashCode(callSuper = true)
@Table("recuperation_travel_agency")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("疗休养旅行社")
public class RecuperationTravelAgency extends BaseModel {
@Name
@Comment("id")
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("旅行社编号")
private String serialNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("旅行社名称")
private String travelAgencyName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("旅行社联系人")
private String contact;
@Column
@ColDefine(type = ColType.VARCHAR, width = 11)
@Comment("旅行社联系人手机")
private String contactMobileNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("旅行社邮箱")
private String email;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("旅行社官网")
private String officialWebsite;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("备注")
private String note;
@Column
@ColDefine(type = ColType.INT)
@Comment("年度")
private Integer year;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否禁用")
private boolean isDisabled;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("缩略图")
private String file;
}
@@ -0,0 +1,17 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationBaseManagement;
import org.nutz.lang.util.NutMap;
/**
* @ClassName RecuperationBaseManagerService
* @Author JyuHsin
* @Date 2025/7/31 10:43
* @Version 1.0
* @Description TODO
*/
public interface RecuperationBaseManagerService extends BaseService<RecuperationBaseManagement> {
NutMap selectBaseAllInfo(String id);
}
@@ -0,0 +1,89 @@
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.RecuperationLine;
import org.nutz.dao.Cnd;
import org.nutz.lang.util.NutMap;
import java.util.List;
/**
* @ClassName RecuperationLineService
* @Author JyuHsin
* @Date 2025/7/31 15:59
* @Version 1.0
* @Description TODO
*/
public interface RecuperationLineService extends BaseService<RecuperationLine> {
/**
* 删除线路
*
* @param lineId 线路id
*/
void deleteLine(String lineId);
/**
* 添加线路
*
* @param line 线路
*/
void addLine(RecuperationLine line);
/**
* 编辑线路
*
* @param line 线路
*/
void editLine(RecuperationLine line);
/**
* 开启或关闭线路
*
* @param lineId 线路id
*/
void openClosedLine(String lineId);
/**
* 页面数据
*
* @param pageForm 分页参数
* @param cnd cnd
* @return {@link Pagination}
*/
Pagination pageData(PageForm pageForm, Cnd cnd);
/**
* 查询线路详细信息
*
* @param lineId 行id
* @return {@link RecuperationLine}
*/
RecuperationLine selectLineInfoById(String lineId);
/**
* 根据分工会选择的线路id查询所该线路报名的人
*
* @param pageForm 页面形式
* @param lineId 行id
* @return {@link List}<{@link NutMap}>
*/
Pagination selectLineUser(PageForm pageForm, String lineId, String unionId);
/**
* 清除线路详细信息
*
* @param lineId 线路id
*/
void deleteLineInfoCache(String lineId);
/**
* 查看各个分工会设置的时间信息
*
* @param lineId 线路id
* @return {@link List}<{@link NutMap}>
*/
List<NutMap> viewUnionSelectTimeInfo(String lineId);
}
@@ -0,0 +1,79 @@
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.RecuperationTravelAgency;
import org.nutz.dao.Cnd;
import org.nutz.lang.util.NutMap;
import java.util.List;
/**
* @ClassName RecuperationTravelAgencyService
* @Author JyuHsin
* @Date 2025/7/31 9:22
* @Version 1.0
* @Description TODO
*/
public interface RecuperationTravelAgencyService extends BaseService<RecuperationTravelAgency> {
/**
* 删除旅行社
*
* @param travelAgencyId 旅行社 ID
*/
void deleteTravelAgency(String travelAgencyId);
/**
* 添加旅行社
*
* @param travelAgency 旅行社
*/
void addTravelAgency(RecuperationTravelAgency travelAgency);
/**
* 编辑旅行社
*
* @param travelAgency 旅行社
*/
void editTravelAgency(RecuperationTravelAgency travelAgency);
/**
* 开启或关闭旅行社
*
* @param travelAgencyId 旅行社id
*/
void openTravelAgency(String travelAgencyId);
/**
* 页面数据
*
* @param pageForm 分页参数
* @param cnd cnd
* @return {@link Pagination}
*/
Pagination pageData(PageForm pageForm, Cnd cnd);
/**
* 查询旅行社
*
* @param cnd cnd
* @return {@link List}<{@link RecuperationTravelAgency}>
*/
List<RecuperationTravelAgency> selectAllTravelAgencyByYear(Cnd cnd);
/**
* 根据旅行社id查询所该旅行社报名的人,只查报旅行社的人跟线路没关系
*
* @param pageForm 页面形式
* @param id 旅行社id
* @return {@link List}<{@link NutMap}>
*/
Pagination selectAgencyUser(PageForm pageForm,String id);
}
@@ -0,0 +1,53 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service.impl;
import cn.hutool.core.date.DateUtil;
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.RecuperationBaseManagement;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationBaseManagerService;
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.lang.util.NutMap;
/**
* @ClassName RecuperationBaseManagerServiceImpl
* @Author JyuHsin
* @Date 2025/7/31 10:43
* @Version 1.0
* @Description TODO
*/
@Slf4j
@IocBean(args = {"refer:dao"})
public class RecuperationBaseManagerServiceImpl extends BaseServiceImpl<RecuperationBaseManagement> implements RecuperationBaseManagerService {
public RecuperationBaseManagerServiceImpl(Dao dao) {
super(dao);
}
@Override
public NutMap selectBaseAllInfo(String id) {
Sql sql = Sqls.create("""
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
from
recuperation_base_management b
left join recuperation_lot l on l.id = b.lotId
$condition
""");
sql.setParam("loginname", SecurityUtil.getUserLoginname());
sql.setParam("year", DateUtil.thisYear());
Cnd cnd = Cnd.NEW();
cnd.and("b.id", "=", id);
sql.setCondition(cnd);
sql.setCallback(Sqls.callback.map());
dao().execute(sql);
return (NutMap) sql.getResult();
}
}
@@ -0,0 +1,189 @@
package com.budwk.app.zhgh.staffbenefit.recuperation.service.impl;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
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.constant.RecuperationSignUpMode;
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.RecuperationEnrollCompanion;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationLine;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationLineUnionSelect;
import com.budwk.app.zhgh.staffbenefit.recuperation.service.RecuperationLineService;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.plugins.wkcache.annotation.CacheRemove;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @ClassName RecuperationLineServiceImpl
* @Author JyuHsin
* @Date 2025/7/31 15:59
* @Version 1.0
* @Description TODO
*/
@Slf4j
@IocBean(args = {"refer:dao"})
public class RecuperationLineServiceImpl extends BaseServiceImpl<RecuperationLine> implements RecuperationLineService {
public RecuperationLineServiceImpl(Dao dao) {
super(dao);
}
@Override
public void deleteLine(String lineId) {
List<RecuperationLineUnionSelect> unionSelectList = dao().query(RecuperationLineUnionSelect.class, Cnd.where("lineId", "=", lineId));
if (Lang.isNotEmpty(unionSelectList)) {
List<String> selectIds = unionSelectList.stream().map(RecuperationLineUnionSelect::getId).collect(Collectors.toList());
List<RecuperationEnroll> enrollList = dao().query(RecuperationEnroll.class, Cnd.where("takePartInLineId", "in", selectIds));
if (Lang.isNotEmpty(enrollList)){
List<String> enrollIds = enrollList.stream().map(RecuperationEnroll::getId).collect(Collectors.toList());
dao().clear(RecuperationEnrollCompanion.class, Cnd.where("trreId", "in", enrollIds));
}
dao().clear(RecuperationEnroll.class, Cnd.where("takePartInLineId", "in", selectIds));
}
delete(lineId);
dao().clear(RecuperationLineUnionSelect.class, Cnd.where("lineId", "=", lineId));
deleteLineInfoCache(lineId);
}
@Override
public void addLine(RecuperationLine line) {
boolean hasSchoolAdminRole = AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name());
if (hasSchoolAdminRole) {
line.setCreateUnionId(null);
line.setCreateMode(RecuperationLineCreateMode.SCHOOL.getValue());
insert(line);
} else if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_ADMIN.name())) {
line.setCreateUnionId(SecurityUtil.getUnionId());
line.setCreateMode(RecuperationLineCreateMode.UNION.getValue());
insert(line);
}
}
@Override
public void editLine(RecuperationLine line) {
update(line);
deleteLineInfoCache(line.getId());
}
@Override
public void openClosedLine(String lineId) {
update(Chain.makeSpecial("isDisabled", "isDisabled ^ 1"), Cnd.where("id", "=", lineId));
}
@Override
public Pagination pageData(PageForm pageForm, Cnd cnd) {
Sql sql = Sqls.create("""
SELECT
line.id,
line.serialNumber,
line.lineName,
line.regionalNature,
line.minimumGroupSize,
line.year,
line.isDisabled,
line.createUnionId,
line.signUpMode,
line.createMode,
line.file AS fileId,
gh.name AS createUnionName,
u.username AS createUserName,
ta.travelAgencyName,
ta.contact,
ta.contactMobileNumber,
ta.officialWebsite,
lot.lotName
FROM
recuperation_line line
LEFT JOIN 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
$condition
""");
sql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@Override
public RecuperationLine selectLineInfoById(String lineId) {
return fetchLinks(fetch(lineId), "travelAgency");
}
@Override
public Pagination selectLineUser(PageForm pageForm, String lineId, String unionId) {
Sql sql = Sqls.create("""
SELECT
line.lineName,
enroll.id,
enroll.loginName,
enroll.userName,
enroll.unionName,
enroll.unitName,
enroll.familyNumber,
( SELECT COUNT( 1 ) FROM recuperation_enroll_companion WHERE trreId = enroll.id) isFamily
FROM
`recuperation_enroll` enroll
LEFT JOIN recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN recuperation_line line ON line.id = lineu.lineId
WHERE
lineu.id = @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));
}
Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
List<NutMap> list = pagination.getList();
list.forEach(v -> {
List<RecuperationEnrollCompanion> companionList = dao().query(RecuperationEnrollCompanion.class, Cnd.where("trreId", "=", v.getString("id")));
for (RecuperationEnrollCompanion enrollCompanion : companionList) {
dao().fetchLinks(enrollCompanion, "bedInfo");
}
v.setv("companionList", companionList);
});
return pagination;
}
@Override
@CacheRemove(cacheKey = "${args[0]}_selectLineInfoById")
public void deleteLineInfoCache(String lineId) {
}
@Override
public List<NutMap> viewUnionSelectTimeInfo(String lineId) {
Sql sql = Sqls.create("""
SELECT
us.signUpStartTime,
us.signUpEndTime,
us.changeEndTime,
us.playStartTime,
us.playEndTime,
gh.name AS selectUnionName
FROM
`recuperation_line_union_select` us
LEFT JOIN sys_union gh ON gh.id = us.unionId
WHERE us.lineId = @lineId
""");
return listMap(sql);
}
}
@@ -0,0 +1,91 @@
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.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.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.IocBean;
import java.util.List;
/**
* @ClassName RecuperationTravelAgencyServiceImpl
* @Author JyuHsin
* @Date 2025/7/31 9:22
* @Version 1.0
* @Description TODO
*/
@Slf4j
@IocBean(args = {"refer:dao"})
public class RecuperationTravelAgencyServiceImpl extends BaseServiceImpl<RecuperationTravelAgency> implements RecuperationTravelAgencyService {
public RecuperationTravelAgencyServiceImpl(Dao dao) {
super(dao);
}
@Override
public void deleteTravelAgency(String travelAgencyId) {
delete(travelAgencyId);
}
@Override
public void addTravelAgency(RecuperationTravelAgency travelAgency) {
insert(travelAgency);
}
@Override
public void editTravelAgency(RecuperationTravelAgency travelAgency) {
update(travelAgency);
}
@Override
public void openTravelAgency(String travelAgencyId) {
update(Chain.makeSpecial("isDisabled", "isDisabled ^ 1"), Cnd.where("id", "=", travelAgencyId));
}
@Override
public Pagination pageData(PageForm pageForm, Cnd cnd) {
Sql sql = Sqls.create("""
select
*,
file as fileId
from
recuperation_travel_agency
$condition
""");
sql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@Override
public List<RecuperationTravelAgency> selectAllTravelAgencyByYear(Cnd cnd) {
return dao().query(RecuperationTravelAgency.class, cnd);
}
@Override
public Pagination selectAgencyUser(PageForm pageForm, String id) {
Sql sql = Sqls.create("""
SELECT
agency.travelAgencyName,
enroll.id,
enroll.loginName,
enroll.userName,
enroll.unionName,
enroll.unitName,
( SELECT COUNT( 1 ) FROM 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
WHERE
enroll.takePartInTravelAgencyId = @takePartInTravelAgencyId
""").setParam("takePartInTravelAgencyId", id);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
}