anderx 1 месяц назад
Родитель
Сommit
4c2fa6fddf

+ 2 - 2
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -360,13 +360,13 @@
             <if test="nda != null">
                 nda = #{nda},
             </if>
-            <if test="ndaUrl != null and ndaUrl != ''">
+            <if test="ndaUrl != null ">
                 nda_url = #{ndaUrl},
             </if>
             <if test="breachClause != null">
                 breach_clause = #{breachClause},
             </if>
-            <if test="breachClauseUrl != null and breachClauseUrl != ''">
+            <if test="breachClauseUrl != null ">
                 breach_clause_url = #{breachClauseUrl},
             </if>
         </set>

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

@@ -137,12 +137,12 @@ public class FileUtils {
 		String fileName = "";
 		if (isPrivate || StringUtils.isNotBlank(sign)) {
 			if (uniq) {
-				fileName = path + uid + "/" + System.nanoTime() + "_" + sign + suffix;
+				fileName = path  + "/" + System.nanoTime() + "_" + sign + suffix;
 			} else {
-				fileName = path + uid + "/" +  sign + suffix;
+				fileName = path  + "/" +  sign + suffix;
 			}
 		} else {
-			fileName = path + uid + "/" + System.nanoTime() + suffix;
+			fileName = path  + "/" + System.nanoTime() + suffix;
 		}
 		return fileName;
 	}

+ 22 - 1
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -891,7 +891,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 			res.getError().add(buildError("只有超级管理员能直接修改"));
 			return res;
 		}
-		return res.data(orderNewService.updateOrderUrl(orderNo,contractPictureUrl,agreementUrl,serviceContent));
+		return res.data(orderNewService.updateOrderAllUrl(orderNo,contractPictureUrl,agreementUrl,serviceContent));
 	}
 
 	/**
@@ -931,5 +931,26 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	}
 
 
+	/**
+	 *  上传订单图片
+	 **/
+	@RequestMapping(value = "/uploadOrderFile", method = RequestMethod.POST)
+	public Result uploadOrderFile(HttpServletRequest req,String sign,String orderNo){
+		Result res = new Result();
+		//sign  nda    breach_clause
+		String path=String.format("/order/%s/%s/", sign, orderNo);
+		String fileUrl = handleFile(res, path, false, req, sign);
+		TOrderNew orderNew = new TOrderNew();
+		orderNew.setOrderNo(orderNo);
+		if (sign.equals("nda")){
+			orderNew.setNdaUrl(fileUrl);
+		}else if (sign.equals("breach_clause")){
+			orderNew.setBreachClauseUrl(fileUrl);
+		}
+		orderNewService.updateOrderUrl(orderNew);
+		res.setData(fileUrl);
+		return res;
+	}
+
 
 }

+ 3 - 1
src/main/java/com/goafanti/order/service/OrderNewService.java

@@ -215,7 +215,7 @@ public interface OrderNewService {
 
 	void pushExamineName(TOrderNew t);
 
-    int updateOrderUrl(String orderNo, String contractPictureUrl, String agreementUrl, String serviceContent);
+    int updateOrderAllUrl(String orderNo, String contractPictureUrl, String agreementUrl, String serviceContent);
 
     OrderProcessName getProcessName(String orderNo);
 
@@ -249,4 +249,6 @@ public interface OrderNewService {
     Object updateAddGroupChat(TOrderMid us);
 
     Object pushOrderNewUser();
+
+	void updateOrderUrl(TOrderNew orderNew);
 }

+ 6 - 1
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -2607,7 +2607,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 	@Override
-	public int updateOrderUrl(String orderNo, String contractPictureUrl, String agreementUrl, String serviceContent) {
+	public int updateOrderAllUrl(String orderNo, String contractPictureUrl, String agreementUrl, String serviceContent) {
 		TOrderNew t=new TOrderNew();
 		t.setOrderNo(orderNo);
 		t.setContractPictureUrl(contractPictureUrl);
@@ -2742,4 +2742,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		return 1;
 	}
 
+	@Override
+	public void updateOrderUrl(TOrderNew orderNew) {
+		tOrderNewMapper.update(orderNew);
+	}
+
 }