Merge remote-tracking branch 'origin/feature_职代会' into feature_职代会UI优化
# Conflicts: # src/main/resources/views/layouts/platform_h5.html
This commit is contained in:
+170
@@ -0,0 +1,170 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.congress.service.CongressManageService;
|
||||
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.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.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
@IocBean
|
||||
@At("/platform/congress/materials/manage")
|
||||
@Ok("json:full")
|
||||
public class CongressMaterialsManageController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private CongressManageService congressManageService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/democratic/congress/materials/manage/index.html")
|
||||
@SaCheckPermission("congress.materials.manage")
|
||||
public void index() {
|
||||
}
|
||||
@At("/sessions")
|
||||
@SaCheckPermission("congress.materials.manage")
|
||||
public Result sessions() {
|
||||
return Result.success(congressManageService.sessionOptions());
|
||||
}
|
||||
|
||||
@At("/types")
|
||||
@SaCheckPermission("congress.materials.manage")
|
||||
public Result types() {
|
||||
return Result.success(congressManageService.typeOptions());
|
||||
}
|
||||
|
||||
@At("/pageData")
|
||||
@SaCheckPermission("congress.materials.manage")
|
||||
public Result materialsPageData(PageForm pageForm,
|
||||
@Param("sessionId") String sessionId,
|
||||
@Param("typeId") String typeId,
|
||||
@Param("name") String name) {
|
||||
StringBuilder text = new StringBuilder("""
|
||||
SELECT
|
||||
m.id,
|
||||
m.name,
|
||||
m.session_id AS sessionId,
|
||||
m.time_id AS timeId,
|
||||
m.type_id AS typeId,
|
||||
m.sort_no AS sortNo,
|
||||
m.file_name AS fileName,
|
||||
m.file_url AS fileUrl,
|
||||
m.file_type AS fileType,
|
||||
m.file_size AS fileSize,
|
||||
m.create_time AS createTime,
|
||||
mt.name AS typeName,
|
||||
tcs.fullName AS sessionName
|
||||
FROM congress_materials m
|
||||
LEFT JOIN congress_materials_type mt ON mt.id = m.type_id
|
||||
LEFT JOIN teacher_congress_session tcs ON tcs.id = m.session_id
|
||||
WHERE COALESCE(m.deleted, 0) = 0
|
||||
""");
|
||||
NutMap params = NutMap.NEW();
|
||||
congressManageService.appendEquals(text, params, "m.session_id", "sessionId", sessionId);
|
||||
congressManageService.appendEquals(text, params, "m.type_id", "typeId", typeId);
|
||||
if (StrUtil.isNotBlank(name)) {
|
||||
text.append(" AND m.name LIKE @name");
|
||||
params.addv("name", "%" + name.trim() + "%");
|
||||
}
|
||||
text.append(" ORDER BY m.sort_no, m.create_time DESC, m.id DESC");
|
||||
return congressManageService.page(pageForm, text.toString(), params);
|
||||
}
|
||||
|
||||
@At("/get")
|
||||
@SaCheckPermission("congress.materials.manage")
|
||||
public Result materialsGet(@Param("id") String id) {
|
||||
return Result.success(congressManageService.fetchMap("""
|
||||
SELECT
|
||||
id,
|
||||
name,
|
||||
session_id AS sessionId,
|
||||
time_id AS timeId,
|
||||
type_id AS typeId,
|
||||
sort_no AS sortNo,
|
||||
file_name AS fileName,
|
||||
file_url AS fileUrl,
|
||||
file_type AS fileType,
|
||||
file_size AS fileSize
|
||||
FROM congress_materials
|
||||
WHERE id = @id
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
""", NutMap.NEW().addv("id", id)));
|
||||
}
|
||||
|
||||
@At("/save")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("congress.materials.manage")
|
||||
@SLog(tag = "职代会-会议资料", msg = "保存会议资料")
|
||||
public Result materialsSave(@Param("id") String id,
|
||||
@Param("name") String name,
|
||||
@Param("sessionId") String sessionId,
|
||||
@Param("typeId") String typeId,
|
||||
@Param("sortNo") Integer sortNo,
|
||||
@Param("fileName") String fileName,
|
||||
@Param("fileUrl") String fileUrl,
|
||||
@Param("fileType") String fileType,
|
||||
@Param("fileSize") String fileSize) {
|
||||
if (StrUtil.hasBlank(name, sessionId, typeId, fileUrl)) {
|
||||
return Result.error("届次、资料名称、资料类型和文件不能为空");
|
||||
}
|
||||
Date now = new Date();
|
||||
Chain chain = Chain.make("name", name.trim())
|
||||
.add("session_id", sessionId)
|
||||
.add("time_id", null)
|
||||
.add("type_id", typeId)
|
||||
.add("sort_no", sortNo == null ? 0 : sortNo)
|
||||
.add("file_name", StrUtil.blankToDefault(fileName, name.trim()))
|
||||
.add("file_url", fileUrl)
|
||||
.add("file_type", congressManageService.normalizeFileType(fileType, fileName, fileUrl))
|
||||
.add("file_size", StrUtil.blankToDefault(fileSize, null))
|
||||
.add("update_time", now);
|
||||
if (StrUtil.isBlank(id)) {
|
||||
String newId = R.UU32();
|
||||
chain.add("id", newId)
|
||||
.add("create_time", now)
|
||||
.add("deleted", 0);
|
||||
dao.insert("congress_materials", chain);
|
||||
return Result.success().addData(newId);
|
||||
}
|
||||
dao.update("congress_materials", chain,
|
||||
Cnd.where("id", "=", id).and("deleted", "=", 0));
|
||||
return Result.success().addData(id);
|
||||
}
|
||||
|
||||
@At("/delete")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("congress.materials.manage")
|
||||
@SLog(tag = "职代会-会议资料", msg = "删除会议资料")
|
||||
public Result materialsDelete(@Param("id") String id) {
|
||||
if (congressManageService.count("""
|
||||
SELECT COUNT(1)
|
||||
FROM congress_voting_issue
|
||||
WHERE materials_id = @id
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
""", NutMap.NEW().addv("id", id)) > 0) {
|
||||
return Result.error("该资料已关联投票议题,不能删除");
|
||||
}
|
||||
congressManageService.softDelete("congress_materials", id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+132
@@ -0,0 +1,132 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.congress.service.CongressManageService;
|
||||
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.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.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
@IocBean
|
||||
@At("/platform/congress/materials/type")
|
||||
@Ok("json:full")
|
||||
public class CongressMaterialsTypeController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private CongressManageService congressManageService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/democratic/congress/materials/type/index.html")
|
||||
@SaCheckPermission("congress.materials.type")
|
||||
public void index() {
|
||||
}
|
||||
@At("/pageData")
|
||||
@SaCheckPermission("congress.materials.type")
|
||||
public Result typePageData(PageForm pageForm,
|
||||
@Param("name") String name,
|
||||
@Param("isVote") String isVote) {
|
||||
StringBuilder text = new StringBuilder("""
|
||||
SELECT id, name, is_vote AS isVote, sort_no AS sortNo, create_time AS createTime
|
||||
FROM congress_materials_type
|
||||
WHERE COALESCE(deleted, 0) = 0
|
||||
""");
|
||||
NutMap params = NutMap.NEW();
|
||||
if (StrUtil.isNotBlank(name)) {
|
||||
text.append(" AND name LIKE @name");
|
||||
params.addv("name", "%" + name.trim() + "%");
|
||||
}
|
||||
if (StrUtil.isNotBlank(isVote)) {
|
||||
text.append(" AND is_vote = @isVote");
|
||||
params.addv("isVote", "1".equals(isVote) || "true".equalsIgnoreCase(isVote) ? 1 : 0);
|
||||
}
|
||||
text.append(" ORDER BY sort_no, create_time, id");
|
||||
return congressManageService.page(pageForm, text.toString(), params);
|
||||
}
|
||||
|
||||
@At("/get")
|
||||
@SaCheckPermission("congress.materials.type")
|
||||
public Result typeGet(@Param("id") String id) {
|
||||
return Result.success(congressManageService.fetchMap("""
|
||||
SELECT id, name, is_vote AS isVote, sort_no AS sortNo
|
||||
FROM congress_materials_type
|
||||
WHERE id = @id
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
""", NutMap.NEW().addv("id", id)));
|
||||
}
|
||||
|
||||
@At("/save")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("congress.materials.type")
|
||||
@SLog(tag = "职代会-资料类型", msg = "保存资料类型")
|
||||
public Result typeSave(@Param("id") String id,
|
||||
@Param("name") String name,
|
||||
@Param("isVote") boolean isVote,
|
||||
@Param("sortNo") Integer sortNo) {
|
||||
if (StrUtil.isBlank(name)) {
|
||||
return Result.error("资料类型不能为空");
|
||||
}
|
||||
int repeat = congressManageService.count("""
|
||||
SELECT COUNT(1)
|
||||
FROM congress_materials_type
|
||||
WHERE name = @name
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
AND (@id IS NULL OR id <> @id)
|
||||
""", NutMap.NEW().addv("name", name.trim()).addv("id", StrUtil.blankToDefault(id, null)));
|
||||
if (repeat > 0) {
|
||||
return Result.error("资料类型已存在");
|
||||
}
|
||||
Date now = new Date();
|
||||
Chain chain = Chain.make("name", name.trim())
|
||||
.add("is_vote", isVote ? 1 : 0)
|
||||
.add("sort_no", sortNo == null ? 0 : sortNo)
|
||||
.add("update_time", now);
|
||||
if (StrUtil.isBlank(id)) {
|
||||
chain.add("id", R.UU32())
|
||||
.add("create_time", now)
|
||||
.add("deleted", 0);
|
||||
dao.insert("congress_materials_type", chain);
|
||||
} else {
|
||||
dao.update("congress_materials_type", chain,
|
||||
Cnd.where("id", "=", id).and("deleted", "=", 0));
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At("/delete")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("congress.materials.type")
|
||||
@SLog(tag = "职代会-资料类型", msg = "删除资料类型")
|
||||
public Result typeDelete(@Param("id") String id) {
|
||||
if (congressManageService.count("""
|
||||
SELECT COUNT(1)
|
||||
FROM congress_materials
|
||||
WHERE type_id = @id
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
""", NutMap.NEW().addv("id", id)) > 0) {
|
||||
return Result.error("该类型下已有资料,不能删除");
|
||||
}
|
||||
congressManageService.softDelete("congress_materials_type", id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.congress.service.CongressManageService;
|
||||
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.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.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
@IocBean
|
||||
@At("/platform/congress/record")
|
||||
@Ok("json:full")
|
||||
public class CongressRecordController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private CongressManageService congressManageService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/democratic/congress/record/index.html")
|
||||
@SaCheckPermission("congress.signIn.record")
|
||||
public void index() {
|
||||
}
|
||||
@At("/sessions")
|
||||
@SaCheckPermission("congress.signIn.record")
|
||||
public Result sessions() {
|
||||
return Result.success(congressManageService.sessionOptions());
|
||||
}
|
||||
|
||||
@At("/meetings")
|
||||
@SaCheckPermission("congress.signIn.record")
|
||||
public Result meetings(@Param("sessionId") String sessionId) {
|
||||
return Result.success(congressManageService.meetingOptions(sessionId));
|
||||
}
|
||||
|
||||
@At("/pageData")
|
||||
@SaCheckPermission("congress.signIn.record")
|
||||
public Result recordPageData(PageForm pageForm,
|
||||
@Param("sessionId") String sessionId,
|
||||
@Param("meetingId") String meetingId,
|
||||
@Param("keyword") String keyword) {
|
||||
StringBuilder text = new StringBuilder("""
|
||||
SELECT
|
||||
si.id,
|
||||
si.emplid,
|
||||
si.name,
|
||||
si.create_time AS signInTime,
|
||||
si.meeting_id AS meetingId,
|
||||
si.time_id AS timeId,
|
||||
m.meeting_name AS meetingName,
|
||||
m.sign_in_start_time AS signInStartTime,
|
||||
m.sign_in_end_time AS signInEndTime,
|
||||
tcs.fullName AS sessionName,
|
||||
COALESCE(r.delegation_name, d.name) AS delegationName
|
||||
FROM congress_sign_in si
|
||||
LEFT JOIN congress_sign_in_meeting m ON m.id = si.meeting_id
|
||||
LEFT JOIN teacher_congress_session tcs ON tcs.id = si.session_id AND tcs.delFlag = 0
|
||||
LEFT JOIN congress_rep r ON r.id = si.rep_id
|
||||
LEFT JOIN congress_delegation d ON d.id = si.delegation_id
|
||||
WHERE COALESCE(si.deleted, 0) = 0
|
||||
""");
|
||||
NutMap params = NutMap.NEW();
|
||||
congressManageService.appendEquals(text, params, "si.session_id", "sessionId", sessionId);
|
||||
congressManageService.appendEquals(text, params, "si.meeting_id", "meetingId", meetingId);
|
||||
if (StrUtil.isNotBlank(keyword)) {
|
||||
text.append(" AND (si.emplid LIKE @keyword OR si.name LIKE @keyword)");
|
||||
params.addv("keyword", "%" + keyword.trim() + "%");
|
||||
}
|
||||
text.append(" ORDER BY si.create_time DESC, si.id DESC");
|
||||
return congressManageService.page(pageForm, text.toString(), params);
|
||||
}
|
||||
|
||||
}
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.congress.service.CongressManageService;
|
||||
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.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.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
@IocBean
|
||||
@At("/platform/congress/signIn")
|
||||
@Ok("json:full")
|
||||
public class CongressSignInController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private CongressManageService congressManageService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/democratic/congress/signIn/index.html")
|
||||
@SaCheckPermission("congress.signIn.manage")
|
||||
public void index() {
|
||||
}
|
||||
@At("/sessions")
|
||||
@SaCheckPermission("congress.signIn.manage")
|
||||
public Result sessions() {
|
||||
return Result.success(congressManageService.sessionOptions());
|
||||
}
|
||||
|
||||
@At("/pageData")
|
||||
@SaCheckPermission("congress.signIn.manage")
|
||||
public Result signInPageData(PageForm pageForm, @Param("sessionId") String sessionId) {
|
||||
StringBuilder text = new StringBuilder("""
|
||||
SELECT
|
||||
m.id,
|
||||
m.meeting_name AS meetingName,
|
||||
m.sign_in_start_time AS signInStartTime,
|
||||
m.sign_in_end_time AS signInEndTime,
|
||||
m.session_id AS sessionId,
|
||||
m.time_id AS timeId,
|
||||
m.remark,
|
||||
tcs.fullName AS sessionName,
|
||||
(
|
||||
SELECT COUNT(1)
|
||||
FROM congress_sign_in si
|
||||
WHERE si.meeting_id = m.id
|
||||
AND COALESCE(si.deleted, 0) = 0
|
||||
) AS signInCount
|
||||
FROM congress_sign_in_meeting m
|
||||
LEFT JOIN teacher_congress_session tcs ON tcs.id = m.session_id AND tcs.delFlag = 0
|
||||
WHERE COALESCE(m.deleted, 0) = 0
|
||||
""");
|
||||
NutMap params = NutMap.NEW();
|
||||
congressManageService.appendEquals(text, params, "m.session_id", "sessionId", sessionId);
|
||||
text.append(" ORDER BY m.sign_in_start_time DESC, m.create_time DESC, m.id DESC");
|
||||
return congressManageService.page(pageForm, text.toString(), params);
|
||||
}
|
||||
|
||||
@At("/get")
|
||||
@SaCheckPermission("congress.signIn.manage")
|
||||
public Result signInGet(@Param("id") String id) {
|
||||
return Result.success(congressManageService.fetchMap("""
|
||||
SELECT
|
||||
id,
|
||||
meeting_name AS meetingName,
|
||||
sign_in_start_time AS signInStartTime,
|
||||
sign_in_end_time AS signInEndTime,
|
||||
session_id AS sessionId,
|
||||
time_id AS timeId,
|
||||
remark
|
||||
FROM congress_sign_in_meeting
|
||||
WHERE id = @id
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
""", NutMap.NEW().addv("id", id)));
|
||||
}
|
||||
|
||||
@At("/save")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("congress.signIn.manage")
|
||||
@SLog(tag = "职代会-会议签到", msg = "保存会议签到配置")
|
||||
public Result signInSave(@Param("id") String id,
|
||||
@Param("meetingName") String meetingName,
|
||||
@Param("sessionId") String sessionId,
|
||||
@Param("signInStartTime") String signInStartTime,
|
||||
@Param("signInEndTime") String signInEndTime,
|
||||
@Param("remark") String remark) {
|
||||
if (StrUtil.hasBlank(meetingName, sessionId, signInStartTime, signInEndTime)) {
|
||||
return Result.error("届次、会议名称和签到时间不能为空");
|
||||
}
|
||||
Date startTime = congressManageService.parseDate(signInStartTime);
|
||||
Date endTime = congressManageService.parseDate(signInEndTime);
|
||||
if (startTime == null || endTime == null) {
|
||||
return Result.error("签到时间格式不正确");
|
||||
}
|
||||
if (!endTime.after(startTime)) {
|
||||
return Result.error("签到结束时间必须晚于开始时间");
|
||||
}
|
||||
Date now = new Date();
|
||||
Chain chain = Chain.make("meeting_name", meetingName.trim())
|
||||
.add("session_id", sessionId)
|
||||
.add("time_id", null)
|
||||
.add("sign_in_start_time", startTime)
|
||||
.add("sign_in_end_time", endTime)
|
||||
.add("remark", StrUtil.blankToDefault(remark, null))
|
||||
.add("update_time", now);
|
||||
if (StrUtil.isBlank(id)) {
|
||||
chain.add("id", R.UU32())
|
||||
.add("sign_in_count", 0)
|
||||
.add("create_time", now)
|
||||
.add("deleted", 0);
|
||||
dao.insert("congress_sign_in_meeting", chain);
|
||||
} else {
|
||||
dao.update("congress_sign_in_meeting", chain,
|
||||
Cnd.where("id", "=", id).and("deleted", "=", 0));
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At("/delete")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("congress.signIn.manage")
|
||||
@SLog(tag = "职代会-会议签到", msg = "删除会议签到配置")
|
||||
public Result signInDelete(@Param("id") String id) {
|
||||
if (congressManageService.count("""
|
||||
SELECT COUNT(1)
|
||||
FROM congress_sign_in
|
||||
WHERE meeting_id = @id
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
""", NutMap.NEW().addv("id", id)) > 0) {
|
||||
return Result.error("该会议已有签到记录,不能删除");
|
||||
}
|
||||
congressManageService.softDelete("congress_sign_in_meeting", id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+271
@@ -0,0 +1,271 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.congress.service.CongressManageService;
|
||||
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.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.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
@IocBean
|
||||
@At("/platform/congress/materials/issue")
|
||||
@Ok("json:full")
|
||||
public class CongressVotingIssueController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private CongressManageService congressManageService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/democratic/congress/materials/issue/index.html")
|
||||
@SaCheckPermission("congress.vote.issue")
|
||||
public void index() {
|
||||
}
|
||||
@At("/sessions")
|
||||
@SaCheckPermission("congress.vote.issue")
|
||||
public Result sessions() {
|
||||
return Result.success(congressManageService.sessionOptions());
|
||||
}
|
||||
|
||||
@At("/types")
|
||||
@SaCheckPermission("congress.vote.issue")
|
||||
public Result types() {
|
||||
return Result.success(congressManageService.typeOptions());
|
||||
}
|
||||
|
||||
@At("/materials")
|
||||
@SaCheckPermission("congress.vote.issue")
|
||||
public Result materials(@Param("sessionId") String sessionId, @Param("typeId") String typeId) {
|
||||
return Result.success(congressManageService.materialOptions(sessionId, typeId));
|
||||
}
|
||||
|
||||
@At("/uploadMaterial")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("congress.vote.issue")
|
||||
@SLog(tag = "职代会-投票管理", msg = "快捷上传投票资料")
|
||||
public Result uploadMaterial(@Param("sessionId") String sessionId,
|
||||
@Param("typeId") String typeId,
|
||||
@Param("name") String name,
|
||||
@Param("fileName") String fileName,
|
||||
@Param("fileUrl") String fileUrl,
|
||||
@Param("fileType") String fileType,
|
||||
@Param("fileSize") String fileSize) {
|
||||
if (StrUtil.hasBlank(sessionId, typeId, fileUrl)) {
|
||||
return Result.error("届次、投票类型和文件不能为空");
|
||||
}
|
||||
if (congressManageService.count("""
|
||||
SELECT COUNT(1)
|
||||
FROM teacher_congress_session
|
||||
WHERE id = @sessionId
|
||||
AND delFlag = 0
|
||||
""", NutMap.NEW().addv("sessionId", sessionId)) <= 0) {
|
||||
return Result.error("所选届次不存在");
|
||||
}
|
||||
if (congressManageService.count("""
|
||||
SELECT COUNT(1)
|
||||
FROM congress_materials_type
|
||||
WHERE id = @typeId
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
AND COALESCE(is_vote, 0) = 1
|
||||
""", NutMap.NEW().addv("typeId", typeId)) <= 0) {
|
||||
return Result.error("所选投票类型不存在");
|
||||
}
|
||||
Date now = new Date();
|
||||
String materialName = StrUtil.blankToDefault(name, StrUtil.blankToDefault(fileName, "资料")).trim();
|
||||
String newId = R.UU32();
|
||||
dao.insert("congress_materials", Chain.make("id", newId)
|
||||
.add("name", materialName)
|
||||
.add("session_id", sessionId)
|
||||
.add("time_id", null)
|
||||
.add("type_id", typeId)
|
||||
.add("sort_no", 0)
|
||||
.add("file_name", StrUtil.blankToDefault(fileName, materialName))
|
||||
.add("file_url", fileUrl)
|
||||
.add("file_type", congressManageService.normalizeFileType(fileType, fileName, fileUrl))
|
||||
.add("file_size", StrUtil.blankToDefault(fileSize, null))
|
||||
.add("create_time", now)
|
||||
.add("update_time", now)
|
||||
.add("deleted", 0));
|
||||
return Result.success(NutMap.NEW()
|
||||
.addv("id", newId)
|
||||
.addv("name", materialName)
|
||||
.addv("fileName", StrUtil.blankToDefault(fileName, materialName))
|
||||
.addv("fileUrl", fileUrl));
|
||||
}
|
||||
|
||||
@At("/pageData")
|
||||
@SaCheckPermission("congress.vote.issue")
|
||||
public Result issuePageData(PageForm pageForm,
|
||||
@Param("sessionId") String sessionId,
|
||||
@Param("name") String name) {
|
||||
StringBuilder text = new StringBuilder("""
|
||||
SELECT
|
||||
i.id,
|
||||
i.name,
|
||||
i.description,
|
||||
i.session_id AS sessionId,
|
||||
i.time_id AS timeId,
|
||||
i.type_id AS typeId,
|
||||
i.materials_id AS materialsId,
|
||||
i.voting_start_time AS votingStartTime,
|
||||
i.voting_end_time AS votingEndTime,
|
||||
mt.name AS typeName,
|
||||
m.name AS materialsName,
|
||||
m.file_name AS fileName,
|
||||
m.file_url AS fileUrl,
|
||||
tcs.fullName AS sessionName,
|
||||
(
|
||||
SELECT COUNT(1)
|
||||
FROM congress_voting_record r
|
||||
WHERE r.issue_id = i.id
|
||||
AND COALESCE(r.deleted, 0) = 0
|
||||
) AS voteCount
|
||||
FROM congress_voting_issue i
|
||||
LEFT JOIN congress_materials_type mt ON mt.id = i.type_id
|
||||
LEFT JOIN congress_materials m ON m.id = i.materials_id
|
||||
LEFT JOIN teacher_congress_session tcs ON tcs.id = i.session_id AND tcs.delFlag = 0
|
||||
WHERE COALESCE(i.deleted, 0) = 0
|
||||
""");
|
||||
NutMap params = NutMap.NEW();
|
||||
congressManageService.appendEquals(text, params, "i.session_id", "sessionId", sessionId);
|
||||
if (StrUtil.isNotBlank(name)) {
|
||||
text.append(" AND i.name LIKE @name");
|
||||
params.addv("name", "%" + name.trim() + "%");
|
||||
}
|
||||
text.append(" ORDER BY i.create_time DESC, i.id DESC");
|
||||
return congressManageService.page(pageForm, text.toString(), params);
|
||||
}
|
||||
|
||||
@At("/get")
|
||||
@SaCheckPermission("congress.vote.issue")
|
||||
public Result issueGet(@Param("id") String id) {
|
||||
return Result.success(congressManageService.fetchMap("""
|
||||
SELECT
|
||||
id,
|
||||
name,
|
||||
description,
|
||||
content,
|
||||
session_id AS sessionId,
|
||||
time_id AS timeId,
|
||||
type_id AS typeId,
|
||||
materials_id AS materialsId,
|
||||
voting_type AS votingType,
|
||||
voting_start_time AS votingStartTime,
|
||||
voting_end_time AS votingEndTime,
|
||||
voting_content AS votingContent,
|
||||
voting_content_item_header AS votingContentItemHeader,
|
||||
voting_content_option_header AS votingContentOptionHeader
|
||||
FROM congress_voting_issue
|
||||
WHERE id = @id
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
""", NutMap.NEW().addv("id", id)));
|
||||
}
|
||||
|
||||
@At("/save")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("congress.vote.issue")
|
||||
@SLog(tag = "职代会-投票管理", msg = "保存投票议题")
|
||||
public Result issueSave(@Param("id") String id,
|
||||
@Param("name") String name,
|
||||
@Param("description") String description,
|
||||
@Param("sessionId") String sessionId,
|
||||
@Param("typeId") String typeId,
|
||||
@Param("materialsId") String materialsId,
|
||||
@Param("votingStartTime") String votingStartTime,
|
||||
@Param("votingEndTime") String votingEndTime,
|
||||
@Param("votingContent") String votingContent,
|
||||
@Param("votingContentItemHeader") String votingContentItemHeader,
|
||||
@Param("votingContentOptionHeader") String votingContentOptionHeader) {
|
||||
if (StrUtil.hasBlank(name, sessionId, typeId, materialsId,
|
||||
votingStartTime, votingEndTime, votingContent)) {
|
||||
return Result.error("届次、会议名称、投票类型、资料、投票时间和投票内容不能为空");
|
||||
}
|
||||
Date startTime = congressManageService.parseDate(votingStartTime);
|
||||
Date endTime = congressManageService.parseDate(votingEndTime);
|
||||
if (startTime == null || endTime == null || !endTime.after(startTime)) {
|
||||
return Result.error("投票结束时间必须晚于开始时间");
|
||||
}
|
||||
if (!JSONUtil.isTypeJSONArray(votingContent) || JSONUtil.parseArray(votingContent).isEmpty()) {
|
||||
return Result.error("请至少配置一个投票事项");
|
||||
}
|
||||
NutMap session = congressManageService.fetchMap("""
|
||||
SELECT id, fullName AS `sessionName`
|
||||
FROM teacher_congress_session
|
||||
WHERE id = @id
|
||||
AND delFlag = 0
|
||||
""", NutMap.NEW().addv("id", sessionId));
|
||||
if (session == null) {
|
||||
return Result.error("所选届次不存在");
|
||||
}
|
||||
Date now = new Date();
|
||||
Chain chain = Chain.make("name", name.trim())
|
||||
.add("description", StrUtil.blankToDefault(description, null))
|
||||
.add("session_id", sessionId)
|
||||
.add("session_name", session.getString("sessionName"))
|
||||
.add("time_id", null)
|
||||
.add("time_name", null)
|
||||
.add("type_id", typeId)
|
||||
.add("materials_id", materialsId)
|
||||
.add("voting_type", 1)
|
||||
.add("voting_start_time", startTime)
|
||||
.add("voting_end_time", endTime)
|
||||
.add("voting_content", votingContent)
|
||||
.add("voting_content_item_header", StrUtil.blankToDefault(votingContentItemHeader, "表决事项"))
|
||||
.add("voting_content_option_header", StrUtil.blankToDefault(votingContentOptionHeader, "表决内容"))
|
||||
.add("update_time", now);
|
||||
if (StrUtil.isBlank(id)) {
|
||||
chain.add("id", R.UU32())
|
||||
.add("create_time", now)
|
||||
.add("deleted", 0);
|
||||
dao.insert("congress_voting_issue", chain);
|
||||
} else {
|
||||
if (congressManageService.count("""
|
||||
SELECT COUNT(1)
|
||||
FROM congress_voting_record
|
||||
WHERE issue_id = @id
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
""", NutMap.NEW().addv("id", id)) > 0) {
|
||||
return Result.error("该议题已有投票记录,不能修改");
|
||||
}
|
||||
dao.update("congress_voting_issue", chain,
|
||||
Cnd.where("id", "=", id).and("deleted", "=", 0));
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At("/delete")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("congress.vote.issue")
|
||||
@SLog(tag = "职代会-投票管理", msg = "删除投票议题")
|
||||
public Result issueDelete(@Param("id") String id) {
|
||||
if (congressManageService.count("""
|
||||
SELECT COUNT(1)
|
||||
FROM congress_voting_record
|
||||
WHERE issue_id = @id
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
""", NutMap.NEW().addv("id", id)) > 0) {
|
||||
return Result.error("该议题已有投票记录,不能删除");
|
||||
}
|
||||
congressManageService.softDelete("congress_voting_issue", id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.congress.service.CongressManageService;
|
||||
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.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.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
@IocBean
|
||||
@At("/platform/congress/materials/statistical")
|
||||
@Ok("json:full")
|
||||
public class CongressVotingStatisticalController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private CongressManageService congressManageService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/democratic/congress/materials/statistical/index.html")
|
||||
@SaCheckPermission("congress.vote.statistical")
|
||||
public void index() {
|
||||
}
|
||||
@At("/sessions")
|
||||
@SaCheckPermission("congress.vote.statistical")
|
||||
public Result sessions() {
|
||||
return Result.success(congressManageService.sessionOptions());
|
||||
}
|
||||
|
||||
@At("/pageData")
|
||||
@SaCheckPermission("congress.vote.statistical")
|
||||
public Result statisticalPageData(PageForm pageForm,
|
||||
@Param("sessionId") String sessionId,
|
||||
@Param("name") String name) {
|
||||
StringBuilder text = new StringBuilder("""
|
||||
SELECT
|
||||
i.id,
|
||||
i.name,
|
||||
i.description,
|
||||
i.session_id AS sessionId,
|
||||
i.time_id AS timeId,
|
||||
i.type_id AS typeId,
|
||||
i.materials_id AS materialsId,
|
||||
i.voting_start_time AS votingStartTime,
|
||||
i.voting_end_time AS votingEndTime,
|
||||
mt.name AS typeName,
|
||||
m.name AS materialsName,
|
||||
m.file_name AS fileName,
|
||||
m.file_url AS fileUrl,
|
||||
tcs.fullName AS sessionName,
|
||||
(
|
||||
SELECT COUNT(1)
|
||||
FROM congress_voting_record r
|
||||
WHERE r.issue_id = i.id
|
||||
AND COALESCE(r.deleted, 0) = 0
|
||||
) AS voteCount
|
||||
FROM congress_voting_issue i
|
||||
LEFT JOIN congress_materials_type mt ON mt.id = i.type_id
|
||||
LEFT JOIN congress_materials m ON m.id = i.materials_id
|
||||
LEFT JOIN teacher_congress_session tcs ON tcs.id = i.session_id AND tcs.delFlag = 0
|
||||
WHERE COALESCE(i.deleted, 0) = 0
|
||||
""");
|
||||
NutMap params = NutMap.NEW();
|
||||
congressManageService.appendEquals(text, params, "i.session_id", "sessionId", sessionId);
|
||||
if (StrUtil.isNotBlank(name)) {
|
||||
text.append(" AND i.name LIKE @name");
|
||||
params.addv("name", "%" + name.trim() + "%");
|
||||
}
|
||||
text.append(" ORDER BY i.create_time DESC, i.id DESC");
|
||||
return congressManageService.page(pageForm, text.toString(), params);
|
||||
}
|
||||
|
||||
@At("/records")
|
||||
@SaCheckPermission("congress.vote.statistical")
|
||||
public Result voteRecords(@Param("issueId") String issueId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
r.id,
|
||||
r.emplid,
|
||||
r.name,
|
||||
r.vote_result AS voteResult,
|
||||
r.create_time AS createTime,
|
||||
COALESCE(rep.union_id, du.union_id) AS unionId,
|
||||
du.union_name AS unionName,
|
||||
COALESCE(rep.delegation_name, d.name) AS delegationName
|
||||
FROM congress_voting_record r
|
||||
LEFT JOIN congress_rep rep ON rep.id = r.rep_id
|
||||
LEFT JOIN congress_delegation d ON d.id = r.delegation_id
|
||||
LEFT JOIN (
|
||||
SELECT delegation_id, time_id, union_id, union_name
|
||||
FROM (
|
||||
SELECT
|
||||
delegation_id,
|
||||
time_id,
|
||||
union_id,
|
||||
union_name,
|
||||
ROW_NUMBER() OVER (
|
||||
PARTITION BY delegation_id, time_id
|
||||
ORDER BY create_time DESC, id DESC
|
||||
) AS row_num
|
||||
FROM congress_delegation_union
|
||||
WHERE COALESCE(deleted, 0) = 0
|
||||
) latest_union
|
||||
WHERE row_num = 1
|
||||
) du ON du.delegation_id = r.delegation_id AND du.time_id = r.time_id
|
||||
WHERE r.issue_id = @issueId
|
||||
AND COALESCE(r.deleted, 0) = 0
|
||||
ORDER BY r.create_time DESC, r.id DESC
|
||||
""");
|
||||
sql.setParam("issueId", issueId);
|
||||
sql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(sql);
|
||||
return Result.success(sql.getList(NutMap.class));
|
||||
}
|
||||
|
||||
}
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.h5controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.congress.service.CongressH5Service;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/h5/congress")
|
||||
@Ok("json:full")
|
||||
public class CongressH5Controller {
|
||||
|
||||
@Inject
|
||||
private CongressH5Service congressH5Service;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/congress/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/materials/list")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/congress/materials/list.html")
|
||||
@SaCheckLogin
|
||||
public void materialsListPage() {
|
||||
}
|
||||
|
||||
@At("/meeting/list")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/congress/meeting/list.html")
|
||||
@SaCheckLogin
|
||||
public void meetingListPage() {
|
||||
}
|
||||
|
||||
@At("/meeting/remark")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/congress/meeting/remark.html")
|
||||
@SaCheckLogin
|
||||
public void meetingRemarkPage() {
|
||||
}
|
||||
|
||||
@At("/pdf")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/congress/pdf.html")
|
||||
@SaCheckLogin
|
||||
public void pdfPage() {
|
||||
}
|
||||
|
||||
@At("/vote")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/congress/vote.html")
|
||||
@SaCheckLogin
|
||||
public void votePage() {
|
||||
}
|
||||
|
||||
@At("/voted")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/congress/voted.html")
|
||||
@SaCheckLogin
|
||||
public void votedPage() {
|
||||
}
|
||||
|
||||
@At("/repTimes")
|
||||
@SaCheckLogin
|
||||
public Result repTimes(@Param("emplid") String emplid) {
|
||||
return Result.success(congressH5Service.repTimes(emplid));
|
||||
}
|
||||
|
||||
@At("/materialsTypeList")
|
||||
@SaCheckLogin
|
||||
public Result materialsTypeList() {
|
||||
return Result.success(congressH5Service.materialsTypeList());
|
||||
}
|
||||
|
||||
@At("/materialsList")
|
||||
@SaCheckLogin
|
||||
public Result materialsList(@Param("typeId") String typeId,
|
||||
@Param("timeId") String timeId,
|
||||
@Param("emplid") String emplid,
|
||||
@Param("searchKeyword") String searchKeyword,
|
||||
@Param("fileType") String fileType,
|
||||
@Param("uploadTimeOrder") String uploadTimeOrder,
|
||||
@Param("pageNumber") Integer pageNumber,
|
||||
@Param("pageSize") Integer pageSize) {
|
||||
return Result.success(congressH5Service.materialsList(typeId, timeId, emplid, searchKeyword,
|
||||
fileType, uploadTimeOrder, pageNumber, pageSize));
|
||||
}
|
||||
|
||||
@At("/user/meetingList")
|
||||
@SaCheckLogin
|
||||
public Result userMeetingList(@Param("timeId") String timeId,
|
||||
@Param("emplid") String emplid,
|
||||
@Param("searchKeyword") String searchKeyword,
|
||||
@Param("signTimeStatus") String signTimeStatus,
|
||||
@Param("signInCountStatus") String signInCountStatus,
|
||||
@Param("signStatus") String signStatus,
|
||||
@Param("pageNumber") Integer pageNumber,
|
||||
@Param("pageSize") Integer pageSize) {
|
||||
return Result.success(congressH5Service.userMeetingList(timeId, emplid, searchKeyword,
|
||||
signTimeStatus, signInCountStatus, signStatus, pageNumber, pageSize));
|
||||
}
|
||||
|
||||
@At("/user/meetingRemark")
|
||||
@SaCheckLogin
|
||||
public Result meetingRemark(@Param("meetingId") String meetingId,
|
||||
@Param("timeId") String timeId,
|
||||
@Param("emplid") String emplid) {
|
||||
return Result.success(congressH5Service.meetingRemark(meetingId, timeId, emplid));
|
||||
}
|
||||
|
||||
@At("/signin")
|
||||
@SaCheckLogin
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result signin(@Param("repId") String repId,
|
||||
@Param("sessionId") String sessionId,
|
||||
@Param("timeId") String timeId,
|
||||
@Param("meetingId") String meetingId) {
|
||||
return congressH5Service.signin(repId, sessionId, timeId, meetingId);
|
||||
}
|
||||
|
||||
@At("/votingIssue")
|
||||
@SaCheckLogin
|
||||
public Result votingIssue(@Param("materialsId") String materialsId, @Param("repId") String repId) {
|
||||
return Result.success(congressH5Service.votingIssue(materialsId, repId));
|
||||
}
|
||||
|
||||
@At("/api/vote")
|
||||
@SaCheckLogin
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result voteSubmit(@Param("issueId") String issueId,
|
||||
@Param("repId") String repId,
|
||||
@Param("sessionId") String sessionId,
|
||||
@Param("timeId") String timeId,
|
||||
@Param("delegationId") String delegationId,
|
||||
@Param("voteResult") String voteResult) {
|
||||
return congressH5Service.voteSubmit(issueId, repId, sessionId, timeId, delegationId, voteResult);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.ColDefine;
|
||||
import org.nutz.dao.entity.annotation.ColType;
|
||||
import org.nutz.dao.entity.annotation.Column;
|
||||
import org.nutz.dao.entity.annotation.Comment;
|
||||
import org.nutz.dao.entity.annotation.Default;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 职代会历史表公共审计字段。
|
||||
*
|
||||
* <p>这些表使用下划线字段和 DATETIME 时间,不能继承使用驼峰字段、时间戳的通用 BaseModel。</p>
|
||||
*/
|
||||
@Data
|
||||
public abstract class CongressBaseModel implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column("create_by")
|
||||
@Comment("创建人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String createBy;
|
||||
|
||||
@Column("create_time")
|
||||
@Comment("创建时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date createTime;
|
||||
|
||||
@Column("update_by")
|
||||
@Comment("修改人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String updateBy;
|
||||
|
||||
@Column("update_time")
|
||||
@Comment("修改时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date updateTime;
|
||||
|
||||
@Column("deleted")
|
||||
@Comment("删除标记")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean deleted;
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_committee_elect_quota")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会委员预选分配")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_committee_elect_quota_session", fields = {"sessionId"}, unique = false)
|
||||
})
|
||||
public class CongressCommitteeElectQuota extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("zbztjmes")
|
||||
@Comment("筹备组推荐名额数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer zbztjmes;
|
||||
|
||||
@Column("wyhyxrs")
|
||||
@Comment("委员会预选人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer wyhyxrs;
|
||||
|
||||
@Column("dbttjzs")
|
||||
@Comment("代表团推荐总数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer dbttjzs;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("session_name")
|
||||
@Comment("届次名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String sessionName;
|
||||
|
||||
@Column("first_preselected_begin_time")
|
||||
@Comment("第一次预选开始时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date firstPreselectedBeginTime;
|
||||
|
||||
@Column("first_preselected_end_time")
|
||||
@Comment("第一次预选结束时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date firstPreselectedEndTime;
|
||||
|
||||
@Column("second_preselected_begin_time")
|
||||
@Comment("第二次预选开始时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date secondPreselectedBeginTime;
|
||||
|
||||
@Column("second_preselected_end_time")
|
||||
@Comment("第二次预选结束时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date secondPreselectedEndTime;
|
||||
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_committee_elect_rep")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会委员推选")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_committee_elect_rep_session", fields = {"sessionId"}, unique = false),
|
||||
@Index(name = "idx_congress_committee_elect_rep_delegation", fields = {"delegationId"}, unique = false)
|
||||
})
|
||||
public class CongressCommitteeElectRep extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("rep_id")
|
||||
@Comment("代表ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String repId;
|
||||
|
||||
@Column("type")
|
||||
@Comment("推选类型")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer type;
|
||||
|
||||
@Column("times")
|
||||
@Comment("第几次")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer times;
|
||||
|
||||
@Column("user_id")
|
||||
@Comment("团长用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("time_id")
|
||||
@Comment("会议ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String timeId;
|
||||
|
||||
@Column("delegation_id")
|
||||
@Comment("代表团ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String delegationId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_delegation")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会代表团")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_delegation_time", fields = {"timeId"}, unique = false)
|
||||
})
|
||||
public class CongressDelegation extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("name")
|
||||
@Comment("代表团名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String name;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("session_name")
|
||||
@Comment("届次名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String sessionName;
|
||||
|
||||
@Column("time_id")
|
||||
@Comment("会议ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String timeId;
|
||||
|
||||
@Column("time_name")
|
||||
@Comment("会议名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String timeName;
|
||||
|
||||
@Column("code")
|
||||
@Comment("编码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String code;
|
||||
|
||||
@Column("official_number")
|
||||
@Comment("正式代表人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer officialNumber;
|
||||
|
||||
@Column("attendance_number")
|
||||
@Comment("列席代表人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer attendanceNumber;
|
||||
|
||||
@Column("invite_number")
|
||||
@Comment("特邀代表人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer inviteNumber;
|
||||
|
||||
@Column("committee_allot_number")
|
||||
@Comment("委员分配人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer committeeAllotNumber;
|
||||
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_delegation_head")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会代表团团长")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_delegation_head_delegation", fields = {"delegationId"}, unique = false)
|
||||
})
|
||||
public class CongressDelegationHead extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("time_id")
|
||||
@Comment("会议ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String timeId;
|
||||
|
||||
@Column("delegation_id")
|
||||
@Comment("代表团ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String delegationId;
|
||||
|
||||
@Column("user_id")
|
||||
@Comment("用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column("emplid")
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String emplid;
|
||||
|
||||
@Column("name")
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String name;
|
||||
|
||||
@Column("unit")
|
||||
@Comment("单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String unit;
|
||||
|
||||
@Column("mobile")
|
||||
@Comment("电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String mobile;
|
||||
|
||||
@Column("sex")
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer sex;
|
||||
|
||||
@Column("identity")
|
||||
@Comment("身份")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer identity;
|
||||
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_delegation_rep")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会代表团代表")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_delegation_rep_delegation", fields = {"delegationId"}, unique = false)
|
||||
})
|
||||
public class CongressDelegationRep extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("delegation_id")
|
||||
@Comment("代表团ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String delegationId;
|
||||
|
||||
@Column("user_id")
|
||||
@Comment("用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column("empid")
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String empid;
|
||||
|
||||
@Column("name")
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String name;
|
||||
|
||||
@Column("unit")
|
||||
@Comment("单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String unit;
|
||||
|
||||
@Column("mobile")
|
||||
@Comment("电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String mobile;
|
||||
|
||||
@Column("sex")
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer sex;
|
||||
|
||||
@Column("identity")
|
||||
@Comment("身份")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer identity;
|
||||
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_delegation_union")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会代表团工会")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_delegation_union_delegation", fields = {"delegationId"}, unique = false),
|
||||
@Index(name = "idx_congress_delegation_union_time", fields = {"timeId"}, unique = false)
|
||||
})
|
||||
public class CongressDelegationUnion extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("delegation_id")
|
||||
@Comment("代表团ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String delegationId;
|
||||
|
||||
@Column("time_id")
|
||||
@Comment("会议ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String timeId;
|
||||
|
||||
@Column("union_id")
|
||||
@Comment("工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column("union_name")
|
||||
@Comment("工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String unionName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_materials")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会资料")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_materials_time_type", fields = {"timeId", "typeId"}, unique = false)
|
||||
})
|
||||
public class CongressMaterials extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("time_id")
|
||||
@Comment("会议ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String timeId;
|
||||
|
||||
@Column("type_id")
|
||||
@Comment("资料类型ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String typeId;
|
||||
|
||||
@Column("sort_no")
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer sortNo;
|
||||
|
||||
@Column("name")
|
||||
@Comment("资料名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String name;
|
||||
|
||||
@Column("file_name")
|
||||
@Comment("文件名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String fileName;
|
||||
|
||||
@Column("file_url")
|
||||
@Comment("文件地址")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
private String fileUrl;
|
||||
|
||||
@Column("file_type")
|
||||
@Comment("文件类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String fileType;
|
||||
|
||||
@Column("file_size")
|
||||
@Comment("文件大小")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String fileSize;
|
||||
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_materials_type")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会资料类型")
|
||||
public class CongressMaterialsType extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("sort_no")
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer sortNo;
|
||||
|
||||
@Column("name")
|
||||
@Comment("名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String name;
|
||||
|
||||
@Column("is_vote")
|
||||
@Comment("是否表决类")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean isVote;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_org")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会机构")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_org_session", fields = {"sessionId"}, unique = false),
|
||||
@Index(name = "idx_congress_org_parent", fields = {"parentId"}, unique = false)
|
||||
})
|
||||
public class CongressOrg extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("name")
|
||||
@Comment("机构名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String name;
|
||||
|
||||
@Column("code")
|
||||
@Comment("机构代码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String code;
|
||||
|
||||
@Column("type")
|
||||
@Comment("机构类别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String type;
|
||||
|
||||
@Column("remark")
|
||||
@Comment("备注")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
private String remark;
|
||||
|
||||
@Column("parent_id")
|
||||
@Comment("父节点")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String parentId;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("session_name")
|
||||
@Comment("届次名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String sessionName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_org_member")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会机构成员")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_org_member_org", fields = {"orgId"}, unique = false),
|
||||
@Index(name = "idx_congress_org_member_session", fields = {"sessionId"}, unique = false)
|
||||
})
|
||||
public class CongressOrgMember extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("user_id")
|
||||
@Comment("用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column("empid")
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String empid;
|
||||
|
||||
@Column("name")
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String name;
|
||||
|
||||
@Column("unit")
|
||||
@Comment("单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String unit;
|
||||
|
||||
@Column("mobile")
|
||||
@Comment("电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String mobile;
|
||||
|
||||
@Column("sex")
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer sex;
|
||||
|
||||
@Column("identity")
|
||||
@Comment("身份")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer identity;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("session_name")
|
||||
@Comment("届次名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String sessionName;
|
||||
|
||||
@Column("org_id")
|
||||
@Comment("机构ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String orgId;
|
||||
|
||||
@Column("role_id")
|
||||
@Comment("角色ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String roleId;
|
||||
|
||||
@Column("role_name")
|
||||
@Comment("角色名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String roleName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_rep")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会代表")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_rep_emplid", fields = {"emplid"}, unique = false),
|
||||
@Index(name = "idx_congress_rep_time_emplid", fields = {"timeId", "emplid"}, unique = false),
|
||||
@Index(name = "idx_congress_rep_session_id", fields = {"sessionId"}, unique = false)
|
||||
})
|
||||
public class CongressRep extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("time_id")
|
||||
@Comment("会议ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String timeId;
|
||||
|
||||
@Column("session_name")
|
||||
@Comment("届次名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String sessionName;
|
||||
|
||||
@Column("time_name")
|
||||
@Comment("会议名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String timeName;
|
||||
|
||||
@Column("user_id")
|
||||
@Comment("用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column("name")
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String name;
|
||||
|
||||
@Column("emplid")
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String emplid;
|
||||
|
||||
@Column("sex")
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 16)
|
||||
private String sex;
|
||||
|
||||
@Column("birthdate")
|
||||
@Comment("出生日期")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String birthdate;
|
||||
|
||||
@Column("politics_status")
|
||||
@Comment("政治面貌")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String politicsStatus;
|
||||
|
||||
@Column("position")
|
||||
@Comment("职务")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String position;
|
||||
|
||||
@Column("education")
|
||||
@Comment("学历")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String education;
|
||||
|
||||
@Column("work_unit")
|
||||
@Comment("工作单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String workUnit;
|
||||
|
||||
@Column("work_experience")
|
||||
@Comment("工作经历")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String workExperience;
|
||||
|
||||
@Column("tags")
|
||||
@Comment("标签")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String tags;
|
||||
|
||||
@Column("filling_status")
|
||||
@Comment("填报状态")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String fillingStatus;
|
||||
|
||||
@Column("identity")
|
||||
@Comment("身份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String identity;
|
||||
|
||||
@Column("type")
|
||||
@Comment("代表类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String type;
|
||||
|
||||
@Column("is_gdh")
|
||||
@Comment("是否工代会代表")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean isGdh;
|
||||
|
||||
@Column("is_zdh")
|
||||
@Comment("是否职代会代表")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean isZdh;
|
||||
|
||||
@Column("union_id")
|
||||
@Comment("工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column("delegation_id")
|
||||
@Comment("代表团ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String delegationId;
|
||||
|
||||
@Column("delegation_name")
|
||||
@Comment("代表团名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String delegationName;
|
||||
|
||||
@Column("supplement")
|
||||
@Comment("补充说明")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String supplement;
|
||||
|
||||
@Column("status")
|
||||
@Comment("状态")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer status;
|
||||
|
||||
@Column("precinct_union_id")
|
||||
@Comment("选区工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String precinctUnionId;
|
||||
|
||||
@Column("precinct_union_name")
|
||||
@Comment("选区工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String precinctUnionName;
|
||||
|
||||
@Column("nation")
|
||||
@Comment("民族")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String nation;
|
||||
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_rep_supplement")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会代表增补")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_rep_supplement_time", fields = {"timeId"}, unique = false)
|
||||
})
|
||||
public class CongressRepSupplement extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("precinct_union_id")
|
||||
@Comment("选区")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String precinctUnionId;
|
||||
|
||||
@Column("time_id")
|
||||
@Comment("会议ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String timeId;
|
||||
|
||||
@Column("time_name")
|
||||
@Comment("会议名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String timeName;
|
||||
|
||||
@Column("add_user_id")
|
||||
@Comment("增加代表用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String addUserId;
|
||||
|
||||
@Column("add_user_union_id")
|
||||
@Comment("增加代表工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String addUserUnionId;
|
||||
|
||||
@Column("add_user_name")
|
||||
@Comment("增加代表姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String addUserName;
|
||||
|
||||
@Column("add_emplid")
|
||||
@Comment("增加代表工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String addEmplid;
|
||||
|
||||
@Column("sub_user_id")
|
||||
@Comment("替换代表用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String subUserId;
|
||||
|
||||
@Column("sub_user_name")
|
||||
@Comment("替换代表姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String subUserName;
|
||||
|
||||
@Column("sub_emplid")
|
||||
@Comment("替换代表工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String subEmplid;
|
||||
|
||||
@Column("reason")
|
||||
@Comment("原因")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
private String reason;
|
||||
|
||||
@Column("add_precinct_union_id")
|
||||
@Comment("增加选区工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String addPrecinctUnionId;
|
||||
|
||||
@Column("add_precinct_union_name")
|
||||
@Comment("增加选区工会名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String addPrecinctUnionName;
|
||||
|
||||
@Column("sub_precinct_union_id")
|
||||
@Comment("替换选区工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String subPrecinctUnionId;
|
||||
|
||||
@Column("sub_precinct_union_name")
|
||||
@Comment("替换选区工会名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String subPrecinctUnionName;
|
||||
|
||||
@Column("type")
|
||||
@Comment("类型")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_sessions")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会届次")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_sessions_union_id", fields = {"unionId"}, unique = false)
|
||||
})
|
||||
public class CongressSessions extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("name")
|
||||
@Comment("届次名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String name;
|
||||
|
||||
@Column("year")
|
||||
@Comment("年份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String year;
|
||||
|
||||
@Column("description")
|
||||
@Comment("描述")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
private String description;
|
||||
|
||||
@Column("sc_session")
|
||||
@Comment("省产届次")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer scSession;
|
||||
|
||||
@Column("uc_session")
|
||||
@Comment("校产届次")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer ucSession;
|
||||
|
||||
@Column("union_id")
|
||||
@Comment("工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column("type")
|
||||
@Comment("会类型")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer type;
|
||||
|
||||
@Column("union_name")
|
||||
@Comment("工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String unionName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_sign_in")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会签到记录")
|
||||
@TableIndexes({
|
||||
@Index(name = "uk_congress_sign_in_rep_meeting", fields = {"repId", "meetingId", "deleted"}, unique = true),
|
||||
@Index(name = "idx_congress_sign_in_meeting", fields = {"meetingId"}, unique = false)
|
||||
})
|
||||
public class CongressSignIn extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("time_id")
|
||||
@Comment("会议ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String timeId;
|
||||
|
||||
@Column("meeting_id")
|
||||
@Comment("签到会议ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String meetingId;
|
||||
|
||||
@Column("delegation_id")
|
||||
@Comment("代表团ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String delegationId;
|
||||
|
||||
@Column("rep_id")
|
||||
@Comment("代表ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String repId;
|
||||
|
||||
@Column("emplid")
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String emplid;
|
||||
|
||||
@Column("name")
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String name;
|
||||
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_sign_in_meeting")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会签到会议")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_sign_in_meeting_time", fields = {"timeId"}, unique = false)
|
||||
})
|
||||
public class CongressSignInMeeting extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("meeting_name")
|
||||
@Comment("会议名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String meetingName;
|
||||
|
||||
@Column("sign_in_start_time")
|
||||
@Comment("签到开始时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date signInStartTime;
|
||||
|
||||
@Column("sign_in_end_time")
|
||||
@Comment("签到结束时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date signInEndTime;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("time_id")
|
||||
@Comment("会议ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String timeId;
|
||||
|
||||
@Column("remark")
|
||||
@Comment("备注")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
private String remark;
|
||||
|
||||
@Column("sign_in_count")
|
||||
@Comment("签到人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer signInCount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_times")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会会议")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_times_session_id", fields = {"sessionId"}, unique = false)
|
||||
})
|
||||
public class CongressTimes extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("year")
|
||||
@Comment("年份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String year;
|
||||
|
||||
@Column("name")
|
||||
@Comment("会议名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String name;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("session_name")
|
||||
@Comment("届次名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String sessionName;
|
||||
|
||||
@Column("sc_times")
|
||||
@Comment("省产次数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer scTimes;
|
||||
|
||||
@Column("uc_times")
|
||||
@Comment("校产次数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer ucTimes;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_union")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会工会名额")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_union_session", fields = {"sessionId"}, unique = false),
|
||||
@Index(name = "idx_congress_union_delegation", fields = {"delegationId"}, unique = false)
|
||||
})
|
||||
public class CongressUnion extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("session_name")
|
||||
@Comment("届次名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String sessionName;
|
||||
|
||||
@Column("union_id")
|
||||
@Comment("工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column("union_name")
|
||||
@Comment("工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String unionName;
|
||||
|
||||
@Column("quota_config")
|
||||
@Comment("名额配置")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String quotaConfig;
|
||||
|
||||
@Column("member_number")
|
||||
@Comment("会员数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer memberNumber;
|
||||
|
||||
@Column("delegation_id")
|
||||
@Comment("代表团ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String delegationId;
|
||||
|
||||
@Column("sort_no")
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer sortNo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_voting_issue")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会议题表决")
|
||||
@TableIndexes({
|
||||
@Index(name = "idx_congress_voting_issue_materials", fields = {"materialsId"}, unique = false),
|
||||
@Index(name = "idx_congress_voting_issue_time", fields = {"timeId"}, unique = false)
|
||||
})
|
||||
public class CongressVotingIssue extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("session_name")
|
||||
@Comment("届次名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String sessionName;
|
||||
|
||||
@Column("time_id")
|
||||
@Comment("会议ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String timeId;
|
||||
|
||||
@Column("time_name")
|
||||
@Comment("会议名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String timeName;
|
||||
|
||||
@Column("name")
|
||||
@Comment("议题名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String name;
|
||||
|
||||
@Column("description")
|
||||
@Comment("描述")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
private String description;
|
||||
|
||||
@Column("content")
|
||||
@Comment("内容")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String content;
|
||||
|
||||
@Column("voting_type")
|
||||
@Comment("表决类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String votingType;
|
||||
|
||||
@Column("voting_start_time")
|
||||
@Comment("表决开始时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date votingStartTime;
|
||||
|
||||
@Column("voting_end_time")
|
||||
@Comment("表决结束时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date votingEndTime;
|
||||
|
||||
@Column("voting_content")
|
||||
@Comment("表决内容")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String votingContent;
|
||||
|
||||
@Column("voting_content_item_header")
|
||||
@Comment("表决项表头")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String votingContentItemHeader;
|
||||
|
||||
@Column("voting_content_option_header")
|
||||
@Comment("表决选项表头")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String votingContentOptionHeader;
|
||||
|
||||
@Column("materials_id")
|
||||
@Comment("资料ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String materialsId;
|
||||
|
||||
@Column("type_id")
|
||||
@Comment("资料类型ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String typeId;
|
||||
|
||||
@Column("delegation_id")
|
||||
@Comment("代表团ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String delegationId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.models;
|
||||
|
||||
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("congress_voting_record")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职代会表决记录")
|
||||
@TableIndexes({
|
||||
@Index(name = "uk_congress_voting_record_rep_issue", fields = {"repId", "issueId", "deleted"}, unique = true),
|
||||
@Index(name = "idx_congress_voting_record_issue", fields = {"issueId"}, unique = false)
|
||||
})
|
||||
public class CongressVotingRecord extends CongressBaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("主键")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column("issue_id")
|
||||
@Comment("议题ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String issueId;
|
||||
|
||||
@Column("rep_id")
|
||||
@Comment("代表ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String repId;
|
||||
|
||||
@Column("emplid")
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 64)
|
||||
private String emplid;
|
||||
|
||||
@Column("name")
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String name;
|
||||
|
||||
@Column("session_id")
|
||||
@Comment("届次ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column("time_id")
|
||||
@Comment("会议ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String timeId;
|
||||
|
||||
@Column("delegation_id")
|
||||
@Comment("代表团ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String delegationId;
|
||||
|
||||
@Column("vote_result")
|
||||
@Comment("表决结果")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String voteResult;
|
||||
|
||||
@Column("user_id")
|
||||
@Comment("用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.service;
|
||||
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CongressH5Service {
|
||||
|
||||
List<NutMap> repTimes(String emplid);
|
||||
|
||||
List<NutMap> materialsTypeList();
|
||||
|
||||
Pagination<NutMap> materialsList(String typeId, String sessionId, String emplid, String searchKeyword,
|
||||
String fileType, String uploadTimeOrder, Integer pageNumber, Integer pageSize);
|
||||
|
||||
Pagination<NutMap> userMeetingList(String sessionId, String emplid, String searchKeyword,
|
||||
String signTimeStatus, String signInCountStatus, String signStatus,
|
||||
Integer pageNumber, Integer pageSize);
|
||||
|
||||
NutMap meetingRemark(String meetingId, String sessionId, String emplid);
|
||||
|
||||
Result signin(String repId, String sessionId, String timeId, String meetingId);
|
||||
|
||||
NutMap votingIssue(String materialsId, String repId);
|
||||
|
||||
Result voteSubmit(String issueId, String repId, String sessionId, String timeId,
|
||||
String delegationId, String voteResult);
|
||||
}
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.service.BaseService;
|
||||
import org.nutz.dao.Chain;
|
||||
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 java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* 职代会管理公共服务类。
|
||||
*
|
||||
* <p>本服务不注册页面路由,只集中维护六个菜单控制器共用的查询和基础操作。</p>
|
||||
*/
|
||||
@IocBean
|
||||
public class CongressManageService {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private BaseService<?> baseService;
|
||||
|
||||
|
||||
public List<NutMap> sessionOptions() {
|
||||
return listMaps("""
|
||||
SELECT id AS `id`, fullName AS `fullName`
|
||||
FROM teacher_congress_session
|
||||
WHERE delFlag = 0
|
||||
ORDER BY startDate desc, createdAt desc
|
||||
""");
|
||||
}
|
||||
|
||||
public List<NutMap> typeOptions() {
|
||||
return listMaps("""
|
||||
SELECT id, name, sort_no AS sortNo, is_vote AS isVote
|
||||
FROM congress_materials_type
|
||||
WHERE COALESCE(deleted, 0) = 0
|
||||
ORDER BY sort_no, create_time, id
|
||||
""");
|
||||
}
|
||||
|
||||
public List<NutMap> meetingOptions(String sessionId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT id, meeting_name AS meetingName
|
||||
FROM congress_sign_in_meeting
|
||||
WHERE COALESCE(deleted, 0) = 0
|
||||
AND session_id = @sessionId
|
||||
ORDER BY sign_in_start_time DESC, create_time DESC
|
||||
""");
|
||||
sql.setParam("sessionId", sessionId);
|
||||
sql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(sql);
|
||||
return sql.getList(NutMap.class);
|
||||
}
|
||||
|
||||
public List<NutMap> materialOptions(String sessionId, String typeId) {
|
||||
StringBuilder sqlText = new StringBuilder("""
|
||||
SELECT
|
||||
m.id,
|
||||
m.name,
|
||||
m.type_id AS typeId,
|
||||
m.file_name AS fileName,
|
||||
m.file_url AS fileUrl
|
||||
FROM congress_materials m
|
||||
WHERE COALESCE(m.deleted, 0) = 0
|
||||
AND m.session_id = @sessionId
|
||||
""");
|
||||
if (StrUtil.isNotBlank(typeId)) {
|
||||
sqlText.append(" AND m.type_id = @typeId");
|
||||
}
|
||||
sqlText.append(" ORDER BY m.sort_no, m.create_time DESC");
|
||||
Sql sql = Sqls.create(sqlText.toString());
|
||||
sql.setParam("sessionId", sessionId);
|
||||
sql.setParam("typeId", typeId);
|
||||
sql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(sql);
|
||||
return sql.getList(NutMap.class);
|
||||
}
|
||||
|
||||
public Result page(PageForm pageForm, String sqlText, NutMap params) {
|
||||
Sql sql = Sqls.create(sqlText);
|
||||
params.forEach(sql::setParam);
|
||||
Pagination pagination = baseService.listPageMap(
|
||||
pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
public List<NutMap> listMaps(String sqlText) {
|
||||
Sql sql = Sqls.create(sqlText);
|
||||
sql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(sql);
|
||||
return sql.getList(NutMap.class);
|
||||
}
|
||||
|
||||
public NutMap fetchMap(String sqlText, NutMap params) {
|
||||
Sql sql = Sqls.create(sqlText);
|
||||
params.forEach(sql::setParam);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
return sql.getObject(NutMap.class);
|
||||
}
|
||||
|
||||
public int count(String sqlText, NutMap params) {
|
||||
Sql sql = Sqls.create(sqlText);
|
||||
params.forEach(sql::setParam);
|
||||
sql.setCallback(Sqls.callback.integer());
|
||||
dao.execute(sql);
|
||||
return sql.getInt();
|
||||
}
|
||||
|
||||
public void softDelete(String tableName, String id) {
|
||||
dao.update(tableName,
|
||||
Chain.make("deleted", 1).add("update_time", new Date()),
|
||||
Cnd.where("id", "=", id).and("deleted", "=", 0));
|
||||
}
|
||||
|
||||
public Date parseDate(String value) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return DateUtil.parse(value);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void appendEquals(StringBuilder sql, NutMap params,
|
||||
String column, String paramName, Object value) {
|
||||
if (value instanceof String && StrUtil.isBlank((String) value)) {
|
||||
return;
|
||||
}
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
sql.append(" AND ").append(column).append(" = @").append(paramName);
|
||||
params.addv(paramName, value);
|
||||
}
|
||||
|
||||
public String normalizeFileType(String fileType, String fileName, String fileUrl) {
|
||||
if (StrUtil.isNotBlank(fileType) && !fileType.contains("/")) {
|
||||
return fileType.replace(".", "").trim().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
String suffix = extractFileExtension(fileName);
|
||||
if (StrUtil.isBlank(suffix)) {
|
||||
suffix = extractFileExtension(fileUrl);
|
||||
}
|
||||
return StrUtil.blankToDefault(suffix, null);
|
||||
}
|
||||
|
||||
private String extractFileExtension(String name) {
|
||||
if (StrUtil.isBlank(name)) {
|
||||
return "";
|
||||
}
|
||||
String value = name.split("\\?", 2)[0];
|
||||
int slashIndex = Math.max(value.lastIndexOf('/'), value.lastIndexOf('\\'));
|
||||
if (slashIndex >= 0) {
|
||||
value = value.substring(slashIndex + 1);
|
||||
}
|
||||
int dotIndex = value.lastIndexOf('.');
|
||||
if (dotIndex < 0 || dotIndex == value.length() - 1) {
|
||||
return "";
|
||||
}
|
||||
return value.substring(dotIndex + 1).toLowerCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
+457
@@ -0,0 +1,457 @@
|
||||
package com.budwk.app.zhgh.democratic.congress.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.congress.service.CongressH5Service;
|
||||
import org.nutz.dao.Chain;
|
||||
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.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
public class CongressH5ServiceImpl implements CongressH5Service {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Override
|
||||
public List<NutMap> repTimes(String emplid) {
|
||||
String loginName = loginName(emplid);
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
s.id,
|
||||
s.id AS timeId,
|
||||
COALESCE(s.fullName, CONCAT(s.year, '年职代会')) AS name,
|
||||
s.year,
|
||||
s.id AS sessionId,
|
||||
s.fullName AS sessionName,
|
||||
NULL AS type,
|
||||
d.id AS repId,
|
||||
d.delegationId AS delegationId,
|
||||
dg.name AS delegationName
|
||||
FROM teacher_congress_delegate d
|
||||
INNER JOIN teacher_congress_session s ON s.id = d.sessionId
|
||||
AND COALESCE(s.delFlag, 0) = 0
|
||||
LEFT JOIN teacher_congress_delegation dg ON dg.id = d.delegationId
|
||||
AND COALESCE(dg.delFlag, 0) = 0
|
||||
WHERE d.loginName = @emplid
|
||||
AND COALESCE(d.delFlag, 0) = 0
|
||||
AND COALESCE(s.enable, 0) = 1
|
||||
ORDER BY s.startDate DESC, s.createdAt DESC, s.id DESC
|
||||
""");
|
||||
sql.setParam("emplid", loginName);
|
||||
sql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(sql);
|
||||
return sql.getList(NutMap.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> materialsTypeList() {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
SUBSTRING_INDEX(
|
||||
GROUP_CONCAT(
|
||||
id
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN id IN (
|
||||
'congress_type_file_notice',
|
||||
'congress_type_evaluation_vote',
|
||||
'congress_type_issue_vote',
|
||||
'congress_type_vote_notice',
|
||||
'congress_type_prepare_material'
|
||||
) THEN 0
|
||||
ELSE 1
|
||||
END,
|
||||
sort_no ASC,
|
||||
create_time ASC
|
||||
),
|
||||
',',
|
||||
1
|
||||
) AS id,
|
||||
MIN(sort_no) AS sortNo,
|
||||
name,
|
||||
MAX(is_vote) AS isVote
|
||||
FROM congress_materials_type
|
||||
WHERE COALESCE(deleted, 0) = 0
|
||||
GROUP BY name
|
||||
ORDER BY sortNo ASC, name ASC
|
||||
""");
|
||||
sql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(sql);
|
||||
return sql.getList(NutMap.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<NutMap> materialsList(String typeId, String sessionId, String emplid, String searchKeyword,
|
||||
String fileType, String uploadTimeOrder, Integer pageNumber, Integer pageSize) {
|
||||
String loginName = loginName(emplid);
|
||||
int currentPage = pageNumber == null || pageNumber < 1 ? 1 : pageNumber;
|
||||
int currentSize = pageSize == null || pageSize < 1 ? 10 : Math.min(pageSize, 50);
|
||||
String orderBy = "asc".equalsIgnoreCase(uploadTimeOrder) ? "ASC" : "DESC";
|
||||
Sql sql = Sqls.create(("""
|
||||
SELECT
|
||||
cm.id,
|
||||
cm.session_id AS sessionId,
|
||||
COALESCE(cm.time_id, cm.session_id) AS timeId,
|
||||
cm.type_id AS typeId,
|
||||
cm.sort_no AS sortNo,
|
||||
cm.name,
|
||||
cm.file_name AS fileName,
|
||||
cm.file_url AS fileUrl,
|
||||
cm.file_type AS fileType,
|
||||
cm.file_size AS fileSize,
|
||||
cm.create_time AS uploadTime,
|
||||
CASE
|
||||
WHEN cvi.id IS NULL THEN NULL
|
||||
WHEN cvr.id IS NOT NULL THEN true
|
||||
ELSE false
|
||||
END AS hasVoted,
|
||||
CASE WHEN cvr.id IS NOT NULL THEN true ELSE false END AS voted
|
||||
FROM congress_materials cm
|
||||
INNER JOIN teacher_congress_delegate d ON d.sessionId = cm.session_id
|
||||
AND d.loginName = @emplid
|
||||
AND COALESCE(d.delFlag, 0) = 0
|
||||
INNER JOIN congress_materials_type cmt ON cm.type_id = cmt.id
|
||||
AND COALESCE(cmt.deleted, 0) = 0
|
||||
LEFT JOIN congress_voting_issue cvi ON cm.id = cvi.materials_id
|
||||
AND COALESCE(cvi.deleted, 0) = 0
|
||||
AND COALESCE(cmt.is_vote, 0) = 1
|
||||
LEFT JOIN congress_voting_record cvr ON cvi.id = cvr.issue_id
|
||||
AND (cvr.rep_id = d.id OR cvr.emplid = @emplid)
|
||||
AND COALESCE(cvr.deleted, 0) = 0
|
||||
WHERE COALESCE(cm.deleted, 0) = 0
|
||||
AND cm.type_id = @typeId
|
||||
AND (cm.session_id = @sessionId OR cm.time_id = @sessionId)
|
||||
AND (@searchKeyword = '' OR cm.name LIKE CONCAT('%%', @searchKeyword, '%%')
|
||||
OR cm.file_name LIKE CONCAT('%%', @searchKeyword, '%%'))
|
||||
AND (@fileType = '' OR FIND_IN_SET(LOWER(REPLACE(cm.file_type, '.', '')), @fileType) > 0
|
||||
OR FIND_IN_SET(LOWER(SUBSTRING_INDEX(cm.file_name, '.', -1)), @fileType) > 0)
|
||||
ORDER BY cm.create_time %s, cm.id DESC
|
||||
""").formatted(orderBy));
|
||||
sql.setParam("typeId", typeId);
|
||||
sql.setParam("sessionId", sessionId);
|
||||
sql.setParam("emplid", loginName);
|
||||
sql.setParam("searchKeyword", StrUtil.blankToDefault(searchKeyword, ""));
|
||||
sql.setParam("fileType", StrUtil.blankToDefault(fileType, ""));
|
||||
sql.setPager(dao.createPager(currentPage, currentSize));
|
||||
sql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(sql);
|
||||
|
||||
int totalCount = count("""
|
||||
SELECT COUNT(DISTINCT cm.id)
|
||||
FROM congress_materials cm
|
||||
INNER JOIN teacher_congress_delegate d ON d.sessionId = cm.session_id
|
||||
AND d.loginName = @emplid
|
||||
AND COALESCE(d.delFlag, 0) = 0
|
||||
WHERE COALESCE(cm.deleted, 0) = 0
|
||||
AND cm.type_id = @typeId
|
||||
AND (cm.session_id = @sessionId OR cm.time_id = @sessionId)
|
||||
AND (@searchKeyword = '' OR cm.name LIKE CONCAT('%%', @searchKeyword, '%%')
|
||||
OR cm.file_name LIKE CONCAT('%%', @searchKeyword, '%%'))
|
||||
AND (@fileType = '' OR FIND_IN_SET(LOWER(REPLACE(cm.file_type, '.', '')), @fileType) > 0
|
||||
OR FIND_IN_SET(LOWER(SUBSTRING_INDEX(cm.file_name, '.', -1)), @fileType) > 0)
|
||||
""", NutMap.NEW()
|
||||
.addv("typeId", typeId)
|
||||
.addv("sessionId", sessionId)
|
||||
.addv("emplid", loginName)
|
||||
.addv("searchKeyword", StrUtil.blankToDefault(searchKeyword, ""))
|
||||
.addv("fileType", StrUtil.blankToDefault(fileType, "")));
|
||||
return new Pagination<>(currentPage, currentSize, totalCount, sql.getList(NutMap.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<NutMap> userMeetingList(String sessionId, String emplid, String searchKeyword,
|
||||
String signTimeStatus, String signInCountStatus, String signStatus,
|
||||
Integer pageNumber, Integer pageSize) {
|
||||
String loginName = loginName(emplid);
|
||||
int currentPage = pageNumber == null || pageNumber < 1 ? 1 : pageNumber;
|
||||
int currentSize = pageSize == null || pageSize < 1 ? 10 : Math.min(pageSize, 50);
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
m.id,
|
||||
m.meeting_name AS meetingName,
|
||||
m.sign_in_start_time AS signInStartTime,
|
||||
m.sign_in_end_time AS signInEndTime,
|
||||
m.session_id AS sessionId,
|
||||
COALESCE(m.time_id, m.session_id) AS timeId,
|
||||
m.remark,
|
||||
(
|
||||
SELECT COUNT(1)
|
||||
FROM congress_sign_in s
|
||||
WHERE s.meeting_id = m.id
|
||||
AND COALESCE(s.deleted, 0) = 0
|
||||
) AS signInCount,
|
||||
si.id AS signInId,
|
||||
si.create_time AS userSignInTime,
|
||||
d.id AS repId
|
||||
FROM congress_sign_in_meeting m
|
||||
INNER JOIN teacher_congress_delegate d ON d.sessionId = m.session_id
|
||||
AND d.loginName = @emplid
|
||||
AND COALESCE(d.delFlag, 0) = 0
|
||||
LEFT JOIN congress_sign_in si ON m.id = si.meeting_id
|
||||
AND COALESCE(si.deleted, 0) = 0
|
||||
AND si.rep_id = d.id
|
||||
WHERE COALESCE(m.deleted, 0) = 0
|
||||
AND (m.session_id = @sessionId OR m.time_id = @sessionId)
|
||||
AND (@searchKeyword = '' OR m.meeting_name LIKE CONCAT('%', @searchKeyword, '%'))
|
||||
AND (@signTimeStatus = ''
|
||||
OR (@signTimeStatus = 'upcoming' AND m.sign_in_start_time > NOW())
|
||||
OR (@signTimeStatus = 'ongoing' AND m.sign_in_start_time <= NOW() AND m.sign_in_end_time >= NOW())
|
||||
OR (@signTimeStatus = 'ended' AND m.sign_in_end_time < NOW()))
|
||||
AND (@signInCountStatus = ''
|
||||
OR (@signInCountStatus = 'has' AND EXISTS (
|
||||
SELECT 1 FROM congress_sign_in count_si
|
||||
WHERE count_si.meeting_id = m.id AND COALESCE(count_si.deleted, 0) = 0))
|
||||
OR (@signInCountStatus = 'none' AND NOT EXISTS (
|
||||
SELECT 1 FROM congress_sign_in count_si
|
||||
WHERE count_si.meeting_id = m.id AND COALESCE(count_si.deleted, 0) = 0)))
|
||||
AND (@signStatus = ''
|
||||
OR (@signStatus = 'signed' AND si.id IS NOT NULL)
|
||||
OR (@signStatus = 'unsigned' AND si.id IS NULL))
|
||||
ORDER BY m.sign_in_start_time DESC, m.create_time DESC
|
||||
""");
|
||||
sql.setParam("sessionId", sessionId);
|
||||
sql.setParam("emplid", loginName);
|
||||
sql.setParam("searchKeyword", StrUtil.blankToDefault(searchKeyword, ""));
|
||||
sql.setParam("signTimeStatus", StrUtil.blankToDefault(signTimeStatus, ""));
|
||||
sql.setParam("signInCountStatus", StrUtil.blankToDefault(signInCountStatus, ""));
|
||||
sql.setParam("signStatus", StrUtil.blankToDefault(signStatus, ""));
|
||||
sql.setPager(dao.createPager(currentPage, currentSize));
|
||||
sql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(sql);
|
||||
|
||||
int totalCount = count("""
|
||||
SELECT COUNT(DISTINCT m.id)
|
||||
FROM congress_sign_in_meeting m
|
||||
INNER JOIN teacher_congress_delegate d ON d.sessionId = m.session_id
|
||||
AND d.loginName = @emplid
|
||||
AND COALESCE(d.delFlag, 0) = 0
|
||||
LEFT JOIN congress_sign_in si ON m.id = si.meeting_id
|
||||
AND COALESCE(si.deleted, 0) = 0
|
||||
AND si.rep_id = d.id
|
||||
WHERE COALESCE(m.deleted, 0) = 0
|
||||
AND (m.session_id = @sessionId OR m.time_id = @sessionId)
|
||||
AND (@searchKeyword = '' OR m.meeting_name LIKE CONCAT('%', @searchKeyword, '%'))
|
||||
AND (@signTimeStatus = ''
|
||||
OR (@signTimeStatus = 'upcoming' AND m.sign_in_start_time > NOW())
|
||||
OR (@signTimeStatus = 'ongoing' AND m.sign_in_start_time <= NOW() AND m.sign_in_end_time >= NOW())
|
||||
OR (@signTimeStatus = 'ended' AND m.sign_in_end_time < NOW()))
|
||||
AND (@signInCountStatus = ''
|
||||
OR (@signInCountStatus = 'has' AND EXISTS (
|
||||
SELECT 1 FROM congress_sign_in count_si
|
||||
WHERE count_si.meeting_id = m.id AND COALESCE(count_si.deleted, 0) = 0))
|
||||
OR (@signInCountStatus = 'none' AND NOT EXISTS (
|
||||
SELECT 1 FROM congress_sign_in count_si
|
||||
WHERE count_si.meeting_id = m.id AND COALESCE(count_si.deleted, 0) = 0)))
|
||||
AND (@signStatus = ''
|
||||
OR (@signStatus = 'signed' AND si.id IS NOT NULL)
|
||||
OR (@signStatus = 'unsigned' AND si.id IS NULL))
|
||||
""", NutMap.NEW()
|
||||
.addv("sessionId", sessionId)
|
||||
.addv("emplid", loginName)
|
||||
.addv("searchKeyword", StrUtil.blankToDefault(searchKeyword, ""))
|
||||
.addv("signTimeStatus", StrUtil.blankToDefault(signTimeStatus, ""))
|
||||
.addv("signInCountStatus", StrUtil.blankToDefault(signInCountStatus, ""))
|
||||
.addv("signStatus", StrUtil.blankToDefault(signStatus, "")));
|
||||
return new Pagination<>(currentPage, currentSize, totalCount, sql.getList(NutMap.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NutMap meetingRemark(String meetingId, String sessionId, String emplid) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
m.id,
|
||||
m.meeting_name AS meetingName,
|
||||
m.remark,
|
||||
m.session_id AS sessionId,
|
||||
COALESCE(m.time_id, m.session_id) AS timeId
|
||||
FROM congress_sign_in_meeting m
|
||||
INNER JOIN teacher_congress_delegate d ON d.sessionId = m.session_id
|
||||
AND d.loginName = @emplid
|
||||
AND COALESCE(d.delFlag, 0) = 0
|
||||
WHERE m.id = @meetingId
|
||||
AND COALESCE(m.deleted, 0) = 0
|
||||
AND (m.session_id = @sessionId OR m.time_id = @sessionId)
|
||||
LIMIT 1
|
||||
""");
|
||||
sql.setParam("meetingId", meetingId);
|
||||
sql.setParam("sessionId", sessionId);
|
||||
sql.setParam("emplid", loginName(emplid));
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
return sql.getObject(NutMap.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result signin(String repId, String sessionId, String timeId, String meetingId) {
|
||||
if (StrUtil.hasBlank(repId, sessionId, meetingId)) {
|
||||
return Result.error("签到参数不完整");
|
||||
}
|
||||
int count = count("""
|
||||
SELECT COUNT(1)
|
||||
FROM congress_sign_in
|
||||
WHERE rep_id = @repId
|
||||
AND meeting_id = @meetingId
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
""", NutMap.NEW().addv("repId", repId).addv("meetingId", meetingId));
|
||||
if (count > 0) {
|
||||
return Result.success(true);
|
||||
}
|
||||
|
||||
NutMap rep = fetchMap("""
|
||||
SELECT id, userId, loginName, userName, delegationId
|
||||
FROM teacher_congress_delegate
|
||||
WHERE id = @repId
|
||||
AND sessionId = @sessionId
|
||||
AND COALESCE(delFlag, 0) = 0
|
||||
LIMIT 1
|
||||
""", NutMap.NEW().addv("repId", repId).addv("sessionId", sessionId));
|
||||
if (rep == null) {
|
||||
return Result.error("当前用户不是该届次职工代表,无法签到");
|
||||
}
|
||||
|
||||
dao.insert("congress_sign_in", Chain.make("id", R.UU32())
|
||||
.add("session_id", sessionId)
|
||||
.add("time_id", StrUtil.blankToDefault(timeId, sessionId))
|
||||
.add("meeting_id", meetingId)
|
||||
.add("delegation_id", rep.getString("delegationId"))
|
||||
.add("rep_id", repId)
|
||||
.add("emplid", rep.getString("loginName"))
|
||||
.add("name", rep.getString("userName"))
|
||||
.add("create_time", new Date())
|
||||
.add("update_time", new Date())
|
||||
.add("deleted", false));
|
||||
return Result.success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NutMap votingIssue(String materialsId, String repId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
i.id,
|
||||
i.session_id AS sessionId,
|
||||
i.session_name AS sessionName,
|
||||
COALESCE(i.time_id, i.session_id) AS timeId,
|
||||
i.time_name AS timeName,
|
||||
i.name,
|
||||
i.description,
|
||||
i.content,
|
||||
i.voting_type AS votingType,
|
||||
i.voting_start_time AS votingStartTime,
|
||||
i.voting_end_time AS votingEndTime,
|
||||
i.voting_content AS votingContent,
|
||||
i.voting_content_item_header AS votingContentItemHeader,
|
||||
i.voting_content_option_header AS votingContentOptionHeader,
|
||||
i.materials_id AS materialsId,
|
||||
i.type_id AS typeId,
|
||||
i.delegation_id AS delegationId,
|
||||
mt.name AS typeName,
|
||||
CASE WHEN vr.id IS NULL THEN false ELSE true END AS voted,
|
||||
vr.vote_result AS voteResult
|
||||
FROM congress_voting_issue i
|
||||
INNER JOIN teacher_congress_delegate d ON d.id = @repId
|
||||
AND d.sessionId = i.session_id
|
||||
AND COALESCE(d.delFlag, 0) = 0
|
||||
LEFT JOIN congress_materials_type mt ON mt.id = i.type_id
|
||||
AND COALESCE(mt.deleted, 0) = 0
|
||||
LEFT JOIN congress_voting_record vr ON vr.issue_id = i.id
|
||||
AND (vr.rep_id = d.id OR vr.emplid = d.loginName)
|
||||
AND COALESCE(vr.deleted, 0) = 0
|
||||
WHERE i.materials_id = @materialsId
|
||||
AND COALESCE(i.deleted, 0) = 0
|
||||
LIMIT 1
|
||||
""");
|
||||
sql.setParam("materialsId", materialsId);
|
||||
sql.setParam("repId", repId);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
return sql.getObject(NutMap.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result voteSubmit(String issueId, String repId, String sessionId, String timeId,
|
||||
String delegationId, String voteResult) {
|
||||
if (StrUtil.hasBlank(issueId, repId, sessionId, voteResult)) {
|
||||
return Result.error("投票参数不完整");
|
||||
}
|
||||
NutMap issue = fetchMap("""
|
||||
SELECT id, session_id AS sessionId, COALESCE(time_id, session_id) AS timeId
|
||||
FROM congress_voting_issue
|
||||
WHERE id = @issueId
|
||||
AND session_id = @sessionId
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
LIMIT 1
|
||||
""", NutMap.NEW().addv("issueId", issueId).addv("sessionId", sessionId));
|
||||
if (issue == null) {
|
||||
return Result.error("投票议题不存在");
|
||||
}
|
||||
|
||||
NutMap rep = fetchMap("""
|
||||
SELECT id, userId, loginName, userName, delegationId
|
||||
FROM teacher_congress_delegate
|
||||
WHERE id = @repId
|
||||
AND sessionId = @sessionId
|
||||
AND COALESCE(delFlag, 0) = 0
|
||||
LIMIT 1
|
||||
""", NutMap.NEW().addv("repId", repId).addv("sessionId", sessionId));
|
||||
if (rep == null) {
|
||||
return Result.error("当前用户不是该届次职工代表,无法投票");
|
||||
}
|
||||
|
||||
int count = count("""
|
||||
SELECT COUNT(1)
|
||||
FROM congress_voting_record
|
||||
WHERE issue_id = @issueId
|
||||
AND rep_id = @repId
|
||||
AND COALESCE(deleted, 0) = 0
|
||||
""", NutMap.NEW().addv("issueId", issueId).addv("repId", repId));
|
||||
if (count > 0) {
|
||||
return Result.error("您已投票,请勿重复提交");
|
||||
}
|
||||
|
||||
dao.insert("congress_voting_record", Chain.make("id", R.UU32())
|
||||
.add("issue_id", issueId)
|
||||
.add("rep_id", repId)
|
||||
.add("emplid", rep.getString("loginName"))
|
||||
.add("name", rep.getString("userName"))
|
||||
.add("session_id", sessionId)
|
||||
.add("time_id", StrUtil.blankToDefault(timeId, issue.getString("timeId")))
|
||||
.add("delegation_id", StrUtil.blankToDefault(delegationId, rep.getString("delegationId")))
|
||||
.add("vote_result", voteResult)
|
||||
.add("user_id", rep.getString("userId"))
|
||||
.add("create_time", new Date())
|
||||
.add("update_time", new Date())
|
||||
.add("deleted", false));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
private String loginName(String emplid) {
|
||||
return StrUtil.blankToDefault(emplid, SecurityUtil.getUserLoginname());
|
||||
}
|
||||
|
||||
private NutMap fetchMap(String sqlText, NutMap params) {
|
||||
Sql sql = Sqls.create(sqlText);
|
||||
params.forEach(sql::setParam);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
return sql.getObject(NutMap.class);
|
||||
}
|
||||
|
||||
private int count(String sqlText, NutMap params) {
|
||||
Sql sql = Sqls.create(sqlText);
|
||||
params.forEach(sql::setParam);
|
||||
sql.setCallback(Sqls.callback.integer());
|
||||
dao.execute(sql);
|
||||
return sql.getInt();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user