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

Merge branch 'test' of jishutao/kede-server into prod

anderx лет назад: 2
Родитель
Сommit
cf68a94dfc

+ 35 - 29
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -21,53 +21,56 @@ public class AFTConstants {
 	/**	特批决策者 */
 	public static final String	APPROVAL_DECISION					= "99999";
 	/**	特批决策者审核 */
-	public static final String	APPROVAL_DECISION_ASSISTANT				= "99989";
-	/**	总裁 */
+	public static final String	APPROVAL_DECISION_ASSISTANT			= "99989";
+	/** 总裁 */
 	public static final String	CED									= "99998";
-	/**	总裁助理 */
-	public static final String	CED_ASSISTANT						= "99988";
+	/** 副总裁 */
+	public static final String  VICE_CED	 	             	    = "99996";
 	/**	集团副总 */
 	public static final String	VICE_CEO							= "99997";
-	/** 技术财税管理员 */
-	public static final String  TECH_FINANCE_DIRECTOR                = "9994";
+	/**	总裁助理 */
+	public static final String	CED_ASSISTANT						= "99988";
 	/** 技术管理员 */
 	public static final String  TECH_ADMIN                          = "9998";
-	/**	技术经理 */
-	public static final String  TECH_MANAGER                        = "998";
-	/**	技术员 */
-	public static final String  TECH		                        = "98";
 	/**	财务管理员*/
 	public static final String  FINANCE_ADMIN                       = "9997";
-	/**	湖南特批开票*/
-	public static final String  HN_APPROVED							= "9987";
-	/**	财务经理*/
-	public static final String  FINANCE_MANAGER						= "997";
-	/**	财务专员*/
-	public static final String  FINANCE								= "97";
 	/**	营销管理员 */
 	public static final String  SALESMAN_ADMIN                      = "9996";
 	/**	营销总监 */
 	public static final String  SALESMAN_DIRECTOR                   = "9995";
-	/** 营销经理 */
-	public static final String  SALESMAN_MANAGER                    = "996";
-	/**	营销员 */
-	public static final String  SALESMAN                      		= "96";
-	/** 客服营销员 */
-	public static final String  CUSTOMER_SERVICE_SALESMAN     		= "960";
+	/** 技术财税管理员 */
+	public static final String  TECH_FINANCE_DIRECTOR               = "9994";
+	/** 公司管理 */
+	public static final String  COMPANY_MANAGER 	                = "9993";
+	/** 专利管理员 */
+	public static final String  PATENT_AUDITOR 	                  	= "9992";
 	/**	外包审核员 */
 	public static final String  OUTSOURCE_AUDITOR                   = "9991";
 	/** 人事管理员*/
 	public static final String  PERSONNEL_AUDITOR              	  	= "9990";
-	/** 专利管理员 */
-	public static final String  PATENT_AUDITOR 	                  	= "9992";
-	/** 公司管理 */
-	public static final String  COMPANY_MANAGER 	                = "9993";
 	/** 运营管理 */
 	public static final String  OPERATION_MANAGER		            = "9989";
-	/** 渠道专员 */
-	public static final String  CHANNEL                      		= "80";
+
+	/**	湖南特批开票*/
+	public static final String  HN_APPROVED							= "9987";
 	/** 渠道总监 */
 	public static final String  CHANNEL_DIRECTOR                    = "9980";
+	/**	技术经理 */
+	public static final String  TECH_MANAGER                        = "998";
+	/**	财务经理*/
+	public static final String  FINANCE_MANAGER						= "997";
+	/** 营销经理 */
+	public static final String  SALESMAN_MANAGER                    = "996";
+	/** 客服营销员 */
+	public static final String  CUSTOMER_SERVICE_SALESMAN     		= "960";
+	/**	技术员 */
+	public static final String  TECH		                        = "98";
+	/**	财务专员*/
+	public static final String  FINANCE								= "97";
+	/**	营销员 */
+	public static final String  SALESMAN                      		= "96";
+	/** 渠道专员 */
+	public static final String  CHANNEL                      		= "80";
 	/** 客服专员 */
 	public static final String  CUSTOMER_SERVICE            		= "81";
 	/** 法务专员 */
@@ -209,5 +212,8 @@ public class AFTConstants {
 
     public static final long DUN_START_LIMIT_MS						= 24*3600*1000*900L;
 
-
+	/**
+	 * 省内判定
+	 */
+    public static final Integer HN_PROVINCE = 11;
 }

+ 3 - 0
src/main/java/com/goafanti/common/dao/TOrderNewMapper.java

@@ -1,5 +1,6 @@
 package com.goafanti.common.dao;
 
+import com.goafanti.common.model.Department;
 import com.goafanti.common.model.FinanceCount;
 import com.goafanti.common.model.TOrderBillNew;
 import com.goafanti.common.model.TOrderNew;
@@ -94,4 +95,6 @@ public interface TOrderNewMapper {
     List<FinanceCount> selectCountByFinance(String id);
 
     OrganizationListOut selectOrderFinance(String orderNo);
+
+    Department selectDepByOrderNo(String orderNo);
 }

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

@@ -576,27 +576,31 @@ select
 	<if test="salesmanName !=null">
 	and d.name like concat('%',#{salesmanName},'%')
 	</if>
-	<if test="complete ==0 and processState != 9 and  processState != 5 and processState != 7">
-	 and ((a.process_state &gt;= #{processState} or a.back_status &gt;= #{processState}))
-	</if>
-    <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 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;= 1 and  a.process_state &lt; 10)or a.back_status &gt;= #{processState})
+      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}) and e.province !=11
+    </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 != 6 and processState != 8 and processState != 9">
+    <if test="complete ==0 and processState == 10">
+      and ((a.process_state =10 )or a.back_status &gt;= #{processState}) and e.province=11
+    </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 == 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 ==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>
@@ -604,10 +608,10 @@ select
 	 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 = 4 or a.status = 2))or a.process_state &gt; 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 = 4 or a.status = 2)
