Antiloveg %!s(int64=9) %!d(string=hai) anos
pai
achega
d29dadea3c
Modificáronse 29 ficheiros con 2427 adicións e 820 borrados
  1. 556 143
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  2. 176 13
      src/main/java/com/goafanti/admin/controller/AdminPatentApiController.java
  3. 0 1
      src/main/java/com/goafanti/admin/controller/AdminTechProjectApiController.java
  4. 82 0
      src/main/java/com/goafanti/cognizance/bo/InputApplyCognizance.java
  5. 188 0
      src/main/java/com/goafanti/cognizance/bo/InputOrgCognizance.java
  6. 92 0
      src/main/java/com/goafanti/cognizance/bo/InputOrgTechCenterDetail.java
  7. 743 546
      src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java
  8. 1 1
      src/main/java/com/goafanti/cognizance/service/OrgCognizanceService.java
  9. 70 64
      src/main/java/com/goafanti/cognizance/service/impl/OrgCognizanceServiceImpl.java
  10. 4 1
      src/main/java/com/goafanti/common/enums/AttachmentType.java
  11. 57 0
      src/main/java/com/goafanti/common/enums/CognizanceApplyFields.java
  12. 64 0
      src/main/java/com/goafanti/common/enums/OrgCognizanceFields.java
  13. 70 0
      src/main/java/com/goafanti/common/enums/OrgCognizanceStatus.java
  14. 58 0
      src/main/java/com/goafanti/common/enums/OrgTechCenterDetailFields.java
  15. 6 0
      src/main/java/com/goafanti/common/mapper/CopyrightInfoMapper.xml
  16. 29 23
      src/main/java/com/goafanti/common/mapper/OrgCognizanceMapper.xml
  17. 10 0
      src/main/java/com/goafanti/common/mapper/PatentCostMapper.xml
  18. 30 2
      src/main/java/com/goafanti/common/mapper/PatentInfoMapper.xml
  19. 10 0
      src/main/java/com/goafanti/common/mapper/PatentRegistrationMapper.xml
  20. 11 3
      src/main/java/com/goafanti/common/mapper/TechProjectMapper.xml
  21. 4 1
      src/main/java/com/goafanti/common/utils/FileUtils.java
  22. 4 0
      src/main/java/com/goafanti/copyright/service/impl/CopyrightInfoServiceImpl.java
  23. 1 1
      src/main/java/com/goafanti/core/shiro/token/UserRealm.java
  24. 118 8
      src/main/java/com/goafanti/patent/controller/PatentApiController.java
  25. 5 0
      src/main/java/com/goafanti/patent/service/impl/PatentCostServiceImpl.java
  26. 16 2
      src/main/java/com/goafanti/patent/service/impl/PatentInfoServiceImpl.java
  27. 12 5
      src/main/java/com/goafanti/patent/service/impl/PatentRegistrationServiceImpl.java
  28. 6 1
      src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java
  29. 4 5
      src/main/webapp/WEB-INF/html/test.html

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 556 - 143
src/main/java/com/goafanti/admin/controller/AdminApiController.java


+ 176 - 13
src/main/java/com/goafanti/admin/controller/AdminPatentApiController.java

@@ -1,12 +1,15 @@
 package com.goafanti.admin.controller;
 package com.goafanti.admin.controller;
 
 
+import java.io.IOException;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.util.Arrays;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
+import java.util.UUID;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import javax.validation.Valid;
 
 
@@ -22,23 +25,28 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
 
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
+import com.goafanti.admin.service.AftFileService;
 import com.goafanti.cognizance.service.OrgIntellectualPropertyService;
 import com.goafanti.cognizance.service.OrgIntellectualPropertyService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.enums.PatentCostFields;
 import com.goafanti.common.enums.PatentCostFields;
 import com.goafanti.common.enums.PatentInfoFields;
 import com.goafanti.common.enums.PatentInfoFields;
 import com.goafanti.common.enums.PatentInfoStatus;
 import com.goafanti.common.enums.PatentInfoStatus;
 import com.goafanti.common.enums.PatentRegistrationFields;
 import com.goafanti.common.enums.PatentRegistrationFields;
+import com.goafanti.common.model.AftFile;
 import com.goafanti.common.model.PatentCost;
 import com.goafanti.common.model.PatentCost;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.PatentLog;
 import com.goafanti.common.model.PatentLog;
 import com.goafanti.common.model.PatentRegistration;
 import com.goafanti.common.model.PatentRegistration;
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.User;
 import com.goafanti.common.utils.FileUtils;
 import com.goafanti.common.utils.FileUtils;
+import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.patent.bo.InputPatentCost;
 import com.goafanti.patent.bo.InputPatentCost;
@@ -75,6 +83,155 @@ public class AdminPatentApiController extends CertifyApiController {
 	private OrgIntellectualPropertyService	orgIntellectualPropertyService;
 	private OrgIntellectualPropertyService	orgIntellectualPropertyService;
 	@Resource
 	@Resource
 	private UserService						userService;
 	private UserService						userService;
+	@Resource
+	private AftFileService					aftFileService;
+
+	/**
+	 * 专利相关材料上传
+	 * 
+	 * @param req
+	 * @param uid
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/upload", method = RequestMethod.POST)
+	public Result upload(HttpServletRequest req, String sign, String uid) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+        
+		User curUser = userService.selectByPrimaryKey(uid);
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT || attachmentType == AttachmentType.PATENT_WRITING
+			|| attachmentType == AttachmentType.AUTHORIZATION_NOTICE || attachmentType == AttachmentType.PATENT_CERTIFICATE) {
+			res.setData(handleFiles(res, "/patent/", true, req, sign, uid));
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		
+		return res;
+	}
+
+	/**
+	 * 下载专利相关材料
+	 * 
+	 * @param id
+	 * @param sign
+	 * @param response
+	 * @return
+	 */
+	@RequestMapping(value = "/download", method = RequestMethod.GET)
+	public Result download(String id, String sign, HttpServletResponse response) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利id"));
+			return res;
+		}
+		PatentInfo pi = patentInfoService.selectByPrimaryKey(id);
+		if (pi == null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利id"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT || attachmentType == AttachmentType.PATENT_WRITING
+				|| attachmentType == AttachmentType.AUTHORIZATION_NOTICE
+				|| attachmentType == AttachmentType.PATENT_CERTIFICATE) {
+			if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT) {
+				downloadFile(response, pi.getPatentProryStatementDownloadFileName(), pi.getPatentProryStatementUrl());
+			} else if (attachmentType == AttachmentType.PATENT_WRITING) {
+				downloadFile(response, pi.getPatentWritingDownloadFileName(), pi.getPatentWritingUrl());
+			} else if (attachmentType == AttachmentType.AUTHORIZATION_NOTICE) {
+				downloadFile(response, pi.getAuthorizationNoticeDownloadFileName(), pi.getAuthorizationNoticeUrl());
+			} else if (attachmentType == AttachmentType.PATENT_CERTIFICATE) {
+				downloadFile(response, pi.getPatentCertificateDownloadFileName(), pi.getPatentCertificateUrl());
+			}
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 下载模版文件(专利代理委托书)
+	 * 
+	 * @param response
+	 * @return
+	 */
+	@RequestMapping(value = "/downloadTemplateFile", method = RequestMethod.GET)
+	public Result downloadTemplateFile(HttpServletResponse response, String sign) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT) {
+			String fileName = "";
+			AftFile af = aftFileService.selectAftFileBySign(sign);
+			if (null == af) {
+				res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "找不到", "文件"));
+			} else {
+				String path = af.getFilePath();
+				String suffix = path.substring(path.lastIndexOf("."));
+				fileName = "专利代理委托书模版" + suffix;
+				downloadFile(response, fileName, path);
+			}
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利代理委托书标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 上传专利代理委托书模版
+	 * 
+	 * @param req
+	 * @return
+	 */
+	@RequestMapping(value = "/uploadTemplate", method = RequestMethod.POST)
+	public Result uploadPatentTemplate(HttpServletRequest req, String sign) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		String fileName = "";
+		List<MultipartFile> files = getFiles(req);
+		MultipartFile mf = files.get(0);
+		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
+		System.err.println("suffix" + " " + suffix);
+		if (suffix.equals(".doc") || suffix.equals(".docx")) {
+			if ("patent_prory_statement".equals(sign)) {
+				fileName = "patent_prory_statement" + suffix;
+			} else {
+				fileName = System.nanoTime() + "";
+			}
+			String name = handleFile(res, req, fileName, files, mf);
+			res.setData(name);
+			System.out.println(name);
+			if (res.getData() != "" && res.getData() != null && null == aftFileService.selectAftFileBySign(sign)) {
+				AftFile f = new AftFile();
+				f.setId(UUID.randomUUID().toString());
+				if ("patent_prory_statement".equals(sign)) {
+					f.setFileName("专利代理委托书模版");
+					f.setSign(sign);
+				}
+				f.setFilePath("/admin/" + fileName);
+				f.setDeleletedSign(0);
+				aftFileService.insert(f);
+
+			}
+		} else {
+			res.getError().add(buildError(ErrorConstants.FILE_PATTERN_ERROR, "文件格式错误,请重新上传!"));
+		}
+		return res;
+	}
 
 
 	/**
 	/**
 	 * 删除专利
 	 * 删除专利
@@ -82,7 +239,7 @@ public class AdminPatentApiController extends CertifyApiController {
 	 * @param ids
 	 * @param ids
 	 * @return
 	 * @return
 	 */
 	 */
