Browse Source

专利修改接口修改

anderx 4 years ago
parent
commit
1ffc054243

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

@@ -152,7 +152,6 @@ public class AdminPatentNewApiController extends CertifyApiController {
 	/**
 	 * 	Excel批量导入专利
      * 
-     * @param response
      * @return
      */
     @RequestMapping(value = "/import" , method = RequestMethod.POST)

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

@@ -91,8 +91,7 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		PatentNew pn=patentNewMapper.selectByPrimaryKey(p.getId());
 		StringBuffer str=new StringBuffer(a.getName());
 		if (!p.getApplyDate().equals(pn.getApplyDate()) 
-				|| p.getType() != pn.getType()
-				|| ! p.getTid().equals(pn.getTid())) {
+				|| p.getType() != pn.getType()) {
 			p.setYears(getyear(p));
 			p.setPatentAmount(sumAmout(p.getType(),p.getTid(),p.getYears()));
 			 if(p.getPatentAmount()==null) {
@@ -505,14 +504,12 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 			Calendar apply =Calendar.getInstance();
 			apply.setTime(trb.getApplyDate());
 			List<PatentPaymentDetails> list =new ArrayList<PatentPaymentDetails>();
-			
 			for (int i = 1; i < 21; i++) {
 				PatentPaymentDetails pd=new PatentPaymentDetails();
 				if ((trb.getType()==0||trb.getType()==2)&&i<11) {
 						addParam(trb, apply, i, pd);
 						list.add(pd);
 				}else if (trb.getType()==1) {
-					
 					addParam(trb, apply, i, pd);
 					list.add(pd);
 				}
@@ -522,7 +519,6 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 			return list;
 		}
 		return null;
-		
 	}
 
 	private void addParam(PatentNew trb, Calendar apply, int i, PatentPaymentDetails pd) {
@@ -546,13 +542,16 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		}
 		for (PatentYearPayment p : patentYear) {
 			if (type==p.getType()&&year==p.getYear()) {
-				TOrderTask t=tOrderTaskMapper.selectByPrimaryKey(tid);
-				if (t!=null&&t.getCostReduction()!=null&& t.getCostReduction()==1) {
-					return p.getReductionAmount();
-				}else {
+				if (tid==null){
 					return p.getPatentAmount();
+				}else{
+					TOrderTask t=tOrderTaskMapper.selectByPrimaryKey(tid);
+					if (t!=null&&t.getCostReduction()!=null&& t.getCostReduction()==1) {
+						return p.getReductionAmount();
+					}else {
+						return p.getPatentAmount();
+					}
 				}
-				
 			}
 		}
 		return null;