+	 and a.process_state = 9  and   a.status in (2,4)
 
 	</if>
 	<if test="complete ==3">
@@ -617,7 +621,7 @@ select
 	 and   a.status = 4
 	</if>
     <if test="complete ==5 and processState != 3 and processState != 4">
-	 and a.back_status &gt;= #{processState}
+	 and a.back_status = #{processState}
 	</if>
     <if test="complete ==6">
       and   a.status = 6
@@ -652,103 +656,108 @@ select
       </if>
       group by order_no,aid)x on a.order_no = x.order_no
     </if>
-	where 1=1
+    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="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="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="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 != 9 and  processState != 5 and processState != 7">
-      and (a.process_state &gt;= #{processState} or a.back_status &gt;= #{processState})
+    <if test="salesmanName !=null">
+      and d.name like concat('%',#{salesmanName},'%')
     </if>
-    <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 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;= 1 and  a.process_state &lt; 10)or a.back_status &gt;= #{processState})
+      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 != 6 and processState != 8 and processState != 9">
+    <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}) and e.province !=11
+    </if>
+    <if test="complete ==0 and processState == 9">
+      and ((a.process_state = 9 )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}) and e.province=11
+    </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 == 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 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 = 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
-	</if>
-	<if test="complete ==4">
-	 and   a.status = 4
-	</if>
-	<if test="complete ==5 and processState != 3 and processState != 4">
-	 and a.back_status &gt;= #{processState}
-	</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>
@@ -858,6 +867,7 @@ select
 
   <select id="getProcessName" resultType="com.goafanti.order.bo.OutProcessName">
     select a.id,a.order_no orderNo ,a.`type`,a.change_amount changeAmount ,a.status,a.process_state processState,
+           if(dep.province=11,1,0)isHN,fzc.name fzc,
            c.name yxy,mg.name yxjl, yxgly.name yxgly,zxs.name zxs,zxsjl.name zxsjl, zxsgly.name zxsgly,
            fm.name cwzy,cwgly.name cwgly, zc.name zc,dsz.name dsz,b.salesman_id salesmanId
     from new_order_change a
@@ -883,6 +893,10 @@ select
            left join (select group_concat(a.name) name
                       from admin a left join user_role b on a.id=b.uid
                                    left join `role` c on b.rid =c.id
+                      where c.role_type in ('99996') and a.status ='0' ) fzc on 1=1
+           left join (select group_concat(a.name) name
+                      from admin a left join user_role b on a.id=b.uid
+                                   left join `role` c on b.rid =c.id
                       where c.role_type in ('99999','99989') and a.status ='0' ) dsz on 1=1
            left join (select group_concat(a.name) name
                       from admin a left join user_role b on a.id=b.uid

+ 52 - 29
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -783,7 +783,7 @@
       a.other_cost_actual otherCostActual , a.expect_profit expectProfit ,a.actual_profit  actualProfit,a.service_type serviceType,
       a.service_project serviceProject,o.examine_name examineName
     from t_order_new o left join department d on o.order_dep = d.id left join `user` u on o.buyer_id = u.id left join t_order_mid a on o.order_no=a.order_no
-    left join (select * from  t_order_outsource where type=0) too on o.order_no=too.order_no where delete_sign in(0,2) and approval in(0,1,2,4,5)
+    left join (select * from  t_order_outsource where type=0) too on o.order_no=too.order_no where delete_sign in(0,2) and 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}
@@ -841,13 +841,13 @@
           and a.project_type = #{o.projectType}
         </if>
       <if test="o.approval != null and o.approval ==1">
-        and o.approval in (1,4)
+        and o.approval in (1,4,7)
       </if>
       <if test="o.approval != null and o.approval ==2">
-        and o.approval in (2,5)
+        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)
+          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 + '%'" />
@@ -871,7 +871,7 @@
   <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
- where delete_sign in(0,2) and approval in(0,1,2) and outsource=  #{o.outsource,jdbcType=INTEGER}
+ where delete_sign in(0,2) and 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>
@@ -928,13 +928,13 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
       and a.project_type = #{o.projectType}
     </if>
     <if test="o.approval != null and o.approval ==1">
-      and o.approval in (1,4)
+      and o.approval in (1,4,7)
     </if>
     <if test="o.approval != null and o.approval ==2">
-      and o.approval in (2,5)
+      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)
+      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 + '%'" />
@@ -1013,7 +1013,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	</if>
   	<if test="specially == 0">
   	  <if test="approval ==null">
-  	  and a.approval in(0,1,2,4,5)
+  	  and a.approval in(0,1,2,4,5,7,8)
       </if>
   	and a.order_status  in(0,1,2,4)
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
@@ -1041,17 +1041,23 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
             <if test="manageType ==0">
             (1)
             </if>
-          <if test="manageType ==1">
-            (4)
-          </if>
+        <if test="manageType ==1">
+          (4)
+        </if>
+        <if test="manageType ==2">
+          (7)
+        </if>
       </if>
       <if test="approval ==2">
         and a.approval in
         <if test="manageType ==0">
-          (2)
+          (2,3)
         </if>
         <if test="manageType ==1">
