ソースを参照

闲置合同编号问题处理

Signed-off-by: anderx <312518615@qq.com>
anderx 6 年 前
コミット
3de57f6b49

+ 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="new_order_dun"/>
+    <table schema="aft" tableName="idle_contract_no"/>
   </context>
 </generatorConfiguration>

+ 56 - 77
src/main/java/com/goafanti/common/dao/IdleContractNoMapper.java

@@ -7,92 +7,71 @@ 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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table idle_contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	int updateByPrimaryKey(IdleContractNo record);
 
-	IdleContractNo selectByAbbreviation(String abbreviation);
+	IdleContractNo selectByAbbreviation(@Param("abbreviation")String abbreviation, @Param("year")Integer year);
 }

+ 39 - 24
src/main/java/com/goafanti/common/mapper/IdleContractNoMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="abbreviation" jdbcType="VARCHAR" property="abbreviation" />
@@ -13,12 +13,13 @@
     <result column="contract_no" jdbcType="VARCHAR" property="contractNo" />
     <result column="aid" jdbcType="VARCHAR" property="aid" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="year" jdbcType="INTEGER" property="year" />
   </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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -52,7 +53,7 @@
     <!--
       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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -86,15 +87,15 @@
     <!--
       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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
-    id, abbreviation, used_order_no, contract_no, aid, create_time
+    id, abbreviation, used_order_no, contract_no, aid, create_time, year
   </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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     select
     <if test="distinct">
@@ -113,7 +114,7 @@
     <!--
       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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -124,7 +125,7 @@
     <!--
       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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     delete from idle_contract_no
     where id = #{id,jdbcType=INTEGER}
@@ -133,7 +134,7 @@
     <!--
       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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     delete from idle_contract_no
     <if test="_parameter != null">
@@ -144,20 +145,20 @@
     <!--
       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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     insert into idle_contract_no (id, abbreviation, used_order_no, 
-      contract_no, aid, create_time
-      )
+      contract_no, aid, create_time, 
+      year)
     values (#{id,jdbcType=INTEGER}, #{abbreviation,jdbcType=VARCHAR}, #{usedOrderNo,jdbcType=VARCHAR}, 
-      #{contractNo,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
-      )
+      #{contractNo,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{year,jdbcType=INTEGER})
   </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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     insert into idle_contract_no
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -179,6 +180,9 @@
       <if test="createTime != null">
         create_time,
       </if>
+      <if test="year != null">
+        year,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -199,13 +203,16 @@
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="year != null">
+        #{year,jdbcType=INTEGER},
+      </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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     select count(*) from idle_contract_no
     <if test="_parameter != null">
@@ -216,7 +223,7 @@
     <!--
       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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     update idle_contract_no
     <set>
@@ -238,6 +245,9 @@
       <if test="record.createTime != null">
         create_time = #{record.createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="record.year != null">
+        year = #{record.year,jdbcType=INTEGER},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -247,7 +257,7 @@
     <!--
       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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     update idle_contract_no
     set id = #{record.id,jdbcType=INTEGER},
@@ -255,7 +265,8 @@
       used_order_no = #{record.usedOrderNo,jdbcType=VARCHAR},
       contract_no = #{record.contractNo,jdbcType=VARCHAR},
       aid = #{record.aid,jdbcType=VARCHAR},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP}
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      year = #{record.year,jdbcType=INTEGER}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -264,7 +275,7 @@
     <!--
       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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     update idle_contract_no
     <set>
@@ -283,6 +294,9 @@
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="year != null">
+        year = #{year,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -290,19 +304,20 @@
     <!--
       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.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     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}
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      year = #{year,jdbcType=INTEGER}
     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})
