mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-23 02:46:53 +08:00
v1.0.6 优化代码生成模板
This commit is contained in:
@@ -50,7 +50,7 @@ public class EmailService {
|
||||
List<EmailEntity> entities = emailDao.queryByPage(page, queryDTO);
|
||||
List<EmailVO> dtoList = SmartBeanUtil.copyList(entities, EmailVO.class);
|
||||
page.setRecords(dtoList);
|
||||
PageResultDTO<EmailVO> pageResultDTO = SmartPaginationUtil.convert2PageInfoDTO(page);
|
||||
PageResultDTO<EmailVO> pageResultDTO = SmartPaginationUtil.convert2PageResultDTO(page);
|
||||
return ResponseDTO.succData(pageResultDTO);
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ public class EmployeeService {
|
||||
}
|
||||
}
|
||||
}
|
||||
return ResponseDTO.succData(SmartPaginationUtil.convert2PageInfoDTO(pageParam, employeeList, EmployeeVO.class));
|
||||
return ResponseDTO.succData(SmartPaginationUtil.convert2PageResultDTO(pageParam, employeeList, EmployeeVO.class));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -158,7 +158,7 @@ public class FileService {
|
||||
e.setFileUrl(fileService.getFileUrl(e.getFilePath()).getData());
|
||||
});
|
||||
}
|
||||
PageResultDTO<FileVO> pageResultDTO = SmartPaginationUtil.convert2PageInfoDTO(page, fileList);
|
||||
PageResultDTO<FileVO> pageResultDTO = SmartPaginationUtil.convert2PageResultDTO(page, fileList);
|
||||
return ResponseDTO.succData(pageResultDTO);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.gangquan360.smartadmin.config.SmartHeartBeatConfig;
|
||||
import com.gangquan360.smartadmin.util.SmartBeanUtil;
|
||||
import com.gangquan360.smartadmin.util.SmartPaginationUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -84,7 +83,7 @@ public class HeartBeatService extends AbstractHeartBeatCommand {
|
||||
public ResponseDTO<PageResultDTO<HeartBeatRecordVO>> pageQuery(PageParamDTO pageParamDTO) {
|
||||
Page pageQueryInfo = SmartPaginationUtil.convert2PageQueryInfo(pageParamDTO);
|
||||
List<HeartBeatRecordVO> recordVOList = heartBeatRecordDao.pageQuery(pageQueryInfo);
|
||||
PageResultDTO<HeartBeatRecordVO> pageResultDTO = SmartPaginationUtil.convert2PageInfoDTO(pageQueryInfo, recordVOList);
|
||||
PageResultDTO<HeartBeatRecordVO> pageResultDTO = SmartPaginationUtil.convert2PageResultDTO(pageQueryInfo, recordVOList);
|
||||
return ResponseDTO.succData(pageResultDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class UserLoginLogService {
|
||||
List<UserLoginLogEntity> entities = userLoginLogDao.queryByPage(page, queryDTO);
|
||||
List<UserLoginLogDTO> dtoList = SmartBeanUtil.copyList(entities, UserLoginLogDTO.class);
|
||||
page.setRecords(dtoList);
|
||||
PageResultDTO<UserLoginLogDTO> pageResultDTO = SmartPaginationUtil.convert2PageInfoDTO(page);
|
||||
PageResultDTO<UserLoginLogDTO> pageResultDTO = SmartPaginationUtil.convert2PageResultDTO(page);
|
||||
return ResponseDTO.succData(pageResultDTO);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class UserOperateLogService {
|
||||
List<UserOperateLogEntity> entities = userOperateLogDao.queryByPage(page, queryDTO);
|
||||
List<UserOperateLogDTO> dtoList = SmartBeanUtil.copyList(entities, UserOperateLogDTO.class);
|
||||
page.setRecords(dtoList);
|
||||
PageResultDTO<UserOperateLogDTO> pageResultDTO = SmartPaginationUtil.convert2PageInfoDTO(page);
|
||||
PageResultDTO<UserOperateLogDTO> pageResultDTO = SmartPaginationUtil.convert2PageResultDTO(page);
|
||||
return ResponseDTO.succData(pageResultDTO);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class NoticeService {
|
||||
Page page = SmartPaginationUtil.convert2PageQueryInfo(queryDTO);
|
||||
List<NoticeVO> dtoList = noticeDao.queryByPage(page, queryDTO);
|
||||
page.setRecords(dtoList);
|
||||
PageResultDTO<NoticeVO> pageResultDTO = SmartPaginationUtil.convert2PageInfoDTO(page);
|
||||
PageResultDTO<NoticeVO> pageResultDTO = SmartPaginationUtil.convert2PageResultDTO(page);
|
||||
return ResponseDTO.succData(pageResultDTO);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class NoticeService {
|
||||
}
|
||||
});
|
||||
page.setRecords(dtoList);
|
||||
PageResultDTO<NoticeReceiveDTO> pageResultDTO = SmartPaginationUtil.convert2PageInfoDTO(page);
|
||||
PageResultDTO<NoticeReceiveDTO> pageResultDTO = SmartPaginationUtil.convert2PageResultDTO(page);
|
||||
return ResponseDTO.succData(pageResultDTO);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class NoticeService {
|
||||
Page page = SmartPaginationUtil.convert2PageQueryInfo(queryDTO);
|
||||
List<NoticeVO> dtoList = noticeDao.queryUnreadByPage(page, requestToken.getRequestUserId(), JudgeEnum.YES.getValue());
|
||||
page.setRecords(dtoList);
|
||||
PageResultDTO<NoticeVO> pageResultDTO = SmartPaginationUtil.convert2PageInfoDTO(page);
|
||||
PageResultDTO<NoticeVO> pageResultDTO = SmartPaginationUtil.convert2PageResultDTO(page);
|
||||
return ResponseDTO.succData(pageResultDTO);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class PositionService {
|
||||
Page page = SmartPaginationUtil.convert2PageQueryInfo(queryDTO);
|
||||
List<PositionEntity> entityList = positionDao.selectByPage(page, queryDTO);
|
||||
page.setRecords(entityList.stream().map(e -> SmartBeanUtil.copy(e, PositionResultVO.class)).collect(Collectors.toList()));
|
||||
PageResultDTO<PositionResultVO> pageResultDTO = SmartPaginationUtil.convert2PageInfoDTO(page);
|
||||
PageResultDTO<PositionResultVO> pageResultDTO = SmartPaginationUtil.convert2PageResultDTO(page);
|
||||
return ResponseDTO.succData(pageResultDTO);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class QuartzTaskService {
|
||||
Page pageParam = SmartPaginationUtil.convert2PageQueryInfo(queryDTO);
|
||||
List<QuartzTaskVO> taskList = quartzTaskDao.queryList(pageParam, queryDTO);
|
||||
pageParam.setRecords(taskList);
|
||||
return ResponseDTO.succData(SmartPaginationUtil.convert2PageInfoDTO(pageParam));
|
||||
return ResponseDTO.succData(SmartPaginationUtil.convert2PageResultDTO(pageParam));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,7 +69,7 @@ public class QuartzTaskService {
|
||||
Page pageParam = SmartPaginationUtil.convert2PageQueryInfo(queryDTO);
|
||||
List<QuartzTaskLogVO> taskList = quartzTaskLogDao.queryList(pageParam, queryDTO);
|
||||
pageParam.setRecords(taskList);
|
||||
return ResponseDTO.succData(SmartPaginationUtil.convert2PageInfoDTO(pageParam));
|
||||
return ResponseDTO.succData(SmartPaginationUtil.convert2PageResultDTO(pageParam));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,7 +55,7 @@ public class RoleEmployeeService {
|
||||
DepartmentEntity departmentEntity = departmentDao.selectById(employeeDTO.getDepartmentId());
|
||||
employeeDTO.setDepartmentName(departmentEntity.getName());
|
||||
});
|
||||
PageResultDTO<EmployeeVO> pageResultDTO = SmartPaginationUtil.convert2PageInfoDTO(page, employeeDTOS, EmployeeVO.class);
|
||||
PageResultDTO<EmployeeVO> pageResultDTO = SmartPaginationUtil.convert2PageResultDTO(page, employeeDTOS, EmployeeVO.class);
|
||||
return ResponseDTO.succData(pageResultDTO);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ public class SystemConfigService {
|
||||
public ResponseDTO<PageResultDTO<SystemConfigVO>> getSystemConfigPage(SystemConfigQueryDTO queryDTO) {
|
||||
Page page = SmartPaginationUtil.convert2PageQueryInfo(queryDTO);
|
||||
List<SystemConfigEntity> entityList = systemConfigDao.selectSystemSettingList(page, queryDTO);
|
||||
PageResultDTO<SystemConfigVO> pageResultDTO = SmartPaginationUtil.convert2PageInfoDTO(page, entityList, SystemConfigVO.class);
|
||||
PageResultDTO<SystemConfigVO> pageResultDTO = SmartPaginationUtil.convert2PageResultDTO(page, entityList, SystemConfigVO.class);
|
||||
return ResponseDTO.succData(pageResultDTO);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
|
||||
public class SmartPaginationUtil {
|
||||
|
||||
public static <T> PageResultDTO<T> convert2PageInfoDTO(Page<T> page) {
|
||||
public static <T> PageResultDTO<T> convert2PageResultDTO(Page<T> page) {
|
||||
PageResultDTO<T> result = new PageResultDTO<>();
|
||||
result.setPageNum(page.getCurrent());
|
||||
result.setPageSize(page.getSize());
|
||||
@@ -51,7 +51,7 @@ public class SmartPaginationUtil {
|
||||
* @author yandanyang
|
||||
* @date 2018年5月16日 下午6:05:28
|
||||
*/
|
||||
public static <T, E> PageResultDTO<T> convert2PageInfoDTO(Page page, List<E> sourceList, Class<T> targetClazz) {
|
||||
public static <T, E> PageResultDTO<T> convert2PageResultDTO(Page page, List<E> sourceList, Class<T> targetClazz) {
|
||||
PageResultDTO pageResultDTO = setPage(page);
|
||||
List<T> records = SmartBeanUtil.copyList(sourceList, targetClazz);
|
||||
page.setRecords(records);
|
||||
@@ -68,7 +68,7 @@ public class SmartPaginationUtil {
|
||||
* @author yandanyang
|
||||
* @date 2018年5月16日 下午6:05:28
|
||||
*/
|
||||
public static <T, E> PageResultDTO<T> convert2PageInfoDTO(Page page, List<E> sourceList) {
|
||||
public static <T, E> PageResultDTO<T> convert2PageResultDTO(Page page, List<E> sourceList) {
|
||||
PageResultDTO pageResultDTO = setPage(page);
|
||||
page.setRecords(sourceList);
|
||||
pageResultDTO.setList(sourceList);
|
||||
|
||||
Reference in New Issue
Block a user