|
|
@@ -43,6 +43,7 @@ import com.goafanti.cognizance.bo.InputOrgTechAchievement;
|
|
|
import com.goafanti.cognizance.bo.InputOrgTechCenter;
|
|
|
import com.goafanti.cognizance.bo.InputOrgTechCenterDetail;
|
|
|
import com.goafanti.cognizance.bo.InputOrgTechProduct;
|
|
|
+import com.goafanti.cognizance.bo.OrgIntellectualPropertyDetailBo;
|
|
|
import com.goafanti.cognizance.service.OrgActivityCostService;
|
|
|
import com.goafanti.cognizance.service.OrgActivityService;
|
|
|
import com.goafanti.cognizance.service.OrgAnnualReportService;
|
|
|
@@ -66,6 +67,7 @@ import com.goafanti.common.enums.AttachmentType;
|
|
|
import com.goafanti.common.enums.CognizanceApplyFields;
|
|
|
import com.goafanti.common.enums.IdentityAuditStatus;
|
|
|
import com.goafanti.common.enums.IdentityProcess;
|
|
|
+import com.goafanti.common.enums.IntellectualPropertyType;
|
|
|
import com.goafanti.common.enums.OrgActivityFields;
|
|
|
import com.goafanti.common.enums.OrgAnnualReportFields;
|
|
|
import com.goafanti.common.enums.OrgCognizanceFields;
|
|
|
@@ -101,14 +103,18 @@ import com.goafanti.common.model.OrgTechCenter;
|
|
|
import com.goafanti.common.model.OrgTechCenterDetail;
|
|
|
import com.goafanti.common.model.OrgTechProduct;
|
|
|
import com.goafanti.common.model.OrganizationIdentity;
|
|
|
+import com.goafanti.common.model.PatentInfo;
|
|
|
import com.goafanti.common.model.User;
|
|
|
import com.goafanti.common.model.UserAbility;
|
|
|
import com.goafanti.common.model.UserIdentity;
|
|
|
import com.goafanti.common.utils.DateUtils;
|
|
|
import com.goafanti.common.utils.PasswordUtil;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
+import com.goafanti.copyright.bo.CopyrightInfoDetail;
|
|
|
+import com.goafanti.copyright.service.CopyrightInfoService;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
+import com.goafanti.patent.service.PatentInfoService;
|
|
|
import com.goafanti.user.bo.InputOrganizationIdentity;
|
|
|
import com.goafanti.user.bo.InputUser;
|
|
|
import com.goafanti.user.bo.InputUserAbility;
|
|
|
@@ -166,6 +172,10 @@ public class AdminApiController extends CertifyApiController {
|
|
|
private AdminService adminService;
|
|
|
@Resource
|
|
|
private OrgTechCenterDetailService orgTechCenterDetailService;
|
|
|
+ @Resource
|
|
|
+ private PatentInfoService patentInfoService;
|
|
|
+ @Resource
|
|
|
+ private CopyrightInfoService copyrightInfoService;
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
@@ -960,6 +970,11 @@ public class AdminApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ if (null == orgStandard.getYear()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "年份"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
if (!checkCertify(res, orgStandard.getUid()).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -982,6 +997,65 @@ public class AdminApiController extends CertifyApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 上传标准制定附件
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ * @param sign
|
|
|
+ * @param uid
|
|
|
+ * @param year
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/uploadStandard", method = RequestMethod.POST)
|
|
|
+ public Result uploadStandard(HttpServletRequest req, String sign, String uid) {
|
|
|
+ Result res = new Result();
|
|
|
+
|
|
|
+ User curUser = userService.selectByPrimaryKey(uid);
|
|
|
+ if (!checkCertify(res, curUser)) {
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ AttachmentType attachmentType = AttachmentType.getField(sign);
|
|
|
+ if (attachmentType == AttachmentType.STANDARD) {
|
|
|
+ res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
|
|
|
+ }
|
|
|
+
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下载标准制定附件
|
|
|
+ *
|
|
|
+ * @param response
|
|
|
+ * @param sign
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/downloadStandard", method = RequestMethod.GET)
|
|
|
+ public Result downloadStandard(HttpServletResponse response, String sign, String id) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "标准制定id"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ OrgStandard os = orgStandardService.selectByPrimaryKey(id);
|
|
|
+ if (os == null) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "标准指定id"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ AttachmentType attachmentType = AttachmentType.getField(sign);
|
|
|
+ if (attachmentType == AttachmentType.STANDARD) {
|
|
|
+ downloadFile(response, os.getStandardDownloadFileName(), os.getEnclosureUrl());
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 删除标准制定情况记录
|
|
|
*
|
|
|
* @param id
|
|
|
@@ -1030,6 +1104,41 @@ public class AdminApiController extends CertifyApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 知识产权详情
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Result intellectualDetail(String id, Integer type) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "知识产权ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null == type) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "知识产权TYPE"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ OrgIntellectualProperty oip = orgIntellectualPropertyService.selectByPrimaryKey(id);
|
|
|
+ if (null == oip) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if (IntellectualPropertyType.PATENT.getCode() == type) {
|
|
|
+ res.setData(orgIntellectualPropertyService.selectPatentTypeDetail(id));
|
|
|
+ } else if (IntellectualPropertyType.COPYRIGHT.getCode() == type) {
|
|
|
+ res.setData(orgIntellectualPropertyService.selectCopyrightTypeDetail(id));
|
|
|
+ } else if (IntellectualPropertyType.COMMON.getCode() == type) {
|
|
|
+ OrgIntellectualPropertyDetailBo oipdb = new OrgIntellectualPropertyDetailBo();
|
|
|
+ BeanUtils.copyProperties(oip, oipdb);
|
|
|
+ res.setData(oipdb);
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权TYPE"));
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 知识产权信息新增及修改
|
|
|
*
|
|
|
* @return
|
|
|
@@ -1067,6 +1176,7 @@ public class AdminApiController extends CertifyApiController {
|
|
|
oip.setId(UUID.randomUUID().toString());
|
|
|
oip.setEvaluationCategory((oip.getCatagory() >= 2 && oip.getCatagory() <= 4) ? 1 : 0);
|
|
|
oip.setDeletedSign(0);
|
|
|
+ oip.setType(IntellectualPropertyType.COMMON.getCode());
|
|
|
res.setData(orgIntellectualPropertyService.insert(oip));
|
|
|
} else {
|
|
|
oip.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
|
|
|
@@ -1134,6 +1244,64 @@ public class AdminApiController extends CertifyApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 知识产权稿件下载
|
|
|
+ *
|
|
|
+ * @param response
|
|
|
+ * @param sign
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/downloadManuscriptUrl", method = RequestMethod.GET)
|
|
|
+ public Result downloadManuscriptUrl(HttpServletResponse response, String sign, String id, Integer type) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "知识产权id"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null == type) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "知识产权TYPE"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ OrgIntellectualProperty olp = orgIntellectualPropertyService.selectByPrimaryKey(id);
|
|
|
+ if (olp == null) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ String fileName = null;
|
|
|
+ String downloadUrl = null;
|
|
|
+ if (IntellectualPropertyType.PATENT.getCode() == type) {
|
|
|
+ PatentInfo pi = patentInfoService.selectByPrimaryKey(olp.getPid());
|
|
|
+ if (null == pi) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID及TYPE"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ fileName = pi.getPatentWritingDownloadFileName();
|
|
|
+ downloadUrl = pi.getPatentWritingUrl();
|
|
|
+ } else if (IntellectualPropertyType.COPYRIGHT.getCode() == type) {
|
|
|
+ CopyrightInfoDetail ci = copyrightInfoService.findByPrimaryKey(id);
|
|
|
+ if (null == ci){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID及TYPE"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ fileName = ci.getApplicationUrlDownloadFileName();
|
|
|
+ downloadUrl = ci.getApplicationUrl();
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权TYPE"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ AttachmentType attachmentType = AttachmentType.getField(sign);
|
|
|
+ if (attachmentType == AttachmentType.MANUSCRIPT) {
|
|
|
+ downloadFile(response, fileName, downloadUrl);
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 删除知识产权记录
|
|
|
*
|
|
|
* @param id
|
|
|
@@ -2146,6 +2314,11 @@ public class AdminApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ if (null == honor.getYear()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "年份"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkCertify(res, honor.getUid()).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -3073,6 +3246,14 @@ public class AdminApiController extends CertifyApiController {
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
+ * @Test public void test () throws IllegalArgumentException,
|
|
|
+ * IllegalAccessException{ Admin a = new Admin(); import
|
|
|
+ * java.lang.reflect.Field; boolean flag = Boolean.FALSE; for(Field f :
|
|
|
+ * a.getClass().getDeclaredFields()){ f.setAccessible(true); if(f.get(a) ==
|
|
|
+ * null){ flag = true; } } }
|
|
|
+ */
|
|
|
+
|
|
|
+ /*
|
|
|
* 高企相关材料上传
|
|
|
*
|
|
|
* @RequestMapping(value = "/upload", method = RequestMethod.POST) public
|