Explorar o código

更新采购单附件批量下载的方法

hejq %!s(int64=8) %!d(string=hai) anos
pai
achega
f1b0182ff0

+ 2 - 5
src/main/java/com/uas/platform/b2b/controller/FileController.java

@@ -1,6 +1,5 @@
 package com.uas.platform.b2b.controller;
 
-import com.alibaba.fastjson.JSONObject;
 import com.uas.dfs.service.FileClient;
 import com.uas.platform.b2b.dao.CommonDao;
 import com.uas.platform.b2b.model.Attach;
@@ -8,10 +7,7 @@ import com.uas.platform.b2b.model.PurchaseOrderAll;
 import com.uas.platform.b2b.ps.InquiryUtils;
 import com.uas.platform.b2b.service.AttachService;
 import com.uas.platform.b2b.service.PurchaseOrderService;
-import com.uas.platform.b2b.support.SystemSession;
-import com.uas.platform.b2b.support.UsageBufferedLogger;
 import com.uas.platform.core.exception.NotFoundException;
-import com.uas.platform.core.logging.BufferedLoggerManager;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -104,7 +100,8 @@ public class FileController {
      * @modify-desc 增加日志记录
      */
     @RequestMapping("/batch/{id}")
-    public void batchDownload(@PathVariable("id") long id, HttpServletResponse response) throws IOException {
+    public void batchDownload(@PathVariable("id") long id, HttpServletResponse response) throws Exception {
+//        response.sendRedirect(" http://113.105.127.36:8099/ERP/common/downloadbyIds.action?ids=67819;67820;67818;67817;67813;67814&zipName=MP180300096 ");
         PurchaseOrderAll orderAll = purchaseOrderService.findById(id);
         String sql = " select at_path path,attachs.at_id id from attachs left join purc$prod$attach on attachs.at_id = purc$prod$attach.at_id " +
                "left join purc$orderitems on purc$orderitems.pd_id = purc$prod$attach.pd_id where purc$orderitems.pd_puid = " + id;

+ 1 - 5
src/main/webapp/resources/js/index/app.js

@@ -3688,11 +3688,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         };
 
         $scope.fileDownload = function (id) {
-            file.batch({id: id}, {}, function (data) {
-
-            }, function (res) {
-                toaster.pop('error', '错误', "暂未找到相关附件");
-            });
+            window.open("file/batch/" + id);
         }
     }]);
     app.controller('SaleChangeCtrl', ['$scope', '$filter', 'PurcChange', 'PurcChanges', 'ngTableParams', 'toaster', 'BaseService', 'PurcChangeHis', 'CurrentRole', function ($scope, $filter, PurcChange, PurcChanges, ngTableParams, toaster, BaseService, PurcChangeHis, CurrentRole) {

+ 2 - 1
src/main/webapp/resources/js/index/services/File.js

@@ -2,7 +2,8 @@ define([ 'ngResource'], function() {
     angular.module('FileService', [ 'ngResource']).factory('file', ['$resource', function($resource) {
         return $resource('file', {}, {
             batch: {
-                url: 'file/batch/:id'
+                url: 'file/batch/:id',
+                method: 'GET'
             }
         })
     }])