ソースを参照

新增催款日志开发

anderx 4 年 前
コミット
87bf3a28a2

+ 24 - 1
.idea/free-mybatis-generator-config.xml

@@ -119,6 +119,29 @@
             </Config>
           </value>
         </entry>
+        <entry key="t_dun_log">
+          <value>
+            <Config>
+              <option name="comment" value="true" />
+              <option name="daoMvnPath" value="src/main/java" />
+              <option name="daoName" value="TDunLogMapper" />
+              <option name="daoPackage" value="com.goafanti.common.dao" />
+              <option name="daoPostfix" value="Mapper" />
+              <option name="modelMvnPath" value="src/main/java" />
+              <option name="modelName" value="TDunLog" />
+              <option name="modelPackage" value="com.goafanti.common.model" />
+              <option name="name" value="t_dun_log" />
+              <option name="needToStringHashcodeEquals" value="true" />
+              <option name="overrideJava" value="true" />
+              <option name="overrideXML" value="true" />
+              <option name="primaryKey" value="" />
+              <option name="projectFolder" value="$PROJECT_DIR$" />
+              <option name="tableName" value="t_dun_log" />
+              <option name="xmlMvnPath" value="src/main/java" />
+              <option name="xmlPackage" value="com.goafanti.common.mapper" />
+            </Config>
+          </value>
+        </entry>
         <entry key="t_order_mid">
           <value>
             <Config>
@@ -247,8 +270,8 @@
               <option name="overrideJava" value="true" />
               <option name="overrideXML" value="true" />
               <option name="projectFolder" value="$PROJECT_DIR$" />
+              <option name="xmlMvnPath" value="src/main/java" />
               <option name="xmlPackage" value="com.goafanti.common.mapper" />
-	<option name="xmlMvnPath" value="src/main/java"/>
             </Config>
           </value>
         </entry>

+ 0 - 2
src/main/java/com/goafanti/admin/controller/AdminPatentApiController.java

