New file |
| | |
| | | package com.oying.modules.message.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.oying.modules.message.domain.MessageOrderLeave; |
| | | import com.oying.modules.message.domain.MessageSystem; |
| | | import com.oying.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.oying.modules.message.service.MessageSystemService; |
| | | import com.oying.modules.message.domain.dto.MessageSystemQueryCriteria; |
| | | import com.oying.modules.message.mapper.MessageSystemMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.oying.utils.PageUtil; |
| | | |
| | | import java.util.*; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.oying.utils.PageResult; |
| | | |
| | | /** |
| | | * @description 服务实现 |
| | | * @author 李萌 |
| | | * @date 2025-05-20 |
| | | **/ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class MessageSystemServiceImpl extends ServiceImpl<MessageSystemMapper, MessageSystem> implements MessageSystemService { |
| | | |
| | | private final MessageSystemMapper messageSystemMapper; |
| | | |
| | | @Override |
| | | public PageResult<MessageSystem> queryAll(MessageSystemQueryCriteria criteria, Page<Object> page){ |
| | | return PageUtil.toPage(messageSystemMapper.findAll(criteria, page)); |
| | | } |
| | | |
| | | @Override |
| | | public List<MessageSystem> queryAll(MessageSystemQueryCriteria criteria){ |
| | | return messageSystemMapper.findAll(criteria); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void create(MessageSystem resources) { |
| | | messageSystemMapper.insert(resources); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(MessageSystem resources) { |
| | | MessageSystem messageSystem = getById(resources.getId()); |
| | | messageSystem.copy(resources); |
| | | messageSystemMapper.updateById(messageSystem); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteAll(List<Integer> ids) { |
| | | messageSystemMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void download(List<MessageSystem> all, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (MessageSystem messageSystem : all) { |
| | | Map<String, Object> map = new LinkedHashMap<>(); |
| | | map.put("系统维护开始时间", messageSystem.getStartTime()); |
| | | map.put("系统维护截至时间", messageSystem.getEndTime()); |
| | | list.add(map); |
| | | } |
| | | FileUtil.downloadExcel(list, response); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |