yxm
2024-06-28 1793428a18b864e94032ce5102d6e5bb650a2c81
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/service/impl/TbResGeneralInvestigationServiceImpl.java
@@ -1,5 +1,6 @@
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;
@@ -36,6 +37,7 @@
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
 * @PROJECT_NAME: skjcmanager
@@ -52,9 +54,12 @@
   private ITbResGeneralInvestigationStateService tbResGeneralInvestigationStateService;
   @Autowired
   private HttpServletRequest request;
   private AttResBaseMapper attResBaseMapper;
   @Autowired
   private HttpServletResponse response;
   private HttpServletRequest request;
//   @Autowired
//   private HttpServletResponse response;
   @Override
   @Transactional
@@ -206,8 +211,10 @@
   }
   @Override
   public List<ResGentionVO> downZipCopy() {
   public List<ResGentionVO> downZipCopy(IPage<AttResBaseGeneralInvestigationVO> page,String type) {
      //获取已审批的数据
      List<ResGentionVO> iamgeAndVideoUrlcopy = baseMapper.getIamgeAndVideoUrlcopy();
      for (ResGentionVO resGentionVO : iamgeAndVideoUrlcopy) {
         List<String> urls = new ArrayList<>();
@@ -218,7 +225,7 @@
         if(resGentionVO.getVideoUrls() != null) {
            urls.add(resGentionVO.getVideoUrls());
         }
         //解析json中url 放入list集合中
         List<String> urlss = DownloadZipUtils.getUrls(urls);
         int counter=1;
         for (String s : urlss) {
@@ -229,6 +236,23 @@
         }
         resGentionVO.setDyketionallVOS(dyketionallVOS);
      }
      //分页情况下
      if(type.equals("1")){
         //获取分页信息
         AttResBaseGeneralInvestigationVO attResBaseGeneralInvestigationVO = new AttResBaseGeneralInvestigationVO();
         attResBaseGeneralInvestigationVO.setTbYear(2024);
         List<AttResBaseGeneralInvestigationVO> attResBaseGeneralInvestigationVOS = attResBaseMapper.selectAttResBaseGeneralInvestigation(page, attResBaseGeneralInvestigationVO);
         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;
   }