Browse Source

变更修改第三方处理付款截点金额

anderx 3 years ago
parent
commit
0e5dc0dd67

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

@@ -87,4 +87,5 @@ public interface PaymentNodeMapper {
 
 	void deleteByParam(@Param("tpcId")Integer tpcId, @Param("tid")Integer tid);
 
-}
+    void updateByCid(PaymentNode paymentNode);
+}

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

@@ -82,4 +82,5 @@ public interface ThirdPartyCompanyMapper {
 
 	void deleteByTid(Integer id);
 
-}
+
+}

+ 70 - 20
src/main/java/com/goafanti/common/mapper/PaymentNodeMapper.xml

@@ -98,7 +98,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Tue Jul 07 13:58:53 CST 2020.
     -->
-    id, tid, cid, company_name, project_type, dun_type, unit_price, quantity, total_amount, 
+    id, tid, cid, company_name, project_type, dun_type, unit_price, quantity, total_amount,
     party_amount, party_time, create_time, dun_status, effective_count, start_time, status
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.PaymentNodeExample" resultMap="BaseResultMap">
@@ -126,7 +126,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Tue Jul 07 13:58:53 CST 2020.
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     from payment_node
     where id = #{id,jdbcType=INTEGER}
@@ -157,17 +157,17 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Tue Jul 07 13:58:53 CST 2020.
     -->
-    insert into payment_node (id, tid, cid, 
-      company_name, project_type, dun_type, 
-      unit_price, quantity, total_amount, 
-      party_amount, party_time, create_time, 
-      dun_status, effective_count, start_time, 
+    insert into payment_node (id, tid, cid,
+      company_name, project_type, dun_type,
+      unit_price, quantity, total_amount,
+      party_amount, party_time, create_time,
+      dun_status, effective_count, start_time,
       status)
-    values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER}, 
-      #{companyName,jdbcType=VARCHAR}, #{projectType,jdbcType=INTEGER}, #{dunType,jdbcType=INTEGER}, 
-      #{unitPrice,jdbcType=DECIMAL}, #{quantity,jdbcType=INTEGER}, #{totalAmount,jdbcType=DECIMAL}, 
-      #{partyAmount,jdbcType=DECIMAL}, #{partyTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{dunStatus,jdbcType=INTEGER}, #{effectiveCount,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP}, 
+    values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER},
+      #{companyName,jdbcType=VARCHAR}, #{projectType,jdbcType=INTEGER}, #{dunType,jdbcType=INTEGER},
+      #{unitPrice,jdbcType=DECIMAL}, #{quantity,jdbcType=INTEGER}, #{totalAmount,jdbcType=DECIMAL},
+      #{partyAmount,jdbcType=DECIMAL}, #{partyTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
+      #{dunStatus,jdbcType=INTEGER}, #{effectiveCount,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP},
       #{status,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.PaymentNode">
@@ -457,8 +457,9 @@
       status = #{status,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
-  
-  <select id="selectByTid" resultType="com.goafanti.organization.bo.OutPaymentNode">
+
+
+    <select id="selectByTid" resultType="com.goafanti.organization.bo.OutPaymentNode">
   select id,tid,cid,company_name companyName,unit_price unitPrice,quantity,total_amount totalAmount,create_time createTime,status,
    party_amount partyAmount, date_format(party_time,'%Y-%m-%d')partyTimes,project_type projectType,dun_type dunType
    from payment_node where tid= #{tid}
@@ -471,7 +472,7 @@
    party_amount partyAmount,party_time partyTime, date_format(party_time,'%Y-%m-%d')partyTimes,project_type projectType,dun_type dunType
    from payment_node where dun_status = #{status}
   </select>
-  
+
   <select id="selectBytidGetEmail" resultType="com.goafanti.common.bo.paymentNodeEmailBo">
     select a.tid,b.order_no orderNo,o.contract_no contractNo ,c.salesman_id salesmanId, c.salesman_name salesmanName,
            c.buyer_name userName,d.email
@@ -479,7 +480,7 @@
     left join t_order_mid c on b.order_no=c.order_no left join admin d on  c.salesman_id=d.id
     where a.tid= #{tid} limit 1
   </select>
