diff --git a/src/main/java/io/v/nutz/zhgh/data/constant/SourceData.java b/src/main/java/io/v/nutz/zhgh/data/constant/SourceData.java index 81d2ada..3ef531a 100644 --- a/src/main/java/io/v/nutz/zhgh/data/constant/SourceData.java +++ b/src/main/java/io/v/nutz/zhgh/data/constant/SourceData.java @@ -53,7 +53,7 @@ public interface SourceData { put("XBM", new String[]{"sex"});// 性别码 put("MZMC", new String[]{"nation"});// 民族码 put("SJ", new String[]{"mobile"}); // 手机号 - put("SFZJH", new String[]{"idcard"}); // 身份证件号 +// put("SFZJH", new String[]{"idcard"}); // 身份证件号 put("ZZMMM", new String[]{"political"}); // 政治面貌码 put("DQZTM", new String[]{"userState", "personalStatus"}); // 在职状态码 put("RYFLMC", new String[]{"personType"}); // 人员类型码 diff --git a/src/main/java/io/v/nutz/zhgh/data/service/impl/SourceUserServiceImpl.java b/src/main/java/io/v/nutz/zhgh/data/service/impl/SourceUserServiceImpl.java index 2561781..d6f548f 100644 --- a/src/main/java/io/v/nutz/zhgh/data/service/impl/SourceUserServiceImpl.java +++ b/src/main/java/io/v/nutz/zhgh/data/service/impl/SourceUserServiceImpl.java @@ -529,7 +529,7 @@ public class SourceUserServiceImpl extends ViServiceImpl implements // 变更记录 List changeList = new ArrayList<>(); for (String fieldName : allowChangeFieldNames) { - if (List.of("retireDate", "welfareStopDate").contains(fieldName)) { + if (List.of("retireDate", "welfareStopDate", "idcard").contains(fieldName)) { continue; } memberCommonService.extractChange(newMap, sourceMap, fieldName, dictMap, changeList); @@ -577,7 +577,7 @@ public class SourceUserServiceImpl extends ViServiceImpl implements NutMap sourceMap = Lang.obj2nutmap(user); List changeList = new ArrayList<>(); for (String fieldName : allowChangeFieldNames) { - if (List.of("retireDate", "welfareStopDate").contains(fieldName)) { + if (List.of("retireDate", "welfareStopDate", "idcard").contains(fieldName)) { continue; } memberCommonService.extractChange(newMap, sourceMap, fieldName, dictMap, changeList); diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/mobile/MobileTheRapyRecuperationEnrollController.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/mobile/MobileTheRapyRecuperationEnrollController.java index c3b811a..f7a0fd1 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/mobile/MobileTheRapyRecuperationEnrollController.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/mobile/MobileTheRapyRecuperationEnrollController.java @@ -1,29 +1,47 @@ package io.v.nutz.zhgh.therapyRecuperation.controller.mobile; +import cn.hutool.core.util.StrUtil; +import cn.wizzer.framework.base.Result; +import io.v.nutz.base.annontation.ViReturn; +import io.v.nutz.web.commons.utils.ShiroUtil; +import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig; +import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService; import org.apache.shiro.authz.annotation.RequiresAuthentication; +import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.lang.Lang; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; +import java.util.List; +import java.util.Map; + /** * @Author JyuHsin * @Date 2022/6/2 * @Description 疗休养页面跳转controller */ @IocBean -@At("/platform/mobile/theRapyRecuperation") @Ok("json:full") +@At("/platform/mobile/theRapyRecuperation") public class MobileTheRapyRecuperationEnrollController { + @Inject + private Dao dao; + @Inject + private TheRapyRecuperationEnrollService theRapyRecuperationEnrollService; + /** * 手机端 首页 */ @At("/index") @Ok("beetl:/mobile/therapyRecuperation/index.html") @RequiresAuthentication - public void index() { - - } + public void index() {} /** * 手机端 线路列表页面 @@ -31,9 +49,7 @@ public class MobileTheRapyRecuperationEnrollController { @At("/mobileLineListPage") @Ok("beetl:/mobile/therapyRecuperation/lineList.html") @RequiresAuthentication - public void mobileLinePage() { - - } + public void mobileLinePage() {} /** * 手机端 线路详情页面 @@ -41,9 +57,7 @@ public class MobileTheRapyRecuperationEnrollController { @At("/lineInfo") @Ok("beetl:/mobile/therapyRecuperation/lineInfo.html") @RequiresAuthentication - public void lineInfo() { - - } + public void lineInfo() {} /** * 手机端 基地详情页面 @@ -51,9 +65,7 @@ public class MobileTheRapyRecuperationEnrollController { @At("/baseInfo") @Ok("beetl:/mobile/therapyRecuperation/baseManagement.html") @RequiresAuthentication - public void baseInfo() { - - } + public void baseInfo() {} /** * 手机端 我的疗休养页面 @@ -61,15 +73,54 @@ public class MobileTheRapyRecuperationEnrollController { @At("/myRecuperation") @Ok("beetl:/mobile/therapyRecuperation/myRecuperation.html") @RequiresAuthentication - public void myRecuperation() { - - } + public void myRecuperation() {} @At("/userSignInfo") @Ok("beetl:/mobile/therapyRecuperation/userSignInfo.html") @RequiresAuthentication - public void userSignInfo() { + public void userSignInfo() {} + @At + @ViReturn + @RequiresAuthentication + public Object getOpenLineList(String id){ + if (StrUtil.isBlank(id)) { + return Result.error("参数错误"); + } + TheRapyRecuperationConfig config = theRapyRecuperationEnrollService.getConfig(); + + Sql sql = Sqls.create(""" + SELECT + us.id AS `value`, + CONCAT( + line.lineName, + '(', + DATE_FORMAT(us.playStartTime, '%m-%d'), + '至', + DATE_FORMAT(us.playEndTime, '%m-%d'), + ')' + ) AS `label` + FROM + the_rapy_recuperation_line_union_select us + LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId + $condition + """).setParam("id", id); + Cnd cnd = Cnd.NEW(); + cnd.and("us.`enable`", "=", true); + cnd.and("us.id", "!=", id); + + if ("fixedUser".equals(config.getOutsideQuotaMode())) { + if (!config.getFixedUserList().contains(ShiroUtil.getUserId())) { + cnd.and("line.regionalNature", "=", "省内"); + } + } + + cnd.asc("line.serialNumber"); + sql.setCondition(cnd); + + sql.setCallback(Sqls.callback.maps()); + dao.execute(sql); + return sql.getResult(); } } diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/process/TheRapyRecuperationEnrollController.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/process/TheRapyRecuperationEnrollController.java index 019ebc8..3ce2e8f 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/process/TheRapyRecuperationEnrollController.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/process/TheRapyRecuperationEnrollController.java @@ -18,12 +18,14 @@ import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgenc import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.slog.annotation.SLog; import org.apache.shiro.authz.annotation.RequiresAuthentication; +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.dao.util.Daos; +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; @@ -87,8 +89,9 @@ public class TheRapyRecuperationEnrollController { @POST @ViReturn @RequiresAuthentication - public Object pageData(PageForm pageForm, Integer year, String unionId, int theRapyRecuperationType, Integer lineUnionType) { - return enrollService.enrollPageData(pageForm, year, unionId, theRapyRecuperationType, lineUnionType); + public Object pageData(PageForm pageForm, Integer year, String unionId, + int theRapyRecuperationType, Integer lineUnionType, String editOther) { + return enrollService.enrollPageData(pageForm, year, unionId, theRapyRecuperationType, lineUnionType, editOther); } @At @@ -149,7 +152,8 @@ public class TheRapyRecuperationEnrollController { @POST @ViReturn @RequiresAuthentication - public Object doSignUpForLine(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) { + @Aop(TransAop.READ_COMMITTED) + public synchronized Object doSignUpForLine(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) { //省外的线路报名需要判断 // if (lineInfo.getRegionalNature().equals(TheRapyRecuperationProvinceType.provinceOut.getValue())) { Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion")); @@ -176,17 +180,28 @@ public class TheRapyRecuperationEnrollController { } else if (!IdcardUtil.isValidCard(companion.getIdCard())) { return Result.error("随行人身份证信息有误"); } - if (companion.getAge() < 3 || companion.getAge() > 70) { + if (companion.getAge() < 1 || companion.getAge() > 70) { return Result.error("随行人年龄超过限制,请上传其他随行人"); } } } - if (StrUtil.isBlank(enrollInfo.getId())) { enrollService.doSignUpForLine(enrollInfo); } else { - enrollService.updateSignUpLine(enrollInfo); + if (StrUtil.isNotBlank(enrollInfo.getEditOther())) { + dao.clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "=", enrollInfo.getEditOther())); + dao.clear(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "=", enrollInfo.getEditOther())); + if (StrUtil.isNotBlank(enrollInfo.getBedInfoId())) { + dao.delete(TheRapyRecuperationEnrollBed.class, enrollInfo.getBedInfoId()); + } + enrollInfo.setSpecificTime(null); + enrollInfo.setTakePartInTravelAgencyId(null); + enrollInfo.setTakePartInBaseManagementId(null); + enrollService.doSignUpForLine(enrollInfo); + } else { + enrollService.updateSignUpLine(enrollInfo); + } } return null; } @@ -201,6 +216,7 @@ public class TheRapyRecuperationEnrollController { @POST @ViReturn @RequiresAuthentication + @Aop(TransAop.READ_COMMITTED) public Object doSignUpForTravelAgency(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) { Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion")); Map resultMap = new HashMap<>(); @@ -230,6 +246,7 @@ public class TheRapyRecuperationEnrollController { @POST @ViReturn @RequiresAuthentication + @Aop(TransAop.READ_COMMITTED) public Object doSignUpForBaseManagement(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) { Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion")); Map resultMap = new HashMap<>(); @@ -242,34 +259,42 @@ public class TheRapyRecuperationEnrollController { return Result.error(resultMap.get(false)); } - // 校验随行人的身份证信息 - if (Lang.isNotEmpty(enrollInfo.getCompanionList())) { - for (TheRapyRecuperationEnrollCompanion companion : enrollInfo.getCompanionList()) { - if (StrUtil.isBlank(companion.getIdCard())) { - return Result.error("随行人身份证信息不能为空"); - } else if (!IdcardUtil.isValidCard(companion.getIdCard())) { - return Result.error("随行人身份证信息有误"); - } - if (companion.getAge() < 3 || companion.getAge() > 70) { - return Result.error("随行人年龄超过限制,请上传其他随行人"); - } - } - } - if (StrUtil.isBlank(enrollInfo.getId())) { enrollService.doSignUpForHotel(enrollInfo); } else { - enrollService.updateSignUpHotel(enrollInfo); + if (StrUtil.isNotBlank(enrollInfo.getEditOther())) { + dao.clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "=", enrollInfo.getEditOther())); + dao.clear(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "=", enrollInfo.getEditOther())); + if (StrUtil.isNotBlank(enrollInfo.getBedInfoId())) { + dao.delete(TheRapyRecuperationEnrollBed.class, enrollInfo.getBedInfoId()); + } + enrollInfo.setRoomCount(null); + enrollInfo.setRoomRemark(null); + enrollInfo.setRoomRemarkName(null); + enrollInfo.setRoommate(null); + enrollInfo.setRoomCountName(null); + enrollInfo.setOtherRemark(null); + enrollInfo.setTakePartInLineId(null); + enrollInfo.setTakePartInUnionId(null); + enrollInfo.setTakePartInTravelAgencyId(null); + enrollInfo.setIntentionLineId(null); + enrollInfo.setIntentionLineName(null); + enrollInfo.setCarryFamilyNum(null); + enrollService.doSignUpForHotel(enrollInfo); + } else { + enrollService.updateSignUpHotel(enrollInfo); + } } return null; } - @At("/findSignUpInfoById/?") + @At @POST @ViReturn @RequiresAuthentication - public Object findSignUpInfoById(String id) { - return enrollService.findSignUpInfoById(id); + public Object findSignUpInfoById(@Param(value = "id", required = false) String id, + @Param(value = "editOther", required = false) String editOther) { + return enrollService.findSignUpInfoById(id, editOther); } /** diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/process/TheRapyRecuperationUserQueryController.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/process/TheRapyRecuperationUserQueryController.java index 0a024b6..9fa49b6 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/process/TheRapyRecuperationUserQueryController.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/process/TheRapyRecuperationUserQueryController.java @@ -119,7 +119,7 @@ public class TheRapyRecuperationUserQueryController { enroll.*, lineu.lineId, lineu.playStartTime, - lineu.playEndTime, + lineu.playEndTime, ( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily FROM `the_rapy_recuperation_enroll` enroll @@ -128,7 +128,7 @@ public class TheRapyRecuperationUserQueryController { LEFT JOIN the_rapy_recuperation_lot lot ON lot.id = line.lotId LEFT JOIN the_rapy_recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = line.travelAgencyId - $condition + $condition """); cnd.andEX("YEAR(enroll.signingUptime)", ">=", startYear); cnd.andEX("YEAR(enroll.signingUptime)", "<=", endYear); @@ -504,7 +504,9 @@ public class TheRapyRecuperationUserQueryController { lineEntities.add(new ExcelExportEntity("行程", "playTime", 20)); lineEntities.add(new ExcelExportEntity("房间需求数", "roomCount", 20)); lineEntities.add(new ExcelExportEntity("用房备注", "roomRemarkName", 30)); - lineEntities.add(new ExcelExportEntity("其他", "other", 20)); + lineEntities.add(new ExcelExportEntity("其他备注", "otherRemark", 20)); + lineEntities.add(new ExcelExportEntity("第二意向线路", "intentionLineName", 30)); + lineEntities.add(new ExcelExportEntity("意向线路携带家属数", "carryFamilyNum", 20)); //自由组团表头 ArrayList travelEntities = new ArrayList<>(commonEntities); diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/theRapyConfig/TheRapyRecuperationConfigController.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/theRapyConfig/TheRapyRecuperationConfigController.java index 0643d7f..b404943 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/theRapyConfig/TheRapyRecuperationConfigController.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/theRapyConfig/TheRapyRecuperationConfigController.java @@ -94,6 +94,15 @@ public class TheRapyRecuperationConfigController { dao.insertWith(config, "lots"); } + // 如果是特定人员报名,将这些人存在redis里边,方便查询 + if ("fixedUser".equals(config.getOutsideQuotaMode())) { + Sql sql = Sqls.create("select userId from the_rapy_recuperation_can_apply_out_user"); + sql.setCallback(Sqls.callback.strList()); + dao.execute(sql); + List stringList = sql.getList(String.class); + config.setFixedUserList(stringList); + } + // 将配置存储到redis里边,可以避免每次都去查一次数据库 String configCache = RedisConstant.REDIS_KEY_THE_RAPY_RECU_CONFIG_CACHE; redisService.del(configCache); diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/model/TheRapyRecuperationConfig.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/model/TheRapyRecuperationConfig.java index 39008c1..10a505b 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/model/TheRapyRecuperationConfig.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/model/TheRapyRecuperationConfig.java @@ -1,5 +1,6 @@ package io.v.nutz.zhgh.therapyRecuperation.model; +import io.v.nutz.sys.models.Sys_file; import lombok.Data; import lombok.experimental.Accessors; import org.nutz.dao.entity.annotation.*; @@ -116,4 +117,12 @@ public class TheRapyRecuperationConfig { @Comment("分工会人数限制") @ColDefine(type = ColType.MYSQL_JSON) private List unionLimit; + + @Column + @ColDefine(type = ColType.MYSQL_JSON) + @Comment("承诺书") + private List files; + + // 可以参加报名的人员 + private List fixedUserList; } diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/model/TheRapyRecuperationEnroll.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/model/TheRapyRecuperationEnroll.java index da02220..70f6176 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/model/TheRapyRecuperationEnroll.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/model/TheRapyRecuperationEnroll.java @@ -237,5 +237,27 @@ public class TheRapyRecuperationEnroll extends BaseModel { @Comment("拼房人") private String roommate; + @Column + @ColDefine(type = ColType.VARCHAR, width = 255) + @Comment("其他备注") + private String otherRemark; + + @Column + @ColDefine(type = ColType.VARCHAR, width = 32) + @Comment("第二意向线路Id") + private String intentionLineId; + + @Column + @ColDefine(type = ColType.VARCHAR, width = 100) + @Comment("第二意向线路名称") + private String intentionLineName; + + @Column + @ColDefine(type = ColType.INT) + @Comment("携带家属人数") + private Integer carryFamilyNum; + private String firstLetter; + + private String editOther; } diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/TheRapyRecuperationEnrollService.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/TheRapyRecuperationEnrollService.java index 74ba674..cd13264 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/TheRapyRecuperationEnrollService.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/TheRapyRecuperationEnrollService.java @@ -4,6 +4,7 @@ import cn.wizzer.framework.page.Pagination; import io.v.nutz.base.query.PageForm; import io.v.nutz.base.service.ViService; import io.v.nutz.sys.models.Sys_union; +import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll; import org.nutz.dao.Cnd; import org.nutz.lang.util.NutMap; @@ -27,7 +28,8 @@ public interface TheRapyRecuperationEnrollService extends ViService getSelectLineById(String lineId, String unionId, int trrt, Integer lineUnionType); @@ -101,7 +103,7 @@ public interface TheRapyRecuperationEnrollService extends ViService getTheRapyUnions(Integer year); + + + TheRapyRecuperationConfig getConfig(); } diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/impl/TheRapyRecuperationAuditServiceImpl.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/impl/TheRapyRecuperationAuditServiceImpl.java index 9544cbf..f6095f2 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/impl/TheRapyRecuperationAuditServiceImpl.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/impl/TheRapyRecuperationAuditServiceImpl.java @@ -113,9 +113,9 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl im fetch.setv("bedInfo", bedInfo); } List companionList = dao().query(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "=", id)); - companionList.forEach(v -> { - v.setBedInfo(dao().fetch(TheRapyRecuperationEnrollBed.class, v.getBedInfoId())); - }); +// companionList.forEach(v -> { +// v.setBedInfo(dao().fetch(TheRapyRecuperationEnrollBed.class, v.getBedInfoId())); +// }); map.addv("viewData", fetch.setv("companionList", companionList)); diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/impl/TheRapyRecuperationEnrollServiceImpl.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/impl/TheRapyRecuperationEnrollServiceImpl.java index c9045d7..f961dce 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/impl/TheRapyRecuperationEnrollServiceImpl.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/impl/TheRapyRecuperationEnrollServiceImpl.java @@ -69,7 +69,12 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl oneYear = this.validCountOneYear(loginName, travelFrequency); + Map oneYear = this.validCountOneYear(loginName, travelFrequency, editOther); if (oneYear != null) { return oneYear; } @@ -505,7 +520,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl oneYear = this.validCountOneYear(loginName, travelFrequency); + Map oneYear = this.validCountOneYear(loginName, travelFrequency, editOther); if (oneYear != null) { return oneYear; } @@ -571,7 +586,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl oneYear = this.validCountOneYear(loginName, travelFrequency); + Map oneYear = this.validCountOneYear(loginName, travelFrequency, editOther); if (oneYear != null) { return oneYear; } @@ -967,22 +982,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl validSignUpInfoForHMC(String loginName, TheRapyRecuperationEnroll enrollInfo) { - //配置信息 - TheRapyRecuperationConfig config; - - // 丛redis里面去配置信息 - String configRedis = redisService.get(RedisConstant.REDIS_KEY_THE_RAPY_RECU_CONFIG_CACHE); - if (StrUtil.isNotBlank(configRedis)) { - try { - config = JSONUtil.toBean(configRedis, TheRapyRecuperationConfig.class); - } catch (Exception e) { - config = dao().fetch(TheRapyRecuperationConfig.class); - redisService.set(RedisConstant.REDIS_KEY_THE_RAPY_RECU_CONFIG_CACHE, JSONUtil.toJsonStr(config)); - } - } else { - config = dao().fetch(TheRapyRecuperationConfig.class); - redisService.set(RedisConstant.REDIS_KEY_THE_RAPY_RECU_CONFIG_CACHE, JSONUtil.toJsonStr(config)); - } + TheRapyRecuperationConfig config = getConfig(); Sys_user user = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", loginName)); //判断是否在报名范围内 @@ -1002,13 +1002,15 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl oneYear = this.validCountOneYear(loginName, travelFrequency); + Map oneYear = this.validCountOneYear(loginName, travelFrequency, editOther); if (oneYear != null) { return oneYear; } @@ -1016,7 +1018,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl oneYear = this.validCountOneYear(loginName, travelFrequency); + Map oneYear = this.validCountOneYear(loginName, travelFrequency, editOther); if (oneYear != null) { return oneYear; } @@ -1076,7 +1078,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl oneYear = this.validCountOneYear(loginName, travelFrequency); + Map oneYear = this.validCountOneYear(loginName, travelFrequency, editOther); if (oneYear != null && oneYear.containsKey(false)) { return oneYear; } @@ -1111,7 +1113,9 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl= result) { return Map.of(false, "已报人数超过" + (proportion * 100) + "%,不能报名"); } + } else if ("fixedUser".equals(outsideQuotaMode)) { + if (!config.getFixedUserList().contains(ShiroUtil.getUserId())) { + return Map.of(false, "您不在省外报名人员范围内,如有疑问请及时联系校工会"); + } } else if ("unionRatio".equals(outsideQuotaMode)) { // 分工会名额限制 String unionId = Vi.getUnionId(); @@ -1263,66 +1269,65 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl validCountOneYear(String loginName, int travelFrequency) { + public Map validCountOneYear(String loginName, int travelFrequency, String editOther) { Cnd cnd = Cnd.NEW(); cnd.and("loginName", "=", loginName); cnd.and("isNormal", "=", true); cnd.and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear()); int joinCount = dao().count(TheRapyRecuperationEnroll.class, cnd); - if (joinCount >= travelFrequency) { - - Sql sql = Sqls.create(""" - SELECT - us.id, - line.regionalNature - FROM - the_rapy_recuperation_line_union_select us - LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId - WHERE - YEAR(us.signUpStartTime) = YEAR(NOW()) - """); - List usList = listMap(sql); - - List unionInSelectIds = usList.stream().filter(v -> "省内".equals(v.getString("regionalNature"))).map(v -> v.getString("id")).toList(); - List unionOutSelectIds = usList.stream().filter(v -> "省外".equals(v.getString("regionalNature"))).map(v -> v.getString("id")).toList(); - - -// List inList = dao().query(TheRapyRecuperationLine.class, Cnd.where("regionalNature", "=", "省内")); -// List unionInSelects = dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "in", inList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList()))); -// List outList = dao().query(TheRapyRecuperationLine.class, Cnd.where("regionalNature", "=", "省外")); -// List unionOutSelects = dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "in", outList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList()))); - //是否选择省外 - int inCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname")) - .and("takePartInLineId", "in", unionInSelectIds) - .and("isNormal", "=", true) - .and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear())); - //是否报省外 - int outCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname")) - .and("takePartInLineId", "in", unionOutSelectIds) - .and("isNormal", "=", true) - .and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear())); - //是否报旅行社 - int travelCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname")) - .and(Cnd.exps("takePartInLineId", "is", null).or("takePartInLineId", "=", "")) - .and("isNormal", "=", true) - .and("takePartInTravelAgencyId", "is not", null) - .and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear())); - //是否报酒店 - int hotelCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname")) - .and("takePartInLineId", "is", null).and("isNormal", "=", true) - .and("takePartInBaseManagementId", "is not", null) - .and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear())); - String str = ""; - if (inCount > 0) { - str = "省内线路"; - } else if (outCount > 0) { - str = "省外线路"; - } else if (travelCount > 0) { - str = "旅行社"; - } else if (hotelCount > 0) { - str = "酒店"; - } + if (joinCount >= travelFrequency && StrUtil.isBlank(editOther)) { +// Sql sql = Sqls.create(""" +// SELECT +// us.id, +// line.regionalNature +// FROM +// the_rapy_recuperation_line_union_select us +// LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId +// WHERE +// YEAR(us.signUpStartTime) = YEAR(NOW()) +// """); +// List usList = listMap(sql); +// +// List unionInSelectIds = usList.stream().filter(v -> "省内".equals(v.getString("regionalNature"))).map(v -> v.getString("id")).toList(); +// List unionOutSelectIds = usList.stream().filter(v -> "省外".equals(v.getString("regionalNature"))).map(v -> v.getString("id")).toList(); +// +// +//// List inList = dao().query(TheRapyRecuperationLine.class, Cnd.where("regionalNature", "=", "省内")); +//// List unionInSelects = dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "in", inList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList()))); +//// List outList = dao().query(TheRapyRecuperationLine.class, Cnd.where("regionalNature", "=", "省外")); +//// List unionOutSelects = dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "in", outList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList()))); +// //是否选择省外 +// int inCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname")) +// .and("takePartInLineId", "in", unionInSelectIds) +// .and("isNormal", "=", true) +// .and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear())); +// //是否报省外 +// int outCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname")) +// .and("takePartInLineId", "in", unionOutSelectIds) +// .and("isNormal", "=", true) +// .and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear())); +// //是否报旅行社 +// int travelCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname")) +// .and(Cnd.exps("takePartInLineId", "is", null).or("takePartInLineId", "=", "")) +// .and("isNormal", "=", true) +// .and("takePartInTravelAgencyId", "is not", null) +// .and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear())); +// //是否报酒店 +// int hotelCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname")) +// .and("takePartInLineId", "is", null).and("isNormal", "=", true) +// .and("takePartInBaseManagementId", "is not", null) +// .and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear())); +// String str = ""; +// if (inCount > 0) { +// str = "省内线路"; +// } else if (outCount > 0) { +// str = "省外线路"; +// } else if (travelCount > 0) { +// str = "旅行社"; +// } else if (hotelCount > 0) { +// str = "酒店"; +// } return Map.of(false, "您已报过其他线路,如有疑问请联系分工会主席!"); } return Map.of(true, "成功"); @@ -1401,7 +1406,8 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl(); } + + + @Override + public TheRapyRecuperationConfig getConfig() { + //配置信息 + TheRapyRecuperationConfig config; + // 丛redis里面去配置信息 + String configRedis = redisService.get(RedisConstant.REDIS_KEY_THE_RAPY_RECU_CONFIG_CACHE); + if (StrUtil.isNotBlank(configRedis)) { + try { + config = JSONUtil.toBean(configRedis, TheRapyRecuperationConfig.class); + } catch (Exception e) { + config = dao().fetch(TheRapyRecuperationConfig.class); + // 如果是特定人员报名,将这些人存在redis里边,方便查询 + if ("fixedUser".equals(config.getOutsideQuotaMode())) { + Sql sql = Sqls.create("select userId from the_rapy_recuperation_can_apply_out_user"); + sql.setCallback(Sqls.callback.strList()); + dao().execute(sql); + List stringList = sql.getList(String.class); + config.setFixedUserList(stringList); + } + redisService.set(RedisConstant.REDIS_KEY_THE_RAPY_RECU_CONFIG_CACHE, JSONUtil.toJsonStr(config)); + } + } else { + config = dao().fetch(TheRapyRecuperationConfig.class); + // 如果是特定人员报名,将这些人存在redis里边,方便查询 + if ("fixedUser".equals(config.getOutsideQuotaMode())) { + Sql sql = Sqls.create("select userId from the_rapy_recuperation_can_apply_out_user"); + sql.setCallback(Sqls.callback.strList()); + dao().execute(sql); + List stringList = sql.getList(String.class); + config.setFixedUserList(stringList); + } + redisService.set(RedisConstant.REDIS_KEY_THE_RAPY_RECU_CONFIG_CACHE, JSONUtil.toJsonStr(config)); + } + return config; + } } diff --git a/src/main/resources/static/components/theRapyRecuperation/Enrollinfo.vue b/src/main/resources/static/components/theRapyRecuperation/Enrollinfo.vue index 10e9b73..926a583 100644 --- a/src/main/resources/static/components/theRapyRecuperation/Enrollinfo.vue +++ b/src/main/resources/static/components/theRapyRecuperation/Enrollinfo.vue @@ -1,193 +1,179 @@ diff --git a/src/main/resources/views/mobile/platform.html b/src/main/resources/views/mobile/platform.html index 5a89656..08118b7 100644 --- a/src/main/resources/views/mobile/platform.html +++ b/src/main/resources/views/mobile/platform.html @@ -116,6 +116,28 @@
diff --git a/src/main/resources/views/mobile/therapyRecuperation/baseManagement.html b/src/main/resources/views/mobile/therapyRecuperation/baseManagement.html index 5b61e1d..704ee33 100644 --- a/src/main/resources/views/mobile/therapyRecuperation/baseManagement.html +++ b/src/main/resources/views/mobile/therapyRecuperation/baseManagement.html @@ -197,6 +197,14 @@ layout("/mobile/platform.html"){ background-color: white; } + .sign_div { + background-color: white; + margin-bottom: 16px; + padding: 18px; + border-radius: 6px; + box-shadow: 0 8px 12px #ebedf0; + } + .pdf_div { padding-bottom: 70px; height: calc(100vh - 46px - 170px - 60px - 24px); @@ -265,12 +273,12 @@ layout("/mobile/platform.html"){ @@ -279,10 +287,10 @@ layout("/mobile/platform.html"){ - + + 温馨提示:报名定点疗休养需签署【定点自由行申请表】,填写基础信息和签字后会同步在申请表中,点击查看按钮可展示申请表 + +
@@ -319,137 +327,31 @@ layout("/mobile/platform.html"){
- - -
+
提交报名
-
- 查看定点自由行申请表 -
-
- @@ -482,21 +384,25 @@ layout("/mobile/platform.html"){ - + + 上下滑动翻页,单击查看,再单击返回 +
+
+ 我已阅读确认 +
+
- - - - - -
- -
+ + 上下滑动翻页,单击查看,再单击返回 +
+
+ 我已阅读确认 +
+