Преглед изворни кода

Merge branch 'test' of jishutao/kede-server into prod

anderx пре 6 година
родитељ
комит
f7ecff3922

+ 1 - 1
GeneratorConfig.xml

@@ -9,6 +9,6 @@
     <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="kede-server" />
     <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="kede-server" />
     <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="kede-server" type="XMLMAPPER" />
-    <table schema="aft" tableName="order_examine"/>
+    <table schema="aft" tableName="idle_contract_no"/>
   </context>
 </generatorConfiguration>

+ 98 - 0
src/main/java/com/goafanti/common/dao/IdleContractNoMapper.java

@@ -0,0 +1,98 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.IdleContractNo;
+import com.goafanti.common.model.IdleContractNoExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface IdleContractNoMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    long countByExample(IdleContractNoExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    int deleteByExample(IdleContractNoExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    int insert(IdleContractNo record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    int insertSelective(IdleContractNo record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:16 CST 2019
+     */
+    List<IdleContractNo> selectByExample(IdleContractNoExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:16 CST 2019
+     */
+    IdleContractNo selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:16 CST 2019
+     */
+    int updateByExampleSelective(@Param("record") IdleContractNo record, @Param("example") IdleContractNoExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:16 CST 2019
+     */
+    int updateByExample(@Param("record") IdleContractNo record, @Param("example") IdleContractNoExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:16 CST 2019
+     */
+    int updateByPrimaryKeySelective(IdleContractNo record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:16 CST 2019
+     */
+    int updateByPrimaryKey(IdleContractNo record);
+
+	IdleContractNo selectByAbbreviation(String abbreviation);
+}

+ 308 - 0
src/main/java/com/goafanti/common/mapper/IdleContractNoMapper.xml

@@ -0,0 +1,308 @@
+<?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.IdleContractNoMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.IdleContractNo">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="abbreviation" jdbcType="VARCHAR" property="abbreviation" />
+    <result column="used_order_no" jdbcType="VARCHAR" property="usedOrderNo" />
+    <result column="contract_no" jdbcType="VARCHAR" property="contractNo" />
+    <result column="aid" jdbcType="VARCHAR" property="aid" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Sep 30 16:05:16 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 Mon Sep 30 16:05:16 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 Mon Sep 30 16:05:16 CST 2019.
+    -->
+    id, abbreviation, used_order_no, contract_no, aid, create_time
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.IdleContractNoExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from idle_contract_no
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from idle_contract_no
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+    -->
+    delete from idle_contract_no
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.IdleContractNoExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+    -->
+    delete from idle_contract_no
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.IdleContractNo">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+    -->
+    insert into idle_contract_no (id, abbreviation, used_order_no, 
+      contract_no, aid, create_time
+      )
+    values (#{id,jdbcType=INTEGER}, #{abbreviation,jdbcType=VARCHAR}, #{usedOrderNo,jdbcType=VARCHAR}, 
+      #{contractNo,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.IdleContractNo">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+    -->
+    insert into idle_contract_no
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="abbreviation != null">
+        abbreviation,
+      </if>
+      <if test="usedOrderNo != null">
+        used_order_no,
+      </if>
+      <if test="contractNo != null">
+        contract_no,
+      </if>
+      <if test="aid != null">
+        aid,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="abbreviation != null">
+        #{abbreviation,jdbcType=VARCHAR},
+      </if>
+      <if test="usedOrderNo != null">
+        #{usedOrderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="contractNo != null">
+        #{contractNo,jdbcType=VARCHAR},
+      </if>
+      <if test="aid != null">
+        #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.IdleContractNoExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+    -->
+    select count(*) from idle_contract_no
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+    -->
+    update idle_contract_no
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.abbreviation != null">
+        abbreviation = #{record.abbreviation,jdbcType=VARCHAR},
+      </if>
+      <if test="record.usedOrderNo != null">
+        used_order_no = #{record.usedOrderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="record.contractNo != null">
+        contract_no = #{record.contractNo,jdbcType=VARCHAR},
+      </if>
+      <if test="record.aid != null">
+        aid = #{record.aid,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 Mon Sep 30 16:05:16 CST 2019.
+    -->
+    update idle_contract_no
+    set id = #{record.id,jdbcType=INTEGER},
+      abbreviation = #{record.abbreviation,jdbcType=VARCHAR},
+      used_order_no = #{record.usedOrderNo,jdbcType=VARCHAR},
+      contract_no = #{record.contractNo,jdbcType=VARCHAR},
+      aid = #{record.aid,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.IdleContractNo">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+    -->
+    update idle_contract_no
+    <set>
+      <if test="abbreviation != null">
+        abbreviation = #{abbreviation,jdbcType=VARCHAR},
+      </if>
+      <if test="usedOrderNo != null">
+        used_order_no = #{usedOrderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="contractNo != null">
+        contract_no = #{contractNo,jdbcType=VARCHAR},
+      </if>
+      <if test="aid != null">
+        aid = #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.IdleContractNo">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+    -->
+    update idle_contract_no
+    set abbreviation = #{abbreviation,jdbcType=VARCHAR},
+      used_order_no = #{usedOrderNo,jdbcType=VARCHAR},
+      contract_no = #{contractNo,jdbcType=VARCHAR},
+      aid = #{aid,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <select id="selectByAbbreviation" resultType="com.goafanti.common.model.IdleContractNo">
+	select a.id,a.abbreviation,a.used_order_no usedOrderNo,a.aid,a.create_time createTime,a.contract_no contractNo from idle_contract_no a
+	where abbreviation= #{abbreviation,jdbcType=VARCHAR} 
+	and a.contract_no=(select max(contract_no)from idle_contract_no where abbreviation= #{abbreviation,jdbcType=VARCHAR})
+  </select>
+</mapper>

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

@@ -743,6 +743,9 @@
 	<if test="name !=null">
 	and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
 	</if>
+	<if test="userName !=null">
+	and a.unit_name like CONCAT('%',#{userName,jdbcType=VARCHAR},'%')
+	</if>
 	<if test="orderDep !=null">
 	and b.order_dep= #{orderDep,jdbcType=VARCHAR}
 	</if>
@@ -780,6 +783,9 @@
 	<if test="name !=null">
 	and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
 	</if>
+	<if test="userName !=null">
+	and a.unit_name like CONCAT('%',#{userName,jdbcType=VARCHAR},'%')
+	</if>
 	<if test="orderDep !=null">
 	and b.order_dep= #{orderDep,jdbcType=VARCHAR}
 	</if>

+ 203 - 0
src/main/java/com/goafanti/common/model/IdleContractNo.java

@@ -0,0 +1,203 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class IdleContractNo {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column idle_contract_no.id
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    private Integer id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column idle_contract_no.abbreviation
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    private String abbreviation;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column idle_contract_no.used_order_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    private String usedOrderNo;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column idle_contract_no.contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    private String contractNo;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column idle_contract_no.aid
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    private String aid;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column idle_contract_no.create_time
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    private Date createTime;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column idle_contract_no.id
+     *
+     * @return the value of idle_contract_no.id
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column idle_contract_no.id
+     *
+     * @param id the value for idle_contract_no.id
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 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 idle_contract_no.abbreviation
+     *
+     * @return the value of idle_contract_no.abbreviation
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public String getAbbreviation() {
+        return abbreviation;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column idle_contract_no.abbreviation
+     *
+     * @param abbreviation the value for idle_contract_no.abbreviation
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public void setAbbreviation(String abbreviation) {
+        this.abbreviation = abbreviation;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column idle_contract_no.used_order_no
+     *
+     * @return the value of idle_contract_no.used_order_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public String getUsedOrderNo() {
+        return usedOrderNo;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column idle_contract_no.used_order_no
+     *
+     * @param usedOrderNo the value for idle_contract_no.used_order_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public void setUsedOrderNo(String usedOrderNo) {
+        this.usedOrderNo = usedOrderNo;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column idle_contract_no.contract_no
+     *
+     * @return the value of idle_contract_no.contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public String getContractNo() {
+        return contractNo;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column idle_contract_no.contract_no
+     *
+     * @param contractNo the value for idle_contract_no.contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public void setContractNo(String contractNo) {
+        this.contractNo = contractNo;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column idle_contract_no.aid
+     *
+     * @return the value of idle_contract_no.aid
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public String getAid() {
+        return aid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column idle_contract_no.aid
+     *
+     * @param aid the value for idle_contract_no.aid
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column idle_contract_no.create_time
+     *
+     * @return the value of idle_contract_no.create_time
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column idle_contract_no.create_time
+     *
+     * @param createTime the value for idle_contract_no.create_time
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 703 - 0
src/main/java/com/goafanti/common/model/IdleContractNoExample.java

@@ -0,0 +1,703 @@
+package com.goafanti.common.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class IdleContractNoExample {
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    protected String orderByClause;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    protected boolean distinct;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    protected List<Criteria> oredCriteria;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public IdleContractNoExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Integer value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Integer value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Integer value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Integer value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Integer> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Integer> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Integer value1, Integer value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationIsNull() {
+            addCriterion("abbreviation is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationIsNotNull() {
+            addCriterion("abbreviation is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationEqualTo(String value) {
+            addCriterion("abbreviation =", value, "abbreviation");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationNotEqualTo(String value) {
+            addCriterion("abbreviation <>", value, "abbreviation");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationGreaterThan(String value) {
+            addCriterion("abbreviation >", value, "abbreviation");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationGreaterThanOrEqualTo(String value) {
+            addCriterion("abbreviation >=", value, "abbreviation");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationLessThan(String value) {
+            addCriterion("abbreviation <", value, "abbreviation");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationLessThanOrEqualTo(String value) {
+            addCriterion("abbreviation <=", value, "abbreviation");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationLike(String value) {
+            addCriterion("abbreviation like", value, "abbreviation");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationNotLike(String value) {
+            addCriterion("abbreviation not like", value, "abbreviation");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationIn(List<String> values) {
+            addCriterion("abbreviation in", values, "abbreviation");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationNotIn(List<String> values) {
+            addCriterion("abbreviation not in", values, "abbreviation");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationBetween(String value1, String value2) {
+            addCriterion("abbreviation between", value1, value2, "abbreviation");
+            return (Criteria) this;
+        }
+
+        public Criteria andAbbreviationNotBetween(String value1, String value2) {
+            addCriterion("abbreviation not between", value1, value2, "abbreviation");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoIsNull() {
+            addCriterion("used_order_no is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoIsNotNull() {
+            addCriterion("used_order_no is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoEqualTo(String value) {
+            addCriterion("used_order_no =", value, "usedOrderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoNotEqualTo(String value) {
+            addCriterion("used_order_no <>", value, "usedOrderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoGreaterThan(String value) {
+            addCriterion("used_order_no >", value, "usedOrderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoGreaterThanOrEqualTo(String value) {
+            addCriterion("used_order_no >=", value, "usedOrderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoLessThan(String value) {
+            addCriterion("used_order_no <", value, "usedOrderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoLessThanOrEqualTo(String value) {
+            addCriterion("used_order_no <=", value, "usedOrderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoLike(String value) {
+            addCriterion("used_order_no like", value, "usedOrderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoNotLike(String value) {
+            addCriterion("used_order_no not like", value, "usedOrderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoIn(List<String> values) {
+            addCriterion("used_order_no in", values, "usedOrderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoNotIn(List<String> values) {
+            addCriterion("used_order_no not in", values, "usedOrderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoBetween(String value1, String value2) {
+            addCriterion("used_order_no between", value1, value2, "usedOrderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andUsedOrderNoNotBetween(String value1, String value2) {
+            addCriterion("used_order_no not between", value1, value2, "usedOrderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoIsNull() {
+            addCriterion("contract_no is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoIsNotNull() {
+            addCriterion("contract_no is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoEqualTo(String value) {
+            addCriterion("contract_no =", value, "contractNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoNotEqualTo(String value) {
+            addCriterion("contract_no <>", value, "contractNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoGreaterThan(String value) {
+            addCriterion("contract_no >", value, "contractNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoGreaterThanOrEqualTo(String value) {
+            addCriterion("contract_no >=", value, "contractNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoLessThan(String value) {
+            addCriterion("contract_no <", value, "contractNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoLessThanOrEqualTo(String value) {
+            addCriterion("contract_no <=", value, "contractNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoLike(String value) {
+            addCriterion("contract_no like", value, "contractNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoNotLike(String value) {
+            addCriterion("contract_no not like", value, "contractNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoIn(List<String> values) {
+            addCriterion("contract_no in", values, "contractNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoNotIn(List<String> values) {
+            addCriterion("contract_no not in", values, "contractNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoBetween(String value1, String value2) {
+            addCriterion("contract_no between", value1, value2, "contractNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andContractNoNotBetween(String value1, String value2) {
+            addCriterion("contract_no not between", value1, value2, "contractNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidIsNull() {
+            addCriterion("aid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidIsNotNull() {
+            addCriterion("aid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidEqualTo(String value) {
+            addCriterion("aid =", value, "aid");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidNotEqualTo(String value) {
+            addCriterion("aid <>", value, "aid");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidGreaterThan(String value) {
+            addCriterion("aid >", value, "aid");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidGreaterThanOrEqualTo(String value) {
+            addCriterion("aid >=", value, "aid");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidLessThan(String value) {
+            addCriterion("aid <", value, "aid");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidLessThanOrEqualTo(String value) {
+            addCriterion("aid <=", value, "aid");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidLike(String value) {
+            addCriterion("aid like", value, "aid");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidNotLike(String value) {
+            addCriterion("aid not like", value, "aid");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidIn(List<String> values) {
+            addCriterion("aid in", values, "aid");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidNotIn(List<String> values) {
+            addCriterion("aid not in", values, "aid");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidBetween(String value1, String value2) {
+            addCriterion("aid between", value1, value2, "aid");
+            return (Criteria) this;
+        }
+
+        public Criteria andAidNotBetween(String value1, String value2) {
+            addCriterion("aid not between", value1, value2, "aid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated do_not_delete_during_merge Mon Sep 30 16:05:15 CST 2019
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table idle_contract_no
+     *
+     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
+     */
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

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

@@ -117,10 +117,10 @@ public class OrderInvoiceApiController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/approvalOrderInvoiceList",method = RequestMethod.GET)
-	public Result approvalOrderInvoiceList(Integer status,Integer approval,Integer type,String orderDep,String orderNo ,String name,Integer pageNo,Integer pageSize){
+	public Result approvalOrderInvoiceList(Integer status,Integer approval,Integer type,String orderDep,String orderNo ,String name,String userName,Integer pageNo,Integer pageSize){
 		Result res = new Result();
 		
-		res.data(orderInvoiceService.approvalOrderInvoiceList( status,approval,type, orderDep, orderNo, name,pageNo,pageSize));
+		res.data(orderInvoiceService.approvalOrderInvoiceList( status,approval,type, orderDep, orderNo, name,userName,pageNo,pageSize));
 		return res;
 	}
 	

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

@@ -36,7 +36,7 @@ public interface OrderInvoiceService {
 
 	int updatefinanceExamine(Integer id, Integer examine, String reason);
 
-	Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer status,Integer approval,Integer type, String orderDep, String orderNo, String name, Integer pageNo,
+	Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer status,Integer approval,Integer type, String orderDep, String orderNo, String name,String userName,Integer pageNo,
 			Integer pageSize);
 
 	int updateapprovalExamine(Integer id, Integer examine, String reason);

+ 0 - 3
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -1,7 +1,6 @@
 package com.goafanti.order.service.impl;
 
 import java.math.BigDecimal;
-import java.text.ParseException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -13,7 +12,6 @@ import org.springframework.stereotype.Service;
 
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.OrderExamineBo;
-import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.NewOrderChangeMapper;
 import com.goafanti.common.dao.OrderChangeLogMapper;
 import com.goafanti.common.dao.OrderExamineMapper;
@@ -31,7 +29,6 @@ import com.goafanti.common.model.OrderRefundInvoice;
 import com.goafanti.common.model.TOrderDun;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.NewOrderChange;
-import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.JDBCIdGenerator;

+ 2 - 3
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -112,7 +112,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer status,Integer approval,Integer type, String orderDep, String orderNo, String name,
+	public Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer status,Integer approval,Integer type, String orderDep, String orderNo, String name,String userName,
 			Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
@@ -120,6 +120,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 		if(StringUtils.isNotBlank(orderDep))params.put("orderDep", orderDep);
 		if(StringUtils.isNotBlank(orderNo))params.put("orderNo", orderNo);
 		if(StringUtils.isNotBlank(name))params.put("name", name);
+		if(StringUtils.isNotBlank(userName))params.put("userName", userName);
 		if(approval!=null)params.put("approval", approval);
 		if(status!=null)params.put("status", status);
 		//0省内 1省外 2查看所有省外
@@ -133,8 +134,6 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 			Admin a=adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
 			params.put("aDep", a.getDepartmentId());
 		}
-		
-		
 		return (Pagination<TOrderInvoiceBo>)findPage("approvalOrderInvoiceList", "approvalOrderInvoiceCount", params, pageNo, pageSize);
 	}
 

+ 63 - 38
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -28,6 +28,7 @@ import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.dao.AdminMapper;
+import com.goafanti.common.dao.IdleContractNoMapper;
 import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.OrganizationManagementMapper;
@@ -43,6 +44,7 @@ import com.goafanti.common.dao.UserLockReleaseMapper;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.model.IdleContractNo;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.OrganizationManagement;
@@ -69,8 +71,6 @@ import com.goafanti.order.bo.TOrderLogBo;
 import com.goafanti.order.bo.TOrderNewBo;
 import com.goafanti.order.bo.TOrderRefundBo;
 import com.goafanti.order.bo.TOrderTaskBo;
-import com.goafanti.order.bo.OrderOutsourceBo;
-import com.goafanti.order.bo.OrderOutsourceDtails;
 import com.goafanti.order.enums.ActiveState;
 import com.goafanti.order.enums.ApprovalNewState;
 import com.goafanti.order.enums.LiquidationNewState;
@@ -112,6 +112,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Autowired
 	private OrderService	orderService;
 	@Autowired
+	private IdleContractNoMapper	idleContractNoMapper;
+	@Autowired
 	private TOrderOutsourceMapper tOrderOutsourceMapper;
 	@Autowired
 	private UserLockReleaseMapper	userLockReleaseMapper;
@@ -208,7 +210,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 	@Override
 	public int updateServiceOrder(TOrderNew t, Integer isSubmit) {
-		TOrderNew t2=checkDeleteSign(t.getOrderNo());
+		TOrderNew t2=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
 		//判断手机号码是否存在
 		if (StringUtils.isNotBlank(t.getContacts())&&StringUtils.isNotBlank(t.getContactMobile())&&
 				organizationContactBookMapper.checkContacts(t2.getBuyerId(), t2.getContactMobile(),TokenManager.getAdminId()==null?"1":TokenManager.getAdminId() )>0) {
@@ -238,6 +240,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			if (StringUtils.isBlank(t2.getContractNo())) {
 				//没有合同编号则生成
 				createContractNo(t);
+			}else if(!t.getOrderDep().equals(t2.getOrderDep())) {
+				contractNoReplace(t.getOrderNo(), t2.getContractNo(),t2.getOrderDep());
+				createContractNo(t);
 			}
 		}
 		if (t2.getApproval()==ApprovalNewState.BH.getCode()||
@@ -265,55 +270,52 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	}
 
 
-
+	/**
+	 * 		新建合同编号,优先获取闲置合同编号,否则按年份生成编号
+	 * @param t
+	 */
 	private void createContractNo(TOrderNew t) {
 		//根据订单部门或许合同编号前缀
 		OrganizationManagement dep=organizationManagementMapper.selectByPrimaryKey(t.getOrderDep());
 		if (dep==null||StringUtils.isBlank(dep.getAbbreviation())) {
 			throw new BusinessException(new Error( "该部门缩写不存在","该部门缩写不存在"));
 		}
-		//根据前缀查询最大编号
-		String max=organizationManagementMapper.getMaxAbbreviation(dep.getAbbreviation()+"-");
-		//获取日期年份
-		Calendar c=Calendar.getInstance();
-		int y=c.getWeekYear();
-		
-		String sno=null;
-		if (StringUtils.isBlank(max)||max.length()<13) {
-			String cn=""+dep.getAbbreviation()+"-"+y+"0001";
-			cn=iterationNo(cn,dep.getAbbreviation(),y,1);
-			t.setContractNo(cn);
+		IdleContractNo i=idleContractNoMapper.selectByAbbreviation(dep.getAbbreviation());
+		if (i!=null&&i.getContractNo()!=null) {
+			t.setContractNo(i.getContractNo());
+			idleContractNoMapper.deleteByPrimaryKey(i.getId());
 		}else {
-			int ty=Integer.parseInt(max.substring(max.indexOf("-")+1, max.length()-4));
-			int no=Integer.parseInt(max.substring(max.length()-4, max.length()));
+			//根据前缀查询最大编号
+			String max=organizationManagementMapper.getMaxAbbreviation(dep.getAbbreviation()+"-");
+			//获取日期年份
+			Calendar c=Calendar.getInstance();
+			int y=c.getWeekYear();
 			
-			//得出字符串
-			sno = countNo(dep.getAbbreviation(), sno, ty, no);
-			//迭代得出最后编码
-			sno=iterationNo(sno,dep.getAbbreviation(),ty,no);
-			//年份小于等于则获取最大值加1,大于则获取最新年份
-			if (y<=ty) {
-				t.setContractNo(sno);
+			String sno=null;
+			if (StringUtils.isBlank(max)||max.length()<13) {
+				String cn=""+dep.getAbbreviation()+"-"+y+"0001";
+				cn=iterationNo(cn,dep.getAbbreviation(),y,1);
+				t.setContractNo(cn);
 			}else {
-				t.setContractNo(""+dep.getAbbreviation()+"-"+y+"0001");
+				int ty=Integer.parseInt(max.substring(max.indexOf("-")+1, max.length()-4));
+				int no=Integer.parseInt(max.substring(max.length()-4, max.length()));
+				
+				//得出字符串
+				sno = countNo(dep.getAbbreviation(), sno, ty, no);
+				//迭代得出最后编码
+				sno=iterationNo(sno,dep.getAbbreviation(),ty,no);
+				//年份小于等于则获取最大值加1,大于则获取最新年份
+				if (y<=ty) {
+					t.setContractNo(sno);
+				}else {
+					t.setContractNo(""+dep.getAbbreviation()+"-"+y+"0001");
+				}
 			}
 		}
 	}
-
-	public static void main(String[] args) {
-		String max="GZKD1-20190001"; 
-		int ty=Integer.parseInt(max.substring(max.indexOf("-")+1, max.length()-4));
-		int no=Integer.parseInt(max.substring(max.length()-4, max.length()));
-		System.out.println("ty:"+ty+",no:"+no);
-		no++;
-		String s="GZKD"+"-"+ty+"000"+no;
-		System.out.println(s);
 		
-		int i=Integer.parseInt(s.substring(s.indexOf("-")+5, s.length()));
-		System.out.println(i);
-				
-	}
 
+	
 
 	private String iterationNo(String sno ,Object mp, int ty, int no) {
 		if (tOrderNewMapper.checkContractNo(sno)>0) {
@@ -642,12 +644,35 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				t.getOrderStatus()==OrderNewState.DQD.getCode()||t.getOrderStatus()==OrderNewState.QDSHJJ.getCode()) {
 			t.setOrderNo(orderNo);
 			t.setDeleteSign(1);//作废
+			contractNoReplace(orderNo, t.getContractNo(),t.getOrderDep());
+			t.setContractNo("");
 			return tOrderNewMapper.updateByPrimaryKeySelective(t);
 		}
 		return -1;
 	}
 
 
+	/**
+	 *  	将合同编号置为闲置编号
+	 * @param orderNo
+	 * @param t
+	 */
+	private void contractNoReplace(String orderNo, String  contractNo,String orderDep) {
+		Calendar c=Calendar.getInstance();
+		int y=c.getWeekYear();
+		String ys="-"+y;
+		if (contractNo.contains(ys)) {
+			IdleContractNo i=new IdleContractNo();
+			i.setAid(TokenManager.getAdminId());
+			i.setContractNo(contractNo);
+			i.setUsedOrderNo(orderNo);
+			OrganizationManagement o=organizationManagementMapper.selectByPrimaryKey(orderDep);
+			i.setAbbreviation(o.getAbbreviation());
+			idleContractNoMapper.insertSelective(i);
+		}
+	}
+
+
 
 	@Override
 	public boolean checkOderSettlementAmount(String orderNo) {