ソースを参照

update

Signed-off-by: anderx <312518615@qq.com>
anderx 5 年 前
コミット
189d14088f

+ 2 - 2
src/main/java/com/goafanti/common/constant/ErrorConstants.java

@@ -9,6 +9,8 @@ public class ErrorConstants {
 	public static final String	VCODE_ERROR							= "VCODE_ERROR";
 	
 	public static final String	NO_AUTH_ERROR						= "NO_AUTH_ERROR";
+	/** 当前*没有数据*/
+	public static final String	DATA_EMPTY_ERROR					= "DATA_EMPTY_ERROR";
 	/** 0参数错误 */
 	public static final String	PARAM_ERROR							= "PARAM_ERROR";
 	/** 0必须为数字*/
@@ -34,8 +36,6 @@ public class ErrorConstants {
 
 	public static final String	DUNPLICATE_KAY_ERROR				= "DUNPLICATE_KAY_ERROR";
 
-	public static final String	DATA_EMPTY_ERROR					= "DATA_EMPTY_ERROR";
-
 	public static final String	PWD_NOT_MATCH_ERROR					= "PWD_NOT_MATCH_ERROR";
 
 	public static final String	PWD_SAME_ERROR						= "PWD_SAME_ERROR";

+ 92 - 90
src/main/java/com/goafanti/common/dao/TOrderMidMapper.java

@@ -1,91 +1,93 @@
-package com.goafanti.common.dao;
-
-import com.goafanti.common.model.TOrderMid;
-import com.goafanti.common.model.TOrderMidExample;
-
-import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
-
-public interface TOrderMidMapper {
-    /**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
-	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
-	 */
-	long countByExample(TOrderMidExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
-	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
-	 */
-	int deleteByExample(TOrderMidExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
-	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
-	 */
-	int deleteByPrimaryKey(Integer id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
-	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
-	 */
-	int insert(TOrderMid record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
-	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
-	 */
-	int insertSelective(TOrderMid record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
-	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
-	 */
-	List<TOrderMid> selectByExample(TOrderMidExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
-	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
-	 */
-	TOrderMid selectByPrimaryKey(Integer id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
-	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
-	 */
-	int updateByExampleSelective(@Param("record") TOrderMid record, @Param("example") TOrderMidExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
-	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
-	 */
-	int updateByExample(@Param("record") TOrderMid record, @Param("example") TOrderMidExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
-	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
-	 */
-	int updateByPrimaryKeySelective(TOrderMid record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
-	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
-	 */
-	int updateByPrimaryKey(TOrderMid record);
-
-	TOrderMid selectByOrderNo(String orderNo);
-
-	void updateSalesmanId(@Param("aid")String aid, @Param("transferId")String transferId);
-
-	void updateFinanceId(@Param("id")String id, @Param("financeId")String financeId);
-
-	void updatefinalReceivables(@Param("orderNo")String orderNo,@Param("amount")BigDecimal amount, @Param("receivablesTime")Date receivablesTime);
-
-	void updateInvoice(String orderNo);
-
-	void addOrderReceivables(@Param("orderNo")String orderNo, @Param("money")BigDecimal money);
-
-	String selectDepNameByDepid(String orderDep);
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.TOrderMid;
+import com.goafanti.common.model.TOrderMidExample;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface TOrderMidMapper {
+    /**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
+	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
+	 */
+	long countByExample(TOrderMidExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
+	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
+	 */
+	int deleteByExample(TOrderMidExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
+	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
+	 */
+	int deleteByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
+	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
+	 */
+	int insert(TOrderMid record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
+	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
+	 */
+	int insertSelective(TOrderMid record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
+	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
+	 */
+	List<TOrderMid> selectByExample(TOrderMidExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
+	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
+	 */
+	TOrderMid selectByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
+	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
+	 */
+	int updateByExampleSelective(@Param("record") TOrderMid record, @Param("example") TOrderMidExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
+	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
+	 */
+	int updateByExample(@Param("record") TOrderMid record, @Param("example") TOrderMidExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
+	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
+	 */
+	int updateByPrimaryKeySelective(TOrderMid record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_mid
+	 * @mbg.generated  Mon Jul 06 11:48:54 CST 2020
+	 */
+	int updateByPrimaryKey(TOrderMid record);
+
+	TOrderMid selectByOrderNo(String orderNo);
+
+	void updateSalesmanId(@Param("aid")String aid, @Param("transferId")String transferId);
+
+	void updateFinanceId(@Param("id")String id, @Param("financeId")String financeId);
+
+	void updatefinalReceivables(@Param("orderNo")String orderNo,@Param("amount")BigDecimal amount, @Param("receivablesTime")Date receivablesTime);
+
+	void updateInvoice(String orderNo);
+
+	void addOrderReceivables(@Param("orderNo")String orderNo, @Param("money")BigDecimal money);
+
+	String selectDepNameByDepid(String orderDep);
+
+	void updateCostAmount(@Param("tid")Integer tid, @Param("count")BigDecimal count);
 }

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

@@ -81,7 +81,7 @@ public interface TOrderPaymentMapper {
 
 	List<outOrderPayment> selectByTid(Integer id);
 
-	List<outOrderPayment> selectList(@Param("tpcId")Integer tpcId, @Param("nodeId")Integer nodeId);
+	List<outOrderPayment> selectList(@Param("tpcId")Integer tpcId, @Param("nodeId")Integer nodeId, @Param("chooseType")Integer chooseType);
 
 	void updateByids(List<Integer> list);
 }

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

@@ -11,68 +11,68 @@ public interface ThirdPartyCompanyMapper {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	long countByExample(ThirdPartyCompanyExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	int deleteByExample(ThirdPartyCompanyExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	int deleteByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	int insert(ThirdPartyCompany record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	int insertSelective(ThirdPartyCompany record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	List<ThirdPartyCompany> selectByExample(ThirdPartyCompanyExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	ThirdPartyCompany selectByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	int updateByExampleSelective(@Param("record") ThirdPartyCompany record,
 			@Param("example") ThirdPartyCompanyExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	int updateByExample(@Param("record") ThirdPartyCompany record, @Param("example") ThirdPartyCompanyExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	int updateByPrimaryKeySelective(ThirdPartyCompany record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	int updateByPrimaryKey(ThirdPartyCompany record);
 

+ 482 - 476
src/main/java/com/goafanti/common/mapper/TOrderMidMapper.xml

@@ -1,477 +1,483 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.goafanti.common.dao.TOrderMidMapper">
-  <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderMid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
-    <result column="salesman_id" jdbcType="VARCHAR" property="salesmanId" />
-    <result column="finance_id" jdbcType="VARCHAR" property="financeId" />
-    <result column="salesman_name" jdbcType="VARCHAR" property="salesmanName" />
-    <result column="finance_name" jdbcType="VARCHAR" property="financeName" />
-    <result column="final_receivables" jdbcType="DECIMAL" property="finalReceivables" />
-    <result column="final_Receivables_time" jdbcType="TIMESTAMP" property="finalReceivablesTime" />
-    <result column="invoice_amount" jdbcType="DECIMAL" property="invoiceAmount" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="buyer_name" jdbcType="VARCHAR" property="buyerName" />
-    <result column="order_receivables" jdbcType="DECIMAL" property="orderReceivables" />
-    <result column="order_arrears" jdbcType="DECIMAL" property="orderArrears" />
-    <result column="cost_amount" jdbcType="DECIMAL" property="costAmount" />
-    <result column="dep_name" jdbcType="VARCHAR" property="depName" />
-  </resultMap>
-  <sql id="Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    <where>
-      <foreach collection="oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Update_By_Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    <where>
-      <foreach collection="example.oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    id, order_no, salesman_id, finance_id, salesman_name, finance_name, final_receivables, 
-    final_Receivables_time, invoice_amount, create_time, buyer_name, order_receivables, 
-    order_arrears, cost_amount, dep_name
-  </sql>
-  <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderMidExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from t_order_mid
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    select 
-    <include refid="Base_Column_List" />
-    from t_order_mid
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    delete from t_order_mid
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderMidExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    delete from t_order_mid
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.TOrderMid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    insert into t_order_mid (id, order_no, salesman_id, 
-      finance_id, salesman_name, finance_name, 
-      final_receivables, final_Receivables_time, 
-      invoice_amount, create_time, buyer_name, 
-      order_receivables, order_arrears, cost_amount, 
-      dep_name)
-    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{salesmanId,jdbcType=VARCHAR}, 
-      #{financeId,jdbcType=VARCHAR}, #{salesmanName,jdbcType=VARCHAR}, #{financeName,jdbcType=VARCHAR}, 
-      #{finalReceivables,jdbcType=DECIMAL}, #{finalReceivablesTime,jdbcType=TIMESTAMP}, 
-      #{invoiceAmount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{buyerName,jdbcType=VARCHAR}, 
-      #{orderReceivables,jdbcType=DECIMAL}, #{orderArrears,jdbcType=DECIMAL}, #{costAmount,jdbcType=DECIMAL}, 
-      #{depName,jdbcType=VARCHAR})
-  </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderMid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    insert into t_order_mid
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="orderNo != null">
-        order_no,
-      </if>
-      <if test="salesmanId != null">
-        salesman_id,
-      </if>
-      <if test="financeId != null">
-        finance_id,
-      </if>
-      <if test="salesmanName != null">
-        salesman_name,
-      </if>
-      <if test="financeName != null">
-        finance_name,
-      </if>
-      <if test="finalReceivables != null">
-        final_receivables,
-      </if>
-      <if test="finalReceivablesTime != null">
-        final_Receivables_time,
-      </if>
-      <if test="invoiceAmount != null">
-        invoice_amount,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="buyerName != null">
-        buyer_name,
-      </if>
-      <if test="orderReceivables != null">
-        order_receivables,
-      </if>
-      <if test="orderArrears != null">
-        order_arrears,
-      </if>
-      <if test="costAmount != null">
-        cost_amount,
-      </if>
-      <if test="depName != null">
-        dep_name,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=INTEGER},
-      </if>
-      <if test="orderNo != null">
-        #{orderNo,jdbcType=VARCHAR},
-      </if>
-      <if test="salesmanId != null">
-        #{salesmanId,jdbcType=VARCHAR},
-      </if>
-      <if test="financeId != null">
-        #{financeId,jdbcType=VARCHAR},
-      </if>
-      <if test="salesmanName != null">
-        #{salesmanName,jdbcType=VARCHAR},
-      </if>
-      <if test="financeName != null">
-        #{financeName,jdbcType=VARCHAR},
-      </if>
-      <if test="finalReceivables != null">
-        #{finalReceivables,jdbcType=DECIMAL},
-      </if>
-      <if test="finalReceivablesTime != null">
-        #{finalReceivablesTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="invoiceAmount != null">
-        #{invoiceAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="buyerName != null">
-        #{buyerName,jdbcType=VARCHAR},
-      </if>
-      <if test="orderReceivables != null">
-        #{orderReceivables,jdbcType=DECIMAL},
-      </if>
-      <if test="orderArrears != null">
-        #{orderArrears,jdbcType=DECIMAL},
-      </if>
-      <if test="costAmount != null">
-        #{costAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="depName != null">
-        #{depName,jdbcType=VARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <select id="countByExample" parameterType="com.goafanti.common.model.TOrderMidExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    select count(*) from t_order_mid
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    update t_order_mid
-    <set>
-      <if test="record.id != null">
-        id = #{record.id,jdbcType=INTEGER},
-      </if>
-      <if test="record.orderNo != null">
-        order_no = #{record.orderNo,jdbcType=VARCHAR},
-      </if>
-      <if test="record.salesmanId != null">
-        salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
-      </if>
-      <if test="record.financeId != null">
-        finance_id = #{record.financeId,jdbcType=VARCHAR},
-      </if>
-      <if test="record.salesmanName != null">
-        salesman_name = #{record.salesmanName,jdbcType=VARCHAR},
-      </if>
-      <if test="record.financeName != null">
-        finance_name = #{record.financeName,jdbcType=VARCHAR},
-      </if>
-      <if test="record.finalReceivables != null">
-        final_receivables = #{record.finalReceivables,jdbcType=DECIMAL},
-      </if>
-      <if test="record.finalReceivablesTime != null">
-        final_Receivables_time = #{record.finalReceivablesTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.invoiceAmount != null">
-        invoice_amount = #{record.invoiceAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="record.createTime != null">
-        create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.buyerName != null">
-        buyer_name = #{record.buyerName,jdbcType=VARCHAR},
-      </if>
-      <if test="record.orderReceivables != null">
-        order_receivables = #{record.orderReceivables,jdbcType=DECIMAL},
-      </if>
-      <if test="record.orderArrears != null">
-        order_arrears = #{record.orderArrears,jdbcType=DECIMAL},
-      </if>
-      <if test="record.costAmount != null">
-        cost_amount = #{record.costAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="record.depName != null">
-        dep_name = #{record.depName,jdbcType=VARCHAR},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    update t_order_mid
-    set id = #{record.id,jdbcType=INTEGER},
-      order_no = #{record.orderNo,jdbcType=VARCHAR},
-      salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
-      finance_id = #{record.financeId,jdbcType=VARCHAR},
-      salesman_name = #{record.salesmanName,jdbcType=VARCHAR},
-      finance_name = #{record.financeName,jdbcType=VARCHAR},
-      final_receivables = #{record.finalReceivables,jdbcType=DECIMAL},
-      final_Receivables_time = #{record.finalReceivablesTime,jdbcType=TIMESTAMP},
-      invoice_amount = #{record.invoiceAmount,jdbcType=DECIMAL},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      buyer_name = #{record.buyerName,jdbcType=VARCHAR},
-      order_receivables = #{record.orderReceivables,jdbcType=DECIMAL},
-      order_arrears = #{record.orderArrears,jdbcType=DECIMAL},
-      cost_amount = #{record.costAmount,jdbcType=DECIMAL},
-      dep_name = #{record.depName,jdbcType=VARCHAR}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderMid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    update t_order_mid
-    <set>
-      <if test="orderNo != null">
-        order_no = #{orderNo,jdbcType=VARCHAR},
-      </if>
-      <if test="salesmanId != null">
-        salesman_id = #{salesmanId,jdbcType=VARCHAR},
-      </if>
-      <if test="financeId != null">
-        finance_id = #{financeId,jdbcType=VARCHAR},
-      </if>
-      <if test="salesmanName != null">
-        salesman_name = #{salesmanName,jdbcType=VARCHAR},
-      </if>
-      <if test="financeName != null">
-        finance_name = #{financeName,jdbcType=VARCHAR},
-      </if>
-      <if test="finalReceivables != null">
-        final_receivables = #{finalReceivables,jdbcType=DECIMAL},
-      </if>
-      <if test="finalReceivablesTime != null">
-        final_Receivables_time = #{finalReceivablesTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="invoiceAmount != null">
-        invoice_amount = #{invoiceAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="buyerName != null">
-        buyer_name = #{buyerName,jdbcType=VARCHAR},
-      </if>
-      <if test="orderReceivables != null">
-        order_receivables = #{orderReceivables,jdbcType=DECIMAL},
-      </if>
-      <if test="orderArrears != null">
-        order_arrears = #{orderArrears,jdbcType=DECIMAL},
-      </if>
-      <if test="costAmount != null">
-        cost_amount = #{costAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="depName != null">
-        dep_name = #{depName,jdbcType=VARCHAR},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderMid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Jul 06 11:48:54 CST 2020.
-    -->
-    update t_order_mid
-    set order_no = #{orderNo,jdbcType=VARCHAR},
-      salesman_id = #{salesmanId,jdbcType=VARCHAR},
-      finance_id = #{financeId,jdbcType=VARCHAR},
-      salesman_name = #{salesmanName,jdbcType=VARCHAR},
-      finance_name = #{financeName,jdbcType=VARCHAR},
-      final_receivables = #{finalReceivables,jdbcType=DECIMAL},
-      final_Receivables_time = #{finalReceivablesTime,jdbcType=TIMESTAMP},
-      invoice_amount = #{invoiceAmount,jdbcType=DECIMAL},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      buyer_name = #{buyerName,jdbcType=VARCHAR},
-      order_receivables = #{orderReceivables,jdbcType=DECIMAL},
-      order_arrears = #{orderArrears,jdbcType=DECIMAL},
-      cost_amount = #{costAmount,jdbcType=DECIMAL},
-      dep_name = #{depName,jdbcType=VARCHAR}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <select id="selectByOrderNo" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from t_order_mid
-    where order_no = #{id,jdbcType=INTEGER}
-  </select>
-  <update id="updateSalesmanId">
-  	update t_order_mid a ,admin b set a.salesman_id=#{transferId},a.salesman_name=b.name
-	where b.id=#{transferId} and a.salesman_id=#{aid}
-  </update>
-    <update id="updateFinanceId">
-  	update t_order_new a ,t_order_mid b,admin c  set b.finance_id=#{financeId},b.finance_name=c.name
-	where a.order_dep=#{id} and a.order_no=b.order_no and c.id= #{financeId}
-  </update>
-  <update id="updatefinalReceivables">
-  update t_order_mid set final_receivables= #{amount},`final_Receivables_time`= #{receivablesTime},
-  order_arrears=if(order_arrears- #{amount} &lt; 0,0,order_arrears- #{amount})
-	where order_no= #{orderNo}
-  </update>
-  <update id="updateInvoice">
-  update t_order_mid m,(select order_no,sum(amount)amount from t_order_invoice where status=2 group by order_no)b 
-	set m.invoice_amount=b.amount where m.order_no= #{orderNo} and  m.order_no=b.order_no 
-  </update>
-  <update id="addOrderReceivables"> 
-  update t_order_mid  set order_receivables=order_receivables+#{money},
-  order_arrears=order_arrears+#{money}
-	where order_no=#{orderNo}
-  </update>
-  <select id="selectDepNameByDepid" resultType="java.lang.String">
-  select name from department where id= #{orderDep}
-  </select>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.TOrderMidMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderMid">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
+    <result column="salesman_id" jdbcType="VARCHAR" property="salesmanId" />
+    <result column="finance_id" jdbcType="VARCHAR" property="financeId" />
+    <result column="salesman_name" jdbcType="VARCHAR" property="salesmanName" />
+    <result column="finance_name" jdbcType="VARCHAR" property="financeName" />
+    <result column="final_receivables" jdbcType="DECIMAL" property="finalReceivables" />
+    <result column="final_Receivables_time" jdbcType="TIMESTAMP" property="finalReceivablesTime" />
+    <result column="invoice_amount" jdbcType="DECIMAL" property="invoiceAmount" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="buyer_name" jdbcType="VARCHAR" property="buyerName" />
+    <result column="order_receivables" jdbcType="DECIMAL" property="orderReceivables" />
+    <result column="order_arrears" jdbcType="DECIMAL" property="orderArrears" />
+    <result column="cost_amount" jdbcType="DECIMAL" property="costAmount" />
+    <result column="dep_name" jdbcType="VARCHAR" property="depName" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    id, order_no, salesman_id, finance_id, salesman_name, finance_name, final_receivables, 
+    final_Receivables_time, invoice_amount, create_time, buyer_name, order_receivables, 
+    order_arrears, cost_amount, dep_name
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderMidExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from t_order_mid
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from t_order_mid
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    delete from t_order_mid
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderMidExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    delete from t_order_mid
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.TOrderMid">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    insert into t_order_mid (id, order_no, salesman_id, 
+      finance_id, salesman_name, finance_name, 
+      final_receivables, final_Receivables_time, 
+      invoice_amount, create_time, buyer_name, 
+      order_receivables, order_arrears, cost_amount, 
+      dep_name)
+    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{salesmanId,jdbcType=VARCHAR}, 
+      #{financeId,jdbcType=VARCHAR}, #{salesmanName,jdbcType=VARCHAR}, #{financeName,jdbcType=VARCHAR}, 
+      #{finalReceivables,jdbcType=DECIMAL}, #{finalReceivablesTime,jdbcType=TIMESTAMP}, 
+      #{invoiceAmount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{buyerName,jdbcType=VARCHAR}, 
+      #{orderReceivables,jdbcType=DECIMAL}, #{orderArrears,jdbcType=DECIMAL}, #{costAmount,jdbcType=DECIMAL}, 
+      #{depName,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderMid">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    insert into t_order_mid
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="orderNo != null">
+        order_no,
+      </if>
+      <if test="salesmanId != null">
+        salesman_id,
+      </if>
+      <if test="financeId != null">
+        finance_id,
+      </if>
+      <if test="salesmanName != null">
+        salesman_name,
+      </if>
+      <if test="financeName != null">
+        finance_name,
+      </if>
+      <if test="finalReceivables != null">
+        final_receivables,
+      </if>
+      <if test="finalReceivablesTime != null">
+        final_Receivables_time,
+      </if>
+      <if test="invoiceAmount != null">
+        invoice_amount,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="buyerName != null">
+        buyer_name,
+      </if>
+      <if test="orderReceivables != null">
+        order_receivables,
+      </if>
+      <if test="orderArrears != null">
+        order_arrears,
+      </if>
+      <if test="costAmount != null">
+        cost_amount,
+      </if>
+      <if test="depName != null">
+        dep_name,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="orderNo != null">
+        #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="salesmanId != null">
+        #{salesmanId,jdbcType=VARCHAR},
+      </if>
+      <if test="financeId != null">
+        #{financeId,jdbcType=VARCHAR},
+      </if>
+      <if test="salesmanName != null">
+        #{salesmanName,jdbcType=VARCHAR},
+      </if>
+      <if test="financeName != null">
+        #{financeName,jdbcType=VARCHAR},
+      </if>
+      <if test="finalReceivables != null">
+        #{finalReceivables,jdbcType=DECIMAL},
+      </if>
+      <if test="finalReceivablesTime != null">
+        #{finalReceivablesTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="invoiceAmount != null">
+        #{invoiceAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="buyerName != null">
+        #{buyerName,jdbcType=VARCHAR},
+      </if>
+      <if test="orderReceivables != null">
+        #{orderReceivables,jdbcType=DECIMAL},
+      </if>
+      <if test="orderArrears != null">
+        #{orderArrears,jdbcType=DECIMAL},
+      </if>
+      <if test="costAmount != null">
+        #{costAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="depName != null">
+        #{depName,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.TOrderMidExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    select count(*) from t_order_mid
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    update t_order_mid
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.orderNo != null">
+        order_no = #{record.orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="record.salesmanId != null">
+        salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.financeId != null">
+        finance_id = #{record.financeId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.salesmanName != null">
+        salesman_name = #{record.salesmanName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.financeName != null">
+        finance_name = #{record.financeName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.finalReceivables != null">
+        final_receivables = #{record.finalReceivables,jdbcType=DECIMAL},
+      </if>
+      <if test="record.finalReceivablesTime != null">
+        final_Receivables_time = #{record.finalReceivablesTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.invoiceAmount != null">
+        invoice_amount = #{record.invoiceAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.buyerName != null">
+        buyer_name = #{record.buyerName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.orderReceivables != null">
+        order_receivables = #{record.orderReceivables,jdbcType=DECIMAL},
+      </if>
+      <if test="record.orderArrears != null">
+        order_arrears = #{record.orderArrears,jdbcType=DECIMAL},
+      </if>
+      <if test="record.costAmount != null">
+        cost_amount = #{record.costAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="record.depName != null">
+        dep_name = #{record.depName,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    update t_order_mid
+    set id = #{record.id,jdbcType=INTEGER},
+      order_no = #{record.orderNo,jdbcType=VARCHAR},
+      salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
+      finance_id = #{record.financeId,jdbcType=VARCHAR},
+      salesman_name = #{record.salesmanName,jdbcType=VARCHAR},
+      finance_name = #{record.financeName,jdbcType=VARCHAR},
+      final_receivables = #{record.finalReceivables,jdbcType=DECIMAL},
+      final_Receivables_time = #{record.finalReceivablesTime,jdbcType=TIMESTAMP},
+      invoice_amount = #{record.invoiceAmount,jdbcType=DECIMAL},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      buyer_name = #{record.buyerName,jdbcType=VARCHAR},
+      order_receivables = #{record.orderReceivables,jdbcType=DECIMAL},
+      order_arrears = #{record.orderArrears,jdbcType=DECIMAL},
+      cost_amount = #{record.costAmount,jdbcType=DECIMAL},
+      dep_name = #{record.depName,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderMid">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    update t_order_mid
+    <set>
+      <if test="orderNo != null">
+        order_no = #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="salesmanId != null">
+        salesman_id = #{salesmanId,jdbcType=VARCHAR},
+      </if>
+      <if test="financeId != null">
+        finance_id = #{financeId,jdbcType=VARCHAR},
+      </if>
+      <if test="salesmanName != null">
+        salesman_name = #{salesmanName,jdbcType=VARCHAR},
+      </if>
+      <if test="financeName != null">
+        finance_name = #{financeName,jdbcType=VARCHAR},
+      </if>
+      <if test="finalReceivables != null">
+        final_receivables = #{finalReceivables,jdbcType=DECIMAL},
+      </if>
+      <if test="finalReceivablesTime != null">
+        final_Receivables_time = #{finalReceivablesTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="invoiceAmount != null">
+        invoice_amount = #{invoiceAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="buyerName != null">
+        buyer_name = #{buyerName,jdbcType=VARCHAR},
+      </if>
+      <if test="orderReceivables != null">
+        order_receivables = #{orderReceivables,jdbcType=DECIMAL},
+      </if>
+      <if test="orderArrears != null">
+        order_arrears = #{orderArrears,jdbcType=DECIMAL},
+      </if>
+      <if test="costAmount != null">
+        cost_amount = #{costAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="depName != null">
+        dep_name = #{depName,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderMid">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 06 11:48:54 CST 2020.
+    -->
+    update t_order_mid
+    set order_no = #{orderNo,jdbcType=VARCHAR},
+      salesman_id = #{salesmanId,jdbcType=VARCHAR},
+      finance_id = #{financeId,jdbcType=VARCHAR},
+      salesman_name = #{salesmanName,jdbcType=VARCHAR},
+      finance_name = #{financeName,jdbcType=VARCHAR},
+      final_receivables = #{finalReceivables,jdbcType=DECIMAL},
+      final_Receivables_time = #{finalReceivablesTime,jdbcType=TIMESTAMP},
+      invoice_amount = #{invoiceAmount,jdbcType=DECIMAL},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      buyer_name = #{buyerName,jdbcType=VARCHAR},
+      order_receivables = #{orderReceivables,jdbcType=DECIMAL},
+      order_arrears = #{orderArrears,jdbcType=DECIMAL},
+      cost_amount = #{costAmount,jdbcType=DECIMAL},
+      dep_name = #{depName,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <select id="selectByOrderNo" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from t_order_mid
+    where order_no = #{id,jdbcType=INTEGER}
+  </select>
+  <update id="updateSalesmanId">
+  	update t_order_mid a ,admin b set a.salesman_id=#{transferId},a.salesman_name=b.name
+	where b.id=#{transferId} and a.salesman_id=#{aid}
+  </update>
+    <update id="updateFinanceId">
+  	update t_order_new a ,t_order_mid b,admin c  set b.finance_id=#{financeId},b.finance_name=c.name
+	where a.order_dep=#{id} and a.order_no=b.order_no and c.id= #{financeId}
+  </update>
+  <update id="updatefinalReceivables">
+  update t_order_mid set final_receivables= #{amount},`final_Receivables_time`= #{receivablesTime},
+  order_arrears=if(order_arrears- #{amount} &lt; 0,0,order_arrears- #{amount})
+	where order_no= #{orderNo}
+  </update>
+  <update id="updateInvoice">
+  update t_order_mid m,(select order_no,sum(amount)amount from t_order_invoice where status=2 group by order_no)b 
+	set m.invoice_amount=b.amount where m.order_no= #{orderNo} and  m.order_no=b.order_no 
+  </update>
+  <update id="addOrderReceivables"> 
+  update t_order_mid  set order_receivables=order_receivables+#{money},
+  order_arrears=order_arrears+#{money}
+	where order_no=#{orderNo}
+  </update>
+  <select id="selectDepNameByDepid" resultType="java.lang.String">
+  select name from department where id= #{orderDep}
+  </select>
+  <update id="updateCostAmount">
+      update t_order_task a ,t_order_mid b ,t_task_mid c
+    set b.cost_amount= #{count},c.cost_amount=#{count}
+    where a.order_no=b.order_no  and a.id=c.tid and a.id= #{tid}
+  </update>
+  
 </mapper>

+ 3 - 0
src/main/java/com/goafanti/common/mapper/TOrderPaymentMapper.xml

@@ -594,6 +594,9 @@ select a.id,a.tid,a.node_id nodeId,a.payment_type paymentType,a.company_name com
 	 <if test="nodeId != null">
 	 and a.node_id= #{nodeId}
 	 </if>
+	 <if test="chooseType != null">
+	 and a.choose_type= #{chooseType}
+	 </if>
   </select>
   
   <update id="updateByids">

+ 40 - 21
src/main/java/com/goafanti/common/mapper/ThirdPartyCompanyMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="tid" jdbcType="INTEGER" property="tid" />
@@ -24,12 +24,13 @@
     <result column="party_amount" jdbcType="DECIMAL" property="partyAmount" />
     <result column="type" jdbcType="INTEGER" property="type" />
     <result column="patent_name_type" jdbcType="INTEGER" property="patentNameType" />
+    <result column="official_amount" jdbcType="DECIMAL" property="officialAmount" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -63,7 +64,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -97,16 +98,17 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     id, tid, company_name, unit_price, quantity, total_amount, material, urgent, audit, 
-    assets, income, remarks, create_time, cid, party_amount, type, patent_name_type
+    assets, income, remarks, create_time, cid, party_amount, type, patent_name_type, 
+    official_amount
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.ThirdPartyCompanyExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     select
     <if test="distinct">
@@ -125,7 +127,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -136,7 +138,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     delete from third_party_company
     where id = #{id,jdbcType=INTEGER}
@@ -145,7 +147,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     delete from third_party_company
     <if test="_parameter != null">
@@ -156,26 +158,28 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     insert into third_party_company (id, tid, company_name, 
       unit_price, quantity, total_amount, 
       material, urgent, audit, 
       assets, income, remarks, 
       create_time, cid, party_amount, 
-      type, patent_name_type)
+      type, patent_name_type, official_amount
+      )
     values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{companyName,jdbcType=VARCHAR}, 
       #{unitPrice,jdbcType=DECIMAL}, #{quantity,jdbcType=INTEGER}, #{totalAmount,jdbcType=DECIMAL}, 
       #{material,jdbcType=INTEGER}, #{urgent,jdbcType=INTEGER}, #{audit,jdbcType=INTEGER}, 
       #{assets,jdbcType=VARCHAR}, #{income,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, 
       #{createTime,jdbcType=TIMESTAMP}, #{cid,jdbcType=INTEGER}, #{partyAmount,jdbcType=DECIMAL}, 
-      #{type,jdbcType=INTEGER}, #{patentNameType,jdbcType=INTEGER})
+      #{type,jdbcType=INTEGER}, #{patentNameType,jdbcType=INTEGER}, #{officialAmount,jdbcType=DECIMAL}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.ThirdPartyCompany">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     insert into third_party_company
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -230,6 +234,9 @@
       <if test="patentNameType != null">
         patent_name_type,
       </if>
+      <if test="officialAmount != null">
+        official_amount,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -283,13 +290,16 @@
       <if test="patentNameType != null">
         #{patentNameType,jdbcType=INTEGER},
       </if>
+      <if test="officialAmount != null">
+        #{officialAmount,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.ThirdPartyCompanyExample" resultType="java.lang.Long">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     select count(*) from third_party_company
     <if test="_parameter != null">
@@ -300,7 +310,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     update third_party_company
     <set>
@@ -355,6 +365,9 @@
       <if test="record.patentNameType != null">
         patent_name_type = #{record.patentNameType,jdbcType=INTEGER},
       </if>
+      <if test="record.officialAmount != null">
+        official_amount = #{record.officialAmount,jdbcType=DECIMAL},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -364,7 +377,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     update third_party_company
     set id = #{record.id,jdbcType=INTEGER},
@@ -383,7 +396,8 @@
       cid = #{record.cid,jdbcType=INTEGER},
       party_amount = #{record.partyAmount,jdbcType=DECIMAL},
       type = #{record.type,jdbcType=INTEGER},
-      patent_name_type = #{record.patentNameType,jdbcType=INTEGER}
+      patent_name_type = #{record.patentNameType,jdbcType=INTEGER},
+      official_amount = #{record.officialAmount,jdbcType=DECIMAL}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -392,7 +406,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     update third_party_company
     <set>
@@ -444,6 +458,9 @@
       <if test="patentNameType != null">
         patent_name_type = #{patentNameType,jdbcType=INTEGER},
       </if>
+      <if test="officialAmount != null">
+        official_amount = #{officialAmount,jdbcType=DECIMAL},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -451,7 +468,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 14 11:10:10 CST 2020.
+      This element was generated on Tue Sep 15 15:56:36 CST 2020.
     -->
     update third_party_company
     set tid = #{tid,jdbcType=INTEGER},
@@ -469,7 +486,8 @@
       cid = #{cid,jdbcType=INTEGER},
       party_amount = #{partyAmount,jdbcType=DECIMAL},
       type = #{type,jdbcType=INTEGER},
-      patent_name_type = #{patentNameType,jdbcType=INTEGER}
+      patent_name_type = #{patentNameType,jdbcType=INTEGER},
+      official_amount = #{officialAmount,jdbcType=DECIMAL}
     where id = #{id,jdbcType=INTEGER}
   </update>
   <select id="selectByTid" resultType="com.goafanti.organization.bo.OutThirdPartyCompany">
@@ -478,13 +496,14 @@
 	a.type,a.party_amount partyAmount from third_party_company a left join t_order_task b on a.tid=b.id  where tid= #{tid}
   </select>
    <select id="selectPaymentList" resultType="com.goafanti.organization.bo.outPaymentList">
-			select c.contract_no contractNo,b.order_no orderNo,d.buyer_name userName, d.dep_name depName,f.cost_amount costAmount,
+			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,
 		date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTime,a.aname,d.finance_name financeName,b.cname,
 		b.commodity_name pname,b.project_status projectStatus,a.status,bp.`type` projectType
 		from t_order_payment a left join t_order_task b on a.tid=b.id left join t_order_new c on b.order_no=c.order_no
 		left join business_project bp on b.commodity_id=bp.id
 		left join t_order_mid d on b.order_no=d.order_no left join t_task_mid f on a.tid=f.tid
+		where 1=1
 		<if test="lvl==0">
 		and c.finance_id= #{aid}
 		</if>

+ 74 - 51
src/main/java/com/goafanti/common/model/ThirdPartyCompany.java

@@ -12,98 +12,103 @@ public class ThirdPartyCompany {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.id
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private Integer id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.tid
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private Integer tid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.company_name
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private String companyName;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.unit_price
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	@DecimalMax(value = "999999", message = "{" + ErrorConstants.DECIMAL_PARAM_MAX_ERROR + "}")
 	@DecimalMin(value = "0", message = "{" + ErrorConstants.DECIMAL_PARAM_MIN_ERROR + "}")
 	private BigDecimal unitPrice;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.quantity
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private Integer quantity;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.total_amount
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	@DecimalMax(value = "999999", message = "{" + ErrorConstants.DECIMAL_PARAM_MAX_ERROR + "}")
 	@DecimalMin(value = "0", message = "{" + ErrorConstants.DECIMAL_PARAM_MIN_ERROR + "}")
 	private BigDecimal totalAmount;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.material
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private Integer material;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.urgent
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private Integer urgent;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.audit
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private Integer audit;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.assets
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private String assets;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.income
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private String income;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.remarks
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private String remarks;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.create_time
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private Date createTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.cid
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private Integer cid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.party_amount
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private BigDecimal partyAmount;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.type
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private Integer type;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.patent_name_type
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	private Integer patentNameType;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column third_party_company.official_amount
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
+	 */
+	private BigDecimal officialAmount;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.id
 	 * @return  the value of third_party_company.id
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public Integer getId() {
 		return id;
@@ -112,7 +117,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.id
 	 * @param id  the value for third_party_company.id
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setId(Integer id) {
 		this.id = id;
@@ -121,7 +126,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.tid
 	 * @return  the value of third_party_company.tid
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public Integer getTid() {
 		return tid;
@@ -130,7 +135,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.tid
 	 * @param tid  the value for third_party_company.tid
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setTid(Integer tid) {
 		this.tid = tid;
@@ -139,7 +144,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.company_name
 	 * @return  the value of third_party_company.company_name
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public String getCompanyName() {
 		return companyName;
@@ -148,7 +153,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.company_name
 	 * @param companyName  the value for third_party_company.company_name
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setCompanyName(String companyName) {
 		this.companyName = companyName;
@@ -157,7 +162,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.unit_price
 	 * @return  the value of third_party_company.unit_price
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public BigDecimal getUnitPrice() {
 		return unitPrice;
@@ -166,7 +171,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.unit_price
 	 * @param unitPrice  the value for third_party_company.unit_price
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setUnitPrice(BigDecimal unitPrice) {
 		this.unitPrice = unitPrice;
@@ -175,7 +180,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.quantity
 	 * @return  the value of third_party_company.quantity
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public Integer getQuantity() {
 		return quantity;
@@ -184,7 +189,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.quantity
 	 * @param quantity  the value for third_party_company.quantity
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setQuantity(Integer quantity) {
 		this.quantity = quantity;
@@ -193,7 +198,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.total_amount
 	 * @return  the value of third_party_company.total_amount
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public BigDecimal getTotalAmount() {
 		return totalAmount;
@@ -202,7 +207,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.total_amount
 	 * @param totalAmount  the value for third_party_company.total_amount
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setTotalAmount(BigDecimal totalAmount) {
 		this.totalAmount = totalAmount;
@@ -211,7 +216,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.material
 	 * @return  the value of third_party_company.material
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public Integer getMaterial() {
 		return material;
@@ -220,7 +225,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.material
 	 * @param material  the value for third_party_company.material
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setMaterial(Integer material) {
 		this.material = material;
@@ -229,7 +234,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.urgent
 	 * @return  the value of third_party_company.urgent
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public Integer getUrgent() {
 		return urgent;
@@ -238,7 +243,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.urgent
 	 * @param urgent  the value for third_party_company.urgent
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setUrgent(Integer urgent) {
 		this.urgent = urgent;
@@ -247,7 +252,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.audit
 	 * @return  the value of third_party_company.audit
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public Integer getAudit() {
 		return audit;
@@ -256,7 +261,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.audit
 	 * @param audit  the value for third_party_company.audit
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setAudit(Integer audit) {
 		this.audit = audit;
@@ -265,7 +270,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.assets
 	 * @return  the value of third_party_company.assets
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public String getAssets() {
 		return assets;
@@ -274,7 +279,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.assets
 	 * @param assets  the value for third_party_company.assets
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setAssets(String assets) {
 		this.assets = assets;
@@ -283,7 +288,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.income
 	 * @return  the value of third_party_company.income
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public String getIncome() {
 		return income;
@@ -292,7 +297,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.income
 	 * @param income  the value for third_party_company.income
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setIncome(String income) {
 		this.income = income;
@@ -301,7 +306,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.remarks
 	 * @return  the value of third_party_company.remarks
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public String getRemarks() {
 		return remarks;
@@ -310,7 +315,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.remarks
 	 * @param remarks  the value for third_party_company.remarks
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setRemarks(String remarks) {
 		this.remarks = remarks;
@@ -319,7 +324,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.create_time
 	 * @return  the value of third_party_company.create_time
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public Date getCreateTime() {
 		return createTime;
@@ -328,7 +333,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.create_time
 	 * @param createTime  the value for third_party_company.create_time
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
@@ -337,7 +342,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.cid
 	 * @return  the value of third_party_company.cid
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public Integer getCid() {
 		return cid;
@@ -346,7 +351,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.cid
 	 * @param cid  the value for third_party_company.cid
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setCid(Integer cid) {
 		this.cid = cid;
@@ -355,7 +360,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.party_amount
 	 * @return  the value of third_party_company.party_amount
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public BigDecimal getPartyAmount() {
 		return partyAmount;
@@ -364,7 +369,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.party_amount
 	 * @param partyAmount  the value for third_party_company.party_amount
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setPartyAmount(BigDecimal partyAmount) {
 		this.partyAmount = partyAmount;
@@ -373,7 +378,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.type
 	 * @return  the value of third_party_company.type
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public Integer getType() {
 		return type;
@@ -382,7 +387,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.type
 	 * @param type  the value for third_party_company.type
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setType(Integer type) {
 		this.type = type;
@@ -391,7 +396,7 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.patent_name_type
 	 * @return  the value of third_party_company.patent_name_type
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public Integer getPatentNameType() {
 		return patentNameType;
@@ -400,9 +405,27 @@ public class ThirdPartyCompany {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.patent_name_type
 	 * @param patentNameType  the value for third_party_company.patent_name_type
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setPatentNameType(Integer patentNameType) {
 		this.patentNameType = patentNameType;
 	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column third_party_company.official_amount
+	 * @return  the value of third_party_company.official_amount
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
+	 */
+	public BigDecimal getOfficialAmount() {
+		return officialAmount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column third_party_company.official_amount
+	 * @param officialAmount  the value for third_party_company.official_amount
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
+	 */
+	public void setOfficialAmount(BigDecimal officialAmount) {
+		this.officialAmount = officialAmount;
+	}
 }

+ 76 - 16
src/main/java/com/goafanti/common/model/ThirdPartyCompanyExample.java

@@ -8,23 +8,23 @@ import java.util.List;
 public class ThirdPartyCompanyExample {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	protected String orderByClause;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	protected boolean distinct;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	protected List<Criteria> oredCriteria;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public ThirdPartyCompanyExample() {
 		oredCriteria = new ArrayList<Criteria>();
@@ -32,7 +32,7 @@ public class ThirdPartyCompanyExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setOrderByClause(String orderByClause) {
 		this.orderByClause = orderByClause;
@@ -40,7 +40,7 @@ public class ThirdPartyCompanyExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public String getOrderByClause() {
 		return orderByClause;
@@ -48,7 +48,7 @@ public class ThirdPartyCompanyExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void setDistinct(boolean distinct) {
 		this.distinct = distinct;
@@ -56,7 +56,7 @@ public class ThirdPartyCompanyExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public boolean isDistinct() {
 		return distinct;
@@ -64,7 +64,7 @@ public class ThirdPartyCompanyExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public List<Criteria> getOredCriteria() {
 		return oredCriteria;
@@ -72,7 +72,7 @@ public class ThirdPartyCompanyExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void or(Criteria criteria) {
 		oredCriteria.add(criteria);
@@ -80,7 +80,7 @@ public class ThirdPartyCompanyExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public Criteria or() {
 		Criteria criteria = createCriteriaInternal();
@@ -90,7 +90,7 @@ public class ThirdPartyCompanyExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public Criteria createCriteria() {
 		Criteria criteria = createCriteriaInternal();
@@ -102,7 +102,7 @@ public class ThirdPartyCompanyExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	protected Criteria createCriteriaInternal() {
 		Criteria criteria = new Criteria();
@@ -111,7 +111,7 @@ public class ThirdPartyCompanyExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public void clear() {
 		oredCriteria.clear();
@@ -121,7 +121,7 @@ public class ThirdPartyCompanyExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	protected abstract static class GeneratedCriteria {
 		protected List<Criterion> criteria;
@@ -1223,11 +1223,71 @@ public class ThirdPartyCompanyExample {
 			addCriterion("patent_name_type not between", value1, value2, "patentNameType");
 			return (Criteria) this;
 		}
+
+		public Criteria andOfficialAmountIsNull() {
+			addCriterion("official_amount is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andOfficialAmountIsNotNull() {
+			addCriterion("official_amount is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andOfficialAmountEqualTo(BigDecimal value) {
+			addCriterion("official_amount =", value, "officialAmount");
+			return (Criteria) this;
+		}
+
+		public Criteria andOfficialAmountNotEqualTo(BigDecimal value) {
+			addCriterion("official_amount <>", value, "officialAmount");
+			return (Criteria) this;
+		}
+
+		public Criteria andOfficialAmountGreaterThan(BigDecimal value) {
+			addCriterion("official_amount >", value, "officialAmount");
+			return (Criteria) this;
+		}
+
+		public Criteria andOfficialAmountGreaterThanOrEqualTo(BigDecimal value) {
+			addCriterion("official_amount >=", value, "officialAmount");
+			return (Criteria) this;
+		}
+
+		public Criteria andOfficialAmountLessThan(BigDecimal value) {
+			addCriterion("official_amount <", value, "officialAmount");
+			return (Criteria) this;
+		}
+
+		public Criteria andOfficialAmountLessThanOrEqualTo(BigDecimal value) {
+			addCriterion("official_amount <=", value, "officialAmount");
+			return (Criteria) this;
+		}
+
+		public Criteria andOfficialAmountIn(List<BigDecimal> values) {
+			addCriterion("official_amount in", values, "officialAmount");
+			return (Criteria) this;
+		}
+
+		public Criteria andOfficialAmountNotIn(List<BigDecimal> values) {
+			addCriterion("official_amount not in", values, "officialAmount");
+			return (Criteria) this;
+		}
+
+		public Criteria andOfficialAmountBetween(BigDecimal value1, BigDecimal value2) {
+			addCriterion("official_amount between", value1, value2, "officialAmount");
+			return (Criteria) this;
+		}
+
+		public Criteria andOfficialAmountNotBetween(BigDecimal value1, BigDecimal value2) {
+			addCriterion("official_amount not between", value1, value2, "officialAmount");
+			return (Criteria) this;
+		}
 	}
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table third_party_company
-	 * @mbg.generated  Mon Sep 14 11:10:10 CST 2020
+	 * @mbg.generated  Tue Sep 15 15:56:36 CST 2020
 	 */
 	public static class Criterion {
 		private String condition;

+ 4 - 0
src/main/java/com/goafanti/order/controller/OutsourceOrgApiController.java

@@ -134,6 +134,10 @@ public class OutsourceOrgApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "项目外包信息","项目外包信息"));
 			return res;
 		}
+		if(orderNewService.checkOutAudit(o.getTid())) {
+			res.getError().add(buildError(ErrorConstants.DATA_EMPTY_ERROR, "第三方信息","第三方信息"));
+			return res;
+		}
 		
 		return res.data(orderNewService.pushOutsourceProjectAudit(o));
 	}

+ 1 - 0
src/main/java/com/goafanti/order/service/OrderNewService.java

@@ -203,5 +203,6 @@ public interface OrderNewService {
 	Pagination<OutArrearsDunListBo> arrearsDunList(InputArrearsDunListBo in);
 	void exportArrearsDunListData(InputArrearsDunListBo in, HttpServletResponse response) throws IOException;
 	void pushOrderDun(String orderNo);
+	boolean checkOutAudit(Integer id);
 	
 }

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

@@ -1431,6 +1431,14 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 
+	@Override
+	public boolean checkOutAudit(Integer id) {
+		List<OutThirdPartyCompany> list=thirdPartyCompanyMapper.selectByTid(id);
+		return list.isEmpty();
+	}
+
+
+
 
 	
 }

+ 7 - 0
src/main/java/com/goafanti/organization/bo/outOrderPayment.java

@@ -22,6 +22,7 @@ public class outOrderPayment extends TOrderPayment{
 		 * 原已付
 		 */
 	 private BigDecimal initialPaymentAmount;
+	 private String initialCompanyName;
 	 private String createTimes;
 	 
 	 private String financeName;
@@ -62,6 +63,12 @@ public class outOrderPayment extends TOrderPayment{
 	public void setInitialPaymentAmount(BigDecimal initialPaymentAmount) {
 		this.initialPaymentAmount = initialPaymentAmount;
 	}
+	public String getInitialCompanyName() {
+		return initialCompanyName;
+	}
+	public void setInitialCompanyName(String initialCompanyName) {
+		this.initialCompanyName = initialCompanyName;
+	}
 	
 	
 	/*public String getAuditInformation() {

+ 7 - 0
src/main/java/com/goafanti/organization/bo/outPaymentList.java

@@ -1,6 +1,7 @@
 package com.goafanti.organization.bo;
 
 public class outPaymentList {
+		private Integer id;
 		private String contractNo;
 		private String orderNo;
 		private String userName;
@@ -121,5 +122,11 @@ public class outPaymentList {
 		public void setProjectType(Integer projectType) {
 			this.projectType = projectType;
 		}
+		public Integer getId() {
+			return id;
+		}
+		public void setId(Integer id) {
+			this.id = id;
+		}
 		
 }

+ 16 - 10
src/main/java/com/goafanti/organization/controller/ThirdPartyCompanyApiController.java

@@ -55,12 +55,21 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"名称","名称"));
 			return res;
 		}
+		if(thirdPartyCompanyService.addCompanyChekeNumber(t)) {
+			res.getError().add(buildError("第三方数量总和必须小于项目数量。","第三方数量总和必须小于项目数量。"));
+			return res;
+		}
 		//0 系统 1软著 2专利
 		if (calculation==1) {
 			thirdPartyCompanyService.calculationUnitPrice(t);
+			
 		}else if (calculation==2) {
 			thirdPartyCompanyService.calculationPatentUnitPrice(t,patentType);
 		}
+		if(calculation!=0&&t.getUnitPrice()==null) {
+			res.getError().add(buildError("系统未有设置当前选项金额,请核对","系统未有设置当前选项金额,请核对"));
+			return res;
+		}
 		if (t.getUnitPrice()==null||t.getTotalAmount()==null) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"单价","单价"));
 			return res;
@@ -88,6 +97,10 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
             		ThirdPartyError.getValueByCode(bindingResult.getFieldError().getField())));
             return res;
         }
+		if(thirdPartyCompanyService.addCompanyChekeNumber(t)) {
+			res.getError().add(buildError("第三方数量总和必须小于项目数量。","第三方数量总和必须小于项目数量。"));
+			return res;
+		}
 		if (null==t.getId()) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"编号","编号"));
 			return res;
@@ -150,10 +163,6 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 	@RequestMapping(value = "/selectVague" , method = RequestMethod.GET)
 	public Result selectVague(String  name,Integer type) {
 		Result res =new Result();
-		if (StringUtils.isBlank(name)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"名称","名称"));
-			return res;
-		}
 		res.data(thirdPartyCompanyService.selectVague(name,type));
 		return res;
 	}
@@ -198,7 +207,6 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"编号","编号"));
 			return res;
 		}
-		
 		res.data(thirdPartyCompanyService.deletePaymentNode(id));
 		return res;
 	}
@@ -276,7 +284,6 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 			res.getError().add(buildError("金额超出限制,请核对可输入余额。","金额超出限制,请核对可输入余额。"));
 			return res;
 		}
-		
 		if (p.getChooseType()==1&&thirdPartyCompanyService.checkprojectDun(p)) {
 			res.getError().add(buildError("项目节点未达到可付款状态。","项目节点未达到可付款状态。"));
 			return res;
@@ -494,7 +501,6 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 		if (pageSize==null||pageSize<1) {
 			pageSize=10;
 		}
-		
 		res.data(thirdPartyCompanyService.listSoftWritingPrice(s,pageNo, pageSize));
 		return res;
 	}
@@ -539,9 +545,9 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 	public Result addOfficialFeePrice(OfficialFeePrice  o) {
 		Result res =new Result();
 		if (o.getType()==null||o.getProportion85()==null||
-				o.getAmount()==null) {
-				res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"",""));
-				return res;
+			o.getAmount()==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"",""));
+			return res;
 		}
 		res.data(thirdPartyCompanyService.addOfficialFeePrice(o));
 		return res;

+ 2 - 0
src/main/java/com/goafanti/organization/service/ThirdPartyCompanyService.java

@@ -102,5 +102,7 @@ public interface ThirdPartyCompanyService {
 
 	void calculationPatentUnitPrice(ThirdPartyCompany t, Integer patentType);
 
+	boolean addCompanyChekeNumber(ThirdPartyCompany t);
+
 
 }

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

@@ -27,10 +27,10 @@ import com.goafanti.common.dao.PatentPriceMapper;
 import com.goafanti.common.dao.PaymentLogMapper;
 import com.goafanti.common.dao.PaymentNodeMapper;
 import com.goafanti.common.dao.SoftWritingPriceMapper;
+import com.goafanti.common.dao.TOrderMidMapper;
 import com.goafanti.common.dao.TOrderOutsourceMapper;
 import com.goafanti.common.dao.TOrderPaymentMapper;
 import com.goafanti.common.dao.TOrderTaskMapper;
-import com.goafanti.common.dao.TTaskMidMapper;
 import com.goafanti.common.dao.ThirdPartyCompanyMapper;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.model.CompanyLibrary;
@@ -91,7 +91,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 	@Autowired
 	private OfficialFeePriceMapper	officialFeePriceMapper;
 	@Autowired
-	private TTaskMidMapper	tTaskMidMapper;
+	private TOrderMidMapper tOrderMidMapper;
 	@Autowired
 	private PatentPriceMapper	patentPriceMapper;
 	@Autowired
@@ -102,22 +102,35 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 
 	@Override
 	public int addCompany(ThirdPartyCompany t,Integer calculation) {
-		if (calculation==0) {//0其他 1计算
 			CompanyLibrary c=new CompanyLibrary();
 			String aid=TokenManager.getAdminId();
-			List<Integer> list=companyLibraryMapper.selectName(t.getCompanyName(),1,aid);
-			if (list.size()<1) {
-				c.setCompanyName(t.getCompanyName());
-				c.setAid(aid);
-				c.setType(1);//0系统 1录入
-				companyLibraryMapper.insertSelectiveGetId(c);
-				t.setCid(c.getId());
-			}else {
-				t.setCid(list.get(0));
+			if(calculation==0) {
+				List<Integer> list=companyLibraryMapper.selectName(t.getCompanyName(),1,aid);
+				if (list.size()<1) {
+					c.setCompanyName(t.getCompanyName());
+					c.setAid(aid);
+					c.setType(1);//类型 0软著 1其他 2专利
+					companyLibraryMapper.insertSelectiveGetId(c);
+					t.setCid(c.getId());
+				}else {
+					t.setCid(list.get(0));
+				}
+				t.setTotalAmount(t.getUnitPrice().multiply(new BigDecimal(t.getQuantity())));
 			}
-			t.setTotalAmount(t.getUnitPrice().multiply(new BigDecimal(t.getQuantity())));
+		thirdPartyCompanyMapper.insertSelective(t);
+		updateOrderCostAmount(t);
+		return 1;
+	}
+
+
+	private void updateOrderCostAmount(ThirdPartyCompany t) {
+		List<OutThirdPartyCompany>list=selectCompany(t.getTid());
+		BigDecimal count=new BigDecimal(0);
+		for (OutThirdPartyCompany op : list) {
+			count=count.add(op.getTotalAmount());
 		}
-		return thirdPartyCompanyMapper.insertSelective(t);
+		
+		tOrderMidMapper.updateCostAmount(t.getTid(),count);
 	}
 
 
@@ -138,7 +151,9 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 			}
 			t.setTotalAmount(t.getUnitPrice().multiply(new BigDecimal(t.getQuantity())));
 		}
-		return thirdPartyCompanyMapper.updateByPrimaryKeySelective(t);
+		thirdPartyCompanyMapper.updateByPrimaryKeySelective(t);
+		updateOrderCostAmount(t);
+		return 1; 
 	}
 
 
@@ -162,18 +177,19 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 	@Override
 	public boolean addNodeCheck(InputPaymentNode p) {
 		ThirdPartyCompany t=thirdPartyCompanyMapper.selectByPrimaryKey(p.getCid());
-		
-		if(p.getTotalAmount()==null)p.setTotalAmount(new BigDecimal(0));
-		if (p.getTotalAmount().compareTo(t.getTotalAmount())>0) {
-			return true;
-		}
 		List<OutPaymentNode> list=paymentNodeMapper.selectByTidAndCid(p.getTid(),p.getCid());
-		BigDecimal sum=p.getTotalAmount();
+		BigDecimal sum=p.getTotalAmount()==null?new BigDecimal(0):p.getTotalAmount();
 		for (OutPaymentNode pn : list) {
-			if (!pn.getId().equals(p.getId())) sum=sum.add(pn.getTotalAmount());
+			if (p.getId()==null || !pn.getId().equals(p.getId())) {
+				sum=sum.add(pn.getTotalAmount());
+			}
 		}
 		if(p.getUnitPrice()==null)p.setUnitPrice(t.getUnitPrice());
 		if(p.getTotalAmount()==null)p.setTotalAmount(p.getUnitPrice().multiply(new BigDecimal(p.getQuantity())));
+		if(p.getTotalAmount()==null)p.setTotalAmount(new BigDecimal(0));
+		if (p.getTotalAmount().compareTo(t.getTotalAmount())>0) {
+			return true;
+		}
 		if (sum.compareTo(t.getTotalAmount())>0) {
 			return true;
 		}
@@ -207,12 +223,18 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 
 	@Override
 	public int deleteCompany(String id) {
+		ThirdPartyCompany p=new ThirdPartyCompany();
 		if (id.contains(",")) {
 			String []ids =id.split(",");
 			for (String s : ids) {
+				p=thirdPartyCompanyMapper.selectByPrimaryKey(Integer.valueOf(s));;
 				thirdPartyCompanyMapper.deleteByPrimaryKey(Integer.valueOf(s));
 			}
-		}else thirdPartyCompanyMapper.deleteByPrimaryKey(Integer.valueOf(id));
+		}else {
+			p=thirdPartyCompanyMapper.selectByPrimaryKey(Integer.valueOf(id));
+			thirdPartyCompanyMapper.deleteByPrimaryKey(Integer.valueOf(id));
+		}
+		updateOrderCostAmount(p);
 		return 1;
 	}
 
@@ -232,9 +254,11 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 	@Override
 	public int addOrderPayment(TOrderPayment p) {
 		p.setStatus(0);
+		AdminListBo a =adminMapper.getDeptNameByAid(TokenManager.getAdminId());
+		p.setAid(a.getId());
+		p.setAname(a.getName());
 		tOrderPaymentMapper.insertSelectiveGetId(p);
 		NoticeInformationBo ni=financialPaymentMapper.selectBypidGetNotice(p.getId());
-		AdminListBo a =adminMapper.getDeptNameByAid(TokenManager.getAdminId());
 		addNoticAndSendEmail(ni,a,NoticeStatus.PAYMENT_NODE.getCode());
 		PaymentLog pl=new PaymentLog(p.getId(),0,"发起付款:"+p.getRemarks(),a.getId(),a.getName());
 		paymentLogMapper.insertSelective(pl);
@@ -248,8 +272,9 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 		Integer type=tp.getChooseType();
 		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 (type==0) {//支付种类 0第三方 1催款 2官费
-			ThirdPartyCompany tpc=thirdPartyCompanyMapper.selectByPrimaryKey(tp.getTpcId());
 			op.setInitialQuantity(tpc.getQuantity());
 			op.setInitialTotalAmount(tpc.getTotalAmount());
 			op.setInitialUnitPrice(tpc.getUnitPrice());
@@ -262,7 +287,6 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 			op.setInitialUnitPrice(pn.getUnitPrice());
 			op.setInitialPaymentAmount(pn.getPartyAmount());
 		}else if (type==2) {
-			ThirdPartyCompany tpc=thirdPartyCompanyMapper.selectByPrimaryKey(tp.getTpcId());
 			op.setInitialQuantity(tpc.getQuantity());
 			TOrderTask tk=tOrderTaskMapper.selectByPrimaryKey(tp.getTid());
 			OrderOutsourceDtails out=tOrderOutsourceMapper.selectByOrderNo(null, tp.getTid().toString());
@@ -327,7 +351,9 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 			if (p.getPaymentAmount()==null||p.getPaymentAmount().compareTo(new BigDecimal(0))==0) {
 				p.setPaymentAmount(tp.getApplicationAmount());
 			}
-			if (tp.getChooseType()==1) {
+			if(tp.getChooseType()==0){
+				tpc=thirdPartyCompanyMapper.selectByPrimaryKey(tp.getTpcId());
+			}else if (tp.getChooseType()==1) {
 				PaymentNode pn=paymentNodeMapper.selectByPrimaryKey(tp.getNodeId());
 				BigDecimal count=pn.getTotalAmount();
 				BigDecimal party=pn.getPartyAmount();
@@ -343,12 +369,11 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 				pn.setPartyAmount(p.getPaymentAmount());
 				paymentNodeMapper.updateByPrimaryKeySelective(pn);
 				tpc=thirdPartyCompanyMapper.selectByPrimaryKey(pn.getCid());
-			}else {
+			}else if(tp.getChooseType()==2){
 				tpc=thirdPartyCompanyMapper.selectByPrimaryKey(tp.getTpcId());
+				tpc.setOfficialAmount(tpc.getOfficialAmount().add(p.getPaymentAmount()));
 			}
-			TOrderPayment used=tOrderPaymentMapper.selectByPrimaryKey(p.getId());
 			tpc.setPartyAmount(tpc.getPartyAmount().add(p.getPaymentAmount()));
-			tTaskMidMapper.updatePaymentAmount(used.getTid(), tp.getPaymentAmount(), 0);
 			financialPaymentMapper.updateOrderCost(p.getId(),p.getPaymentAmount());
 			thirdPartyCompanyMapper.updateByPrimaryKeySelective(tpc);
 	}
@@ -419,25 +444,29 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 		BigDecimal total=new BigDecimal(0);
 		BigDecimal a=p.getApplicationAmount();
 		List<outOrderPayment> list=new ArrayList<>();
-		//支付种类 0第三方 1催款
-		
-		if (p.getChooseType()==0||p.getChooseType()==2) {
+		//支付种类 0第三方 1催款2官费
+		if (p.getChooseType()==0) {
 			//首先不能大于第三方
-			list=tOrderPaymentMapper.selectList(p.getTpcId(),null);
+			list=tOrderPaymentMapper.selectList(p.getTpcId(),null,p.getChooseType());
 		}else if (p.getChooseType()==1) {
-			list=tOrderPaymentMapper.selectList(null,p.getNodeId());
+			list=tOrderPaymentMapper.selectList(null,p.getNodeId(),p.getChooseType());
+		}else if (p.getChooseType()==2) {
+			list=tOrderPaymentMapper.selectList(p.getTpcId(),null,p.getChooseType());
 		}
 		for (outOrderPayment o : list) {
 			if (o.getApplicationAmount()!=null) {
 				a=a.add(o.getApplicationAmount());	
 			}
 		}
-		if (p.getChooseType()==0||p.getChooseType()==2) {
+		if (p.getChooseType()==0) {
 			ThirdPartyCompany t=thirdPartyCompanyMapper.selectByPrimaryKey(p.getTpcId());
 			total=t.getTotalAmount();
 		}else if (p.getChooseType()==1) {
 			PaymentNode n=paymentNodeMapper.selectByPrimaryKey(p.getNodeId());
 			total=n.getTotalAmount();
+		}else if (p.getChooseType()==2) {
+			ThirdPartyCompany t=thirdPartyCompanyMapper.selectByPrimaryKey(p.getTpcId());
+			total=t.getOfficialAmount();
 		}
 		if (a.compareTo(total) != 1) {
 			return false;
@@ -640,7 +669,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 				NoticeInformationBo ni=financialPaymentMapper.selectBypidGetNotice(Integer.valueOf(s));
 				AdminListBo a =adminMapper.getDeptNameByAid(TokenManager.getAdminId());
 				n.setAid(ni.getTechId());
-				n.setNoticeType(NoticeStatus.PAYMENT_YES.getCode());
+				n.setNoticeType(NoticeStatus.PAYMENT_COMPLETE.getCode());
 				String str=NoticeStatus.getValueByCode(n.getNoticeType())+": 订单编号 -"+ni.getOrderNo()+
 						",客户名称:"+ni.getBuyerName()+", 操作人:"+a.getName()+"-"+a.getDepartmentName()+"。";	
 				n.setContent(str);
@@ -744,6 +773,23 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 	}
 
 
+	@Override
+	public boolean addCompanyChekeNumber(ThirdPartyCompany t) {
+		TOrderTask tt=tOrderTaskMapper.selectByPrimaryKey(t.getTid());
+		 List<OutThirdPartyCompany> list =selectCompany(t.getTid());
+		 Integer count=t.getQuantity();
+		 for (OutThirdPartyCompany out : list) {
+			if (t.getId()==null||!t.getId().equals(out.getId())) {
+				count+=out.getQuantity();
+			}
+		}
+		if (tt.getCommodityQuantity()>=count) {
+			return false;
+		}
+		return true;
+	}
+
+