Browse Source

修改催款触发条件

Signed-off-by: anderx <312518615@qq.com>
anderx 6 years ago
parent
commit
2a9253f3ae

+ 1 - 1
GeneratorConfig.xml

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

+ 11 - 11
src/main/java/com/goafanti/common/dao/NewOrderDunMapper.java

@@ -10,67 +10,67 @@ import org.apache.ibatis.annotations.Param;
 public interface NewOrderDunMapper {
     /**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	long countByExample(NewOrderDunExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	int deleteByExample(NewOrderDunExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	int deleteByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	int insert(NewOrderDun record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	int insertSelective(NewOrderDun record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	List<NewOrderDun> selectByExample(NewOrderDunExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	NewOrderDun selectByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	int updateByExampleSelective(@Param("record") NewOrderDun record, @Param("example") NewOrderDunExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	int updateByExample(@Param("record") NewOrderDun record, @Param("example") NewOrderDunExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	int updateByPrimaryKeySelective(NewOrderDun record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	int updateByPrimaryKey(NewOrderDun record);
 

+ 0 - 1
src/main/java/com/goafanti/common/dao/TTaskHoursMapper.java

@@ -80,7 +80,6 @@ public interface TTaskHoursMapper {
 
 	List<TOrderTaskListBo> getOrderDunData(String name, String taskId, String starTime, String endTime);
 
-	List<TOrderTaskListBo> getTaskHoursData( @Param("name")String name,  @Param("taskId")String taskId,@Param("orderNo")String orderNo,  @Param("startTime")String startTime,  @Param("endTime")String endTime,@Param("fid")String fid );
 
 	List<TTaskHours> taskHoursDetailsList( @Param("taskId")String taskId,  @Param("aid")String aid);
 }

+ 43 - 29
src/main/java/com/goafanti/common/mapper/NewOrderDunMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
@@ -19,12 +19,13 @@
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
     <result column="money" jdbcType="DECIMAL" property="money" />
+    <result column="appropriation_ratio" jdbcType="DECIMAL" property="appropriationRatio" />
   </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 Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -58,7 +59,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -92,16 +93,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     id, order_no, tid, project_type, dun_type, wait_day, effective_count, aid, status, 
-    create_time, start_time, money
+    create_time, start_time, money, appropriation_ratio
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.NewOrderDunExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     select
     <if test="distinct">
@@ -120,7 +121,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -131,22 +132,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     delete from new_order_dun
     where id = #{id,jdbcType=INTEGER}
   </delete>
-  <delete id="deleteByTid" parameterType="java.lang.Integer">
-    
-    delete from new_order_dun
-    where tid = #{tid,jdbcType=INTEGER}
-  </delete>
-  
   <delete id="deleteByExample" parameterType="com.goafanti.common.model.NewOrderDunExample">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     delete from new_order_dun
     <if test="_parameter != null">
@@ -157,24 +152,24 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     insert into new_order_dun (id, order_no, tid, 
       project_type, dun_type, wait_day, 
       effective_count, aid, status, 
-      create_time, start_time, money
-      )
+      create_time, start_time, money, 
+      appropriation_ratio)
     values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{tid,jdbcType=INTEGER}, 
       #{projectType,jdbcType=INTEGER}, #{dunType,jdbcType=INTEGER}, #{waitDay,jdbcType=INTEGER}, 
       #{effectiveCount,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{startTime,jdbcType=TIMESTAMP}, #{money,jdbcType=DECIMAL}
-      )
+      #{createTime,jdbcType=TIMESTAMP}, #{startTime,jdbcType=TIMESTAMP}, #{money,jdbcType=DECIMAL}, 
+      #{appropriationRatio,jdbcType=DECIMAL})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.NewOrderDun">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     insert into new_order_dun
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -214,6 +209,9 @@
       <if test="money != null">
         money,
       </if>
+      <if test="appropriationRatio != null">
+        appropriation_ratio,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -252,13 +250,16 @@
       <if test="money != null">
         #{money,jdbcType=DECIMAL},
       </if>
+      <if test="appropriationRatio != null">
+        #{appropriationRatio,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.NewOrderDunExample" resultType="java.lang.Long">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     select count(*) from new_order_dun
     <if test="_parameter != null">
@@ -269,7 +270,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     update new_order_dun
     <set>
@@ -309,6 +310,9 @@
       <if test="record.money != null">
         money = #{record.money,jdbcType=DECIMAL},
       </if>
+      <if test="record.appropriationRatio != null">
+        appropriation_ratio = #{record.appropriationRatio,jdbcType=DECIMAL},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -318,7 +322,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     update new_order_dun
     set id = #{record.id,jdbcType=INTEGER},
@@ -332,7 +336,8 @@
       status = #{record.status,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       start_time = #{record.startTime,jdbcType=TIMESTAMP},
-      money = #{record.money,jdbcType=DECIMAL}
+      money = #{record.money,jdbcType=DECIMAL},
+      appropriation_ratio = #{record.appropriationRatio,jdbcType=DECIMAL}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -341,7 +346,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     update new_order_dun
     <set>
@@ -378,6 +383,9 @@
       <if test="money != null">
         money = #{money,jdbcType=DECIMAL},
       </if>
+      <if test="appropriationRatio != null">
+        appropriation_ratio = #{appropriationRatio,jdbcType=DECIMAL},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -385,7 +393,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Dec 06 08:46:15 CST 2019.
+      This element was generated on Thu Dec 19 11:46:22 CST 2019.
     -->
     update new_order_dun
     set order_no = #{orderNo,jdbcType=VARCHAR},
@@ -398,9 +406,15 @@
       status = #{status,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       start_time = #{startTime,jdbcType=TIMESTAMP},
-      money = #{money,jdbcType=DECIMAL}
+      money = #{money,jdbcType=DECIMAL},
+      appropriation_ratio = #{appropriationRatio,jdbcType=DECIMAL}
     where id = #{id,jdbcType=INTEGER}
   </update>
+  <delete id="deleteByTid" parameterType="java.lang.Integer">
+    
+    delete from new_order_dun
+    where tid = #{tid,jdbcType=INTEGER}
+  </delete>
   <select id="selectListNewOrderDun" resultType="com.goafanti.order.bo.OutNewOrderDunBo">
   	 select a.id,a.order_no orderNo, a.tid, a.project_type projectType, a.dun_type dunType, a.wait_day waitDay, 
   a.effective_count effectiveCount, a.aid, a.create_time createTime ,b.commodity_name commodityName,a.money,a.status
@@ -417,7 +431,7 @@
   select a.id, a.order_no orderNo, a.tid, a.project_type projectType, a.dun_type dunType, a.wait_day waitDay, 
   a.effective_count effectiveCount, a.aid, a.create_time createTime,b.approval
   from new_order_dun a left join  t_order_new b on a.order_no=b.order_no
-  where 1=1 and a.status=0
+  where 1=1 and a.status=0 and b.process_status &gt; 1
   </select>
   <select id="selectByTid" resultType="com.goafanti.order.bo.OutNewOrderDunBo">
     select a.id, a.order_no orderNo, a.tid, a.project_type projectType, a.dun_type dunType, a.wait_day waitDay, 

+ 17 - 12
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1207,6 +1207,9 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	</if>
   	from t_order_new a  left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
   	left join department dep on a.order_dep=dep.id
+  	<if test="specially == 1">
+  	left join admin ad on a.salesman_id=ad.id
+  	</if>
   	<if test="specially == 2">
 	left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
   	left join admin f on e.initiate=f.id
@@ -1227,7 +1230,7 @@ where super_id is null )  e on e.order_no=a.order_no
   	<if test="specially == 1">
   	and a.process_status = 1  and a.order_status = 1
   	<!-- and c.department_id in (#{deps,jdbcType=VARCHAR}) -->
-  	and a.order_dep in
+  	and ad.department_id in
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
 	 #{deps.id}
   	</foreach>
@@ -1298,6 +1301,9 @@ where super_id is null )  e on e.order_no=a.order_no
   		count(*)
   	from t_order_new a  left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
   	left join department dep on a.order_dep=dep.id
+  	<if test="specially == 1">
+  	left join admin ad on a.salesman_id=ad.id
+  	</if>
   	<if test="specially == 2">
 	left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
   	left join admin f on e.initiate=f.id
@@ -1317,7 +1323,7 @@ where super_id is null ) e on e.order_no=a.order_no
   	</if>
   	<if test="specially == 1">
   	and a.process_status =1  and a.order_status=1
-  	and a.order_dep in
+  	and ad.department_id in
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
 	 #{deps.id}
   	</foreach>
@@ -1369,19 +1375,18 @@ where super_id is null ) e on e.order_no=a.order_no
   	</if>
   </select>
   
-  <select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
+  <select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.outOrderDunListBo">
     	select a.id, b.contract_no contractNo,a.order_no as orderNo,c.nickname as userName,d.name as salesmanName,b.project_status projectStatus,
 	b.total_amount as totalAmount,b.liquidation_status as liquidationStatus,b.settlement_amount as settlementAmount,a.money as accountsReceivable,
-	if((a.money-b.settlement_amount) &lt; 1,0,(a.money-b.settlement_amount)) as uncollectedAmount,b.order_status as orderStatus,b.project_status as projectStatus,
+	if((b.total_amount-b.settlement_amount) &lt; 1,0,(b.total_amount-b.settlement_amount)) as uncollectedAmount,b.order_status as orderStatus,
 	date_format(a.start_time, '%Y-%m-%d') as startDate,dep.name as depName,date_format(b.sign_time,'%Y-%m-%d') as signDate,
 	<if test="newStatus == 0 ">
 	a.dun_subject as dunSubject,a.dun_status dunStatus
 	from t_order_dun a  
 	</if>
 	<if test="newStatus == 1 ">
-	a.project_type projectType,a.status dunStatus,
-	a.dun_type dunType 
-	from new_order_dun a 
+	a.project_type projectType,a.status dunStatus, a.dun_type dunType,a.appropriation_ratio appropriationRatio,e.set_up_amount setUpAmount
+	from new_order_dun a left join t_order_task e on a.tid=e.id 
 	</if>
 	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 dep on d.department_id=dep.id 
@@ -1417,23 +1422,23 @@ where super_id is null ) e on e.order_no=a.order_no
 	from t_order_dun a  
 	</if>
 	<if test="newStatus == 1 ">
-	from new_order_dun a 
+	from new_order_dun a left join t_order_task e on a.tid=e.id 
 	</if>
 	 left join t_order_new b on a.order_no=b.order_no
     left join `user` c on b.buyer_id=c.id 
-    where a.start_time is not null and b.delete_sign != 1
+    where b.delete_sign != 1
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
   	<if test="adminName != null">
   	and d.name  like CONCAT('%',#{adminName,jdbcType=VARCHAR},'%')
   	</if>
+  	<if test="orderNo != null">
+  	and a.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%') 
+  	</if>
   	<if test="depId != null">
   	and dep.id= #{depId,jdbcType=VARCHAR}
   	</if>
-  	<if test="orderNo != null">
-  	and a.order_no = #{orderNo,jdbcType=VARCHAR}
-  	</if>
   	<if test="aid != null">
   	and b.salesman_id= #{aid,jdbcType=VARCHAR}
   	</if>

+ 36 - 12
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -906,7 +906,7 @@
     select a.id,e.contract_no contractNo,a.order_no as orderNo,h.nickname userName,f.name salesmanName,a.outsource_name outsourceName,
   a.outsource_price outsourcePrice,g.name depName,e.order_status orderStatus,d.name as contacts,d.contact_mobile as contactsMobile,a.main, c.cname,
   c.sort cSort,a.commodity_name as commodityName,a.commodity_quantity as commodityQuantity,i.price,a.certificate_number as certificateNumber,
-  a.commodity_id as commodityId,a.manager_id managerId,a.consultant_id consultantId,a.project_status as projectStatus,
+  a.commodity_id as commodityId,a.manager_id managerId,a.consultant_id consultantId,a.project_status as projectStatus,a.set_up_amount setUpAmount,
   a.task_comment as taskComment ,a.commodity_price as commodityPrice, a.task_status as taskStatus,  a.task_receiver as taskReceiver 
   	 from t_order_task a left join business_project b on a.commodity_id=b.id left join t_order_new e on a.order_no=e.order_no
   	 left join admin f on e.salesman_id=f.id left join department g on e.order_dep=g.id left join user h on e.buyer_id=h.id
@@ -984,7 +984,7 @@
   	and e.project_status = #{projectStatus,jdbcType=INTEGER}
   	</if>
   	<if test="depId != null">
-  	and e.order_dep= #{depId,jdbcType=VARCHAR}
+  	and e.order_dep = #{depId,jdbcType=VARCHAR}
   	</if>
     <if test="name != null">
   	and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
@@ -1029,20 +1029,32 @@ from t_order_task a left join business_project b on a.commodity_id=b.id
   </select>
   
    <select id="selectTaskHoursListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
-  	select  a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,dep.name as depName,a.project_status projectStatus,
-    a.task_status as taskStatus,f.nickname as userName,ifnull(g.hours,0) as hours,a.commodity_quantity as commodityQuantity,
+  select  a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,dep.name as depName,a.project_status projectStatus,
+    a.task_status as taskStatus,f.nickname as userName,ifnull(g.hours,0) as hours,a.commodity_quantity as commodityQuantity,a.commodity_price commodityPrice,
     e.contract_no as contractNo,date_format(e.create_time,'%Y-%m-%d %H:%i:%S')as creteTime,date_format(e.sign_time,'%Y-%m-%d')as signTime,
-    date_format(a.task_distribution_time,'%Y-%m-%d %H:%i:%S')taskDistributionTime, date_format(a.task_end_time,'%Y-%m-%d')taskEndTime
+    date_format(a.task_distribution_time,'%Y-%m-%d %H:%i:%S')taskDistributionTime, date_format(a.task_end_time,'%Y-%m-%d')taskEndTime,tm.salesman_name salesmanName
   	from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
     left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no left join department dep on e.order_dep=dep.id  
     left join user f on e.buyer_id=f.id left join (select task_id,sum(hours) as hours from t_task_hours group by task_id) g on a.id=g.task_id
-    where e.delete_sign !=1 and a.super_id is null
-    <if test="fid != null">
-  	and dep.finance_id= #{fid,jdbcType=VARCHAR}
+    left join t_order_mid tm on a.order_no=tm.order_no where e.delete_sign !=1 and a.super_id is null
+  	<if test="shiroType == 1 and aid !=null">
+  	  	and tm.finance_id= #{aid,jdbcType=VARCHAR}
+  	</if>
+  	<if test="shiroType == 2 and aid !=null">
+  	  	and tm.finance_id in (select id from admin where superior_id= #{aid,jdbcType=VARCHAR})
   	</if>
     <if test="name != null">
   	and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
+  	<if test="cid != null">
+  	and b.cid = #{cid,jdbcType=VARCHAR}
+  	</if>
+  	<if test="depId != null">
+  	and e.order_dep = #{depId,jdbcType=VARCHAR}
+  	</if>
+  	<if test="contractNo != null">
+  	and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
+  	</if>
   	<if test="orderNo != null">
   	and e.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
   	</if>
@@ -1052,7 +1064,7 @@ from t_order_task a left join business_project b on a.commodity_id=b.id
   	<if test="starTime !=null and endTime !=null">
   	and  e.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
   	</if>
-  	order by  a.task_start_time desc
+  	order by  a.task_start_time desc,e.create_time desc
   	<if test="page_sql!=null">
 			${page_sql}
 	</if>
@@ -1062,13 +1074,25 @@ from t_order_task a left join business_project b on a.commodity_id=b.id
   	select  count(*) from t_order_task a left join business_project b on a.commodity_id=b.id
   	left join business_category c on b.cid=c.id left join admin d on a.task_receiver=d.id
     left join t_order_new e on a.order_no=e.order_no left join user f on e.buyer_id=f.id
-    where e.delete_sign !=1 and a.super_id is null
-    <if test="fid != null">
-  	and e.finance_id= #{fid,jdbcType=VARCHAR}
+    left join t_order_mid tm on a.order_no=tm.order_no where e.delete_sign !=1 and a.super_id is null
+  <if test="shiroType == 1 and aid !=null">
+  	  	and tm.finance_id= #{aid,jdbcType=VARCHAR}
+  	</if>
+  	<if test="shiroType == 2 and aid !=null">
+  	  	and tm.finance_id in (select id from admin where superior_id= #{aid,jdbcType=VARCHAR})
   	</if>
     <if test="name != null">
   	and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
+  	<if test="cid != null">
+  	and b.cid = #{cid,jdbcType=VARCHAR}
+  	</if>
+  	<if test="depId != null">
+  	and e.order_dep = #{depId,jdbcType=VARCHAR}
+  	</if>
+  	<if test="contractNo != null">
+  	and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
+  	</if>
   	<if test="orderNo != null">
   	and e.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
   	</if>

+ 0 - 26
src/main/java/com/goafanti/common/mapper/TTaskHoursMapper.xml

@@ -320,32 +320,6 @@
     left join t_order_task b on a.task_id=b.id
     where b.super_id=#{id,jdbcType=VARCHAR}
   </select>
-  <select id="getTaskHoursData" resultType="com.goafanti.order.bo.TOrderTaskListBo">
-  select  a.id,e.contract_no contractNo,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,dep.name as depName,
-    a.task_status as taskStatus,f.nickname as userName,ifnull(g.hours,0) as hours,a.commodity_quantity as commodityQuantity,a.project_status projectStatus,
-    e.contract_no as contractNo,date_format(e.create_time,'%Y-%m-%d %H:%I:%S')as creteTime,date_format(e.sign_time,'%Y-%m-%d')as signTime,
-    date_format(a.task_distribution_time,'%Y-%m-%d %H:%I:%S')taskDistributionTime, date_format(a.task_end_time,'%Y-%m-%d %H:%I:%S')taskEndTime
-  	from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
-    left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no left join department dep on e.order_dep=dep.id  
-    left join user f on e.buyer_id=f.id left join (select tid,aid,sum(hours) as hours from task_hours_count group by tid,aid) g on a.id=g.tid
-    where e.delete_sign !=1 and a.super_id is null
-    <if test="orderNo != null and orderNo !=''">
-  	and e.order_no= #{orderNo,jdbcType=VARCHAR}
-  	</if>
-    <if test="fid != null">
-  	and e.finance_id= #{fid,jdbcType=VARCHAR}
-  	</if>
-    <if test="name != null and name != ''">
-  	and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
-  	</if>
-  	<if test="taskId != null and taskId != ''">
-  	and a.id= #{taskId,jdbcType=VARCHAR}
-  	</if>
-  	<if test="startTime !=null and endTime !=null and startTime !='' and endTime !=''">
-  	and e.sign_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
-  	</if>
-  	order by  a.task_start_time desc
-  </select>
   <select id="taskHoursDetailsList" resultType="com.goafanti.common.model.TTaskHours">
   select id,task_id taskId,hours,aid, date_format(create_time,'%Y-%m-%d %H:%i:%S') createTimes,remarks,
   date_format(task_day,'%Y-%m-%d %H:%i:%S') taskDays from t_task_hours where aid= #{aid} and task_id =#{taskId}

+ 59 - 36
src/main/java/com/goafanti/common/model/NewOrderDun.java

@@ -7,69 +7,74 @@ public class NewOrderDun {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.id
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	private Integer id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.order_no
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	private String orderNo;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.tid
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	private Integer tid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.project_type
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	private Integer projectType;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.dun_type
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	private Integer dunType;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.wait_day
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	private Integer waitDay;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.effective_count
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	private Integer effectiveCount;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.aid
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	private String aid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.status
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	private Integer status;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.create_time
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	private Date createTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.start_time
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	private Date startTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.money
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	private BigDecimal money;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column new_order_dun.appropriation_ratio
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
+	 */
+	private BigDecimal appropriationRatio;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.id
 	 * @return  the value of new_order_dun.id
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public Integer getId() {
 		return id;
@@ -78,7 +83,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.id
 	 * @param id  the value for new_order_dun.id
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setId(Integer id) {
 		this.id = id;
@@ -87,7 +92,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.order_no
 	 * @return  the value of new_order_dun.order_no
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public String getOrderNo() {
 		return orderNo;
@@ -96,7 +101,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.order_no
 	 * @param orderNo  the value for new_order_dun.order_no
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setOrderNo(String orderNo) {
 		this.orderNo = orderNo;
@@ -105,7 +110,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.tid
 	 * @return  the value of new_order_dun.tid
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public Integer getTid() {
 		return tid;
@@ -114,7 +119,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.tid
 	 * @param tid  the value for new_order_dun.tid
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setTid(Integer tid) {
 		this.tid = tid;
@@ -123,7 +128,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.project_type
 	 * @return  the value of new_order_dun.project_type
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public Integer getProjectType() {
 		return projectType;
@@ -132,7 +137,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.project_type
 	 * @param projectType  the value for new_order_dun.project_type
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setProjectType(Integer projectType) {
 		this.projectType = projectType;
@@ -141,7 +146,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.dun_type
 	 * @return  the value of new_order_dun.dun_type
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public Integer getDunType() {
 		return dunType;
@@ -150,7 +155,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.dun_type
 	 * @param dunType  the value for new_order_dun.dun_type
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setDunType(Integer dunType) {
 		this.dunType = dunType;
@@ -159,7 +164,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.wait_day
 	 * @return  the value of new_order_dun.wait_day
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public Integer getWaitDay() {
 		return waitDay;
@@ -168,7 +173,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.wait_day
 	 * @param waitDay  the value for new_order_dun.wait_day
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setWaitDay(Integer waitDay) {
 		this.waitDay = waitDay;
@@ -177,7 +182,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.effective_count
 	 * @return  the value of new_order_dun.effective_count
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public Integer getEffectiveCount() {
 		return effectiveCount;
@@ -186,7 +191,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.effective_count
 	 * @param effectiveCount  the value for new_order_dun.effective_count
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setEffectiveCount(Integer effectiveCount) {
 		this.effectiveCount = effectiveCount;
@@ -195,7 +200,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.aid
 	 * @return  the value of new_order_dun.aid
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public String getAid() {
 		return aid;
@@ -204,7 +209,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.aid
 	 * @param aid  the value for new_order_dun.aid
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setAid(String aid) {
 		this.aid = aid;
@@ -213,7 +218,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.status
 	 * @return  the value of new_order_dun.status
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public Integer getStatus() {
 		return status;
@@ -222,7 +227,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.status
 	 * @param status  the value for new_order_dun.status
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setStatus(Integer status) {
 		this.status = status;
@@ -231,7 +236,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.create_time
 	 * @return  the value of new_order_dun.create_time
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public Date getCreateTime() {
 		return createTime;
@@ -240,7 +245,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.create_time
 	 * @param createTime  the value for new_order_dun.create_time
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
@@ -249,7 +254,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.start_time
 	 * @return  the value of new_order_dun.start_time
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public Date getStartTime() {
 		return startTime;
@@ -258,7 +263,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.start_time
 	 * @param startTime  the value for new_order_dun.start_time
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setStartTime(Date startTime) {
 		this.startTime = startTime;
@@ -267,7 +272,7 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.money
 	 * @return  the value of new_order_dun.money
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public BigDecimal getMoney() {
 		return money;
@@ -276,9 +281,27 @@ public class NewOrderDun {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.money
 	 * @param money  the value for new_order_dun.money
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setMoney(BigDecimal money) {
 		this.money = money;
 	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column new_order_dun.appropriation_ratio
+	 * @return  the value of new_order_dun.appropriation_ratio
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
+	 */
+	public BigDecimal getAppropriationRatio() {
+		return appropriationRatio;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column new_order_dun.appropriation_ratio
+	 * @param appropriationRatio  the value for new_order_dun.appropriation_ratio
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
+	 */
+	public void setAppropriationRatio(BigDecimal appropriationRatio) {
+		this.appropriationRatio = appropriationRatio;
+	}
 }

+ 76 - 16
src/main/java/com/goafanti/common/model/NewOrderDunExample.java

@@ -8,23 +8,23 @@ import java.math.BigDecimal;
 public class NewOrderDunExample {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	protected String orderByClause;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	protected boolean distinct;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	protected List<Criteria> oredCriteria;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public NewOrderDunExample() {
 		oredCriteria = new ArrayList<Criteria>();
@@ -32,7 +32,7 @@ public class NewOrderDunExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setOrderByClause(String orderByClause) {
 		this.orderByClause = orderByClause;
@@ -40,7 +40,7 @@ public class NewOrderDunExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public String getOrderByClause() {
 		return orderByClause;
@@ -48,7 +48,7 @@ public class NewOrderDunExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void setDistinct(boolean distinct) {
 		this.distinct = distinct;
@@ -56,7 +56,7 @@ public class NewOrderDunExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public boolean isDistinct() {
 		return distinct;
@@ -64,7 +64,7 @@ public class NewOrderDunExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public List<Criteria> getOredCriteria() {
 		return oredCriteria;
@@ -72,7 +72,7 @@ public class NewOrderDunExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void or(Criteria criteria) {
 		oredCriteria.add(criteria);
@@ -80,7 +80,7 @@ public class NewOrderDunExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public Criteria or() {
 		Criteria criteria = createCriteriaInternal();
@@ -90,7 +90,7 @@ public class NewOrderDunExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public Criteria createCriteria() {
 		Criteria criteria = createCriteriaInternal();
@@ -102,7 +102,7 @@ public class NewOrderDunExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	protected Criteria createCriteriaInternal() {
 		Criteria criteria = new Criteria();
@@ -111,7 +111,7 @@ public class NewOrderDunExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public void clear() {
 		oredCriteria.clear();
@@ -121,7 +121,7 @@ public class NewOrderDunExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	protected abstract static class GeneratedCriteria {
 		protected List<Criterion> criteria;
@@ -903,11 +903,71 @@ public class NewOrderDunExample {
 			addCriterion("money not between", value1, value2, "money");
 			return (Criteria) this;
 		}
+
+		public Criteria andAppropriationRatioIsNull() {
+			addCriterion("appropriation_ratio is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andAppropriationRatioIsNotNull() {
+			addCriterion("appropriation_ratio is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andAppropriationRatioEqualTo(BigDecimal value) {
+			addCriterion("appropriation_ratio =", value, "appropriationRatio");
+			return (Criteria) this;
+		}
+
+		public Criteria andAppropriationRatioNotEqualTo(BigDecimal value) {
+			addCriterion("appropriation_ratio <>", value, "appropriationRatio");
+			return (Criteria) this;
+		}
+
+		public Criteria andAppropriationRatioGreaterThan(BigDecimal value) {
+			addCriterion("appropriation_ratio >", value, "appropriationRatio");
+			return (Criteria) this;
+		}
+
+		public Criteria andAppropriationRatioGreaterThanOrEqualTo(BigDecimal value) {
+			addCriterion("appropriation_ratio >=", value, "appropriationRatio");
+			return (Criteria) this;
+		}
+
+		public Criteria andAppropriationRatioLessThan(BigDecimal value) {
+			addCriterion("appropriation_ratio <", value, "appropriationRatio");
+			return (Criteria) this;
+		}
+
+		public Criteria andAppropriationRatioLessThanOrEqualTo(BigDecimal value) {
+			addCriterion("appropriation_ratio <=", value, "appropriationRatio");
+			return (Criteria) this;
+		}
+
+		public Criteria andAppropriationRatioIn(List<BigDecimal> values) {
+			addCriterion("appropriation_ratio in", values, "appropriationRatio");
+			return (Criteria) this;
+		}
+
+		public Criteria andAppropriationRatioNotIn(List<BigDecimal> values) {
+			addCriterion("appropriation_ratio not in", values, "appropriationRatio");
+			return (Criteria) this;
+		}
+
+		public Criteria andAppropriationRatioBetween(BigDecimal value1, BigDecimal value2) {
+			addCriterion("appropriation_ratio between", value1, value2, "appropriationRatio");
+			return (Criteria) this;
+		}
+
+		public Criteria andAppropriationRatioNotBetween(BigDecimal value1, BigDecimal value2) {
+			addCriterion("appropriation_ratio not between", value1, value2, "appropriationRatio");
+			return (Criteria) this;
+		}
 	}
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri Dec 06 08:46:15 CST 2019
+	 * @mbg.generated  Thu Dec 19 11:46:22 CST 2019
 	 */
 	public static class Criterion {
 		private String condition;

+ 18 - 0
src/main/java/com/goafanti/order/bo/TOrderNewBo.java

@@ -29,6 +29,7 @@ public class TOrderNewBo extends TOrderNew{
 	private String uid;
 	private String email;
 	private String depName;
+	//应收款
 	private BigDecimal accountsReceivable;
 	private BigDecimal uncollectedAmount;
 	private Integer locationProvince;
@@ -43,6 +44,8 @@ public class TOrderNewBo extends TOrderNew{
 	private Integer projectType;
 	private Integer dunType;
 	private Integer dunStatus;
+	private BigDecimal appropriationRatio;
+	private BigDecimal setUpAmount;
 	
 	public String getDunSubject() {
 		if(dunSubject!=null)return OrderDunSubject.getValueByCode(Integer.valueOf(dunSubject));
@@ -244,6 +247,9 @@ public class TOrderNewBo extends TOrderNew{
 	}
 
 	public BigDecimal getAccountsReceivable() {
+		if(getDunSubject()!=null&&getDunSubject().equals("33")&&accountsReceivable==null&&appropriationRatio !=null &&setUpAmount!=null) {
+			return setUpAmount.multiply(accountsReceivable);
+		}
 		return accountsReceivable;
 	}
 
@@ -317,5 +323,17 @@ public class TOrderNewBo extends TOrderNew{
 	public void setInvoiceAmount(BigDecimal invoiceAmount) {
 		this.invoiceAmount = invoiceAmount;
 	}
+	public BigDecimal getAppropriationRatio() {
+		return appropriationRatio;
+	}
+	public void setAppropriationRatio(BigDecimal appropriationRatio) {
+		this.appropriationRatio = appropriationRatio;
+	}
+	public BigDecimal getSetUpAmount() {
+		return setUpAmount;
+	}
+	public void setSetUpAmount(BigDecimal setUpAmount) {
+		this.setUpAmount = setUpAmount;
+	}
 	
 }

+ 16 - 0
src/main/java/com/goafanti/order/bo/TOrderTaskListBo.java

@@ -1,5 +1,7 @@
 package com.goafanti.order.bo;
 
+import java.math.BigDecimal;
+
 public class TOrderTaskListBo {
 	private String id;
 	private String taskName;
@@ -11,12 +13,14 @@ public class TOrderTaskListBo {
 	private Integer taskStatus;
 	private String taskDate;
 	private Integer commodityQuantity;
+	private BigDecimal commodityPrice;
 	private Double hours;
 	private String depName;
 	private String contractNo;
 	private String creteTime;
 	private String signTime;
 	private Integer alreadyNumber;
+	private String salesmanName;
 	private String taskDistributionTime;
 	private String taskEndTime;
 	/** 外包部门 */
@@ -135,5 +139,17 @@ public class TOrderTaskListBo {
 	public void setTaskEndTime(String taskEndTime) {
 		this.taskEndTime = taskEndTime;
 	}
+	public BigDecimal getCommodityPrice() {
+		return commodityPrice;
+	}
+	public void setCommodityPrice(BigDecimal commodityPrice) {
+		this.commodityPrice = commodityPrice;
+	}
+	public String getSalesmanName() {
+		return salesmanName;
+	}
+	public void setSalesmanName(String salesmanName) {
+		this.salesmanName = salesmanName;
+	}
 	
 }

+ 62 - 0
src/main/java/com/goafanti/order/bo/inuptTaskHoursListBo.java

@@ -0,0 +1,62 @@
+package com.goafanti.order.bo;
+
+
+public class inuptTaskHoursListBo {
+	private String name;
+	private String orderNo;
+	private String taskId;
+	private String starTime;
+	private String endTime; 
+	private String cid;
+	private String depId;
+	private String contractNo;
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getOrderNo() {
+		return orderNo;
+	}
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+	public String getTaskId() {
+		return taskId;
+	}
+	public void setTaskId(String taskId) {
+		this.taskId = taskId;
+	}
+	public String getStarTime() {
+		return starTime;
+	}
+	public void setStarTime(String starTime) {
+		this.starTime = starTime;
+	}
+	public String getEndTime() {
+		return endTime;
+	}
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
+	public String getCid() {
+		return cid;
+	}
+	public void setCid(String cid) {
+		this.cid = cid;
+	}
+	public String getDepId() {
+		return depId;
+	}
+	public void setDepId(String depId) {
+		this.depId = depId;
+	}
+	public String getContractNo() {
+		return contractNo;
+	}
+	public void setContractNo(String contractNo) {
+		this.contractNo = contractNo;
+	}
+	
+}

+ 160 - 0
src/main/java/com/goafanti/order/bo/outOrderDunListBo.java

@@ -0,0 +1,160 @@
+package com.goafanti.order.bo;
+
+import java.math.BigDecimal;
+
+import com.goafanti.order.enums.NewOrderDunType;
+import com.goafanti.order.enums.OrderDunSubject;
+
+public class outOrderDunListBo {
+	private String id;
+	private String contractNo;
+	private String orderNo;
+	private String userName;
+	private String salesmanName;
+	private Integer projectStatus;
+	private BigDecimal totalAmount;
+	private Integer liquidationStatus;
+	private BigDecimal settlementAmount;
+	private BigDecimal accountsReceivable;
+	private BigDecimal uncollectedAmount;
+	private String startDate;
+	private String depName;
+	private String signDate;
+	private Integer orderStatus;
+	private Integer projectType;
+	private Integer dunStatus;
+	private Integer dunType;
+	private String dunSubject;
+	private BigDecimal appropriationRatio;
+	private BigDecimal setUpAmount;
+	public String getId() {
+		return id;
+	}
+	public String getDunSubject() {
+		if(dunSubject!=null)return OrderDunSubject.getValueByCode(Integer.valueOf(dunSubject));
+		if(getDunType()!=null&&getProjectType()!=null)return NewOrderDunType.getValueByCode(Integer.valueOf(""+getProjectType()+getDunType()));
+		return dunSubject;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getContractNo() {
+		return contractNo;
+	}
+	public void setContractNo(String contractNo) {
+		this.contractNo = contractNo;
+	}
+	public String getOrderNo() {
+		return orderNo;
+	}
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+	public String getUserName() {
+		return userName;
+	}
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+	public String getSalesmanName() {
+		return salesmanName;
+	}
+	public void setSalesmanName(String salesmanName) {
+		this.salesmanName = salesmanName;
+	}
+	public Integer getProjectStatus() {
+		return projectStatus;
+	}
+	public void setProjectStatus(Integer projectStatus) {
+		this.projectStatus = projectStatus;
+	}
+	public BigDecimal getTotalAmount() {
+		return totalAmount;
+	}
+	public void setTotalAmount(BigDecimal totalAmount) {
+		this.totalAmount = totalAmount;
+	}
+	public Integer getLiquidationStatus() {
+		return liquidationStatus;
+	}
+	public void setLiquidationStatus(Integer liquidationStatus) {
+		this.liquidationStatus = liquidationStatus;
+	}
+	public BigDecimal getSettlementAmount() {
+		return settlementAmount;
+	}
+	public void setSettlementAmount(BigDecimal settlementAmount) {
+		this.settlementAmount = settlementAmount;
+	}
+	public BigDecimal getAccountsReceivable() {
+		if(getDunSubject()!=null&&getDunSubject().equals("33")&&accountsReceivable==null&&appropriationRatio !=null &&setUpAmount!=null) {
+			return setUpAmount.multiply(accountsReceivable);
+		}
+		return accountsReceivable;
+	}
+	public void setAccountsReceivable(BigDecimal accountsReceivable) {
+		this.accountsReceivable = accountsReceivable;
+	}
+	public String getStartDate() {
+		return startDate;
+	}
+	public void setStartDate(String startDate) {
+		this.startDate = startDate;
+	}
+	public String getDepName() {
+		return depName;
+	}
+	public void setDepName(String depName) {
+		this.depName = depName;
+	}
+	public String getSignDate() {
+		return signDate;
+	}
+	public void setSignDate(String signDate) {
+		this.signDate = signDate;
+	}
+	public Integer getProjectType() {
+		return projectType;
+	}
+	public void setProjectType(Integer projectType) {
+		this.projectType = projectType;
+	}
+	public Integer getDunStatus() {
+		return dunStatus;
+	}
+	public void setDunStatus(Integer dunStatus) {
+		this.dunStatus = dunStatus;
+	}
+	public Integer getDunType() {
+		return dunType;
+	}
+	public void setDunType(Integer dunType) {
+		this.dunType = dunType;
+	}
+	public BigDecimal getAppropriationRatio() {
+		return appropriationRatio;
+	}
+	public void setAppropriationRatio(BigDecimal appropriationRatio) {
+		this.appropriationRatio = appropriationRatio;
+	}
+	public BigDecimal getSetUpAmount() {
+		return setUpAmount;
+	}
+	public void setSetUpAmount(BigDecimal setUpAmount) {
+		this.setUpAmount = setUpAmount;
+	}
+	public BigDecimal getUncollectedAmount() {
+		return uncollectedAmount;
+	}
+	public void setUncollectedAmount(BigDecimal uncollectedAmount) {
+		this.uncollectedAmount = uncollectedAmount;
+	}
+	public Integer getOrderStatus() {
+		return orderStatus;
+	}
+	public void setOrderStatus(Integer orderStatus) {
+		this.orderStatus = orderStatus;
+	}
+	
+
+}

+ 6 - 38
src/main/java/com/goafanti/order/controller/OrderProjectApiController.java

@@ -2,15 +2,12 @@ package com.goafanti.order.controller;
 
 
 import java.io.IOException;
-import java.io.OutputStream;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Date;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -21,9 +18,9 @@ import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.model.TTaskHours;
 import com.goafanti.common.utils.StringUtils;
-import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.TOrderTaskDetailBo;
 import com.goafanti.order.bo.TaskProgressBo;
+import com.goafanti.order.bo.inuptTaskHoursListBo;
 import com.goafanti.order.service.OrderProjectService;
 
 @RestController
@@ -123,11 +120,10 @@ public class OrderProjectApiController extends CertifyApiController {
 	 * 任务工时列表
 	 */
 	@RequestMapping(value="/taskHoursList" ,method = RequestMethod.GET)
-	public Result taskHoursList(String name,String orderNo, String taskId ,String starTime,String endTime ,Integer type,
+	public Result taskHoursList(inuptTaskHoursListBo ib,
 			Integer pageNo, Integer pageSize){
 		Result res=new Result();
-		//type 0所有 1个人
-		res.setData(orderProjectService.taskHoursList(name,orderNo,taskId,  starTime, endTime ,type,pageNo, pageSize));
+		res.setData(orderProjectService.taskHoursList(ib,pageNo, pageSize));
 		return res;
 	}
 	/**
@@ -198,45 +194,17 @@ public class OrderProjectApiController extends CertifyApiController {
 		res.setData(orderProjectService.selectTaskProgress(tid));
 		return res;
 	}
-	/**
-	 * 任务工时表
-	 * @throws IOException 
-	 */
-	@RequestMapping(value = "/exportTaskHoursListData", method = RequestMethod.GET)
-	public Result exportTaskHoursListData(String name, String taskId ,String orderNo,String starTime,String endTime ,Integer type,HttpServletResponse response) throws IOException{
-		 Result res = new Result();
-		 XSSFWorkbook wb = orderProjectService.exportTaskHoursListData( name, taskId,orderNo, starTime, endTime,type);
-		 if(null == wb){
-			 res.getError().add(buildError("", "没有找到数据"));
-			 return res;
-		 }
-		 String fileName = "任务工时表  " + new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xls";
-		 OutputStream out = response.getOutputStream();
-		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-         response.setContentType("application/octet-stream;charset=utf-8");  
-		try {
-			// 返回数据流
-			wb.write(out);
-			out.flush();
-			out.close();
-		} finally {
-			out.flush();
-			out.close();
-		}
-		
-		return res;
-	}
+	
 	
 	/**
 	 * 我的任务列表导出xls
 	 * @throws IOException 
 	 */
 	@RequestMapping(value = "/exportMyTaskList", method = RequestMethod.GET)
-	public Result exportMyTaskList(HttpServletResponse response,String name,String orderNo, String taskId, String starTime,String endTime ,Integer type, Integer pageNo,
-			Integer pageSize) throws IOException{
+	public Result exportMyTaskList(HttpServletResponse response,inuptTaskHoursListBo ib, Integer pageNo, Integer pageSize) throws IOException{
 		Result res=new Result();
 		try {
-			orderProjectService.exportMyTaskList( response, name, orderNo,  taskId,  starTime, endTime , type,  pageNo, pageSize);
+			orderProjectService.exportMyTaskList( response, ib,  pageNo, pageSize);
 		} catch (Exception e) {
 			res.getError().add(buildError("格式不正确"));
 			e.printStackTrace();

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

@@ -13,6 +13,7 @@ import com.goafanti.order.bo.TOrderTaskDetailBo;
 import com.goafanti.order.bo.TOrderTaskListBo;
 import com.goafanti.order.bo.TaskLogBo;
 import com.goafanti.order.bo.TaskProgressBo;
+import com.goafanti.order.bo.inuptTaskHoursListBo;
 
 public interface OrderProjectService {
 
@@ -27,7 +28,7 @@ public interface OrderProjectService {
 
 	int addTaskHours(TTaskHours t);
 	
-	Pagination<TOrderTaskListBo> taskHoursList(String name,String orderNo, String taskId,String starTime,String endTime ,Integer type,
+	Pagination<TOrderTaskListBo> taskHoursList(inuptTaskHoursListBo ib,
 			Integer pageNo, Integer pageSize);
 
 
@@ -43,10 +44,9 @@ public interface OrderProjectService {
 	List<TaskProgressBo> selectTaskProgress(Integer tid);
 
 
-	XSSFWorkbook exportTaskHoursListData(String name, String taskId,String orderNo, String startTime, String endTime,  Integer type);
-
 	List<TTaskHours> taskHoursDetailsList(String taskId);
 
-	void exportMyTaskList(HttpServletResponse response, String name, String orderNo, String taskId, String starTime, String endTime, Integer type, Integer pageNo, Integer pageSize)throws IOException ;
+	void exportMyTaskList(HttpServletResponse response,inuptTaskHoursListBo ib, Integer pageNo, Integer pageSize)throws IOException ;
+
 	
 }

+ 2 - 0
src/main/java/com/goafanti/order/service/impl/NewOrderDunServiceImpl.java

@@ -26,6 +26,7 @@ public class NewOrderDunServiceImpl extends BaseMybatisDao<NewOrderDunMapper> im
 	@Override
 	public int createDun(InputNewOrderDunBo ib) {
 		ib.setAid(TokenManager.getAdminId());
+		if (ib.getAppropriationRatio()!=null)ib.setMoney(null);
 		if (ib.getProjectType()==OrderDunProjectType.HY.getCode()&&ib.getDunType()==2&&ib.getEffectiveCount()>1) {
 			for (int i = 1; i <= ib.getEffectiveCount(); i++) {
 				int x=ib.getEffectiveCount();
@@ -40,6 +41,7 @@ public class NewOrderDunServiceImpl extends BaseMybatisDao<NewOrderDunMapper> im
 	
 	@Override
 	public int updateDun(InputNewOrderDunBo ib) {
+		if (ib.getAppropriationRatio()!=null)ib.setMoney(null);
 		return newOrderDunMapper.updateByPrimaryKeySelective(ib);
 	}
 	@Override

+ 32 - 26
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -67,6 +67,7 @@ import com.goafanti.order.bo.TOrderTaskDetailBo;
 import com.goafanti.order.bo.TOrderTaskListBo;
 import com.goafanti.order.bo.TaskLogBo;
 import com.goafanti.order.bo.TaskProgressBo;
+import com.goafanti.order.bo.inuptTaskHoursListBo;
 import com.goafanti.order.enums.BonusSubject;
 import com.goafanti.order.enums.OrderDunProjectType;
 import com.goafanti.order.enums.OrderProjectStatus;
@@ -455,35 +456,32 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<TOrderTaskListBo> taskHoursList(String name,String orderNo, String taskId, String starTime,String endTime ,Integer type, Integer pageNo,
+	public Pagination<TOrderTaskListBo> taskHoursList(inuptTaskHoursListBo ib, 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 (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
-		if (StringUtils.isNotBlank(taskId)) params.put("taskId", taskId);
-		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
-		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
-		if(type!=null&&type==1)params.put("fid", TokenManager.getAdminId());
+		if (StringUtils.isNotBlank(ib.getName())) params.put("name", ib.getName());
+		if (StringUtils.isNotBlank(ib.getOrderNo())) params.put("orderNo", ib.getOrderNo());
+		if (StringUtils.isNotBlank(ib.getTaskId())) params.put("taskId", ib.getTaskId());
+		if (StringUtils.isNotBlank(ib.getStarTime())) params.put("starTime", ib.getStarTime());
+		if (StringUtils.isNotBlank(ib.getEndTime())) params.put("endTime", ib.getEndTime()+" 23:59:59");
+		if(StringUtils.isNotBlank(ib.getContractNo()))params.put("contractNo", ib.getContractNo());
+		if(StringUtils.isNotBlank(ib.getDepId()))params.put("depId", ib.getDepId());
+		if(StringUtils.isNotBlank(ib.getCid()))params.put("cid", ib.getCid());
+		Integer i=null;
+		if (TokenManager.hasRole(AFTConstants.FINANCE))i=1;
+		if (TokenManager.hasRole(AFTConstants.FINANCE_MANAGER))i=2;
+		if (TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)||TokenManager.hasRole(AFTConstants.VICE_CEO))i=3;
+		if(TokenManager.getAdminId()!=null)params.put("aid", TokenManager.getAdminId());
+		if(i!=null)params.put("shiroType", i);
 		Pagination<TOrderTaskListBo> p = (Pagination<TOrderTaskListBo>)findPage("selectTaskHoursListByPage", "selectTaskHoursListCount", params, pageNo, pageSize);
 		
 		return p;
 	}
 
 	
-	@Override
-	public XSSFWorkbook exportTaskHoursListData(String name, String taskId, String orderNo,String startTime, String endTime,Integer type) {
-		if(StringUtils.isNoneBlank(endTime)) endTime=endTime+" 23:59:59";
-		String fid=null;
-		if(type!=null&&type==1)fid=TokenManager.getAdminId();
-		List<TOrderTaskListBo> list=tTaskHoursMapper.getTaskHoursData(name,taskId,orderNo,startTime,endTime,fid);
-		if (list==null || list.size()==0) return null;
-		String[] comment = {"任务编号","任务名称","订单编号","业务别类","订单部门","客户名称","任务负责人","任务状态","项目状态","工时","合同编号","签单日期","派单日期"};
-		String filePath = uploadPath + "/TaskHours";
-		XSSFWorkbook wb = ExportExcelUtil.exportTaskHoursListData(list, comment, filePath);
-		return wb;
-	}
+	
 	
 
 
@@ -546,13 +544,13 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		return tTaskHoursMapper.taskHoursDetailsList(taskId,aid);
 	}
 	@Override
-	public void exportMyTaskList(HttpServletResponse response,String name,String orderNo, String taskId, String starTime,String endTime ,Integer type, Integer pageNo,
-			Integer pageSize) throws IOException {
+	public void exportMyTaskList(HttpServletResponse response,inuptTaskHoursListBo ib, Integer pageNo, Integer pageSize) throws IOException {
 		OutputStream out = response.getOutputStream();
 		try {
 			@SuppressWarnings("unchecked")
-			List<TOrderTaskListBo> list=(List<TOrderTaskListBo>) taskHoursList( name, orderNo,  taskId,  starTime, endTime , type,  pageNo, pageSize).getList();
-    		String[] comment = {"合同编号","订单编号","客户名称","项目负责人","项目别类","项目名称","项目状态","工时","分配时间","完成时间"};
+			List<TOrderTaskListBo> list=(List<TOrderTaskListBo>) taskHoursList(ib,  pageNo, pageSize).getList();
+			//合同编号  订单编号  客户名称    订单部门  订单负责人      项目类别   项目编号   项目名称     项目负责人  项目价格(万元)    数量(个)       任务状态   项目状态    工时   签单时间    派单时间   分配时间   完成时间
+    		String[] comment = {"合同编号","订单编号","客户名称","订单部门","订单负责人","项目类别","项目编号","项目名称","项目负责人","项目价格(万元)","数量(个)","任务状态","项目状态","工时","签单日期","派单日期","分配时间","完成时间"};
     		String fileName ="工时信息记录表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
     		//type 0 变更
     		XSSFWorkbook wb =ExportExcelUtil.exportTemplateInfoS(comment,"工时信息");
@@ -565,18 +563,26 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
     				//当前列的只
     				String o = "";
     				switch (comment[i]) {
-//    String[] comment = {"合同编号 ","订单编号","客户名称","项目负责人 ","项目别类","项目名称","项目状态","工时","分配时间","完成时间"};
+//    "合同编号","订单编号","客户名称","订单部门","订单负责人 ","项目类别","项目编号","项目名称","项目负责人","项目价格(万元)",
+//    				" 数量(个)","任务状态","项目状态","工时","签单日期","派单日期","分配时间","完成时间"
     				case "合同编号": o = ob.getContractNo(); break;
     				case "订单编号": o = ob.getOrderNo().toString(); break;
     				case "客户名称": o = ob.getUserName(); break;
     				case "订单部门": o = ob.getDepName(); break;
-    				case "项目负责人": o = ob.getReceiverName(); break;
-    				case "项目别类": o = ob.getCname(); break;
+    				case "订单负责人": o = ob.getSalesmanName(); break;
+    				case "项目类别": o =ob.getCname(); break;
+    				case "项目编号": o = ob.getId(); break;
     				case "项目名称": o = ob.getTaskName(); break;
+    				case "项目负责人": o = ob.getReceiverName(); break;
+    				case "项目价格(万元)": o = ob.getCommodityPrice().toString(); break;
+    				case "数量(个)": o = ob.getCommodityQuantity().toString(); break;
+    				case "任务状态": o = TaskState.getValueByCode(ob.getTaskStatus()); break;
     				case "项目状态": o = ProjectNewStage.getValueByCode(ob.getProjectStatus()); break;
     				case "工时": o = ob.getHours().toString(); break;
     				case "分配时间": o = ob.getTaskDistributionTime(); break;
     				case "完成时间": o = ob.getTaskEndTime(); break;
+    				case "签单日期": o = ob.getSignTime(); break;
+    				case "派单日期": o = ob.getCreteTime();break;
     				default: o = ""; break;
     				}
     				XSSFCell c = r.createCell(i);