Browse Source

营销管理、公司管理、财务管理、咨询管理新增修改对于审核人员的更新

anderx 3 years ago
parent
commit
74ca965652

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

@@ -733,14 +733,18 @@ select
       ,t_order_new b,admin c
       set a.examine_name=c.name
       where a.process_state = #{type} and a.order_no =b.order_no
-      and b.order_dep = #{depId}
+      <if test="type==1">
+        and b.order_dep = #{depId}
+      </if>
       and c.id= #{aid}
     </if>
       <if test="names !=null">
         ,t_order_new b
         set a.examine_name=#{names}
         where a.process_state = #{type} and a.order_no =b.order_no
-        and b.order_dep = #{depId}
+        <if test="type==1">
+          and b.order_dep = #{depId}
+        </if>
       </if>
   </update>
     <update id="updateTaskExamineName">

+ 8 - 5
src/main/java/com/goafanti/common/mapper/TOrderInvoiceMapper.xml

@@ -594,9 +594,9 @@ where a.status=2 and a.order_no=  #{orderNo,jdbcType=VARCHAR}
   </select>
 
   <update id="updateExamineName">
-    update  t_order_invoice a
+    update  t_order_invoice a,t_order_new b
     <if test="names ==null">
-      ,t_order_new b,admin c
+      ,admin c
       set a.examine_name=c.name
       where 1=1
       <if test="type==0">
@@ -609,11 +609,12 @@ where a.status=2 and a.order_no=  #{orderNo,jdbcType=VARCHAR}
         and  a.`type` =1 and a.status =1 and a.approval =1
       </if>
       and a.order_no =b.order_no
-      and b.order_dep = #{depId}
+      <if test="type==1">
+        and b.order_dep = #{depId}
+      </if>
       and c.id= #{aid}
     </if>
     <if test="names !=null">
-      ,t_order_new b
       set a.examine_name= #{names}
       where 1=1
       <if test="type==0">
@@ -626,7 +627,9 @@ where a.status=2 and a.order_no=  #{orderNo,jdbcType=VARCHAR}
         and  a.`type` =1 and a.status =1 and a.approval =1
       </if>
       and a.order_no =b.order_no
-      and b.order_dep = #{depId}
+      <if test="type==1">
+        and b.order_dep = #{depId}
+      </if>
     </if>
   </update>
   <update id="updateListExamineName">

+ 8 - 2
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1946,12 +1946,18 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     <if test="names==null">
       ,admin b
       set a.examine_name=b.name
-      where a.process_status = #{type} and a.order_dep = #{depId}
+      where a.process_status = #{type}
+      <if test="type==1">
+        and a.order_dep = #{depId}
+      </if>
       and b.id= #{aid}
     </if>
     <if test="names!=null">
       set a.examine_name= #{names}
-      where a.process_status = #{type}  and a.order_dep = #{depId}
+      where a.process_status = #{type}
+      <if test="type==1">
+        and a.order_dep = #{depId}
+      </if>
     </if>
 
 

+ 8 - 6
src/main/java/com/goafanti/common/utils/AsyncUtils.java

@@ -134,31 +134,33 @@ public class AsyncUtils {
 	public void updateListExamineName(Integer type, String depId, String roleType) {
 		String names="";
 		if (type==1){
-			names=getNames(depId, roleType);
+			names=getNames(type,depId, roleType);
 			tOrderNewMapper.updateExamineName(ProcessStatus.YPYXGLY.getCode(),depId,null,names);
 			newOrderChangeMapper.updateExamineName(OrderChangeProcess.YXGLY.getCode(),depId,null,names);
 			tOrderInvoiceMapper.updateExamineName(1,depId,null,names);
 		}else if (type==2){
 			tOrderInvoiceMapper.updateListExamineName(type,depId,roleType);
 		}else if (type==3){
-			names=getNames(depId, roleType);
+			names=getNames(type,depId, roleType);
 			newOrderChangeMapper.updateExamineName(OrderChangeProcess.CWZJ.getCode(),depId,null,names);
 		}else if (type==4){
-			names=getNames(depId, roleType);
+			names=getNames(type,depId, roleType);
 			tOrderNewMapper.updateExamineName(ProcessStatus.YPZXSGLY.getCode(),depId,null,names);
 			newOrderChangeMapper.updateExamineName(OrderChangeProcess.JSZJ.getCode(),depId,null,names);
 		}
 	}
 
-	private String getNames(String depId, String roleType) {
+	private String getNames(Integer type,String depId, String roleType) {
 		StringBuffer str=new StringBuffer();
 		List<Admin> admins = adminMapper.selectAdminByRoleType(roleType);
 		for (Admin admin : admins) {
-			if (admin.getDepartmentId().equals(depId)) {
+			if (type==1&&admin.getDepartmentId().equals(depId)){
+				str = str.append(admin.getName()).append(",");
+			}else if(type!=1){
 				str = str.append(admin.getName()).append(",");
 			}
 		}
 		if (str.length()>1)return str.substring(0,str.length()-1);
-		else return "";
+		else return "暂无";
 	}
 }