Quellcode durchsuchen

新增法务日志文件上传接口

anderx vor 4 Jahren
Ursprung
Commit
6eaedb73e8

+ 3 - 1
src/main/java/com/goafanti/common/enums/AttachmentType.java

@@ -56,7 +56,9 @@ public enum AttachmentType {
 	BUSINESS_PROJECT_MAX_PICTURE("business_project_max_picture","业务项目大图"),
 	VARIETIES_PICTURE("varieties_picture","业务品类图片"),
 	ORGANIZATION_APPLICATION("organization_application","企业申报书"),
-	DUN_LOG_ATTACHMENT("dun_log_attachment","催款日志附件");
+	DUN_LOG_ATTACHMENT("dun_log_attachment","催款日志附件"),
+	LEGAL_LOG_ATTACHMENT("legal_log_attachment","催款日志附件");
+
 
 	private AttachmentType(String code, String desc) {
 		this.code = code;

+ 2 - 5
src/main/java/com/goafanti/common/utils/FileUtils.java

@@ -30,8 +30,6 @@ public class FileUtils {
 	/**
 	 * response 输出JSON
 	 * 
-	 * @param hresponse
-	 * @param resultMap
 	 * @throws IOException
 	 */
 	public static void out(HttpServletResponse response, String jsonStr) {
@@ -111,7 +109,8 @@ public class FileUtils {
 				||sign.indexOf("business_project_max_picture") != -1||sign.indexOf("business_project_min_picture") != -1
 				||sign.indexOf("varieties_picture") != -1  || sign.indexOf("organization_application") != -1
 				||sign.indexOf("order_task_file") != -1||sign.indexOf("patent_certificate") != -1
-				||sign.indexOf("order_invoice_file") != -1 ||sign.indexOf("order_outsource") != -1|| sign.indexOf("dun_log_attachment") != -1){
+				||sign.indexOf("order_invoice_file") != -1 ||sign.indexOf("order_outsource") != -1|| sign.indexOf("dun_log_attachment") != -1||
+				sign.indexOf("legal_log_attachment") != -1){
 			uniq = true;
 		}
 		String fileName = "";
@@ -228,7 +227,6 @@ public class FileUtils {
 	/**
 	 * 拼接文件路径
 	 * 
-	 * @param root
 	 * @param params
 	 * @return
 	 */
@@ -246,7 +244,6 @@ public class FileUtils {
 	/**
 	 * 拼接文件名字
 	 * 
-	 * @param root
 	 * @param params
 	 * @return
 	 */

+ 18 - 0
src/main/java/com/goafanti/order/controller/LegalAffairsApiController.java

@@ -3,7 +3,9 @@ package com.goafanti.order.controller;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.*;
 import com.goafanti.order.enums.OrderLegalAffairsState;
 import com.goafanti.order.service.LegalAffairsService;
@@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
 
 @RestController
@@ -127,4 +130,19 @@ public class LegalAffairsApiController extends CertifyApiController {
         res.data(legalAffairsService.lagalAffairsLogList(orderNo));
         return res;
     }
+
+    /**
+     * 法务日志文件上传
+     */
+    @RequestMapping(value = "/uploadLegalLogFile", method = RequestMethod.POST)
+    public Result uploadDunLogFileResult(HttpServletRequest req, String sign) {
+        Result res = new Result();
+        AttachmentType attachmentType = AttachmentType.getField(sign);
+        if (attachmentType == AttachmentType.LEGAL_LOG_ATTACHMENT) {
+            res.setData(handleFiles(res, "/legal_log_attachment/", false, req, sign, TokenManager.getAdminId()));
+        } else {
+            res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+        }
+        return res;
+    }
 }