..
This commit is contained in:
@@ -929,6 +929,11 @@ public class BpmService {
|
||||
*/
|
||||
public List<BpmTaskApprovalRecordVo> getNodeTasks(BpmProcessConstant process, String processInstanceBusinessId) {
|
||||
BpmProcessInstance bpmProcessInstance = dao.fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", processInstanceBusinessId));
|
||||
|
||||
if(ObjectUtil.isEmpty(bpmProcessInstance)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<BpmProcessTask> tasks = dao.query(BpmProcessTask.class, Cnd.where(BpmProcessTask::getProcessInstanceId, "=", bpmProcessInstance.getId()).and(BpmProcessTask::getTaskStatus, "!=", BpmProcessTaskStatusEnum.REVOKE.name()).and(BpmProcessTask::getTaskStatus, "!=", BpmProcessTaskStatusEnum.ACTIVE.name()).and(BpmProcessTask::getTaskStatus, "!=", BpmProcessTaskStatusEnum.TRANSFER.name()).asc(BpmProcessTask::getCreatedAt));
|
||||
|
||||
//流程定义
|
||||
|
||||
-89
@@ -1,89 +0,0 @@
|
||||
package com.budwk.app.sys.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
import com.budwk.app.sys.vo.SysBranchUnionUserAuthorizationPageVO;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.article.param.ArticleInfoPageParam;
|
||||
import com.budwk.app.zhgh.dayofficework.article.vo.ArticleInfoPageVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/branchUnionUser/authorization")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "分工会人员授权")
|
||||
public class SysBranchUnionUserAuthorizationController {
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("sys.branch.union.authorization")
|
||||
@ApiOperation("分页查询")
|
||||
public Result pageData(@Valid ArticleInfoPageParam pageForm, boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
inst.id processInstanceId,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
task.id processInstanceTaskId,
|
||||
task.taskStatus processInstanceTaskStatus,
|
||||
COUNT(nt.id) OVER (PARTITION BY task.id) > 0 AS nextTaskIsComplete\s
|
||||
FROM
|
||||
bpm_process_task task
|
||||
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
|
||||
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
|
||||
INNER JOIN sys_branch_union_user_permission info ON info.id = inst.processInstanceBusinessId
|
||||
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id AND nt.taskStatus = 'COMPLETE'
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and(new Static("JSON_CONTAINS( task.assignments, '\"%s\"' )".formatted(SecurityUtil.getUserLoginname())));
|
||||
}
|
||||
cnd.and("nd.nodeCode", "=", 20);
|
||||
if (approval) {
|
||||
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.COMPLETE);
|
||||
} else {
|
||||
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.ACTIVE);
|
||||
}
|
||||
|
||||
cnd.andEX("YEAR(info.submitTime)", "=", pageForm.getYear());
|
||||
cnd.and(Cnd.likeEX("info.title", pageForm.getTitle()));
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.createdAt");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination<SysBranchUnionUserAuthorizationPageVO> pageVO = sysUserService.listPageVO(pageForm, sql, SysBranchUnionUserAuthorizationPageVO.class);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
package com.budwk.app.sys.controller.branchUnionUserAuthorization;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
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.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.bpm.enums.BpmTaskApprovalTypeEnum;
|
||||
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.models.Sys_branch_union_user_permission;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
import com.budwk.app.sys.vo.SysBranchUnionUserAuthorizationPageVO;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
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.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/branchUnionUser/authorization/approval")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "分工会人员授权校工会审核")
|
||||
public class SysBranchUnionUserAuthorizationApprovalController {
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("sys.branch.union.authorization.approval")
|
||||
@Ok("beetl:/platform/sys/branchUnionUserAuthorization/approval/index.html")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("sys.branch.union.authorization.approval")
|
||||
@ApiOperation("分页查询")
|
||||
public Result pageData(@Valid PageForm pageForm, String unionId, boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.mobile as mobile,
|
||||
r.name as roleName,
|
||||
gh.name as unionName,
|
||||
inst.id processInstanceId,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
task.id processInstanceTaskId,
|
||||
task.taskStatus processInstanceTaskStatus,
|
||||
COUNT(nt.id) OVER (PARTITION BY task.id) > 0 AS nextTaskIsComplete\s
|
||||
FROM
|
||||
bpm_process_task task
|
||||
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
|
||||
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
|
||||
INNER JOIN sys_branch_union_user_permission info ON info.id = inst.processInstanceBusinessId
|
||||
LEFT JOIN sys_user u on u.id = info.userId
|
||||
LEFT JOIN sys_role r on r.id = info.roleId
|
||||
LEFT JOIN sys_union gh on gh.id = info.unionId
|
||||
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id AND nt.taskStatus = 'COMPLETE'
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and(new Static("JSON_CONTAINS( task.assignments, '\"%s\"' )".formatted(SecurityUtil.getUserLoginname())));
|
||||
}
|
||||
cnd.and("nd.nodeCode", "=", 20);
|
||||
if (approval) {
|
||||
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.COMPLETE);
|
||||
} else {
|
||||
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.ACTIVE);
|
||||
}
|
||||
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.where().andLike("u.username", pageForm.getSearchKeyword());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.orderBy("info.createdAt", "desc");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination<SysBranchUnionUserAuthorizationPageVO> pageVO = sysUserService.listPageVO(pageForm, sql, SysBranchUnionUserAuthorizationPageVO.class);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("sys.branch.union.authorization.approval")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("校工会审核")
|
||||
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
List<String> assignments = new ArrayList<>();
|
||||
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, assignments);
|
||||
|
||||
if (approvalParam.getBpmTaskApprovalTypeEnum().equals(BpmTaskApprovalTypeEnum.PASS)) {
|
||||
// 审核通过
|
||||
String businessId = approvalParam.getProcessInstanceBusinessId();
|
||||
Sys_branch_union_user_permission userPermission = dao.fetch(Sys_branch_union_user_permission.class, businessId);
|
||||
if (userPermission != null) {
|
||||
if (userPermission.getMode().equals("JOIN")) {
|
||||
// 加入角色
|
||||
Sys_user_role userRole = new Sys_user_role();
|
||||
userRole.setRoleId(userPermission.getRoleId());
|
||||
userRole.setUserId(userPermission.getUserId());
|
||||
userRole.setUnionId(userPermission.getUnionId());
|
||||
dao.insert(userRole);
|
||||
} else {
|
||||
// 移除角色
|
||||
dao.clear(Sys_user_role.class, Cnd.where(Sys_user_role::getUserId, "=", userPermission.getUserId()).and(Sys_user_role::getUnionId, "=", userPermission.getUnionId())
|
||||
.and(Sys_user_role::getRoleId, "=", userPermission.getRoleId()));
|
||||
}
|
||||
sysUserService.clearCache();
|
||||
}
|
||||
}
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("sys.branch.union.authorization.approval")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("校工会撤回")
|
||||
public Result revoke(@Valid String taskId) {
|
||||
bpmService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.budwk.app.sys.controller.branchUnionUserAuthorization;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/branchUnionUser/authorization/common")
|
||||
@Ok("json:full")
|
||||
public class SysBranchUnionUserAuthorizationCommonController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At
|
||||
@SaCheckPermission("sys.branch.union.authorization")
|
||||
public Result info(@Valid String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*,
|
||||
u.username userName,
|
||||
u.loginname loginName,
|
||||
u.mobile,
|
||||
gh.NAME unionName
|
||||
FROM
|
||||
sys_branch_union_user_permission t1
|
||||
LEFT JOIN sys_user u ON u.id = t1.userId
|
||||
LEFT JOIN sys_union gh ON gh.id = t1.unionId
|
||||
WHERE t1.id = @id
|
||||
""");
|
||||
sql.setParam("id", id);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
Object result = sql.getResult();
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
}
|
||||
+281
@@ -0,0 +1,281 @@
|
||||
package com.budwk.app.sys.controller.branchUnionUserAuthorization;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.BpmProcessConstant;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
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.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||
import com.budwk.app.bpm.models.BpmProcessInstance;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.models.Sys_branch_union_user_permission;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.sys.vo.SysBranchUnionUserAuthorizationPageVO;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
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 org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/branchUnionUser/authorization/apply")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "分工会人员授权")
|
||||
public class SysBranchUnionUserAuthorizationController {
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("sys.branch.union.authorization")
|
||||
@Ok("beetl:/platform/sys/branchUnionUserAuthorization/apply/index.html")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("分工会人员授权")
|
||||
@SaCheckPermission("sys.branch.union.authorization")
|
||||
public Result doApply(@Valid String userId, @Valid String roleCode, String reason) {
|
||||
Sys_role role = sysRoleService.fetch(Cnd.where("code", "=", roleCode));
|
||||
if (Lang.isEmpty(role)) {
|
||||
return Result.error("无法找到" + roleCode + "对应编码的角色");
|
||||
}
|
||||
|
||||
int count = dao.count(Sys_user_role.class, Cnd.where(Sys_user_role::getUserId, "=", userId).and(Sys_user_role::getRoleId, "=", role.getId()));
|
||||
if (count > 0) {
|
||||
return Result.error("用户已授权");
|
||||
}
|
||||
|
||||
Sys_branch_union_user_permission permission = dao.fetch(Sys_branch_union_user_permission.class, Cnd.where(Sys_branch_union_user_permission::getUserId, "=", userId).and(Sys_branch_union_user_permission::getRoleId, "=", role.getId()));
|
||||
if (permission != null) {
|
||||
// 查询流程实例信息
|
||||
BpmProcessInstance instance = dao.fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", permission.getId()));
|
||||
if (instance.getProcessInstanceNodeCode() == 20) {
|
||||
return Result.error("不能重复申请");
|
||||
}
|
||||
// 其它的情况就是校工会拒绝了 那么可以再申请一条
|
||||
}
|
||||
|
||||
// 插入数据
|
||||
Sys_branch_union_user_permission newPermission = new Sys_branch_union_user_permission();
|
||||
newPermission.setUserId(userId);
|
||||
newPermission.setRoleId(role.getId());
|
||||
newPermission.setUnionId(SecurityUtil.getUnionId());
|
||||
newPermission.setMode("JOIN");
|
||||
newPermission.setReason(reason);
|
||||
dao.insert(newPermission);
|
||||
|
||||
List<String> assignments = new ArrayList<>();
|
||||
assignments.add(SecurityUtil.getUserId());
|
||||
|
||||
// 启动流程实例
|
||||
bpmService.startSubmitProcessInstance(BpmProcessConstant.BRANCH_UNION_WEIYUAN_AUTHORIZATION.name(), "分工会人员授权", newPermission.getId(), assignments, null);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("sys.manager.union")
|
||||
@ApiOperation("分工会人员授权分页数据")
|
||||
public Result branchUnionUserPageData(PageForm pageForm) {
|
||||
List<Sys_dict> branchUnionRoles = sysDictService.getSubListByCode("BRANCH_UNION_ROLES");
|
||||
if (Lang.isEmpty(branchUnionRoles)) {
|
||||
return Result.success();
|
||||
}
|
||||
List<String> branchUnionRoleCodes = branchUnionRoles.stream().map(Sys_dict::getCode).toList();
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.userId,
|
||||
t1.roleId,
|
||||
t1.unionId,
|
||||
t2.username,
|
||||
t2.loginname,
|
||||
t2.mobile,
|
||||
t3.`code` AS roleCode,
|
||||
t3.`name` AS roleName
|
||||
FROM
|
||||
sys_user_role t1
|
||||
LEFT JOIN sys_user t2 ON t2.id = t1.userId
|
||||
LEFT JOIN sys_role t3 ON t3.id = t1.roleId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.where("t3.`code`", "in", branchUnionRoleCodes);
|
||||
cnd.and("t1.unionId", "=", SecurityUtil.getUnionId());
|
||||
if (StrUtil.isAllNotBlank(pageForm.getSearchName(), pageForm.getSearchKeyword())) {
|
||||
switch (pageForm.getSearchName()) {
|
||||
case "loginname" -> cnd.where().andLike("t2.loginname", pageForm.getSearchKeyword());
|
||||
case "username" -> cnd.where().andLike("t2.username", pageForm.getSearchKeyword());
|
||||
case "roleName" -> cnd.where().andLike("t3.`name`", pageForm.getSearchKeyword());
|
||||
}
|
||||
}
|
||||
cnd.and(new Static("1=1 order by field(t3.code," + branchUnionRoleCodes.stream().map(code -> "'" + code + "'").collect(Collectors.joining(",")) + ")"));
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = sysUserService.listMap(sql);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("按关键字查询分工会下的人员")
|
||||
@Ok("json:{ignoreNull:true}")
|
||||
@SaCheckPermission("sys.manager.union")
|
||||
public Result listUserSelect(@Valid String keyWord) {
|
||||
Sql sql = Sqls.create("select id,loginname,username,unitname from vw_user $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and(View_user::getUnionId, "=", SecurityUtil.getUnionId());
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike(View_user::getLoginname, keyWord, true);
|
||||
seg.orLike(View_user::getUsername, keyWord, true);
|
||||
cnd.and(seg);
|
||||
cnd.limit(1, 10);
|
||||
sql.setCondition(cnd);
|
||||
sql.setCallback(Sqls.callback.entities());
|
||||
sql.setEntity(dao.getEntity(View_user.class));
|
||||
dao.execute(sql);
|
||||
List<View_user> list = sql.getList(View_user.class);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("sys.branch.union.authorization")
|
||||
@ApiOperation("分页查询")
|
||||
public Result pageData(@Valid PageForm pageForm, String mode) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.mobile as mobile,
|
||||
r.name as roleName,
|
||||
inst.id processInstanceId,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeCode,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
(
|
||||
SELECT
|
||||
count(1) > 0
|
||||
FROM
|
||||
bpm_process_task
|
||||
WHERE
|
||||
prevTaskId = (SELECT id FROM bpm_process_task WHERE processInstanceId = inst.id AND processTaskNodeCode IN (10, 30) ORDER BY createdAt DESC LIMIT 1)
|
||||
AND taskStatus = 'COMPELTE') AS nextTaskIsComplete
|
||||
FROM
|
||||
sys_branch_union_user_permission info
|
||||
LEFT JOIN sys_user u on u.id = info.userId
|
||||
LEFT JOIN sys_role r on r.id = info.roleId
|
||||
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = info.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("inst.processInstanceInitiatorLoginName", "=", SecurityUtil.getUserLoginname());
|
||||
}
|
||||
if(StrUtil.isNotBlank(pageForm.getSearchKeyword())){
|
||||
cnd.where().andLike("u.username",pageForm.getSearchKeyword());
|
||||
}
|
||||
cnd.andEX("info.mode", "=", mode);
|
||||
sql.setCondition(cnd);
|
||||
Pagination<SysBranchUnionUserAuthorizationPageVO> pageVO = sysUserService.listPageVO(pageForm, sql, SysBranchUnionUserAuthorizationPageVO.class);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("sys.branch.union.authorization")
|
||||
@ApiOperation("取消授权")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result cancel(@Valid String userId, @Valid String roleId, @Valid String unionId) {
|
||||
|
||||
// 查询是否已经有退出的申请事项了
|
||||
List<Sys_branch_union_user_permission> list = dao.query(Sys_branch_union_user_permission.class, Cnd.where(Sys_branch_union_user_permission::getUserId, "=", userId)
|
||||
.and(Sys_branch_union_user_permission::getRoleId, "=", roleId)
|
||||
.and(Sys_branch_union_user_permission::getUnionId, "=", unionId)
|
||||
.and(Sys_branch_union_user_permission::getMode, "=", "EXIT"));
|
||||
|
||||
List<String> ids = list.stream().map(Sys_branch_union_user_permission::getId).toList();
|
||||
|
||||
// 查询流程实例
|
||||
List<BpmProcessInstance> instances = dao.query(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "in", ids));
|
||||
|
||||
boolean b = instances.stream().anyMatch(instance -> instance.getProcessInstanceStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.name()));
|
||||
|
||||
if (b) {
|
||||
return Result.error("当前有正在进行的退出申请流程,不能重复取消授权");
|
||||
}
|
||||
|
||||
|
||||
// 插入数据
|
||||
Sys_branch_union_user_permission newPermission = new Sys_branch_union_user_permission();
|
||||
newPermission.setUserId(userId);
|
||||
newPermission.setRoleId(roleId);
|
||||
newPermission.setUnionId(unionId);
|
||||
newPermission.setMode("EXIT");
|
||||
dao.insert(newPermission);
|
||||
|
||||
List<String> assignments = new ArrayList<>();
|
||||
assignments.add(SecurityUtil.getUserId());
|
||||
|
||||
// 启动流程实例
|
||||
bpmService.startSubmitProcessInstance(BpmProcessConstant.BRANCH_UNION_WEIYUAN_AUTHORIZATION.name(), "分工会人员授权", newPermission.getId(), assignments, null);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("sys.branch.union.authorization")
|
||||
@ApiOperation("取消申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result cancelApply(@Param("id") String id) {
|
||||
Sys_branch_union_user_permission userPermission = dao.fetch(Sys_branch_union_user_permission.class, id);
|
||||
if (userPermission == null) {
|
||||
return Result.error("授权不存在");
|
||||
}
|
||||
// 删除
|
||||
dao.delete(userPermission);
|
||||
// 删除流程实例
|
||||
bpmService.deleteInstance(userPermission.getId());
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
@@ -33,4 +33,14 @@ public class Sys_branch_union_user_permission extends BaseModel {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("权限模式(JOIN、EXIT)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String mode;
|
||||
|
||||
@Column
|
||||
@Comment("申请理由")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String reason;
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class Sys_task extends BaseModel implements Serializable {
|
||||
@Column
|
||||
@Name
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(els = {@EL("uuid()")})
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
|
||||
@@ -8,9 +8,21 @@ import lombok.EqualsAndHashCode;
|
||||
@Data
|
||||
public class SysBranchUnionUserAuthorizationPageVO extends BpmTaskApprovalVo {
|
||||
|
||||
private String userName;
|
||||
|
||||
private String loginName;
|
||||
|
||||
private String mobile;
|
||||
|
||||
private String roleName;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String roleId;
|
||||
|
||||
private String unionId;
|
||||
|
||||
private String unionName;
|
||||
|
||||
private String mode;
|
||||
}
|
||||
|
||||
+76
-17
@@ -52,6 +52,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -166,13 +167,15 @@ public class ClubInfoManageController {
|
||||
@SLog(type = "infoManage", tag = "删除协会成员", msg = "删除协会成员", param = true)
|
||||
public Result userDelete(@Valid String id) {
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, id);
|
||||
dao.delete(ClubUser.class,id);
|
||||
// sysClubUserService.clear(Cnd.where("id", "=", id));
|
||||
Sys_role sysRole = sysRoleService.getByCode(clubUser.getRoleCode());
|
||||
if(ObjectUtil.isNotEmpty(sysRole)){
|
||||
dao.clear(Sys_user_role.class, Cnd.NEW().and("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "=", sysRole.getId())
|
||||
.and("clubId", "=", clubUser.getClubId()));
|
||||
dao.delete(ClubUser.class, id);
|
||||
List<String> roleCodes = clubUser.getRoleCode();
|
||||
for (String roleCode : roleCodes) {
|
||||
Sys_role sysRole = sysRoleService.getByCode(roleCode);
|
||||
if (ObjectUtil.isNotEmpty(sysRole)) {
|
||||
dao.clear(Sys_user_role.class, Cnd.NEW().and("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "=", sysRole.getId())
|
||||
.and("clubId", "=", clubUser.getClubId()));
|
||||
}
|
||||
}
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
@@ -202,10 +205,22 @@ public class ClubInfoManageController {
|
||||
|
||||
//如果变更为会员,则直接变更
|
||||
if (Objects.equals(roleCode, RoleConstant.CLUB_MEMBER.name())) {
|
||||
sysClubUserService.dao().update(ClubUser.class,Chain.make("roleCode", roleCode), Cnd.where("id", "=", id));
|
||||
sysClubUserService.dao().update(ClubUser.class, Chain.make("roleCode", roleCode), Cnd.where("id", "=", id));
|
||||
//变更为会员则需要清除社团负责人角色
|
||||
dao.clear(Sys_user_role.class, Cnd.where("clubId", "=", clubId).and("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "in", roleList));
|
||||
} else if (Objects.equals(roleCode, RoleConstant.CLUB_OPERATOR.name())) {
|
||||
// 变更为协会操作员添加角色即可 此用户可能是会长也可能是秘书长
|
||||
Sys_role operatorRole = sysRoleService.getByCode(RoleConstant.CLUB_OPERATOR);
|
||||
dao.clear(Sys_user_role.class, Cnd.where("clubId", "=", clubId).and("userId", "=", clubUser.getUserId()).and("roleId", "=", operatorRole.getId()));
|
||||
//插入新的身份角色
|
||||
Sys_user_role sysUserRole = new Sys_user_role();
|
||||
sysUserRole.setUserId(clubUser.getUserId());
|
||||
sysUserRole.setRoleId(operatorRole.getId());
|
||||
sysUserRole.setClubId(clubId);
|
||||
dao.insert(sysUserRole);
|
||||
clubUser.getRoleCode().add(roleCode);
|
||||
dao.update(clubUser);
|
||||
} else {
|
||||
//先清除原始身份的角色
|
||||
dao.clear(Sys_user_role.class, Cnd.where("clubId", "=", clubId).and("userId", "=", clubUser.getUserId())
|
||||
@@ -218,7 +233,9 @@ public class ClubInfoManageController {
|
||||
sysUserRole.setClubId(clubId);
|
||||
dao.insert(sysUserRole);
|
||||
|
||||
clubUser.setRoleCode(roleCode);
|
||||
// 添加新身份
|
||||
clubUser.getRoleCode().add(roleCode);
|
||||
|
||||
dao.update(clubUser);
|
||||
/* //变更社团负责人,如果是管理员直接变更完成
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_CLUB_MANAGER.name())) {
|
||||
@@ -316,28 +333,70 @@ public class ClubInfoManageController {
|
||||
}
|
||||
cUser.setClubId(clubId);
|
||||
cUser.setUserId(user);
|
||||
cUser.setRoleCode(roleCode);
|
||||
cUser.setRoleCode(List.of(roleCode));
|
||||
sysClubUserService.insertOrUpdate(cUser);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/*===============================20250806新增授权 zhaoxinyu==========================================*/
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@ApiOperation("授权")
|
||||
public Result doAuthRole(@Valid String userId, @Valid String clubId, @Param("roleCode") @Valid String[] roleCode) {
|
||||
// 删除原来的身份
|
||||
List<String> roleCodes = List.of(RoleConstant.CLUB_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_VICE_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_SECRETARY.name(),
|
||||
RoleConstant.CLUB_VICE_SECRETARY.name(),
|
||||
RoleConstant.CLUB_MEMBER.name());
|
||||
for (String code : roleCodes) {
|
||||
String roleId = sysRoleService.getByCode(code).getId();
|
||||
dao.clear(Sys_user_role.class, Cnd.where(Sys_user_role::getUserId, "=", userId).and(Sys_user_role::getClubId, "=", clubId).and(Sys_user_role::getRoleId, "=", roleId));
|
||||
}
|
||||
|
||||
// 新增身份
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where(ClubUser::getClubId, "=", clubId).and(ClubUser::getUserId, "=", userId));
|
||||
clubUser.setRoleCode(Arrays.asList(roleCode));
|
||||
dao.update(clubUser,"roleCode");
|
||||
|
||||
// 新增权限
|
||||
for (String code : roleCode) {
|
||||
Sys_role sysRole = sysRoleService.getByCode(code);
|
||||
Sys_user_role userRole = new Sys_user_role();
|
||||
userRole.setUserId(userId);
|
||||
userRole.setRoleId(sysRole.getId());
|
||||
userRole.setClubId(clubId);
|
||||
dao.insert(userRole);
|
||||
}
|
||||
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/*===============================20250806新增授权 zhaoxinyu==========================================*/
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@ApiOperation("导出登记表")
|
||||
public void exportRegistrationDoc(@Valid String clubId, HttpServletResponse response){
|
||||
clubInfoManageService.exportRegistrationDoc(clubId,response);
|
||||
public void exportRegistrationDoc(@Valid String clubId, HttpServletResponse response) {
|
||||
clubInfoManageService.exportRegistrationDoc(clubId, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
public void downloadUserImport(HttpServletResponse response) {
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();){
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();) {
|
||||
EasyExcel.write(byteArrayOutputStream, ClubUserImportVo.class)
|
||||
.sheet("协会会员导入模版")
|
||||
.doWrite(ArrayList::new);
|
||||
CommonDownloadUtil.download("协会会员导入模版.xlsx",byteArrayOutputStream.toByteArray() ,response);
|
||||
CommonDownloadUtil.download("协会会员导入模版.xlsx", byteArrayOutputStream.toByteArray(), response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -353,7 +412,7 @@ public class ClubInfoManageController {
|
||||
List<ClubUserImportVo> mdList = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(ClubUserImportVo.class);
|
||||
List<String> loginNames = mdList.stream().map(ClubUserImportVo::getLoginname).collect(Collectors.toList());
|
||||
List<View_user> sysUsers = sysClubUserService.dao().query(View_user.class, Cnd.where("loginname", "in", loginNames));
|
||||
List<ClubUser> clubUsers = sysClubUserService.dao().query(ClubUser.class,Cnd.where("clubId", "=", businessId));
|
||||
List<ClubUser> clubUsers = sysClubUserService.dao().query(ClubUser.class, Cnd.where("clubId", "=", businessId));
|
||||
|
||||
|
||||
List<ClubUser> clubUserList = new ArrayList<>();
|
||||
@@ -365,7 +424,7 @@ public class ClubInfoManageController {
|
||||
List<ClubUserImportVo> errorInfos = new ArrayList<>();
|
||||
for (ClubUserImportVo v : mdList) {
|
||||
View_user user = sysUsers.stream().filter(s -> s.getLoginname().equals(v.getLoginname())).findFirst().orElse(null);
|
||||
if (Lang.isEmpty(user)){
|
||||
if (Lang.isEmpty(user)) {
|
||||
v.setErrorInfo("数据库暂无此人请检查工号");
|
||||
errorInfos.add(v);
|
||||
continue;
|
||||
@@ -379,7 +438,7 @@ public class ClubInfoManageController {
|
||||
cUser.setClubPosition(v.getClubPosition());
|
||||
cUser.setUserId(user.getId());
|
||||
cUser.setClubId(businessId);
|
||||
cUser.setRoleCode(RoleConstant.CLUB_MEMBER.name());
|
||||
cUser.setRoleCode(List.of(RoleConstant.CLUB_MEMBER.name()));
|
||||
clubUserList.add(cUser);
|
||||
}
|
||||
sysClubUserService.insert(clubUserList);
|
||||
|
||||
@@ -6,6 +6,9 @@ import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("club_user")
|
||||
@@ -31,8 +34,8 @@ public class ClubUser extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Comment("身份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String roleCode;
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> roleCode = new ArrayList<>();
|
||||
|
||||
@Column
|
||||
@Comment("协会职务")
|
||||
|
||||
+4
-2
@@ -124,15 +124,17 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
|
||||
u.mobile,
|
||||
club.clubName,
|
||||
u.unitname as unitName,
|
||||
r.name as roleName
|
||||
r.name as roleName,
|
||||
GROUP_CONCAT(r.`name`) as roleNames
|
||||
FROM
|
||||
club_user scu
|
||||
LEFT JOIN sys_club club ON scu.clubId = club.id
|
||||
LEFT JOIN sys_role r on r.code = scu.roleCode
|
||||
LEFT JOIN sys_role r ON JSON_CONTAINS(scu.roleCode, CONCAT('"', r.CODE, '"')) OR r.CODE = JSON_UNQUOTE(JSON_EXTRACT(scu.roleCode, '$[0]'))
|
||||
RIGHT JOIN `vw_user` u ON scu.userId = u.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.groupBy("scu.id,scu.userId");
|
||||
|
||||
cnd.and("scu.clubId", "=", pageForm.getClubId());
|
||||
// cnd.and("scu.isNormal", "=", true);
|
||||
|
||||
@@ -172,7 +172,7 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
List<ClubUser> clubUsers = managePerson.stream().map(person -> {
|
||||
ClubUser clubUser = new ClubUser();
|
||||
clubUser.setClubId(club.getId());
|
||||
clubUser.setRoleCode(person.getString("roleCode"));
|
||||
clubUser.setRoleCode(List.of(person.getString("roleCode")));
|
||||
clubUser.setUserId(person.getString("userId"));
|
||||
return clubUser;
|
||||
}).toList();
|
||||
@@ -202,7 +202,7 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
List<ClubUser> clubUsers = managePerson.stream().map(person -> {
|
||||
ClubUser clubUser = new ClubUser();
|
||||
clubUser.setClubId(club.getId());
|
||||
clubUser.setRoleCode(person.getString("roleCode"));
|
||||
clubUser.setRoleCode(List.of(person.getString("roleCode")));
|
||||
clubUser.setUserId(person.getString("userId"));
|
||||
return clubUser;
|
||||
}).toList();
|
||||
|
||||
@@ -31,4 +31,6 @@ public class ClubUserCommonPageVo extends SysClubUser {
|
||||
private String unionId;
|
||||
|
||||
private String roleName;
|
||||
|
||||
private String roleNames;
|
||||
}
|
||||
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
package com.budwk.app.zhgh.dayofficework.birthdayWishes.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
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.sys.models.Sys_task;
|
||||
import com.budwk.app.sys.services.SysTaskService;
|
||||
import com.budwk.app.task.services.TaskPlatformService;
|
||||
import com.budwk.app.zhgh.dayofficework.birthdayWishes.models.BirthdayWishesPlan;
|
||||
import com.budwk.app.zhgh.dayofficework.birthdayWishes.service.BirthdayWishesService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
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.json.Json;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/birthdayWishes/plan")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "生日祝福")
|
||||
public class BirthdayWishesPlanController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BirthdayWishesService birthdayWishesService;
|
||||
@Inject
|
||||
private SysTaskService sysTaskService;
|
||||
@Inject
|
||||
private TaskPlatformService taskPlatformService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/birthdayWishes/plan/index.html")
|
||||
@SaCheckPermission("birthdayWishes")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json:full")
|
||||
@SaCheckPermission("birthdayWishes")
|
||||
public Result pageData(PageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Pagination pagination = birthdayWishesService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("添加计划")
|
||||
@SaCheckPermission("birthdayWishes")
|
||||
public Result insert(BirthdayWishesPlan wishesPlan) {
|
||||
dao.insert(wishesPlan);
|
||||
|
||||
// 插入定时任务
|
||||
Sys_task sysTask = new Sys_task();
|
||||
sysTask.setId(wishesPlan.getId());
|
||||
sysTask.setName(wishesPlan.getName());
|
||||
sysTask.setJobClass("com.budwk.app.zhgh.dayofficework.birthdayWishes.task.BirthdayWishesTask");
|
||||
sysTask.setCron(wishesPlan.getCron());
|
||||
sysTask.setData(Json.toJson(wishesPlan));
|
||||
sysTask.setDisabled(!wishesPlan.getEnabled());
|
||||
// sysTaskService.fastInsert(sysTask);
|
||||
sysTaskService.insert("sys_task", Chain.from(sysTask));
|
||||
|
||||
// 添加定时任务
|
||||
if (wishesPlan.getEnabled()) {
|
||||
if (!taskPlatformService.isExist(sysTask.getId(), sysTask.getId())) {
|
||||
taskPlatformService.add(sysTask.getId(), sysTask.getId(), sysTask.getJobClass(), sysTask.getCron(), sysTask.getNote(), sysTask.getData());
|
||||
}
|
||||
}
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("更新计划")
|
||||
@SaCheckPermission("birthdayWishes")
|
||||
public Result update(BirthdayWishesPlan wishesPlan) {
|
||||
dao.update(wishesPlan);
|
||||
|
||||
Sys_task sysTask = sysTaskService.fetch(wishesPlan.getId());
|
||||
sysTask.setName(wishesPlan.getName());
|
||||
sysTask.setCron(wishesPlan.getCron());
|
||||
sysTask.setData(Json.toJson(wishesPlan));
|
||||
sysTask.setDisabled(!wishesPlan.getEnabled());
|
||||
sysTaskService.update(sysTask);
|
||||
|
||||
if (wishesPlan.getEnabled()) {
|
||||
if (taskPlatformService.isExist(sysTask.getId(), sysTask.getId())) {
|
||||
taskPlatformService.delete(sysTask.getId(), sysTask.getId());
|
||||
}
|
||||
taskPlatformService.add(sysTask.getId(), sysTask.getId(), sysTask.getJobClass(), sysTask.getCron(), sysTask.getNote(), sysTask.getData());
|
||||
} else {
|
||||
if (taskPlatformService.isExist(sysTask.getId(), sysTask.getId())) {
|
||||
taskPlatformService.delete(sysTask.getId(), sysTask.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("删除计划")
|
||||
@SaCheckPermission("birthdayWishes")
|
||||
public Result delete(@Param("id") String id) {
|
||||
dao.delete(BirthdayWishesPlan.class, id);
|
||||
dao.clear(Sys_task.class, Cnd.where(Sys_task::getId, "=", id));
|
||||
if (taskPlatformService.isExist(id, id)) {
|
||||
taskPlatformService.delete(id, id);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.budwk.app.zhgh.dayofficework.birthdayWishes.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;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Table("birthday_wishes_plan")
|
||||
@Comment("生日祝福计划")
|
||||
public class BirthdayWishesPlan extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Comment("计划名称")
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String name;
|
||||
|
||||
@Comment("定时任务")
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String cron;
|
||||
|
||||
@Comment("模板")
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String template;
|
||||
|
||||
@Comment("是否启用")
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("1")
|
||||
private Boolean enabled;
|
||||
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.budwk.app.zhgh.dayofficework.birthdayWishes.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.dayofficework.birthdayWishes.models.BirthdayWishesPlan;
|
||||
|
||||
public interface BirthdayWishesService extends BaseService<BirthdayWishesPlan> {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.dayofficework.birthdayWishes.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.dayofficework.birthdayWishes.models.BirthdayWishesPlan;
|
||||
import com.budwk.app.zhgh.dayofficework.birthdayWishes.service.BirthdayWishesService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class BirthdayWishesServiceImpl extends BaseServiceImpl<BirthdayWishesPlan> implements BirthdayWishesService {
|
||||
public BirthdayWishesServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.budwk.app.zhgh.dayofficework.birthdayWishes.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.budwk.app.sys.models.Sys_msg;
|
||||
import com.budwk.app.sys.services.SysMsgService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@Slf4j
|
||||
public class BirthdayWishesTask implements Job {
|
||||
|
||||
@Inject
|
||||
protected SysMsgService sysMsgService;
|
||||
@Inject
|
||||
protected Dao dao;
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
log.info("=================================执行计划任务:{}", context.getJobDetail().getKey().getName());
|
||||
JobDataMap dataMap = context.getJobDetail().getJobDataMap();
|
||||
log.info("=================================参数:{}", Json.toJson(dataMap));
|
||||
|
||||
String planName = dataMap.getString("name");
|
||||
|
||||
String today = DateUtil.today();
|
||||
|
||||
Sys_msg msg = new Sys_msg();
|
||||
msg.setTitle(planName + today);
|
||||
msg.setType("user");
|
||||
msg.setSendType("show");
|
||||
msg.setSendAt(DateUtil.current());
|
||||
msg.setNote(dataMap.getString("template"));
|
||||
|
||||
// 查询今天生日的会员用户
|
||||
Sql sql = Sqls.create("SELECT loginname FROM sys_user WHERE member = 1 AND MONTH(birthday) = MONTH(CURRENT_DATE) AND DAY(birthday) = DAY(CURRENT_DATE)");
|
||||
sql.setCallback(Sqls.callback.strList());
|
||||
dao.execute(sql);
|
||||
List<String> users = sql.getList(String.class);
|
||||
// 转为数组
|
||||
String[] userArray = users.toArray(String[]::new);
|
||||
log.info("=================================查询今天生日会员用户:{}", users);
|
||||
|
||||
if(userArray.length > 0){
|
||||
log.info("=================================发送消息:{}", msg);
|
||||
sysMsgService.saveMsg(msg, userArray, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-7
@@ -85,7 +85,7 @@ public class HonorBasicSettingsController {
|
||||
} else {
|
||||
dao.updateIgnoreNull(honorBasicSettings);
|
||||
}
|
||||
dao.update(Chain.make("hasChildren", true), Cnd.where("id", "=", honorBasicSettings.getParentId()));
|
||||
dao.update(HonorBasicSettings.class, Chain.make("hasChildren", true), Cnd.where("id", "=", honorBasicSettings.getParentId()));
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
@@ -101,11 +101,12 @@ public class HonorBasicSettingsController {
|
||||
|
||||
/**
|
||||
* 获取荣誉类别
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result getHonorType(){
|
||||
public Result getHonorType() {
|
||||
List<HonorBasicSettings> list = honorCommonService.getHonorBasicSettingsByQueryTypeCode(HonorTypeOrigin.HONOR_TYPE.name());
|
||||
return Result.success(list);
|
||||
}
|
||||
@@ -113,6 +114,7 @@ public class HonorBasicSettingsController {
|
||||
|
||||
/**
|
||||
* 获取获奖等级
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@@ -125,6 +127,7 @@ public class HonorBasicSettingsController {
|
||||
|
||||
/**
|
||||
* 获取奖项介质
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@@ -136,6 +139,7 @@ public class HonorBasicSettingsController {
|
||||
|
||||
/**
|
||||
* 获取个人荣誉
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@@ -147,6 +151,7 @@ public class HonorBasicSettingsController {
|
||||
|
||||
/**
|
||||
* 获取集体荣誉
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@@ -173,10 +178,10 @@ public class HonorBasicSettingsController {
|
||||
cndGr.and("stateId", "=", stateId).and("honorTypeId", "=", "8a8b455b964a41f2bbf18a4896cbd83e");
|
||||
Cnd cndJt = Cnd.NEW();
|
||||
cndJt.and("stateId", "=", stateId).and("honorTypeId", "=", "6b9e26a9467f49ae88fbd3951377e0f8");
|
||||
if("1600".equals(stateId) && !AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
|
||||
if ("1600".equals(stateId) && !AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
|
||||
cndGr.and("unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
if("1700".equals(stateId) && !AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
|
||||
if ("1700".equals(stateId) && !AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
|
||||
cndGr.and("unitId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
return null;
|
||||
@@ -218,12 +223,12 @@ public class HonorBasicSettingsController {
|
||||
LEFT JOIN `sys_user_role` sur ON u.id = sur.userId
|
||||
LEFT JOIN `sys_role` sr ON sr.id = sur.roleId
|
||||
$condition
|
||||
""").setParam("unionId",id);
|
||||
""").setParam("unionId", id);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
Sys_role role = dao.fetch(Sys_role.class, Cnd.where("`code`", "=", RoleConstant.BRANCH_UNION_CHAIRMAN));
|
||||
cnd.and("sur.roleId","=", role.getId());
|
||||
cnd.and("u.unionId","=",id);
|
||||
cnd.and("sur.roleId", "=", role.getId());
|
||||
cnd.and("u.unionId", "=", id);
|
||||
sql.setCondition(cnd);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
|
||||
+1
-17
@@ -64,7 +64,6 @@ public class HonorManageController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
h.*,
|
||||
u.loginname,
|
||||
prize.`name` AS prizeName,
|
||||
type.`name` AS typeName,
|
||||
`level`.`name` AS levelName,
|
||||
@@ -75,7 +74,6 @@ public class HonorManageController {
|
||||
LEFT JOIN honor_basic_settings type ON type.id = h.honorType
|
||||
LEFT JOIN honor_basic_settings `level` ON `level`.id = h.honorLevel
|
||||
LEFT JOIN honor_basic_settings `award` ON `award`.id = h.awardType
|
||||
LEFT JOIN `vw_user` u on u.id = h.userId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
@@ -94,13 +92,6 @@ public class HonorManageController {
|
||||
cnd.andEX("h.unionName", "like", "%" + pageForm.getUnionName() + "%");
|
||||
}
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
|
||||
cnd.and("u.unionId", "=", SecurityUtil.getUnionId());
|
||||
} else {
|
||||
cnd.and("u.id", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = honorViService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> list = pagination.getList();
|
||||
@@ -135,15 +126,12 @@ public class HonorManageController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
h.*,
|
||||
u.sex,
|
||||
u.loginName as loginname,
|
||||
prize.`name` AS prizeName,
|
||||
type.`name` AS typeName,
|
||||
`level`.`name` AS levelName,
|
||||
award.`name` AS awardName
|
||||
FROM
|
||||
`honor` h
|
||||
left join `vw_user` u on h.userid = u.id
|
||||
LEFT JOIN honor_basic_settings prize ON prize.id = h.prize
|
||||
LEFT JOIN honor_basic_settings type ON type.id = h.honorType
|
||||
LEFT JOIN honor_basic_settings `level` ON `level`.id = h.honorLevel
|
||||
@@ -199,10 +187,6 @@ public class HonorManageController {
|
||||
v.setAwardMaterialsExcel(getBasicNameById(Json.toJson(v.getAwardMaterials())).toString());
|
||||
}
|
||||
v.setHonorType(singleHonor.get().getName());
|
||||
if(StrUtil.isNotBlank(v.getUserId())) {
|
||||
Sys_user user = dao.fetch(Sys_user.class, v.getUserId());
|
||||
v.setLoginname(user != null ? user.getLoginname() : "");
|
||||
}
|
||||
});
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
@@ -214,7 +198,7 @@ public class HonorManageController {
|
||||
private List<ExcelExportEntity> getPersonalEntitys() {
|
||||
List<ExcelExportEntity> excelExportEntity = new ArrayList<>();
|
||||
excelExportEntity.add(new ExcelExportEntity("姓名", "userName", 10));
|
||||
excelExportEntity.add(new ExcelExportEntity("工号", "loginname", 10));
|
||||
excelExportEntity.add(new ExcelExportEntity("工号", "loginName", 10));
|
||||
excelExportEntity.add(new ExcelExportEntity("性别", "userSex", 10));
|
||||
excelExportEntity.add(new ExcelExportEntity("担任工会职务", "post", 10));
|
||||
excelExportEntity.add(new ExcelExportEntity("职称", "title", 16));
|
||||
|
||||
@@ -37,6 +37,11 @@ public class Honor extends BaseModel {
|
||||
@Comment("姓名")
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("工号")
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Excel(name = "性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1)
|
||||
@@ -221,6 +226,4 @@ public class Honor extends BaseModel {
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("附件")
|
||||
private List<JSONObject> files;
|
||||
|
||||
private String loginname;
|
||||
}
|
||||
|
||||
+17
-1
@@ -50,11 +50,23 @@ public class RestQueryController {
|
||||
@SaCheckPermission("rest.query")
|
||||
@ApiOperation("分页查询")
|
||||
public Result pageData(@Valid RestQueryPageForm pageForm) {
|
||||
|
||||
|
||||
// Sql sql = Sqls.create("""
|
||||
// SELECT
|
||||
// s.*
|
||||
// FROM
|
||||
// rest_act_signup s
|
||||
// LEFT JOIN rest r ON r.id = s.restActId
|
||||
// $condition
|
||||
// """);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX(RestActSignUp::getRestActId, "=", pageForm.getActId());
|
||||
cnd.andEX(RestActSignUp::getUnionId, "=", pageForm.getUnionId());
|
||||
cnd.andEX(RestActSignUp::getUnitId, "=", pageForm.getUnitId());
|
||||
// sql.setCondition(cnd);
|
||||
Pagination pagination = restActSignUpService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@@ -64,11 +76,15 @@ public class RestQueryController {
|
||||
@Ok("void")
|
||||
public void exportExcel(@Valid RestQueryPageForm pageForm, HttpServletResponse response) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX(RestActSignUp::getRestActId, "=", pageForm.getActId());
|
||||
cnd.andEX(RestActSignUp::getUnionId, "=", pageForm.getUnionId());
|
||||
cnd.andEX(RestActSignUp::getUnitId, "=", pageForm.getUnitId());
|
||||
cnd.desc(RestActSignUp::getUnionName).desc(RestActSignUp::getUnitName);
|
||||
List<RestActSignUp> list = restActSignUpService.query(cnd);
|
||||
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
entities.add(new ExcelExportEntity("姓名", "name", 20));
|
||||
entities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
entities.add(new ExcelExportEntity("单位", "unitName", 20));
|
||||
entities.add(new ExcelExportEntity("分工会", "unionName", 20));
|
||||
entities.add(new ExcelExportEntity("批次", "batch", 20));
|
||||
|
||||
@@ -52,6 +52,11 @@ public class RestActSignUp extends BaseModel {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@Comment("单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.BpmProcessConstant;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolence;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.service.WarmthCondolenceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
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.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/warmthCondolence/apply")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "送温暖慰问申请")
|
||||
public class WarmthCondolenceApplyController {
|
||||
|
||||
@Inject
|
||||
private WarmthCondolenceService warmthCondolenceService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/warmthCondolence/apply/index.html")
|
||||
@SaCheckPermission("warmthCondolence.apply")
|
||||
public void index(){}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.apply")
|
||||
@ApiOperation("保存")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(type = "warmthCondolenceApply", tag = "保存慰问申请", msg = "保存慰问申请")
|
||||
public Result save(@Param("warmthCondolence")WarmthCondolence warmthCondolence){
|
||||
warmthCondolence.setNo(warmthCondolenceService.createNo(warmthCondolence));
|
||||
warmthCondolenceService.insertOrUpdate(warmthCondolence);
|
||||
bpmService.startSaveProcessInstance(BpmProcessConstant.WARMTH_CONDOLENCE.name(), warmthCondolence.getUserName()+"的申请", warmthCondolence.getId(), null);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.apply")
|
||||
@ApiOperation("提交")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "送温暖慰问申请", msg = "送温暖慰问申请")
|
||||
public Result submit(@Param("warmthCondolence")@Valid WarmthCondolence warmthCondolence){
|
||||
warmthCondolence.setNo(warmthCondolenceService.createNo(warmthCondolence));
|
||||
warmthCondolenceService.insertOrUpdate(warmthCondolence);
|
||||
//查询分工会审批人工号
|
||||
String branchUnionApprovalLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.BRANCH_UNION_CHAIRMAN, Cnd.where(Sys_user_role::getUnionId, "=", warmthCondolence.getUnionId()));
|
||||
if(StrUtil.isBlank(branchUnionApprovalLoginName)){
|
||||
return Result.error("分工会未配置审批人,请联系校工会!");
|
||||
}
|
||||
bpmService.startSubmitProcessInstance(BpmProcessConstant.WARMTH_CONDOLENCE.name(), warmthCondolence.getUserName()+"的申请", warmthCondolence.getId(), List.of(branchUnionApprovalLoginName),null);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.apply")
|
||||
@ApiOperation("详情")
|
||||
public Result info(@Valid String id){
|
||||
WarmthCondolence condolence = warmthCondolenceService.fetch(id);
|
||||
return Result.success(condolence);
|
||||
}
|
||||
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.bpm.enums.BpmTaskApprovalTypeEnum;
|
||||
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolence;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.param.WarmthCondolencePageForm;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.service.WarmthCondolenceService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.vo.WarmthCondolencePageVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/warmthCondolence/branchUnionApproval")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "送温暖慰问分工会审核")
|
||||
public class WarmthCondolenceBranchUnionApprovalController {
|
||||
|
||||
@Inject
|
||||
private WarmthCondolenceService warmthCondolenceService;
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/warmthCondolence/branchUnionApproval/index.html")
|
||||
@SaCheckPermission("warmthCondolence.branchUnionApproval")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.branchUnionApproval")
|
||||
@ApiOperation("数据列表")
|
||||
@Ok("json")
|
||||
public Result pageData(@Valid WarmthCondolencePageForm pageForm, boolean approval){
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
wc.*,
|
||||
inst.id processInstanceId,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
task.id processInstanceTaskId,
|
||||
task.taskStatus processInstanceTaskStatus,
|
||||
COUNT(nt.id) OVER (PARTITION BY task.id) > 0 AS nextTaskIsComplete
|
||||
FROM
|
||||
bpm_process_task task
|
||||
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
|
||||
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
|
||||
INNER JOIN warmth_condolence wc ON wc.id = inst.processInstanceBusinessId
|
||||
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id AND nt.taskStatus = 'COMPLETE'
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){
|
||||
cnd.and(new Static("JSON_CONTAINS( task.assignments, '\"%s\"' )".formatted(SecurityUtil.getUserLoginname())));
|
||||
}
|
||||
|
||||
cnd.and("nd.nodeCode","=",20);
|
||||
if(approval){
|
||||
cnd.and("task.taskStatus","=",BpmProcessTaskStatusEnum.COMPLETE);
|
||||
}else{
|
||||
cnd.and("task.taskStatus","=",BpmProcessTaskStatusEnum.ACTIVE);
|
||||
}
|
||||
|
||||
cnd.andEX("wc.noticeId","=",pageForm.getNoticeId());
|
||||
cnd.and(Cnd.likeEX("wc.userName", pageForm.getUserName()));
|
||||
cnd.and(Cnd.likeEX("wc.loginName", pageForm.getLoginName()));
|
||||
cnd.andEX("wc.unionId","=",pageForm.getUnionId());
|
||||
cnd.andEX("wc.unitId","=",pageForm.getUnitId());
|
||||
|
||||
sql.setCondition(cnd);
|
||||
Pagination<WarmthCondolencePageVO> pageVO = warmthCondolenceService.listPageVO(pageForm, sql, WarmthCondolencePageVO.class);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.branchUnionApproval")
|
||||
@ApiOperation("审核")
|
||||
@SLog(tag = "送温暖慰问分工会审核", msg = "分工会审核")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result approval(@Valid @Param("approval")BpmTaskApprovalParam approvalParam){
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
|
||||
WarmthCondolence warmthCondolence = warmthCondolenceService.fetch(approvalParam.getProcessInstanceBusinessId());
|
||||
|
||||
List<String> assignments = new ArrayList<>();
|
||||
if(approvalParam.getBpmTaskApprovalTypeEnum().equals(BpmTaskApprovalTypeEnum.PASS)){
|
||||
String schoolUnionApprovalLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.SCHOOL_UNION_ADMIN, Cnd.where(Sys_user_role::getUnionId, "=", warmthCondolence.getUnionId()));
|
||||
assignments.add(schoolUnionApprovalLoginName);
|
||||
}
|
||||
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, assignments);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.branchUnionApproval")
|
||||
@ApiOperation("撤回")
|
||||
@SLog(tag = "送温暖慰问分工会审核", msg = "撤回")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result revoke(@Valid String taskId){
|
||||
bpmService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolenceNotice;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.service.WarmthCondolenceNoticeService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.service.WarmthCondolenceService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.vo.WarmthCondolenceVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/warmthCondolence/common")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "送温暖慰问公共")
|
||||
public class WarmthCondolenceCommonController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private WarmthCondolenceNoticeService warmthCondolenceNoticeService;
|
||||
@Inject
|
||||
private WarmthCondolenceService warmthCondolenceService;
|
||||
|
||||
@At
|
||||
@ApiOperation("申请详情")
|
||||
@SaCheckPermission("warmthCondolence")
|
||||
public Result info(@Valid String id){
|
||||
WarmthCondolenceVO condolenceVO = warmthCondolenceService.info(id);
|
||||
return Result.success(condolenceVO);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("获取通知列表")
|
||||
@SaCheckPermission("warmthCondolence")
|
||||
public Result listNotice(){
|
||||
List<WarmthCondolenceNotice> list = warmthCondolenceNoticeService.query(Cnd.where(WarmthCondolenceNotice::getEnable, "=", 1)
|
||||
.asc(WarmthCondolenceNotice::getStartTime));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("warmthCondolence")
|
||||
@ApiOperation("导出申请表")
|
||||
public void exportApplyDocx(@Valid String id, HttpServletResponse response){
|
||||
warmthCondolenceService.exportApplyDocx(id,response);
|
||||
}
|
||||
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.param.WarmthCondolencePageForm;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.service.WarmthCondolenceService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.vo.WarmthCondolencePageVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/warmthCondolence/mine")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "送温暖慰问我的申请记录")
|
||||
public class WarmthCondolenceMineController {
|
||||
|
||||
@Inject
|
||||
private WarmthCondolenceService warmthCondolenceService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/warmthCondolence/mine/index.html")
|
||||
@SaCheckPermission("warmthCondolence.mine")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.mine")
|
||||
@ApiOperation("数据列表")
|
||||
@Ok("json")
|
||||
public Result pageData(@Valid WarmthCondolencePageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeCode,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
nd.nodeType AS processInstanceTaskNodeType,
|
||||
(
|
||||
SELECT
|
||||
count( 1 ) > 0
|
||||
FROM
|
||||
bpm_process_task
|
||||
WHERE
|
||||
prevTaskId = ( SELECT id FROM bpm_process_task WHERE processInstanceId = inst.id AND processTaskNodeCode IN ( 10, 40, 70 ) ORDER BY createdAt DESC LIMIT 1 )
|
||||
AND taskStatus = 'COMPELTE'
|
||||
) AS nextTaskIsComplete
|
||||
FROM
|
||||
warmth_condolence info
|
||||
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = info.id
|
||||
LEFT JOIN bpm_process_node_define nd ON nd.id = inst.processInstanceNodeId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("info.loginName", "=", SecurityUtil.getUserLoginname());
|
||||
}
|
||||
cnd.andEX("info.noticeId","=",pageForm.getNoticeId());
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<WarmthCondolencePageVO> pageVO = warmthCondolenceService.listPageVO(pageForm, sql, WarmthCondolencePageVO.class);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.mine")
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "送温暖慰问申请", msg = "删除申请")
|
||||
public Result delete(@Valid String id) {
|
||||
warmthCondolenceService.delete(id);
|
||||
bpmService.deleteInstance(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.mine")
|
||||
@ApiOperation("撤回")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "送温暖慰问申请", msg = "撤回申请")
|
||||
public Result revokeApply(@Valid String id) {
|
||||
bpmService.revokeApply(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolence;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolenceNotice;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.param.WarmthCondolenceNoticePageForm;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.service.WarmthCondolenceNoticeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/warmthCondolenceNotice")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "送温暖慰问通知")
|
||||
public class WarmthCondolenceNoticeController {
|
||||
|
||||
@Inject
|
||||
private WarmthCondolenceNoticeService warmthCondolenceNoticeService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/warmthCondolence/notice/index.html")
|
||||
@SaCheckPermission("warmthCondolence.notice")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.notice")
|
||||
@ApiOperation("分页查询")
|
||||
public Result pageData(@Valid WarmthCondolenceNoticePageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and(Cnd.likeEX(WarmthCondolenceNotice::getTitle, pageForm.getTitle()));
|
||||
cnd.andEX(WarmthCondolenceNotice::getYear, "=", pageForm.getYear());
|
||||
cnd.desc(WarmthCondolenceNotice::getYear);
|
||||
Pagination pagination = warmthCondolenceNoticeService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.notice")
|
||||
@ApiOperation("新增")
|
||||
@SLog(tag = "送温暖慰问通知", msg = "新增")
|
||||
public Result insert(WarmthCondolenceNotice warmthCondolenceNotice) {
|
||||
warmthCondolenceNoticeService.insert(warmthCondolenceNotice);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.notice")
|
||||
@SLog(tag = "送温暖慰问通知", msg = "修改")
|
||||
public Result update(WarmthCondolenceNotice warmthCondolenceNotice) {
|
||||
warmthCondolenceNoticeService.updateIgnoreNull(warmthCondolenceNotice);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.notice")
|
||||
@SLog(tag = "送温暖慰问通知", msg = "删除")
|
||||
public Result delete(@Valid String id) {
|
||||
int count = warmthCondolenceNoticeService.dao().count(WarmthCondolence.class, Cnd.where(WarmthCondolence::getNoticeId, "=", id));
|
||||
if (count > 0) {
|
||||
return Result.error("该事项有关联的申请记录,无法删除!");
|
||||
}
|
||||
warmthCondolenceNoticeService.delete(id);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.param.WarmthCondolencePageForm;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.service.WarmthCondolenceService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.vo.WarmthCondolencePageVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/warmthCondolence/query")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "送温暖慰问综合查询")
|
||||
public class WarmthCondolenceQueryController {
|
||||
|
||||
@Inject
|
||||
private WarmthCondolenceService warmthCondolenceService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/warmthCondolence/query/index.html")
|
||||
@SaCheckPermission("warmthCondolence.query")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.query")
|
||||
@ApiOperation("数据列表")
|
||||
@Ok("json")
|
||||
public Result pageData(@Valid WarmthCondolencePageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
inst.id processInstanceId,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus
|
||||
FROM
|
||||
warmth_condolence info
|
||||
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = info.id
|
||||
LEFT JOIN bpm_process_node_define nd ON nd.id = inst.processInstanceNodeId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// cnd.and("inst.processInstanceNodeCode","=",80);
|
||||
cnd.andEX("info.noticeId", "=", pageForm.getNoticeId());
|
||||
cnd.and(Cnd.likeEX("info.userName", pageForm.getUserName()));
|
||||
cnd.and(Cnd.likeEX("info.loginName", pageForm.getLoginName()));
|
||||
cnd.andEX("info.unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("info.unitId", "=", pageForm.getUnitId());
|
||||
cnd.asc("info.no");
|
||||
cnd.asc("info.unionName");
|
||||
cnd.asc("info.unitName");
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<WarmthCondolencePageVO> pageVO = warmthCondolenceService.listPageVO(pageForm, sql, WarmthCondolencePageVO.class);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.query")
|
||||
@ApiOperation("图表数据")
|
||||
public Result chartData() {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
wcn.year,
|
||||
COUNT(wc.id) as user_count,
|
||||
SUM(wc.amount) AS total_amount
|
||||
FROM
|
||||
warmth_condolence_notice wcn
|
||||
LEFT JOIN
|
||||
warmth_condolence wc ON wc.noticeId = wcn.id
|
||||
GROUP BY
|
||||
wcn.YEAR
|
||||
ORDER BY
|
||||
wcn.YEAR
|
||||
""");
|
||||
List<NutMap> list = warmthCondolenceService.listMap(sql);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.query.delete")
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "送温暖慰问综合查询", msg = "删除申请")
|
||||
public Result delete(@Valid String id) {
|
||||
warmthCondolenceService.delete(id);
|
||||
bpmService.deleteInstance(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("warmthCondolence.query")
|
||||
@ApiOperation("导出Excel")
|
||||
public void exportExcel(@Valid WarmthCondolencePageForm pageForm, HttpServletResponse response) {
|
||||
warmthCondolenceService.exportExcel(pageForm, response);
|
||||
}
|
||||
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.param.WarmthCondolencePageForm;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.service.WarmthCondolenceService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.vo.WarmthCondolencePageVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/warmthCondolence/schoolUnionApproval")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "送温暖慰问校工会审核")
|
||||
public class WarmthCondolenceSchoolUnionApprovalController {
|
||||
|
||||
@Inject
|
||||
private WarmthCondolenceService warmthCondolenceService;
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/warmthCondolence/schoolUnionApproval/index.html")
|
||||
@SaCheckPermission("warmthCondolence.schoolUnionApproval")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.schoolUnionApproval")
|
||||
@ApiOperation("数据列表")
|
||||
@Ok("json")
|
||||
public Result pageData(@Valid WarmthCondolencePageForm pageForm, boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
wc.*,
|
||||
inst.id processInstanceId,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
task.id processInstanceTaskId,
|
||||
task.taskStatus processInstanceTaskStatus,
|
||||
COUNT(nt.id) OVER (PARTITION BY task.id) > 0 AS nextTaskIsComplete
|
||||
FROM
|
||||
bpm_process_task task
|
||||
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
|
||||
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
|
||||
INNER JOIN warmth_condolence wc ON wc.id = inst.processInstanceBusinessId
|
||||
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id AND nt.taskStatus = 'COMPLETE'
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){
|
||||
cnd.and(new Static("JSON_CONTAINS( task.assignments, '\"%s\"' )".formatted(SecurityUtil.getUserLoginname())));
|
||||
}
|
||||
cnd.and("nd.nodeCode", "=", 50);
|
||||
if (approval) {
|
||||
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.COMPLETE);
|
||||
} else {
|
||||
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.ACTIVE);
|
||||
}
|
||||
|
||||
cnd.andEX("wc.noticeId", "=", pageForm.getNoticeId());
|
||||
cnd.and(Cnd.likeEX("wc.userName", pageForm.getUserName()));
|
||||
cnd.and(Cnd.likeEX("wc.loginName", pageForm.getLoginName()));
|
||||
cnd.andEX("wc.unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("wc.unitId", "=", pageForm.getUnitId());
|
||||
|
||||
sql.setCondition(cnd);
|
||||
Pagination<WarmthCondolencePageVO> pageVO = warmthCondolenceService.listPageVO(pageForm, sql, WarmthCondolencePageVO.class);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.schoolUnionApproval")
|
||||
@ApiOperation("审核")
|
||||
@SLog(tag = "送温暖慰问校工会审核", msg = "校工会审核")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, null);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("warmthCondolence.schoolUnionApproval")
|
||||
@ApiOperation("撤回")
|
||||
@SLog(tag = "送温暖慰问校工会审核", msg = "撤回")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result revoke(@Valid String taskId) {
|
||||
bpmService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.models;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
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.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("warmth_condolence")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("送温暖慰问")
|
||||
public class WarmthCondolence 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 noticeId;
|
||||
|
||||
@Column
|
||||
@Comment("编号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String no;
|
||||
|
||||
@Column
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@Comment("出生年月")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date birthday;
|
||||
|
||||
@Column
|
||||
@Comment("联系电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 11)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("职务(职称)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String technicalTitle;
|
||||
|
||||
@Column
|
||||
@Comment("单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("分工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("分工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("申请理由")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
private String applyReason;
|
||||
|
||||
@Column
|
||||
@Comment("申请时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private String applyDateTime;
|
||||
|
||||
@Column
|
||||
@Comment("补助金额")
|
||||
@ColDefine(customType = "decimal", width = 10, precision = 2)
|
||||
private BigDecimal amount;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
|
||||
@One(field = "noticeId")
|
||||
private WarmthCondolenceNotice warmthCondolenceNotice;
|
||||
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.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;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("warmth_condolence_notice")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("送温暖慰问通知")
|
||||
public class WarmthCondolenceNotice extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("标题")
|
||||
private String title;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 500)
|
||||
@Comment("内容")
|
||||
private String content;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("年份")
|
||||
private Integer year;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("开始时间")
|
||||
private Date startTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("结束时间")
|
||||
private Date endTime;
|
||||
|
||||
@Column
|
||||
@Comment("是否启用")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("1")
|
||||
private Boolean enable;
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.param;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolenceNotice;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("送温暖慰问通知分页参数")
|
||||
@Data
|
||||
public class WarmthCondolenceNoticePageForm extends PageForm<WarmthCondolenceNotice> {
|
||||
|
||||
@ApiModelProperty("标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("年份")
|
||||
private Integer year;
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.param;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolence;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("送温暖慰问分页参数")
|
||||
@Data
|
||||
public class WarmthCondolencePageForm extends PageForm<WarmthCondolence> {
|
||||
|
||||
@ApiModelProperty("通知")
|
||||
private String noticeId;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("工号")
|
||||
private String loginName;
|
||||
|
||||
@ApiModelProperty("分工会")
|
||||
private String unionId;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
private String unitId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolenceNotice;
|
||||
|
||||
public interface WarmthCondolenceNoticeService extends BaseService<WarmthCondolenceNotice> {
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolence;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.param.WarmthCondolencePageForm;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.vo.WarmthCondolenceVO;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public interface WarmthCondolenceService extends BaseService<WarmthCondolence> {
|
||||
|
||||
/**
|
||||
* 生成编号
|
||||
* @param warmthCondolence
|
||||
* @return
|
||||
*/
|
||||
String createNo(WarmthCondolence warmthCondolence);
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
WarmthCondolenceVO info(String id);
|
||||
|
||||
/**
|
||||
* 导出word
|
||||
* @param id
|
||||
* @param response
|
||||
*/
|
||||
void exportApplyDocx(String id, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
* @param pageForm
|
||||
* @param response
|
||||
*/
|
||||
void exportExcel(WarmthCondolencePageForm pageForm, HttpServletResponse response);
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolenceNotice;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.service.WarmthCondolenceNoticeService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class WarmthCondolenceNoticeServiceImpl extends BaseServiceImpl<WarmthCondolenceNotice> implements WarmthCondolenceNoticeService {
|
||||
|
||||
public WarmthCondolenceNoticeServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.service.impl;
|
||||
|
||||
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.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.BpmProcessConstant;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.bpm.vo.BpmTaskApprovalRecordVo;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolence;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolenceNotice;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.param.WarmthCondolencePageForm;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.service.WarmthCondolenceService;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.vo.WarmthCondolenceVO;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.vo.WarmthCondolenceWordVO;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
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.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class WarmthCondolenceServiceImpl extends BaseServiceImpl<WarmthCondolence> implements WarmthCondolenceService {
|
||||
|
||||
@Inject
|
||||
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
public WarmthCondolenceServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createNo(WarmthCondolence warmthCondolence) {
|
||||
if (ObjectUtil.isNull(warmthCondolence) || StrUtil.isBlank(warmthCondolence.getNo())) {
|
||||
WarmthCondolenceNotice condolenceNotice = dao().fetch(WarmthCondolenceNotice.class, warmthCondolence.getNoticeId());
|
||||
Integer year = condolenceNotice.getYear();
|
||||
int count = dao().count(WarmthCondolence.class, Cnd.where(WarmthCondolence::getNoticeId, "=", warmthCondolence.getId()));
|
||||
return String.format("%04d", year) + String.format("%03d", count + 1);
|
||||
}
|
||||
return warmthCondolence.getNo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarmthCondolenceVO info(String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
wc.*,
|
||||
wcn.title AS noticeTitle
|
||||
FROM
|
||||
warmth_condolence wc
|
||||
LEFT JOIN warmth_condolence_notice wcn ON wcn.id = wc.noticeId
|
||||
WHERE wc.id = @id
|
||||
""");
|
||||
sql.setParam("id", id);
|
||||
WarmthCondolenceVO warmthCondolenceVO = fetchVO(sql, WarmthCondolenceVO.class);
|
||||
warmthCondolenceVO.setNodeTasks(bpmService.getNodeTasks(BpmProcessConstant.WARMTH_CONDOLENCE, id));
|
||||
return warmthCondolenceVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportApplyDocx(String id, HttpServletResponse response) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
wc.no,
|
||||
wc.userName,
|
||||
wc.sex,
|
||||
DATE_FORMAT(wc.birthday,'%Y年%m月%d日') birthday,
|
||||
wc.technicalTitle,
|
||||
wc.loginName,
|
||||
wc.unitName,
|
||||
wc.unionName,
|
||||
wc.applyReason,
|
||||
DATE_FORMAT(wc.applyDateTime,'%Y年%m月%d日') applyDate
|
||||
FROM
|
||||
warmth_condolence wc
|
||||
WHERE wc.id = @id
|
||||
""");
|
||||
sql.setParam("id", id);
|
||||
WarmthCondolenceWordVO wordVO = fetchVO(sql, WarmthCondolenceWordVO.class);
|
||||
Map<String, Object> renderData = BeanUtil.beanToMap(wordVO);
|
||||
|
||||
List<BpmTaskApprovalRecordVo> nodeTasks = bpmService.getNodeTasks(BpmProcessConstant.WARMTH_CONDOLENCE, id);
|
||||
|
||||
renderData.put("branchUnionApproval", nodeTasks.stream().filter(v -> v.getNodeCode() == 20).flatMap(v -> v.getTasks().stream()).map(v -> {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
if(ObjectUtil.isNotNull(v.getEndOn())){
|
||||
map.put("endOn", DateUtil.format(v.getEndOn(), "yyyy年MM月dd日"));
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(v.getExtVariable())){
|
||||
map.put("approvalOpinion", v.getExtVariable().getStr("approvalOpinion"));
|
||||
map.put("sign", sysOfficeTemplateUtil.createPictureRenderData(v.getExtVariable().getStr("approvalSignature")));
|
||||
}
|
||||
return map;
|
||||
}).toList());
|
||||
renderData.put("schoolUnionApproval", nodeTasks.stream().filter(v -> v.getNodeCode() == 50).flatMap(v -> v.getTasks().stream()).map(v -> {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
if(ObjectUtil.isNotNull(v.getEndOn())){
|
||||
map.put("endOn", DateUtil.format(v.getEndOn(), "yyyy年MM月dd日"));
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(v.getExtVariable())){
|
||||
map.put("approvalOpinion", v.getExtVariable().getStr("approvalOpinion"));
|
||||
map.put("sign", sysOfficeTemplateUtil.createPictureRenderData(v.getExtVariable().getStr("approvalSignature")));
|
||||
}
|
||||
return map;
|
||||
}).toList());
|
||||
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
|
||||
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("warmthCondolence")).render(renderData).write(byteArrayOutputStream);
|
||||
CommonDownloadUtil.download(wordVO.getUserName()+"的送温暖慰问申请表.docx", byteArrayOutputStream.toByteArray(), response);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportExcel(WarmthCondolencePageForm pageForm, HttpServletResponse response) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.no,
|
||||
info.userName,
|
||||
info.sex,
|
||||
info.mobile,
|
||||
info.loginName,
|
||||
info.unitName,
|
||||
info.unionName,
|
||||
DATE_FORMAT(info.birthday,'%Y年%m月%d日') birthday,
|
||||
FROM
|
||||
warmth_condolence info
|
||||
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = info.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("inst.processInstanceNodeCode", "=", 80);
|
||||
cnd.andEX("info.noticeId","=",pageForm.getNoticeId());
|
||||
cnd.and(Cnd.likeEX("info.userName", pageForm.getUserName()));
|
||||
cnd.and(Cnd.likeEX("info.loginName", pageForm.getLoginName()));
|
||||
cnd.and(Cnd.likeEX("info.unionId", pageForm.getUnionId()));
|
||||
cnd.and(Cnd.likeEX("info.unitId", pageForm.getUnitId()));
|
||||
cnd.asc("info.unionName");
|
||||
cnd.asc("info.unitName");
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = listMap(sql);
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("编号", "no", 20));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
exportEntities.add(new ExcelExportEntity("单位", "unitName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("分工会", "unionName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("联系电话", "mobile", 20));
|
||||
exportEntities.add(new ExcelExportEntity("出生年月", "birthday", 20));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
|
||||
CommonDownloadUtil.download("送温暖慰问名单.xlsx", workbook, response);
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.vo;
|
||||
|
||||
import com.budwk.app.bpm.vo.BpmTaskApprovalVo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class WarmthCondolencePageVO extends BpmTaskApprovalVo {
|
||||
|
||||
private String id;
|
||||
private String noticeId;
|
||||
private String no;
|
||||
private String loginName;
|
||||
private String userName;
|
||||
private String sex;
|
||||
private Date birthday;
|
||||
private String mobile;
|
||||
private String technicalTitle;
|
||||
private String unitName;
|
||||
private String unitId;
|
||||
private String unionName;
|
||||
private String unionId;
|
||||
private String applyReason;
|
||||
private Date applyDateTime;
|
||||
private BigDecimal amount;
|
||||
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.vo;
|
||||
|
||||
import com.budwk.app.bpm.vo.BpmTaskApprovalRecordVo;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolence;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class WarmthCondolenceVO extends WarmthCondolence {
|
||||
|
||||
@ApiModelProperty("通知标题")
|
||||
private String noticeTitle;
|
||||
|
||||
@ApiModelProperty("节点审批记录")
|
||||
private List<BpmTaskApprovalRecordVo> nodeTasks;
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.budwk.app.zhgh.dayofficework.warmthCondolence.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WarmthCondolenceWordVO {
|
||||
|
||||
@ApiModelProperty("编号")
|
||||
private String no;
|
||||
|
||||
@ApiModelProperty("工号")
|
||||
private String loginName;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("性别")
|
||||
private String sex;
|
||||
|
||||
@ApiModelProperty("出生年月")
|
||||
private String birthday;
|
||||
|
||||
@ApiModelProperty("联系电话")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("职务(职称)")
|
||||
private String technicalTitle;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty("分工会")
|
||||
private String unionName;
|
||||
|
||||
@ApiModelProperty("申请理由")
|
||||
private String applyReason;
|
||||
|
||||
@ApiModelProperty("申请时间")
|
||||
private String applyDate;
|
||||
|
||||
|
||||
}
|
||||
@@ -445,29 +445,17 @@
|
||||
}
|
||||
|
||||
:root {
|
||||
/*--color-primary: #1890ff;*/
|
||||
/*--color-primary-1: #e6f7ff;*/
|
||||
/*--color-primary-2: #bae7ff;*/
|
||||
/*--color-primary-3: #91d5ff;*/
|
||||
/*--color-primary-4: #69c0ff;*/
|
||||
/*--color-primary-5: #73d13d;*/
|
||||
/*--color-primary-6: #1890ff;*/
|
||||
/*--color-primary-7: #096dd9;*/
|
||||
/*--color-primary-8: #0050b3;*/
|
||||
/*--color-primary-9: #003a8c;*/
|
||||
/*--color-primary-10: #002766;*/
|
||||
|
||||
--color-primary: #217050;
|
||||
--color-primary-1: #e8f5eb;
|
||||
--color-primary-2: #c3e6d1;
|
||||
--color-primary-3: #9dd7b7;
|
||||
--color-primary-4: #78c89d;
|
||||
--color-primary-5: #53b983;
|
||||
--color-primary-6: #217050; /* 主色 */
|
||||
--color-primary-7: #1a5a40;
|
||||
--color-primary-8: #134330;
|
||||
--color-primary-9: #0d2d20;
|
||||
--color-primary-10: #061610;
|
||||
--color-primary: #006db9; /* 主色 */
|
||||
--color-primary-1: #e6f3ff; /* 最浅,用于浅色背景 */
|
||||
--color-primary-2: #b3d9ff; /* 较浅,用于 hover/light-bg */
|
||||
--color-primary-3: #80c0ff; /* 轻微强调 */
|
||||
--color-primary-4: #4da6ff; /* 中等强调 */
|
||||
--color-primary-5: #1a8cff; /* 较强强调 */
|
||||
--color-primary-6: #006db9; /* 主色(默认) */
|
||||
--color-primary-7: #005aa3; /* 点击/active 状态 */
|
||||
--color-primary-8: #00468c; /* 较深,用于文字/强调 */
|
||||
--color-primary-9: #003370; /* 更深,用于深色模式 */
|
||||
--color-primary-10: #002054; /* 最深,用于特殊强调 */
|
||||
|
||||
--color-success: #52c41a;
|
||||
--color-success-1: #f6ffed;
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
flex-wrap: wrap;
|
||||
column-gap: 50px;
|
||||
row-gap: 10px;
|
||||
container-type: inline-size;
|
||||
}
|
||||
|
||||
.search .search-item {
|
||||
@@ -120,6 +121,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
@container (max-width: 800px) {
|
||||
.search .search-item {
|
||||
width: calc((100%) / 3);
|
||||
}
|
||||
}
|
||||
|
||||
@container (max-width: 600px) {
|
||||
.search .search-item {
|
||||
width: calc((100%) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
@container (max-width: 400px) {
|
||||
.search .search-item {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Text Color Variant
|
||||
*
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-row type="flex" :gutter="20" style="height: calc(100vh - 126px)">
|
||||
<el-col :span="12">
|
||||
<el-card shadow="never">
|
||||
<table-tool label="已授权人员"></table-tool>
|
||||
<el-table :data="hasAuthUsers" border size="small">
|
||||
<el-table-column label="序号" type="index" width="50px"></el-table-column>
|
||||
<el-table-column prop="username" label="姓名"></el-table-column>
|
||||
<el-table-column prop="loginname" label="工号"></el-table-column>
|
||||
<el-table-column prop="mobile" label="联系方式"></el-table-column>
|
||||
<el-table-column prop="roleName" label="角色"></el-table-column>
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template scope="scope">
|
||||
<el-button size="mini" type="danger" @click="cancelAuthorization(scope.row)">取消授权
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="姓名">
|
||||
<el-input v-model="pageForm.searchKeyword" placeholder="请输入姓名"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool label="申请记录">
|
||||
<el-radio-group v-model="pageForm.mode" size="small" @change="doSearch" class="mr5">
|
||||
<el-radio-button label="JOIN">新增</el-radio-button>
|
||||
<el-radio-button label="EXIT">退出</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-button size="small" type="primary" icon="el-icon-plus" @click="openAdd">新增授权</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData">
|
||||
<el-table-column type="index" label="序号" width="50px" :index="indexMethod"></el-table-column>
|
||||
<el-table-column label="姓名" prop="userName"></el-table-column>
|
||||
<el-table-column label="工号" prop="loginName"></el-table-column>
|
||||
<el-table-column label="联系电话" prop="mobile"></el-table-column>
|
||||
<el-table-column label="授权角色" prop="roleName"></el-table-column>
|
||||
<el-table-column label="授权模式" prop="mode">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="mini" type="success" v-if="scope.row.mode === 'JOIN'">加入</el-tag>
|
||||
<el-tag size="mini" type="danger" v-if="scope.row.mode === 'EXIT'">退出</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程节点" prop="processInstanceNodeName"></el-table-column>
|
||||
<el-table-column label="操作" width="150px" fixed="right">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary"
|
||||
@click="onOpen(row.id)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button v-if="row.processInstanceStatus === 'RUNNING'" size="mini" type="danger"
|
||||
@click="cancelApply(row)">取消申请
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-dialog title="新增授权" :visible.sync="dialogFormVisible" width="600px" :close-on-click-modal="false">
|
||||
<el-form :model="formData" ref="form" size="small" label-width="80px">
|
||||
<el-form-item prop="roleCode" label="角色"
|
||||
:rules="[{required: true, message: '请选择角色', trigger: 'change'}]">
|
||||
<dict-select v-model="formData.roleCode" code="BRANCH_UNION_ROLES"></dict-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="userId" label="人员"
|
||||
:rules="[{required: true, message: '请选择人员', trigger: 'change'}]">
|
||||
<user-select
|
||||
style="width: 100%"
|
||||
v-model="formData.userId"
|
||||
api="/platform/branchUnionUser/authorization/apply/listUserSelect"
|
||||
:option_label_func="
|
||||
(item) => {
|
||||
return item.username + item.loginname + '(' + item.unitName + ')'
|
||||
}
|
||||
"
|
||||
></user-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="reason" label="申请理由"
|
||||
:rules="[{required: true, message: '请填写申请理由', trigger: 'blur'}]">
|
||||
<el-input type="textarea" v-model="formData.reason" rows="4" placeholder="请填写申请理由"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doSubmit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="查看详情" :visible.sync="dialogVisible" width="800px">
|
||||
<info ref="infoRef"></info>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('../info.js'){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"info": info
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
dialogFormVisible: false,
|
||||
formData: {
|
||||
roleCode: "",
|
||||
userId: ""
|
||||
},
|
||||
pageForm: {
|
||||
mode: "JOIN"
|
||||
},
|
||||
hasAuthUsers: [],
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openAdd() {
|
||||
this.dialogFormVisible = true
|
||||
this.formData = {
|
||||
roleCode: "",
|
||||
userId: ""
|
||||
}
|
||||
},
|
||||
// 取消授权
|
||||
cancelAuthorization(row) {
|
||||
this.$confirm("您确定要取消授权吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
$.post("/platform/branchUnionUser/authorization/apply/cancel", row).then((res) => {
|
||||
this.$message.success(res.msg)
|
||||
this.pageForm.mode = "EXIT"
|
||||
this.doSearch()
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 取消申请
|
||||
cancelApply(row) {
|
||||
this.$confirm("您确定要取消申请吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
$.post("/platform/branchUnionUser/authorization/apply/cancelApply", {
|
||||
id: row.id
|
||||
}).then((res) => {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onOpen(id) {
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.infoRef.onOpen(id)
|
||||
})
|
||||
},
|
||||
|
||||
// 提交
|
||||
doSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
$.post("/platform/branchUnionUser/authorization/apply/doApply", this.formData).then((res) => {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogFormVisible = false
|
||||
this.doSearch()
|
||||
})
|
||||
} else {
|
||||
this.$message.error("请填写完整信息")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
listAuthUsers() {
|
||||
this.$axios.get("/platform/branchUnionUser/authorization/apply/branchUnionUserPageData").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.hasAuthUsers = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.listAuthUsers()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="姓名">
|
||||
<el-input v-model="pageForm.searchKeyword" placeholder="请输入姓名" clearable></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
<el-select v-model="pageForm.unionId" placeholder="请选择所属工会" filterable clearable
|
||||
style="width: 100%">
|
||||
<el-option v-for="item in unionOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData">
|
||||
<el-table-column type="index" label="序号" width="50px" :index="indexMethod"></el-table-column>
|
||||
<el-table-column label="姓名" prop="userName"></el-table-column>
|
||||
<el-table-column label="工号" prop="loginName"></el-table-column>
|
||||
<el-table-column label="分工会" prop="unionName"></el-table-column>
|
||||
<el-table-column label="联系电话" prop="mobile"></el-table-column>
|
||||
<el-table-column label="授权角色" prop="roleName"></el-table-column>
|
||||
<el-table-column label="授权模式" prop="mode">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="mini" type="success" v-if="scope.row.mode === 'JOIN'">加入</el-tag>
|
||||
<el-tag size="mini" type="danger" v-if="scope.row.mode === 'EXIT'">退出</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程节点" prop="processInstanceNodeName"></el-table-column>
|
||||
<el-table-column label="操作" width="200px" fixed="right">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary"
|
||||
@click="onOpen(row.id)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button v-if="row.processInstanceTaskStatus==='ACTIVE'" @click="openApproval(row)" size="mini"
|
||||
type="primary">
|
||||
审核
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- v-if="row.processInstanceTaskStatus==='COMPLETE' && !row.nextTaskIsComplete"-->
|
||||
<!-- @click="openRevoke(row.processInstanceTaskId)"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="danger"-->
|
||||
<!-- >-->
|
||||
<!-- 撤回-->
|
||||
<!-- </el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="审核" :visible.sync="dialogVisible" width="800px">
|
||||
<info ref="infoRef"></info>
|
||||
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">{{formData.processInstanceNodeName}}</div>
|
||||
<el-form :model="formData" ref="approvalFormRef" label-position="left" label-width="80px">
|
||||
<el-form-item label="审核意见" prop="approvalOpinion"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.approvalOpinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button plain @click="dialogVisible=false">取消</el-button>
|
||||
<el-button type="danger" @click="doApproval('REJECT')">拒绝</el-button>
|
||||
<el-button type="primary" @click="doApproval('PASS')">同意</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('../info.js'){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"info": info
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
unionOptions: [],
|
||||
pageForm: {
|
||||
approval: false
|
||||
},
|
||||
dialogVisible: false,
|
||||
showApprovalForm: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(id) {
|
||||
this.dialogVisible = true
|
||||
this.showApprovalForm = false
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.infoRef.onOpen(id)
|
||||
})
|
||||
},
|
||||
openApproval(row) {
|
||||
this.dialogVisible = true
|
||||
this.showApprovalForm = true
|
||||
this.formData = row.approvalParam
|
||||
this.formData.approvalOpinion = '同意'
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.infoRef.onOpen(row.id)
|
||||
})
|
||||
},
|
||||
doApproval(approvalType) {
|
||||
this.formData.bpmTaskApprovalType = approvalType
|
||||
this.$refs.approvalFormRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$axios
|
||||
.post("/platform/branchUnionUser/authorization/approval/approval", {
|
||||
approval: JSON.stringify(this.formData)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.dialogVisible = false
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
openRevoke(taskId) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/branchUnionUser/authorization/approval/revoke", { taskId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,35 @@
|
||||
const info = {
|
||||
template: /*language=HTML*/ `
|
||||
<div class="">
|
||||
<div class="process-title">
|
||||
申请信息
|
||||
</div>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="姓名">{{ viewData.userName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">{{ viewData.loginName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ viewData.mobile }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属工会">{{ viewData.unionName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="授权模式" :span="2">
|
||||
<el-tag size="mini" type="success" v-if="viewData.mode === 'JOIN'">加入</el-tag>
|
||||
<el-tag size="mini" type="danger" v-if="viewData.mode === 'EXIT'">退出</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请理由" :span="2">{{ viewData.reason }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
viewData: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(id) {
|
||||
this.$axios.post("/platform/branchUnionUser/authorization/common/info", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
const MSG_FORM_TEMPLATE = {
|
||||
template: `
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" label-width="120px">
|
||||
<el-form-item prop="title" label="标题">
|
||||
@@ -20,6 +20,13 @@ const MSG_FORM_TEMPLATE = {
|
||||
<el-radio border label="user">用户消息</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="cron" label="定时发送">
|
||||
<el-input placeholder="Cron表达式,为空则立即发送" v-model="formData.cron">
|
||||
<template slot="append">
|
||||
<a href="${base}/platform/sys/task/cron" style="color: #409eff" target="_blank">表达式生成器</a>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户列表" v-if="'user'==formData.type">
|
||||
<el-row class="mb10">
|
||||
<el-button icon="el-icon-search" @click="openSelect" size="small">选择用户</el-button>
|
||||
@@ -169,16 +176,16 @@ const MSG_FORM_TEMPLATE = {
|
||||
return false
|
||||
}
|
||||
|
||||
if(loginNames.length > 100){
|
||||
if (loginNames.length > 100) {
|
||||
this.$message.warning("单条消息最多发送100人,请分批次发送。")
|
||||
return false
|
||||
}
|
||||
|
||||
this.$confirm('您确定要发送吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(()=>{
|
||||
this.$confirm("您确定要发送吗, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios
|
||||
.post("/platform/sys/msg/addDo", {
|
||||
msg: JSON.stringify(this.formData),
|
||||
@@ -226,7 +233,7 @@ const MSG_FORM_TEMPLATE = {
|
||||
},
|
||||
clearSelect() {
|
||||
this.userTableData = []
|
||||
if(this.$refs.tableRef){
|
||||
if (this.$refs.tableRef) {
|
||||
this.$refs.tableRef.clearSelection()
|
||||
}
|
||||
},
|
||||
@@ -242,13 +249,13 @@ const MSG_FORM_TEMPLATE = {
|
||||
const self = this
|
||||
console.log(this.selectUsers)
|
||||
console.log(this.userTableData)
|
||||
const tableLoginNames = this.userTableData.map(v=>v.loginname)
|
||||
const tableLoginNames = this.userTableData.map((v) => v.loginname)
|
||||
this.selectUsers.forEach(function (o) {
|
||||
if(!tableLoginNames.includes(o.loginname)){
|
||||
if (!tableLoginNames.includes(o.loginname)) {
|
||||
self.userTableData.push(o)
|
||||
}
|
||||
})
|
||||
if(this.$refs.tableRef){
|
||||
if (this.$refs.tableRef) {
|
||||
this.$refs.tableRef.clearSelection()
|
||||
}
|
||||
this.selectDialogVisible = false
|
||||
|
||||
@@ -97,7 +97,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<template #view>
|
||||
<el-descriptions class="margin-top" title="" :column="3" border>
|
||||
<el-descriptions-item span="2">
|
||||
<el-descriptions-item :span="2">
|
||||
<template slot="label">协会名称</template>
|
||||
<div v-html="viewData.clubName"></div>
|
||||
</el-descriptions-item>
|
||||
@@ -125,11 +125,11 @@ layout("/layouts/platform.html"){
|
||||
<template slot="label">当前人数</template>
|
||||
{{viewData.currentPeopleNum}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="3">
|
||||
<el-descriptions-item :span="3">
|
||||
<template slot="label">协会介绍</template>
|
||||
<div class="text-left" v-html="viewData.introduce"></div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="3">
|
||||
<el-descriptions-item :span="3">
|
||||
<template slot="label">协会宗旨</template>
|
||||
<div class="text-left" v-html="viewData.purpose"></div>
|
||||
</el-descriptions-item>
|
||||
@@ -149,11 +149,11 @@ layout("/layouts/platform.html"){
|
||||
:view="true"
|
||||
></file-upload>
|
||||
</el-descriptions-item>-->
|
||||
<el-descriptions-item span="1.5">
|
||||
<el-descriptions-item :span="3">
|
||||
<template slot="label">协会章程</template>
|
||||
<file-preview :files="viewData.rulesFile" complete_result></file-preview>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="2">
|
||||
<el-descriptions-item :span="3">
|
||||
<template slot="label">年度活动计划</template>
|
||||
<file-preview :files="viewData.yearPlanFile" complete_result></file-preview>
|
||||
</el-descriptions-item>
|
||||
|
||||
@@ -1,40 +1,45 @@
|
||||
const CLUB_INFO_MANAGE_TEMPLATE = {
|
||||
template: `
|
||||
<div>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="姓名/工号:">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
<search-item label="人员类型:">
|
||||
<dict-select code="PERSON_TYPE" placeholder="请选择人员类型" clearable v-model="pageForm.personType"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="在职状态:">
|
||||
<dict-select clearable code="USER_STATE" placeholder="请选择人员状态" v-model="pageForm.userState"></dict-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="会员信息">
|
||||
<el-button size="small" type="primary" icon="el-icon-download" @click="exportRegistrationDoc">导出登记表</el-button>
|
||||
<el-button @click="openImport" size="small" type="primary">导入成员</el-button>
|
||||
<el-button size="small" type="primary" @click="openUserAdd(true)">录入成员</el-button>
|
||||
<el-button size="small" type="primary" @click="openUserAdd(false)">设置理事机构</el-button>
|
||||
<el-radio-group @change="doSearch" style="margin-left: 10px" v-model="pageForm.radioType" size="small">
|
||||
<el-radio-button label="3">全部</el-radio-button>
|
||||
<el-radio-button label="2">协会成员</el-radio-button>
|
||||
<el-radio-button label="1">理事机构</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" row-key="id" @sort-change='pageOrder'>
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="70"></el-table-column>
|
||||
<el-table-column label="工号" prop="loginName" show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column label="姓名" prop="userName" show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column label="性别" prop="sex" show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column label="电话" prop="mobile" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="所属单位" prop="unitName" sortable show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="身份" prop="roleName" show-overflow-tooltip></el-table-column>
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="姓名/工号:">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
<search-item label="人员类型:">
|
||||
<dict-select code="PERSON_TYPE" placeholder="请选择人员类型" clearable
|
||||
v-model="pageForm.personType"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="在职状态:">
|
||||
<dict-select clearable code="USER_STATE" placeholder="请选择人员状态"
|
||||
v-model="pageForm.userState"></dict-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="会员信息">
|
||||
<el-button size="small" type="primary" icon="el-icon-download" @click="exportRegistrationDoc">
|
||||
导出登记表
|
||||
</el-button>
|
||||
<el-button @click="openImport" size="small" type="primary">导入成员</el-button>
|
||||
<el-button size="small" type="primary" @click="openUserAdd(true)">录入成员</el-button>
|
||||
<el-button size="small" type="primary" @click="openUserAdd(false)">设置理事机构</el-button>
|
||||
<el-radio-group @change="doSearch" style="margin-left: 10px" v-model="pageForm.radioType"
|
||||
size="small">
|
||||
<el-radio-button label="3">全部</el-radio-button>
|
||||
<el-radio-button label="2">协会成员</el-radio-button>
|
||||
<el-radio-button label="1">理事机构</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" row-key="id" @sort-change='pageOrder'>
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="70"></el-table-column>
|
||||
<el-table-column label="工号" prop="loginName" show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column label="姓名" prop="userName" show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column label="性别" prop="sex" show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column label="电话" prop="mobile" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="所属单位" prop="unitName" sortable show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="身份" prop="roleNames" show-overflow-tooltip></el-table-column>
|
||||
<!-- <el-table-column label="变更状态" prop="state"show-overflow-tooltip sortable>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.state==1">待校工会审核</span>
|
||||
@@ -52,117 +57,156 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
|
||||
<el-tag v-if="scope.row.status==5" size="mini" type="success">审核通过</el-tag>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="{row}">
|
||||
<el-dropdown>
|
||||
<el-button size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<!-- <el-dropdown-item @click.native="updatePayed(row)" class="text-primary">-->
|
||||
<!-- {{row.payed === true ? '设置为未缴费' : '设置为缴费'}}-->
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="{row}">
|
||||
<el-dropdown>
|
||||
<el-button size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="openAuth(row)">授权</el-dropdown-item>
|
||||
|
||||
<!-- <el-dropdown-item @click.native="updatePayed(row)" class="text-primary">-->
|
||||
<!-- {{row.payed === true ? '设置为未缴费' : '设置为缴费'}}-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item @click.native="updateGive(row)" class="text-primary">-->
|
||||
<!-- {{row.giveMoney === true ? '设置为不拨付' : '设置为拨付'}}-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!--v-if="row.changeRoleCode === '' || row.changeRoleCode === undefined || row.state !== 1"-->
|
||||
<!-- <template>-->
|
||||
<!-- <el-dropdown-item v-if="row.roleCode !== 'CLUB_PRESIDENT'"-->
|
||||
<!-- @click.native="updateRoleCode(row, 'CLUB_PRESIDENT', '会长')"-->
|
||||
<!-- class="text-primary">-->
|
||||
<!-- 设置会长-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item @click.native="updateGive(row)" class="text-primary">-->
|
||||
<!-- {{row.giveMoney === true ? '设置为不拨付' : '设置为拨付'}}-->
|
||||
<!-- <el-dropdown-item v-if="row.roleCode !== 'CLUB_VICE_PRESIDENT'"-->
|
||||
<!-- @click.native="updateRoleCode(row, 'CLUB_VICE_PRESIDENT', '副会长')"-->
|
||||
<!-- class="text-primary">-->
|
||||
<!-- 设置副会长-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!--v-if="row.changeRoleCode === '' || row.changeRoleCode === undefined || row.state !== 1"-->
|
||||
<template>
|
||||
<el-dropdown-item v-if="row.roleCode !== 'CLUB_PRESIDENT'" @click.native="updateRoleCode(row, 'CLUB_PRESIDENT', '会长')" class="text-primary">
|
||||
设置会长
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="row.roleCode !== 'CLUB_VICE_PRESIDENT'" @click.native="updateRoleCode(row, 'CLUB_VICE_PRESIDENT', '副会长')" class="text-primary">
|
||||
设置副会长
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="row.roleCode !== 'CLUB_SECRETARY'" @click.native="updateRoleCode(row, 'CLUB_SECRETARY', '秘书长')" class="text-primary">
|
||||
设置秘书长
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="row.roleCode !== 'CLUB_VICE_SECRETARY'" @click.native="updateRoleCode(row, 'CLUB_VICE_SECRETARY', '副秘书长')" class="text-primary">
|
||||
设置副秘书长
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="row.roleCode !== 'CLUB_OPERATOR'" @click.native="updateRoleCode(row, 'CLUB_OPERATOR', '操作员')" class="text-primary">
|
||||
设置操作员
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="row.roleCode !== 'CLUB_MEMBER'" @click.native="updateRoleCode(row, 'CLUB_MEMBER', '会员')" class="text-primary">
|
||||
设置会员
|
||||
</el-dropdown-item>
|
||||
</template>
|
||||
<!-- <template v-else>
|
||||
<el-dropdown-item @click.native="rollbackChange(row)" class="text-primary">
|
||||
撤回变更
|
||||
</el-dropdown-item>
|
||||
</template>-->
|
||||
<!--<el-dropdown-item @click.native="viewInfo(row)">查看注册信息</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportInfo(row)">导出登记表</el-dropdown-item>-->
|
||||
<el-dropdown-item @click.native="userDelete(row)">删除</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exitClub(row)">退会</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container" style="margin-top: 20px">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[5,10, 20, 30, 50, 200]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="pageForm.totalCount"
|
||||
></el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="addMember === true ? '录入成员' : '设置理事机构'"
|
||||
<!-- <el-dropdown-item v-if="row.roleCode !== 'CLUB_SECRETARY'"-->
|
||||
<!-- @click.native="updateRoleCode(row, 'CLUB_SECRETARY', '秘书长')"-->
|
||||
<!-- class="text-primary">-->
|
||||
<!-- 设置秘书长-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item v-if="row.roleCode !== 'CLUB_VICE_SECRETARY'"-->
|
||||
<!-- @click.native="updateRoleCode(row, 'CLUB_VICE_SECRETARY', '副秘书长')"-->
|
||||
<!-- class="text-primary">-->
|
||||
<!-- 设置副秘书长-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item v-if="row.roleCode !== 'CLUB_OPERATOR'"-->
|
||||
<!-- @click.native="updateRoleCode(row, 'CLUB_OPERATOR', '操作员')"-->
|
||||
<!-- class="text-primary">-->
|
||||
<!-- 设置操作员-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item v-if="row.roleCode !== 'CLUB_MEMBER'"-->
|
||||
<!-- @click.native="updateRoleCode(row, 'CLUB_MEMBER', '会员')"-->
|
||||
<!-- class="text-primary">-->
|
||||
<!-- 设置会员-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- </template>-->
|
||||
<!-- <template v-else>
|
||||
<el-dropdown-item @click.native="rollbackChange(row)" class="text-primary">
|
||||
撤回变更
|
||||
</el-dropdown-item>
|
||||
</template>-->
|
||||
<!--<el-dropdown-item @click.native="viewInfo(row)">查看注册信息</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportInfo(row)">导出登记表</el-dropdown-item>-->
|
||||
<el-dropdown-item @click.native="userDelete(row)">删除</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exitClub(row)">退会</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container" style="margin-top: 20px">
|
||||
<el-pagination
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[5,10, 20, 30, 50, 200]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="pageForm.totalCount"
|
||||
></el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="addMember === true ? '录入成员' : '设置理事机构'"
|
||||
:visible.sync="addDialogVisible" :close-on-click-modal="false" width="40%">
|
||||
<el-form :model="formData" ref="userForm" :rules="userFormRules" label-width="80px">
|
||||
<el-form-item label="成员" prop="users">
|
||||
<el-select v-model="formData.users" style="width: 100%" multiple filterable
|
||||
remote reserve-keyword :remote-method="selectUser">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.userName + item.loginName + '(' + item.unitName + ')'"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否缴费" prop="payed" size="medium">
|
||||
<el-radio :label="true" border v-model="formData.payed">已缴费</el-radio>
|
||||
<el-radio :label="false" border v-model="formData.payed">未缴费</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="身份" prop="roleCode">
|
||||
<el-radio-group v-model="formData.roleCode" size="medium">
|
||||
<el-radio v-if="!addMember" border label="CLUB_PRESIDENT">会长</el-radio>
|
||||
<el-radio v-if="!addMember" border label="CLUB_VICE_PRESIDENT">副会长</el-radio>
|
||||
<el-radio v-if="!addMember" border label="CLUB_SECRETARY">秘书长</el-radio>
|
||||
<el-radio v-if="!addMember" border label="CLUB_VICE_SECRETARY">副秘书长</el-radio>
|
||||
<el-radio v-if="addMember" border label="CLUB_MEMBER">会员</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-form :model="formData" ref="userForm" :rules="userFormRules" label-width="80px">
|
||||
<el-form-item label="成员" prop="users">
|
||||
<el-select v-model="formData.users" style="width: 100%" multiple filterable
|
||||
remote reserve-keyword :remote-method="selectUser">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.userName + item.loginName + '(' + item.unitName + ')'"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否缴费" prop="payed" size="medium">
|
||||
<el-radio :label="true" border v-model="formData.payed">已缴费</el-radio>
|
||||
<el-radio :label="false" border v-model="formData.payed">未缴费</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="身份" prop="roleCode">
|
||||
<el-radio-group v-model="formData.roleCode" size="medium">
|
||||
<el-radio v-if="!addMember" border label="CLUB_PRESIDENT">会长</el-radio>
|
||||
<el-radio v-if="!addMember" border label="CLUB_VICE_PRESIDENT">副会长</el-radio>
|
||||
<el-radio v-if="!addMember" border label="CLUB_SECRETARY">秘书长</el-radio>
|
||||
<el-radio v-if="!addMember" border label="CLUB_VICE_SECRETARY">副秘书长</el-radio>
|
||||
<el-radio v-if="addMember" border label="CLUB_MEMBER">会员</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="userDoAdd">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="importDialog"
|
||||
title="导入成员"
|
||||
width="50%"
|
||||
>
|
||||
<file-import ref="viewImport" temp_url="/platform/club/infoManage/manage/downloadUserImport"
|
||||
post_url="/platform/club/infoManage/manage/doImportUser" is_show_radio
|
||||
@flush="successImport" :business_id="parentNode.currentTreeData.id"
|
||||
></file-import>
|
||||
</el-dialog>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="importDialog"
|
||||
title="导入成员"
|
||||
width="50%"
|
||||
>
|
||||
<file-import ref="viewImport" temp_url="/platform/club/infoManage/manage/downloadUserImport"
|
||||
post_url="/platform/club/infoManage/manage/doImportUser" is_show_radio
|
||||
@flush="successImport" :business_id="parentNode.currentTreeData.id"
|
||||
></file-import>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="授权身份" :visible.sync="authDialogVisible" width="50%">
|
||||
<el-form :model="authFormData" ref="authForm" label-width="80px">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="authFormData.userName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="工号">
|
||||
<el-input v-model="authFormData.loginName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="身份" prop="roleCode"
|
||||
:rules="[{required: true, message: '请选择身份', trigger: 'blur'}]">
|
||||
<el-checkbox-group v-model="authFormData.roleCode">
|
||||
<el-checkbox label="CLUB_PRESIDENT">协会会长</el-checkbox>
|
||||
<el-checkbox label="CLUB_VICE_PRESIDENT">协会副会长</el-checkbox>
|
||||
<el-checkbox label="CLUB_SECRETARY">协会秘书长</el-checkbox>
|
||||
<el-checkbox label="CLUB_VICE_SECRETARY">协会副秘书长</el-checkbox>
|
||||
<el-checkbox label="CLUB_OPERATOR">协会操作员</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="authDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="authConfirm">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
props: {
|
||||
parentNode: {
|
||||
@@ -183,7 +227,14 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
|
||||
formData: {
|
||||
users: []
|
||||
},
|
||||
importDialog: false
|
||||
importDialog: false,
|
||||
|
||||
/*=======================协会授权==========================*/
|
||||
authDialogVisible: false,
|
||||
authRoleChecked: [],
|
||||
authFormData: {
|
||||
authRoleChecked: []
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
@@ -191,6 +242,46 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
|
||||
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime())
|
||||
},
|
||||
methods: {
|
||||
// 打开授权弹框
|
||||
openAuth(row) {
|
||||
this.authDialogVisible = true
|
||||
this.authFormData = {
|
||||
userId: row.userId,
|
||||
userName: row.userName,
|
||||
loginName: row.loginName,
|
||||
clubId: row.clubId,
|
||||
roleCode: row.roleCode ? JSON.parse(row.roleCode) : []
|
||||
}
|
||||
console.log(this.authFormData)
|
||||
},
|
||||
|
||||
// 授权确认提交
|
||||
authConfirm() {
|
||||
this.$refs.authForm.validate().then(async (valid) => {
|
||||
if (!valid) return
|
||||
|
||||
this.$confirm("是否确定授权?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then((res) => {
|
||||
this.$axios
|
||||
.post("/platform/club/infoManage/manage/doAuthRole", {
|
||||
userId: this.authFormData.userId,
|
||||
clubId: this.authFormData.clubId,
|
||||
roleCode: JSON.stringify(this.authFormData.roleCode)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("授权成功")
|
||||
this.authDialogVisible = false
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
openImport() {
|
||||
this.importData = {
|
||||
isfg: 1,
|
||||
@@ -247,7 +338,10 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
|
||||
},
|
||||
async updatePayed(row) {
|
||||
const payed = !row.payed
|
||||
const resp = await this.$axios.post("/platform/club/infoManage/manage/updatePayed", { id: row.id, payed: payed })
|
||||
const resp = await this.$axios.post("/platform/club/infoManage/manage/updatePayed", {
|
||||
id: row.id,
|
||||
payed: payed
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
await this.pageData()
|
||||
|
||||
@@ -46,7 +46,6 @@ layout("/layouts/platform.html"){
|
||||
</el-row>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
<!--#include("../../register/apply/clubRegisterForm.js"){}#-->
|
||||
@@ -91,7 +90,9 @@ layout("/layouts/platform.html"){
|
||||
treeNodeClick(data, node) {
|
||||
this.currentTreeData = data
|
||||
this.currentTreeNode = node
|
||||
this.$refs.clubInfo.pageData()
|
||||
if (this.$refs.clubInfo) {
|
||||
this.$refs.clubInfo.pageData()
|
||||
}
|
||||
},
|
||||
getTreeData() {
|
||||
this.$axios.post("/platform/club/infoManage/manage/getClubTreeData").then((res) => {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,135 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="名称">
|
||||
<el-input placeholder="名称" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="数据列表">
|
||||
<el-button type="primary" size="small" icon="el-icon-plus" @click="onOpen">新增</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column label="名称" prop="name" sortable></el-table-column>
|
||||
<el-table-column label="模板内容" prop="template" width="400px"></el-table-column>
|
||||
<el-table-column label="定时任务" prop="cron" width="150px"></el-table-column>
|
||||
<el-table-column label="是否启用" prop="enabled" sortable width="150px">
|
||||
<template scope="{row}">
|
||||
<el-tag :type="row.enabled ? 'success' : 'danger'" size="mini">{{row.enabled ? '是' : '否'}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="onEdit(row)">修改</el-button>
|
||||
<el-button size="mini" type="danger" @click="onDelete(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
|
||||
<el-dialog :title="formData.id ? '编辑' : '新增'" :visible.sync="dialogVisible" :close-on-click-modal="false" width="60%">
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="模板内容" prop="template">
|
||||
<el-input v-model="formData.template" placeholder="模板内容" type="textarea" rows="5"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="定时任务" prop="cron">
|
||||
{{formData.cron}}
|
||||
<el-select v-model="formData.cron" placeholder="请选择定时任务或者输入cron表达式" allow-create filterable>
|
||||
<el-option label="早上8点" value="0 0 8 * * ?"></el-option>
|
||||
<el-option label="早上9点" value="0 0 9 * * ?"></el-option>
|
||||
<el-option label="早上10点" value="0 0 10 * * ?"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="enabled">
|
||||
<el-switch v-model="formData.enabled"></el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formRules: {
|
||||
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||
template: [{ required: true, message: "请输入模板内容", trigger: "blur" }],
|
||||
cron: [{ required: true, message: "请选择定时任务或者输入cron表达式", trigger: "blur" }],
|
||||
enabled: [{ required: true, message: "请选择是否启用", trigger: "blur" }]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen() {
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.formData = {}
|
||||
this.$refs.formRef.resetFields()
|
||||
})
|
||||
},
|
||||
onEdit(row) {
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.formData = { ...row }
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$axios.post("/platform/birthdayWishes/plan/" + (this.formData.id ? "update" : "insert"), this.formData).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogVisible = false
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onDelete(id) {
|
||||
this.$confirm("确定删除吗?", "提示", {
|
||||
type: "warning",
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/birthdayWishes/plan/delete", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -44,7 +44,7 @@ layout("/layouts/platform.html"){
|
||||
<table-tool title="荣誉列表">
|
||||
<el-button type="primary" size="small" @click="doExport">导出</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData">
|
||||
<el-table :data="tableData" :key="pageForm.toString()">
|
||||
<el-table-column label="序号" type="index" header-align="center" align="center" width="50"></el-table-column>
|
||||
<template v-if="pageForm.queryTypeCode=='HONOR_SINGLE'">
|
||||
<el-table-column prop="userName" label="姓名" header-align="center" align="center" sortable></el-table-column>
|
||||
@@ -53,24 +53,24 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column prop="unitName" label="所属单位" header-align="center" align="center" sortable></el-table-column>
|
||||
</template>
|
||||
<template v-if="pageForm.queryTypeCode=='HONOR_LIST'">
|
||||
<el-table-column prop="applyUnionName" label="申报分工会" header-align="center" align="center" sortable></el-table-column>
|
||||
<el-table-column
|
||||
prop="gameName"
|
||||
label="参加比赛名称"
|
||||
header-align="center"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
></el-table-column>
|
||||
<el-table-column prop="applyUnionName" label="分工会" header-align="center" align="center" sortable></el-table-column>
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="gameName"-->
|
||||
<!-- label="参加比赛名称"-->
|
||||
<!-- header-align="center"-->
|
||||
<!-- align="center"-->
|
||||
<!-- show-overflow-tooltip-->
|
||||
<!-- ></el-table-column>-->
|
||||
</template>
|
||||
<el-table-column prop="prizeName" label="奖项" header-align="center" align="center" sortable></el-table-column>
|
||||
<!--<el-table-column prop="prizeDesc" label="奖项说明" header-align="center" align="center"></el-table-column>-->
|
||||
<el-table-column prop="typeName" label="荣誉类型" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="levelName" label="级别" header-align="center" align="center" sortable></el-table-column>
|
||||
<el-table-column prop="grantUnit" label="授予单位" header-align="center" align="center" show-overflow-tooltip></el-table-column>
|
||||
<!-- <el-table-column prop="grantUnit" label="授予单位" header-align="center" align="center" show-overflow-tooltip></el-table-column>-->
|
||||
<el-table-column prop="grantDate" label="授予时间" header-align="center" align="center" sortable></el-table-column>
|
||||
<!--<el-table-column prop="archiveStatus" label="存档情况" header-align="center"
|
||||
align="center"></el-table-column>-->
|
||||
<el-table-column prop="awardMaterialsExcel" label="获奖材料" header-align="center" align="center"></el-table-column>
|
||||
<!-- <el-table-column prop="awardMaterialsExcel" label="获奖材料" header-align="center" align="center"></el-table-column>-->
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="100px">
|
||||
<template scope="{row}">
|
||||
@@ -287,20 +287,17 @@ layout("/layouts/platform.html"){
|
||||
const res = await this.$axios.post("/platform/honor/basic/settings/getData", { parentId: honorType })
|
||||
return res.data
|
||||
},
|
||||
getHonorType() {
|
||||
this.$axios.post("/platform/honor/basic/settings/getHonorType").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.honorTypeList = res.data
|
||||
console.log(this.honorTypeList)
|
||||
}
|
||||
})
|
||||
async getHonorType() {
|
||||
const res = await this.$axios.post("/platform/honor/basic/settings/getHonorType")
|
||||
if (res.code === 0) {
|
||||
this.honorTypeList = res.data
|
||||
}
|
||||
},
|
||||
getHonorLevel() {
|
||||
this.$axios.post("/platform/honor/basic/settings/getHonorLevel").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.honorLevelList = res.data
|
||||
}
|
||||
})
|
||||
async getHonorLevel() {
|
||||
const res = await this.$axios.post("/platform/honor/basic/settings/getHonorLevel")
|
||||
if (res.code === 0) {
|
||||
this.honorLevelList = res.data
|
||||
}
|
||||
},
|
||||
getHonorAwardType() {
|
||||
this.$axios.post("/platform/honor/basic/settings/getHonorAwardType").then((res) => {
|
||||
@@ -310,18 +307,17 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
},
|
||||
async initData() {
|
||||
this.getHonorType()
|
||||
this.getHonorLevel()
|
||||
this.getHonorAwardType()
|
||||
await this.getHonorType()
|
||||
await this.getHonorLevel()
|
||||
await this.getHonorAwardType()
|
||||
this.$businessTool.listUnit().then((data) => {
|
||||
this.units = data
|
||||
})
|
||||
if (this.honorTypeList && this.honorLevelList.length > 0) {
|
||||
this.formData = {
|
||||
honorType: this.honorTypeList[0].id,
|
||||
queryTypeCode: this.honorLevelList[0].queryTypeCode
|
||||
}
|
||||
if (this.honorTypeList && this.honorLevelList) {
|
||||
this.$set(this.pageForm, "honorType", this.honorTypeList[0].id)
|
||||
this.$set(this.pageForm, "queryTypeCode", this.honorTypeList[0].queryTypeCode)
|
||||
this.honorPrizeList = await this.getHonorPrize(this.formData.honorType)
|
||||
console.log(this.pageForm)
|
||||
}
|
||||
},
|
||||
async honorTypeChange(val) {
|
||||
|
||||
@@ -5,11 +5,11 @@ layout("/layouts/platform.html"){
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker placeholder="选择年度" type="year" style="width: 100%" v-model="pageForm.year" value-format="yyyy"></el-date-picker>
|
||||
</search-item>
|
||||
<!-- <search-item label="年度">-->
|
||||
<!-- <el-date-picker placeholder="选择年度" type="year" style="width: 100%" v-model="pageForm.year" value-format="yyyy"></el-date-picker>-->
|
||||
<!-- </search-item>-->
|
||||
<search-item label="活动">
|
||||
<el-select v-model="pageForm.activityId" placeholder="请选择活动">
|
||||
<el-select v-model="pageForm.actId" placeholder="请选择活动">
|
||||
<el-option v-for="item in actOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
@@ -196,11 +196,11 @@ const signForm = {
|
||||
},
|
||||
isInSignUpTimeRange() {
|
||||
if (!this.activityInfo.signUpStartTime || !this.activityInfo.signUpEndTime) return false
|
||||
|
||||
|
||||
const now = new Date().getTime()
|
||||
const signUpStartTime = new Date(this.activityInfo.signUpStartTime).getTime()
|
||||
const signUpEndTime = new Date(this.activityInfo.signUpEndTime).getTime()
|
||||
|
||||
|
||||
return now >= signUpStartTime && now <= signUpEndTime
|
||||
}
|
||||
},
|
||||
@@ -435,6 +435,8 @@ const signForm = {
|
||||
if (signedResponse.code === 0) {
|
||||
this.signedUsers = Array.isArray(signedResponse.data) ? signedResponse.data : []
|
||||
}
|
||||
this.visible = false
|
||||
this.$emit("refresh")
|
||||
} else {
|
||||
this.$message.error(msg || "报名失败")
|
||||
}
|
||||
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<div class="">
|
||||
<el-card shadow="never" class="form-box">
|
||||
<h3 style="color: var(--color-primary)" slot="header">送温暖慰问申请</h3>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0">
|
||||
<el-descriptions border class="descriptions-form">
|
||||
<el-descriptions-item label="申请事项" :span="3">
|
||||
<el-form-item prop="noticeId" label="申请事项">
|
||||
<el-select v-model="formData.noticeId" placeholder="请选择" filterable clearable>
|
||||
<el-option v-for="item in noticeOptions" :key="item.id" :label="item.title" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">
|
||||
<el-form-item prop="userName" label="姓名">
|
||||
<el-input :value="formData.userName" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">
|
||||
<el-form-item prop="loginName" label="工号">
|
||||
<el-input :value="formData.loginName" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">
|
||||
<el-form-item prop="sex" label="性别">
|
||||
<el-input :value="formData.sex" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="出生年月">
|
||||
<el-form-item prop="birthday" label="出生年月">
|
||||
<el-input :value="formData.birthday" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">
|
||||
<el-form-item prop="mobile" label="联系电话">
|
||||
<el-input v-model="formData.mobile" max="11"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="职务(职称)">
|
||||
<el-form-item prop="technicalTitle" label="职务(职称)">
|
||||
<el-input v-model="formData.technicalTitle" max="100" placeholder="请填写职务(职称)"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="单位">
|
||||
<el-form-item prop="unitName" label="单位">
|
||||
<el-input :value="formData.unitName" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="分工会" :span="2">
|
||||
<el-form-item prop="unionName" label="分工会">
|
||||
<el-input :value="formData.unionName" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请事由" :span="3">
|
||||
<el-form-item prop="applyReason" label="申请事由">
|
||||
<el-input
|
||||
maxlength="1000"
|
||||
v-model="formData.applyReason"
|
||||
placeholder="请填写申请事由"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4, maxRows: 8}"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请附件">
|
||||
<el-form-item label="附件" prop="files">
|
||||
<file-upload
|
||||
:value.sync="formData.files"
|
||||
:upload_number="5"
|
||||
upload_result_category="array"
|
||||
complete_result
|
||||
upload_mode="drag"
|
||||
></file-upload>
|
||||
<span>说明: 涉及会员患重病、大病且自费金额较大者须提供病史诊断复印件及医疗发票复印件。</span>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end" class="mt10">
|
||||
<el-button type="primary" plain @click="doSave">保存草稿</el-button>
|
||||
<el-button type="primary" @click="doSubmit">提交申请</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
id: GetQueryString("id"),
|
||||
typeOptions: [],
|
||||
formRules: {
|
||||
noticeId: [{ required: true, message: "请选择申请事项", trigger: ["blur", "change"] }],
|
||||
userName: [{ required: true, message: "请填写姓名", trigger: ["blur", "change"] }],
|
||||
loginName: [{ required: true, message: "请填写工号", trigger: ["blur", "change"] }],
|
||||
sex: [{ required: true, message: "请填写性别", trigger: ["blur", "change"] }],
|
||||
birthday: [{ required: true, message: "请填写出生年月", trigger: ["blur", "change"] }],
|
||||
mobile: [{ required: true, message: "请填写联系电话", trigger: ["blur", "change"] }],
|
||||
technicalTitle: [{ required: true, message: "请填写职务(职称)", trigger: ["blur", "change"] }],
|
||||
unitName: [{ required: true, message: "请填写单位", trigger: ["blur", "change"] }],
|
||||
unionName: [{ required: true, message: "请填写分工会", trigger: ["blur", "change"] }],
|
||||
applyReason: [{ required: true, message: "请填写申请事由", trigger: ["blur", "change"] }]
|
||||
},
|
||||
noticeOptions: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
if (this.id) {
|
||||
this.$axios.post("/platform/warmthCondolence/apply/info", { id: this.id }).then(async (res) => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const { username, loginname, sex, mobile, birthday, technicalTitle, id, unit, union } = this.$store.state.user
|
||||
this.$set(this.formData, "userName", username)
|
||||
this.$set(this.formData, "loginName", loginname)
|
||||
this.$set(this.formData, "sex", sex)
|
||||
this.$set(this.formData, "birthday", "${@auth.getPrincipalProperty('birthday'),'yyyy-MM-dd'}")
|
||||
this.$set(this.formData, "mobile", mobile)
|
||||
this.$set(this.formData, "technicalTitle", technicalTitle)
|
||||
this.$set(this.formData, "unitName", unit?.name)
|
||||
this.$set(this.formData, "unitId", unit?.id)
|
||||
this.$set(this.formData, "unionName", union?.name)
|
||||
this.$set(this.formData, "unionId", union?.id)
|
||||
this.$set(this.formData, "applyDateTime", this.$moment().format("YYYY-MM-DD"))
|
||||
}
|
||||
},
|
||||
|
||||
doSave() {
|
||||
this.$refs.formRef.validateField("noticeId", (errors) => {
|
||||
if (!errors) {
|
||||
this.$axios
|
||||
.post(loc() + "/save", {
|
||||
warmthCondolence: JSON.stringify(this.formData)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$axios
|
||||
.post(loc() + "/submit", {
|
||||
warmthCondolence: JSON.stringify(this.formData)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$store.dispatch("pjaxRoute", "/platform/warmthCondolence/mine")
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
listNotice() {
|
||||
this.$axios.post("/platform/warmthCondolence/common/listNotice").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.noticeOptions = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.init()
|
||||
this.listNotice()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+185
@@ -0,0 +1,185 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style></style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="事项:">
|
||||
<el-select v-model="pageForm.noticeId" placeholder="请选择" filterable clearable>
|
||||
<el-option v-for="item in noticeOptions" :key="item.id" :label="item.title" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="姓名:">
|
||||
<el-input placeholder="请输入姓名查询" clearable v-model="pageForm.userName"></el-input>
|
||||
</search-item>
|
||||
<search-item label="工号:">
|
||||
<el-input placeholder="请输入工号查询" clearable v-model="pageForm.loginName"></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会:">
|
||||
<el-select v-model="pageForm.unionId" placeholder="请选择所属工会" filterable clearable style="width: 100%">
|
||||
<el-option v-for="item in unionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位:">
|
||||
<el-select v-model="pageForm.unitId" placeholder="请选择所属单位" filterable clearable style="width: 100%">
|
||||
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder">
|
||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="no" label="编号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="loginName" label="工号"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column prop="mobile" label="手机号"></el-table-column>
|
||||
<el-table-column prop="unitName" label="单位" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="unionName" label="分工会" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="当前节点" prop="processInstanceNodeName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="操作" width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.processInstanceTaskStatus==='ACTIVE'" @click="openApproval(row)" size="mini" type="primary">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.processInstanceTaskStatus==='COMPLETE' && !row.nextTaskIsComplete"
|
||||
@click="openRevoke(row.processInstanceTaskId)"
|
||||
size="mini"
|
||||
type="danger"
|
||||
>
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
<template #public>
|
||||
<info ref="infoRef"></info>
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">{{formData.processInstanceNodeName}}</div>
|
||||
<el-form :model="formData" ref="approvalFormRef" label-position="left" label-width="80px">
|
||||
<el-form-item label="审核意见" prop="approvalOpinion" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.approvalOpinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子签名" prop="approvalSignature" :rules="[{required:false,message:'必填',trigger:['change','blur']}]">
|
||||
<pc-signature v-model="formData.approvalSignature"></pc-signature>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button plain @click="$refs.guava.index()">取消</el-button>
|
||||
<el-button type="danger" @click="doApproval('BACK')">退回重新申请</el-button>
|
||||
<el-button type="danger" @click="doApproval('REJECT')">拒绝申请</el-button>
|
||||
<el-button type="primary" @click="doApproval('PASS')">同意申请</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("../common/info.js"){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
info
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
approval: false,
|
||||
unionId: "",
|
||||
unitId: "",
|
||||
year: null,
|
||||
searchKeyword: "",
|
||||
type: ""
|
||||
},
|
||||
unionList: [],
|
||||
unitList: [],
|
||||
noticeOptions: [],
|
||||
showApprovalForm: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.public(() => {
|
||||
this.$refs.infoRef.onOpen(row.id)
|
||||
this.showApprovalForm = false
|
||||
})
|
||||
},
|
||||
openApproval(row) {
|
||||
this.$refs.guava.public(() => {
|
||||
this.$refs.infoRef.onOpen(row.id)
|
||||
this.formData = row.approvalParam
|
||||
this.showApprovalForm = true
|
||||
})
|
||||
},
|
||||
doApproval(approvalType) {
|
||||
this.formData.bpmTaskApprovalType = approvalType
|
||||
this.$refs.approvalFormRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$axios
|
||||
.post(loc() + "/approval", {
|
||||
approval: JSON.stringify(this.formData)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
openRevoke(taskId) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
this.$axios.post(loc() + "/revoke", { taskId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
listNotice() {
|
||||
this.$axios.post("/platform/warmthCondolence/common/listNotice").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.noticeOptions = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unitList = await this.$businessTool.listUnit()
|
||||
this.unionList = await this.$businessTool.listUnion()
|
||||
this.listNotice()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,109 @@
|
||||
const info = {
|
||||
template: `
|
||||
<div>
|
||||
<div>
|
||||
<div class="process-title">
|
||||
申请信息
|
||||
</div>
|
||||
<el-descriptions border>
|
||||
<el-descriptions-item label="申请事项" :span="3">
|
||||
{{viewData.noticeTitle}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">
|
||||
{{viewData.userName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">
|
||||
{{viewData.loginName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">
|
||||
{{viewData.sex}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="出生年月">
|
||||
{{viewData.birthday}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">
|
||||
{{viewData.mobile}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="职务(职称)">
|
||||
{{viewData.technicalTitle}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="单位">
|
||||
{{viewData.unitName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="分工会" :span="2">
|
||||
{{viewData.unionName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请事由" :span="3">
|
||||
{{viewData.applyReason}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请附件">
|
||||
<file-preview :files="viewData.files" complete_result></file-preview>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div v-for="nodeTask in viewData.nodeTasks" :key="nodeTask.id">
|
||||
<div class="process-title">
|
||||
{{nodeTask.nodeName}}
|
||||
</div>
|
||||
<div v-if="nodeTask.nodeCode === 20">
|
||||
<el-descriptions :column="3" border v-for="task in nodeTask.tasks" :key="task.id">
|
||||
<el-descriptions-item label="审核人">{{ task.actualOwnerLoginName + '-' + task.actualOwnerUserName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核时间">{{ task.endOn }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核结果">
|
||||
<div v-if="task.extVariable">
|
||||
<el-tag type="success" size="mini" v-if="task.extVariable.bpmTaskApprovalType === 'PASS'">同意</el-tag>
|
||||
<el-tag type="danger" size="mini" v-if="task.extVariable.bpmTaskApprovalType === 'BACK'">退回重新填写</el-tag>
|
||||
<el-tag type="danger" size="mini" v-if="task.extVariable.bpmTaskApprovalType === 'REJECT'">拒绝</el-tag>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核意见" :span="3">{{ task.extVariable.approvalOpinion}}</el-descriptions-item>
|
||||
<el-descriptions-item label="签字" :span="3">
|
||||
<el-image :src="task.extVariable.approvalSignature"
|
||||
v-if="task.extVariable && task.extVariable.approvalSignature"
|
||||
class="signature-image"></el-image>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div v-if="nodeTask.nodeCode === 50">
|
||||
<el-descriptions :column="3" border v-for="task in nodeTask.tasks" :key="task.id">
|
||||
<el-descriptions-item label="审核人">{{ task.actualOwnerLoginName + '-' + task.actualOwnerUserName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核时间">{{ task.endOn }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核结果">
|
||||
<div v-if="task.extVariable">
|
||||
<el-tag type="success" size="mini" v-if="task.extVariable.bpmTaskApprovalType === 'PASS'">同意</el-tag>
|
||||
<el-tag type="danger" size="mini" v-if="task.extVariable.bpmTaskApprovalType === 'BACK'">退回重新填写</el-tag>
|
||||
<el-tag type="danger" size="mini" v-if="task.extVariable.bpmTaskApprovalType === 'REJECT'">拒绝</el-tag>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核意见" :span="3">{{ task.extVariable.approvalOpinion}}</el-descriptions-item>
|
||||
<el-descriptions-item label="签字" :span="3">
|
||||
<el-image :src="task.extVariable.approvalSignature"
|
||||
v-if="task.extVariable && task.extVariable.approvalSignature"
|
||||
class="signature-image"></el-image>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
viewData: {},
|
||||
activeName: "first",
|
||||
isScrollNow: "0"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(id) {
|
||||
this.$axios.post("/platform/warmthCondolence/common/info", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
const taskRecord = {
|
||||
template: `
|
||||
<div>
|
||||
{{tasks}}
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
tasks: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(businessId) {
|
||||
this.$axios.post("/platform/bpm/common/listTask", { businessId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tasks = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="事项:">
|
||||
<el-select v-model="pageForm.noticeId" placeholder="请选择" filterable clearable>
|
||||
<el-option v-for="item in noticeOptions" :key="item.id" :label="item.title" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button v-if="$auth.hasPermission('warmthCondolence.query')" @click="exportExcel" size="small" type="primary" icon="el-icon-download">导出excel</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder">
|
||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="no" label="编号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="loginName" label="工号"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column prop="mobile" label="手机号"></el-table-column>
|
||||
<el-table-column prop="unitName" label="单位" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="unionName" label="分工会" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="当前节点" prop="processInstanceNodeName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="操作" width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row)">查看</el-button>
|
||||
<el-button
|
||||
v-if="[10,40,70].includes(row.processInstanceNodeCode)"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="$store.dispatch('pjaxRoute', '/platform/warmthCondolence/apply?id='+row.id)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="[20].includes(row.processInstanceNodeCode) && !row.nextTaskIsComplete"
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="openRevoke(row)"
|
||||
>
|
||||
撤销
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="exportApplyDocx(row.id)">导出</el-button>
|
||||
<el-button v-if="[10].includes(row.processInstanceNodeCode)" size="mini" type="danger" @click="doDelete(row)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<info ref="infoRef"></info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("../common/info.js"){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
info
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {},
|
||||
noticeOptions: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.infoRef.onOpen(row.id)
|
||||
})
|
||||
},
|
||||
openEdit(row) {
|
||||
this.$store.dispatch("pjaxRoute", "/platform/condolence/apply?id=" + row.id)
|
||||
},
|
||||
openRevoke(row) {
|
||||
this.$confirm("您确定要撤销申请吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/warmthCondolence/mine/revokeApply", { id: row.id }).then((resp) => {
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
})
|
||||
})
|
||||
},
|
||||
exportApplyDocx(id) {
|
||||
this.$downLoad("/platform/warmthCondolence/common/exportApplyDocx", { id })
|
||||
},
|
||||
exportExcel() {
|
||||
this.$downLoad("/platform/warmthCondolence/query/exportExcel", this.pageForm)
|
||||
},
|
||||
async doDelete(row) {
|
||||
const confirm = await this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await this.$axios.post("/platform/warmthCondolence/mine/delete", { id: row.id })
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
},
|
||||
listNotice() {
|
||||
this.$axios.post("/platform/warmthCondolence/common/listNotice").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.noticeOptions = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.listNotice()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度:">
|
||||
<el-date-picker placeholder="选择年度" type="year" style="width: 100%" v-model="pageForm.year" value-format="yyyy"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="标题:">
|
||||
<el-input placeholder="输入标题" v-model="pageForm.title" clearable></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button size="mini" type="primary" icon="el-icon-plus" @click="openAdd">新增</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData">
|
||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="title" label="标题"></el-table-column>
|
||||
<el-table-column prop="startTime" label="开始时间"></el-table-column>
|
||||
<el-table-column prop="endTime" label="结束时间"></el-table-column>
|
||||
<el-table-column prop="enable" label="是否开启">
|
||||
<template slot-scope="{row}">
|
||||
<i v-if="row.enable" class="fa fa-circle text-success"></i>
|
||||
<i v-else class="fa fa-circle text-danger"></i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200px" fixed="right">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openEdit(row)">编辑</el-button>
|
||||
<el-button size="mini" type="danger" @click="doDelete(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="formData.id?'编辑' : '新增'" :visible.sync="dialogVisible" width="50%">
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="formData.title"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="content">
|
||||
<text-editor v-model="formData.content"></text-editor>
|
||||
</el-form-item>
|
||||
<el-form-item label="年份" prop="year">
|
||||
<el-date-picker placeholder="选择年份" type="year" style="width: 100%" v-model="formData.year" value-format="yyyy"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker
|
||||
placeholder="选择开始时间"
|
||||
type="datetime"
|
||||
style="width: 100%"
|
||||
v-model="formData.startTime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker
|
||||
placeholder="选择结束时间"
|
||||
type="datetime"
|
||||
style="width: 100%"
|
||||
v-model="formData.endTime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否开启" prop="enable" size="small">
|
||||
<el-radio-group v-model="formData.enable">
|
||||
<el-radio border :label="true">是</el-radio>
|
||||
<el-radio border :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button plain @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doSubmit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
id: GetQueryString("id"),
|
||||
typeOptions: [],
|
||||
formRules: {
|
||||
title: [{ required: true, message: "请输入标题", trigger: ["blur", "change"] }],
|
||||
content: [{ required: true, message: "请输入内容", trigger: ["blur", "change"] }],
|
||||
year: [{ required: true, message: "请选择年份", trigger: ["blur", "change"] }],
|
||||
startTime: [{ required: true, message: "请选择开始时间", trigger: ["blur", "change"] }],
|
||||
endTime: [{ required: true, message: "请选择结束时间", trigger: ["blur", "change"] }],
|
||||
enable: [{ required: true, message: "请选择是否开启", trigger: ["blur", "change"] }]
|
||||
},
|
||||
dialogVisible: false,
|
||||
formData: {
|
||||
title: ""
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openAdd() {
|
||||
this.formData = {}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
openEdit(row) {
|
||||
this.formData = { ...row, year: row.year.toString() }
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
||||
doSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$axios
|
||||
.post("/platform/warmthCondolenceNotice/" + (this.formData.id ? "update" : "insert"), this.formData)
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.dialogVisible = false
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/warmthCondolenceNotice/delete", { id: id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+240
@@ -0,0 +1,240 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style></style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="事项:">
|
||||
<el-select v-model="pageForm.noticeId" placeholder="请选择" filterable clearable>
|
||||
<el-option v-for="item in noticeOptions" :key="item.id" :label="item.title" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="姓名:">
|
||||
<el-input placeholder="请输入姓名查询" clearable v-model="pageForm.userName"></el-input>
|
||||
</search-item>
|
||||
<search-item label="工号:">
|
||||
<el-input placeholder="请输入工号查询" clearable v-model="pageForm.loginName"></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会:">
|
||||
<el-select v-model="pageForm.unionId" placeholder="请选择所属工会" filterable clearable style="width: 100%">
|
||||
<el-option v-for="item in unionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位:">
|
||||
<el-select v-model="pageForm.unitId" placeholder="请选择所属单位" filterable clearable style="width: 100%">
|
||||
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button size="mini" type="primary" icon="" @click="openChart">查看图表分析</el-button>
|
||||
<!-- <el-button size="small" type="primary" icon="el-icon-plus" @click="openAdd">新增</el-button>-->
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder">
|
||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="no" label="编号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="loginName" label="工号"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column prop="mobile" label="手机号"></el-table-column>
|
||||
<el-table-column prop="unitName" label="单位" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="unionName" label="分工会" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="当前节点" prop="processInstanceNodeName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="补助金额(元)" prop="amount"></el-table-column>
|
||||
<el-table-column label="操作" width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row)">查看</el-button>
|
||||
<el-button v-if="$auth.hasPermission('warmthCondolence.query.delete')" size="mini" type="danger" @click="deleteDo(row)">
|
||||
删除
|
||||
</el-button>
|
||||
<!-- <el-button size="mini" type="primary" @click="exportApplyDocx(row.id)">导出</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
<template #view>
|
||||
<info ref="infoRef"></info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog title="图表数据" :visible.sync="chartVisible" width="60%">
|
||||
<div id="combo-chart" class="chart-container"></div>
|
||||
|
||||
<el-table :data="chartData">
|
||||
<el-table-column label="年度" prop="year"></el-table-column>
|
||||
<el-table-column label="人数" prop="user_count"></el-table-column>
|
||||
<el-table-column label="总金额(元)" prop="total_amount"></el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("../common/info.js"){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
info
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {},
|
||||
noticeOptions: [],
|
||||
unionList: [],
|
||||
unitList: [],
|
||||
typeList: [],
|
||||
chartVisible: false,
|
||||
chartData: [],
|
||||
comboChart: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.infoRef.onOpen(row.id)
|
||||
})
|
||||
},
|
||||
exportApplyDocx(id) {
|
||||
this.$downLoad("/platform/warmthCondolence/common/exportApplyDocx", { id })
|
||||
},
|
||||
listNotice() {
|
||||
this.$axios.post("/platform/warmthCondolence/common/listNotice").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.noticeOptions = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
async deleteDo(row) {
|
||||
const confirm = await this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await this.$axios.post("/platform/warmthCondolence/query/delete", { id: row.id })
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
},
|
||||
async openChart() {
|
||||
this.chartVisible = true
|
||||
await this.$nextTick()
|
||||
const { code, data, msg } = await this.$axios.post("/platform/warmthCondolence/query/chartData")
|
||||
if (code === 0) {
|
||||
this.chartData = data
|
||||
// 处理数据
|
||||
const processedData = data.map((item) => ({
|
||||
...item,
|
||||
year: item.year.toString(),
|
||||
total_amount_display: item.total_amount || 0,
|
||||
avg_amount: item.total_amount && item.user_count > 0 ? Math.round(item.total_amount / item.user_count) : 0
|
||||
}))
|
||||
|
||||
if (this.comboChart) this.comboChart.destroy()
|
||||
|
||||
// 组合图表
|
||||
this.comboChart = new G2Plot.DualAxes("combo-chart", {
|
||||
data: [processedData, processedData],
|
||||
xField: "year",
|
||||
yField: ["user_count", "total_amount_display"],
|
||||
geometryOptions: [
|
||||
{
|
||||
geometry: "column",
|
||||
color: "#3b82f6",
|
||||
columnWidthRatio: 0.6
|
||||
},
|
||||
{
|
||||
geometry: "line",
|
||||
color: "#f59e0b",
|
||||
lineStyle: {
|
||||
lineWidth: 3
|
||||
},
|
||||
point: {
|
||||
size: 6,
|
||||
shape: "circle",
|
||||
style: {
|
||||
fill: "#f59e0b",
|
||||
stroke: "#fff",
|
||||
lineWidth: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: {
|
||||
user_count: {
|
||||
title: {
|
||||
text: "用户数量",
|
||||
style: {
|
||||
fill: "#006db9",
|
||||
fontSize: 12
|
||||
}
|
||||
},
|
||||
label: {
|
||||
style: {
|
||||
fill: "#006db9"
|
||||
}
|
||||
}
|
||||
},
|
||||
total_amount_display: {
|
||||
title: {
|
||||
text: "总金额(元)",
|
||||
style: {
|
||||
fill: "#f59e0b",
|
||||
fontSize: 12
|
||||
}
|
||||
},
|
||||
label: {
|
||||
formatter: (value) => (value / 1000).toFixed(0) + "k",
|
||||
style: {
|
||||
fill: "#f59e0b"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemName: {
|
||||
formatter: (text, item) => {
|
||||
return text === "user_count" ? "用户数量" : "总金额"
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
formatter: (datum) => {
|
||||
const name = datum.user_count !== undefined ? "用户数量" : "总金额"
|
||||
const value =
|
||||
datum.user_count !== undefined
|
||||
? datum.user_count + "人"
|
||||
: datum.total_amount_display === 0
|
||||
? "无数据"
|
||||
: `¥` + datum.total_amount_display.toLocaleString()
|
||||
return { name, value }
|
||||
}
|
||||
}
|
||||
})
|
||||
this.comboChart.render()
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unitList = await this.$businessTool.listUnit()
|
||||
this.unionList = await this.$businessTool.listUnion()
|
||||
this.listNotice()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style></style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava" approval_scroll>
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="事项:">
|
||||
<el-select v-model="pageForm.noticeId" placeholder="请选择" filterable clearable>
|
||||
<el-option v-for="item in noticeOptions" :key="item.id" :label="item.title" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="姓名:">
|
||||
<el-input placeholder="请输入姓名查询" clearable v-model="pageForm.userName"></el-input>
|
||||
</search-item>
|
||||
<search-item label="工号:">
|
||||
<el-input placeholder="请输入工号查询" clearable v-model="pageForm.loginName"></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会:">
|
||||
<el-select v-model="pageForm.unionId" placeholder="请选择所属工会" filterable clearable style="width: 100%">
|
||||
<el-option v-for="item in unionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位:">
|
||||
<el-select v-model="pageForm.unitId" placeholder="请选择所属单位" filterable clearable style="width: 100%">
|
||||
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder">
|
||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="no" label="编号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="loginName" label="工号"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column prop="mobile" label="手机号"></el-table-column>
|
||||
<el-table-column prop="unitName" label="单位" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="unionName" label="分工会" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="当前节点" prop="processInstanceNodeName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="操作" width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.processInstanceTaskStatus==='ACTIVE'" @click="openApproval(row)" size="mini" type="primary">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.processInstanceTaskStatus==='COMPLETE' && !row.nextTaskIsComplete"
|
||||
@click="openRevoke(row.processInstanceTaskId)"
|
||||
size="mini"
|
||||
type="danger"
|
||||
>
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
<template #public>
|
||||
<info ref="infoRef"></info>
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">{{formData.processInstanceNodeName}}</div>
|
||||
<el-form :model="formData" ref="approvalFormRef" label-position="left" label-width="80px">
|
||||
<el-form-item label="审核意见" prop="approvalOpinion" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.approvalOpinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子签名" prop="approvalSignature" :rules="[{required:false,message:'必填',trigger:['change','blur']}]">
|
||||
<pc-signature v-model="formData.approvalSignature"></pc-signature>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button plain @click="$refs.guava.index()">取消</el-button>
|
||||
<el-button type="danger" @click="doApproval('BACK')">退回重新申请</el-button>
|
||||
<el-button type="danger" @click="doApproval('REJECT')">拒绝申请</el-button>
|
||||
<el-button type="primary" @click="doApproval('PASS')">同意申请</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("../common/info.js"){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
info
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
approval: false,
|
||||
unionId: "",
|
||||
unitId: "",
|
||||
year: null,
|
||||
searchKeyword: "",
|
||||
type: ""
|
||||
},
|
||||
showApprovalForm: false,
|
||||
unionList: [],
|
||||
unitList: [],
|
||||
noticeOptions: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.public(() => {
|
||||
this.$refs.infoRef.onOpen(row.id)
|
||||
this.showApprovalForm = false
|
||||
})
|
||||
},
|
||||
openApproval(row) {
|
||||
this.$refs.guava.public(() => {
|
||||
this.$refs.infoRef.onOpen(row.id)
|
||||
this.formData = row.approvalParam
|
||||
this.showApprovalForm = true
|
||||
})
|
||||
},
|
||||
doApproval(approvalType) {
|
||||
this.formData.bpmTaskApprovalType = approvalType
|
||||
this.$refs.approvalFormRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$axios
|
||||
.post(loc() + "/approval", {
|
||||
approval: JSON.stringify(this.formData)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
openRevoke(taskId) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
this.$axios.post(loc() + "/revoke", { taskId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
listNotice() {
|
||||
this.$axios.post("/platform/warmthCondolence/common/listNotice").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.noticeOptions = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unitList = await this.$businessTool.listUnit()
|
||||
this.unionList = await this.$businessTool.listUnion()
|
||||
this.listNotice()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -50,7 +50,7 @@ layout("/layouts/platform.html"){
|
||||
.stat-value {
|
||||
font-size: 32px;
|
||||
font-weight: bold;
|
||||
color: #217050;
|
||||
color: var(--color-primary);
|
||||
margin: 10px 0;
|
||||
line-height: 1.2;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
|
||||
.idx-rank {
|
||||
background: linear-gradient(135deg, #217050, #2d8a5f);
|
||||
background: var(--color-primary);
|
||||
color: white;
|
||||
}
|
||||
|
||||
@@ -243,8 +243,6 @@ layout("/layouts/platform.html"){
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.dashboard {
|
||||
grid-template-columns: 1fr; /* 单列布局 */
|
||||
@@ -284,7 +282,6 @@ layout("/layouts/platform.html"){
|
||||
min-height: 120px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
@@ -297,10 +294,10 @@ layout("/layouts/platform.html"){
|
||||
{{memberNumberData.memberNum}}
|
||||
<span style="font-size: 14px"> 人</span>
|
||||
</div>
|
||||
<!-- <div class="stat-meta" v-loading="loading.memberNumber">-->
|
||||
<!-- 年同比 {{memberNumberData.ratio}} -->
|
||||
<!-- <i :class="memberNumberData.diff >= 0 ? 'el-icon-top trend-up' : 'el-icon-bottom trend-down'"></i>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="stat-meta" v-loading="loading.memberNumber">-->
|
||||
<!-- 年同比 {{memberNumberData.ratio}} -->
|
||||
<!-- <i :class="memberNumberData.diff >= 0 ? 'el-icon-top trend-up' : 'el-icon-bottom trend-down'"></i>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
<div class="card stats-card">
|
||||
@@ -337,11 +334,11 @@ layout("/layouts/platform.html"){
|
||||
<div class="card content-right">
|
||||
<div class="card-title">工会会员明细</div>
|
||||
<el-table
|
||||
:data="unionMember"
|
||||
:header-cell-style="{background:'#FAFAFA'}"
|
||||
style="width: 100%; height: calc(100% - 40px)"
|
||||
row-key="id"
|
||||
v-loading="loading.unionMember"
|
||||
:data="unionMember"
|
||||
:header-cell-style="{background:'#FAFAFA'}"
|
||||
style="width: 100%; height: calc(100% - 40px)"
|
||||
row-key="id"
|
||||
v-loading="loading.unionMember"
|
||||
>
|
||||
<el-table-column label="序号" width="100px" align="center">
|
||||
<template scope="{$index}">
|
||||
@@ -353,13 +350,13 @@ layout("/layouts/platform.html"){
|
||||
<template scope="{row}">{{row.unionname}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="会员人数"
|
||||
prop="value"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
width="120px"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="会员人数"
|
||||
prop="value"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
width="120px"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
@@ -379,8 +376,8 @@ layout("/layouts/platform.html"){
|
||||
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
data(){
|
||||
return{
|
||||
data() {
|
||||
return {
|
||||
loading: {
|
||||
memberNumber: false,
|
||||
growthTrend: false,
|
||||
@@ -399,7 +396,6 @@ layout("/layouts/platform.html"){
|
||||
memberPercentage: "--",
|
||||
unionMember: []
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
@@ -446,13 +442,13 @@ layout("/layouts/platform.html"){
|
||||
smooth: true,
|
||||
|
||||
// 核心配色方案
|
||||
color: '#217050', // 主色线
|
||||
color: "#006db9", // 主色线
|
||||
areaStyle: {
|
||||
fill: 'l(270) 0:#e8f5eb 1:#217050', // 线性渐变填充
|
||||
fill: "l(270) 0:#e8f5eb 1:#006db9", // 线性渐变填充
|
||||
opacity: 0.8
|
||||
},
|
||||
line: {
|
||||
color: '#134330', // 深绿色线条
|
||||
color: "#006db9", // 深绿色线条
|
||||
size: 2
|
||||
},
|
||||
|
||||
@@ -460,8 +456,8 @@ layout("/layouts/platform.html"){
|
||||
point: {
|
||||
size: 3,
|
||||
style: {
|
||||
fill: '#fff',
|
||||
stroke: '#217050',
|
||||
fill: "#fff",
|
||||
stroke: "#006db9",
|
||||
lineWidth: 2
|
||||
}
|
||||
},
|
||||
@@ -508,12 +504,12 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
autoFit: true,
|
||||
percent: data,
|
||||
color: '#217050',
|
||||
color: "#006db9",
|
||||
statistic: {
|
||||
content: {
|
||||
style: {
|
||||
fontSize: 16,
|
||||
fill: '#fff', // 白色文字
|
||||
fill: "#fff" // 白色文字
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -545,21 +541,19 @@ layout("/layouts/platform.html"){
|
||||
colorField: "type",
|
||||
legend: false,
|
||||
label: {
|
||||
type: 'inner',
|
||||
offset: '-30%',
|
||||
type: "inner",
|
||||
offset: "-30%",
|
||||
style: {
|
||||
fontSize: 14,
|
||||
fontWeight: 'bold',
|
||||
fill: '#fff', // 白色文字
|
||||
textShadow: '0 1px 2px rgba(0,0,0,0.5)' // 增强可读性
|
||||
fontWeight: "bold",
|
||||
fill: "#fff", // 白色文字
|
||||
textShadow: "0 1px 2px rgba(0,0,0,0.5)" // 增强可读性
|
||||
},
|
||||
formatter: (datum) => (datum.percent * 100).toFixed(1)
|
||||
},
|
||||
// 交互效果
|
||||
interactions: [
|
||||
{ type: 'element-active' },
|
||||
],
|
||||
color: ['#217050', '#f0a35c']
|
||||
interactions: [{ type: "element-active" }],
|
||||
color: ["#006db9", "#f0a35c"]
|
||||
})
|
||||
chart.memberSexPercentageChart.render()
|
||||
} else {
|
||||
@@ -593,23 +587,23 @@ layout("/layouts/platform.html"){
|
||||
autoFit: true,
|
||||
xField: "unionname",
|
||||
yField: "value",
|
||||
color: '#217050', // 主色柱体
|
||||
color: "#006db9", // 主色柱体
|
||||
// 柱体样式
|
||||
columnStyle: {
|
||||
fill: '#217050',
|
||||
stroke: '#134330',
|
||||
fill: "#006db9",
|
||||
stroke: "#006db9",
|
||||
lineWidth: 1,
|
||||
shadowColor: 'rgba(33, 112, 80, 0.5)', // 主色阴影
|
||||
shadowColor: "rgba(0, 109, 185, 0.5)", // 主色阴影
|
||||
shadowBlur: 6,
|
||||
radius: [4, 4, 0, 0] // 顶部圆角
|
||||
},
|
||||
label: {
|
||||
position: "top",
|
||||
style: {
|
||||
fill: "#217050", // 白色文字
|
||||
fill: "#006db9", // 白色文字
|
||||
fontSize: 12,
|
||||
fontWeight: 'bold',
|
||||
textShadow: '0 1px 2px rgba(0,0,0,0.5)',
|
||||
fontWeight: "bold",
|
||||
textShadow: "0 1px 2px rgba(0,0,0,0.5)",
|
||||
opacity: 0.9
|
||||
},
|
||||
formatter: (datum) => datum.value // 显示原始值
|
||||
@@ -620,19 +614,19 @@ layout("/layouts/platform.html"){
|
||||
autoHide: true,
|
||||
autoRotate: false,
|
||||
style: {
|
||||
fill: '#666',
|
||||
fill: "#666",
|
||||
fontSize: 12
|
||||
}
|
||||
},
|
||||
line: {
|
||||
style: {
|
||||
stroke: '#e8f5eb' // 浅绿色轴线
|
||||
stroke: "#e8f5eb" // 浅绿色轴线
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
line: {
|
||||
style: {
|
||||
stroke: '#f0f0f0',
|
||||
stroke: "#f0f0f0",
|
||||
lineDash: [4, 2]
|
||||
}
|
||||
}
|
||||
@@ -642,14 +636,14 @@ layout("/layouts/platform.html"){
|
||||
yAxis: {
|
||||
label: {
|
||||
style: {
|
||||
fill: '#666'
|
||||
fill: "#666"
|
||||
},
|
||||
formatter: (val) => val
|
||||
},
|
||||
grid: {
|
||||
line: {
|
||||
style: {
|
||||
stroke: '#e8f5eb',
|
||||
stroke: "#e8f5eb",
|
||||
lineDash: [4, 2]
|
||||
}
|
||||
}
|
||||
@@ -693,13 +687,13 @@ layout("/layouts/platform.html"){
|
||||
xField: "label",
|
||||
yField: "value",
|
||||
// 核心配色方案
|
||||
color: '#217050', // 主色柱体
|
||||
color: "#006db9", // 主色柱体
|
||||
// 柱体样式
|
||||
columnStyle: {
|
||||
fill: '#217050',
|
||||
stroke: '#134330',
|
||||
fill: "#006db9",
|
||||
stroke: "#006db9",
|
||||
lineWidth: 1,
|
||||
shadowColor: 'rgba(33, 112, 80, 0.5)', // 主色阴影
|
||||
shadowColor: "rgba(0, 109, 185, 0.5)", // 主色阴影
|
||||
shadowBlur: 6,
|
||||
radius: [4, 4, 0, 0] // 顶部圆角
|
||||
},
|
||||
@@ -708,10 +702,10 @@ layout("/layouts/platform.html"){
|
||||
label: {
|
||||
position: "top",
|
||||
style: {
|
||||
fill: "#217050", // 白色文字
|
||||
fill: "#006db9", // 白色文字
|
||||
fontSize: 12,
|
||||
fontWeight: 'bold',
|
||||
textShadow: '0 1px 2px rgba(0,0,0,0.5)',
|
||||
fontWeight: "bold",
|
||||
textShadow: "0 1px 2px rgba(0,0,0,0.5)",
|
||||
opacity: 0.9
|
||||
},
|
||||
formatter: (datum) => datum.value // 显示原始值
|
||||
@@ -724,19 +718,19 @@ layout("/layouts/platform.html"){
|
||||
autoHide: true,
|
||||
autoRotate: false,
|
||||
style: {
|
||||
fill: '#666',
|
||||
fill: "#666",
|
||||
fontSize: 12
|
||||
}
|
||||
},
|
||||
line: {
|
||||
style: {
|
||||
stroke: '#e8f5eb' // 浅绿色轴线
|
||||
stroke: "#e8f5eb" // 浅绿色轴线
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
line: {
|
||||
style: {
|
||||
stroke: '#f0f0f0',
|
||||
stroke: "#f0f0f0",
|
||||
lineDash: [4, 2]
|
||||
}
|
||||
}
|
||||
@@ -747,14 +741,14 @@ layout("/layouts/platform.html"){
|
||||
yAxis: {
|
||||
label: {
|
||||
style: {
|
||||
fill: '#666'
|
||||
fill: "#666"
|
||||
},
|
||||
formatter: (val) => val
|
||||
},
|
||||
grid: {
|
||||
line: {
|
||||
style: {
|
||||
stroke: '#e8f5eb',
|
||||
stroke: "#e8f5eb",
|
||||
lineDash: [4, 2]
|
||||
}
|
||||
}
|
||||
@@ -798,13 +792,13 @@ layout("/layouts/platform.html"){
|
||||
xField: "label",
|
||||
yField: "value",
|
||||
// 核心配色方案
|
||||
color: '#217050', // 主色柱体
|
||||
color: "#006db9", // 主色柱体
|
||||
// 柱体样式
|
||||
columnStyle: {
|
||||
fill: '#217050',
|
||||
stroke: '#134330',
|
||||
fill: "#006db9",
|
||||
stroke: "#006db9",
|
||||
lineWidth: 1,
|
||||
shadowColor: 'rgba(33, 112, 80, 0.5)', // 主色阴影
|
||||
shadowColor: "rgba(0, 109, 185, 0.5)", // 主色阴影
|
||||
shadowBlur: 6,
|
||||
radius: [4, 4, 0, 0] // 顶部圆角
|
||||
},
|
||||
@@ -813,10 +807,10 @@ layout("/layouts/platform.html"){
|
||||
label: {
|
||||
position: "top",
|
||||
style: {
|
||||
fill: "#217050", // 白色文字
|
||||
fill: "#006db9", // 白色文字
|
||||
fontSize: 12,
|
||||
fontWeight: 'bold',
|
||||
textShadow: '0 1px 2px rgba(0,0,0,0.5)',
|
||||
fontWeight: "bold",
|
||||
textShadow: "0 1px 2px rgba(0,0,0,0.5)",
|
||||
opacity: 0.9
|
||||
},
|
||||
formatter: (datum) => datum.value // 显示原始值
|
||||
@@ -829,19 +823,19 @@ layout("/layouts/platform.html"){
|
||||
autoHide: true,
|
||||
autoRotate: false,
|
||||
style: {
|
||||
fill: '#666',
|
||||
fill: "#666",
|
||||
fontSize: 12
|
||||
}
|
||||
},
|
||||
line: {
|
||||
style: {
|
||||
stroke: '#e8f5eb' // 浅绿色轴线
|
||||
stroke: "#e8f5eb" // 浅绿色轴线
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
line: {
|
||||
style: {
|
||||
stroke: '#f0f0f0',
|
||||
stroke: "#f0f0f0",
|
||||
lineDash: [4, 2]
|
||||
}
|
||||
}
|
||||
@@ -852,14 +846,14 @@ layout("/layouts/platform.html"){
|
||||
yAxis: {
|
||||
label: {
|
||||
style: {
|
||||
fill: '#666'
|
||||
fill: "#666"
|
||||
},
|
||||
formatter: (val) => val
|
||||
},
|
||||
grid: {
|
||||
line: {
|
||||
style: {
|
||||
stroke: '#e8f5eb',
|
||||
stroke: "#e8f5eb",
|
||||
lineDash: [4, 2]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.budwk.app;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.zhgh.dayofficework.honor.models.Honor;
|
||||
import lombok.Data;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.nutz.boot.test.junit4.NbJUnit4Runner;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@RunWith(NbJUnit4Runner.class)
|
||||
public class HonorTest {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Test
|
||||
public void importData() {
|
||||
List<HonorImport> honors = ExcelImportUtil.importExcel(new File("C:\\Users\\jug\\Desktop\\njnu\\巾帼表彰.xlsx"), HonorImport.class, new ImportParams());
|
||||
System.out.println(honors.size());
|
||||
|
||||
List<Honor> list = honors.stream().map(v -> {
|
||||
Honor honor = new Honor();
|
||||
|
||||
if (v.getIdentity().equals("优秀工会干部")) {
|
||||
honor.setHonorType("8a8b455b964a41f2bbf18a4896cbd83e");
|
||||
honor.setPrize("68b9db0712bd43a88cccb557593e2072");
|
||||
}
|
||||
|
||||
if (v.getIdentity().equals("工会积极分子")) {
|
||||
honor.setHonorType("8a8b455b964a41f2bbf18a4896cbd83e");
|
||||
honor.setPrize("18e64fa01e0d446bb5f2be478c450aba");
|
||||
}
|
||||
|
||||
if (v.getIdentity().equals("工会先进集体")) {
|
||||
honor.setUnitName(v.getUnitName());
|
||||
honor.setHonorType("6b9e26a9467f49ae88fbd3951377e0f8");
|
||||
honor.setPrize("5b3a0f27b1034b8f998d47dcecd8f2a2");
|
||||
}
|
||||
|
||||
if(v.getIdentity().equals("巾帼文明岗")){
|
||||
honor.setUnitName(v.getUserName());
|
||||
honor.setUnionName(v.getUnitName());
|
||||
honor.setHonorType("6b9e26a9467f49ae88fbd3951377e0f8");
|
||||
honor.setPrize("c1fa5b363adc420c902fd5ab9f697cfa");
|
||||
}
|
||||
|
||||
if(v.getIdentity().equals("巾帼建功先进个人")){
|
||||
honor.setHonorType("8a8b455b964a41f2bbf18a4896cbd83e");
|
||||
honor.setPrize("6ee171a4650a4966b3626375d68202fa");
|
||||
}
|
||||
|
||||
|
||||
if (v.getIdentity().equals("优秀工会干部") || v.getIdentity().equals("工会积极分子") || v.getIdentity().equals("巾帼建功先进个人")) {
|
||||
View_user viewUser = dao.fetch(View_user.class, Cnd.where("username", "=", v.getUserName()));
|
||||
if (viewUser != null) {
|
||||
honor.setUserId(viewUser.getId());
|
||||
honor.setUserName(viewUser.getUsername());
|
||||
honor.setUserSex(viewUser.getSex());
|
||||
}else{
|
||||
honor.setUserName(v.getUserName());
|
||||
}
|
||||
honor.setUnitName(v.getUnitName());
|
||||
honor.setGrantDate(v.getTime());
|
||||
}
|
||||
return honor;
|
||||
}).toList();
|
||||
|
||||
dao.insert(list);
|
||||
|
||||
|
||||
// List<Honor> list = dao.query(Honor.class, Cnd.where(Honor::getHonorType, "=", "8a8b455b964a41f2bbf18a4896cbd83e"));
|
||||
//
|
||||
// for (Honor honor : list) {
|
||||
// View_user viewUser = dao.fetch(View_user.class, Cnd.where("username", "=", honor.getUserName()));
|
||||
// if (viewUser != null) {
|
||||
// honor.setLoginName(viewUser.getLoginname());
|
||||
// }
|
||||
// }
|
||||
// dao.update(list,"loginName");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
public static class HonorImport {
|
||||
@Excel(name = "姓名")
|
||||
private String userName;
|
||||
|
||||
@Excel(name = "单位")
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "身份")
|
||||
private String identity;
|
||||
|
||||
@Excel(name = "时间")
|
||||
private String time;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.budwk.app;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import com.budwk.app.sys.models.Sys_union;
|
||||
import com.budwk.app.sys.models.Sys_unit;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.zhgh.dayofficework.rest.models.RestActSignUp;
|
||||
import lombok.Data;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.nutz.boot.test.junit4.NbJUnit4Runner;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@IocBean
|
||||
@RunWith(NbJUnit4Runner.class)
|
||||
public class RestTest {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Test
|
||||
public void importData() {
|
||||
List<Rest> rests = ExcelImportUtil.importExcel(new File("C:\\Users\\jug\\Desktop\\njnu\\疗休养.xlsx"), Rest.class, new ImportParams());
|
||||
|
||||
List<Sys_unit> units = dao.query(Sys_unit.class, Cnd.where(Sys_unit::getUnitLevel, "=", 2));
|
||||
Map<String, Sys_unit> unitMap = units.stream().collect(Collectors.toMap(v -> v.getName(), v -> v));
|
||||
|
||||
List<Sys_union> unions = dao.query(Sys_union.class, Cnd.NEW());
|
||||
Map<String, Sys_union> unionMap = unions.stream().collect(Collectors.toMap(v -> v.getId(), v -> v));
|
||||
|
||||
|
||||
List<RestActSignUp> list = rests.stream().map(v -> {
|
||||
RestActSignUp sign = new RestActSignUp();
|
||||
sign.setRestActId(v.getRestActId());
|
||||
|
||||
View_user viewUser = dao.fetch(View_user.class, Cnd.where(View_user::getUsername, "=", v.getUserName()));
|
||||
if (viewUser != null) {
|
||||
sign.setUserId(viewUser.getId());
|
||||
sign.setUserName(viewUser.getUsername());
|
||||
sign.setLoginName(viewUser.getLoginname());
|
||||
// sign.setUnitId(viewUser.getUnitId());
|
||||
// sign.setUnitName(viewUser.getUnitName());
|
||||
// sign.setUnionId(viewUser.getUnionId());
|
||||
// sign.setUnionName(viewUser.getUnionName());
|
||||
|
||||
sign.setUnitName(viewUser.getUnitName());
|
||||
|
||||
Sys_unit sysUnit = unitMap.get(v.getUnitName());
|
||||
|
||||
if (sysUnit == null) {
|
||||
System.out.println(v.getUnitName());
|
||||
throw new RuntimeException("没有此单位");
|
||||
}
|
||||
|
||||
sign.setUnitId(sysUnit.getId());
|
||||
sign.setUnionId(sign.getUnionId());
|
||||
sign.setUnionName(unionMap.get(sysUnit.getUnionId()).getName());
|
||||
|
||||
} else {
|
||||
sign.setUserName(v.getUserName());
|
||||
}
|
||||
sign.setAge(v.getAge());
|
||||
sign.setBatch(v.getBatch());
|
||||
return sign;
|
||||
}).toList();
|
||||
|
||||
// String s = list.stream().filter(v -> v.getLoginName() == null).map(v -> v.getUserName()).collect(Collectors.joining(","));
|
||||
// System.out.println(s);
|
||||
|
||||
dao.insert(list);
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Rest {
|
||||
@Excel(name = "姓名")
|
||||
private String userName;
|
||||
|
||||
@Excel(name = "单位")
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "身份")
|
||||
private String identity;
|
||||
|
||||
@Excel(name = "时间")
|
||||
private String time;
|
||||
|
||||
@Excel(name = "活动ID")
|
||||
private String restActId;
|
||||
|
||||
@Excel(name = "批次")
|
||||
private String batch;
|
||||
|
||||
@Excel(name = "年龄")
|
||||
private Integer age;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package com.budwk.app;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolence;
|
||||
import lombok.Data;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.nutz.boot.test.junit4.NbJUnit4Runner;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@IocBean
|
||||
@RunWith(NbJUnit4Runner.class)
|
||||
public class WarmthCondolenceTest {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Test
|
||||
public void importData() {
|
||||
// List<Warmth> list = ExcelImportUtil.importExcel(new File("C:\\Users\\jug\\Desktop\\njnu\\送温暖.xlsx"), Warmth.class, new ImportParams());
|
||||
//
|
||||
// List<WarmthCondolence> list1 = list.stream().map(v -> {
|
||||
// WarmthCondolence condolence = new WarmthCondolence();
|
||||
// String userName = v.getUserName();
|
||||
// View_user viewUser = dao.fetch(View_user.class, Cnd.where(View_user::getUsername, "=", userName));
|
||||
// if (viewUser != null) {
|
||||
// condolence.setUserName(viewUser.getUsername());
|
||||
// condolence.setLoginName(viewUser.getLoginname());
|
||||
// condolence.setSex(viewUser.getSex());
|
||||
// condolence.setBirthday(viewUser.getBirthday());
|
||||
// condolence.setMobile(viewUser.getMobile());
|
||||
// condolence.setUnitName(viewUser.getUnitName());
|
||||
// condolence.setUnitId(viewUser.getUnitId());
|
||||
// condolence.setUnionName(viewUser.getUnionName());
|
||||
// condolence.setUnionId(viewUser.getUnionId());
|
||||
// }else{
|
||||
// condolence.setUserName(userName);
|
||||
// }
|
||||
// condolence.setAmount(v.getMoney());
|
||||
//
|
||||
// if(v.getYear().equals("2019")){
|
||||
// condolence.setNoticeId("1");
|
||||
// } else if (v.getYear().equals("2020")) {
|
||||
// condolence.setNoticeId("2");
|
||||
// }else if (v.getYear().equals("2021")) {
|
||||
// condolence.setNoticeId("3");
|
||||
// }else if (v.getYear().equals("2022")) {
|
||||
// condolence.setNoticeId("4");
|
||||
// }else if (v.getYear().equals("2023")) {
|
||||
// condolence.setNoticeId("5");
|
||||
// }else if (v.getYear().equals("2024")) {
|
||||
// condolence.setNoticeId("6");
|
||||
// }
|
||||
//
|
||||
// return condolence;
|
||||
// }).toList();
|
||||
//
|
||||
// System.out.println(list1);
|
||||
// dao.insert(list1);
|
||||
|
||||
|
||||
List<WarmthCondolence> list = dao.query(WarmthCondolence.class, Cnd.NEW());
|
||||
Map<String, List<WarmthCondolence>> map = list.stream().collect(Collectors.groupingBy(WarmthCondolence::getNoticeId));
|
||||
|
||||
map.forEach((k, v) -> {
|
||||
if (k.equals("1")) {
|
||||
// 编号 格式为20190001开始
|
||||
int i = 1;
|
||||
for (WarmthCondolence v1 : v) {
|
||||
v1.setNo("2019" + String.format("%04d", i));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (k.equals("2")) {
|
||||
// 编号 20200001开始
|
||||
int i = 1;
|
||||
for (WarmthCondolence v1 : v) {
|
||||
v1.setNo("2020" + String.format("%04d", i));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (k.equals("3")) {
|
||||
// 编号 20210001开始
|
||||
int i = 1;
|
||||
for (WarmthCondolence v1 : v) {
|
||||
v1.setNo("2021" + String.format("%04d", i));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (k.equals("4")) {
|
||||
// 编号 20220001开始
|
||||
int i = 1;
|
||||
for (WarmthCondolence v1 : v) {
|
||||
v1.setNo("2022" + String.format("%04d", i));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (k.equals("5")) {
|
||||
// 编号 20230001开始
|
||||
int i = 1;
|
||||
for (WarmthCondolence v1 : v) {
|
||||
v1.setNo("2023" + String.format("%04d", i));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (k.equals("6")) {
|
||||
// 编号 20240001开始
|
||||
int i = 1;
|
||||
for (WarmthCondolence v1 : v) {
|
||||
v1.setNo("2024" + String.format("%04d", i));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
dao.update(v,"no");
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Warmth {
|
||||
|
||||
@Excel(name = "姓名")
|
||||
private String userName;
|
||||
|
||||
@Excel(name = "单位")
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "补助金(元)")
|
||||
private BigDecimal money;
|
||||
|
||||
@Excel(name = "年度")
|
||||
private String year;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user