|
|
@@ -4,6 +4,7 @@ import java.util.Arrays;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
@@ -31,6 +32,28 @@ public class AdminAchievementApiController extends CertifyApiController {
|
|
|
|
|
|
|
|
|
/**
|
|
|
+ * 下载文本文件(成熟度)
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/download", 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;
|
|
|
+ }
|
|
|
+
|
|
|
+ Achievement a = achievementService.selectByPrimaryKey(id);
|
|
|
+ if (null == a) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ downloadUnPrivateFile(response, a.getMaturityTextFileDownloadFileName(), a.getMaturityTextFileUrl());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 成熟度文本文件上传
|
|
|
*/
|
|
|
@RequestMapping(value = "/uploadTextFile", method = RequestMethod.POST)
|