Bläddra i källkod

b端 分配业务经理

zhangc 7 månader sedan
förälder
incheckning
fdf7551baf

+ 9 - 0
src/main/java/com/sunxung/factoring/service/sys/impl/ClientUserServiceImpl.java

@@ -68,6 +68,7 @@ import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Random;
 
 
 @Service
@@ -1054,6 +1055,7 @@ public class ClientUserServiceImpl extends ServiceImpl<ClientUserMapper, ClientU
     Long shyyzx = orgService.findByName("上海运营中心").getId();    //上海运营中心
     Long szyyzx = orgService.findByName("深圳运营中心").getId();
     ;   //深圳运营中心
+    List<Long> orgIdList = Lists.newArrayList(xayyzx,zcglzx,shyyzx,szyyzx);
 
     List<ClientUserDO> userList = new ArrayList<>();
     List<ClientUserDO> userList1 = new ArrayList<>();
@@ -1076,6 +1078,13 @@ public class ClientUserServiceImpl extends ServiceImpl<ClientUserMapper, ClientU
           continue;
         }
         Long provinceId = user.getProvinceId();
+        if(provinceId==null){
+          Random p1=new Random();
+          int p=p1.nextInt(3);
+          user.setOrgId(orgIdList.get(p));
+          this.baseMapper.updateById(user);
+          continue;
+        }
         if (list.indexOf(provinceId) >= 0) {
           userList.add(user);
         }

+ 2 - 2
src/main/resources/mapper/sys/ClientUserMapper.xml

@@ -19,8 +19,8 @@
 		from  c_sys_user a
 		LEFT JOIN sys_user b on a.project_manager = b.id
 		LEFT JOIN sys_user c on  a.risk_manager = c.id
-		LEFT JOIN t_org d on a.province_id = d.id
-		LEFT JOIN t_org e on a.city_id = e.id
+		LEFT JOIN pbccrc_department d on a.province_id = d.id
+		LEFT JOIN pbccrc_department e on a.city_id = e.id
     <where>
 			<if test="mark !=null and mark !='' ">
 				 and (a.id = #{mark}  or a.mobile like CONCAT('%',#{mark},'%') )