| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztmd.util.DownloadZipUtils; |
| | | import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigation; |
| | | import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigationState; |
| | | import cn.gistack.sm.sjztmd.mapper.TbResGeneralInvestigationMapper; |
| | |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTable; |
| | | import cn.gistack.sm.sjztmd.util.CalculateUtils; |
| | | import cn.gistack.sm.sjztmd.util.DownloadZipUtils; |
| | | import cn.gistack.sm.sjztmd.vo.AttResBaseGeneralInvestigationVO; |
| | | import cn.gistack.sm.sjztmd.vo.ImageAndVideoVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbResGeneralInvestigationParam; |
| | | import com.alibaba.nacos.shaded.com.google.gson.Gson; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonArray; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonElement; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonObject; |
| | | 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 lombok.val; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | |
| | | 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 ITbResGeneralInvestigationStateService tbResGeneralInvestigationStateService; |
| | | |
| | | @Autowired |
| | | private HttpServletRequest request; |
| | | @Autowired |
| | | private HttpServletResponse response; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> downZip(IPage<ImageAndVideoVO> page,String type) throws IOException { |
| | | List<String> urls = new ArrayList<>(); |
| | | List<ImageAndVideoVO> iamgeAndVideoUrls; |
| | | if (type.equals("1")) { |
| | | iamgeAndVideoUrls = baseMapper.getIamgeAndVideoUrl(page); |
| | | }else { |
| | | iamgeAndVideoUrls = baseMapper.getIamgeAndVideoUrl(null); |
| | | } |
| | | |
| | | |
| | | |
| | | 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) { |
| | | //System.out.println(url1+"ssss"); |
| | | DownloadZipUtils.downloadFile(url1); |
| | | } |
| | | DownloadZipUtils.downloadZip(request, response,1); |
| | | return urlss; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |