commit
This commit is contained in:
+9
-2
@@ -37,7 +37,7 @@ public class GuildHallController {
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("guildHall.management")
|
||||
@Ok("beetl:/platform/zhgh/democratic/teachercongress/guildhall/index.html")
|
||||
@Ok("beetl:/platform/zhgh/democratic/teachercongress/guildhall/manage/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@@ -90,10 +90,17 @@ public class GuildHallController {
|
||||
return Result.success(dao.fetch(GuildHall.class, id));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("guildHall.management")
|
||||
@ApiOperation("查询会议厅多个")
|
||||
public Result selectList() {
|
||||
return Result.success(dao.query(GuildHall.class, Cnd.NEW()));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("guildHall.management")
|
||||
@ApiOperation("查询座位")
|
||||
public Result selectSeat(String hallId) {
|
||||
public Result selectSeatList(String hallId) {
|
||||
List<GuildHallSeat> list = dao.query(GuildHallSeat.class, Cnd.where(GuildHallSeat::getHallId, "=", hallId)
|
||||
.asc(GuildHallSeat::getRowNumber).asc(GuildHallSeat::getColNumber));
|
||||
|
||||
|
||||
+45
-1
@@ -1,21 +1,33 @@
|
||||
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
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.zhgh.democratic.teachercongress.guildhall.models.GuildHall;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHallMeeting;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHallSeat;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHallSeatSelect;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.service.GuildHallMeetingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Api("会议厅会议")
|
||||
@IocBean
|
||||
@At("/platform/guildHall/meeting")
|
||||
@@ -50,17 +62,32 @@ public class GuildHallMeetingController {
|
||||
@SaCheckPermission("guildHall.meeting")
|
||||
@SLog(tag = "会议厅会议", msg = "保存会议厅会议")
|
||||
@ApiOperation("保存会议厅会议")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result save(GuildHallMeeting meeting) {
|
||||
dao.insert(meeting);
|
||||
return Result.success();
|
||||
List<GuildHallSeat> seats = dao.query(GuildHallSeat.class, Cnd.where("hallId", "=", meeting.getHallId()));
|
||||
List<GuildHallSeatSelect> selects = BeanUtil.copyToList(seats, GuildHallSeatSelect.class);
|
||||
for (GuildHallSeatSelect select : selects) {
|
||||
select.setMeetingId(meeting.getId());
|
||||
}
|
||||
dao.insert(selects);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("guildHall.meeting")
|
||||
@SLog(tag = "会议厅会议", msg = "修改会议厅会议")
|
||||
@ApiOperation("修改会议厅会议")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result update(GuildHallMeeting meeting) {
|
||||
dao.update(meeting);
|
||||
dao.clear(GuildHallSeatSelect.class, Cnd.where("hallId", "=", meeting.getHallId()));
|
||||
List<GuildHallSeat> seats = dao.query(GuildHallSeat.class, Cnd.where("hallId", "=", meeting.getHallId()));
|
||||
List<GuildHallSeatSelect> selects = BeanUtil.copyToList(seats, GuildHallSeatSelect.class);
|
||||
for (GuildHallSeatSelect select : selects) {
|
||||
select.setMeetingId(meeting.getId());
|
||||
}
|
||||
dao.insert(selects);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@@ -73,4 +100,21 @@ public class GuildHallMeetingController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("guildHall")
|
||||
@ApiOperation("查询会议")
|
||||
public Result selectList() {
|
||||
List<NutMap> results = new ArrayList<>();
|
||||
List<GuildHallMeeting> meetings = dao.query(GuildHallMeeting.class, Cnd.NEW().desc("startTime"));
|
||||
for (GuildHallMeeting meeting : meetings) {
|
||||
if(DateUtil.compare(DateUtil.date(), meeting.getEndTime()) > 0) {
|
||||
continue;
|
||||
}
|
||||
NutMap nutMap = Lang.obj2nutmap(meeting);
|
||||
GuildHall hall = dao.fetch(GuildHall.class, meeting.getHallId());
|
||||
nutMap.put("address", hall.getAddress());
|
||||
results.add(nutMap);
|
||||
}
|
||||
return Result.success(results);
|
||||
}
|
||||
}
|
||||
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHall;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHallMeeting;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.service.GuildHallService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName GuildHallSeatSummaryController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/24 16:25
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Api("会议选座统计")
|
||||
@IocBean
|
||||
@At("/platform/guildHall/seatSummary")
|
||||
@Ok("json:full")
|
||||
public class GuildHallSeatSummaryController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private GuildHallService guildHallService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("guildHall.seatSummary")
|
||||
@Ok("beetl:/platform/zhgh/democratic/teachercongress/guildhall/seatSummary/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("guildHall.seatSummary")
|
||||
@ApiOperation("分页查询")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "meetingId") String meetingId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.userName,
|
||||
u.loginName,
|
||||
u.unitName as unitName,
|
||||
u.unionName as unionName,
|
||||
u.mobile,
|
||||
u.sex,
|
||||
t1.rowNumber,
|
||||
t1.colNumber
|
||||
FROM
|
||||
`guild_hall_seat_select` t1
|
||||
LEFT JOIN `vw_user` u ON u.id = t1.userId
|
||||
WHERE
|
||||
t1.userId IS NOT NULL AND t1.meetingId = @meetingId
|
||||
order by t1.rowNumber ASC,t1.colNumber ASC
|
||||
""");
|
||||
sql.setParam("meetingId", meetingId);
|
||||
Pagination pagination = guildHallService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("guildHall.seatSummary")
|
||||
@ApiOperation("查询会议")
|
||||
public Result listMeeting() {
|
||||
List<GuildHallMeeting> meetings = dao.query(GuildHallMeeting.class, Cnd.NEW().desc("startTime"));
|
||||
return Result.success(meetings);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("guildHall.seatSummary")
|
||||
public void exportExcel(String meetingId, HttpServletResponse response) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.userName,
|
||||
u.loginName,
|
||||
u.unitName as unitName,
|
||||
u.unionName as unionName,
|
||||
u.mobile,
|
||||
u.sex,
|
||||
t1.rowNumber,
|
||||
t1.colNumber,
|
||||
CONCAT(t1.rowNumber,'排',t1.colNumber,'列') seat
|
||||
FROM
|
||||
`guild_hall_seat_select` t1
|
||||
LEFT JOIN `vw_user` u ON u.id = t1.userId
|
||||
WHERE
|
||||
t1.userId IS NOT NULL AND t1.meetingId = @meetingId
|
||||
order by t1.rowNumber ASC,t1.colNumber ASC
|
||||
""");
|
||||
sql.setParam("meetingId",meetingId);
|
||||
|
||||
List<NutMap> list = guildHallService.listMap(sql);
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
exportEntities.add(new ExcelExportEntity("单位", "unitName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("分工会", "unionName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("手机号", "mobile", 20));
|
||||
exportEntities.add(new ExcelExportEntity("座位", "seat", 20));
|
||||
|
||||
try {
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setSheetName("选座人员");
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
|
||||
CommonDownloadUtil.download("选座人员.xlsx", workbook, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHallMeeting;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHallSeat;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHallSeatSelect;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.service.GuildHallService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName GuildHallSelectSeatController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/24 15:22
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Api("会议选座")
|
||||
@IocBean
|
||||
@At("/platform/guildHall/selectSeat")
|
||||
@Ok("json:full")
|
||||
public class GuildHallSelectSeatController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private GuildHallService guildHallService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("guildHall.selectSeat")
|
||||
@Ok("beetl:/platform/zhgh/democratic/teachercongress/guildhall/selectSeat/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.guildHall.selectSeat")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/teachercongress/guildhall/selectSeat/index.html")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("guildHall.selectSeat")
|
||||
public Result loadSeats(@Param("meetingId") String meetingId) {
|
||||
// 已选择情况
|
||||
List<GuildHallSeatSelect> selectedSeats = dao.query(GuildHallSeatSelect.class, Cnd.where("meetingId", "=", meetingId));
|
||||
|
||||
for (GuildHallSeatSelect selectedSeat : selectedSeats) {
|
||||
if (selectedSeat.getUserId() != null) {
|
||||
selectedSeat.setIsOccupied(true);
|
||||
selectedSeat.setOccupiedBy(selectedSeat.getUserId());
|
||||
selectedSeat.setIsMine(selectedSeat.getUserId().equals(SecurityUtil.getUserId()));
|
||||
} else {
|
||||
selectedSeat.setIsOccupied(false);
|
||||
selectedSeat.setIsMine(false);
|
||||
}
|
||||
}
|
||||
|
||||
// 座位排序 首先按seatRowNum 再按seatColNum
|
||||
selectedSeats.sort((o1, o2) -> {
|
||||
int compare = o1.getRowNumber().compareTo(o2.getRowNumber());
|
||||
if (compare == 0) {
|
||||
return o1.getColNumber().compareTo(o2.getColNumber());
|
||||
}
|
||||
return compare;
|
||||
});
|
||||
return Result.success(selectedSeats);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("guildHall.selectSeat")
|
||||
public Result doSelect(@Param("meetingId") String meetingId, Integer rowNumber, Integer colNumber) {
|
||||
GuildHallSeatSelect oldSeat = dao.fetch(GuildHallSeatSelect.class, Cnd.where("meetingId", "=", meetingId).and("userId", "=", SecurityUtil.getUserId()));
|
||||
if(oldSeat != null){
|
||||
oldSeat.setUserId(null);
|
||||
oldSeat.setSelectTime(null);
|
||||
dao.update(oldSeat);
|
||||
}
|
||||
|
||||
GuildHallSeatSelect seat = dao.fetch(GuildHallSeatSelect.class, Cnd.where("meetingId", "=", meetingId).and("rowNumber", "=", rowNumber).and("colNumber", "=", colNumber));
|
||||
seat.setUserId(SecurityUtil.getUserId());
|
||||
seat.setSelectTime(new Date());
|
||||
dao.update(seat);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+5
@@ -58,4 +58,9 @@ public class GuildHallMeeting extends BaseModel {
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer groupId;
|
||||
|
||||
@Column
|
||||
@Comment("会厅Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String hallId;
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -7,6 +7,8 @@ import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("guild_hall_seat")
|
||||
@@ -39,9 +41,15 @@ public class GuildHallSeat extends BaseModel {
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer colNumber;
|
||||
|
||||
@Column
|
||||
@Comment("座位编号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String seatNumber;
|
||||
|
||||
@Column
|
||||
@Comment("是否启用")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("1")
|
||||
private Boolean enable;
|
||||
|
||||
}
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.models;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName GuildHallSeatSelect
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/24 15:55
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("guild_hall_seat_select")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("会议厅座位")
|
||||
@Accessors(chain = true)
|
||||
@TableIndexes(value = {
|
||||
@Index(name = "INDEX_GUILD_HALL_SEAT_HALL_ID", fields = "hallId",unique = false)
|
||||
})
|
||||
public class GuildHallSeatSelect extends GuildHallSeat{
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("会议id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String meetingId;
|
||||
|
||||
@Column
|
||||
@Comment("用户id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("选座时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date selectTime;
|
||||
|
||||
private Boolean isOccupied;
|
||||
private String occupiedBy;
|
||||
private Boolean isMine;
|
||||
}
|
||||
Reference in New Issue
Block a user