Antiloveg 8 years ago
parent
commit
c84cc0802f

+ 6 - 7
src/main/java/com/goafanti/admin/controller/AdminContractApiController.java

@@ -73,16 +73,16 @@ public class AdminContractApiController extends CertifyApiController {
 			return res;
 		}
 		if (!c.getCognizanceStatus().equals(ContractBusinessStatus.UNCREATE.getCode())) {
-			res.getError().add(buildError(ErrorConstants.CONTRACT_COPYRIGHT_CREATED, "", "当前合同高企认定申请已创建,无法重复创建!"));
+			res.getError().add(buildError(ErrorConstants.CONTRACT_COGNIZANCE_CREATED, "", "当前合同高企认定申请已创建,无法重复创建!"));
 			return res;
 		}
 
-		if (null == c.getCognizanceYear()) {
+		if (null == c.getCognizanceYear() || c.getCognizanceYear().equals(0)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到高企认定申请年份", "高企认定申请年份"));
 			return res;
 		}
 
-		if (null != c.getCognizanceYear()) {
+		if (null != c.getCognizanceYear() && !c.getCognizanceYear().equals(0)) {
 			if (!disposeCog(c.getCognizanceYear(), c.getUid(), res).getError().isEmpty()) {
 				return res;
 			}
@@ -108,7 +108,7 @@ public class AdminContractApiController extends CertifyApiController {
 			return res;
 		}
 		if (!c.getTechProjectStatus().equals(ContractBusinessStatus.UNCREATE.getCode())) {
-			res.getError().add(buildError(ErrorConstants.CONTRACT_COPYRIGHT_CREATED, "", "当前合同科技项目申请已创建,无法重复创建!"));
+			res.getError().add(buildError(ErrorConstants.CONTRACT_TECHPROJECT_CREATED, "", "当前合同科技项目申请已创建,无法重复创建!"));
 			return res;
 		}
 
@@ -163,7 +163,6 @@ public class AdminContractApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "合同ID"));
 			return res;
 		}
-
 		if (!c.getPatentStatus().equals(ContractBusinessStatus.UNCREATE.getCode())) {
 			res.getError().add(buildError(ErrorConstants.CONTRACT_PATENT_CREATED, "", "当前合同专利申请已创建,无法重复创建!"));
 			return res;
@@ -284,7 +283,7 @@ public class AdminContractApiController extends CertifyApiController {
 			return res;
 		}
 
-		if (null != contract.getCognizanceYear()) {
+		if (null != contract.getCognizanceYear() && !contract.getCognizanceYear().equals(0)) {
 			if (!disposeCog(contract.getCognizanceYear(), contract.getUid(), res).getError().isEmpty()) {
 				return res;
 			}
@@ -327,7 +326,7 @@ public class AdminContractApiController extends CertifyApiController {
 			return res;
 		}
 
-		if (null != ic.getCognizanceYear()) {
+		if (null != ic.getCognizanceYear() && !ic.getCognizanceYear().equals(0)) {
 			if (!disposeCog(ic.getCognizanceYear(), ic.getUid(), res).getError().isEmpty()) {
 				return res;
 			}

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

@@ -498,7 +498,7 @@
 			tp.tech_field as techField, a.name as principle
 		from tech_project tp 
 		left join admin a on a.id = tp.principal
-		where tp.contract_id = #{contractId,jdbcType=VARCHAR}
+		where tp.contract_id = #{contractId,jdbcType=VARCHAR} 
 	</select>
 	
   <insert id="batchInsert" parameterType="com.goafanti.common.model.TechProject">

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

@@ -223,7 +223,7 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 
 	@Override
 	public void batchInsertContractRecord(Contract contract) {
-		contract.setPatentStatus(ContractBusinessStatus.CREATE.getCode());
+		contract.setTechProjectStatus(ContractBusinessStatus.CREATE.getCode());
 		contractMapper.updateByPrimaryKeySelective(contract);
 		
 		List<TechProject> tp = new ArrayList<>();