Просмотр исходного кода

财务管理员派单、财务收款结算筛选新增合同编号

anderx лет назад: 6
Родитель
Сommit
83b47ea2e2

+ 2 - 2
src/main/java/com/goafanti/common/controller/BaseApiController.java

@@ -113,11 +113,11 @@ public class BaseApiController extends BaseController {
 	 * @param filePath
 	 */
 	protected void downloadFile(HttpServletResponse res, String fileName, String filePath) {
-		FileUtils.downloadFile(res, fileName, uploadPrivatePath + filePath);
+		FileUtils.downloadFile(res, fileName,  uploadPath+ filePath);
 	}
 
 	protected void downloadUnPrivateFile(HttpServletResponse res, String fileName, String filePath) {
-		FileUtils.downloadFile(res, fileName, uploadPath + filePath);
+		FileUtils.downloadFile(res, fileName, uploadPrivatePath + filePath);
 	}
 
 	private File buildFile(String filePath) {

+ 55 - 77
src/main/java/com/goafanti/common/dao/TOrderOutsourceMapper.java

@@ -9,93 +9,71 @@ import org.apache.ibatis.annotations.Param;
 
 public interface TOrderOutsourceMapper {
     /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    long countByExample(TOrderOutsourceExample example);
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	long countByExample(TOrderOutsourceExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int deleteByExample(TOrderOutsourceExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int deleteByExample(TOrderOutsourceExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int deleteByPrimaryKey(Integer id);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int deleteByPrimaryKey(Integer id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int insert(TOrderOutsource record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int insert(TOrderOutsource record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int insertSelective(TOrderOutsource record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int insertSelective(TOrderOutsource record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    List<TOrderOutsource> selectByExample(TOrderOutsourceExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	List<TOrderOutsource> selectByExample(TOrderOutsourceExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    TOrderOutsource selectByPrimaryKey(Integer id);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	TOrderOutsource selectByPrimaryKey(Integer id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int updateByExampleSelective(@Param("record") TOrderOutsource record, @Param("example") TOrderOutsourceExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int updateByExampleSelective(@Param("record") TOrderOutsource record,
+			@Param("example") TOrderOutsourceExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int updateByExample(@Param("record") TOrderOutsource record, @Param("example") TOrderOutsourceExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int updateByExample(@Param("record") TOrderOutsource record, @Param("example") TOrderOutsourceExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int updateByPrimaryKeySelective(TOrderOutsource record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int updateByPrimaryKey(TOrderOutsource record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int updateByPrimaryKeySelective(TOrderOutsource record);
 
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int updateByPrimaryKey(TOrderOutsource record);
 
 	OrderOutsourceDtails selectByOrderNo(String orderNo);
 }

+ 14 - 43
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -907,6 +907,10 @@
   	<if test="o.financeId != null and o.financeId != &quot;&quot;">
   	and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
   	</if>
+  	<if test="o.contractNo != null and o.contractNo != &quot;&quot;">
+  	and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
+  	</if>
+  	
   	<if test="o.buyerName != null and o.buyerName != &quot;&quot;">
   	<bind name="n" value="'%' + o.buyerName + '%'" />
   	and u.nickname  like #{n,jdbcType=VARCHAR}
@@ -937,6 +941,9 @@
   	<if test="o.financeId != null and o.financeId != &quot;&quot;">
   	and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
   	</if>
+  	<if test="o.contractNo != null and o.contractNo != &quot;&quot;">
+  	and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
+  	</if>
   	<if test="o.buyerName != null and o.buyerName != &quot;&quot;">
   	<bind name="n" value="'%' + o.buyerName + '%'" />
   	and u.nickname  like #{n,jdbcType=VARCHAR}
@@ -1044,6 +1051,9 @@
   		<if test="o.departmentId != null and o.departmentId != &quot;&quot;">
 	  	and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
 	  	</if>
+	  	<if test="o.contractNo != null and o.contractNo != &quot;&quot;">
+  	and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
+  	</if>
   		<if test="o.liquidationStatus != null and o.liquidationStatus != &quot;&quot;">
 	  	and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
 	  	</if>
@@ -1087,6 +1097,9 @@
 	  	<if test="o.departmentId != null and o.departmentId != &quot;&quot;">
 	  	and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
 	  	</if>
+	  	<if test="o.contractNo != null and o.contractNo != &quot;&quot;">
+  		and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
+  		</if>
 	  	<if test="o.liquidationStatus != null and o.liquidationStatus != &quot;&quot;">
 	  	and o.liquidation_status = #{o.liquidationStatus,jdbcType=VARCHAR}
 	  	</if>
@@ -1142,7 +1155,7 @@ where super_id is null )  e on e.order_no=a.order_no
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
   	</if>
   	<if test="specially == 1">
-  	and a.process_status =1  and a.order_status=1
+  	and a.process_status = 1  and a.order_status = 1
   	<!-- and c.department_id in (#{deps,jdbcType=VARCHAR}) -->
   	and c.department_id in
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
@@ -1427,46 +1440,4 @@ where super_id is null ) e on e.order_no=a.order_no
   	select count(contract_no) from t_order_new
 	where contract_no= #{0}
   </select>										
-  <select id="orderOutsourceList" resultType="com.goafanti.order.bo.OrderOutsourceBo">
-  select a.order_no orderNo,b.contract_no contractNo,date_format(b.create_time,'%Y-%m-%d %H:%i:%S') createTime,
-	date_format(b.sign_time,'%Y-%m-%d') signTime,c.nickname userName, e.name depName,b.total_amount totalAmount,
-	b.liquidation_status liquidationStatus,a.refund_status refundStatus,d.name adminName,f.name financeName
-	from t_order_outsource a
-	left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id
-	left join admin d on b.salesman_id=d.id left join department e on d.department_id=e.id
-	left join admin f on b.finance_id=f.id
-	where 1=1
-	<if test="refundStatus != null">
-	and a.refund_status= #{refundStatus}
-	</if>
-	<if test="contractNo != null">
-	and b.contract_no like concat('%',#{contractNo},'%')
-	</if>
-	<if test="name != null">
-	and c.nickname like concat('%',#{name},'%')
-	</if>
-	<if test="startTime != null and endTime != null">
-	and b.create_time between #{startTime} and  #{endTime}
-	</if>
-	order by b.create_time desc
-  	<if test="page_sql!=null">
-			${page_sql}
-	</if>
-  </select>
-  <select id="orderOutsourceCount" resultType="java.lang.Integer">
-  select count(*) from t_order_outsource a left join t_order_new b on a.order_no=b.order_no 
-  left join `user` c on b.buyer_id=c.id where 1=1
-  <if test="refundStatus != null">
-	and a.refund_status= #{refundStatus}
-	</if>
-	<if test="contractNo != null">
-	and b.contract_no like concat('%',#{contractNo},'%')
-	</if>
-	<if test="name != null">
-	and c.nickname like concat('%',#{name},'%')
-	</if>
-	<if test="starTime != null and endTime != null">
-	and b.create_time between #{starTime} and  #{endTime}
-	</if>
-  </select>
 </mapper>

+ 132 - 25
src/main/java/com/goafanti/common/mapper/TOrderOutsourceMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
@@ -16,12 +16,13 @@
     <result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
     <result column="amount" jdbcType="DECIMAL" property="amount" />
     <result column="company_name" jdbcType="VARCHAR" property="companyName" />
+    <result column="audit_time" jdbcType="TIMESTAMP" property="auditTime" />
   </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 Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -55,7 +56,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -89,16 +90,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     id, order_no, refund_status, create_time, remarks, attachment_url, picture_url, amount, 
-    company_name
+    company_name, audit_time
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderOutsourceExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     select
     <if test="distinct">
@@ -117,7 +118,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -128,7 +129,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     delete from t_order_outsource
     where id = #{id,jdbcType=INTEGER}
@@ -137,7 +138,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     delete from t_order_outsource
     <if test="_parameter != null">
@@ -148,22 +149,22 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     insert into t_order_outsource (id, order_no, refund_status, 
       create_time, remarks, attachment_url, 
-      picture_url, amount, company_name
-      )
+      picture_url, amount, company_name, 
+      audit_time)
     values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{refundStatus,jdbcType=INTEGER}, 
       #{createTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=VARCHAR}, 
-      #{pictureUrl,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{companyName,jdbcType=VARCHAR}
-      )
+      #{pictureUrl,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{companyName,jdbcType=VARCHAR}, 
+      #{auditTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderOutsource">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     insert into t_order_outsource
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -194,6 +195,9 @@
       <if test="companyName != null">
         company_name,
       </if>
+      <if test="auditTime != null">
+        audit_time,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -223,13 +227,16 @@
       <if test="companyName != null">
         #{companyName,jdbcType=VARCHAR},
       </if>
+      <if test="auditTime != null">
+        #{auditTime,jdbcType=TIMESTAMP},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.TOrderOutsourceExample" resultType="java.lang.Long">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     select count(*) from t_order_outsource
     <if test="_parameter != null">
@@ -240,7 +247,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     update t_order_outsource
     <set>
@@ -271,6 +278,9 @@
       <if test="record.companyName != null">
         company_name = #{record.companyName,jdbcType=VARCHAR},
       </if>
+      <if test="record.auditTime != null">
+        audit_time = #{record.auditTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -280,7 +290,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     update t_order_outsource
     set id = #{record.id,jdbcType=INTEGER},
@@ -291,7 +301,8 @@
       attachment_url = #{record.attachmentUrl,jdbcType=VARCHAR},
       picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
       amount = #{record.amount,jdbcType=DECIMAL},
-      company_name = #{record.companyName,jdbcType=VARCHAR}
+      company_name = #{record.companyName,jdbcType=VARCHAR},
+      audit_time = #{record.auditTime,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -300,7 +311,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     update t_order_outsource
     <set>
@@ -328,6 +339,9 @@
       <if test="companyName != null">
         company_name = #{companyName,jdbcType=VARCHAR},
       </if>
+      <if test="auditTime != null">
+        audit_time = #{auditTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -335,7 +349,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     update t_order_outsource
     set order_no = #{orderNo,jdbcType=VARCHAR},
@@ -345,12 +359,105 @@
       attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
       picture_url = #{pictureUrl,jdbcType=VARCHAR},
       amount = #{amount,jdbcType=DECIMAL},
-      company_name = #{companyName,jdbcType=VARCHAR}
+      company_name = #{companyName,jdbcType=VARCHAR},
+      audit_time = #{auditTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=INTEGER}
   </update>
   <select id="selectByOrderNo" resultType="com.goafanti.order.bo.OrderOutsourceDtails">
-   select id, order_no orderNo, refund_status refundStatus, date_format(create_time,'%Y-%m-%d %H:%i:%S') createTimes , remarks, 
-   attachment_url attachmentUrl, picture_url pictureUrl, amount,company_name companyName from t_order_outsource
-    where order_no =  #{orderNo}
+  select id, order_no orderNo, refund_status refundStatus, date_format(create_time,'%Y-%m-%d %H:%i:%S') createTimes , remarks,
+	 date_format(audit_time,'%Y-%m-%d %H:%i:%S') auditTimes,attachment_url attachmentUrl, picture_url pictureUrl, amount,
+	 company_name companyName from t_order_outsource where order_no =  #{orderNo}
+  </select>
+  <select id="orderOutsourceList" resultType="com.goafanti.order.bo.OrderOutsourceBo">
+  select a.order_no orderNo,b.contract_no contractNo,date_format(b.create_time,'%Y-%m-%d %H:%i:%S') createTime,
+	date_format(b.sign_time,'%Y-%m-%d') signTime,c.nickname userName, e.name depName,b.total_amount totalAmount,
+	b.liquidation_status liquidationStatus,a.refund_status refundStatus,d.name adminName,f.name financeName
+	from t_order_outsource a
+	left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id
+	left join admin d on b.salesman_id=d.id left join department e on d.department_id=e.id
+	left join admin f on b.finance_id=f.id
+	where 1=1
+	<if test="refundStatus != null">
+	and a.refund_status= #{refundStatus}
+	</if>
+	<if test="contractNo != null">
+	and b.contract_no like concat('%',#{contractNo},'%')
+	</if>
+	<if test="name != null">
+	and c.nickname like concat('%',#{name},'%')
+	</if>
+	<if test="startTime != null and endTime != null">
+	and b.create_time between #{startTime} and  #{endTime}
+	</if>
+	order by b.create_time desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  <select id="orderOutsourceCount" resultType="java.lang.Integer">
+  select count(*) from t_order_outsource a left join t_order_new b on a.order_no=b.order_no 
+  left join `user` c on b.buyer_id=c.id where 1=1
+  <if test="refundStatus != null">
+	and a.refund_status= #{refundStatus}
+	</if>
+	<if test="contractNo != null">
+	and b.contract_no like concat('%',#{contractNo},'%')
+	</if>
+	<if test="name != null">
+	and c.nickname like concat('%',#{name},'%')
+	</if>
+	<if test="starTime != null and endTime != null">
+	and b.create_time between #{starTime} and  #{endTime}
+	</if>
+  </select>
+    <select id="salesmanOrderOutsourceList" resultType="com.goafanti.order.bo.OrderOutsourceBo">
+    select a.order_no orderNo,b.contract_no contractNo,date_format(b.create_time,'%Y-%m-%d %H:%i:%S') createTime,
+	date_format(b.sign_time,'%Y-%m-%d') signTime,c.nickname userName, e.name depName,b.total_amount totalAmount,
+	b.liquidation_status liquidationStatus,a.refund_status refundStatus,d.name adminName,f.name financeName
+	from t_order_outsource a
+	left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id
+	left join admin d on b.salesman_id=d.id left join department e on d.department_id=e.id
+	left join admin f on b.finance_id=f.id
+	where 1=1 and b.outsource=1
+		and d.department_id in
+  	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
+	 #{deps.id}
+  	</foreach>
+	<if test="refundStatus != null">
+	and a.refund_status= #{refundStatus}
+	</if>
+	<if test="contractNo != null">
+	and b.contract_no like concat('%',#{contractNo},'%')
+	</if>
+	<if test="name != null">
+	and c.nickname like concat('%',#{name},'%')
+	</if>
+	<if test="startTime != null and endTime != null">
+	and b.create_time between #{startTime} and  #{endTime}
+	</if>
+	order by b.create_time desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  <select id="salesmanOrderOutsourceCount" resultType="java.lang.Integer">
+  select count(*) from t_order_outsource a left join t_order_new b on a.order_no=b.order_no 
+  left join `user` c on b.buyer_id=c.id where 1=1 left join admin d on b.salesman_id=d.id
+  	and d.department_id in
+  	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
+	 #{deps.id}
+  	</foreach>
+  <if test="refundStatus != null">
+	and a.refund_status= #{refundStatus}
+	</if>
+	<if test="contractNo != null">
+	and b.contract_no like concat('%',#{contractNo},'%')
+	</if>
+	<if test="name != null">
+	and c.nickname like concat('%',#{name},'%')
+	</if>
+	<if test="starTime != null and endTime != null">
+	and b.create_time between #{starTime} and  #{endTime}
+	</if>
   </select>
 </mapper>

+ 230 - 295
src/main/java/com/goafanti/common/model/TOrderOutsource.java

@@ -4,300 +4,235 @@ import java.math.BigDecimal;
 import java.util.Date;
 
 public class TOrderOutsource {
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.id
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private Integer id;
 
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.order_no
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private String orderNo;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.refund_status
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private Integer refundStatus;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.create_time
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private Date createTime;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.remarks
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private String remarks;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.attachment_url
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private String attachmentUrl;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.picture_url
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private String pictureUrl;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.amount
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private BigDecimal amount;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.company_name
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private String companyName;
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.id
-     *
-     * @return the value of t_order_outsource.id
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public Integer getId() {
-        return id;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.id
-     *
-     * @param id the value for t_order_outsource.id
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.order_no
-     *
-     * @return the value of t_order_outsource.order_no
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public String getOrderNo() {
-        return orderNo;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.order_no
-     *
-     * @param orderNo the value for t_order_outsource.order_no
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setOrderNo(String orderNo) {
-        this.orderNo = orderNo;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.refund_status
-     *
-     * @return the value of t_order_outsource.refund_status
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public Integer getRefundStatus() {
-        return refundStatus;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.refund_status
-     *
-     * @param refundStatus the value for t_order_outsource.refund_status
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setRefundStatus(Integer refundStatus) {
-        this.refundStatus = refundStatus;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.create_time
-     *
-     * @return the value of t_order_outsource.create_time
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.create_time
-     *
-     * @param createTime the value for t_order_outsource.create_time
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.remarks
-     *
-     * @return the value of t_order_outsource.remarks
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public String getRemarks() {
-        return remarks;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.remarks
-     *
-     * @param remarks the value for t_order_outsource.remarks
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setRemarks(String remarks) {
-        this.remarks = remarks;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.attachment_url
-     *
-     * @return the value of t_order_outsource.attachment_url
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public String getAttachmentUrl() {
-        return attachmentUrl;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.attachment_url
-     *
-     * @param attachmentUrl the value for t_order_outsource.attachment_url
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setAttachmentUrl(String attachmentUrl) {
-        this.attachmentUrl = attachmentUrl;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.picture_url
-     *
-     * @return the value of t_order_outsource.picture_url
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public String getPictureUrl() {
-        return pictureUrl;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.picture_url
-     *
-     * @param pictureUrl the value for t_order_outsource.picture_url
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setPictureUrl(String pictureUrl) {
-        this.pictureUrl = pictureUrl;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.amount
-     *
-     * @return the value of t_order_outsource.amount
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public BigDecimal getAmount() {
-        return amount;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.amount
-     *
-     * @param amount the value for t_order_outsource.amount
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setAmount(BigDecimal amount) {
-        this.amount = amount;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.company_name
-     *
-     * @return the value of t_order_outsource.company_name
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public String getCompanyName() {
-        return companyName;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.company_name
-     *
-     * @param companyName the value for t_order_outsource.company_name
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setCompanyName(String companyName) {
-        this.companyName = companyName;
-    }
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.id
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private Integer id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.order_no
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private String orderNo;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.refund_status
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private Integer refundStatus;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.create_time
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private Date createTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.remarks
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private String remarks;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.attachment_url
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private String attachmentUrl;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.picture_url
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private String pictureUrl;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.amount
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private BigDecimal amount;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.company_name
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private String companyName;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.audit_time
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private Date auditTime;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.id
+	 * @return  the value of t_order_outsource.id
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public Integer getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.id
+	 * @param id  the value for t_order_outsource.id
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.order_no
+	 * @return  the value of t_order_outsource.order_no
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public String getOrderNo() {
+		return orderNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.order_no
+	 * @param orderNo  the value for t_order_outsource.order_no
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.refund_status
+	 * @return  the value of t_order_outsource.refund_status
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public Integer getRefundStatus() {
+		return refundStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.refund_status
+	 * @param refundStatus  the value for t_order_outsource.refund_status
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setRefundStatus(Integer refundStatus) {
+		this.refundStatus = refundStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.create_time
+	 * @return  the value of t_order_outsource.create_time
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.create_time
+	 * @param createTime  the value for t_order_outsource.create_time
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.remarks
+	 * @return  the value of t_order_outsource.remarks
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public String getRemarks() {
+		return remarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.remarks
+	 * @param remarks  the value for t_order_outsource.remarks
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setRemarks(String remarks) {
+		this.remarks = remarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.attachment_url
+	 * @return  the value of t_order_outsource.attachment_url
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public String getAttachmentUrl() {
+		return attachmentUrl;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.attachment_url
+	 * @param attachmentUrl  the value for t_order_outsource.attachment_url
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setAttachmentUrl(String attachmentUrl) {
+		this.attachmentUrl = attachmentUrl;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.picture_url
+	 * @return  the value of t_order_outsource.picture_url
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public String getPictureUrl() {
+		return pictureUrl;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.picture_url
+	 * @param pictureUrl  the value for t_order_outsource.picture_url
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setPictureUrl(String pictureUrl) {
+		this.pictureUrl = pictureUrl;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.amount
+	 * @return  the value of t_order_outsource.amount
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public BigDecimal getAmount() {
+		return amount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.amount
+	 * @param amount  the value for t_order_outsource.amount
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setAmount(BigDecimal amount) {
+		this.amount = amount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.company_name
+	 * @return  the value of t_order_outsource.company_name
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public String getCompanyName() {
+		return companyName;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.company_name
+	 * @param companyName  the value for t_order_outsource.company_name
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setCompanyName(String companyName) {
+		this.companyName = companyName;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.audit_time
+	 * @return  the value of t_order_outsource.audit_time
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public Date getAuditTime() {
+		return auditTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.audit_time
+	 * @param auditTime  the value for t_order_outsource.audit_time
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setAuditTime(Date auditTime) {
+		this.auditTime = auditTime;
+	}
 }

Разница между файлами не показана из-за своего большого размера
+ 892 - 873
src/main/java/com/goafanti/common/model/TOrderOutsourceExample.java


+ 15 - 0
src/main/java/com/goafanti/order/bo/OrderOutsourceDtails.java

@@ -3,5 +3,20 @@ package com.goafanti.order.bo;
 import com.goafanti.common.model.TOrderOutsource;
 
 public class OrderOutsourceDtails extends TOrderOutsource {
+	private String createTimes;
+	private String auditTimes;
+	public String getCreateTimes() {
+		return createTimes;
+	}
+	public void setCreateTimes(String createTimes) {
+		this.createTimes = createTimes;
+	}
+	public String getAuditTimes() {
+		return auditTimes;
+	}
+	public void setAuditTimes(String auditTimes) {
+		this.auditTimes = auditTimes;
+	}
+	
 		
 }

+ 3 - 57
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -268,24 +268,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		}
 		return res.data(orderNewService.updateOrderNew(orderNo,orderStatus,reason,0,null));
 	}
-	/**
-	 * 审核并外包
-	 */
-	@RequestMapping(value="/auditOutsource", method = RequestMethod.POST)
-	public Result auditOutsource(TOrderOutsource o,Integer orderStatus){
-		Result res=new Result();
-		if(StringUtils.isBlank(o.getOrderNo())||StringUtils.isBlank(o.getCompanyName())||
-				o.getAmount()==null){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "外包信息","外包信息"));
-			return res;
-		}
-		if(orderStatus==null||(orderStatus!=OrderNewState.QDSHTG.getCode()&&orderStatus!=OrderNewState.QDSHJJ.getCode())||
-				orderNewService.chekeOrderStatus(o.getOrderNo())){
-			res.getError().add(buildError( "审核状态错误","审核状态错误"));
-			return res;
-		}
-		return res.data(orderNewService.updateOrderNew(o.getOrderNo(),orderStatus,null,1,o));
-	}
+	
 	
 	/**
 	 * 催款统计列表
@@ -417,37 +400,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		return res;
 	}
 	
-	/**
-	 * 外包审核列表
-	 */
-	@RequestMapping(value="/orderOutsourceList", method = RequestMethod.GET)
-	public Result orderOutsourceList(String name,String contractNo,String starTime,String endTime,Integer refundStatus,Integer pageNo,Integer pageSize){
-		Result res=new Result();
-		res.data(orderNewService.orderOutsourceList(name, contractNo, starTime, endTime,refundStatus, pageNo, pageSize));
-		return res;
-	}
-	/**
-	 * 外包审核详情
-	 */
-	@RequestMapping(value="/orderOutsourceDtails", method = RequestMethod.GET)
-	public Result orderOutsourceDtails(String orderNo){
-		Result res=new Result();
-		res.data(orderNewService.orderOutsourceDtails(orderNo));
-		return res;
-	}
-	/**
-	 * 外包审核
-	 */
-	@RequestMapping(value="/auditOutsource", method = RequestMethod.GET)
-	public Result auditOutsource(OrderOutsourceDtails o){
-		Result res=new Result();
-		if (o.getId()==null||o.getRefundStatus()==null||o.getRemarks()==null) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "外包信息","外包信息"));
-			return res;
-		}
-		res.data(orderNewService.updateAuditOutsource(o));
-		return res;
-	}
+	
 	
 	
 	
@@ -514,14 +467,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		return res;
 	}
 	
-	/** 外包文件上传 **/
-	@RequestMapping(value = "/uploadOutsourceFile", method = RequestMethod.POST)
-	public Result uploadOutsourceFile(HttpServletRequest req,String sign){
-		Result res = new Result();
-		//order_refund_file
-		res.setData(handleFile(res, "/order_outsource/", false, req, sign));
-		return res;
-	}
+	
 	
 	
 

+ 98 - 0
src/main/java/com/goafanti/order/controller/OutsourceOrgApiController.java

@@ -3,7 +3,10 @@ package com.goafanti.order.controller;
 
 
 
+
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -11,8 +14,13 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.model.OutsourceOrganization;
+import com.goafanti.common.model.TOrderOutsource;
+import com.goafanti.order.bo.OrderOutsourceDtails;
+import com.goafanti.order.enums.OrderNewState;
+import com.goafanti.order.service.OrderNewService;
 import com.goafanti.order.service.OutsourceOrgService;
 
 @RestController
@@ -21,6 +29,8 @@ public class OutsourceOrgApiController extends CertifyApiController {
 	
 	@Resource
 	private OutsourceOrgService	outsourceOrgService;
+	@Resource
+	private OrderNewService	orderNewService;
 	
 	@RequestMapping(value = "/addOutsourceOrg", method=RequestMethod.POST)
 	public Result addOutsourceOrg(OutsourceOrganization o) {
@@ -67,6 +77,14 @@ public class OutsourceOrgApiController extends CertifyApiController {
 		res.data(outsourceOrgService.selectOutsourceOrg(orderNo,tid));
 		return res;
 	}
+	/** 外包文件上传 **/
+	@RequestMapping(value = "/uploadOutsourceFile", method = RequestMethod.POST)
+	public Result uploadOutsourceFile(HttpServletRequest req,String sign){
+		Result res = new Result();
+		//order_refund_file
+		res.setData(handleFile(res, "/order_outsource/", false, req, sign));
+		return res;
+	}
 	/**
 	 * 订单外包列表
 	 * @param orderNo
@@ -82,4 +100,84 @@ public class OutsourceOrgApiController extends CertifyApiController {
 		res.data(outsourceOrgService.selectOrderOutsourceOrg(orderNo));
 		return res;
 	}
+	
+	/**
+	 * 审核并外包
+	 */
+	@RequestMapping(value="/auditOutsource", method = RequestMethod.POST)
+	public Result auditOutsource(TOrderOutsource o,Integer orderStatus){
+		Result res=new Result();
+		if(StringUtils.isBlank(o.getOrderNo())||StringUtils.isBlank(o.getCompanyName())||
+				o.getAmount()==null){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "外包信息","外包信息"));
+			return res;
+		}
+		if(orderStatus==null||(orderStatus!=OrderNewState.QDSHTG.getCode()&&orderStatus!=OrderNewState.QDSHJJ.getCode())||
+				orderNewService.chekeOrderStatus(o.getOrderNo())){
+			res.getError().add(buildError( "审核状态错误","审核状态错误"));
+			return res;
+		}
+		return res.data(orderNewService.updateOrderNew(o.getOrderNo(),orderStatus,null,1,o));
+	}
+	/**
+	 * 外包审核列表
+	 */
+	@RequestMapping(value="/orderOutsourceList", method = RequestMethod.GET)
+	public Result orderOutsourceList(String name,String contractNo,String starTime,String endTime,Integer refundStatus,Integer pageNo,Integer pageSize){
+		Result res=new Result();
+		res.data(outsourceOrgService.orderOutsourceList(name, contractNo, starTime, endTime,refundStatus, pageNo, pageSize));
+		return res;
+	}
+	
+	/**
+	 * 外包审核列表(营销管理员列表)
+	 */
+	@RequestMapping(value="/salesmanOrderOutsourceList", method = RequestMethod.GET)
+	public Result salesmanOrderOutsourceList(String name,String orderNo,String starTime,String endTime,Integer refundStatus,Integer pageNo,Integer pageSize){
+		Result res=new Result();
+		res.data(outsourceOrgService.salesmanOrderOutsourceList(name, orderNo, starTime, endTime,refundStatus, pageNo, pageSize));
+		return res;
+	}
+	/**
+	 * 外包审核详情
+	 */
+	@RequestMapping(value="/orderOutsourceDtails", method = RequestMethod.GET)
+	public Result orderOutsourceDtails(String orderNo){
+		Result res=new Result();
+		res.data(outsourceOrgService.orderOutsourceDtails(orderNo));
+		return res;
+	}
+	/**
+	 * 外包审核
+	 */
+	@RequestMapping(value="/auditOutsource", method = RequestMethod.GET)
+	public Result auditOutsource(OrderOutsourceDtails o){
+		Result res=new Result();
+		if (o.getId()==null||o.getRefundStatus()==null||o.getRemarks()==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "外包信息","外包信息"));
+			return res;
+		}
+		res.data(outsourceOrgService.updateAuditOutsource(o));
+		return res;
+	}
+	 /**
+     *	 下载文档
+     * 
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/downloadFile", method = RequestMethod.GET)
+    public Result downloadTemplateFile(HttpServletResponse response, String path) {
+        Result res = new Result();
+            if (null == path) {
+                res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "", "找不到文件!"));
+            } else {
+               String suffix = path.substring(path.lastIndexOf("."));
+               String name=path.substring(path.lastIndexOf("/")+1, path.lastIndexOf("."));
+                String fileName = name + suffix;
+                downloadFile(response, fileName, path);
+        } 
+        return res;
+    } 
+    
 }

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

@@ -169,10 +169,7 @@ public interface OrderNewService {
 	
 	int updateFinance(String orderNo, String newFinance);
 	List<TOrderLogBo> selectOrderLog(String orderNo);
-	Pagination<OrderOutsourceBo> orderOutsourceList(String name, String contractNo, String starTime, String endTime,Integer refundStatus, Integer pageNo,
-			Integer pageSize);
-	OrderOutsourceDtails orderOutsourceDtails(String orderNo);
-	int updateAuditOutsource(OrderOutsourceDtails o);
+
 	
 	
 }

+ 13 - 0
src/main/java/com/goafanti/order/service/OutsourceOrgService.java

@@ -3,6 +3,9 @@ package com.goafanti.order.service;
 import java.util.List;
 
 import com.goafanti.common.model.OutsourceOrganization;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.bo.OrderOutsourceBo;
+import com.goafanti.order.bo.OrderOutsourceDtails;
 import com.goafanti.order.bo.OutsourceOrganizationBo;
 
 public interface OutsourceOrgService {
@@ -16,6 +19,16 @@ public interface OutsourceOrgService {
 	List<OutsourceOrganizationBo> selectOutsourceOrg(String orderNo,String tid);
 
 	List<OutsourceOrganizationBo> selectOrderOutsourceOrg(String orderNo);
+	
+	Pagination<OrderOutsourceBo> orderOutsourceList(String name, String contractNo, String starTime, String endTime,Integer refundStatus, Integer pageNo,
+			Integer pageSize);
+	
+	OrderOutsourceDtails orderOutsourceDtails(String orderNo);
+	
+	int updateAuditOutsource(OrderOutsourceDtails o);
+
+	Pagination<OrderOutsourceBo> salesmanOrderOutsourceList(String name, String orderNo, String starTime, String endTime,
+			Integer refundStatus, Integer pageNo, Integer pageSize);
 
 	
 }

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

@@ -817,34 +817,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 
-	@Override
-	@SuppressWarnings("unchecked")
-	public Pagination<OrderOutsourceBo> orderOutsourceList(String name, String contractNo, String starTime,
-			String endTime,Integer refundStatus, Integer pageNo, Integer pageSize) {
-		Map<String, Object> params = new HashMap<String, Object>();
-		if(pageSize==null||pageSize<0)pageSize=10;
-		if(pageNo==null||pageNo<0)pageNo=1;
-		if (StringUtils.isNotBlank(name)) params.put("name", name);
-		if(refundStatus != null) params.put("refundStatus", refundStatus);
-		if (StringUtils.isNotBlank(contractNo)) params.put("contractNo", contractNo);
-		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
-		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
-		Pagination<OrderOutsourceBo> p = (Pagination<OrderOutsourceBo>)findPage("orderOutsourceList", "orderOutsourceCount", params, pageNo, pageSize);
-		return p;
-	}
 
-
-
-	@Override
-	public OrderOutsourceDtails orderOutsourceDtails(String orderNo) {
-		return tOrderOutsourceMapper.selectByOrderNo(orderNo);
-	}
-
-
-
-	@Override
-	public int updateAuditOutsource(OrderOutsourceDtails o) {
-		return tOrderOutsourceMapper.updateByPrimaryKeySelective(o);
-	}
 	
 }

+ 62 - 1
src/main/java/com/goafanti/order/service/impl/OutsourceOrgServiceImpl.java

@@ -1,18 +1,32 @@
 package com.goafanti.order.service.impl;
 
+import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.dao.OutsourceOrganizationMapper;
+import com.goafanti.common.dao.TOrderOutsourceMapper;
 import com.goafanti.common.model.OutsourceOrganization;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.bo.OrderOutsourceBo;
+import com.goafanti.order.bo.OrderOutsourceDtails;
 import com.goafanti.order.bo.OutsourceOrganizationBo;
+import com.goafanti.order.service.OrderService;
 import com.goafanti.order.service.OutsourceOrgService;
 @Service
-public class OutsourceOrgServiceImpl implements OutsourceOrgService {
+public class OutsourceOrgServiceImpl  extends BaseMybatisDao<TOrderOutsourceMapper> implements OutsourceOrgService {
 	@Autowired
 	private OutsourceOrganizationMapper  outsourceOrganizationMapper;
+	@Autowired
+	private TOrderOutsourceMapper	tOrderOutsourceMapper;
+	@Autowired
+	private OrderService	orderService;
 	@Override
 	public int addOutsourceOrg(OutsourceOrganization o) {
 		return outsourceOrganizationMapper.insertSelective(o);
@@ -35,5 +49,52 @@ public class OutsourceOrgServiceImpl implements OutsourceOrgService {
 		
 		return outsourceOrganizationMapper.selectOrderOutsourceOrg(orderNo);
 	}
+	
+	@Override
+	@SuppressWarnings("unchecked")
+	public Pagination<OrderOutsourceBo> orderOutsourceList(String name, String contractNo, String starTime,
+			String endTime,Integer refundStatus, Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(pageSize==null||pageSize<0)pageSize=10;
+		if(pageNo==null||pageNo<0)pageNo=1;
+		if (StringUtils.isNotBlank(name)) params.put("name", name);
+		if(refundStatus != null) params.put("refundStatus", refundStatus);
+		if (StringUtils.isNotBlank(contractNo)) params.put("contractNo", contractNo);
+		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
+		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
+		Pagination<OrderOutsourceBo> p = (Pagination<OrderOutsourceBo>)findPage("orderOutsourceList", "orderOutsourceCount", params, pageNo, pageSize);
+		return p;
+	}
+
+
+
+	@Override
+	public OrderOutsourceDtails orderOutsourceDtails(String orderNo) {
+		return tOrderOutsourceMapper.selectByOrderNo(orderNo);
+	}
+
+
+
+	@Override
+	public int updateAuditOutsource(OrderOutsourceDtails o) {
+		o.setAuditTime(new Date());
+		return tOrderOutsourceMapper.updateByPrimaryKeySelective(o);
+	}
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<OrderOutsourceBo> salesmanOrderOutsourceList(String name, String orderNo, String starTime,
+			String endTime, Integer refundStatus, Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(pageSize==null||pageSize<0)pageSize=10;
+		if(pageNo==null||pageNo<0)pageNo=1;
+		if (StringUtils.isNotBlank(name)) params.put("name", name);
+		params.put("deps", orderService.selectMyDeps());
+		if(refundStatus != null) params.put("refundStatus", refundStatus);
+		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");
+		Pagination<OrderOutsourceBo> p = (Pagination<OrderOutsourceBo>)findPage("salesmanOrderOutsourceList", "salesmanOrderOutsourceCount", params, pageNo, pageSize);
+		return p;
+	}
 
 }