Pārlūkot izejas kodu

变更流程修改

anderx 1 gadu atpakaļ
vecāks
revīzija
2ea7eb93b4

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

@@ -603,142 +603,13 @@ from new_order_change a where 1 = 1 and status in (0,1,2,3)
 	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==1">
-      and d.manager_id= #{aid}
-    </if>
-	<if test="processState==3 and complete !=5">
-	and  x.aid=#{aid}  and a.process_state &gt;= #{processState}
-	</if>
-	<if test="processState==4 and complete !=5">
-	and x.aid=#{aid}  and a.process_state &gt;= #{processState}
-	</if>
-	<if test="processState==3 and complete ==5">
-	and  x.aid=#{aid}  and a.back_status &gt;= #{processState}
-	</if>
-	<if test="processState==4 and complete ==5">
-	and x.aid=#{aid}  and a.back_status &gt;= #{processState}
-	</if>
-	<if test="processState==6 and aid !=null">
-	and e.finance_id =#{aid}
-	</if>
-	<if test="processState==6 and aids !=null">
-	and e.finance_id in
-		<foreach close=")" collection="aids" item="id" open="(" separator=",">
-		#{id}
-		</foreach>
-	</if>
-    <if test="processState==8 and aid !=null">
-      and e.approval_aid =#{aid}
-    </if>
-	<if test="userName !=null">
-	and c.nickname like concat('%',#{userName},'%')
-	</if>
-	<if test="orderNo !=null">
-	and a.order_no like concat('%',#{orderNo},'%')
-	</if>
-	<if test="contractNo !=null">
-	and b.contract_no like concat('%',#{contractNo},'%')
-	</if>
-	<if test="type !=null">
-	and a.type = #{type}
-	</if>
-	<if test="timeType == 0 and startTime !=null and endTime !=null">
-	and a.create_time between #{startTime} and #{endTime}
-	</if>
-	<if test="timeType == 1 and startTime !=null and endTime !=null">
-	and b.create_time between #{startTime} and #{endTime}
-	</if>
-	<if test="deps !=null">
-	and b.order_dep in
-      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
-        #{depId}
-      </foreach>
-	</if>
-	<if test="salesmanName !=null">
-	and d.name like concat('%',#{salesmanName},'%')
-	</if>
-    <if test="complete ==0 and  processState != 5  and processState &lt; 7">
-      and ((a.process_state &gt;= #{processState} or a.back_status &gt;= #{processState}))
-    </if>
-    <if test="complete ==0 and (processState == 5 or processState == 7)">
-      and ((a.process_state &gt;= #{processState} and  a.process_state &lt; 10)or a.back_status &gt;= #{processState})
-    </if>
-    <if test="complete ==0 and processState == 8">
-      and ((a.process_state &gt;= 8 and  a.process_state &lt; 10)or a.back_status &gt;= #{processState})
-    </if>
-    <if test="complete ==0 and processState == 9">
-      and ((a.process_state = 9 )or a.back_status &gt;= #{processState})
-    </if>
-    <if test="complete ==1 and processState &lt; 6">
-	 and a.process_state = #{processState} and a.status in (0,1,2,3)
-	</if>
-	<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 > 6">
-      and (a.process_state = #{processState}  and a.status =1)
-    </if>
-
-	<if test="complete ==2 and processState != 6 and processState != 8 and processState != 9 and processState !=3 and processState !=4">
-	 and a.process_state &gt; #{processState}
-	</if>
-	<if test="complete ==2 and processState == 6">
-	 and((a.process_state &gt; 6 and a.process_state &lt; 10) or (a.process_state =6 and a.status=4))
-	</if>
-	<if test="complete ==2 and processState == 8">
-	 and ((a.process_state = 8  and  a.status in(2,4))or a.process_state &gt; 8)
-	</if>
-	<if test="complete ==2 and processState == 9">
-	 and a.process_state = 9  and   a.status in (2,4)
-
-	</if>
-	<if test="complete ==3">
-	 and   a.status = 2
-	</if>
-	<if test="complete ==4">
-	 and   a.status = 4
-	</if>
-    <if test="complete ==5 and processState != 3 and processState != 4">
-	 and a.back_status = #{processState}
-	</if>
-    <if test="complete ==6">
-      and   a.status = 6
-    </if>
+    <include refid="selectOrderChangeSql"/>
 	order by a.status,a.create_time desc
 	<if test="page_sql != null">
 			${page_sql}
 	</if>
   </select>
-
-  <!--suppress MybatisPlusMapperXmlInspection -->
-  <select id="selectOrderChangeCount" resultType="java.lang.Integer">
-  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==3">
-      left join (select order_no, aid from order_examine where`type`=0
-      <if test="complete ==1">
-        and status=0
-      </if>
-      <if test="complete ==2">
-        and status=1
-      </if>
-      group by order_no,aid)x on a.order_no = x.order_no
-    </if>
-    <if test="processState==4">
-      left join (select order_no, aid from order_examine where`type`=1
-      <if test="complete ==1">
-        and status=0
-      </if>
-      <if test="complete ==2">
-        and status=1
-      </if>
-      group by order_no,aid)x on a.order_no = x.order_no
-    </if>
-    where 1=1
+  <sql id="selectOrderChangeSql">
     <if test="processState==0">
       and b.salesman_id= #{aid}
     </if>
@@ -766,7 +637,7 @@ from new_order_change a where 1 = 1 and status in (0,1,2,3)
         #{id}
       </foreach>
     </if>
-    <if test="processState==8 and aid !=null">
+    <if test="processState==9 and aid !=null">
       and e.approval_aid =#{aid}
     </if>
     <if test="userName !=null">
@@ -802,11 +673,11 @@ from new_order_change a where 1 = 1 and status in (0,1,2,3)
     <if test="complete ==0 and (processState == 5 or processState == 7)">
       and ((a.process_state &gt;= #{processState} and  a.process_state &lt; 10)or a.back_status &gt;= #{processState})
     </if>
-    <if test="complete ==0 and processState == 8">
-      and ((a.process_state &gt;= 8 and  a.process_state &lt; 10)or a.back_status &gt;= #{processState})
-    </if>
     <if test="complete ==0 and processState == 9">
-      and ((a.process_state = 9 )or a.back_status &gt;= #{processState})
+      and ((a.process_state &gt;= 9 and  a.process_state &lt; 11)or a.back_status &gt;= #{processState})
+    </if>
+    <if test="complete ==0 and processState == 10">
+      and ((a.process_state = 10 )or a.back_status &gt;= #{processState})
     </if>
     <if test="complete ==1 and processState &lt; 6">
       and a.process_state = #{processState} and a.status in (0,1,2,3)
@@ -824,11 +695,11 @@ from new_order_change a where 1 = 1 and status in (0,1,2,3)
     <if test="complete ==2 and processState == 6">
       and((a.process_state &gt; 6 and a.process_state &lt; 10) or (a.process_state =6 and a.status=4))
     </if>
-    <if test="complete ==2 and processState == 8">
-      and ((a.process_state = 8  and  a.status in(2,4))or a.process_state &gt; 8)
-    </if>
     <if test="complete ==2 and processState == 9">
-      and a.process_state = 9  and   a.status in (2,4)
+      and ((a.process_state = 9  and  a.status in(2,4))or a.process_state &gt; 9)
+    </if>
+    <if test="complete ==2 and processState == 10">
+      and a.process_state = 10  and   a.status in (2,4)
 
     </if>
     <if test="complete ==3">
@@ -843,6 +714,35 @@ from new_order_change a where 1 = 1 and status in (0,1,2,3)
     <if test="complete ==6">
       and   a.status = 6
     </if>
+  </sql>
+
+  <!--suppress MybatisPlusMapperXmlInspection -->
+  <select id="selectOrderChangeCount" resultType="java.lang.Integer">
+  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==3">
+      left join (select order_no, aid from order_examine where`type`=0
+      <if test="complete ==1">
+        and status=0
+      </if>
+      <if test="complete ==2">
+        and status=1
+      </if>
+      group by order_no,aid)x on a.order_no = x.order_no
+    </if>
+    <if test="processState==4">
+      left join (select order_no, aid from order_examine where`type`=1
+      <if test="complete ==1">
+        and status=0
+      </if>
+      <if test="complete ==2">
+        and status=1
+      </if>
+      group by order_no,aid)x on a.order_no = x.order_no
+    </if>
+    where 1=1
+    <include refid="selectOrderChangeSql"/>
 	</select>
 	<update id="addRefundInvoice">
 	update  new_order_change

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

@@ -304,18 +304,7 @@ public class OrderChangeApiController extends CertifyApiController {
 	 * 	首先是草稿然后发起变成审核中,再在流程中走一遍当金额小于2000总裁通过标记为通过,大于2000总裁通过不改变状态,流转到董事长,董事长审核改变
 	 * 	状态为通过,通过状态下为财务退票,退票完成后改状态为上传附件,实际为营销员上传附件,营销员上传完后触发完成变更,状态才变成完成
 	 * 	状态 0草稿 1审核中 2通过 3驳回 4完成 5撤销 6上传附件
-	 * @param userName
-	 * @param processState 流程状态 0=营销员,1=营销经理,2=营销管理员,3=技术员,4=技术经理,5=技术总监,6=财务专员,7=财务总监,8=总裁,9=董事长
-	 * @param timeType
-	 * @param startTime
-	 * @param endTime
-	 * @param salesmanName
-	 * @param complete
-	 * @param orderNo
-	 * @param contractNo
-	 * @param type
-	 * @param pageSize
-	 * @param pageNo
+	 * @param processState 流程状态 0=营销员,1=营销经理,2=营销管理员,3=技术员,4=技术经理,5=技术总监,6=财务专员,7=财务总监,8运营保障 9=总裁,10=董事长
 	 * @return
 	 */
 	@RequestMapping(value ="/orderChangeList",method = RequestMethod.GET)

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

@@ -864,7 +864,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			if (str.length()>0)noc.setExamineName(str.substring(0,str.length()-1));
 		}else if (noc.getProcessState()== OrderChangeProcess.JSY.getCode()){
 			List<OrderExamineBo> os = orderExamineMapper.selectByOrderNo(noc.getOrderNo(), 0);
-			StringBuffer str=new StringBuffer();
+			StringBuilder str=new StringBuilder();
 			for (OrderExamineBo o : os) {
 				if (o.getStatus()==0){
 					if (!str.toString().contains(o.getName()))str.append(o.getName()).append(",");
@@ -904,7 +904,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 
 		}else if (Objects.equals(noc.getProcessState(), OrderChangeProcess.YYBZ.getCode())){
 			TOrderNewBo ton = tOrderNewMapper.getSaleIdByOno(noc.getOrderNo());
-			noc.setExamineName(ton.getExamineName());
+			noc.setExamineName(ton.getOperationGuaranteeName());
 		} else if (Objects.equals(noc.getProcessState(), OrderChangeProcess.TPSH.getCode())
 				|| Objects.equals(noc.getProcessState(), OrderChangeProcess.DSZ.getCode())
 				|| Objects.equals(noc.getProcessState(), OrderChangeProcess.FZC.getCode())){