-  
+
    <select id="selectByTidAndCid" resultType="com.goafanti.organization.bo.OutPaymentNode">
     select id,tid,cid,company_name companyName,unit_price unitPrice,quantity,total_amount totalAmount,create_time createTime,
    party_amount partyAmount, date_format(party_time,'%Y-%m-%d')partyTimes,project_type projectType,dun_type dunType
@@ -490,7 +491,7 @@
    <if test="cid !=null">
    and cid = #{cid}
    </if>
-  </select> 
+  </select>
   <select id="selectByCid" resultType="java.lang.Integer">
   select count(*) from payment_node where cid= #{tpcId}
   </select>
@@ -502,7 +503,56 @@
     </if>
     <if test="tid !=null">
     and tid= #{tid}
-    </if> 
+    </if>
   </delete>
-  
-</mapper>
+
+  <update id="updateByCid">
+    update payment_node
+    <set>
+      <if test="tid != null">
+        tid = #{tid,jdbcType=INTEGER},
+      </if>
+      <if test="companyName != null">
+        company_name = #{companyName,jdbcType=VARCHAR},
+      </if>
+      <if test="projectType != null">
+        project_type = #{projectType,jdbcType=INTEGER},
+      </if>
+      <if test="dunType != null">
+        dun_type = #{dunType,jdbcType=INTEGER},
+      </if>
+      <if test="unitPrice != null">
+        unit_price = #{unitPrice,jdbcType=DECIMAL},
+      </if>
+      <if test="quantity != null">
+        quantity = #{quantity,jdbcType=INTEGER},
+      </if>
+      <if test="totalAmount != null">
+        total_amount = #{totalAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="partyAmount != null">
+        party_amount = #{partyAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="partyTime != null">
+        party_time = #{partyTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="dunStatus != null">
+        dun_status = #{dunStatus,jdbcType=INTEGER},
+      </if>
+      <if test="effectiveCount != null">
+        effective_count = #{effectiveCount,jdbcType=INTEGER},
+      </if>
+      <if test="startTime != null">
+        start_time = #{startTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="status != null">
+        status = #{status,jdbcType=INTEGER},
+      </if>
+    </set>
+    where cid = #{cid,jdbcType=INTEGER}
+  </update>
+
+</mapper>

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

@@ -520,7 +520,8 @@
       patent_type = #{patentType,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
-  <select id="selectByTid" resultType="com.goafanti.organization.bo.OutThirdPartyCompany">
+
+    <select id="selectByTid" resultType="com.goafanti.organization.bo.OutThirdPartyCompany">
 	 select a.id,a.tid,a.company_name companyName,a.unit_price unitPrice,a.quantity,a.total_amount totalAmount,a.material,a.urgent,
 	a.patent_name_type patentNameType,a.audit,a.assets,a.income,a.remarks,a.cid,b.cost_reduction costReduction,b.official_cost officialCost,
 	a.type,a.party_amount partyAmount ,op.amount officialUnitPrice,op.proportion85 reductionAmount,a.start_type startType,a.patent_type patentType

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

@@ -163,6 +163,14 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 			}
 			t.setTotalAmount(t.getUnitPrice().multiply(new BigDecimal(t.getQuantity())));
 		}
+		ThirdPartyCompany use = thirdPartyCompanyMapper.selectByPrimaryKey(t.getId());
+		if (!use.getUnitPrice().equals(t.getUnitPrice())){
+			PaymentNode paymentNode = new PaymentNode();
+			paymentNode.setCid(t.getId());
+			paymentNode.setUnitPrice(t.getUnitPrice());
+			paymentNodeMapper.updateByCid(paymentNode);
+		}
+
 		thirdPartyCompanyMapper.updateByPrimaryKeySelective(t);
 		return 1;
 	}

+ 5 - 5
src/main/resources/props/config_local.properties

@@ -1,12 +1,12 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
-jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-jdbc.username=root
-jdbc.password=123456
-#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.username=root
-#jdbc.password=aftdev
+#jdbc.password=123456
+jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.username=root
+jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20