| | |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsBar; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.util.DownloadZipUtils; |
| | | import cn.gistack.sm.sjztmd.vo.ImageAndVideoVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbDykeInvestigationParam; |
| | | import cn.gistack.sm.sjztmd.vo.TbResGeneralInvestigationParam; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | |
| | | @Autowired |
| | | private IAttAdBaseService attAdBaseService; |
| | | |
| | | @Autowired |
| | | private HttpServletRequest request; |
| | | |
| | | @Autowired |
| | | private HttpServletResponse response; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param page |
| | | * @return 操作状态 |
| | | */ |
| | | @Override |
| | | public List<String> downZip(IPage<ImageAndVideoVO> page,String type) throws IOException { |
| | | List<ImageAndVideoVO> iamgeAndVideoUrls; |
| | | if (type.equals("1")) { |
| | | iamgeAndVideoUrls = baseMapper.getIamgeAndVideoUrl(page); |
| | | }else { |
| | | iamgeAndVideoUrls = baseMapper.getIamgeAndVideoUrl(null); |
| | | } |
| | | |
| | | List<String> urls = new ArrayList<>(); |
| | | for (ImageAndVideoVO iamgeAndVideoUrl : iamgeAndVideoUrls) { |
| | | urls.add(iamgeAndVideoUrl.getImagesUrl()); |
| | | urls.add(iamgeAndVideoUrl.getVideosUrl()); |
| | | } |
| | | List<String> urlss = DownloadZipUtils.getUrls(urls); |
| | | if (urlss.isEmpty()) { |
| | | return null; |
| | | }else { |
| | | // 打印提取的URLs |
| | | for (String url1 : urlss) { |
| | | DownloadZipUtils.downloadFile(url1); |
| | | } |
| | | DownloadZipUtils.downloadZip(request, response,0); |
| | | return urlss; |
| | | } |
| | | } |
| | | } |