提交 570345d8 作者: 洪东保

Merge remote-tracking branch 'origin/main'

......@@ -4,12 +4,12 @@ import com.cmeeting.annotation.OperLog;
import com.cmeeting.service.MeetingInfoService;
import com.cmeeting.service.MeetingRecordTemplateService;
import com.cmeeting.util.R;
import com.cmeeting.util.page.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.netty.http.server.HttpServerResponse;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
......@@ -43,9 +43,9 @@ public class StatisticsController {
@RequestParam("createTimeStart") Date createTimeStart,
@RequestParam("createTimeEnd") Date createTimeEnd) {
List<Map<String, String>> list =meetingInfoService.statistics(searchValue, createTimeStart, createTimeEnd);
List<Map<String, String>> list =meetingInfoService.statistics(searchValue, createTimeStart, createTimeEnd, true);
return R.ok(list);
return PageUtil.getDataTable(list);
}
/**
......
......@@ -23,9 +23,10 @@ public interface MeetingInfoService extends IService<MeetingInfo> {
* @param searchValue 查询值
* @param createTimeStart 起始时间
* @param createTimeEnd 截止时间
* @param page
* @return
*/
List<Map<String, String>> statistics(String searchValue, Date createTimeStart, Date createTimeEnd);
List<Map<String, String>> statistics(String searchValue, Date createTimeStart, Date createTimeEnd, Boolean page);
/**
* 导出
......
......@@ -35,6 +35,7 @@ import com.cmeeting.pojo.MeetingRecordTemplate;
import com.cmeeting.pojo.UserId;
import com.cmeeting.service.MeetingInfoService;
import com.cmeeting.util.MinioUtils;
import com.cmeeting.util.page.PageUtil;
import com.cmeeting.vo.MeetingInfoVO;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
......@@ -268,10 +269,11 @@ public class MeetingInfoServiceImpl extends ServiceImpl<MeetingInfoMapper, Meeti
* @param searchValue 查询值
* @param createTimeStart 起始时间
* @param createTimeEnd 截止时间
* @param page 是否分页
* @return
*/
@Override
public List<Map<String, String>> statistics(String searchValue, Date createTimeStart, Date createTimeEnd) {
public List<Map<String, String>> statistics(String searchValue, Date createTimeStart, Date createTimeEnd, Boolean page) {
List<String> dateList = DateUtil.rangeToList(createTimeStart, createTimeEnd, DateField.DAY_OF_YEAR).stream()
.map(date -> DateUtil.format(date, "yyyy-MM-dd"))
.collect(Collectors.toList());
......@@ -281,8 +283,11 @@ public class MeetingInfoServiceImpl extends ServiceImpl<MeetingInfoMapper, Meeti
String endTime = DateUtil.format(createTimeEnd, "yyyy-MM-dd");
List<Map<String, String>> statisticsList = meetingInfoMapper.statistics(startTime, endTime, dateList);
if (page) {
PageUtil.startPage();
}
// 获取用户信息
List<String> userIdList = statisticsList.stream().map(map -> map.get("userId")).distinct().collect(Collectors.toList());
List<String> userIdList = statisticsList.stream().map(map -> map.get("userId")).collect(Collectors.toList());
List<Map<String, String>> userInfoList = sysUserSysMapper.selectParamByUserIdList(permissionTenantId, searchValue, userIdList);
for (Map<String, String> userInfo : userInfoList) {
......@@ -334,7 +339,7 @@ public class MeetingInfoServiceImpl extends ServiceImpl<MeetingInfoMapper, Meeti
*/
@Override
public void exportRecordTemplateUsingInfo(String searchValue, Date createTimeStart, Date createTimeEnd, HttpServletResponse response) {
List<Map<String, String>> statistics = statistics(searchValue, createTimeStart, createTimeEnd);
List<Map<String, String>> statistics = statistics(searchValue, createTimeStart, createTimeEnd, false);
if (statistics.isEmpty()) {
throw new RobotBaseException("暂无数据");
}
......
......@@ -268,12 +268,13 @@ public class MeetingRecordTemplateServiceImpl extends ServiceImpl<MeetingRecordT
public Long save(EditRecordTemplateVo recordTemplateVo) {
RobotSecurityUser loginUser = SecurityUtil.getUser();
String role = loginUser.getRole();
String userId = String.format("%08d", loginUser.getUserId());
MeetType meetType = meetTypeMapper.selectById(recordTemplateVo.getMeetingTypeId());
if (MeetingTypeConstant.PERSONAL_PERMISSION_NO == meetType.getPersonalPermission() && !MeetingTypeConstant.TYPE_SYSTEM.equals(role)) {
throw new RobotBaseException("当前会议类型下不允许新建纪要模板");
}
Integer count = baseMapper.selectCount(new LambdaQueryWrapper<MeetingRecordTemplate>().eq(MeetingRecordTemplate::getName, recordTemplateVo.getName()));
Integer count = baseMapper.selectCount(new LambdaQueryWrapper<MeetingRecordTemplate>().eq(MeetingRecordTemplate::getName, recordTemplateVo.getName()).eq(MeetingRecordTemplate::getCreateUser, userId));
if (count > 0) {
throw new RobotBaseException("添加失败。当前纪要模板名称已存在。");
}
......@@ -293,8 +294,8 @@ public class MeetingRecordTemplateServiceImpl extends ServiceImpl<MeetingRecordT
}
recordTemplate.setCreateTime(now);
recordTemplate.setUpdateTime(now);
recordTemplate.setCreateUser(String.format("%08d", loginUser.getUserId()));
recordTemplate.setUpdateUser(String.format("%08d", loginUser.getUserId()));
recordTemplate.setCreateUser(userId);
recordTemplate.setUpdateUser(userId);
recordTemplate.setCreateUserName(loginUser.getUsername());
recordTemplate.setUpdateUserName(loginUser.getUsername());
baseMapper.insert(recordTemplate);
......@@ -319,7 +320,7 @@ public class MeetingRecordTemplateServiceImpl extends ServiceImpl<MeetingRecordT
// 当前是普通用户,不允许修改非自己创建的模板
throw new RobotBaseException("当前用户没有权限修改该模板");
}
Integer count = baseMapper.selectCount(new LambdaQueryWrapper<MeetingRecordTemplate>().eq(MeetingRecordTemplate::getName, recordTemplateVo.getName()).ne(MeetingRecordTemplate::getId, recordTemplateVo.getId()));
Integer count = baseMapper.selectCount(new LambdaQueryWrapper<MeetingRecordTemplate>().eq(MeetingRecordTemplate::getName, recordTemplateVo.getName()).eq(MeetingRecordTemplate::getCreateUser, userId).ne(MeetingRecordTemplate::getId, recordTemplateVo.getId()));
if (count > 0) {
throw new RobotBaseException("编辑失败。当前纪要模板名称已存在。");
}
......
......@@ -41,17 +41,18 @@ public class PageUtil {
/**
* 分页
* @param pageSize 分页参数
* @param pageNum 分页参数
* @param orderby 排序规则
*
* @param size 分页参数
* @param current 分页参数
* @param orderby 排序规则
*/
public static void startPage(Integer pageSize, Integer pageNum, String orderby) {
public static void startPage(Integer size, Integer current, String orderby) {
if (!ObjectUtils.isEmpty(pageNum) && !ObjectUtils.isEmpty(pageSize)) {
if (!ObjectUtils.isEmpty(current) && !ObjectUtils.isEmpty(size)) {
if (ObjectUtils.isEmpty(orderby)) {
PageHelper.startPage(pageNum, pageSize);
PageHelper.startPage(current, size);
} else {
PageHelper.startPage(pageNum, pageSize, orderby);
PageHelper.startPage(current, size, orderby);
}
} else {
startPage(orderby);
......
......@@ -12,7 +12,7 @@ public class TableSupport {
/**
* 当前记录起始索引
*/
public static final String PAGE_NUM = "pageNum";
public static final String PAGE_NUM = "current";
/**
* 默认分页号
......@@ -22,7 +22,7 @@ public class TableSupport {
/**
* 每页显示记录数
*/
public static final String PAGE_SIZE = "pageSize";
public static final String PAGE_SIZE = "size";
/**
* 默认每页显示记录数
......
......@@ -157,6 +157,7 @@
sys_user_sync_category
<where>
sys_user_sync.tenant_id = #{tenantId}
and sys_user_sync_category.tenant_id = #{tenantId}
and sys_user_sync.dept_id = sys_user_sync_category.dept_id
<if test="searchValue != null and searchValue != ''">
and (sys_user_sync.user_id like concat('%',#{searchValue},'%') or sys_user_sync.name like concat('%',#{searchValue},'%') or sys_user_sync_category.name like concat('%',#{searchValue},'%'))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论