Przeglądaj źródła

Merge branch 'test' of jishutao/kede-server into prod

gitadmin 4 lat temu
rodzic
commit
95a97d4913

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

@@ -81,6 +81,9 @@ public interface ThirdPartyCompanyMapper {
 
 
 	ProjectTypePuls selectByTidGetDtails(Integer tid);
+	
 
 	void deleteByTid(Integer id);
+
+	List<ProjectTypePuls>  selectByTidGetListDtails(Integer tid);
 }

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

@@ -533,7 +533,15 @@
 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 id="selectByTidGetListDtails" 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 x  left join t_order_task a  on x.order_no =a.order_no 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 x.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`  

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

@@ -1345,13 +1345,16 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		}
 		//订单成本计算
 		if (type==1) {
-			ProjectTypePuls op= thirdPartyCompanyMapper.selectByTidGetDtails(tid);
-			if (op.getOfficialCost()==1) {
-				BigDecimal mCount=op.getOfficialAmount().multiply(new BigDecimal(op.getQuantity()));
-				if (op.getCostReduction()==1) {
-					mCount=op.getProportion85().multiply(new BigDecimal(op.getQuantity()));
+			List<ProjectTypePuls> list2=thirdPartyCompanyMapper.selectByTidGetListDtails(tid);
+			for (ProjectTypePuls op : list2) {
+				if (op.getOfficialCost()==1) {
+					BigDecimal mCount=op.getOfficialAmount().multiply(new BigDecimal(op.getQuantity()));
+					if (op.getCostReduction()==1) {
+						mCount=op.getProportion85().multiply(new BigDecimal(op.getQuantity()));
+					}
+					oCount=oCount.add(mCount);
 				}
-				oCount=oCount.add(mCount);
+				
 			}
 		}
 		tOrderMidMapper.updateCostAmount(tid,oCount,null);