+	where abbreviation= #{abbreviation,jdbcType=VARCHAR}  and `year`= #{year ,jdbcType=INTEGER}
+	and a.contract_no=(select max(contract_no)from idle_contract_no where abbreviation= #{abbreviation,jdbcType=VARCHAR} and `year`= #{year ,jdbcType=INTEGER})
   </select>
 </mapper>

+ 8 - 7
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1210,7 +1210,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	</if>
   	<if test="specially == 4">
   	left join (select * from t_order_task
-where super_id is null )  e on e.order_no=a.order_no
+	where super_id is null )  e on e.order_no=a.order_no
   	left join admin f on e.task_receiver=f.id
   	</if>
   	where a.delete_sign !=1
@@ -1234,17 +1234,18 @@ where super_id is null )  e on e.order_no=a.order_no
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
   	</if>
   	<if test="specially == 3">
-  	 and  a.order_status=2 and a.process_status != 99 
-  	</if>
-  	<if test="approval ==0">
-  	and a.approval &gt; 1
+  	 and  a.order_status=2 and a.process_status != 99
+  	 <if test="approval ==0">
+  	and a.approval &gt; 0
   	</if>
   	<if test="approval ==1">
   	and a.approval = 1
   	</if>
   	<if test="approval ==2">
   	and a.approval &gt; 1
+  	</if> 
   	</if>
+  	
   	<if test="specially == 4">
   	and e.main=1
   	and a.process_status in (4,5,6,99)
@@ -1337,9 +1338,8 @@ where super_id is null ) e on e.order_no=a.order_no
   	</if>
   	<if test="specially == 3">
   	 and  a.order_status=2 and a.process_status != 99 
-  	</if>
   	<if test="approval ==0">
-  	and a.approval &gt; 1
+  	and a.approval &gt; 0
   	</if>
   	<if test="approval ==1">
   	and a.approval = 1
@@ -1347,6 +1347,7 @@ where super_id is null ) e on e.order_no=a.order_no
   	<if test="approval ==2">
   	and a.approval &gt; 1
   	</if>
+  	</if>
   	<if test="specially == 4">
   	and e.main=1
   	and a.process_status in (4,5,6,99)

+ 162 - 197
src/main/java/com/goafanti/common/model/IdleContractNo.java

