Browse Source

离职集团公司

xuzhiheng 1 năm trước cách đây
mục cha
commit
ce944ba37c
2 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 2 2
      service/clue.go
  2. 1 1
      service/company.go

+ 2 - 2
service/clue.go

@@ -674,7 +674,7 @@ func batchDraw(data []map[string]interface{}, nowTime, seatNumber, name string,
 			if cdata != nil && len(*cdata) > 0 {
 			if cdata != nil && len(*cdata) > 0 {
 				salePositionId := common.Int64All((*cdata)["position_id"])
 				salePositionId := common.Int64All((*cdata)["position_id"])
 				if pcount := JyBiMysql.Count("dwd_f_crm_personnel_management", map[string]interface{}{"resign": 0, "position_id": salePositionId}); pcount > 0 {
 				if pcount := JyBiMysql.Count("dwd_f_crm_personnel_management", map[string]interface{}{"resign": 0, "position_id": salePositionId}); pcount > 0 {
-					logx.Info("当前线索有在职销售 ", salePositionId)
+					logx.Info("当前线索有在职销售 ", clueId, cluename)
 					return count
 					return count
 				} else {
 				} else {
 					saledata := JyBiMysql.SelectBySql(`SELECT position_id from dwd_d_crm_department_level_succbi WHERE bi_pcode in (SELECT bi_pcode from dwd_d_crm_department_level_succbi WHERE position_id = ?) AND resign = 0`, salePositionId)
 					saledata := JyBiMysql.SelectBySql(`SELECT position_id from dwd_d_crm_department_level_succbi WHERE bi_pcode in (SELECT bi_pcode from dwd_d_crm_department_level_succbi WHERE position_id = ?) AND resign = 0`, salePositionId)
@@ -687,7 +687,7 @@ func batchDraw(data []map[string]interface{}, nowTime, seatNumber, name string,
 							}
 							}
 						}
 						}
 						if !isOk {
 						if !isOk {
-							logx.Info("当前线索销售离职,只能同部门领取 ", salePositionId)
+							logx.Info("当前线索销售离职,只能同部门领取 ", clueId, cluename)
 							return count
 							return count
 						}
 						}
 					}
 					}

+ 1 - 1
service/company.go

@@ -128,7 +128,7 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq) *biservice.Distri
 	}
 	}
 	logx.Info("clueArrs ", clueArrs)
 	logx.Info("clueArrs ", clueArrs)
 	if len(clueArrs) > 0 {
 	if len(clueArrs) > 0 {
-		sql0 := `SELECT a.cluename,a.id,b.position_id FROM dwd_f_crm_clue_info a INNER JOIN (SELECT a.cluename,a.position_id FROM dwd_f_crm_clue_info a INNER JOIN dwd_f_crm_personnel_management b on a.position_id = b.position_id WHERE a.cluename in (SELECT cluename FROM dwd_f_crm_clue_info WHERE id in (` + strings.Join(clueArrs, ",") + `) GROUP BY cluename) AND a.id not in (` + strings.Join(clueArrs, ",") + `) AND b.resign = 1 GROUP BY a.cluename) as b on b.cluename = a.cluename where a.id in (` + strings.Join(clueArrs, ",") + `)`
+		sql0 := `SELECT a.cluename,a.id,b.position_id FROM dwd_f_crm_clue_info a INNER JOIN (SELECT a.cluename,a.position_id FROM dwd_f_crm_clue_info a INNER JOIN dwd_f_crm_personnel_management b on a.position_id = b.position_id WHERE a.cluename in (SELECT cluename FROM dwd_f_crm_clue_info WHERE id in (` + strings.Join(clueArrs, ",") + `) GROUP BY cluename) AND a.id not in (` + strings.Join(clueArrs, ",") + `) AND b.resign = 1 AND a.company_nature = 0 AND a.company_verification = 1 GROUP BY a.cluename) as b on b.cluename = a.cluename where a.id in (` + strings.Join(clueArrs, ",") + `)`
 		logx.Info("sql0", sql0)
 		logx.Info("sql0", sql0)
 		mdata := JyBiTidb.SelectBySql(sql0)
 		mdata := JyBiTidb.SelectBySql(sql0)
 		if mdata != nil && len(*mdata) > 0 {
 		if mdata != nil && len(*mdata) > 0 {