Antiloveg 8 years ago
parent
commit
ea8a06ad43

+ 10 - 8
src/main/java/com/goafanti/patent/controller/PatentApiController.java

@@ -1,5 +1,6 @@
 package com.goafanti.patent.controller;
 
+import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -86,11 +87,10 @@ public class PatentApiController extends CertifyApiController {
 		}
 
 		AttachmentType attachmentType = AttachmentType.getField(sign);
-		if (attachmentType == AttachmentType.PATENT_WRITING
-				|| attachmentType == AttachmentType.AUTHORIZATION_NOTICE
+		if (attachmentType == AttachmentType.PATENT_WRITING || attachmentType == AttachmentType.AUTHORIZATION_NOTICE
 				|| attachmentType == AttachmentType.PATENT_CERTIFICATE) {
 			res.setData(handleFiles(res, "/patent/", true, req, sign, TokenManager.getUserId()));
-		} else if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT){
+		} else if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT) {
 			res.setData(handleFile(res, "/identity/", true, req, sign));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
@@ -264,13 +264,15 @@ public class PatentApiController extends CertifyApiController {
 		PatentInfo pi = patentInfoService.selectByPrimaryKey(pid);
 		if (null != pi.getUid() && pi.getUid().equals(TokenManager.getUserId())) {
 			List<PatentLog> list = patentLogService.selectProcessByPid(pid);
-			for (PatentLog log : list) {
-				if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.SIGN
-						|| PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.CIRCULATION
-						|| PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.SETTLEMENT) {
-					list.remove(log);
+			for (Iterator<PatentLog> log = list.iterator(); log.hasNext();) {
+				Integer state = log.next().getState();
+				if (PatentInfoStatus.getStatus(state) == PatentInfoStatus.SIGN
+						|| PatentInfoStatus.getStatus(state) == PatentInfoStatus.CIRCULATION
+						|| PatentInfoStatus.getStatus(state) == PatentInfoStatus.SETTLEMENT) {
+					log.remove();
 				}
 			}
+
 			res.setData(list);
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利id"));

+ 8 - 5
src/main/java/com/goafanti/techproject/controller/TechProjectApiController.java

@@ -1,6 +1,7 @@
 package com.goafanti.techproject.controller;
 
 import java.text.ParseException;
+import java.util.Iterator;
 import java.util.List;
 
 import javax.annotation.Resource;
@@ -138,13 +139,15 @@ public class TechProjectApiController extends CertifyApiController {
 		TechProject tp = techProjectService.selectByPrimaryKey(pid);
 		if (StringUtils.isNotBlank(tp.getUid()) && tp.getUid().equals(TokenManager.getUserId())) {
 			List<TechProjectLog> list = techProjectLogService.selectTechProjectLogByPid(pid);
-			for (TechProjectLog log : list) {
-				if (TechProjectStatus.getStatus(log.getState()) == TechProjectStatus.SIGN
-						|| TechProjectStatus.getStatus(log.getState()) == TechProjectStatus.CIRCULATION
-						|| TechProjectStatus.getStatus(log.getState()) == TechProjectStatus.SETTLEMENT) {
-					list.remove(log);
+			for (Iterator<TechProjectLog> log = list.iterator() ; log.hasNext();) {
+				Integer state = log.next().getState();
+				if (TechProjectStatus.getStatus(state) == TechProjectStatus.SIGN
+						|| TechProjectStatus.getStatus(state) == TechProjectStatus.CIRCULATION
+						|| TechProjectStatus.getStatus(state) == TechProjectStatus.SETTLEMENT) {
+					log.remove();
 				}
 			}
+			
 			res.setData(list);
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目id"));