@@ -3,201 +3,166 @@ 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;
-    }
+
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.id
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private Integer id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.abbreviation
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private String usedOrderNo;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private String contractNo;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.aid
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private String aid;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.create_time
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private Date createTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.year
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private Integer year;
+
+	/**
+	 * 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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column idle_contract_no.abbreviation
+	 * @return  the value of idle_contract_no.abbreviation
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public void setAid(String aid) {
+		this.aid = aid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column idle_contract_no.create_time
+	 * @return  the value of idle_contract_no.create_time
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	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  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column idle_contract_no.year
+	 * @return  the value of idle_contract_no.year
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public Integer getYear() {
+		return year;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column idle_contract_no.year
+	 * @param year  the value for idle_contract_no.year
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public void setYear(Integer year) {
+		this.year = year;
+	}
 }

File diff suppressed because it is too large
+ 702 - 683
src/main/java/com/goafanti/common/model/IdleContractNoExample.java


+ 16 - 14
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -14,7 +14,6 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.TimeZone;
 import java.util.UUID;
 
 import javax.mail.MessagingException;
@@ -279,7 +278,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			tl.setOrderNo(t.getOrderNo());
 			tl.setProcess(OrderLogProcess.TJ.getCode());
 			tl.setAid(TokenManager.getAdminId());
-			addOrderLog(tl);
+			addOrderLog(tl,null);
 			System.out.println(""+t2.getContractNo());
 			if (StringUtils.isBlank(t2.getContractNo())) {
 				//没有合同编号则生成
@@ -353,19 +352,20 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	private void createContractNo(TOrderNew t) {
 		//根据订单部门或许合同编号前缀
 		OrganizationManagement dep=organizationManagementMapper.selectByPrimaryKey(t.getOrderDep());
+		//获取日期年份
+		Calendar c=Calendar.getInstance();
+		int y=c.get(Calendar.YEAR);
 		if (dep==null||StringUtils.isBlank(dep.getAbbreviation())) {
 			throw new BusinessException(new Error( "该部门缩写不存在","该部门缩写不存在"));
 		}
-		IdleContractNo i=idleContractNoMapper.selectByAbbreviation(dep.getAbbreviation());
+		IdleContractNo i=idleContractNoMapper.selectByAbbreviation(dep.getAbbreviation(),y);
 		if (i!=null&&i.getContractNo()!=null) {
 			t.setContractNo(i.getContractNo());
 			idleContractNoMapper.deleteByPrimaryKey(i.getId());
 		}else {
 			//根据前缀查询最大编号
 			String max=organizationManagementMapper.getMaxAbbreviation(dep.getAbbreviation()+"-");
-			//获取日期年份
-			Calendar c=Calendar.getInstance();
-			int y=c.get(Calendar.YEAR);
+			
 			String sno=null;
 			if (StringUtils.isBlank(max)||max.length()<13) {
 				String cn=""+dep.getAbbreviation()+"-"+y+"0001";
@@ -418,8 +418,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	}
 	
 
-	public void addOrderLog(TOrderLog tl) {
+	public void addOrderLog(TOrderLog tl, String reason) {
 		tl.setAid(TokenManager.getAdminId());
+		if(reason!=null)tl.setRemarks(reason);
 		tOrderLogMapper.insertSelective(tl);
 		
 	}
@@ -498,7 +499,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (StringUtils.isNotBlank(depId)) params.put("depId", depId);
 		if (StringUtils.isNotBlank(contractNo)) params.put("contractNo", contractNo);
 		if (null!=liquidationStatus) params.put("liquidationStatus", liquidationStatus);
-		if (null!=approval)params.put("approval", approval);
+		if (null==approval)params.put("approval", 0);
+		else 	params.put("approval", approval);
 		if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
 		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
 		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
@@ -533,8 +535,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 					t.setProcessStatus(ProcessStatus.YPWBSH.getCode());
 					tl.setOrderNo(orderNo);
 					tl.setProcess(OrderLogProcess.FQWB.getCode());
-					addOrderLog(tl);
-					
+					addOrderLog(tl,null);
 					
 				}
 			}else {
@@ -547,7 +548,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			tl.setOrderNo(orderNo);
 			tl.setProcess(OrderLogProcess.SH.getCode());
 			//增加日志
-			addOrderLog(tl);
+			addOrderLog(tl,null);
 			//非特批增加催款信息
 			//外包
 			 if(outsource==1) {
@@ -566,7 +567,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				addBackOrder(orderNo, reason);
 				tl.setOrderNo(orderNo);
 				tl.setProcess(OrderLogProcess.SH.getCode());
-				addOrderLog(tl);
+				addOrderLog(tl,null);
 			}
 				aids.add(t2.getSalesmanId());
 				type=NoticeStatus.ORDER_NO.getCode();
@@ -734,7 +735,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		TOrderLog tl=new TOrderLog();
 		tl.setOrderNo(t.getOrderNo());
 		tl.setProcess(OrderLogProcess.FQTD.getCode());
-		addOrderLog(tl);
+		addOrderLog(tl,null);
 		return tOrderRefundMapper.insertSelective(t);
 	}
 
@@ -771,7 +772,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			aids.add(t2.getSalesmanId());
 			type=NoticeStatus.ORDER_APPROVA_NO.getCode();
 		}
-		addOrderLog(tl);
+		addOrderLog(tl,reason);
 		pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId(),t2.getApproval());
 		//新增特批催款信息
 		
@@ -861,6 +862,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			i.setAid(TokenManager.getAdminId());
 			i.setContractNo(contractNo);
 			i.setUsedOrderNo(orderNo);
+			i.setYear(y);
 			//如果找不到订单部门,则取订单编号-前面的缩写
 			if(StringUtils.isNotBlank(orderDep)) {
 				OrganizationManagement o=organizationManagementMapper.selectByPrimaryKey(orderDep);