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

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

anderx лет назад: 3
Родитель
Сommit
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 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);
 	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 is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Tue Jul 07 13:58:53 CST 2020.
       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
     party_amount, party_time, create_time, dun_status, effective_count, start_time, status
   </sql>
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.PaymentNodeExample" resultMap="BaseResultMap">
   <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 is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Tue Jul 07 13:58:53 CST 2020.
       This element was generated on Tue Jul 07 13:58:53 CST 2020.
     -->
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     from payment_node
     from payment_node
     where id = #{id,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
@@ -157,17 +157,17 @@
       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 Jul 07 13:58:53 CST 2020.
       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)
       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})
       #{status,jdbcType=INTEGER})
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.PaymentNode">
   <insert id="insertSelective" parameterType="com.goafanti.common.model.PaymentNode">
@@ -457,8 +457,9 @@
       status = #{status,jdbcType=INTEGER}
       status = #{status,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
   </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,
   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
    party_amount partyAmount, date_format(party_time,'%Y-%m-%d')partyTimes,project_type projectType,dun_type dunType
    from payment_node where tid= #{tid}
    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
    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}
    from payment_node where dun_status = #{status}
   </select>
   </select>
-  
+
   <select id="selectBytidGetEmail" resultType="com.goafanti.common.bo.paymentNodeEmailBo">
   <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,
     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
            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
     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
     where a.tid= #{tid} limit 1
   </select>
   </select>
-  
+
    <select id="selectByTidAndCid" resultType="com.goafanti.organization.bo.OutPaymentNode">
    <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,
     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
    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">
    <if test="cid !=null">
    and cid = #{cid}
    and cid = #{cid}
    </if>
    </if>
-  </select> 
+  </select>
   <select id="selectByCid" resultType="java.lang.Integer">
   <select id="selectByCid" resultType="java.lang.Integer">
   select count(*) from payment_node where cid= #{tpcId}
   select count(*) from payment_node where cid= #{tpcId}
   </select>
   </select>
@@ -502,7 +503,56 @@
     </if>
     </if>
     <if test="tid !=null">
     <if test="tid !=null">
     and tid= #{tid}
     and tid= #{tid}
-    </if> 
+    </if>
   </delete>
   </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}
       patent_type = #{patentType,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
   </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,
 	 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.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
 	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())));
 			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);
 		thirdPartyCompanyMapper.updateByPrimaryKeySelective(t);
 		return 1;
 		return 1;
 	}
 	}

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

@@ -1,12 +1,12 @@
 dev.name=local
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 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.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.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.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.initialSize=3
 jdbc.maxActive=20
 jdbc.maxActive=20