| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.UserOperation; |
| | | import com.whyc.dto.CodeFilesDto; |
| | | import com.whyc.dto.FileDirPath; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.SoftDto; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.ZoneId; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | |
| | | return new Response().set(1,flag>0,"件id实现软件删除"); |
| | | } |
| | | |
| | | //查询日期三天内的所有上传软件名称 |
| | | //查询日期三天内的所有上传软件 |
| | | public Response getFileNameByCreateTime(String createTime) { |
| | | //获取endtime的三天前的时间 |
| | | LocalDate createDay= LocalDate.parse(createTime); |
| | |
| | | Date starttime=Date.from(startOfDay.atZone(ZoneId.systemDefault()).toInstant()); |
| | | |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.select("distinct file_name"); |
| | | wrapper.select("distinct file_name","type","version","based_version","owner","filing_date","create_time"); |
| | | wrapper.ge("create_time",starttime); |
| | | wrapper.le("create_time",endtime); |
| | | wrapper.eq("owner",ActionUtil.getUser().getName()); |
| | | List<Software> list=mapper.selectList(wrapper); |
| | | //获取list中fileName的集合 |
| | | List<String> nameList = list.stream().map(Software::getFileName).collect(Collectors.toList()); |
| | | return new Response().setII(1,nameList!=null,nameList,"查询日期三天内的所有上传软件名称"); |
| | | //List<String> nameList = list.stream().map(Software::getFileName).collect(Collectors.toList()); |
| | | return new Response().setII(1,list!=null,list,"查询日期三天内的所有上传软件"); |
| | | } |
| | | //查询当前owner的未上传源码记录 |
| | | public Response getFileNameByOwnerWithCode(String owner) { |
| | | List<Software> list=mapper.getFileNameByOwnerWithCode(owner); |
| | | return new Response().setII(1,list!=null,list,"查询当前owner的未上传源码记录"); |
| | | } |
| | | //批量添加源码包 |
| | | public Response setCodeByFileNmaes(CodeFilesDto dto) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("num",dto.getNum()); |
| | | wrapper.last("limit 1"); |
| | | Softcode softcode=codeMapper.selectOne(wrapper); |
| | | if(softcode==null){ |
| | | return new Response().set(1,false,"源码包不存在"); |
| | | }else{ |
| | | //获取list中fileName的集合 |
| | | List<String> nameList = dto.getFileNames(); |
| | | List<Softcode> softcodeList=new ArrayList<>(); |
| | | for (String fileName : nameList) { |
| | | Softcode s=new Softcode(); |
| | | s.setFileName(fileName); |
| | | s.setCodeUrl(softcode.getCodeUrl()); |
| | | s.setCodeName(softcode.getCodeName()); |
| | | s.setCreateTime(new Date()); |
| | | softcodeList.add(s); |
| | | } |
| | | codeMapper.insertBatchSomeColumn(softcodeList); |
| | | return new Response().set(1,true,"批量添加源码包"); |
| | | } |
| | | } |
| | | } |