| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.SoftwareMapper; |
| | | import com.whyc.pojo.Software; |
| | | import org.apache.poi.openxml4j.exceptions.InvalidFormatException; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.IOException; |
| | |
| | | |
| | | @Service |
| | | public class SoftwareService { |
| | | @Autowired |
| | | private SoftwareMapper mapper; |
| | | |
| | | public List<Software> excelParse(InputStream inputStream) throws IOException, InvalidFormatException { |
| | | List<Software> softwareList = new LinkedList<>(); |
| | |
| | | return softwareList; |
| | | |
| | | } |
| | | |
| | | //查询软件列表的信息 |
| | | public Response getAllSoftware(String fileName, int pageCurr, int pageSize) { |
| | | PageHelper.startPage(pageCurr,pageSize); |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | if(fileName!=null&&!fileName.isEmpty()){ |
| | | wrapper.like("file_name",fileName); |
| | | } |
| | | wrapper.orderByAsc("id"); |
| | | List list=mapper.selectList(wrapper); |
| | | return new Response().setII(1,list.size()>0,list,"软件信息返回"); |
| | | } |
| | | } |