Compare commits
13
Commits
d017fd239f
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0cd7f1819 | ||
|
|
3beb3cf77b | ||
|
|
dbd76108eb | ||
|
|
e9044fb0b5 | ||
|
|
9a97ded0d9 | ||
|
|
f5fb765bc2 | ||
|
|
364a6d0c4f | ||
|
|
ca2635b60f | ||
|
|
e4c4e538dd | ||
|
|
58bcec892f | ||
|
|
62be1ba55e | ||
|
|
a529473ba3 | ||
|
|
70ac623830 |
@@ -11,6 +11,7 @@ import io.v.nutz.sys.services.SysMenuService;
|
||||
import io.v.nutz.sys.services.SysUserService;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activity.models.ActivitySchool;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.jsoup.Jsoup;
|
||||
@@ -211,6 +212,35 @@ public class SysHomeController {
|
||||
public Result listHomeActivity() {
|
||||
FieldFilter fieldFilter = FieldFilter.locked(Sys_home_activity.class, "classPath");
|
||||
List<Sys_home_activity> list = Daos.ext(dao,fieldFilter) .query(Sys_home_activity.class, Cnd.where("enable", "=", 1).desc("top"));
|
||||
boolean sportsApplyRole = ShiroUtil.hasAnyRoles("H04,sysadmin,SCHOOL_UNION_SPORTS_ADMIN,gh08,gh01");
|
||||
// 体育活动未写入首页活动表,在此转换以兼容已有数据
|
||||
List<ActivitySchool> sportsActivities = dao.query(ActivitySchool.class, Cnd.where("isDisabled", "=", true)
|
||||
.and("close", "!=", true)
|
||||
.and("isSave", "!=", true)
|
||||
.desc("applyStartTime"));
|
||||
for (ActivitySchool sportsActivity : sportsActivities) {
|
||||
if (StrUtil.isBlank(sportsActivity.getApplyStartTime()) || StrUtil.isBlank(sportsActivity.getApplyEndTime())) {
|
||||
continue;
|
||||
}
|
||||
// 首页为PC入口,普通会员没有体育活动个人报名页面
|
||||
if (!sportsApplyRole) {
|
||||
continue;
|
||||
}
|
||||
Sys_home_activity homeActivity = new Sys_home_activity();
|
||||
homeActivity.setId(sportsActivity.getId());
|
||||
homeActivity.setName(sportsActivity.getName());
|
||||
if (Lang.isNotEmpty(sportsActivity.getImage())) {
|
||||
homeActivity.setCover(sportsActivity.getImage().get(0).getId());
|
||||
}
|
||||
homeActivity.setUrl("/platform/activity/apply");
|
||||
homeActivity.setH5Url("/mobile/activity/Sports/list/activityList?id=" + sportsActivity.getId() + "&signUpMethod=2");
|
||||
homeActivity.setAllowUserGroupId(sportsActivity.getActivityGroupId());
|
||||
homeActivity.setStartDate(DateUtil.parse(sportsActivity.getApplyStartTime()));
|
||||
homeActivity.setEndDate(DateUtil.parse(sportsActivity.getApplyEndTime()));
|
||||
homeActivity.setEnable(true);
|
||||
homeActivity.setType("Activity");
|
||||
list.add(homeActivity);
|
||||
}
|
||||
String userId = ShiroUtil.getUserId();
|
||||
List<Sys_home_activity> allowActivityList = new ArrayList<>();
|
||||
// 今天的时间
|
||||
@@ -226,6 +256,11 @@ public class SysHomeController {
|
||||
Integer allowUserGroupId = activity.getAllowUserGroupId();
|
||||
String allowUserSql = activity.getAllowUserSql();
|
||||
activity.setAllowUserSql(null);
|
||||
// 体育活动管理员与报名页保持一致,不受活动分组限制
|
||||
if ("Activity".equals(activity.getType()) && sportsApplyRole) {
|
||||
allowActivityList.add(activity);
|
||||
continue;
|
||||
}
|
||||
if (allowUserGroupId == null && StrUtil.isBlank(allowUserSql)) {
|
||||
allowActivityList.add(activity);
|
||||
continue;
|
||||
|
||||
@@ -80,4 +80,9 @@ public class Sys_home_activity extends BaseModel {
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 业务类型,不保存到数据库
|
||||
*/
|
||||
private String type;
|
||||
|
||||
}
|
||||
|
||||
@@ -159,12 +159,13 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
|
||||
<template #edit_func>
|
||||
<el-button @click="doSave" type="primary">保 存</el-button>
|
||||
<el-button @click="doOperate" type="primary">提 交</el-button>
|
||||
<el-button :disabled="!activityReady" @click="doSave" type="primary">保 存</el-button>
|
||||
<el-button :disabled="!activityReady" @click="doOperate" type="primary">提 交</el-button>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<add-activity
|
||||
v-if="showActivity"
|
||||
:form="formData"
|
||||
:is_a06="is_A06"
|
||||
:is_club="is_club"
|
||||
@@ -174,12 +175,13 @@ layout("/layouts/platform.html"){
|
||||
:unionid="'${@shiro.getPrincipalProperty('unit').getUnionid()}'"
|
||||
@flip="flip"
|
||||
@flush="flush"
|
||||
@hook:mounted="activityMounted"
|
||||
ref="activity"
|
||||
></add-activity>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<info ref="info"></info>
|
||||
<info v-if="showInfo" @hook:mounted="infoMounted" ref="info"></info>
|
||||
</template>
|
||||
|
||||
<send-msg :url="url" ref="sendMsg"></send-msg>
|
||||
@@ -203,6 +205,11 @@ layout("/layouts/platform.html"){
|
||||
is_A06: false,
|
||||
is_h10: false,
|
||||
activities: [],
|
||||
showActivity: false,
|
||||
activityReady: false,
|
||||
activityAction: null,
|
||||
showInfo: false,
|
||||
infoId: null,
|
||||
unitOptions: [],
|
||||
activityTypeList: [],
|
||||
planList: [],
|
||||
@@ -317,27 +324,57 @@ layout("/layouts/platform.html"){
|
||||
this.url = `<a href="` + (APP_DOMAIN + "/mobile/activity/Sports/list/activityList") + `">点击参与</a>`
|
||||
this.$refs.sendMsg.openDialog(row.activityGroupId)
|
||||
},
|
||||
infoMounted() {
|
||||
this.loadInfo()
|
||||
},
|
||||
loadInfo(id) {
|
||||
if (id) {
|
||||
this.infoId = id
|
||||
}
|
||||
if (this.$refs.info && this.infoId) {
|
||||
const infoId = this.infoId
|
||||
this.infoId = null
|
||||
this.$refs.info.getInfo(infoId)
|
||||
}
|
||||
},
|
||||
openView(row) {
|
||||
const { id } = row
|
||||
this.infoId = id
|
||||
this.showInfo = true
|
||||
this.$refs.guava.view()
|
||||
setTimeout(() => {
|
||||
this.$refs.info.getInfo(id)
|
||||
}, 500)
|
||||
this.$nextTick(() => this.loadInfo())
|
||||
},
|
||||
activityMounted() {
|
||||
this.activityReady = true
|
||||
this.handleActivityAction()
|
||||
},
|
||||
handleActivityAction(action) {
|
||||
if (action) {
|
||||
this.activityAction = action
|
||||
}
|
||||
if (!this.$refs.activity || !this.activityAction) {
|
||||
return
|
||||
}
|
||||
const { type, row } = this.activityAction
|
||||
this.activityAction = null
|
||||
if (type === "add") {
|
||||
this.$refs.activity.openAdd()
|
||||
} else if (type === "edit") {
|
||||
this.$refs.activity.openEdit(row, true)
|
||||
}
|
||||
},
|
||||
async openAdd() {
|
||||
this.showActivity = true
|
||||
this.$refs.guava.edit()
|
||||
setTimeout(() => {
|
||||
this.$refs.activity.openAdd()
|
||||
}, 500)
|
||||
this.handleActivityAction({ type: "add" })
|
||||
},
|
||||
async openEdit(row) {
|
||||
const { id, applyStartTime, isSave } = row
|
||||
this.formData.id = id
|
||||
const now = moment().valueOf()
|
||||
this.showActivity = true
|
||||
this.$refs.guava.edit()
|
||||
setTimeout(() => {
|
||||
this.$refs.activity.openEdit(row, true)
|
||||
}, 500)
|
||||
this.handleActivityAction({ type: "edit", row })
|
||||
},
|
||||
doDelete(row) {
|
||||
const { id } = row
|
||||
|
||||
@@ -51,14 +51,18 @@ const activity = {
|
||||
})
|
||||
},
|
||||
enterActivity(item) {
|
||||
if (item.type === "Activity" && "${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')}||${@shiro.hasRole('gh01')||@shiro.hasRole('gh08')}" === 'false') {
|
||||
if (item.type === "Activity" && "${@shiro.hasRole('H04')||@shiro.hasRole('sysadmin')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')||@shiro.hasRole('gh01')||@shiro.hasRole('gh08')}" === "false") {
|
||||
this.$message.warning("该活动只支持基层工会主席报名,个人报名请前往移动端")
|
||||
return
|
||||
}
|
||||
if (item.type === "Activity" && "${@shiro.hasPermission('activity.apply')}" === "false") {
|
||||
this.$message.warning("您没有体育活动报名权限")
|
||||
return
|
||||
}
|
||||
if (item.url) {
|
||||
sublime.jumpPagePjax(item.url)
|
||||
} else if (item.url) {
|
||||
this.$refs.openQRCode.openCode(item.url, "该活动只支持手机端报名,请使用手机扫描二维码报名!")
|
||||
} else if (item.h5Url) {
|
||||
this.$refs.openQRCode.openCode(item.h5Url, "该活动只支持手机端报名,请使用手机扫描二维码报名!")
|
||||
} else {
|
||||
this.$message.warning("该活动不支持,请在手机上选择!")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user