Compare commits
10
Commits
b80f7e0a77
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bc7eaccea | ||
|
|
5288cd3bff | ||
|
|
3426df168f | ||
|
|
d647ebd92b | ||
|
|
7e3bafafb9 | ||
|
|
54890729b0 | ||
|
|
f82fed5f82 | ||
|
|
c4338df18d | ||
|
|
ea61ad3061 | ||
|
|
2911ff415a |
+158
-43
@@ -1,13 +1,17 @@
|
|||||||
package io.v.nutz.activity.controller.basic;
|
package io.v.nutz.activity.controller.basic;
|
||||||
|
|
||||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||||
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.wizzer.framework.base.Result;
|
import cn.wizzer.framework.base.Result;
|
||||||
import io.v.nutz.activity.models.ActivityUserCnd;
|
import io.v.nutz.activity.models.ActivityUserCnd;
|
||||||
import io.v.nutz.activity.models.ActivityUserScope;
|
import io.v.nutz.activity.models.ActivityUserScope;
|
||||||
import io.v.nutz.activity.services.ActivityBasicScopeService;
|
import io.v.nutz.activity.services.ActivityBasicScopeService;
|
||||||
|
import io.v.nutz.activity.template.UserTemp;
|
||||||
import io.v.nutz.annontation.ViReturn;
|
import io.v.nutz.annontation.ViReturn;
|
||||||
import io.v.nutz.base.service.SimpleService;
|
import io.v.nutz.base.service.SimpleService;
|
||||||
import io.v.nutz.base.utils.Vi;
|
import io.v.nutz.base.utils.Vi;
|
||||||
@@ -19,27 +23,31 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
import org.nutz.dao.Dao;
|
import org.nutz.dao.Dao;
|
||||||
import org.nutz.dao.Sqls;
|
import org.nutz.dao.Sqls;
|
||||||
import org.nutz.dao.sql.Sql;
|
import org.nutz.dao.sql.Sql;
|
||||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||||
import org.nutz.dao.util.cri.Static;
|
import org.nutz.dao.util.cri.Static;
|
||||||
|
import org.nutz.integration.jedis.RedisService;
|
||||||
|
import org.nutz.ioc.aop.Aop;
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
import org.nutz.json.Json;
|
import org.nutz.json.Json;
|
||||||
import org.nutz.lang.Lang;
|
import org.nutz.lang.Lang;
|
||||||
import org.nutz.lang.util.NutMap;
|
import org.nutz.lang.util.NutMap;
|
||||||
import org.nutz.mvc.annotation.At;
|
import org.nutz.mvc.annotation.*;
|
||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.upload.TempFile;
|
||||||
import org.nutz.mvc.annotation.POST;
|
import org.nutz.mvc.upload.UploadAdaptor;
|
||||||
import org.nutz.mvc.annotation.Param;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,6 +63,8 @@ public class ActivityBasicScopeController {
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private SimpleService simpleService;
|
private SimpleService simpleService;
|
||||||
|
@Inject
|
||||||
|
private RedisService redisService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ActivityBasicScopeService activityBasicScopeService;
|
private ActivityBasicScopeService activityBasicScopeService;
|
||||||
@@ -97,6 +107,7 @@ public class ActivityBasicScopeController {
|
|||||||
@Param(value = "personTypes", required = false) String[] personTypes,
|
@Param(value = "personTypes", required = false) String[] personTypes,
|
||||||
@Param(value = "userStates", required = false) String[] userStates,
|
@Param(value = "userStates", required = false) String[] userStates,
|
||||||
@Param(value = "memberTypes", required = false) String[] memberTypes,
|
@Param(value = "memberTypes", required = false) String[] memberTypes,
|
||||||
|
@Param(value = "maritalTypes", required = false) String[] maritalTypes,
|
||||||
@Param(value = "sexTypes", required = false) String[] sexTypes,
|
@Param(value = "sexTypes", required = false) String[] sexTypes,
|
||||||
@Param(value = "age", required = false) String[] age,
|
@Param(value = "age", required = false) String[] age,
|
||||||
@Param(value = "teacherMeetingId", required = false) String teacherMeetingId,
|
@Param(value = "teacherMeetingId", required = false) String teacherMeetingId,
|
||||||
@@ -105,7 +116,8 @@ public class ActivityBasicScopeController {
|
|||||||
@Param(value = "clubId", required = false) String clubId,
|
@Param(value = "clubId", required = false) String clubId,
|
||||||
@Param(value = "reverseSelection") boolean reverseSelection,
|
@Param(value = "reverseSelection") boolean reverseSelection,
|
||||||
@Param(value = "activityGroupId", required = false) Integer activityGroupId,
|
@Param(value = "activityGroupId", required = false) Integer activityGroupId,
|
||||||
@Param(value = "activityUserCnd", required = false) String activityUserCndStr) {
|
@Param(value = "activityUserCnd", required = false) String activityUserCndStr,
|
||||||
|
@Param(value = "existsLoginNameRedisKey", required = false) String existsLoginNameRedisKey) {
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
DISTINCT(u.id) as id,
|
DISTINCT(u.id) as id,
|
||||||
@@ -118,16 +130,22 @@ public class ActivityBasicScopeController {
|
|||||||
u.userState,
|
u.userState,
|
||||||
u.unitname AS unitName,
|
u.unitname AS unitName,
|
||||||
u.unionname AS unionName,
|
u.unionname AS unionName,
|
||||||
TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age
|
TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age,
|
||||||
|
TIMESTAMPDIFF(YEAR, u.schoolTime, CURDATE()) AS teachNum,
|
||||||
|
su.maritalStatus
|
||||||
FROM
|
FROM
|
||||||
`user` u
|
`user` u
|
||||||
LEFT JOIN sys_user_role sur on sur.userid = u.id
|
LEFT JOIN sys_user_role sur on sur.userid = u.id
|
||||||
LEFT JOIN sys_club_user clubuser ON clubuser.userid=u.id
|
LEFT JOIN sys_club_user clubuser ON clubuser.userid=u.id
|
||||||
|
LEFT JOIN single_user su on su.userId = u.id
|
||||||
$condition
|
$condition
|
||||||
""");
|
""");
|
||||||
try {
|
try {
|
||||||
Cnd cnd = getCnd(pageForm, unionId, unitId, personTypes, userStates, memberTypes, sexTypes, age, teacherMeetingId, roleIds, userId, clubId, reverseSelection, activityGroupId, activityUserCndStr);
|
Cnd cnd = getCnd(pageForm, unionId, unitId, personTypes, userStates, memberTypes, maritalTypes, sexTypes, age, teacherMeetingId, roleIds, userId, clubId, reverseSelection, activityGroupId, activityUserCndStr);
|
||||||
|
if (StrUtil.isNotBlank(existsLoginNameRedisKey)) {
|
||||||
|
List<String> loginNames = redisService.lrange(existsLoginNameRedisKey, 0, -1);
|
||||||
|
cnd.andEX("u.loginname", "in", loginNames);
|
||||||
|
}
|
||||||
|
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
return simpleService.list(pageForm, sql);
|
return simpleService.list(pageForm, sql);
|
||||||
@@ -151,6 +169,7 @@ public class ActivityBasicScopeController {
|
|||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
@POST
|
@POST
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
@RequiresPermissions("activity.basic.scope")
|
@RequiresPermissions("activity.basic.scope")
|
||||||
public Object doSetActivityUser(PageForm pageForm,
|
public Object doSetActivityUser(PageForm pageForm,
|
||||||
@Param(value = "unionId", required = false) String unionId,
|
@Param(value = "unionId", required = false) String unionId,
|
||||||
@@ -158,6 +177,7 @@ public class ActivityBasicScopeController {
|
|||||||
@Param(value = "personTypes", required = false) String[] personTypes,
|
@Param(value = "personTypes", required = false) String[] personTypes,
|
||||||
@Param(value = "userStates", required = false) String[] userStates,
|
@Param(value = "userStates", required = false) String[] userStates,
|
||||||
@Param(value = "memberTypes", required = false) String[] memberTypes,
|
@Param(value = "memberTypes", required = false) String[] memberTypes,
|
||||||
|
@Param(value = "maritalTypes", required = false) String[] maritalTypes,
|
||||||
@Param(value = "sexTypes", required = false) String[] sexTypes,
|
@Param(value = "sexTypes", required = false) String[] sexTypes,
|
||||||
@Param(value = "age", required = false) String[] age,
|
@Param(value = "age", required = false) String[] age,
|
||||||
@Param(value = "activityGroupId", required = false) Integer activityGroupId,
|
@Param(value = "activityGroupId", required = false) Integer activityGroupId,
|
||||||
@@ -169,7 +189,8 @@ public class ActivityBasicScopeController {
|
|||||||
@Param(value = "userId", required = false) String[] userId,
|
@Param(value = "userId", required = false) String[] userId,
|
||||||
@Param(value = "clubId", required = false) String clubId,
|
@Param(value = "clubId", required = false) String clubId,
|
||||||
@Param(value = "reverseSelection") boolean reverseSelection,
|
@Param(value = "reverseSelection") boolean reverseSelection,
|
||||||
@Param(value = "activityUserCnd", required = false) String activityUserCndStr) {
|
@Param(value = "activityUserCnd", required = false) String activityUserCndStr,
|
||||||
|
@Param(value = "existsLoginNameRedisKey", required = false) String existsLoginNameRedisKey) {
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
( u.id ) AS userId
|
( u.id ) AS userId
|
||||||
@@ -177,10 +198,14 @@ public class ActivityBasicScopeController {
|
|||||||
`user` u
|
`user` u
|
||||||
LEFT JOIN sys_user_role sur ON sur.userid = u.id
|
LEFT JOIN sys_user_role sur ON sur.userid = u.id
|
||||||
LEFT JOIN sys_club_user clubuser ON clubuser.userid=u.id
|
LEFT JOIN sys_club_user clubuser ON clubuser.userid=u.id
|
||||||
|
LEFT JOIN single_user su on su.userId = u.id
|
||||||
$condition
|
$condition
|
||||||
""");
|
""");
|
||||||
Cnd cnd = getCnd(pageForm, unionId, unitId, personTypes, userStates, memberTypes, sexTypes, age, teacherMeetingId, roleIds, userId, clubId, reverseSelection, activityGroupId, activityUserCndStr);
|
Cnd cnd = getCnd(pageForm, unionId, unitId, personTypes, userStates, memberTypes, maritalTypes, sexTypes, age, teacherMeetingId, roleIds, userId, clubId, reverseSelection, activityGroupId, activityUserCndStr);
|
||||||
|
if (StrUtil.isNotBlank(existsLoginNameRedisKey)) {
|
||||||
|
List<String> loginNames = redisService.lrange(existsLoginNameRedisKey, 0, -1);
|
||||||
|
cnd.andEX("u.loginname", "in", loginNames);
|
||||||
|
}
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
sql.setCallback(Sqls.callback.entities());
|
sql.setCallback(Sqls.callback.entities());
|
||||||
sql.setEntity(dao.getEntity(ActivityUserScope.class));
|
sql.setEntity(dao.getEntity(ActivityUserScope.class));
|
||||||
@@ -235,11 +260,11 @@ public class ActivityBasicScopeController {
|
|||||||
$condition
|
$condition
|
||||||
""");
|
""");
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
// if (!ShiroUtil.hasAnyRoles("sysadmin,H06,H10")) {
|
if (!ShiroUtil.hasAnyRoles("sysadmin,H06,H10")) {
|
||||||
// if (ShiroUtil.hasAnyRoles(new String[]{"H04", "club01"})) {
|
if (ShiroUtil.hasAnyRoles(new String[]{"H04", "club01"})) {
|
||||||
// cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id"));
|
cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
cnd.and("groupId", "IS NOT", null);
|
cnd.and("groupId", "IS NOT", null);
|
||||||
cnd.and("groupName", "IS NOT", null);
|
cnd.and("groupName", "IS NOT", null);
|
||||||
cnd.groupBy("groupId");
|
cnd.groupBy("groupId");
|
||||||
@@ -257,8 +282,8 @@ public class ActivityBasicScopeController {
|
|||||||
@ViReturn
|
@ViReturn
|
||||||
// @RequiresPermissions("activity.basic.scope")
|
// @RequiresPermissions("activity.basic.scope")
|
||||||
public Object getScopeUser(String activityGroupId, @Param(value = "userId", required = false) String userId) {
|
public Object getScopeUser(String activityGroupId, @Param(value = "userId", required = false) String userId) {
|
||||||
String userid = StrUtil.isNotBlank(userId) ? userId : ShiroUtil.getUserId();
|
String userid = StrUtil.isNotBlank(userId) ? userId : io.v.nutz.util.ShiroUtil.getUserId();
|
||||||
return simpleService.dao().count(ActivityUserScope.class, Cnd.where("groupId", "=", activityGroupId).and("userId", "=", userid));
|
return simpleService.dao().count(ActivityUserScope.class, Cnd.where("groupId", "=", activityGroupId).and("userId", "=", io.v.nutz.util.ShiroUtil.getUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@@ -283,7 +308,7 @@ public class ActivityBasicScopeController {
|
|||||||
addv("is_A06", ShiroUtil.hasRole("A06"));
|
addv("is_A06", ShiroUtil.hasRole("A06"));
|
||||||
addv("is_H04", ShiroUtil.hasRole("H04"));
|
addv("is_H04", ShiroUtil.hasRole("H04"));
|
||||||
addv("is_H02", ShiroUtil.hasRole("club01"));
|
addv("is_H02", ShiroUtil.hasRole("club01"));
|
||||||
addv("is_H03", ShiroUtil.hasRole("SchoolUnionMemberAdmin"));
|
addv("is_H03", ShiroUtil.hasRole("H03"));
|
||||||
addv("is_sysadmin", ShiroUtil.hasRole("sysadmin"));
|
addv("is_sysadmin", ShiroUtil.hasRole("sysadmin"));
|
||||||
addv("unionid", Vi.getUnionId());
|
addv("unionid", Vi.getUnionId());
|
||||||
}};
|
}};
|
||||||
@@ -308,11 +333,10 @@ public class ActivityBasicScopeController {
|
|||||||
COLUMN_COMMENT
|
COLUMN_COMMENT
|
||||||
FROM INFORMATION_SCHEMA.COLUMNS
|
FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
WHERE TABLE_NAME = 'sys_user'
|
WHERE TABLE_NAME = 'sys_user'
|
||||||
AND TABLE_SCHEMA = 'zhgh_hmc'
|
AND TABLE_SCHEMA = 'zhgh_ctbu'
|
||||||
""");
|
""");
|
||||||
List<NutMap> sqlDataList = activityBasicScopeService.listMap(sql);
|
List<NutMap> sqlDataList = activityBasicScopeService.listMap(sql);
|
||||||
// sqlDataList.forEach(v -> v.put("DATA_TYPE", new String((byte[]) v.get("DATA_TYPE"))));
|
sqlDataList.forEach(v -> v.put("DATA_TYPE", new String((byte[]) v.get("DATA_TYPE"))));
|
||||||
sqlDataList.forEach(v -> v.put("DATA_TYPE", v.getString("DATA_TYPE")));
|
|
||||||
return sqlDataList;
|
return sqlDataList;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -323,6 +347,7 @@ public class ActivityBasicScopeController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
|
|
||||||
@RequiresPermissions("activity.basic.scope")
|
@RequiresPermissions("activity.basic.scope")
|
||||||
public void doExportUser(PageForm pageForm,
|
public void doExportUser(PageForm pageForm,
|
||||||
@Param(value = "props", required = false) String props,
|
@Param(value = "props", required = false) String props,
|
||||||
@@ -331,6 +356,7 @@ public class ActivityBasicScopeController {
|
|||||||
@Param(value = "personTypes", required = false) String[] personTypes,
|
@Param(value = "personTypes", required = false) String[] personTypes,
|
||||||
@Param(value = "userStates", required = false) String[] userStates,
|
@Param(value = "userStates", required = false) String[] userStates,
|
||||||
@Param(value = "memberTypes", required = false) String[] memberTypes,
|
@Param(value = "memberTypes", required = false) String[] memberTypes,
|
||||||
|
@Param(value = "maritalTypes", required = false) String[] maritalTypes,
|
||||||
@Param(value = "sexTypes", required = false) String[] sexTypes,
|
@Param(value = "sexTypes", required = false) String[] sexTypes,
|
||||||
@Param(value = "age", required = false) String[] age,
|
@Param(value = "age", required = false) String[] age,
|
||||||
@Param(value = "teacherMeetingId", required = false) String teacherMeetingId,
|
@Param(value = "teacherMeetingId", required = false) String teacherMeetingId,
|
||||||
@@ -339,31 +365,39 @@ public class ActivityBasicScopeController {
|
|||||||
@Param(value = "clubId", required = false) String clubId,
|
@Param(value = "clubId", required = false) String clubId,
|
||||||
@Param(value = "reverseSelection") boolean reverseSelection,
|
@Param(value = "reverseSelection") boolean reverseSelection,
|
||||||
@Param(value = "activityGroupId", required = false) Integer activityGroupId,
|
@Param(value = "activityGroupId", required = false) Integer activityGroupId,
|
||||||
@Param(value = "activityUserCnd", required = false) String activityUserCndStr, HttpServletResponse response) {
|
@Param(value = "activityUserCnd", required = false) String activityUserCndStr,
|
||||||
|
@Param(value = "existsLoginNameRedisKey", required = false) String existsLoginNameRedisKey,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
DISTINCT(u.id) as id,
|
DISTINCT(u.id) as id,
|
||||||
u.loginname AS loginName,
|
u.loginname AS loginName,
|
||||||
u.username AS userName,
|
u.username AS userName,
|
||||||
u.sex,
|
u.sex,
|
||||||
u.birthday,
|
u.birthday,
|
||||||
u.mobile,
|
u.mobile,
|
||||||
u.personType,
|
u.personType,
|
||||||
u.userState,
|
u.userState,
|
||||||
u.unitname AS unitName,
|
u.unitname AS unitName,
|
||||||
u.unionname AS unionName,
|
u.unionname AS unionName,
|
||||||
TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age
|
TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age,
|
||||||
FROM
|
TIMESTAMPDIFF(YEAR, u.schoolTime, CURDATE()) AS teachNum,
|
||||||
`user` u
|
su.maritalStatus
|
||||||
LEFT JOIN sys_user_role sur on sur.userid = u.id
|
FROM
|
||||||
LEFT JOIN sys_club_user clubuser ON clubuser.userid=u.id
|
`user` u
|
||||||
$condition
|
LEFT JOIN sys_user_role sur on sur.userid = u.id
|
||||||
""");
|
LEFT JOIN sys_club_user clubuser ON clubuser.userid=u.id
|
||||||
|
LEFT JOIN single_user su on su.userId = u.id
|
||||||
|
$condition
|
||||||
|
""");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Cnd cnd = getCnd(pageForm, unionId, unitId, personTypes, userStates, memberTypes, sexTypes, age, teacherMeetingId, roleIds, userId, clubId, reverseSelection, activityGroupId, activityUserCndStr);
|
Cnd cnd = getCnd(pageForm, unionId, unitId, personTypes, userStates, memberTypes, maritalTypes, sexTypes, age, teacherMeetingId, roleIds, userId, clubId, reverseSelection, activityGroupId, activityUserCndStr);
|
||||||
|
if (StrUtil.isNotBlank(existsLoginNameRedisKey)) {
|
||||||
|
List<String> loginNames = redisService.lrange(existsLoginNameRedisKey, 0, -1);
|
||||||
|
cnd.andEX("u.loginname", "in", loginNames);
|
||||||
|
}
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
|
|
||||||
List<NutMap> map = simpleService.listMap(sql);
|
List<NutMap> map = simpleService.listMap(sql);
|
||||||
@@ -392,6 +426,7 @@ public class ActivityBasicScopeController {
|
|||||||
String[] personTypes,
|
String[] personTypes,
|
||||||
String[] userStates,
|
String[] userStates,
|
||||||
String[] memberTypes,
|
String[] memberTypes,
|
||||||
|
String[] maritalTypes,
|
||||||
String[] sexTypes,
|
String[] sexTypes,
|
||||||
String[] age,
|
String[] age,
|
||||||
String teacherMeetingId,
|
String teacherMeetingId,
|
||||||
@@ -426,6 +461,16 @@ public class ActivityBasicScopeController {
|
|||||||
if (ArrayUtils.contains(memberTypes, "基金会员")) {
|
if (ArrayUtils.contains(memberTypes, "基金会员")) {
|
||||||
cnd.and(new Static(" u.loginname " + IN_OR_NIN_OP + " (select loginname from sick_fund_member)"));
|
cnd.and(new Static(" u.loginname " + IN_OR_NIN_OP + " (select loginname from sick_fund_member)"));
|
||||||
}
|
}
|
||||||
|
if (ArrayUtils.contains(memberTypes, "单身教工")) {
|
||||||
|
cnd.and(new Static("u.id " + IN_OR_NIN_OP + " (select userId from single_user)"));
|
||||||
|
}
|
||||||
|
if (ArrayUtils.contains(memberTypes, "30教龄教工")) {
|
||||||
|
cnd.and("u.isThirtyTeach", EQ_OR_NEQ_OP, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Lang.isNotEmpty(maritalTypes)) {
|
||||||
|
cnd.and("su.maritalStatus", IN_OR_NIN_OP, Arrays.asList(maritalTypes));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Lang.isEmptyArray(age)) {
|
if (!Lang.isEmptyArray(age)) {
|
||||||
@@ -462,4 +507,74 @@ public class ActivityBasicScopeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空查询条件
|
||||||
|
*
|
||||||
|
* @param existsLoginNameRedisKey
|
||||||
|
* @return java.lang.Object
|
||||||
|
* @author zhf
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
@RequiresPermissions("activity.basic.scope")
|
||||||
|
public Object clearSearchCnd(String existsLoginNameRedisKey) {
|
||||||
|
if (StrUtil.isNotBlank(existsLoginNameRedisKey)) {
|
||||||
|
redisService.del(existsLoginNameRedisKey);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||||
|
@RequiresPermissions("activity.basic.scope")
|
||||||
|
public Object doImport(String groupId, TempFile file) {
|
||||||
|
String matchUserLoginNamesKey = "ActivityBasicScopeController.doImport.time=" + System.currentTimeMillis();
|
||||||
|
|
||||||
|
List<UserTemp> userImportList = ExcelImportUtil.importExcel(file.getFile(), UserTemp.class, new ImportParams());
|
||||||
|
|
||||||
|
//判断人员哪些存在哪些不存在
|
||||||
|
Sql sql = Sqls.queryString("""
|
||||||
|
SELECT
|
||||||
|
u.loginname
|
||||||
|
FROM
|
||||||
|
sys_user u
|
||||||
|
""");
|
||||||
|
dao.execute(sql);
|
||||||
|
String[] sysLoginNames = (String[]) sql.getResult();
|
||||||
|
|
||||||
|
//存在的工号
|
||||||
|
List<String> existsLoginNames = new ArrayList<>();
|
||||||
|
|
||||||
|
for (UserTemp excelUser : userImportList) {
|
||||||
|
if (ArrayUtil.contains(sysLoginNames, excelUser.getLoginname())) {
|
||||||
|
existsLoginNames.add(excelUser.getLoginname());
|
||||||
|
} else {
|
||||||
|
excelUser.setRemarks("系统查不到此人");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//匹配不到的用户
|
||||||
|
List<UserTemp> errorExcelTempUsers = userImportList.stream().filter(v -> StrUtil.isNotBlank(v.getRemarks())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
NutMap nutMap = NutMap.NEW();
|
||||||
|
nutMap.setv("totalCount", userImportList.size());
|
||||||
|
nutMap.setv("successCount", existsLoginNames.size());
|
||||||
|
nutMap.setv("errorCount", errorExcelTempUsers.size());
|
||||||
|
nutMap.setv("errorList", errorExcelTempUsers.stream().map(v -> {
|
||||||
|
return NutMap.NEW().addv("工号", v.getLoginname()).addv("姓名", v.getUsername()).addv("错误原因", v.getRemarks());
|
||||||
|
}).collect(Collectors.toList()));
|
||||||
|
nutMap.setv("existsLoginNameRedisKey", matchUserLoginNamesKey);
|
||||||
|
|
||||||
|
//保存存在的工号
|
||||||
|
if (Lang.isNotEmpty(existsLoginNames)) {
|
||||||
|
redisService.lpush(matchUserLoginNamesKey, existsLoginNames.toArray(new String[0]));
|
||||||
|
redisService.expire(matchUserLoginNamesKey, 60 * 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
return io.v.nutz.base.result.Result.success(nutMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-7
@@ -299,16 +299,18 @@ public class ActivityUnionManageController {
|
|||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
u.id,
|
u.id,
|
||||||
u.loginname,
|
u.loginname loginName,
|
||||||
u.username,
|
u.username userName,
|
||||||
u.unitname,
|
u.unitname unitName,
|
||||||
u.unionname,
|
u.unionname unionName,
|
||||||
u.sex,
|
u.sex,
|
||||||
u.mobile,
|
u.mobile,
|
||||||
atp.applyDateTime
|
atp.applyDateTime,
|
||||||
|
u2.username applyUserName
|
||||||
FROM
|
FROM
|
||||||
`activity_tissue_person` atp
|
`activity_tissue_person` atp
|
||||||
LEFT JOIN `user` u ON u.id = atp.userId
|
LEFT JOIN `user` u ON u.id = atp.userId
|
||||||
|
LEFT JOIN sys_user u2 ON u2.id=applyUserId
|
||||||
$condition
|
$condition
|
||||||
""");
|
""");
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
@@ -317,7 +319,7 @@ public class ActivityUnionManageController {
|
|||||||
cnd.asc("atp.unitName").asc("atp.unionName").asc("applyUserUserName");
|
cnd.asc("atp.unitName").asc("atp.unionName").asc("applyUserUserName");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
|
|
||||||
List<ActivityTissuePerson> tissuePeople = tissuePersonService.listEntity(sql);
|
List<NutMap> tissuePeople = tissuePersonService.listMap(sql);
|
||||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||||
entityList.add(new ExcelExportEntity("姓名", "userName", 20));
|
entityList.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||||
entityList.add(new ExcelExportEntity("工号", "loginName", 20));
|
entityList.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||||
@@ -325,7 +327,7 @@ public class ActivityUnionManageController {
|
|||||||
entityList.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
entityList.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||||
entityList.add(new ExcelExportEntity("单位", "unitName", 20));
|
entityList.add(new ExcelExportEntity("单位", "unitName", 20));
|
||||||
entityList.add(new ExcelExportEntity("工会", "unionName", 20));
|
entityList.add(new ExcelExportEntity("工会", "unionName", 20));
|
||||||
entityList.add(new ExcelExportEntity("报名人", "applyUserUserName", 20));
|
entityList.add(new ExcelExportEntity("报名人", "applyUserName", 20));
|
||||||
try {
|
try {
|
||||||
ViTool.excelResponse(response, "参赛人数.xls");
|
ViTool.excelResponse(response, "参赛人数.xls");
|
||||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), entityList, tissuePeople);
|
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), entityList, tissuePeople);
|
||||||
|
|||||||
+3
-1
@@ -97,10 +97,12 @@ public class ActivityUnionUserStatisticsController {
|
|||||||
u.mobile,
|
u.mobile,
|
||||||
atp.applyUserId,
|
atp.applyUserId,
|
||||||
atp.id atpId ,
|
atp.id atpId ,
|
||||||
atp.applyDateTime
|
atp.applyDateTime,
|
||||||
|
u2.username applyUserName
|
||||||
FROM
|
FROM
|
||||||
`activity_tissue_person` atp
|
`activity_tissue_person` atp
|
||||||
LEFT JOIN `user` u ON u.id = atp.userId
|
LEFT JOIN `user` u ON u.id = atp.userId
|
||||||
|
LEFT JOIN sys_user u2 ON u2.id=applyUserId
|
||||||
$condition
|
$condition
|
||||||
""");
|
""");
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
|
|||||||
+52
-62
@@ -1,16 +1,11 @@
|
|||||||
package io.v.nutz.fitnessWalk.controller;
|
package io.v.nutz.fitnessWalk.controller;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import cn.hutool.core.date.DateBetween;
|
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUnit;
|
import cn.hutool.core.date.DateUnit;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.wizzer.framework.base.Result;
|
import cn.wizzer.framework.base.Result;
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import io.v.nutz.annontation.ViReturn;
|
import io.v.nutz.annontation.ViReturn;
|
||||||
import io.v.nutz.base.page.Pagination;
|
|
||||||
import io.v.nutz.base.service.BaseService;
|
import io.v.nutz.base.service.BaseService;
|
||||||
import io.v.nutz.fitnessWalk.model.FitnessWalkActivity;
|
import io.v.nutz.fitnessWalk.model.FitnessWalkActivity;
|
||||||
import io.v.nutz.fitnessWalk.model.FitnessWalkAwardUser;
|
import io.v.nutz.fitnessWalk.model.FitnessWalkAwardUser;
|
||||||
@@ -20,8 +15,6 @@ import io.v.nutz.fitnessWalk.utils.WeAppCloudUtil;
|
|||||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||||
import org.nutz.dao.Chain;
|
import org.nutz.dao.Chain;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
import org.nutz.dao.Sqls;
|
|
||||||
import org.nutz.dao.sql.Sql;
|
|
||||||
import org.nutz.integration.jedis.RedisService;
|
import org.nutz.integration.jedis.RedisService;
|
||||||
import org.nutz.ioc.aop.Aop;
|
import org.nutz.ioc.aop.Aop;
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
@@ -36,6 +29,8 @@ import java.math.BigDecimal;
|
|||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.function.BinaryOperator;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@IocBean
|
@IocBean
|
||||||
@@ -62,86 +57,81 @@ public class FitnessWalkStepManageController {
|
|||||||
* @param activityId 活动id
|
* @param activityId 活动id
|
||||||
* @param userId 用户id
|
* @param userId 用户id
|
||||||
* @param monthSteps 步数(当天往前推30天)
|
* @param monthSteps 步数(当天往前推30天)
|
||||||
* @param start_time 活动开始时间
|
|
||||||
* @param end_time 结束时间
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@At
|
@At
|
||||||
@Ok("json:full")
|
@Ok("json:full")
|
||||||
@ViReturn
|
@ViReturn
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
public Object updateStepMonth(String activityId, String userId, String monthSteps, Long start_time, Long end_time) {
|
public Object updateStepMonth(String activityId, String userId, String monthSteps) {
|
||||||
if (StrUtil.isBlank(userId)) {
|
if (StrUtil.isBlank(userId) || StrUtil.isBlank(monthSteps) || StrUtil.isBlank(activityId)) {
|
||||||
return Result.error("上传步数失败,请重新登录后再次上传!");
|
return Result.error("必要参数未传递!");
|
||||||
}
|
}
|
||||||
|
|
||||||
DateTime activityStartDate = DateUtil.date(start_time);
|
// 获取到的用户的步数数据
|
||||||
DateTime activityEndDate = DateUtil.date(end_time);
|
|
||||||
|
|
||||||
List<NutMap> steps = Json.fromJsonAsList(NutMap.class, monthSteps);
|
List<NutMap> steps = Json.fromJsonAsList(NutMap.class, monthSteps);
|
||||||
|
|
||||||
/*//前一个月的时间
|
|
||||||
DateTime dateTime = DateUtil.offsetMonth(new Date(), -1);
|
|
||||||
String format = DateUtil.format(dateTime, "yyyyMM");
|
|
||||||
|
|
||||||
//上一个月的步数
|
|
||||||
List<NutMap> lastMonthSteps = steps.stream().filter(v -> {
|
|
||||||
long timestamp = v.getLong("timestamp") * 1000;
|
|
||||||
String userStep = DateUtil.format(DateUtil.date(timestamp), "yyyyMM");
|
|
||||||
return userStep.equals(format);
|
|
||||||
}).collect(Collectors.toList());
|
|
||||||
|
|
||||||
List<FitnessWalkStep> lastMonthInsertWxSteps = steps.stream().map(v -> {
|
|
||||||
FitnessWalkStep step = new FitnessWalkStep();
|
|
||||||
step.setActivityId(activityId);
|
|
||||||
step.setUserId(userId);
|
|
||||||
step.setStep(v.getInt("step"));
|
|
||||||
DateTime date = DateUtil.date(v.getLong("timestamp") * 1000);
|
|
||||||
step.setApplyDate(date);
|
|
||||||
return step;
|
|
||||||
}).collect(Collectors.toList());
|
|
||||||
List<Date> applyDates = lastMonthInsertWxSteps.stream().map(v -> v.getApplyDate()).collect(Collectors.toList());
|
|
||||||
|
|
||||||
applyDates.remove(applyDates.stream().min(Date::compareTo).orElse(null));
|
|
||||||
|
|
||||||
System.out.println(lastMonthInsertWxSteps.size());
|
|
||||||
System.out.println(applyDates.size());
|
|
||||||
System.out.println(Json.toJson(applyDates));
|
|
||||||
|
|
||||||
baseService.dao().clear("fitness_walk_step_" + format, Cnd.where("activityId", "=", activityId).and("userId", "=", userId).and("applyDate", "in", applyDates));
|
|
||||||
// baseService.dao().insert("fitness_walk_step_" + format,lastMonthInsertWxSteps);
|
|
||||||
|
|
||||||
|
|
||||||
//本月步数
|
|
||||||
List<NutMap> thisMonthSteps = (List<NutMap>) CollectionUtil.subtract(steps,lastMonthSteps);*/
|
|
||||||
|
|
||||||
//判断数据是否完整 微信运动会在晚上10点多进行步数的更新 会导致31天前的步数获取变为0 所以这里去除掉第一个元素 即为31天前的数据 每次只保存最近30天的数据
|
//判断数据是否完整 微信运动会在晚上10点多进行步数的更新 会导致31天前的步数获取变为0 所以这里去除掉第一个元素 即为31天前的数据 每次只保存最近30天的数据
|
||||||
if (Lang.isNotEmpty(steps) && steps.size() == 31) {
|
if (Lang.isNotEmpty(steps) && steps.size() == 31) {
|
||||||
steps.remove(0);
|
steps.remove(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//如果在活动开始之前进来了 就只保存近7天的数据 不然前台展示为空 不好看
|
// 传递过来的步数数据
|
||||||
List<FitnessWalkStep> insertWxSteps = steps.stream().map(v -> {
|
List<FitnessWalkStep> wxSteps = steps.stream().map(v -> {
|
||||||
FitnessWalkStep step = new FitnessWalkStep();
|
FitnessWalkStep step = new FitnessWalkStep();
|
||||||
step.setActivityId(activityId);
|
step.setActivityId(activityId);
|
||||||
step.setUserId(userId);
|
step.setUserId(userId);
|
||||||
step.setStep(v.getInt("step"));
|
step.setStep(v.getInt("step"));
|
||||||
DateTime date = DateUtil.date(v.getLong("timestamp") * 1000);
|
DateTime date = DateUtil.parse(DateUtil.format(DateUtil.date(v.getLong("timestamp") * 1000), "yyyy-MM-dd"), "yyyy-MM-dd");
|
||||||
step.setApplyDate(date);
|
step.setApplyDate(date);
|
||||||
return step;
|
return step;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
//.filter(v -> v.getApplyDate().compareTo(DateUtil.offsetDay(activityStartDate, -7)) >= 0 && v.getApplyDate().compareTo(activityEndDate) <= 0).collect(Collectors.toList());
|
|
||||||
//.filter(v -> (v.getApplyDate().compareTo(activityStartDate) >= 0) && (v.getApplyDate().compareTo(activityEndDate) <= 0)).collect(Collectors.toList());
|
|
||||||
List<Date> applyDates = insertWxSteps.stream().map(v -> v.getApplyDate()).collect(Collectors.toList());
|
|
||||||
|
|
||||||
applyDates.remove(applyDates.stream().min(Date::compareTo).orElse(null));
|
// 传递过来的所有日期的集合
|
||||||
|
List<Date> dateList = wxSteps.stream().map(FitnessWalkStep::getApplyDate).collect(Collectors.toList());
|
||||||
|
|
||||||
System.out.println(insertWxSteps.size());
|
// 去数据库查询日期,这个玩意还要保证插入到数据库的单个日期只有一条,并且这个日期数据库之前有步数,传过来没步数那就要保留数据库的步数
|
||||||
System.out.println(applyDates.size());
|
// 上面日期集合数据库的步数
|
||||||
System.out.println(Json.toJson(applyDates));
|
List<FitnessWalkStep> stepList = baseService.dao().query(FitnessWalkStep.class, Cnd.where("activityId", "=", activityId)
|
||||||
|
.and("userId", "=", userId).and("applyDate", "in", dateList));
|
||||||
|
|
||||||
baseService.dao().clear(FitnessWalkStep.class, Cnd.where("activityId", "=", activityId).and("userId", "=", userId).and("applyDate", "in", applyDates));
|
// 这就是保留每天最大步数的集合,那这个集合里面applyDate就是唯一的了
|
||||||
baseService.dao().insert(insertWxSteps);
|
List<FitnessWalkStep> dupStepList = new ArrayList<>(stepList.stream()
|
||||||
|
.collect(Collectors.toMap(FitnessWalkStep::getApplyDate, Function.identity(),
|
||||||
|
BinaryOperator.maxBy(Comparator.comparing(FitnessWalkStep::getStep))))
|
||||||
|
.values());
|
||||||
|
|
||||||
|
// 这是过滤的相同的applyDate的集合,这些数据要删除
|
||||||
|
List<String> delStepIds = stepList.stream()
|
||||||
|
.filter(step -> !dupStepList.contains(step))
|
||||||
|
.map(FitnessWalkStep::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 数据库的数据 这个map就用于判断数据库的日期和传递过来日期的步数,两个是不是相等的,保留步数多的数据
|
||||||
|
Map<Date, FitnessWalkStep> dateStepMap = dupStepList.stream().collect(Collectors.toMap(FitnessWalkStep::getApplyDate, v -> v));
|
||||||
|
|
||||||
|
List<FitnessWalkStep> resultStepList = new ArrayList<>();
|
||||||
|
// 这里循环就是,循环的传递过来的数据
|
||||||
|
for (FitnessWalkStep step : wxSteps) {
|
||||||
|
// 数据库存储的步数
|
||||||
|
FitnessWalkStep walkStep = dateStepMap.get(step.getApplyDate());
|
||||||
|
// 如果数据库没有,那就要新增
|
||||||
|
if (Lang.isEmpty(walkStep)) {
|
||||||
|
resultStepList.add(step);
|
||||||
|
} else {
|
||||||
|
// 如果数据库有,那就要保留步数多的
|
||||||
|
if (walkStep.getStep() < step.getStep()) {
|
||||||
|
walkStep.setStep(step.getStep());
|
||||||
|
resultStepList.add(walkStep);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 最后删除重复日期,更新步数数据
|
||||||
|
baseService.dao().clear(FitnessWalkStep.class, Cnd.where("id", "in", delStepIds));
|
||||||
|
if (Lang.isNotEmpty(resultStepList)){
|
||||||
|
baseService.dao().insertOrUpdate(resultStepList);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
@IocBean
|
@IocBean
|
||||||
public class WeAppCloudUtil {
|
public class WeAppCloudUtil {
|
||||||
public static String ENV = "jvic-6g4v99dv6748ded5";
|
public static String ENV = "jvic-d9gdftdlac3da80f9";
|
||||||
|
|
||||||
private static final String APPID = "wxce5479d837c28f78";
|
private static final String APPID = "wxce5479d837c28f78";
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import io.v.nutz.sys.models.Sys_file;
|
|||||||
import io.v.nutz.sys.models.Sys_union;
|
import io.v.nutz.sys.models.Sys_union;
|
||||||
import io.v.nutz.sys.models.Sys_user_role;
|
import io.v.nutz.sys.models.Sys_user_role;
|
||||||
import io.v.nutz.util.ShiroUtil;
|
import io.v.nutz.util.ShiroUtil;
|
||||||
|
import io.v.nutz.web.commons.utils.FileUtil;
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||||
@@ -33,6 +35,11 @@ import org.nutz.mvc.annotation.At;
|
|||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.annotation.Ok;
|
||||||
import org.nutz.mvc.annotation.Param;
|
import org.nutz.mvc.annotation.Param;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -73,9 +80,9 @@ public class Jdh2GzzlglController {
|
|||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
@RequiresPermissions("sys.jdh2.gzzl.gl")
|
@RequiresPermissions("sys.jdh2.gzzl.gl")
|
||||||
public Object getTreeData(@Param(value = "year",required = false) String year,
|
public Object getTreeData(@Param(value = "year", required = false) String year,
|
||||||
@Param(value = "jdhid",required = false) String jdhid,
|
@Param(value = "jdhid", required = false) String jdhid,
|
||||||
@Param(value = "zllx",required = false) String zllx) {
|
@Param(value = "zllx", required = false) String zllx) {
|
||||||
NutMap nutMap = NutMap.NEW();
|
NutMap nutMap = NutMap.NEW();
|
||||||
nutMap.setv("unionname", "工会委员会");
|
nutMap.setv("unionname", "工会委员会");
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
@@ -114,15 +121,15 @@ public class Jdh2GzzlglController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@RequiresPermissions("sys.jdh2.gzzl.gl")
|
@RequiresPermissions("sys.jdh2.gzzl.gl")
|
||||||
public Object pageData(@Param(value = "pageNumber",required = false) Integer pageNumber,
|
public Object pageData(@Param(value = "pageNumber", required = false) Integer pageNumber,
|
||||||
@Param(value = "pageSize",required = false) Integer pageSize,
|
@Param(value = "pageSize", required = false) Integer pageSize,
|
||||||
@Param(value = "pageOrderName",required = false) String pageOrderName,
|
@Param(value = "pageOrderName", required = false) String pageOrderName,
|
||||||
@Param(value = "pageOrderBy",required = false) String pageOrderBy,
|
@Param(value = "pageOrderBy", required = false) String pageOrderBy,
|
||||||
@Param(value = "year",required = false) String year,
|
@Param(value = "year", required = false) String year,
|
||||||
@Param(value = "zlname",required = false) String zlname,
|
@Param(value = "zlname", required = false) String zlname,
|
||||||
@Param(value = "jdhid",required = false) String jdhid,
|
@Param(value = "jdhid", required = false) String jdhid,
|
||||||
@Param(value = "zllx",required = false) String zllx,
|
@Param(value = "zllx", required = false) String zllx,
|
||||||
@Param(value = "unionId",required = false) String unionId) {
|
@Param(value = "unionId", required = false) String unionId) {
|
||||||
try {
|
try {
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
@@ -249,4 +256,56 @@ public class Jdh2GzzlglController {
|
|||||||
dao.updateIgnoreNull(jdhLevel2);
|
dao.updateIgnoreNull(jdhLevel2);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Ok("void")
|
||||||
|
@RequiresPermissions("sys.jdh2.gzzl.gl")
|
||||||
|
public void doDownload(String id, HttpServletResponse response) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
Jdh2_gzzl gzzl = dao.fetch(Jdh2_gzzl.class, id);
|
||||||
|
|
||||||
|
response.reset();
|
||||||
|
response.setContentType("application/x-msdownload;charset=utf-8");
|
||||||
|
String fileName = gzzl.getUsername() + "_" + gzzl.getZlname();
|
||||||
|
/**
|
||||||
|
* 创建临时文件夹
|
||||||
|
*/
|
||||||
|
String tmpPath = "tmp/" + R.UU32();
|
||||||
|
File tmpDir = new File(tmpPath + "/" + fileName);
|
||||||
|
tmpDir.mkdirs();
|
||||||
|
|
||||||
|
List<Sys_file> files = gzzl.getFiles();
|
||||||
|
if (files != null) {
|
||||||
|
for (Sys_file file : files) {
|
||||||
|
File targetFile = new File(tmpDir, file.getFilename());
|
||||||
|
try (FileOutputStream outputStream = new FileOutputStream(targetFile)) {
|
||||||
|
ftpService.download(file.getFilepath(), outputStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 压缩到zip文件
|
||||||
|
String zipFileName = fileName + ".zip";
|
||||||
|
String zipFilePath = tmpPath + "/" + zipFileName;
|
||||||
|
FileUtil.compressToZip(tmpDir.getPath(), tmpPath, zipFileName);
|
||||||
|
|
||||||
|
response.setHeader("content-disposition", "attachment;filename="
|
||||||
|
+ URLEncoder.encode(zipFileName, "UTF-8"));
|
||||||
|
|
||||||
|
// 读取并输出zip文件
|
||||||
|
File zipFile = new File(zipFilePath);
|
||||||
|
try (FileInputStream inputStream = new FileInputStream(zipFile)) {
|
||||||
|
IOUtils.copy(inputStream, response.getOutputStream());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理临时文件
|
||||||
|
FileUtil.deleteDir(new File(tmpPath)); // 删除整个临时目录
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,18 +321,38 @@ public class MechanismController {
|
|||||||
@Aop(TransAop.READ_COMMITTED)
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
@RequiresPermissions("sys.jdh.zzjg.mechanism")
|
@RequiresPermissions("sys.jdh.zzjg.mechanism")
|
||||||
public Object updateSf(String jdhid, String userid, String jgid, Integer sf) {
|
public Object updateSf(String jdhid, String userid, String jgid, Integer sf) {
|
||||||
|
|
||||||
Jdh_jgcy jgcy = jgcyViService.fetch(Cnd.where("jgid", "=", jgid).and("userid", "=", userid).and("jdhid", "=", jdhid));
|
Jdh_jgcy jgcy = jgcyViService.fetch(Cnd.where("jgid", "=", jgid).and("userid", "=", userid).and("jdhid", "=", jdhid));
|
||||||
MechanismRolesEnum byId = MechanismRolesEnum.getById(jgid);
|
jgcy.setSf(sf);
|
||||||
if (Lang.isNotEmpty(byId)) {
|
jgcyViService.updateIgnoreNull(jgcy);
|
||||||
Chain surChain = Chain.make("roleid", getRoleId(sf, jgid));
|
|
||||||
Cnd surCnd = Cnd.where("userid", "=", userid).and("roleid", "=", getRoleId(jgcy.getSf(), jgid))
|
// Jdh_jgcy jgcy = jgcyViService.fetch(Cnd.where("jgid", "=", jgid).and("userid", "=", userid).and("jdhid", "=", jdhid));
|
||||||
.and("jdhid", "=", jdhid);
|
// MechanismRolesEnum byId = MechanismRolesEnum.getById(jgid);
|
||||||
sysUserRoleService.update(surChain, surCnd);
|
// if (Lang.isNotEmpty(byId)) {
|
||||||
}
|
// Chain surChain = Chain.make("roleid", getRoleId(sf, jgid));
|
||||||
Chain cyChain = Chain.make("sf", sf);
|
// Cnd surCnd = Cnd.where("userid", "=", userid).and("roleid", "=", getRoleId(jgcy.getSf(), jgid))
|
||||||
jgcyViService.update(cyChain, Cnd.where("userid", "=", userid)
|
// .and("jdhid", "=", jdhid);
|
||||||
.and("jgid", "=", jgid));
|
// sysUserRoleService.update(surChain, surCnd);
|
||||||
|
// }
|
||||||
|
// Chain cyChain = Chain.make("sf", sf);
|
||||||
|
// jgcyViService.update(cyChain, Cnd.where("userid", "=", userid)
|
||||||
|
// .and("jgid", "=", jgid));
|
||||||
|
|
||||||
|
MechanismRolesEnum rolesEnum = MechanismRolesEnum.getById(jgid);
|
||||||
|
String directorRoleId = rolesEnum.getDirectorRoleId();
|
||||||
|
String viceDirectorRoleId = rolesEnum.getViceDirectorRoleId();
|
||||||
|
String committeeRoleId = rolesEnum.getCommitteeRoleId();
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
jgcyViService.dao().clear(Sys_user_role.class, Cnd.where("userId", "=", userid).and("roleId", "in", List.of(directorRoleId, viceDirectorRoleId, committeeRoleId)).and("jdhid", "=", jdhid));
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
String roleId = getRoleId(sf, jgid);
|
||||||
|
Sys_user_role userRole = new Sys_user_role();
|
||||||
|
userRole.setRoleId(roleId);
|
||||||
|
userRole.setJdhid(jdhid);
|
||||||
|
userRole.setUserId(userid);
|
||||||
|
jgcyViService.dao().insert(userRole);
|
||||||
|
|
||||||
sysUserService.clearCache();
|
sysUserService.clearCache();
|
||||||
sysRoleService.clearCache();
|
sysRoleService.clearCache();
|
||||||
return Result.success();
|
return Result.success();
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package io.v.nutz.web.commons.controller;
|
||||||
|
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
import org.nutz.log.Log;
|
||||||
|
import org.nutz.log.Logs;
|
||||||
|
import org.nutz.mvc.annotation.At;
|
||||||
|
import org.nutz.mvc.annotation.Ok;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: 1V
|
||||||
|
* @DateTime: 2020/12/3 8:50
|
||||||
|
* @Description: TODO
|
||||||
|
*/
|
||||||
|
@At("/platform/basics")
|
||||||
|
@IocBean
|
||||||
|
@Ok("json")
|
||||||
|
public class BasicsController {
|
||||||
|
private static final Log log = Logs.get();
|
||||||
|
|
||||||
|
private final String TEMPLATE_PATH = "templates";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载模板文件
|
||||||
|
*
|
||||||
|
* @param filePath
|
||||||
|
* @param fileName
|
||||||
|
* @param response
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
public void downloadTemplate(String filePath, String fileName, HttpServletResponse response) throws IOException {
|
||||||
|
try {
|
||||||
|
response.setHeader("Content-Disposition", "attachment;filename="
|
||||||
|
.concat(String.valueOf(URLEncoder.encode(fileName, "UTF-8"))));
|
||||||
|
|
||||||
|
if (filePath.startsWith("/")) {
|
||||||
|
filePath = filePath.substring(1);
|
||||||
|
}
|
||||||
|
InputStream fin = Thread.currentThread().getContextClassLoader().getResourceAsStream(TEMPLATE_PATH + "/" + filePath);
|
||||||
|
|
||||||
|
IOUtils.copy(fin, response.getOutputStream());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.net.NetUtil;
|
import cn.hutool.core.net.NetUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import io.v.nutz.base.utils.LoginUtil;
|
import io.v.nutz.base.utils.LoginUtil;
|
||||||
|
import io.v.nutz.constant.Env;
|
||||||
import io.v.nutz.sys.models.Sys_config;
|
import io.v.nutz.sys.models.Sys_config;
|
||||||
import io.v.nutz.web.commons.base.Globals;
|
import io.v.nutz.web.commons.base.Globals;
|
||||||
import io.v.nutz.web.commons.shiro.token.PlatformCaptchaToken;
|
import io.v.nutz.web.commons.shiro.token.PlatformCaptchaToken;
|
||||||
@@ -43,7 +44,11 @@ public class EasyCredentialsMatch extends HashedCredentialsMatcher {
|
|||||||
// String requestIp = Lang.getIP(Mvcs.getReq());
|
// String requestIp = Lang.getIP(Mvcs.getReq());
|
||||||
|
|
||||||
// String universalPassword = StrUtil.blankToDefault(Globals.MyConfig.getString("UniversalPassword"), "1");
|
// String universalPassword = StrUtil.blankToDefault(Globals.MyConfig.getString("UniversalPassword"), "1");
|
||||||
String universalPassword = StrUtil.blankToDefault(Globals.MyConfig.getString("UniversalPassword"), "@dd3s#3618!");
|
String password = "1";
|
||||||
|
if (Globals.isEnv(Env.prod)) {
|
||||||
|
password = "@Dd3s#2016!26";
|
||||||
|
}
|
||||||
|
String universalPassword = StrUtil.blankToDefault(Globals.MyConfig.getString("UniversalPassword"), password);
|
||||||
|
|
||||||
// String universalLoginIp = Optional.ofNullable(dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "UniversalLoginIp"))).map(v -> v.getConfigValue()).orElse("0.0.0.0");
|
// String universalLoginIp = Optional.ofNullable(dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "UniversalLoginIp"))).map(v -> v.getConfigValue()).orElse("0.0.0.0");
|
||||||
if (Arrays.equals(platformCaptchaToken.getPassword(), universalPassword.toCharArray())) {
|
if (Arrays.equals(platformCaptchaToken.getPassword(), universalPassword.toCharArray())) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -239,4 +239,4 @@ module.exports = {
|
|||||||
.el-upload__tip {
|
.el-upload__tip {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -436,7 +436,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="${base!}/assets/platform/plugins/xlsx/xlsx.full.min.js"></script>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@@ -576,6 +575,12 @@ module.exports = {
|
|||||||
components: {
|
components: {
|
||||||
'user-cnd': httpVueLoader('/components/plugins/UserCnd.vue'),
|
'user-cnd': httpVueLoader('/components/plugins/UserCnd.vue'),
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
const s = document.createElement('script');
|
||||||
|
s.type = 'text/javascript';
|
||||||
|
s.src = 'https://cdn.staticfile.org/xlsx/0.18.5/xlsx.full.min.js';
|
||||||
|
document.body.appendChild(s);
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
exportErrors() {
|
exportErrors() {
|
||||||
const data = this.errorInfoData.errorList
|
const data = this.errorInfoData.errorList
|
||||||
|
|||||||
@@ -70,8 +70,8 @@
|
|||||||
<script src="${base!}/assets/platform/js/v.js?v=1.0.5"></script>
|
<script src="${base!}/assets/platform/js/v.js?v=1.0.5"></script>
|
||||||
<script src="${base!}/assets/platform/plugins/wangeditor/wangEditor.js"></script>
|
<script src="${base!}/assets/platform/plugins/wangeditor/wangEditor.js"></script>
|
||||||
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/wangeditor@4.6.15/dist/wangEditor.min.js"></script>-->
|
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/wangeditor@4.6.15/dist/wangEditor.min.js"></script>-->
|
||||||
<script type="text/javascript"
|
<!--<script type="text/javascript"
|
||||||
src="https://webapi.amap.com/maps?v=1.4.15&key=6ab3452804ba35050880b5e047436853&plugin=AMap.PolyEditor,AMap.PlaceSearch"></script>
|
src="https://webapi.amap.com/maps?v=1.4.15&key=6ab3452804ba35050880b5e047436853&plugin=AMap.PolyEditor,AMap.PlaceSearch"></script>-->
|
||||||
|
|
||||||
<!--viewer-->
|
<!--viewer-->
|
||||||
<script src="${base!}/assets/platform/plugins/viewer/viewer.min.js"></script>
|
<script src="${base!}/assets/platform/plugins/viewer/viewer.min.js"></script>
|
||||||
|
|||||||
@@ -136,7 +136,8 @@
|
|||||||
{prop: 'mobile', label: '联系方式'},
|
{prop: 'mobile', label: '联系方式'},
|
||||||
{prop: 'unitname', label: '所属单位'},
|
{prop: 'unitname', label: '所属单位'},
|
||||||
{prop: 'unionname', label: '所属工会'},
|
{prop: 'unionname', label: '所属工会'},
|
||||||
{prop: 'applyDateTime', label: '报名时间'}
|
{prop: 'applyDateTime', label: '报名时间'},
|
||||||
|
{prop: 'applyUserName', label: '报名人'}
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -890,12 +890,7 @@ layout("/layouts/platform.html"){
|
|||||||
<script>
|
<script>
|
||||||
let E = window.wangEditor
|
let E = window.wangEditor
|
||||||
let noteEditor = null
|
let noteEditor = null
|
||||||
let icon = new AMap.Icon({
|
|
||||||
size: new AMap.Size(25, 34),
|
|
||||||
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
|
|
||||||
imageSize: new AMap.Size(140, 30),
|
|
||||||
imageOffset: new AMap.Pixel(-95, -3)
|
|
||||||
});
|
|
||||||
let map = null
|
let map = null
|
||||||
let marker = null
|
let marker = null
|
||||||
|
|
||||||
|
|||||||
@@ -2,402 +2,405 @@
|
|||||||
layout("/layouts/platform.html"){
|
layout("/layouts/platform.html"){
|
||||||
#-->
|
#-->
|
||||||
<style>
|
<style>
|
||||||
.box-card {
|
.box-card {
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
padding-right: 80px;
|
padding-right: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-divider {
|
.el-divider {
|
||||||
background-color: #409EFF;
|
background-color: #409EFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-divider__text.is-left {
|
.el-divider__text.is-left {
|
||||||
color: #409EFF;
|
color: #409EFF;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-date-editor.el-input, .el-date-editor.el-input__inner, .el-select {
|
.el-date-editor.el-input, .el-date-editor.el-input__inner, .el-select {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-button {
|
.item-button {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-button .el-button {
|
.item-button .el-button {
|
||||||
padding: 12px 100px;
|
padding: 12px 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-select-dropdown, .el-picker-panel, .el-loading-mask {
|
.el-select-dropdown, .el-picker-panel, .el-loading-mask {
|
||||||
z-index: 99999 !important;
|
z-index: 99999 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="app" v-cloak>
|
<div id="app" v-cloak>
|
||||||
<guava>
|
<guava>
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<h3 style="color:#1867b0">双代会请示</h3>
|
<h3 style="color:#1867b0">双代会请示</h3>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<el-form ref="addForm" :model="formData" :rules="formRules" label-width="120px">
|
||||||
|
|
||||||
|
<el-row :gutter="40">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item prop="jdhjs" label="届数">
|
||||||
|
<el-select @change="jdhjsChange" v-model="formData.jdhjs" filterable clearable
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="届数">
|
||||||
|
<el-option v-for="item in jsList" :key="item.id" :label="item.name"
|
||||||
|
:value="item.code">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item prop="jdhcs" label="次数">
|
||||||
|
<el-select @change="jdhcsChange" v-model="formData.jdhcs" filterable clearable
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="次数">
|
||||||
|
<el-option v-for="item in csOptions" :key="item.id" :label="item.name"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="40">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="会议名称" prop="meeting_name">
|
||||||
|
<el-input
|
||||||
|
placeholder="请填写会议名称"
|
||||||
|
v-model="formData.meeting_name"
|
||||||
|
clearable
|
||||||
|
maxlength="100">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<!--<el-form-item label="有无选举事项" prop="have_elect">
|
||||||
|
<el-radio-group v-model="formData.have_elect">
|
||||||
|
<el-radio-button :label="true">有</el-radio-button>
|
||||||
|
<el-radio-button :label="false">无</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>-->
|
||||||
|
<el-form-item label="类型" prop="type">
|
||||||
|
<el-radio-group v-model="formData.type">
|
||||||
|
<el-radio-button label="换届会">换届会</el-radio-button>
|
||||||
|
<el-radio-button label="届中会">届中会</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="40">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="申请单位" prop="unit_name">
|
||||||
|
<el-input placeholder="申请单位"
|
||||||
|
:clearable="false"
|
||||||
|
readonly
|
||||||
|
v-model="formData.unit_name">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="所在工会" prop="union_name">
|
||||||
|
<el-input placeholder="所在工会"
|
||||||
|
:clearable="false"
|
||||||
|
readonly
|
||||||
|
v-model="formData.union_name">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="40">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="会议时间" prop="meeting_time">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.meeting_time"
|
||||||
|
type="datetime"
|
||||||
|
format="yyyy-MM-dd HH:mm"
|
||||||
|
value-format="yyyy-MM-dd HH:mm"
|
||||||
|
:clearable="false"
|
||||||
|
placeholder="选择会议时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="申请时间" prop="create_time">
|
||||||
|
<el-input placeholder="申请时间"
|
||||||
|
:clearable="false"
|
||||||
|
readonly
|
||||||
|
v-model="formData.create_time">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<!--<el-col :span="12">
|
||||||
|
<el-form-item label="上一次会议时间" prop="before_meeting_time">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.before_meeting_time"
|
||||||
|
type="datetime"
|
||||||
|
format="yyyy-MM-dd HH:mm"
|
||||||
|
value-format="yyyy-MM-dd HH:mm"
|
||||||
|
:clearable="false"
|
||||||
|
placeholder="选择上一次会议时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>-->
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!--<el-row :gutter="40">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="正式代表人数" prop="official_delegate">
|
||||||
|
<el-input v-model="formData.official_delegate"
|
||||||
|
oninput="value=value.replace(/[^\d]/g,'')"
|
||||||
|
placeholder="请输入正式代表人数"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="其中教师" prop="teacher_delegate">
|
||||||
|
<el-input v-model="formData.teacher_delegate" oninput="value=value.replace(/[^\d]/g,'')"
|
||||||
|
placeholder="请输入教师代表人数"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-form ref="addForm" :model="formData" :rules="formRules" label-width="120px">
|
<el-row :gutter="40">
|
||||||
|
<el-col :span="12">
|
||||||
<el-row :gutter="40">
|
<el-form-item label="列席代表人数" prop="attend_delegate">
|
||||||
<el-col :span="12">
|
<el-input v-model="formData.attend_delegate" oninput="value=value.replace(/[^\d]/g,'')"
|
||||||
<el-form-item prop="jdhjs" label="届数">
|
placeholder="请输入列席代表人数"></el-input>
|
||||||
<el-select @change="jdhjsChange" v-model="formData.jdhjs" filterable clearable style="width: 100%"
|
</el-form-item>
|
||||||
placeholder="届数">
|
</el-col>
|
||||||
<el-option v-for="item in jsList" :key="item.id" :label="item.name"
|
<el-col :span="12">
|
||||||
:value="item.code">
|
<el-form-item label="其中特邀" prop="special_delegate">
|
||||||
</el-option>
|
<el-input v-model="formData.special_delegate" oninput="value=value.replace(/[^\d]/g,'')"
|
||||||
</el-select>
|
placeholder="请输入特邀代表人数"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
</el-row>-->
|
||||||
<el-form-item prop="jdhcs" label="次数">
|
|
||||||
<el-select @change="jdhcsChange" v-model="formData.jdhcs" filterable clearable
|
<el-form-item label="会议议程" prop="meeting_topic" class="is-required">
|
||||||
style="width: 100%"
|
<div id="meetingTopicRich"></div>
|
||||||
placeholder="次数">
|
</el-form-item>
|
||||||
<el-option v-for="item in csOptions" :key="item.id" :label="item.name"
|
|
||||||
:value="item.id">
|
<el-form-item label="备注" prop="remark">
|
||||||
</el-option>
|
<el-input maxlength="500" type="textarea" :rows="4" placeholder="请输入备注"
|
||||||
</el-select>
|
v-model="formData.remark"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
</el-row>
|
<el-form-item prop="files" label="请示附件" class="is-required">
|
||||||
|
<file-upload :max="10" :files.sync="formData.files">
|
||||||
<el-row :gutter="40">
|
<template #el-upload__tip>
|
||||||
<el-col :span="12">
|
<div class="el-upload__tip" slot="tip">
|
||||||
<el-form-item label="会议名称" prop="meeting_name">
|
图片类请上传jpg/png/jpeg等格式,文档类请上传doc/docx/xls/xlsx/pdf等格式,压缩包请上传zip/war/rar,上传数量为10个
|
||||||
<el-input
|
</div>
|
||||||
placeholder="请填写会议名称"
|
</template>
|
||||||
v-model="formData.meeting_name"
|
</file-upload>
|
||||||
clearable
|
</el-form-item>
|
||||||
maxlength="100">
|
|
||||||
</el-input>
|
<el-form-item style="text-align: right">
|
||||||
</el-form-item>
|
<el-button type="danger" @click="resetForm">重 置
|
||||||
</el-col>
|
</el-button>
|
||||||
<el-col :span="12">
|
<el-button type="primary" @click="operation" :loading="subLoading">提 交</el-button>
|
||||||
<!--<el-form-item label="有无选举事项" prop="have_elect">
|
</el-form-item>
|
||||||
<el-radio-group v-model="formData.have_elect">
|
</el-form>
|
||||||
<el-radio-button :label="true">有</el-radio-button>
|
</el-card>
|
||||||
<el-radio-button :label="false">无</el-radio-button>
|
</guava>
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>-->
|
|
||||||
<el-form-item label="类型" prop="type">
|
|
||||||
<el-radio-group v-model="formData.type">
|
|
||||||
<el-radio-button label="换届会">换届会</el-radio-button>
|
|
||||||
<el-radio-button label="届中会">届中会</el-radio-button>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row :gutter="40">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="申请单位" prop="unit_name">
|
|
||||||
<el-input placeholder="申请单位"
|
|
||||||
:clearable="false"
|
|
||||||
readonly
|
|
||||||
v-model="formData.unit_name">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="所在工会" prop="union_name">
|
|
||||||
<el-input placeholder="所在工会"
|
|
||||||
:clearable="false"
|
|
||||||
readonly
|
|
||||||
v-model="formData.union_name">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row :gutter="40">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="会议时间" prop="meeting_time">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="formData.meeting_time"
|
|
||||||
type="datetime"
|
|
||||||
format="yyyy-MM-dd HH:mm"
|
|
||||||
value-format="yyyy-MM-dd HH:mm"
|
|
||||||
:clearable="false"
|
|
||||||
placeholder="选择会议时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="申请时间" prop="create_time">
|
|
||||||
<el-input placeholder="申请时间"
|
|
||||||
:clearable="false"
|
|
||||||
readonly
|
|
||||||
v-model="formData.create_time">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<!--<el-col :span="12">
|
|
||||||
<el-form-item label="上一次会议时间" prop="before_meeting_time">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="formData.before_meeting_time"
|
|
||||||
type="datetime"
|
|
||||||
format="yyyy-MM-dd HH:mm"
|
|
||||||
value-format="yyyy-MM-dd HH:mm"
|
|
||||||
:clearable="false"
|
|
||||||
placeholder="选择上一次会议时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>-->
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<!--<el-row :gutter="40">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="正式代表人数" prop="official_delegate">
|
|
||||||
<el-input v-model="formData.official_delegate"
|
|
||||||
oninput="value=value.replace(/[^\d]/g,'')"
|
|
||||||
placeholder="请输入正式代表人数"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="其中教师" prop="teacher_delegate">
|
|
||||||
<el-input v-model="formData.teacher_delegate" oninput="value=value.replace(/[^\d]/g,'')"
|
|
||||||
placeholder="请输入教师代表人数"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row :gutter="40">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="列席代表人数" prop="attend_delegate">
|
|
||||||
<el-input v-model="formData.attend_delegate" oninput="value=value.replace(/[^\d]/g,'')"
|
|
||||||
placeholder="请输入列席代表人数"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="其中特邀" prop="special_delegate">
|
|
||||||
<el-input v-model="formData.special_delegate" oninput="value=value.replace(/[^\d]/g,'')"
|
|
||||||
placeholder="请输入特邀代表人数"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>-->
|
|
||||||
|
|
||||||
<el-form-item label="会议议程" prop="meeting_topic" class="is-required">
|
|
||||||
<div id="meetingTopicRich"></div>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input maxlength="500" type="textarea" :rows="4" placeholder="请输入备注"
|
|
||||||
v-model="formData.remark"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item prop="files" label="请示附件" class="is-required">
|
|
||||||
<file-upload :max="1" :files.sync="formData.files">
|
|
||||||
<template #el-upload__tip>
|
|
||||||
<div class="el-upload__tip" slot="tip">图片类请上传jpg/png/jpeg等格式,文档类请上传doc/docx/xls/xlsx/pdf等格式,上传数量为1个</div>
|
|
||||||
</template>
|
|
||||||
</file-upload>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item style="text-align: right">
|
|
||||||
<el-button type="danger" @click="resetForm">重 置
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" @click="operation" :loading="subLoading">提 交</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
</guava>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function getQueryVariable(variable) {
|
function getQueryVariable(variable) {
|
||||||
let query = window.location.search.substring(1);
|
let query = window.location.search.substring(1);
|
||||||
let vars = query.split("&");
|
let vars = query.split("&");
|
||||||
for (let i = 0; i < vars.length; i++) {
|
for (let i = 0; i < vars.length; i++) {
|
||||||
let pair = vars[i].split("=");
|
let pair = vars[i].split("=");
|
||||||
if (pair[0] == variable) {
|
if (pair[0] == variable) {
|
||||||
return pair[1];
|
return pair[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
let E = window.wangEditor
|
let E = window.wangEditor
|
||||||
let meetingTopicRich = null
|
let meetingTopicRich = null
|
||||||
const vue = new Vue({
|
const vue = new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
data() {
|
data() {
|
||||||
const meetingTopicValid = (rule, value, callback) => {
|
const meetingTopicValid = (rule, value, callback) => {
|
||||||
if (!this.formData.meeting_topic || !dd3s.html2txt(this.formData.meeting_topic)) {
|
if (!this.formData.meeting_topic || !dd3s.html2txt(this.formData.meeting_topic)) {
|
||||||
callback(new Error('请填写会议议题'));
|
callback(new Error('请填写会议议题'));
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const filesValid = (rule, value, callback) => {
|
const filesValid = (rule, value, callback) => {
|
||||||
if (!this.formData.files || this.formData.files.length === 0) {
|
if (!this.formData.files || this.formData.files.length === 0) {
|
||||||
callback(new Error('请上传请示附件'));
|
callback(new Error('请上传请示附件'));
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
jsList: [],
|
jsList: [],
|
||||||
csOptions: [
|
csOptions: [
|
||||||
{id: "一", name: "一次"},
|
{id: "一", name: "一次"},
|
||||||
{id: "二", name: "二次"},
|
{id: "二", name: "二次"},
|
||||||
{id: "三", name: "三次"},
|
{id: "三", name: "三次"},
|
||||||
{id: "四", name: "四次"},
|
{id: "四", name: "四次"},
|
||||||
{id: "五", name: "五次"},
|
{id: "五", name: "五次"},
|
||||||
{id: "六", name: "六次"},
|
{id: "六", name: "六次"},
|
||||||
],
|
],
|
||||||
subLoading: false,
|
subLoading: false,
|
||||||
sessionOptions: [],
|
sessionOptions: [],
|
||||||
formData: {
|
formData: {
|
||||||
meeting_name: '',
|
meeting_name: '',
|
||||||
have_elect: false,
|
have_elect: false,
|
||||||
unit_name: '${@shiro.getPrincipalProperty("unit").getName()}',
|
unit_name: '${@shiro.getPrincipalProperty("unit").getName()}',
|
||||||
union_name: '${@shiro.getPrincipalProperty("union").getUnionname()}',
|
union_name: '${@shiro.getPrincipalProperty("union").getUnionname()}',
|
||||||
create_time: moment(new Date()).format("YYYY-MM-DD"),
|
create_time: moment(new Date()).format("YYYY-MM-DD"),
|
||||||
meeting_time: '',
|
meeting_time: '',
|
||||||
before_meeting_time: '',
|
before_meeting_time: '',
|
||||||
session_num: '',
|
session_num: '',
|
||||||
frequency: '',
|
frequency: '',
|
||||||
official_delegate: '',
|
official_delegate: '',
|
||||||
teacher_delegate: '',
|
teacher_delegate: '',
|
||||||
attend_delegate: '',
|
attend_delegate: '',
|
||||||
special_delegate: '',
|
special_delegate: '',
|
||||||
meeting_topic: '',
|
meeting_topic: '',
|
||||||
remark: '',
|
remark: '',
|
||||||
files: [],
|
files: [],
|
||||||
type: '届中会'
|
type: '届中会'
|
||||||
},
|
},
|
||||||
formRules: {
|
formRules: {
|
||||||
meeting_name: [{required: true, message: '请填写会议标题', trigger: ['blur', 'change']}],
|
meeting_name: [{required: true, message: '请填写会议标题', trigger: ['blur', 'change']}],
|
||||||
session_id: [{required: true, message: '请选择届次', trigger: ['blur', 'change']}],
|
session_id: [{required: true, message: '请选择届次', trigger: ['blur', 'change']}],
|
||||||
jdhjs: [{required: true, message: '请选择届数', trigger: ['blur', 'change']}],
|
jdhjs: [{required: true, message: '请选择届数', trigger: ['blur', 'change']}],
|
||||||
type: [{required: true, message: '请选择类型', trigger: ['blur', 'change']}],
|
type: [{required: true, message: '请选择类型', trigger: ['blur', 'change']}],
|
||||||
have_elect: [{required: true, message: '请选择有无选举事项', trigger: ['blur', 'change']}],
|
have_elect: [{required: true, message: '请选择有无选举事项', trigger: ['blur', 'change']}],
|
||||||
unit_name: [{required: true, message: '请选择填表单位', trigger: ['blur', 'change']}],
|
unit_name: [{required: true, message: '请选择填表单位', trigger: ['blur', 'change']}],
|
||||||
create_time: [{required: true, message: '请选择填表日期', trigger: ['blur', 'change']}],
|
create_time: [{required: true, message: '请选择填表日期', trigger: ['blur', 'change']}],
|
||||||
meeting_time: [{required: true, message: '请选择会议时间', trigger: ['blur', 'change']}],
|
meeting_time: [{required: true, message: '请选择会议时间', trigger: ['blur', 'change']}],
|
||||||
session_num: [{required: true, message: '请选择届数', trigger: ['blur', 'change']}],
|
session_num: [{required: true, message: '请选择届数', trigger: ['blur', 'change']}],
|
||||||
frequency: [{required: true, message: '请选择次数', trigger: ['blur', 'change']}],
|
frequency: [{required: true, message: '请选择次数', trigger: ['blur', 'change']}],
|
||||||
official_delegate: [{required: true, message: '请填写正式代表人数', trigger: ['blur', 'change']}],
|
official_delegate: [{required: true, message: '请填写正式代表人数', trigger: ['blur', 'change']}],
|
||||||
meeting_topic: [{validator: meetingTopicValid, trigger: ['blur', 'change']}],
|
meeting_topic: [{validator: meetingTopicValid, trigger: ['blur', 'change']}],
|
||||||
files: [{validator: filesValid, trigger: ['blur', 'change']}],
|
files: [{validator: filesValid, trigger: ['blur', 'change']}],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue')
|
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
jdhjsChange(o) {
|
jdhjsChange(o) {
|
||||||
const j = this.formData.jdhjs ? ('第' + this.formData.jdhjs + '届') : ''
|
const j = this.formData.jdhjs ? ('第' + this.formData.jdhjs + '届') : ''
|
||||||
const c = this.formData.jdhcs ? ('第' + this.formData.jdhcs + '次') : ''
|
const c = this.formData.jdhcs ? ('第' + this.formData.jdhcs + '次') : ''
|
||||||
const str = '关于召开' + this.formData.unit_name + j + c + '教职工代表大会、工会会员代表大会的请示'
|
const str = '关于召开' + this.formData.unit_name + j + c + '教职工代表大会、工会会员代表大会的请示'
|
||||||
this.formData.meeting_name = str
|
this.formData.meeting_name = str
|
||||||
},
|
},
|
||||||
jdhcsChange(o) {
|
jdhcsChange(o) {
|
||||||
const j = this.formData.jdhjs ? ('第' + this.formData.jdhjs + '届') : ''
|
const j = this.formData.jdhjs ? ('第' + this.formData.jdhjs + '届') : ''
|
||||||
const c = this.formData.jdhcs ? ('第' + this.formData.jdhcs + '次') : ''
|
const c = this.formData.jdhcs ? ('第' + this.formData.jdhcs + '次') : ''
|
||||||
const str = '关于召开' + this.formData.unit_name + j + c + '教职工代表大会、工会会员代表大会的请示'
|
const str = '关于召开' + this.formData.unit_name + j + c + '教职工代表大会、工会会员代表大会的请示'
|
||||||
this.formData.meeting_name = str
|
this.formData.meeting_name = str
|
||||||
},
|
},
|
||||||
resetForm() {
|
resetForm() {
|
||||||
this.$refs["addForm"].resetFields();
|
this.$refs["addForm"].resetFields();
|
||||||
meetingTopicRich.txt.html('')
|
meetingTopicRich.txt.html('')
|
||||||
meetingTopicRich.create()
|
meetingTopicRich.create()
|
||||||
},
|
},
|
||||||
async openEdit(id) {
|
async openEdit(id) {
|
||||||
const resp = await $.get(loc() + "/findOne", {id})
|
const resp = await $.get(loc() + "/findOne", {id})
|
||||||
if(resp.code===0){
|
if (resp.code === 0) {
|
||||||
const data = resp.data
|
const data = resp.data
|
||||||
data.files = JSON.parse(data.files)
|
data.files = JSON.parse(data.files)
|
||||||
this.formData = data
|
this.formData = data
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
meetingTopicRich = new E('#meetingTopicRich')
|
meetingTopicRich = new E('#meetingTopicRich')
|
||||||
meetingTopicRich.config.onchange = (html) => {
|
meetingTopicRich.config.onchange = (html) => {
|
||||||
this.formData.meeting_topic = html
|
this.formData.meeting_topic = html
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
meetingTopicRich.create()
|
meetingTopicRich.create()
|
||||||
meetingTopicRich.txt.html(data.meeting_topic)
|
meetingTopicRich.txt.html(data.meeting_topic)
|
||||||
}, 100)
|
}, 100)
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
this.notifyWarning(resp.msg)
|
this.notifyWarning(resp.msg)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
initPage() {
|
initPage() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
meetingTopicRich = new E('#meetingTopicRich')
|
meetingTopicRich = new E('#meetingTopicRich')
|
||||||
meetingTopicRich.config.onchange = (html) => {
|
meetingTopicRich.config.onchange = (html) => {
|
||||||
this.formData.meeting_topic = html
|
this.formData.meeting_topic = html
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
meetingTopicRich.create()
|
meetingTopicRich.create()
|
||||||
}, 100)
|
}, 100)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async operation() {
|
async operation() {
|
||||||
if (!this.formData.files || this.formData.files.length === 0) {
|
if (!this.formData.files || this.formData.files.length === 0) {
|
||||||
this.$notify.warning({title: '提示', message: '请上传请示附件!'});
|
this.$notify.warning({title: '提示', message: '请上传请示附件!'});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let method = this.formData.id ? "/doEdit" : "/doAdd"
|
let method = this.formData.id ? "/doEdit" : "/doAdd"
|
||||||
this.$refs["addForm"].validate(async (valid) => {
|
this.$refs["addForm"].validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
/*this.subLoading = true
|
/*this.subLoading = true
|
||||||
const loading = this.$loading({
|
const loading = this.$loading({
|
||||||
lock: true,
|
lock: true,
|
||||||
text: '正在提交...',
|
text: '正在提交...',
|
||||||
spinner: 'el-icon-loading',
|
spinner: 'el-icon-loading',
|
||||||
background: COVER_LAYER_COLOR
|
background: COVER_LAYER_COLOR
|
||||||
});*/
|
});*/
|
||||||
|
|
||||||
this.formData.jdhallname = this.formData.jdhjs + '届'
|
this.formData.jdhallname = this.formData.jdhjs + '届'
|
||||||
if(this.formData.jdhcs) {
|
if (this.formData.jdhcs) {
|
||||||
this.formData.jdhallname += this.formData.jdhcs + '次'
|
this.formData.jdhallname += this.formData.jdhcs + '次'
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = clone(this.formData)
|
const data = clone(this.formData)
|
||||||
data.files = JSON.stringify(data.files)
|
data.files = JSON.stringify(data.files)
|
||||||
|
|
||||||
const resp = await $.post(loc() + method, {jdhLevel2: JSON.stringify(data)})
|
const resp = await $.post(loc() + method, {jdhLevel2: JSON.stringify(data)})
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: '成功',
|
title: '成功',
|
||||||
message: resp.msg,
|
message: resp.msg,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
sublime.jumpPagePjax('/platform/jdh/level2/reading')
|
sublime.jumpPagePjax('/platform/jdh/level2/reading')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*requestLaterFun(resp, () => {
|
/*requestLaterFun(resp, () => {
|
||||||
window.location.href = '/platform/jdh/level2/reading'
|
window.location.href = '/platform/jdh/level2/reading'
|
||||||
}, () => {
|
}, () => {
|
||||||
this.$notify.error({title: '失败', message: resp.msg});
|
this.$notify.error({title: '失败', message: resp.msg});
|
||||||
}, () => {
|
}, () => {
|
||||||
loading.close()
|
loading.close()
|
||||||
this.subLoading = false
|
this.subLoading = false
|
||||||
})*/
|
})*/
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
this.sessionOptions = await getOpenJdhByDb()
|
this.sessionOptions = await getOpenJdhByDb()
|
||||||
let id = getQueryVariable("id")
|
let id = getQueryVariable("id")
|
||||||
id ? this.openEdit(id) : this.initPage()
|
id ? this.openEdit(id) : this.initPage()
|
||||||
this.jsList = await getJc()
|
this.jsList = await getJc()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<!--#
|
<!--#
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,6 +148,9 @@ layout("/layouts/platform.html"){
|
|||||||
<el-dropdown-item :command="{type:'view',data:scope.row}">
|
<el-dropdown-item :command="{type:'view',data:scope.row}">
|
||||||
预览
|
预览
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item :command="{type:'download',data:scope.row}">
|
||||||
|
下载
|
||||||
|
</el-dropdown-item>
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
v-if="(${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}) || scope.row.state == 0"
|
v-if="(${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}) || scope.row.state == 0"
|
||||||
:command="{type:'edit',data:scope.row}">
|
:command="{type:'edit',data:scope.row}">
|
||||||
@@ -217,7 +220,13 @@ layout("/layouts/platform.html"){
|
|||||||
</template>
|
</template>
|
||||||
</el-form-item>-->
|
</el-form-item>-->
|
||||||
<el-form-item prop="files" label="附件上传">
|
<el-form-item prop="files" label="附件上传">
|
||||||
<file-upload :files.sync="formData.files"></file-upload>
|
<file-upload :files.sync="formData.files">
|
||||||
|
<template #el-upload__tip>
|
||||||
|
<div class="el-upload__tip" slot="tip">
|
||||||
|
图片类请上传jpg/png/jpeg等格式,文档类请上传doc/docx/xls/xlsx/pdf等格式,压缩包请上传zip/war/rar,上传数量为10个
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</file-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -266,7 +275,13 @@ layout("/layouts/platform.html"){
|
|||||||
</el-form-item>-->
|
</el-form-item>-->
|
||||||
|
|
||||||
<el-form-item prop="files" label="附件上传">
|
<el-form-item prop="files" label="附件上传">
|
||||||
<file-upload :files.sync="formData.files"></file-upload>
|
<file-upload :files.sync="formData.files" :max="10">
|
||||||
|
<template #el-upload__tip>
|
||||||
|
<div class="el-upload__tip" slot="tip">
|
||||||
|
图片类请上传jpg/png/jpeg等格式,文档类请上传doc/docx/xls/xlsx/pdf等格式,压缩包请上传zip/war/rar,上传数量为10个
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</file-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -416,8 +431,14 @@ layout("/layouts/platform.html"){
|
|||||||
this.openEdit(data)
|
this.openEdit(data)
|
||||||
} else if (type == 'delete') {
|
} else if (type == 'delete') {
|
||||||
this.doDelete(data.id)
|
this.doDelete(data.id)
|
||||||
|
}else if (type == 'download') {
|
||||||
|
this.doDownload(data.id)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
doDownload(id){
|
||||||
|
window.location.href = "/platform/jdh2/gzzlgl/doDownload?id=" + id
|
||||||
|
|
||||||
|
},
|
||||||
handleChange: function (file, filelist) {
|
handleChange: function (file, filelist) {
|
||||||
this.fileList = filelist;
|
this.fileList = filelist;
|
||||||
},
|
},
|
||||||
@@ -454,7 +475,7 @@ layout("/layouts/platform.html"){
|
|||||||
const formData = clone(this.formData)
|
const formData = clone(this.formData)
|
||||||
formData.files = JSON.stringify(formData.files)
|
formData.files = JSON.stringify(formData.files)
|
||||||
const resp = await $.post('/platform/jdh2/gzzlgl/doEdit', formData)
|
const resp = await $.post('/platform/jdh2/gzzlgl/doEdit', formData)
|
||||||
if (resp.code===0){
|
if (resp.code === 0) {
|
||||||
this.editDialogVisible = false
|
this.editDialogVisible = false
|
||||||
this.doSearch()
|
this.doSearch()
|
||||||
}
|
}
|
||||||
@@ -518,7 +539,7 @@ layout("/layouts/platform.html"){
|
|||||||
formData.files = JSON.stringify(formData.files)
|
formData.files = JSON.stringify(formData.files)
|
||||||
|
|
||||||
const resp = await $.post('/platform/jdh2/gzzlgl/doAdd', formData)
|
const resp = await $.post('/platform/jdh2/gzzlgl/doAdd', formData)
|
||||||
if (resp.code===0){
|
if (resp.code === 0) {
|
||||||
this.addDialogVisible = false
|
this.addDialogVisible = false
|
||||||
this.doSearch()
|
this.doSearch()
|
||||||
loading.close()
|
loading.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user