Browse Source

变更流程列表开发

anderx 3 years ago
parent
commit
9444114999

+ 50 - 50
src/main/java/com/goafanti/common/mapper/NewOrderChangeMapper.xml

@@ -501,32 +501,32 @@ select
   a.process_state processState,a.back_status backStatus from new_order_change  noc left join  new_order_change a on noc.id=a.id
   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 b.order_dep=e.id
- 	<if test="processState==2">
+ 	<if test="processState==3">
  	left join (select order_no, aid from order_examine where`type`=0 group by order_no,aid)x on a.order_no = x.order_no
 	</if>
-	<if test="processState==3">
+	<if test="processState==4">
 	left join (select order_no, aid from order_examine where`type`=1 group by order_no,aid)x on a.order_no = x.order_no
 	</if>
 	where 1=1
 	<if test="processState==0">
 	and b.salesman_id= #{aid}
 	</if>
-	<if test="processState==2 and complete !=5">
+	<if test="processState==3 and complete !=5">
 	and  x.aid=#{aid}  and a.process_state &gt;= 2
 	</if>
-	<if test="processState==3 and complete !=5">
+	<if test="processState==4 and complete !=5">
 	and x.aid=#{aid}  and a.process_state &gt;= 3
 	</if>
-	<if test="processState==2 and complete ==5">
+	<if test="processState==3 and complete ==5">
 	and  x.aid=#{aid}  and a.back_status &gt;= #{processState}
 	</if>
-	<if test="processState==3 and complete ==5">
+	<if test="processState==4 and complete ==5">
 	and x.aid=#{aid}  and a.back_status &gt;= #{processState}
 	</if>
-	<if test="processState==5 and aid !=null">
+	<if test="processState==6 and aid !=null">
 	and e.finance_id =#{aid}
 	</if>
-	<if test="processState==5 and aids !=null">
+	<if test="processState==6 and aids !=null">
 	and e.finance_id in
 		<foreach close=")" collection="aids" item="id" open="(" separator=",">
 		#{id}
