吉安感知网项目-后端
linwei
2026-01-19 3664ff0935aeab26d23926331333a1f55caea1c1
drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/service/impl/GdSupplyDemandAuditAttachmentServiceImpl.java
@@ -16,16 +16,21 @@
 */
package org.sxkj.gd.orderdata.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
import org.sxkj.gd.orderdata.entity.GdSupplyDemandAuditAttachmentEntity;
import org.sxkj.gd.orderdata.vo.GdSupplyDemandAuditAttachmentVO;
import org.sxkj.gd.orderdata.excel.GdSupplyDemandAuditAttachmentExcel;
import org.sxkj.gd.orderdata.mapper.GdSupplyDemandAuditAttachmentMapper;
import org.sxkj.gd.orderdata.service.IGdSupplyDemandAuditAttachmentService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.sxkj.gd.orderdata.vo.GdSupplyDemandAuditAttachmentVO;
import org.sxkj.gd.orderdata.wrapper.GdSupplyDemandAuditAttachmentWrapper;
import java.util.List;
import java.util.stream.Collectors;
/**
 * 供需需求审核附件表 服务实现类
@@ -51,4 +56,27 @@
      return gdSupplyDemandAuditAttachmentList;
   }
   @Override
   public boolean saveSupplyDemandAuditAttachments(List<GdSupplyDemandAuditAttachmentEntity> attachments) {
      if (attachments == null || attachments.isEmpty()) {
         return true;
      }
      return baseMapper.insertSupplyDemandAuditAttachments(attachments) > 0;
   }
   @Override
   public List<GdSupplyDemandAuditAttachmentVO> listSupplyDemandAuditAttachments(Long demandId) {
      if (demandId == null) {
         throw new ServiceException("需求编号不能为空");
      }
      List<GdSupplyDemandAuditAttachmentEntity> entities = baseMapper.selectSupplyDemandAuditAttachmentList(demandId);
      if (Func.isEmpty(entities)) {
         return java.util.Collections.emptyList();
      }
      GdSupplyDemandAuditAttachmentWrapper wrapper = GdSupplyDemandAuditAttachmentWrapper.build();
      return entities.stream()
         .map(wrapper::entityVO)
         .collect(Collectors.toList());
   }
}