anderx 3 år sedan
förälder
incheckning
d9aacd4a6f

+ 0 - 1
src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java

@@ -104,7 +104,6 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 			}
 			TokenManager.clearUserAuthByUserId(ad.getId());
 		}
-
 		ad.setType(sumType(roleIds));
 		int count=adminMapper.updateByPrimaryKey(ad);
 		//

+ 0 - 1
src/main/java/com/goafanti/common/dao/NewOrderChangeMapper.java

@@ -43,7 +43,6 @@ public interface NewOrderChangeMapper {
     NewOrderChangeBo selectByorderNoAndStatus(String orderNo);
 
 
-    int updateExamineName(String depId);
 
     int updateTaskExamineName(@Param("aid") String aid, @Param("taskReceiverId") String taskReceiverId,@Param("type") Integer type);
 

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

@@ -67,7 +67,6 @@ public interface TOrderNewMapper {
      */
     OrderProcessName getProcessName(String orderNo);
 
-    void updateDepExamine(String departmentId);
 
     void updateExamineById(@Param("id") String id,@Param("type")Integer type);
 

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

@@ -768,6 +768,15 @@ select
       set a.examine_name=c.name
       where a.process_state =1 and c.manager_id = #{id}
     </if>
+    <if test="type==2">
+      left join (select a.department_id depId,group_concat(a.name) name
+      from admin a left join admin b on a.department_id =b.department_id
+      left join user_role c on a.id=c.uid left join `role` d on c.rid =d.id
+      where  b.id= #{id} and d.role_type ='9996'
+      and a.status ='0' group by b.department_id )x on b.order_dep=x.depId
+      set a.examine_name=x.name
+      where a.process_state =2
+    </if>
     <if test="type==3">
       left join t_order_task c on a.order_no =c.order_no
       left join (select a.order_no ,a.`type` ,GROUP_CONCAT(distinct b.name) name

+ 12 - 3
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1642,9 +1642,18 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   <update id="updateExamineById">
     update t_order_new a
     <if test="type==1">
-    left join admin b on a.salesman_id =b.id
-    set a.examine_name=b.name
-    where a.process_status =1 and b.manager_id = #{id}
+      left join admin b on a.salesman_id =b.id
+      set a.examine_name=b.name
+      where a.process_status =1 and b.manager_id = #{id}
+    </if>
+    <if test="type==2">
+      left join (select a.department_id depId,group_concat(a.name) name
+      from admin a left join admin b on a.department_id =b.department_id
+      left join user_role c on a.id=c.uid left join `role` d on c.rid =d.id
+      where  b.id= #{id} and d.role_type ='9996'
+      and a.status ='0' group by b.department_id )x on a.order_dep=x.depId
+      set a.examine_name=x.name
+      where a.process_status =2
     </if>
     <if test="type==3">
       left join department b on a.order_dep =b.id

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

@@ -519,8 +519,7 @@ public class AsyncUtils {
 	 */
 	public void updateOrderAndChangeExamine(Admin ad, String roleType) {
 		if (roleType.equals(AFTConstants.SALESMAN_ADMIN)){
-			tOrderNewMapper.updateDepExamine(ad.getDepartmentId());
-			newOrderChangeMapper.updateExamineName(ad.getDepartmentId());
+			updateSalesmanAdminExamine(ad.getId());
 		}else if (roleType.equals(AFTConstants.SALESMAN_MANAGER)){
 //			订单 0=营销员,1=经理,2=营销管理员,3=财务专员,4=总裁,5=技术总监,6部分分配,7全部分配
 //			变更 流程状态 0=营销员,1=营销经理,2=营销管理员,3=技术员,4=技术经理,5=技术总监,6=财务专员,7=财务总监,8=总裁,9=董事长
@@ -539,6 +538,11 @@ public class AsyncUtils {
 		}
 	}
 
+	private void updateSalesmanAdminExamine(String id) {
+		tOrderNewMapper.updateExamineById(id,ProcessStatus.YPYXGLY.getCode());
+		newOrderChangeMapper.updateExamineById(id,OrderChangeProcess.YXGLY.getCode());
+	}
+
 	private void updateSalesmanManagerExamine(Admin ad) {
 		updateSalesmanManagerExamine(ad.getId());
 	}