anderx пре 4 година
родитељ
комит
daf9754974

+ 4 - 0
src/main/java/com/goafanti/patent/controller/AdminPatentNewApiController.java

@@ -76,6 +76,10 @@ public class AdminPatentNewApiController extends CertifyApiController {
 			p.setApplyDate(DateUtils.StringToDate(p.getApplyDates(),AFTConstants.YYYYMMDD));
 			p.setAuthorizationDate(DateUtils.StringToDate(p.getAuthorizationDates(),AFTConstants.YYYYMMDD));
 		}
+		if (p.getTid()!=null&&patentNewService.checkTid(p.getTid())) {
+			StringBuffer str=new StringBuffer("项目").append("[").append(p.getTid()).append("]"); 
+			res.getError().add(buildError(ErrorConstants.DATA_EMPTY_ERROR, str.toString(), str.toString()));
+		}
 		return res.data(patentNewService.updatePatenNew(p));
 	}
 	/**

+ 2 - 0
src/main/java/com/goafanti/patent/service/PatentNewService.java

@@ -44,5 +44,7 @@ public interface PatentNewService {
 
 	void pushResetPatentNew(List<String> list);
 
+	boolean checkTid(Integer tid);
+
 
 }

+ 9 - 0
src/main/java/com/goafanti/patent/service/impl/PatentNewServiceImpl.java

@@ -485,4 +485,13 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 			patentNewMapper.updateByPrimaryKeySelective(n);
 		}
 	}
+
+	@Override
+	public boolean checkTid(Integer tid) {
+		TOrderTask task=tOrderTaskMapper.selectByPrimaryKey(tid);
+		if (task==null) {
+			return true;
+		}
+		return false;
+	}
 }