| | |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.*; |
| | | import cn.gistack.sm.sjztmd.mapper.TbDykeInvestigationMapper; |
| | | import cn.gistack.sm.sjztmd.mapper.TbResDykeMapper; |
| | | import cn.gistack.sm.sjztmd.mapper.TbResGeneralInvestigationMapper; |
| | | import cn.gistack.sm.sjztmd.service.*; |
| | | 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 cn.gistack.sm.sjztmd.vo.*; |
| | | 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 java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | |
| | | private IAttAdBaseService attAdBaseService; |
| | | |
| | | @Autowired |
| | | private HttpServletRequest request; |
| | | private TbResDykeMapper tbResDykeMapper; |
| | | |
| | | @Autowired |
| | | private HttpServletResponse response; |
| | | private HttpServletRequest request; |
| | | |
| | | // @Autowired |
| | | // private HttpServletResponse response; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | return urlss; |
| | | } |
| | | |
| | | @Override |
| | | public List<DyketionVO> downloadZipCopy(IPage<TbResDykeVO> page,String type,TbResDykeVO tbResDykeVO) { |
| | | //获取已审批的数据 |
| | | List<DyketionVO> iamgeAndVideoUrlcopy = baseMapper.getIamgeAndVideoUrlcopy(); |
| | | |
| | | |
| | | for (DyketionVO dyketionVO : iamgeAndVideoUrlcopy) { |
| | | List<String> urls = new ArrayList<>(); |
| | | List<DyketionallVO> dyketionallVOS = new ArrayList<>(); |
| | | if(dyketionVO.getImagesUrl() != null){ |
| | | urls.add(dyketionVO.getImagesUrl()); |
| | | } |
| | | if(dyketionVO.getVideosUrl() != null) { |
| | | urls.add(dyketionVO.getVideosUrl()); |
| | | } |
| | | |
| | | //解析json中url 放入list集合中 |
| | | List<String> urlss = DownloadZipUtils.getUrls(urls); |
| | | |
| | | int counter=1; |
| | | for (String s : urlss) { |
| | | DyketionallVO dyketionallVO = new DyketionallVO(); |
| | | dyketionallVO.setUrlname(dyketionVO.getDname()+"+"+dyketionVO.getRn()+String.format("%02d", counter++)+s.substring(s.length() - 4)); |
| | | dyketionallVO.setUrl(s); |
| | | dyketionallVOS.add(dyketionallVO); |
| | | } |
| | | dyketionVO.setDyketionallVOS(dyketionallVOS); |
| | | } |
| | | //分页情况下 |
| | | if(type.equals("1")){ |
| | | //获取分页信息 |
| | | // TbResDykeVO tbResDykeVO = new TbResDykeVO(); |
| | | // tbResDykeVO.setTbYear(2024); |
| | | List<TbResDykeVO> tbResDykeVOIPage = tbResDykeMapper.findTbResDykePcBy(page, tbResDykeVO); |
| | | |
| | | List<String> dykeCode = new ArrayList<>(); |
| | | for (TbResDykeVO imageAndVideoVO : tbResDykeVOIPage) { |
| | | dykeCode.add(imageAndVideoVO.getGuid()); |
| | | } |
| | | List<DyketionVO> iamgeAndVideoUrls = iamgeAndVideoUrlcopy.stream() |
| | | .filter(dyketionVO -> dykeCode.contains(dyketionVO.getCode())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | return iamgeAndVideoUrls; |
| | | } |
| | | |
| | | |
| | | return iamgeAndVideoUrlcopy; |
| | | } |
| | | |
| | | } |