-	@RequestMapping(value = "/delete", method = RequestMethod.GET)
+	@RequestMapping(value = "/delete", method = RequestMethod.POST)
 	public Result deletePatent(@RequestParam(name = "ids[]", required = false) String[] ids) {
 	public Result deletePatent(@RequestParam(name = "ids[]", required = false) String[] ids) {
 		Result res = new Result();
 		Result res = new Result();
 		if (!checkAdminLogin(res)) {
 		if (!checkAdminLogin(res)) {
@@ -696,42 +853,30 @@ public class AdminPatentApiController extends CertifyApiController {
 			if (!StringUtils.isBlank(patentRegistrationBo.getAcceptanceIssueTime())) {
 			if (!StringUtils.isBlank(patentRegistrationBo.getAcceptanceIssueTime())) {
 				patentRegistration.setAcceptanceIssueTime(
 				patentRegistration.setAcceptanceIssueTime(
 						DateUtils.parseDate(patentRegistrationBo.getAcceptanceIssueTime(), "yyyy-MM-dd"));
 						DateUtils.parseDate(patentRegistrationBo.getAcceptanceIssueTime(), "yyyy-MM-dd"));
-			} else {
-				patentRegistration.setAcceptanceIssueTime(null);
 			}
 			}
 			if (!StringUtils.isBlank(patentRegistrationBo.getAcceptanceReceiveTime())) {
 			if (!StringUtils.isBlank(patentRegistrationBo.getAcceptanceReceiveTime())) {
 				patentRegistration.setAcceptanceReceiveTime(
 				patentRegistration.setAcceptanceReceiveTime(
 						DateUtils.parseDate(patentRegistrationBo.getAcceptanceReceiveTime(), "yyyy-MM-dd"));
 						DateUtils.parseDate(patentRegistrationBo.getAcceptanceReceiveTime(), "yyyy-MM-dd"));
-			} else {
-				patentRegistration.setAcceptanceReceiveTime(null);
 			}
 			}
 			patentRegistration.setAcceptanceTrackingNumber(patentRegistrationBo.getAcceptanceTrackingNumber());
 			patentRegistration.setAcceptanceTrackingNumber(patentRegistrationBo.getAcceptanceTrackingNumber());
 			patentRegistration.setAuthorizationExpressCompany(patentRegistrationBo.getAuthorizationExpressCompany());
 			patentRegistration.setAuthorizationExpressCompany(patentRegistrationBo.getAuthorizationExpressCompany());
 			if (!StringUtils.isBlank(patentRegistrationBo.getAuthorizationIssueTime())) {
 			if (!StringUtils.isBlank(patentRegistrationBo.getAuthorizationIssueTime())) {
 				patentRegistration.setAuthorizationIssueTime(
 				patentRegistration.setAuthorizationIssueTime(
 						DateUtils.parseDate(patentRegistrationBo.getAuthorizationIssueTime(), "yyyy-MM-dd"));
 						DateUtils.parseDate(patentRegistrationBo.getAuthorizationIssueTime(), "yyyy-MM-dd"));
-			} else {
-				patentRegistration.setAuthorizationIssueTime(null);
 			}
 			}
 			if (!StringUtils.isBlank(patentRegistrationBo.getAuthorizationReceiveTime())) {
 			if (!StringUtils.isBlank(patentRegistrationBo.getAuthorizationReceiveTime())) {
 				patentRegistration.setAuthorizationReceiveTime(
 				patentRegistration.setAuthorizationReceiveTime(
 						DateUtils.parseDate(patentRegistrationBo.getAuthorizationReceiveTime(), "yyyy-MM-dd"));
 						DateUtils.parseDate(patentRegistrationBo.getAuthorizationReceiveTime(), "yyyy-MM-dd"));
-			} else {
-				patentRegistration.setAuthorizationReceiveTime(null);
 			}
 			}
 			patentRegistration.setAuthorizationTrackingNumber(patentRegistrationBo.getAuthorizationTrackingNumber());
 			patentRegistration.setAuthorizationTrackingNumber(patentRegistrationBo.getAuthorizationTrackingNumber());
 			patentRegistration.setCertificateExpressCompany(patentRegistrationBo.getCertificateExpressCompany());
 			patentRegistration.setCertificateExpressCompany(patentRegistrationBo.getCertificateExpressCompany());
 			if (!StringUtils.isBlank(patentRegistrationBo.getCertificateIssueTime())) {
 			if (!StringUtils.isBlank(patentRegistrationBo.getCertificateIssueTime())) {
 				patentRegistration.setCertificateIssueTime(
 				patentRegistration.setCertificateIssueTime(
 						DateUtils.parseDate(patentRegistrationBo.getCertificateIssueTime(), "yyyy-MM-dd"));
 						DateUtils.parseDate(patentRegistrationBo.getCertificateIssueTime(), "yyyy-MM-dd"));
-			} else {
-				patentRegistration.setCertificateIssueTime(null);
 			}
 			}
 			if (!StringUtils.isBlank(patentRegistrationBo.getCertificateRecieveTime())) {
 			if (!StringUtils.isBlank(patentRegistrationBo.getCertificateRecieveTime())) {
 				patentRegistration.setCertificateRecieveTime(
 				patentRegistration.setCertificateRecieveTime(
 						DateUtils.parseDate(patentRegistrationBo.getCertificateRecieveTime(), "yyyy-MM-dd"));
 						DateUtils.parseDate(patentRegistrationBo.getCertificateRecieveTime(), "yyyy-MM-dd"));
-			} else {
-				patentRegistration.setCertificateRecieveTime(null);
 			}
 			}
 		} catch (ParseException e) {
 		} catch (ParseException e) {
 		}
 		}
@@ -832,4 +977,22 @@ public class AdminPatentApiController extends CertifyApiController {
 		return state;
 		return state;
 	}
 	}
 
 
+	private String handleFile(Result res, HttpServletRequest req, String fileName, List<MultipartFile> files,
+			MultipartFile mf) {
+		if (!files.isEmpty()) {
+			try {
+				mf.transferTo(toAdminPrivateFile(fileName));
+				LoggerUtils.debug(getClass(), fileName + " 文件上传成功");
+			} catch (IllegalStateException | IOException e) {
+				LoggerUtils.error(getClass(), "文件上传失败", e);
+				res.getError().add(buildError("", "文件上传失败!"));
+				return "";
+			}
+		} else {
+			res.getError().add(buildError("", "文件上传失败!"));
+			return "";
+		}
+		return fileName;
+	}
+
 }
 }

+ 0 - 1
src/main/java/com/goafanti/admin/controller/AdminTechProjectApiController.java

