Commit 907b326a by 杨树贤

修复

parent 92367b19
Showing with 27 additions and 4 deletions
...@@ -1177,10 +1177,33 @@ class SupplierService ...@@ -1177,10 +1177,33 @@ class SupplierService
->first(); ->first();
if ($existingLiexin) { if ($existingLiexin) {
// 有猎芯采购但没有数据跟单员,用已有的猎芯采购员分配数据跟单员 // 检查这个猎芯采购是否是四个人中的一个
$assignCodeIds[] = $existingLiexin->can_check_uids; $existingLiexinCodeId = $existingLiexin->can_check_uids;
$result['debug_info']['assign_type'] = '代理商/原厂-使用已有猎芯采购分配数据跟单员'; $isInDataFollowerGroup = false;
$result['debug_info']['existing_liexin_code_id'] = $existingLiexin->can_check_uids; foreach ($dataFollowerGroup as $followerName) {
$codeId = $adminUserService->getCodeIdByUserName($followerName);
if ($codeId && $codeId == $existingLiexinCodeId) {
$isInDataFollowerGroup = true;
break;
}
}
if ($isInDataFollowerGroup) {
// 猎芯采购是四个人中的一个,用已有的猎芯采购员分配数据跟单员
$assignCodeIds[] = $existingLiexin->can_check_uids;
$result['debug_info']['assign_type'] = '代理商/原厂-使用已有猎芯采购(四人组)分配数据跟单员';
$result['debug_info']['existing_liexin_code_id'] = $existingLiexin->can_check_uids;
} else {
// 猎芯采购不是四个人中的一个,随机选商品供应链部数据跟单采购组的其中1人
$randomFollower = $dataFollowerGroup[array_rand($dataFollowerGroup)];
$codeId = $adminUserService->getCodeIdByUserName($randomFollower);
if ($codeId) {
$assignCodeIds[] = $codeId;
}
$result['debug_info']['assign_type'] = '代理商/原厂-猎芯采购非四人组,随机分配1人';
$result['debug_info']['random_follower'] = $randomFollower;
$result['debug_info']['existing_liexin_code_id'] = $existingLiexin->can_check_uids;
}
} else { } else {
// 都没有,随机选商品供应链部数据跟单采购组的其中1人 // 都没有,随机选商品供应链部数据跟单采购组的其中1人
$randomFollower = $dataFollowerGroup[array_rand($dataFollowerGroup)]; $randomFollower = $dataFollowerGroup[array_rand($dataFollowerGroup)];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment