anderx vor 4 Jahren
Ursprung
Commit
3091489b22

+ 1 - 1
src/main/java/com/goafanti/common/dao/ThirdPartyCompanyMapper.java

@@ -80,5 +80,5 @@ public interface ThirdPartyCompanyMapper {
 	List<OutThirdPartyCompany> selectByTid(Integer tid);
 
 
-	ProjectTypePuls selectByTidPuls(Integer tid);
+	ProjectTypePuls selectByTidGetDtails(Integer tid);
 }

+ 4 - 3
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -1404,7 +1404,7 @@ date_format(e.create_time ,'%Y-%m-%d')creteTime
 	date_format(a.task_end_time,'%Y-%m-%d') as endDate,date_format(a.accept_time,'%Y-%m-%d') as acceptDate,h.name as depName,e.contact_mobile as contactMobile ,
 	date_format(a.review_time,'%Y-%m-%d') as reviewDate,date_format(a.publicity_time,'%Y-%m-%d') as publicityDate,a.outsource_price outsourcePrice,
 	date_format(a.licence_time,'%Y-%m-%d') as licenceDate,date_format(a.task_distribution_time,'%Y-%m-%d %H:%i:%S') as taskDate,e.legal_person as legalPerson,
-	e.legal_person_tel as legalPersonTel, a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,a.declaration_batch declarationBatch,
+	e.legal_person_tel as legalPersonTel, a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,a.declaration_batch declarationBatch,a.patent_type patentType, 
 	a.if_certification_fee ifCertificationFee , a.certification_corporate certificationCorporate ,a.certification_fee certificationFee ,a.time_record timeRecord,
 	a.cost_reduction costReduction,  a.official_cost officialCost,a.set_up_status setUpStatus ,date_format(a.set_up_time,'%Y-%m-%d') setUpTime ,a.high_tech_status highTechStatus ,
 	a.spot_check_status spotCheckStatus , a.special_comment specialComment ,ttm.certificates_count certificatesCount ,ttm.reject_count rejectCount ,a.check_status checkStatus, 
@@ -2073,9 +2073,10 @@ left join department de on x.department_id=de.id left join business_category bc
   </select>
   
   <select id="selectProjectCheck" resultType="com.goafanti.order.bo.OutProjectCheck">
-    select a.id,a.commodity_name commodityName ,b.order_no orderNo,b.contract_no contractNo,a.commodity_quantity  commodityQuantity,
+     select a.id,a.commodity_name commodityName ,b.order_no orderNo,b.contract_no contractNo,a.commodity_quantity  commodityQuantity,
     c.buyer_name userName ,e.cname  ,a.task_distribution_time  taskDistributionTime,f.name depName ,a.check_status checkStatus ,
-    a.main ,a.commodity_price commodityPrice ,a.task_comment taskComment 
+    a.main ,a.commodity_price commodityPrice ,a.task_comment taskComment ,a.official_cost officialCost,a.cost_reduction costReduction,
+    a.patent_type patentType 
     from t_order_task a left join t_order_new b on a.order_no =b.order_no
     left join t_order_mid c on a.order_no =c.order_no 
     left join business_project d on a.commodity_id =d.id 

+ 7 - 2
src/main/java/com/goafanti/common/mapper/ThirdPartyCompanyMapper.xml

@@ -527,13 +527,18 @@
 	from third_party_company a left join t_order_task b on a.tid=b.id  left join official_fee_price op on b.patent_type =op.patent_type  and a.patent_name_type =op.`type` 
  where tid= #{tid}
   </select>
-  <select id="selectByTidPuls" resultType="com.goafanti.organization.bo.ProjectTypePuls">
+<!--   <select id="selectByTidPuls" resultType="com.goafanti.organization.bo.ProjectTypePuls">
+ select a.id,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,b.patent_name_type projectType,
+ c.amount officialAmount,c.proportion85 from t_order_task a left join t_order_outsource b on a.id=b.tid
+left join official_fee_price c on a.patent_type =c.patent_type and b.patent_name_type =c.`type`  
+where a.id= #{tid}
+  </select> -->
+  <select id="selectByTidGetDtails" resultType="com.goafanti.organization.bo.ProjectTypePuls">
  select a.id,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,b.patent_name_type projectType,
  c.amount officialAmount,c.proportion85 from t_order_task a left join t_order_outsource b on a.id=b.tid
 left join official_fee_price c on a.patent_type =c.patent_type and b.patent_name_type =c.`type`  
 where a.id= #{tid}
   </select>
-  
    <select id="selectPaymentList" resultType="com.goafanti.organization.bo.outPaymentList">
 		    select a.id, c.contract_no contractNo,b.order_no orderNo,d.buyer_name userName, d.dep_name depName,f.party_amount costAmount,
 		a.choose_type chooseType,a.payment_amount paymentAmount,a.application_amount applicationAmount,a.tid,a.company_name companyName, 

