This commit is contained in:
2025-04-03 08:59:19 +08:00
parent a023e2b858
commit 6dd08cfa79
23 changed files with 1957 additions and 969 deletions
@@ -1,17 +1,13 @@
package io.v.nutz.activity.controller.basic; package io.v.nutz.activity.controller.basic;
import cn.afterturn.easypoi.excel.ExcelExportUtil; 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.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.activity.models.ActivityUserCnd; import io.v.nutz.activity.models.ActivityUserCnd;
import io.v.nutz.activity.models.ActivityUserScope; import io.v.nutz.activity.models.ActivityUserScope;
import io.v.nutz.activity.services.ActivityBasicScopeService; import io.v.nutz.activity.services.ActivityBasicScopeService;
import io.v.nutz.activity.template.UserTemp;
import io.v.nutz.annontation.ViReturn; import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.service.SimpleService; import io.v.nutz.base.service.SimpleService;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
@@ -23,31 +19,27 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.ArrayUtils;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup; import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.dao.util.cri.Static; import org.nutz.dao.util.cri.Static;
import org.nutz.integration.jedis.RedisService;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json; import org.nutz.json.Json;
import org.nutz.lang.Lang; import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.*; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.upload.TempFile; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.upload.UploadAdaptor; import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
@@ -63,8 +55,6 @@ public class ActivityBasicScopeController {
@Inject @Inject
private SimpleService simpleService; private SimpleService simpleService;
@Inject
private RedisService redisService;
@Inject @Inject
private ActivityBasicScopeService activityBasicScopeService; private ActivityBasicScopeService activityBasicScopeService;
@@ -107,7 +97,6 @@ public class ActivityBasicScopeController {
@Param(value = "personTypes", required = false) String[] personTypes, @Param(value = "personTypes", required = false) String[] personTypes,
@Param(value = "userStates", required = false) String[] userStates, @Param(value = "userStates", required = false) String[] userStates,
@Param(value = "memberTypes", required = false) String[] memberTypes, @Param(value = "memberTypes", required = false) String[] memberTypes,
@Param(value = "maritalTypes", required = false) String[] maritalTypes,
@Param(value = "sexTypes", required = false) String[] sexTypes, @Param(value = "sexTypes", required = false) String[] sexTypes,
@Param(value = "age", required = false) String[] age, @Param(value = "age", required = false) String[] age,
@Param(value = "teacherMeetingId", required = false) String teacherMeetingId, @Param(value = "teacherMeetingId", required = false) String teacherMeetingId,
@@ -116,8 +105,7 @@ public class ActivityBasicScopeController {
@Param(value = "clubId", required = false) String clubId, @Param(value = "clubId", required = false) String clubId,
@Param(value = "reverseSelection") boolean reverseSelection, @Param(value = "reverseSelection") boolean reverseSelection,
@Param(value = "activityGroupId", required = false) Integer activityGroupId, @Param(value = "activityGroupId", required = false) Integer activityGroupId,
@Param(value = "activityUserCnd", required = false) String activityUserCndStr, @Param(value = "activityUserCnd", required = false) String activityUserCndStr) {
@Param(value = "existsLoginNameRedisKey", required = false) String existsLoginNameRedisKey) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
DISTINCT(u.id) as id, DISTINCT(u.id) as id,
@@ -130,22 +118,16 @@ public class ActivityBasicScopeController {
u.userState, u.userState,
u.unitname AS unitName, u.unitname AS unitName,
u.unionname AS unionName, u.unionname AS unionName,
TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age, TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age
TIMESTAMPDIFF(YEAR, u.schoolTime, CURDATE()) AS teachNum,
su.maritalStatus
FROM FROM
`user` u `user` u
LEFT JOIN sys_user_role sur on sur.userid = u.id LEFT JOIN sys_user_role sur on sur.userid = u.id
LEFT JOIN sys_club_user clubuser ON clubuser.userid=u.id LEFT JOIN sys_club_user clubuser ON clubuser.userid=u.id
LEFT JOIN single_user su on su.userId = u.id
$condition $condition
"""); """);
try { try {
Cnd cnd = getCnd(pageForm, unionId, unitId, personTypes, userStates, memberTypes, maritalTypes, sexTypes, age, teacherMeetingId, roleIds, userId, clubId, reverseSelection, activityGroupId, activityUserCndStr); Cnd cnd = getCnd(pageForm, unionId, unitId, personTypes, userStates, memberTypes, sexTypes, age, teacherMeetingId, roleIds, userId, clubId, reverseSelection, activityGroupId, activityUserCndStr);
if (StrUtil.isNotBlank(existsLoginNameRedisKey)) {
List<String> loginNames = redisService.lrange(existsLoginNameRedisKey, 0, -1);
cnd.andEX("u.loginname", "in", loginNames);
}
sql.setCondition(cnd); sql.setCondition(cnd);
return simpleService.list(pageForm, sql); return simpleService.list(pageForm, sql);
@@ -169,7 +151,6 @@ public class ActivityBasicScopeController {
@At @At
@ViReturn @ViReturn
@POST @POST
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("activity.basic.scope") @RequiresPermissions("activity.basic.scope")
public Object doSetActivityUser(PageForm pageForm, public Object doSetActivityUser(PageForm pageForm,
@Param(value = "unionId", required = false) String unionId, @Param(value = "unionId", required = false) String unionId,
@@ -177,7 +158,6 @@ public class ActivityBasicScopeController {
@Param(value = "personTypes", required = false) String[] personTypes, @Param(value = "personTypes", required = false) String[] personTypes,
@Param(value = "userStates", required = false) String[] userStates, @Param(value = "userStates", required = false) String[] userStates,
@Param(value = "memberTypes", required = false) String[] memberTypes, @Param(value = "memberTypes", required = false) String[] memberTypes,
@Param(value = "maritalTypes", required = false) String[] maritalTypes,
@Param(value = "sexTypes", required = false) String[] sexTypes, @Param(value = "sexTypes", required = false) String[] sexTypes,
@Param(value = "age", required = false) String[] age, @Param(value = "age", required = false) String[] age,
@Param(value = "activityGroupId", required = false) Integer activityGroupId, @Param(value = "activityGroupId", required = false) Integer activityGroupId,
@@ -189,8 +169,7 @@ public class ActivityBasicScopeController {
@Param(value = "userId", required = false) String[] userId, @Param(value = "userId", required = false) String[] userId,
@Param(value = "clubId", required = false) String clubId, @Param(value = "clubId", required = false) String clubId,
@Param(value = "reverseSelection") boolean reverseSelection, @Param(value = "reverseSelection") boolean reverseSelection,
@Param(value = "activityUserCnd", required = false) String activityUserCndStr, @Param(value = "activityUserCnd", required = false) String activityUserCndStr) {
@Param(value = "existsLoginNameRedisKey", required = false) String existsLoginNameRedisKey) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT DISTINCT SELECT DISTINCT
( u.id ) AS userId ( u.id ) AS userId
@@ -198,14 +177,10 @@ public class ActivityBasicScopeController {
`user` u `user` u
LEFT JOIN sys_user_role sur ON sur.userid = u.id LEFT JOIN sys_user_role sur ON sur.userid = u.id
LEFT JOIN sys_club_user clubuser ON clubuser.userid=u.id LEFT JOIN sys_club_user clubuser ON clubuser.userid=u.id
LEFT JOIN single_user su on su.userId = u.id
$condition $condition
"""); """);
Cnd cnd = getCnd(pageForm, unionId, unitId, personTypes, userStates, memberTypes, maritalTypes, sexTypes, age, teacherMeetingId, roleIds, userId, clubId, reverseSelection, activityGroupId, activityUserCndStr); Cnd cnd = getCnd(pageForm, unionId, unitId, personTypes, userStates, memberTypes, sexTypes, age, teacherMeetingId, roleIds, userId, clubId, reverseSelection, activityGroupId, activityUserCndStr);
if (StrUtil.isNotBlank(existsLoginNameRedisKey)) {
List<String> loginNames = redisService.lrange(existsLoginNameRedisKey, 0, -1);
cnd.andEX("u.loginname", "in", loginNames);
}
sql.setCondition(cnd); sql.setCondition(cnd);
sql.setCallback(Sqls.callback.entities()); sql.setCallback(Sqls.callback.entities());
sql.setEntity(dao.getEntity(ActivityUserScope.class)); sql.setEntity(dao.getEntity(ActivityUserScope.class));
@@ -260,11 +235,11 @@ public class ActivityBasicScopeController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,H06,H10")) { // if (!ShiroUtil.hasAnyRoles("sysadmin,H06,H10")) {
if (ShiroUtil.hasAnyRoles(new String[]{"H04", "club01"})) { // if (ShiroUtil.hasAnyRoles(new String[]{"H04", "club01"})) {
cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id")); // cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id"));
} // }
} // }
cnd.and("groupId", "IS NOT", null); cnd.and("groupId", "IS NOT", null);
cnd.and("groupName", "IS NOT", null); cnd.and("groupName", "IS NOT", null);
cnd.groupBy("groupId"); cnd.groupBy("groupId");
@@ -282,8 +257,8 @@ public class ActivityBasicScopeController {
@ViReturn @ViReturn
// @RequiresPermissions("activity.basic.scope") // @RequiresPermissions("activity.basic.scope")
public Object getScopeUser(String activityGroupId, @Param(value = "userId", required = false) String userId) { public Object getScopeUser(String activityGroupId, @Param(value = "userId", required = false) String userId) {
String userid = StrUtil.isNotBlank(userId) ? userId : io.v.nutz.util.ShiroUtil.getUserId(); String userid = StrUtil.isNotBlank(userId) ? userId : ShiroUtil.getUserId();
return simpleService.dao().count(ActivityUserScope.class, Cnd.where("groupId", "=", activityGroupId).and("userId", "=", io.v.nutz.util.ShiroUtil.getUserId())); return simpleService.dao().count(ActivityUserScope.class, Cnd.where("groupId", "=", activityGroupId).and("userId", "=", userid));
} }
@At @At
@@ -308,7 +283,7 @@ public class ActivityBasicScopeController {
addv("is_A06", ShiroUtil.hasRole("A06")); addv("is_A06", ShiroUtil.hasRole("A06"));
addv("is_H04", ShiroUtil.hasRole("H04")); addv("is_H04", ShiroUtil.hasRole("H04"));
addv("is_H02", ShiroUtil.hasRole("club01")); addv("is_H02", ShiroUtil.hasRole("club01"));
addv("is_H03", ShiroUtil.hasRole("H03")); addv("is_H03", ShiroUtil.hasRole("SchoolUnionMemberAdmin"));
addv("is_sysadmin", ShiroUtil.hasRole("sysadmin")); addv("is_sysadmin", ShiroUtil.hasRole("sysadmin"));
addv("unionid", Vi.getUnionId()); addv("unionid", Vi.getUnionId());
}}; }};
@@ -333,10 +308,11 @@ public class ActivityBasicScopeController {
COLUMN_COMMENT COLUMN_COMMENT
FROM INFORMATION_SCHEMA.COLUMNS FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'sys_user' WHERE TABLE_NAME = 'sys_user'
AND TABLE_SCHEMA = 'zhgh_jviv' AND TABLE_SCHEMA = 'zhgh_hmc'
"""); """);
List<NutMap> sqlDataList = activityBasicScopeService.listMap(sql); List<NutMap> sqlDataList = activityBasicScopeService.listMap(sql);
sqlDataList.forEach(v -> v.put("DATA_TYPE", new String((byte[]) v.get("DATA_TYPE")))); // sqlDataList.forEach(v -> v.put("DATA_TYPE", new String((byte[]) v.get("DATA_TYPE"))));
sqlDataList.forEach(v -> v.put("DATA_TYPE", v.getString("DATA_TYPE")));
return sqlDataList; return sqlDataList;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@@ -347,7 +323,6 @@ public class ActivityBasicScopeController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions("activity.basic.scope") @RequiresPermissions("activity.basic.scope")
public void doExportUser(PageForm pageForm, public void doExportUser(PageForm pageForm,
@Param(value = "props", required = false) String props, @Param(value = "props", required = false) String props,
@@ -356,7 +331,6 @@ public class ActivityBasicScopeController {
@Param(value = "personTypes", required = false) String[] personTypes, @Param(value = "personTypes", required = false) String[] personTypes,
@Param(value = "userStates", required = false) String[] userStates, @Param(value = "userStates", required = false) String[] userStates,
@Param(value = "memberTypes", required = false) String[] memberTypes, @Param(value = "memberTypes", required = false) String[] memberTypes,
@Param(value = "maritalTypes", required = false) String[] maritalTypes,
@Param(value = "sexTypes", required = false) String[] sexTypes, @Param(value = "sexTypes", required = false) String[] sexTypes,
@Param(value = "age", required = false) String[] age, @Param(value = "age", required = false) String[] age,
@Param(value = "teacherMeetingId", required = false) String teacherMeetingId, @Param(value = "teacherMeetingId", required = false) String teacherMeetingId,
@@ -365,9 +339,7 @@ public class ActivityBasicScopeController {
@Param(value = "clubId", required = false) String clubId, @Param(value = "clubId", required = false) String clubId,
@Param(value = "reverseSelection") boolean reverseSelection, @Param(value = "reverseSelection") boolean reverseSelection,
@Param(value = "activityGroupId", required = false) Integer activityGroupId, @Param(value = "activityGroupId", required = false) Integer activityGroupId,
@Param(value = "activityUserCnd", required = false) String activityUserCndStr, @Param(value = "activityUserCnd", required = false) String activityUserCndStr, HttpServletResponse response) {
@Param(value = "existsLoginNameRedisKey", required = false) String existsLoginNameRedisKey,
HttpServletResponse response) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -381,23 +353,17 @@ public class ActivityBasicScopeController {
u.userState, u.userState,
u.unitname AS unitName, u.unitname AS unitName,
u.unionname AS unionName, u.unionname AS unionName,
TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age, TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age
TIMESTAMPDIFF(YEAR, u.schoolTime, CURDATE()) AS teachNum,
su.maritalStatus
FROM FROM
`user` u `user` u
LEFT JOIN sys_user_role sur on sur.userid = u.id LEFT JOIN sys_user_role sur on sur.userid = u.id
LEFT JOIN sys_club_user clubuser ON clubuser.userid=u.id LEFT JOIN sys_club_user clubuser ON clubuser.userid=u.id
LEFT JOIN single_user su on su.userId = u.id
$condition $condition
"""); """);
try { try {
Cnd cnd = getCnd(pageForm, unionId, unitId, personTypes, userStates, memberTypes, maritalTypes, sexTypes, age, teacherMeetingId, roleIds, userId, clubId, reverseSelection, activityGroupId, activityUserCndStr); Cnd cnd = getCnd(pageForm, unionId, unitId, personTypes, userStates, memberTypes, sexTypes, age, teacherMeetingId, roleIds, userId, clubId, reverseSelection, activityGroupId, activityUserCndStr);
if (StrUtil.isNotBlank(existsLoginNameRedisKey)) {
List<String> loginNames = redisService.lrange(existsLoginNameRedisKey, 0, -1);
cnd.andEX("u.loginname", "in", loginNames);
}
sql.setCondition(cnd); sql.setCondition(cnd);
List<NutMap> map = simpleService.listMap(sql); List<NutMap> map = simpleService.listMap(sql);
@@ -426,7 +392,6 @@ public class ActivityBasicScopeController {
String[] personTypes, String[] personTypes,
String[] userStates, String[] userStates,
String[] memberTypes, String[] memberTypes,
String[] maritalTypes,
String[] sexTypes, String[] sexTypes,
String[] age, String[] age,
String teacherMeetingId, String teacherMeetingId,
@@ -461,16 +426,6 @@ public class ActivityBasicScopeController {
if (ArrayUtils.contains(memberTypes, "基金会员")) { if (ArrayUtils.contains(memberTypes, "基金会员")) {
cnd.and(new Static(" u.loginname " + IN_OR_NIN_OP + " (select loginname from sick_fund_member)")); cnd.and(new Static(" u.loginname " + IN_OR_NIN_OP + " (select loginname from sick_fund_member)"));
} }
if (ArrayUtils.contains(memberTypes, "单身教工")) {
cnd.and(new Static("u.id " + IN_OR_NIN_OP + " (select userId from single_user)"));
}
if (ArrayUtils.contains(memberTypes, "30教龄教工")) {
cnd.and("u.isThirtyTeach", EQ_OR_NEQ_OP, 1);
}
}
if (Lang.isNotEmpty(maritalTypes)) {
cnd.and("su.maritalStatus", IN_OR_NIN_OP, Arrays.asList(maritalTypes));
} }
if (!Lang.isEmptyArray(age)) { if (!Lang.isEmptyArray(age)) {
@@ -507,74 +462,4 @@ public class ActivityBasicScopeController {
} }
/**
* 清空查询条件
*
* @param existsLoginNameRedisKey
* @return java.lang.Object
* @author zhf
* @description
*/
@At
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("activity.basic.scope")
public Object clearSearchCnd(String existsLoginNameRedisKey) {
if (StrUtil.isNotBlank(existsLoginNameRedisKey)) {
redisService.del(existsLoginNameRedisKey);
}
return null;
}
@At
@Aop(TransAop.READ_COMMITTED)
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@RequiresPermissions("activity.basic.scope")
public Object doImport(String groupId, TempFile file) {
String matchUserLoginNamesKey = "ActivityBasicScopeController.doImport.time=" + System.currentTimeMillis();
List<UserTemp> userImportList = ExcelImportUtil.importExcel(file.getFile(), UserTemp.class, new ImportParams());
//判断人员哪些存在哪些不存在
Sql sql = Sqls.queryString("""
SELECT
u.loginname
FROM
sys_user u
""");
dao.execute(sql);
String[] sysLoginNames = (String[]) sql.getResult();
//存在的工号
List<String> existsLoginNames = new ArrayList<>();
for (UserTemp excelUser : userImportList) {
if (ArrayUtil.contains(sysLoginNames, excelUser.getLoginname())) {
existsLoginNames.add(excelUser.getLoginname());
} else {
excelUser.setRemarks("系统查不到此人");
}
}
//匹配不到的用户
List<UserTemp> errorExcelTempUsers = userImportList.stream().filter(v -> StrUtil.isNotBlank(v.getRemarks())).collect(Collectors.toList());
NutMap nutMap = NutMap.NEW();
nutMap.setv("totalCount", userImportList.size());
nutMap.setv("successCount", existsLoginNames.size());
nutMap.setv("errorCount", errorExcelTempUsers.size());
nutMap.setv("errorList", errorExcelTempUsers.stream().map(v -> {
return new NutMap().addv("工号", v.getLoginname()).addv("姓名", v.getUsername()).addv("错误信息", v.getRemarks());
}));
nutMap.setv("existsLoginNameRedisKey", matchUserLoginNamesKey);
//保存存在的工号
if (Lang.isNotEmpty(existsLoginNames)) {
redisService.lpush(matchUserLoginNamesKey, existsLoginNames.toArray(new String[0]));
redisService.expire(matchUserLoginNamesKey, 60 * 3);
}
return io.v.nutz.base.result.Result.success(nutMap);
}
} }
@@ -7,9 +7,8 @@ import io.v.nutz.base.service.BaseService;
import io.v.nutz.dao.CndPlus; import io.v.nutz.dao.CndPlus;
import io.v.nutz.modules.models.Audit; import io.v.nutz.modules.models.Audit;
import io.v.nutz.modules.models.PageForm; import io.v.nutz.modules.models.PageForm;
import io.v.nutz.util.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -75,10 +74,10 @@ public class ActivityAuditController {
$condition $condition
"""); """);
cnd.andExcludeEmpty("YEAR(tissue.startTime)", "=", year); cnd.andEX("YEAR(tissue.startTime)", "=", year);
cnd.andExcludeEmpty("tissue.unionId", "=", unionId); cnd.andEX("tissue.unionId", "=", unionId);
cnd.andExcludeEmpty("tissue.type", "=", type); cnd.andEX("tissue.type", "=", type);
cnd.andExcludeEmpty("tissue.state", state ? ">" : "=", 1); cnd.andEX("tissue.state", state ? ">" : "=", 1);
if (Strings.isNotBlank(name)) { if (Strings.isNotBlank(name)) {
cnd.where().andLike("tissue.name", name); cnd.where().andLike("tissue.name", name);
@@ -103,6 +102,11 @@ public class ActivityAuditController {
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString()); audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
baseService.insert(audit); baseService.insert(audit);
baseService.dao().update(ActivityTissue.class, Chain.make("state", flag ? 3 : 2).add("auditId", audit.getId()), Cnd.where("id", "=", id)); baseService.dao().update(ActivityTissue.class, Chain.make("state", flag ? 3 : 2).add("auditId", audit.getId()), Cnd.where("id", "=", id));
// 审核通过,修改活动为启动状态,并且还要将这个活动设置成首界面可见
if (flag) {
baseService.dao().update(ActivityTissue.class, Chain.make("isDisabled", true), Cnd.where("id", "=", id));
}
return null; return null;
} }
@@ -0,0 +1,197 @@
package io.v.nutz.activity.controller.union;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.activity.models.ActivityTissuePerson;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.service.SimpleService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.dao.CndPlus;
import io.v.nutz.modules.models.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
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.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.List;
import java.util.stream.Collectors;
/**
* @ClassName ActivityUnionApplyUserController
* @Description pc端活动报名
* @Author zhf
* @Date 2024/1/12 15:38
*/
@IocBean
@Ok("json:full")
@At("/platform/activity/applyUser")
public class ActivityUnionApplyUserController {
@Inject
private SimpleService simpleService;
@Inject
private BaseService baseService;
@At("/union")
@Ok("beetl:platform/activity/union/unionActivityApplyUser.html")
@RequiresPermissions("activity.union.applyUser")
public void unionIndex() {
}
@At("/club")
@Ok("beetl:platform/activity/union/clubActivityApplyUser.html")
@RequiresPermissions("activity.club.applyUser")
public void clubIndex() {
}
@At("/school")
@Ok("beetl:platform/activity/union/schoolActivityApplyUser.html")
@RequiresPermissions("activity.school.applyUser")
public void schoolIndex() {
}
@At
@ViReturn
@RequiresPermissions(value = {"activity.club.applyUser", "activity.union.applyUser", "activity.school.applyUser"}, logical = Logical.OR)
public Object pageData(PageForm page,
@Param(value = "year", required = false) String year,
@Param(value = "name", required = false) String name,
@Param(value = "type", required = false) Integer type) {
CndPlus cnd = CndPlus.create();
Sql sql = Sqls.create("""
SELECT
tissue.*,
uni.unionname ,
club.`name` clubName,
abs.`name` projectTypeName
FROM
activity_tissue tissue
LEFT JOIN sys_union uni ON uni.id = tissue.unionId
LEFT JOIN sys_club club ON club.id = tissue.clubId
LEFT JOIN activity_basic_settings abs ON abs.`code`=tissue.projectTypeCode
$condition
""");
if (StrUtil.isNotBlank(year)) {
cnd.andEX("YEAR(tissue.startTime)", "=", year);
}
cnd.andEX("tissue.isDisabled", "=", true);
cnd.andEX("tissue.type", "=", type);
cnd.andEX("tissue.state", "=", 3);
cnd.andEX("tissue.projectTypeCode", "!=", 50004);
cnd.andEX("tissue.signUpMethod", "in", List.of(1, 2, 3));
if (Strings.isNotBlank(name)) {
cnd.where().andLike("tissue.name", name);
}
if (!ShiroUtil.hasAnyRoles("A06,sysadmin")) {
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=tissue.groupId AND userId='%s') >0".formatted(ShiroUtil.getUserId())));
}
if (StrUtil.isNotBlank(page.getPageOrderName()) && StrUtil.isNotBlank(page.getPageOrderBy())) {
cnd.orderBy(page.getPageOrderName(), page.getPageOrderBy().equalsIgnoreCase("ascending") ? "ASC" : "DESC");
} else {
cnd.desc("tissue.startTime");
}
sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
List<NutMap> list = pagination.getList();
list.forEach(v -> {
String activityId = v.getString("id");
// 当前活动已报名人数
int totalApplyNum = baseService.dao().count(ActivityTissuePerson.class, Cnd.where("tissueId", "=", activityId));
v.put("totalApplyNum", totalApplyNum);
int signUpMethod = v.getInt("signUpMethod");
if (signUpMethod == 1||signUpMethod == 3) {
int count = baseService.dao().count(ActivityTissuePerson.class,
Cnd.where("tissueId", "=", activityId)
.and("applyUserId", "=", ShiroUtil.getUserId()));
v.setv("countUser", count);
} else if (signUpMethod == 2) {
Sql sqlApplyUser = Sqls.create("""
SELECT
COUNT(*)
FROM
`activity_tissue_person` atp
LEFT JOIN `user` u ON u.id = atp.userId
where atp.tissueId=@tissueId and u.unionid=@unionid
""").setParam("tissueId", activityId).setParam("unionid", Vi.getUnionId());
int count = baseService.count(sqlApplyUser);
v.setv("countUser", count);
}
});
pagination.setList(list);
return pagination;
}
@At
@ViReturn
@RequiresPermissions(value = {"activity.club.applyUser", "activity.union.applyUser", "activity.school.applyUser"}, logical = Logical.OR)
public Object selfUnionUsers(String groupId) {
Sql sql = Sqls.create("""
SELECT
u.id,
u.username,
u.loginname,
u.sex,
u.userState,
u.unitname,
u.unionname
FROM
`user` u
LEFT JOIN activity_user_scope aus ON u.id = aus.userId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("u.unionId", "=", Vi.getUnionId());
cnd.and("aus.groupId", "=", groupId);
cnd.groupBy("u.id");
cnd.asc("u.unitname").asc("u.unionname");
sql.setCondition(cnd);
List<NutMap> list = baseService.listMap(sql);
return list;
}
@At
@ViReturn
@RequiresPermissions(value = {"activity.club.applyUser", "activity.union.applyUser", "activity.school.applyUser"}, logical = Logical.OR)
public Object getReportedUser(String tissueId) {
Sql sql = Sqls.create("""
SELECT
atp.userId
FROM
activity_tissue_person atp
LEFT JOIN `user` u ON atp.userId = u.id
WHERE
atp.tissueId = @tissueId AND u.unionid = @unionId
""");
sql.setParam("tissueId", tissueId);
sql.setParam("unionId", Vi.getUnionId());
List<NutMap> list = baseService.listMap(sql);
List<String> userIds = list.stream().map(v -> v.getString("userId")).collect(Collectors.toList());
return userIds;
}
}
@@ -3,6 +3,7 @@ package io.v.nutz.activity.controller.union;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure; import com.deepoove.poi.config.Configure;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy; import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
@@ -19,24 +20,27 @@ import io.v.nutz.modules.models.PageForm;
import io.v.nutz.service.ViService; import io.v.nutz.service.ViService;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysMsgService; import io.v.nutz.sys.services.SysMsgService;
import io.v.nutz.util.ShiroUtil;
import io.v.nutz.util.ViTool; import io.v.nutz.util.ViTool;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup; 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.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import org.nutz.trans.Trans;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
@@ -95,6 +99,8 @@ public class ActivityUnionManageController {
public void schoolIndex() { public void schoolIndex() {
} }
@At @At
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
@@ -130,12 +136,41 @@ public class ActivityUnionManageController {
cnd.and(group); cnd.and(group);
} }
cnd.limit(1, 30);
sql.setCondition(cnd); sql.setCondition(cnd);
return sysUserService.listMap(sql); return sysUserService.listPageMap(1, 30, sql);
} }
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR)
public Object doSave(@Param(value = "tissue") ActivityTissue tissue){
tissue.setUserId(StrUtil.isNotBlank(tissue.getUserId()) ? tissue.getUserId() : ShiroUtil.getUserId());
tissue.setApplyTime(StrUtil.isNotBlank(tissue.getApplyTime()) ? tissue.getApplyTime() : DateUtil.getDate());
tissue.setState(0);
if (tissue.getType() == 40002) {
tissue.setUnionId(Vi.getUnionId());
} else if (tissue.getType() == 40003) {
tissue.setClubId(vi.getClubId());
}
// 如果有商品,则设置商品活动编码和活动id
if (Lang.isNotEmpty(tissue.getGoods())) {
tissue.getGoods().forEach(v -> {
v.setActivityCode(tissue.getActivityCode());
v.setReid(tissue.getId());
});
}
activityTissueService.insertWith(tissue, "tissuePersonList");
activitySchoolService.dao().insert(tissue.getGoods());
return null;
}
/** /**
* 校工会添加 * 校工会添加
* *
@@ -144,39 +179,31 @@ public class ActivityUnionManageController {
*/ */
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR) @RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR)
public Object doAdd(@Param(value = "tissue") ActivityTissue tissue) { public Object doAdd(@Param(value = "tissue") ActivityTissue tissue) {
tissue.setUserId(ShiroUtil.getUserId()); tissue.setUserId(StrUtil.isNotBlank(tissue.getUserId()) ? tissue.getUserId() : ShiroUtil.getUserId());
tissue.setApplyTime(DateUtil.getDate()); tissue.setApplyTime(StrUtil.isNotBlank(tissue.getApplyTime()) ? tissue.getApplyTime() : DateUtil.getDate());
String title = "校工会文化活动"; if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
String url = "/platform/activity/info/mange/school";
if (tissue.getType() == 40002) {
tissue.setState(1); tissue.setState(1);
tissue.setUnionId(Vi.getUnionId());
title = "分工会活动";
url = "/platform/activity/info/mange/union";
} else if (tissue.getType() == 40003) {
tissue.setState(1);
tissue.setClubId(vi.getClubId());
title = "协会活动";
url = "/platform/activity/info/mange/club";
} else { } else {
tissue.setState(3); tissue.setState(3);
tissue.setIsDisabled(true);
tissue.setIsEnrollSystem(true);
}
if (tissue.getType() == 40002) {
tissue.setUnionId(Vi.getUnionId());
} else if (tissue.getType() == 40003) {
tissue.setClubId(vi.getClubId());
} }
Trans.exec(() -> {
activityTissueService.insertWith(tissue, "tissuePersonList");
tissue.getGoods().forEach(v -> { tissue.getGoods().forEach(v -> {
v.setActivityCode(tissue.getActivityCode()); v.setActivityCode(tissue.getActivityCode());
v.setReid(tissue.getId()); v.setReid(tissue.getId());
}); });
// tissue.getCover();
activityTissueService.insertWith(tissue, "tissuePersonList");
activitySchoolService.dao().insert(tissue.getGoods()); activitySchoolService.dao().insert(tissue.getGoods());
tissue.getCover();
});
if (tissue.getXlFlag() != null && tissue.getXlFlag()) {
String time = tissue.getStartTime() + "" + tissue.getEndTime();
sysMsgService.sendMsgByActivityGroupId(tissue.getId(), tissue.getGroupId(), title, tissue.getName(), url, "/mobile/activity/unionActivity", time);
}
return null; return null;
} }
@@ -185,21 +212,12 @@ public class ActivityUnionManageController {
@ViReturn @ViReturn
@RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR) @RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR)
public Object doEdit(@Param("tissue") ActivityTissue tissue) { public Object doEdit(@Param("tissue") ActivityTissue tissue) {
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
tissue.setState(1);
} else {
tissue.setState(3);
}
activityTissueService.doEdit(tissue); activityTissueService.doEdit(tissue);
String title = "校工会文化活动";
String url = "/platform/activity/info/mange/school";
if (tissue.getType() == 40002) {
title = "分工会活动";
url = "/platform/activity/info/mange/union";
} else if (tissue.getType() == 40003) {
title = "协会活动";
url = "/platform/activity/info/mange/club";
}
sysMsgService.deleteMsgByActivityId(tissue.getId());
if (tissue.getXlFlag() != null && tissue.getXlFlag()) {
String time = tissue.getStartTime() + "" + tissue.getEndTime();
sysMsgService.sendMsgByActivityGroupId(tissue.getId(), tissue.getGroupId(), title, tissue.getName(), url, "/mobile/activity/unionActivity", time);
}
return null; return null;
} }
@@ -208,7 +226,6 @@ public class ActivityUnionManageController {
@RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR) @RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR)
public Object doDelete(String id) { public Object doDelete(String id) {
activityTissueService.doDelete(id); activityTissueService.doDelete(id);
return null; return null;
} }
@@ -318,4 +335,11 @@ public class ActivityUnionManageController {
} }
@At
@ViReturn
@RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR)
public Object activityStatusChange(String id, String isDisabled) {
activityTissueService.update(Chain.make("isDisabled", "1".equals(isDisabled)), Cnd.where("id", "=", id));
return null;
}
} }
@@ -4,7 +4,9 @@ import cn.hutool.core.util.StrUtil;
import io.v.nutz.activity.models.ActivityTissue; import io.v.nutz.activity.models.ActivityTissue;
import io.v.nutz.annontation.ViReturn; import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.service.BaseService; import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.modules.models.PageForm; import io.v.nutz.modules.models.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -12,6 +14,7 @@ import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
@@ -51,13 +54,35 @@ public class ActivityUnionUserStatisticsController {
@Inject @Inject
private BaseService baseService; private BaseService baseService;
@Inject
private Vi vi;
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"activity.school.user.statistics", "activity.club.user.statistics", "activity.union.user.statistics"}, logical = Logical.OR) @RequiresPermissions(value = {"activity.school.user.statistics", "activity.club.user.statistics", "activity.union.user.statistics"}, logical = Logical.OR)
public Object pageData(PageForm page, public Object pageData(PageForm page,
@Param(value = "type", required = false) Integer type,
@Param(value = "activityId", required = false) String activityId, @Param(value = "activityId", required = false) String activityId,
@Param(value = "unionId", required = false) String unionId) { @Param(value = "unionId", required = false) String unionId) {
ActivityTissue tissue = baseService.dao().fetch(ActivityTissue.class, activityId);
if (Lang.isEmpty(tissue)){
return null;
}
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (type == 40002) {
if (!Vi.getUnionId().equals(tissue.getUnionId())) {
return null;
}
} else if (type == 40003) {
if (!vi.getClubId().equals(tissue.getClubId())) {
return null;
}
}
}
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -68,6 +93,8 @@ public class ActivityUnionUserStatisticsController {
u.unionname, u.unionname,
u.sex, u.sex,
u.mobile, u.mobile,
atp.applyUserId,
atp.id atpId ,
atp.applyDateTime atp.applyDateTime
FROM FROM
`activity_tissue_person` atp `activity_tissue_person` atp
@@ -75,8 +102,17 @@ public class ActivityUnionUserStatisticsController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("atp.tissueId", "=", activityId); cnd.andEX("atp.tissueId", "=", activityId);
cnd.andEX("u.unionId", "=", unionId); // cnd.andEX("u.unionId", "=", unionId);
// if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
// if (!tissue.getUserId().equals(ShiroUtil.getUserId())) {
// if (type == 40002) {
// cnd.and("unionId", "=", Vi.getUnionId());
// } else if (type == 40003) {
// cnd.and("u.id", "in", " SELECT userid FROM sys_club_user WHERE clubid = '%s' ".formatted(vi.getClubId()));
// }
// }
// }
if (Strings.isNotBlank(page.getSearchName()) && Strings.isNotBlank(page.getSearchKeyword())) { if (Strings.isNotBlank(page.getSearchName()) && Strings.isNotBlank(page.getSearchKeyword())) {
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword()); cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
} }
@@ -95,7 +131,11 @@ public class ActivityUnionUserStatisticsController {
@RequiresPermissions(value = {"activity.school.user.statistics", "activity.club.user.statistics", "activity.union.user.statistics"}, logical = Logical.OR) @RequiresPermissions(value = {"activity.school.user.statistics", "activity.club.user.statistics", "activity.union.user.statistics"}, logical = Logical.OR)
public Object getActivityByYearOrType(@Param(value = "year", required = false) Integer year, public Object getActivityByYearOrType(@Param(value = "year", required = false) Integer year,
@Param(value = "type", required = false) Integer type) { @Param(value = "type", required = false) Integer type) {
return baseService.dao().query(ActivityTissue.class, Cnd.where("type", "=", type).andEX("YEAR(startTime)", "=", year).desc("startTime")); Cnd cnd = Cnd.NEW();
cnd.and("type", "=", type);
cnd.andEX("YEAR(startTime)", "=", year);
cnd.desc("startTime");
return baseService.dao().query(ActivityTissue.class, cnd);
} }
@@ -1,22 +1,28 @@
package io.v.nutz.activity.models; package io.v.nutz.activity.models;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.model.BaseModel;
import io.v.nutz.activity.models.ActivityTissuePerson;
import io.v.nutz.common.models.Goods; import io.v.nutz.common.models.Goods;
import io.v.nutz.sys.models.Sys_file; import io.v.nutz.sys.models.Sys_file;
import lombok.Data; import lombok.Data;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import java.io.Serializable;
import java.util.List; import java.util.List;
/** /**
* @author: Aaron * @author: Aaron
* @create: 2021-03-09 13:57 * @create: 2021-03-09 13:57
* @description: 社团或分工会活动校工会活动 * @description: 协会或分工会活动校工会活动
**/ **/
@Data @Data
@Table("activity_tissue") @Table("activity_tissue")
public class ActivityTissue { @Comment("协会或分工会活动校工会活动")
public class ActivityTissue extends BaseModel implements Serializable {
@Column @Column
@Name @Name
@@ -131,7 +137,7 @@ public class ActivityTissue {
private String unionId; private String unionId;
@Column @Column
@Comment("创建人所属社团") @Comment("创建人所属协会")
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
private String clubId; private String clubId;
@@ -210,7 +216,7 @@ public class ActivityTissue {
@Column @Column
@Comment("是否报名系统") @Comment("是否报名系统")
@ColDefine(type = ColType.BOOLEAN) @ColDefine(type = ColType.BOOLEAN)
private boolean isEnrollSystem; private Boolean isEnrollSystem;
@Many(field = "tissueId") @Many(field = "tissueId")
private List<ActivityTissuePerson> tissuePersonList; private List<ActivityTissuePerson> tissuePersonList;
@@ -223,4 +229,24 @@ public class ActivityTissue {
@ColDefine(type = ColType.BOOLEAN) @ColDefine(type = ColType.BOOLEAN)
private Boolean xlFlag; private Boolean xlFlag;
@Column
@Comment("是否开启")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isDisabled;
@Column
@Comment("是否推送移动端首页")
@ColDefine(type = ColType.INT)
private Integer isPushHome;
@Column
@Comment("签到开始时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String signStartTime;
@Column
@Comment("签到结束时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String signEndTime;
} }
@@ -7,18 +7,18 @@ import io.v.nutz.activity.services.ActivityTissueService;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.common.models.Goods; import io.v.nutz.common.models.Goods;
import io.v.nutz.dao.CndPlus; import io.v.nutz.dao.CndPlus;
import io.v.nutz.jf.model.ActivityBx;
import io.v.nutz.modules.models.Audit; import io.v.nutz.modules.models.Audit;
import io.v.nutz.modules.models.PageForm; import io.v.nutz.modules.models.PageForm;
import io.v.nutz.service.ViService; import io.v.nutz.service.ViService;
import io.v.nutz.service.impl.ViServiceImpl; import io.v.nutz.service.impl.ViServiceImpl;
import io.v.nutz.util.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop; import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
@@ -66,21 +66,26 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
$condition $condition
"""); """);
cnd.andExcludeEmpty("YEAR(tissue.startTime)", "=", year); cnd.andEX("YEAR(tissue.applyTime)", "=", year);
cnd.andExcludeEmpty("tissue.projectTypeCode", "!=", "50004"); SqlExpressionGroup seg = new SqlExpressionGroup();
cnd.andExcludeEmpty("tissue.unionId", "=", unionId); seg.or("tissue.projectTypeCode", "!=", "50004");
cnd.andExcludeEmpty("tissue.type", "=", type); seg.or("tissue.projectTypeCode", "is", null);
cnd.and(seg);
// cnd.andEx("tissue.projectTypeCode", "!=", "50004");
cnd.andEX("tissue.unionId", "=", unionId);
cnd.andEX("tissue.type", "=", type);
if (Strings.isNotBlank(name)) { if (Strings.isNotBlank(name)) {
cnd.where().andLike("tissue.name", name); cnd.where().andLike("tissue.name", name);
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06")) {
if (ShiroUtil.hasRole("H04")) { cnd.and("tissue.userId", "=", ShiroUtil.getUserId());
/* if (ShiroUtil.hasRole("H04")) {
cnd.and("tissue.unionId", "in", vi.getMangeUnionStr()); cnd.and("tissue.unionId", "in", vi.getMangeUnionStr());
} else if (ShiroUtil.hasRole("club01")) { } else if (ShiroUtil.hasRole("club01")) {
cnd.and("tissue.clubId", "in", vi.getMangeClubStr()); cnd.and("tissue.clubId", "in", vi.getMangeClubStr());
} }*/
} }
if (StrUtil.isNotBlank(page.getPageOrderName()) && StrUtil.isNotBlank(page.getPageOrderBy())) { if (StrUtil.isNotBlank(page.getPageOrderName()) && StrUtil.isNotBlank(page.getPageOrderBy())) {
@@ -98,7 +103,7 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
public void doDelete(String id) { public void doDelete(String id) {
this.delete(id); this.delete(id);
tissuePersonService.clear(Cnd.where("tissueId", "=", id)); tissuePersonService.clear(Cnd.where("tissueId", "=", id));
tissuePersonService.dao().clear(Goods.class, Cnd.where("reid", "=", id)); dao().clear(Goods.class, Cnd.where("reid", "=", id));
} }
@Override @Override
@@ -132,7 +137,7 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
}); });
tissuePersonService.dao().insert(tissue.getGoods()); tissuePersonService.dao().insert(tissue.getGoods());
if (Lang.isNotEmpty(tissue.getBillFiles())) { /* if (Lang.isNotEmpty(tissue.getBillFiles())) {
tissuePersonService.dao().update(ActivityBx.class, Chain.make("billFiles", tissue.getBillFiles()), tissuePersonService.dao().update(ActivityBx.class, Chain.make("billFiles", tissue.getBillFiles()),
Cnd.where("activity_id", "=", tissue.getId())); Cnd.where("activity_id", "=", tissue.getId()));
} }
@@ -143,7 +148,8 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
if (Lang.isNotEmpty(tissue.getPhotoFiles())) { if (Lang.isNotEmpty(tissue.getPhotoFiles())) {
tissuePersonService.dao().update(ActivityBx.class, Chain.make("photoFiles", tissue.getPhotoFiles()), tissuePersonService.dao().update(ActivityBx.class, Chain.make("photoFiles", tissue.getPhotoFiles()),
Cnd.where("activity_id", "=", tissue.getId())); Cnd.where("activity_id", "=", tissue.getId()));
} }*/
} }
@@ -24,10 +24,7 @@ import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import java.util.Arrays; import java.util.*;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -301,10 +298,15 @@ public class QuestionH5Controller {
} }
} }
// issueCnd.asc("ipxbh"); issueCnd.asc("ipxbh");
questionService.fetchLinks(question, "issues", issueCnd); questionService.fetchLinks(question, "issues", issueCnd);
// List<String> issueIds = question.getIssues().stream().map(Question_issue::getIid).collect(Collectors.toList());
// List<Question_wor> wors = dao.query(Question_wor.class, Cnd.where("wiid", "in", issueIds));
for (Question_issue issue : question.getIssues()) { for (Question_issue issue : question.getIssues()) {
questionService.fetchLinks(issue, "wors", Cnd.NEW().asc("wpxbh")); questionService.fetchLinks(issue, "wors", Cnd.NEW().asc("wpxbh"));
// issue.setWors(wors.stream().filter(v -> v.getWiid().equals(issue.getIid()))
// .sorted(Comparator.comparingInt(Question_wor::getWpxbh)).collect(Collectors.toList()));
} }
if (question.getDisruptingOrder()) { if (question.getDisruptingOrder()) {
@@ -1,162 +1,119 @@
<template> <template>
<el-tabs tab-position="top" v-model="activeName" v-loading="loading"> <el-tabs tab-position="top" v-model="activeName" v-loading="loading">
<el-tab-pane label="活动基础信息" name="1"> <el-tab-pane label="活动基础信息" name="1">
<el-form label-suffix=":" style="padding: 20px 0" label-width="120px"> <border-table>
<el-form-item class="item-center">{{ viewData.name }}</el-form-item> <table>
<tr>
<th>联系人</th>
<td>{{ viewData.username }}( {{ viewData.loginname }})</td>
<th>联系方式</th>
<td>{{ viewData.mobile }}</td>
<th>活动编号</th>
<td>{{ viewData.activityCode }}</td>
</tr>
<tr>
<th>活动名称</th>
<td>{{ viewData.name }}</td>
<th>活动类型</th>
<td>{{ viewData.type === 1 ? "分工会活动" : viewData.type === 2 ? "协会协会活动" : "校工会活动" }}</td>
<th>活动项目类型</th>
<td>{{ viewData.projectTypeName }}( {{ viewData.projectTypeCode }})</td>
</tr>
<el-row gutter="60"> <tr>
<th>活动地点</th>
<td>{{ viewData.address }}</td>
<th>报名时间</th>
<td>{{ viewData.applyStartTime }} - {{ viewData.applyEndTime }}</td>
<th>活动时间</th>
<td>{{ viewData.startTime }} - {{ viewData.endTime }}</td>
</tr>
<el-col :span="12"> <tr>
<el-form-item label="联系人"> <th>创建组织</th>
<span v-if="viewData.username"> <td>
{{ viewData.username }} <span v-if="viewData.type===40001">{{ "校工会" }}</span>
({{ viewData.loginname }})</span> <span v-if="viewData.type===40002">{{ viewData.unionname ? viewData.unionname : "暂无" }}</span>
</el-form-item> <span v-if="viewData.type===40003">{{ viewData.clubName ? viewData.clubName : "暂无" }}</span>
</el-col> </td>
<th>报名方式</th>
<el-col :span="12"> <td>
<el-form-item label="联系方式">
{{ viewData.mobile }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动编号">
{{ viewData.activityCode }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动项目类型">
{{ viewData.projectTypeName }}({{ viewData.projectTypeCode }})
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动类型">
{{ viewData.type === 1 ? '分工会活动' : viewData.type === 2 ? '协会社团活动' : '校工会活动' }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动计划时间">
{{ viewData.startPlannedDate + ' - ' + viewData.endPlannedDate }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动时间">{{ viewData.startTime }} - {{
viewData.endTime
}}
</el-form-item>
</el-col>
<el-col :span="12" v-if="viewData.applyStartTime">
<el-form-item label="报名时间">{{ viewData.applyStartTime }} - {{
viewData.applyEndTime
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动人数">{{ viewData.peopleNum || '暂无' }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动内容">{{ viewData.activityContent }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动地点">{{ viewData.address }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报名方式">
<span v-if="viewData.signUpMethod===1">个人报名</span> <span v-if="viewData.signUpMethod===1">个人报名</span>
<span v-else-if="viewData.signUpMethod===2">分工会报名</span> <span v-else-if="viewData.signUpMethod===2">分工会报名</span>
<span v-else-if="viewData.signUpMethod===3">组队报名</span> <span v-else-if="viewData.signUpMethod===3">组队报名</span>
<span v-else-if="!viewData.signUpMethod">无需报名</span> <span v-else-if="!viewData.signUpMethod">无需报名</span>
</el-form-item> </td>
</el-col> <th>报名人数限制</th>
<td>
<el-col :span="12"> <span v-if="viewData.userNumberLimit===1">总人数限制({{viewData.totalUserNumberLimit }})</span>
<el-form-item label="活动提醒">
{{ viewData.xlFlag ? '提醒' : '不提醒' }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否用于报名">
<span v-if="viewData.isEnrollSystem">活动报名</span>
<span v-else>活动管理</span>
</el-form-item>
</el-col>
<el-col :span="12" v-if="viewData.signUpMethod!=null">
<el-form-item label="报名人数限制">
<span v-if="viewData.userNumberLimit===1">总人数限制({{
viewData.totalUserNumberLimit
}})</span>
<span v-else-if="viewData.userNumberLimit===2">分工会人数限制</span> <span v-else-if="viewData.userNumberLimit===2">分工会人数限制</span>
<span v-else-if="!viewData.userNumberLimit">不限制</span> <span v-else-if="!viewData.userNumberLimit">不限制</span>
</el-form-item> </td>
</el-col> </tr>
<el-col :span="24" v-if="viewData.userNumberLimit===2"> <tr v-if="viewData.userNumberLimit===2">
<el-form-item label="分工会限制名额"> <th>报名方式</th>
<td colspan="5">
<el-table border stripe :data="viewData.unionUserNumberLimit" size="small" <el-table border stripe :data="viewData.unionUserNumberLimit" size="small"
height="500"> height="500">
<el-table-column type="index" label="序号" header-align="center" align="center" <el-table-column type="index" label="序号" header-align="center" align="center"
width="100"> width="100">
</el-table-column> </el-table-column>
<el-table-column label="分工会名称" prop="unionName"></el-table-column> <el-table-column label="分工会名称" prop="unionname"></el-table-column>
<el-table-column label="分工会人数" prop="unionNum"></el-table-column> <el-table-column label="分工会人数" prop="teacherCount"></el-table-column>
<el-table-column label="限制人数" prop="limitNum"></el-table-column> <el-table-column label="限制人数" prop="limitNum"></el-table-column>
</el-table> </el-table>
</el-form-item> </td>
</el-col> </tr>
<el-col :span="24"> <tr v-if="viewData.needSign && viewData.needSign!=null">
<el-form-item v-if="viewData.type===1" label="所属工会"> <th>是否需要签到</th>
{{ !viewData.unionname ? '暂无' : viewData.unionname }} <td>{{ viewData.needSign ? "需要" : "不需要" }}</td>
</el-form-item> <th>签到半径</th>
<el-form-item v-if="viewData.type===2" label="所属社团"> <td colspan="3">{{ viewData.rangeMeter + "米" }}</td>
{{ !viewData.clubName ? '暂无' : viewData.clubName }} </tr>
</el-form-item>
<el-form-item v-if="viewData.type===3" label="所属组织">
校工会
</el-form-item>
</el-col>
<el-col :span="12" v-if="[1,2].includes(viewData.signUpMethod)"> <tr v-if="viewData.needSign">
<el-form-item label="是否需要签到"> <th>活动签到点位</th>
{{ viewData.needSign ? '需要' : '不需要' }} <td colspan="5">
</el-form-item>
</el-col>
<el-col :span="12" v-if="viewData.signUpMethod!=null">
<el-form-item label="签到半径(m)" v-if="viewData.needSign">
{{ viewData.rangeMeter + '' }}
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="封面图" prop="cover">
<img v-if="viewData.cover"
:src="FILE_DOMAIN + '/fileStreamPreview?id=' + viewData.cover"
class="avatar" style="height: 200px;width: auto">
</el-form-item>
</el-col>
<el-col :span="24" v-if="viewData.needSign">
<el-form-item prop="" label="活动签到点位">
<el-card shadow="never"> <el-card shadow="never">
<div style="width: 100%;height: 500px" id="signMap"></div> <div style="width: 100%;height: 500px" id="signMap"></div>
</el-card> </el-card>
</el-form-item> </td>
</el-col> </tr>
</el-row> <tr>
<th>活动介绍</th>
<td colspan="5">
<div v-html="viewData.activityContent"></div>
</td>
</tr>
<tr>
<th>附件</th>
<td colspan="5">
<file-upload v-if="viewData.otherFiles&&viewData.otherFiles.length"
:files="viewData.otherFiles" :view="true">
</file-upload>
<span v-else>暂无</span>
</td>
</tr>
<tr>
<th>封面图</th>
<td colspan="5">
<img v-if="viewData.cover"
:src="FILE_DOMAIN + '/fileStreamPreview?id=' + viewData.cover"
class="avatar" style="height: 200px;width: auto">
<span v-else>暂无</span>
</td>
</tr>
</table>
</border-table>
</el-form>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="活动费用" name="3" v-if="!viewData.isEnrollSystem"> <el-tab-pane label="活动费用" name="3" v-if="!viewData.isEnrollSystem">
<el-form label-suffix=":" label-position="left" style="padding: 20px 0" label-width="80px"> <el-form label-suffix=":" label-position="left" style="padding: 20px 0" label-width="80px">
@@ -189,13 +146,6 @@
</file-upload> </file-upload>
<span v-else>暂无</span> <span v-else>暂无</span>
</el-form-item> </el-form-item>
<el-form-item label="其&emsp;&emsp;他">
<file-upload v-if="viewData.otherFiles&&viewData.otherFiles.length"
:files="viewData.otherFiles" :view="true">
</file-upload>
<span v-else>暂无</span>
</el-form-item>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
@@ -239,26 +189,26 @@ module.exports = {
props: { props: {
handle: { handle: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
label: { label: {
type: String, type: String,
default: '审核' default: "审核"
}, }
}, },
data() { data() {
return { return {
userData: [], userData: [],
viewData: {}, viewData: {},
loading: true, loading: true,
search: '', search: "",
tableKey: '', tableKey: "",
activeName: '1', activeName: "1",
userColumns: [], userColumns: []
} }
}, },
components: { components: {
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'), "file-upload": httpVueLoader("/components/plugins/FileUpload.vue")
}, },
methods: { methods: {
hasPane(name) { hasPane(name) {
@@ -280,19 +230,19 @@ module.exports = {
} }
}, },
async getInfo(id) { async getInfo(id) {
this.userColumns = [{prop: 'userName', label: '姓名'}, this.userColumns = [{ prop: "userName", label: "姓名" },
{prop: 'loginName', label: '工号'}, { prop: "loginName", label: "工号" },
{prop: 'sex', label: '性别'}, { prop: "sex", label: "性别" },
{prop: 'mobile', label: '联系方式'}, { prop: "mobile", label: "联系方式" },
{prop: 'unitName', label: '所属单位'}, { prop: "unitName", label: "所属单位" },
{prop: 'unionName', label: '所属工会'}] { prop: "unionName", label: "所属工会" }]
this.loading = true this.loading = true
const { data } = await $.get("/platform/activity/info/mange/findOne", { id }) const { data } = await $.get("/platform/activity/info/mange/findOne", { id })
this.loading = false this.loading = false
if (data) { if (data) {
if (data.needSign) { if (data.needSign) {
this.userColumns.push({prop: 'isSign', label: '是否签到'}) this.userColumns.push({ prop: "isSign", label: "是否签到" })
this.userColumns.push({prop: 'signTime', label: '签到时间'}) this.userColumns.push({ prop: "signTime", label: "签到时间" })
} }
data.billFiles = JSON.parse(data.billFiles) data.billFiles = JSON.parse(data.billFiles)
data.photoFiles = JSON.parse(data.photoFiles) data.photoFiles = JSON.parse(data.photoFiles)
@@ -306,7 +256,7 @@ module.exports = {
this.activeName = this.handle ? "999" : "1" this.activeName = this.handle ? "999" : "1"
} else { } else {
this.viewData = {} this.viewData = {}
this.$notify.error({title: '错误', message: '获取信息失败'}); this.$notify.error({ title: "错误", message: "获取信息失败" })
} }
}, },
initMap() { initMap() {
@@ -316,7 +266,7 @@ module.exports = {
resizeEnable: true, resizeEnable: true,
center: [118.640081, 32.082496], center: [118.640081, 32.082496],
zoom: 16 zoom: 16
}); })
if (this.viewData.location && Array.isArray(this.viewData.location)) { if (this.viewData.location && Array.isArray(this.viewData.location)) {
const lng = parseFloat(this.viewData.location[0]) const lng = parseFloat(this.viewData.location[0])
@@ -324,11 +274,11 @@ module.exports = {
marker = new AMap.Marker({ marker = new AMap.Marker({
position: [lng, lat], position: [lng, lat],
offset: new AMap.Pixel(-13, -30) offset: new AMap.Pixel(-13, -30)
}); })
marker.setMap(map); marker.setMap(map)
map.setZoomAndCenter(18, [lng, lat]) map.setZoomAndCenter(18, [lng, lat])
} }
map.on('click', (e) => { map.on("click", (e) => {
console.log(e) console.log(e)
if (marker) { if (marker) {
marker.setMap(null) marker.setMap(null)
@@ -342,10 +292,10 @@ module.exports = {
this.formData.location = [] this.formData.location = []
this.formData.location.push(e.lnglat.getLng()) this.formData.location.push(e.lnglat.getLng())
this.formData.location.push(e.lnglat.getLat()) this.formData.location.push(e.lnglat.getLat())
}); })
}) })
} }
}, }
} }
</script> </script>
@@ -61,9 +61,7 @@
</van-cell> </van-cell>
<van-cell title="活动内容" v-if="o.projectTypeCode!=='50004'"> <van-cell title="活动内容" v-if="o.projectTypeCode!=='50004'">
<template #label> <span @click.stop="showActivityInfo(o.activityContent)" style="color: #0a84ff">点我查看详情</span>
{{o.activityContent}}
</template>
</van-cell> </van-cell>
<van-cell title="签到点位" v-if="o.needSign"> <van-cell title="签到点位" v-if="o.needSign">
<template #label> <template #label>
@@ -1,11 +1,12 @@
const self_mixin = { const self_mixin_h5 = {
data() { data() {
return { return {
//已报名人数 //已报名人数
hasRegUserNum: 0, hasRegUserNum: 0,
unionId: null, unionId: null,
unionLimitNum: 0, unionLimitNum: 0,
isRegisterFull: false isRegisterFull: false,
user: JSON.parse(window.sessionStorage.getItem('user'))
} }
}, },
methods: { methods: {
@@ -15,7 +16,7 @@ const self_mixin = {
resp.data.location = JSON.parse(resp.data.location) resp.data.location = JSON.parse(resp.data.location)
resp.data.unionUserNumberLimit = JSON.parse(resp.data.unionUserNumberLimit) resp.data.unionUserNumberLimit = JSON.parse(resp.data.unionUserNumberLimit)
this.o = resp.data this.o = resp.data
this.unionId = "${@shiro.getPrincipalProperty('unit').getUnionid()}" this.unionId = this.user.union.id
if (!this.unionId) { if (!this.unionId) {
this.$toast.fail('您的所属工会信息缺失,请联系管理员') this.$toast.fail('您的所属工会信息缺失,请联系管理员')
return return
@@ -52,8 +53,9 @@ const self_mixin = {
zoomEnable: true, zoomEnable: true,
dragEnable: false, dragEnable: false,
resizeEnable: true, resizeEnable: true,
center: [114.402582, 30.521378], center: [119.743667, 30.216618],
zoom: 16 zoom: 16,
scrollWheel: true,
}); });
if (this.o.location && Array.isArray(this.o.location)) { if (this.o.location && Array.isArray(this.o.location)) {
@@ -61,7 +63,7 @@ const self_mixin = {
const lat = parseFloat(this.o.location[1]) const lat = parseFloat(this.o.location[1])
marker = new AMap.Marker({ marker = new AMap.Marker({
position: [lng, lat], position: [lng, lat],
offset: new AMap.Pixel(-13, -30) //offset: new AMap.Pixel(-13, -30)
}) })
map.add(marker) map.add(marker)
// marker.setMap(map); // marker.setMap(map);
@@ -56,24 +56,25 @@ layout("/mobile/platform.html"){
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="活动列表" left-arrow placeholder fixed <van-nav-bar @click-left="location.replace('/mobile/index')" fixed left-arrow placeholder
@click-left="location.replace('/mobile/index')"></van-nav-bar> title="活动列表"></van-nav-bar>
<div style="margin: 10px auto 60px auto"> <div style="margin: 10px auto 60px auto">
<van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" <van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
@load="pageData"> @load="pageData"
<div v-for="o in tableData" class="list-card" @click="openReg(o)"> v-model="loading">
<div @click="openReg(o)" class="list-card" v-for="o in tableData">
<div class="activity_card"> <div class="activity_card">
<van-image <van-image
fit="cover"
width="100%"
height="200"
:src="FILE_DOMAIN + '/fileStreamPreview?id=' + o.cover" :src="FILE_DOMAIN + '/fileStreamPreview?id=' + o.cover"
fit="cover"
height="200"
width="100%"
></van-image> ></van-image>
<div class="activity_content"> <div class="activity_content">
<div class="activity_name van-ellipsis"> <div class="activity_name van-ellipsis">
<van-icon name="fire" color="red"></van-icon> <van-icon color="red" name="fire"></van-icon>
<span style="margin-left: 10px;">{{o.name}}</span> <span style="margin-left: 10px;">{{o.name}}</span>
</div> </div>
<div class="activity_bottom"> <div class="activity_bottom">
@@ -85,20 +86,20 @@ layout("/mobile/platform.html"){
</span> </span>
</div> </div>
<div class="right"> <div class="right">
<span v-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()" <span style="color: forestgreen"
style="color: forestgreen"> v-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()">
报名中 报名中
</span> </span>
<span v-else-if="moment(o.applyEndTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.startTime).valueOf()" <span style="color: #ee1919"
style="color: #ee1919"> v-else-if="moment(o.applyEndTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.startTime).valueOf()">
报名结束 报名结束
</span> </span>
<span v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()" <span style="color: forestgreen"
style="color: forestgreen"> v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()">
活动进行中 活动进行中
</span> </span>
<span v-else-if="moment().valueOf() > moment(o.endTime).valueOf()" <span style="color: #ee1919"
style="color: #ee1919"> v-else-if="moment().valueOf() > moment(o.endTime).valueOf()">
活动结束 活动结束
</span> </span>
</div> </div>
@@ -109,14 +110,18 @@ layout("/mobile/platform.html"){
</van-list> </van-list>
</div> </div>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" <van-empty class="custom-image" description="暂无数据" image="/none.svg"
description="暂无数据"> v-if="mLoading==false&&tableData.length==0">
</van-empty> </van-empty>
<div> <div>
<van-tabbar v-model="tabBarIndex" :active-color="themeColor"> <van-tabbar :active-color="themeColor" v-model="tabBarIndex">
<van-tabbar-item icon="home-o" url="/mobile/activity/unionActivity">全部活动</van-tabbar-item> <van-tabbar-item @click="location.replace('/mobile/activity/unionActivity')" icon="home-o">
<van-tabbar-item icon="friends-o" url="/mobile/activity/myActivity">我的活动</van-tabbar-item> 全部活动
</van-tabbar-item>
<van-tabbar-item @click="location.replace('/mobile/activity/myActivity')" icon="friends-o">
我的活动
</van-tabbar-item>
</van-tabbar> </van-tabbar>
</div> </div>
@@ -161,9 +166,9 @@ layout("/mobile/platform.html"){
openReg(o) { openReg(o) {
// window.location.href = '/mobile/activity/unionActivity/goReg?id=' + o.id + '&signUpMethod=1' // window.location.href = '/mobile/activity/unionActivity/goReg?id=' + o.id + '&signUpMethod=1'
if (o.projectTypeCode === '50004') { if (o.projectTypeCode === '50004') {
window.location.href = '/mobile/activity/myActivity/goMyProject?id=' + o.id location.replace('/mobile/activity/myActivity/goMyProject?id=' + o.id)
} else { } else {
window.location.href = '/mobile/activity/myActivity/goSign?id=' + o.id location.replace('/mobile/activity/myActivity/goSign?id=' + o.id)
} }
} }
}, },
@@ -9,22 +9,43 @@ layout("/mobile/platform.html"){
height: 200px; height: 200px;
width: 100%; width: 100%;
} }
.remark-content{
width: 100%;
max-width: 100%;
height: calc(100vh - 46px - 44px);
overflow-y: auto;
}
.remark-content *{
max-width: 100%!important;
}
.joinPopup {
width: 100%;
height: 100%;
background-color: #f6f7f9;
}
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="签到" left-arrow placeholder fixed @click-left="history.back()"></van-nav-bar> <van-nav-bar title="签到" left-arrow placeholder fixed @click-left="location.replace('/mobile/activity/unionActivity')"></van-nav-bar>
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#--> <!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
<div style="margin: 20px 20px 10px 20px" v-if="o.needSign"> <div style="margin: 20px 20px 10px 20px" v-if="o.needSign">
<van-button <van-button
:disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign" :disabled="isSign"
@click="doSign()" style="border-radius: 10px" block type="info" @click="doSign()" style="border-radius: 10px" block type="info"
:color="themeColor"> :color="themeColor">
{{isSign?'签到成功':'立即签到'}} {{isSign?'签到成功':'立即签到'}}
</van-button> </van-button>
</div> </div>
<van-popup class="joinPopup" position="right" v-model:show="showActivityInfoPopup">
<van-nav-bar @click-left="showActivityInfoPopup = false" fixed left-arrow placeholder title="活动内容"></van-nav-bar>
<div class="remark-content" v-html="activityContent" @click="remarkClick"></div>
</van-popup>
</div> </div>
@@ -36,15 +57,29 @@ layout("/mobile/platform.html"){
let geolocation = null let geolocation = null
const vue = new Vue({ const vue = new Vue({
el: '#app', el: '#app',
mixins: [mobileMixins, self_mixin], mixins: [mobileMixins, self_mixin_h5],
data() { data() {
return { return {
activityId: '', activityId: '',
o: {}, o: {},
isSign: null isSign: null,
activityContent: '',
showActivityInfoPopup: false
} }
}, },
methods: { methods: {
remarkClick(event){
//如果点击的是图片
if(event.target.tagName === 'IMG'){
vant.ImagePreview([event.target.src])
}
},
showActivityInfo(activityContent){
this.activityContent = ''
this.activityContent = activityContent
this.showActivityInfoPopup = true
},
async getSignStatus() { async getSignStatus() {
const resp = await $.post('/mobile/activity/unionActivity/isSign', {activityId: this.activityId}) const resp = await $.post('/mobile/activity/unionActivity/isSign', {activityId: this.activityId})
if (resp.code === 0) { if (resp.code === 0) {
@@ -52,25 +87,38 @@ layout("/mobile/platform.html"){
} }
}, },
async doSign() { async doSign() {
const loading1 = this.$toast.loading({
message: '正在获取您的位置...',
forbidClick: true,
overlay: true,
duration: 0
})
geolocation.getCurrentPosition(async (status, result) => { geolocation.getCurrentPosition(async (status, result) => {
if (status !== 'complete') { if (status !== 'complete') {
this.$toast.fail('定位失败!') this.$toast.fail('定位失败!')
return return
} }
console.log(status)
console.log(result)
const lat = result.position.lat const lat = result.position.lat
const lng = result.position.lng const lng = result.position.lng
const params = { const params = {
lat1: lat, lng1: lng, lat2: this.o.location[1], lng2: this.o.location[0] lat1: lat, lng1: lng, lat2: this.o.location[1], lng2: this.o.location[0]
} }
const distance = this.getMapDistance(params) const distance = this.getMapDistance(params)
console.log(distance)
console.log(this.o.rangeMeter) loading1.close()
if (!moment().isBetween(moment(this.o.signStartTime), moment(this.o.signEndTime))) {
vant.Dialog.alert({
title: '温馨提示',
message: '未到签到时间<br/>签到开始时间:' + this.o.signStartTime + '<br/>签到结束时间:' + this.o.signEndTime,
})
return
}
if (distance > this.o.rangeMeter) { if (distance > this.o.rangeMeter) {
this.$toast('距离活动打卡点还有' + distance + '米') this.$toast('距离活动打卡点还有' + distance + '米')
return return
} }
const confirm = await this.$dialog.confirm({ const confirm = await this.$dialog.confirm({
title: '提示', title: '提示',
message: '您确认要签到吗?', message: '您确认要签到吗?',
@@ -83,23 +131,24 @@ layout("/mobile/platform.html"){
}) })
if (confirm === 'confirm') { if (confirm === 'confirm') {
const resp = await $.post('/mobile/activity/unionActivity/singleSignUp', {activityId: this.activityId}) const resp = await $.post('/mobile/activity/unionActivity/singleSignUp', {activityId: this.activityId})
loading.close()
if (resp.code === 0) { if (resp.code === 0) {
await this.getSignStatus() await this.getSignStatus()
loading.close()
this.$toast.success(resp.msg) this.$toast.success(resp.msg)
} else {
this.$toast.fail(resp.msg)
} }
} }
}) })
} }
}, },
created() { async created() {
const id = GetQueryString("id") const id = GetQueryString("id")
if (id) { if (id) {
this.activityId = id this.activityId = id
this.getActivityInfo() await this.getActivityInfo()
this.getSignStatus() await this.getSignStatus()
} }
} }
}) })
@@ -9,68 +9,103 @@ layout("/mobile/platform.html"){
/*height: 200px;*/ /*height: 200px;*/
width: 100%; width: 100%;
} }
.remark-content{
width: 100%;
max-width: 100%;
height: calc(100vh - 46px - 44px);
overflow-y: auto;
}
.remark-content *{
max-width: 100%!important;
}
.joinPopup {
width: 100%;
height: 100%;
background-color: #f6f7f9;
}
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="个人报名" left-arrow placeholder fixed <van-nav-bar @click-left="location.replace('/mobile/activity/unionActivity')" fixed left-arrow
@click-left="history.back()"></van-nav-bar> placeholder
title="个人报名"></van-nav-bar>
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#--> <!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
<div style="margin: 20px 20px 10px 20px" <div style="margin: 20px 20px 10px 20px"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"> v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()">
<van-button v-if="!isRegister && !isRegisterFull" @click="doSave()" <van-button :color="themeColor" @click="doSave()"
style="border-radius: 10px" block block style="border-radius: 10px"
type="info" type="info"
:color="themeColor"> v-if="!isRegister && !isRegisterFull">
立即报名 立即报名
</van-button> </van-button>
<van-button v-else-if="!isRegister && isRegisterFull" @click="doSave()" <van-button :color="themeColor" @click="doSave()"
style="border-radius: 10px" block block disabled
disabled style="border-radius: 10px"
type="info" type="info"
:color="themeColor"> v-else-if="!isRegister && isRegisterFull">
名额已满 名额已满
</van-button> </van-button>
<van-button v-else-if="isRegister && moment().valueOf() < moment(o.applyEndTime).valueOf()" <van-button @click="doCancel"
@click="doCancel" block
style="border-radius: 10px" block type="info" color="red" style="border-radius: 10px" type="info"
color="red"> v-else-if="isRegister && moment().valueOf() < moment(o.applyEndTime).valueOf()">
取消报名 取消报名
</van-button> </van-button>
</div> </div>
<div style="margin: 20px 20px 10px 20px" <!--<div style="margin: 20px 20px 10px 20px"
v-if="isRegister && moment().valueOf() < moment(o.endTime).valueOf() && moment().valueOf() > moment(o.startTime).valueOf()"> v-if="isRegister && moment().valueOf() < moment(o.endTime).valueOf() && moment().valueOf() > moment(o.startTime).valueOf()">
<van-button <van-button
:color="themeColor"
:disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign" :disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign"
@click="doSign()" style="border-radius: 10px" block type="info" @click="doSign()" block style="border-radius: 10px"
:color="themeColor"> type="info">
{{isSign?'签到成功':'立即签到'}} {{isSign?'签到成功':'立即签到'}}
</van-button> </van-button>
</div> </div>-->
<van-popup class="joinPopup" position="right" v-model:show="showActivityInfoPopup">
<van-nav-bar @click-left="showActivityInfoPopup = false" fixed left-arrow placeholder title="活动内容"></van-nav-bar>
<div class="remark-content" v-html="activityContent" @click="remarkClick"></div>
</van-popup>
</div> </div>
<script> <script>
<!--#include("/mobile/activity/unionActivity/common/initMap.js"){}#--> <!--#include("/mobile/activity/unionActivity/common/initMap.js"){}#-->
</script>
<script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: '#app',
mixins: [mobileMixins, self_mixin], mixins: [mobileMixins, self_mixin_h5],
data() { data() {
return { return {
activityId: '', activityId: '',
o: {}, o: {},
tagCloseable: true, tagCloseable: true,
isRegister: false, isRegister: false,
isSign: false isSign: false,
activityContent: '',
showActivityInfoPopup: false
} }
}, },
methods: { methods: {
remarkClick(event){
//如果点击的是图片
if(event.target.tagName === 'IMG'){
vant.ImagePreview([event.target.src])
}
},
showActivityInfo(activityContent){
console.log(activityContent)
this.activityContent = ''
this.activityContent = activityContent
this.showActivityInfoPopup = true
},
async isRegisterForMe() { async isRegisterForMe() {
const resp = await $.get('/mobile/activity/unionActivity/isRegisterForMe', {activityId: this.activityId}) const resp = await $.get('/mobile/activity/unionActivity/isRegisterForMe', {activityId: this.activityId})
if (resp.code === 0) { if (resp.code === 0) {
@@ -97,13 +132,19 @@ layout("/mobile/platform.html"){
const resp = await $.post('/mobile/activity/unionActivity/doSingleRegister', {activityId: this.activityId}) const resp = await $.post('/mobile/activity/unionActivity/doSingleRegister', {activityId: this.activityId})
loading.close() loading.close()
if (resp.code === 0) { if (resp.code === 0) {
this.$toast.success(resp.msg) vant.Dialog.alert({
setTimeout(() => { title: '温馨提示',
window.history.back() message: '您已报名成功,请按时参加活动哦',
}, 1000) }).then(() => {
window.location.reload()
}).catch(() => {
window.location.reload()
})
} else { } else {
this.$toast.fail(resp.msg) vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
} }
} }
}, },
@@ -112,22 +153,31 @@ layout("/mobile/platform.html"){
title: '提示', title: '提示',
message: '您确认要取消报名吗?', message: '您确认要取消报名吗?',
}) })
if (confirm === 'confirm') {
const loading = this.$toast.loading({ const loading = this.$toast.loading({
message: '取消中...', message: '取消中...',
forbidClick: true, forbidClick: true,
overlay: true, overlay: true,
duration: 0 duration: 0
}) })
if (confirm === 'confirm') {
const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {activityId: this.activityId}) const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {activityId: this.activityId})
loading.close() loading.close()
if (resp.code === 0) { if (resp.code === 0) {
this.$toast.success(resp.msg) vant.Dialog.alert({
setTimeout(() => { title: '温馨提示',
window.history.back() message: resp.msg,
}, 1000) }).then(() => {
window.location.reload()
}).catch(() => {})
// setTimeout(() => {
// this.$toast.success(resp.msg)
// pjaxReplace('/mobile/activity/unionActivity')
// }, 1000)
} else { } else {
this.$toast.fail(resp.msg) vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
} }
} }
}, },
@@ -39,58 +39,69 @@ layout("/mobile/platform.html"){
.van-search__action { .van-search__action {
background-color: #edf0ff background-color: #edf0ff
} }
.remark-content{
width: 100%;
max-width: 100%;
height: calc(100vh - 46px - 44px);
overflow-y: auto;
}
.remark-content *{
max-width: 100%!important;
}
.joinPopup {
width: 100%;
height: 100%;
background-color: #f6f7f9;
}
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar :title="title" left-arrow placeholder fixed <van-nav-bar :title="title" @click-left="location.replace('/mobile/activity/unionActivity')" fixed left-arrow
@click-left="history.back()"></van-nav-bar> placeholder></van-nav-bar>
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#--> <!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
<van-cell-group inset class="mt5"> <van-cell-group class="mt5" inset>
<van-cell title="报名人员" class="regCell"> <van-cell class="regCell" title="报名人员">
<template #label> <template #label>
<div> <div>
<span v-if="o.userNumberLimit===1"> <span v-if="o.userNumberLimit===1">本活动限制总报名人数:({{o.totalUserNumberLimit}})人</span>
本活动限制总报名人数:({{o.totalUserNumberLimit}})人
</span>
<span v-else-if="o.userNumberLimit===2"> <span v-else-if="o.userNumberLimit===2">
当前工会报名限额 <span style="color: orange">{{o.limitUnion.limitNum}})人</span> 当前基层工会报名限额
<span style="color: orange">{{o.limitUnion.limitNum}})人</span>
</span> </span>
</div> </div>
<div class="mt5" v-loading="tagCloseable"> <div class="mt5" v-loading="tagCloseable">
<div v-if="registerList && registerList.length>0"> <div v-if="registerList && registerList.length>0">
<template v-for="item in registerList"> <template v-for="item in registerList">
<van-tag type="primary" :closeable="tagCloseable" size="medium" <van-tag :closeable="tagCloseable" :color="themeColor" @close="removeRegUser(item)" size="medium" type="primary">
:color="themeColor"
@close="removeRegUser(item)">
{{item.userName}} {{item.userName}}
</van-tag> </van-tag>
</template> </template>
</div> </div>
<div v-else> <div v-else>
<div style="text-align: center;margin-top: 20px;"> <div style="text-align: center; margin-top: 20px">无报名人员</div>
无报名人员
</div> </div>
</div> </div>
</div> <div
<div class="mt5" style="text-align: right" class="mt5"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"> style="text-align: right"
<van-button v-if="tagCloseable" size="mini" type="info" v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"
@click="openUserActionSheet" :color="themeColor">选择报名人员 >
</van-button> <van-button :color="themeColor" @click="openUserActionSheet" size="mini" type="info" v-if="tagCloseable">选择报名人员</van-button>
</div> </div>
</template> </template>
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
<van-action-sheet v-model="userActionSheet" title="选择报名人员" class="userActionPopup"> <van-action-sheet class="userActionPopup" title="选择报名人员" v-model="userActionSheet">
<van-search v-model="searchKey" @search="onSearchUser" show-action <van-search @search="onSearchUser" placeholder="请输入姓名搜索" show-action v-model="searchKey">
placeholder="请输入姓名搜索">
<template #action> <template #action>
<div @click="onSearchUser(searchKey)">搜索</div> <div @click="onSearchUser(searchKey)">搜索</div>
</template> </template>
</van-search> </van-search>
<!-- <div class="van-hairline&#45;&#45;bottom">--> <!-- <div class="van-hairline&#45;&#45;bottom">-->
@@ -100,41 +111,36 @@ layout("/mobile/platform.html"){
<van-loading size="24px" vertical>搜索中...</van-loading> <van-loading size="24px" vertical>搜索中...</van-loading>
</template> </template>
<div class="van-action-sheet__content mt5" <div class="van-action-sheet__content mt5" v-else-if="searchUserList && searchUserList.length>0">
v-else-if="searchUserList && searchUserList.length>0">
<template> <template>
<template v-for="item in searchUserList" <template v-for="item in searchUserList" v-if="!registerList.map(v=>v.id).includes(item.id)">
v-if="!registerList.map(v=>v.id).includes(item.id)"> <button @click="searchUserAdd(item)" class="van-action-sheet__item van-hairline--bottom">
<button @click="searchUserAdd(item)"
class="van-action-sheet__item van-hairline--bottom">
<span class="van-action-sheet__name">{{item.userName}}{{item.loginName}}</span> <span class="van-action-sheet__name">{{item.userName}}{{item.loginName}}</span>
</button> </button>
</template> </template>
<!--<van-empty description="没有更多了" style="position:absolute;height: 70%" <!--<van-empty description="没有更多了"
v-else></van-empty>--> v-else></van-empty>-->
</template> </template>
</div> </div>
<van-empty description="暂无数据" style="position:absolute;height: 70%" <van-empty description="暂无数据" v-else-if="searchUserList.length===0"></van-empty>
v-else-if="searchUserList.length===0"></van-empty>
</van-action-sheet> </van-action-sheet>
<div
<div style="margin: 20px 20px 10px 20px" style="margin: 20px 20px 10px 20px"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"> v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"
<van-button v-if="tagCloseable" @click="doSave()" style="border-radius: 10px" block >
type="info" <van-button :color="themeColor" @click="doSave()" block style="border-radius: 10px" type="info" v-if="tagCloseable">提 交</van-button>
:color="themeColor"> <template v-else="!tagCloseable">
提 交 <van-button :color="themeColor" @click="tagCloseable = true" block style="border-radius: 10px" type="info">修 改</van-button>
</van-button> <van-button @click="doCancel" block color="red" style="border-radius: 10px; margin-top: 10px" type="info">取消报名</van-button>
<van-button v-else="!tagCloseable" @click="tagCloseable = true" style="border-radius: 10px" </template>
block type="info"
:color="themeColor">
修 改
</van-button>
</div> </div>
<van-popup class="joinPopup" position="right" v-model:show="showActivityInfoPopup">
<van-nav-bar @click-left="showActivityInfoPopup = false" fixed left-arrow placeholder title="活动内容"></van-nav-bar>
<div class="remark-content" v-html="activityContent" @click="remarkClick"></div>
</van-popup>
<!-- <div style="margin: 20px 20px 10px 20px" v-if="tagCloseable">--> <!-- <div style="margin: 20px 20px 10px 20px" v-if="tagCloseable">-->
<!-- <van-button--> <!-- <van-button-->
<!-- :disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf()"--> <!-- :disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf()"-->
@@ -150,30 +156,69 @@ layout("/mobile/platform.html"){
<!--#include("/mobile/activity/unionActivity/common/initMap.js"){}#--> <!--#include("/mobile/activity/unionActivity/common/initMap.js"){}#-->
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins, self_mixin], mixins: [mobileMixins, self_mixin_h5],
data() { data() {
return { return {
title: "", title: "",
userId: "${@shiro.getPrincipalProperty('id')}", userId: "${@shiro.getPrincipalProperty('id')}",
userName: "${@shiro.getPrincipalProperty('username')}", userName: "${@shiro.getPrincipalProperty('username')}",
activityId: '', activityId: "",
o: {}, o: {},
registerList: [], registerList: [],
addRegisterList: [], addRegisterList: [],
userActionSheet: false, userActionSheet: false,
searchKey: '', searchKey: "",
searchUserList: [], searchUserList: [],
tagCloseable: true, tagCloseable: true,
searchLoading: false searchLoading: false,
activityContent: '',
showActivityInfoPopup: false
} }
}, },
methods: { methods: {
remarkClick(event){
//如果点击的是图片
if(event.target.tagName === 'IMG'){
vant.ImagePreview([event.target.src])
}
},
showActivityInfo(activityContent){
console.log(activityContent)
this.activityContent = ''
this.activityContent = activityContent
this.showActivityInfoPopup = true
},
async doCancel() {
const confirm = await this.$dialog.confirm({
title: "提示",
message: "您确认要取消报名吗?"
})
if (confirm === "confirm") {
const loading = this.$toast.loading({
message: "取消中...",
forbidClick: true,
overlay: true,
duration: 0
})
const resp = await $.post("/mobile/activity/unionActivity/doSingleCancelRegister", { activityId: this.activityId })
loading.close()
if (resp.code === 0) {
setTimeout(() => {
this.$toast.success(resp.msg)
window.location.reload()
}, 1000)
} else {
this.$toast.fail(resp.msg)
}
}
},
async getRegisterUser() { async getRegisterUser() {
const resp = await $.get('/mobile/activity/myActivity/selectRegisterList', {activityId: this.activityId}) const resp = await $.get("/mobile/activity/myActivity/selectRegisterList", { activityId: this.activityId })
if (resp.code === 0) { if (resp.code === 0) {
if (this.o.signUpMethod === 3) { if (this.o.signUpMethod === 3) {
this.registerList = resp.data.filter(v => v.applyUserId === this.userId) this.registerList = resp.data.filter((v) => v.applyUserId === this.userId)
} else { } else {
this.registerList = resp.data this.registerList = resp.data
} }
@@ -184,9 +229,10 @@ layout("/mobile/platform.html"){
} }
}, },
openUserActionSheet() { openUserActionSheet() {
this.searchKey = '' this.searchKey = ""
this.searchUserList = [] this.searchUserList = []
this.userActionSheet = true this.userActionSheet = true
this.onSearchUser("1")
}, },
async onSearchUser(val) { async onSearchUser(val) {
if (!val) { if (!val) {
@@ -194,14 +240,13 @@ layout("/mobile/platform.html"){
return return
} }
this.searchLoading = true this.searchLoading = true
const resp = await $.get('/mobile/activity/unionActivity/searchNoRegisterUser', { const resp = await $.get("/mobile/activity/unionActivity/searchNoRegisterUser", {
activityId: this.activityId, activityId: this.activityId,
searchKey: val searchKey: val
}) })
if (resp.code === 0) { if (resp.code === 0) {
this.searchLoading = false this.searchLoading = false
this.searchUserList = resp.data.list this.searchUserList = resp.data.list
} else { } else {
this.$toast.fail(resp.msg) this.$toast.fail(resp.msg)
} }
@@ -209,6 +254,7 @@ layout("/mobile/platform.html"){
searchUserAdd(item) { searchUserAdd(item) {
const { id, userName } = item const { id, userName } = item
this.registerList.push({ id, userName }) this.registerList.push({ id, userName })
this.$toast.success("添加成功")
}, },
async removeRegUser(item) { async removeRegUser(item) {
if (this.userId === item.id) { if (this.userId === item.id) {
@@ -216,46 +262,42 @@ layout("/mobile/platform.html"){
return return
} }
const confirm = await this.$dialog.confirm({ const confirm = await this.$dialog.confirm({
title: '提示', title: "提示",
message: '您确认要移除吗?', message: "您确认要移除吗?"
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
const index = this.registerList.findIndex(v => v.id === item.id) const index = this.registerList.findIndex((v) => v.id === item.id)
this.registerList.splice(index, 1) this.registerList.splice(index, 1)
} }
}, },
//保存 //保存
async doSave() { async doSave() {
if (this.registerList.length === 0) { if (this.registerList.length === 0) {
this.$toast('请添加报名人员后再提交!') this.$toast("请添加报名人员后再提交!")
return return
} }
if (this.o.signUpMethod === 3) { if (this.o.signUpMethod === 3) {
if (this.registerList.length !== this.o.teamNum) { if (this.registerList.length !== this.o.teamNum) {
vant.Dialog.alert({ vant.Dialog.alert({
title: '温馨提示', title: "温馨提示",
message: '此活动是双人报名模式您需要报名' + this.o.teamNum + '人!', message: "此活动是双人报名模式您需要报名" + this.o.teamNum + "人!"
}).then(() => { }).then(() => {})
});
return return
} }
if (!this.registerList.map(v => v.id).includes(this.userId)) { if (!this.registerList.map((v) => v.id).includes(this.userId)) {
vant.Dialog.alert({ vant.Dialog.alert({
title: '温馨提示', title: "温馨提示",
message: '此活动是组队模式请您找' + this.o.teamNum + '朋友一起报名!', message: "此活动是组队模式请您找" + this.o.teamNum + "朋友一起报名!"
}).then(() => { }).then(() => {})
});
return return
} }
// await this.getRegisterUser() // await this.getRegisterUser()
const resp = await $.get('/mobile/activity/myActivity/selectRegisterList', {activityId: this.activityId}) const resp = await $.get("/mobile/activity/myActivity/selectRegisterList", { activityId: this.activityId })
this.addRegisterList = resp.data this.addRegisterList = resp.data
let arr = [] let arr = []
if (this.addRegisterList && this.addRegisterList.length > 0) { if (this.addRegisterList && this.addRegisterList.length > 0) {
this.addRegisterList.forEach(v => { this.addRegisterList.forEach((v) => {
this.registerList.forEach(r => { this.registerList.forEach((r) => {
if (v.id === r.id && v.applyUserId !== this.userId) { if (v.id === r.id && v.applyUserId !== this.userId) {
arr.push(r.userName) arr.push(r.userName)
} }
@@ -265,11 +307,9 @@ layout("/mobile/platform.html"){
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
vant.Dialog.alert({ vant.Dialog.alert({
title: '温馨提示', title: "温馨提示",
message: '【' + arr.toString() + '】已成功报名您无需再报名!', message: "【" + arr.toString() + "】已成功报名您无需再报名!"
}).then(() => { }).then(() => {})
});
return return
} }
@@ -282,35 +322,40 @@ layout("/mobile/platform.html"){
}); });
return return
}*/ }*/
} }
let message = '' let message = ""
if (this.o.needSign) { if (this.o.needSign) {
message = '此活动开启了签到,需要您活动当天前往签到点位核实活动报名人员后进行签到!' message = "此活动开启了签到,需要您活动当天前往签到点位核实活动报名人员后进行签到!"
} }
const confirm = await this.$dialog.confirm({ const confirm = await this.$dialog.confirm({
title: '提示', title: "提示",
message: message + '您确认要报名吗?', message: message + "您确认要报名吗?"
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
const loading = this.$toast.loading({ const loading = this.$toast.loading({
message: '报名中...', message: "报名中...",
forbidClick: true, forbidClick: true,
overlay: true, overlay: true,
duration: 0 duration: 0
}) })
const params = { const params = {
activityId: this.activityId, activityId: this.activityId,
personIds: JSON.stringify(this.registerList.map(v => v.id)) personIds: JSON.stringify(this.registerList.map((v) => v.id))
} }
const resp = await $.post('/mobile/activity/unionActivity/doSaveUnionRegister', params) const resp = await $.post("/mobile/activity/unionActivity/doSaveUnionRegister", params)
loading.close() loading.close()
if (resp.code === 0) { if (resp.code === 0) {
await this.getRegisterUser() await this.getRegisterUser()
await this.getHasRegUserNum() await this.getHasRegUserNum()
this.$toast.success(resp.msg) vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
} else { } else {
this.$toast.fail(resp.msg) vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
} }
} }
} }
@@ -324,12 +369,10 @@ layout("/mobile/platform.html"){
if (this.o.signUpMethod === 3 && this.registerList.length === 0) { if (this.o.signUpMethod === 3 && this.registerList.length === 0) {
this.registerList.push({ id: this.userId, userName: this.userName }) this.registerList.push({ id: this.userId, userName: this.userName })
} }
this.title = (this.o.signUpMethod === 2 ? '分工会报名' : '组队报名') this.title = this.o.signUpMethod === 2 ? "基层工会报名" : "组队报名"
if (moment(this.o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() > moment(this.o.applyEndTime).valueOf()) { if (moment(this.o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() > moment(this.o.applyEndTime).valueOf()) {
this.$toast.fail("不在活动范围内") this.$toast.fail("不在活动范围内")
} }
} }
} }
}) })
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,12 @@
<!--#
layout("/layouts/platform.html"){
#-->
<script>
window.type = 40003
</script>
<!--#include("/platform/activity/union/layoutApplyUser.html"){}#-->
<!--#
}
#-->
@@ -12,7 +12,7 @@
} }
</style> </style>
<div id="app" class="platform" v-cloak> <div class="platform" id="app" v-cloak>
<guava ref="guava"> <guava ref="guava">
<template> <template>
<el-card shadow="never"> <el-card shadow="never">
@@ -21,11 +21,11 @@
<div class="search-item-label">活动时间</div> <div class="search-item-label">活动时间</div>
<div class="search-item-option"> <div class="search-item-option">
<el-date-picker <el-date-picker
placeholder="选择年"
style="width: 100%" style="width: 100%"
v-model="pageForm.year"
value-format="yyyy"
type="year" type="year"
placeholder="选择年"> v-model="pageForm.year"
value-format="yyyy">
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
@@ -33,86 +33,100 @@
<div class="search-item"> <div class="search-item">
<div class="search-item-label">活动名称</div> <div class="search-item-label">活动名称</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input v-model="pageForm.name" placeholder="请输入活动名称" <el-input clearable placeholder="请输入活动名称"
clearable></el-input> v-model="pageForm.name"></el-input>
</div> </div>
</div> </div>
<div class="search-item" v-if="type==1"> <div class="search-item" v-if="type==1">
<div class="search-item-label">工会名称</div> <div class="search-item-label">工会名称</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select v-model="pageForm.unionId" placeholder="请选择工会" filterable <el-select clearable filterable placeholder="请选择工会"
clearable style="width: 100%"
style="width: 100%"> v-model="pageForm.unionId">
<el-option <el-option
v-for="item in unionList"
:key="item.id" :key="item.id"
:label="item.unionname" :label="item.unionname"
:value="item.id"> :value="item.id"
v-for="item in unionList">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div class="search-query"> <div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="pageData">搜索 <el-button @click="pageData" icon="el-icon-search" type="primary">搜索
</el-button> </el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
<el-card shadow="never" class="mt10"> <el-card class="mt10" shadow="never">
<table-tool label="活动列表" :app="this"> <table-tool :app="this" label="活动列表">
</table-tool> </table-tool>
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px" row-key="id" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
@sort-change="pageOrder" v-loading="tableLoading" :size="tableSize" class="vi-table" row-key="id" style="width: 100%;margin-bottom: 20px"
class="vi-table"> v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" <el-table-column :index="indexMethod" align="center" header-align="center"
:index="indexMethod" label="序号" label="序号" type="index"
width="80px"></el-table-column> width="80px"></el-table-column>
<el-table-column <el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label" :label="column.label"
:prop="column.prop" :prop="column.prop"
:sortable="column.sortable"
:width="column.width" :width="column.width"
align="center"
header-align="center"
show-overflow-tooltip show-overflow-tooltip
:sortable="column.sortable"> v-for="column in tableColumns">
<template v-if="column.prop=='time'" scope="{row}"> <template scope="{row}" v-if="column.prop=='time'">
<span> <span v-if="row.startTime && row.endTime">
{{ moment(row.startTime).format('YYYY-MM-DD')}} - {{ moment(row.endTime).format('YYYY-MM-DD')}} {{ moment(row.startTime).format('YYYY-MM-DD')}} - {{ moment(row.endTime).format('YYYY-MM-DD')}}
</span> </span>
<span v-else>{{ '未填写' }}</span>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='time2'"> <template scope="{row}" v-else-if="column.prop=='time2'">
{{row.applyStartTime}}-{{row.applyEndTime}} {{row.applyStartTime}}-{{row.applyEndTime}}
</template> </template>
<template v-else-if="column.prop=='projectTypeName'" scope="{row}"> <template scope="{row}" v-else-if="column.prop=='projectTypeName'">
{{row.projectTypeName}}({{row.projectTypeCode}}) {{row.projectTypeName}}({{row.projectTypeCode}})
</template> </template>
<template v-else-if="column.prop=='tussueName'" scope="{row}"> <template scope="{row}" v-else-if="column.prop=='isDisabled'">
<el-switch
:active-value="true"
:inactive-value="false"
@change="(val)=>{activityStatusChange(row.id,row.isDisabled == 1?1:0)}"
active-color="#13ce66"
inactive-color="#ff4949"
v-model="row.isDisabled">
</el-switch>
</template>
<template scope="{row}" v-else-if="column.prop=='tussueName'">
<span v-if="row.type==40002">{{row.unionname?row.unionname:'暂无'}}</span> <span v-if="row.type==40002">{{row.unionname?row.unionname:'暂无'}}</span>
<span v-if="row.type==40003">{{row.clubName?row.clubName:'暂无'}}</span> <span v-if="row.type==40003">{{row.clubName?row.clubName:'暂无'}}</span>
<span v-if="row.type==40001">校工会</span> <span v-if="row.type==40001">校工会</span>
</template> </template>
<template v-else-if="column.prop=='state'" scope="{row}"> <template scope="{row}" v-else-if="column.prop=='state'">
{{row.state===1?'未审核':row.state===2?'审核不通过':'审核通过'}} <span v-if="row.state === 0" style="color: #fd835a">待提交</span>
<span v-else-if="row.state === 1" style="color: #fd835a">待校工会审核</span>
<span v-else-if="row.state === 2" style="color: #bc2a25">校工会审核拒绝</span>
<span v-else-if="row.state === 3" style="color: #0e9558">审核通过</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" <el-table-column align="center" header-align="center" label="操作"
label="操作" width="150px"> prop="userOnline" width="150px">
<template scope="{row}"> <template scope="{row}">
<el-dropdown @command="dropdownCommand"> <el-dropdown @command="dropdownCommand">
<el-button size="mini" :loading="row.loading"> <el-button :loading="row.loading" size="mini">
<i class="ti-settings"></i> <i class="ti-settings"></i>
<span class="ti-angle-down"></span> <span class="ti-angle-down"></span>
</el-button> </el-button>
@@ -122,6 +136,7 @@
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item :command="{type:'edit',row}" <el-dropdown-item :command="{type:'edit',row}"
v-if="row.state===0 || ${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
:disabled="row.projectTypeCode==50004"> :disabled="row.projectTypeCode==50004">
编辑 编辑
</el-dropdown-item> </el-dropdown-item>
@@ -133,7 +148,10 @@
通知 通知
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item :command="{type:'openCode',row}"> <el-dropdown-item :command="{type:'openCode',row}">
二维码 报名二维码
</el-dropdown-item>
<el-dropdown-item :command="{type:'openSignCode',row}">
签到二维码
</el-dropdown-item> </el-dropdown-item>
<!-- <el-dropdown-item :command="{type:'export',row}"> <!-- <el-dropdown-item :command="{type:'export',row}">
导出人员名单 导出人员名单
@@ -155,9 +173,9 @@
</template> </template>
</guava> </guava>
<send-msg ref="sendMsg" :url="url"></send-msg> <send-msg :mobile_url="mobileUrl" :url="url" ref="sendMsg"></send-msg>
<open-qr-code ref="openQRCode" :url="url"></open-qr-code> <open-qr-code :url="url" ref="openQRCode"></open-qr-code>
</div> </div>
@@ -172,6 +190,7 @@
userTabLoading: false, userTabLoading: false,
dialogVisible: false, dialogVisible: false,
url: "", url: "",
mobileUrl: "",
userData: [], userData: [],
userList: [], userList: [],
unionList: [], unionList: [],
@@ -190,6 +209,7 @@
{prop: 'time', label: '活动日期'}, {prop: 'time', label: '活动日期'},
{prop: 'time2', label: '报名日期', width: '300'}, {prop: 'time2', label: '报名日期', width: '300'},
{prop: 'applyTime', label: '创建时间', sortable: true}, {prop: 'applyTime', label: '创建时间', sortable: true},
{prop: 'isDisabled', label: '是否开启'},
{prop: 'state', label: '审核状态', sortable: true}, {prop: 'state', label: '审核状态', sortable: true},
], ],
@@ -214,10 +234,23 @@
'guava': httpVueLoader('/components/plugins/Guava.vue'), 'guava': httpVueLoader('/components/plugins/Guava.vue'),
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'), 'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
'tissue-info': httpVueLoader('/components/activity/school/tissueInfo.vue'), 'tissue-info': httpVueLoader('/components/activity/school/tissueInfo.vue'),
'send-msg': httpVueLoader('/components/plugins/SendMsgByGroupId.vue'), 'send-msg': httpVueLoader('/components/plugins/SendMsgByGroupId.vue?v=' + new Date().getTime()),
'open-qr-code': httpVueLoader('/components/plugins/OpenQRCode.vue'), 'open-qr-code': httpVueLoader('/components/plugins/OpenQRCode.vue'),
}, },
methods: { methods: {
async activityStatusChange(id, isDisabled) {
const resp = await $.get('/platform/activity/info/mange/activityStatusChange', {
id: id,
isDisabled: isDisabled
})
if (resp.code === 0) {
this.pageData();
this.notifySuccess(resp.msg)
} else {
this.notifyError(resp.msg)
}
},
dropdownCommand(command) { dropdownCommand(command) {
const {type, row} = command const {type, row} = command
if (type === 'view') { if (type === 'view') {
@@ -230,6 +263,8 @@
this.sendMsg(row) this.sendMsg(row)
} else if (type === 'openCode') { } else if (type === 'openCode') {
this.openCode(row) this.openCode(row)
} else if (type === 'openSignCode') {
this.openSignCode(row)
} else if (type === 'export') { } else if (type === 'export') {
location.href = "/platform/activity/info/mange/export?id=" + row.id location.href = "/platform/activity/info/mange/export?id=" + row.id
} }
@@ -237,9 +272,24 @@
openCode(row) { openCode(row) {
this.$refs.openQRCode.openCode("/mobile/activity/unionActivity/goReg?id=" + row.id + "&signUpMethod=" + row.signUpMethod) this.$refs.openQRCode.openCode("/mobile/activity/unionActivity/goReg?id=" + row.id + "&signUpMethod=" + row.signUpMethod)
}, },
openSignCode(row) {
this.$refs.openQRCode.openCode("/mobile/activity/myActivity/goSign?id=" + row.id)
},
sendMsg(row) { sendMsg(row) {
this.url = `<a href="` + (APP_DOMAIN + "/mobile/activity/unionActivity/goReg?id=" + row.id + "&signUpMethod=" + row.signUpMethod) + `">点击参与</a>` if (row.signUpMethod === 1 || row.signUpMethod === 3) {
this.$refs.sendMsg.openDialog(row.groupId) this.mobileUrl = "/mobile/activity/unionActivity/goReg?id=" + row.id + "&signUpMethod=" + row.signUpMethod
} else if (row.signUpMethod === 2) {
if (type === 40001) {
this.url = "/platform/activity/applyUser/school"
} else if (type === 40002) {
this.url = "/platform/activity/applyUser/union"
} else {
this.url = "/platform/activity/applyUser/club"
}
}
this.$refs.sendMsg.openDialog(row.groupId, "文化活动")
}, },
async remoteMethod(query) { async remoteMethod(query) {
if (query) { if (query) {
@@ -0,0 +1,438 @@
<div class="platform" id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">活动时间</div>
<div class="search-item-option">
<el-date-picker
placeholder="选择年"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy"
></el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">活动名称</div>
<div class="search-item-option">
<el-input clearable placeholder="请输入活动名称" v-model="pageForm.name"></el-input>
</div>
</div>
<div class="search-query">
<el-button @click="pageData" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="活动列表"></table-tool>
<el-table
:data="tableData"
:size="tableSize"
@sort-change="pageOrder"
class="vi-table"
row-key="id"
style="width: 100%; margin-bottom: 20px"
v-loading="tableLoading"
>
<el-table-column
:index="indexMethod"
align="center"
header-align="center"
label="序号"
type="index"
width="80px"
></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:width="column.width"
:sortable="column.sortable"
align="center"
header-align="center"
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='time'">
<span>{{moment(row.startTime).format('YYYY-MM-DD')}} - {{moment(row.endTime).format('YYYY-MM-DD')}}</span>
</template>
<template scope="{row}" v-else-if="column.prop=='tussueName'">
<span v-if="row.type==40002">{{row.unionname?row.unionname:'暂无'}}</span>
<span v-if="row.type==40003">{{row.clubName?row.clubName:'暂无'}}</span>
<span v-if="row.type==40001">校工会</span>
</template>
<template scope="{row}" v-else-if="column.prop=='totalApplyNum'">
<span v-if="row.userNumberLimit===1">(<span style="color: red">余{{ Number(row.totalUserNumberLimit) - Number(row.totalApplyNum) }}</span>/{{row.totalUserNumberLimit}}人)</span>
<span v-else-if="row.userNumberLimit===2">{{ row.totalApplyNum }}人</span>
<span v-else>(<span style="color: #fd835a">无名额限制</span>/已报 <span style="color: red">{{row.totalApplyNum}}</span>人)</span>
</template>
<template scope="{row}" v-else-if="column.prop=='signUpMethod'">
<span v-if="row.signUpMethod===1">个人报名</span>
<span v-else-if="row.signUpMethod===2">分工会报名</span>
<span v-else-if="row.signUpMethod===3"
style="color: #fd835a">组队报名<span style="color: black">(每组限报 <span style="color: red">{{row.teamNum}}</span> 人)</span></span>
<span v-else-if="!row.signUpMethod">无需报名</span>
</template>
<template scope="{row}" v-else-if="column.prop=='countUser'">
<el-tag type="success" v-if="row.countUser>0">已报名({{row.countUser}}</el-tag>
<el-tag type="danger" v-else>未报名</el-tag>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" prop="userOnline" width="250px">
<template scope="{row}">
<el-button :loading="row.loading" @click="openView(row)" size="mini" type="primary">查看</el-button>
<template
v-if="moment(row.applyStartTime).valueOf()<moment().valueOf()&&moment(row.applyEndTime).valueOf()>moment().valueOf()"
>
<el-button :loading="row.loading" @click="openAudit(row)" size="mini" type="primary" v-if="row.signUpMethod === 2">
报名
</el-button>
<el-button :loading="row.loading" @click="openAudit(row)" size="mini" type="primary" v-if="row.signUpMethod === 3">
{{ row.countUser > 0 ? '修改' : '报名' }}
</el-button>
<el-button
:loading="row.loading"
@click="doAdd(row)"
size="mini"
type="primary"
v-if="row.signUpMethod === 1&&row.countUser===0"
>
报名
</el-button>
<el-button
:loading="row.loading"
@click="doDelete(row)"
size="mini"
type="danger"
v-if="row.countUser>0"
>
取消报名
</el-button>
</template>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<el-card shadow="never">
<el-transfer
:data="leftData"
:filter-method="filterMethod"
:props="{key: 'id',label: 'name'}"
:titles="['可报人员名单', '当前选择']"
filterable
ref="transfer"
v-loading="tableLoading"
v-model="rightData"
>
<template #left-footer>
<div></div>
</template>
</el-transfer>
</el-card>
<el-card class="mt10" shadow="never">
<el-table :data="escalationTableData" max-height="500px">
<el-table-column align="center" header-align="center" label="序号" type="index" width="100"></el-table-column>
<el-table-column align="center" header-align="center" label="姓名" prop="username"></el-table-column>
<el-table-column align="center" header-align="center" label="教工号" prop="loginname"></el-table-column>
<el-table-column align="center" header-align="center" label="单位" prop="unitname" sortable></el-table-column>
<!--<el-table-column align="center" header-align="center" label="操作" sortable>
<template scope="{$index,row}">
<el-button @click="rightData.splice($index,1)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>-->
</el-table>
</el-card>
<el-row class="mt10 text-right">
<el-button @click="doBatchAdd" class="mt10" type="primary" v-loading="submitLoading">提交</el-button>
</el-row>
</template>
<template #view>
<tissue-info ref="info"></tissue-info>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: "#app",
mixins: [initTableMixins],
data() {
return {
submitLoading: false,
pageForm: {
type: type,
year: new Date().getFullYear() + ""
},
tableColumns: [
{ prop: "name", label: "活动名称" },
{ prop: "address", label: "活动地点" },
{ prop: "projectTypeName", label: "活动项目类型" },
{ prop: "tussueName", label: "举办单位" },
{ prop: "time", label: "活动日期" },
{ prop: "totalApplyNum", label: "已报名人数", width: 160 },
{ prop: "signUpMethod", label: "报名方式", sortable: true, width: 200 },
{ prop: "countUser", label: "我的报名", sortable: true }
],
leftData: [],
rightData: [],
rowData: {}
}
},
components: {
"tissue-info": httpVueLoader("/components/activity/school/tissueInfo.vue?v=" + new Date().getTime())
},
computed: {
escalationTableData() {
return this.leftData.filter((v) => this.rightData.includes(v.id))
}
},
methods: {
openView(row) {
const { id } = row
this.$refs.info.getInfo(id)
this.$refs.guava.view()
},
async doBatchAdd() {
if (this.rightData && this.rightData.length > this.rowData.teamNum && this.rowData.signUpMethod === 3) {
this.$message.error("该模式组队限制人数为" + this.rowData.teamNum + "人!")
return
}
this.submitLoading = true
const { code, msg } = await $.get("/mobile/activity/unionActivity/doSaveUnionRegister", {
activityId: this.tissueId,
personIds: JSON.stringify(this.rightData)
})
if (code === 0) {
this.$message.success(msg)
this.doSearch()
this.$refs.guava.index()
} else {
this.$message.warning(msg)
}
this.submitLoading = false
},
async doDelete(row) {
const confirm = await this.$confirm("确认要取消报名吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
row.loading = true
const { code, msg } = await $.get("/mobile/activity/unionActivity/doSingleCancelRegister", {
activityId: row.id
})
if (code === 0) {
this.$message.success(msg)
this.doSearch()
this.$refs.guava.index()
} else {
this.$message.warning(msg)
}
row.loading = false
}
},
async doAdd(row) {
const confirm = await this.$confirm("确认要报名吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
row.loading = true
const { code, msg } = await $.get("/mobile/activity/unionActivity/doSingleRegister", {
activityId: row.id
})
if (code === 0) {
this.$message.success(msg)
this.doSearch()
this.$refs.guava.index()
} else {
this.$message.warning(msg)
}
row.loading = false
}
},
async openAudit(row) {
this.rowData = row
this.tissueId = row.id
const flag = await getScopeUser(row.groupId)
if (!flag) {
this.$message.warning("您没有报名权限!")
return
}
this.tableLoading = true
this.$refs.guava.edit()
const { data } = await $.get("/platform/activity/applyUser/selfUnionUsers", {
groupId: row.groupId,
tissueId: row.id
})
this.leftData = data
const { data: rightData } = await $.get("/platform/activity/applyUser/getReportedUser", {
tissueId: row.id
})
debugger
this.leftData = data.map((user) => {
return this.getTransProp(user, row.signUpMethod)
})
// this.rightData = rightData.map((user) => {
// return this.getTransProp(user)
// })
this.rightData = rightData
//如果是组队报名,默认添加自己
if (rightData && rightData.length === 0 && row.signUpMethod === 3) {
rightData.push("${@shiro.getPrincipalProperty('id')}")
}
this.tableLoading = false
},
getTransProp(user, signUpMethod) {
return {
id: user.id,
username: user.username,
loginname: user.loginname,
sex: user.sex,
unionname: user.unionname,
unitname: user.unitname,
userState: user.userState,
name: user.username + "-" + user.loginname + "-" + user.unitname,
//如果是组队报名,并且userId等于当前登入人禁用选项
disabled: signUpMethod === 3 && user.id === "${@shiro.getPrincipalProperty('id')}" ? true : false
}
},
filterMethod(query, item) {
if (!query) {
return -1
}
return item.name.indexOf(query) > -1
},
pageData() {
sublime.showLoadingbar()
this.tableLoading = true
$.post(
"/platform/activity/applyUser/pageData",
this.pageForm,
(data) => {
sublime.closeLoadingbar()
this.tableLoading = false
if (data.code === 0) {
this.tableData = data.data.list
this.pageForm.totalCount = data.data.totalCount
} else {
this.$message.error(data.msg)
}
},
"json"
)
}
},
async created() {
this.pageData()
}
})
</script>
<style>
.flexible-gifts {
display: flex;
flex-direction: column;
}
.flexible-gifts-item {
display: flex;
}
.flexible-gifts-item:not(:first-of-type) {
margin-top: 15px;
}
.flexible-gifts-item-input {
width: calc(100% - 144px);
}
.flexible-gifts-item-radio {
width: 100px;
text-align: center;
}
.flexible-gifts-item-delete {
width: 44px;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
.el-transfer-panel {
text-align: left;
width: calc(50% - 91px);
height: 53vh;
}
.el-transfer-panel__list.is-filterable {
height: calc(50vh - 110px);
}
.transfer {
display: flex;
height: 100%;
width: 100%;
align-items: center;
padding: 0 10px;
}
.transfer .el-checkbox {
display: inline-block !important;
margin: 0 10px !important;
}
</style>
@@ -1,4 +1,4 @@
<div id="app" class="platform" v-cloak> <div class="platform" id="app" v-cloak>
<guava ref="guava"> <guava ref="guava">
<template> <template>
@@ -9,11 +9,11 @@
<div class="search-item-option"> <div class="search-item-option">
<el-date-picker <el-date-picker
@change="getActivityByYearOrType" @change="getActivityByYearOrType"
placeholder="选择年"
style="width: 100%" style="width: 100%"
v-model="pageForm.year"
value-format="yyyy"
type="year" type="year"
placeholder="选择年"> v-model="pageForm.year"
value-format="yyyy">
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
@@ -21,13 +21,13 @@
<div class="search-item"> <div class="search-item">
<div class="search-item-label">活动名称</div> <div class="search-item-label">活动名称</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select v-model="pageForm.activityId" placeholder="请选择活动" filterable <el-select filterable placeholder="请选择活动" style="width: 100%"
style="width: 100%"> v-model="pageForm.activityId">
<el-option <el-option
v-for="item in activityList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id"
v-for="item in activityList">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
@@ -36,14 +36,14 @@
<div class="search-item" v-if="type==40002||type==40001"> <div class="search-item" v-if="type==40002||type==40001">
<div class="search-item-label">工会名称</div> <div class="search-item-label">工会名称</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select v-model="pageForm.unionId" placeholder="请选择工会" filterable <el-select clearable filterable placeholder="请选择工会"
clearable style="width: 100%"
style="width: 100%"> v-model="pageForm.unionId">
<el-option <el-option
v-for="item in unionList"
:key="item.id" :key="item.id"
:label="item.unionname" :label="item.unionname"
:value="item.id"> :value="item.id"
v-for="item in unionList">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
@@ -52,12 +52,12 @@
<div class="search-item"> <div class="search-item">
<div class="search-item-label">姓名/工号</div> <div class="search-item-label">姓名/工号</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input placeholder="请输入姓名/工号" clearable <el-input @keyup.enter.native="doSearch" clearable
v-model="pageForm.searchKeyword" placeholder="请输入姓名/工号"
@keyup.enter.native="doSearch"> v-model="pageForm.searchKeyword">
<el-select v-model="pageForm.searchName" slot="prepend" <el-select placeholder="姓名/工号" slot="prepend"
placeholder="姓名/工号" style="width: 80px;"
style="width: 80px;"> v-model="pageForm.searchName">
<el-option label="姓名" value="u.username"></el-option> <el-option label="姓名" value="u.username"></el-option>
<el-option label="工号" value="u.loginanme"></el-option> <el-option label="工号" value="u.loginanme"></el-option>
</el-select> </el-select>
@@ -66,36 +66,44 @@
</div> </div>
<div class="search-query"> <div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="pageData">搜索 <el-button @click="pageData" icon="el-icon-search" type="primary">搜索
</el-button> </el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
<el-card shadow="never" class="mt10"> <el-card class="mt10" shadow="never">
<table-tool label="人员列表" :app="this"> <table-tool :app="this" label="人员列表">
<template #func> <template #func>
<el-button icon="el-icon-s-promotion" type="primary" @click="doExport">导出 <el-button @click="doExport" icon="el-icon-s-promotion" type="primary" size="small">导出</el-button>
</el-button>
</template> </template>
</table-tool> </table-tool>
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px" row-key="id" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
@sort-change="pageOrder" v-loading="tableLoading" :size="tableSize" class="vi-table" row-key="id" style="width: 100%;margin-bottom: 20px"
class="vi-table"> v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" <el-table-column :index="indexMethod" align="center" header-align="center"
:index="indexMethod" label="序号" label="序号" type="index"
width="80px"></el-table-column> width="80px"></el-table-column>
<el-table-column <el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label" :label="column.label"
:prop="column.prop" :prop="column.prop"
sortable> align="center"
header-align="center"
sortable
v-for="column in tableColumns">
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
v-if="${@shiro.hasRole('sysadmin')}"
width="100">
<template scope="{row}">
<el-button @click="doDelete(row)" size="mini" type="danger">
删除
</el-button>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--#include("/layouts/pagination.html"){}#--> <!--#include("/layouts/pagination.html"){}#-->
@@ -133,6 +141,22 @@
} }
}, },
methods: { methods: {
doDelete(row) {
this.$confirm('您确认要取消报名吗?', '提示', {type: 'warning'}).then(async () => {
const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {
activityId: this.pageForm.activityId,
applyUserId: row.applyUserId,
id: row.atpId
})
if (resp.code === 0) {
this.doSearch()
this.$refs.guava.index()
this.notifySuccess(resp.msg)
} else {
this.notifyError(resp.msg)
}
})
},
async doExport() { async doExport() {
const {activityId, unionId} = this.pageForm const {activityId, unionId} = this.pageForm
window.open("/platform/activity/info/mange/doExportUser?id=" + activityId + window.open("/platform/activity/info/mange/doExportUser?id=" + activityId +
@@ -0,0 +1,12 @@
<!--#
layout("/layouts/platform.html"){
#-->
<script>
window.type = 40001
</script>
<!--#include("/platform/activity/union/layoutApplyUser.html"){}#-->
<!--#
}
#-->
@@ -0,0 +1,12 @@
<!--#
layout("/layouts/platform.html"){
#-->
<script>
window.type = 40002
</script>
<!--#include("/platform/activity/union/layoutApplyUser.html"){}#-->
<!--#
}
#-->
@@ -29,7 +29,7 @@
<!-- v-for="(item, key) in userSignInfo">--> <!-- v-for="(item, key) in userSignInfo">-->
<!-- <el-table :data="item">--> <!-- <el-table :data="item">-->
<!-- <el-table-column label="姓名" prop="username"></el-table-column>--> <!-- <el-table-column label="姓名" prop="username"></el-table-column>-->
<!-- <el-table-column label="一卡通号" prop="loginname"></el-table-column>--> <!-- <el-table-column label="号" prop="loginname"></el-table-column>-->
<!-- <el-table-column label="是否签到" prop="isAttend"></el-table-column>--> <!-- <el-table-column label="是否签到" prop="isAttend"></el-table-column>-->
<!-- <el-table-column label="签到时间" prop="attendTime"></el-table-column>--> <!-- <el-table-column label="签到时间" prop="attendTime"></el-table-column>-->
<!-- </el-table>--> <!-- </el-table>-->
@@ -41,7 +41,7 @@
<span slot="label"><i class="el-icon-date"></i> {{key}}</span> <span slot="label"><i class="el-icon-date"></i> {{key}}</span>
<el-table :data="item" style="max-height: 600px; overflow-y: auto"> <el-table :data="item" style="max-height: 600px; overflow-y: auto">
<el-table-column label="姓名" prop="username"></el-table-column> <el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="一卡通号" prop="loginname"></el-table-column> <el-table-column label="号" prop="loginname"></el-table-column>
<el-table-column label="是否签到" prop="isAttend"> <el-table-column label="是否签到" prop="isAttend">
<template scope="{row}"> <template scope="{row}">
<template v-if="Date.now() < Date.parse(row.courseStartTime)"> <template v-if="Date.now() < Date.parse(row.courseStartTime)">