|
|
@@ -60,12 +60,12 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
private CopyrightInfoService copyrightInfoService;
|
|
|
@Resource
|
|
|
private TechProjectService techProjectService;
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 合同管理--创建高企认定申请
|
|
|
*/
|
|
|
@RequestMapping(value = "/createCognizance", method = RequestMethod.POST)
|
|
|
- public Result createCognizance(String id){
|
|
|
+ public Result createCognizance(String id) {
|
|
|
Result res = new Result();
|
|
|
if (StringUtils.isBlank(id)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合同ID", "合同ID"));
|
|
|
@@ -76,31 +76,31 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "合同ID"));
|
|
|
return res;
|
|
|
}
|
|
|
- if (!c.getCognizanceStatus().equals(ContractBusinessStatus.UNCREATE.getCode())){
|
|
|
+ if (!c.getCognizanceStatus().equals(ContractBusinessStatus.UNCREATE.getCode())) {
|
|
|
res.getError().add(buildError(ErrorConstants.CONTRACT_COPYRIGHT_CREATED, "", "当前合同高企认定申请已创建,无法重复创建!"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
- if (null == c.getCognizanceYear()){
|
|
|
+
|
|
|
+ if (null == c.getCognizanceYear()) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到高企认定申请年份", "高企认定申请年份"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (null != c.getCognizanceYear()) {
|
|
|
if (!disposeCog(c.getUid(), res).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
orgCognizanceService.insertContractRecord(c);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 合同管理--批量创建科技项目
|
|
|
*/
|
|
|
@RequestMapping(value = "/createTechProject", method = RequestMethod.POST)
|
|
|
- public Result createTechProject(String id){
|
|
|
+ public Result createTechProject(String id) {
|
|
|
Result res = new Result();
|
|
|
if (StringUtils.isBlank(id)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合同ID", "合同ID"));
|
|
|
@@ -111,11 +111,11 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "合同ID"));
|
|
|
return res;
|
|
|
}
|
|
|
- if (!c.getTechProjectStatus().equals(ContractBusinessStatus.UNCREATE.getCode())){
|
|
|
+ if (!c.getTechProjectStatus().equals(ContractBusinessStatus.UNCREATE.getCode())) {
|
|
|
res.getError().add(buildError(ErrorConstants.CONTRACT_COPYRIGHT_CREATED, "", "当前合同科技项目申请已创建,无法重复创建!"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (c.getTechProjectNum() >= 1 && c.getTechProjectNum() <= 30) {
|
|
|
techProjectService.batchInsertContractRecord(c);
|
|
|
} else {
|
|
|
@@ -123,12 +123,12 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 合同管理--批量创建软著
|
|
|
*/
|
|
|
@RequestMapping(value = "/createCopyright", method = RequestMethod.POST)
|
|
|
- public Result createCopyright(String id){
|
|
|
+ public Result createCopyright(String id) {
|
|
|
Result res = new Result();
|
|
|
if (StringUtils.isBlank(id)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合同ID", "合同ID"));
|
|
|
@@ -139,11 +139,11 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "合同ID"));
|
|
|
return res;
|
|
|
}
|
|
|
- if (!c.getCopyrightStatus().equals(ContractBusinessStatus.UNCREATE.getCode())){
|
|
|
+ if (!c.getCopyrightStatus().equals(ContractBusinessStatus.UNCREATE.getCode())) {
|
|
|
res.getError().add(buildError(ErrorConstants.CONTRACT_COPYRIGHT_CREATED, "", "当前合同软著申请已创建,无法重复创建!"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (c.getCopyrightNum() >= 1 && c.getCopyrightNum() <= 30) {
|
|
|
copyrightInfoService.batchInsertContractRecord(c);
|
|
|
} else {
|
|
|
@@ -167,8 +167,8 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "合同ID"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
- if (!c.getPatentStatus().equals(ContractBusinessStatus.UNCREATE.getCode())){
|
|
|
+
|
|
|
+ if (!c.getPatentStatus().equals(ContractBusinessStatus.UNCREATE.getCode())) {
|
|
|
res.getError().add(buildError(ErrorConstants.CONTRACT_PATENT_CREATED, "", "当前合同专利申请已创建,无法重复创建!"));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -293,10 +293,14 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Contract c = new Contract();
|
|
|
BeanUtils.copyProperties(contract, c);
|
|
|
- res.setData(contractService.saveManageContract(c));
|
|
|
+ if (StringUtils.isBlank(contract.getId())) {
|
|
|
+ res.setData(contractService.saveManageContract(c));
|
|
|
+ } else {
|
|
|
+ res.setData(contractService.updateByPrimaryKeySelective(c));
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -366,12 +370,12 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
res.setData(contractLogService.selectContractLogByCid(cid));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 合同流转状态下拉
|
|
|
*/
|
|
|
@RequestMapping(value = "/status", method = RequestMethod.GET)
|
|
|
- public Result status(){
|
|
|
+ public Result status() {
|
|
|
Result res = new Result();
|
|
|
res.setData(disposeStatus());
|
|
|
return res;
|
|
|
@@ -442,7 +446,7 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private Object disposeStatus() {
|
|
|
Map<String, String> status = new TreeMap<String, String>();
|
|
|
if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|