Browse Source

管理端--下载科技需求线索单/意向单附件

Antiloveg 8 years ago
parent
commit
ce5784055c

+ 23 - 0
src/main/java/com/goafanti/admin/controller/AdminOrderApiController.java

@@ -1,6 +1,7 @@
 package com.goafanti.admin.controller;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 
 import org.apache.commons.lang3.StringUtils;
@@ -144,4 +145,26 @@ public class AdminOrderApiController extends CertifyApiController {
 		res.setData(demandOrderService.updateShutdownByUser(order, unSign));
 		return res;
 	}
+	
+	/**
+	 * 下载科技需求订单文件
+	 */
+	@RequestMapping(value = "/downloadDemandOrder", method = RequestMethod.GET)
+	public Result download(HttpServletResponse response, String id) {
+		Result res = new Result();
+
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技需求订单ID"));
+			return res;
+		}
+
+		DemandOrder order = demandOrderService.selectByPrimaryKey(id);
+		if (null == order) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技需求订单ID"));
+			return res;
+		}
+
+		downloadUnPrivateFile(response, order.getEnclosureDownloadFileName(), order.getEnclosureUrl());
+		return res;
+	}
 }