Sfoglia il codice sorgente

feat(采购):下载文件

Wangyafan 8 mesi fa
parent
commit
b109254d48

+ 2 - 2
src/main/java/com/sunxung/factoring/service/purchcontractmanagement/PurchContractElectronicInfoService.java

@@ -53,11 +53,11 @@ public interface PurchContractElectronicInfoService extends IService<PurchContra
 
     /**
      * 出证下载
-     * @param managerId
+     * @param managementId
      * @param res
      * @return
      */
-    ResponseEntity<Object> downloadReportUrl(Long managerId, HttpServletResponse res) throws IOException;
+    ResponseEntity<Object> downloadReportUrl(Long managementId, HttpServletResponse res) throws IOException;
 
     void checkCallBack(Long businessKey);
 

+ 7 - 6
src/main/java/com/sunxung/factoring/service/purchcontractmanagement/impl/PurchContractElectronicInfoServiceImpl.java

@@ -69,9 +69,6 @@ public class PurchContractElectronicInfoServiceImpl extends ServiceImpl<PurchCon
     @Autowired
     private PurchContractElectronicInfoService purchContractElectronicInfoService;
 
-    @Autowired
-    private BusinessBasicInfoService businessBasicInfoService;
-
     @Autowired
     private PlatformService platformService;
 
@@ -147,6 +144,9 @@ public class PurchContractElectronicInfoServiceImpl extends ServiceImpl<PurchCon
     @Autowired
     private IEnterpriseService enterpriseService;
 
+    @Autowired
+    private IPurchContractSupplementInfoService purchContractSupplementInfoService;
+
     @Override
     public List<PurchContractElectronicInfo> findByPurchContApprId(Long id) {
         return baseMapper.findByPurchContBasicId(id);
@@ -659,18 +659,19 @@ public class PurchContractElectronicInfoServiceImpl extends ServiceImpl<PurchCon
     }
 
     @Override
-    public ResponseEntity<Object> downloadReportUrl(Long managerId, HttpServletResponse res) throws IOException {
+    public ResponseEntity<Object> downloadReportUrl(Long managementId, HttpServletResponse res) throws IOException {
         String fileName = "出证文件.zip";
         fileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1");
         res.setContentType("application/zip");
         res.setHeader("Content-disposition", String.format("attachment; filename=" + fileName));
         PurchContractBasicInfo purchContractBasicInfo = purchContractBasicInfoService
-                .lambdaQuery().eq(PurchContractBasicInfo::getPurchContractManagementId,managerId).one();
+                .lambdaQuery().eq(PurchContractBasicInfo::getPurchContractManagementId,managementId).one();
         AttachmentDto attachmentDto = AttachmentDto.builder()
                 .setEntityId(purchContractBasicInfo.getId())
                 .setChildEnum(FileModuleDict.ChildEnum.PURCHASE_CONTRACT_SIGN_FILE_REPORT)
                 .build();
-        List<PurchContractSupplementInfo> supplementInfos = purchContractService.findByManagerId(managerId);
+        List<PurchContractSupplementInfo> supplementInfos = purchContractSupplementInfoService
+                .lambdaQuery().eq(PurchContractSupplementInfo::getPurchContractManagementId,managementId).list();
         List<AttachmentDto> attachmentDtoChanges = new ArrayList<>();
         for (PurchContractSupplementInfo supplementInfo : supplementInfos) {
             AttachmentDto attachmentDtoChange = AttachmentDto.builder()