-          (5)
+          (5,6)
+        </if>
+        <if test="manageType ==2">
+          (8,9)
         </if>
       </if>
     </if>
@@ -1060,13 +1066,13 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
           and a.approval = 0
         </if>
         <if test="approval ==1">
-          and a.approval in (1,4)
+          and a.approval in (1,4,7)
         </if>
         <if test="approval ==2">
-          and a.approval in (2,5)
+          and a.approval in (2,5,8)
         </if>
         <if test="approval ==4">
-          and a.approval in (1,2,4,5)
+          and a.approval in (1,2,4,5,7,8)
         </if>
       </if>
   	<if test="specially == 4">
@@ -1185,7 +1191,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	</if>
   	<if test="specially == 0">
       <if test="approval ==null">
-        and a.approval in(0,1,2,4,5)
+        and a.approval in(0,1,2,4,5,7,8)
       </if>
       and a.order_status  in(0,1,2,4)
       and a.salesman_id = #{aid,jdbcType=VARCHAR}
@@ -1216,29 +1222,35 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
          <if test="manageType ==1">
            (4)
          </if>
+         <if test="manageType ==2">
+           (7)
+         </if>
        </if>
        <if test="approval ==2">
          and a.approval in
          <if test="manageType ==0">
-           (2)
+           (2,3)
          </if>
          <if test="manageType ==1">
-           (5)
+           (5,6)
+         </if>
+         <if test="manageType ==2">
+           (8,9)
          </if>
        </if>
      </if>
-     <if test="specially !=3">
+     <if test="specially !=3 ">
        <if test="approval ==0">
          and a.approval = 0
        </if>
        <if test="approval ==1">
-         and a.approval in (1,4)
+         and a.approval in (1,4,7)
        </if>
        <if test="approval ==2">
-         and a.approval in (2,5)
+         and a.approval in (2,5,8)
        </if>
        <if test="approval ==4">
-         and a.approval in (1,2,4,5)
+         and a.approval in (1,2,4,5,7,8)
        </if>
      </if>
   	<if test="specially == 4">
@@ -1566,7 +1578,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     select IFNULL( sum(o.settlement_amount),0) actuallyTotalAmount,IFNULL(sum(o.total_amount),0)  signTotalAmount
     from t_order_new o
     left join department d   on o.order_dep=d.id left join `user` u on o.buyer_id = u.id  left join t_order_mid a on o.order_no=a.order_no
-    where o.delete_sign in(0,2,3)  and (o.approval = 0 or o.approval = 2) and outsource=  #{o.outsource,jdbcType=INTEGER}
+    where o.delete_sign in(0,2,3)  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>
@@ -1622,11 +1634,14 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     <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 &lt; 3">
-      and o.approval = #{o.approval}
+    <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)
+      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 + '%'" />
@@ -2085,7 +2100,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   </select>
   <select id="getProcessName" resultType="com.goafanti.order.bo.OrderProcessName">
     select a.order_no orderNo,a.approval,a.process_status processStatus  ,b.name yxy,mg.name yxjl,