@@ -559,35 +559,35 @@ select
 	<if test="salesmanName !=null">
 	and d.name like concat('%',#{salesmanName},'%')
 	</if>
-	<if test="complete ==0 and processState != 8">
+	<if test="complete ==0 and processState != 9">
 	 and (a.process_state &gt;= #{processState} or a.back_status &gt;= #{processState})
 	</if>
-	<if test="complete ==0 and processState == 8">
-	 and (a.process_state &gt;= #{processState} and  a.process_state &lt; 9)or a.back_status &gt;= #{processState}
+	<if test="complete ==0 and processState == 9">
+	 and (a.process_state &gt;= #{processState} and  a.process_state &lt; 10)or a.back_status &gt;= #{processState}
 	</if>
-	<if test="complete ==1 and processState != 5 and processState != 7 and processState != 8">
+	<if test="complete ==1 and processState != 7 and processState != 8 and processState != 9">
 	 and a.process_state = #{processState}
 	</if>
-	<if test="complete ==1 and processState == 5">
-	 and (a.process_state in(5,9)  and a.status !=4)
+	<if test="complete ==1 and processState == 6">
+	 and (a.process_state in(6)  and a.status in (0,1,2,3,5,6))
 	</if>
-	<if test="complete ==1 and processState == 7">
-	 and (a.process_state = 7  and  a.status =1)
+	<if test="complete ==1 and processState == 9">
+	 and (a.process_state = 8  and  a.status =1)
 	</if>
-	<if test="complete ==1 and processState == 8">
+	<if test="complete ==1 and processState == 9">
 	 and (a.process_state = #{processState}  and a.status =1)
 	</if>
-	<if test="complete ==2 and processState != 5 and processState != 7 and processState != 8">
+	<if test="complete ==2 and processState != 6 and processState != 8 and processState != 9">
 	 and a.process_state &gt; #{processState}
 	</if>
-	<if test="complete ==2 and processState == 5">
-	 and (a.process_state &gt; 5 and a.process_state &lt; 9) or (a.process_state =9 and a.status=4)
-	</if>
-	<if test="complete ==2 and processState == 7">
-	 and ((a.process_state = 7  and  (a.status = 4 or a.status = 2))or a.process_state &gt; 7)
+	<if test="complete ==2 and processState == 6">
+	 and a.process_state &gt; 6 and a.process_state &lt; 10
 	</if>
 	<if test="complete ==2 and processState == 8">
-	 and a.process_state = 8  and   (a.status = 4 or a.status = 2)
+	 and ((a.process_state = 8  and  (a.status = 4 or a.status = 2))or a.process_state &gt; 8)
+	</if>
+	<if test="complete ==2 and processState == 9">
+	 and a.process_state = 9  and   (a.status = 4 or a.status = 2)
 	</if>
 	<if test="complete ==3">
 	 and   a.status = 2
@@ -595,7 +595,7 @@ select
 	<if test="complete ==4">
 	 and   a.status = 4
 	</if>
-    <if test="complete ==5 and processState != 2 and processState != 3">
+    <if test="complete ==5 and processState != 3 and processState != 4">
 	 and a.back_status &gt;= #{processState}
 	</if>
     <if test="complete ==6">
@@ -611,32 +611,32 @@ select
   select count(*) from new_order_change noc left join  new_order_change a on noc.id=a.id
   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 b.order_dep=e.id
-		<if test="processState==2">
+		<if test="processState==3">
  	left join (select order_no, aid from order_examine where`type`=0 group by order_no,aid)x on a.order_no = x.order_no
 	</if>
-	<if test="processState==3">
+	<if test="processState==4">
 	left join (select order_no, aid from order_examine where`type`=1 group by order_no,aid)x on a.order_no = x.order_no
 	</if>
 	where 1=1
 	<if test="processState==0">
 	and b.salesman_id= #{aid}
 	</if>
-	<if test="processState==2 and complete !=5">
+	<if test="processState==3 and complete !=5">
 	and  x.aid=#{aid}  and a.process_state &gt;= 2
 	</if>
-	<if test="processState==3 and complete !=5">
+	<if test="processState==4 and complete !=5">
 	and x.aid=#{aid}  and a.process_state &gt;= 3
 	</if>
-	<if test="processState==2 and complete ==5">
+	<if test="processState==3 and complete ==5">
 	and  x.aid=#{aid}  and a.back_status &gt;= #{processState}
 	</if>
-	<if test="processState==3 and complete ==5">
+	<if test="processState==4 and complete ==5">
 	and x.aid=#{aid}  and a.back_status &gt;= #{processState}
 	</if>
-	<if test="processState==5 and aid !=null">
+	<if test="processState==6 and aid !=null">
 	and e.finance_id =#{aid}
 	</if>
-	<if test="processState==5 and aids !=null">
+	<if test="processState==6 and aids !=null">
 	and e.finance_id in
 		<foreach close=")" collection="aids" item="id" open="(" separator=",">
 		#{id}
@@ -669,35 +669,35 @@ select
 	<if test="salesmanName !=null">
 	and d.name like concat('%',#{salesmanName},'%')
 	</if>
-	<if test="complete ==0 and processState != 8">
+	<if test="complete ==0 and processState != 9">
 	 and (a.process_state &gt;= #{processState} or a.back_status &gt;= #{processState})
 	</if>
-	<if test="complete ==0 and processState == 8">
-	 and (a.process_state &gt;= #{processState} and  a.process_state &lt; 9)or a.back_status &gt;= #{processState}
+	<if test="complete ==0 and processState == 9">
+	 and (a.process_state &gt;= #{processState} and  a.process_state &lt; 10)or a.back_status &gt;= #{processState}
 	</if>
-	<if test="complete ==1 and processState != 5 and processState != 7 and processState != 8">
+	<if test="complete ==1 and processState != 6 and processState != 8 and processState != 9">
 	 and a.process_state = #{processState}
 	</if>
-	<if test="complete ==1 and processState == 5">
-	 and (a.process_state in(5,9)  and a.status !=4)
+	<if test="complete ==1 and processState == 6">
+	 and (a.process_state in(6)  and a.status in (0,1,2,3,5,6))
 	</if>
-    <if test="complete ==1 and processState == 7">
-      and (a.process_state = 7  and  a.status =1)
-    </if>
     <if test="complete ==1 and processState == 8">
+      and (a.process_state = 8  and  a.status =1)
+    </if>
+    <if test="complete ==1 and processState == 9">
       and (a.process_state = #{processState} and   a.status =1)
     </if>
-	<if test="complete ==2 and processState != 5 and processState != 7 and processState != 8">
+	<if test="complete ==2 and processState != 6 and processState != 8 and processState != 9">
 	 and a.process_state &gt; #{processState}
 	</if>
-	<if test="complete ==2 and processState == 5">
-	 and (a.process_state &gt; 5 and a.process_state &lt; 9) or (a.process_state =9 and a.status=4)
-	</if>
-	<if test="complete ==2 and processState == 7">
-	 and ((a.process_state = 7  and  (a.status = 4 or a.status = 2))or a.process_state &gt; 7)
+	<if test="complete ==2 and processState == 6">
+	 and a.process_state &gt; 6 and a.process_state &lt; 10
 	</if>
 	<if test="complete ==2 and processState == 8">
-	 and a.process_state = 8  and   (a.status = 4 or a.status = 2)
+	 and ((a.process_state = 8  and  (a.status = 4 or a.status = 2))or a.process_state &gt; 8)
+	</if>
+	<if test="complete ==2 and processState == 9">
+	 and a.process_state = 9  and   (a.status = 4 or a.status = 2)
 	</if>
 	<if test="complete ==3">
 	 and   a.status = 2
@@ -705,7 +705,7 @@ select
 	<if test="complete ==4">
 	 and   a.status = 4
 	</if>
-	<if test="complete ==5 and processState != 2 and processState != 3">
+	<if test="complete ==5 and processState != 3 and processState != 4">
 	 and a.back_status &gt;= #{processState}
 	</if>
     <if test="complete ==6">

+ 1 - 1
src/main/java/com/goafanti/order/controller/OrderChangeApiController.java

@@ -288,7 +288,7 @@ public class OrderChangeApiController extends CertifyApiController {
 	 * 	状态为通过,通过状态下为财务退票,退票完成后改状态为上传附件,实际为营销员上传附件,营销员上传完后触发完成变更,状态才变成完成
 	 * 	状态 0草稿 1审核中 2通过 3驳回 4完成 5撤销 6上传附件
 	 * @param userName
-	 * @param processState 流程状态 0营销员 1营销管理员 2技术员 3技术经理 4技术总监 5财务专员(退单) 6财务总监 7总裁 8董事长
+	 * @param processState 流程状态 0=营销员,1=营销经理,2=营销管理员,3=技术员,4=技术经理,5=技术总监,6=财务专员,7=财务总监,8=总裁,9=董事长
 	 * @param timeType
 	 * @param startTime
 	 * @param endTime