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

Commit 88518273 authored by 姜秀龙's avatar 姜秀龙

Merge branch 'refs/heads/master' into container-prod

parents ef291c6f 46a09ccb
...@@ -99,7 +99,7 @@ public class KylinNoticesAdminController extends BaseController { ...@@ -99,7 +99,7 @@ public class KylinNoticesAdminController extends BaseController {
@PostMapping("list") @PostMapping("list")
@ResponseBody @ResponseBody
public TableDataInfo noticeList(BuyNoticeSearchParam param) { public TableDataInfo noticeList(BuyNoticeSearchParam param) {
PageInfo<BuyNoticeVo> result = kylinNoticesServiceImpl.noticeListVo(param); PageInfo<KylinBuyNotice> result = kylinNoticesServiceImpl.noticeList(param);
return getDataTable(result.getList()); return getDataTable(result.getList());
} }
......
...@@ -90,7 +90,20 @@ ...@@ -90,7 +90,20 @@
}, },
{ {
field: 'createdAt', field: 'createdAt',
title: '创建时间' title: '创建时间',
formatter: function(value, row, index) {
if (value) {
// 将LocalDateTime格式转换为可读的日期格式
var date = new Date(value);
return date.getFullYear() + '-' +
String(date.getMonth() + 1).padStart(2, '0') + '-' +
String(date.getDate()).padStart(2, '0') + ' ' +
String(date.getHours()).padStart(2, '0') + ':' +
String(date.getMinutes()).padStart(2, '0') + ':' +
String(date.getSeconds()).padStart(2, '0');
}
return '';
}
}, },
{ {
title: '操作', title: '操作',
......
...@@ -148,51 +148,7 @@ public class KylinBuyNoticeServiceImpl extends ServiceImpl<KylinBuyNoticeMapper, ...@@ -148,51 +148,7 @@ public class KylinBuyNoticeServiceImpl extends ServiceImpl<KylinBuyNoticeMapper,
return pageInfoTmp; 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