Преглед на файлове

采购单详情增加附件下载

hejq преди 8 години
родител
ревизия
2485878df7
променени са 1 файла, в които са добавени 9 реда и са изтрити 9 реда
  1. 9 9
      src/main/java/com/uas/platform/b2b/controller/FileController.java

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

@@ -99,12 +99,12 @@ public class FileController {
     @RequestMapping("/batch/{id}")
     public void batchDownload(@PathVariable("id") long id, HttpServletResponse response) throws IOException {
         PurchaseOrderAll orderAll = purchaseOrderService.findById(id);
-       String sql = " select at_path path from attachs left join purc$prod$attach on attachs.at_id = purc$prod$attach.at_id " +
+        String sql = " select at_path path 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;
-       List<Attach> attaches = commonDao.query(sql, Attach.class);
-       StringBuffer idString = null;
-       String url = null;
-       if (!CollectionUtils.isEmpty(attaches)) {
+        List<Attach> attaches = commonDao.query(sql, Attach.class);
+        StringBuffer idString = null;
+        String url = null;
+        if (!CollectionUtils.isEmpty(attaches)) {
            for (Attach attach : attaches) {
                if (attach.getPath().startsWith("http://dfs.ubtob.com")) {// 存储在dfs存储服务器,去dfs存储服务器下载
                 // TODO dfs服务器上打包下载
@@ -119,12 +119,12 @@ public class FileController {
                     url = attach.getPath().replace("downloadbyId.action?id=", "downloadbyIds.action?ids=");
                }
            }
-       } else {
+        } else {
            throw new NotFoundException("暂未找到相关附件");
-       }
-       if (idString.length() > 0 && null != url && null != orderAll) {
+        }
+         if (idString.length() > 0 && null != url && null != orderAll) {
            response.sendRedirect(url + idString + "&zipName=" + orderAll.getCode() + "采购明细附件");
-       }
+        }
     }