@@ -224,7 +224,6 @@ public class AdminTechProjectApiController extends CertifyApiController {
 
 
 		TechProject tp = new TechProject();
 		TechProject tp = new TechProject();
 		TechProjectLog tpl = new TechProjectLog();
 		TechProjectLog tpl = new TechProjectLog();
-		tp.setId(techProject.getId());
 		BeanUtils.copyProperties(techProject, tp);
 		BeanUtils.copyProperties(techProject, tp);
 		BeanUtils.copyProperties(techProject, tpl);
 		BeanUtils.copyProperties(techProject, tpl);
 		res.setData(techProjectService.updateTechProject(tp, tpl, recordTime));
 		res.setData(techProjectService.updateTechProject(tp, tpl, recordTime));

+ 82 - 0
src/main/java/com/goafanti/cognizance/bo/InputApplyCognizance.java

@@ -0,0 +1,82 @@
+package com.goafanti.cognizance.bo;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Size;
+
+import com.goafanti.common.constant.ErrorConstants;
+
+public class InputApplyCognizance {
+	
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String uid;
+	
+	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer contacts;
+	
+	@Size(min = 0, max = 500, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String comment;
+	
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String consultant;
+	
+	@Max(value = 9999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer year;
+	
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer state;
+
+	public Integer getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(Integer contacts) {
+		this.contacts = contacts;
+	}
+
+	public String getComment() {
+		return comment;
+	}
+
+	public void setComment(String comment) {
+		this.comment = comment;
+	}
+
+	public String getConsultant() {
+		return consultant;
+	}
+
+	public void setConsultant(String consultant) {
+		this.consultant = consultant;
+	}
+
+	public String getUid() {
+		return uid;
+	}
+
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+
+	public Integer getYear() {
+		return year;
+	}
+
+	public void setYear(Integer year) {
+		this.year = year;
+	}
+
+	public Integer getState() {
+		return state;
+	}
+
+	public void setState(Integer state) {
+		this.state = state;
+	}
+    
+	
+	
+}

+ 188 - 0
src/main/java/com/goafanti/cognizance/bo/InputOrgCognizance.java

@@ -0,0 +1,188 @@
+package com.goafanti.cognizance.bo;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Size;
+
+import com.goafanti.common.constant.ErrorConstants;
+
+public class InputOrgCognizance {
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	id;
+
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	uid;
+
+	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	contacts;
+
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	consultant;
+
+	@Max(value = 999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	technicalField1;
+
+	@Max(value = 999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	technicalField2;
+
+	@Max(value = 999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	technicalField3;
+
+	@Max(value = (long)999999.99, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	basicResearchCost;
+
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	accident;
+
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	certificateNumber;
+
+	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	certificateUrl;
+
+	@Max(value = 12, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	state;
+
+	@Max(value = 9999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	year;
+	
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String		principal;
+	
+	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	comment;
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getUid() {
+		return uid;
+	}
+
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+
+	public Integer getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(Integer contacts) {
+		this.contacts = contacts;
+	}
+
+	public String getConsultant() {
+		return consultant;
+	}
+
+	public void setConsultant(String consultant) {
+		this.consultant = consultant;
+	}
+
+	public Integer getTechnicalField1() {
+		return technicalField1;
+	}
+
+	public void setTechnicalField1(Integer technicalField1) {
+		this.technicalField1 = technicalField1;
+	}
+
+	public Integer getTechnicalField2() {
+		return technicalField2;
+	}
+
+	public void setTechnicalField2(Integer technicalField2) {
+		this.technicalField2 = technicalField2;
+	}
+
+	public Integer getTechnicalField3() {
+		return technicalField3;
+	}
+
+	public void setTechnicalField3(Integer technicalField3) {
+		this.technicalField3 = technicalField3;
+	}
+
+	public Integer getBasicResearchCost() {
+		return basicResearchCost;
+	}
+
+	public void setBasicResearchCost(Integer basicResearchCost) {
+		this.basicResearchCost = basicResearchCost;
+	}
+
+	public Integer getAccident() {
+		return accident;
+	}
+
+	public void setAccident(Integer accident) {
+		this.accident = accident;
+	}
+
+	public String getCertificateNumber() {
+		return certificateNumber;
+	}
+
+	public void setCertificateNumber(String certificateNumber) {
+		this.certificateNumber = certificateNumber;
+	}
+
+	public String getCertificateUrl() {
+		return certificateUrl;
+	}
+
+	public void setCertificateUrl(String certificateUrl) {
+		this.certificateUrl = certificateUrl;
+	}
+
+	public Integer getState() {
+		return state;
+	}
+
+	public void setState(Integer state) {
+		this.state = state;
+	}
+
+	public Integer getYear() {
+		return year;
+	}
+
+	public void setYear(Integer year) {
+		this.year = year;
+	}
+
+	public String getPrincipal() {
+		return principal;
+	}
+
+	public void setPrincipal(String principal) {
+		this.principal = principal;
+	}
+
+	public String getComment() {
+		return comment;
+	}
+
+	public void setComment(String comment) {
+		this.comment = comment;
+	}
+	
+	
+	
+	
+	
+
+}

+ 92 - 0
src/main/java/com/goafanti/cognizance/bo/InputOrgTechCenterDetail.java

@@ -0,0 +1,92 @@
+package com.goafanti.cognizance.bo;
+
+import java.util.Date;
+
+import javax.validation.constraints.Size;
+
+import com.goafanti.common.constant.ErrorConstants;
+
+public class InputOrgTechCenterDetail {
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	id;
+
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	cid;
+
+	@Size(min = 0, max = 32, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	projectName;
+
+	@Size(min = 0, max = 32, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	institution;
+
+	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	protocolUrl;
+
+	/**
+	 * 产学研时间
+	 */
+	private Date	projectTime;
+
+	/**
+	 * 期限
+	 */
+	private Date	termTime;
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getCid() {
+		return cid;
+	}
+
+	public void setCid(String cid) {
+		this.cid = cid;
+	}
+
+	public String getProjectName() {
+		return projectName;
+	}
+
+	public void setProjectName(String projectName) {
+		this.projectName = projectName;
+	}
+
+	public String getInstitution() {
+		return institution;
+	}
+
+	public void setInstitution(String institution) {
+		this.institution = institution;
+	}
+
+	public String getProtocolUrl() {
+		return protocolUrl;
+	}
+
+	public void setProtocolUrl(String protocolUrl) {
+		this.protocolUrl = protocolUrl;
+	}
+
+	public Date getProjectTime() {
+		return projectTime;
+	}
+
+	public void setProjectTime(Date projectTime) {
+		this.projectTime = projectTime;
+	}
+
+	public Date getTermTime() {
+		return termTime;
+	}
+
+	public void setTermTime(Date termTime) {
+		this.termTime = termTime;
+	}
+	
+	
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 743 - 546
src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java


+ 1 - 1
src/main/java/com/goafanti/cognizance/service/OrgCognizanceService.java

@@ -41,7 +41,7 @@ public interface OrgCognizanceService {
 
 
 	void updateCognizance(OrgCognizance cog, OrgCognizanceLog log, Date recordTime, String aid);
 	void updateCognizance(OrgCognizance cog, OrgCognizanceLog log, Date recordTime, String aid);
 
 
-	void insertCognizance(Integer contacts, String comment, Integer year, Integer state, String aid, String uid);
+	void insertCognizance(OrgCognizance cog, String aid);
 
 
 	Pagination<CultivationListBo> listCultivation(String uid, String province, String unitName, Integer pNo, Integer pSize);
 	Pagination<CultivationListBo> listCultivation(String uid, String province, String unitName, Integer pNo, Integer pSize);
 
 

+ 70 - 64
src/main/java/com/goafanti/cognizance/service/impl/OrgCognizanceServiceImpl.java

@@ -23,6 +23,7 @@ import com.goafanti.cognizance.service.OrgCognizanceService;
 import com.goafanti.common.dao.OrgCognizanceLogMapper;
 import com.goafanti.common.dao.OrgCognizanceLogMapper;
 import com.goafanti.common.dao.OrgCognizanceMapper;
 import com.goafanti.common.dao.OrgCognizanceMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
+import com.goafanti.common.enums.OrgCognizanceStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.OrgCognizance;
 import com.goafanti.common.model.OrgCognizance;
 import com.goafanti.common.model.OrgCognizanceLog;
 import com.goafanti.common.model.OrgCognizanceLog;
@@ -30,14 +31,15 @@ import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.core.shiro.token.TokenManager;
+
 @Service
 @Service
 public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper> implements OrgCognizanceService {
 public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper> implements OrgCognizanceService {
 	@Autowired
 	@Autowired
-	private OrgCognizanceMapper orgCognizanceMapper;
+	private OrgCognizanceMapper			orgCognizanceMapper;
 	@Autowired
 	@Autowired
-	private OrgCognizanceLogMapper orgCognizanceLogMapper;
+	private OrgCognizanceLogMapper		orgCognizanceLogMapper;
 	@Autowired
 	@Autowired
-	private OrganizationIdentityMapper organizationIdentityMapper;
+	private OrganizationIdentityMapper	organizationIdentityMapper;
 
 
 	@Override
 	@Override
 	public OrgCognizance insert(OrgCognizance c) {
 	public OrgCognizance insert(OrgCognizance c) {
@@ -47,23 +49,26 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 
 
 	@SuppressWarnings("unchecked")
 	@SuppressWarnings("unchecked")
 	@Override
 	@Override
-	public Pagination<CognizanceBo> listCognizance(String uid, String unitName, String locationProvince,  Integer pageNo,
+	public Pagination<CognizanceBo> listCognizance(String uid, String unitName, String locationProvince, Integer pageNo,
 			Integer pageSize) {
 			Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 		
 		
-		if (!StringUtils.isBlank(unitName)){
+		if (!TokenManager.hasRole("999999")) {
+			params.put("principal", TokenManager.getAdminId());
+		}
+
+		if (!StringUtils.isBlank(unitName)) {
 			params.put("unitName", unitName);
 			params.put("unitName", unitName);
 		}
 		}
-		
-		if (!StringUtils.isBlank(uid)){
+
+		if (!StringUtils.isBlank(uid)) {
 			params.put("uid", uid);
 			params.put("uid", uid);
 		}
 		}
-		
-		if (!StringUtils.isBlank(locationProvince)){
+
+		if (!StringUtils.isBlank(locationProvince)) {
 			params.put("locationProvince", locationProvince);
 			params.put("locationProvince", locationProvince);
 		}
 		}
-		
-		
+
 		if (pageNo == null || pageNo < 0) {
 		if (pageNo == null || pageNo < 0) {
 			pageNo = 1;
 			pageNo = 1;
 		}
 		}
@@ -71,22 +76,22 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 		if (pageSize == null || pageSize < 0) {
 		if (pageSize == null || pageSize < 0) {
 			pageSize = 10;
 			pageSize = 10;
 		}
 		}
-		return (Pagination<CognizanceBo>) findPage("findCognizanceBoByPage","findCognizanceBoCount", params, pageNo,
+		return (Pagination<CognizanceBo>) findPage("findCognizanceBoByPage", "findCognizanceBoCount", params, pageNo,
 				pageSize);
 				pageSize);
 	}
 	}
-	
+
 	@Override
 	@Override
-	public CognizanceDetailBo selectCognizanceDetailBo(String uid, String cid, Integer year){
+	public CognizanceDetailBo selectCognizanceDetailBo(String uid, String cid, Integer year) {
 		CognizanceDetailBo cog = new CognizanceDetailBo();
 		CognizanceDetailBo cog = new CognizanceDetailBo();
-		
+
 		CognizanceOrgInfoBo orgInfo = orgCognizanceMapper.selectCognizanceOrgInfoBoByUidAndCid(uid, cid);
 		CognizanceOrgInfoBo orgInfo = orgCognizanceMapper.selectCognizanceOrgInfoBoByUidAndCid(uid, cid);
-		if (null != orgInfo){
+		if (null != orgInfo) {
 			cog.setUid(null == orgInfo.getUid() ? "" : orgInfo.getUid());
 			cog.setUid(null == orgInfo.getUid() ? "" : orgInfo.getUid());
 			cog.setCid(null == orgInfo.getCid() ? "" : orgInfo.getCid());
 			cog.setCid(null == orgInfo.getCid() ? "" : orgInfo.getCid());
 			cog.setUnitName(null == orgInfo.getUnitName() ? "" : orgInfo.getUnitName());
 			cog.setUnitName(null == orgInfo.getUnitName() ? "" : orgInfo.getUnitName());
 			cog.setOrgCode(null == orgInfo.getOrgCode() ? "" : orgInfo.getOrgCode());
 			cog.setOrgCode(null == orgInfo.getOrgCode() ? "" : orgInfo.getOrgCode());
 			cog.setPostalAddress(null == orgInfo.getPostalAddress() ? "" : orgInfo.getPostalAddress());
 			cog.setPostalAddress(null == orgInfo.getPostalAddress() ? "" : orgInfo.getPostalAddress());
-			cog.setContacts(null == orgInfo.getContacts() ? "" : orgInfo.getContacts().toString());//联系人
+			cog.setContacts(null == orgInfo.getContacts() ? "" : orgInfo.getContacts().toString());// 联系人
 			cog.setTechnicalField1(null == orgInfo.getTechnicalField1() ? 0 : orgInfo.getTechnicalField1());
 			cog.setTechnicalField1(null == orgInfo.getTechnicalField1() ? 0 : orgInfo.getTechnicalField1());
 			cog.setTechnicalField2(null == orgInfo.getTechnicalField2() ? 0 : orgInfo.getTechnicalField2());
 			cog.setTechnicalField2(null == orgInfo.getTechnicalField2() ? 0 : orgInfo.getTechnicalField2());
 			cog.setTechnicalField3(null == orgInfo.getTechnicalField3() ? 0 : orgInfo.getTechnicalField3());
 			cog.setTechnicalField3(null == orgInfo.getTechnicalField3() ? 0 : orgInfo.getTechnicalField3());
@@ -94,7 +99,7 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 					null == orgInfo.getBasicResearchCost() ? new BigDecimal(0) : orgInfo.getBasicResearchCost());
 					null == orgInfo.getBasicResearchCost() ? new BigDecimal(0) : orgInfo.getBasicResearchCost());
 			cog.setAccident(null == orgInfo.getAccient() ? 0 : orgInfo.getAccient());
 			cog.setAccident(null == orgInfo.getAccient() ? 0 : orgInfo.getAccient());
 		}
 		}
-		
+
 		CognizanceResearchCostBo researchCost = orgCognizanceMapper.selectCognizanceResearchCostBoByUidAndYear(year,
 		CognizanceResearchCostBo researchCost = orgCognizanceMapper.selectCognizanceResearchCostBoByUidAndYear(year,
 				uid);
 				uid);
 		if (null != researchCost) {
 		if (null != researchCost) {
@@ -102,22 +107,28 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 					null == researchCost.getResearchCost() ? new BigDecimal(0) : researchCost.getResearchCost());
 					null == researchCost.getResearchCost() ? new BigDecimal(0) : researchCost.getResearchCost());
 			cog.setTerritory(null == researchCost.getTerritory() ? new BigDecimal(0) : researchCost.getTerritory());
 			cog.setTerritory(null == researchCost.getTerritory() ? new BigDecimal(0) : researchCost.getTerritory());
 		}
 		}
-		
+
 		CognizanceManageCostBo manageCost = orgCognizanceMapper.selectCognizanceManageCostBoByUidAndYear(year, uid);
 		CognizanceManageCostBo manageCost = orgCognizanceMapper.selectCognizanceManageCostBoByUidAndYear(year, uid);
 		if (null != manageCost) {
 		if (null != manageCost) {
 			cog.setNetAsset1(null == manageCost.getNetAsset1() ? new BigDecimal(0) : manageCost.getNetAsset1());
 			cog.setNetAsset1(null == manageCost.getNetAsset1() ? new BigDecimal(0) : manageCost.getNetAsset1());
 			cog.setNetAsset2(null == manageCost.getNetAsset2() ? new BigDecimal(0) : manageCost.getNetAsset2());
 			cog.setNetAsset2(null == manageCost.getNetAsset2() ? new BigDecimal(0) : manageCost.getNetAsset2());
 			cog.setNetAsset3(null == manageCost.getNetAsset3() ? new BigDecimal(0) : manageCost.getNetAsset3());
 			cog.setNetAsset3(null == manageCost.getNetAsset3() ? new BigDecimal(0) : manageCost.getNetAsset3());
-			cog.setSalesRevenue1(null == manageCost.getSalesRevenue1() ? new BigDecimal(0) : manageCost.getSalesRevenue1());
-			cog.setSalesRevenue2(null == manageCost.getSalesRevenue2() ? new BigDecimal(0) : manageCost.getSalesRevenue2());
-			cog.setSalesRevenue3(null == manageCost.getSalesRevenue3() ? new BigDecimal(0) : manageCost.getSalesRevenue3());
-			cog.setGrossProfit1(null == manageCost.getGrossProfit1() ? new BigDecimal(0) : manageCost.getGrossProfit1());
-			cog.setGrossProfit2(null == manageCost.getGrossProfit2() ? new BigDecimal(0) : manageCost.getGrossProfit2());
-			cog.setGrossProfit3(null == manageCost.getGrossProfit3() ? new BigDecimal(0) : manageCost.getGrossProfit3());
+			cog.setSalesRevenue1(
+					null == manageCost.getSalesRevenue1() ? new BigDecimal(0) : manageCost.getSalesRevenue1());
+			cog.setSalesRevenue2(
+					null == manageCost.getSalesRevenue2() ? new BigDecimal(0) : manageCost.getSalesRevenue2());
+			cog.setSalesRevenue3(
+					null == manageCost.getSalesRevenue3() ? new BigDecimal(0) : manageCost.getSalesRevenue3());
+			cog.setGrossProfit1(
+					null == manageCost.getGrossProfit1() ? new BigDecimal(0) : manageCost.getGrossProfit1());
+			cog.setGrossProfit2(
+					null == manageCost.getGrossProfit2() ? new BigDecimal(0) : manageCost.getGrossProfit2());
+			cog.setGrossProfit3(
+					null == manageCost.getGrossProfit3() ? new BigDecimal(0) : manageCost.getGrossProfit3());
 		}
 		}
-		
+
 		CognizanceCatagoryBo catagory = orgCognizanceMapper.selectCognizanceCatagoryBoByUidAndYear(year, uid);
 		CognizanceCatagoryBo catagory = orgCognizanceMapper.selectCognizanceCatagoryBoByUidAndYear(year, uid);
-		if (null != catagory){
+		if (null != catagory) {
 			cog.setFirstCatagory(null == catagory.getFirstCatagory() ? 0 : catagory.getFirstCatagory());
 			cog.setFirstCatagory(null == catagory.getFirstCatagory() ? 0 : catagory.getFirstCatagory());
 			cog.setSecondCatagory(null == catagory.getSecondCatagory() ? 0 : catagory.getSecondCatagory());
 			cog.setSecondCatagory(null == catagory.getSecondCatagory() ? 0 : catagory.getSecondCatagory());
 			cog.setFirmTotal(null == catagory.getFirmTotal() ? 0 : catagory.getFirmTotal());
 			cog.setFirmTotal(null == catagory.getFirmTotal() ? 0 : catagory.getFirmTotal());
@@ -171,26 +182,27 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 
 
 	@Override
 	@Override
 	public void updateCognizance(OrgCognizance cog, OrgCognizanceLog log, Date recordTime, String aid) {
 	public void updateCognizance(OrgCognizance cog, OrgCognizanceLog log, Date recordTime, String aid) {
-		if (null != log.getState() && null != recordTime && null != cog.getUid() ) {
+		if (null != log.getState() && null != recordTime && null != cog.getUid()) {
 			log.setRecordTime(recordTime);
 			log.setRecordTime(recordTime);
-			cog.setState(log.getState());
-			switch (log.getState()) {
-			case 1:
+
+			if (OrgCognizanceStatus.getStatus(cog.getState()) == OrgCognizanceStatus.DELIVERD) {
 				cog.setCreateTime(recordTime);
 				cog.setCreateTime(recordTime);
-				break;
-			case 2:
+			} else if (OrgCognizanceStatus.getStatus(cog.getState()) == OrgCognizanceStatus.ACCEPT) {
 				cog.setAcceptDate(recordTime);
 				cog.setAcceptDate(recordTime);
-				break;
-			case 5:
+			} else if (OrgCognizanceStatus.getStatus(cog.getState()) == OrgCognizanceStatus.ISSUING) {
 				cog.setIssuingDate(recordTime);
 				cog.setIssuingDate(recordTime);
-					OrganizationIdentity o = organizationIdentityMapper.selectOrgIdentityByUserId(cog.getUid());
-					o.setCertificateNumber(null == cog.getCertificateNumber() ? "" : cog.getCertificateNumber());
-					o.setIssuingDate(recordTime);
-					o.setConsultant(null == cog.getConsultant() ? "" : cog.getConsultant());
-					o.setCogContacts(null == cog.getContacts() ? null : cog.getContacts());
-					organizationIdentityMapper.updateByPrimaryKeySelective(o);
-				break;
+				OrganizationIdentity o = organizationIdentityMapper.selectOrgIdentityByUserId(cog.getUid());
+				o.setCertificateNumber(null == cog.getCertificateNumber() ? "" : cog.getCertificateNumber());
+				o.setIssuingDate(recordTime);
+				o.setConsultant(null == cog.getConsultant() ? "" : cog.getConsultant());
+				o.setCogContacts(null == cog.getContacts() ? null : cog.getContacts());
+				organizationIdentityMapper.updateByPrimaryKeySelective(o);
 			}
 			}
+
+			if (OrgCognizanceStatus.getStatus(cog.getState()) != OrgCognizanceStatus.CIRCULATION) {
+				cog.setState(OrgCognizanceStatus.DELIVERD.getCode());
+			}
+
 			log.setId(UUID.randomUUID().toString());
 			log.setId(UUID.randomUUID().toString());
 			log.setCid(cog.getId());
 			log.setCid(cog.getId());
 			log.setOperator(aid);
 			log.setOperator(aid);
@@ -200,15 +212,9 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 	}
 	}
 
 
 	@Override
 	@Override
-	public void insertCognizance(Integer contacts, String comment, Integer year, Integer state, String aid, String uid) {
-		OrgCognizance c = new OrgCognizance();
+	public void insertCognizance(OrgCognizance c, String aid) {
 		c.setId(UUID.randomUUID().toString());
 		c.setId(UUID.randomUUID().toString());
-		c.setUid(uid);
-		c.setContacts(contacts);
-		c.setComment(comment);
 		c.setDeletedSign(0);
 		c.setDeletedSign(0);
-		c.setYear(year);
-		c.setState(state);
 		Calendar now = Calendar.getInstance();
 		Calendar now = Calendar.getInstance();
 		now.set(Calendar.MILLISECOND, 0);
 		now.set(Calendar.MILLISECOND, 0);
 		c.setRecordTime(now.getTime());
 		c.setRecordTime(now.getTime());
@@ -217,35 +223,35 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 		OrgCognizanceLog log = new OrgCognizanceLog();
 		OrgCognizanceLog log = new OrgCognizanceLog();
 		log.setId(UUID.randomUUID().toString());
 		log.setId(UUID.randomUUID().toString());
 		log.setCid(c.getId());
 		log.setCid(c.getId());
-		
+
 		log.setRecordTime(c.getCreateTime());
 		log.setRecordTime(c.getCreateTime());
-		log.setState(state);
-		log.setComment(comment);
-		log.setPrincipal(aid);
-		if (TokenManager.getToken() instanceof  Admin) {
+		log.setState(c.getState());
+		log.setPrincipal(null == aid && TokenManager.getToken() instanceof Admin? TokenManager.getAdminId() : "");
+		if (TokenManager.getToken() instanceof Admin) {
 			log.setOperator(TokenManager.getAdminId());
 			log.setOperator(TokenManager.getAdminId());
 		}
 		}
 		orgCognizanceLogMapper.insert(log);
 		orgCognizanceLogMapper.insert(log);
-		
+
 	}
 	}
 
 
 	@SuppressWarnings("unchecked")
 	@SuppressWarnings("unchecked")
 	@Override
 	@Override
-	public Pagination<CultivationListBo> listCultivation(String uid, String province, String unitName, Integer pageNo, Integer pageSize) {
+	public Pagination<CultivationListBo> listCultivation(String uid, String province, String unitName, Integer pageNo,
+			Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
-		
-		if (!StringUtils.isBlank(unitName)){
+
+		if (!StringUtils.isBlank(unitName)) {
 			params.put("unitName", unitName);
 			params.put("unitName", unitName);
 		}
 		}
-		
-		if (!StringUtils.isBlank(uid)){
+
+		if (!StringUtils.isBlank(uid)) {
 			params.put("uid", uid);
 			params.put("uid", uid);
 		}
 		}
-		
-		if (!StringUtils.isBlank(province)){
+
+		if (!StringUtils.isBlank(province)) {
 			params.put("province", province);
 			params.put("province", province);
 		}
 		}
-		
+
 		if (pageNo == null || pageNo < 0) {
 		if (pageNo == null || pageNo < 0) {
 			pageNo = 1;
 			pageNo = 1;
 		}
 		}
@@ -253,7 +259,7 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 		if (pageSize == null || pageSize < 0) {
 		if (pageSize == null || pageSize < 0) {
 			pageSize = 10;
 			pageSize = 10;
 		}
 		}
-		return(Pagination<CultivationListBo>) findPage("findCultivationListByPage", "findCultivationCount", params,
+		return (Pagination<CultivationListBo>) findPage("findCultivationListByPage", "findCultivationCount", params,
 				pageNo, pageSize);
 				pageNo, pageSize);
 	}
 	}
 }
 }

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

@@ -4,7 +4,10 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Map;
 
 
 public enum AttachmentType {
 public enum AttachmentType {
-	COPYRIGHT_AUTH("copyright_auth", "软著证书"), COPYRIGHT_APPLY("copyright_apply", "软著申请书"), DEFAULT("attachment", "附件");
+	COPYRIGHT_AUTH("copyright_auth", "软著证书"), COPYRIGHT_APPLY("copyright_apply", "软著申请书"), DEFAULT("attachment", "附件"),
+	PATENT_PRORY_STATEMENT("patent_prory_statement", "专利代理委托书"), PATENT_WRITING("patent_writing", "专利稿件"),
+	AUTHORIZATION_NOTICE("authorization_notice", "授权通知书 "), PATENT_CERTIFICATE("patent_certificate", "专利证书"),
+	INSTITUTION("institution", "研发部门制度"), PROTOCOL("protocol", "产学研技术中心协议"), PROOF("proof", "研发活动立项证明材料");
 
 
 	private AttachmentType(String code, String desc) {
 	private AttachmentType(String code, String desc) {
 		this.code = code;
 		this.code = code;

+ 57 - 0
src/main/java/com/goafanti/common/enums/CognizanceApplyFields.java

@@ -0,0 +1,57 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum CognizanceApplyFields {
+	
+	UID("uid", "用户id"),
+	CONTACTS("contacts", "联系人"),
+	COMMENT("comment", "备注"),
+	CONSULTANT("consultant", "咨询师"),
+	YEAR("year", "年份"),
+	STATE("state", "状态"),
+	
+	OTHER("", "未知参数");
+	
+	private String	code;
+	private String	desc;
+	
+	private static Map<String, CognizanceApplyFields> status = new HashMap<String, CognizanceApplyFields>();
+	
+	private CognizanceApplyFields(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+	
+	static {
+		for (CognizanceApplyFields value : CognizanceApplyFields.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	
+	public static CognizanceApplyFields getField(String code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+	
+	public static String getFieldDesc(String code) {
+		return getField(code).getDesc();
+	}
+
+	public static boolean containsType(String code) {
+		return status.containsKey(code);
+	}
+	
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+
+}

+ 64 - 0
src/main/java/com/goafanti/common/enums/OrgCognizanceFields.java

@@ -0,0 +1,64 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum OrgCognizanceFields {
+	
+	UID("uid", "用户id"),
+	CONTACTS("contacts", "联系人及联系方式"),
+	CONSULTANT("consultant", "咨询师"),
+	TECHNICALFIELD1("technicalField1", "技术领域1st select"),
+	TECHNICALFIELD2("technicalField2", "技术领域1nd select"),
+	TECHNICALFIELD3("technicalField3", "技术领域1rd select"),
+	BASICRESEARCHCOST("basicResearchCost", "基础研究投入费用"),
+	ACCIDENT("accident", "申请认定前一年内是否发生过重大安全、重大质量或严重环境违法行为"),
+	CERTIFICATENUMBER("certificateNumber", "证书编号"),
+	CERTIFICATEURL("certificateUrl", "证书URL"),
+	YEAR("year", "年份"),
+	PRINCIPAL("principal", "负责人"),
+	COMMENT("comment", "备注"),
+	STATE("state", "高企申请状态"),
+	
+	OTHER("", "未知参数");
+	
+	private String	code;
+	private String	desc;
+	
+	private static Map<String, OrgCognizanceFields> status = new HashMap<String, OrgCognizanceFields>();
+	
+	private OrgCognizanceFields(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+	
+	static {
+		for (OrgCognizanceFields value : OrgCognizanceFields.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	
+	public static OrgCognizanceFields getField(String code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+	
+	public static String getFieldDesc(String code) {
+		return getField(code).getDesc();
+	}
+
+	public static boolean containsType(String code) {
+		return status.containsKey(code);
+	}
+	
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 70 - 0
src/main/java/com/goafanti/common/enums/OrgCognizanceStatus.java

@@ -0,0 +1,70 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum OrgCognizanceStatus {
+	
+	CREATE(0, "创建"),
+	SIGN(1,"签单"),
+	DELIVERD(2, "派单"),
+	CIRCULATION(3,"流转"),
+	PREPARE(4, "准备材料"),
+	SUBMIT(5, "提交国家系统"),
+	ACCEPT(6, "受理"),
+	APPRVOVED(7, "审批通过"),
+	REJECT(8, "审批不通过"),
+	ISSUING(9, "已发证"),
+	EXPIRED(10, "已到期"),
+	FOSTER(11, "培育中"),
+	SETTLEMENT(12, "已结款"),
+	CALLBACK(13, "撤销"),
+	OTHER(14, "其他");
+	
+	private Integer	code;
+	private String	desc;
+
+	private OrgCognizanceStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, OrgCognizanceStatus> status = new HashMap<Integer, OrgCognizanceStatus>();
+
+	static {
+		for (OrgCognizanceStatus value : OrgCognizanceStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static OrgCognizanceStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static OrgCognizanceStatus getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 58 - 0
src/main/java/com/goafanti/common/enums/OrgTechCenterDetailFields.java

@@ -0,0 +1,58 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum OrgTechCenterDetailFields {
+	
+	UID("uid", "用户id"),
+	TOTALTAX("totalTax", "纳税总额(万元)"),
+	INCOMETAXRELIEF("incomeTaxRelief", "所得税减免(万元)"),
+	TOTALEXPORTVOLUME("totalExportVolume", "出口创汇总额(万元)"),
+	BASICRESEARCHCOST("basicResearchCost", "基础研究投入费用"),
+	YEAR("year", "年份"),
+	STATE("state", "年报状态"),
+	
+	OTHER("", "未知参数");
+	
+	private String	code;
+	private String	desc;
+	
+	private static Map<String, OrgTechCenterDetailFields> status = new HashMap<String, OrgTechCenterDetailFields>();
+	
+	private OrgTechCenterDetailFields(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+	
+	static {
+		for (OrgTechCenterDetailFields value : OrgTechCenterDetailFields.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	
+	public static OrgTechCenterDetailFields getField(String code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+	
+	public static String getFieldDesc(String code) {
+		return getField(code).getDesc();
+	}
+
+	public static boolean containsType(String code) {
+		return status.containsKey(code);
+	}
+	
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+
+}

+ 6 - 0
src/main/java/com/goafanti/common/mapper/CopyrightInfoMapper.xml

@@ -273,6 +273,9 @@
 	left join organization_identity oi on ci.uid = oi.uid
 	left join organization_identity oi on ci.uid = oi.uid
 	left join admin a on ci.principal = a.id
 	left join admin a on ci.principal = a.id
 	where ci.delete_sign = 0
 	where ci.delete_sign = 0
+	<if test="principal != null">
+			and ci.id in (SELECT l.pid FROM copyright_log l where l.principal = #{principal,jdbcType=VARCHAR})
+	</if>
 	<if test="province != null">
 	<if test="province != null">
 	    and oi.location_province =  #{province,jdbcType=VARCHAR}
 	    and oi.location_province =  #{province,jdbcType=VARCHAR}
 	</if>
 	</if>
@@ -317,6 +320,9 @@
 	from copyright_info ci 
 	from copyright_info ci 
 	left join organization_identity oi on ci.uid = oi.uid
 	left join organization_identity oi on ci.uid = oi.uid
 	where ci.delete_sign = 0
 	where ci.delete_sign = 0
+	<if test="principal != null">
+		and ci.id in (SELECT l.pid FROM copyright_log l where l.principal = #{principal,jdbcType=VARCHAR})
+	</if>
 	<if test="province != null">
 	<if test="province != null">
 	    and oi.location_province =  #{province,jdbcType=VARCHAR}
 	    and oi.location_province =  #{province,jdbcType=VARCHAR}
 	</if>
 	</if>

+ 29 - 23
src/main/java/com/goafanti/common/mapper/OrgCognizanceMapper.xml

@@ -270,48 +270,54 @@
   </update>
   </update>
   
   
   <select id="findCognizanceBoByPage" parameterType="String"  resultType="com.goafanti.cognizance.bo.CognizanceBo">
   <select id="findCognizanceBoByPage" parameterType="String"  resultType="com.goafanti.cognizance.bo.CognizanceBo">
-  	select x.uid, x.cid, x.serial_number as serialNumber, x.location_province as locationProvince, 
-  	x.unit_name as unitName, x.contacts, x.create_time as createTime, x.comment, x.state, x.certificate_number as certificateNumber,
-	x.issuing_date as issuingDate, a.name as consultant, x.year, x.firstContacts, x.secondContacts, x.thirdContacts from 
-	(select u.id as uid,
-	c.id as cid, c.serial_number, i.location_province,
-	i.unit_name, c.contacts, c.create_time, 
-	c.comment, c.state, c.certificate_number, 
-	c.issuing_date, c.consultant, c.year, 
+  	select  c.id as cid, c.uid as uid, c.serial_number as serialNumber, i.location_province as locationProvince,
+	i.unit_name as unitName, c.contacts, c.create_time as createTime, 
+	c.comment, c.state, c.certificate_number as certificateNumber, 
+	c.issuing_date as issuingDate, c.year, a.name as consultant,
     CONCAT(i.first_contacts,'  ', i.first_mobile) as firstContacts,
     CONCAT(i.first_contacts,'  ', i.first_mobile) as firstContacts,
     CONCAT(i.second_contacts,'  ', i.second_mobile) as secondContacts,
     CONCAT(i.second_contacts,'  ', i.second_mobile) as secondContacts,
     CONCAT(i.third_contacts,'  ', i.third_mobile) as thirdContacts
     CONCAT(i.third_contacts,'  ', i.third_mobile) as thirdContacts
-	from user u 
-	LEFT JOIN organization_identity i on i.uid = u.id
-	INNER JOIN org_cognizance c on u.id = c.uid  and deleted_sign = 0
-	) x  
-	LEFT JOIN  admin a on a.id = x.consultant
-	where 1 = 1
+	from org_cognizance c 
+	LEFT JOIN organization_identity i on c.uid = i.uid
+	LEFT JOIN admin a on c.consultant = a.id 
+	where c.deleted_sign = 0
+	
+	
+	<if test="principal != null">
+		and c.id in (SELECT l.pid FROM org_cognizance_log l where l.principal = #{principal,jdbcType=VARCHAR})
+	</if>
+	
 	<if test="unitName != null">
 	<if test="unitName != null">
-		and x.unit_name like  CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
+		and i.unit_name like  CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
 	</if>
 	</if>
 	<if test="uid != null">
 	<if test="uid != null">
-		and x.uid = #{uid,jdbcType=VARCHAR}
+		and c.uid = #{uid,jdbcType=VARCHAR}
 	</if>
 	</if>
 	<if test="locationProvince != null">
 	<if test="locationProvince != null">
-		and x.location_province = #{locationProvince, jdbcType=VARCHAR}
+		and i.location_province = #{locationProvince, jdbcType=VARCHAR}
 	</if>
 	</if>
-     order by x.serial_number desc
+     order by c.serial_number desc
 	<if test="page_sql!=null">
 	<if test="page_sql!=null">
 		${page_sql}
 		${page_sql}
 	</if>
 	</if>
   </select>
   </select>
   
   
    <select id="findCognizanceBoCount" resultType="java.lang.Integer" parameterType="String">
    <select id="findCognizanceBoCount" resultType="java.lang.Integer" parameterType="String">
-  	select count(1) from 
-    user u INNER JOIN org_cognizance c on u.id = c.uid  and deleted_sign = 0
-	LEFT JOIN organization_identity i on i.uid = u.id  
-	where 1 = 1
+  select count(1)
+	from org_cognizance c 
+	LEFT JOIN organization_identity i on c.uid = i.uid
+	LEFT JOIN admin a on c.consultant = a.id 
+	where c.deleted_sign = 0  
+
+	<if test="principal != null">
+		and c.id in (SELECT l.pid FROM org_cognizance_log l where l.principal = #{principal,jdbcType=VARCHAR})
+	</if>
+	
 	<if test="uid != null">
 	<if test="uid != null">
 		and c.uid = #{uid,jdbcType=VARCHAR}
 		and c.uid = #{uid,jdbcType=VARCHAR}
 	</if>
 	</if>
 	<if test="unitName != null">
 	<if test="unitName != null">
-		and x.unit_name like  CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
+		and i.unit_name like  CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
 	</if>
 	</if>
 	<if test="locationProvince != null">
 	<if test="locationProvince != null">
 		and i.location_province = #{locationProvince, jdbcType=VARCHAR}
 		and i.location_province = #{locationProvince, jdbcType=VARCHAR}

+ 10 - 0
src/main/java/com/goafanti/common/mapper/PatentCostMapper.xml

@@ -172,6 +172,11 @@
 		from patent_info p
 		from patent_info p
 		LEFT JOIN organization_identity o on o.uid = p.uid
 		LEFT JOIN organization_identity o on o.uid = p.uid
 		LEFT JOIN patent_cost c on p.id = c.pid WHERE p.deleted_sign = 0
 		LEFT JOIN patent_cost c on p.id = c.pid WHERE p.deleted_sign = 0
+		
+		<if test="principal != null">
+			and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+		</if>
+		
 		<if test="locationProvince != null">
 		<if test="locationProvince != null">
 			and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 			and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 		</if>
 		</if>
@@ -195,6 +200,11 @@
 		from patent_info p
 		from patent_info p
 		LEFT JOIN organization_identity o on o.uid = p.uid
 		LEFT JOIN organization_identity o on o.uid = p.uid
 		LEFT JOIN patent_cost c on p.id = c.pid WHERE p.deleted_sign = 0
 		LEFT JOIN patent_cost c on p.id = c.pid WHERE p.deleted_sign = 0
+		
+		<if test="principal != null">
+			and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+		</if>
+		
 		<if test="locationProvince != null">
 		<if test="locationProvince != null">
 			and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 			and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 		</if>
 		</if>

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

@@ -589,6 +589,10 @@
 		o.uid
 		o.uid
 		LEFT JOIN admin a on a.id = p.author
 		LEFT JOIN admin a on a.id = p.author
 		where p.deleted_sign = 0
 		where p.deleted_sign = 0
+		
+		<if test="principal != null">
+			and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+		</if>
 
 
 		<if test="serialNumber != null">
 		<if test="serialNumber != null">
 			and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 			and p.serial_number = #{serialNumber,jdbcType=INTEGER}
@@ -652,8 +656,12 @@
 		LEFT JOIN organization_identity o on
 		LEFT JOIN organization_identity o on
 		p.uid = o.uid
 		p.uid = o.uid
 		LEFT JOIN admin a on a.id = p.author
 		LEFT JOIN admin a on a.id = p.author
-		where p.deleted_sign
-		= 0
+		where p.deleted_sign = 0
+		
+		<if test="principal != null">
+			and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+		</if>
+		
 		<if test="serialNumber != null">
 		<if test="serialNumber != null">
 			and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 			and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 		</if>
 		</if>
@@ -717,6 +725,11 @@
 		INNER JOIN patent_cost c on p.id = c.pid
 		INNER JOIN patent_cost c on p.id = c.pid
 		LEFT JOIN organization_identity o on p.uid = o.id
 		LEFT JOIN organization_identity o on p.uid = o.id
 		where p.deleted_sign = 0 
 		where p.deleted_sign = 0 
+		
+		<if test="principal != null">
+			and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+		</if>
+		
 		<if test="locationProvince != null">
 		<if test="locationProvince != null">
 			and o.location_province =
 			and o.location_province =
 			#{locationProvince,jdbcType=VARCHAR}
 			#{locationProvince,jdbcType=VARCHAR}
@@ -734,6 +747,11 @@
 		INNER JOIN patent_cost c on p.id = c.pid
 		INNER JOIN patent_cost c on p.id = c.pid
 		LEFT JOIN organization_identity o on p.uid = o.id 
 		LEFT JOIN organization_identity o on p.uid = o.id 
 		where p.deleted_sign = 0 
 		where p.deleted_sign = 0 
+		
+		<if test="principal != null">
+			and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+		</if>
+		
 		<if test="locationProvince != null">
 		<if test="locationProvince != null">
 			and o.location_province =
 			and o.location_province =
 			#{locationProvince,jdbcType=VARCHAR}
 			#{locationProvince,jdbcType=VARCHAR}
@@ -756,6 +774,11 @@
     	LEFT JOIN admin a on a.id = p.author
     	LEFT JOIN admin a on a.id = p.author
 		where p.patent_state in
 		where p.patent_state in
 		(6,8) and p.deleted_sign = 0
 		(6,8) and p.deleted_sign = 0
+		
+		<if test="principal != null">
+			and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+		</if>
+		
 		<if test="serialNumber != null">
 		<if test="serialNumber != null">
 			and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 			and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 		</if>
 		</if>
@@ -802,6 +825,11 @@
     	LEFT JOIN admin a on a.id = p.author
     	LEFT JOIN admin a on a.id = p.author
 		where p.patent_state in
 		where p.patent_state in
 		(6,8) and p.deleted_sign = 0
 		(6,8) and p.deleted_sign = 0
+		
+		<if test="principal != null">
+			and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+		</if>
+		
 		<if test="serialNumber != null">
 		<if test="serialNumber != null">
 			and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 			and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 		</if>
 		</if>

+ 10 - 0
src/main/java/com/goafanti/common/mapper/PatentRegistrationMapper.xml

@@ -216,6 +216,13 @@
 		from patent_info p 
 		from patent_info p 
 		LEFT  JOIN patent_registration r  on p.id = r.pid
 		LEFT  JOIN patent_registration r  on p.id = r.pid
 		LEFT JOIN organization_identity o on o.uid = p.uid where p.deleted_sign = 0
 		LEFT JOIN organization_identity o on o.uid = p.uid where p.deleted_sign = 0
+		<if test="principal != null">
+			and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+		</if>
+		order by p.serial_number DESC
+		<if test="page_sql!=null">
+			${page_sql}
+		</if>
   </select>
   </select>
   
   
   <select id="findRecieveSendCount" resultType="java.lang.Integer">
   <select id="findRecieveSendCount" resultType="java.lang.Integer">
@@ -223,5 +230,8 @@
 	from patent_info p 
 	from patent_info p 
 	LEFT  JOIN patent_registration r  on p.id = r.pid
 	LEFT  JOIN patent_registration r  on p.id = r.pid
 	LEFT JOIN organization_identity o on o.uid = p.uid where p.deleted_sign = 0
 	LEFT JOIN organization_identity o on o.uid = p.uid where p.deleted_sign = 0
+	<if test="principal != null">
+		and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+	</if>
   </select>
   </select>
 </mapper>
 </mapper>

+ 11 - 3
src/main/java/com/goafanti/common/mapper/TechProjectMapper.xml

@@ -341,8 +341,12 @@
 	  FROM  tech_project p
 	  FROM  tech_project p
 		LEFT JOIN organization_identity i on i.uid = p.uid
 		LEFT JOIN organization_identity i on i.uid = p.uid
 		LEFT JOIN admin a on p.consultant = a.id 
 		LEFT JOIN admin a on p.consultant = a.id 
-    LEFT JOIN tech_website w on p.department = w.id where p.deleted_sign = 0 ) x where x.wd = 0 or x.wd is null
-		 <if test="province != null">
+    LEFT JOIN tech_website w on p.department = w.id where p.deleted_sign = 0 
+    <if test = "principal != null">
+    and p.id in (select  l.pid from tech_project_log l where l.principal = #{principal,jdbcType = VARCHAR})
+    </if>
+    ) x where x.wd = 0 or x.wd is null
+    <if test="province != null">
     	and x.province = #{province,jdbcType=VARCHAR}
     	and x.province = #{province,jdbcType=VARCHAR}
     </if>
     </if>
     <if test="unitName != null" >
     <if test="unitName != null" >
@@ -367,7 +371,11 @@
 	  FROM  tech_project p
 	  FROM  tech_project p
 		LEFT JOIN organization_identity i on i.uid = p.uid
 		LEFT JOIN organization_identity i on i.uid = p.uid
 		LEFT JOIN admin a on p.consultant = a.id 
 		LEFT JOIN admin a on p.consultant = a.id 
-    LEFT JOIN tech_website w on p.department = w.id where p.deleted_sign = 0 ) x where x.wd = 0 or x.wd is null
+    LEFT JOIN tech_website w on p.department = w.id where p.deleted_sign = 0 
+    <if test = "principal != null">
+    and p.id in (select  l.pid from tech_project_log l where l.principal = #{principal,jdbcType = VARCHAR})
+    </if>
+    ) x where x.wd = 0 or x.wd is null
 		 <if test="province != null">
 		 <if test="province != null">
     	and x.province = #{province,jdbcType=VARCHAR}
     	and x.province = #{province,jdbcType=VARCHAR}
     </if>
     </if>

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

@@ -97,7 +97,10 @@ public class FileUtils {
 		if (sign.indexOf("protocol") != -1 || sign.indexOf("achievement") != -1 || sign.indexOf("honor") != -1
 		if (sign.indexOf("protocol") != -1 || sign.indexOf("achievement") != -1 || sign.indexOf("honor") != -1
 				|| sign.indexOf("proof") != -1 || sign.indexOf("activity_cost_account") != -1
 				|| sign.indexOf("proof") != -1 || sign.indexOf("activity_cost_account") != -1
 				|| sign.indexOf("tech_product") != -1 || sign.indexOf("property_ritht") != -1
 				|| sign.indexOf("tech_product") != -1 || sign.indexOf("property_ritht") != -1
-				|| sign.indexOf("tech_project") != -1) {
+				|| sign.indexOf("tech_project") != -1 || sign.indexOf("patent_prory_statement") != -1 
+				|| sign.indexOf("patent_writing") != -1 || sign.indexOf("authorization_notice") != -1 
+				|| sign.indexOf("patent_certificate") != -1 
+				) {
 			uniq = true;
 			uniq = true;
 		}
 		}
 		String fileName = "";
 		String fileName = "";

+ 4 - 0
src/main/java/com/goafanti/copyright/service/impl/CopyrightInfoServiceImpl.java

@@ -111,6 +111,10 @@ public class CopyrightInfoServiceImpl extends BaseMybatisDao<CopyrightInfoMapper
 			CopyrightStatus status, String[] createTime, String[] acceptTime, String[] authTime, Integer pageNo,
 			CopyrightStatus status, String[] createTime, String[] acceptTime, String[] authTime, Integer pageNo,
 			Integer pageSize, String uid) {
 			Integer pageSize, String uid) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
+		
+		if (!TokenManager.hasRole("999999")) {
+			params.put("principal", TokenManager.getAdminId());
+		}
 		if (StringUtils.isNotBlank(province)) {
 		if (StringUtils.isNotBlank(province)) {
 			params.put("province", province);
 			params.put("province", province);
 		}
 		}

+ 1 - 1
src/main/java/com/goafanti/core/shiro/token/UserRealm.java

@@ -90,7 +90,7 @@ public class UserRealm extends AuthorizingRealm {
 	 */
 	 */
 	@Override
 	@Override
 	protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
 	protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
-		String userId = TokenManager.getUserId();
+		String userId = TokenManager.getAdminId();
 		SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
 		SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
 		// 根据用户ID查询角色(role),放入到Authorization里。
 		// 根据用户ID查询角色(role),放入到Authorization里。
 		Set<String> roles = roleService.findRoleByUserId(userId);
 		Set<String> roles = roleService.findRoleByUserId(userId);

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

@@ -1,6 +1,5 @@
 package com.goafanti.patent.controller;
 package com.goafanti.patent.controller;
 
 
-import java.io.IOException;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Calendar;
@@ -27,15 +26,17 @@ import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.multipart.MultipartFile;
 
 
+import com.goafanti.admin.service.AftFileService;
 import com.goafanti.cognizance.service.OrgIntellectualPropertyService;
 import com.goafanti.cognizance.service.OrgIntellectualPropertyService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.enums.PatentInfoFields;
 import com.goafanti.common.enums.PatentInfoFields;
 import com.goafanti.common.enums.PatentInfoStatus;
 import com.goafanti.common.enums.PatentInfoStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.AftFile;
 import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.PatentCost;
 import com.goafanti.common.model.PatentCost;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.PatentInfo;
@@ -44,7 +45,6 @@ import com.goafanti.common.model.PatentRegistration;
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.User;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.FileUtils;
 import com.goafanti.common.utils.FileUtils;
-import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -83,10 +83,114 @@ public class PatentApiController extends CertifyApiController {
 	private OrgIntellectualPropertyService	orgIntellectualPropertyService;
 	private OrgIntellectualPropertyService	orgIntellectualPropertyService;
 	@Resource
 	@Resource
 	private UserService						userService;
 	private UserService						userService;
+	@Resource
+	private AftFileService aftFileService;
 
 
 	@Value(value = "${upload.private.path}")
 	@Value(value = "${upload.private.path}")
 	private String							uploadPrivatePath	= null;
 	private String							uploadPrivatePath	= null;
-
+	
+	/**
+	 * 专利相关材料上传
+	 * @param req
+	 * @param uid
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/upload", method = RequestMethod.POST)
+	public Result upload(HttpServletRequest req, String sign){
+		Result res = new Result();
+		if (!checkUserLogin(res)) {
+			return res;
+		}
+		User curUser = TokenManager.getUserToken();
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+		
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT || attachmentType == AttachmentType.PATENT_WRITING
+			|| attachmentType == AttachmentType.AUTHORIZATION_NOTICE || attachmentType == AttachmentType.PATENT_CERTIFICATE) {
+			res.setData(handleFiles(res, "/patent/", true, req, sign, TokenManager.getUserId()));
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		
+		return res;
+	}
+	
+	
+	/**
+	 * 下载专利相关材料
+	 * 
+	 * @param id
+	 * @param sign
+	 * @param response
+	 * @return
+	 */
+	@RequestMapping(value = "/download", method = RequestMethod.GET)
+	public Result download(String id, String sign, HttpServletResponse response) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利id"));
+			return res;
+		}
+		PatentInfo pi = patentInfoService.selectByPrimaryKey(id);
+		if (pi == null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利id"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT || attachmentType == AttachmentType.PATENT_WRITING
+				|| attachmentType == AttachmentType.AUTHORIZATION_NOTICE
+				|| attachmentType == AttachmentType.PATENT_CERTIFICATE) {
+			if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT) {
+				downloadFile(response, pi.getPatentProryStatementDownloadFileName(), pi.getPatentProryStatementUrl());
+			} else if (attachmentType == AttachmentType.PATENT_WRITING) {
+				downloadFile(response, pi.getPatentWritingDownloadFileName(), pi.getPatentWritingUrl());
+			} else if (attachmentType == AttachmentType.AUTHORIZATION_NOTICE) {
+				downloadFile(response, pi.getAuthorizationNoticeDownloadFileName(), pi.getAuthorizationNoticeUrl());
+			} else if (attachmentType == AttachmentType.PATENT_CERTIFICATE){
+				downloadFile(response, pi.getPatentCertificateDownloadFileName(), pi.getPatentCertificateUrl());
+			}
+		} else{
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+	
+	/**
+	 * 下载模版文件(专利代理委托书)
+	 * 
+	 * @param response
+	 * @return
+	 */
+	@RequestMapping(value = "/downloadTemplateFile", method = RequestMethod.GET)
+	public Result downloadTemplateFile(HttpServletResponse response, String sign) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT) {
+			String fileName = "";
+			AftFile af = aftFileService.selectAftFileBySign(sign);
+			if (null == af) {
+				res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "找不到", "文件"));
+			} else {
+				String path = af.getFilePath();
+				String suffix = path.substring(path.lastIndexOf("."));
+				fileName = "专利代理委托书模版" + suffix;
+				downloadFile(response, fileName, path);
+			}
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利代理委托书标示"));
+		}
+		return res;
+	}
+	
 	/**
 	/**
 	 * 用户端专利申请
 	 * 用户端专利申请
 	 */
 	 */
@@ -710,6 +814,11 @@ public class PatentApiController extends CertifyApiController {
 		return workbook;
 		return workbook;
 	}
 	}
 
 
+	
+	
+	
+	
+
 	/**
 	/**
 	 * 专利相关材料上传
 	 * 专利相关材料上传
 	 * 
 	 * 
@@ -717,15 +826,16 @@ public class PatentApiController extends CertifyApiController {
 	 * @param sign
 	 * @param sign
 	 *            材料类型标记,其中'patent_prory_statement'为专利代理委托书标记
 	 *            材料类型标记,其中'patent_prory_statement'为专利代理委托书标记
 	 * @return
 	 * @return
-	 */
+	 *//*
 	@RequestMapping(value = "/patentFile", method = RequestMethod.POST)
 	@RequestMapping(value = "/patentFile", method = RequestMethod.POST)
 	public Result patentFile(HttpServletRequest req, String sign, String oid) {
 	public Result patentFile(HttpServletRequest req, String sign, String oid) {
 		Result res = new Result();
 		Result res = new Result();
 		res.setData(handleFile(res, "/cognizannce/", true, req, sign, oid));
 		res.setData(handleFile(res, "/cognizannce/", true, req, sign, oid));
 		return res;
 		return res;
-	}
+	}*/
+	
 
 
-	private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign,
+	/*private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign,
 			String oid) {
 			String oid) {
 		List<MultipartFile> files = getFiles(req);
 		List<MultipartFile> files = getFiles(req);
 		MultipartFile mf = files.get(0);
 		MultipartFile mf = files.get(0);
@@ -745,7 +855,7 @@ public class PatentApiController extends CertifyApiController {
 			return "";
 			return "";
 		}
 		}
 		return fileName;
 		return fileName;
-	}
+	}*/
 
 
 	// 专利纸件收发登记
 	// 专利纸件收发登记
 	private Pagination<PatentRecieveSendBo> getRecieveSendList(Integer pNo, Integer pSize) {
 	private Pagination<PatentRecieveSendBo> getRecieveSendList(Integer pNo, Integer pSize) {

+ 5 - 0
src/main/java/com/goafanti/patent/service/impl/PatentCostServiceImpl.java

@@ -14,6 +14,7 @@ import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.patent.bo.PatentApplicationFeeBo;
 import com.goafanti.patent.bo.PatentApplicationFeeBo;
 import com.goafanti.patent.service.PatentCostService;
 import com.goafanti.patent.service.PatentCostService;
 @Service
 @Service
@@ -34,6 +35,10 @@ public class PatentCostServiceImpl extends BaseMybatisDao<PatentCostMapper> impl
 		Date pStart = null;
 		Date pStart = null;
 		Date pEnd = null;
 		Date pEnd = null;
 		
 		
+		if (!TokenManager.hasRole("999999")) {
+			params.put("principal", TokenManager.getAdminId());
+		}
+		
 		if (pDate != null && pDate.length > 0) {
 		if (pDate != null && pDate.length > 0) {
 			pStart = StringUtils.isBlank(pDate[0]) ? null : DateUtils.parseDate(pDate[0], "yyyy-MM-dd");
 			pStart = StringUtils.isBlank(pDate[0]) ? null : DateUtils.parseDate(pDate[0], "yyyy-MM-dd");
 			pEnd = StringUtils.isBlank(pDate[1]) ? null :  DateUtils.addDays(DateUtils.parseDate(pDate[1], "yyyy-MM-dd"), 1);
 			pEnd = StringUtils.isBlank(pDate[1]) ? null :  DateUtils.addDays(DateUtils.parseDate(pDate[1], "yyyy-MM-dd"), 1);

+ 16 - 2
src/main/java/com/goafanti/patent/service/impl/PatentInfoServiceImpl.java

@@ -116,6 +116,11 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		Date cEnd = null;
 		Date cEnd = null;
 		Date pStart = null;
 		Date pStart = null;
 		Date pEnd = null;
 		Date pEnd = null;
+		
+		if (!TokenManager.hasRole("999999")) {
+			params.put("principal", TokenManager.getAdminId());
+		}
+		
 
 
 		if (cDate != null && cDate.length > 0) {
 		if (cDate != null && cDate.length > 0) {
 			try {
 			try {
@@ -204,6 +209,10 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 			Integer pageSize) {
 			Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 
 
+		if (!TokenManager.hasRole("999999")) {
+			params.put("principal", TokenManager.getAdminId());
+		}
+		
 		if (locationProvince != null && locationProvince != "") {
 		if (locationProvince != null && locationProvince != "") {
 			params.put("locationProvince", locationProvince);
 			params.put("locationProvince", locationProvince);
 		}
 		}
@@ -225,7 +234,12 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 			String patentNumber, String office, String locationProvince, String unitName, Integer patentCatagory,
 			String patentNumber, String office, String locationProvince, String unitName, Integer patentCatagory,
 			String patentName, Integer patentState, String author, Integer pageNo, Integer pageSize) {
 			String patentName, Integer patentState, String author, Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
-
+		
+		
+		if (!TokenManager.hasRole("999999")) {
+			params.put("principal", TokenManager.getAdminId());
+		}
+		
 		if (authorizedDate != null) {
 		if (authorizedDate != null) {
 			params.put("authorizedDate", authorizedDate);
 			params.put("authorizedDate", authorizedDate);
 		}
 		}
@@ -311,7 +325,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		log.setPid(patentInfo.getId());
 		log.setPid(patentInfo.getId());
 		log.setRecordTime(patentInfo.getCreateTime());
 		log.setRecordTime(patentInfo.getCreateTime());
 		log.setState(PatentInfoStatus.CREATE.getCode());
 		log.setState(PatentInfoStatus.CREATE.getCode());
-		log.setPrincipal(aid);
+		log.setPrincipal(null == aid && TokenManager.getToken() instanceof Admin? TokenManager.getAdminId() : "");
 		if (TokenManager.getToken() instanceof Admin) {
 		if (TokenManager.getToken() instanceof Admin) {
 			log.setOperator(TokenManager.getAdminId());
 			log.setOperator(TokenManager.getAdminId());
 		}
 		}

+ 12 - 5
src/main/java/com/goafanti/patent/service/impl/PatentRegistrationServiceImpl.java

@@ -10,12 +10,15 @@ import com.goafanti.common.dao.PatentRegistrationMapper;
 import com.goafanti.common.model.PatentRegistration;
 import com.goafanti.common.model.PatentRegistration;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.patent.bo.PatentRecieveSendBo;
 import com.goafanti.patent.bo.PatentRecieveSendBo;
 import com.goafanti.patent.service.PatentRegistrationService;
 import com.goafanti.patent.service.PatentRegistrationService;
+
 @Service
 @Service
-public class PatentRegistrationServiceImpl extends BaseMybatisDao<PatentRegistrationMapper> implements PatentRegistrationService {
+public class PatentRegistrationServiceImpl extends BaseMybatisDao<PatentRegistrationMapper>
+		implements PatentRegistrationService {
 	@Autowired
 	@Autowired
-    private PatentRegistrationMapper patentRegistrationMapper;
+	private PatentRegistrationMapper patentRegistrationMapper;
 
 
 	@Override
 	@Override
 	public PatentRegistration insert(PatentRegistration patentRegistration) {
 	public PatentRegistration insert(PatentRegistration patentRegistration) {
@@ -33,6 +36,11 @@ public class PatentRegistrationServiceImpl extends BaseMybatisDao<PatentRegistra
 	public Pagination<PatentRecieveSendBo> getRecieveSendList(Integer pageNo, Integer pageSize) {
 	public Pagination<PatentRecieveSendBo> getRecieveSendList(Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 		
 		
+		if (!TokenManager.hasRole("999999")) {
+			params.put("principal", TokenManager.getAdminId());
+		}
+		
+
 		if (pageNo == null || pageNo < 0) {
 		if (pageNo == null || pageNo < 0) {
 			pageNo = 1;
 			pageNo = 1;
 		}
 		}
@@ -40,13 +48,13 @@ public class PatentRegistrationServiceImpl extends BaseMybatisDao<PatentRegistra
 		if (pageSize == null || pageSize < 0) {
 		if (pageSize == null || pageSize < 0) {
 			pageSize = 15;
 			pageSize = 15;
 		}
 		}
-		return (Pagination<PatentRecieveSendBo>) findPage("findRecieveSendList","findRecieveSendCount",params, pageNo,
+		return (Pagination<PatentRecieveSendBo>) findPage("findRecieveSendList", "findRecieveSendCount", params, pageNo,
 				pageSize);
 				pageSize);
 	}
 	}
 
 
 	@Override
 	@Override
 	public int updateByPrimaryKey(PatentRegistration patentRegistration) {
 	public int updateByPrimaryKey(PatentRegistration patentRegistration) {
-		return patentRegistrationMapper.updateByPrimaryKey(patentRegistration);
+		return patentRegistrationMapper.updateByPrimaryKeySelective(patentRegistration);
 	}
 	}
 
 
 	@Override
 	@Override
@@ -54,5 +62,4 @@ public class PatentRegistrationServiceImpl extends BaseMybatisDao<PatentRegistra
 		return patentRegistrationMapper.selectByPrimaryKey(id);
 		return patentRegistrationMapper.selectByPrimaryKey(id);
 	}
 	}
 
 
-
 }
 }

+ 6 - 1
src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

@@ -90,7 +90,7 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 		log.setId(UUID.randomUUID().toString());
 		log.setId(UUID.randomUUID().toString());
 		log.setPid(techProject.getId());
 		log.setPid(techProject.getId());
 		log.setRecordTime(techProject.getRecordTime());
 		log.setRecordTime(techProject.getRecordTime());
-		log.setPrincipal(aid);
+		log.setPrincipal(null == aid && TokenManager.getToken() instanceof Admin ? TokenManager.getAdminId() : "");
 		log.setState(TechProjectStatus.CREATE.getCode());
 		log.setState(TechProjectStatus.CREATE.getCode());
 		if (TokenManager.getToken() instanceof Admin) {
 		if (TokenManager.getToken() instanceof Admin) {
 			log.setOperator(TokenManager.getAdminId());
 			log.setOperator(TokenManager.getAdminId());
@@ -103,6 +103,11 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 	public Pagination<TechProjectManageListBo> listManageTechProject(String province, String unitName, Integer pageNo,
 	public Pagination<TechProjectManageListBo> listManageTechProject(String province, String unitName, Integer pageNo,
 			Integer pageSize) {
 			Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
+		
+		if (!TokenManager.hasRole("999999")) {
+			params.put("principal", TokenManager.getAdminId());
+		}
+		
 		if (!StringUtils.isBlank(province)) {
 		if (!StringUtils.isBlank(province)) {
 			params.put("province", province);
 			params.put("province", province);
 		}
 		}

+ 4 - 5
src/main/webapp/WEB-INF/html/test.html

@@ -58,7 +58,7 @@
     </label>
     </label>
     <label>
     <label>
       <span>接口地址</span>
       <span>接口地址</span>
-      <input type="text" id="path" value="/signin" >
+      <input type="text" id="path" value="/managesignin" >
     </label>
     </label>
     <label>
     <label>
       <span>post or get</span>
       <span>post or get</span>
@@ -73,10 +73,9 @@
       <textarea id="data" cols="30" rows="10">
       <textarea id="data" cols="30" rows="10">
       
       
 	{
 	{
-	"mobile": "13600000000",
-	"password": "123456",
-	"type"    :1 ,
-	"remember":false
+	"mobile": "137",
+	"password": "123456"
+	
 }
 }
       </textarea>
       </textarea>
     </label>
     </label>