|
@@ -59,18 +59,20 @@ func MaterialSave(in *pb.MaterialSaveReq, title, content string) (msgId, mId int
|
|
|
return msgId, mId, nil
|
|
|
}
|
|
|
|
|
|
-func GetSendUserId(positionIds string, entId int64) []string {
|
|
|
+func GetSendUserId(positionIds string, entId int64) ([]string, map[int]string) {
|
|
|
//拿职位id找mgoid
|
|
|
userIdArr := []string{}
|
|
|
- query := fmt.Sprintf("SELECT userid FROM data_service.user_system WHERE position_id in (%s) AND ent_id = %d", positionIds, entId)
|
|
|
+ res := map[int]string{}
|
|
|
+ query := fmt.Sprintf("SELECT userid,position_id FROM data_service.user_system WHERE status = 1 AND position_id in (%s) AND ent_id = %d", positionIds, entId)
|
|
|
log.Println("查找分发人的sql", query)
|
|
|
useridMap := entity.JyBiTidb.SelectBySql(query)
|
|
|
if useridMap != nil && len(*useridMap) > 0 {
|
|
|
for _, val := range *useridMap {
|
|
|
userIdArr = append(userIdArr, gconv.String(val["userid"]))
|
|
|
+ res[common.IntAll(val["position_id"])] = common.InterfaceToStr(val["userid"])
|
|
|
}
|
|
|
}
|
|
|
- return userIdArr
|
|
|
+ return userIdArr, res
|
|
|
}
|
|
|
|
|
|
func PersonImageSave(imgUrl string, msgId, positionId, materialsId int64) bool {
|