Merge remote-tracking branch 'origin/main'

This commit is contained in:
@jyuhsin
2025-09-05 15:11:06 +08:00
66 changed files with 2875 additions and 1644 deletions
@@ -0,0 +1,13 @@
package com.budwk.app.base.event.role;
/**
* @version 1.0
* @Author zzr
* @nameRoleEventListener
* @Date 2025/9/3 17:13
* @注释
*/
public interface RoleEventListener {
void receive(RoleEventMsg message);
}
@@ -0,0 +1,67 @@
package com.budwk.app.base.event.role;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @version 1.0
* @Author zzr
* @nameRoleEventMsg
* @Date 2025/9/3 17:14
* @注释
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RoleEventMsg {
/**
* 用户id
*/
private List<String> userIds;
/**
* 角色code
*/
private String roleCode;
/**
* 单位id
*/
private String unitId;
/**
* 操作类型
*/
private Integer operationType;
/**
* 添加角色
*/
public static final int ADD_ROLE = 1;
/**
* 删除角色
*/
public static final int REMOVE_ROLE = 2;
/**
* 更新角色
*/
public static final int RENEW_ROLE = 3;
public RoleEventMsg(String unitId, String roleCode, Integer operationType){
this.unitId = unitId;
this.operationType = operationType;
}
public RoleEventMsg(List<String> userIds, String roleCode, Integer operationType){
this.userIds = userIds;
this.roleCode = roleCode;
this.operationType = operationType;
}
}
@@ -0,0 +1,21 @@
package com.budwk.app.base.event.role;
import org.nutz.mvc.Mvcs;
/**
* @version 1.0
* @Author zzr
* @nameRoleEventPublisher
* @Date 2025/9/3 17:14
* @注释
*/
public class RoleEventPublisher {
public static void broadcast(RoleEventMsg event){
String[] names = Mvcs.getIoc().getNamesByType(RoleEventListener.class);
for (String name : names) {
RoleEventListener listener = Mvcs.getIoc().get(RoleEventListener.class, name);
listener.receive(event);
}
}
}
@@ -19,8 +19,10 @@ import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.FieldFilter;
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.Daos;
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.Lang;
@@ -29,6 +31,7 @@ import org.nutz.lang.util.NutMap;
import org.nutz.log.Log; import org.nutz.log.Log;
import org.nutz.log.Logs; import org.nutz.log.Logs;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.GET;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
@@ -490,4 +493,15 @@ public class SysRoleController {
return Result.success(); return Result.success();
} }
@At
@Ok("json:full")
@GET
@SaCheckLogin
public Result getMenuOptions() {
FieldFilter fieldFilter = FieldFilter.create(Sys_menu.class, "^id|name$");
Cnd cnd = Cnd.where("disabled", "=", 0);
cnd.and(Cnd.exps("parentId", "is", null).or("parentId", "=", ""));
return Result.success(Daos.ext(sysRoleService.dao(), fieldFilter).query(Sys_menu.class, cnd));
}
} }
@@ -0,0 +1,108 @@
package com.budwk.app.sys.listener;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.event.role.RoleEventListener;
import com.budwk.app.base.event.role.RoleEventMsg;
import com.budwk.app.sys.models.Sys_role;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.sys.models.Sys_user_role;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import java.util.List;
/**
* @version 1.0
* @Author zzr
* @nameSysRoleEventListener
* @Date 2025/9/3 17:35
* @注释
*/
@IocBean
public class SysRoleEventListener implements RoleEventListener {
@Inject
private Dao dao;
@Override
@Aop(TransAop.READ_COMMITTED)
public void receive(RoleEventMsg message) {
if (ObjectUtil.isAllEmpty(message.getUserIds(), message.getUnitId(), message.getRoleCode())) {
return;
}
switch (message.getOperationType()) {
case RoleEventMsg.ADD_ROLE -> {
addRole(message);
}
case RoleEventMsg.REMOVE_ROLE -> {
removeRole(message);
}
case RoleEventMsg.RENEW_ROLE -> {
removeRole(message);
addRole(message);
}
}
}
/**
* 添加角色
* @param message 订阅消息
*/
private void addRole(RoleEventMsg message) {
Sys_role role = dao.fetch(Sys_role.class, Cnd.where("code", "=", message.getRoleCode()));
if (ObjectUtil.isAllNotEmpty(message.getUserIds(), message.getRoleCode())) {
List<Sys_user_role> roleList = message.getUserIds().stream().map(item -> {
Sys_user_role userRole = new Sys_user_role();
userRole.setUserId(item);
userRole.setUnitId(StrUtil.isNotBlank(message.getUnitId()) ? message.getUnitId() : null);
userRole.setRoleId(role.getId());
return userRole;
}).toList();
dao.insert(roleList);
} else if (ObjectUtil.isAllNotEmpty(message.getUnitId(), message.getRoleCode())) {
List<Sys_user> userList = dao.query(Sys_user.class, Cnd.where("unitId", "=", message.getUnitId()));
List<Sys_user_role> roleList = userList.stream().map(item -> {
Sys_user_role userRole = new Sys_user_role();
userRole.setUserId(item.getId());
userRole.setUnitId(item.getUnitId());
userRole.setRoleId(role.getId());
return userRole;
}).toList();
dao.insert(roleList);
}
}
/**
* 删除角色
* @param message 订阅消息
*/
private void removeRole(RoleEventMsg message) {
// 判断传过来的东西
if (ObjectUtil.isAllNotEmpty(message.getUserIds(), message.getUnitId(), message.getRoleCode())) {
dao.clear(Sys_user_role.class,
Cnd.where("userId", "in", message.getUserIds())
.and("unitId", "=", message.getUnitId())
.and("roleCode", "=", message.getRoleCode())
);
} else if (ObjectUtil.isAllNotEmpty(message.getUserIds(), message.getRoleCode())) {
dao.clear(Sys_user_role.class,
Cnd.where("userId", "in", message.getUserIds())
.and("roleCode", "=", message.getRoleCode())
);
} else if (ObjectUtil.isAllNotEmpty(message.getUnitId(), message.getUnitId())) {
dao.clear(Sys_user_role.class,
Cnd.where("unitId", "in", message.getUnitId())
.and("roleCode", "=", message.getRoleCode())
);
}
}
}
@@ -7,6 +7,8 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HtmlUtil; import cn.hutool.http.HtmlUtil;
import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.event.role.RoleEventMsg;
import com.budwk.app.base.event.role.RoleEventPublisher;
import com.budwk.app.base.utils.ConditionGroupUtil; import com.budwk.app.base.utils.ConditionGroupUtil;
import com.budwk.app.base.utils.PwdUtil; import com.budwk.app.base.utils.PwdUtil;
import com.budwk.app.sys.annotation.DataCenterColumn; import com.budwk.app.sys.annotation.DataCenterColumn;
@@ -16,6 +18,7 @@ import com.budwk.app.sys.services.SysDataUserUpdateService;
import com.budwk.app.sys.services.SysDictService; import com.budwk.app.sys.services.SysDictService;
import com.budwk.app.sys.services.SysRoleService; import com.budwk.app.sys.services.SysRoleService;
import com.budwk.app.sys.services.SysUserService; import com.budwk.app.sys.services.SysUserService;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalConfig;
import com.budwk.app.zhgh.staffmanage.member.constant.MemberChangeOrigin; import com.budwk.app.zhgh.staffmanage.member.constant.MemberChangeOrigin;
import com.budwk.app.zhgh.staffmanage.member.constant.MemberChangeType; import com.budwk.app.zhgh.staffmanage.member.constant.MemberChangeType;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -161,9 +164,9 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
Map<String, Sys_user> userMap = sysUsers.stream().collect(Collectors.toMap(Sys_user::getLoginname, sysUser -> sysUser)); Map<String, Sys_user> userMap = sysUsers.stream().collect(Collectors.toMap(Sys_user::getLoginname, sysUser -> sysUser));
// 准备数据集合 // 准备数据集合
List<Sys_user> needDoUpdateList = new ArrayList<>(); List<Sys_user> needDoUpdateList = new CopyOnWriteArrayList<>();
List<Sys_user> needInitUserList = new ArrayList<>(); List<Sys_user> needInitUserList = new CopyOnWriteArrayList<>();
List<Sys_user_history> histories = new ArrayList<>(); List<Sys_user_history> histories = new CopyOnWriteArrayList<>();
List<String> addMemberUserIds = Collections.synchronizedList(new ArrayList<>()); List<String> addMemberUserIds = Collections.synchronizedList(new ArrayList<>());
List<String> removeMemberUserIds = Collections.synchronizedList(new ArrayList<>()); List<String> removeMemberUserIds = Collections.synchronizedList(new ArrayList<>());
@@ -380,6 +383,13 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
}); });
} }
// 6. 处理其他任务
// 6.1 更新提案的校领导角色,发送订阅
ProposalConfig config = dao.fetch(ProposalConfig.class, Cnd.where("delFlag", "=", false).desc("updatedAt"));
for (String unitId : config.getSchoolLeaderUnitIds()) {
RoleEventPublisher.broadcast(new RoleEventMsg(unitId, RoleConstant.PROPOSAL_BRANCH_SCHOOL_LEADER.name(), RoleEventMsg.RENEW_ROLE));
}
long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();
log.info("全量更新用户数据完成,耗时: {} 毫秒", (endTime - startTime)); log.info("全量更新用户数据完成,耗时: {} 毫秒", (endTime - startTime));
@@ -5,38 +5,52 @@ 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.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.excel.EasyExcel;
import com.budwk.app.base.annotation.SLog; import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination; import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService; import com.budwk.app.base.service.BaseService;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.base.utils.EasyExcelUtil;
import com.budwk.app.sys.models.Sys_role; import com.budwk.app.sys.models.Sys_role;
import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope; import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
import com.budwk.app.zhgh.activity.basic.param.ActivityUserScopePageParam; import com.budwk.app.zhgh.activity.basic.param.ActivityUserScopePageParam;
import com.budwk.app.zhgh.activity.basic.service.ActivityBasicScopeService; import com.budwk.app.zhgh.activity.basic.service.ActivityBasicScopeService;
import com.budwk.app.zhgh.activity.basic.template.UserTemp;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
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.Static; import org.nutz.dao.util.cri.Static;
import org.nutz.integration.jedis.RedisService;
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.AdaptBy;
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.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
@@ -59,6 +73,9 @@ public class ActivityBasicScopeController {
@Inject @Inject
private Dao dao; private Dao dao;
@Inject
private RedisService redisService;
@At("") @At("")
@Ok("beetl:platform/zhgh/activity/basic/userScope/index.html") @Ok("beetl:platform/zhgh/activity/basic/userScope/index.html")
@SaCheckPermission("activity.basic.scope") @SaCheckPermission("activity.basic.scope")
@@ -90,6 +107,7 @@ public class ActivityBasicScopeController {
FROM FROM
`vw_user` u `vw_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
$condition $condition
"""); """);
try { try {
@@ -201,8 +219,8 @@ public class ActivityBasicScopeController {
} }
@At @At
public Object getRoleListByMenuId(String menuId) { public Object getRoleListByMenuId() {
return Result.success(dao.query(Sys_role.class, Cnd.where("system_name", "=", menuId).desc("code"))); return Result.success(dao.query(Sys_role.class, Cnd.NEW().desc("code")));
} }
@@ -275,6 +293,7 @@ public class ActivityBasicScopeController {
FROM FROM
`vw_user` u `vw_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
$condition $condition
"""); """);
@@ -342,6 +361,11 @@ public class ActivityBasicScopeController {
} }
if (StrUtil.isNotBlank(activityUserScopePageParam.getExistsLoginNameRedisKey())) {
List<String> loginNames = redisService.lrange(activityUserScopePageParam.getExistsLoginNameRedisKey(), 0, -1);
cnd.andEX("u.loginname", "in", loginNames);
}
try { try {
@@ -350,8 +374,8 @@ public class ActivityBasicScopeController {
cnd.andEX("u.personType", IN_OR_NIN_OP, activityUserScopePageParam.getPersonTypes()); cnd.andEX("u.personType", IN_OR_NIN_OP, activityUserScopePageParam.getPersonTypes());
cnd.andEX("u.userState", IN_OR_NIN_OP, activityUserScopePageParam.getUserStates()); cnd.andEX("u.userState", IN_OR_NIN_OP, activityUserScopePageParam.getUserStates());
cnd.andEX("u.sex", IN_OR_NIN_OP, activityUserScopePageParam.getSexTypes()); cnd.andEX("u.sex", IN_OR_NIN_OP, activityUserScopePageParam.getSexTypes());
cnd.andEX("sur.jdhid", EQ_OR_NEQ_OP, activityUserScopePageParam.getTeacherMeetingId()); cnd.andEX("sur.tcSessionId", EQ_OR_NEQ_OP, activityUserScopePageParam.getSessionId());
cnd.andEX("sur.roleid", IN_OR_NIN_OP, activityUserScopePageParam.getRoleIds()); cnd.andEX("sur.roleId", IN_OR_NIN_OP, activityUserScopePageParam.getRoleIds());
cnd.andEX("clubuser.clubid", EQ_OR_NEQ_OP, activityUserScopePageParam.getClubId()); cnd.andEX("clubuser.clubid", EQ_OR_NEQ_OP, activityUserScopePageParam.getClubId());
} catch (Exception e) { } catch (Exception e) {
@@ -362,4 +386,82 @@ public class ActivityBasicScopeController {
} }
@At
@Ok("void")
@ApiOperation("下载导入人员模板")
@SaCheckPermission("activity.basic.user")
public void downloadImport(HttpServletResponse response) {
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();) {
EasyExcel.write(byteArrayOutputStream, UserTemp.class)
.sheet("福利名单导入模版")
.doWrite(ArrayList::new);
CommonDownloadUtil.download("人员导入模板.xlsx", byteArrayOutputStream.toByteArray(), response);
} catch (Exception e) {
e.printStackTrace();
}
}
@At
@SaCheckPermission("activity.basic.user")
@ApiOperation("导入人员核对名单")
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Result doImport(TempFile file) {
String matchUserLoginNamesKey = "ActivityBasicScopeController.doImport.time=" + System.currentTimeMillis();
List<T> ts = EasyExcelUtil.syncReadModel(file.getFile(), UserTemp.class, 0, 1);
List<UserTemp> userImportList = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(UserTemp.class);
//判断人员哪些存在哪些不存在
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.setErrorInfo("系统查不到此人");
}
}
//匹配不到的用户
List<UserTemp> errorExcelTempUsers = userImportList.stream().filter(v -> StrUtil.isNotBlank(v.getErrorInfo())).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 NutMap.NEW().addv("工号", v.getLoginName()).addv("姓名", v.getUserName()).addv("错误原因", v.getErrorInfo());
}).collect(Collectors.toList()));
nutMap.setv("existsLoginNameRedisKey", matchUserLoginNamesKey);
//保存存在的工号
if (Lang.isNotEmpty(existsLoginNames)) {
redisService.lpush(matchUserLoginNamesKey, existsLoginNames.toArray(new String[0]));
redisService.expire(matchUserLoginNamesKey, 60 * 3);
}
return Result.success(nutMap);
}
@At
@SaCheckPermission("activity.basic.user")
@ApiOperation("清空查询条件")
public Result clearSearchCnd(String existsLoginNameRedisKey) {
if (StrUtil.isNotBlank(existsLoginNameRedisKey)) {
redisService.del(existsLoginNameRedisKey);
}
return Result.success();
}
} }
@@ -2,26 +2,43 @@ package com.budwk.app.zhgh.activity.basic.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.annotation.SLog; import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination; import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm; import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService; import com.budwk.app.base.service.BaseService;
import com.budwk.app.base.utils.EasyExcelUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope; import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
import com.budwk.app.zhgh.activity.basic.template.UserTemp;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.formula.functions.T;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
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.Static; import org.nutz.dao.util.cri.Static;
import org.nutz.integration.jedis.RedisService;
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;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.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.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* @ClassName ActivityBasicScopeUserDataController * @ClassName ActivityBasicScopeUserDataController
@@ -37,6 +54,9 @@ public class ActivityBasicScopeUserDataController {
@Inject @Inject
private BaseService baseService; private BaseService baseService;
@Inject
private RedisService redisService;
@At("") @At("")
@Ok("beetl:platform/zhgh/activity/basic/userScopeData/index.html") @Ok("beetl:platform/zhgh/activity/basic/userScopeData/index.html")
@SaCheckPermission("activity.basic.user") @SaCheckPermission("activity.basic.user")
@@ -51,29 +71,8 @@ public class ActivityBasicScopeUserDataController {
@Param(value = "unitId") String unitId, @Param(value = "unitId") String unitId,
@Param(value = "personType") String personType, @Param(value = "personType") String personType,
@Param(value = "userState") String userState, @Param(value = "userState") String userState,
@Param(value = "groupId") Integer groupId) { @Param(value = "groupId") Integer groupId,
/* Sql sql = Sqls.create(""" @Param(value = "existsLoginNameRedisKey") String existsLoginNameRedisKey) {
SELECT
aus.id,
u.username AS userName,
u.loginname AS loginName,
u.sex,
u.birthday,
u.mobile,
u.personType,
u.userState,
u.unitname AS unitName,
u.unionname AS unionName,
aus.groupId,
aus.groupName,
actun.unionname AS activityUnionName
FROM
activity_user_scope aus
LEFT JOIN `vw_user` u ON u.id = aus.userId
LEFT JOIN activity_basic_unit actit ON actit.id=u.unitid
LEFT JOIN activity_basic_union actun ON actit.unionid=actun.id
$condition
""");*/
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
aus.id, aus.id,
@@ -107,9 +106,13 @@ public class ActivityBasicScopeUserDataController {
cnd.andEX("u.personType", "=", personType); cnd.andEX("u.personType", "=", personType);
cnd.andEX("u.userState", "=", userState); cnd.andEX("u.userState", "=", userState);
if (!StpUtil.hasRole(RoleConstant.SYSADMIN.name()) && if (!StpUtil.hasRole(RoleConstant.SYSADMIN.name()) &&
!StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) { !StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) {
cnd.and("aus.creator", "=", SecurityUtil.getUserId()); cnd.and("aus.creator", "=", SecurityUtil.getUserId());
} }
if (StrUtil.isNotBlank(existsLoginNameRedisKey)) {
List<String> loginNames = redisService.lrange(existsLoginNameRedisKey, 0, -1);
cnd.andEX("u.loginname", "in", loginNames);
}
sql.setCondition(cnd); sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
@@ -134,7 +137,17 @@ public class ActivityBasicScopeUserDataController {
@Param(value = "unionId") String unionId, @Param(value = "unionId") String unionId,
@Param(value = "unitId") String unitId, @Param(value = "unitId") String unitId,
@Param(value = "personType") String personType, @Param(value = "personType") String personType,
@Param(value = "userState") String userState) { @Param(value = "userState") String userState,
@Param(value = "existsLoginNameRedisKey") String existsLoginNameRedisKey) {
List<String> existsLoginNames = new ArrayList<>();
if(StrUtil.isNotBlank(existsLoginNameRedisKey) && redisService.exists(existsLoginNameRedisKey)){
existsLoginNames = redisService.lrange(existsLoginNameRedisKey, 0, -1);
if (StrUtil.isNotBlank(existsLoginNameRedisKey)) {
redisService.del(existsLoginNameRedisKey);
}
}
Sql sql = Sqls.create("select id from `vw_user` u $condition"); Sql sql = Sqls.create("select id from `vw_user` u $condition");
Cnd userCnd = Cnd.NEW(); Cnd userCnd = Cnd.NEW();
if (StrUtil.isNotBlank(searchName) && StrUtil.isNotBlank(searchKeyword)) { if (StrUtil.isNotBlank(searchName) && StrUtil.isNotBlank(searchKeyword)) {
@@ -145,12 +158,13 @@ public class ActivityBasicScopeUserDataController {
userCnd.andEX("u.personType", "=", personType); userCnd.andEX("u.personType", "=", personType);
userCnd.andEX("u.userState", "=", userState); userCnd.andEX("u.userState", "=", userState);
userCnd.andEX("u.id", "=", id); userCnd.andEX("u.id", "=", id);
userCnd.andEX("u.loginname","in",existsLoginNames);
sql.setCondition(userCnd); sql.setCondition(userCnd);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("groupId", "=", groupId); cnd.and("groupId", "=", groupId);
if (!StpUtil.hasRole(RoleConstant.SYSADMIN.name()) && if (!StpUtil.hasRole(RoleConstant.SYSADMIN.name()) &&
!StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) { !StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) {
cnd.and("creator", "=", SecurityUtil.getUserId()); cnd.and("creator", "=", SecurityUtil.getUserId());
} }
if (StrUtil.isNotBlank(id)) { if (StrUtil.isNotBlank(id)) {
@@ -163,5 +177,56 @@ public class ActivityBasicScopeUserDataController {
return Result.success(); return Result.success();
} }
@At
@SaCheckPermission("activity.basic.user")
@ApiOperation("导入人员核对名单")
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Result doImport(@Valid String groupId, TempFile file) {
String matchUserLoginNamesKey = "ActivityBasicUserController.doImport.groupId=" + groupId + "time=" + System.currentTimeMillis();
List<T> ts = EasyExcelUtil.syncReadModel(file.getFile(), UserTemp.class, 0, 1);
List<UserTemp> userImportList = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(UserTemp.class);
//判断人员哪些存在哪些不存在
Sql sql = Sqls.queryString("""
SELECT
u.loginname
FROM
activity_user_scope aus
LEFT JOIN sys_user u ON u.id = aus.userId
WHERE
aus.groupId = @groupId
""").setParam("groupId", groupId);
baseService.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.setErrorInfo("系统查不到此人");
}
}
//匹配不到的用户
List<UserTemp> errorExcelTempUsers = userImportList.stream().filter(v -> StrUtil.isNotBlank(v.getErrorInfo())).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 NutMap.NEW().addv("工号", v.getLoginName()).addv("姓名", v.getUserName()).addv("错误原因", v.getErrorInfo());
}).collect(Collectors.toList()));
nutMap.setv("existsLoginNameRedisKey", matchUserLoginNamesKey);
//保存存在的工号
if (Lang.isNotEmpty(existsLoginNames)) {
redisService.lpush(matchUserLoginNamesKey, existsLoginNames.toArray(new String[0]));
redisService.expire(matchUserLoginNamesKey, 60 * 3);
}
return Result.success(nutMap);
}
} }
@@ -33,7 +33,7 @@ public class ActivityUserScopePageParam extends PageForm {
private Integer setGroupId; private Integer setGroupId;
private String setGroupName; private String setGroupName;
// 教师会议id // 教师会议id
private String teacherMeetingId; private String sessionId;
// 角色id // 角色id
private String[] roleIds; private String[] roleIds;
// 用户id // 用户id
@@ -46,4 +46,6 @@ public class ActivityUserScopePageParam extends PageForm {
private String props; private String props;
private String existsLoginNameRedisKey;
} }
@@ -0,0 +1,27 @@
package com.budwk.app.zhgh.activity.basic.template;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode
@ContentRowHeight(20) // 内容行高
@HeadRowHeight(20) // 表头行高
@ColumnWidth(25)
public class UserTemp {
@ExcelProperty("工号")
private String loginName;
@ExcelProperty("姓名")
private String userName;
@ExcelIgnore
private String errorInfo;
}
@@ -1,10 +1,20 @@
package com.budwk.app.zhgh.activity.culture.controller; package com.budwk.app.zhgh.activity.culture.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode; import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog; import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.flow.constant.FlowConst;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
import com.budwk.app.flow.service.FlowCommonService;
import com.budwk.app.sys.models.Sys_user_role; import com.budwk.app.sys.models.Sys_user_role;
import com.budwk.app.web.commons.auth.utils.AuthUtil; import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil;
@@ -12,10 +22,15 @@ import com.budwk.app.zhgh.activity.culture.models.ActivityTissue;
import com.budwk.app.zhgh.activity.culture.service.ActivityCultureService; import com.budwk.app.zhgh.activity.culture.service.ActivityCultureService;
import com.budwk.app.zhgh.club.model.SysClub; import com.budwk.app.zhgh.club.model.SysClub;
import com.budwk.app.zhgh.club.service.SysClubService; import com.budwk.app.zhgh.club.service.SysClubService;
import com.budwk.app.zhgh.unionReimburse.model.UnionReimburse;
import io.swagger.annotations.ApiOperation;
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.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.Strings; import org.nutz.lang.Strings;
@@ -39,6 +54,17 @@ import java.util.stream.Collectors;
@At("/platform/activity/culture/applyActivity") @At("/platform/activity/culture/applyActivity")
public class ActivityCultureApplyActivityController { public class ActivityCultureApplyActivityController {
@Inject
private Dao dao;
@Inject
private FlowEngine flowEngine;
@Inject
private FlowCommonService flowCommonService;
@Inject
private SysClubService sysClubService;
@Inject
private ActivityCultureService activityCultureService;
@At("/school") @At("/school")
@Ok("beetl:platform/zhgh/activity/culture/school/applyActivity/index.html") @Ok("beetl:platform/zhgh/activity/culture/school/applyActivity/index.html")
@SaCheckPermission("activity.culture.applyActivity.school") @SaCheckPermission("activity.culture.applyActivity.school")
@@ -57,12 +83,6 @@ public class ActivityCultureApplyActivityController {
public void clubIndex() { public void clubIndex() {
} }
@Inject
private ActivityCultureService activityCultureService;
@Inject
private SysClubService sysClubService;
/** /**
* @param activityScopeGroupId * @param activityScopeGroupId
@@ -79,13 +99,71 @@ public class ActivityCultureApplyActivityController {
@At @At
@SLog(tag = "文化活动", msg = "添加了一条文化活动记录", param = true, result = true) @ApiOperation("保存活动申报")
@SLog( tag = "文化活动-活动申报", msg = "保存了一条文化活动记录")
@SaCheckPermission(value = {"activity.culture.applyActivity.school", "activity.culture.applyActivity.union", "activity.culture.applyActivity.club"}, mode = SaMode.OR) @SaCheckPermission(value = {"activity.culture.applyActivity.school", "activity.culture.applyActivity.union", "activity.culture.applyActivity.club"}, mode = SaMode.OR)
public Result doAdd(@Param("tissue") @Valid ActivityTissue tissue) { public Result save(@Param("data") ActivityTissue tissue) {
activityCultureService.doAddActivity(tissue); if (tissue.getActivity_type() == 40002) {
tissue.setUnionId(SecurityUtil.getUnionId());
}
tissue.setUserId(SecurityUtil.getUserId());
tissue.setApplyTime(DateUtil.now());
activityCultureService.insertOrUpdate(tissue);
return Result.success(); return Result.success();
} }
@At
@SaCheckLogin
@ApiOperation("提交申请")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"activity.culture.applyActivity.school", "activity.culture.applyActivity.union", "activity.culture.applyActivity.club"}, mode = SaMode.OR)
public Result submit(@Param("data") ActivityTissue tissue) {
if (tissue.getActivity_type() == 40002) {
tissue.setUnionId(SecurityUtil.getUnionId());
}
tissue.setUserId(SecurityUtil.getUserId());
tissue.setApplyTime(DateUtil.now());
activityCultureService.insertOrUpdate(tissue);
if (tissue.getActivity_type() == 40002 || tissue.getActivity_type() == 40003){
// 开启流程实例
Dict args = Dict.create();
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
args.set(FlowConst.FORM_DATA, tissue);
ProcessInstance instance = flowEngine.startProcessInstanceByKey("WHHD", tissue.getId(), SecurityUtil.getUserId(), args);
// 自动完成第一个申请任务
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
for (ProcessTask task : doingTaskList) {
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
}
return Result.success();
}
return Result.success();
}
@At
@SaCheckLogin
@ApiOperation("重新提交申请")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"activity.culture.applyActivity.school", "activity.culture.applyActivity.union", "activity.culture.applyActivity.club"}, mode = SaMode.OR)
public Result submitAgain(@Param("data") ActivityTissue tissue, @Param("taskId") Long taskId) {
if (tissue.getActivity_type() == 40002) {
tissue.setUnionId(SecurityUtil.getUnionId());
}
tissue.setUserId(SecurityUtil.getUserId());
tissue.setApplyTime(DateUtil.now());
activityCultureService.insertOrUpdate(tissue);
Dict dict = Dict.create();
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
flowCommonService.executeTask(dict);
return Result.success();
}
@At @At
@SLog(tag = "文化活动", msg = "编辑了一条文化活动记录", param = true, result = true) @SLog(tag = "文化活动", msg = "编辑了一条文化活动记录", param = true, result = true)
@SaCheckPermission(value = {"activity.culture.applyActivity.school", "activity.culture.applyActivity.union", "activity.culture.applyActivity.club"}, mode = SaMode.OR) @SaCheckPermission(value = {"activity.culture.applyActivity.school", "activity.culture.applyActivity.union", "activity.culture.applyActivity.club"}, mode = SaMode.OR)
@@ -3,7 +3,6 @@ package com.budwk.app.zhgh.activity.culture.controller;
import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode; import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.stream.CollectorUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
@@ -15,12 +14,10 @@ import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.culture.models.ActivityTissuePerson; import com.budwk.app.zhgh.activity.culture.models.ActivityTissuePerson;
import com.budwk.app.zhgh.activity.culture.service.ActivityCultureApplyUserService; import com.budwk.app.zhgh.activity.culture.service.ActivityCultureApplyUserService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
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.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;
@@ -34,7 +31,6 @@ import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @ClassName ActivityCultureApplyUserController * @ClassName ActivityCultureApplyUserController
@@ -115,11 +111,14 @@ public class ActivityCultureApplyUserController {
@At @At
@SaCheckLogin @SaCheckLogin
@ApiOperation(value = "队友搜索") @ApiOperation(value = "队友搜索")
public Result queryTeammate(@Valid String keyword) { public Result queryTeammate(@Valid String keyword,Integer signUpMethod) {
Sql sql = Sqls.create("select id userId,username userName,loginname loginName,sex,mobile,unitName from vw_user $condition limit 0,10"); Sql sql = Sqls.create("select id userId,username userName,loginname loginName,sex,mobile,unitName from vw_user $condition limit 0,10");
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.or(Cnd.likeEX("username", keyword)); cnd.or(Cnd.likeEX("username", keyword));
cnd.or(Cnd.likeEX("loginname", keyword)); cnd.or(Cnd.likeEX("loginname", keyword));
if (signUpMethod == 3){
cnd.and("unionid", "=", SecurityUtil.getUnionId());
}
sql.setCondition(cnd); sql.setCondition(cnd);
List<NutMap> list = activityCultureApplyUserService.listMap(sql); List<NutMap> list = activityCultureApplyUserService.listMap(sql);
return Result.success(list); return Result.success(list);
@@ -142,6 +141,16 @@ public class ActivityCultureApplyUserController {
return Result.success(list); return Result.success(list);
} }
@At
@SaCheckLogin
@ApiOperation(value = "查询分工会报名人员")
public Result listTeamUserUnion(@Valid String activityId) {
List<ActivityTissuePerson> list = dao.query(ActivityTissuePerson.class, Cnd.where(ActivityTissuePerson::getTissueId, "=", activityId)
.and(ActivityTissuePerson::getApplyUserId, "=", SecurityUtil.getUserId())
);
return Result.success(list);
}
@At @At
@SaCheckLogin @SaCheckLogin
@ApiOperation(value = "是否报名") @ApiOperation(value = "是否报名")
@@ -7,6 +7,7 @@ import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.model.Audit; import com.budwk.app.base.model.Audit;
import com.budwk.app.base.param.PageForm; import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.culture.models.ActivityTissue; import com.budwk.app.zhgh.activity.culture.models.ActivityTissue;
import com.budwk.app.zhgh.activity.culture.service.ActivityCultureService; import com.budwk.app.zhgh.activity.culture.service.ActivityCultureService;
@@ -20,6 +21,8 @@ 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;
import java.util.List;
/** /**
* @ClassName ActivityCultureAuditActivityController * @ClassName ActivityCultureAuditActivityController
* @Description TODO * @Description TODO
@@ -50,7 +53,7 @@ public class ActivityCultureAuditActivityController {
@At @At
@SaCheckPermission(value = {"activity.culture.auditActivity.union", "activity.culture.auditActivity.club"}, mode = SaMode.OR) @SaCheckPermission(value = {"activity.culture.auditActivity.union", "activity.culture.auditActivity.club"}, mode = SaMode.OR)
public Result pageData(PageForm page, Boolean state, public Result pageData(PageForm page, boolean approval,
String year, String year,
String name, String name,
String unionId, String unionId,
@@ -62,19 +65,46 @@ public class ActivityCultureAuditActivityController {
tissue.*, tissue.*,
uni.name unionname , uni.name unionname ,
club.clubName, club.clubName,
abs.`name` projectTypeName abs.`name` projectTypeName,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariable,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariable,
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
FROM FROM
activity_tissue tissue wf_process_task t
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
LEFT JOIN activity_tissue tissue ON tissue.id = ins.businessNo
LEFT JOIN sys_union uni ON uni.id = tissue.unionId LEFT JOIN sys_union uni ON uni.id = tissue.unionId
LEFT JOIN sys_club club ON club.id = tissue.clubId LEFT JOIN sys_club club ON club.id = tissue.clubId
LEFT JOIN activity_basic_settings abs ON abs.`code`=tissue.projectTypeCode LEFT JOIN activity_basic_settings abs ON abs.`code`=tissue.projectTypeCode
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
$condition $condition
"""); """);
cnd.and("t.taskName", "=", "76a03838-caa4-4561-ba0f-0da0d3a17c37");
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
cnd.andEX("YEAR(tissue.startTime)", "=", year); cnd.andEX("YEAR(tissue.startTime)", "=", year);
cnd.andEX("tissue.unionId", "=", unionId); cnd.andEX("tissue.unionId", "=", unionId);
cnd.andEX("tissue.activity_type", "=", activity_type); cnd.andEX("tissue.activity_type", "=", activity_type);
cnd.andEX("tissue.state", state ? ">" : "=", 1); if (approval) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
} else {
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
}
if (Strings.isNotBlank(name)) { if (Strings.isNotBlank(name)) {
cnd.where().andLike("tissue.name", name); cnd.where().andLike("tissue.name", name);
@@ -86,7 +116,7 @@ public class ActivityCultureAuditActivityController {
} else { } else {
cnd.desc("tissue.startTime"); cnd.desc("tissue.startTime");
} }
cnd.groupBy("t.id");
sql.setCondition(cnd); sql.setCondition(cnd);
return Result.success(activityCultureService.listPageMap(page.getPageNumber(), page.getPageSize(), sql)); return Result.success(activityCultureService.listPageMap(page.getPageNumber(), page.getPageSize(), sql));
} }
@@ -133,17 +133,38 @@ public class ActivityCultureUserStatisticsController {
@SaCheckPermission(value = {"activity.culture.userStatistics.school", "activity.culture.userStatistics.union", "activity.culture.userStatistics.club"}, mode = SaMode.OR) @SaCheckPermission(value = {"activity.culture.userStatistics.school", "activity.culture.userStatistics.union", "activity.culture.userStatistics.club"}, mode = SaMode.OR)
public Result getActivityByYearOrType(Integer year, public Result getActivityByYearOrType(Integer year,
@Valid Integer activity_type) { @Valid Integer activity_type) {
Cnd cnd = Cnd.where("activity_type", "=", activity_type); Sql sql = Sqls.create("""
cnd.and("projectTypeCode", "!=", 50004); SELECT
tissue.*,
uni.name unionname ,
club.clubName,
abs.`name` projectTypeName,
atp.applyUserId,
ins.state instanceState,
CASE WHEN atp.id IS NOT NULL THEN 1 ELSE 0 END AS isEnrolled
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
LEFT JOIN activity_tissue_person atp on atp.tissueId=tissue.id AND (atp.applyUserId = @userId OR atp.userId = @userId)
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = tissue.id AND ins.state = 20
$condition
""").setParam("userId", SecurityUtil.getUserId());
Cnd cnd =Cnd.where("tissue.activity_type", "=", activity_type);
cnd.and("tissue.projectTypeCode", "!=", 50004);
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) { if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
cnd.and("signUpMethod", "in", List.of(1, 2, 3)); cnd.and("tissue.signUpMethod", "in", List.of(1, 2, 3));
if (activity_type == 40002) { if (activity_type == 40002) {
cnd.and("unionId", "=", SecurityUtil.getUnionId()); cnd.and("tissue.unionId", "=", SecurityUtil.getUnionId());
} }
} }
cnd.andEX("YEAR(startTime)", "=", year).desc("startTime"); // 只查询流程实例状态为20的数据(已完成状态)
List<ActivityTissue> list = activityCultureApplyUserService.dao().query(ActivityTissue.class, cnd); cnd.and("ins.state", "=", 20);
return Result.success(list); cnd.andEX("YEAR(tissue.startTime)", "=", year).desc("tissue.startTime");
sql.setCondition(cnd);
return Result.success(activityCultureApplyUserService.list(sql));
} }
@@ -1,12 +1,8 @@
package com.budwk.app.zhgh.activity.culture.models; package com.budwk.app.zhgh.activity.culture.models;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.budwk.app.base.model.BaseModel; import com.budwk.app.base.model.BaseModel;
import com.budwk.app.base.model.CustomFormField; import com.budwk.app.base.model.CustomFormField;
import com.budwk.app.sys.models.Sys_home_activity;
import com.budwk.app.sys.services.SysHomeConvert;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
@@ -25,7 +21,7 @@ import java.util.List;
@Data @Data
@Comment("文化活动表") @Comment("文化活动表")
@Table("activity_tissue") @Table("activity_tissue")
public class ActivityTissue extends BaseModel implements Serializable, SysHomeConvert { public class ActivityTissue extends BaseModel implements Serializable {
@Column @Column
@Name @Name
@@ -252,29 +248,6 @@ public class ActivityTissue extends BaseModel implements Serializable, SysHomeCo
@Many(field = "tissueId") @Many(field = "tissueId")
private List<ActivityTissuePerson> tissuePersonList; private List<ActivityTissuePerson> tissuePersonList;
@Override
public Sys_home_activity covertToSysHomeActivity() {
Sys_home_activity sysHomeActivity = new Sys_home_activity();
sysHomeActivity.setId(this.getId());
sysHomeActivity.setName(this.getName());
sysHomeActivity.setCover(this.getCover());
if (this.getActivity_type() == 40001) {
sysHomeActivity.setUrl("/platform/activity/culture/applyUser/school");
} else if (this.getActivity_type() == 40002) {
sysHomeActivity.setUrl("/platform/activity/culture/applyUser/union");
} else if (this.getActivity_type() == 40003) {
sysHomeActivity.setUrl("/platform/activity/culture/applyUser/club");
}
sysHomeActivity.setH5Url("/platform/h5/activity/culture/applyUser");
if (StrUtil.isNotBlank(this.getApplyStartTime())) {
sysHomeActivity.setStartDate(DateUtil.parseDate(this.getApplyStartTime()));
sysHomeActivity.setEndDate(DateUtil.parseDate(this.getApplyEndTime()));
}
sysHomeActivity.setAllowUserGroupId(this.getGroupId());
sysHomeActivity.setEnable(this.getIsUnseal());
sysHomeActivity.setClassPath(this.getClass().getPackageName() + this.getClass().getName());
return sysHomeActivity;
}
private String username; private String username;
@@ -18,7 +18,6 @@ public interface ActivityCultureService extends BaseService<ActivityTissue> {
*/ */
List<NutMap> getUnionData(String activityScopeGroupId); List<NutMap> getUnionData(String activityScopeGroupId);
void doAddActivity(ActivityTissue tissue);
void doEditActivity(ActivityTissue tissue); void doEditActivity(ActivityTissue tissue);
@@ -4,14 +4,11 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.exception.BaseException; import com.budwk.app.base.exception.BaseException;
import com.budwk.app.base.page.Pagination; import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm; import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.impl.BaseServiceImpl; import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.sys.views.View_user; import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope; import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
import com.budwk.app.zhgh.activity.culture.models.ActivityTissue; import com.budwk.app.zhgh.activity.culture.models.ActivityTissue;
@@ -21,15 +18,11 @@ 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.Static; import org.nutz.dao.util.cri.Static;
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 java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@@ -56,6 +49,7 @@ public class ActivityCultureApplyUserServiceImpl extends BaseServiceImpl<Activit
club.clubName, club.clubName,
abs.`name` projectTypeName, abs.`name` projectTypeName,
atp.applyUserId, atp.applyUserId,
ins.state instanceState,
CASE WHEN atp.id IS NOT NULL THEN 1 ELSE 0 END AS isEnrolled CASE WHEN atp.id IS NOT NULL THEN 1 ELSE 0 END AS isEnrolled
FROM FROM
activity_tissue tissue activity_tissue tissue
@@ -63,16 +57,19 @@ public class ActivityCultureApplyUserServiceImpl extends BaseServiceImpl<Activit
LEFT JOIN sys_club club ON club.id = tissue.clubId LEFT JOIN sys_club club ON club.id = tissue.clubId
LEFT JOIN activity_basic_settings abs ON abs.`code`=tissue.projectTypeCode LEFT JOIN activity_basic_settings abs ON abs.`code`=tissue.projectTypeCode
LEFT JOIN activity_tissue_person atp on atp.tissueId=tissue.id AND (atp.applyUserId = @userId OR atp.userId = @userId) LEFT JOIN activity_tissue_person atp on atp.tissueId=tissue.id AND (atp.applyUserId = @userId OR atp.userId = @userId)
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = tissue.id
$condition $condition
""").setParam("userId", SecurityUtil.getUserId()); """).setParam("userId", SecurityUtil.getUserId());
if (Strings.isNotBlank(name)) { if (Strings.isNotBlank(name)) {
cnd.where().andLike("tissue.name", name); cnd.where().andLike("tissue.name", name);
} }
// 只查询流程实例状态为20的数据(已完成状态)
cnd.and("ins.state", "=", 20);
cnd.andEX("YEAR(tissue.startTime)", "=", year); cnd.andEX("YEAR(tissue.startTime)", "=", year);
cnd.andEX("tissue.isUnseal", "=", true); cnd.andEX("tissue.isUnseal", "=", true);
cnd.andEX("tissue.activity_type", "=", activity_type); cnd.andEX("tissue.activity_type", "=", activity_type);
cnd.andEX("tissue.state", "=", 3);
cnd.and("tissue.isEnrollSystem", "=", 1); cnd.and("tissue.isEnrollSystem", "=", 1);
cnd.andEX("tissue.projectTypeCode", "!=", 50004); cnd.andEX("tissue.projectTypeCode", "!=", 50004);
cnd.andEX("tissue.signUpMethod", "in", List.of(1, 2, 3)); cnd.andEX("tissue.signUpMethod", "in", List.of(1, 2, 3));
@@ -221,23 +218,30 @@ public class ActivityCultureApplyUserServiceImpl extends BaseServiceImpl<Activit
//分工会报名独有判断 //分工会报名独有判断
//判断总人数限制 //判断总人数限制
//判断分工会人数限制 //判断分工会人数限制
View_user user = dao().fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId())); Sql sql = Sqls.create("""
ActivityTissuePerson activityTissuePerson = new ActivityTissuePerson(); SELECT
activityTissuePerson.setTissueId(activityId); id AS userId,
activityTissuePerson.setUserId(user.getId()); username AS userName,
activityTissuePerson.setUserName(user.getUsername()); loginname AS loginName,
activityTissuePerson.setLoginName(user.getLoginname()); sex,
activityTissuePerson.setSex(user.getSex()); mobile,
activityTissuePerson.setMobile(user.getMobile()); unitName,
activityTissuePerson.setUnitId(user.getUnitId()); unionName,
activityTissuePerson.setUnitName(user.getUnitName()); '$activityId' AS tissueId,
activityTissuePerson.setUnionId(user.getUnionId()); '$applyUserId' AS applyUserId,
activityTissuePerson.setUnionName(user.getUnionName()); '$applyUserUserName' AS applyUserUserName,
activityTissuePerson.setApplyDateTime(DateUtil.now()); '$applyDateTime' AS applyDateTime
activityTissuePerson.setApplyUserId(user.getId()); FROM
activityTissuePerson.setApplyUserUserName(user.getUsername()); `vw_user`
activityTissuePerson.setDynamicFormData(dynamicFormParam); $condition
insert(activityTissuePerson); """);
sql.setVar("activityId", activityId);
sql.setVar("applyUserId", SecurityUtil.getUserId());
sql.setVar("applyDateTime", DateUtil.now());
sql.setVar("applyUserUserName", SecurityUtil.getUserUsername());
sql.setCondition(Cnd.where("id", "in", personIds));
List<ActivityTissuePerson> fullPersonList = listEntity(sql);
insert(fullPersonList);
} }
} }
@@ -1,12 +1,10 @@
package com.budwk.app.zhgh.activity.culture.service.impl; package com.budwk.app.zhgh.activity.culture.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.model.Audit; import com.budwk.app.base.model.Audit;
import com.budwk.app.base.param.PageForm; import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.service.impl.BaseServiceImpl; import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.sys.models.Sys_home_activity;
import com.budwk.app.web.commons.auth.utils.AuthUtil; import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.culture.models.ActivityTissue; import com.budwk.app.zhgh.activity.culture.models.ActivityTissue;
@@ -60,7 +58,7 @@ public class ActivityCultureServiceImpl extends BaseServiceImpl<ActivityTissue>
gh.id, gh.id,
gh.name unionname, gh.name unionname,
( SELECT count( 1 ) FROM `user` WHERE id IN ( SELECT userid FROM activity_user_scope WHERE groupId = @activityScopeGroupId ) AND unionId = gh.id ) as teacherCount ( SELECT count( 1 ) FROM `user` WHERE id IN ( SELECT userid FROM activity_user_scope WHERE groupId = @activityScopeGroupId ) AND unionId = gh.id ) as teacherCount
FROM FROM
sys_union gh sys_union gh
LEFT JOIN `vw_user` u ON u.unionid = gh.id LEFT JOIN `vw_user` u ON u.unionid = gh.id
@@ -72,38 +70,10 @@ public class ActivityCultureServiceImpl extends BaseServiceImpl<ActivityTissue>
} }
} }
@Override
public void doAddActivity(ActivityTissue tissue) {
tissue.setUserId(SecurityUtil.getUserId());
tissue.setApplyTime(DateUtil.now());
tissue.setIsUnseal(true);
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
tissue.setState(1);
} else {
tissue.setState(3);
}
if (tissue.getActivity_type() == 40002) {
tissue.setUnionId(SecurityUtil.getUnionId());
} else if (tissue.getActivity_type() == 40003) {
// tissue.setClubId(vi.getClubId());
}
insertWith(tissue, "tissuePersonList");
if (tissue.getIsEnrollSystem()) {
Sys_home_activity sysHomeActivity = tissue.covertToSysHomeActivity();
dao().insertOrUpdate(sysHomeActivity);
}
}
@Override @Override
public void doEditActivity(ActivityTissue tissue) { public void doEditActivity(ActivityTissue tissue) {
update(tissue); update(tissue);
if (tissue.getIsEnrollSystem()) {
Sys_home_activity sysHomeActivity = tissue.covertToSysHomeActivity();
dao().insertOrUpdate(sysHomeActivity);
} else {
dao().delete(Sys_home_activity.class, tissue.getId());
}
} }
@Override @Override
@@ -115,12 +85,31 @@ public class ActivityCultureServiceImpl extends BaseServiceImpl<ActivityTissue>
tissue.*, tissue.*,
uni.name unionname , uni.name unionname ,
club.clubName, club.clubName,
abs.`name` projectTypeName abs.`name` projectTypeName,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariable,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariable,
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
FROM FROM
activity_tissue tissue activity_tissue tissue
LEFT JOIN sys_union uni ON uni.id = tissue.unionId LEFT JOIN sys_union uni ON uni.id = tissue.unionId
LEFT JOIN sys_club club ON club.id = tissue.clubId LEFT JOIN sys_club club ON club.id = tissue.clubId
LEFT JOIN activity_basic_settings abs ON abs.`code`=tissue.projectTypeCode LEFT JOIN activity_basic_settings abs ON abs.`code`=tissue.projectTypeCode
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = tissue.id
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
$condition $condition
"""); """);
@@ -150,7 +139,7 @@ public class ActivityCultureServiceImpl extends BaseServiceImpl<ActivityTissue>
} else { } else {
cnd.desc("tissue.startTime"); cnd.desc("tissue.startTime");
} }
//cnd.groupBy("tissue.id");
sql.setCondition(cnd); sql.setCondition(cnd);
return this.listPageMap(page.getPageNumber(), page.getPageSize(), sql); return this.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
} }
@@ -137,7 +137,6 @@ public class ActivityDeclareMineController {
} else { } else {
cnd.orderBy("info." + pageParam.getPageOrderName(), PageUtil.getOrder(pageParam.getPageOrderBy())); cnd.orderBy("info." + pageParam.getPageOrderName(), PageUtil.getOrder(pageParam.getPageOrderBy()));
} }
cnd.groupBy("t.id");
sql.setCondition(cnd); sql.setCondition(cnd);
Pagination<NutMap> pagination = activityDeclareService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql); Pagination<NutMap> pagination = activityDeclareService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql);
return Result.success().addData(pagination); return Result.success().addData(pagination);
@@ -178,7 +177,7 @@ public class ActivityDeclareMineController {
@Ok("void") @Ok("void")
@SaCheckPermission("activityDeclare.mine") @SaCheckPermission("activityDeclare.mine")
@SLog(tag = "活动申报", msg = "导出活动申报表") @SLog(tag = "活动申报", msg = "导出活动申报表")
public void doExport(@Valid String id, HttpServletResponse response) { public void doExportDeclare(@Valid String id, HttpServletResponse response) {
HashMap<String, Object> docData = new HashMap<>(); HashMap<String, Object> docData = new HashMap<>();
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
@@ -37,6 +37,7 @@ import org.nutz.mvc.annotation.Param;
import javax.validation.Valid; import javax.validation.Valid;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@@ -87,9 +88,6 @@ public class ActivityReimbursementApplyController {
.mapToDouble(v -> ObjectUtil.defaultIfNull(v.getActualPrice(), 0D)) .mapToDouble(v -> ObjectUtil.defaultIfNull(v.getActualPrice(), 0D))
.sum(); .sum();
activityReimbursementInfo.setActualMoney(new BigDecimal(sum)); activityReimbursementInfo.setActualMoney(new BigDecimal(sum));
if (StrUtil.isBlank(activityReimbursementInfo.getDeclareId())) {
activityReimbursementInfo.setDeclareId(activityReimbursementInfo.getId());
}
dao.insertOrUpdate(activityReimbursementInfo); dao.insertOrUpdate(activityReimbursementInfo);
return Result.success(); return Result.success();
} }
@@ -110,9 +108,6 @@ public class ActivityReimbursementApplyController {
.mapToDouble(v -> ObjectUtil.defaultIfNull(v.getActualPrice(), 0D)) .mapToDouble(v -> ObjectUtil.defaultIfNull(v.getActualPrice(), 0D))
.sum(); .sum();
activityReimbursementInfo.setActualMoney(new BigDecimal(sum)); activityReimbursementInfo.setActualMoney(new BigDecimal(sum));
if (StrUtil.isBlank(activityReimbursementInfo.getDeclareId())) {
activityReimbursementInfo.setDeclareId(activityReimbursementInfo.getId());
}
dao.insertOrUpdate(activityReimbursementInfo); dao.insertOrUpdate(activityReimbursementInfo);
// 开启流程实例 // 开启流程实例
@@ -146,9 +141,6 @@ public class ActivityReimbursementApplyController {
.mapToDouble(v -> ObjectUtil.defaultIfNull(v.getActualPrice(), 0D)) .mapToDouble(v -> ObjectUtil.defaultIfNull(v.getActualPrice(), 0D))
.sum(); .sum();
activityReimbursementInfo.setActualMoney(new BigDecimal(sum)); activityReimbursementInfo.setActualMoney(new BigDecimal(sum));
if (StrUtil.isBlank(activityReimbursementInfo.getDeclareId())) {
activityReimbursementInfo.setDeclareId(activityReimbursementInfo.getId());
}
dao.insertOrUpdate(activityReimbursementInfo); dao.insertOrUpdate(activityReimbursementInfo);
Dict dict = Dict.create(); Dict dict = Dict.create();
@@ -162,14 +154,33 @@ public class ActivityReimbursementApplyController {
@At @At
@ApiOperation("获取当前用户活动报销") @ApiOperation("获取当前用户活动报销")
@SaCheckPermission("activityReimbursement.apply") @SaCheckPermission("activityReimbursement.apply")
public Result getActivityReimbursementByUser() { public Result getActivityReimbursementByUser(String id) {
// 查询reimbursement表里面没有,在declare表里面有的申请记录 if (StrUtil.isNotBlank(id)) {
Sql sql = Sqls.create("SELECT declareId FROM activity_reimbursement_info WHERE userId = @userId").setParam("userId", SecurityUtil.getUserId()); ActivityReimbursementInfo reimbursementInfo = dao.fetch(ActivityReimbursementInfo.class, id);
ActivityDeclareInfo info = dao.fetch(ActivityDeclareInfo.class, reimbursementInfo.getDeclareId());
return Result.success().addData(List.of(info));
}
// 查询已经报销成功的记录
Sql reiSql = Sqls.create("""
SELECT
info.declareId
FROM
activity_reimbursement_info info
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
WHERE
userId = @userId
AND ins.state IN (10, 20)
""").setParam("userId", SecurityUtil.getUserId());
reiSql.setCallback(Sqls.callback.strList());
dao.execute(reiSql);
List<String> reiDecIdList = reiSql.getList(String.class);
Sql sql = Sqls.create("select declareId from activity_reimbursement_info where userId = @userId").setParam("userId", SecurityUtil.getUserId());
sql.setCallback(Sqls.callback.strList()); sql.setCallback(Sqls.callback.strList());
dao.execute(sql); dao.execute(sql);
List<String> declareIdList = sql.getList(String.class); List<String> declareIdList = sql.getList(String.class);
Sql applySql = Sqls.create(""" Sql applySql = Sqls.create("""
SELECT SELECT
info.* info.*
@@ -178,10 +189,12 @@ public class ActivityReimbursementApplyController {
LEFT JOIN wf_process_instance ins ON info.id = ins.businessNo LEFT JOIN wf_process_instance ins ON info.id = ins.businessNo
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (Lang.isNotEmpty(declareIdList)) { if (Lang.isNotEmpty(declareIdList)) {
cnd.and("info.id", "in", declareIdList); cnd.and("info.id", "not in", declareIdList);
}
if (Lang.isNotEmpty(reiDecIdList)) {
cnd.and("info.id", "not in", reiDecIdList);
} }
cnd.and("info.userId", "=", SecurityUtil.getUserId()); cnd.and("info.userId", "=", SecurityUtil.getUserId());
cnd.and("ins.state", "=", 20); cnd.and("ins.state", "=", 20);
@@ -5,6 +5,7 @@ import com.budwk.app.zhgh.activity.declarereimbursement.declare.models.ActivityD
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@@ -22,6 +23,12 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class ActivityReimbursementInfo extends ActivityDeclareInfo { public class ActivityReimbursementInfo extends ActivityDeclareInfo {
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column @Column
@Comment("申报id") @Comment("申报id")
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
@@ -179,7 +179,7 @@ public class ActivityWorksCollectionReadController {
response.setHeader("Content-Disposition", "attachment;filename=" + URLUtil.encode("作品征集数据.zip")); response.setHeader("Content-Disposition", "attachment;filename=" + URLUtil.encode("作品征集数据.zip"));
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.andEX("up.activityId", "=", pageForm.getActivityId()); cnd.andEX("activityId", "=", pageForm.getActivityId());
cnd.andEX("typeName", "=", pageForm.getTypeName()); cnd.andEX("typeName", "=", pageForm.getTypeName());
if (StrUtil.isAllNotBlank(pageForm.getSearchKeyword())) { if (StrUtil.isAllNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.activity.workscollection.controller; package com.budwk.app.zhgh.activity.workscollection.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil;
import com.budwk.app.base.page.Pagination; import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm; import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
@@ -26,6 +27,7 @@ import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -56,7 +58,7 @@ public class ActivityWorksCollectionUploadController {
*/ */
@At @At
@SaCheckPermission("activity.workscollection.upload") @SaCheckPermission("activity.workscollection.upload")
public Result pageData(@Valid PageForm pageForm, String activityId, String subjectId, String worksId) { public Result pageData(@Valid PageForm pageForm, String activityId, String subjectId, String worksId, Long year) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
select select
up.*, up.*,
@@ -72,6 +74,7 @@ public class ActivityWorksCollectionUploadController {
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("userId", "=", SecurityUtil.getUserId()); cnd.and("userId", "=", SecurityUtil.getUserId());
cnd.andEX("YEAR(co.startDateTime)","=",year);
cnd.andEX("up.activityId", "=", activityId); cnd.andEX("up.activityId", "=", activityId);
cnd.andEX("up.subjectId", "=", subjectId); cnd.andEX("up.subjectId", "=", subjectId);
cnd.andEX("up.worksId", "=", worksId); cnd.andEX("up.worksId", "=", worksId);
@@ -9,7 +9,9 @@ import org.nutz.dao.interceptor.annotation.PrevInsert;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List; import java.util.List;
@Data @Data
@@ -97,4 +99,6 @@ public class Activity_works_collection_upload extends BaseModel {
@NotEmpty(message = "附件不能为空") @NotEmpty(message = "附件不能为空")
private List<JSONObject> files; private List<JSONObject> files;
} }
@@ -57,7 +57,7 @@ public class EvaluateBranchUnionApprovalController {
ea.name AS evaluateName, ea.name AS evaluateName,
hb.name AS honorName, hb.name AS honorName,
bs.name as honorTypeName, bs.name as honorTypeName,
ins.id AS instanceId, ins.id AS instanceId,
ins.businessNo, ins.businessNo,
ins.state instanceState, ins.state instanceState,
ins.variable instanceVariable, ins.variable instanceVariable,
@@ -76,17 +76,18 @@ public class EvaluateBranchUnionApprovalController {
FROM FROM
wf_process_task t wf_process_task t
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
LEFT JOIN evaluate_apply info ON info.id = ins.businessNo LEFT JOIN evaluate_apply info ON info.id = ins.businessNo
LEFT JOIN evaluate_activity ea ON ea.id = info.evaluateId LEFT JOIN evaluate_activity ea ON ea.id = info.evaluateId
LEFT JOIN honor_basic_settings hb ON hb.id = info.honorId LEFT JOIN honor_basic_settings hb ON hb.id = info.honorId
LEFT JOIN honor_basic_settings bs ON bs.id = info.honorTypeId LEFT JOIN honor_basic_settings bs ON bs.id = info.honorTypeId
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("t.taskName", "=", "3bdaa29d-e5eb-4e3e-b7f1-14d03bedd078"); cnd.and("t.taskName", "=", "3bdaa29d-e5eb-4e3e-b7f1-14d03bedd078");
cnd.and("info.evaluateId", "=", pageForm.getEvaluateId());
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
if (approval) { if (approval) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode())); cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
@@ -102,6 +102,7 @@ public class EvaluateSchoolUnionApprovalController {
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
cnd.andEX("info.unionId","=",pageForm.getUnionId()); cnd.andEX("info.unionId","=",pageForm.getUnionId());
cnd.andEX("info.unitId","=",pageForm.getUnitId()); cnd.andEX("info.unitId","=",pageForm.getUnitId());
cnd.andEX("info.evaluateId","=",pageForm.getEvaluateId());
if (approval) { if (approval) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode())); cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
@@ -15,13 +15,13 @@ import com.budwk.app.flow.constant.FlowConst;
import com.budwk.app.flow.engine.FlowEngine; import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.entity.ProcessInstance; import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask; import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum; import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
import com.budwk.app.sys.views.View_user; import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.AuthUtil; import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.enrollmentRegistration.model.EnrollmentRegistration;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationActivity; import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationActivity;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationLine; import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationLine;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationQuotaAllocation;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationSignUpUser; import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationSignUpUser;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -149,7 +149,7 @@ public class ExcellentRecuperationActivitySignUpController {
@At @At
@ApiOperation("删除报名信息") @ApiOperation("删除报名信息")
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("enrollmentRegistration.summary") @SaCheckPermission("excellentRecuperation.activitySignUp")
@SLog(tag = "优秀教职工疗休养-活动报名", type = "excellentRecuperationActivitySignUp", msg = "删除id: ${args[0]}") @SLog(tag = "优秀教职工疗休养-活动报名", type = "excellentRecuperationActivitySignUp", msg = "删除id: ${args[0]}")
public Result doDelete(String id) { public Result doDelete(String id) {
dao.delete(ExcellentRecuperationSignUpUser.class, id); dao.delete(ExcellentRecuperationSignUpUser.class, id);
@@ -205,6 +205,9 @@ public class ExcellentRecuperationActivitySignUpController {
public Result listActivityByYear(String year) { public Result listActivityByYear(String year) {
List<ExcellentRecuperationActivity> activityList = dao.query(ExcellentRecuperationActivity.class, List<ExcellentRecuperationActivity> activityList = dao.query(ExcellentRecuperationActivity.class,
Cnd.where("YEAR(signUpStartTime)", "=", year).desc("signUpStartTime")); Cnd.where("YEAR(signUpStartTime)", "=", year).desc("signUpStartTime"));
activityList.forEach(activity -> {
activity.setUnionQuotaAllocationList(dao.query(ExcellentRecuperationQuotaAllocation.class, Cnd.where("activityId", "=", activity.getId())));
});
return Result.success(activityList); return Result.success(activityList);
} }
@@ -258,5 +261,47 @@ public class ExcellentRecuperationActivitySignUpController {
return Result.success(dao.fetch(ExcellentRecuperationSignUpUser.class, id)); return Result.success(dao.fetch(ExcellentRecuperationSignUpUser.class, id));
} }
@At
@ApiOperation("查询报名人员")
@SaCheckLogin
public Result getSIgnUpUserList(String unionId, String activityId){
Sql sql = Sqls.create("""
SELECT
info.*,
line.lineName,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariale,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariale,
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
(SELECT MAX(id) FROM wf_process_task WHERE processInstanceId = ins.id AND taskName = 'startTask' AND taskState IN (10, 20)) AS startTaskId
FROM
excellent_recuperation_sign_user info
LEFT JOIN excellent_recuperation_line line ON line.id = info.lineId
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
AND t.taskState = 10
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("info.activityId", "=", activityId);
cnd.and("info.unionId", "=", unionId);
cnd.and("ins.state", "!=", ProcessInstanceStateEnum.REJECT.getCode());
sql.setCondition(cnd);
List<NutMap> map = baseService.listMap(sql);
return Result.success(map);
}
} }
@@ -19,7 +19,6 @@ import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationTravelAgency; import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationTravelAgency;
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationTravelAgencyService; import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationTravelAgencyService;
import com.budwk.app.zhgh.staffbenefit.recuperation.mode.TravelAgencyExcelMode; import com.budwk.app.zhgh.staffbenefit.recuperation.mode.TravelAgencyExcelMode;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -221,8 +220,8 @@ public class ExcellentRecuperationTravelAgencyController {
ExcelImportRes<TravelAgencyExcelMode> excelImportRes = new ExcelImportRes<>(); ExcelImportRes<TravelAgencyExcelMode> excelImportRes = new ExcelImportRes<>();
excelImportRes.setTotalRecords(travelAgency.size()); excelImportRes.setTotalRecords(travelAgency.size());
List<RecuperationTravelAgency> travelAgencyList = dao.query(RecuperationTravelAgency.class, Cnd.NEW().desc("id")); List<ExcellentRecuperationTravelAgency> travelAgencyList = dao.query(ExcellentRecuperationTravelAgency.class, Cnd.NEW().desc("id"));
Map<String, String> map = travelAgencyList.stream().collect(Collectors.toMap(RecuperationTravelAgency::getTravelAgencyName, RecuperationTravelAgency::getId)); Map<String, String> map = travelAgencyList.stream().collect(Collectors.toMap(ExcellentRecuperationTravelAgency::getTravelAgencyName, ExcellentRecuperationTravelAgency::getId));
for (int i = 0; i < travelAgency.size(); i++) { for (int i = 0; i < travelAgency.size(); i++) {
TravelAgencyExcelMode travel = travelAgency.get(i); TravelAgencyExcelMode travel = travelAgency.get(i);
@@ -234,7 +233,7 @@ public class ExcellentRecuperationTravelAgencyController {
travel.setErrInfo("旅行社名称为空", i + 1); travel.setErrInfo("旅行社名称为空", i + 1);
continue; continue;
} }
RecuperationTravelAgency agency = new RecuperationTravelAgency(); ExcellentRecuperationTravelAgency agency = new ExcellentRecuperationTravelAgency();
if (Strings.isNotBlank(map.get(travel.getTravelAgencyName()))){ if (Strings.isNotBlank(map.get(travel.getTravelAgencyName()))){
agency.setId(map.get(travel.getTravelAgencyName())); agency.setId(map.get(travel.getTravelAgencyName()));
} }
@@ -1,7 +1,6 @@
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model; package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model;
import com.budwk.app.base.model.BaseModel; import com.budwk.app.base.model.BaseModel;
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
@@ -55,7 +54,7 @@ public class ExcellentRecuperationLine extends BaseModel {
private boolean isDisabled; private boolean isDisabled;
@Column @Column
@ColDefine(type = ColType.VARCHAR, width = 50) @ColDefine(type = ColType.VARCHAR, width = 500)
@Comment("缩略图") @Comment("缩略图")
private String file; private String file;
@@ -60,7 +60,7 @@ public class MemberStatisticsServiceImpl extends BaseServiceImpl<Sys_user> imple
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().equalsIgnoreCase("ascending") ? "ASC" : "DESC"); cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().equalsIgnoreCase("ascending") ? "ASC" : "DESC");
} }
if (Lang.isNotEmpty(pageForm.getAge()) && !"0".equals(pageForm.getAge().get(0)) && !"0".equals(pageForm.getAge().get(1))) { if (Lang.isNotEmpty(pageForm.getAge()) && !"0".equals(pageForm.getAge().get(1))) {
if (reverseSelection) { if (reverseSelection) {
cnd.andNot("TIMESTAMPDIFF(YEAR, u.birthday, CURDATE())", "between", pageForm.getAge().toArray()); cnd.andNot("TIMESTAMPDIFF(YEAR, u.birthday, CURDATE())", "between", pageForm.getAge().toArray());
} else { } else {
@@ -174,7 +174,7 @@ public class MemberPaymentChartSummaryController {
) subquery ON subquery.unionId = un.id ) subquery ON subquery.unionId = un.id
GROUP BY GROUP BY
un.id, un.id,
un.unionname, un.name,
un.unioncode un.unioncode
ORDER BY ORDER BY
un.unioncode; un.unioncode;
@@ -5,8 +5,10 @@ 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.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog; import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.constant.RoleConstant;
@@ -104,9 +106,9 @@ public class MemberPaymentSummaryController {
public Result modify(@Param("ids") String[] ids, String paymentMoney, boolean isPay, String remark) { public Result modify(@Param("ids") String[] ids, String paymentMoney, boolean isPay, String remark) {
List<String> idList = Arrays.asList(ids); List<String> idList = Arrays.asList(ids);
if (Lang.isNotEmpty(idList)) { if (Lang.isNotEmpty(idList)) {
if (!isPay) { if (isPay) {
//未缴费设为已缴费 //未缴费设为已缴费
memberPaymentService.update(Chain.make("paymentMoney", paymentMoney) memberPaymentService.update(Chain.make("paymentMoney", NumberUtil.mul(paymentMoney, "100"))
.add("remark", remark).add("isPayment", 1) .add("remark", remark).add("isPayment", 1)
.add("paymentTime", new Date()), .add("paymentTime", new Date()),
Cnd.where("id", "in", idList)); Cnd.where("id", "in", idList));
@@ -134,9 +136,16 @@ public class MemberPaymentSummaryController {
@ApiOperation("下载导入模版") @ApiOperation("下载导入模版")
@SaCheckPermission("member.payment.summary") @SaCheckPermission("member.payment.summary")
public void downloadImportTemp(HttpServletResponse response) { public void downloadImportTemp(HttpServletResponse response) {
List<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
exportEntities.add(new ExcelExportEntity("缴纳金额", "paymentBase", 20));
exportEntities.add(new ExcelExportEntity("是否缴费", "isPay", 20));
exportEntities.add(new ExcelExportEntity("备注", "remark", 20));
ExportParams exportParams = new ExportParams(); ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF); exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, MemberPaymentTemp.class, new ArrayList<>()); Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, new ArrayList<>());
CommonDownloadUtil.download("会员缴费导入模版.xlsx", workbook, response); CommonDownloadUtil.download("会员缴费导入模版.xlsx", workbook, response);
} }
@@ -37,7 +37,7 @@ import org.nutz.mvc.annotation.Param;
@At("/platform/unionReimburse/mine") @At("/platform/unionReimburse/mine")
@Api("工会报销我的") @Api("工会报销我的")
@Ok("json:full") @Ok("json:full")
public class UnionReimburseMineController { public class UnionReimburseMineController {
@Inject @Inject
private UnionReimburseService unionReimburseService; private UnionReimburseService unionReimburseService;
@@ -0,0 +1,27 @@
package com.budwk.app.zhgh.user.childManage.h5controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import lombok.extern.slf4j.Slf4j;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
/**
* @version 1.0
* @Author hqw
* @nameH5ChildManageController
* @Date 2025/9/4 8:52
* @注释
*/
@Slf4j
@IocBean
@Ok("json")
@At("/platform/childManage/manage/h5")
public class H5ChildManageController {
@At("")
@Ok("beetl:/platform/zhghh5/staffmanage/childmanage/")
@SaCheckPermission("h5.childManage")
public void index() {
}
}
@@ -0,0 +1,235 @@
<template>
<div style="padding: 20px 50px">
<el-timeline>
<el-timeline-item timestamp="下载模板" placement="top">
<el-card>
<el-button size="medium" style="width: 200px"
@click="$downLoad('/platform/activity/basic/scope/downloadImport')" icon="el-icon-download">下载模板
</el-button>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="上传文件" placement="top">
<el-card>
<el-form>
<el-upload
action="#"
name="file"
ref="upload"
:on-remove="
(file, fileList) => {
importData.fileList = fileHandleRemove(file, fileList)
importResult = {
errorCount: 0,
successCount: 0,
totalCount: 0,
errorList: []
}
}
"
:on-change="
(file, fileList) => {
importData.fileList = fileHandleChange(file, fileList, { type: ['xls', 'xlsx'] })
}
"
:auto-upload="false"
:limit="1"
:file-list="importData.fileList"
>
<el-button size="medium" type="" icon="el-icon-upload" style="width: 200px">选择文件</el-button>
<div class="el-upload__tip" slot="tip" style="color: #f56c6c">只能上传 xls/xlsx 文件</div>
</el-upload>
</el-form>
</el-card>
</el-timeline-item>
<el-timeline-item placement="top" timestamp="导入结果">
<el-card shadow="never">
<p>总记录数:{{ errorInfoData.totalCount }}</p>
<p>
成功数:
<span class="text-success">{{ errorInfoData.successCount }}</span>
</p>
<p>
错误数:
<span class="text-danger">{{ errorInfoData.errorCount }}</span>
</p>
<el-link @click="exportErrors" type="primary" v-if="errorInfoData.errorCount > 0">下载错误记录</el-link>
</el-card>
</el-timeline-item>
</el-timeline>
<div style="text-align: right">
<span slot="footer" class="dialog-footer">
<el-button @click="clearImportDialog" type="primary"
:disabled="importLoading">取 消</el-button>
<el-button type="primary" @click="clearSearchCnd"
:loading="importLoading">清空查询条件</el-button>
<el-button type="primary" @click="doImport" :loading="importLoading">核对人员</el-button>
<el-button type="primary" @click="doImportSearch"
:loading="importLoading">查询人员</el-button>
</span>
</div>
</div>
</template>
<script>
module.exports = {
props: {
exists_login_name_redis_key: {type: String, required: ""},
group_id: {type: Number, required: ""},
do_import_url: {type: String, required: ""}
},
mounted() {
const s = document.createElement("script")
s.type = "text/javascript"
s.src = "/assets/platform/plugins/xlsx/xlsx.full.min.js"
document.body.appendChild(s)
},
data() {
return {
importData: {
fileList: [],
isFlag: false
},
errorInfoData: {
totalCount: 0,
successCount: 0,
errorCount: 0,
errorList: 0
},
importLoading: false,
doImportUrl:""
}
},
methods: {
clearImportDialog() {
this.$emit("clear_import_dialog")
},
clearSearchCnd() {
this.importData = {
fileList: [],
}
this.errorInfoData = {
totalCount: 0,
successCount: 0,
errorCount: 0,
errorList: [],
}
$.get('/platform/activity/basic/scope/clearSearchCnd', {existsLoginNameRedisKey: this.exists_login_name_redis_key}).then(res => {
if (res.code === 0) {
this.$emit("flush", this.exists_login_name_redis_key)
this.$message.success(res.msg)
} else {
this.$message.error(res.msg)
}
})
},
resetImportData() {
this.importData = {
fileList: [],
}
this.errorInfoData = {
totalCount: 0,
successCount: 0,
errorCount: 0,
errorList: 0
}
},
doImportSearch() {
this.$emit("flush", this.exists_login_name_redis_key)
this.clearImportDialog()
},
doImport() {
if (this.importData.fileList.length === 0) {
this.$message.error({
title: "错误",
message: "请选择文件!"
})
return
}
const data = new FormData()
data.append("groupId", this.group_id)
this.importData.fileList.forEach((val) => {
data.append("file", val.raw, val.raw.name)
})
this.importLoading = true
this.$axios.post(this.do_import_url, data).then((res) => {
if (res.code === 0) {
if (res.data.errorList && res.data.errorList.length > 0) {
this.$message.warning("核对失败")
} else {
this.$message.success("核对成功")
}
this.errorInfoData = res.data
this.$emit("flush", res.data.existsLoginNameRedisKey)
} else {
this.$message.warning("核对失败")
}
this.importLoading = false
})
},
exportErrors() {
const data = this.errorInfoData.errorList
// 创建工作簿
const workbook = XLSX.utils.book_new()
// 创建工作表
const worksheet = XLSX.utils.json_to_sheet(data)
// 将工作表添加到工作簿
XLSX.utils.book_append_sheet(workbook, worksheet, "Sheet1")
// 将工作簿转换为二进制对象
const excelBuffer = XLSX.write(workbook, {bookType: "xlsx", type: "array"})
// 将二进制对象转换为Blob对象
const blob = new Blob([excelBuffer], {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})
// 创建下载链接并设置相关属性
const url = window.URL.createObjectURL(blob)
const link = document.createElement("a")
link.href = url
link.download = "错误记录.xlsx"
// 模拟点击下载链接
document.body.appendChild(link)
link.click()
// 清理下载链接
document.body.removeChild(link)
window.URL.revokeObjectURL(url)
},
fileHandleRemove(file, fileList) {
return fileList
},
fileHandleChange(file, fileList, {type, size}) {
const removeFile = () => {
fileList.splice(fileList.findIndex((v) => v === file))
}
if (!file.size) {
this.$message.warning("您选择的是空文件")
removeFile()
}
if (type && type.length && !type.includes(file.name.split(".").pop().toLowerCase())) {
this.$message.warning(`文件只能是 ${type.map((v) => v.toUpperCase()).join("/")} 格式`)
removeFile()
}
if (size && !file.size < size) {
this.$message.warning(`文件大小不能超过 ${size / 1024 / 1024}MB`)
removeFile()
}
return fileList
}
}
}
</script>
<style>
.el-card__body {
padding: 25px;
}
</style>
@@ -1,319 +1,347 @@
<template> <template>
<div> <div>
<el-card shadow="never"> <el-card shadow="never">
<div class="search"> <div class="search">
<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 <el-select
placeholder="活动分组" placeholder="活动分组"
v-model="pageForm.groupId" v-model="pageForm.groupId"
style="width: 100%" style="width: 100%"
@change=" @change="
doSearch() doSearch()
viewGroupName() viewGroupName()
" "
filterable filterable
> >
<el-option <el-option
v-for="item in activityGroupList" v-for="item in activityGroupList"
:label="item.groupName" :label="item.groupName"
:value="item.groupId" :value="item.groupId"
:key="item.groupId" :key="item.groupId"
></el-option> ></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<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 <el-input
placeholder="请输入内容" placeholder="请输入内容"
clearable clearable
v-model="pageForm.searchKeyword" v-model="pageForm.searchKeyword"
style="width: 100%" style="width: 100%"
@keyup.enter.native="doSearch" @keyup.enter.native="doSearch"
> >
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 80px"> <el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 80px">
<el-option label="姓名" value="username"></el-option> <el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option> <el-option label="工号" value="loginname"></el-option>
</el-select> </el-select>
</el-input> </el-input>
</div> </div>
</div> </div>
<div class="search-item" v-if="is_sysadmin || is_A06"> <div class="search-item" v-if="is_sysadmin || is_A06">
<div class="search-item-label">所属工会</div> <div class="search-item-label">所属工会</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select <el-select
placeholder="所属工会" placeholder="所属工会"
v-model="pageForm.unionId" v-model="pageForm.unionId"
style="width: 100%" style="width: 100%"
clearable clearable
@change="flushUnits" @change="flushUnits"
@clear="flushUnits" @clear="flushUnits"
filterable filterable
> >
<el-option v-for="item in unions" :label="item.name" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in unions" :label="item.name" :value="item.id" :key="item.id"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<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 placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%" clearable @change="doSearch" filterable> <el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%" clearable @change="doSearch"
<el-option v-for="item in units" :label="item.name" :value="item.id" :key="item.id"></el-option> filterable>
</el-select> <el-option v-for="item in units" :label="item.name" :value="item.id" :key="item.id"></el-option>
</div> </el-select>
</div> </div>
</div>
<!--<div class="search-item" <!--<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')}"> v-if="${@shiro.hasRole('sysadmin')}">
<div class="search-item-label">活动工会</div> <div class="search-item-label">活动工会</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.activityUnionId" <el-select placeholder="所属工会" v-model="pageForm.activityUnionId"
style="width: 100%;" style="width: 100%;"
clearable="true" clearable="true"
@change="flushUnits" @clear="flushUnits" @change="flushUnits" @clear="flushUnits"
filterable="true"> filterable="true">
<el-option v-for="item in ActivityUnions" :label="item.unionname" <el-option v-for="item in ActivityUnions" :label="item.unionname"
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</div>
</div>
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')}">
<div class="search-item-label">活动单位</div>
<div class="search-item-option">
<el-select placeholder="所属单位" v-model="pageForm.activityUnitId"
style="width: 100%;"
clearable="true"
@change="doSearch"
filterable="true">
<el-option v-for="item in ActivityUnits" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</div>-->
<div class="search-item">
<div class="search-item-label">人员类型</div>
<div class="search-item-option">
<dict-select v-model="pageForm.personType" code="PERSON_TYPE" @change="doSearch" style="width: 100%"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">在职状态</div>
<div class="search-item-option">
<dict-select
v-model="pageForm.userState"
style="width: 100%"
clearable
placeholder="在职状态"
@change="doSearch"
code="USER_STATE"
></dict-select>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</div>
</div> </div>
</el-card> </div>
<el-card shadow="never" class="mt10"> <div class="search-item" v-if="${@shiro.hasRole('sysadmin')}">
<table-tool :label="currentGroupName"> <div class="search-item-label">活动单位</div>
<el-button @click="doExportUser" icon="el-icon-printer" size="small" type="primary" :disabled="!pageForm.groupId"> <div class="search-item-option">
导出活动分组人员xlsx <el-select placeholder="所属单位" v-model="pageForm.activityUnitId"
</el-button> style="width: 100%;"
<el-button @click="doDelete(null)" type="danger" size="small" :disabled="tableData.length === 0"> clearable="true"
删除{{ currentGroupName }} @change="doSearch"
</el-button> filterable="true">
</table-tool> <el-option v-for="item in ActivityUnits" :label="item.name"
<el-table ref="userTable" :data="tableData" stripe border :size="tableSize" @sort-change="pageOrder"> :value="item.id"></el-option>
<el-table-column label="序号" type="index" width="80"> </el-select>
<template slot-scope="scope"> </div>
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }}</span> </div>-->
</template>
</el-table-column> <div class="search-item">
<el-table-column <div class="search-item-label">人员类型</div>
align="center" <div class="search-item-option">
header-align="center" <dict-select v-model="pageForm.personType" code="PERSON_TYPE" @change="doSearch"
v-for="column in tableColumns" style="width: 100%"></dict-select>
show-overflow-tooltip </div>
:label="column.label" </div>
:prop="column.prop"
:key="column.prop" <div class="search-item">
:sortable="column.sortable" <div class="search-item-label">在职状态</div>
></el-table-column> <div class="search-item-option">
<el-table-column align="center" header-align="center" label="操作" width="100"> <dict-select
<template slot-scope="{ row }"> v-model="pageForm.userState"
<el-button size="mini" type="danger" @click="doDelete(row.id)">删除</el-button> style="width: 100%"
</template> clearable
</el-table-column> placeholder="在职状态"
</el-table> @change="doSearch"
<el-row class="el-pagination-container" style="margin-bottom: 0px"> code="USER_STATE"
<el-pagination ></dict-select>
@size-change="pageSizeChange" </div>
@current-change="pageNumberChange" </div>
:current-page="pageForm.pageNumber"
:page-sizes="[5, 10, 20, 30, 50]" <div class="search-query">
:page-size="pageForm.pageSize" <el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
layout="total, sizes, prev, pager, next" </div>
:total="pageForm.totalCount" </div>
></el-pagination> </el-card>
</el-row>
</el-card> <el-card shadow="never" class="mt10">
</div> <table-tool :label="currentGroupName">
<el-button v-if="is_sysadmin||is_A06"
type="primary" size="medium" icon="el-icon-printer" @click="importDialogVisible=true">
导入XLSX查询
</el-button>
<el-button @click="doExportUser" icon="el-icon-printer" size="small" type="primary"
:disabled="!pageForm.groupId">
导出活动分组人员xlsx
</el-button>
<el-button @click="doDelete(null)" type="danger" size="small" :disabled="tableData.length === 0">
删除{{ currentGroupName }}
</el-button>
</table-tool>
<el-table ref="userTable" :data="tableData" stripe border :size="tableSize" @sort-change="pageOrder">
<el-table-column label="序号" type="index" width="80">
<template slot-scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }}</span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:key="column.prop"
:sortable="column.sortable"
></el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="100">
<template slot-scope="{ row }">
<el-button size="mini" type="danger" @click="doDelete(row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[5, 10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="pageForm.totalCount"
></el-pagination>
</el-row>
</el-card>
<el-dialog :visible.sync="importDialogVisible" title="人员导入" width="45%" :append-to-body="true"
:close-on-click-modal="false">
<activity-import-user ref="importUserRef"
@clear_import_dialog="clearImportDialog"
@flush="flush"
do_import_url="/platform/activity/basic/user/doImport"
:group_id="pageForm.groupId"
:exists_login_name_redis_key="pageForm.existsLoginNameRedisKey"></activity-import-user>
</el-dialog>
</div>
</template> </template>
<script> <script>
module.exports = { module.exports = {
props: { props: {
group_id: { group_id: {
type: String, type: String,
default: "" default: ""
}
},
computed: {
is_H10() {
return this.roleData.is_H10
},
is_A06() {
return this.roleData.is_A06
},
is_H04() {
return this.roleData.is_H04
},
is_H02() {
return this.roleData.is_H02
},
is_H03() {
return this.roleData.is_H03
},
is_sysadmin() {
return this.roleData.is_sysadmin
},
unionid() {
return this.roleData.unionid
}
},
data() {
return {
activityGroupList: [],
ActivityUnions: [],
ActivityUnits: [],
unions: [],
units: [],
pageForm: {
unionId: "",
unitId: "",
searchName: "username",
personTypes: [],
userStates: [],
memberStatus: [],
year: moment().format("YYYY")
},
tableColumns: [
{ prop: "loginName", label: "工号" },
{ prop: "userName", label: "姓名" },
{ prop: "sex", label: "性别", sortable: true },
{ prop: "birthday", label: "出生年月" },
{ prop: "mobile", label: "联系电话" },
{ prop: "personType", label: "人员类型", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "groupName", label: "所属分组", sortable: true }
],
roleData: {},
currentGroupName: null
}
},
mixins: [initTableMixins],
components: {},
methods: {
viewGroupName() {
if (this.pageForm?.groupId) {
const group = this.activityGroupList.find((v) => v.groupId === this.pageForm.groupId)
this.currentGroupName = group.groupName + "人员"
return
}
this.currentGroupName = "全部人员"
},
doExportUser() {
window.open("/platform/activity/basic/user/doExportUser?groupId=" + this.pageForm.groupId)
},
doSearch2() {
this.getActivityGroup()
this.doSearch()
},
async doDelete(id, groupId) {
const confirm = await this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
let pageForm = clone(this.pageForm)
pageForm.id = id
const resp = await $.post("/platform/activity/basic/user/doDelete", pageForm)
if (resp.code === 0) {
this.$message.success(resp.msg)
await this.getActivityGroup(this.pageForm.groupId)
this.$emit("group_change")
} else {
}
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if (this.is_A06 || this.is_sysadmin) {
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
// this.ActivityUnits = await getActivityUnits(this.pageForm.activityUnionId)
} else {
this.units = await this.$businessTool.listUnit(this.unionid)
}
},
async getActivityGroup(id) {
const resp = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
this.activityGroupList = resp.data
if (resp.data && resp.data.length > 0) {
if (id) {
if (this.activityGroupList.some((v) => v.groupId === id)) {
this.$set(this.pageForm, "groupId", id)
} else {
this.$set(this.pageForm, "groupId", resp.data[0].groupId)
}
} else {
this.$set(this.pageForm, "groupId", resp.data[0].groupId)
}
}
await this.doSearch()
},
async getRolesAndUnion() {
const { data } = await $.post("/platform/activity/basic/scope/getRolesAndUnion")
this.roleData = data
},
async pageData() {
const resp = await $.post("/platform/activity/basic/user/pageData", this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
}
}
},
async created() {
this.unions = await this.$businessTool.listUnion()
// this.ActivityUnions = await getActivityUnions()
await this.flushUnits()
await this.getActivityGroup()
await this.getRolesAndUnion()
this.viewGroupName()
} }
},
computed: {
is_H10() {
return this.roleData.is_H10
},
is_A06() {
return this.roleData.is_A06
},
is_H04() {
return this.roleData.is_H04
},
is_H02() {
return this.roleData.is_H02
},
is_H03() {
return this.roleData.is_H03
},
is_sysadmin() {
return this.roleData.is_sysadmin
},
unionid() {
return this.roleData.unionid
}
},
data() {
return {
activityGroupList: [],
ActivityUnions: [],
ActivityUnits: [],
unions: [],
units: [],
pageForm: {
unionId: "",
unitId: "",
searchName: "username",
personTypes: [],
userStates: [],
memberStatus: [],
year: moment().format("YYYY")
},
tableColumns: [
{prop: "loginName", label: "工号"},
{prop: "userName", label: "姓名"},
{prop: "sex", label: "性别", sortable: true},
{prop: "birthday", label: "出生年月"},
{prop: "mobile", label: "联系电话"},
{prop: "personType", label: "人员类型", sortable: true},
{prop: "userState", label: "在职状态", sortable: true},
{prop: "unitName", label: "所属单位", sortable: true},
{prop: "unionName", label: "所属工会", sortable: true},
{prop: "groupName", label: "所属分组", sortable: true}
],
roleData: {},
currentGroupName: null,
importDialogVisible: false,
}
},
mixins: [initTableMixins],
components: {
"activity-import-user": httpVueLoader("/components/module/activity/ActivityImportUser.vue?v=" + new Date().getTime())
},
methods: {
flush(exists_login_name_redis_key) {
this.pageForm.existsLoginNameRedisKey = exists_login_name_redis_key
this.doSearch()
},
clearImportDialog() {
this.importDialogVisible = false
},
viewGroupName() {
if (this.pageForm?.groupId) {
const group = this.activityGroupList.find((v) => v.groupId === this.pageForm.groupId)
this.currentGroupName = group.groupName + "人员"
return
}
this.currentGroupName = "全部人员"
},
doExportUser() {
window.open("/platform/activity/basic/user/doExportUser?groupId=" + this.pageForm.groupId)
},
doSearch2() {
this.getActivityGroup()
this.doSearch()
},
async doDelete(id, groupId) {
const confirm = await this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
let pageForm = clone(this.pageForm)
pageForm.id = id
const resp = await $.post("/platform/activity/basic/user/doDelete", pageForm)
if (resp.code === 0) {
this.$message.success(resp.msg)
await this.getActivityGroup(this.pageForm.groupId)
this.$emit("group_change")
} else {
}
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if (this.is_A06 || this.is_sysadmin) {
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
// this.ActivityUnits = await getActivityUnits(this.pageForm.activityUnionId)
} else {
this.units = await this.$businessTool.listUnit(this.unionid)
}
},
async getActivityGroup(id) {
const resp = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
this.activityGroupList = resp.data
if (resp.data && resp.data.length > 0) {
if (id) {
if (this.activityGroupList.some((v) => v.groupId === id)) {
this.$set(this.pageForm, "groupId", id)
} else {
this.$set(this.pageForm, "groupId", resp.data[0].groupId)
}
} else {
this.$set(this.pageForm, "groupId", resp.data[0].groupId)
}
}
await this.doSearch()
},
async getRolesAndUnion() {
const {data} = await $.post("/platform/activity/basic/scope/getRolesAndUnion")
this.roleData = data
},
async pageData() {
const resp = await $.post("/platform/activity/basic/user/pageData", this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
}
}
},
async created() {
this.unions = await this.$businessTool.listUnion()
// this.ActivityUnions = await getActivityUnions()
await this.flushUnits()
await this.getActivityGroup()
await this.getRolesAndUnion()
this.viewGroupName()
}
} }
</script> </script>
File diff suppressed because it is too large Load Diff
@@ -36,6 +36,7 @@
} }
" "
:auto-upload="false" :auto-upload="false"
action
:limit="1" :limit="1"
:file-list="importData.fileList" :file-list="importData.fileList"
> >
@@ -2,10 +2,11 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
template: /*language=HTML*/ ` template: /*language=HTML*/ `
<div> <div>
<template> <template>
<el-card shadow="never" style="min-height: calc(100vh - 70px);position: relative"> <el-card shadow="never">
<snaker-start slot="header" label="文化活动申报" define_key="WHHD"
v-if="activity_type===40002||activity_type===40003"></snaker-start>
<el-form :model="formData" :rules="formRules" label-suffix="" label-width="170px" <el-form :model="formData" :rules="formRules" label-suffix="" label-width="170px"
ref="addForm" v-loading="formLoading"> ref="addForm" v-loading="formLoading">
<el-tabs tab-position="top" v-model="activeName"> <el-tabs tab-position="top" v-model="activeName">
<el-tab-pane label="活动基础信息" name="1"> <el-tab-pane label="活动基础信息" name="1">
<div class="mt20"> <div class="mt20">
@@ -44,7 +45,6 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
<el-form-item label="是否用于报名" prop="isEnrollSystem"> <el-form-item label="是否用于报名" prop="isEnrollSystem">
<el-radio-group v-model="formData.isEnrollSystem" size="small"> <el-radio-group v-model="formData.isEnrollSystem" size="small">
<el-radio border :label="true">活动报名</el-radio> <el-radio border :label="true">活动报名</el-radio>
<el-radio border :label="false">活动管理</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -84,20 +84,20 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="12"--> <!-- <el-col :span="12"-->
<!-- v-if="formData.isEnrollSystem === true">--> <!-- v-if="formData.isEnrollSystem === true">-->
<!-- <el-form-item label="活动计划时间" prop="plannedDate">--> <!-- <el-form-item label="活动计划时间" prop="plannedDate">-->
<!-- <el-date-picker--> <!-- <el-date-picker-->
<!-- @change="plannedDateChange"--> <!-- @change="plannedDateChange"-->
<!-- end-placeholder="结束日期"--> <!-- end-placeholder="结束日期"-->
<!-- range-separator="-"--> <!-- range-separator="-"-->
<!-- start-placeholder="开始日期"--> <!-- start-placeholder="开始日期"-->
<!-- style="width: 100%"--> <!-- style="width: 100%"-->
<!-- type="daterange"--> <!-- type="daterange"-->
<!-- v-model="formData.plannedDate" value-format="yyyy-MM-dd">--> <!-- v-model="formData.plannedDate" value-format="yyyy-MM-dd">-->
<!-- </el-date-picker>--> <!-- </el-date-picker>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="实际活动时间" prop="time"> <el-form-item label="实际活动时间" prop="time">
@@ -181,7 +181,9 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
<el-form-item label="报名人数限制" prop="userNumberLimit"> <el-form-item label="报名人数限制" prop="userNumberLimit">
<el-radio-group v-model="formData.userNumberLimit" size="small"> <el-radio-group v-model="formData.userNumberLimit" size="small">
<el-radio border :label="1">总人数限制</el-radio> <el-radio border :label="1">总人数限制</el-radio>
<el-radio border :label="2" v-if="activity_type===40001">分工会人数限制</el-radio> <el-radio border :label="2" v-if="activity_type===40001">
分工会人数限制
</el-radio>
<el-radio border :label="null">不限制</el-radio> <el-radio border :label="null">不限制</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@@ -472,15 +474,12 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
</el-alert> </el-alert>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div style="padding: 20px;text-align: center;">
<el-button @click="operation" style="width: 300px" type="primary" :disabled="formLoading">
确 定
</el-button>
</div>
</el-form> </el-form>
<el-row type="flex" justify="end" class="mt20">
<el-button type="primary" plain @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit" v-if="!taskId">提交</el-button>
<el-button type="primary" @click="onFinishTask" v-else>提交</el-button>
</el-row>
</el-card> </el-card>
<drawer-user-scope <drawer-user-scope
@@ -489,7 +488,8 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
:group_id.sync="formData.groupId" :group_id.sync="formData.groupId"
></drawer-user-scope> ></drawer-user-scope>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :visible.sync="userDialogVisible" title="添加人员" width="40%"> <el-dialog :append-to-body="true" :close-on-click-modal="false" :visible.sync="userDialogVisible"
title="添加人员" width="40%">
<el-form :model="formData" label-width="100px"> <el-form :model="formData" label-width="100px">
<el-form-item label="参加人员" prop="userId"> <el-form-item label="参加人员" prop="userId">
@@ -522,25 +522,28 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
`, `,
props: { props: {
activity_type: { activity_type: {
value: { type: Object, default: "" } value: {type: Object, default: ""}
} }
}, },
mixins: [initTableMixins], mixins: [initTableMixins],
data() { data() {
return { return {
bizId: "",
taskId: "",
activeName: "1", activeName: "1",
pageForm: { pageForm: {
year: new Date().getFullYear() + "" year: new Date().getFullYear() + ""
}, },
formRules: { formRules: {
groupId: [{ required: true, message: "必填", trigger: ["blur", "change"] }], groupId: [{required: true, message: "必填", trigger: ["blur", "change"]}],
name: [{ required: true, message: "必填", trigger: ["blur", "change"] }], name: [{required: true, message: "必填", trigger: ["blur", "change"]}],
type: [{ required: true, message: "必填", trigger: ["blur", "change"] }], type: [{required: true, message: "必填", trigger: ["blur", "change"]}],
projectTypeCode: [{ required: true, message: "必填", trigger: ["blur", "change"] }], projectTypeCode: [{required: true, message: "必填", trigger: ["blur", "change"]}],
address: [{ required: true, message: "必填", trigger: ["blur", "change"] }], address: [{required: true, message: "必填", trigger: ["blur", "change"]}],
plannedDate: [{ required: true, message: "必填", trigger: ["blur", "change"] }], plannedDate: [{required: true, message: "必填", trigger: ["blur", "change"]}],
time: [{ required: true, message: "必填", trigger: ["blur", "change"] }], time: [{required: true, message: "必填", trigger: ["blur", "change"]}],
cover: [{ required: true, message: "必填", trigger: ["blur", "change"] }] cover: [{required: true, message: "必填", trigger: ["blur", "change"]}]
}, },
projectTypeList: [], projectTypeList: [],
@@ -557,12 +560,12 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
selectLoading: false, selectLoading: false,
userColumns: [ userColumns: [
{ prop: "userName", label: "姓名" }, {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: "所属工会"}
] ]
} }
}, },
@@ -584,10 +587,133 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
} }
}, },
methods: { methods: {
// 保存
onSave() {
this.$confirm("您确定保存吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const formData = JSON.parse(JSON.stringify(this.formData))
formData.activity_type = this.activity_type
const {time, applyTime2, plannedDate} = formData
if (applyTime2 && applyTime2.length) {
formData.applyStartTime = applyTime2[0]
formData.applyEndTime = applyTime2[1]
formData.applyTime2 = null
}
if (time && time.length) {
formData.startTime = formData.time[0]
formData.endTime = formData.time[1]
formData.time = null
}
if (plannedDate && plannedDate.length) {
formData.startPlannedDate = formData.plannedDate[0]
formData.endPlannedDate = formData.plannedDate[1]
formData.plannedDate = null
}
this.$axios.post('/platform/activity/culture/applyActivity/save', {data: JSON.stringify(formData)}).then(res => {
if (res.code === 0) {
this.$message.success("保存成功")
if (this.activity_type === 40002) {
window.location.href = "/platform/activity/culture/infoManage/union"
} else if (this.activity_type === 40003) {
window.location.href = "/platform/activity/culture/infoManage/club"
} else {
window.location.href = "/platform/activity/culture/infoManage/school"
}
}
})
})
},
// 提交
onSubmit() {
this.$confirm("您确定保存吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const formData = JSON.parse(JSON.stringify(this.formData))
formData.activity_type = this.activity_type
const {time, applyTime2, plannedDate} = formData
if (applyTime2 && applyTime2.length) {
formData.applyStartTime = applyTime2[0]
formData.applyEndTime = applyTime2[1]
formData.applyTime2 = null
}
if (time && time.length) {
formData.startTime = formData.time[0]
formData.endTime = formData.time[1]
formData.time = null
}
if (plannedDate && plannedDate.length) {
formData.startPlannedDate = formData.plannedDate[0]
formData.endPlannedDate = formData.plannedDate[1]
formData.plannedDate = null
}
this.$axios.post('/platform/activity/culture/applyActivity/submit', {
data: JSON.stringify(formData)
}).then(res => {
if (res.code === 0) {
this.$message.success("提交成功")
if (this.activity_type === 40002) {
window.location.href = "/platform/activity/culture/infoManage/union"
} else if (this.activity_type === 40003) {
window.location.href = "/platform/activity/culture/infoManage/club"
} else {
window.location.href = "/platform/activity/culture/infoManage/school"
}
}
})
})
},
// 再次提交
onFinishTask() {
this.$confirm("您确定保存吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const formData = JSON.parse(JSON.stringify(this.formData))
formData.activity_type = this.activity_type
const {time, applyTime2, plannedDate} = formData
if (applyTime2 && applyTime2.length) {
formData.applyStartTime = applyTime2[0]
formData.applyEndTime = applyTime2[1]
formData.applyTime2 = null
}
if (time && time.length) {
formData.startTime = formData.time[0]
formData.endTime = formData.time[1]
formData.time = null
}
if (plannedDate && plannedDate.length) {
formData.startPlannedDate = formData.plannedDate[0]
formData.endPlannedDate = formData.plannedDate[1]
formData.plannedDate = null
}
this.$axios.post('/platform/activity/culture/applyActivity/submitAgain', {
data: JSON.stringify(formData),
taskId: this.taskId
}).then(res => {
if (res.code === 0) {
this.$message.success("提交成功")
if (this.activity_type === 40002) {
window.location.href = "/platform/activity/culture/infoManage/union"
} else if (this.activity_type === 40003) {
window.location.href = "/platform/activity/culture/infoManage/club"
} else {
window.location.href = "/platform/activity/culture/infoManage/school"
}
}
})
})
},
async remoteMethod(query) { async remoteMethod(query) {
if (query) { if (query) {
this.selectLoading = true this.selectLoading = true
const { data } = await this.$axios.post("/platform/activity/culture/applyActivity/findUser", { const {data} = await this.$axios.post("/platform/activity/culture/applyActivity/findUser", {
serachWord: query, serachWord: query,
activity_type: this.activity_type activity_type: this.activity_type
}) })
@@ -624,7 +750,7 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
this.formLoading = true this.formLoading = true
const formData = JSON.parse(JSON.stringify(this.formData)) const formData = JSON.parse(JSON.stringify(this.formData))
formData.activity_type = this.activity_type formData.activity_type = this.activity_type
const { time, applyTime2, plannedDate } = formData const {time, applyTime2, plannedDate} = formData
if (applyTime2 && applyTime2.length) { if (applyTime2 && applyTime2.length) {
formData.applyStartTime = applyTime2[0] formData.applyStartTime = applyTime2[0]
formData.applyEndTime = applyTime2[1] formData.applyEndTime = applyTime2[1]
@@ -715,28 +841,28 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
this.$set(this.formData, "mobile", id ? userList.find((v) => v.id === id).mobile : null) this.$set(this.formData, "mobile", id ? userList.find((v) => v.id === id).mobile : null)
}, },
async getActivityTwoLevelType(code) { async getActivityTwoLevelType(code) {
const { data } = await this.$axios.post("/platform/activity/basic/settings/getActivityTwoLevelType", { code: code }) const {data} = await this.$axios.post("/platform/activity/basic/settings/getActivityTwoLevelType", {code: code})
return data return data
}, },
async getActivityGroup() { async getActivityGroup() {
const { data } = await this.$axios.post("/platform/activity/basic/scope/getActivityUserScopeGroup") const {data} = await this.$axios.post("/platform/activity/basic/scope/getActivityUserScopeGroup")
this.activityGroupList = data this.activityGroupList = data
}, },
async generateActivityCode() { async generateActivityCode() {
const { data } = await this.$axios.post("/platform/activity/sports/common/generateActivityCode", { activity_type: this.activity_type }) const {data} = await this.$axios.post("/platform/activity/sports/common/generateActivityCode", {activity_type: this.activity_type})
return data return data
}, },
async getUnionData() { async getUnionData() {
const { data } = await this.$axios.post("/platform/activity/culture/applyActivity/getUnionData", { const {data} = await this.$axios.post("/platform/activity/culture/applyActivity/getUnionData", {
activityScopeGroupId: this.formData.groupId activityScopeGroupId: this.formData.groupId
}) })
return data return data
}, },
init(id) { init(id) {
if (id){ if (id) {
this.activeName = "1" this.activeName = "1"
this.findOne(id) this.findOne(id)
}else{ } else {
this.formData = { this.formData = {
time: [], time: [],
applyTime2: [], applyTime2: [],
@@ -762,11 +888,11 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
} }
}, },
async queryUserByIds(ids) { async queryUserByIds(ids) {
const { data } = await this.$axios.post("/platform/activity/culture/applyActivity/queryUserByIds", { ids: JSON.stringify(ids) }) const {data} = await this.$axios.post("/platform/activity/culture/applyActivity/queryUserByIds", {ids: JSON.stringify(ids)})
return data return data
}, },
async findOne(id) { async findOne(id) {
const { data, code, msg } = await this.$axios.post("/platform/activity/culture/infoManage/findOne", { id }) const {data, code, msg} = await this.$axios.post("/platform/activity/culture/infoManage/findOne", {id})
if (code === 0) { if (code === 0) {
if (data.userId) { if (data.userId) {
const user = await this.queryUserByIds([data.userId]) const user = await this.queryUserByIds([data.userId])
@@ -789,9 +915,11 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
} }
} }
}, },
openEdit(id) { openEdit(row) {
this.taskId=row.startTaskId
this.bizId=row.id
this.activeName = "1" this.activeName = "1"
this.init(id) this.init(row.id)
} }
}, },
async created() { async created() {
@@ -17,7 +17,7 @@ const ACTIVITY_CULTURE_APPLY_USER = {
></el-date-picker> ></el-date-picker>
</search-item> </search-item>
<search-item label="活动时间"> <search-item label="活动名称">
<el-input clearable placeholder="请输入活动名称" <el-input clearable placeholder="请输入活动名称"
v-model="pageForm.name"></el-input> v-model="pageForm.name"></el-input>
</search-item> </search-item>
@@ -34,8 +34,8 @@ const ACTIVITY_CULTURE_APPLY_USER = {
<el-card class="mt10" shadow="never"> <el-card class="mt10" shadow="never">
<table-tool label="活动列表"> <table-tool label="活动列表">
<el-radio-group v-model="pageForm.isEnrolled" @change="doSearch" size="mini" class="ml10"> <el-radio-group v-model="pageForm.isEnrolled" @change="doSearch" size="mini" class="ml10">
<el-radio-button :label="false">未报名</el-radio-button>
<el-radio-button :label="true">已报名</el-radio-button> <el-radio-button :label="true">已报名</el-radio-button>
<el-radio-button :label="false">未报名</el-radio-button>
</el-radio-group> </el-radio-group>
</table-tool> </table-tool>
@@ -132,7 +132,7 @@ const ACTIVITY_CULTURE_APPLY_USER = {
}, },
openView(row) { openView(row) {
this.$refs.guava.view(() => { this.$refs.guava.view(() => {
this.$refs.infoActivity.findOne(row.id) this.$refs.infoActivity.onOpen(row)
}) })
}, },
pageData() { pageData() {
@@ -38,7 +38,7 @@ const ACTIVITY_CULTURE_AUDIT_ACTIVITY = {
<el-card class="mt10" shadow="never"> <el-card class="mt10" shadow="never">
<table-tool :app="this" label="活动列表"> <table-tool :app="this" label="活动列表">
<el-radio-group @change="doSearch" size="small" v-model="pageForm.state"> <el-radio-group @change="doSearch" size="small" v-model="pageForm.approval">
<el-radio-button :key="i.code" :label="i.code" v-for="i in auditList">{{i.name}} <el-radio-button :key="i.code" :label="i.code" v-for="i in auditList">{{i.name}}
</el-radio-button> </el-radio-button>
</el-radio-group> </el-radio-group>
@@ -70,89 +70,62 @@ const ACTIVITY_CULTURE_AUDIT_ACTIVITY = {
{{row.projectTypeName}}({{row.projectTypeCode}}) {{row.projectTypeName}}({{row.projectTypeCode}})
</template> </template>
<template scope="{row}" v-else-if="column.prop=='tussueName'"> <template scope="{row}" v-else-if="column.prop=='curTaskName'">
<span v-if="row.activity_type==40002">{{row.unionname?row.unionname:'暂无'}}</span> <span v-if="row.activity_type==40002 || row.activity_type==40003">
<span v-if="row.activity_type==40003">{{row.clubName?row.clubName:'暂无'}}</span> {{row.curTaskName}}
<span v-if="row.activity_type==40001">校工会</span> </span>
<span v-else>-</span>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='state'"> <template scope="{row}" v-else-if="column.prop=='instanceState'">
{{row.state===1?'未审核':row.state===2?'审核不通过':'审核通过'}} <span v-if="row.activity_type==40002 || row.activity_type==40003">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</span>
<span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" <el-table-column align="center" header-align="center" label="操作"
prop="userOnline" width="150px"> prop="userOnline" width="150px">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button :loading="row.loading" @click="openView(row)" size="mini"> <el-button :loading="row.loading" @click="onView(row)" size="mini">
查看 查看
</el-button> </el-button>
<el-button :loading="row.loading" @click="openAudit(row)" size="mini" <el-button v-if="row.taskState === 10" @click="openAudit(row)" size="mini" type="primary">
type="primary" 审核
v-if="row.state===1">
审核
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--#include("/layouts/pagination.html"){}#--> <!--#include("/layouts/pagination.html"){}#-->
</el-card> </el-card>
</template> </template>
<template #edit> <template #edit>
<activity-culture-info-activity handle label="校工会审核" ref="editInfo"> <activity-culture-info-activity handle label="校工会审核" ref="editInfo">
<template #handle> <div v-if="showApprovalForm">
<el-form :model="formData" label-position="right" <div class="process-title">
label-width="120px" {{formData.taskName}}
style="padding: 20px 0"> </div>
<el-form-item class="view-header" label="审核信息" label-width="135px"> <el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=""
</el-form-item> class="flow-task-form">
<el-form-item label="审批意见" prop="tf_opinion"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-row :gutter="20"> <user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
<el-col :span="12"> </el-form-item>
<el-form-item label="审核人" prop="username"> </el-form>
<el-input disabled <el-row type="flex" justify="end">
v-model="formData.username"></el-input> <el-button @click="$refs.guava.index()" size="small">取消</el-button>
</el-form-item> <el-button @click="handleTaskAction(6)" size="small" type="info">退回到发起人</el-button>
</el-col> <el-button @click="handleTaskAction(2)" size="small" type="danger">拒绝申请</el-button>
<el-col :span="12"> <el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
<el-form-item label="审核时间" prop="time"> </el-row>
<el-input disabled v-model="formData.auditTime"></el-input> </div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="审核意见" prop="idea">
<el-input maxlength="500" placeholder="请填写您的审核意见"
rows="4" type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button :disabled="subDis" @click="doReview(false)"
type="danger">拒
</el-button>
<el-button :disabled="subDis" @click="doReview(true)"
type="success">通
</el-button>
</div>
</template>
</activity-culture-info-activity> </activity-culture-info-activity>
</template> </template>
<template #view>
<activity-culture-info-activity ref="infoActivity"></activity-culture-info-activity>
</template>
</guava> </guava>
`, `,
props: { props: {
@@ -166,12 +139,13 @@ const ACTIVITY_CULTURE_AUDIT_ACTIVITY = {
return { return {
subDis: false, subDis: false,
unionList: [], unionList: [],
showApprovalForm: false,
auditList: [ auditList: [
{ code: true, name: "已审核" }, { code: true, name: "已审核" },
{ code: false, name: "未审核" } { code: false, name: "未审核" }
], ],
pageForm: { pageForm: {
state: false, approval: false,
year: new Date().getFullYear() + "" year: new Date().getFullYear() + ""
}, },
tableColumns: [ tableColumns: [
@@ -181,7 +155,6 @@ const ACTIVITY_CULTURE_AUDIT_ACTIVITY = {
{ prop: "tussueName", label: "举办单位" }, { prop: "tussueName", label: "举办单位" },
{ prop: "time", label: "活动日期" }, { prop: "time", label: "活动日期" },
{ prop: "applyTime", label: "创建时间", sortable: true }, { prop: "applyTime", label: "创建时间", sortable: true },
{ prop: "state", label: "审核状态", sortable: true }
] ]
} }
}, },
@@ -189,39 +162,23 @@ const ACTIVITY_CULTURE_AUDIT_ACTIVITY = {
"activity-culture-info-activity": ACTIVITY_CULTURE_INFO_ACTIVITY "activity-culture-info-activity": ACTIVITY_CULTURE_INFO_ACTIVITY
}, },
methods: { methods: {
async doReview(flag) {
const confirm = await this.$confirm("确定要审核" + (flag ? "通过" : "拒绝") + "吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
this.formData.flag = flag
this.subDis = true
flag ? (this.subLoading2 = true) : (this.subLoading1 = true)
const resp = await $.post("/platform/activity/culture/auditActivity/doReview", this.formData)
if (resp.code === 0) {
this.pageData()
this.$refs.guava.index()
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
}
}
},
openAudit(row) { openAudit(row) {
this.$refs.guava.edit() this.$refs.guava.edit(()=>{
this.$refs.editInfo.findOne(row.id) this.showApprovalForm = true
this.formData = { this.formData = {
id: row.id, processTaskId: row.taskId,
username: this.$store.state.user.username, taskName: row.curTaskName
auditTime: this.$moment().format("YYYY-MM-DD") }
} this.$refs.editInfo.onOpen(row)
})
}, },
openView(row) { onView(row) {
const { id } = row this.$refs.guava.edit(()=>{
this.$refs.guava.view() this.showApprovalForm = false
this.$refs.infoActivity.findOne(id) this.$refs.editInfo.onOpen(row)
})
}, },
pageData() { pageData() {
this.tableLoading = true this.tableLoading = true
@@ -233,9 +190,50 @@ const ACTIVITY_CULTURE_AUDIT_ACTIVITY = {
} }
}) })
this.tableLoading = false this.tableLoading = false
},
handleTaskAction(val) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
onRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
})
} }
}, },
async created() { async created() {
// 根据 activity_type 动态添加流程相关列
if (this.activity_type === 40002 || this.activity_type === 40003) {
this.tableColumns.push(
{prop: "curTaskName", label: "当前节点"},
{prop: "instanceState", label: "流程状态"}
);
}
this.unionList = await this.$businessTool.listUnion() this.unionList = await this.$businessTool.listUnion()
this.pageData() this.pageData()
} }
@@ -1,123 +1,129 @@
const ACTIVITY_CULTURE_INFO_ACTIVITY = { const ACTIVITY_CULTURE_INFO_ACTIVITY = {
template: /*language=HTML*/ ` template: /*language=HTML*/ `
<el-tabs tab-position="top" v-loading="loading" v-model="activeName"> <div>
<el-tab-pane label="活动基础信息" name="1"> <div class="process-title">
<el-descriptions :column="3" border class="margin-top" style="margin: 10px" title=""> 申请信息
<el-descriptions-item label="活动名称" span="3"> <el-link type="primary" @click="openChart">点击查看流程图</el-link>
<span class="item-center"> {{ viewData.name }}</span> </div>
</el-descriptions-item> <el-descriptions :column="3" border class="margin-top" style="margin: 10px" title="">
<el-descriptions-item label="联系人"> <el-descriptions-item label="活动名称" span="3">
<span class="item-center"> {{ viewData.name }}</span>
</el-descriptions-item>
<el-descriptions-item label="联系人">
<span v-if="viewData.username"> <span v-if="viewData.username">
{{ viewData.username }} {{ viewData.username }}
({{ viewData.loginname }})</span> ({{ viewData.loginname }})</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="联系方式"> <el-descriptions-item label="联系方式">
{{ viewData.mobile }} {{ viewData.mobile }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="活动编号"> <el-descriptions-item label="活动编号">
{{ viewData.activityCode }} {{ viewData.activityCode }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="活动编号"> <el-descriptions-item label="活动项目类型">
{{ viewData.projectTypeName }}({{ viewData.projectTypeCode }}) {{ viewData.projectTypeName }}({{ viewData.projectTypeCode }})
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="活动类型" :span="2"> <el-descriptions-item label="活动类型" :span="2">
{{ viewData.activity_type === 40001 ? '校工会活动' : viewData.activity_type === 40002 ? '分工会活动' {{ viewData.activity_type === 40001 ? '校工会活动' : viewData.activity_type === 40002 ?
: '分工会活动'
'协会/社团活动' }} :
</el-descriptions-item> '协会/社团活动' }}
<!-- <el-descriptions-item label="活动计划时间">--> </el-descriptions-item>
<!-- {{ viewData.startPlannedDate + ' - ' + viewData.endPlannedDate }}--> <!-- <el-descriptions-item label="活动计划时间">-->
<!-- </el-descriptions-item>--> <!-- {{ viewData.startPlannedDate + ' - ' + viewData.endPlannedDate }}-->
<el-descriptions-item label="活动时间"> <!-- </el-descriptions-item>-->
{{ viewData.startTime + ' - ' + viewData.endTime }} <el-descriptions-item label="活动时间">
</el-descriptions-item> {{ viewData.startTime + ' - ' + viewData.endTime }}
<el-descriptions-item label="报名时间" v-if="viewData.applyStartTime"> </el-descriptions-item>
{{ viewData.applyStartTime + ' - ' + viewData.applyEndTime }} <el-descriptions-item label="报名时间" v-if="viewData.applyStartTime">
</el-descriptions-item> {{ viewData.applyStartTime + ' - ' + viewData.applyEndTime }}
<el-descriptions-item label="活动人数"> </el-descriptions-item>
{{ viewData.peopleNum || '暂无' }} <el-descriptions-item label="活动人数">
</el-descriptions-item> {{ viewData.peopleNum || '暂无' }}
<el-descriptions-item label="活动地点"> </el-descriptions-item>
{{ viewData.address }} <el-descriptions-item label="活动地点">
</el-descriptions-item> {{ viewData.address }}
<el-descriptions-item label="报名方式"> </el-descriptions-item>
<span v-if="viewData.signUpMethod===1">个人报名</span> <el-descriptions-item label="报名方式">
<span v-else-if="viewData.signUpMethod===2">分工会报名</span> <span v-if="viewData.signUpMethod===1">个人报名</span>
<span v-else-if="viewData.signUpMethod===3">组队报名</span> <span v-else-if="viewData.signUpMethod===2">组队报名</span>
<span v-else-if="!viewData.signUpMethod">无需报名</span> <span v-else-if="viewData.signUpMethod===3">分工会报名</span>
</el-descriptions-item> <span v-else-if="!viewData.signUpMethod">无需报名</span>
<el-descriptions-item label="是否用于报名"> </el-descriptions-item>
<span v-if="viewData.isEnrollSystem">活动报名</span> <el-descriptions-item label="是否用于报名">
<span v-else>活动管理</span> <span v-if="viewData.isEnrollSystem">活动报名</span>
</el-descriptions-item> <span v-else>活动管理</span>
<el-descriptions-item label="报名人数限制" span="3" v-if="viewData.signUpMethod!=null"> </el-descriptions-item>
<el-descriptions-item label="报名人数限制" span="3" v-if="viewData.signUpMethod!=null">
<span v-if="viewData.userNumberLimit===1">总人数限制({{ <span v-if="viewData.userNumberLimit===1">总人数限制({{
viewData.totalUserNumberLimit viewData.totalUserNumberLimit
}}人)</span> }}人)</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-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="分工会限制名额" span="3" v-if="viewData.userNumberLimit===2"> <el-descriptions-item label="分工会限制名额" span="3" v-if="viewData.userNumberLimit===2">
<el-table :data="viewData.unionUserNumberLimit" border height="500" size="small" <el-table :data="viewData.unionUserNumberLimit" border height="500" size="small"
stripe> stripe>
<el-table-column align="center" header-align="center" label="序号" <el-table-column align="center" header-align="center" label="序号"
type="index" type="index"
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="teacherCount"></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-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="封面图" span="3"> <el-descriptions-item label="封面图" span="3">
<img :src="viewData.cover" <img :src="viewData.cover"
class="avatar" class="avatar"
style="height: 200px;width: auto" v-if="viewData.cover"> style="height: 200px;width: auto" v-if="viewData.cover">
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="活动内容" span="3"> <el-descriptions-item label="活动内容" span="3">
<div v-html="viewData.activityContent"></div> <div v-html="viewData.activityContent"></div>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-tab-pane>
<el-tab-pane label="活动费用" name="2" v-if="!viewData.isEnrollSystem">
</el-tab-pane> <template v-for="task in doneTasks">
<el-tab-pane label="活动总结" name="3" v-if="!viewData.isEnrollSystem"> <div class="mt10">
<el-form label-width="120px" ref="form"> <div class="process-title">{{ task.displayName }}</div>
<el-form-item label="活动总结" prop="activitySummary"> <el-descriptions border class="flow-task-form" :column="3" :key="task.id"
{{ viewData.activitySummary }} v-if="task.ext.isFirstTaskNode">
</el-form-item> <el-descriptions-item label="申请用户">{{ task.ext.initiatorName
</el-form> }}({{task.ext.initiatorAccount}})
</el-tab-pane> </el-descriptions-item>
<el-tab-pane label="审核信息" name="4" v-if="viewData.auditId"> <el-descriptions-item label="申请时间">{{ task.finishTime }}</el-descriptions-item>
<el-form label-width="120px" ref="form"> <el-descriptions-item label="办理结果">
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
:value="task.ext.submitType"></dict-tag>
</el-descriptions-item>
</el-descriptions>
<el-row :gutter="20"> <el-descriptions border class="flow-task-form" :column="3" :key="task.id" v-else>
<el-col :span="12"> <el-descriptions-item label="办理用户">{{ task.taskFormData.userName
<el-form-item label="审核人员:"> }}({{task.taskFormData.loginName}})
{{ viewData.audit.username }} </el-descriptions-item>
</el-form-item> <el-descriptions-item label="办理时间">{{ task.finishTime }}</el-descriptions-item>
</el-col> <el-descriptions-item label="办理结果">
<el-col :span="12"> <dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
<el-form-item label="审核时间:"> :value="task.ext.submitType"></dict-tag>
{{ viewData.audit.auditTime }} </el-descriptions-item>
</el-form-item> <el-descriptions-item label="办理意见" v-if="!task.ext.isFirstTaskNode">{{
</el-col> task.taskFormData.opinion }}
<el-col :span="24"> </el-descriptions-item>
<el-form-item label="审核意见:"> </el-descriptions>
{{ viewData.audit.auditOpinion }} </div>
</el-form-item> </template>
</el-col> <slot></slot>
</el-row>
</el-form> <snaker-chart ref="snakerChartRef"></snaker-chart>
</el-tab-pane> </div>
<el-tab-pane :label="label" name="999" v-if="handle">
<slot name="handle"></slot>
</el-tab-pane>
</el-tabs>
`, `,
store,
dicts: ["PROCESS_TASK_SUBMIT_TYPE"],
styles: [ styles: [
` `
.item-center { .item-center {
@@ -127,20 +133,13 @@ const ACTIVITY_CULTURE_INFO_ACTIVITY = {
} }
` `
], ],
props: {
handle: {
type: Boolean,
default: false
},
label: {
type: String,
default: "审核"
}
},
data() { data() {
return { return {
visible: false,
userData: [], userData: [],
viewData: {}, viewData: {},
row: null,
doneTasks: [],
loading: true, loading: true,
search: "", search: "",
tableKey: "", tableKey: "",
@@ -148,15 +147,9 @@ const ACTIVITY_CULTURE_INFO_ACTIVITY = {
} }
}, },
methods: { methods: {
hasPane(name) { async findOne() {
if (!this.handle) {
return true
}
return this.panes.includes(name)
},
async findOne(id) {
this.loading = true this.loading = true
const { data } = await this.$axios.post("/platform/activity/culture/infoManage/findOne", { id }) const { data } = await this.$axios.post("/platform/activity/culture/infoManage/findOne", { id: this.row.id })
this.loading = false this.loading = false
if (data) { if (data) {
data.billFiles = JSON.parse(data.billFiles) data.billFiles = JSON.parse(data.billFiles)
@@ -172,8 +165,28 @@ const ACTIVITY_CULTURE_INFO_ACTIVITY = {
this.viewData = {} this.viewData = {}
this.$notify.error({ title: "错误", message: "获取信息失败" }) this.$notify.error({ title: "错误", message: "获取信息失败" })
} }
},
// 打开
onOpen(row) {
this.row = row;
this.visible = true;
this.findOne();
this.getDoneTasks();
},
// 获取已办任务审批记录
getDoneTasks() {
this.$axios.post("/flow/common/doneTasks", {bizId: this.row.id}).then((res) => {
if (res.code === 0) {
this.doneTasks = res.data
}
})
},
// 查看流程图
openChart(){
this.$refs.snakerChartRef.onOpenFull(this.row.instanceProcessDefineId,this.row.instanceId)
} }
} }
} }
// <style> // <style>
@@ -66,18 +66,23 @@ const ACTIVITY_CULTURE_INFO_MANAGE = {
</el-switch> </el-switch>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='tussueName'"> <template scope="{row}" v-else-if="column.prop=='taskName'">
<span v-if="row.activity_type==40002">{{row.unionname?row.unionname:'暂无'}}</span> <span v-if="row.activity_type==40002 || row.activity_type==40003">
<span v-if="row.activity_type==40003">{{row.clubName?row.clubName:'暂无'}}</span> {{row.taskName}}
<span v-if="row.activity_type==40001">校工会</span> </span>
</template> <span v-else>-</span>
<template scope="{row}" v-else-if="column.prop=='state'">
{{row.state===1?'未审核':row.state===2?'审核不通过':'审核通过'}}
</template> </template>
<template scope="{row}" v-else-if="column.prop=='instanceState'">
<span v-if="row.activity_type==40002 || row.activity_type==40003">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</span>
<span v-else>-</span>
</template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" <el-table-column align="center" header-align="center" label="操作"
prop="userOnline" width="150px"> prop="userOnline" width="150px">
<template slot-scope="{row}"> <template slot-scope="{row}">
@@ -92,10 +97,17 @@ const ACTIVITY_CULTURE_INFO_MANAGE = {
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item :command="{type:'edit',row}" <el-dropdown-item :command="{type:'edit',row}"
v-if="row.taskKey === 'startTask' || !row.instanceId"
:disabled="row.projectTypeCode==50004"> :disabled="row.projectTypeCode==50004">
编辑 编辑
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item :command="{type:'delete',row}"> <el-dropdown-item
v-if="row.canRevoke" :command="{type:'Revoke',row}">
撤回
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',row}"
v-if="row.taskKey === 'startTask' || !row.instanceId" >
删除 删除
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item :command="{type:'openCode',row}"> <el-dropdown-item :command="{type:'openCode',row}">
@@ -155,9 +167,7 @@ const ACTIVITY_CULTURE_INFO_MANAGE = {
{prop: "time2", label: "报名日期", width: "300"}, {prop: "time2", label: "报名日期", width: "300"},
{prop: "applyTime", label: "创建时间", sortable: true}, {prop: "applyTime", label: "创建时间", sortable: true},
{prop: "isUnseal", label: "是否开启"}, {prop: "isUnseal", label: "是否开启"},
{prop: "state", label: "审核状态", sortable: true} ],
],
url: "" url: ""
} }
}, },
@@ -182,9 +192,11 @@ const ACTIVITY_CULTURE_INFO_MANAGE = {
dropdownCommand(command) { dropdownCommand(command) {
const {type, row} = command const {type, row} = command
if (type === "view") { if (type === "view") {
this.openView(row) this.onView(row)
} else if (type === "edit") { } else if (type === "edit") {
this.openEdit(row) this.openEdit(row)
}else if (type === "Revoke") {
this.onRevoke(row)
} else if (type === "delete") { } else if (type === "delete") {
this.doDelete(row) this.doDelete(row)
} else if (type === "openCode") { } else if (type === "openCode") {
@@ -200,12 +212,12 @@ const ACTIVITY_CULTURE_INFO_MANAGE = {
}, },
openEdit(row) { openEdit(row) {
this.$refs.guava.edit(() => { this.$refs.guava.edit(() => {
this.$refs.applyActivity.openEdit(row.id) this.$refs.applyActivity.openEdit(row)
}) })
}, },
openView(row) { onView(row) {
this.$refs.guava.view(() => { this.$refs.guava.view(()=>{
this.$refs.infoActivity.findOne(row.id) this.$refs.infoActivity.onOpen(row)
}) })
}, },
doDelete(row) { doDelete(row) {
@@ -222,6 +234,20 @@ const ACTIVITY_CULTURE_INFO_MANAGE = {
this.$set(row, "loading", false) this.$set(row, "loading", false)
}) })
}, },
onRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.startTaskId}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
})
},
pageData() { pageData() {
this.tableLoading = true this.tableLoading = true
this.pageForm.activity_type = this.activity_type this.pageForm.activity_type = this.activity_type
@@ -235,6 +261,13 @@ const ACTIVITY_CULTURE_INFO_MANAGE = {
} }
}, },
async created() { async created() {
// 根据 activity_type 动态添加流程相关列
if (this.activity_type === 40002 || this.activity_type === 40003) {
this.tableColumns.push(
{prop: "taskName", label: "当前节点"},
{prop: "instanceState", label: "流程状态"}
);
}
this.pageData() this.pageData()
} }
} }
@@ -153,7 +153,43 @@ const singleSignUp = {
</div> </div>
<!-- 分工会报名--> <!-- 分工会报名-->
<div v-else-if="viewData.signUpMethod===3"> <div v-else-if="viewData.signUpMethod===3">
<div class="process-title">选择报名人员,报名人数 <span style="color: red">{{viewData.teamNum}}</span>人
</div>
<el-select
v-if="inApplyTime"
v-model="searchTeammateUserId"
filterable
clearable
remote
reserve-keyword
placeholder="请输入关键词"
:remote-method="queryTeammate">
<el-option
v-for="item in teammateOptions"
:key="item.userId"
:label="item.userName + '(' + item.loginName + ')'"
:value="item.userId">
</el-option>
</el-select>
<el-button v-if="inApplyTime" class="ml5" type="primary" icon="el-icon-plus"
@click="addTeamUser">添加
</el-button>
<el-table :data="teamUsers" class="mt10">
<el-table-column label="序号" type="index" width="60px"></el-table-column>
<el-table-column prop="userName" label="姓名"></el-table-column>
<el-table-column prop="loginName" label="工号"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="unitName" label="单位"></el-table-column>
<el-table-column prop="mobile" label="手机号"></el-table-column>
<el-table-column label="操作" width="100px"
v-if="inApplyTime">
<template slot-scope="scope">
<el-button type="danger" size="mini" @click="removeTeamUser(scope.$index)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</div> </div>
<!-- 表单填写--> <!-- 表单填写-->
@@ -243,6 +279,18 @@ const singleSignUp = {
}) })
}, },
//查询报名人员
listTeamUserUnion() {
this.$axios.post("/platform/activity/culture/applyUser/listTeamUserUnion", {activityId: this.id}).then((res) => {
if (res.code === 0) {
this.isSignUp = res.data.length > 0
this.teamUsers = res.data
this.defaultAddSelf()
this.customFormInit()
}
})
},
//表单回显 //表单回显
customFormInit() { customFormInit() {
if (this.teamUsers && this.teamUsers.length > 0) { if (this.teamUsers && this.teamUsers.length > 0) {
@@ -300,14 +348,14 @@ const singleSignUp = {
//分工会 //分工会
if (this.viewData.signUpMethod === 3) { if (this.viewData.signUpMethod === 3) {
// if (this.teamUsers.length === 0) { if (this.teamUsers.length === 0) {
// this.$message.warning("请添加报名人员后再提交!") this.$message.warning("请添加报名人员后再提交!")
// return return
// } }
// if (this.teamUsers.length > this.viewData.teamNum) { if (this.teamUsers.length > this.viewData.teamNum) {
// this.$message.warning("您选择的人数大于" + this.viewData.teamNum + "人,请重新选择!") this.$message.warning("您选择的人数大于" + this.viewData.teamNum + "人,请重新选择!")
// return return
// } }
} }
let formData = { let formData = {
@@ -420,7 +468,10 @@ const singleSignUp = {
//查询队友信息 //查询队友信息
queryTeammate(val) { queryTeammate(val) {
if (val) { if (val) {
this.$axios.post("/platform/activity/culture/applyUser/queryTeammate", {keyword: val}).then((res) => { this.$axios.post("/platform/activity/culture/applyUser/queryTeammate", {
keyword: val,
signUpMethod: this.viewData.signUpMethod
}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
res.data.map(v => v.applyUserId = this.$store.state.user.id) res.data.map(v => v.applyUserId = this.$store.state.user.id)
this.teammateOptions = res.data this.teammateOptions = res.data
@@ -457,11 +508,18 @@ const singleSignUp = {
this.$axios.post("/platform/activity/culture/infoManage/activityInfo", {id: this.id}).then((res) => { this.$axios.post("/platform/activity/culture/infoManage/activityInfo", {id: this.id}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.viewData = res.data this.viewData = res.data
if (this.viewData.signUpMethod === 3) {
const union = this.viewData.unionUserNumberLimit.find(v => v.id === this.$store.state.user.union.id)
this.viewData.teamNum = union.limitNum
this.listTeamUserUnion()
}else{
this.listTeamUser()
}
if (this.viewData.formConfig) { if (this.viewData.formConfig) {
this.formCreateRule = formCreate.parseJson(this.viewData.formConfig.rule) this.formCreateRule = formCreate.parseJson(this.viewData.formConfig.rule)
this.formCreateOption = formCreate.parseJson(this.viewData.formConfig.options) this.formCreateOption = formCreate.parseJson(this.viewData.formConfig.options)
} }
this.listTeamUser()
} }
}) })
} }
@@ -117,8 +117,8 @@ const ACTIVITY_CULTURE_USER_STATISTICS = {
{ prop: "loginName", label: "工号", width: 180, fixed: "left" }, { prop: "loginName", label: "工号", width: 180, fixed: "left" },
{ prop: "sex", label: "性别", width: 70 }, { prop: "sex", label: "性别", width: 70 },
{ prop: "mobile", label: "联系方式", width: 180 }, { prop: "mobile", label: "联系方式", width: 180 },
{ prop: "unitName", label: "所属单位", width: 200 },
{ prop: "unionName", label: "所属工会", width: 200 }, { prop: "unionName", label: "所属工会", width: 200 },
{ prop: "unitName", label: "所属单位", width: 200 },
{ prop: "applyDateTime", label: "报名时间", width: 180 }, { prop: "applyDateTime", label: "报名时间", width: 180 },
{ prop: "applyUserUserName", label: "报名人", width: 180 } { prop: "applyUserUserName", label: "报名人", width: 180 }
], ],
@@ -93,7 +93,7 @@ layout("/layouts/platform.html"){
</el-button> </el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button> <el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
<el-button v-if="row.instanceState === 20" @click="doExport(row)" size="mini" type="primary">导出</el-button> <el-button v-if="row.instanceState === 20" @click="doExportDeclare(row)" size="mini" type="primary">申请表导出</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -143,8 +143,8 @@ layout("/layouts/platform.html"){
'info': INFO 'info': INFO
}, },
methods: { methods: {
doExport(row){ doExportDeclare(row){
this.$downLoad('/platform/activityDeclare/mine/doExport?id=' + row.id) this.$downLoad('/platform/activityDeclare/mine/doExportDeclare?id=' + row.id)
}, },
onApply() { onApply() {
window.location.href = '/platform/activityDeclare/apply' window.location.href = '/platform/activityDeclare/apply'
@@ -13,8 +13,8 @@ layout("/layouts/platform.html"){
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix="" class="flow-task-form"> <el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix="" class="flow-task-form">
<el-descriptions :column="2" border> <el-descriptions :column="2" border>
<el-descriptions-item label="活动名称"> <el-descriptions-item label="活动名称">
<el-form-item prop="id"> <el-form-item prop="declareId">
<el-select v-model="formData.id" <el-select v-model="formData.declareId"
style="width: 100%;" style="width: 100%;"
@change="activityChange" @change="activityChange"
filterable placeholder="请选择活动"> filterable placeholder="请选择活动">
@@ -28,7 +28,7 @@ layout("/layouts/platform.html"){
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<template v-if="formData.id"> <template v-if="formData.declareId">
<el-descriptions-item label="相关数据"> <el-descriptions-item label="相关数据">
<el-button size="small" type="primary" @click="viewDeclare">查看申报信息</el-button> <el-button size="small" type="primary" @click="viewDeclare">查看申报信息</el-button>
</el-descriptions-item> </el-descriptions-item>
@@ -37,7 +37,7 @@ layout("/layouts/platform.html"){
<el-descriptions-item></el-descriptions-item> <el-descriptions-item></el-descriptions-item>
</template> </template>
<el-descriptions-item label="实际活动时间" :span="2"> <el-descriptions-item label="实际活动时间">
<el-form-item prop="activityTime"> <el-form-item prop="activityTime">
<el-date-picker <el-date-picker
start-placeholder="开始日期" start-placeholder="开始日期"
@@ -51,6 +51,23 @@ layout("/layouts/platform.html"){
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="活动计划时间">
<el-form-item prop="planDate">
<el-date-picker
readonly
start-placeholder="开始日期"
range-separator="-"
end-placeholder="结束日期"
style="width: 100%"
type="daterange"
v-model="formData.planDate"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="活动预算费用" :span="2"> <el-descriptions-item label="活动预算费用" :span="2">
<el-form-item prop="budgets"> <el-form-item prop="budgets">
<el-table :data="formData.budgets" border max-height="500" size="mini" style="width: 100%"> <el-table :data="formData.budgets" border max-height="500" size="mini" style="width: 100%">
@@ -211,7 +228,9 @@ layout("/layouts/platform.html"){
formData: { formData: {
id: GetQueryString("businessId"), id: GetQueryString("businessId"),
activityTime: [] activityTime: [],
budgets: [],
planDate: [],
}, },
formRules: { formRules: {
id: [{required: true, message: "必填", trigger: ['change', 'blur']}] id: [{required: true, message: "必填", trigger: ['change', 'blur']}]
@@ -294,7 +313,7 @@ layout("/layouts/platform.html"){
viewDeclare() { viewDeclare() {
this.declareDialogVisible = true this.declareDialogVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.infoRef.onOpen({id: this.formData.id}) this.$refs.infoRef.onOpen({id: this.formData.declareId})
}) })
}, },
@@ -315,24 +334,40 @@ layout("/layouts/platform.html"){
...data ...data
} }
if (data.planStartTime && data.planEndTime) { this.formData.id = this.bizId ? this.bizId : null
this.formData.activityTime = [
new Date(data.planStartTime),
new Date(data.planEndTime)
]
}
if (data.planStartTime && data.planEndTime) {
this.formData.planDate = [data.planStartTime, data.planEndTime]
}
} }
}, },
async getActivityReimbursementByUser() { async getActivityReimbursementByUser(id) {
const {code, data} = await this.$axios.post('/platform/activityReimbursement/apply/getActivityReimbursementByUser'); const {code, data} = await this.$axios.post('/platform/activityReimbursement/apply/getActivityReimbursementByUser',{id});
if (code === 0) { if (code === 0) {
this.activityOptions = data this.activityOptions = data
} }
}, },
findOne(){
this.$axios.post('/platform/activityReimbursement/mine/findOne', {id: this.bizId})
.then(res => {
if (res.code === 0) {
this.formData = res.data
if (res.data.planStartTime && res.data.planEndTime) {
this.formData.planDate = [res.data.planStartTime, res.data.planEndTime]
}
if (res.data.startTime && res.data.endTime) {
this.formData.activityTime = [res.data.startTime, res.data.endTime]
}
// this.activityChange(res.data.activityId)
}
})
},
}, },
async created() { async created() {
await this.getActivityReimbursementByUser() await this.getActivityReimbursementByUser(this.bizId)
if (this.bizId) {
this.findOne()
}
} }
}) })
</script> </script>
@@ -83,7 +83,7 @@ layout("/layouts/platform.html"){
size="small"></enum-tag> size="small"></enum-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" width="300px"> <el-table-column label="操作" fixed="right" width="350px" fixed="right">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button> <el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)" size="mini" type="primary"> <el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)" size="mini" type="primary">
@@ -93,8 +93,8 @@ layout("/layouts/platform.html"){
</el-button> </el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button> <el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
<el-button @click="doExport(row)" size="mini">申请</el-button> <el-button @click="doExportDeclare(row)" size="mini" type="primary">申请表导出</el-button>
<el-button @click="doExportReimbursement(row)" size="mini">报销</el-button> <el-button v-if="row.instanceState === 20" @click="doExportReimbursement(row)" size="mini" type="primary">报销凭证导出</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -144,8 +144,8 @@ layout("/layouts/platform.html"){
}, },
methods: { methods: {
// 导出示例 // 导出示例
doExport(row){ doExportDeclare(row){
this.$downLoad('/platform/activityDeclare/mine/doExport?id=' + row.declareId) this.$downLoad('/platform/activityDeclare/mine/doExportDeclare?id=' + row.declareId)
}, },
// 导出报销凭证 // 导出报销凭证
doExportReimbursement(row){ doExportReimbursement(row){
@@ -56,6 +56,19 @@ layout("/layouts/platform.html"){
v-for="item in unionOptions"></el-option> v-for="item in unionOptions"></el-option>
</el-select> </el-select>
</search-item> </search-item>
<search-item label="活动项目" v-if="unionLeaderCoach">
<el-select
@change="doSearch"
clearable
filterable
placeholder="请选择活动项目"
v-model="pageForm.eventId"
>
<el-option :key="item.eventId" :label="item.allName"
:value="item.eventId" v-for="item in eventList"></el-option>
</el-select>
</search-item>
</search> </search>
</el-card> </el-card>
@@ -136,45 +149,28 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never"> <el-card class="mt10" shadow="never">
<table-tool label="活动项目信息"> <table-tool label="活动项目信息">
<div class="search-item-option"> <!-- <div class="search-item-option">
<el-select <el-select
@change="doSearch" @change="doSearch"
clearable clearable
filterable filterable
placeholder="请选择组别" placeholder="请选择组别"
style="width: 100%; margin-bottom: 5px; margin-left: 10px" style="width: 100%; margin-bottom: 5px; margin-left: 10px"
v-if="unionLeaderCoach" v-if="unionLeaderCoach"
v-model="pageForm.groupName" v-model="pageForm.groupName"
> >
<el-option :key="item.id" :label="item.name" :value="item.name" <el-option :key="item.id" :label="item.name" :value="item.name"
v-for="item in groupList"></el-option> v-for="item in groupList"></el-option>
</el-select> </el-select>
</div> </div>-->
<div class="search-item-option">
<el-select <div v-if="unionLeaderCoach">
@change="doSearch"
clearable
filterable
placeholder="请选择活动项目"
style="width: 100%; margin-bottom: 5px; margin-left: 10px"
v-if="unionLeaderCoach"
v-model="pageForm.eventId"
>
<el-option :key="item.eventId" :label="item.allName"
:value="item.eventId" v-for="item in eventList"></el-option>
</el-select>
</div>
<div class="mr10 ml20" v-if="unionLeaderCoach">
领队: 领队:
<span style="color: #419bf8">{{leaderData.username?leaderData.username:'暂无'}}</span> <span style="color: #419bf8">{{leaderData.username?leaderData.username:'暂无'}}</span>
&emsp13; 教练: &emsp13; 教练:
<span <span style="color: #419bf8">{{coachData.username ?coachData.username:'暂无'}}</span>
style="color: #419bf8">{{coachData.username ?coachData.username:'暂无'}}</span> <el-button @click="openLeaderCoach" size="medium" type="primary">设置领队/教练
</div>
<div>
<el-button @click="openLeaderCoach" size="medium" type="primary"
v-if="unionLeaderCoach">设置领队/教练
</el-button> </el-button>
</div> </div>
</table-tool> </table-tool>
@@ -418,9 +418,10 @@ layout("/layouts/platform.html"){
return v.id === this.pageForm.id return v.id === this.pageForm.id
}) })
await this.getEventsByActivityId() await this.getEventsByActivityId()
this.pageForm.activityName = activity.length > 0 ? activity[0].name : null if (activity.length>0){
this.pageForm.applyType = activity[0].applyType this.pageForm.activityName = activity.length > 0 ? activity[0].name : null
this.pageForm.applyType = activity[0].applyType
}
const resp = await this.$axios.post(loc() + "/pageData", this.pageForm) const resp = await this.$axios.post(loc() + "/pageData", this.pageForm)
this.tabLoading = false this.tabLoading = false
if (resp.code === 0) { if (resp.code === 0) {
@@ -184,7 +184,7 @@ const apply_component = {
this.$axios.post("/platform/evaluate/apply/info", {id: row.id}).then((res) => { this.$axios.post("/platform/evaluate/apply/info", {id: row.id}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.formData = res.data this.formData = res.data
this.$set(this.formData, "honorTypeName", row.honorTypeName)
} }
}) })
}, },
@@ -109,7 +109,7 @@ layout("/layouts/platform.html"){
}, },
openView(row) { openView(row) {
this.$refs.guava.public(() => { this.$refs.guava.public(() => {
this.$refs.infoRef.onOpen(row.id) this.$refs.infoRef.onOpen(row)
this.showApprovalForm = false this.showApprovalForm = false
}) })
}, },
@@ -108,7 +108,7 @@ layout("/layouts/platform.html"){
methods: { methods: {
openView(row) { openView(row) {
this.$refs.guava.view(() => { this.$refs.guava.view(() => {
this.$refs.infoRef.onOpen(row.id) this.$refs.infoRef.onOpen(row)
}) })
}, },
exportExcel() { exportExcel() {
@@ -303,6 +303,7 @@ layout("/layouts/platform.html"){
} }
}, },
async init() { async init() {
this.clubOption = await this.$businessTool.listCLubByRole()
this.budgetTypeOption = await this.$businessTool.getDictOptions("ACTIVITY_BUDGET_TYPE") this.budgetTypeOption = await this.$businessTool.getDictOptions("ACTIVITY_BUDGET_TYPE")
const budgetTypeOption = [] const budgetTypeOption = []
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) { if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) {
@@ -364,7 +365,7 @@ layout("/layouts/platform.html"){
}, },
async created() { async created() {
this.init() this.init()
this.clubOption = await this.$businessTool.listCLubByRole()
} }
}) })
</script> </script>
@@ -49,14 +49,17 @@ layout("/layouts/platform.html"){
<el-table-column label="报名结束时间" prop="signUpEndTIme"></el-table-column> <el-table-column label="报名结束时间" prop="signUpEndTIme"></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="allocationNum"></el-table-column> <el-table-column label="分配名额数" prop="allocationNum"></el-table-column>
<el-table-column label="报名数(已审核通过数)"> <!-- <el-table-column label="报名数(已审核通过数)">
<template v-slot="{ row }"> <template v-slot="{ row }">
</template> </template>
</el-table-column> </el-table-column>-->
<el-table-column label="操作" width="230"> <el-table-column label="操作" width="230">
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button> <el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="onSignUp(row)" size="mini" type="primary">报名</el-button> <el-button @click="onSignUp(row)" size="mini" type="primary"
v-if="$moment(row.signUpStartTime).valueOf() < $moment().valueOf()
&&
$moment(row.signUpEndTIme).valueOf() > $moment().valueOf()">报名</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -94,7 +97,8 @@ layout("/layouts/platform.html"){
methods: { methods: {
onSignUp(row){ onSignUp(row){
this.$refs.guava.edit(() => { this.$refs.guava.edit(() => {
this.$refs.signUpFormRef.onOpen(row.activityId, row.unionId) const activity= this.activityList.find(item => item.id === row.activityId)
this.$refs.signUpFormRef.onOpen(row.activityId, row.unionId,activity)
}) })
}, },
onView(row){ onView(row){
@@ -1,11 +1,13 @@
const info = { const info = {
template: /*language=HTML*/ ` template: /*language=HTML*/ `
<div> <div>
<el-tabs v-model="activeName" > <el-tabs v-model="activeName">
<el-tab-pane label="活动基础信息" name="one"> <el-tab-pane label="活动基础信息" name="one">
<el-descriptions :column="2" border class="table_fixed"> <el-descriptions :column="2" border class="table_fixed">
<el-descriptions-item label="活动名称">{{ viewData.activityName }}</el-descriptions-item> <el-descriptions-item label="活动名称">{{ viewData.activityName }}</el-descriptions-item>
<el-descriptions-item label="报名时间">{{ viewData.signUpStartTime }}至{{viewData.signUpEndTIme}}</el-descriptions-item> <el-descriptions-item label="报名时间">{{ viewData.signUpStartTime
}}至{{viewData.signUpEndTIme}}
</el-descriptions-item>
<el-descriptions-item label="活动线路" :span="2">{{viewData.linNames}}</el-descriptions-item> <el-descriptions-item label="活动线路" :span="2">{{viewData.linNames}}</el-descriptions-item>
<el-descriptions-item label="工会名额分配" :span="2"> <el-descriptions-item label="工会名额分配" :span="2">
<el-table :data="viewData.unionQuotaAllocationList" size="medium" height="70vh"> <el-table :data="viewData.unionQuotaAllocationList" size="medium" height="70vh">
@@ -24,20 +26,81 @@ const info = {
</el-descriptions> </el-descriptions>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="报名信息" name="two"> <el-tab-pane label="报名信息" name="two">
<el-table :data="userTableData" :size="tableSize" height="70vh">
<el-table-column label="序号" type="index" :index="indexMethod" width="60"></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="mobile"></el-table-column>
<el-table-column label="身份证号" prop="idCard"></el-table-column>
<el-table-column label="单位" prop="unitName"></el-table-column>
<el-table-column label="报名线路" prop="lineName"></el-table-column>
<el-table-column prop="signUpTime" label="填报时间"></el-table-column>
<el-table-column prop="taskName" label="当前节点"></el-table-column>
<el-table-column prop="instanceState" label="流程状态">
<template v-slot="{row}">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="230">
<template v-slot="{ row }">
<el-button @click="openView(row)" size="mini" type="primary">
查看
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-dialog
:close-on-click-modal="false"
:append-to-body="true"
:visible.sync="userDialogVisible"
title="详细信息查看"
width="40%"
>
<el-descriptions :column="2" border class="table_fixed">
<el-descriptions-item label="姓名">{{ userViewData.userName }}</el-descriptions-item>
<el-descriptions-item label="工号">{{ userViewData.loginName }}</el-descriptions-item>
<el-descriptions-item label="单位">{{ userViewData.unitName }}</el-descriptions-item>
<el-descriptions-item label="工会">{{ userViewData.unionName }}</el-descriptions-item>
<el-descriptions-item label="附件">
<file-preview :files="userViewData.files" complete_result></file-preview>
</el-descriptions-item>
</el-descriptions>
<span slot="footer" class="dialog-footer">
<el-button @click="userDialogVisible = false" type="primary">关 闭</el-button>
</span>
</el-dialog>
</div> </div>
`, `,
mixins: [initTableMixins],
data() { data() {
return { return {
viewData: {}, viewData: {},
activeName:"one" activeName: "one",
userTableData: [],
activityId: "",
unionId: "",
userDialogVisible:false,
userViewData:{}
} }
}, },
methods: { methods: {
async onOpen(id,unionId) { openView(row) {
this.userViewData = row
this.userViewData.files = JSON.parse(row.files)
this.userDialogVisible = true
},
async onOpen(id, unionId) {
this.activityId = id
this.unionId = unionId
await this.findOne(id) await this.findOne(id)
this.listQuotaAllocation()
}, },
async findOne(id) { async findOne(id) {
this.$axios.post("/platform/excellentRecuperation/activityList/findOne", {id}).then(resp => { this.$axios.post("/platform/excellentRecuperation/activityList/findOne", {id}).then(resp => {
@@ -46,6 +109,16 @@ const info = {
} }
}) })
}, },
listQuotaAllocation() {
this.$axios.post("/platform/excellentRecuperation/activitySignUp/listQuotaAllocation", {
activityId: this.activityId,
unionId: this.unionId
}).then(res => {
if (res.code === 0) {
this.userTableData = res.data
}
})
},
}, },
} }
@@ -77,7 +77,7 @@ const SIGN_UP_FORM = {
</el-row> </el-row>
</el-card> </el-card>
<div class="process-title">报名人员信息</div> <div class="process-title">报名人员信息<span style="color:#ee0a24;">(如需修改或提交报名人员信息请点击编辑后提交)</span></div>
<el-table :data="tableData" @sort-change="pageOrder" :size="tableSize" height="70vh"> <el-table :data="tableData" @sort-change="pageOrder" :size="tableSize" height="70vh">
<el-table-column label="序号" type="index" :index="indexMethod" width="60"></el-table-column> <el-table-column label="序号" type="index" :index="indexMethod" width="60"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column> <el-table-column label="姓名" prop="userName"></el-table-column>
@@ -144,7 +144,8 @@ const SIGN_UP_FORM = {
unionId: "", unionId: "",
lineList: [], lineList: [],
userOptions: [], userOptions: [],
userViewData:{}, userViewData: {},
activityData: {},
userDialogVisible: false userDialogVisible: false
} }
}, },
@@ -152,7 +153,7 @@ const SIGN_UP_FORM = {
userChange(val) { userChange(val) {
const user = this.userOptions.find(o => o.id === val) const user = this.userOptions.find(o => o.id === val)
if (user) { if (user) {
const {userName, loginName, unitId, unitName, unionId, unionName,mobile,idCard} = user const {userName, loginName, unitId, unitName, unionId, unionName, mobile, idCard} = user
this.$set(this.formData, "userName", userName) this.$set(this.formData, "userName", userName)
this.$set(this.formData, "loginName", loginName) this.$set(this.formData, "loginName", loginName)
this.$set(this.formData, "unitId", unitId) this.$set(this.formData, "unitId", unitId)
@@ -168,17 +169,37 @@ const SIGN_UP_FORM = {
} }
} }
}, },
async getSIgnUpUserList() {
const res = await this.$axios.post('/platform/excellentRecuperation/activitySignUp/getSIgnUpUserList', {
activityId: this.activityId,
unionId: this.unionId
})
if (res.code === 0) {
return res.data.length
} else {
return 0
}
},
onSave() { onSave() {
this.$axios.post('/platform/excellentRecuperation/activitySignUp/save', {data: JSON.stringify(this.formData)}).then(res => { this.getSIgnUpUserList().then(data => {
if (res.code === 0) { const union = this.activityData.unionQuotaAllocationList.find(v => v.unionId === this.unionId)
this.listQuotaAllocation() if (data >= union.allocationNum) {
this.$message.success("保存成功") this.$message.error("该活动已满")
this.formData = { return
lineId: this.lineList[0].id, } else {
activityId: this.activityId this.$axios.post('/platform/excellentRecuperation/activitySignUp/save', {data: JSON.stringify(this.formData)}).then(res => {
} if (res.code === 0) {
this.listQuotaAllocation()
this.$message.success("保存成功")
this.formData = {
lineId: this.lineList[0].id,
activityId: this.activityId
}
}
})
} }
}) })
}, },
onSubmit() { onSubmit() {
this.$refs.formRef.validate(valid => { this.$refs.formRef.validate(valid => {
@@ -188,14 +209,22 @@ const SIGN_UP_FORM = {
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$axios.post('/platform/excellentRecuperation/activitySignUp/submit', {data: JSON.stringify(this.formData)}).then(res => { this.getSIgnUpUserList().then(data => {
if (res.code === 0) { const union = this.activityData.unionQuotaAllocationList(v => v.unionId === this.unionId)
this.listQuotaAllocation() if (data >= union.allocationNum) {
this.$message.success("提交成功") this.$message.error("该活动已满")
this.formData = { return
lineId: this.lineList[0].id, } else {
activityId: this.activityId this.$axios.post('/platform/excellentRecuperation/activitySignUp/submit', {data: JSON.stringify(this.formData)}).then(res => {
} if (res.code === 0) {
this.listQuotaAllocation()
this.$message.success("提交成功")
this.formData = {
lineId: this.lineList[0].id,
activityId: this.activityId
}
}
})
} }
}) })
}) })
@@ -294,9 +323,10 @@ const SIGN_UP_FORM = {
} }
}) })
}, },
onOpen(activityId, unionId) { onOpen(activityId, unionId, activity) {
this.activityId = activityId this.activityId = activityId
this.unionId = unionId this.unionId = unionId
this.activityData = activity
this.listQuotaAllocation() this.listQuotaAllocation()
this.getLineList(activityId) this.getLineList(activityId)
}, },
@@ -11,7 +11,7 @@ layout("/layouts/platform.html"){
<template> <template>
<el-card shadow="never"> <el-card shadow="never">
<search @search="doSearch"> <search @search="doSearch">
<search-item label="年度"> <search-item label="年度">
<el-date-picker <el-date-picker
v-model="pageForm.year" v-model="pageForm.year"
type="year" type="year"
@@ -24,7 +24,7 @@ layout("/layouts/platform.html"){
</el-date-picker> </el-date-picker>
</search-item> </search-item>
<search-item label="活动"> <search-item label="活动">
<el-select clearable filterable style="width: 100%" <el-select clearable filterable style="width: 100%"
v-model="pageForm.activityId" v-model="pageForm.activityId"
placeholder="请选择活动"> placeholder="请选择活动">
@@ -2,8 +2,8 @@ const MEMBER_CHANGE = {
template: /*language=HTML*/ ` template: /*language=HTML*/ `
<el-card shadow="never"> <el-card shadow="never">
<div class="process-title">会员变更</div> <div class="process-title">会员变更</div>
<el-form :model="formData" ref="formRef" label-width="0" :rules="formRules" size="small"> <el-form :model="formData" ref="formRef" label-width="0" :rules="formRules" size="small" class="flow-task-form">
<el-descriptions :column="3" border class="descriptions-form"> <el-descriptions :column="3" border>
<el-descriptions-item label="工号"> <el-descriptions-item label="工号">
<el-form-item prop="loginname"> <el-form-item prop="loginname">
<el-input v-model="formData.loginname" readonly size="small"></el-input> <el-input v-model="formData.loginname" readonly size="small"></el-input>
@@ -17,8 +17,8 @@ const MEMBER_CHANGE = {
<el-descriptions-item label="性别"> <el-descriptions-item label="性别">
<el-form-item prop="sex"> <el-form-item prop="sex">
<el-radio-group :disabled="allowFields('sex')" v-model="formData.sex" size="small"> <el-radio-group :disabled="allowFields('sex')" v-model="formData.sex" size="small">
<el-radio border label="男"></el-radio> <el-radio border label="男"></el-radio>
<el-radio border label="女"></el-radio> <el-radio border label="女"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
@@ -515,5 +515,10 @@ const MEMBER_CHANGE = {
}, },
created(){ created(){
this.init() this.init()
} },
style: /*language=CSS*/ `
.el-descriptions-item__label {
width: 15% !important;
}
`
} }
@@ -170,7 +170,6 @@ layout("/layouts/platform.html"){
el: "#app", el: "#app",
store, store,
mixins: [initTableMixins], mixins: [initTableMixins],
dicts: ['USER_SEX', 'USER_STATE', 'PERSON_TYPE', 'MEMBER_CHANGE_TYPE'],
data: { data: {
pickerOptions: { pickerOptions: {
shortcuts: [{ shortcuts: [{
@@ -1,59 +1,6 @@
<!--# <!--#
layout("/layouts/platform.html"){ layout("/layouts/platform.html"){
#--> #-->
<style>
.el-tabs__content {
padding-top: 20px;
}
.el-dialog__body div div {
/*color: #ff0000;*/
margin-bottom: 10px;
}
.query-row {
height: 60px;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
.query-row:not(:last-child) {
border-bottom: 1px dashed rgb(230, 230, 230);
}
.query-row-title {
width: 120px;
}
.query-row > .query-title {
width: 100px;
max-width: 100px;
min-width: 100px;
overflow: hidden;
}
.query-row > .query-content {
min-width: 200px;
overflow: hidden;
}
.query-row > .query-content > .el-tag {
margin-bottom: 5px;
margin-top: 5px;
}
@media screen and (max-width: 992px) {
.query-row:nth-child(4) .query-content .el-col:not(:last-child) {
margin-bottom: 5px;
}
.query-title {
display: none;
}
}
</style>
<div id="app" v-cloak> <div id="app" v-cloak>
<guava ref="guava"> <guava ref="guava">
<template> <template>
@@ -48,7 +48,7 @@ layout("/layouts/platform.html"){
<el-option label="无工会" value="false"></el-option> <el-option label="无工会" value="false"></el-option>
</el-select> </el-select>
<el-button icon="el-icon-printer" class="m10" type="primary" style="float: right" size="small" @click="doExport">导出</el-button> <el-button icon="el-icon-printer" type="primary" style="float: right" size="small" @click="doExport">导出</el-button>
</table-tool> </table-tool>
<el-table <el-table
:data="tableData" :data="tableData"
@@ -44,7 +44,7 @@ layout("/layouts/platform.html"){
<div class="p10"> <div class="p10">
<el-card shadow="never"> <el-card shadow="never">
<div class="top_block" v-loading="top_block_loading"> <div class="top_block" v-loading="top_block_loading">
<el-row gutter="60"> <el-row :gutter="60">
<div style="position: absolute; top: -35px; right: -8px"> <div style="position: absolute; top: -35px; right: -8px">
<el-date-picker <el-date-picker
class="year" class="year"
@@ -54,7 +54,7 @@ layout("/layouts/platform.html"){
type="year" type="year"
:clearable="false" :clearable="false"
value-format="yyyy" value-format="yyyy"
@change="if(numForm.endYear){getNumData();}" @change="getNumData()"
placeholder="选择年" placeholder="选择年"
></el-date-picker> ></el-date-picker>
- -
@@ -66,7 +66,7 @@ layout("/layouts/platform.html"){
type="year" type="year"
:clearable="false" :clearable="false"
value-format="yyyy" value-format="yyyy"
@change="if(numForm.startYear){getNumData();}" @change="getNumData()"
placeholder="选择年" placeholder="选择年"
></el-date-picker> ></el-date-picker>
</div> </div>
@@ -101,7 +101,7 @@ layout("/layouts/platform.html"){
type="year" type="year"
:clearable="false" :clearable="false"
value-format="yyyy" value-format="yyyy"
@change="if(oneForm.endYear){getPayProjectChart();getPayMoneyChart();}" @change="getPayProjectChart();getPayMoneyChart()"
placeholder="选择年" placeholder="选择年"
></el-date-picker> ></el-date-picker>
- -
@@ -113,7 +113,7 @@ layout("/layouts/platform.html"){
type="year" type="year"
:clearable="false" :clearable="false"
value-format="yyyy" value-format="yyyy"
@change="if(oneForm.startYear){getPayProjectChart();getPayMoneyChart();}" @change="getPayProjectChart();getPayMoneyChart()"
placeholder="选择年" placeholder="选择年"
></el-date-picker> ></el-date-picker>
</div> </div>
@@ -151,7 +151,7 @@ layout("/layouts/platform.html"){
:clearable="false" :clearable="false"
@change="doSearch" @change="doSearch"
@clear="doSearch" @clear="doSearch"
filterable="true" filterable
> >
<el-option v-for="item in paymentProjectList" <el-option v-for="item in paymentProjectList"
:label="item.projectName" :value="item.id"></el-option> :label="item.projectName" :value="item.id"></el-option>
@@ -83,7 +83,7 @@ layout("/layouts/platform.html"){
<search-item label="在职状态"> <search-item label="在职状态">
<dict-select v-model="pageForm.userState" style="width: 100%" clearable <dict-select v-model="pageForm.userState" style="width: 100%" clearable
placeholder="在职状态" code="UserState"></dict-select> placeholder="在职状态" code="USER_STATE"></dict-select>
</search-item> </search-item>
<search-item label="入职时间"> <search-item label="入职时间">
@@ -416,9 +416,12 @@ layout("/layouts/platform.html"){
} }
}, },
openImport() { openImport() {
this.$refs.guava.edit(() => { this.$refs.guava.edit()
this.$refs.viewImport.resetImportData() this.$nextTick(() => {
}) setTimeout(() => {
this.$refs.viewImport.resetImportData()
}, 500)
})
}, },
successImport() { successImport() {
this.$refs.guava.index() this.$refs.guava.index()
@@ -0,0 +1,26 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app">
<van-nav-bar title="信息填报" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar>
</div>
<script>
new Vue({
el: '#app',
data() {
return {
}
},
methods: {
historyBack,
},
created() {
}
});
</script>
<!--#
}
#-->