|
@@ -1,6 +1,8 @@
|
|
|
package com.goafanti.admin.controller;
|
|
package com.goafanti.admin.controller;
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+import java.util.TreeMap;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
@@ -16,10 +18,12 @@ import com.goafanti.admin.service.AdminService;
|
|
|
import com.goafanti.cognizance.bo.LatelyCogRecord;
|
|
import com.goafanti.cognizance.bo.LatelyCogRecord;
|
|
|
import com.goafanti.cognizance.service.OrgCognizanceService;
|
|
import com.goafanti.cognizance.service.OrgCognizanceService;
|
|
|
import com.goafanti.common.bo.Result;
|
|
import com.goafanti.common.bo.Result;
|
|
|
|
|
+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.ContractFields;
|
|
import com.goafanti.common.enums.ContractFields;
|
|
|
import com.goafanti.common.enums.ContractLogFields;
|
|
import com.goafanti.common.enums.ContractLogFields;
|
|
|
|
|
+import com.goafanti.common.enums.ContractStatus;
|
|
|
import com.goafanti.common.enums.OrgCognizanceStatus;
|
|
import com.goafanti.common.enums.OrgCognizanceStatus;
|
|
|
import com.goafanti.common.model.Contract;
|
|
import com.goafanti.common.model.Contract;
|
|
|
import com.goafanti.common.model.User;
|
|
import com.goafanti.common.model.User;
|
|
@@ -31,6 +35,7 @@ import com.goafanti.contract.bo.InputSaveContract;
|
|
|
import com.goafanti.contract.service.ContractLogService;
|
|
import com.goafanti.contract.service.ContractLogService;
|
|
|
import com.goafanti.contract.service.ContractService;
|
|
import com.goafanti.contract.service.ContractService;
|
|
|
import com.goafanti.copyright.service.CopyrightInfoService;
|
|
import com.goafanti.copyright.service.CopyrightInfoService;
|
|
|
|
|
+import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.patent.service.PatentInfoService;
|
|
import com.goafanti.patent.service.PatentInfoService;
|
|
|
import com.goafanti.techproject.service.TechProjectService;
|
|
import com.goafanti.techproject.service.TechProjectService;
|
|
|
import com.goafanti.user.service.UserService;
|
|
import com.goafanti.user.service.UserService;
|
|
@@ -56,6 +61,30 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
private TechProjectService techProjectService;
|
|
private TechProjectService techProjectService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 合同管理--创建专利
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/createPatent", method = RequestMethod.POST)
|
|
|
|
|
+ public Result createPatent(String id) {
|
|
|
|
|
+ Result res = new Result();
|
|
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合同ID", "合同ID"));
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
+ Contract c = contractService.selectByPrimaryKey(id);
|
|
|
|
|
+ if (null == c) {
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "合同ID"));
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (c.getPatentNum() >= 1 && c.getPatentNum() <= 30) {
|
|
|
|
|
+ patentInfoService.batchInsertContractRecord(c);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利数量"));
|
|
|
|
|
+ }
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 合同详情-科技项目列表
|
|
* 合同详情-科技项目列表
|
|
|
*/
|
|
*/
|
|
|
@RequestMapping(value = "/techProject", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/techProject", method = RequestMethod.GET)
|
|
@@ -240,6 +269,16 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
res.setData(contractLogService.selectContractLogByCid(cid));
|
|
res.setData(contractLogService.selectContractLogByCid(cid));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 合同流转状态下拉
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/status", method = RequestMethod.GET)
|
|
|
|
|
+ public Result status(){
|
|
|
|
|
+ Result res = new Result();
|
|
|
|
|
+ res.setData(disposeStatus());
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 流转分发
|
|
* 流转分发
|
|
@@ -253,8 +292,8 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
ContractLogFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
ContractLogFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if (StringUtils.isBlank(recordTimeFormattedDate)){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isBlank(recordTimeFormattedDate)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到流转分发时间", "流转分发时间"));
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到流转分发时间", "流转分发时间"));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
@@ -306,5 +345,29 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private Object disposeStatus() {
|
|
|
|
|
+ Map<String, String> status = new TreeMap<String, String>();
|
|
|
|
|
+ if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
|
|
+ for (ContractStatus p : ContractStatus.values()) {
|
|
|
|
|
+ status.put(p.getCode().toString(), p.getDesc());
|
|
|
|
|
+ status.remove(ContractStatus.OTHER.getCode().toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (TokenManager.hasPermission("ContractStatus" + ContractStatus.CREATE.getCode())) {
|
|
|
|
|
+ status.put(ContractStatus.CREATE.getCode().toString(), ContractStatus.CREATE.getDesc());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (TokenManager.hasPermission("ContractStatus" + ContractStatus.SIGN.getCode())) {
|
|
|
|
|
+ status.put(ContractStatus.SIGN.getCode().toString(), ContractStatus.SIGN.getDesc());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (TokenManager.hasPermission("ContractStatus" + ContractStatus.CIRCULATION.getCode())) {
|
|
|
|
|
+ status.put(ContractStatus.CIRCULATION.getCode().toString(), ContractStatus.CIRCULATION.getDesc());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (TokenManager.hasPermission("ContractStatus" + ContractStatus.COMPLETE.getCode())) {
|
|
|
|
|
+ status.put(ContractStatus.COMPLETE.getCode().toString(), ContractStatus.COMPLETE.getDesc());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return status;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|