-        yxgly.name yxgly,d.name cwzy,zc.name zc, zxsgly.name zxsgly,dsz.name dsz
+        yxgly.name yxgly,d.name cwzy,zc.name zc,fzc.name fzc, zxsgly.name zxsgly,dsz.name dsz
     from t_order_new a left join admin b on a.salesman_id =b.id
     left join admin mg on b.manager_id =mg.id left join department c on a.order_dep =c.id
      left join (select a.department_id depId,group_concat(a.name) name
@@ -2096,6 +2111,9 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
         from admin a left join user_role b on a.id=b.uid left join `role` c on b.rid =c.id
         where c.role_type in ('99998','99988') and a.status ='0' ) zc on 1=1
      left join (select group_concat(a.name) name
+                from admin a left join user_role b on a.id=b.uid left join `role` c on b.rid =c.id
+                where c.role_type in ('99996') and a.status ='0' ) fzc on 1=1
+     left join (select group_concat(a.name) name
         from admin a left join user_role b on a.id=b.uid left join `role` c on b.rid =c.id
         where c.role_type in ('99999','99989') and a.status ='0' ) dsz on 1=1
      left join (select group_concat(a.name) name
@@ -2173,5 +2191,10 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     left join admin d on b.retrial_finance_id=d.id
     where a.order_no =#{orderNo}
   </select>
+  <select id="selectDepByOrderNo" resultType="com.goafanti.common.model.Department">
+    select a.id,a.name,a.province,a.finance_id financeId
+    from department a left join t_order_new b on a.id =b.order_dep
+    where b.order_no= #{orderNo}
+  </select>
 
 </mapper>

+ 23 - 6
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -68,6 +68,7 @@
     <result column="satisfaction_degree" jdbcType="INTEGER" property="satisfactionDegree" />
     <result column="satisfaction_degree_url" jdbcType="VARCHAR" property="satisfactionDegreeUrl" />
     <result column="examine_type" jdbcType="INTEGER" property="examineType" />
+    <result column="approval" jdbcType="INTEGER" property="approval" />
   </resultMap>
   <sql id="Base_Column_List">
     id, order_no, main, super_id, commodity_id, commodity_name, commodity_quantity, commodity_mode,
@@ -80,7 +81,8 @@
     declaration_batch, cost_reduction, official_cost, set_up_status, set_up_time, spot_check_status,
     high_tech_status, special_comment, if_certification_fee, certification_fee, certification_corporate,
     time_record, if_publicity, check_status, patent_type, pubicity_url, process_status,
-    member_type, picture_url, satisfaction_degree, satisfaction_degree_url, examine_type
+    member_type, picture_url, satisfaction_degree, satisfaction_degree_url, examine_type,
+    approval
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -115,7 +117,7 @@
       check_status, patent_type, pubicity_url,
       process_status, member_type, picture_url,
       satisfaction_degree, satisfaction_degree_url,
-      examine_type)
+      examine_type, approval)
     values (#{orderNo,jdbcType=VARCHAR}, #{main,jdbcType=INTEGER}, #{superId,jdbcType=VARCHAR},
       #{commodityId,jdbcType=VARCHAR}, #{commodityName,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER},
       #{commodityMode,jdbcType=VARCHAR}, #{commodityPrice,jdbcType=DECIMAL}, #{taskStatus,jdbcType=INTEGER},
@@ -138,7 +140,7 @@
       #{checkStatus,jdbcType=INTEGER}, #{patentType,jdbcType=INTEGER}, #{pubicityUrl,jdbcType=VARCHAR},
       #{processStatus,jdbcType=INTEGER}, #{memberType,jdbcType=INTEGER}, #{pictureUrl,jdbcType=VARCHAR},
       #{satisfactionDegree,jdbcType=INTEGER}, #{satisfactionDegreeUrl,jdbcType=VARCHAR},
-      #{examineType,jdbcType=INTEGER})
+      #{examineType,jdbcType=INTEGER}, #{approval,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderTask" useGeneratedKeys="true">
     insert into t_order_task
@@ -338,6 +340,9 @@
       <if test="examineType != null">
         examine_type,
       </if>
+      <if test="approval != null">
+        approval,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="orderNo != null">
@@ -535,6 +540,9 @@
       <if test="examineType != null">
         #{examineType,jdbcType=INTEGER},
       </if>
+      <if test="approval != null">
+        #{approval,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderTask">
@@ -735,6 +743,9 @@
       <if test="examineType != null">
         examine_type = #{examineType,jdbcType=INTEGER},
       </if>
+      <if test="approval != null">
+        approval = #{approval,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -804,7 +815,8 @@
       picture_url = #{pictureUrl,jdbcType=VARCHAR},
       satisfaction_degree = #{satisfactionDegree,jdbcType=INTEGER},
       satisfaction_degree_url = #{satisfactionDegreeUrl,jdbcType=VARCHAR},
-      examine_type = #{examineType,jdbcType=INTEGER}
+      examine_type = #{examineType,jdbcType=INTEGER},
+      approval = #{approval,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -2121,7 +2133,7 @@
     select a.id,b.contract_no contractNo,c.buyer_name userName,a.order_no orderNo,b.approval ,c.dep_name depName,
     c.salesman_name salesmanName,c.finance_name financeName,a.commodity_name projectName,a.member_type memberType,
     b.delete_sign deleteSign ,b.total_amount totalAmount ,b.sales_type salesType ,b.other,a.examine_type examineType,
-    a.process_status status,a.commodity_id commodityId,a.commodity_name commodityName,
+    a.process_status status,a.commodity_id commodityId,a.commodity_name commodityName,a.approval approvalType,
     a.commodity_quantity commodityQuantity,a.task_comment taskComment,a.picture_url pictureUrl,
     e.service_life serviceLife ,e.service_year serviceYear,e.year_sum yearSum,e.contract_term contractTerm
     from t_order_task a left join t_order_new b on a.order_no =b.order_no
@@ -2138,7 +2150,9 @@
     <if test="shiroType ==2">
       and (d.finance_id  = #{aid} or  d.retrial_finance_id =#{aid})
     </if>
-
+    <if test="approvalType !=null">
+      and a.approval= #{approvalType}
+    </if>
     <if test="orderNo != null">
       and a.order_no = #{orderNo}
     </if>
@@ -2206,6 +2220,9 @@
     <if test="shiroType ==2">
       and (d.finance_id  = #{aid} or  d.retrial_finance_id =#{aid})
     </if>
+    <if test="approvalType !=null">
+      and a.approval= #{approvalType}
+    </if>
     <if test="orderNo != null">
       and a.order_no = #{orderNo}
     </if>

+ 14 - 1
src/main/java/com/goafanti/common/model/TOrderTask.java

@@ -335,10 +335,15 @@ public class TOrderTask implements Serializable {
     private String satisfactionDegreeUrl;
 
     /**
-     * 0=全部 ,1=财务审核,2=财务复审,3=已审核
+     * 0=无需审核 ,1=财务审核,2=财务复审,3=全部需要审核,4=已审核
      */
     private Integer examineType;
 
+    /**
+     * 特批状态 0-非特批 ,1-总裁特批,2-副总裁特批
+     */
+    private Integer approval;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -868,4 +873,12 @@ public class TOrderTask implements Serializable {
     public void setExamineType(Integer examineType) {
         this.examineType = examineType;
     }
+
+    public Integer getApproval() {
+        return approval;
+    }
+
+    public void setApproval(Integer approval) {
+        this.approval = approval;
+    }
 }

+ 10 - 0
src/main/java/com/goafanti/order/bo/OrderProcessName.java

@@ -10,8 +10,18 @@ public class OrderProcessName {
     private String yxgly;
     private String cwzy;
     private String zc;
+    private String fzc;
     private String zxsgly;
     private String dsz;
+
+    public String getFzc() {
+        return fzc;
+    }
+
+    public void setFzc(String fzc) {
+        this.fzc = fzc;
+    }
+
     public String getYxjl() {
         return yxjl;
     }

+ 10 - 0
src/main/java/com/goafanti/order/bo/OutMemberList.java

@@ -27,6 +27,8 @@ public class OutMemberList {
     private String taskComment;
     @Excel(name = "状态",readConverterExp = "0=非审核,1=财务审核,2=特批审核,3=通过,4=驳回",width = MINWIDTH)
     private Integer status;
+    /** 特批分类  0非特批 1总裁特批 2副总裁特批*/
+    private Integer approvalType;
 
     private Integer  deleteSign;
 
@@ -57,6 +59,14 @@ public class OutMemberList {
     private Integer myExamine;
     private Integer examineType;
 
+    public Integer getApprovalType() {
+        return approvalType;
+    }
+
+    public void setApprovalType(Integer approvalType) {
+        this.approvalType = approvalType;
+    }
+
     public Integer getExamineType() {
         return examineType;
     }

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

@@ -8,6 +8,8 @@ public class OutProcessName {
     private Integer status;
     private Integer special;
     private Integer processState;
+    private Integer isHN;
+    private String fzc;
     private String yxy;
     private String salesmanId;
     private String yxjl;
@@ -20,6 +22,22 @@ public class OutProcessName {
     private String zc;
     private String dsz;
 
+    public Integer getIsHN() {
+        return isHN;
+    }
+
+    public void setIsHN(Integer isHN) {
+        this.isHN = isHN;
+    }
+
+    public String getFzc() {
+        return fzc;
+    }
+
+    public void setFzc(String fzc) {
+        this.fzc = fzc;
+    }
+
     public Integer getSpecial() {
         if (special==null)return 0;
         return special;

+ 6 - 1
src/main/java/com/goafanti/order/enums/ApprovalNewState.java

@@ -12,13 +12,18 @@ public enum ApprovalNewState {
 	ZCTG(2,"总裁通过"),
 	/** 总裁驳回 **/
 	ZCBH(3,"总裁驳回"),
-
 	/** 董事长待审核 **/
 	DSZDSH(4,"董事长待审核"),
 	/** 董事长通过 **/
 	DSZTG(5,"董事长通过"),
 	/** 董事长驳回 **/
 	DSZBH(6,"董事长驳回"),
+	/** 总裁待审核 **/
+	FZCDSH(7,"副总裁待审核"),
+	/** 总裁通过 **/
+	FZCTG(8,"副总裁通过"),
+	/** 总裁驳回 **/
+	FZCBH(9,"副总裁驳回"),
 	/** 无效 **/
 	INVALID(10, "INVALID");
 

+ 2 - 1
src/main/java/com/goafanti/order/enums/OrderChangeProcess.java

@@ -20,7 +20,8 @@ public enum OrderChangeProcess {
 	CWZJ(7, "财务总监 "),
 	ZC(8, "总裁"),
 	DSZ(9, "董事长"),
-	INVALID(10, "无效");
+	FZC(10, "副总裁"),
+	INVALID(99, "无效");
 
 	private OrderChangeProcess(Integer code, String desc) {
 		this.code = code;

+ 11 - 4
src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java

@@ -546,8 +546,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 		List<String> aids = new ArrayList<>();
 		StringBuffer str= new StringBuffer();
 		TOrderNewBo order = tOrderNewMapper.getSaleIdByOno(t.getOrderNo());
-		if (new1.getApproval()==ApprovalNewState.ZCDSH.getCode()||
-				new1.getApproval()==ApprovalNewState.ZCBH.getCode()) {
+		if (new1.getApproval()==ApprovalNewState.ZCDSH.getCode()|| new1.getApproval()==ApprovalNewState.ZCBH.getCode()) {
 			t.setProcessStatus(ProcessStatus.YPTPSH.getCode());
 			List<String> types=new ArrayList<>();
 			//总裁加助理
@@ -557,8 +556,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 				aids.add(admin.getId());
 				str=str.append(admin.getName()).append(",");
 			}
-		}else if (new1.getApproval()==ApprovalNewState.DSZDSH.getCode()||
-				new1.getApproval()==ApprovalNewState.DSZBH.getCode()) {
+		}else if (new1.getApproval()==ApprovalNewState.DSZDSH.getCode()|| new1.getApproval()==ApprovalNewState.DSZBH.getCode()) {
 			t.setProcessStatus(ProcessStatus.YPTPSH.getCode());
 			List<String> types=new ArrayList<>();
 			//董事长加助理
@@ -568,6 +566,15 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 				aids.add(admin.getId());
 				str=str.append(admin.getName()).append(",");
 			}
+		}else if (new1.getApproval()==ApprovalNewState.FZCDSH.getCode()|| new1.getApproval()==ApprovalNewState.FZCBH.getCode()) {
+			t.setProcessStatus(ProcessStatus.YPTPSH.getCode());
+			List<String> types=new ArrayList<>();
+			//董事长加助理
+			types.add(AFTConstants.VICE_CED);
+			for (Admin admin : adminMapper.getAdminRoleTypesList(types)) {
+				aids.add(admin.getId());
+				str=str.append(admin.getName()).append(",");
+			}
 		}else  {
 			t.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
 			//设置发送邮件标识

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

@@ -253,6 +253,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	public int pushOrderChangeAudit(String changeId, String remarks, Integer status,Integer processState,Integer rejectState) {
 		NewOrderChangeBo nb=newOrderChangeMapper.selectByChangeId(changeId);
 		String orderNo=nb.getOrderNo();
+		Department dep = tOrderNewMapper.selectDepByOrderNo(orderNo);
 		if (processState==null||(nb.getProcessState()!=9&&processState !=nb.getProcessState()) ) {
 			throw new BusinessException(new Error( "变更流程与您所操作流程不匹配","变更流程与您所操作流程不匹配"));
 		}
@@ -273,13 +274,13 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 						return 1;
 					}
 				} else {
-/*				 	 赠送:营销-经理-总经理审核-财务(已收款情况)-总裁
-				 	 重报:营销-经理-总经理审核-技术员-财务-财务总监-总裁
-					仅项目:营销-经理-总经理审核-技术员-技术总监-财务-财务总监-总裁
-				 项目&金额:营销-经理-总经理审核-技术员-经理经理-技术总监-财务-财务总监-总裁
-				  退单退款:营销-经理-总经理审核-技术员-经理经理-技术总监-财务-财务总监-总裁-董事长(大于2K,需董事长审核)-财务退票
-				 退单不退款:营销-经理-总经理审核-技术员-经理经理-技术总监-财务-财务总监-总裁-财务退票
-					仅金额:营销-经理-总经理审核-技术总监-财务-财务总监-总裁
+/*				 	 赠送:营销-经理-总经理审核-财务(已收款情况)-总裁(副总裁)
+				 	 重报:营销-经理-总经理审核-技术员-财务-财务总监-总裁(副总裁)
+					仅项目:营销-经理-总经理审核-技术员-技术总监-财务-财务总监-总裁(副总裁)
+				 项目&金额:营销-经理-总经理审核-技术员-经理经理-技术总监-财务-财务总监-总裁(副总裁)
+				  退单退款:营销-经理-总经理审核-技术员-经理经理-技术总监-财务-财务总监-总裁(副总裁)-董事长(副总裁大于2K,需董事长审核)-财务退票
+				 退单不退款:营销-经理-总经理审核-技术员-经理经理-技术总监-财务-财务总监-总裁(副总裁)-财务退票
+					仅金额:营销-经理-总经理审核-技术总监-财务-财务总监-总裁(副总裁)
 				框架协议审核流程: 营销员发起-营销经理审核-营销管理员审核-财务审核
 				 */
 					if (nb.getProcessState()==OrderChangeProcess.YXJL.getCode()){
@@ -308,7 +309,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 						nb.setProcessState(OrderChangeProcess.CWZY.getCode());
 					}else if (nb.getProcessState()==OrderChangeProcess.CWZY.getCode()){
 						if (nb.getType()==OrderChangeType.ZS.getCode()){
-							nb.setProcessState(OrderChangeProcess.ZC.getCode());
+							pushCED(nb, dep);
 						}if (nb.getType()==OrderChangeType.KJXY.getCode()){
 							nb.setStatus(4);
 							addOrderChangeLog(remarks, 2, orderNo, nb.getId());
@@ -318,22 +319,9 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 							nb.setProcessState(OrderChangeProcess.CWZJ.getCode());
 						}
 					}else if (nb.getProcessState()==OrderChangeProcess.CWZJ.getCode()){
-						//财务总监审核,曹津不走总裁走董事长
-						TOrderNew tOrderNew = tOrderNewMapper.selectByPrimaryKey(nb.getOrderNo());
-						if (tOrderNew.getSalesmanId().equals(AFTConstants.CAOJIN_AID)) {
-							nb.setProcessState(OrderChangeProcess.DSZ.getCode());
-						}else {
-							nb.setProcessState(OrderChangeProcess.ZC.getCode());
-						}
-					}else if (nb.getProcessState()==OrderChangeProcess.ZC.getCode()){
-						if (nb.getType()==OrderChangeType.TDTK.getCode()) {
-							if (nb.getChangeAmount().compareTo(new BigDecimal("0.2")) < 0) {
-								//小于则总裁通过,大于则董事长
-								nb.setStatus(2);
-							}else {
-								nb.setProcessState(OrderChangeProcess.DSZ.getCode());
-							}
-						}else if (nb.getType()==OrderChangeType.TDBTK.getCode()){
+						pushCED(nb,dep);
+					}else if(nb.getProcessState()==OrderChangeProcess.ZC.getCode()) {
+						if (nb.getType()==OrderChangeType.TDTK.getCode()||nb.getType()==OrderChangeType.TDBTK.getCode()) {
 							nb.setStatus(2);
 						}else {
 							nb.setStatus(4);
@@ -341,12 +329,28 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 							pushCompleteOrderChange(nb);
 							return 1;
 						}
+					}else if (nb.getProcessState()==OrderChangeProcess.FZC.getCode()){
+							if (nb.getType()==OrderChangeType.TDTK.getCode()) {
+								if (nb.getChangeAmount().compareTo(new BigDecimal("0.2")) < 0) {
+									//小于则总裁通过,大于则董事长
+									nb.setStatus(2);
+								}else {
+									nb.setProcessState(OrderChangeProcess.DSZ.getCode());
+								}
+							}else if (nb.getType()==OrderChangeType.TDBTK.getCode()){
+								nb.setStatus(2);
+							}else {
+								nb.setStatus(4);
+								addOrderChangeLog(remarks, 2, orderNo, nb.getId());
+								pushCompleteOrderChange(nb);
+								return 1;
+							}
 
-					}else if (nb.getProcessState()==OrderChangeProcess.DSZ.getCode()){
-						nb.setStatus(2);
+						}else if (nb.getProcessState()==OrderChangeProcess.DSZ.getCode()){
+							nb.setStatus(2);
+						}
 					}
 				}
-			}
 			if(nb.getStatus()==3) {
 				nb.setStatus(1);//如果驳回数据则改为正常数据
 			}
@@ -384,6 +388,19 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		return 1;
 	}
 
+	private void pushCED(NewOrderChangeBo nb, Department dep) {
+		TOrderNew tOrderNew = tOrderNewMapper.selectByPrimaryKey(nb.getOrderNo());
+		if (tOrderNew.getSalesmanId().equals(AFTConstants.CAOJIN_AID)) {
+			nb.setProcessState(OrderChangeProcess.DSZ.getCode());
+		}else {
+			if (dep.getProvince()==11){
+				nb.setProcessState(OrderChangeProcess.FZC.getCode());
+			}else {
+				nb.setProcessState(OrderChangeProcess.ZC.getCode());
+			}
+		}
+	}
+
 	/**
 	 *
 	 * @param nb
@@ -515,6 +532,15 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 				}
 			}
 			break;
+		case 10:
+			if(nb.getStatus()==2) {
+				alist.add(o.getFinanceId());
+			}else {
+				for (Admin admin : adminMapper.selectAdminByRoleType(AFTConstants.VICE_CED)) {
+					alist.add(admin.getId());
+				}
+			}
+			break;
 		}
 		//发送站内信息与邮件
 		pushGeneralSendNoticeAndEmail(alist, type, o, TokenManager.getAdminId(),0);
@@ -815,8 +841,25 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			}
 			if (str.length()>0)noc.setExamineName(str.substring(0,str.length()-1));
 
-		}else if (noc.getProcessState()== OrderChangeProcess.ZC.getCode()||noc.getProcessState()== OrderChangeProcess.DSZ.getCode()){
-			if(noc.getStatus()==2){
+		}else if (noc.getProcessState()== OrderChangeProcess.ZC.getCode()
+				||noc.getProcessState()== OrderChangeProcess.DSZ.getCode()
+				||noc.getProcessState()== OrderChangeProcess.FZC.getCode()){
+			if(noc.getStatus()==1){
+				String roleType="";
+				if (noc.getProcessState()== OrderChangeProcess.ZC.getCode()){
+					roleType=AFTConstants.CED;
+				}else if(noc.getProcessState()== OrderChangeProcess.DSZ.getCode()){
+					roleType=AFTConstants.APPROVAL_DECISION;
+				}else if(noc.getProcessState()== OrderChangeProcess.FZC.getCode()){
+					roleType=AFTConstants.VICE_CED;
+				}
+				StringBuffer str=new StringBuffer();
+				List<Admin> admins = adminMapper.getAdminRoleTypeList(roleType);
+				for (Admin a : admins) {
+					str=str.append(a.getName()).append(",");
+				}
+				if (str.length()>0)noc.setExamineName(str.substring(0,str.length()-1));
+			} else if(noc.getStatus()==2){
 				TOrderNewBo ton = tOrderNewMapper.getSaleIdByOno(noc.getOrderNo());
 				OrganizationListOut dep = departmentMapper.selectAllById(ton.getOrderDep());
 				noc.setExamineName(dep.getFinanceName());

+ 19 - 9
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -198,7 +198,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		OrganizationListOut dep = departmentMapper.selectAllById(o.getOrderDep());
 		List<TOrderExamine> list =new ArrayList<>();
 		if(!Objects.isNull(dep)){
-			if (!Objects.isNull(dep.getFinanceId())){
+			if (StringUtils.isNotBlank(dep.getFinanceId())){
 				list.add(new TOrderExamine(o.getOrderNo(),0,dep.getFinanceId(),dep.getFinanceName()));
 			}
 			if (StringUtils.isNotBlank(dep.getRetrialFinanceId())){
@@ -525,6 +525,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			tOrderExamineMapper.deleteByOrderNo(t.getOrderNo());
 			addOrderExamine(t);
 		}
+
 		//订单提交
 		if (isSubmit==1) {
 			t2.setApproval(t.getApproval());
@@ -548,18 +549,21 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 			}
 			//特批逻辑处理
-			if (t2.getApproval()==ApprovalNewState.ZCDSH.getCode()){
+			if (t2.getApproval()==ApprovalNewState.ZCBH.getCode()||
+					t2.getApproval()==ApprovalNewState.DSZBH.getCode()||
+					t2.getApproval()== ApprovalNewState.FZCBH.getCode()||
+					t2.getApproval()==ApprovalNewState.ZCDSH.getCode()){
 				if (a.getId().equals(AFTConstants.CAOJIN_AID)){
 					t.setApproval(ApprovalNewState.DSZDSH.getCode());
 				}else {
-					t.setApproval(ApprovalNewState.ZCDSH.getCode());
+					Department dep = departmentMapper.selectByPrimaryKey(t2.getOrderDep());
+					if(dep.getProvince()==11){
+						t.setApproval(ApprovalNewState.FZCDSH.getCode());
+					}else {
+						t.setApproval(ApprovalNewState.ZCDSH.getCode());
+					}
 				}
 			}
-			if (t2.getApproval()==ApprovalNewState.ZCBH.getCode()){
-				t.setApproval(ApprovalNewState.ZCDSH.getCode());
-			}else if (t2.getApproval()==ApprovalNewState.DSZBH.getCode()){
-				t.setApproval(ApprovalNewState.DSZDSH.getCode());
-			}
 			//生成流转
 			if (StringUtils.isBlank(t2.getContractNo())) {
 				//没有合同编号则生成
@@ -937,10 +941,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			}
 		}
 		if (in.getSpecially()==3){
-			if (TokenManager.hasRole(AFTConstants.CED)){
+			if (TokenManager.hasRole(AFTConstants.CED)||TokenManager.hasRole(AFTConstants.CED_ASSISTANT)){
 				params.put("manageType",0);
 			}else if (TokenManager.hasRole(AFTConstants.APPROVAL_DECISION_ASSISTANT)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)){
 				params.put("manageType",1);
+			}else if (TokenManager.hasRole(AFTConstants.VICE_CED)){
+				params.put("manageType",2);
 			}else {
 				params.put("manageType",0);
 			}
@@ -1472,12 +1478,16 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (confirm==2) {
 			if (t2.getApproval()==ApprovalNewState.ZCDSH.getCode())t.setApproval(ApprovalNewState.ZCTG.getCode());
 			else if (t2.getApproval()==ApprovalNewState.DSZDSH.getCode())t.setApproval(ApprovalNewState.DSZTG.getCode());
+			else if (t2.getApproval()==ApprovalNewState.FZCDSH.getCode())t.setApproval(ApprovalNewState.FZCTG.getCode());
 				t.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
 				OrganizationListOut oo=departmentMapper.selectAllById(t2.getOrderDep());
 				t.setFinanceId(oo.getFinanceId());
+				StringBuffer str=new StringBuffer();
 				for (Admin admin : adminMapper.getAdminRoleTypeList(AFTConstants.TECH_ADMIN)) {
 					aids.add(admin.getId());
+					if (!str.toString().contains(admin.getName()))str.append(admin.getName()).append(",");
 				}
+			if (str.length()>0)t.setExamineName(str.substring(0,str.length()-1));
 			type=NoticeStatus.ORDER_APPROVA_YES.getCode();
 			tl.setProcess(OrderLogProcess.TP.getCode());
 			addOrderLog(tl,reason);

+ 17 - 1
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -1261,6 +1261,11 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		if(in.getStatus()!=null) map.put("status", in.getStatus());
 		if(in.getShiroType()!=null) map.put("shiroType", in.getShiroType());
 		map.put("aid",TokenManager.getAdminId());
+		if (TokenManager.hasRole(AFTConstants.VICE_CED)){
+			map.put("approvalType",2);
+		}else if (TokenManager.hasRole(AFTConstants.CED)){
+			map.put("approvalType",1);
+		}
 	}
 
 	@Override
@@ -1466,6 +1471,15 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			tOrderTask.setProcessStatus(1);
 			tOrderTask.setMemberType(memberType);
 			tOrderTask.setPictureUrl(pictureUrl);
+			if(memberType==1||memberType==2){
+				//判定项目省内外
+				Department dep = tOrderNewMapper.selectDepByOrderNo(tOrderTask.getOrderNo());
+				if (dep!=null&&dep.getProvince()==AFTConstants.HN_PROVINCE){
+					tOrderTask.setApproval(2);
+				}else {
+					tOrderTask.setApproval(1);
+				}
+			}
 		}
 		Integer i=tOrderTaskMapper.getSplitCount(tid);
 		i++;
@@ -1509,7 +1523,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		tOrderExamineMapper.deleteByTid(t.getId());
 		List<TOrderExamine> list=new ArrayList<>();
 		TOrderTask tOrderTask= new TOrderTask();
-		if(!Objects.isNull(dep)){
+		if(StringUtils.isNotBlank(dep.getFinanceId())){
 			int examineType=0;
 			if (!Objects.isNull(dep.getFinanceId())){
 				list.add(new TOrderExamine(t.getOrderNo(),1,t.getId(),dep.getFinanceId(),dep.getFinanceName()));
@@ -1531,6 +1545,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		tOrderExamineMapper.insertBatch(list);
 	}
 
+
+
 	private void addFinanceCountMember(String orderNo, Date date) {
 		Admin admin = adminMapper.selectOrderByFinanace(orderNo);
 		String startTime = DateUtils.formatDate(date, AFTConstants.YYYYMMDD);

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

@@ -34,6 +34,14 @@ public class PushOrderService {
             }else {
                 return  t.getContractPictureUrl();
             }
+        }else if(TokenManager.hasRole(AFTConstants.VICE_CED)){
+            if (t.getApproval()== ApprovalNewState.FZCDSH.getCode()){
+                return  t.getContractPictureUrl();
+            }else  if (t.getSalesmanId().equals(AFTConstants.CAOJIN_AID)){
+                return DEFAULTS_URL;
+            }else {
+                return  t.getContractPictureUrl();
+            }
         }else if (TokenManager.hasRole(AFTConstants.SALESMAN)&&
                 TokenManager.getAdminId().equals(t.getSalesmanId())){
             return  t.getContractPictureUrl();
@@ -127,6 +135,11 @@ public class PushOrderService {
                         flag=true;
                     }
                     break;
+                case 10:
+                    if((TokenManager.hasRole(AFTConstants.VICE_CED))||(TokenManager.hasRole(AFTConstants.FINANCE)&&status==2)){
+                        flag=true;
+                    }
+                    break;
             }
         }
         if (flag){

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -52,7 +52,7 @@ yxjl_max=100
 amb.maxLvl=6
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.93
+static.host=//static.jishutao.com/1.2.96
 rd.static.host=//static.jishutao.com/RD/1.0.00
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.62

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -52,7 +52,7 @@ amb.maxLvl=6
 
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.93
+static.host=//static.jishutao.com/1.2.96
 rd.static.host=//static.jishutao.com/RD/1.0.01
 avatar.upload.host=//static.jishutao.com/upload