+ 21 - 0
src/main/java/com/goafanti/order/bo/OutProjectCheck.java

@@ -17,6 +17,9 @@ public class OutProjectCheck {
 	private Integer main;
 	private BigDecimal commodityPrice; 
 	private String taskComment;
+	private Integer patentType;
+	private Integer officialCost;
+	private Integer costReduction;
 	public Integer getId() {
 		return id;
 	}
@@ -95,6 +98,24 @@ public class OutProjectCheck {
 	public void setTaskComment(String taskComment) {
 		this.taskComment = taskComment;
 	}
+	public Integer getPatentType() {
+		return patentType;
+	}
+	public void setPatentType(Integer patentType) {
+		this.patentType = patentType;
+	}
+	public Integer getOfficialCost() {
+		return officialCost;
+	}
+	public void setOfficialCost(Integer officialCost) {
+		this.officialCost = officialCost;
+	}
+	public Integer getCostReduction() {
+		return costReduction;
+	}
+	public void setCostReduction(Integer costReduction) {
+		this.costReduction = costReduction;
+	}
 	
 	
 	

+ 20 - 1
src/main/java/com/goafanti/order/bo/TOrderTaskDetailBo.java

@@ -2,6 +2,7 @@ package com.goafanti.order.bo;
 
 import java.math.BigDecimal;
 
+import com.goafanti.common.enums.OfficialPatentType;
 import com.goafanti.common.utils.StringUtils;
 
 public class TOrderTaskDetailBo {
@@ -114,6 +115,10 @@ public class TOrderTaskDetailBo {
 	
 	private Integer	checkStatus;
 	
+	private Integer patentType;
+	
+	@SuppressWarnings("unused")
+	private String patentTypeName;
 	
 	
 	public Integer getCertificatesCount() {
@@ -526,6 +531,20 @@ public class TOrderTaskDetailBo {
 	public void setCheckStatus(Integer checkStatus) {
 		this.checkStatus = checkStatus;
 	}
+	public Integer getPatentType() {
+		return patentType;
+	}
+	public void setPatentType(Integer patentType) {
+		this.patentType = patentType;
+	}
 	
-	
+	public String getPatentTypeName() {
+		if (getPatentType()!=null) {
+			return OfficialPatentType.getValueByCode(getPatentType());
+		}
+		return "";
+	}
+	public void setPatentTypeName(String patentTypeName) {
+		this.patentTypeName = patentTypeName;
+	}
 }

+ 2 - 2
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -1332,11 +1332,11 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			if (tm!=null&&tm.getCostAmount()!=null)oCount=oCount.add(tm.getCostAmount()==null?new BigDecimal(0):tm.getCostAmount());
 		}
 		//订单成本计算
-		ProjectTypePuls op= thirdPartyCompanyMapper.selectByTidPuls( tid);
+		ProjectTypePuls op= thirdPartyCompanyMapper.selectByTidGetDtails( tid);
 		if (op.getOfficialCost()==1) {
 			BigDecimal mCount=new BigDecimal(0);
 			if (op.getCostReduction()==0) {
-				mCount=op.getAmount().multiply(new BigDecimal(op.getQuantity()));
+				mCount=op.getOfficialAmount().multiply(new BigDecimal(op.getQuantity()));
 			}else {
 				mCount=op.getProportion85().multiply(new BigDecimal(op.getQuantity()));
 			}

+ 9 - 7
src/main/java/com/goafanti/organization/bo/ProjectTypePuls.java

@@ -7,12 +7,13 @@ public class ProjectTypePuls {
 	private Integer id;
 	private Integer patentType;
 	private Integer projectType;
-	private BigDecimal amount;
+	private BigDecimal officialAmount;
 	private BigDecimal proportion85;
 	private Integer costReduction;
 	private Integer quantity;
 	private Integer officialCost;
 	
+	
 
 	
 	public Integer getId() {
@@ -33,12 +34,7 @@ public class ProjectTypePuls {
 	public void setProjectType(Integer projectType) {
 		this.projectType = projectType;
 	}
-	public BigDecimal getAmount() {
-		return amount;
-	}
-	public void setAmount(BigDecimal amount) {
-		this.amount = amount;
-	}
+
 	public BigDecimal getProportion85() {
 		return proportion85;
 	}
@@ -63,6 +59,12 @@ public class ProjectTypePuls {
 	public void setQuantity(Integer quantity) {
 		this.quantity = quantity;
 	}
+	public BigDecimal getOfficialAmount() {
+		return officialAmount;
+	}
+	public void setOfficialAmount(BigDecimal officialAmount) {
+		this.officialAmount = officialAmount;
+	}
 	
 	
 

+ 23 - 23
src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java

@@ -53,7 +53,6 @@ import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.order.bo.OrderOutsourceDtails;
 import com.goafanti.order.bo.TOrderTaskDetailBo;
 import com.goafanti.order.enums.NewOrderDunType;
 import com.goafanti.order.enums.NewProjectStatus;
@@ -297,7 +296,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 		outOrderPayment op=tOrderPaymentMapper.selectByidGetDetails(id);
 		op.setChooseType(type);
 		ThirdPartyCompany tpc=thirdPartyCompanyMapper.selectByPrimaryKey(tp.getTpcId());
-		if(!op.getCompanyName().equals(tpc.getCompanyName()))op.setCompanyName(op.getCompanyName()+"("+tpc.getCompanyName()+")");
+		if(tp.getChooseType()!=2&&!op.getCompanyName().equals(tpc.getCompanyName()))op.setCompanyName(op.getCompanyName()+"("+tpc.getCompanyName()+")");
 		if (type==0) {//支付种类 0第三方 1催款 2官费
 			op.setInitialQuantity(tpc.getQuantity());
 			op.setInitialTotalAmount(tpc.getTotalAmount().toString());
@@ -419,22 +418,22 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 	@Override
 	public List<outOrderPayment> selectOrderPayment(Integer id) {
 		List<outOrderPayment> list=tOrderPaymentMapper.selectByTid(id,null);
-		if (!TokenManager.hasRole(AFTConstants.FINANCE)&&
-				!TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)&&
-				!TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)&&
-				!TokenManager.hasRole(AFTConstants.OUTSOURCE_AUDITOR)) {
-			outProjectBo op =null;
-			if(!list.isEmpty()) op=tOrderOutsourceMapper.selectByTid(id);
-			if (op!=null &&op.getStartType()!=null&&op.getStartType()==1) {
-				if((op.getProjectType()==1&&op.getPatentType()==0)||(op.getProjectType()==2)) {
-					for (outOrderPayment oc : list) {
-						if (oc.getChooseType()!=2) {
-							oc.setApplicationAmount("***");
-						}
-					}
-				}
-			}
-		}
+//		if (!TokenManager.hasRole(AFTConstants.FINANCE)&&
+//				!TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)&&
+//				!TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)&&
+//				!TokenManager.hasRole(AFTConstants.OUTSOURCE_AUDITOR)) {
+//			outProjectBo op =null;
+//			if(!list.isEmpty()) op=tOrderOutsourceMapper.selectByTid(id);
+//			if (op!=null &&op.getStartType()!=null&&op.getStartType()==1) {
+//				if((op.getProjectType()==1&&op.getPatentType()==0)||(op.getProjectType()==2)) {
+//					for (outOrderPayment oc : list) {
+//						if (oc.getChooseType()!=2) {
+//							oc.setApplicationAmount("***");
+//						}
+//					}
+//				}
+//			}
+//		}
 		return list;
 	}
 
@@ -485,6 +484,8 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 
 	@Override
 	public int checkPayment(TOrderPayment p) {
+		//没有填写申请金额的情况下计算金额
+				checkGetAmount(p);
 		if (p.getChooseType()==2) {
 			TOrderTask tot=tOrderTaskMapper.selectByPrimaryKey(p.getTid());
 			List<outOrderPayment> list2=tOrderPaymentMapper.selectByTid(p.getTid(),p.getChooseType());
@@ -496,8 +497,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 				return -2;
 			}
 		}
-		//没有填写申请金额的情况下计算金额
-		checkGetAmount(p);
+		
 		BigDecimal total=new BigDecimal(0);
 		BigDecimal a=p.getApplicationAmount()==null?new BigDecimal(0):p.getApplicationAmount();
 		List<outOrderPayment> list=new ArrayList<>();
@@ -883,11 +883,11 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 				PaymentNode pn=paymentNodeMapper.selectByPrimaryKey(p.getNodeId());
 				count=pn.getUnitPrice().multiply(new BigDecimal(p.getQuantity()));
 			}else if (p.getChooseType()==2) {
-				ProjectTypePuls ot=thirdPartyCompanyMapper.selectByTidPuls(p.getTid());
+				ProjectTypePuls ot=thirdPartyCompanyMapper.selectByTidGetDtails(p.getTid());
 				if (ot.getCostReduction()==0) {
-					count=ot.getAmount().multiply(new BigDecimal(ot.getQuantity()));
+					count=ot.getOfficialAmount().multiply(new BigDecimal(p.getQuantity()));
 				}else {
-					count=ot.getProportion85().multiply(new BigDecimal(ot.getQuantity()));
+					count=ot.getProportion85().multiply(new BigDecimal(p.getQuantity()));
 				}
 			}
 			p.setApplicationAmount(count);