Просмотр исходного кода

主项目本次派单关于新增、修改及变更等多接口修改

anderx лет назад: 3
Родитель
Сommit
8ca4e5a68f

+ 14 - 14
src/main/java/com/goafanti/common/mapper/FinancialPaymentMapper.xml

@@ -114,7 +114,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Tue Jun 16 16:45:09 CST 2020.
       This element was generated on Tue Jun 16 16:45:09 CST 2020.
     -->
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     from financial_payment
     from financial_payment
     where id = #{id,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
@@ -145,9 +145,9 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Tue Jun 16 16:45:09 CST 2020.
       This element was generated on Tue Jun 16 16:45:09 CST 2020.
     -->
     -->
-    insert into financial_payment (id, pid, party_amount, 
+    insert into financial_payment (id, pid, party_amount,
       payment_time, create_time)
       payment_time, create_time)
-    values (#{id,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, #{partyAmount,jdbcType=DECIMAL}, 
+    values (#{id,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, #{partyAmount,jdbcType=DECIMAL},
       #{paymentTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP})
       #{paymentTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP})
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.FinancialPayment">
   <insert id="insertSelective" parameterType="com.goafanti.common.model.FinancialPayment">
@@ -192,8 +192,8 @@
       </if>
       </if>
     </trim>
     </trim>
   </insert>
   </insert>
-  
-  
+
+
   <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.FinancialPayment" useGeneratedKeys="true">
   <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.FinancialPayment" useGeneratedKeys="true">
     insert into financial_payment
     insert into financial_payment
     <trim prefix="(" suffix=")" suffixOverrides=",">
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -326,22 +326,22 @@
     where id = #{id,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
   </update>
   <select id="selectByPid" resultType="com.goafanti.organization.bo.outFinancialPayment">
   <select id="selectByPid" resultType="com.goafanti.organization.bo.outFinancialPayment">
-  select id,pid,party_amount partyAmount,date_format(payment_time,'%Y-%m-%d') paymentTimes 
+  select id,pid,party_amount partyAmount,date_format(payment_time,'%Y-%m-%d') paymentTimes
   from financial_payment where pid= #{id}
   from financial_payment where pid= #{id}
   </select>
   </select>
   <select id="selectBypidGetNotice" resultType="com.goafanti.organization.bo.NoticeInformationBo">
   <select id="selectBypidGetNotice" resultType="com.goafanti.organization.bo.NoticeInformationBo">
 	select b.id pid,d.order_no orderNo,d.salesman_id salesmanId,d.salesman_name salesmanName , d.buyer_name buyerName,
 	select b.id pid,d.order_no orderNo,d.salesman_id salesmanId,d.salesman_name salesmanName , d.buyer_name buyerName,
 	d.finance_id financeId,d.finance_name financeName,ta.name techName ,sa.email salesmanEmail,fa.email financeEmail,
 	d.finance_id financeId,d.finance_name financeName,ta.name techName ,sa.email salesmanEmail,fa.email financeEmail,
-	ta.email techEmail,ta.id techId	from  t_order_payment b left join t_order_task c on b.tid=c.id 
-	left join t_order_mid d on c.order_no=d.order_no left join admin sa on d.salesman_id=sa.id 
+	ta.email techEmail,ta.id techId	from  t_order_payment b left join t_order_task c on b.tid=c.id
+	left join t_order_mid d on c.order_no=d.order_no left join admin sa on d.salesman_id=sa.id
 	left join admin fa on d.finance_id=fa.id left join admin ta on c.task_receiver=ta.id
 	left join admin fa on d.finance_id=fa.id left join admin ta on c.task_receiver=ta.id
 	where b.id= #{pid}
 	where b.id= #{pid}
   </select>
   </select>
-  
+
   <select id="updateOrderCost">
   <select id="updateOrderCost">
-  update t_order_mid x ,(select a.id,a.tid,b.order_no from t_order_payment a left join t_order_task b on a.tid=b.id 
-	where a.id=#{pid})y,t_task_mid z set x.payment_amount= x.payment_amount+ #{partyAmount}, z.party_amount=z.party_amount+ #{partyAmount}
-  where x.order_no=y.order_no and y.tid=z.tid
+  update  t_order_payment a,t_task_mid z
+  set  z.party_amount=z.party_amount+ #{partyAmount}
+  where a.id=#{pid} and a.tid=z.tid
   </select>
   </select>
-  
-</mapper>
+
+</mapper>

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

@@ -474,6 +474,21 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 				tpc.setPartyAmount(tpc.getPartyAmount().add(p.getPaymentAmount()));
 				tpc.setPartyAmount(tpc.getPartyAmount().add(p.getPaymentAmount()));
 				thirdPartyCompanyMapper.updateByPrimaryKeySelective(tpc);
 				thirdPartyCompanyMapper.updateByPrimaryKeySelective(tpc);
 			}
 			}
+			//计算成本
+			ProjectTypePuls projectTypePuls = tOrderTaskMapper.selectByTidGetDtails(tp.getTid());
+			TOrderMid in=new TOrderMid();
+			in.setOrderNo(projectTypePuls.getOrderNo());
+			in.setPaymentAmount(p.getPaymentAmount());
+			if (projectTypePuls.getType()== ProjectType.ZL.getCode()){
+				in.setPatentCostActual(p.getPaymentAmount());
+			}else if (projectTypePuls.getType()== ProjectType.RZ.getCode()){
+				in.setSoftCostActual(p.getPaymentAmount());
+			}else if (projectTypePuls.getType()== ProjectType.SJ.getCode()){
+				in.setAuditCostActual(p.getPaymentAmount());
+			}else {
+				in.setOtherCostActual(p.getPaymentAmount());
+			}
+			tOrderMidMapper.updateAddCostAmount(in);
 			financialPaymentMapper.updateOrderCost(p.getId(),p.getPaymentAmount());
 			financialPaymentMapper.updateOrderCost(p.getId(),p.getPaymentAmount());
 	}
 	}