commit
This commit is contained in:
@@ -3,6 +3,7 @@ package com.budwk.app.sys.controller;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.lang.tree.TreeNode;
|
||||
import cn.hutool.core.lang.tree.TreeUtil;
|
||||
@@ -13,7 +14,14 @@ import com.budwk.app.base.exception.BaseException;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
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.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.sys.models.*;
|
||||
import com.budwk.app.sys.services.*;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
@@ -41,6 +49,7 @@ import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -71,6 +80,9 @@ public class SysUnionController {
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/sys/union/index.html")
|
||||
@SaCheckPermission("sys.manager.union")
|
||||
@@ -319,10 +331,47 @@ public class SysUnionController {
|
||||
|
||||
// bpmService.startSubmitProcessInstance(BpmProcessConstant.BRANCH_UNION_WEIYUAN_AUTHORIZATION.name(), instanceName, permission.getId(), List.of("24017"), null);
|
||||
|
||||
sysRoleService.clear("sys_user_role", Cnd.where("roleId", "=", role.getId()).and("userId", "=", userId).and("unionId", "=", unionId));
|
||||
sysRoleService.insert("sys_user_role", Chain.make("roleId", role.getId()).add("userId", userId).add("unionId", unionId));
|
||||
sysRoleService.clearCache();
|
||||
sysUserService.clearCache();
|
||||
// sysRoleService.clear("sys_user_role", Cnd.where("roleId", "=", role.getId()).and("userId", "=", userId).and("unionId", "=", unionId));
|
||||
// sysRoleService.insert("sys_user_role", Chain.make("roleId", role.getId()).add("userId", userId).add("unionId", unionId));
|
||||
// sysRoleService.clearCache();
|
||||
// sysUserService.clearCache();
|
||||
// 构建表结构存储
|
||||
View_user user = dao.fetch(View_user.class, Cnd.where("id", "=", userId));
|
||||
|
||||
Sys_union_cadre unionCadre = new Sys_union_cadre();
|
||||
unionCadre.setUserId(userId);
|
||||
unionCadre.setUnionId(unionId);
|
||||
unionCadre.setMobile(user.getMobile());
|
||||
unionCadre.setUnionName(user.getUnionName());
|
||||
unionCadre.setLoginName(user.getLoginname());
|
||||
unionCadre.setUserName(user.getUsername());
|
||||
unionCadre.setRoleCode(roleCode);
|
||||
unionCadre.setApplyDate(new Date());
|
||||
unionCadre.setIsJoin(true);
|
||||
dao.insert(unionCadre);
|
||||
|
||||
// 去走工作流
|
||||
boolean isAdmin = AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name());
|
||||
Dict args = Dict.create();
|
||||
args.set("submit", isAdmin ? "admin" : "branch");
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, unionCadre);
|
||||
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("JCGHWY", unionCadre.getId(), SecurityUtil.getUserId(), args);
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
|
||||
if (isAdmin) {
|
||||
// 如果是管理员,直接加角色
|
||||
sysRoleService.clear("sys_user_role", Cnd.where("roleId", "=", role.getId()).and("userId", "=", userId).and("unionId", "=", unionId));
|
||||
sysRoleService.insert("sys_user_role", Chain.make("roleId", role.getId()).add("userId", userId).add("unionId", unionId));
|
||||
sysRoleService.clearCache();
|
||||
sysUserService.clearCache();
|
||||
}
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@@ -413,4 +462,63 @@ public class SysUnionController {
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 基层干部审核相关
|
||||
*/
|
||||
@At
|
||||
@ApiOperation("基层干部审核菜单")
|
||||
@SaCheckPermission("sys.manager.union")
|
||||
public Result cadrePageData(PageForm pageForm, @Param("isJoin") Boolean isJoin) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
role.`name` AS roleName,
|
||||
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
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN sys_union_cadre info ON info.id = ins.businessNo
|
||||
LEFT JOIN sys_role role ON role.`code` = info.roleCode
|
||||
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
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "2978a74a-75c1-4f95-99f9-9c08c480f1b5");
|
||||
if (pageForm.getAudit()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(),
|
||||
ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
cnd.andEX("info.isJoin", "=", isJoin);
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt");
|
||||
cnd.desc("info.applyDate");
|
||||
} else {
|
||||
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = sysUnionService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.budwk.app.sys.interceptor;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowInterceptor;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_union_cadre;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:SysUnionSchoolAuditInterceptor
|
||||
* @Date 2025/10/28 10:15
|
||||
* @注释
|
||||
*/
|
||||
public class SysUnionSchoolAuditInterceptor implements FlowInterceptor {
|
||||
|
||||
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
// 是否审核通过
|
||||
boolean submitType = execution.getArgs().getInt("submitType").equals(ProcessSubmitTypeEnum.AGREE.getCode());
|
||||
if (submitType) {
|
||||
// 审核通过,添加相应的角色
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
|
||||
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
|
||||
SysUserService sysUserService = ServiceContext.find(SysUserService.class);
|
||||
|
||||
// 表单数据
|
||||
Sys_union_cadre unionBean = JSONUtil.toBean(formDataStr, Sys_union_cadre.class);
|
||||
|
||||
// 清除对应角色然后再新增
|
||||
Sys_role role = sysRoleService.getByCode(unionBean.getRoleCode());
|
||||
sysRoleService.clear("sys_user_role", Cnd.where("roleId", "=", role.getId())
|
||||
.and("userId", "=", unionBean.getUserId()).and("unionId", "=", unionBean.getUnionId()));
|
||||
sysRoleService.insert("sys_user_role", Chain.make("roleId", role.getId())
|
||||
.add("userId", unionBean.getUserId()).add("unionId", unionBean.getUnionId()));
|
||||
|
||||
// 清除缓存
|
||||
sysRoleService.clearCache();
|
||||
sysUserService.clearCache();
|
||||
}
|
||||
// 未审核通过,不作操作
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.budwk.app.sys.models;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:Sys_union_cadre
|
||||
* @Date 2025/10/28 10:22
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class Sys_union_cadre extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("工会Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("用户Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("用户名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("联系方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("角色编码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String roleCode;
|
||||
|
||||
@Column
|
||||
@Comment("添加时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date applyDate;
|
||||
|
||||
@Column
|
||||
@Comment("加入还是退出")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isJoin;
|
||||
}
|
||||
+306
@@ -0,0 +1,306 @@
|
||||
package com.budwk.app.zhgh.activity.sports.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.DateUtil;
|
||||
import com.budwk.app.base.utils.PwdUtil;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.activity.basic.models.ActivityBasicUnion;
|
||||
import com.budwk.app.zhgh.activity.basic.models.ActivityBasicUnit;
|
||||
import com.budwk.app.zhgh.activity.sports.models.ActivityResults;
|
||||
import com.budwk.app.zhgh.activity.sports.models.ActivitySchoolApply;
|
||||
import com.budwk.app.zhgh.activity.sports.service.ActivitySportsApplyUserService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/5/19 14:58
|
||||
* @description 运动会成绩录入
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/activity/results/input")
|
||||
public class ActivitySportsResultsController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private ActivitySportsApplyUserService activitySchoolApplyViService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:platform/zhgh/activity/sports/ActivityResults/index.html")
|
||||
@SaCheckPermission("activity.results.input")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("activity.results.input")
|
||||
public Result pageData(String groupName,
|
||||
PageForm page,
|
||||
String activityId,
|
||||
String eventId,
|
||||
String[] isMenWomen) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ase.id,
|
||||
ase.activityId,
|
||||
ase.eventId,
|
||||
ae.projectType awardsMode,
|
||||
ae.allName,
|
||||
ae.isMenWomen,
|
||||
school.`name` ,
|
||||
( SELECT COUNT( 1 ) FROM activity_results ar WHERE ar.eventId = ase.eventId and ar.activityId=ase.activityId) rs
|
||||
FROM
|
||||
activity_school_event ase
|
||||
LEFT JOIN activity_event ae ON ase.eventId = ae.id
|
||||
LEFT JOIN activity_school school ON school.id = ase.activityId
|
||||
LEFT JOIN activity_basic_settings abs ON abs.id=ae.competitionCategory
|
||||
$condition
|
||||
""");
|
||||
cnd.and("ase.activityId", "=", activityId);
|
||||
cnd.andEX("abs.`name`", "=", groupName);
|
||||
cnd.andEX("ae.`id`", "=", eventId);
|
||||
SqlExpressionGroup sqlExpressionGroup = new SqlExpressionGroup();
|
||||
if (Arrays.stream(isMenWomen).anyMatch(a -> a.equals("2"))) {
|
||||
sqlExpressionGroup.and("ae.isMenWomen", "=", 1);
|
||||
}
|
||||
if (Arrays.stream(isMenWomen).anyMatch(a -> a.equals("3"))) {
|
||||
sqlExpressionGroup.or("ae.isMenWomen", "=", 2);
|
||||
}
|
||||
if (Arrays.stream(isMenWomen).anyMatch(a -> a.equals("4"))) {
|
||||
sqlExpressionGroup.and("ae.projectType", "=", 1);
|
||||
}
|
||||
if (Arrays.stream(isMenWomen).anyMatch(a -> a.equals("5"))) {
|
||||
sqlExpressionGroup.or("ae.projectType", "=", 2);
|
||||
}
|
||||
if (sqlExpressionGroup.getExps().size() > 0) {
|
||||
cnd.and(sqlExpressionGroup);
|
||||
}
|
||||
cnd.desc("allName");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql));
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("activity.results.input")
|
||||
public Result doAdd(@Param(value = "activityResults") ActivityResults[] activityResults, String activityId, String eventId) {
|
||||
|
||||
baseService.dao().clear(ActivityResults.class, Cnd.where("activityId", "=", activityId).and("eventId", "=", eventId));
|
||||
baseService.insert(activityResults);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("activity.results.input")
|
||||
public Result doAddUser(ActivitySchoolApply activitySchoolApply) {
|
||||
|
||||
|
||||
Sys_user sysUser = baseService.dao().fetch(Sys_user.class, Cnd.where("loginname", "=", activitySchoolApply.getLoginname()));
|
||||
|
||||
|
||||
if (sysUser != null && sysUser.getLoginname().equals(activitySchoolApply.getLoginname()) && !sysUser.getUsername().equals(activitySchoolApply.getUsername())) {
|
||||
return Result.error("工号已存在,请检查姓名和工号是否一致!");
|
||||
}
|
||||
if (sysUser == null) {
|
||||
Trans.exec(() -> {
|
||||
String pwd = "@dd3s#3618!";
|
||||
String salt = R.UU32();
|
||||
Sys_user user = new Sys_user();
|
||||
user.setId(R.UU32());
|
||||
user.setSalt(R.UU32());
|
||||
user.setPassword(PwdUtil.getPassword(pwd, salt));
|
||||
user.setUsername(activitySchoolApply.getUsername());
|
||||
user.setLoginname(activitySchoolApply.getLoginname());
|
||||
user.setSex(activitySchoolApply.getSex());
|
||||
user.setUnitId(activitySchoolApply.getUnitId());
|
||||
user.setMobile(activitySchoolApply.getMobile());
|
||||
baseService.insert(user);
|
||||
ActivityBasicUnit activityBasicUnit = activitySchoolApplyViService.dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", user.getUnitId()));
|
||||
ActivityBasicUnion basicUnion = activitySchoolApplyViService.dao().fetch(ActivityBasicUnion.class, Cnd.where("id", "=", activityBasicUnit.getUnionId()));
|
||||
|
||||
activitySchoolApply.setUserId(user.getId());
|
||||
activitySchoolApply.setApplyDate(DateUtil.getDate());
|
||||
activitySchoolApply.setSex(user.getSex());
|
||||
activitySchoolApply.setUnitId(user.getUnitId());
|
||||
activitySchoolApply.setActivityUnionId(basicUnion.getId());
|
||||
activitySchoolApply.setActivityUnionName(basicUnion.getName());
|
||||
activitySchoolApplyViService.insert(activitySchoolApply);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
sysUser.setSex(activitySchoolApply.getSex());
|
||||
baseService.update(sysUser);
|
||||
ActivityBasicUnit activityBasicUnit = activitySchoolApplyViService.dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", sysUser.getUnitId()));
|
||||
ActivityBasicUnion basicUnion = activitySchoolApplyViService.dao().fetch(ActivityBasicUnion.class, Cnd.where("id", "=", activityBasicUnit.getUnionId()));
|
||||
activitySchoolApply.setUserId(sysUser.getId());
|
||||
activitySchoolApply.setApplyUser(SecurityUtil.getUserId());
|
||||
activitySchoolApply.setApplyDate(DateUtil.getDate());
|
||||
activitySchoolApply.setUnitId(sysUser.getUnitId());
|
||||
activitySchoolApply.setActivityUnionId(basicUnion.getId());
|
||||
activitySchoolApply.setActivityUnionName(basicUnion.getName());
|
||||
activitySchoolApplyViService.insert(activitySchoolApply);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询个人参赛人员
|
||||
*
|
||||
* @param activityId
|
||||
* @param eventId
|
||||
* @param isMenWomen
|
||||
* @return
|
||||
*/
|
||||
|
||||
@At
|
||||
@SaCheckPermission("activity.results.input")
|
||||
public Result getUserList(String activityId,
|
||||
String eventId,
|
||||
Integer isMenWomen) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id,u.username,u.loginname,u.unionId,
|
||||
u.unionname,u.sex
|
||||
FROM
|
||||
activity_school_apply asa
|
||||
LEFT JOIN `vw_user` u ON u.id = asa.userId $condition
|
||||
""");
|
||||
|
||||
cnd.and("asa.activityId", "=", activityId);
|
||||
cnd.and("asa.eventId", "=", eventId);
|
||||
cnd.and("asa.awardsMode", "=", 1);
|
||||
if (isMenWomen != null && isMenWomen == 1) cnd.and("u.sex", "=", "男性");
|
||||
if (isMenWomen != null && isMenWomen == 2) cnd.and("u.sex", "=", "女性");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(activitySchoolApplyViService.listMap(sql));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("activity.results.input")
|
||||
public Result getUnionDetails(String activityId, String eventId, String unionId) {
|
||||
int count = activitySchoolApplyViService.count(Cnd.where("activityId", "=", activityId).and("eventId", "=", eventId).and("unionId", "=", unionId));
|
||||
return Result.success(count);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询团体参赛分工会
|
||||
*
|
||||
* @param activityId
|
||||
* @param eventId
|
||||
* @return
|
||||
*/
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result getUnionList(String activityId,
|
||||
String eventId) {
|
||||
Sql sql = Sqls.create("""
|
||||
|
||||
SELECT
|
||||
un.id,
|
||||
un.unionname
|
||||
FROM
|
||||
activity_school_apply asa
|
||||
LEFT JOIN sys_union un ON un.id = asa.unionId
|
||||
WHERE
|
||||
asa.activityId = @activityId
|
||||
AND asa.eventId = @eventId
|
||||
|
||||
GROUP BY
|
||||
un.unionname
|
||||
""").setParam("activityId", activityId).setParam("eventId", eventId);
|
||||
return Result.success(activitySchoolApplyViService.list(sql));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据活动项目性别查询有没有获奖人员
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
@At
|
||||
@SaCheckPermission("activity.results.input")
|
||||
public Result getUserData(String activityId,
|
||||
String eventId,
|
||||
Integer isMenWomen) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ar.id,
|
||||
ar.userId,
|
||||
ar.activityId,
|
||||
ar.eventId,
|
||||
u.username,
|
||||
u.unionId unionId,
|
||||
u.unionname,
|
||||
u.sex,
|
||||
ar.integral,
|
||||
ar.numberOfPeople,
|
||||
ar.ranking,
|
||||
ar.isTeamPersonal
|
||||
FROM
|
||||
`activity_results` ar
|
||||
LEFT JOIN `vw_user` u ON ar.userId = u.id $condition
|
||||
""");
|
||||
cnd.and("ar.activityId", "=", activityId);
|
||||
cnd.and("ar.eventId", "=", eventId);
|
||||
if (isMenWomen != null && isMenWomen == 1) cnd.and("u.sex", "=", "男性");
|
||||
if (isMenWomen != null && isMenWomen == 2) cnd.and("u.sex", "=", "女性");
|
||||
cnd.asc("ar.ranking");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(baseService.listMap(sql));
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("activity.results.input")
|
||||
public Result getUnionData(String activityId,
|
||||
String eventId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ar.id,
|
||||
ar.activityId,
|
||||
ar.eventId,
|
||||
ar.ranking,
|
||||
ar.unionId,
|
||||
ar.numberOfPeople,
|
||||
ar.integral,
|
||||
ar.isTeamPersonal
|
||||
FROM
|
||||
activity_results ar
|
||||
WHERE
|
||||
ar.isTeamPersonal = 2
|
||||
AND ar.activityId = @activityId
|
||||
AND ar.eventId = @eventId
|
||||
ORDER BY ar.ranking asc
|
||||
""").setParam("activityId", activityId).setParam("eventId", eventId);
|
||||
return Result.success(baseService.listMap(sql));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+603
@@ -0,0 +1,603 @@
|
||||
package com.budwk.app.zhgh.activity.sports.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.sys.models.Sys_union;
|
||||
import com.budwk.app.sys.services.SysUnionService;
|
||||
import com.budwk.app.zhgh.activity.sports.models.ActivitySchool;
|
||||
import com.budwk.app.zhgh.activity.sports.models.ActivitySchoolEvent;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/5/24 14:12
|
||||
* @description 运动会成绩统计
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/activity/score/statistics")
|
||||
public class ActivitySportsScoreStatisticsController {
|
||||
|
||||
@Inject
|
||||
private SysUnionService sysUnionService;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
|
||||
// @Inject
|
||||
// private OfficeTemplateUtil officeTemplateUtil;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:platform/zhgh/activity/sports/scoreStatistics/index.html")
|
||||
@SaCheckPermission("activity.score.statistics")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result isMaleFemale(String activityId, String sex, Integer awardsMode) {
|
||||
|
||||
NutMap map = new NutMap();
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
|
||||
//查询所有的工会
|
||||
List<Sys_union> query = sysUnionService.query();
|
||||
Cnd cndX = Cnd.NEW();
|
||||
//查询所有的项目
|
||||
Sql sqlX = Sqls.create("""
|
||||
SELECT
|
||||
ev.id,
|
||||
ev.eventId,
|
||||
ba.`name` baname,
|
||||
eve.projectType awardsMode,
|
||||
eve.allName label,
|
||||
eve.isMenWomen
|
||||
FROM
|
||||
activity_school_event ev
|
||||
LEFT JOIN activity_event eve ON ev.eventId = eve.id
|
||||
LEFT JOIN activity_basic_settings ba ON eve.competitionCategory = ba.id $condition
|
||||
""");
|
||||
cndX.and("ev.activityId", "=", activityId);
|
||||
if (awardsMode < 3) {
|
||||
cndX.and("eve.projectType", "=", awardsMode);
|
||||
cndX.and("eve.isInterest", "=", false);
|
||||
cndX.and("eve.isMenWomen", "=", sex.equals("男性") ? 1 : 2);
|
||||
}
|
||||
if (awardsMode == 3) {
|
||||
cndX.and("eve.isInterest", "=", true);
|
||||
}
|
||||
if (awardsMode == 4) {
|
||||
cndX.and(Cnd.exps("eve.isMenWomen", "=", sex.equals("男性") ? 1 : 2).or("eve.isMenWomen", "is", null));
|
||||
}
|
||||
cndX.and(new Static("1=1 order by case ba.`name` when '甲组' then 1 when '乙组' then 2 when '丙组' then 3 when '丁组' then 4 when '团体' then 5 end"));
|
||||
sqlX.setCondition(cndX);
|
||||
List<Record> eventList = baseService.list(sqlX);
|
||||
|
||||
//查询每个工会下每个项目的成绩
|
||||
for (Sys_union sys_union : query) {
|
||||
NutMap nutMap = new NutMap();
|
||||
//记录总积分
|
||||
double totalScore = 0;
|
||||
nutMap.setv("unionname", sys_union.getName());
|
||||
for (Record event : eventList) {
|
||||
Sql sqlC = Sqls.create("""
|
||||
SELECT
|
||||
IF ( sum( integral ) IS NULL, 0, sum( integral )) AS integral,
|
||||
ev.allName,ev.projectType,abs.`name` AS zb,ev.isInterest
|
||||
FROM
|
||||
activity_results ar
|
||||
LEFT JOIN activity_event ev ON ar.eventId = ev.id
|
||||
LEFT JOIN activity_basic_settings abs ON abs.id=ev.competitionCategory $condition
|
||||
""");
|
||||
Cnd cndC = Cnd.NEW();
|
||||
if ((awardsMode == 1 && event.getString("awardsMode").equals("1")) || (awardsMode == 2 && event.getString("awardsMode").equals("2"))) {
|
||||
cndC.and("ev.isInterest", "=", false);
|
||||
cndC.and("ev.isMenWomen", "=", sex.equals("男性") ? 1 : 2);
|
||||
} else if (awardsMode == 3) {
|
||||
cndC.and("ev.isInterest", "=", true);
|
||||
} else if (awardsMode == 4) {
|
||||
cndC.and(Cnd.exps("ev.isMenWomen", "=", sex.equals("男性") ? 1 : 2).or("ev.isMenWomen", "is", null));
|
||||
}
|
||||
cndC.and("ar.eventId", "=", event.getString("eventid"));
|
||||
cndC.and("ar.unionid", "=", sys_union.getId());
|
||||
cndC.and("ar.activityId", "=", activityId);
|
||||
sqlC.setCondition(cndC);
|
||||
Double score = 0.0;
|
||||
List<NutMap> list = baseService.listMap(sqlC);
|
||||
boolean isInterest = list.get(0).getBoolean("isInterest");
|
||||
|
||||
if (list.size() > 0) {
|
||||
score = list.get(0).getDouble("integral");
|
||||
}
|
||||
|
||||
if (list.get(0).getString("allName") != null) {
|
||||
if (!isInterest) {
|
||||
nutMap.setv(list.get(0).getString("allName"), score);
|
||||
} else {
|
||||
nutMap.setv(list.get(0).getString("allName"), score / 2);
|
||||
}
|
||||
}
|
||||
totalScore += isInterest ? (score / 2) : score;
|
||||
if (list.get(0).getString("zb") != null) {
|
||||
nutMap.setv("projectType", list.get(0).getString("projectType"));
|
||||
nutMap.setv("zb", list.get(0).getString("zb"));
|
||||
}
|
||||
}
|
||||
nutMap.setv("totalScore", totalScore);
|
||||
result.add(nutMap);
|
||||
}
|
||||
|
||||
map.put("score", result);
|
||||
map.put("eventList", eventList);
|
||||
return Result.success(map);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result isTopEight(String activityId, String sex, Integer awardsMode) {
|
||||
NutMap map = new NutMap();
|
||||
Cnd cndX = Cnd.NEW();
|
||||
//查询所有的项目
|
||||
Sql sqlX = Sqls.create("""
|
||||
SELECT
|
||||
ev.id,
|
||||
ev.eventId,
|
||||
ba.`name` baname,
|
||||
eve.projectType awardsMode,
|
||||
eve.allName label
|
||||
FROM
|
||||
activity_school_event ev
|
||||
LEFT JOIN activity_event eve ON ev.eventId = eve.id
|
||||
LEFT JOIN activity_basic_settings ba ON eve.competitionCategory = ba.id $condition
|
||||
""");
|
||||
cndX.and("ev.activityId", "=", activityId);
|
||||
if (awardsMode == 1) {
|
||||
cndX.and("eve.isMenWomen", "!=", sex.equals("男性") ? 2 : 1);
|
||||
cndX.and("eve.projectType", "=", 1);
|
||||
|
||||
} else {
|
||||
cndX.and("eve.projectType", "=", 2);
|
||||
}
|
||||
cndX.and(new Static("1=1 order by case ba.`name` when '甲组' then 1 when '乙组' then 2 when '丙组' then 3 when '丁组' then 4 when '团体' then 5 end"));
|
||||
sqlX.setCondition(cndX);
|
||||
List<Record> eventList = baseService.list(sqlX);
|
||||
|
||||
|
||||
Sql sqlC = Sqls.create("");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (awardsMode == 1) {
|
||||
sqlC = Sqls.create("""
|
||||
SELECT
|
||||
CONCAT( apply.username, '(', apply.activityUnionName, ')' ) username,
|
||||
ar.integral,
|
||||
ar.ranking,
|
||||
eve.allName
|
||||
FROM
|
||||
activity_results ar
|
||||
LEFT JOIN activity_event eve ON ar.eventId = eve.id
|
||||
LEFT JOIN activity_school_apply apply ON apply.userId = ar.userId
|
||||
AND ar.activityId = apply.activityId $condition
|
||||
""");
|
||||
cnd.and("ar.isTeamPersonal", "=", awardsMode);
|
||||
cnd.and("apply.sex", "=", sex);
|
||||
cnd.and("ar.activityId", "=", activityId);
|
||||
cnd.and("ar.ranking", "<=", 8);
|
||||
cnd.groupBy("ar.id");
|
||||
} else {
|
||||
sqlC = Sqls.create("""
|
||||
SELECT
|
||||
CONCAT(sun.name) username,
|
||||
eve.allName,ar.ranking
|
||||
FROM
|
||||
activity_results ar
|
||||
LEFT JOIN activity_event eve ON ar.eventId = eve.id
|
||||
LEFT JOIN sys_union sun ON sun.id = ar.unionId $condition
|
||||
""");
|
||||
cnd.and("ar.isTeamPersonal", "=", awardsMode);
|
||||
cnd.and("ar.activityId", "=", activityId);
|
||||
cnd.and("ar.ranking", "<=", 8);
|
||||
|
||||
|
||||
}
|
||||
|
||||
sqlC.setCondition(cnd);
|
||||
List<Record> list = baseService.list(sqlC);
|
||||
|
||||
map.put("userList", list);
|
||||
map.put("eventList", eventList);
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result getActivitys(Integer year) {
|
||||
List<ActivitySchool> schoolList = baseService.dao().query(ActivitySchool.class, Cnd.where("YEAR(applyEndTime)", "=", year));
|
||||
return Result.success(schoolList);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result isScoreTopEight(String activityId, String sex) {
|
||||
|
||||
NutMap map = new NutMap();
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
Cnd cndX = Cnd.NEW();
|
||||
//查询所有的项目
|
||||
Sql sqlX = Sqls.create("""
|
||||
SELECT
|
||||
ev.id,
|
||||
ev.eventId,
|
||||
ba.`name` baname,
|
||||
eve.projectType awardsMode,
|
||||
eve.allName label
|
||||
FROM
|
||||
activity_school_event ev
|
||||
LEFT JOIN activity_event eve ON ev.eventId = eve.id
|
||||
LEFT JOIN activity_basic_settings ba ON eve.competitionCategory = ba.id $condition
|
||||
""");
|
||||
cndX.and("ev.activityId", "=", activityId);
|
||||
cndX.and(Cnd.exps("eve.isMenWomen", "=", sex.equals("男性") ? 1 : 2).or("eve.isMenWomen", "is", null));
|
||||
cndX.and(new Static("1=1 order by case ba.`name` when '甲组' then 1 when '乙组' then 2 when '丙组' then 3 when '丁组' then 4 when '团体' then 5 end"));
|
||||
sqlX.setCondition(cndX);
|
||||
List<Record> eventList = baseService.list(sqlX);
|
||||
|
||||
//查询所有的工会
|
||||
List<Sys_union> query = sysUnionService.query();
|
||||
|
||||
for (Sys_union sys_union : query) {
|
||||
NutMap nutMap = new NutMap();
|
||||
|
||||
//记录总积分
|
||||
double totalScore = 0;
|
||||
nutMap.setv("unionname", sys_union.getName());
|
||||
for (Record event : eventList) {
|
||||
Sql sqlC = Sqls.create("""
|
||||
SELECT
|
||||
IF ( sum( integral ) IS NULL, 0, sum( integral )) AS integral,
|
||||
ev.allName,ev.isInterest
|
||||
FROM
|
||||
activity_results ar
|
||||
LEFT JOIN activity_event ev ON ar.eventId = ev.id $condition
|
||||
""");
|
||||
Cnd cndC = Cnd.NEW();
|
||||
cndC.and(Cnd.exps("ev.isMenWomen", "=", sex.equals("男性") ? 1 : 2).or("ev.isMenWomen", "is", null));
|
||||
cndC.and("ar.unionid", "=", sys_union.getId());
|
||||
cndC.and("ar.eventId", "=", event.getString("eventid"));
|
||||
cndC.and("ar.activityId", "=", activityId);
|
||||
sqlC.setCondition(cndC);
|
||||
Double score = 0.0;
|
||||
List<NutMap> list = baseService.listMap(sqlC);
|
||||
boolean isInterest = list.get(0).getBoolean("isInterest");
|
||||
if (list.size() > 0) {
|
||||
score = list.get(0).getDouble("integral");
|
||||
}
|
||||
totalScore += isInterest ? (score / 2) : score;
|
||||
|
||||
}
|
||||
nutMap.setv("totalScore", totalScore);
|
||||
result.add(nutMap);
|
||||
|
||||
}
|
||||
|
||||
map.put("score", result);
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result getAnnualResults(Integer year) {
|
||||
|
||||
ArrayList<Map> resultMap = new ArrayList<>();
|
||||
|
||||
|
||||
Dao dao = sysUnionService.dao();
|
||||
List<Sys_union> unionList = sysUnionService.query();
|
||||
List<ActivitySchool> activitySchoolList = dao.query(ActivitySchool.class, Cnd.where("YEAR(applyStartTime)", "=", year));
|
||||
|
||||
List<String> labelList = activitySchoolList.stream().map(v -> v.getName()).collect(Collectors.toList());
|
||||
labelList.add(0, "分工会");
|
||||
|
||||
unionList.forEach(u -> {
|
||||
NutMap unionMap = Lang.obj2nutmap(u);
|
||||
AtomicReference<Double> scoreSum = new AtomicReference<>((double) 0);
|
||||
activitySchoolList.forEach(x -> {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT sum(integral) as sumScore FROM `activity_results` ar
|
||||
where ar.activityId = @activityId and ar.unionId = @unionId
|
||||
""");
|
||||
sql.setParam("activityId", x.getId());
|
||||
sql.setParam("unionId", u.getId());
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
NutMap scoreMap = (NutMap) sql.getResult();
|
||||
double score = scoreMap.getDouble("sumScore");
|
||||
scoreSum.updateAndGet(v -> v + score);
|
||||
unionMap.put(x.getName(), score);
|
||||
});
|
||||
unionMap.put("总分", scoreSum.get());
|
||||
unionMap.put("分工会", unionMap.getString("unionname"));
|
||||
resultMap.add(unionMap);
|
||||
});
|
||||
labelList.add("总分");
|
||||
|
||||
return Result.success(Map.of("label", labelList, "score", resultMap));
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result getYear8(Integer isMenWomen, Integer year) {
|
||||
ArrayList<Map> resultMap = new ArrayList<>();
|
||||
|
||||
// int isMenWomen = sex.equals("男性") ? 1 : 2;
|
||||
|
||||
Dao dao = sysUnionService.dao();
|
||||
List<Sys_union> unionList = sysUnionService.query();
|
||||
|
||||
List<ActivitySchool> activityList = dao.query(ActivitySchool.class, Cnd.where("YEAR(applyStartTime)", "=", year));
|
||||
List<String> activityIdList = activityList.stream().map(ActivitySchool::getId).collect(Collectors.toList());
|
||||
List<String> activityNameList = activityList.stream().map(ActivitySchool::getName).collect(Collectors.toList());
|
||||
|
||||
List<String> eventIdList = dao.query(ActivitySchoolEvent.class, Cnd.where("activityId", "in", activityIdList)).stream().map(v -> v.getEventId()).collect(Collectors.toList());
|
||||
|
||||
activityNameList.add(0, "分工会");
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ae.isMenWomen,
|
||||
ae.isInterest,
|
||||
ar.integral,
|
||||
ar.unionId,
|
||||
ar.activityId
|
||||
FROM
|
||||
activity_event ae
|
||||
LEFT JOIN activity_results ar ON ar.eventId = ae.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("ae.id", "in", eventIdList);
|
||||
cnd.and("ar.activityId", "in", activityIdList);
|
||||
|
||||
sql.setCondition(cnd);
|
||||
sql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(sql);
|
||||
List<NutMap> list = sql.getList(NutMap.class);
|
||||
|
||||
unionList.forEach(u -> {
|
||||
NutMap unionMap = Lang.obj2nutmap(u);
|
||||
AtomicReference<Double> scoreSum = new AtomicReference<>((double) 0);
|
||||
|
||||
activityList.forEach(a -> {
|
||||
double sexScore = list.stream().filter(x -> x.getString("unionId").equals(u.getId()) && x.getInt("isMenWomen") == isMenWomen && x.getString("activityId").equals(a.getId())).mapToDouble(h -> h.getDouble("integral")).sum();
|
||||
double qwScore = list.stream().filter(x -> x.getString("unionId").equals(u.getId()) && x.getInt("isInterest") == 1 && x.getString("activityId").equals(a.getId())).mapToDouble(h -> h.getDouble("integral")).sum();
|
||||
scoreSum.updateAndGet(v -> v + sexScore + qwScore * 0.5);
|
||||
unionMap.put(a.getName(), sexScore + (qwScore * 0.5));
|
||||
});
|
||||
unionMap.put("总分", scoreSum.get());
|
||||
unionMap.put("分工会", unionMap.getString("unionname"));
|
||||
resultMap.add(unionMap);
|
||||
|
||||
});
|
||||
activityNameList.add("总分");
|
||||
return Result.success(Map.of("label", activityNameList, "score", resultMap));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@Ok("void")
|
||||
public void doGetYear8(HttpServletResponse response, Integer isMenWomen, Integer year) throws Exception {
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
|
||||
List<Sys_union> unionList = sysUnionService.query();
|
||||
|
||||
unionList.forEach(u -> {
|
||||
NutMap nutMap = new NutMap();
|
||||
nutMap.setv("unionname", u.getName());
|
||||
double score = 0;
|
||||
for (int i = 1; i <= 2; i++) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
SUM( ar.integral ) score
|
||||
FROM
|
||||
activity_results ar
|
||||
LEFT JOIN activity_event eve ON ar.eventId = eve.id
|
||||
LEFT JOIN activity_school `as` ON `as`.id = ar.activityId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("YEAR ( `as`.applyStartTime )", "=", year);
|
||||
cnd.and("ar.unionId", "=", u.getId());
|
||||
if (i == 1) {
|
||||
cnd.and("eve.isMenWomen", "=", isMenWomen);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
score += list.get(0).getDouble("score");
|
||||
} else {
|
||||
cnd.and("eve.isInterest", "=", 1);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
score += list.get(0).getDouble("score") * 0.5;
|
||||
}
|
||||
}
|
||||
nutMap.setv("score", score);
|
||||
result.add(nutMap);
|
||||
});
|
||||
List<NutMap> scoreList = result.stream().sorted(Comparator.comparing(ActivitySportsScoreStatisticsController::getDouble).reversed()).collect(Collectors.toList()).subList(0, 8);
|
||||
|
||||
for (int i = 0; i < scoreList.size(); i++) {
|
||||
scoreList.get(i).put("ranking", i + 1);
|
||||
}
|
||||
|
||||
|
||||
/* HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
|
||||
Configure config = Configure.newBuilder().bind("scoreList", policy).build();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("year", year);
|
||||
map.put("sex", isMenWomen == 1 ? '男性' : '女');
|
||||
map.put("scoreList", scoreList);
|
||||
String fileName = "%s年运动会%s子积分表".formatted(year, isMenWomen == 1 ? '男性' : '女');
|
||||
|
||||
response.addHeader("Content-Type", "application/octet-stream");
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
|
||||
XWPFTemplate.compile(officeTemplateUtil.getPath("activity_getYear8"), config).render(map).writeAndClose(response.getOutputStream());*/
|
||||
}
|
||||
|
||||
public static Double getDouble(NutMap o) {
|
||||
return o.getDouble("score");
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckLogin
|
||||
public void doExport8ByActivity(HttpServletResponse response, String activityId, Integer isMenWomen) throws Exception {
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
|
||||
List<Sys_union> unionList = sysUnionService.query();
|
||||
unionList.forEach(u -> {
|
||||
NutMap nutMap = new NutMap();
|
||||
nutMap.setv("unionname", u.getName());
|
||||
double score = 0;
|
||||
for (int i = 1; i <= 2; i++) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
SUM( ar.integral ) score
|
||||
FROM
|
||||
activity_results ar
|
||||
LEFT JOIN activity_event eve ON ar.eventId = eve.id
|
||||
LEFT JOIN activity_school `as` ON `as`.id = ar.activityId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("activityId", "=", activityId);
|
||||
cnd.and("ar.unionId", "=", u.getId());
|
||||
if (i == 1) {
|
||||
cnd.and("eve.isMenWomen", "=", isMenWomen);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
score += list.get(0).getDouble("score");
|
||||
} else {
|
||||
cnd.and("eve.isInterest", "=", 1);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
score += list.get(0).getDouble("score") * 0.5;
|
||||
}
|
||||
}
|
||||
nutMap.setv("score", score);
|
||||
result.add(nutMap);
|
||||
});
|
||||
List<NutMap> scoreList = result.stream().sorted(Comparator.comparing(ActivitySportsScoreStatisticsController::getDouble).reversed()).collect(Collectors.toList()).subList(0, 8);
|
||||
|
||||
for (int i = 0; i < scoreList.size(); i++) {
|
||||
scoreList.get(i).put("ranking", i + 1);
|
||||
}
|
||||
|
||||
/*HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
|
||||
Configure config = Configure.newBuilder().bind("scoreList", policy).build();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("sex", isMenWomen == 1 ? '男性' : '女');
|
||||
map.put("scoreList", scoreList);
|
||||
String fileName = "%s子积分表".formatted(isMenWomen == 1 ? '男性' : '女');
|
||||
|
||||
response.addHeader("Content-Type", "application/octet-stream");
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
|
||||
XWPFTemplate.compile(officeTemplateUtil.getPath("activity_getYear8"), config).render(map, response.getOutputStream());*/
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckLogin
|
||||
public void doExcelCj(String activityId, String unionId, HttpServletResponse response) throws IOException {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
un.unioncode,
|
||||
un.unionname,
|
||||
us.loginname,
|
||||
us.username,
|
||||
us.sex,
|
||||
eve.projectCode,
|
||||
abs.`name` competitionCategoryName,
|
||||
eve.allName,
|
||||
ar.integral,
|
||||
CEILING(
|
||||
IF
|
||||
( us.loginname IS NOT NULL, ar.integral, ar.integral / 2 )) jf,
|
||||
ar.ranking
|
||||
FROM
|
||||
activity_results ar
|
||||
LEFT JOIN activity_event eve ON ar.eventId = eve.id
|
||||
LEFT JOIN activity_basic_settings abs ON abs.id = eve.competitionCategory
|
||||
LEFT JOIN activity_school_apply apply ON apply.userId = ar.userId
|
||||
AND ar.activityId = apply.activityId
|
||||
LEFT JOIN sys_union un ON un.id = ar.unionId
|
||||
LEFT JOIN sys_user us ON us.id = ar.userId
|
||||
$condition
|
||||
ORDER BY
|
||||
un.unioncode ASC,
|
||||
us.sex DESC,
|
||||
FIELD( abs.`name`, '甲组', '乙组', '丙组', '丁组', '团体' ) ASC
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("ar.activityId", "=", activityId);
|
||||
cnd.andEX("ar.unionId", "=", unionId);
|
||||
cnd.groupBy("ar.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("分工会代码", "unioncode", 40));
|
||||
entityList.add(new ExcelExportEntity("分工会名称", "unionname", 20));
|
||||
entityList.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
entityList.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
entityList.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
entityList.add(new ExcelExportEntity("项目代码", "projectCode", 20));
|
||||
entityList.add(new ExcelExportEntity("组别", "competitionCategoryName", 20));
|
||||
entityList.add(new ExcelExportEntity("项目名称", "allName", 40));
|
||||
entityList.add(new ExcelExportEntity("成绩", "integral", 20));
|
||||
entityList.add(new ExcelExportEntity("名次", "ranking", 20));
|
||||
entityList.add(new ExcelExportEntity("积分", "jf", 20));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, list);
|
||||
CommonDownloadUtil.download("成绩名单.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+487
@@ -0,0 +1,487 @@
|
||||
package com.budwk.app.zhgh.activity.sports.controller;
|
||||
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.sys.models.Sys_union;
|
||||
import com.budwk.app.sys.services.SysUnionService;
|
||||
import com.budwk.app.zhgh.activity.sports.models.ActivitySchool;
|
||||
import com.budwk.app.zhgh.activity.sports.models.ActivitySchoolEvent;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/activity/statistics/export")
|
||||
public class ActivitySportsStatisticsTypeExportController {
|
||||
|
||||
@Inject
|
||||
private SysUnionService sysUnionService;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Ok("void")
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public void getYear8(Integer isMenWomen, Integer year, HttpServletResponse response) {
|
||||
ArrayList<Map> resultMap = new ArrayList<>();
|
||||
List<Sys_union> unionList = sysUnionService.query();
|
||||
|
||||
List<ActivitySchool> activityList = baseService.dao().query(ActivitySchool.class, Cnd.where("YEAR(applyStartTime)", "=", year));
|
||||
List<String> activityIdList = activityList.stream().map(ActivitySchool::getId).collect(Collectors.toList());
|
||||
List<String> activityNameList = activityList.stream().map(ActivitySchool::getName).collect(Collectors.toList());
|
||||
|
||||
List<String> eventIdList = baseService.dao().query(ActivitySchoolEvent.class, Cnd.where("activityId", "in", activityIdList)).stream().map(v -> v.getEventId()).collect(Collectors.toList());
|
||||
|
||||
activityNameList.add(0, "分工会");
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ae.isMenWomen,
|
||||
ae.isInterest,
|
||||
ar.integral,
|
||||
ar.unionId,
|
||||
ar.activityId
|
||||
FROM
|
||||
activity_event ae
|
||||
LEFT JOIN activity_results ar ON ar.eventId = ae.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("ae.id", "in", eventIdList);
|
||||
cnd.and("ar.activityId", "in", activityIdList);
|
||||
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
unionList.forEach(u -> {
|
||||
NutMap unionMap = Lang.obj2nutmap(u);
|
||||
AtomicReference<Double> scoreSum = new AtomicReference<>((double) 0);
|
||||
|
||||
activityList.forEach(a -> {
|
||||
double sexScore = list.stream().filter(x -> x.getString("unionId").equals(u.getId()) && x.getInt("isMenWomen") == isMenWomen && x.getString("activityId").equals(a.getId())).mapToDouble(h -> h.getDouble("integral")).sum();
|
||||
double qwScore = list.stream().filter(x -> x.getString("unionId").equals(u.getId()) && x.getInt("isInterest") == 1 && x.getString("activityId").equals(a.getId())).mapToDouble(h -> h.getDouble("integral")).sum();
|
||||
scoreSum.updateAndGet(v -> v + (sexScore + (qwScore * 0.5)));
|
||||
unionMap.put(a.getName(), sexScore + (qwScore * 0.5));
|
||||
});
|
||||
unionMap.put("总分", scoreSum.get());
|
||||
unionMap.put("分工会", unionMap.getString("unionname"));
|
||||
resultMap.add(unionMap);
|
||||
|
||||
});
|
||||
activityNameList.add("总分");
|
||||
|
||||
resultMap.sort(Comparator.comparing((Map m) -> (new BigDecimal(m.get("总分").toString()))).reversed());
|
||||
for (int i = 0; i < resultMap.size(); i++) {
|
||||
resultMap.get(i).put("名次", i + 1);
|
||||
}
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("名次", "名次", 20));
|
||||
activityNameList.forEach(v -> {
|
||||
entityList.add(new ExcelExportEntity(v, v, 40));
|
||||
});
|
||||
try {
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, resultMap);
|
||||
CommonDownloadUtil.download("年度" + (isMenWomen == 1 ? "男子" : "女子") + "团体总分.xlsx", workbook, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Ok("void")
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public void getAnnualResults(Integer year, HttpServletResponse response) {
|
||||
ArrayList<Map> resultMap = new ArrayList<>();
|
||||
|
||||
|
||||
Dao dao = sysUnionService.dao();
|
||||
List<Sys_union> unionList = sysUnionService.query();
|
||||
List<ActivitySchool> activitySchoolList = dao.query(ActivitySchool.class, Cnd.where("YEAR(applyStartTime)", "=", year));
|
||||
|
||||
List<String> labelList = activitySchoolList.stream().map(v -> v.getName()).collect(Collectors.toList());
|
||||
labelList.add(0, "分工会");
|
||||
|
||||
unionList.forEach(u -> {
|
||||
NutMap unionMap = Lang.obj2nutmap(u);
|
||||
AtomicReference<Double> scoreSum = new AtomicReference<>((double) 0);
|
||||
activitySchoolList.forEach(x -> {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT sum(integral) as sumScore FROM `activity_results` ar
|
||||
where ar.activityId = @activityId and ar.unionId = @unionId
|
||||
""");
|
||||
sql.setParam("activityId", x.getId());
|
||||
sql.setParam("unionId", u.getId());
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
NutMap scoreMap = (NutMap) sql.getResult();
|
||||
double score = scoreMap.getDouble("sumScore");
|
||||
scoreSum.updateAndGet(v -> v + score);
|
||||
unionMap.put(x.getName(), score);
|
||||
});
|
||||
unionMap.put("总分", scoreSum.get());
|
||||
unionMap.put("分工会", unionMap.getString("unionname"));
|
||||
resultMap.add(unionMap);
|
||||
});
|
||||
labelList.add("总分");
|
||||
|
||||
resultMap.sort(Comparator.comparing((Map m) -> (new BigDecimal(m.get("总分").toString()))).reversed());
|
||||
for (int i = 0; i < resultMap.size(); i++) {
|
||||
resultMap.get(i).put("名次", i + 1);
|
||||
}
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("名次", "名次", 20));
|
||||
labelList.forEach(v -> {
|
||||
entityList.add(new ExcelExportEntity(v, v, 40));
|
||||
|
||||
});
|
||||
try {
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, resultMap);
|
||||
CommonDownloadUtil.download("年度团体总分.xlsx", workbook, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
public void isMaleFemale(String activityId, String sex, Integer awardsMode, HttpServletResponse response) {
|
||||
NutMap map = new NutMap();
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
|
||||
//查询所有的工会
|
||||
List<Sys_union> query = sysUnionService.query();
|
||||
Cnd cndX = Cnd.NEW();
|
||||
//查询所有的项目
|
||||
Sql sqlX = Sqls.create("""
|
||||
SELECT
|
||||
ev.id,
|
||||
ev.eventId,
|
||||
ba.`name` baname,
|
||||
eve.projectType awardsMode,
|
||||
eve.allName label,
|
||||
eve.isMenWomen
|
||||
FROM
|
||||
activity_school_event ev
|
||||
LEFT JOIN activity_event eve ON ev.eventId = eve.id
|
||||
LEFT JOIN activity_basic_settings ba ON eve.competitionCategory = ba.id $condition
|
||||
""");
|
||||
cndX.and("ev.activityId", "=", activityId);
|
||||
if (awardsMode < 3) {
|
||||
cndX.and("eve.projectType", "=", awardsMode);
|
||||
cndX.and("eve.isInterest", "=", false);
|
||||
cndX.and("eve.isMenWomen", "=", sex.equals("男性") ? 1 : 2);
|
||||
}
|
||||
if (awardsMode == 3) {
|
||||
cndX.and("eve.isInterest", "=", true);
|
||||
}
|
||||
if (awardsMode == 4) {
|
||||
cndX.and(Cnd.exps("eve.isMenWomen", "=", sex.equals("男性") ? 1 : 2).or("eve.isMenWomen", "is", null));
|
||||
}
|
||||
cndX.and(new Static("1=1 order by case ba.`name` when '甲组' then 1 when '乙组' then 2 when '丙组' then 3 when '丁组' then 4 when '团体' then 5 end"));
|
||||
sqlX.setCondition(cndX);
|
||||
List<Record> eventList = baseService.list(sqlX);
|
||||
|
||||
//查询每个工会下每个项目的成绩
|
||||
for (Sys_union sys_union : query) {
|
||||
NutMap nutMap = new NutMap();
|
||||
//记录总积分
|
||||
double totalScore = 0;
|
||||
nutMap.setv("unionname", sys_union.getName());
|
||||
for (Record event : eventList) {
|
||||
Sql sqlC = Sqls.create("""
|
||||
SELECT
|
||||
IF ( sum( integral ) IS NULL, 0, sum( integral )) AS integral,
|
||||
ev.allName,ev.projectType,abs.`name` AS zb,ev.isInterest
|
||||
FROM
|
||||
activity_results ar
|
||||
LEFT JOIN activity_event ev ON ar.eventId = ev.id
|
||||
LEFT JOIN activity_basic_settings abs ON abs.id=ev.competitionCategory $condition
|
||||
""");
|
||||
Cnd cndC = Cnd.NEW();
|
||||
if ((awardsMode == 1 && event.getString("awardsMode").equals("1")) || (awardsMode == 2 && event.getString("awardsMode").equals("2"))) {
|
||||
cndC.and("ev.isInterest", "=", false);
|
||||
cndC.and("ev.isMenWomen", "=", sex.equals("男性") ? 1 : 2);
|
||||
} else if (awardsMode == 3) {
|
||||
cndC.and("ev.isInterest", "=", true);
|
||||
} else if (awardsMode == 4) {
|
||||
cndC.and(Cnd.exps("ev.isMenWomen", "=", sex.equals("男性") ? 1 : 2).or("ev.isMenWomen", "is", null));
|
||||
}
|
||||
cndC.and("ar.eventId", "=", event.getString("eventid"));
|
||||
cndC.and("ar.unionid", "=", sys_union.getId());
|
||||
cndC.and("ar.activityId", "=", activityId);
|
||||
sqlC.setCondition(cndC);
|
||||
Double score = 0.0;
|
||||
List<NutMap> list = baseService.listMap(sqlC);
|
||||
boolean isInterest = list.get(0).getBoolean("isInterest");
|
||||
|
||||
if (list.size() > 0) {
|
||||
score = list.get(0).getDouble("integral");
|
||||
}
|
||||
|
||||
if (list.get(0).getString("allName") != null) {
|
||||
if (!isInterest) {
|
||||
nutMap.setv(list.get(0).getString("allName"), score);
|
||||
} else {
|
||||
nutMap.setv(list.get(0).getString("allName"), score / 2);
|
||||
}
|
||||
}
|
||||
totalScore += isInterest ? (score / 2) : score;
|
||||
if (list.get(0).getString("zb") != null) {
|
||||
nutMap.setv("projectType", list.get(0).getString("projectType"));
|
||||
nutMap.setv("zb", list.get(0).getString("zb"));
|
||||
}
|
||||
}
|
||||
nutMap.setv("totalScore", totalScore);
|
||||
result.add(nutMap);
|
||||
}
|
||||
|
||||
result.sort(Comparator.comparing((Map m) -> (new BigDecimal(m.get("totalScore").toString()))).reversed());
|
||||
for (int i = 0; i < result.size(); i++) {
|
||||
result.get(i).put("名次", i + 1);
|
||||
}
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("名次", "名次", 20));
|
||||
entityList.add(new ExcelExportEntity("分工会", "unionname", 40));
|
||||
eventList.forEach(v -> {
|
||||
entityList.add(new ExcelExportEntity(v.getString("label"), v.getString("label"), 40));
|
||||
});
|
||||
entityList.add(new ExcelExportEntity("总分", "totalScore", 40));
|
||||
try {
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, result);
|
||||
CommonDownloadUtil.download("分工会" + sex + "项目积分.xlsx", workbook, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
public void isTopEight(String activityId, String sex, Integer awardsMode, HttpServletResponse response) {
|
||||
NutMap map = new NutMap();
|
||||
List<Record> result = new ArrayList<>();
|
||||
Cnd cndX = Cnd.NEW();
|
||||
//查询所有的项目
|
||||
Sql sqlX = Sqls.create("""
|
||||
SELECT
|
||||
ev.id,
|
||||
ev.eventId,
|
||||
ba.`name` baname,
|
||||
eve.projectType awardsMode,
|
||||
eve.allName label
|
||||
FROM
|
||||
activity_school_event ev
|
||||
LEFT JOIN activity_event eve ON ev.eventId = eve.id
|
||||
LEFT JOIN activity_basic_settings ba ON eve.competitionCategory = ba.id $condition
|
||||
""");
|
||||
cndX.and("ev.activityId", "=", activityId);
|
||||
if (awardsMode == 1) {
|
||||
cndX.and("eve.isMenWomen", "!=", sex.equals("男性") ? 2 : 1);
|
||||
cndX.and("eve.projectType", "=", 1);
|
||||
|
||||
} else {
|
||||
cndX.and("eve.projectType", "=", 2);
|
||||
}
|
||||
cndX.and(new Static("1=1 order by case ba.`name` when '甲组' then 1 when '乙组' then 2 when '丙组' then 3 when '丁组' then 4 when '团体' then 5 end"));
|
||||
sqlX.setCondition(cndX);
|
||||
List<Record> eventList = baseService.list(sqlX);
|
||||
|
||||
|
||||
List<NutMap> nutMaps = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
NutMap nutMap = new NutMap();
|
||||
Sql sqlC = Sqls.create("");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (awardsMode == 1) {
|
||||
sqlC = Sqls.create("""
|
||||
SELECT
|
||||
CONCAT( apply.username, '(', apply.activityUnionName, ')' ) username,
|
||||
ar.integral,
|
||||
ar.ranking,
|
||||
eve.allName
|
||||
FROM
|
||||
activity_results ar
|
||||
LEFT JOIN activity_event eve ON ar.eventId = eve.id
|
||||
LEFT JOIN activity_school_apply apply ON apply.userId = ar.userId
|
||||
AND ar.activityId = apply.activityId $condition
|
||||
""");
|
||||
cnd.and("ar.isTeamPersonal", "=", awardsMode);
|
||||
cnd.and("apply.sex", "=", sex);
|
||||
cnd.and("ar.activityId", "=", activityId);
|
||||
cnd.and("ar.ranking", "=", i + 1);
|
||||
cnd.groupBy("ar.id");
|
||||
} else {
|
||||
sqlC = Sqls.create("""
|
||||
SELECT
|
||||
CONCAT(sun.name) username,
|
||||
eve.allName,ar.ranking
|
||||
FROM
|
||||
activity_results ar
|
||||
LEFT JOIN activity_event eve ON ar.eventId = eve.id
|
||||
LEFT JOIN sys_union sun ON sun.id = ar.unionId $condition
|
||||
""");
|
||||
cnd.and("ar.isTeamPersonal", "=", awardsMode);
|
||||
cnd.and("ar.activityId", "=", activityId);
|
||||
cnd.and("ar.ranking", "=", i + 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
sqlC.setCondition(cnd);
|
||||
List<Record> list = baseService.list(sqlC);
|
||||
list.forEach(l -> {
|
||||
nutMap.setv(l.getString("allName"), l.getString("username"));
|
||||
});
|
||||
|
||||
nutMaps.add(nutMap);
|
||||
}
|
||||
|
||||
for (int i = 0; i < nutMaps.size(); i++) {
|
||||
nutMaps.get(i).put("名次", i + 1);
|
||||
}
|
||||
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("名次", "名次", 20));
|
||||
eventList.forEach(v -> {
|
||||
entityList.add(new ExcelExportEntity(v.getString("label"), v.getString("label"), 40));
|
||||
});
|
||||
String sex2 = awardsMode == 2 ? "团体" : sex.equals("男性") ? "男子" : "女子";
|
||||
try {
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, nutMaps);
|
||||
CommonDownloadUtil.download("项目前八.xlsx", workbook, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
public void isScoreTopEight(String activityId, String sex, HttpServletResponse response) {
|
||||
|
||||
NutMap map = new NutMap();
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
Cnd cndX = Cnd.NEW();
|
||||
//查询所有的项目
|
||||
Sql sqlX = Sqls.create("""
|
||||
SELECT
|
||||
ev.id,
|
||||
ev.eventId,
|
||||
ba.`name` baname,
|
||||
eve.projectType awardsMode,
|
||||
eve.allName label
|
||||
FROM
|
||||
activity_school_event ev
|
||||
LEFT JOIN activity_event eve ON ev.eventId = eve.id
|
||||
LEFT JOIN activity_basic_settings ba ON eve.competitionCategory = ba.id $condition
|
||||
""");
|
||||
cndX.and("ev.activityId", "=", activityId);
|
||||
cndX.and(Cnd.exps("eve.isMenWomen", "=", sex.equals("男性") ? 1 : 2).or("eve.isMenWomen", "is", null));
|
||||
cndX.and(new Static("1=1 order by case ba.`name` when '甲组' then 1 when '乙组' then 2 when '丙组' then 3 when '丁组' then 4 when '团体' then 5 end"));
|
||||
sqlX.setCondition(cndX);
|
||||
List<Record> eventList = baseService.list(sqlX);
|
||||
|
||||
//查询所有的工会
|
||||
List<Sys_union> query = sysUnionService.query();
|
||||
|
||||
for (Sys_union sys_union : query) {
|
||||
NutMap nutMap = new NutMap();
|
||||
|
||||
//记录总积分
|
||||
double totalScore = 0;
|
||||
nutMap.setv("unionname", sys_union.getName());
|
||||
for (Record event : eventList) {
|
||||
Sql sqlC = Sqls.create("""
|
||||
SELECT
|
||||
IF ( sum( integral ) IS NULL, 0, sum( integral )) AS integral,
|
||||
ev.allName,ev.isInterest
|
||||
FROM
|
||||
activity_results ar
|
||||
LEFT JOIN activity_event ev ON ar.eventId = ev.id $condition
|
||||
""");
|
||||
Cnd cndC = Cnd.NEW();
|
||||
cndC.and(Cnd.exps("ev.isMenWomen", "=", sex.equals("男性") ? 1 : 2).or("ev.isMenWomen", "is", null));
|
||||
cndC.and("ar.unionid", "=", sys_union.getId());
|
||||
cndC.and("ar.eventId", "=", event.getString("eventid"));
|
||||
cndC.and("ar.activityId", "=", activityId);
|
||||
sqlC.setCondition(cndC);
|
||||
Double score = 0.0;
|
||||
List<NutMap> list = baseService.listMap(sqlC);
|
||||
boolean isInterest = list.get(0).getBoolean("isInterest");
|
||||
if (list.size() > 0) {
|
||||
score = list.get(0).getDouble("integral");
|
||||
}
|
||||
totalScore += isInterest ? (score / 2) : score;
|
||||
|
||||
}
|
||||
nutMap.setv("totalScore", totalScore);
|
||||
result.add(nutMap);
|
||||
}
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("名次", "名次", 20));
|
||||
entityList.add(new ExcelExportEntity("分工会", "unionname", 40));
|
||||
entityList.add(new ExcelExportEntity("总分", "totalScore", 40));
|
||||
|
||||
result.sort(Comparator.comparing((Map m) -> (new BigDecimal(m.get("totalScore").toString()))).reversed());
|
||||
for (int i = 0; i < result.size(); i++) {
|
||||
result.get(i).put("名次", i + 1);
|
||||
}
|
||||
|
||||
try {
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, result);
|
||||
CommonDownloadUtil.download("分工会" + sex + "子总分.xlsx", workbook, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -45,6 +45,11 @@ public class ProposalInfo extends BaseModel {
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer typeId;
|
||||
|
||||
@Column
|
||||
@Comment("提案类型")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer proposalTypeId;
|
||||
|
||||
@Column
|
||||
@Comment("提案来源")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
|
||||
+98
@@ -1,12 +1,22 @@
|
||||
package com.budwk.app.zhgh.welfare.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.model.ExcelImportRes;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.zhgh.welfare.mode.CourierNumberExcelMode;
|
||||
import com.budwk.app.zhgh.welfare.mode.WelfareUserImportExcel;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareList;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareUserSelection;
|
||||
import com.budwk.app.zhgh.welfare.param.WelfareSelectionSituationPageForm;
|
||||
@@ -16,21 +26,27 @@ import com.budwk.app.zhgh.welfare.service.WelfareStatisticsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
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 org.nutz.mvc.annotation.AdaptBy;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
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.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@@ -113,4 +129,86 @@ public class WelfareSelectionSituationController {
|
||||
return Result.success().addData(user.getMobile());
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.selection.situation")
|
||||
@ApiOperation("下载模版")
|
||||
public void downloadTemplate(HttpServletResponse response) {
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
entities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
entities.add(new ExcelExportEntity("快递单号", "courierNumber", 30));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, Collections.emptyList());
|
||||
CommonDownloadUtil.download("福利快递单号模版.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("welfare.list.mange")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
@SLog(tag = "福利名单管理", msg = "导入福利单号")
|
||||
public Result importByExcel(@Param("file") TempFile tempFile, @Valid @Param("projectId") String projectId, @Valid @Param("welfareOptionId") String welfareOptionId) {
|
||||
|
||||
if (StrUtil.isBlank(projectId)||StrUtil.isBlank(welfareOptionId)){
|
||||
return Result.error("请选择福利项目或福利选项");
|
||||
}
|
||||
// 读取数据
|
||||
List<CourierNumberExcelMode> excelList = ExcelImportUtil.importExcel(tempFile.getFile(), CourierNumberExcelMode.class, new ImportParams());
|
||||
|
||||
// 查询用户
|
||||
List<String> loginNames = excelList.stream().map(CourierNumberExcelMode::getLoginName).filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
|
||||
List<View_user> sysUsers = welfareListService.dao().query(View_user.class, Cnd.where(View_user::getLoginname, "in", loginNames));
|
||||
|
||||
List<WelfareUserSelection> selectionList = dao.query(WelfareUserSelection.class, Cnd.where(WelfareUserSelection::getWelfareId, "=", projectId)
|
||||
.and(WelfareUserSelection::getSelectOptionId, "=", welfareOptionId));
|
||||
|
||||
// 创建结果集
|
||||
ExcelImportRes<CourierNumberExcelMode> excelImportRes = new ExcelImportRes<>();
|
||||
excelImportRes.setTotalRecords(excelList.size());
|
||||
|
||||
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
CourierNumberExcelMode excel = excelList.get(i);
|
||||
if (StrUtil.isBlank(excel.getLoginName())) {
|
||||
excel.setErrInfo("工号为空", i + 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
// 不能在excel里重复
|
||||
if (excelList.stream().filter(s -> s.getLoginName().equals(excel.getLoginName())).count() > 1) {
|
||||
excel.setErrInfo("重复数据", i + 1);
|
||||
}
|
||||
|
||||
View_user user = sysUsers.stream().filter(s -> s.getLoginname().equals(excel.getLoginName())).findFirst().orElse(null);
|
||||
if (user == null) {
|
||||
excel.setErrInfo("无此用户", i + 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!selectionList.stream().anyMatch(s -> s.getSelectUserId().equals(user.getId()))) {
|
||||
excel.setErrInfo("该用户不存在", i + 1);
|
||||
continue;
|
||||
}
|
||||
WelfareUserSelection selection = selectionList.stream().filter(s -> s.getSelectUserId().equals(user.getId())).findFirst().orElse(null);
|
||||
selection.setCourierNumber(excel.getCourierNumber());
|
||||
try {
|
||||
welfareListService.updateIgnoreNull(selection);
|
||||
} catch (Exception e) {
|
||||
log.error("添加福利名单失败:{}", e.getMessage());
|
||||
excel.setErrInfo("添加失败", i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// 添加错误记录
|
||||
excelImportRes.setErrorDetails(excelList.stream().filter(s -> StrUtil.isNotBlank(s.getErrMsg())).collect(Collectors.toList()));
|
||||
excelImportRes.setFailedCount(excelImportRes.getErrorDetails().size());
|
||||
|
||||
return Result.success(excelImportRes);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.budwk.app.zhgh.welfare.mode;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.budwk.app.base.model.ExcelImportError;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class CourierNumberExcelMode {
|
||||
public class CourierNumberExcelMode extends ExcelImportError {
|
||||
|
||||
@Excel(name = "工号", width = 20)
|
||||
private String loginName;
|
||||
@@ -12,6 +15,9 @@ public class CourierNumberExcelMode {
|
||||
@Excel(name = "姓名", width = 20)
|
||||
private String userName;
|
||||
|
||||
@Excel(name = "快递单号", width = 30)
|
||||
private String courierNumber;
|
||||
|
||||
@Excel(name = "快递单号1", width = 30)
|
||||
private String oneCourierNumber;
|
||||
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<el-table :data="tableData" style="width: 100%;height: 100%" stripe border
|
||||
ref="MaleFemaleTab"
|
||||
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
|
||||
v-loading="tableLoading" size="mini" fixed>
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
|
||||
width="80px" fixed></el-table-column>
|
||||
<el-table-column label="分工会" prop="unionname" header-align="center"
|
||||
align="center" fixed show-overflow-tooltip width="250px"></el-table-column>
|
||||
<el-table-column label="甲组" header-align="center" v-if="tableColumns.length>0">
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="乙组" header-align="center" v-if="tableColumns2.length>0">
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns2"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="丙组" header-align="center" v-if="tableColumns3.length>0">
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns3"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="丁组" header-align="center" v-if="tableColumns4.length>0">
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns4"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="团体" header-align="center" v-if="tableColumns5.length>0">
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns5"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="总分" prop="totalScore" header-align="center"
|
||||
align="center" show-overflow-tooltip fixed="right"></el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index" show-overflow-tooltip label="名次"
|
||||
width="80px" fixed="right"></el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props: {
|
||||
Form: {
|
||||
type: Object,
|
||||
default: {},
|
||||
}
|
||||
},
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
maxHeight: 0,
|
||||
tableColumns2: [],
|
||||
tableColumns3: [],
|
||||
tableColumns4: [],
|
||||
tableColumns5: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
/* const tabHeight = document.getElementById("app").clientHeight - (this.$refs.MaleFemaleTab.$el.offsetTop + 60)
|
||||
this.$nextTick(()=>{
|
||||
this.maxHeight = tabHeight
|
||||
})*/
|
||||
},
|
||||
methods: {
|
||||
async isMaleFemale() {
|
||||
|
||||
this.tableColumns = []
|
||||
this.tableColumns2 = []
|
||||
this.tableColumns3 = []
|
||||
this.tableColumns4 = []
|
||||
this.tableColumns5 = []
|
||||
this.tableData = []
|
||||
const {data} = await this.$axios.post("/platform/activity/score/statistics/isMaleFemale", this.Form)
|
||||
data.eventList.forEach(v => {
|
||||
if (v.baname == "甲组" || v.baname == "乙组" || v.baname == "丙组" || v.baname == "丁组") {
|
||||
this.tableColumns.push({label: v.isMenWomen ? v.label.substr(4) : v.label.substr(2), prop: v.label})
|
||||
} else {
|
||||
|
||||
this.tableColumns5.push({label: v.label, prop: v.label})
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
this.tableData = data.score.sort(this.compare("totalScore"))
|
||||
if (this.Form.unionname) {
|
||||
this.tableData = this.tableData.filter(v => v.unionname == this.Form.unionname)
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
compare(prop) {
|
||||
return function (obj1, obj2) {
|
||||
const val1 = obj1[prop];
|
||||
const val2 = obj2[prop];
|
||||
if (val1 > val2) {
|
||||
return -1;
|
||||
} else if (val1 < val2) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<el-table :data="tableData" style="width: 100%;height: 100%" stripe border
|
||||
ref="MaleFemaleTab"
|
||||
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
|
||||
v-loading="tableLoading" size="mini" fixed >
|
||||
<!--:max-height="maxHeight"-->
|
||||
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
|
||||
width="80px" fixed></el-table-column>
|
||||
<el-table-column label="分工会" prop="unionname" header-align="center"
|
||||
align="center" fixed show-overflow-tooltip></el-table-column>
|
||||
|
||||
<el-table-column label="总分" prop="totalScore" header-align="center"
|
||||
align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="名次"
|
||||
width="80px" ></el-table-column>
|
||||
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props: {
|
||||
Form: {
|
||||
type: Object,
|
||||
default: {},
|
||||
}
|
||||
},
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
maxHeight: 0
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
/*const tabHeight = document.getElementById("app").clientHeight - (this.$refs.MaleFemaleTab.$el.offsetTop + 60)
|
||||
this.$nextTick(() => {
|
||||
this.maxHeight = tabHeight
|
||||
})*/
|
||||
},
|
||||
methods: {
|
||||
async isScoreTopEight() {
|
||||
|
||||
this.tableColumns = []
|
||||
this.tableData = []
|
||||
const {data} = await this.$axios.post(loc() + "/isScoreTopEight", this.Form)
|
||||
const table = data.score.sort(this.compare("totalScore"))
|
||||
this.tableData = table.slice(0, 8)
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
compare(prop) {
|
||||
return function (obj1, obj2) {
|
||||
const val1 = obj1[prop];
|
||||
const val2 = obj2[prop];
|
||||
if (val1 > val2) {
|
||||
return -1;
|
||||
} else if (val1 < val2) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <el-table :data="tableData" style="width: 100%" stripe border
|
||||
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
|
||||
v-loading="tableLoading" size="mini">
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="名次"
|
||||
width="100px"></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>-->
|
||||
<table class="table table-bordered" style="table-layout: fixed;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center!important;">项目</th>
|
||||
<th style="text-align: center!important;" v-for="i in 8">第{{ i }}名</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="i in tableData">
|
||||
<td align="center" width="20%">{{ i.label }}</td>
|
||||
<td v-for="x in 8" align="center" width="10%">
|
||||
{{ getTableTdContent(i.sss, x) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props: {
|
||||
Form: {
|
||||
type: Object,
|
||||
default: {},
|
||||
}
|
||||
},
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTableTdContent(d, i) {
|
||||
return d.filter(v => {
|
||||
if (v.ranking == i) {
|
||||
return v.username
|
||||
}
|
||||
}).map(v => {
|
||||
return v.username
|
||||
}).toString()
|
||||
},
|
||||
async isTopEight() {
|
||||
var loading = this.$loading({
|
||||
lock: true,
|
||||
text: '数据正在查询中,请稍后...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
this.tableColumns = []
|
||||
this.tableData = []
|
||||
const {data} = await this.$axios.post(loc() + "/isTopEight", this.Form)
|
||||
data.eventList.map(v => {
|
||||
v.sss = []
|
||||
data.userList.map(x => {
|
||||
if (v.label === x.allname) {
|
||||
console.log(x)
|
||||
v.sss.push(x)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
this.tableData = data.eventList
|
||||
loading.close();
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
const branchUnionCadreAudit = {
|
||||
template: /*language=HTML*/ `
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="基层干部">
|
||||
<el-radio-group @change="doSearch" class="mr5" size="small" v-model="pageForm.audit">
|
||||
<el-radio-button label="true">已审核</el-radio-button>
|
||||
<el-radio-button label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<!-- <el-button size="small" @click="doAudit(true)" :disabled="!multipleSelection.length" type="primary"-->
|
||||
<!-- icon="el-icon-check">批量通过-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button size="small" @click="doAudit(false)" :disabled="!multipleSelection.length" type="danger"-->
|
||||
<!-- icon="el-icon-check">批量拒绝-->
|
||||
<!-- </el-button>-->
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id"
|
||||
style="width: 100%" @selection-change="handleSelectionChange" height="65vh">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" type="index" :index="indexMethod"
|
||||
label="序号" width="80px"></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"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
<template v-if="column.prop==='isJoin'" scope="{row:{isJoin}}">
|
||||
<span v-if="isJoin" class="text-info">加入</span>
|
||||
<span v-else class="text-danger">退出</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='instanceState'">
|
||||
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
|
||||
size="small"></enum-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" fixed="right" width="180px" v-if="!pageForm.audit">
|
||||
<template scope="{row}">
|
||||
<template v-if="row.taskState === 10">
|
||||
<el-button @click="handleTaskAction(row, 1)" size="mini" type="primary">通过</el-button>
|
||||
<el-button @click="handleTaskAction(row, 2)" size="mini" type="danger">拒绝</el-button>
|
||||
</template>
|
||||
<el-button v-if="row.canRevoke" @click="openRevoke(row)" size="mini" type="danger">
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-row class="el-pagination-container" style="margin-bottom: 0">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
audit: false
|
||||
},
|
||||
tableColumns: [
|
||||
{ prop: 'loginName', label: '工号' },
|
||||
{ prop: 'userName', label: '姓名' },
|
||||
{ prop: 'unionName', label: '所属工会' },
|
||||
{ prop: 'mobile', label: '联系方式' },
|
||||
{ prop: 'roleName', label: '职务' },
|
||||
{ prop: 'isJoin', label: '申请类型' },
|
||||
{ prop: "curTaskName", label: "当前节点" },
|
||||
{ prop: "instanceState", label: "流程状态" }
|
||||
],
|
||||
multipleSelection: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
doAudit(pass) {
|
||||
this.$confirm('是否确认提交?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const ids = JSON.stringify(this.multipleSelection.map(v => v.id))
|
||||
this.$axios.post('/platform/sys/union/cadreDoAudit', {ids, pass})
|
||||
.then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.table.clearSelection();
|
||||
this.$message.success(resp.msg)
|
||||
}else{
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
handleTaskAction(row, val) {
|
||||
const msg = val === 1 ? "通过" : "拒绝"
|
||||
this.$confirm("您确定要" + msg + "吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.formData = {
|
||||
origin: row.origin,
|
||||
processTaskId: row.taskId,
|
||||
taskName: row.curTaskName
|
||||
}
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
pageData() {
|
||||
this.$axios.post('/platform/sys/union/cadrePageData', this.pageForm)
|
||||
.then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list
|
||||
this.pageForm.totalCount = resp.data.totalCount
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ const branchUnionManage = {
|
||||
<el-input placeholder="请输入分工会名称" clearable size="small" style="width: 300px" v-model="pageForm.searchKeyword"></el-input>
|
||||
|
||||
<el-button type="primary" class="ml5" size="small" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
<!-- <el-button icon="el-icon-s-check" type="primary" style="margin-left: auto" size="small">基层干部审核</el-button>-->
|
||||
<el-button @click="openAudit" icon="el-icon-s-check" type="primary" style="margin-left: auto" size="small">基层干部审核</el-button>
|
||||
<el-button @click="openAdd" icon="ti-plus" type="primary" size="small" v-if="$auth.hasPermission('sys.manager.union.add')">新建分工会</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
@@ -75,6 +75,10 @@ const branchUnionManage = {
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
})
|
||||
},
|
||||
// 基层干部审核
|
||||
openAudit() {
|
||||
this.$emit('union-cadre')
|
||||
},
|
||||
openAdd() {
|
||||
this.dialogFormVisible = true
|
||||
this.$nextTick(() => {
|
||||
|
||||
@@ -3,89 +3,103 @@ layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-row type="flex" :gutter="20" style="height: calc(100vh - 84px)">
|
||||
<el-col :span="5">
|
||||
<el-card shadow="never" style="height: 100%" :body-style="{ height: '100%',display:'flex','flex-direction':'column' }">
|
||||
<el-input placeholder="输入关键字进行查找" v-model="filterText" clearable></el-input>
|
||||
<div style="flex: 1;overflow-y: auto">
|
||||
<el-tree
|
||||
:data="treeData"
|
||||
ref="treeRef"
|
||||
:expand-on-click-node="false"
|
||||
:props="{
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-row type="flex" :gutter="20" style="height: calc(100vh - 84px)">
|
||||
<el-col :span="5">
|
||||
<el-card shadow="never" style="height: 100%"
|
||||
:body-style="{ height: '100%',display:'flex','flex-direction':'column' }">
|
||||
<el-input placeholder="输入关键字进行查找" v-model="filterText" clearable></el-input>
|
||||
<div style="flex: 1;overflow-y: auto">
|
||||
<el-tree
|
||||
:data="treeData"
|
||||
ref="treeRef"
|
||||
:expand-on-click-node="false"
|
||||
:props="{
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
}"
|
||||
default-expand-all
|
||||
@node-click="treeNodeClick"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
>
|
||||
<template slot-scope="{ node, data }">
|
||||
default-expand-all
|
||||
@node-click="treeNodeClick"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
>
|
||||
<template slot-scope="{ node, data }">
|
||||
<span class="el-tree-node__label">
|
||||
<i class="el-icon-folder-opened" v-if="node.level===1"></i>
|
||||
<i class="el-icon-folder" v-else></i>
|
||||
{{node.label}}
|
||||
</span>
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="19">
|
||||
<el-card shadow="never">
|
||||
<el-tabs v-model="schoolUnionTabActive" type="card" v-if="currentTreeNode==null || currentTreeNode.level===1">
|
||||
<el-tab-pane name="branchUnionManage">
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="19">
|
||||
<el-card shadow="never">
|
||||
<el-tabs v-model="schoolUnionTabActive" type="card"
|
||||
v-if="currentTreeNode==null || currentTreeNode.level===1">
|
||||
<el-tab-pane name="branchUnionManage">
|
||||
<span slot="label">
|
||||
<i class="el-icon-school"></i>
|
||||
分工会信息
|
||||
</span>
|
||||
<sys-union-branch-union-manage @refresh="getTreeData()"></sys-union-branch-union-manage>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="schoolUnionInfo" v-if="$auth.hasPermission('sys.manager.union.schoolOfficer')">
|
||||
<sys-union-branch-union-manage @refresh="getTreeData()"
|
||||
@union-cadre="unionCadreInit"></sys-union-branch-union-manage>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="schoolUnionInfo"
|
||||
v-if="$auth.hasPermission('sys.manager.union.schoolOfficer')">
|
||||
<span slot="label">
|
||||
<i class="el-icon-office-building"></i>
|
||||
校工会信息
|
||||
</span>
|
||||
<sys-union-school-union-user-manage></sys-union-school-union-user-manage>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<sys-union-school-union-user-manage></sys-union-school-union-user-manage>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-tabs v-model="branchUnionTabActive" @tab-click="branchTabChange" type="card" v-if="currentTreeNode && currentTreeNode.level===2">
|
||||
<el-tab-pane name="branchUnionUserManage">
|
||||
<el-tabs v-model="branchUnionTabActive" @tab-click="branchTabChange" type="card"
|
||||
v-if="currentTreeNode && currentTreeNode.level===2">
|
||||
<el-tab-pane name="branchUnionUserManage">
|
||||
<span slot="label">
|
||||
<i class="el-icon-school"></i>
|
||||
分工会干部
|
||||
</span>
|
||||
<sys-union-branch-union-user-manage
|
||||
ref="branchUnionUserManageRef"
|
||||
:union_id="currentTreeData.id"
|
||||
></sys-union-branch-union-user-manage>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="branchUnionPartUnitManage">
|
||||
<sys-union-branch-union-user-manage
|
||||
ref="branchUnionUserManageRef"
|
||||
:union_id="currentTreeData.id"
|
||||
></sys-union-branch-union-user-manage>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="branchUnionPartUnitManage">
|
||||
<span slot="label">
|
||||
<i class="el-icon-school"></i>
|
||||
组成单位
|
||||
</span>
|
||||
<sys-union-branch-union-part-unit-manage
|
||||
ref="branchUnionPartUnitManageRef"
|
||||
:union_id="currentTreeData.id"
|
||||
></sys-union-branch-union-part-unit-manage>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="branchUnionGroup">
|
||||
<sys-union-branch-union-part-unit-manage
|
||||
ref="branchUnionPartUnitManageRef"
|
||||
:union_id="currentTreeData.id"
|
||||
></sys-union-branch-union-part-unit-manage>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="branchUnionGroup">
|
||||
<span slot="label">
|
||||
<i class="el-icon-school"></i>
|
||||
工会小组
|
||||
</span>
|
||||
<sys-union-branch-union-group-manage
|
||||
ref="branchUnionGroupRef"
|
||||
:union_id="currentTreeData.id"
|
||||
></sys-union-branch-union-group-manage>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<sys-union-branch-union-group-manage
|
||||
ref="branchUnionGroupRef"
|
||||
:union_id="currentTreeData.id"
|
||||
></sys-union-branch-union-group-manage>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<sys-union-branch-union-cadre-audit ref="unionCadreAuditRef">
|
||||
</sys-union-branch-union-cadre-audit>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -94,6 +108,7 @@ layout("/layouts/platform.html"){
|
||||
<!--#include("branchUnionUserManage.js"){}#-->
|
||||
<!--#include("branchUnionPartUnitManage.js"){}#-->
|
||||
<!--#include("branchUnionGroupManage.js"){}#-->
|
||||
<!--#include("branchUnionCadreAudit.js"){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
@@ -102,7 +117,8 @@ layout("/layouts/platform.html"){
|
||||
"sys-union-school-union-user-manage": schoolUnionUserManage,
|
||||
"sys-union-branch-union-user-manage": branchUnionUserManage,
|
||||
"sys-union-branch-union-part-unit-manage": branchUnionPartUnitManage,
|
||||
"sys-union-branch-union-group-manage": branchUnionGroupManage
|
||||
"sys-union-branch-union-group-manage": branchUnionGroupManage,
|
||||
"sys-union-branch-union-cadre-audit": branchUnionCadreAudit,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -144,6 +160,12 @@ layout("/layouts/platform.html"){
|
||||
this.$nextTick(() => {
|
||||
this.$refs[val.name + "Ref"].doSearch()
|
||||
})
|
||||
},
|
||||
// 基层干部审核初始化
|
||||
unionCadreInit() {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.unionCadreAuditRef.pageData()
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -0,0 +1,854 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" class="platform" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年  度</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
@change="yearChange"
|
||||
v-model="pageForm.year"
|
||||
type="year"
|
||||
value-format="yyyy" style="width: 100%"
|
||||
placeholder="选择年">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动名称</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.activityId" placeholder="请选择活动名称" filterable clearable
|
||||
style="width: 100%" @change="doSearchS">
|
||||
<el-option
|
||||
v-for="item in activityList"
|
||||
:key="item.id"
|
||||
: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">
|
||||
<el-select v-model="pageForm.eventId" placeholder="请选择活动项目" filterable clearable
|
||||
style="width: 100%" @change="doSearchS">
|
||||
<el-option
|
||||
v-for="item in events"
|
||||
:key="item.eventId"
|
||||
:label="item.allName"
|
||||
:value="item.eventId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="项目列表">
|
||||
<!--<el-radio-group v-model="pageForm.isMenWomen" @change="doSearch"
|
||||
style="margin-left: 10px">
|
||||
<el-radio-button :label="1">全部</el-radio-button>
|
||||
<el-radio-button :label="2">男子</el-radio-button>
|
||||
<el-radio-button :label="3">女子</el-radio-button>
|
||||
<el-radio-button :label="4">团体</el-radio-button>
|
||||
</el-radio-group>-->
|
||||
<!-- <el-checkbox-group @change="doSearch" v-model="pageForm.isMenWomen">
|
||||
<el-checkbox-button :key="2" :label="2">男子</el-checkbox-button>
|
||||
<el-checkbox-button :key="3" :label="3">女子</el-checkbox-button>
|
||||
</el-checkbox-group>-->
|
||||
|
||||
<!-- <el-checkbox-group @change="doSearch" v-model="pageForm.isMenWomen">
|
||||
<el-checkbox-button :key="4" :label="4">单项</el-checkbox-button>
|
||||
<el-checkbox-button :key="5" :label="5">团体</el-checkbox-button>
|
||||
</el-checkbox-group>
|
||||
|
||||
<el-select v-model="pageForm.groupName" placeholder="请选择组别"
|
||||
filterable clearable
|
||||
style="width: 100%;margin-bottom: 5px;margin-left: 10px" @change="doSearch">
|
||||
<el-option
|
||||
v-for="item in groupList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name">
|
||||
</el-option>
|
||||
</el-select>-->
|
||||
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px" row-key="id"
|
||||
@sort-change="pageOrder" v-loading="tableLoading" :size="tableSize" class="vi-table">
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
<el-table-column prop="allName" align="center" header-align="center"
|
||||
label="项目名称"></el-table-column>
|
||||
|
||||
<el-table-column prop="rs" align="center" header-align="center"
|
||||
label="获奖数量"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button size="mini" :loading="row.loading">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'input',row}">
|
||||
录入成绩
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'view',row}">
|
||||
查  看
|
||||
</el-dropdown-item>
|
||||
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit_func>
|
||||
<el-button type="primary" @click="openAdd" v-if="awardsMode==1">临时获奖人员添加</el-button>
|
||||
<el-button type="primary" @click="doAdd">确 定</el-button>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<template>
|
||||
<table-tool label="录入成绩"></table-tool>
|
||||
<el-form :model="formData" ref="addForm" label-width="120px"
|
||||
label-suffix=":">
|
||||
<el-row :gutter="40">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="name" label="活动名称">
|
||||
<el-input maxlength="200" disabled v-model="name"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="allName" label="活动项目">
|
||||
<el-input maxlength="200" disabled v-model="allName"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<div style="display: flex;margin: 20px 0">
|
||||
<el-divider content-position="left">获奖名次列表</el-divider>
|
||||
<div style="padding-left: 10px;padding-top: 10px;">
|
||||
<el-tooltip class="item" effect="dark" content="点击添加活动人员" placement="top">
|
||||
<el-button style="float: right;margin-bottom: 10px" type="primary" icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="openAddUser">
|
||||
添加
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<el-table style="margin-bottom: 20px" border stripe :data="userData" size="small"
|
||||
v-loading="userTabLoading">
|
||||
<el-table-column
|
||||
type="index" label="序号" header-align="center" align="center" width="100">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center"
|
||||
:label="awardsMode==1?'姓名':'分工会'"
|
||||
prop="id">
|
||||
<template scope="{$index,row}">
|
||||
<el-select v-model="row.userId" @change="(val)=>{userDetailsChange(val,row)}"
|
||||
placeholder="请输入姓名" filterable clearable
|
||||
style="width: 100%" size="small" v-if="awardsMode==1">
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:disabled="item.disabled"
|
||||
:key="item.id"
|
||||
:label="item.username+'('+item.loginname+')'+item.sex"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select v-model="row.unionId" @change="(val)=>{unionDetailsChange(val,row)}"
|
||||
placeholder="请输入分工会" filterable clearable
|
||||
style="width: 100%" size="small" v-if="awardsMode==2">
|
||||
<el-option
|
||||
v-for="item in unionList"
|
||||
:disabled="item.disabled"
|
||||
:key="item.id"
|
||||
:label="item.unionname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="名次" prop="ranking">
|
||||
<template scope="{$index,row}">
|
||||
<el-select v-model="row.ranking" @change="rankingChange(row)"
|
||||
placeholder="请输入名次" filterable clearable
|
||||
style="width: 100%" size="small">
|
||||
<el-option
|
||||
v-for="item in rankingList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="积分" prop="integral">
|
||||
<template scope="{row}">
|
||||
<el-input-number v-model="row.integral"
|
||||
type="text"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="人数" prop="numberOfPeople"
|
||||
v-if="awardsMode==2">
|
||||
<template scope="{row}">
|
||||
<el-input-number v-model="row.numberOfPeople"
|
||||
type="text"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="分工会" prop="unionname"
|
||||
v-if="awardsMode==1">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.unionname" disabled placeholder="分工会"
|
||||
type="text"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center" label="操作"
|
||||
width="150px">
|
||||
<template scope="{$index,row}">
|
||||
<el-button type="danger" icon="el-icon-delete" circle
|
||||
@click="delUser($index,row)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
</el-form>
|
||||
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<el-form :model="formData" ref="addForm" label-width="120px" label-suffix=":">
|
||||
<el-row :gutter="40">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="name" label="活动名称">
|
||||
<el-input maxlength="200" disabled v-model="name"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="allName" label="活动项目">
|
||||
<el-input maxlength="200" disabled v-model="allName"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div style="display: flex;margin: 20px 0">
|
||||
<el-divider content-position="left">获奖名次列表</el-divider>
|
||||
</div>
|
||||
<el-table style="margin-bottom: 20px" border stripe :data="viewData" size="small"
|
||||
v-loading="userTabLoading">
|
||||
<el-table-column
|
||||
type="index" label="序号" header-align="center" align="center" width="100">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center"
|
||||
:label="awardsMode==1?'姓名':'分工会'"
|
||||
prop="id">
|
||||
<template scope="{$index,row}">
|
||||
<el-select v-model="row.userId" @change="(val)=>{userDetailsChange(val,row)}"
|
||||
placeholder="请输入姓名" filterable clearable disabled
|
||||
style="width: 100%" size="small" v-if="awardsMode==1">
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.id"
|
||||
:label="item.username+'('+item.loginname+')'+item.sex"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select v-model="row.unionId" @change="(val)=>{unionDetailsChange(val,row)}"
|
||||
placeholder="请输入分工会" filterable clearable disabled
|
||||
style="width: 100%" size="small" v-if="awardsMode==2">
|
||||
<el-option
|
||||
v-for="item in unionList"
|
||||
:key="item.id"
|
||||
:label="item.unionname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="名次" prop="ranking">
|
||||
<template scope="{$index,row}">
|
||||
<el-select v-model="row.ranking" @change="rankingChange(row)"
|
||||
placeholder="请输入名次" filterable clearable disabled
|
||||
style="width: 100%" size="small">
|
||||
<el-option
|
||||
v-for="item in rankingList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="积分" prop="integral">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.integral" disabled type="text"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="人数" prop="numberOfPeople"
|
||||
v-if="awardsMode==2">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.numberOfPeople" disabled type="text"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="分工会" prop="unionname"
|
||||
v-if="awardsMode==1">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.unionname" disabled placeholder="分工会"
|
||||
type="text"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
|
||||
<el-dialog
|
||||
title="添加人员"
|
||||
:visible.sync="dialogVisible"
|
||||
width="40%"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-width="100px">
|
||||
<!-- <el-form-item prop="loginname" label="工  号">
|
||||
<el-input maxlength="50" placeholder="请填写工号" v-model="formData.loginname"
|
||||
type="text" @blur="userBlur"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="username" label="姓  名">
|
||||
<el-input maxlength="50" placeholder="请填写姓名" v-model="formData.username"
|
||||
type="text"></el-input>
|
||||
</el-form-item>-->
|
||||
<el-form-item prop="mobile" label="姓名或工号">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="formData.userid"
|
||||
filterable
|
||||
clearable
|
||||
remote
|
||||
reserve-keyword
|
||||
allow-create
|
||||
default-first-option
|
||||
placeholder="请输入姓名或工号查找"
|
||||
:remote-method="userRemoteMethod"
|
||||
@change="userChange2">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.username+'('+item.loginname+')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="loginname" label="工  号">
|
||||
<el-input maxlength="50" placeholder="请填写工号" v-model="formData.loginname"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="mobile" label="电  话">
|
||||
<el-input maxlength="50" placeholder="请填写电话" v-model="formData.mobile"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sex" label="性  别">
|
||||
<el-radio-group v-model="formData.sex">
|
||||
<el-radio :label="'男性'" border>男性</el-radio>
|
||||
<el-radio :label="'女性'" border>女性</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="unitId" label="所在单位">
|
||||
<el-select v-model="formData.unitId" placeholder="请选择所在单位" clearable @change="unitChange"
|
||||
filterable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="unionname" label="所属工会">
|
||||
<el-input disabled placeholder="所属工会" v-model="formData.unionname"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doAddUser">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
|
||||
userOptions: [],
|
||||
groupList: [
|
||||
{value: 1, name: "甲组"},
|
||||
{value: 2, name: "乙组"},
|
||||
{value: 3, name: "丙组"},
|
||||
{value: 4, name: "丁组"}
|
||||
],
|
||||
dialogVisible: false,
|
||||
viewData: [],
|
||||
userTabLoading: false,
|
||||
awardsMode: "",
|
||||
isMenWomen: "",
|
||||
allName: "",
|
||||
name: "",
|
||||
eventId: "",
|
||||
activityId: "",
|
||||
userData: [],
|
||||
userList: [],
|
||||
userList2: [],
|
||||
unionList: [],
|
||||
unionList2: [],
|
||||
activityList: [],
|
||||
events: [],
|
||||
unitOptions: [],
|
||||
rankingList: [
|
||||
{name: "第一名", id: 1},
|
||||
{name: "第二名", id: 2},
|
||||
{name: "第三名", id: 3},
|
||||
{name: "第四名", id: 4},
|
||||
{name: "第五名", id: 5},
|
||||
{name: "第六名", id: 6},
|
||||
{name: "第七名", id: 7},
|
||||
{name: "第八名", id: 8}],
|
||||
sexList: [{sex: "男", id: 1}, {sex: "女", id: 2}],
|
||||
pageForm: {
|
||||
isMenWomen: [],
|
||||
year: new Date().getFullYear() + "",
|
||||
},
|
||||
formRules: {
|
||||
unitId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
username: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
loginname: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
|
||||
dropdownCommand(command) {
|
||||
const {type, row} = command
|
||||
if (type === 'view') {
|
||||
this.openView(row)
|
||||
} else if (type === 'input') {
|
||||
this.openInput(row)
|
||||
}
|
||||
},
|
||||
async userRemoteMethod(query) {
|
||||
if (query) {
|
||||
const resp = await this.$axios.post("/open/common/userOptions", {query: query})
|
||||
this.userOptions = resp.data
|
||||
}
|
||||
},
|
||||
userChange2(userid) {
|
||||
const aa = this.userOptions.find(v => v.id === userid)
|
||||
|
||||
if (aa) {
|
||||
const unit = this.unitOptions.find(v => v.id === aa.unitId)
|
||||
this.$set(this.formData, "username", aa.username)
|
||||
this.$set(this.formData, "loginname", aa.loginname)
|
||||
this.$set(this.formData, "mobile", aa.mobile)
|
||||
this.$set(this.formData, "unitId", aa.unitId)
|
||||
this.$set(this.formData, "unionId", unit.unionId)
|
||||
this.$set(this.formData, "unionname", unit.unionName)
|
||||
this.$set(this.formData, "sex", aa.sex)
|
||||
} else {
|
||||
this.$set(this.formData, "username", userid)
|
||||
}
|
||||
|
||||
},
|
||||
async unitChange() {
|
||||
const unit = this.unitOptions.find(v => v.id === this.formData.unitId)
|
||||
this.$set(this.formData, "unionId", unit.id)
|
||||
this.$set(this.formData, "unionname", unit.unionName)
|
||||
this.$set(this.formData, "unitname", unit.name)
|
||||
},
|
||||
async openAdd() {
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
this.$set(this.formData, "activityId", this.activityId)
|
||||
this.$set(this.formData, "eventId", this.eventId)
|
||||
this.$set(this.formData, "awardsMode", this.awardsMode)
|
||||
this.$set(this.formData, "identity", ['1'])
|
||||
this.$set(this.formData, "status", 2)
|
||||
this.$set(this.formData, "sex", "男性")
|
||||
this.dialogVisible = true
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
|
||||
},
|
||||
async doAddUser() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
if (this.userList.some(v => v.id === this.formData.userid)) {
|
||||
this.notifyWarning("您添加的运动员已经是远动员!")
|
||||
return
|
||||
}
|
||||
await this.$axios.post(loc() + "/doAdd", {
|
||||
activityResults: JSON.stringify(this.userData),
|
||||
activityId: this.activityId,
|
||||
eventId: this.eventId
|
||||
})
|
||||
const pageForm = clone(this.formData)
|
||||
pageForm.identity = JSON.stringify(this.formData.identity)
|
||||
const resp = await this.$axios.post(loc() + "/doAddUser", pageForm)
|
||||
if (resp.code === 0) {
|
||||
await this.userChange()
|
||||
this.userDetailsChange()
|
||||
this.dialogVisible = false
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async yearChange() {
|
||||
this.activityList = []
|
||||
this.events = []
|
||||
this.$set(this.pageForm, "activityId", "")
|
||||
this.$set(this.pageForm, "eventId", "")
|
||||
const {data} = await this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year})
|
||||
this.activityList = data
|
||||
if (data.length > 0) {
|
||||
this.pageForm.activityId = this.activityList[0].id
|
||||
}
|
||||
await this.doSearchS()
|
||||
},
|
||||
async changeActivit() {
|
||||
const resp = await this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
|
||||
this.events = resp.data
|
||||
},
|
||||
async doAdd() {
|
||||
|
||||
|
||||
this.userData.activityId = this.activityId
|
||||
this.userData.eventId = this.eventId
|
||||
const resp = await this.$axios.post(loc() + "/doAdd", {
|
||||
activityResults: JSON.stringify(this.userData),
|
||||
activityId: this.activityId,
|
||||
eventId: this.eventId
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
rankingChange() {
|
||||
for (let ranking = 1; ranking <= 8; ranking++) {
|
||||
let size = 0
|
||||
let indexArray = [];
|
||||
this.userData.forEach((v, index) => {
|
||||
if (ranking == v.ranking) {
|
||||
size++
|
||||
indexArray.push(index)
|
||||
}
|
||||
})
|
||||
if (size == 1) {
|
||||
/*
|
||||
if (this.awardsMode == 2) {
|
||||
this.userData[indexArray[0]].integral = (this.calScore(ranking) / 2).toFixed(2);
|
||||
console.log(this.calScore(ranking),2)
|
||||
} else {
|
||||
this.userData[indexArray[0]].integral = this.calScore(ranking).toFixed(2);
|
||||
console.log(this.calScore(ranking),1)
|
||||
}*/
|
||||
|
||||
this.userData[indexArray[0]].integral = this.calScore(ranking).toFixed(2);
|
||||
} else {
|
||||
var scoreArray = 0;
|
||||
for (var i = 0; i < size; i++) {
|
||||
scoreArray += this.calScore(ranking * 1 + i * 1);
|
||||
}
|
||||
/* if (this.awardsMode == 2) {
|
||||
scoreArray = scoreArray / size / 2;
|
||||
console.log(scoreArray, 2)
|
||||
} else {
|
||||
scoreArray = scoreArray / size;
|
||||
console.log(scoreArray, 1)
|
||||
}*/
|
||||
scoreArray = scoreArray / size;
|
||||
indexArray.forEach(v => {
|
||||
this.userData[v].integral = scoreArray.toFixed(2);
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
calScore(ranking) {
|
||||
let score;
|
||||
if (ranking < 5) {// 1 2 3 4
|
||||
if (ranking < 3) {//1 2
|
||||
if (ranking == 1) {
|
||||
score = this.awardsMode == 1 ? 9 : 9 * 2;
|
||||
} else if (ranking == 2) {
|
||||
score = this.awardsMode == 1 ? 7 : 7 * 2;
|
||||
}
|
||||
} else {//3 4
|
||||
if (ranking == 3) {
|
||||
score = this.awardsMode == 1 ? 6 : 6 * 2;
|
||||
} else if (ranking == 4) {
|
||||
score = this.awardsMode == 1 ? 5 : 5 * 2;
|
||||
}
|
||||
}
|
||||
} else {//5 6 7 8
|
||||
if (ranking < 7) {//5 6
|
||||
if (ranking == 5) {
|
||||
score = this.awardsMode == 1 ? 4 : 4 * 2;
|
||||
} else if (ranking == 6) {
|
||||
score = this.awardsMode == 1 ? 3 : 3 * 2;
|
||||
}
|
||||
} else {//7 8 9
|
||||
if (ranking == 7) {
|
||||
score = this.awardsMode == 1 ? 2 : 2 * 2;
|
||||
} else if (ranking == 8) {
|
||||
score = this.awardsMode == 1 ? 1 : 1 * 2;
|
||||
} else if (ranking == 9) {
|
||||
score = this.awardsMode == 1 ? 1 : 1 * 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
return score;
|
||||
},
|
||||
userDetailsChange(val, row) {
|
||||
const useridArr = this.userData.map(v => v.userId)
|
||||
this.userList.forEach(v => {
|
||||
v.disabled = useridArr.includes(v.id)
|
||||
if (row && row.userId === v.id) {
|
||||
const o = {
|
||||
unionId: v.unionId,
|
||||
activityId: this.activityId,
|
||||
eventId: this.eventId,
|
||||
isTeamPersonal: 1,
|
||||
unionname: v.unionname
|
||||
}
|
||||
Object.assign(row, o)
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
async unionDetailsChange(val, row) {
|
||||
let data = ''
|
||||
if (row) {
|
||||
const {unionId} = row
|
||||
data = await this.$axios.post(loc() + "/getUnionDetails", {
|
||||
activityId: this.activityId,
|
||||
eventId: this.eventId,
|
||||
unionId: unionId
|
||||
})
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
const unionIdArr = this.userData.map(v => v.unionId)
|
||||
this.unionList.forEach(v => {
|
||||
v.disabled = unionIdArr.includes(v.id)
|
||||
if (row && row.unionId === v.id) {
|
||||
const o = {
|
||||
numberOfPeople: data.data,
|
||||
activityId: this.activityId,
|
||||
eventId: this.eventId,
|
||||
isTeamPersonal: 2
|
||||
}
|
||||
Object.assign(row, o)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
delUser(index, row) {
|
||||
this.userData.splice(index, 1)
|
||||
this.userDetailsChange()
|
||||
this.unionDetailsChange()
|
||||
},
|
||||
async getUserList() {
|
||||
const {data} = await this.$axios.post(loc() + "/getUserList", {
|
||||
activityId: this.activityId,
|
||||
eventId: this.eventId,
|
||||
isMenWomen: this.isMenWomen
|
||||
})
|
||||
return data;
|
||||
|
||||
},
|
||||
async getUnionList(row) {
|
||||
const {activityId, eventId} = row
|
||||
const {data} = await this.$axios.post(loc() + "/getUnionList", {
|
||||
activityId: activityId,
|
||||
eventId: eventId
|
||||
})
|
||||
return data;
|
||||
},
|
||||
openAddUser() {
|
||||
this.userData.push({})
|
||||
},
|
||||
async userChange() {
|
||||
this.userList = await this.getUserList()
|
||||
this.userList2 = this.userList
|
||||
this.userData = []
|
||||
const {data} = await this.$axios.post(loc() + "/getUserData", {
|
||||
activityId: this.activityId,
|
||||
eventId: this.eventId,
|
||||
isMenWomen: this.isMenWomen
|
||||
})
|
||||
if (data.length > 0) {
|
||||
this.userData = data
|
||||
this.viewData = data
|
||||
}
|
||||
this.$forceUpdate();
|
||||
|
||||
},
|
||||
|
||||
async getUnionData(row) {
|
||||
const {activityId, eventId} = row
|
||||
const {data} = await this.$axios.post(loc() + "/getUnionData", {
|
||||
activityId: activityId,
|
||||
eventId: eventId
|
||||
})
|
||||
return data
|
||||
},
|
||||
|
||||
|
||||
async openView(row) {
|
||||
this.isMenWomen = ""
|
||||
this.userData = []
|
||||
this.viewData = []
|
||||
this.userList = []
|
||||
this.awardsMode = row.awardsMode
|
||||
this.name = row.name
|
||||
this.allName = row.allName
|
||||
this.activityId = row.activityId
|
||||
this.eventId = row.eventId
|
||||
if (row.awardsMode == 2) {
|
||||
this.unionList = await this.getUnionList(row)
|
||||
this.viewData = await this.getUnionData(row)
|
||||
await this.unionDetailsChange(row)
|
||||
} else {
|
||||
await this.userChange()
|
||||
this.userDetailsChange()
|
||||
}
|
||||
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async openInput(row) {
|
||||
this.isMenWomen = ""
|
||||
this.userData = []
|
||||
this.userList = []
|
||||
this.awardsMode = row.awardsMode
|
||||
this.name = row.name
|
||||
this.allName = row.allName
|
||||
this.activityId = row.activityId
|
||||
this.eventId = row.eventId
|
||||
this.isMenWomen = row.isMenWomen
|
||||
if (row.awardsMode == 2) {
|
||||
this.unionList = await this.getUnionList(row)
|
||||
this.userData = await this.getUnionData(row)
|
||||
await this.unionDetailsChange()
|
||||
} else {
|
||||
await this.userChange()
|
||||
this.userDetailsChange()
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
|
||||
|
||||
},
|
||||
async getActivitys() {
|
||||
const {data} = await this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year})
|
||||
return data;
|
||||
|
||||
},
|
||||
async doSearchS() {
|
||||
this.doSearch()
|
||||
await this.changeActivit()
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
pageData() {
|
||||
this.tabLoading = true
|
||||
const pageForm = clone(this.pageForm)
|
||||
pageForm.isMenWomen = JSON.stringify(pageForm.isMenWomen)
|
||||
this.$axios.post("/platform/activity/results/input/pageData", pageForm).then(resp => {
|
||||
this.tabLoading = false
|
||||
if (resp.code == 0) {
|
||||
this.tableData = resp.data.list;
|
||||
this.pageForm.totalCount = resp.data.totalCount;
|
||||
} else {
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
async created() {
|
||||
this.yearChange()
|
||||
// this.pageData()
|
||||
this.activityList = await this.getActivitys()
|
||||
if (this.activityList.length) {
|
||||
this.pageForm.activityId = this.activityList[0].id
|
||||
}
|
||||
await this.changeActivit()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,433 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
#app {
|
||||
/*max-height: calc(100vh - 50px);
|
||||
overflow: hidden;*/
|
||||
}
|
||||
|
||||
.query-row {
|
||||
height: 70px;
|
||||
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;
|
||||
}
|
||||
|
||||
/* .el-select, .el-input {
|
||||
width: 80%;
|
||||
}*/
|
||||
|
||||
.el-date-editor.el-input, .el-date-editor.el-input__inner {
|
||||
width: 175px !important;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava"
|
||||
style="width: 100%;min-height: 100%;background-color: #f0f2f5;padding: 20px;box-sizing: border-box;">
|
||||
<template>
|
||||
<div style="max-height: 250px">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
@change="getActivitys"
|
||||
placeholder="选择年"
|
||||
type="year"
|
||||
v-model="pageForm.year" value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="活动名称">
|
||||
<el-select :clearable="false" @change="activityChange" filterable
|
||||
placeholder="请选择活动名称" style="width: 100%" v-model="pageForm.activityId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in activityList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
<el-select @change="unionChange(pageForm.unionId)" clearable filterable
|
||||
placeholder="请选择工会"
|
||||
style="width: 100%" v-model="pageForm.name">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
v-for="item in unionList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
</search>
|
||||
|
||||
|
||||
<!-- <div class="pull-right offscreen-right">
|
||||
<el-button @click="getYear8(1)" icon="el-icon-search" type="primary">年度男子团体总分
|
||||
</el-button>
|
||||
<el-button @click="getYear8(2)" icon="el-icon-search" type="primary">年度女子团体总分
|
||||
</el-button>
|
||||
<el-button @click="annualResults" icon="el-icon-search" type="primary">年度团体总分</el-button>
|
||||
<el-button @click="doExcelCj" class="mr10" icon="el-icon-printer" type="primary">导出成绩excel
|
||||
</el-button>
|
||||
</div>-->
|
||||
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" style="margin-top: 10px">
|
||||
<el-row type="flex" align="middle" class="query-row">
|
||||
<el-col class="query-row-title">按活动统计:</el-col>
|
||||
<el-col class="query-row-content" v-if="isSearchOptions">
|
||||
<el-button
|
||||
style="margin-left: 10px"
|
||||
size="medium"
|
||||
v-for="item in searchOptions"
|
||||
:key="item.id"
|
||||
:type="item.name" @click="searchClick(item.id)">{{item.name}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col class="query-row-content" v-else>
|
||||
<el-button style="margin-left: 10px"
|
||||
size="medium" @click="gradesClick(9)">成绩统计
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
||||
|
||||
<div class="pull-right offscreen-right" style="margin-left: auto">
|
||||
<!--
|
||||
<el-button type="primary" icon="el-icon-printer" @click="doExport8ByActivity"
|
||||
v-if="[11,12].includes(isSearchOptions)&&pageForm.activityId">导出
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-printer" @click="doGetYear8" v-else-if="isYear8">导出
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-printer" @click="print" v-else>打 印</el-button>-->
|
||||
<el-button @click="doExportByActivityStatisticsType" icon="el-icon-printer" type="primary">
|
||||
导出
|
||||
</el-button>
|
||||
|
||||
</div>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
<div id=print ref="print">
|
||||
<el-card shadow="never" class="mt10"
|
||||
v-show="[1,2,3,4,5,9,10].includes(isSearchOptions)&&isSearchOptions">
|
||||
<table-tool v-if="isSearchOptions==1" label="男子单项成绩"></table-tool>
|
||||
<table-tool v-if="isSearchOptions==2" label="女子单项成绩"></table-tool>
|
||||
<table-tool v-if="isSearchOptions==3" label="男子团体成绩"></table-tool>
|
||||
<table-tool v-if="isSearchOptions==4" label="女子团体成绩"></table-tool>
|
||||
<table-tool v-if="isSearchOptions==5" label="男女混合类成绩"></table-tool>
|
||||
<table-tool v-if="isSearchOptions==9&&isSearch" label="分工会男子项目积分"></table-tool>
|
||||
<table-tool v-if="isSearchOptions==9&&!isSearch" label="分工会项目成绩"></table-tool>
|
||||
<table-tool v-if="isSearchOptions==10" label="分工会女子项目积分"></table-tool>
|
||||
<is-male-female :form="pageForm" ref="female"></is-male-female>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10" v-show="[6,7,8].includes(isSearchOptions)&&isSearchOptions">
|
||||
<table-tool v-if="isSearchOptions==6" label="男子项目前八"></table-tool>
|
||||
<table-tool v-if="isSearchOptions==7" label="女子项目前八"></table-tool>
|
||||
<table-tool v-if="isSearchOptions==8" label="综合类前八"></table-tool>
|
||||
<el-row>
|
||||
<top-eight :form="pageForm" ref="doeight"></top-eight>
|
||||
</el-row>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10" v-show="[11,12].includes(isSearchOptions)&&isSearchOptions">
|
||||
<table-tool v-if="isSearchOptions==11" label="分工会男子总分前八"></table-tool>
|
||||
<table-tool v-if="isSearchOptions==12" label="分工会女子总分前八"></table-tool>
|
||||
<score-top-eight :form="pageForm" ref="doTopEight"></score-top-eight>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10" v-show="[99].includes(isSearchOptions)">
|
||||
<table-tool v-if="isSearchOptions==99" label="全年成绩"></table-tool>
|
||||
<el-table :data="annualResultsTableData" style="width: 100%;height: 100%" stripe border
|
||||
show-summary
|
||||
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
|
||||
v-loading="tableLoading" size="mini" fixed ref="annualResults"
|
||||
>
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
label="名次"
|
||||
width="80px" fixed></el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in annualTableColumns"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
|
||||
<script>
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
isMenWomen: "",
|
||||
isUnion: false,
|
||||
isYear8: false,
|
||||
annualTableColumns: [],
|
||||
annualResultsTableData: [],
|
||||
annualMaxHeight: 0,
|
||||
colspan: [],
|
||||
eventList: [],
|
||||
score: [],
|
||||
titleCol: 0,
|
||||
activityList: [],
|
||||
events: [],
|
||||
unionList: [],
|
||||
units: [],
|
||||
isSearch: true,
|
||||
searchOptions: [],
|
||||
Options: [
|
||||
/* {id: 1, name: "男子单项"},
|
||||
{id: 2, name: "女子单项"},
|
||||
{id: 3, name: "男子团体"},
|
||||
{id: 4, name: "女子团体"},
|
||||
{id: 5, name: "男女混合类"},*/
|
||||
{id: 9, name: "分工会男子项目积分"},
|
||||
{id: 10, name: "分工会女子项目积分"},
|
||||
{id: 6, name: "男子项目前八"},
|
||||
{id: 7, name: "女子项目前八"},
|
||||
{id: 8, name: "团体前八"},
|
||||
|
||||
{id: 11, name: "分工会男子总分前八"},
|
||||
{id: 12, name: "分工会女子总分前八"},
|
||||
|
||||
],
|
||||
isSearchOptions: 9,
|
||||
pageForm: {
|
||||
unionname: '',
|
||||
activityId: "",
|
||||
personTypes: [],
|
||||
year: new Date().getFullYear() + "",
|
||||
},
|
||||
activityStatisticsType: 0//统计类型说明:1 年度男子团体总分2.年度女子团体总分3.年度团体总分4.分工会男子项目积分5.分工会女子项目积分,依次后推
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'is-male-female': httpVueLoader('/components/module/activity/score/isMaleFemale.vue?v=' + new Date().getTime()),
|
||||
'top-eight': httpVueLoader('/components/module/activity/score/topEight.vue?v=' + new Date().getTime()),
|
||||
'score-top-eight': httpVueLoader('/components/module/activity/score/scoreTopEight.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
async doExportByActivityStatisticsType() {
|
||||
const {activityId, year} = this.pageForm
|
||||
const url = "/platform/activity/statistics/export"
|
||||
if (this.activityStatisticsType === 1 || this.activityStatisticsType === 2) {
|
||||
window.open(url + "/getYear8?year=" + year + "&isMenWomen=" + this.isMenWomen)
|
||||
} else if (this.activityStatisticsType === 3) {
|
||||
window.open(url + "/getAnnualResults?year=" + year)
|
||||
} else if (this.activityStatisticsType === 4 || this.activityStatisticsType === 5) {
|
||||
let sex = this.activityStatisticsType === 4 ? "男性" : "女性"
|
||||
window.open(url + "/isMaleFemale?activityId=" + activityId + "&sex=" + sex + "&awardsMode=4")
|
||||
} else if (this.activityStatisticsType === 6 || this.activityStatisticsType === 7 || this.activityStatisticsType === 8) {
|
||||
let sex = this.activityStatisticsType === 6 ? "男性" : "女性"
|
||||
let awardsMode = this.activityStatisticsType === 8 ? 2 : 1
|
||||
window.open(url + "/isTopEight?activityId=" + activityId + "&sex=" + sex + "&awardsMode=" + awardsMode)
|
||||
} else if (this.activityStatisticsType === 9 || this.activityStatisticsType === 10) {
|
||||
let sex = this.activityStatisticsType === 9 ? "男性" : "女性"
|
||||
window.open(url + "/isScoreTopEight?activityId=" + activityId + "&sex=" + sex)
|
||||
}
|
||||
},
|
||||
doExport8ByActivity() {
|
||||
window.open(loc() + "/doExport8ByActivity?activityId=" + this.pageForm.activityId + "&isMenWomen=" + (this.isSearchOptions === 11 ? 1 : 2))
|
||||
|
||||
},
|
||||
doExcelCj() {
|
||||
const {activityId, unionname} = this.pageForm
|
||||
let unionId = ''
|
||||
if (unionname) {
|
||||
const unionlist = clone(this.unionList)
|
||||
unionId = unionlist.find(v => v.unionname === unionname).id
|
||||
}
|
||||
window.open(loc() + "/doExcelCj?activityId=" + activityId + "&unionId=" + unionId)
|
||||
|
||||
},
|
||||
print() {
|
||||
let subOutputRankPrint = document.getElementById('print');
|
||||
let newContent = subOutputRankPrint.innerHTML;
|
||||
let oldContent = document.body.innerHTML;
|
||||
document.body.innerHTML = newContent;
|
||||
window.print();
|
||||
window.location.reload();
|
||||
document.body.innerHTML = oldContent;
|
||||
return false;
|
||||
|
||||
},
|
||||
activityChange() {
|
||||
const aa = this.activityList.find(v => v.id == this.pageForm.activityId)
|
||||
if (aa.applyType == 1) {
|
||||
this.isSearch = false
|
||||
this.searchOptions = [{id: 9, name: "分工会项目成绩"}]
|
||||
} else {
|
||||
this.searchOptions = this.Options
|
||||
}
|
||||
this.searchClick(9)
|
||||
},
|
||||
unionChange() {
|
||||
this.searchClick(9)
|
||||
},
|
||||
searchClick(id) {
|
||||
if (id === 9) {
|
||||
this.activityStatisticsType = 4
|
||||
} else if (id === 10) {
|
||||
this.activityStatisticsType = 5
|
||||
} else if (id === 6) {
|
||||
this.activityStatisticsType = 6
|
||||
} else if (id === 7) {
|
||||
this.activityStatisticsType = 7
|
||||
} else if (id === 8) {
|
||||
this.activityStatisticsType = 8
|
||||
} else if (id === 11) {
|
||||
this.activityStatisticsType = 9
|
||||
} else if (id === 12) {
|
||||
this.activityStatisticsType = 10
|
||||
}
|
||||
this.isSearchOptions = id
|
||||
if (id <= 5 || id == 9 || id == 10) {
|
||||
if (id == 1 || id == 2) {
|
||||
this.isUnion = false
|
||||
this.isYear8 = false
|
||||
this.pageForm.sex = id == 1 ? "男性" : "女性"
|
||||
this.pageForm.awardsMode = 1
|
||||
} else if (id == 3 || id == 4) {
|
||||
this.isUnion = false
|
||||
this.isUnionisYear8 = false
|
||||
this.pageForm.sex = id == 3 ? "男性" : "女性"
|
||||
this.pageForm.awardsMode = 2
|
||||
} else if (id == 9 || id == 10) {
|
||||
this.isUnion = true
|
||||
this.pageForm.sex = id == 9 ? "男性" : "女性"
|
||||
this.pageForm.awardsMode = 4
|
||||
} else {
|
||||
this.pageForm.awardsMode = 3
|
||||
}
|
||||
this.$refs.female.isMaleFemale()
|
||||
} else if (id == 6 || id == 7 || id == 8) {
|
||||
if (id == 6 || id == 7) {
|
||||
this.isUnion = false
|
||||
this.isYear8 = false
|
||||
this.pageForm.sex = id == 6 ? "男性" : "女性"
|
||||
this.pageForm.awardsMode = 1
|
||||
} else if (id == 8) {
|
||||
this.pageForm.awardsMode = 2
|
||||
}
|
||||
this.$refs.doeight.isTopEight()
|
||||
} else if (id == 11 || id == 12) {
|
||||
this.pageForm.sex = id == 11 ? "男性" : "女性"
|
||||
this.$refs.doTopEight.isScoreTopEight()
|
||||
}
|
||||
},
|
||||
async doGetYear8() {
|
||||
location.href = loc() + "/doGetYear8?year=" + this.pageForm.year + "&isMenWomen=" + this.isMenWomen
|
||||
},
|
||||
async getYear8(isMenWomen) {
|
||||
this.activityStatisticsType = isMenWomen
|
||||
this.isMenWomen = isMenWomen
|
||||
this.isUnion = false
|
||||
this.isYear8 = true
|
||||
this.$set(this.pageForm, "activityId", null)
|
||||
this.$set(this.pageForm, "unionname", null)
|
||||
this.annualTableColumns = []
|
||||
this.annualResultsTableData = []
|
||||
|
||||
this.isSearchOptions = 99
|
||||
const {data} = await this.$axios.post(loc() + "/getYear8", {
|
||||
year: this.pageForm.year,
|
||||
isMenWomen: isMenWomen
|
||||
})
|
||||
this.annualResultsTableData = data.score
|
||||
this.annualResultsTableData = this.annualResultsTableData.sort((a, b) => b['总分'] - a['总分'])
|
||||
|
||||
data.label.forEach(v => {
|
||||
this.annualTableColumns.push({label: v, prop: v})
|
||||
})
|
||||
},
|
||||
|
||||
async annualResults() {
|
||||
this.activityStatisticsType = 3
|
||||
this.isUnion = false
|
||||
this.isYear8 = false
|
||||
this.$set(this.pageForm, "activityId", null)
|
||||
this.$set(this.pageForm, "unionname", null)
|
||||
this.annualTableColumns = []
|
||||
this.annualResultsTableData = []
|
||||
|
||||
this.isSearchOptions = 99
|
||||
const {data} = await this.$axios.post(loc() + "/getAnnualResults", {
|
||||
year: this.pageForm.year
|
||||
})
|
||||
this.annualResultsTableData = data.score
|
||||
this.annualResultsTableData = this.annualResultsTableData.sort((a, b) => b['总分'] - a['总分'])
|
||||
|
||||
data.label.forEach(v => {
|
||||
this.annualTableColumns.push({label: v, prop: v})
|
||||
})
|
||||
},
|
||||
async getActivitys() {
|
||||
|
||||
const {data} = await this.$axios.post(loc() + "/getActivitys", {year: this.pageForm.year})
|
||||
this.pageForm = {
|
||||
activityId: "",
|
||||
year: this.pageForm.year
|
||||
}
|
||||
this.activityList = data
|
||||
|
||||
},
|
||||
async changeActivit() {
|
||||
const resp = await this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
|
||||
this.events = resp
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.searchOptions = this.Options
|
||||
this.unionList = await this.$businessTool.listUnion()
|
||||
await this.getActivitys()
|
||||
if (this.activityList.length) {
|
||||
this.pageForm.activityId = this.activityList[0].id
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.searchClick(9)
|
||||
}, 200)
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -46,6 +46,9 @@ layout("/layouts/platform.html"){
|
||||
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
|
||||
size="small"></enum-tag>
|
||||
</template>
|
||||
<template v-else-if="column.prop === 'proposalTypeId'" scope="{row}">
|
||||
{{row.proposalTypeId===1?'意见':'建议'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="400px">
|
||||
<template scope="{row}">
|
||||
@@ -104,6 +107,7 @@ layout("/layouts/platform.html"){
|
||||
{label: "提案名称", prop: "name", width: "200px"},
|
||||
{label: "提案人", prop: "createUserName"},
|
||||
{label: "提案类别", prop: "typeName"},
|
||||
{label: "提案类型", prop: "proposalTypeId"},
|
||||
{label: "届次", prop: "sessionName"},
|
||||
{label: "代表团", prop: "delegationName"},
|
||||
{label: "当前节点", prop: "taskName"},
|
||||
|
||||
+11
-1
@@ -97,8 +97,17 @@ layout("/layouts/platform.html"){
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="提案类型" prop="proposalTypeId">
|
||||
<el-select v-model="formData.proposalTypeId" style="width: 100%">
|
||||
<el-option label="意见" :value="1"></el-option>
|
||||
<el-option label="建议" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<!-- <el-form-item label="提案摘要" prop="excerpt">-->
|
||||
<!-- <span slot="label">-->
|
||||
<!-- 提案摘要-->
|
||||
@@ -206,7 +215,8 @@ layout("/layouts/platform.html"){
|
||||
measures: [{required: true, message: "请填写", trigger: ["blur", "change"]}],
|
||||
unitName: [{required: true, message: "请填写", trigger: ["blur", "change"]}],
|
||||
mobile: [{required: true, message: "请填写", trigger: ["blur", "change"]}],
|
||||
signature: [{required: false, message: "请扫描二维码进行签字", trigger: ["blur", "change"]}]
|
||||
signature: [{required: false, message: "请扫描二维码进行签字", trigger: ["blur", "change"]}],
|
||||
proposalTypeId: [{required: true, message: "请选择提案类型", trigger: ["blur", "change"]}]
|
||||
},
|
||||
proposalConfig: {},
|
||||
noticeDialogVisible: false,
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ layout("/layouts/platform.html"){
|
||||
<search-item label="姓名/工号">
|
||||
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
<search-item label="性别">
|
||||
<el-select v-model="pageForm.sex" placeholder="请选择性别" clearable style="width: 100%">
|
||||
<search-item label="请假类型">
|
||||
<el-select v-model="pageForm.sex" placeholder="请选择请假类型" clearable style="width: 100%">
|
||||
<el-option label="男" value="男"></el-option>
|
||||
<el-option label="女" value="女"></el-option>
|
||||
</el-select>
|
||||
|
||||
@@ -72,7 +72,7 @@ layout("/layouts/platform.html"){
|
||||
<el-radio-button :label="false">未选择</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="importCourierNumber">
|
||||
<el-button type="primary" size="small" icon="el-icon-upload2" style="margin-left: 10px" @click="openImportCourierNumber">
|
||||
导入快递单号
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="exportXlsx">
|
||||
@@ -118,6 +118,18 @@ layout("/layouts/platform.html"){
|
||||
<option-select ref="optionSelectRef" @refresh="optionSelectVisible=false;doSearch();"></option-select>
|
||||
</el-dialog>
|
||||
</guava>
|
||||
|
||||
<!--导入福利名单-->
|
||||
<excel-import
|
||||
ref="excelImportRef"
|
||||
url="/platform/welfare/selection/situation/importByExcel"
|
||||
template_url="/platform/welfare/selection/situation/downloadTemplate"
|
||||
:visible.sync="showImportDialog"
|
||||
title="导入快递单号"
|
||||
@import-success="showImportDialog=false;doSearch()"
|
||||
width="700px"
|
||||
:extra_params="{projectId:pageForm.projectId,welfareOptionId:pageForm.welfareOptionId}"
|
||||
></excel-import>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -134,7 +146,9 @@ layout("/layouts/platform.html"){
|
||||
pageForm: {
|
||||
searchName: "username",
|
||||
year: new Date().getFullYear().toString(),
|
||||
isSelect: null
|
||||
isSelect: null,
|
||||
welfareOptionId:'',
|
||||
projectId:''
|
||||
},
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
@@ -150,7 +164,8 @@ layout("/layouts/platform.html"){
|
||||
{ prop: "courierNumbers", label: "快递号", sortable: true },
|
||||
{ prop: "mobile", label: "联系电话", sortable: true }
|
||||
],
|
||||
optionSelectVisible: false
|
||||
optionSelectVisible: false,
|
||||
showImportDialog: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -165,8 +180,12 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
importCourierNumber(){
|
||||
|
||||
openImportCourierNumber(){
|
||||
this.importData = {
|
||||
isfg: 1,
|
||||
fileList: []
|
||||
}
|
||||
this.showImportDialog = true
|
||||
},
|
||||
// 获取福利列表
|
||||
getWelfareList() {
|
||||
@@ -180,7 +199,6 @@ layout("/layouts/platform.html"){
|
||||
this.doSearch()
|
||||
})
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
pageData() {
|
||||
this.tableLoading = true
|
||||
|
||||
Reference in New Issue
Block a user