anderx 4 years ago
parent
commit
fafdf4b996
21 changed files with 562 additions and 742 deletions
  1. 1 1
      GeneratorConfig.xml
  2. 3 0
      src/main/java/com/goafanti/common/dao/OfficialFeePriceMapper.java
  3. 34 86
      src/main/java/com/goafanti/common/dao/PaymentLogMapper.java
  4. 1 1
      src/main/java/com/goafanti/common/dao/TOrderPaymentMapper.java
  5. 2 1
      src/main/java/com/goafanti/common/dao/ThirdPartyCompanyMapper.java
  6. 6 0
      src/main/java/com/goafanti/common/mapper/OfficialFeePriceMapper.xml
  7. 27 177
      src/main/java/com/goafanti/common/mapper/PaymentLogMapper.xml
  8. 5 1
      src/main/java/com/goafanti/common/mapper/TOrderPaymentMapper.xml
  9. 8 2
      src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml
  10. 5 7
      src/main/java/com/goafanti/common/mapper/ThirdPartyCompanyMapper.xml
  11. 218 236
      src/main/java/com/goafanti/common/model/PaymentLog.java
  12. 9 0
      src/main/java/com/goafanti/order/bo/TOrderTaskBo.java
  13. 2 0
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  14. 12 1
      src/main/java/com/goafanti/organization/bo/OutPaymentLog.java
  15. 12 11
      src/main/java/com/goafanti/organization/bo/outPaymentList.java
  16. 38 0
      src/main/java/com/goafanti/organization/bo/outPaymentListFinance.java
  17. 14 184
      src/main/java/com/goafanti/organization/bo/outPaymentListPatent.java
  18. 45 0
      src/main/java/com/goafanti/organization/bo/projectTypePuls.java
  19. 29 4
      src/main/java/com/goafanti/organization/controller/ThirdPartyCompanyApiController.java
  20. 6 1
      src/main/java/com/goafanti/organization/service/ThirdPartyCompanyService.java
  21. 85 29
      src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java

+ 1 - 1
GeneratorConfig.xml

@@ -45,7 +45,7 @@
     <property name="enableSubPackages" value="false"/>
      <property name="nullCatalogMeansCurrent" value="true"/>
     </javaClientGenerator>
-    <table schema="aft" tableName="t_order_task"
+    <table schema="aft" tableName="payment_log"
 	enableCountByExample="false" enableUpdateByExample="false"
 	enableDeleteByExample="false" enableSelectByExample="false"
 	selectByExampleQueryId="false" enableSelectByPrimaryKey="true"

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

@@ -52,4 +52,7 @@ public interface OfficialFeePriceMapper {
 
 
 	OfficialFeePrice selectBytype(Integer type);
+
+
+	OfficialFeePrice countOfficialFeePrice(OfficialFeePrice o);
 }

+ 34 - 86
src/main/java/com/goafanti/common/dao/PaymentLogMapper.java

