记得上下班打卡 | git大法好,push需谨慎

Commit 332e6c38 authored by 姜秀龙's avatar 姜秀龙

Merge branch 'refs/heads/250115-realNameAndinformation-optimization' into container-test

parents 647f46d8 f9e0135e
......@@ -99,7 +99,7 @@ public class KylinNoticesAdminController extends BaseController {
@PostMapping("list")
@ResponseBody
public TableDataInfo noticeList(BuyNoticeSearchParam param) {
PageInfo<KylinBuyNotice> result = kylinNoticesServiceImpl.noticeList(param);
PageInfo<BuyNoticeVo> result = kylinNoticesServiceImpl.noticeListVo(param);
return getDataTable(result.getList());
}
......
......@@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -147,6 +148,52 @@ public class KylinBuyNoticeServiceImpl extends ServiceImpl<KylinBuyNoticeMapper,
return pageInfoTmp;
}
/**
* 须知列表(返回VO格式,用于前端显示)
*/
public PageInfo<BuyNoticeVo> noticeListVo(BuyNoticeSearchParam param) {
PageInfo<BuyNoticeVo> pageInfoTmp = null;
try {
PageHelper.startPage(param.getPageNum(), param.getPageSize());
Map<String, Object> paramMap = BeanUtil.convertBeanToMap(param);
log.info("原始参数对象: title={}, noticeType={}, status={}", param.getTitle(), param.getNoticeType(), param.getStatus());
log.info("转换后的Map参数: {}", paramMap);
List<KylinBuyNotice> list = noticesMapper.searchNoticesList(paramMap);
// 转换为VO并设置须知类型名称和格式化时间
List<BuyNoticeVo> voList = new ArrayList<>();
if (list != null) {
for (KylinBuyNotice item : list) {
BuyNoticeVo vo = new BuyNoticeVo();
BeanUtils.copyProperties(item, vo);
// 设置须知类型名称
if (item.getNoticeType() != null) {
vo.setNoticeTypeName(item.getNoticeType() == 1 ? "购票须知" : "观演须知");
}
// 格式化时间显示
if (item.getCreatedAt() != null) {
vo.setCreatedAt(DateUtil.Formatter.yyyyMMddHHmmss.format(item.getCreatedAt()));
}
if (item.getUpdatedAt() != null) {
vo.setUpdatedAt(DateUtil.Formatter.yyyyMMddHHmmss.format(item.getUpdatedAt()));
}
voList.add(vo);
}
}
pageInfoTmp = new PageInfo<>(voList);
} catch (Exception e) {
log.error("获取须知列表失败", e);
return new PageInfo<>();
}
return pageInfoTmp;
}
/**
* 删除须知(逻辑删除)
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment