Browse Source

财务派单列表筛选项修改

anderx 11 months ago
parent
commit
1af025e422

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

@@ -1156,6 +1156,14 @@
         left join (select * from  t_order_outsource where type=0) too on o.order_no=too.order_no
         left join (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
         from t_order_approval group by order_no) toa on o.order_no=toa.order_no
+        <include refid="financeListSql"/>
+        order by o.liquidation_status, o.sign_time desc
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
+    </select>
+    <sql id="financeListSql">
+
         <if test="type !=null">
             inner join
             (select distinct order_no
@@ -1246,103 +1254,16 @@
             <bind name="d" value="o.endFinalReceivablesTime + ' 23:59:59'" />
             and a.final_Receivables_time between #{c,jdbcType=VARCHAR} and #{d,jdbcType=VARCHAR}
         </if>
-        order by o.liquidation_status, o.sign_time desc
-        <if test="page_sql != null">
-            ${page_sql}
+        <if test="o.startSignTime != null and o.startSignTime != &quot;&quot; and o.endSignTime != null and o.endSignTime != &quot;&quot;">
+            <bind name="e" value="o.startSignTime + ' 00:00:00'" />
+            <bind name="f" value="o.endSignTime + ' 23:59:59'" />
+            and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
         </if>
-    </select>
+    </sql>
     <select id="financeCount" parameterType="Map" resultType="java.lang.Integer">
         select count(*) from t_order_new o left join `user` u on o.buyer_id = u.id
         left join department d on o.order_dep = d.id   left join t_order_mid a on o.order_no=a.order_no
-        <if test="type !=null">
-            inner join
-            (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
-            from t_order_approval
-            where `type` in
-            <foreach collection="type" item="item" separator="," open="(" close=")">
-                #{item}
-            </foreach>
-            group by order_no) toa on o.order_no=toa.order_no
-        </if>
-        where delete_sign in(0,2) and o.approval in(0,1,2,4,5,7,8) and outsource=  #{o.outsource,jdbcType=INTEGER}
-        <if test="o.processStatus == 3">
-            and o.process_status = #{o.processStatus,jdbcType=INTEGER}
-        </if>
-        <if test="o.processStatus == 4" >
-            and o.process_status &gt;= #{o.processStatus,jdbcType=INTEGER}
-        </if>
-        <if test="o.processStatus == 9">
-            and o.back_status = 3
-        </if>
-        <if test="fids != null and fids.size() &gt; 0">
-            and (d.finance_id in
-            <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
-                #{item}
-            </foreach>
-            or d.retrial_finance_id in
-            <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
-                #{item}
-            </foreach>)
-        </if>
-        <if test="o.orderStatus != null and o.orderStatus != &quot;&quot;">
-            and (o.order_status >=  #{o.orderStatus,jdbcType=INTEGER} or o.back_status=3)
-        </if>
-        <if test="deps !=null">
-            and o.order_dep in
-            <foreach close=")" collection="deps" item="depId" open="(" separator=",">
-                #{depId}
-            </foreach>
-        </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.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
-        </if>
-        <if test="o.amountStatus == 0">
-            and o.total_amount &lt; 10
-        </if>
-        <if test="o.amountStatus == 1">
-            and o.total_amount between 10 and 20
-        </if>
-        <if test="o.amountStatus == 2">
-            and o.total_amount between 20 and 30
-        </if>
-        <if test="o.amountStatus == 3">
-            and o.total_amount between 30 and 40
-        </if>
-        <if test="o.amountStatus == 4">
-            and o.total_amount  &gt; 40
-        </if>
-        <if test="o.orderNo != null and o.orderNo != &quot;&quot;">
-            and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
-        </if>
-        <if test="o.projectType != null and o.projectType != &quot;&quot;">
-            and a.project_type = #{o.projectType}
-        </if>
-        <if test="o.approval != null and o.approval ==1">
-            and o.approval in (1,4,7)
-        </if>
-        <if test="o.approval != null and o.approval ==2">
-            and o.approval in (2,5,8)
-        </if>
-        <if test="o.approval != null and o.approval ==4">
-            and o.approval in (1,2,4,5,7,8)
-        </if>
-        <if test="o.buyerName != null and o.buyerName != &quot;&quot;">
-            <bind name="n" value="'%' + o.buyerName + '%'" />
-            and u.nickname  like #{n,jdbcType=VARCHAR}
-        </if>
-        <if test="o.startTime != null and o.startTime != &quot;&quot; and o.endTime != null and o.endTime != &quot;&quot;">
-            <bind name="a" value="o.startTime + ' 00:00:00'" />
-            <bind name="b" value="o.endTime + ' 23:59:59'" />
-            and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
-        </if>
-        <if test="o.startFinalReceivablesTime != null and o.startFinalReceivablesTime != &quot;&quot; and o.endFinalReceivablesTime != null and o.endFinalReceivablesTime != &quot;&quot;">
-            <bind name="c" value="o.startFinalReceivablesTime + ' 00:00:00'" />
-            <bind name="d" value="o.endFinalReceivablesTime + ' 23:59:59'" />
-            and a.final_Receivables_time between #{c,jdbcType=VARCHAR} and #{d,jdbcType=VARCHAR}
-        </if>
+        <include refid="financeListSql"/>
     </select>
     <!-- 通过订单编号获得订单的负责人(营销员) -->
     <select id="getSaleIdByOno" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">

+ 21 - 0
src/main/java/com/goafanti/order/bo/OrderListBo.java

@@ -157,6 +157,27 @@ public class OrderListBo {
 
 	private String typeExplain;
 
+	/** 开始签单 时间*/
+	private String startSignTime;
+	/** 结束签单 时间*/
+	private String endSignTime;
+
+	public String getEndSignTime() {
+		return endSignTime;
+	}
+
+	public void setEndSignTime(String endSignTime) {
+		this.endSignTime = endSignTime;
+	}
+
+	public String getStartSignTime() {
+		return startSignTime;
+	}
+
+	public void setStartSignTime(String startSignTime) {
+		this.startSignTime = startSignTime;
+	}
+
 	public String getTypeExplain() {
 		return typeExplain;
 	}

+ 0 - 1
src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java

@@ -129,7 +129,6 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 
 	}
 
-	@SuppressWarnings("unchecked")
 	@Override
 	public Map<String, Object> financeList(OrderListBo order, Integer pageNo, Integer pageSize) {
 		Map<String, Object> result = new HashMap<String, Object>();