@@ -9,92 +9,40 @@ import org.apache.ibatis.annotations.Param;
 
 public interface PaymentLogMapper {
     /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table payment_log
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    long countByExample(PaymentLogExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table payment_log
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    int deleteByExample(PaymentLogExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table payment_log
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    int deleteByPrimaryKey(Integer id);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table payment_log
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    int insert(PaymentLog record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table payment_log
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    int insertSelective(PaymentLog record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table payment_log
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    List<PaymentLog> selectByExample(PaymentLogExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table payment_log
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    PaymentLog selectByPrimaryKey(Integer id);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table payment_log
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    int updateByExampleSelective(@Param("record") PaymentLog record, @Param("example") PaymentLogExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table payment_log
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    int updateByExample(@Param("record") PaymentLog record, @Param("example") PaymentLogExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table payment_log
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    int updateByPrimaryKeySelective(PaymentLog record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table payment_log
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    int updateByPrimaryKey(PaymentLog record);
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_log
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	int deleteByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_log
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	int insert(PaymentLog record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_log
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	int insertSelective(PaymentLog record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_log
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	PaymentLog selectByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_log
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	int updateByPrimaryKeySelective(PaymentLog record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_log
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	int updateByPrimaryKey(PaymentLog record);
 
 	List<OutPaymentLog> selectByPid(Integer id);
 }

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

@@ -79,7 +79,7 @@ public interface TOrderPaymentMapper {
 
 	int insertSelectiveGetId(TOrderPayment p);
 
-	List<outOrderPayment> selectByTid(Integer id);
+	List<outOrderPayment> selectByTid(@Param("tid")Integer tid, @Param("chooseType")Integer chooseType);
 
 	List<outOrderPayment> selectList(@Param("tpcId")Integer tpcId, @Param("nodeId")Integer nodeId, @Param("chooseType")Integer chooseType);
 

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

@@ -78,5 +78,6 @@ public interface ThirdPartyCompanyMapper {
 
 	List<OutThirdPartyCompany> selectByTid(Integer tid);
 
-	OutThirdPartyCompany selectByIdPuls(Integer id);
+
+	OutThirdPartyCompany selectByTidPuls(Integer tid);
 }

+ 6 - 0
src/main/java/com/goafanti/common/mapper/OfficialFeePriceMapper.xml

@@ -163,4 +163,10 @@
     from official_fee_price
     where type = #{cid,jdbcType=INTEGER}
   </select>
+  <select id="countOfficialFeePrice" resultMap="BaseResultMap">
+  	select 
+<include refid="Base_Column_List" />  	
+ from official_fee_price 
+  where `type` = #{type} and patent_type = #{patentType}
+  </select>
 </mapper>

+ 27 - 177
src/main/java/com/goafanti/common/mapper/PaymentLogMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 16 11:20:47 CST 2020.
+      This element was generated on Mon Jul 19 17:20:00 CST 2021.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="pid" jdbcType="INTEGER" property="pid" />
@@ -14,107 +14,21 @@
     <result column="aid" jdbcType="VARCHAR" property="aid" />
     <result column="aname" jdbcType="VARCHAR" property="aname" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="process_status" jdbcType="INTEGER" property="processStatus" />
   </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 Tue Jun 16 11:20:47 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 Tue Jun 16 11:20:47 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 Tue Jun 16 11:20:47 CST 2020.
+      This element was generated on Mon Jul 19 17:20:00 CST 2021.
     -->
-    id, pid, status, remarks, aid, aname, create_time
+    id, pid, `status`, remarks, aid, aname, create_time, process_status
   </sql>
-  <select id="selectByExample" parameterType="com.goafanti.common.model.PaymentLogExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 16 11:20:47 CST 2020.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from payment_log
-    <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 Tue Jun 16 11:20:47 CST 2020.
+      This element was generated on Mon Jul 19 17:20:00 CST 2021.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -125,40 +39,29 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 16 11:20:47 CST 2020.
+      This element was generated on Mon Jul 19 17:20:00 CST 2021.
     -->
     delete from payment_log
     where id = #{id,jdbcType=INTEGER}
   </delete>
-  <delete id="deleteByExample" parameterType="com.goafanti.common.model.PaymentLogExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 16 11:20:47 CST 2020.
-    -->
-    delete from payment_log
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
   <insert id="insert" parameterType="com.goafanti.common.model.PaymentLog">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 16 11:20:47 CST 2020.
+      This element was generated on Mon Jul 19 17:20:00 CST 2021.
     -->
-    insert into payment_log (id, pid, status, 
+    insert into payment_log (id, pid, `status`, 
       remarks, aid, aname, 
-      create_time)
+      create_time, process_status)
     values (#{id,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, 
       #{remarks,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{aname,jdbcType=VARCHAR}, 
-      #{createTime,jdbcType=TIMESTAMP})
+      #{createTime,jdbcType=TIMESTAMP}, #{processStatus,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.PaymentLog">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 16 11:20:47 CST 2020.
+      This element was generated on Mon Jul 19 17:20:00 CST 2021.
     -->
     insert into payment_log
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -169,7 +72,7 @@
         pid,
       </if>
       <if test="status != null">
-        status,
+        `status`,
       </if>
       <if test="remarks != null">
         remarks,
@@ -183,6 +86,9 @@
       <if test="createTime != null">
         create_time,
       </if>
+      <if test="processStatus != null">
+        process_status,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -206,76 +112,16 @@
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="processStatus != null">
+        #{processStatus,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.goafanti.common.model.PaymentLogExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 16 11:20:47 CST 2020.
-    -->
-    select count(*) from payment_log
-    <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 Tue Jun 16 11:20:47 CST 2020.
-    -->
-    update payment_log
-    <set>
-      <if test="record.id != null">
-        id = #{record.id,jdbcType=INTEGER},
-      </if>
-      <if test="record.pid != null">
-        pid = #{record.pid,jdbcType=INTEGER},
-      </if>
-      <if test="record.status != null">
-        status = #{record.status,jdbcType=INTEGER},
-      </if>
-      <if test="record.remarks != null">
-        remarks = #{record.remarks,jdbcType=VARCHAR},
-      </if>
-      <if test="record.aid != null">
-        aid = #{record.aid,jdbcType=VARCHAR},
-      </if>
-      <if test="record.aname != null">
-        aname = #{record.aname,jdbcType=VARCHAR},
-      </if>
-      <if test="record.createTime != null">
-        create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      </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 Tue Jun 16 11:20:47 CST 2020.
-    -->
-    update payment_log
-    set id = #{record.id,jdbcType=INTEGER},
-      pid = #{record.pid,jdbcType=INTEGER},
-      status = #{record.status,jdbcType=INTEGER},
-      remarks = #{record.remarks,jdbcType=VARCHAR},
-      aid = #{record.aid,jdbcType=VARCHAR},
-      aname = #{record.aname,jdbcType=VARCHAR},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PaymentLog">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 16 11:20:47 CST 2020.
+      This element was generated on Mon Jul 19 17:20:00 CST 2021.
     -->
     update payment_log
     <set>
@@ -283,7 +129,7 @@
         pid = #{pid,jdbcType=INTEGER},
       </if>
       <if test="status != null">
-        status = #{status,jdbcType=INTEGER},
+        `status` = #{status,jdbcType=INTEGER},
       </if>
       <if test="remarks != null">
         remarks = #{remarks,jdbcType=VARCHAR},
@@ -297,6 +143,9 @@
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="processStatus != null">
+        process_status = #{processStatus,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -304,15 +153,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 16 11:20:47 CST 2020.
+      This element was generated on Mon Jul 19 17:20:00 CST 2021.
     -->
     update payment_log
     set pid = #{pid,jdbcType=INTEGER},
-      status = #{status,jdbcType=INTEGER},
+      `status` = #{status,jdbcType=INTEGER},
       remarks = #{remarks,jdbcType=VARCHAR},
       aid = #{aid,jdbcType=VARCHAR},
       aname = #{aname,jdbcType=VARCHAR},
-      create_time = #{createTime,jdbcType=TIMESTAMP}
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      process_status = #{processStatus,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
   

+ 5 - 1
src/main/java/com/goafanti/common/mapper/TOrderPaymentMapper.xml

@@ -578,8 +578,12 @@ select a.id,a.tid,a.node_id nodeId,a.payment_type paymentType,a.company_name com
 	  a.payment_status paymentStatus, a.status,a.payment_amount paymentAmount,a.remarks ,tpc.company_name tpcName,d.finance_name financeName ,
 	  c.order_no orderNo,date_format(a.create_time,'%Y-%m-%d %H:%i:%s')createTimes,a.application_amount applicationAmount 
 	 from t_order_payment a	 left join t_order_task c on a.tid=c.id left join t_order_mid d on c.order_no=d.order_no 
-	 left join third_party_company tpc on tpc.id=a.tpc_id where  a.tid= #{id}
+	 left join third_party_company tpc on tpc.id=a.tpc_id where  a.tid= #{tid}
+	 <if test="chooseType != null">
+	 and a.choose_type = #{chooseType}
+	 </if>
   </select>
+  
   <select id="selectList" resultType="com.goafanti.organization.bo.outOrderPayment">
   select a.id,a.tid,a.node_id nodeId,a.payment_type paymentType,a.company_name companyName,a.quantity,
 	  a.payment_status paymentStatus, a.status,a.payment_amount paymentAmount,a.remarks , b.quantity NodeQuantity,

+ 8 - 2
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -858,7 +858,7 @@
         SELECT LAST_INSERT_ID()
     &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/selectKey&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; -->
   <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderTask" useGeneratedKeys="true">
-     insert into t_order_task
+    insert into t_order_task
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
         id,
@@ -1028,6 +1028,9 @@
       <if test="checkStatus != null">
         check_status,
       </if>
+      <if test="patentType != null">
+        patent_type,
+      </if>
       <if test="attachmentUrl != null">
         attachment_url,
       </if>
@@ -1204,6 +1207,9 @@
       <if test="checkStatus != null">
         #{checkStatus,jdbcType=INTEGER},
       </if>
+      <if test="patentType != null">
+        #{patentType,jdbcType=INTEGER},
+      </if>
       <if test="attachmentUrl != null">
         #{attachmentUrl,jdbcType=LONGVARCHAR},
       </if>
@@ -1242,7 +1248,7 @@
 	  c.sort cSort,a.commodity_name as commodityName,a.commodity_quantity as commodityQuantity,i.price,a.certificate_number as certificateNumber,a.receiver_name receiverName,
 	  a.commodity_id as commodityId,a.manager_id managerId,a.consultant_id consultantId,a.project_status as projectStatus,a.set_up_amount setUpAmount,
 	  a.task_comment as taskComment ,a.commodity_price as commodityPrice, a.task_status as taskStatus,  a.task_receiver as taskReceiver ,
-	  a.split_status splitStatus,a.split_super splitSuper,a.split_aid splitAid,a.split_time splitTime
+	  a.split_status splitStatus,a.split_super splitSuper,a.split_aid splitAid,a.split_time splitTime,a.patent_type patentType
 	from t_order_task a left join business_project b on a.commodity_id=b.id left join t_order_new e on a.order_no=e.order_no
   	left join admin f on e.salesman_id=f.id left join department g on e.order_dep=g.id left join user h on e.buyer_id=h.id
   	left join business_project i on a.commodity_id=i.id left join business_category c on b.cid=c.id left join admin d on a.task_receiver=d.id

+ 5 - 7
src/main/java/com/goafanti/common/mapper/ThirdPartyCompanyMapper.xml

@@ -524,15 +524,13 @@
 	 select a.id,a.tid,a.company_name companyName,a.unit_price unitPrice,a.quantity,a.total_amount totalAmount,a.material,a.urgent,
 	a.patent_name_type patentNameType,a.audit,a.assets,a.income,a.remarks,a.cid,b.cost_reduction costReduction,b.official_cost officialCost,
 	a.type,a.party_amount partyAmount ,op.amount officialUnitPrice,op.proportion85 reductionAmount,a.start_type startType,a.patent_type patentType
-	from third_party_company a left join t_order_task b on a.tid=b.id  left join official_fee_price op on a.patent_name_type=op.`type` 
+	from third_party_company a left join t_order_task b on a.tid=b.id  left join official_fee_price op on b.patent_type =op.patent_type  and a.patent_name_type =op.`type` 
  where tid= #{tid}
   </select>
-  <select id="selectByIdPuls" resultType="com.goafanti.organization.bo.OutThirdPartyCompany">
-  select a.id,a.tid,a.company_name companyName,a.unit_price unitPrice,a.quantity,a.total_amount totalAmount,a.material,a.urgent,
-	a.patent_name_type patentNameType,a.audit,a.assets,a.income,a.remarks,a.cid,b.cost_reduction costReduction,b.official_cost officialCost,
-	a.type,a.party_amount partyAmount ,op.amount officialUnitPrice,op.proportion85 reductionAmount,a.start_type startType
-	from third_party_company a left join t_order_task b on a.tid=b.id  left join official_fee_price op on a.patent_name_type=op.`type`
-	where a.id= #{id}
+  <select id="selectByTidPuls" resultType="com.goafanti.organization.bo.OutThirdPartyCompany">
+select a.id,a.patent_type patentType,b.patent_name_type projectType,c.amount ,c.proportion85 from t_order_task a left join t_order_outsource b on a.id=b.tid
+left join official_fee_price c on a.patent_type =c.patent_type and b.patent_name_type =c.`type` 
+where a.id= #{tid}
   </select>
   
    <select id="selectPaymentList" resultType="com.goafanti.organization.bo.outPaymentList">

+ 218 - 236
src/main/java/com/goafanti/common/model/PaymentLog.java

@@ -1,83 +1,223 @@
 package com.goafanti.common.model;
 
 import java.util.Date;
-
-public class PaymentLog {
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column payment_log.id
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    private Integer id;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column payment_log.pid
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    private Integer pid;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column payment_log.status
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    private Integer status;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column payment_log.remarks
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    private String remarks;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column payment_log.aid
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    private String aid;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column payment_log.aname
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    private String aname;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column payment_log.create_time
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    private Date createTime;
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column payment_log.id
-     *
-     * @return the value of payment_log.id
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    
-    public PaymentLog() {}
-    
-    public PaymentLog(Integer pid,Integer status,String remarks,String aid,String aname) {
+import java.io.Serializable;
+
+public class PaymentLog implements Serializable {
+    /**
+	 * Database Column Remarks: 编号 This field was generated by MyBatis Generator. This field corresponds to the database column payment_log.id
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	private Integer id;
+	/**
+	 * Database Column Remarks: 项目id This field was generated by MyBatis Generator. This field corresponds to the database column payment_log.pid
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	private Integer pid;
+	/**
+	 * Database Column Remarks: 0发起 1通过 2驳回 This field was generated by MyBatis Generator. This field corresponds to the database column payment_log.status
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	private Integer status;
+	/**
+	 * Database Column Remarks: 备注 This field was generated by MyBatis Generator. This field corresponds to the database column payment_log.remarks
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	private String remarks;
+	/**
+	 * Database Column Remarks: 操作人 This field was generated by MyBatis Generator. This field corresponds to the database column payment_log.aid
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	private String aid;
+	/**
+	 * Database Column Remarks: 操作名称 This field was generated by MyBatis Generator. This field corresponds to the database column payment_log.aname
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	private String aname;
+	/**
+	 * Database Column Remarks: 创建时间 This field was generated by MyBatis Generator. This field corresponds to the database column payment_log.create_time
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	private Date createTime;
+	/**
+	 * Database Column Remarks: 流程状态 0发起 1咨询师管理员 2财务 This field was generated by MyBatis Generator. This field corresponds to the database column payment_log.process_status
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	private Integer processStatus;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table payment_log
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_log.id
+	 * @return  the value of payment_log.id
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public Integer getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_log.id
+	 * @param id  the value for payment_log.id
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_log.pid
+	 * @return  the value of payment_log.pid
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public Integer getPid() {
+		return pid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_log.pid
+	 * @param pid  the value for payment_log.pid
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public void setPid(Integer pid) {
+		this.pid = pid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_log.status
+	 * @return  the value of payment_log.status
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public Integer getStatus() {
+		return status;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_log.status
+	 * @param status  the value for payment_log.status
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_log.remarks
+	 * @return  the value of payment_log.remarks
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public String getRemarks() {
+		return remarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_log.remarks
+	 * @param remarks  the value for payment_log.remarks
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public void setRemarks(String remarks) {
+		this.remarks = remarks == null ? null : remarks.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_log.aid
+	 * @return  the value of payment_log.aid
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public String getAid() {
+		return aid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_log.aid
+	 * @param aid  the value for payment_log.aid
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public void setAid(String aid) {
+		this.aid = aid == null ? null : aid.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_log.aname
+	 * @return  the value of payment_log.aname
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public String getAname() {
+		return aname;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_log.aname
+	 * @param aname  the value for payment_log.aname
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public void setAname(String aname) {
+		this.aname = aname == null ? null : aname.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_log.create_time
+	 * @return  the value of payment_log.create_time
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_log.create_time
+	 * @param createTime  the value for payment_log.create_time
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_log.process_status
+	 * @return  the value of payment_log.process_status
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public Integer getProcessStatus() {
+		return processStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_log.process_status
+	 * @param processStatus  the value for payment_log.process_status
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	public void setProcessStatus(Integer processStatus) {
+		this.processStatus = processStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_log
+	 * @mbg.generated  Mon Jul 19 17:20:00 CST 2021
+	 */
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append(getClass().getSimpleName());
+		sb.append(" [");
+		sb.append("Hash = ").append(hashCode());
+		sb.append(", id=").append(id);
+		sb.append(", pid=").append(pid);
+		sb.append(", status=").append(status);
+		sb.append(", remarks=").append(remarks);
+		sb.append(", aid=").append(aid);
+		sb.append(", aname=").append(aname);
+		sb.append(", createTime=").append(createTime);
+		sb.append(", processStatus=").append(processStatus);
+		sb.append(", serialVersionUID=").append(serialVersionUID);
+		sb.append("]");
+		return sb.toString();
+	}
+
+	public PaymentLog(Integer pid,Integer status,String remarks,String aid,String aname) {
     	this.pid=pid;
     	this.status=status;
     	this.remarks=remarks;
@@ -85,163 +225,5 @@ public class PaymentLog {
     	this.aname=aname;
     }
     
-    public Integer getId() {
-        return id;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column payment_log.id
-     *
-     * @param id the value for payment_log.id
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column payment_log.pid
-     *
-     * @return the value of payment_log.pid
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public Integer getPid() {
-        return pid;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column payment_log.pid
-     *
-     * @param pid the value for payment_log.pid
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public void setPid(Integer pid) {
-        this.pid = pid;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column payment_log.status
-     *
-     * @return the value of payment_log.status
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public Integer getStatus() {
-        return status;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column payment_log.status
-     *
-     * @param status the value for payment_log.status
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column payment_log.remarks
-     *
-     * @return the value of payment_log.remarks
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public String getRemarks() {
-        return remarks;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column payment_log.remarks
-     *
-     * @param remarks the value for payment_log.remarks
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public void setRemarks(String remarks) {
-        this.remarks = remarks;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column payment_log.aid
-     *
-     * @return the value of payment_log.aid
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public String getAid() {
-        return aid;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column payment_log.aid
-     *
-     * @param aid the value for payment_log.aid
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public void setAid(String aid) {
-        this.aid = aid;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column payment_log.aname
-     *
-     * @return the value of payment_log.aname
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public String getAname() {
-        return aname;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column payment_log.aname
-     *
-     * @param aname the value for payment_log.aname
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public void setAname(String aname) {
-        this.aname = aname;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column payment_log.create_time
-     *
-     * @return the value of payment_log.create_time
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column payment_log.create_time
-     *
-     * @param createTime the value for payment_log.create_time
-     *
-     * @mbg.generated Tue Jun 16 11:20:47 CST 2020
-     */
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
+   
 }

+ 9 - 0
src/main/java/com/goafanti/order/bo/TOrderTaskBo.java

@@ -36,6 +36,7 @@ public class TOrderTaskBo extends TOrderTask{
 	private BigDecimal appropriationRatio;
 	
 	private Integer patentType;
+	private String patentTypeName;
 	
 	@Excel(name = "项目状态",sort = 13)
 	private String projectStatusName;
@@ -138,6 +139,14 @@ public class TOrderTaskBo extends TOrderTask{
 	public void setType(Integer type) {
 		this.type = type;
 	}
+
+	public String getPatentTypeName() {
+		return patentTypeName;
+	}
+
+	public void setPatentTypeName(String patentTypeName) {
+		this.patentTypeName = patentTypeName;
+	}
 	
 	
 }

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

@@ -62,6 +62,7 @@ import com.goafanti.common.dao.UserLockReleaseMapper;
 import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.dao.UserMidMapper;
 import com.goafanti.common.enums.NoticeStatus;
+import com.goafanti.common.enums.OfficialPatentType;
 import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Admin;
@@ -317,6 +318,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 					//设置隐藏金额
 					t.setCommodityPrice(new BigDecimal(-1));
 					}
+				if(t.getPatentType()!=null)t.setPatentTypeName(OfficialPatentType.getValueByCode(t.getPatentType()));
 		}
 		return list;
 	}

+ 12 - 1
src/main/java/com/goafanti/organization/bo/OutPaymentLog.java

@@ -5,7 +5,18 @@ import com.goafanti.common.model.PaymentLog;
 
 public class OutPaymentLog extends PaymentLog{
 
-    private String createTimes;
+    public OutPaymentLog(Integer pid, Integer status, String remarks, String aid, String aname) {
+		super(pid, status, remarks, aid, aname);
+	}
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	
+
+	private String createTimes;
 
 	public String getCreateTimes() {
 		return createTimes;

+ 12 - 11
src/main/java/com/goafanti/organization/bo/outPaymentList.java

@@ -47,16 +47,11 @@ public class outPaymentList {
 		private Integer projectType;
 		private BigDecimal totalAmount;
 		private BigDecimal settlementAmount;
-		@Excel(name= "官费")
 		private String officialName;
 		
 		
-		public String getOfficialName() {
-			return officialName;
-		}
-		public void setOfficialName(String officialName) {
-			this.officialName = officialName;
-		}
+		
+		
 		public String getContractNo() {
 			return contractNo;
 		}
@@ -184,11 +179,11 @@ public class outPaymentList {
 		public void setOfficialCost(Integer officialCost) {
 			this.officialCost = officialCost;
 		}
-		public BigDecimal getTotalAmount() {
-			return totalAmount;
+		public String getOfficialName() {
+			return officialName;
 		}
-		public void setTotalAmount(BigDecimal totalAmount) {
-			this.totalAmount = totalAmount;
+		public void setOfficialName(String officialName) {
+			this.officialName = officialName;
 		}
 		public BigDecimal getSettlementAmount() {
 			return settlementAmount;
@@ -196,5 +191,11 @@ public class outPaymentList {
 		public void setSettlementAmount(BigDecimal settlementAmount) {
 			this.settlementAmount = settlementAmount;
 		}
+		public BigDecimal getTotalAmount() {
+			return totalAmount;
+		}
+		public void setTotalAmount(BigDecimal totalAmount) {
+			this.totalAmount = totalAmount;
+		}
 		
 }

+ 38 - 0
src/main/java/com/goafanti/organization/bo/outPaymentListFinance.java

@@ -0,0 +1,38 @@
+package com.goafanti.organization.bo;
+
+import java.math.BigDecimal;
+
+import com.goafanti.common.utils.excel.Excel;
+import com.goafanti.common.utils.excel.ExcelConstant;
+
+public class outPaymentListFinance extends outPaymentList {
+		
+		
+		@Excel(name= "签单金额(万元)")
+		private BigDecimal totalAmount;
+		@Excel(name= "已收金额(万元)")
+		private BigDecimal settlementAmount;
+		private String officialName;
+		
+		
+		public String getOfficialName() {
+			return officialName;
+		}
+		public void setOfficialName(String officialName) {
+			this.officialName = officialName;
+		}
+	
+		public BigDecimal getTotalAmount() {
+			return totalAmount;
+		}
+		public void setTotalAmount(BigDecimal totalAmount) {
+			this.totalAmount = totalAmount;
+		}
+		public BigDecimal getSettlementAmount() {
+			return settlementAmount;
+		}
+		public void setSettlementAmount(BigDecimal settlementAmount) {
+			this.settlementAmount = settlementAmount;
+		}
+		
+}

+ 14 - 184
src/main/java/com/goafanti/organization/bo/outPaymentListPatent.java

@@ -1,190 +1,20 @@
 package com.goafanti.organization.bo;
 
-import java.math.BigDecimal;
 
 import com.goafanti.common.utils.excel.Excel;
-import com.goafanti.common.utils.excel.ExcelConstant;
 
-public class outPaymentListPatent {
-		
-		@Excel(name = "支付编号")
-		private Integer id;
-		@Excel(name = "项目编号")
-		private Integer tid;
-		@Excel(name = "项目名称")
-		private String pname;
-		@Excel(name = "项目状态",readConverterExp = ExcelConstant.NewProjectStatusStr)
-		private Integer projectStatus;
-		@Excel(name = "分类名称")
-		private String cname;
-		@Excel(name = "合同编号")
-		private String contractNo;
-		@Excel(name = "订单编号")
-		private String orderNo;
-		@Excel(name = "客户名称")
-		private String userName;
-		@Excel(name = "部门名称")
-		private String depName;
-		@Excel(name = "第三方机构名称")
-		private String companyName;
-		private String costAmount;
-		@Excel(name = "付款类型",readConverterExp = ExcelConstant.chooseTypeStr)
-		private Integer chooseType;
-		@Excel(name = "本次申请金额",scale = 6)
-		private BigDecimal applicationAmount;
-		@Excel(name = "已支付",scale = 6)
-		private BigDecimal paymentAmount;
-		@Excel(name = "申请人")
-		private String aname;
-		@Excel(name = "财务名称")
-		private String financeName;
-		@Excel(name = "状态",readConverterExp = ExcelConstant.paymentStatusStr)
-		private Integer status;
-		@Excel(name = "创建时间")
-		private String createTime;
-		private Integer costReduction;
-		private Integer officialCost;
-		private Integer projectType;
-		private BigDecimal totalAmount;
-		private BigDecimal settlementAmount; 
-		public String getContractNo() {
-			return contractNo;
-		}
-		public void setContractNo(String contractNo) {
-			this.contractNo = contractNo;
-		}
-		public String getOrderNo() {
-			return orderNo;
-		}
-		public void setOrderNo(String orderNo) {
-			this.orderNo = orderNo;
-		}
-		public String getUserName() {
-			return userName;
-		}
-		public void setUserName(String userName) {
-			this.userName = userName;
-		}
-		public String getDepName() {
-			return depName;
-		}
-		public void setDepName(String depName) {
-			this.depName = depName;
-		}
-		public String getCostAmount() {
-			return costAmount;
-		}
-		public void setCostAmount(String costAmount) {
-			this.costAmount = costAmount;
-		}
-		
-		public BigDecimal getPaymentAmount() {
-			return paymentAmount;
-		}
-		public void setPaymentAmount(BigDecimal paymentAmount) {
-			this.paymentAmount = paymentAmount;
-		}
-		public BigDecimal getApplicationAmount() {
-			return applicationAmount;
-		}
-		public void setApplicationAmount(BigDecimal applicationAmount) {
-			this.applicationAmount = applicationAmount;
-		}
-		public String getCreateTime() {
-			return createTime;
-		}
-		public void setCreateTime(String createTime) {
-			this.createTime = createTime;
-		}
-		public String getAname() {
-			return aname;
-		}
-		public void setAname(String aname) {
-			this.aname = aname;
-		}
-		public String getFinanceName() {
-			return financeName;
-		}
-		public void setFinanceName(String financeName) {
-			this.financeName = financeName;
-		}
-		public String getCname() {
-			return cname;
-		}
-		public void setCname(String cname) {
-			this.cname = cname;
-		}
-		public String getPname() {
-			return pname;
-		}
-		public void setPname(String pname) {
-			this.pname = pname;
-		}
-		public Integer getProjectStatus() {
-			return projectStatus;
-		}
-		public void setProjectStatus(Integer projectStatus) {
-			this.projectStatus = projectStatus;
-		}
-		public Integer getStatus() {
-			return status;
-		}
-		public void setStatus(Integer status) {
-			this.status = status;
-		}
-		public Integer getTid() {
-			return tid;
-		}
-		public void setTid(Integer tid) {
-			this.tid = tid;
-		}
-		public Integer getChooseType() {
-			return chooseType;
-		}
-		public void setChooseType(Integer chooseType) {
-			this.chooseType = chooseType;
-		}
-		public Integer getProjectType() {
-			return projectType;
-		}
-		public void setProjectType(Integer projectType) {
-			this.projectType = projectType;
-		}
-		public Integer getId() {
-			return id;
-		}
-		public void setId(Integer id) {
-			this.id = id;
-		}
-		public String getCompanyName() {
-			return companyName;
-		}
-		public void setCompanyName(String companyName) {
-			this.companyName = companyName;
-		}
-		public Integer getCostReduction() {
-			return costReduction;
-		}
-		public void setCostReduction(Integer costReduction) {
-			this.costReduction = costReduction;
-		}
-		public Integer getOfficialCost() {
-			return officialCost;
-		}
-		public void setOfficialCost(Integer officialCost) {
-			this.officialCost = officialCost;
-		}
-		public BigDecimal getTotalAmount() {
-			return totalAmount;
-		}
-		public void setTotalAmount(BigDecimal totalAmount) {
-			this.totalAmount = totalAmount;
-		}
-		public BigDecimal getSettlementAmount() {
-			return settlementAmount;
-		}
-		public void setSettlementAmount(BigDecimal settlementAmount) {
-			this.settlementAmount = settlementAmount;
-		}
-		
+public class outPaymentListPatent extends  outPaymentList {
+	
+	
+	@Excel(name= "官费")
+	private String officialName;
+	
+	
+	public String getOfficialName() {
+		return officialName;
+	}
+	public void setOfficialName(String officialName) {
+		this.officialName = officialName;
+	}
+	
 }

+ 45 - 0
src/main/java/com/goafanti/organization/bo/projectTypePuls.java

@@ -0,0 +1,45 @@
+package com.goafanti.organization.bo;
+
+import java.math.BigDecimal;
+
+public class projectTypePuls {
+	
+	private Integer id;
+	private Integer patentType;
+	private Integer projectType;
+	private BigDecimal amount;
+	private BigDecimal proportion85;
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public Integer getPatentType() {
+		return patentType;
+	}
+	public void setPatentType(Integer patentType) {
+		this.patentType = patentType;
+	}
+	public Integer getProjectType() {
+		return projectType;
+	}
+	public void setProjectType(Integer projectType) {
+		this.projectType = projectType;
+	}
+	public BigDecimal getAmount() {
+		return amount;
+	}
+	public void setAmount(BigDecimal amount) {
+		this.amount = amount;
+	}
+	public BigDecimal getProportion85() {
+		return proportion85;
+	}
+	public void setProportion85(BigDecimal proportion85) {
+		this.proportion85 = proportion85;
+	}
+	
+	
+
+}

+ 29 - 4
src/main/java/com/goafanti/organization/controller/ThirdPartyCompanyApiController.java

@@ -20,6 +20,7 @@ import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.model.OfficialFeePrice;
 import com.goafanti.common.model.PatentPrice;
+import com.goafanti.common.model.PaymentLog;
 import com.goafanti.common.model.SoftWritingPrice;
 import com.goafanti.common.model.TOrderPayment;
 import com.goafanti.common.model.ThirdPartyCompany;
@@ -281,10 +282,15 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 			res.getError().add(buildError("项目节点未达到可付款状态。","项目节点未达到可付款状态。"));
 			return res;
 		}
-		if (thirdPartyCompanyService.checkPayment(p)) {
+		int i=thirdPartyCompanyService.checkPayment(p);
+		if (i==-1) {
 			res.getError().add(buildError("金额超出限制,请核对可输入余额。","金额超出限制,请核对可输入余额。"));
 			return res;
 		}
+		if (i==-2) {
+			res.getError().add(buildError("官费数量超出限制,请核对可输入数量。","官费数量超出限制,请核对可输入数量。"));
+			return res;
+		}
 		if (!res.getError().isEmpty()) {
             return res;
         }
@@ -541,11 +547,14 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 	@RequestMapping(value = "/addOfficialFeePrice" , method = RequestMethod.POST)
 	public Result addOfficialFeePrice(OfficialFeePrice  o) {
 		Result res =new Result();
-		if (o.getType()==null||o.getProportion85()==null||
-			o.getAmount()==null) {
+		if (o.getType()==null|| o.getAmount()==null) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"",""));
 			return res;
 		}
+		if (thirdPartyCompanyService.checkOfficialFeePrice(o)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR,"分类","分类"));
+			return res;
+		}
 		res.data(thirdPartyCompanyService.addOfficialFeePrice(o));
 		return res;
 	}
@@ -568,7 +577,10 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 				res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"",""));
 				return res;
 		}
-		
+		if (thirdPartyCompanyService.checkOfficialFeePrice(o)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR,"分类","分类"));
+			return res;
+		}
 		res.data(thirdPartyCompanyService.updateOfficialFeePrice(o));
 		return res;
 	}
@@ -687,4 +699,17 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 	}
 	
 	
+	
+	/**
+	 * 	审核
+	 *  
+	 */
+	@RequestMapping(value = "/paymentExamine", method = RequestMethod.POST)
+	public Result paymentExamine(PaymentLog in){
+		Result res= new Result();
+		res.data(thirdPartyCompanyService.paymentExamine(in));
+		return res;
+		
+	}
+	
 }

+ 6 - 1
src/main/java/com/goafanti/organization/service/ThirdPartyCompanyService.java

@@ -9,6 +9,7 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.model.CompanyLibrary;
 import com.goafanti.common.model.OfficialFeePrice;
 import com.goafanti.common.model.PatentPrice;
+import com.goafanti.common.model.PaymentLog;
 import com.goafanti.common.model.SoftWritingPrice;
 import com.goafanti.common.model.TOrderPayment;
 import com.goafanti.common.model.ThirdPartyCompany;
@@ -59,7 +60,7 @@ public interface ThirdPartyCompanyService {
 
 	List<outFinancialPayment> selectfinancialPayment(Integer id);
 
-	boolean checkPayment(TOrderPayment p);
+	int checkPayment(TOrderPayment p);
 
 	boolean checkprojectDun(TOrderPayment p);
 
@@ -111,6 +112,10 @@ public interface ThirdPartyCompanyService {
 
 	Result exportPaymentList(HttpServletResponse response, InputPaymentList ip, Integer type);
 
+	boolean checkOfficialFeePrice(OfficialFeePrice o);
+
+	int paymentExamine(PaymentLog in);
+
 
 	
 

+ 85 - 29
src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java

@@ -1,6 +1,7 @@
 package com.goafanti.organization.service.impl;
 
 import java.io.UnsupportedEncodingException;
+import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
@@ -12,6 +13,7 @@ import java.util.UUID;
 import javax.mail.MessagingException;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.collections4.map.HashedMap;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,6 +36,7 @@ import com.goafanti.common.dao.TOrderPaymentMapper;
 import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.dao.ThirdPartyCompanyMapper;
 import com.goafanti.common.enums.NoticeStatus;
+import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.CompanyLibrary;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OfficialFeePrice;
@@ -65,6 +68,8 @@ import com.goafanti.organization.bo.OutThirdPartyCompany;
 import com.goafanti.organization.bo.outFinancialPayment;
 import com.goafanti.organization.bo.outNodeList;
 import com.goafanti.organization.bo.outPaymentList;
+import com.goafanti.organization.bo.outPaymentListFinance;
+import com.goafanti.organization.bo.outPaymentListPatent;
 import com.goafanti.organization.bo.outProjectBo;
 import com.goafanti.organization.bo.outOrderPayment;
 import com.goafanti.organization.service.ThirdPartyCompanyService;
@@ -298,7 +303,6 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 			op.setInitialUnitPrice(pn.getUnitPrice().toString());
 			op.setInitialPaymentAmount(pn.getPartyAmount().toString());
 		}else if (type==2) {
-			op.setInitialQuantity(tpc.getQuantity());
 			TOrderTask tk=tOrderTaskMapper.selectByPrimaryKey(tp.getTid());
 			OrderOutsourceDtails out=tOrderOutsourceMapper.selectByOrderNo(null, tp.getTid().toString());
 			OfficialFeePrice of=officialFeePriceMapper.selectBytype(out.getPatentNameType());
@@ -414,7 +418,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 
 	@Override
 	public List<outOrderPayment> selectOrderPayment(Integer id) {
-		List<outOrderPayment> list=tOrderPaymentMapper.selectByTid(id);
+		List<outOrderPayment> list=tOrderPaymentMapper.selectByTid(id,null);
 		if (!TokenManager.hasRole(AFTConstants.FINANCE)&&
 				!TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)&&
 				!TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)&&
@@ -480,7 +484,18 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 
 
 	@Override
-	public boolean checkPayment(TOrderPayment p) {
+	public int checkPayment(TOrderPayment p) {
+		if (p.getChooseType()==2) {
+			TOrderTask tot=tOrderTaskMapper.selectByPrimaryKey(p.getTid());
+			List<outOrderPayment> list2=tOrderPaymentMapper.selectByTid(p.getTid(),p.getChooseType());
+			int x=p.getQuantity();
+			for (outOrderPayment out : list2) {
+				x+=out.getQuantity();
+			}
+			if (x>tot.getCommodityQuantity()) {
+				return -2;
+			}
+		}
 		//没有填写申请金额的情况下计算金额
 		checkGetAmount(p);
 		BigDecimal total=new BigDecimal(0);
@@ -504,18 +519,11 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 		}else if (p.getChooseType()==1) {
 			PaymentNode n=paymentNodeMapper.selectByPrimaryKey(p.getNodeId());
 			total=n.getTotalAmount();
-		}else if (p.getChooseType()==2) {
-			OutThirdPartyCompany ot=thirdPartyCompanyMapper.selectByIdPuls(p.getTpcId());
-			if (ot.getCostReduction()==0) {
-				total=new BigDecimal(ot.getOfficialUnitPrice()).multiply(new BigDecimal(ot.getQuantity()));
-			}else {
-				total=new BigDecimal(ot.getReductionAmount()).multiply(new BigDecimal(ot.getQuantity()));
-			}
-		}
+		} 
 		if (a.compareTo(total) != 1) {
-			return false;
+			return -1;
 		}
-		return true;
+		return 0;
 	}
 
 
@@ -608,8 +616,9 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 		}else {
 			map.put("lvl", 0);
 		}
-		return (Pagination<outPaymentList>)findPage("selectPaymentList","selectPaymentCount",
+		Pagination<outPaymentList> p=(Pagination<outPaymentList>)findPage("selectPaymentList","selectPaymentCount",
 				map,i.getPageNo(),i.getPageSize());
+		return p;
 	}
 
 
@@ -874,7 +883,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 				PaymentNode pn=paymentNodeMapper.selectByPrimaryKey(p.getNodeId());
 				count=pn.getUnitPrice().multiply(new BigDecimal(p.getQuantity()));
 			}else if (p.getChooseType()==2) {
-				OutThirdPartyCompany ot=thirdPartyCompanyMapper.selectByIdPuls(p.getTpcId());
+				OutThirdPartyCompany ot=thirdPartyCompanyMapper.selectByTidPuls(p.getTid());
 				if (ot.getCostReduction()==0) {
 					count=new BigDecimal(ot.getOfficialUnitPrice()).multiply(new BigDecimal(ot.getQuantity()));
 				}else {
@@ -896,24 +905,71 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 		@SuppressWarnings("unchecked")
 		List<outPaymentList> list=(List<outPaymentList>) selectPaymentList(ip).getList();
 		if (type==0) {
-			for (outPaymentList o : list) {
-				StringBuffer s=new StringBuffer();
-				if (o.getOfficialCost()!=null&&o.getOfficialCost()==1) {
-					s.append("含官费");
-					if (o.getCostReduction()!=null&&o.getOfficialCost()==1) {
-						s.append(",有费减");
+			List<outPaymentListFinance> list2=new ArrayList<outPaymentListFinance>();
+			for (outPaymentList out : list) {
+				outPaymentListFinance out2=new outPaymentListFinance();
+				try {
+					BeanUtils.copyProperties(out2, out);
+				} catch (IllegalAccessException | InvocationTargetException e) {
+					e.printStackTrace();
+				}
+				list2.add(out2);
+			}
+			NewExcelUtil<outPaymentListFinance> excelUtil=new NewExcelUtil<>(outPaymentListFinance.class);
+			return excelUtil.exportExcel(list2, "财务成本列表", response);
+		}else {
+			List<outPaymentListPatent> list3=new ArrayList<outPaymentListPatent>();
+			for (outPaymentList out : list) {
+				outPaymentListPatent out3=new outPaymentListPatent();
+				try {
+					BeanUtils.copyProperties(out3, out);
+				} catch (IllegalAccessException | InvocationTargetException e) {
+					e.printStackTrace();
+				}
+					StringBuffer s=new StringBuffer();
+					if (out3.getOfficialCost()!=null&&out3.getOfficialCost()==1) {
+						s.append("含官费");
+						if (out3.getCostReduction()!=null&&out3.getCostReduction()==1) {
+							s.append(",有费减");
+						}else {
+							s.append(",无费减");
+						}
 					}else {
-						s.append(",无费减");
+						s.append("不含官费");
 					}
-				}else {
-					s.append("不含官费");
-				}
-				o.setOfficialName(s.toString());
+					out3.setOfficialName(s.toString());
+					list3.add(out3);
 			}
-			NewExcelUtil<outPaymentList> excelUtil=new NewExcelUtil<>(outPaymentList.class);
-			return excelUtil.exportExcel(list, "财务成本列表", response);
+			NewExcelUtil<outPaymentListPatent> p=new NewExcelUtil<>(outPaymentListPatent.class);
+			return p.exportExcel(list3, "专利成本列表", response);
 		}
-		return null;
+	}
+
+
+
+
+
+	@Override
+	public boolean checkOfficialFeePrice(OfficialFeePrice o) {
+		OfficialFeePrice x=officialFeePriceMapper.countOfficialFeePrice(o);
+		if(o.getId()==null&&x!=null) {
+			return true;
+		}else if(o.getId()!=null&&o.getId()!=x.getId()) {
+			return true;
+		}
+		return false;
+	}
+
+
+
+
+
+	@Override
+	public int paymentExamine(PaymentLog in) {
+		Admin a=adminMapper.selectAllByid(TokenManager.getAdminId());
+		in.setAid(TokenManager.getAdminId());
+		in.setAname(a.getName());
+		return paymentLogMapper.insertSelective(in);
 	}
 		
 }