| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztmd.mapper.AttResBaseMapper; |
| | | 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.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 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 java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | |
| | | private ITbResGeneralInvestigationStateService tbResGeneralInvestigationStateService; |
| | | |
| | | @Autowired |
| | | private HttpServletRequest request; |
| | | private AttResBaseMapper attResBaseMapper; |
| | | |
| | | @Autowired |
| | | private HttpServletResponse response; |
| | | private HttpServletRequest request; |
| | | // @Autowired |
| | | // private HttpServletResponse response; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<ResGentionVO> downZipCopy(IPage<AttResBaseGeneralInvestigationVO> page,String type,AttResBaseGeneralInvestigationVO attResBase) { |
| | | //获取已审批的数据 |
| | | List<ResGentionVO> iamgeAndVideoUrlcopy = baseMapper.getIamgeAndVideoUrlcopy(); |
| | | |
| | | |
| | | for (ResGentionVO resGentionVO : iamgeAndVideoUrlcopy) { |
| | | List<String> urls = new ArrayList<>(); |
| | | List<DyketionallVO> dyketionallVOS = new ArrayList<>(); |
| | | if(resGentionVO.getImagesUrls() != null){ |
| | | urls.add(resGentionVO.getImagesUrls()); |
| | | } |
| | | if(resGentionVO.getVideoUrls() != null) { |
| | | urls.add(resGentionVO.getVideoUrls()); |
| | | } |
| | | //解析json中url 放入list集合中 |
| | | List<String> urlss = DownloadZipUtils.getUrls(urls); |
| | | int counter=1; |
| | | for (String s : urlss) { |
| | | DyketionallVO dyketionallVO = new DyketionallVO(); |
| | | dyketionallVO.setUrlname(resGentionVO.getResname()+"+"+resGentionVO.getPpname()+"+"+resGentionVO.getRn()+String.format("%02d", counter++)+s.substring(s.length() - 4)); |
| | | dyketionallVO.setUrl(s); |
| | | dyketionallVOS.add(dyketionallVO); |
| | | } |
| | | resGentionVO.setDyketionallVOS(dyketionallVOS); |
| | | } |
| | | //分页情况下 |
| | | if(type.equals("1")){ |
| | | //获取分页信息 |
| | | // AttResBaseGeneralInvestigationVO attResBaseGeneralInvestigationVO = new AttResBaseGeneralInvestigationVO(); |
| | | // attResBaseGeneralInvestigationVO.setTbYear(2024); |
| | | List<AttResBaseGeneralInvestigationVO> attResBaseGeneralInvestigationVOS = attResBaseMapper.selectAttResBaseGeneralInvestigation(page, attResBase); |
| | | |
| | | List<String> resCode = new ArrayList<>(); |
| | | for (AttResBaseGeneralInvestigationVO imageAndVideoVO : attResBaseGeneralInvestigationVOS) { |
| | | resCode.add(imageAndVideoVO.getCode()); |
| | | } |
| | | List<ResGentionVO> iamgeAndVideoUrls = iamgeAndVideoUrlcopy.stream() |
| | | .filter(resGentionVO -> resCode.contains(resGentionVO.getCode())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | return iamgeAndVideoUrls; |
| | | } |
| | | |
| | | return iamgeAndVideoUrlcopy; |
| | | } |
| | | |
| | | |
| | | } |