@@ -497,8 +497,6 @@ public class AdminPatentApiController extends CertifyApiController {
 	 * 下载上年度纳税申报表
 	 * 
 	 * @param response
-	 * @param uid
-	 * @param year
 	 * @param sign
 	 * @return
 	 */

+ 2 - 76
src/main/java/com/goafanti/common/dao/TDunLogMapper.java

@@ -8,93 +8,19 @@ import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
 public interface TDunLogMapper {
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_dun_log
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
-    long countByExample(TDunLogExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_dun_log
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
-    int deleteByExample(TDunLogExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_dun_log
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     int deleteByPrimaryKey(String id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_dun_log
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     int insert(TDunLog record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_dun_log
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     int insertSelective(TDunLog record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_dun_log
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
-    List<TDunLog> selectByExample(TDunLogExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_dun_log
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     TDunLog selectByPrimaryKey(String id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_dun_log
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
-    int updateByExampleSelective(@Param("record") TDunLog record, @Param("example") TDunLogExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_dun_log
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
-    int updateByExample(@Param("record") TDunLog record, @Param("example") TDunLogExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_dun_log
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     int updateByPrimaryKeySelective(TDunLog record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_dun_log
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     int updateByPrimaryKey(TDunLog record);
 
 	List<TDunLogListBo> selectByDunId(String dunId);
+
+    List<TDunLogListBo> selectByOrderNo(String orderNo);
 }

+ 3 - 2
src/main/java/com/goafanti/common/enums/AttachmentType.java

@@ -55,8 +55,9 @@ public enum AttachmentType {
 	BUSINESS_PROJECT_MIN_PICTURE("business_project_min_picture","业务项目小图"),
 	BUSINESS_PROJECT_MAX_PICTURE("business_project_max_picture","业务项目大图"),
 	VARIETIES_PICTURE("varieties_picture","业务品类图片"),
-	ORGANIZATION_APPLICATION("organization_application","企业申报书");
-	
+	ORGANIZATION_APPLICATION("organization_application","企业申报书"),
+	DUN_LOG_ATTACHMENT("dun_log_attachment","催款日志附件");
+
 	private AttachmentType(String code, String desc) {
 		this.code = code;
 		this.desc = desc;

+ 45 - 197
src/main/java/com/goafanti/common/mapper/TDunLogMapper.xml

@@ -2,160 +2,37 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.goafanti.common.dao.TDunLogMapper">
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.TDunLog">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="dun_id" jdbcType="VARCHAR" property="dunId" />
     <result column="dum_by" jdbcType="VARCHAR" property="dumBy" />
     <result column="dum_time" jdbcType="DATE" property="dumTime" />
     <result column="remarks" jdbcType="VARCHAR" property="remarks" />
+    <result column="attachment_url" jdbcType="VARCHAR" property="attachmentUrl" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
   </resultMap>
-  <sql id="Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
-    <where>
-      <foreach collection="oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Update_By_Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
-    <where>
-      <foreach collection="example.oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
   <sql id="Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
-    id, dun_id, dum_by, dum_time, remarks
+    id, dun_id, dum_by, dum_time, remarks, attachment_url, `type`, order_no
   </sql>
-  <select id="selectByExample" parameterType="com.goafanti.common.model.TDunLogExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from t_dun_log
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
     select 
     <include refid="Base_Column_List" />
     from t_dun_log
     where id = #{id,jdbcType=VARCHAR}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
     delete from t_dun_log
     where id = #{id,jdbcType=VARCHAR}
   </delete>
-  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TDunLogExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
-    delete from t_dun_log
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
   <insert id="insert" parameterType="com.goafanti.common.model.TDunLog">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
     insert into t_dun_log (id, dun_id, dum_by, 
-      dum_time, remarks)
+      dum_time, remarks, attachment_url, 
+      `type`, order_no)
     values (#{id,jdbcType=VARCHAR}, #{dunId,jdbcType=VARCHAR}, #{dumBy,jdbcType=VARCHAR}, 
-      #{dumTime,jdbcType=DATE}, #{remarks,jdbcType=VARCHAR})
+      #{dumTime,jdbcType=DATE}, #{remarks,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=VARCHAR}, 
+      #{type,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TDunLog">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
     insert into t_dun_log
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -173,6 +50,15 @@
       <if test="remarks != null">
         remarks,
       </if>
+      <if test="attachmentUrl != null">
+        attachment_url,
+      </if>
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="orderNo != null">
+        order_no,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -190,69 +76,18 @@
       <if test="remarks != null">
         #{remarks,jdbcType=VARCHAR},
       </if>
-    </trim>
-  </insert>
-  <select id="countByExample" parameterType="com.goafanti.common.model.TDunLogExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
-    select count(*) from t_dun_log
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
-    update t_dun_log
-    <set>
-      <if test="record.id != null">
-        id = #{record.id,jdbcType=VARCHAR},
-      </if>
-      <if test="record.dunId != null">
-        dun_id = #{record.dunId,jdbcType=VARCHAR},
+      <if test="attachmentUrl != null">
+        #{attachmentUrl,jdbcType=VARCHAR},
       </if>
-      <if test="record.dumBy != null">
-        dum_by = #{record.dumBy,jdbcType=VARCHAR},
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
       </if>
-      <if test="record.dumTime != null">
-        dum_time = #{record.dumTime,jdbcType=DATE},
+      <if test="orderNo != null">
+        #{orderNo,jdbcType=VARCHAR},
       </if>
-      <if test="record.remarks != null">
-        remarks = #{record.remarks,jdbcType=VARCHAR},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
-    update t_dun_log
-    set id = #{record.id,jdbcType=VARCHAR},
-      dun_id = #{record.dunId,jdbcType=VARCHAR},
-      dum_by = #{record.dumBy,jdbcType=VARCHAR},
-      dum_time = #{record.dumTime,jdbcType=DATE},
-      remarks = #{record.remarks,jdbcType=VARCHAR}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
+    </trim>
+  </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TDunLog">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
     update t_dun_log
     <set>
       <if test="dunId != null">
@@ -267,26 +102,39 @@
       <if test="remarks != null">
         remarks = #{remarks,jdbcType=VARCHAR},
       </if>
+      <if test="attachmentUrl != null">
+        attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="orderNo != null">
+        order_no = #{orderNo,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TDunLog">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Nov 20 11:50:41 CST 2018.
-    -->
     update t_dun_log
     set dun_id = #{dunId,jdbcType=VARCHAR},
       dum_by = #{dumBy,jdbcType=VARCHAR},
       dum_time = #{dumTime,jdbcType=DATE},
-      remarks = #{remarks,jdbcType=VARCHAR}
+      remarks = #{remarks,jdbcType=VARCHAR},
+      attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
+      `type` = #{type,jdbcType=INTEGER},
+      order_no = #{orderNo,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   <select id="selectByDunId" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TDunLogListBo">
-   select 
+   select
     a.id, a.dun_id as dunId, b.name as dumBy, a.dum_time as dumTime, a.remarks
     from t_dun_log a left join admin b on a.dum_by=b.id
     where dun_id = #{dunId,jdbcType=VARCHAR}
   </select>
+  <select id="selectByOrderNo" resultType="com.goafanti.order.bo.TDunLogListBo">
+    select a.id, a.dun_id as dunId, b.name as dumBy, a.dum_time as dumTime, a.remarks,
+           a.attachment_url attachmentUrl, c.order_no orderNo,c.buyer_name userName
+    from t_dun_log a left join admin b on a.dum_by=b.id left join t_order_mid c on a.order_no =c.order_no
+    where c.order_no = #{orderNo}
+  </select>
 </mapper>

+ 105 - 106
src/main/java/com/goafanti/common/model/TDunLog.java

@@ -1,170 +1,169 @@
 package com.goafanti.common.model;
 
+import java.io.Serializable;
 import java.util.Date;
 
-public class TDunLog {
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_dun_log.id
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
+/**
+ * t_dun_log
+ * @author 
+ */
+public class TDunLog implements Serializable {
     private String id;
 
     /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_dun_log.dun_id
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     * 催款ID
      */
     private String dunId;
 
     /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_dun_log.dum_by
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     * 催款人
      */
     private String dumBy;
 
     /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_dun_log.dum_time
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     * 催款日期
      */
     private Date dumTime;
 
     /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_dun_log.remarks
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     * 催款备注
      */
     private String remarks;
 
     /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_dun_log.id
-     *
-     * @return the value of t_dun_log.id
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     * 附件地址
+     */
+    private String attachmentUrl;
+
+    /**
+     * 0项目催款 1订单催款
+     */
+    private Integer type;
+
+    /**
+     * 订单编号
      */
+    private String orderNo;
+
+    private static final long serialVersionUID = 1L;
+
     public String getId() {
         return id;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_dun_log.id
-     *
-     * @param id the value for t_dun_log.id
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     public void setId(String id) {
         this.id = id;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_dun_log.dun_id
-     *
-     * @return the value of t_dun_log.dun_id
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     public String getDunId() {
         return dunId;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_dun_log.dun_id
-     *
-     * @param dunId the value for t_dun_log.dun_id
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     public void setDunId(String dunId) {
         this.dunId = dunId;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_dun_log.dum_by
-     *
-     * @return the value of t_dun_log.dum_by
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     public String getDumBy() {
         return dumBy;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_dun_log.dum_by
-     *
-     * @param dumBy the value for t_dun_log.dum_by
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     public void setDumBy(String dumBy) {
         this.dumBy = dumBy;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_dun_log.dum_time
-     *
-     * @return the value of t_dun_log.dum_time
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     public Date getDumTime() {
         return dumTime;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_dun_log.dum_time
-     *
-     * @param dumTime the value for t_dun_log.dum_time
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     public void setDumTime(Date dumTime) {
         this.dumTime = dumTime;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_dun_log.remarks
-     *
-     * @return the value of t_dun_log.remarks
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     public String getRemarks() {
         return remarks;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_dun_log.remarks
-     *
-     * @param remarks the value for t_dun_log.remarks
-     *
-     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
-     */
     public void setRemarks(String remarks) {
         this.remarks = remarks;
     }
+
+    public String getAttachmentUrl() {
+        return attachmentUrl;
+    }
+
+    public void setAttachmentUrl(String attachmentUrl) {
+        this.attachmentUrl = attachmentUrl;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        TDunLog other = (TDunLog) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getDunId() == null ? other.getDunId() == null : this.getDunId().equals(other.getDunId()))
+            && (this.getDumBy() == null ? other.getDumBy() == null : this.getDumBy().equals(other.getDumBy()))
+            && (this.getDumTime() == null ? other.getDumTime() == null : this.getDumTime().equals(other.getDumTime()))
+            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()))
+            && (this.getAttachmentUrl() == null ? other.getAttachmentUrl() == null : this.getAttachmentUrl().equals(other.getAttachmentUrl()))
+            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
+            && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getDunId() == null) ? 0 : getDunId().hashCode());
+        result = prime * result + ((getDumBy() == null) ? 0 : getDumBy().hashCode());
+        result = prime * result + ((getDumTime() == null) ? 0 : getDumTime().hashCode());
+        result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
+        result = prime * result + ((getAttachmentUrl() == null) ? 0 : getAttachmentUrl().hashCode());
+        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
+        result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", dunId=").append(dunId);
+        sb.append(", dumBy=").append(dumBy);
+        sb.append(", dumTime=").append(dumTime);
+        sb.append(", remarks=").append(remarks);
+        sb.append(", attachmentUrl=").append(attachmentUrl);
+        sb.append(", type=").append(type);
+        sb.append(", orderNo=").append(orderNo);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
 }

+ 1 - 1
src/main/java/com/goafanti/common/utils/FileUtils.java

@@ -111,7 +111,7 @@ public class FileUtils {
 				||sign.indexOf("business_project_max_picture") != -1||sign.indexOf("business_project_min_picture") != -1
 				||sign.indexOf("varieties_picture") != -1  || sign.indexOf("organization_application") != -1
 				||sign.indexOf("order_task_file") != -1||sign.indexOf("patent_certificate") != -1
-				||sign.indexOf("order_invoice_file") != -1 ||sign.indexOf("order_outsource") != -1 ){
+				||sign.indexOf("order_invoice_file") != -1 ||sign.indexOf("order_outsource") != -1|| sign.indexOf("dun_log_attachment") != -1){
 			uniq = true;
 		}
 		String fileName = "";

+ 12 - 1
src/main/java/com/goafanti/order/bo/TDunLogListBo.java

@@ -6,11 +6,22 @@ import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.model.TDunLog;
 
 public class TDunLogListBo extends TDunLog {
+
+	private String userName;
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
 	public String getDumDate() {
 		if (super.getDumTime() == null) {
 			return null;
 		} else {
-			return DateFormatUtils.format(super.getDumTime(), AFTConstants.YYYYMMDDHHMMSS);
+			return DateFormatUtils.format(super.getDumTime(), AFTConstants.YYYYMMDD);
 		}
 	}
 }

+ 19 - 4
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -10,6 +10,8 @@ import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -300,7 +302,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	 * 新增催款记录
 	 */
 	@RequestMapping(value="/createDunLog", method = RequestMethod.POST)
-	public Result createDunLog(String dunId,String dumTime,String remarks){
+	public Result createDunLog(String dunId,String dumTime,String remarks,String attUrl){
 		Result res=new  Result();
 		if (StringUtils.isBlank(dunId)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "催款ID","催款ID"));
@@ -310,7 +312,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "时间与描述","时间与描述"));
 			return res;
 		}
-		res.data(orderNewService.createDunLog(dunId, dumTime, remarks));
+		res.data(orderNewService.createDunLog(dunId, dumTime, remarks,attUrl));
 		return res;
 	}
 	/**
@@ -484,8 +486,21 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		res.setData(handleFile(res, "/order_refund_file/", false, req, sign));
 		return res;
 	}
-	
-	
+
+	/**
+	 * 催款日志文件上传
+	 */
+	@RequestMapping(value = "/uploadDunLogFile", method = RequestMethod.POST)
+	public Result uploadDunLogFileResult(HttpServletRequest req, String sign) {
+		Result res = new Result();
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.DUN_LOG_ATTACHMENT) {
+			res.setData(handleFiles(res, "/dun_log_attachment/", false, req, sign, TokenManager.getAdminId()));
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
 	
 	
 

+ 41 - 0
src/main/java/com/goafanti/order/controller/LegalAffairsApiController.java

@@ -1,18 +1,27 @@
 package com.goafanti.order.controller;
 
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.enums.PatentInfoFields;
+import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.excel.NewExcelUtil;
+import com.goafanti.order.bo.InputDunOrder;
 import com.goafanti.order.bo.InputOrderListBo;
 import com.goafanti.order.bo.OutOrderLegalAffairsListBo;
 import com.goafanti.order.service.LegalAffairsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
 import java.util.List;
 
 @RestController
@@ -78,4 +87,36 @@ public class LegalAffairsApiController extends CertifyApiController {
         }
         return newExcelUtil.exportExcel(list,"订单催款列表",uploadPath,sb.substring(0,sb.length()-1));
     }
+    /**
+     * 订单催款日志列表(法务)
+     * @param orderNo
+     * @return
+     */
+    @RequestMapping(value = "/dunOrderList",method = RequestMethod.GET)
+    public Result dunOrderList(String orderNo){
+        Result res = new Result();
+        if (StringUtils.isBlank(orderNo)){
+            res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,ErrorConstants.PARAM_EMPTY_ERROR,"订单编号"));
+            return res;
+        }
+        return res.data(legalAffairsService.dunOrderList(orderNo));
+    }
+
+    /**
+     * 订单催款日志列表(法务)
+     * @param in
+     * @return
+     */
+    @RequestMapping(value = "/addDunOrder",method = RequestMethod.POST)
+    public Result addDunOrder(@Valid InputDunOrder in, BindingResult bindingResult){
+        Result res = new Result();
+        if (bindingResult.hasErrors()) {
+            res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+                    "订单编号、日期、备注"));
+            return res;
+        }
+        return res.data(legalAffairsService.addDunOrder(in));
+    }
+
+
 }

+ 6 - 0
src/main/java/com/goafanti/order/service/LegalAffairsService.java

@@ -1,7 +1,9 @@
 package com.goafanti.order.service;
 
+import com.goafanti.order.bo.InputDunOrder;
 import com.goafanti.order.bo.InputOrderListBo;
 import com.goafanti.order.bo.OutOrderLegalAffairsListBo;
+import com.goafanti.order.bo.TDunLogListBo;
 
 import java.util.List;
 
@@ -17,4 +19,8 @@ public interface LegalAffairsService {
     List<OutOrderLegalAffairsListBo> getLegalAffairsOrder(InputOrderListBo in);
 
     boolean checkTask(String orderNo);
+
+    List<TDunLogListBo> dunOrderList(String orderNo);
+
+    int addDunOrder(InputDunOrder in);
 }

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

@@ -7,7 +7,6 @@ import javax.mail.MessagingException;
 import javax.servlet.http.HttpServletResponse;
 
 
-import com.goafanti.common.bo.Result;
 import com.goafanti.common.model.TOrderDun;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderNewWithBLOBs;
@@ -107,7 +106,7 @@ public interface OrderNewService {
 	 * 新增催款记录
 	 * @return
 	 */
-	int createDunLog(String dunId,String dumTime,String remarks);
+	int createDunLog( String dunId, String dumTime, String remarks, String attUrl);
 	/**
 	 * 查询催款记录
 	 * @param dunId
@@ -200,5 +199,4 @@ public interface OrderNewService {
 
 	List<outProvinceStatisticsList> provinceStatisticsList(InputStatistics in);
 
-
 }

+ 29 - 7
src/main/java/com/goafanti/order/service/impl/LegalAffairsServiceImpl.java

@@ -1,15 +1,16 @@
 package com.goafanti.order.service.impl;
 
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.TDunLogMapper;
 import com.goafanti.common.dao.TOrderMidMapper;
 import com.goafanti.common.dao.TOrderTaskMapper;
+import com.goafanti.common.model.TDunLog;
 import com.goafanti.common.model.TOrderMid;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.order.bo.InputOrderListBo;
-import com.goafanti.order.bo.OutOrderLegalAffairsListBo;
-import com.goafanti.order.bo.TOrderTaskBo;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.*;
 import com.goafanti.order.enums.NewProjectStatus;
 import com.goafanti.order.service.LegalAffairsService;
 import org.apache.poi.ss.formula.functions.Now;
@@ -17,10 +18,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
+import java.text.ParseException;
+import java.util.*;
 
 @Service
 public class LegalAffairsServiceImpl extends BaseMybatisDao<TOrderMidMapper> implements LegalAffairsService {
@@ -28,6 +27,8 @@ public class LegalAffairsServiceImpl extends BaseMybatisDao<TOrderMidMapper> imp
     private TOrderMidMapper tOrderMidMapper;
     @Autowired
     private TOrderTaskMapper    tOrderTaskMapper;
+    @Autowired
+    private TDunLogMapper tDunLogMapper;
 
 
 
@@ -92,4 +93,25 @@ public class LegalAffairsServiceImpl extends BaseMybatisDao<TOrderMidMapper> imp
         }
         return false;
     }
+
+    @Override
+    public List<TDunLogListBo> dunOrderList(String orderNo) {
+        return tDunLogMapper.selectByOrderNo(orderNo);
+    }
+
+    @Override
+    public int addDunOrder(InputDunOrder in) {
+        TDunLog log = new TDunLog();
+        log.setOrderNo(in.getOrderNo());
+        log.setId(UUID.randomUUID().toString());
+        log.setType(1);
+        log.setAttachmentUrl(in.getAttUrl());
+        log.setDumBy(TokenManager.getAdminId());
+        try {
+            log.setDumTime(DateUtils.parseDate(in.getDate(),AFTConstants.YYYYMMDD));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return tDunLogMapper.insertSelective(log);
+    }
 }

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

@@ -818,11 +818,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 	@Override
-	public int createDunLog(String dunId,String dumTime,String remarks) {
+	public int createDunLog( String dunId, String dumTime, String remarks, String attUrl) {
 		TDunLog d=new TDunLog();
 		d.setId(UUID.randomUUID().toString());
 		d.setDunId(dunId);
 		d.setDumBy(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
+		d.setAttachmentUrl(attUrl);
 		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
 		try {
 			d.setDumTime(sdf.parse(dumTime));