diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java index 4c5390ea..2c13bf90 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java @@ -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(); } } diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceStatisticsController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceStatisticsController.java deleted file mode 100644 index b164c2eb..00000000 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceStatisticsController.java +++ /dev/null @@ -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; - } -} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/constant/RecuperationLineCreateMode.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/constant/RecuperationLineCreateMode.java new file mode 100644 index 00000000..9e19175d --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/constant/RecuperationLineCreateMode.java @@ -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; + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/constant/RecuperationProvinceType.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/constant/RecuperationProvinceType.java new file mode 100644 index 00000000..262275fa --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/constant/RecuperationProvinceType.java @@ -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; + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/constant/RecuperationSignUpMode.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/constant/RecuperationSignUpMode.java new file mode 100644 index 00000000..270d1fda --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/constant/RecuperationSignUpMode.java @@ -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; + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/constant/RecuperationState.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/constant/RecuperationState.java new file mode 100644 index 00000000..25e1965a --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/constant/RecuperationState.java @@ -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; + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationBaseManagerController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationBaseManagerController.java new file mode 100644 index 00000000..b0cfc218 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationBaseManagerController.java @@ -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 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 travelAgencys = dao.query(RecuperationTravelAgency.class, Cnd.NEW().desc("serialNumber")); + List excelTravelAgencyList = travelAgencys.stream().map(v -> v.getTravelAgencyName() + "_" + v.getId()).toList(); + String[] excelTravelAgencyArrs = excelTravelAgencyList.toArray(new String[excelTravelAgencyList.size()]); + + //查标段,转数组 + List lots = dao.query(RecuperationLot.class, Cnd.NEW().asc("id")); + List excelLotList = lots.stream().map(v -> v.getLotName() + "_" + v.getId()).toList(); + String[] excelLotArrs = excelLotList.toArray(new String[excelLotList.size()]); + + List 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 excelList = ExcelImportUtil.importExcel(file.getFile(), BaseManagerExcelMode.class, new ImportParams()); + + // 创建结果集 + ExcelImportRes excelImportRes = new ExcelImportRes<>(); + excelImportRes.setTotalRecords(excelList.size()); + + List travelList = dao.query(RecuperationTravelAgency.class, Cnd.NEW()); + Map travelMap = travelList.stream().collect(Collectors.toMap(RecuperationTravelAgency::getTravelAgencyName, RecuperationTravelAgency::getId)); + + List lotList = dao.query(RecuperationLot.class, Cnd.NEW()); + Map 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); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationConfigController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationConfigController.java new file mode 100644 index 00000000..d1bcd5cf --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationConfigController.java @@ -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 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 lineNames = new ArrayList<>(); + List baseNames = new ArrayList<>(); + Map> map = new HashMap<>(); + List 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 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 lineList = dao.query(RecuperationLine.class, Cnd.where("lotId", "=", lotId)); + if (!CollectionUtils.isEmpty(lineList)) { + lineList.forEach(v -> v.setLotId(null)); + dao.update(lineList); + } + List 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(); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationEvaluateStatisticsController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationEvaluateStatisticsController.java new file mode 100644 index 00000000..4e5d41d1 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationEvaluateStatisticsController.java @@ -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(); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationLineController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationLineController.java new file mode 100644 index 00000000..02a5abbb --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationLineController.java @@ -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 listMap = lineService.viewUnionSelectTimeInfo(id); + return Result.success(listMap); + } + + @At + @Ok("void") + @SaCheckPermission("recuperation.line") + public void downloadTemplate(HttpServletResponse response) { + //查旅行社,转数组 + List travelAgencys = dao.query(RecuperationTravelAgency.class, Cnd.NEW().desc("serialNumber")); + List excelTravelAgencyList = travelAgencys.stream().map(v -> v.getTravelAgencyName() + "_" + v.getId()).toList(); + String[] excelTravelAgencyArrs = excelTravelAgencyList.toArray(new String[excelTravelAgencyList.size()]); + + //查标段,转数组 + List lots = dao.query(RecuperationLot.class, Cnd.NEW().asc("id")); + List excelLotList = lots.stream().map(v -> v.getLotName() + "_" + v.getId()).toList(); + String[] excelLotArrs = excelLotList.toArray(new String[excelLotList.size()]); + + List 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 excelList = ExcelImportUtil.importExcel(file.getFile(), LineExcelMode.class, new ImportParams()); + + // 创建结果集 + ExcelImportRes excelImportRes = new ExcelImportRes<>(); + excelImportRes.setTotalRecords(excelList.size()); + + List travelList = dao.query(RecuperationTravelAgency.class, Cnd.NEW()); + Map travelMap = travelList.stream().collect(Collectors.toMap(RecuperationTravelAgency::getTravelAgencyName, RecuperationTravelAgency::getId)); + + List lotList = dao.query(RecuperationLot.class, Cnd.NEW()); + Map 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); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationTravelAgencyController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationTravelAgencyController.java new file mode 100644 index 00000000..c6986811 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/controller/RecuperationTravelAgencyController.java @@ -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 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 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 listMap = travelAgencyService.listMap(sql); + return Result.success(listMap); + } + + @At + @Ok("void") + @SaCheckPermission("recuperation.travelAgency") + public void downloadTemplate(HttpServletResponse response) { + + List 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 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 travelAgency = ExcelImportUtil.importExcel(file.getFile(), TravelAgencyExcelMode.class, new ImportParams()); + // 创建结果集 + ExcelImportRes excelImportRes = new ExcelImportRes<>(); + excelImportRes.setTotalRecords(travelAgency.size()); + + List travelAgencyList = dao.query(RecuperationTravelAgency.class, Cnd.NEW().desc("id")); + Map 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); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/mode/BaseManagerExcelMode.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/mode/BaseManagerExcelMode.java new file mode 100644 index 00000000..463e3f0a --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/mode/BaseManagerExcelMode.java @@ -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; +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/mode/LineExcelMode.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/mode/LineExcelMode.java new file mode 100644 index 00000000..c1c9bdff --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/mode/LineExcelMode.java @@ -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; + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/mode/RecuperationEnrollExcelMode.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/mode/RecuperationEnrollExcelMode.java new file mode 100644 index 00000000..a6c46c20 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/mode/RecuperationEnrollExcelMode.java @@ -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; +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/mode/TravelAgencyExcelMode.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/mode/TravelAgencyExcelMode.java new file mode 100644 index 00000000..ccfea585 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/mode/TravelAgencyExcelMode.java @@ -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; +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationBaseManagement.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationBaseManagement.java new file mode 100644 index 00000000..0750be50 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationBaseManagement.java @@ -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; +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationConfig.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationConfig.java new file mode 100644 index 00000000..cea08761 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationConfig.java @@ -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 modifyBd; + + @Many(field = "configId") + private List 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; +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationEnroll.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationEnroll.java new file mode 100644 index 00000000..25e0f3da --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationEnroll.java @@ -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 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; + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationEnrollBed.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationEnrollBed.java new file mode 100644 index 00000000..58c2f382 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationEnrollBed.java @@ -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; + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationEnrollCompanion.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationEnrollCompanion.java new file mode 100644 index 00000000..f711d493 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationEnrollCompanion.java @@ -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; + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationLine.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationLine.java new file mode 100644 index 00000000..8dfb9170 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationLine.java @@ -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; + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationLineUnionSelect.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationLineUnionSelect.java new file mode 100644 index 00000000..1a9b640e --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationLineUnionSelect.java @@ -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; + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationLot.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationLot.java new file mode 100644 index 00000000..18271751 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationLot.java @@ -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; + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationTravelAgency.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationTravelAgency.java new file mode 100644 index 00000000..26685434 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/model/RecuperationTravelAgency.java @@ -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; +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/RecuperationBaseManagerService.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/RecuperationBaseManagerService.java new file mode 100644 index 00000000..896d5dcc --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/RecuperationBaseManagerService.java @@ -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 { + + NutMap selectBaseAllInfo(String id); +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/RecuperationLineService.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/RecuperationLineService.java new file mode 100644 index 00000000..41eb6a7b --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/RecuperationLineService.java @@ -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 { + + /** + * 删除线路 + * + * @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 viewUnionSelectTimeInfo(String lineId); +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/RecuperationTravelAgencyService.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/RecuperationTravelAgencyService.java new file mode 100644 index 00000000..70d27290 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/RecuperationTravelAgencyService.java @@ -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 { + + /** + * 删除旅行社 + * + * @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 selectAllTravelAgencyByYear(Cnd cnd); + + + /** + * 根据旅行社id查询所该旅行社报名的人,只查报旅行社的人跟线路没关系 + * + * @param pageForm 页面形式 + * @param id 旅行社id + * @return {@link List}<{@link NutMap}> + */ + Pagination selectAgencyUser(PageForm pageForm,String id); +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/impl/RecuperationBaseManagerServiceImpl.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/impl/RecuperationBaseManagerServiceImpl.java new file mode 100644 index 00000000..047a304c --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/impl/RecuperationBaseManagerServiceImpl.java @@ -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 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(); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/impl/RecuperationLineServiceImpl.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/impl/RecuperationLineServiceImpl.java new file mode 100644 index 00000000..eab2dff5 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/impl/RecuperationLineServiceImpl.java @@ -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 implements RecuperationLineService { + + public RecuperationLineServiceImpl(Dao dao) { + super(dao); + } + + @Override + public void deleteLine(String lineId) { + List unionSelectList = dao().query(RecuperationLineUnionSelect.class, Cnd.where("lineId", "=", lineId)); + if (Lang.isNotEmpty(unionSelectList)) { + List selectIds = unionSelectList.stream().map(RecuperationLineUnionSelect::getId).collect(Collectors.toList()); + List enrollList = dao().query(RecuperationEnroll.class, Cnd.where("takePartInLineId", "in", selectIds)); + if (Lang.isNotEmpty(enrollList)){ + List 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 list = pagination.getList(); + list.forEach(v -> { + List 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 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); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/impl/RecuperationTravelAgencyServiceImpl.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/impl/RecuperationTravelAgencyServiceImpl.java new file mode 100644 index 00000000..1e2917d7 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/recuperation/service/impl/RecuperationTravelAgencyServiceImpl.java @@ -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 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 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); + } +} diff --git a/src/main/resources/static/assets/platform/css/common.css b/src/main/resources/static/assets/platform/css/common.css index 5b7c5352..1b236f8f 100644 --- a/src/main/resources/static/assets/platform/css/common.css +++ b/src/main/resources/static/assets/platform/css/common.css @@ -653,6 +653,15 @@ td.no-b { margin: 0 auto; } +.left-span-label { + border-left: 4px solid var(--color-primary); + font-size: 15px; + color: var(--color-black); + font-weight: 600; + padding-left: 8px; + margin: 10px 0; +} + /**********start****************设置工作流表单el-description嵌套el-form的格式 必须要使用flow-task-form!!!***********************start*****************/ .flow-task-form .el-descriptions__table { diff --git a/src/main/resources/static/assets/platform/js/util/autoShowError.js b/src/main/resources/static/assets/platform/js/util/autoShowError.js index 7b6c8aee..9b487579 100644 --- a/src/main/resources/static/assets/platform/js/util/autoShowError.js +++ b/src/main/resources/static/assets/platform/js/util/autoShowError.js @@ -17,47 +17,48 @@ function autoEnhanceForm(formVm) { const originalValidate = formVm.validate formVm.validate = function(callback) { - originalValidate(async (valid, fields) => { - if (valid) { - callback?.(valid, fields) - } else { - const firstField = Object.keys(fields)[0] - const fieldErrors = fields[firstField] - const errorMessage = fieldErrors[0].message + let capturedFields; - let finalMessage = errorMessage + const promise = new Promise((resolve) => { + originalValidate.call(this, (valid, fields) => { + capturedFields = fields; - const formItem = formVm.fields?.find(item => item.prop === firstField) - - if (errorMessage === '必填' && formItem && formItem.label) { - finalMessage = `${formItem.label} 必填` - } - - // 提示 - if (formVm.$message) { - formVm.$message({ - message: finalMessage, - type: 'error', - }) + if (valid) { + resolve(true); } else { - alert(finalMessage) - } + const firstField = Object.keys(fields)[0]; + const fieldErrors = fields[firstField]; + const errorMessage = fieldErrors?.[0]?.message || '校验失败'; - await formVm.$nextTick() - - if (formItem && formItem.$el) { - const inputEl = - formItem.$el.querySelector('input') || - formItem.$el.querySelector('textarea') || - formItem.$el.querySelector('.el-input__inner') || - formItem.$el.querySelector('.el-textarea__inner') - if (inputEl) { - inputEl.focus() + let finalMessage = errorMessage; + const formItem = this.fields?.find((item) => item.prop === firstField); + if (errorMessage === '必填' && formItem && formItem.label) { + finalMessage = `${formItem.label} 必填`; } + + if (this.$message) { + this.$message({ message: finalMessage, type: 'error' }); + } else { + alert(finalMessage); + } + + this.$nextTick(() => { + const inputEl = + formItem?.$el?.querySelector('input, textarea, .el-input__inner, .el-textarea__inner'); + if (inputEl) inputEl.focus(); + }); + + resolve(false); } - callback?.(valid, fields) - } - }) + }); + }); + + if (typeof callback === 'function') { + promise.then(valid => callback(valid, capturedFields)); + return; + } + + return promise; } } diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/apply/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/apply/index.html index 5c220f66..64176494 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/apply/index.html +++ b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/apply/index.html @@ -9,7 +9,7 @@ layout("/layouts/platform.html"){ - + @@ -118,8 +118,34 @@ layout("/layouts/platform.html"){ "&defineKey=ZGWW" ) }, - onRevoke(id) {}, - onDelete(id) {}, + onRevoke(row) { + this.$confirm("您确定要撤回吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(() => { + this.$axios.post("/flow/common/revokeTask", { taskId: row.startTaskId }).then((res) => { + if (res.code === 0) { + this.$message.success(res.msg) + this.pageData() + } + }) + }) + }, + onDelete(id) { + this.$confirm("您确定要删除吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(() => { + this.$axios.post("/platform/condolence/apply/delete", { id }).then((res) => { + if (res.code === 0) { + this.$message.success(res.msg) + this.pageData() + } + }) + }) + }, queryCondolenceType() { this.$axios.post('/platform/condolence/type/queryCondolenceType') .then((resp) => { diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/baseManagement/basicForm.js b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/baseManagement/basicForm.js new file mode 100644 index 00000000..e6998821 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/baseManagement/basicForm.js @@ -0,0 +1,336 @@ +const basicForm = { + template: /*language=HTML*/ ` +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 校工会组织 + 分工会组织 + + + + + + + 省内 + 省外 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 变更时间应该大于报名截至时间,小于活动时间。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 提交 + +
+ `, + props: { + travelList: { + type: Array, + required: true + }, + lotList: { + type: Array, + required: true + } + }, + data() { + const validateSignUpEndTime = (rule, value, callback) => { + if (!value) { + callback(new Error('请选择报名截至时间')) + } + if (this.formData.signUpStartTime) { + if (Date.parse(value) <= Date.parse(this.formData.signUpStartTime)) { + callback(new Error('报名截至时间必须大于报名开始时间')) + } + } + callback() + } + const validateChangeEndTime = (rule, value, callback) => { + if (!value) { + callback(new Error('请选择变更截至时间')) + } + if (this.formData.activityStartTime) { + if (Date.parse(value) >= Date.parse(this.formData.activityStartTime)) { + callback(new Error('变更截至时间必须小于活动开始时间')) + } + } + if (this.formData.signUpEndTime) { + if (Date.parse(value) <= Date.parse(this.formData.signUpEndTime)) { + callback(new Error('变更截至时间必须大于活动截至时间')) + } + } + callback() + } + const validateActivityStartTime = (rule, value, callback) => { + if (!value) { + callback(new Error('请选择活动开始时间')) + } + if (this.formData.changeEndTime) { + if (Date.parse(value) <= Date.parse(this.formData.changeEndTime)) { + callback(new Error('活动开始时间必须大于变更截至时间')) + } + } + callback() + } + const validateActivityEndTime = (rule, value, callback) => { + if (!value) { + callback(new Error('请选择活动结束时间')) + } + if (this.formData.activityStartTime) { + if (Date.parse(value) <= Date.parse(this.formData.activityStartTime)) { + callback(new Error('活动结束时间必须大于活动开始时间')) + } + } + callback() + } + return { + localTravelList: [...this.travelList], + localLotList: [...this.lotList], + formData: { + isDisabled: true + }, + formRules: { + sortNumber: [{required: false, message: '请输入排序编号', trigger: ['change', 'blur']}], + baseName: [{required: true, message: '请输入目的地名称', trigger: ['change', 'blur']}], + travelAgencyId: [{required: true, message: '请选择旅行社', trigger: ['change', 'blur']}], + regionalNature: [{required: true, message: '请选择区域性质', trigger: ['change', 'blur']}], + year: [{required: true, message: '请选择年度', trigger: ['change', 'blur']}], + lotId: [{required: true, message: '请选择出行天数', trigger: ['change', 'blur']}], + content: [{required: false, message: '请输入详细内容', trigger: ['change', 'blur']}], + signUpStartTime: [{required: true, message: '请选择报名开始时间', trigger: ['change', 'blur']}], + signUpEndTime: [{required: true, validator: validateSignUpEndTime, trigger: ['change', 'blur']}], + changeEndTime: [{required: true, validator: validateChangeEndTime, trigger: ['change', 'blur']}], + files: [{required: true, message: '请上传图片', trigger: ['change', 'blur']}], + createMode: [{required: true, message: '请选择组织方式', trigger: ['change', 'blur']}], + activityStartTime: [{ required: true, validator: validateActivityStartTime, trigger: ['change', 'blur'] }], + activityEndTime: [{ required: true, validator: validateActivityEndTime, trigger: ['change', 'blur'] }], + estimatedCost: [{required: true, message: '请输入预计费用', trigger: ['change', 'blur']}], + }, + } + }, + methods: { + doBdModify() { + const lot = this.localLotList.find(o => o.id === this.formData.lotId) + if (lot) this.$set(this.formData, 'estimatedCost', lot.estimatedCost) + }, + async yearChange() { + this.$set(this.formData, 'travelAgencyId', null) + await this.selectTravelAgencyList() + }, + async selectTravelAgencyList() { + const resp = await this.$axios.post('/platform/recuperation/travelAgency/selectTravelAgency', {year: this.formData.year}) + this.localTravelList = resp.data + }, + onOpen(row) { + if(row && row.id) { + this.$axios.post(loc() + '/selectBaseManageById/' + row.id) + .then((resp) => { + const data = resp.data + data.year = data.year.toString() + this.formData = {...data} + }) + } + }, + onSubmit() { + this.$refs.formRef.validate((valid) => { + if (valid) { + this.$confirm("您确定要提交吗?", "提示", { + 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) + } + }) + } + }) + }, + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/baseManagement/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/baseManagement/index.html new file mode 100644 index 00000000..282c4191 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/baseManagement/index.html @@ -0,0 +1,245 @@ + + + + +
+ + + + + + + + + + + +
+ + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/baseManagement/info.js b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/baseManagement/info.js new file mode 100644 index 00000000..f609c8de --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/baseManagement/info.js @@ -0,0 +1,55 @@ +const info = { + template: /*language=HTML*/ ` +
+
目的地信息
+ + {{ viewData.year }} + {{ viewData.sortNumber }} + {{ viewData.baseName }} + {{ viewData.regionalNature }} + {{ viewData.lotName }} + {{ viewData.estimatedCost }} + {{ viewData.baseContactPerson }} + {{ viewData.baseContactNumber }} + {{ viewData.signUpStartTime }} + {{ viewData.signUpEndTime }} + {{ viewData.changeEndTime }} + {{ viewData.activityStartTime }} + {{ viewData.activityEndTime }} + +
+
+
+
旅行社信息
+ + + {{ viewData.travelAgency.travelAgencyName }} + + {{ viewData.travelAgency.contact }} + {{ viewData.travelAgency.contactMobileNumber }} + {{ viewData.travelAgency.email }} + + + {{ viewData.travelAgency.officialWebsite }} + + + +
+ `, + data() { + return { + viewData: {}, + } + }, + methods: { + onOpen(row) { + this.$axios.post(loc() + '/selectBaseManageById/' + row.id) + .then((resp) => { + this.viewData = resp.data + }) + }, + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/config/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/config/index.html new file mode 100644 index 00000000..5562c4b6 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/config/index.html @@ -0,0 +1,400 @@ + + + + +
+ + +
+

疗休养配置

+
+ + +
基本配置
+ + + + +
+
+ + + +
+
+ 设置 + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 需要 + 不需要 + + + + + + 需要 + 不需要 + + + + + + + + + + + + + + 需要 + 不需要 + + + + + + 数量 + 详细信息 + + + +
标段管理
+ +
+ + 增加一条 + +
+ + + + + + + + + + + + + + + + + +
+ +
服务须知
+ + + + + + 重 置 + 提 交 + +
+
+ + + + + 取 消 + 确 定 + + +
+ + +
+ + + + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/line/basicForm.js b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/line/basicForm.js new file mode 100644 index 00000000..27dc14fa --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/line/basicForm.js @@ -0,0 +1,346 @@ +const basicForm = { + template: /*language=HTML*/ ` +
+ + + + + + + + + + + + 温馨提醒:分工会组织的线路,可以自行设置出行时间。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.label}} + + + + + + + + + + {{item.label}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 提交 + +
+ `, + props: { + travelList: { + type: Array, + required: true + }, + lotList: { + type: Array, + required: true + }, + signList: { + type: Array, + required: true + }, + }, + data() { + const validateSignUpEndTime = (rule, value, callback) => { + if (!value) { + callback(new Error('请选择报名截至时间')) + } + if (this.formData.signUpStartTime) { + if (Date.parse(value) <= Date.parse(this.formData.signUpStartTime)) { + callback(new Error('报名截至时间必须大于报名开始时间')) + } + } + callback() + } + const validateChangeEndTime = (rule, value, callback) => { + if (!value) { + callback(new Error('请选择变更截至时间')) + } + if (this.formData.playStartTime) { + if (Date.parse(value) >= Date.parse(this.formData.playStartTime)) { + callback(new Error('变更截至时间必须小于出行开始时间')) + } + } + if (this.formData.signUpEndTime) { + if (Date.parse(value) <= Date.parse(this.formData.signUpEndTime)) { + callback(new Error('变更截至时间必须大于报名截至时间')) + } + } + callback() + } + const validatePlayEndTime = (rule, value, callback) => { + if (!value) { + callback(new Error('请选择出行结束时间')) + } + if (this.formData.playStartTime) { + if (Date.parse(value) <= Date.parse(this.formData.playStartTime)) { + callback(new Error('出行结束时间必须大于出行开始时间')) + } + } + callback() + } + return { + config: {}, + regionalNatureList: [], + localTravelList: [...this.travelList], + localLotList: [...this.lotList], + signUpModeList: [...this.signList], + formData: { + isDisabled: true + }, + formRules: { + serialNumber: [{required: true, message: '请输入排序号', trigger: ['change', 'blur']}], + lineName: [{required: true, message: '请输入线路名称', trigger: ['change', 'blur']}], + travelAgencyId: [{required: true, message: '请选择旅行社', trigger: ['change', 'blur']}], + regionalNature: [{required: true, message: '请选择区域性质', trigger: ['change', 'blur']}], + minimumGroupSize: [{required: true, message: '请输入最少参与教工', trigger: ['change', 'blur']}], + year: [{required: true, message: '请选择年度', trigger: ['change', 'blur']}], + signUpStartTime: [{required: true, message: '请选择报名开始时间', trigger: ['change', 'blur']}], + signUpEndTime: [{required: true, validator: validateSignUpEndTime, trigger: ['change', 'blur']}], + changeEndTime: [{required: true, validator: validateChangeEndTime, trigger: ['change', 'blur']}], + signUpMode: [{required: true, message: '请选择报名模式', trigger: ['change', 'blur']}], + playStartTime: [{required: true, message: '请选择出行开始时间', trigger: ['change', 'blur']}], + playEndTime: [{required: true, validator: validatePlayEndTime, trigger: ['change', 'blur']}], + trafficTools: [{required: false, message: '请输入交通工具', trigger: ['change', 'blur']}], + estimatedCost: [{required: false, message: '请输入预计费用', trigger: ['change', 'blur']}], + estimatedFamilyNumbers: [{required: false, message: '请输入成团人数包括家属', trigger: ['change', 'blur']}], + lotId: [{required: true, message: '请选择标段时间', trigger: ['change', 'blur']}] + }, + } + }, + methods: { + isShow(roles) { + if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) { + return true + } + if (this.$auth.hasRoleOr(["BRANCH_UNION_ADMIN", "BRANCH_UNION_CHAIRMAN"])) { + return roles.some(r => r === 'H04') + } + }, + async getConfig() { + const resp = await $.get('/platform/recuperation/config/fetchOne') + if (resp.code === 0) { + this.config = resp.data + } + }, + async yearChange() { + this.$set(this.formData, 'travelAgencyId', null) + await this.selectTravelAgencyList() + }, + async selectTravelAgencyList() { + const resp = await this.$axios.post('/platform/recuperation/travelAgency/selectTravelAgency', {year: this.formData.year}) + this.localTravelList = resp.data + }, + async getCreateMode() { + const resp = await this.$axios.get(loc() + '/getCreateMode') + if (resp.code === 0) { + return resp.data + } + }, + async onOpen(row) { + if (row && row.id) { + this.$axios.post(loc() + '/selectLineInfoById/' + row.id) + .then((resp) => { + const data = resp.data + data.year = data.year.toString() + 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) + } + } + }, + onSubmit() { + this.$refs.formRef.validate((valid) => { + if (valid) { + this.$confirm("您确定要提交吗?", "提示", { + 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) + } + }) + } + }) + }, + async getEnumOptions(enumName) { + const resp = await this.$axios.post("/open/common/dictEnumOptions", { name: enumName }) + return resp.data + }, + async getNumber() { + const resp = await this.$axios.post(loc() + '/getNo') + this.$set(this.formData, 'serialNumber', resp.data) + }, + }, + async created() { + this.regionalNatureList = await this.getEnumOptions('RecuperationProvinceType') + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/line/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/line/index.html new file mode 100644 index 00000000..7a6c78e9 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/line/index.html @@ -0,0 +1,284 @@ + + + + +
+ + + + + + + + + + + +
+ + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/line/info.js b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/line/info.js new file mode 100644 index 00000000..8777d37a --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/line/info.js @@ -0,0 +1,78 @@ +const info = { + template: /*language=HTML*/ ` +
+
线路信息
+ + {{ viewData.year }} + {{ viewData.serialNumber }} + {{ viewData.lineName }} + {{ viewData.regionalNature }} + +
+
+
+ +
旅行社信息
+ + + {{ viewData.travelAgency.travelAgencyName }} + + {{ viewData.travelAgency.contact }} + {{ viewData.travelAgency.contactMobileNumber }} + {{ viewData.travelAgency.email }} + + + {{ viewData.travelAgency.officialWebsite }} + + + +
+ `, + data() { + return { + viewData: { + travelAgency:{} + }, + //多个出行的时间段 + times: [], + //分工会选择校工会的线路自己设置的时间信息等等。。。 + unionSelectLineData: {}, + //是否只看基本信息 因为出行时间针对每个分工会都不一样 + showTravelTimePeriod: false + } + }, + methods: { + async onOpen(lineId, usUnionId) { + await 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 + } + }, + async findUnionSelectLineData(lineId, unionId) { + const resp = await this.$axios.post('/platform/recuperation/lineFghSelect/selectLineInfo', { + lineId: lineId, + unionId: unionId + }) + if (resp.code === 0 && resp.data) { + this.times = resp.data + } + } + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/travelAgency/basicForm.js b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/travelAgency/basicForm.js new file mode 100644 index 00000000..f8843d32 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/travelAgency/basicForm.js @@ -0,0 +1,117 @@ +const basicForm = { + template: /*language=HTML*/ ` +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 提交 + +
+ `, + data() { + return { + formData: { + isDisabled: true + }, + formRules: { + serialNumber: [{required: true, message: '请输入编号', trigger: ['change', 'blur']}], + travelAgencyName: [{required: true, message: '请输入旅行社名称', trigger: ['change', 'blur']}], + contact: [{required: true, message: '请输入联系人姓名', trigger: ['change', 'blur']}], + contactMobileNumber: [ + {required: true, message: '请输入联系人电话', trigger: 'blur',}, + { + pattern: /^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/, + message: '请输入正确的联系人电话', + trigger: 'blur' + } + ], + email: [ + {required: false, message: '请输入邮箱地址', trigger: 'blur'}, + {type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change']} + ], + officialWebsite: [ + {required: false, message: '请输入官网地址', trigger: ['change', 'blur']}, + {type: 'url', message: '请输入正确的官网地址', trigger: ['blur', 'change']}], + note: [{required: false, message: '请输入备注', trigger: ['change', 'blur']}], + year: [{required: true, message: '请选择年度', trigger: ['change', 'blur']}], + }, + } + }, + methods: { + onOpen(row) { + if(row && row.id) { + const cloneData = clone(row) + cloneData.year = cloneData.year.toString() + this.formData = {...cloneData} + } + }, + onSubmit() { + this.$refs.formRef.validate((valid) => { + if (valid) { + this.$confirm("您确定要提交吗?", "提示", { + 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) + } + }) + } + }) + }, + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/travelAgency/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/travelAgency/index.html new file mode 100644 index 00000000..cb32cb9c --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/travelAgency/index.html @@ -0,0 +1,189 @@ + + + + +
+ + + + + + + + + + + +
+ + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/travelAgency/info.js b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/travelAgency/info.js new file mode 100644 index 00000000..485a1905 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/recuperation/travelAgency/info.js @@ -0,0 +1,33 @@ +const info = { + template: /*language=HTML*/ ` +
+ + {{viewData.serialNumber}} + {{viewData.travelAgencyName}} + {{viewData.contact}} + {{viewData.contactMobileNumber}} + {{viewData.email}} + + + {{viewData.officialWebsite}} + 立即访问 + + + {{viewData.note}} + +
+ `, + data() { + return { + viewData: {}, + } + }, + methods: { + onOpen(row) { + this.viewData = clone(row) + }, + }, + style: /*language=CSS*/ ` + + ` +}