This commit is contained in:
JyuHsin
2026-02-26 15:13:11 +08:00
parent 440b77e33b
commit 7c304c71ed
16 changed files with 72 additions and 148 deletions
@@ -156,7 +156,7 @@ public class ActivityApplyController {
}
if (!ShiroUtil.hasAnyRoles("H04,gh08,sysadmin")) {
if (!ShiroUtil.hasAnyRoles("gh01,H04,gh08,sysadmin")) {
cnd.and(new Static("JSON_CONTAINS(school.applyWay,JSON_ARRAY( 1))>0"));
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(ShiroUtil.getUserId())));
}
@@ -649,7 +649,7 @@ public class ActivityApplyController {
""").setParam("unionId", getUnionId()).setParam("userId", ShiroUtil.getUserId());
if (!ShiroUtil.hasAnyRoles("H04,sysadmin")) {
if (!ShiroUtil.hasAnyRoles("gh01,H04,sysadmin")) {
cnd.where().andLike("school.applyWay ", "1");
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(ShiroUtil.getUserId())));
@@ -33,8 +33,10 @@ public class SysActivityUnitListener implements SysCommonDataChange {
case UPDATE -> {
Sys_unit sys_unit = dao.fetch(Sys_unit.class, bizId);
ActivityBasicUnit basicUnit = dao.fetch(ActivityBasicUnit.class, Cnd.where("id", "=", sys_unit.getId()));
BeanUtil.copyProperties(sys_unit, basicUnit, "id");
dao.update(basicUnit);
if(basicUnit != null) {
BeanUtil.copyProperties(sys_unit, basicUnit, "id");
dao.update(basicUnit);
}
}
case DELETE -> {
dao.clear(ActivityBasicUnit.class, Cnd.where("id", "=", bizId));
@@ -346,130 +346,14 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
private void checkMemberOrWelfareMember(SourceChangeConfig config, UserSource source, Sys_user user,
List<String> addMemberUserIds, List<String> deleteMemberUserIds,
List<String> addWelfareMemberUserIds, List<String> deleteWelfareMemberUserIds){
if (config == null || config.getMemberSiftList() == null) {
if (StrUtil.isBlank(source.getUserState())) {
return;
}
config.getMemberSiftList().forEach(memberSift -> {
String siftName = memberSift.getSiftName();
Object siftValue = memberSift.getSiftValue();
boolean shouldAdd = false;
boolean shouldRemove = false;
// 提前检查 userState 条件(如果存在)
boolean userStateConditionMet = true;
if ("userState".equals(siftName)) {
userStateConditionMet = checkListCondition(siftValue, source, "userState");
}
switch (siftName) {
case "userState":
// 如果 userState 不满足条件,则直接设置 shouldRemove
shouldAdd = userStateConditionMet;
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
break;
case "personType":
// 检查 personType 条件
// 必须同时满足 userState 和 personType 条件
shouldAdd = checkListCondition(siftValue, source, "personType");
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
break;
case "loginNameStart":
case "loginNameEnd":
shouldAdd = checkLoginNameCondition(siftValue, source, siftName);
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
break;
case "userQuery":
shouldAdd = checkUserQueryCondition(siftValue, user);
break;
}
if (shouldAdd) {
addUserToMemberList(user, source, addMemberUserIds);
source.setMember(1);
} else if (shouldRemove) {
deleteMemberUserIds.add(user.getId());
source.setMember(0);
}
});
if (config.getWelfareMemberSiftList() == null) {
return;
if (user != null && ObjectUtil.equals(user.getMember(), 1) && List.of("退休", "离职", "辞职").contains(source.getUserState())) {
deleteMemberUserIds.add(user.getId());
deleteWelfareMemberUserIds.add(user.getId());
}
config.getWelfareMemberSiftList().forEach(welfareMember -> {
String siftName = welfareMember.getSiftName();
Object siftValue = welfareMember.getSiftValue();
boolean shouldAdd = false;
boolean shouldRemove = false;
// 提前检查 userState 条件(如果存在)
boolean userStateConditionMet = true;
if ("userState".equals(siftName) && siftValue instanceof List<?>) {
List<String> userStateList = (List<String>) siftValue;
userStateConditionMet = source != null && source.getUserState() != null && userStateList.contains(source.getUserState());
}
switch (siftName) {
case "member":
if ((user != null && addMemberUserIds.contains(user.getId())) || addMemberUserIds.contains(source.getId())) {
shouldAdd = true;
} else {
shouldRemove = true;
}
break;
case "userState":
shouldAdd = userStateConditionMet;
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
break;
case "personType":
if (siftValue instanceof List<?> && source != null && source.getPersonType() != null) {
List<String> personTypeList = (List<String>) siftValue;
// 必须同时满足 userState 和 personType 条件
shouldAdd = personTypeList.contains(source.getPersonType());
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
}
break;
case "loginNameStart":
if (siftValue instanceof String loginNameStart && source != null && source.getLoginname() != null) {
shouldAdd = source.getLoginname().startsWith(loginNameStart);
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
}
break;
case "loginNameEnd":
if (siftValue instanceof String loginNameEnd && source != null && source.getLoginname() != null) {
shouldAdd = source.getLoginname().endsWith(loginNameEnd);
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
}
break;
case "userQuery":
if (siftValue instanceof List<?> && user != null) {
List<String> userIds = (List<String>) siftValue;
shouldAdd = userIds.contains(user.getId()) && user.getMember() != 1;
}
break;
}
if (shouldAdd) {
if (user == null) {
addWelfareMemberUserIds.add(source.getId());
} else if (user.getMember() != 1) {
addWelfareMemberUserIds.add(user.getId());
}
source.setWelfareMember(1);
} else if (shouldRemove && user != null) {
deleteWelfareMemberUserIds.add(user.getId());
source.setWelfareMember(0);
}
});
}
// 提取公共方法
@@ -584,9 +468,11 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
history.setId(R.UU32());
history.setChangeTime(DateUtil.date());
history.setChangeOrigin(MemberChangeOrigin.SYSTEM.name());
// 新入职教职工
if (user == null) {
changeTypes.add(MemberChangeType.NEW.getType());
history.setChangeTypes(RESIGN_AND_OUT_WORK.contains(source.getUserState()) ? null : changeTypes);
history.setChangeInfosStr("新入职");
return history;
}
// 获取变更记录
@@ -595,6 +481,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
if (StrUtil.isBlank(newMap.getString("member"))) {
sourceMap.put("member", null);
}
// 变更记录
List<NutMap> changeList = new ArrayList<>();
for (String fieldName : allowChangeFieldNames) {
if (List.of("retireDate", "welfareStopDate", "personalStatus").contains(fieldName)) {
@@ -687,9 +574,9 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
private void deleteMemberUser(List<String> deleteMemberUserIds, Boolean isDeleteMemberActivityScope){
if (Lang.isNotEmpty(deleteMemberUserIds)) {
dao().clear(Sys_user_role.class, Cnd.where("userId", "in", deleteMemberUserIds).and("roleId", "=", Roles.MEMBER));
if (isDeleteMemberActivityScope) {
/* if (isDeleteMemberActivityScope) {
dao().clear(ActivityUserScope.class, Cnd.where("userId", "in", deleteMemberUserIds).and("groupId", "=", 1));
}
}*/
}
}
@@ -33,8 +33,10 @@ public class ProposalUnderTakeListener implements SysCommonDataChange {
case UPDATE -> {
Sys_unit sys_unit = dao.fetch(Sys_unit.class, bizId);
ProposalUndertake undertake = dao.fetch(ProposalUndertake.class, Cnd.where("unitCode", "=", sys_unit.getUnitcode()));
undertake.setUnitName(sys_unit.getName());
dao.updateIgnoreNull(undertake);
if(undertake != null) {
undertake.setUnitName(sys_unit.getName());
dao.updateIgnoreNull(undertake);
}
}
case DELETE -> {
dao.clear(ProposalUndertake.class, Cnd.where("id", "=", bizId));
@@ -57,6 +57,12 @@ public class QsvSubject extends BaseModel {
@ColDefine(type = ColType.INT, width = 1)
private Integer maxMulti;
@Column
@Comment("多选,最少选几个")
@ColDefine(type = ColType.INT, width = 1)
@Default(value = "1")
private Integer minMulti;
@Column
@Comment("排序")
@ColDefine(type = ColType.INT, width = 1)
@@ -178,14 +178,14 @@ public class TrainSignUpActivityStatisticsController {
});
List<ExcelExportEntity> excelCommonExportEntity = new ArrayList<>();
excelCommonExportEntity.add(new ExcelExportEntity("姓名", "username", 20));
excelCommonExportEntity.add(new ExcelExportEntity("姓名", "username", 10));
excelCommonExportEntity.add(new ExcelExportEntity("工号", "loginname", 20));
excelCommonExportEntity.add(new ExcelExportEntity("单位", "unitname", 20));
excelCommonExportEntity.add(new ExcelExportEntity("分工会", "unionname", 20));
excelCommonExportEntity.add(new ExcelExportEntity("性别", "sex", 20));
excelCommonExportEntity.add(new ExcelExportEntity("单位", "unitname", 30));
excelCommonExportEntity.add(new ExcelExportEntity("分工会", "unionname", 30));
excelCommonExportEntity.add(new ExcelExportEntity("性别", "sex", 10));
excelCommonExportEntity.add(new ExcelExportEntity("手机号", "mobile", 20));
excelCommonExportEntity.add(new ExcelExportEntity("报名时间", "signUpTime", 20));
//excelCommonExportEntity.add(new ExcelExportEntity("报名时段", "courseTime", 20));
excelCommonExportEntity.add(new ExcelExportEntity("报名时间", "signUpTime", 30));
excelCommonExportEntity.add(new ExcelExportEntity("报名时段", "courseTime", 30));
// excelCommonExportEntity.add(new ExcelExportEntity("生日", "birthday", 20));
excelCommonExportEntity.add(new ExcelExportEntity("报名状态", "stateName", 20));
@@ -145,4 +145,9 @@ public class TrainSignUpCourse extends BaseModel implements Serializable {
private String courseTimeName;
@Column
@Comment("二维码")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String classQrCode;
}
@@ -122,6 +122,7 @@ layout("/mobile/platform.html"){
v-model="subject.userSelectOptionIds"
:ref="'subject'+subject.id"
:max="subject.maxMulti ? subject.maxMulti : 0"
:min="subject.minMulti ? subject.minMulti : 0"
v-if="['radio','checkbox'].includes(subject.type)"
>
<van-cell-group>
@@ -304,10 +305,15 @@ layout("/mobile/platform.html"){
for (let i = 0; i < this.subjects.length; i++) {
const subject = this.subjects[i]
if (["radio", "checkbox"].includes(subject.type)) {
console.log(subject)
if (!subject.userSelectOptionIds || subject.userSelectOptionIds.length === 0) {
this.$toast.fail("第" + (i + 1) + "题未做答")
return
}
if(subject.minMulti && subject.userSelectOptionIds.length < subject.minMulti) {
this.$toast.fail("第" + (i + 1) + "题最少需要选择" + subject.minMulti + "项")
return
}
} else if ("text" === subject.type) {
if (!subject.userFillContent) {
this.$toast.fail("第" + (i + 1) + "题未作答")
@@ -315,6 +321,7 @@ layout("/mobile/platform.html"){
}
}
}
this.autoSubmit()
},
@@ -226,8 +226,8 @@ layout("/mobile/platform.html"){
</div>
</template>
<div>
<span @click.stop="showPic(FILE_DOMAIN + '/fileStreamPreview?id=' + tableData.wechat.id)"
v-if="o.isSign === true && tableData.wechat"
<span @click.stop="showPic(FILE_DOMAIN + '/fileStreamPreview?id=' + o.classQrCode)"
v-if="o.isSign === true && o.classQrCode"
style="color: #dd6363">点我查看微信群二维码</span>
</div>
<van-button type="primary" color="#1867b0" round size="mini"
@@ -166,9 +166,9 @@ layout("/mobile/platform.html"){
温馨提醒
</div>
<div>
<div>1.本次慰问品共2种套餐,教职工可任选其中1种套餐快递(分2个快递发货),快递地址仅限江浙沪(江苏,浙江,上海)。</div>
<div>2.快递预计于9月29日前投递完成(<label style="font-weight: bold; color: darkred">套餐1内苹果礼盒于11月底前快递到家</label>,请保持联系电话畅通并及时接听。</div>
<div>3.填写截止时间:9月10日10点</div>
<div>1.本次慰问品共3种套餐,教职工可任选其中1种套餐快递(1个快递发货),快递地址仅限江浙沪(江苏,浙江,上海)。</div>
<div>2.快递预计于2026年1月10日前投递完成,请保持联系电话畅通并及时接听。</div>
<div>3.填写截止时间:12月16日12点,没有在规定时间内选套餐的默认套餐二,并统一快递瓯江囗校区自取</div>
</div>
</van-cell>
</van-cell-group>
@@ -258,7 +258,7 @@ layout("/mobile/platform.html"){
备注:{{option.simpleDesc}}
</div>
<div style="position: absolute;right: 10px;bottom: -10px;left: 0;display: flex;justify-content: space-between">
<div style="width: 70px;font-size: 13px;color: #918a8a;text-align: right;"
<div style="width: 70px;font-size: 13px;color: #1867b0;text-align: right;"
@click="openViewDesc(option.description)">
套餐详情
</div>
@@ -358,7 +358,7 @@ layout("/layouts/platform.html"){
type="primary"
v-if="row.applyWay.includes(2)">项目报名
</el-button>
<!--#if(@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('gh08')){#-->
<!--#if(@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('gh08')||@shiro.hasRole('gh01')){#-->
<el-button :loading="row.loading" @click="doDelete(row)"
size="mini"
type="danger">删除报名人员
@@ -42,6 +42,10 @@ const subjectForm = {
<!-- </el-option>-->
</el-select>
</div>
<div v-if="subject.type === 'checkbox'">
最小选择数:<el-input v-model="subject.minMulti" placeholder="最少可选数量" style="width: 200px"></el-input>
</div>
<div v-if="subject.type === 'checkbox'">
最大选择数:<el-input v-model="subject.maxMulti" placeholder="最多可选数量" style="width: 200px"></el-input>
@@ -55,8 +55,8 @@ layout("/layouts/platform.html"){
notice: false,
isIntegral: false,
courseList: [
{courseName: '1', courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1},
{courseName: '2', courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1}
{courseName: '1', courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, classQrCode: ''},
{courseName: '2', courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, classQrCode: ''}
],
conditionStructure: {
method: "AND",
@@ -162,7 +162,7 @@ layout("/layouts/platform.html"){
},
//添加培训班
addCourse() {
this.formData.courseList.push({courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false})
this.formData.courseList.push({courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false, classQrCode: ''})
},
//删除培训班
async removeTableCourse(index) {
@@ -294,7 +294,7 @@ layout("/layouts/platform.html"){
</template>
<template v-else>
<el-button v-if="row.courseList && row.courseList.length == 1" type="text" style="padding: 0">
{{moment(row.courseList[0].courseStartTime).format('MM-DD HH:mm')}}至{{moment(row.courseList[0].courseStartTime).format('MM-DD HH:mm')}}
{{moment(row.courseList[0].courseStartTime).format('MM-DD HH:mm')}}至{{moment(row.courseList[0].courseEndTime).format('MM-DD HH:mm')}}
</el-button>
<el-button v-else style="padding: 0" @click="openViewCourseTime(row)" type="text">
点击查看{{trainType}}时间
@@ -611,6 +611,17 @@
</el-col>
</el-row>
<el-row :gutter="50" type="flex">
<el-col :span="4">
<span>二维码</span>
</el-col>
<el-col :span="20">
<image-Upload :height="100" :width="100" :limit="1" :file-type="['png', 'jpg']" :file-size="1"
:key="moreInfoIndex"
v-model="formData.courseList[moreInfoIndex].classQrCode"></image-Upload>
</el-col>
</el-row>
</el-drawer>
<drawer-user-scope
@@ -157,13 +157,13 @@ layout("/layouts/platform.html"){
<template #edit>
<vi-title title="温馨提醒"></vi-title>
<el-alert title="1.本次慰问品共2种套餐,教职工可任选其中1种套餐快递(分2个快递发货),快递地址仅限江浙沪(江苏,浙江,上海)。" type="warning" effect="dark"></el-alert>
<el-alert title="1.本次慰问品共3种套餐,教职工可任选其中1种套餐快递(1个快递发货),快递地址仅限江浙沪(江苏,浙江,上海)。" type="warning" effect="dark"></el-alert>
<el-alert type="warning" effect="dark">
<template #title>
<span>2.快递预计于9月29日前投递完成(<label style="font-weight: bold; color: darkred">套餐1内苹果礼盒于11月底前快递到家</label>,请保持联系电话畅通并及时接听。</span>
<span>2.快递预计于2026年1月10日前投递完成,请保持联系电话畅通并及时接听。</span>
</template>
</el-alert>
<el-alert title="3.填写截止时间:9月10日10点。" type="warning" effect="dark"></el-alert>
<el-alert title="3.填写截止时间:12月16日12点,没有在规定时间内选套餐的默认套餐二,并统一快递至瓯江囗校区自取。" type="warning" effect="dark"></el-alert>
<el-card shadow="never">
<el-form :model="formData" label-width="120px" ref="addForm">
<el-form-item label="福利名称">