| | |
| | | import com.whyc.dto.FileDirPath; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.SoftDto; |
| | | import com.whyc.mapper.SoftcodeMapper; |
| | | import com.whyc.mapper.SoftwareMapper; |
| | | import com.whyc.pojo.Softcode; |
| | | import com.whyc.pojo.Software; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.CommonUtil; |
| | |
| | | public class SoftwareService { |
| | | @Autowired(required = false) |
| | | private SoftwareMapper mapper; |
| | | |
| | | @Autowired(required = false) |
| | | private SoftcodeMapper codeMapper; |
| | | |
| | | @Autowired |
| | | private DocLogService logService; |
| | |
| | | for (SoftDto dto:list) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("file_name",dto.getFileName()); |
| | | if(mapper.selectCount(wrapper)>0){ |
| | | wrapper.last("limit 1"); |
| | | Softcode code=codeMapper.selectOne(wrapper); |
| | | if(code!=null){ |
| | | dto.setCodeFlag(1); |
| | | dto.setCodeName(code.getCodeName()); |
| | | }else{ |
| | | dto.setCodeFlag(0); |
| | | dto.setCodeName(""); |
| | | } |
| | | } |
| | | PageInfo pageInfo=new PageInfo(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); |
| | | 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,"查询日期三天内的所有上传软件"); |
| | | } |
| | | } |