Bläddra i källkod

新增开票相关类

anderx 6 år sedan
förälder
incheckning
659babec25

+ 77 - 0
src/main/java/com/goafanti/common/dao/TOrderInvoiceMapper.java

@@ -0,0 +1,77 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.TOrderInvoice;
+import com.goafanti.common.model.TOrderInvoiceExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface TOrderInvoiceMapper {
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_invoice
+	 * @mbg.generated  Thu May 16 11:47:09 CST 2019
+	 */
+	long countByExample(TOrderInvoiceExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_invoice
+	 * @mbg.generated  Thu May 16 11:47:09 CST 2019
+	 */
+	int deleteByExample(TOrderInvoiceExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_invoice
+	 * @mbg.generated  Thu May 16 11:47:09 CST 2019
+	 */
+	int deleteByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_invoice
+	 * @mbg.generated  Thu May 16 11:47:09 CST 2019
+	 */
+	int insert(TOrderInvoice record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_invoice
+	 * @mbg.generated  Thu May 16 11:47:09 CST 2019
+	 */
+	int insertSelective(TOrderInvoice record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_invoice
+	 * @mbg.generated  Thu May 16 11:47:09 CST 2019
+	 */
+	List<TOrderInvoice> selectByExample(TOrderInvoiceExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_invoice
+	 * @mbg.generated  Thu May 16 11:47:09 CST 2019
+	 */
+	TOrderInvoice selectByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_invoice
+	 * @mbg.generated  Thu May 16 11:47:09 CST 2019
+	 */
+	int updateByExampleSelective(@Param("record") TOrderInvoice record, @Param("example") TOrderInvoiceExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_invoice
+	 * @mbg.generated  Thu May 16 11:47:09 CST 2019
+	 */
+	int updateByExample(@Param("record") TOrderInvoice record, @Param("example") TOrderInvoiceExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_invoice
+	 * @mbg.generated  Thu May 16 11:47:09 CST 2019
+	 */
+	int updateByPrimaryKeySelective(TOrderInvoice record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_invoice
+	 * @mbg.generated  Thu May 16 11:47:09 CST 2019
+	 */
+	int updateByPrimaryKey(TOrderInvoice record);
+
+	int checkApplyAmount(@Param("orderNo")String orderNo,@Param("id")Integer id);
+}

+ 729 - 0
src/main/java/com/goafanti/common/mapper/TOrderInvoiceMapper.xml

@@ -0,0 +1,729 @@
+<?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.TOrderInvoiceMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderInvoice">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 16 11:47:09 CST 2019.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="reject_reason" jdbcType="VARCHAR" property="rejectReason" />
+    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
+    <result column="invoice_type" jdbcType="INTEGER" property="invoiceType" />
+    <result column="unit_name" jdbcType="VARCHAR" property="unitName" />
+    <result column="tax_number" jdbcType="VARCHAR" property="taxNumber" />
+    <result column="amount" jdbcType="DECIMAL" property="amount" />
+    <result column="banks" jdbcType="VARCHAR" property="banks" />
+    <result column="content" jdbcType="VARCHAR" property="content" />
+    <result column="unit_address" jdbcType="VARCHAR" property="unitAddress" />
+    <result column="invoice_remarks" jdbcType="VARCHAR" property="invoiceRemarks" />
+    <result column="unit_mobile" jdbcType="VARCHAR" property="unitMobile" />
+    <result column="voucher_url" jdbcType="VARCHAR" property="voucherUrl" />
+    <result column="post" jdbcType="INTEGER" property="post" />
+    <result column="addressee" jdbcType="VARCHAR" property="addressee" />
+    <result column="addressee_mobile" jdbcType="VARCHAR" property="addresseeMobile" />
+    <result column="addressee_province" jdbcType="INTEGER" property="addresseeProvince" />
+    <result column="addressee_city" jdbcType="INTEGER" property="addresseeCity" />
+    <result column="addressee_area" jdbcType="INTEGER" property="addresseeArea" />
+    <result column="recipient_address" jdbcType="VARCHAR" property="recipientAddress" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="approval" jdbcType="INTEGER" property="approval" />
+  </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 Thu May 16 11:47:09 CST 2019.
+    -->
+    <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 Thu May 16 11:47:09 CST 2019.
+    -->
+    <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 Thu May 16 11:47:09 CST 2019.
+    -->
+    id, order_no, type, status, reject_reason, remarks, invoice_type, unit_name, tax_number, 
+    amount, banks, content, unit_address, invoice_remarks, unit_mobile, voucher_url, 
+    post, addressee, addressee_mobile, addressee_province, addressee_city, addressee_area, 
+    recipient_address, create_time, update_time, approval
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderInvoiceExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 16 11:47:09 CST 2019.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from t_order_invoice
+    <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 Thu May 16 11:47:09 CST 2019.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from t_order_invoice
+    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 Thu May 16 11:47:09 CST 2019.
+    -->
+    delete from t_order_invoice
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderInvoiceExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 16 11:47:09 CST 2019.
+    -->
+    delete from t_order_invoice
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.TOrderInvoice">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 16 11:47:09 CST 2019.
+    -->
+    insert into t_order_invoice (id, order_no, type, 
+      status, reject_reason, remarks, 
+      invoice_type, unit_name, tax_number, 
+      amount, banks, content, 
+      unit_address, invoice_remarks, unit_mobile, 
+      voucher_url, post, addressee, 
+      addressee_mobile, addressee_province, addressee_city, 
+      addressee_area, recipient_address, create_time, 
+      update_time, approval)
+    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, 
+      #{status,jdbcType=INTEGER}, #{rejectReason,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, 
+      #{invoiceType,jdbcType=INTEGER}, #{unitName,jdbcType=VARCHAR}, #{taxNumber,jdbcType=VARCHAR}, 
+      #{amount,jdbcType=DECIMAL}, #{banks,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, 
+      #{unitAddress,jdbcType=VARCHAR}, #{invoiceRemarks,jdbcType=VARCHAR}, #{unitMobile,jdbcType=VARCHAR}, 
+      #{voucherUrl,jdbcType=VARCHAR}, #{post,jdbcType=INTEGER}, #{addressee,jdbcType=VARCHAR}, 
+      #{addresseeMobile,jdbcType=VARCHAR}, #{addresseeProvince,jdbcType=INTEGER}, #{addresseeCity,jdbcType=INTEGER}, 
+      #{addresseeArea,jdbcType=INTEGER}, #{recipientAddress,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{approval,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderInvoice">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 16 11:47:09 CST 2019.
+    -->
+    insert into t_order_invoice
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="orderNo != null">
+        order_no,
+      </if>
+      <if test="type != null">
+        type,
+      </if>
+      <if test="status != null">
+        status,
+      </if>
+      <if test="rejectReason != null">
+        reject_reason,
+      </if>
+      <if test="remarks != null">
+        remarks,
+      </if>
+      <if test="invoiceType != null">
+        invoice_type,
+      </if>
+      <if test="unitName != null">
+        unit_name,
+      </if>
+      <if test="taxNumber != null">
+        tax_number,
+      </if>
+      <if test="amount != null">
+        amount,
+      </if>
+      <if test="banks != null">
+        banks,
+      </if>
+      <if test="content != null">
+        content,
+      </if>
+      <if test="unitAddress != null">
+        unit_address,
+      </if>
+      <if test="invoiceRemarks != null">
+        invoice_remarks,
+      </if>
+      <if test="unitMobile != null">
+        unit_mobile,
+      </if>
+      <if test="voucherUrl != null">
+        voucher_url,
+      </if>
+      <if test="post != null">
+        post,
+      </if>
+      <if test="addressee != null">
+        addressee,
+      </if>
+      <if test="addresseeMobile != null">
+        addressee_mobile,
+      </if>
+      <if test="addresseeProvince != null">
+        addressee_province,
+      </if>
+      <if test="addresseeCity != null">
+        addressee_city,
+      </if>
+      <if test="addresseeArea != null">
+        addressee_area,
+      </if>
+      <if test="recipientAddress != null">
+        recipient_address,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="approval != null">
+        approval,
+      </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="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="rejectReason != null">
+        #{rejectReason,jdbcType=VARCHAR},
+      </if>
+      <if test="remarks != null">
+        #{remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="invoiceType != null">
+        #{invoiceType,jdbcType=INTEGER},
+      </if>
+      <if test="unitName != null">
+        #{unitName,jdbcType=VARCHAR},
+      </if>
+      <if test="taxNumber != null">
+        #{taxNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="amount != null">
+        #{amount,jdbcType=DECIMAL},
+      </if>
+      <if test="banks != null">
+        #{banks,jdbcType=VARCHAR},
+      </if>
+      <if test="content != null">
+        #{content,jdbcType=VARCHAR},
+      </if>
+      <if test="unitAddress != null">
+        #{unitAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="invoiceRemarks != null">
+        #{invoiceRemarks,jdbcType=VARCHAR},
+      </if>
+      <if test="unitMobile != null">
+        #{unitMobile,jdbcType=VARCHAR},
+      </if>
+      <if test="voucherUrl != null">
+        #{voucherUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="post != null">
+        #{post,jdbcType=INTEGER},
+      </if>
+      <if test="addressee != null">
+        #{addressee,jdbcType=VARCHAR},
+      </if>
+      <if test="addresseeMobile != null">
+        #{addresseeMobile,jdbcType=VARCHAR},
+      </if>
+      <if test="addresseeProvince != null">
+        #{addresseeProvince,jdbcType=INTEGER},
+      </if>
+      <if test="addresseeCity != null">
+        #{addresseeCity,jdbcType=INTEGER},
+      </if>
+      <if test="addresseeArea != null">
+        #{addresseeArea,jdbcType=INTEGER},
+      </if>
+      <if test="recipientAddress != null">
+        #{recipientAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="approval != null">
+        #{approval,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.TOrderInvoiceExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 16 11:47:09 CST 2019.
+    -->
+    select count(*) from t_order_invoice
+    <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 Thu May 16 11:47:09 CST 2019.
+    -->
+    update t_order_invoice
+    <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.type != null">
+        type = #{record.type,jdbcType=INTEGER},
+      </if>
+      <if test="record.status != null">
+        status = #{record.status,jdbcType=INTEGER},
+      </if>
+      <if test="record.rejectReason != null">
+        reject_reason = #{record.rejectReason,jdbcType=VARCHAR},
+      </if>
+      <if test="record.remarks != null">
+        remarks = #{record.remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="record.invoiceType != null">
+        invoice_type = #{record.invoiceType,jdbcType=INTEGER},
+      </if>
+      <if test="record.unitName != null">
+        unit_name = #{record.unitName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.taxNumber != null">
+        tax_number = #{record.taxNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="record.amount != null">
+        amount = #{record.amount,jdbcType=DECIMAL},
+      </if>
+      <if test="record.banks != null">
+        banks = #{record.banks,jdbcType=VARCHAR},
+      </if>
+      <if test="record.content != null">
+        content = #{record.content,jdbcType=VARCHAR},
+      </if>
+      <if test="record.unitAddress != null">
+        unit_address = #{record.unitAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="record.invoiceRemarks != null">
+        invoice_remarks = #{record.invoiceRemarks,jdbcType=VARCHAR},
+      </if>
+      <if test="record.unitMobile != null">
+        unit_mobile = #{record.unitMobile,jdbcType=VARCHAR},
+      </if>
+      <if test="record.voucherUrl != null">
+        voucher_url = #{record.voucherUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="record.post != null">
+        post = #{record.post,jdbcType=INTEGER},
+      </if>
+      <if test="record.addressee != null">
+        addressee = #{record.addressee,jdbcType=VARCHAR},
+      </if>
+      <if test="record.addresseeMobile != null">
+        addressee_mobile = #{record.addresseeMobile,jdbcType=VARCHAR},
+      </if>
+      <if test="record.addresseeProvince != null">
+        addressee_province = #{record.addresseeProvince,jdbcType=INTEGER},
+      </if>
+      <if test="record.addresseeCity != null">
+        addressee_city = #{record.addresseeCity,jdbcType=INTEGER},
+      </if>
+      <if test="record.addresseeArea != null">
+        addressee_area = #{record.addresseeArea,jdbcType=INTEGER},
+      </if>
+      <if test="record.recipientAddress != null">
+        recipient_address = #{record.recipientAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.approval != null">
+        approval = #{record.approval,jdbcType=INTEGER},
+      </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 Thu May 16 11:47:09 CST 2019.
+    -->
+    update t_order_invoice
+    set id = #{record.id,jdbcType=INTEGER},
+      order_no = #{record.orderNo,jdbcType=VARCHAR},
+      type = #{record.type,jdbcType=INTEGER},
+      status = #{record.status,jdbcType=INTEGER},
+      reject_reason = #{record.rejectReason,jdbcType=VARCHAR},
+      remarks = #{record.remarks,jdbcType=VARCHAR},
+      invoice_type = #{record.invoiceType,jdbcType=INTEGER},
+      unit_name = #{record.unitName,jdbcType=VARCHAR},
+      tax_number = #{record.taxNumber,jdbcType=VARCHAR},
+      amount = #{record.amount,jdbcType=DECIMAL},
+      banks = #{record.banks,jdbcType=VARCHAR},
+      content = #{record.content,jdbcType=VARCHAR},
+      unit_address = #{record.unitAddress,jdbcType=VARCHAR},
+      invoice_remarks = #{record.invoiceRemarks,jdbcType=VARCHAR},
+      unit_mobile = #{record.unitMobile,jdbcType=VARCHAR},
+      voucher_url = #{record.voucherUrl,jdbcType=VARCHAR},
+      post = #{record.post,jdbcType=INTEGER},
+      addressee = #{record.addressee,jdbcType=VARCHAR},
+      addressee_mobile = #{record.addresseeMobile,jdbcType=VARCHAR},
+      addressee_province = #{record.addresseeProvince,jdbcType=INTEGER},
+      addressee_city = #{record.addresseeCity,jdbcType=INTEGER},
+      addressee_area = #{record.addresseeArea,jdbcType=INTEGER},
+      recipient_address = #{record.recipientAddress,jdbcType=VARCHAR},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      approval = #{record.approval,jdbcType=INTEGER}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderInvoice">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 16 11:47:09 CST 2019.
+    -->
+    update t_order_invoice
+    <set>
+      <if test="orderNo != null">
+        order_no = #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        type = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="status != null">
+        status = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="rejectReason != null">
+        reject_reason = #{rejectReason,jdbcType=VARCHAR},
+      </if>
+      <if test="remarks != null">
+        remarks = #{remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="invoiceType != null">
+        invoice_type = #{invoiceType,jdbcType=INTEGER},
+      </if>
+      <if test="unitName != null">
+        unit_name = #{unitName,jdbcType=VARCHAR},
+      </if>
+      <if test="taxNumber != null">
+        tax_number = #{taxNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="amount != null">
+        amount = #{amount,jdbcType=DECIMAL},
+      </if>
+      <if test="banks != null">
+        banks = #{banks,jdbcType=VARCHAR},
+      </if>
+      <if test="content != null">
+        content = #{content,jdbcType=VARCHAR},
+      </if>
+      <if test="unitAddress != null">
+        unit_address = #{unitAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="invoiceRemarks != null">
+        invoice_remarks = #{invoiceRemarks,jdbcType=VARCHAR},
+      </if>
+      <if test="unitMobile != null">
+        unit_mobile = #{unitMobile,jdbcType=VARCHAR},
+      </if>
+      <if test="voucherUrl != null">
+        voucher_url = #{voucherUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="post != null">
+        post = #{post,jdbcType=INTEGER},
+      </if>
+      <if test="addressee != null">
+        addressee = #{addressee,jdbcType=VARCHAR},
+      </if>
+      <if test="addresseeMobile != null">
+        addressee_mobile = #{addresseeMobile,jdbcType=VARCHAR},
+      </if>
+      <if test="addresseeProvince != null">
+        addressee_province = #{addresseeProvince,jdbcType=INTEGER},
+      </if>
+      <if test="addresseeCity != null">
+        addressee_city = #{addresseeCity,jdbcType=INTEGER},
+      </if>
+      <if test="addresseeArea != null">
+        addressee_area = #{addresseeArea,jdbcType=INTEGER},
+      </if>
+      <if test="recipientAddress != null">
+        recipient_address = #{recipientAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="approval != null">
+        approval = #{approval,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderInvoice">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 16 11:47:09 CST 2019.
+    -->
+    update t_order_invoice
+    set order_no = #{orderNo,jdbcType=VARCHAR},
+      type = #{type,jdbcType=INTEGER},
+      status = #{status,jdbcType=INTEGER},
+      reject_reason = #{rejectReason,jdbcType=VARCHAR},
+      remarks = #{remarks,jdbcType=VARCHAR},
+      invoice_type = #{invoiceType,jdbcType=INTEGER},
+      unit_name = #{unitName,jdbcType=VARCHAR},
+      tax_number = #{taxNumber,jdbcType=VARCHAR},
+      amount = #{amount,jdbcType=DECIMAL},
+      banks = #{banks,jdbcType=VARCHAR},
+      content = #{content,jdbcType=VARCHAR},
+      unit_address = #{unitAddress,jdbcType=VARCHAR},
+      invoice_remarks = #{invoiceRemarks,jdbcType=VARCHAR},
+      unit_mobile = #{unitMobile,jdbcType=VARCHAR},
+      voucher_url = #{voucherUrl,jdbcType=VARCHAR},
+      post = #{post,jdbcType=INTEGER},
+      addressee = #{addressee,jdbcType=VARCHAR},
+      addressee_mobile = #{addresseeMobile,jdbcType=VARCHAR},
+      addressee_province = #{addresseeProvince,jdbcType=INTEGER},
+      addressee_city = #{addresseeCity,jdbcType=INTEGER},
+      addressee_area = #{addresseeArea,jdbcType=INTEGER},
+      recipient_address = #{recipientAddress,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      approval = #{approval,jdbcType=INTEGER}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <select id="checkApplyAmount" resultType="Integer">
+  select ifnull(sum(amount),0) from t_order_invoice
+	where order_no= #{orderNo,jdbcType=VARCHAR}  and status !=4
+	<if test="id != null">
+	and id != #{id,jdbcType=INTEGER}
+	</if>
+  </select>
+  <select id="financeOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
+     select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,
+     ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%I:%S')as createTime from t_order_invoice a 
+	left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
+	left join (select order_no,sum(amount)as  sumAmount from t_order_invoice where status =2 group by order_no) d
+	on a.order_no=d.order_no where a.status in (1,2) and a.approval in (0,2) 
+	<if test="financeId !=null">
+	and b.finance_id= #{financeId,jdbcType=VARCHAR}
+	</if>
+	<if test="orderNo !=null">
+	and a.order_no = #{orderNo,jdbcType=VARCHAR}
+	</if>
+	<if test="name !=null">
+	and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="orderDep !=null">
+	and b.order_dep= #{orderDep,jdbcType=VARCHAR}
+	</if>
+	order by a.create_time desc
+	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id="financeOrderInvoiceCount" resultType="java.lang.Integer">
+  	select count(*) from t_order_invoice a 
+	left join t_order_new b on a.order_no=b.order_no 
+	left join admin c on b.salesman_id=c.id
+	where a.status in (1,2)
+	<if test="financeId !=null">
+	and b.finance_id= #{financeId,jdbcType=VARCHAR}
+	</if>
+	<if test="orderNo !=null">
+	and a.order_no = #{orderNo,jdbcType=VARCHAR}
+	</if>
+	<if test="name !=null">
+	and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="orderDep !=null">
+	and b.order_dep= #{orderDep,jdbcType=VARCHAR}
+	</if>
+  </select>
+  
+  <select id="salesmanOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
+    select id ,order_no as orderNo,amount,date_format(create_time,'%Y-%m-%d %H:%I:%S') as createTime,
+	status from t_order_invoice
+	where status !=4
+	<if test="orderNo !=null">
+	and order_no = #{orderNo,jdbcType=VARCHAR}
+	</if>
+	order by create_time desc
+	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id="salesmanOrderInvoiceCount" resultType="java.lang.Integer">
+   select count(*) where status !=4
+	<if test="orderNo !=null">
+	and order_no = #{orderNo,jdbcType=VARCHAR}
+	</if>
+  </select>
+  
+  <select id="approvalOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
+     select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,
+     ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%I:%S')as createTime from t_order_invoice a 
+	left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
+	left join (select order_no,sum(amount)as  sumAmount from t_order_invoice where status =2 group by order_no) d
+	on a.order_no=d.order_no where a.status =1 and a.approval =1
+	<if test="type !=null">
+	and a.type= #{type,jdbcType=INTEGER}
+	</if>
+	<if test="orderNo !=null">
+	and a.order_no = #{orderNo,jdbcType=VARCHAR}
+	</if>
+	<if test="name !=null">
+	and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="orderDep !=null">
+	and b.order_dep= #{orderDep,jdbcType=VARCHAR}
+	</if>
+	order by a.create_time desc
+	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id="approvalOrderInvoiceCount" resultType="java.lang.Integer">
+  	   select count(*) from t_order_invoice a 
+	left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
+	where a.status =1 and a.approval =1
+	<if test="type !=null">
+	and a.type= #{type,jdbcType=INTEGER}
+	</if>
+	<if test="orderNo !=null">
+	and a.order_no = #{orderNo,jdbcType=VARCHAR}
+	</if>
+	<if test="name !=null">
+	and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="orderDep !=null">
+	and b.order_dep= #{orderDep,jdbcType=VARCHAR}
+	</if>
+  </select>
+</mapper>

+ 623 - 0
src/main/java/com/goafanti/common/model/TOrderInvoice.java

@@ -0,0 +1,623 @@
+package com.goafanti.common.model;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+
+public class TOrderInvoice {
+
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.id
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private Integer id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.order_no
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String orderNo;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.type
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private Integer type;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.status
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private Integer status;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.reject_reason
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String rejectReason;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.remarks
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String remarks;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.invoice_type
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private Integer invoiceType;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.unit_name
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String unitName;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.tax_number
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String taxNumber;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.amount
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private BigDecimal amount;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.banks
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String banks;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.content
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String content;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.unit_address
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String unitAddress;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.invoice_remarks
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String invoiceRemarks;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.unit_mobile
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String unitMobile;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.voucher_url
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String voucherUrl;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.post
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private Integer post;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.addressee
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String addressee;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.addressee_mobile
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String addresseeMobile;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.addressee_province
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private Integer addresseeProvince;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.addressee_city
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private Integer addresseeCity;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.addressee_area
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private Integer addresseeArea;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.recipient_address
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private String recipientAddress;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.create_time
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private Date createTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.update_time
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private Date updateTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_invoice.approval
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	private Integer approval;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.id
+	 * @return  the value of t_order_invoice.id
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public Integer getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.id
+	 * @param id  the value for t_order_invoice.id
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.order_no
+	 * @return  the value of t_order_invoice.order_no
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getOrderNo() {
+		return orderNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.order_no
+	 * @param orderNo  the value for t_order_invoice.order_no
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.type
+	 * @return  the value of t_order_invoice.type
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public Integer getType() {
+		return type;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.type
+	 * @param type  the value for t_order_invoice.type
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.status
+	 * @return  the value of t_order_invoice.status
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public Integer getStatus() {
+		return status;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.status
+	 * @param status  the value for t_order_invoice.status
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.reject_reason
+	 * @return  the value of t_order_invoice.reject_reason
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getRejectReason() {
+		return rejectReason;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.reject_reason
+	 * @param rejectReason  the value for t_order_invoice.reject_reason
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setRejectReason(String rejectReason) {
+		this.rejectReason = rejectReason;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.remarks
+	 * @return  the value of t_order_invoice.remarks
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getRemarks() {
+		return remarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.remarks
+	 * @param remarks  the value for t_order_invoice.remarks
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setRemarks(String remarks) {
+		this.remarks = remarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.invoice_type
+	 * @return  the value of t_order_invoice.invoice_type
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public Integer getInvoiceType() {
+		return invoiceType;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.invoice_type
+	 * @param invoiceType  the value for t_order_invoice.invoice_type
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setInvoiceType(Integer invoiceType) {
+		this.invoiceType = invoiceType;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.unit_name
+	 * @return  the value of t_order_invoice.unit_name
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getUnitName() {
+		return unitName;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.unit_name
+	 * @param unitName  the value for t_order_invoice.unit_name
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setUnitName(String unitName) {
+		this.unitName = unitName;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.tax_number
+	 * @return  the value of t_order_invoice.tax_number
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getTaxNumber() {
+		return taxNumber;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.tax_number
+	 * @param taxNumber  the value for t_order_invoice.tax_number
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setTaxNumber(String taxNumber) {
+		this.taxNumber = taxNumber;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.amount
+	 * @return  the value of t_order_invoice.amount
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public BigDecimal getAmount() {
+		return amount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.amount
+	 * @param amount  the value for t_order_invoice.amount
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setAmount(BigDecimal amount) {
+		this.amount = amount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.banks
+	 * @return  the value of t_order_invoice.banks
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getBanks() {
+		return banks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.banks
+	 * @param banks  the value for t_order_invoice.banks
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setBanks(String banks) {
+		this.banks = banks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.content
+	 * @return  the value of t_order_invoice.content
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getContent() {
+		return content;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.content
+	 * @param content  the value for t_order_invoice.content
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setContent(String content) {
+		this.content = content;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.unit_address
+	 * @return  the value of t_order_invoice.unit_address
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getUnitAddress() {
+		return unitAddress;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.unit_address
+	 * @param unitAddress  the value for t_order_invoice.unit_address
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setUnitAddress(String unitAddress) {
+		this.unitAddress = unitAddress;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.invoice_remarks
+	 * @return  the value of t_order_invoice.invoice_remarks
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getInvoiceRemarks() {
+		return invoiceRemarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.invoice_remarks
+	 * @param invoiceRemarks  the value for t_order_invoice.invoice_remarks
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setInvoiceRemarks(String invoiceRemarks) {
+		this.invoiceRemarks = invoiceRemarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.unit_mobile
+	 * @return  the value of t_order_invoice.unit_mobile
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getUnitMobile() {
+		return unitMobile;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.unit_mobile
+	 * @param unitMobile  the value for t_order_invoice.unit_mobile
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setUnitMobile(String unitMobile) {
+		this.unitMobile = unitMobile;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.voucher_url
+	 * @return  the value of t_order_invoice.voucher_url
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getVoucherUrl() {
+		return voucherUrl;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.voucher_url
+	 * @param voucherUrl  the value for t_order_invoice.voucher_url
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setVoucherUrl(String voucherUrl) {
+		this.voucherUrl = voucherUrl;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.post
+	 * @return  the value of t_order_invoice.post
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public Integer getPost() {
+		return post;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.post
+	 * @param post  the value for t_order_invoice.post
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setPost(Integer post) {
+		this.post = post;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.addressee
+	 * @return  the value of t_order_invoice.addressee
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getAddressee() {
+		return addressee;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.addressee
+	 * @param addressee  the value for t_order_invoice.addressee
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setAddressee(String addressee) {
+		this.addressee = addressee;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.addressee_mobile
+	 * @return  the value of t_order_invoice.addressee_mobile
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getAddresseeMobile() {
+		return addresseeMobile;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.addressee_mobile
+	 * @param addresseeMobile  the value for t_order_invoice.addressee_mobile
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setAddresseeMobile(String addresseeMobile) {
+		this.addresseeMobile = addresseeMobile;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.addressee_province
+	 * @return  the value of t_order_invoice.addressee_province
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public Integer getAddresseeProvince() {
+		return addresseeProvince;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.addressee_province
+	 * @param addresseeProvince  the value for t_order_invoice.addressee_province
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setAddresseeProvince(Integer addresseeProvince) {
+		this.addresseeProvince = addresseeProvince;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.addressee_city
+	 * @return  the value of t_order_invoice.addressee_city
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public Integer getAddresseeCity() {
+		return addresseeCity;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.addressee_city
+	 * @param addresseeCity  the value for t_order_invoice.addressee_city
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setAddresseeCity(Integer addresseeCity) {
+		this.addresseeCity = addresseeCity;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.addressee_area
+	 * @return  the value of t_order_invoice.addressee_area
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public Integer getAddresseeArea() {
+		return addresseeArea;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.addressee_area
+	 * @param addresseeArea  the value for t_order_invoice.addressee_area
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setAddresseeArea(Integer addresseeArea) {
+		this.addresseeArea = addresseeArea;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.recipient_address
+	 * @return  the value of t_order_invoice.recipient_address
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public String getRecipientAddress() {
+		return recipientAddress;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.recipient_address
+	 * @param recipientAddress  the value for t_order_invoice.recipient_address
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setRecipientAddress(String recipientAddress) {
+		this.recipientAddress = recipientAddress;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.create_time
+	 * @return  the value of t_order_invoice.create_time
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.create_time
+	 * @param createTime  the value for t_order_invoice.create_time
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.update_time
+	 * @return  the value of t_order_invoice.update_time
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public Date getUpdateTime() {
+		return updateTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.update_time
+	 * @param updateTime  the value for t_order_invoice.update_time
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_invoice.approval
+	 * @return  the value of t_order_invoice.approval
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public Integer getApproval() {
+		return approval;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_invoice.approval
+	 * @param approval  the value for t_order_invoice.approval
+	 * @mbg.generated  Thu May 16 11:47:08 CST 2019
+	 */
+	public void setApproval(Integer approval) {
+		this.approval = approval;
+	}
+
+	public String getCreateTimes() {
+		if(this.createTime==null) {
+			return null;
+		}else {
+			return DateFormatUtils.format(this.createTime, AFTConstants.YYYYMMDDHHMMSS);
+		}
+			
+	}
+
+	
+
+	
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1963 - 0
src/main/java/com/goafanti/common/model/TOrderInvoiceExample.java


+ 70 - 0
src/main/java/com/goafanti/order/bo/TOrderInvoiceBo.java

@@ -0,0 +1,70 @@
+package com.goafanti.order.bo;
+
+public class TOrderInvoiceBo {
+	private Integer id;
+	private String unitName;
+	private String orderno;
+	private String name;
+	private Integer projectStatus;
+	private String sumAmount;
+	private String amount;
+	private String createTime;
+	private Integer status;
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public String getUnitName() {
+		return unitName;
+	}
+	public void setUnitName(String unitName) {
+		this.unitName = unitName;
+	}
+	public String getOrderno() {
+		return orderno;
+	}
+	public void setOrderno(String orderno) {
+		this.orderno = orderno;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public Integer getProjectStatus() {
+		return projectStatus;
+	}
+	public void setProjectStatus(Integer projectStatus) {
+		this.projectStatus = projectStatus;
+	}
+	
+	public String getCreateTime() {
+		return createTime;
+	}
+	public void setCreateTime(String createTime) {
+		this.createTime = createTime;
+	}
+	public String getAmount() {
+		return amount;
+	}
+	public void setAmount(String amount) {
+		this.amount = amount;
+	}
+	public String getSumAmount() {
+		return sumAmount;
+	}
+	public void setSumAmount(String sumAmount) {
+		this.sumAmount = sumAmount;
+	}
+	public Integer getStatus() {
+		return status;
+	}
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	
+	
+}

+ 192 - 0
src/main/java/com/goafanti/order/controller/OrderInvoiceApiController.java

@@ -0,0 +1,192 @@
+package com.goafanti.order.controller;
+
+
+
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.model.TOrderInvoice;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.order.service.OrderInvoiceService;
+
+@RestController
+@RequestMapping(value = "/api/admin/orderInvoice")
+public class OrderInvoiceApiController extends CertifyApiController {
+	
+	@Autowired
+	private OrderInvoiceService		orderInvoiceService;
+	
+	/**
+	 * 创建发票申请
+	 * @param uid
+	 * @param orderType
+	 * @return
+	 */
+	@RequestMapping(value = "/createOrderInvoice",method = RequestMethod.POST)
+	public Result createOrderInvoice(TOrderInvoice t,Integer submit ){
+		Result res = new Result();
+		if(t==null||null==t.getInvoiceType()||StringUtils.isBlank(t.getTaxNumber())||
+				null==t.getAmount()||null==t.getBanks()||StringUtils.isBlank(t.getContent())
+				||StringUtils.isBlank(t.getUnitAddress())||StringUtils.isBlank(t.getUnitMobile())
+				||StringUtils.isBlank(t.getUnitName())||StringUtils.isBlank(t.getVoucherUrl())
+				||StringUtils.isAnyBlank(t.getOrderNo())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","基本资料"));
+			return res;
+		}
+		//status 0保存 1提交
+		if(orderInvoiceService.checkAmount(t)) {
+			res.getError().add(buildError("","可开票余额不足!"));
+			return res;
+		}
+		res.data(orderInvoiceService.createServiceOrder(t));
+		return res;
+	}
+	
+	
+	/**
+	   *   发票申请详情
+	 * @param uid
+	 * @param orderType
+	 * @return
+	 */
+	@RequestMapping(value = "/selectByIdOrderInvoice",method = RequestMethod.GET)
+	public Result selectByIdOrderInvoice(Integer id){
+		Result res = new Result();
+		if(id==null){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","ID"));
+			return res;
+		}
+		
+		res.data(orderInvoiceService.selectByIdOrderInvoice(id));
+		return res;
+	}
+	/**
+	 * 修改发票申请
+	 * @param uid
+	 * @param orderType
+	 * @return
+	 */
+	@RequestMapping(value = "/updateOrderInvoice",method = RequestMethod.POST)
+	public Result updateOrderInvoice(TOrderInvoice t){
+		Result res = new Result();
+		if(t==null||null==t.getInvoiceType()||StringUtils.isBlank(t.getTaxNumber())||
+				null==t.getAmount()||null==t.getBanks()||StringUtils.isBlank(t.getContent())
+				||StringUtils.isBlank(t.getUnitAddress())||StringUtils.isBlank(t.getUnitMobile())
+				||StringUtils.isBlank(t.getUnitName())||StringUtils.isBlank(t.getVoucherUrl())
+				||StringUtils.isAnyBlank(t.getOrderNo())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","基本资料"));
+			return res;
+		}
+		if(orderInvoiceService.checkAmount(t)) {
+			res.getError().add(buildError("","可开票余额不足!"));
+			return res;
+		}
+		res.data(orderInvoiceService.updateServiceOrder(t));
+		return res;
+	}
+	
+	
+	/**
+	 *  财务开票列表
+	 * @param uid
+	 * @param orderType
+	 * @return
+	 */
+	@RequestMapping(value = "/financeOrderInvoiceList",method = RequestMethod.GET)
+	public Result financeOrderInvoiceList(String depId,String orderNo ,String name,Integer pageNo,Integer pageSize){
+		Result res = new Result();
+		
+		res.data(orderInvoiceService.financeOrderInvoiceList( depId, orderNo , name,pageNo,pageSize));
+		return res;
+	}
+	/**
+	 *  开票特批列表
+	 * @param uid
+	 * @param orderType
+	 * @return
+	 */
+	@RequestMapping(value = "/approvalOrderInvoiceList",method = RequestMethod.GET)
+	public Result approvalOrderInvoiceList(Integer type,String depId,String orderNo ,String name,Integer pageNo,Integer pageSize){
+		Result res = new Result();
+		
+		res.data(orderInvoiceService.approvalOrderInvoiceList(type, depId, orderNo , name,pageNo,pageSize));
+		return res;
+	}
+	
+	/**
+	 *   开票审核
+	 * @param uid
+	 * @param orderType
+	 * @return
+	 */
+	@RequestMapping(value = "/financeExamine",method = RequestMethod.POST)
+	public Result financeExamine(Integer id,Integer examine,String reason){
+		Result res = new Result();
+		if(id==null){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","ID"));
+			return res;
+		}
+		//examine 2通过 3拒绝
+		if (examine==3&&StringUtils.isBlank(reason)) {
+			res.getError().add(buildError("","拒绝必须填写原因。"));
+			return res;
+		}
+		res.data(orderInvoiceService.updatefinanceExamine( id, examine, reason));
+		return res;
+	}
+	
+	/**
+	 *   开票审核
+	 * @param uid
+	 * @param orderType
+	 * @return
+	 */
+	@RequestMapping(value = "/approvalExamine",method = RequestMethod.POST)
+	public Result approvalExamine(Integer id,Integer examine,String reason){
+		Result res = new Result();
+		if(id==null){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","ID"));
+			return res;
+		}
+		//examine 2通过 3拒绝
+		if (examine==3&&StringUtils.isBlank(reason)) {
+			res.getError().add(buildError("","拒绝必须填写原因。"));
+			return res;
+		}
+		res.data(orderInvoiceService.updateapprovalExamine( id, examine, reason));
+		return res;
+	}
+	
+	/**
+	 *   订单开票列表
+	 * @param uid
+	 * @param orderType
+	 * @return
+	 */
+	@RequestMapping(value = "/salesmanOrderInvoiceList",method = RequestMethod.GET)
+	public Result salesmanOrderInvoiceList(String orderNo,Integer pageNo,Integer pageSize){
+		Result res = new Result();
+		if(StringUtils.isBlank(orderNo)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
+			return res;
+		}
+		res.data(orderInvoiceService.salesmanOrderInvoiceList(  orderNo, pageNo,pageSize));
+		return res;
+	}
+	/** 开票文件上传 **/
+	@RequestMapping(value = "/uploadOrderInvoiceFile", method = RequestMethod.POST)
+	public Result uploadOrderInvoiceFile(HttpServletRequest req,String sign){
+		Result res = new Result();
+		//order_invoice_file
+		res.setData(handleFile(res, "/order_invoice_file/", false, req, sign));
+		return res;
+	}
+}

+ 46 - 0
src/main/java/com/goafanti/order/service/OrderInvoiceService.java

@@ -0,0 +1,46 @@
+package com.goafanti.order.service;
+
+
+
+import com.goafanti.common.model.TOrderInvoice;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.bo.TOrderInvoiceBo;
+
+public interface OrderInvoiceService {
+	/**
+	 * 创建发票申请
+	 * @param uid
+	 * @param orderType
+	 * @return
+	 */
+	int createServiceOrder(TOrderInvoice t);
+	
+	/**
+	 * 修改发票申请
+	 * @param uid
+	 * @param orderType
+	 * @return
+	 */
+	int updateServiceOrder(TOrderInvoice t);
+
+	boolean checkAmount(TOrderInvoice t);
+
+	
+
+	Pagination<TOrderInvoiceBo> financeOrderInvoiceList(String depId, String orderNo, String name, Integer pageNo, Integer pageSize);
+
+	TOrderInvoice selectByIdOrderInvoice(Integer id);
+
+	Pagination<TOrderInvoiceBo> salesmanOrderInvoiceList( String orderNo,  Integer pageNo, Integer pageSize);
+
+	int updatefinanceExamine(Integer id, Integer examine, String reason);
+
+	Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer type, String depId, String orderNo, String name, Integer pageNo,
+			Integer pageSize);
+
+	int updateapprovalExamine(Integer id, Integer examine, String reason);
+
+	
+	
+	
+}

+ 118 - 0
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -0,0 +1,118 @@
+package com.goafanti.order.service.impl;
+
+
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.TOrderInvoiceMapper;
+import com.goafanti.common.dao.TOrderNewMapper;
+import com.goafanti.common.model.TOrderInvoice;
+import com.goafanti.common.model.TOrderNew;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.TOrderInvoiceBo;
+import com.goafanti.order.service.OrderInvoiceService;
+
+@Service
+public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper> implements OrderInvoiceService {
+	@Autowired
+	TOrderInvoiceMapper tOrderInvoiceMapper;
+	@Autowired
+	TOrderNewMapper		tOrderNewMapper;
+	@Override
+	public int createServiceOrder(TOrderInvoice o) {
+		
+		return tOrderInvoiceMapper.insertSelective(o);
+	}
+
+	@Override
+	public int updateServiceOrder(TOrderInvoice o) {
+		return tOrderInvoiceMapper.updateByPrimaryKeySelective(o);
+	}
+
+	@Override
+	public boolean checkAmount(TOrderInvoice t) {
+		TOrderNew tn=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
+		
+			int i=tOrderInvoiceMapper.checkApplyAmount(t.getOrderNo(),t.getId());//新建时直接查所有数据,修改时除掉修改订单
+		int	flag=t.getAmount().add(new BigDecimal(i)).compareTo(tn.getTotalAmount());
+		if (flag>0) {
+			return true;
+		}
+		return false;
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<TOrderInvoiceBo> financeOrderInvoiceList(String depId, String orderNo, String name, Integer pageNo,
+			Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(pageSize==null||pageSize<0)pageSize=10;
+		if(pageNo==null||pageNo<0)pageNo=1;
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
+			params.put("financeId", TokenManager.getAdminId());
+		}
+		if(StringUtils.isNotBlank(depId))params.put("depId", depId);
+		if(StringUtils.isNotBlank(orderNo))params.put("orderNo", orderNo);
+		if(StringUtils.isNotBlank(name))params.put("name", name);
+		return (Pagination<TOrderInvoiceBo>)findPage("financeOrderInvoiceList", "financeOrderInvoiceCount", params, pageNo, pageSize);
+		
+	}
+
+	@Override
+	public TOrderInvoice selectByIdOrderInvoice(Integer id) {
+		return tOrderInvoiceMapper.selectByPrimaryKey(id);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<TOrderInvoiceBo> salesmanOrderInvoiceList( String orderNo, 
+			Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(pageSize==null||pageSize<0)pageSize=10;
+		if(pageNo==null||pageNo<0)pageNo=1;
+		if(StringUtils.isNotBlank(orderNo))params.put("orderNo", orderNo);
+		return (Pagination<TOrderInvoiceBo>)findPage("salesmanOrderInvoiceList", "salesmanOrderInvoiceCount", params, pageNo, pageSize);
+	}
+
+	@Override
+	public int updatefinanceExamine(Integer id, Integer examine, String reason) {
+		TOrderInvoice t=new TOrderInvoice();
+		t.setId(id);
+		t.setRejectReason(reason);
+		t.setStatus(examine);
+		return tOrderInvoiceMapper.updateByPrimaryKeySelective(t);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer type, String depId, String orderNo, String name,
+			Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(pageSize==null||pageSize<0)pageSize=10;
+		if(pageNo==null||pageNo<0)pageNo=1;
+		if(StringUtils.isNotBlank(depId))params.put("depId", depId);
+		if(StringUtils.isNotBlank(orderNo))params.put("orderNo", orderNo);
+		if(StringUtils.isNotBlank(name))params.put("name", name);
+		if(type!=null)params.put("type", type);
+		return (Pagination<TOrderInvoiceBo>)findPage("approvalOrderInvoiceList", "approvalOrderInvoiceCount", params, pageNo, pageSize);
+	}
+
+	@Override
+	public int updateapprovalExamine(Integer id, Integer examine, String reason) {
+		TOrderInvoice t=new TOrderInvoice();
+		t.setId(id);
+		t.setRejectReason(reason);
+		t.setStatus(examine);
+		t.setApproval(examine);
+		return tOrderInvoiceMapper.updateByPrimaryKeySelective(t);
+	}
+
+}