Browse Source

Merge remote-tracking branch 'origin/test' into dev

anderx 7 years ago
parent
commit
d7061c8d70

+ 2 - 2
src/main/java/com/goafanti/admin/controller/AdminPreviewApiController.java

@@ -162,7 +162,7 @@ public class AdminPreviewApiController extends CertifyApiController {
 	@RequestMapping(value = "/techProject", method = RequestMethod.GET)
 	public Result previewTechProject(String id, String sign) {
 		Result res = new Result();
-	/*	if (StringUtils.isEmpty(id)) {
+		if (StringUtils.isEmpty(id)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目申报ID"));
 			return res;
 		}
@@ -171,7 +171,7 @@ public class AdminPreviewApiController extends CertifyApiController {
 		if (null == tp) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目申报ID"));
 			return res;
-		}*/
+		}
 
 		AttachmentType attachmentType = AttachmentType.getField(sign);
 		if (attachmentType == AttachmentType.TECH_PROJECT) {

+ 12 - 0
src/main/java/com/goafanti/common/controller/PreviewController.java

@@ -23,6 +23,7 @@ import com.goafanti.cognizance.service.OrgTechCenterDetailService;
 import com.goafanti.cognizance.service.OrgTechProductService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.model.OrgActivity;
 import com.goafanti.common.model.OrgActivityCost;
@@ -42,6 +43,7 @@ import com.goafanti.common.utils.SHA256Util;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.copyright.bo.CopyrightInfoDetail;
 import com.goafanti.copyright.service.CopyrightInfoService;
+import com.goafanti.customer.bo.CustomerOrganizationDetailBo;
 import com.goafanti.patent.service.PatentInfoService;
 import com.goafanti.techproject.service.TechProjectService;
 import com.goafanti.user.service.OrgHumanResourceService;
@@ -84,6 +86,8 @@ public class PreviewController extends BaseApiController {
 	private OrgStandardService				orgStandardService;
 	@Resource
 	private OrganizationIdentityService		organizationIdentityService;
+	@Resource
+	private UserMapper	userMapper;
 
 	@Value(value = "${aesSecretKey}")
 	private String							secretKey	= null;
@@ -104,6 +108,12 @@ public class PreviewController extends BaseApiController {
 			case PATENT_PRORY_STATEMENT:
 			case PATENT_WRITING:
 			case AUTHORIZATION_NOTICE:
+			case ORGANIZATION_APPLICATION:
+				CustomerOrganizationDetailBo u=userMapper.findOrganizationCustomerDetail(token);
+				TechProject p=new TechProject();
+				p.setApprovalUrl(u.getPojectApplicationUrl());
+				handleTechProjectPreview(response, p, attachmentType);
+				break;
 			case PATENT_CERTIFICATE:
 				PatentInfo pi = patentInfoService.selectByPrimaryKey(token);
 				if (pi == null) {
@@ -249,6 +259,8 @@ public class PreviewController extends BaseApiController {
 			downloadFile(response, pi.getPatentCertificateDownloadFileName(), pi.getPatentCertificateUrl());
 		} else if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT) {
 			downloadFile(response, pi.getPatentProryStatementDownloadFileName(), pi.getPatentProryStatementUrl());
+		} else if (attachmentType == AttachmentType.ORGANIZATION_APPLICATION) {
+			downloadFile(response, pi.getPatentProryStatementDownloadFileName(), pi.getPojectApplicationUrl());
 		}
 	}
 

+ 10 - 0
src/main/java/com/goafanti/common/model/PatentInfo.java

@@ -181,6 +181,8 @@ public class PatentInfo {
 	 */
 	private String founder;
 	
+	private String pojectApplicationUrl;
+	
 	
 
 	public String getFounder() {
@@ -561,4 +563,12 @@ public class PatentInfo {
 
 	}
 
+	public String getPojectApplicationUrl() {
+		return pojectApplicationUrl;
+	}
+
+	public void setPojectApplicationUrl(String pojectApplicationUrl) {
+		this.pojectApplicationUrl = pojectApplicationUrl;
+	}
+
 }

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

@@ -108,7 +108,7 @@ public class FileUtils {
 				|| sign.indexOf("lecture_picture") != -1|| sign.indexOf("cover_picture") != -1 
 				|| sign.indexOf("news") != -1||sign.indexOf("customer_sys_file") != -1
 				||sign.indexOf("business_project_max_picture") != -1||sign.indexOf("business_project_min_picture") != -1
-				||sign.indexOf("varieties_picture") != -1) {
+				||sign.indexOf("varieties_picture") != -1  || sign.indexOf("organization_application") != -1) {
 			uniq = true;
 		}
 		String fileName = "";