|
@@ -49,13 +49,13 @@ func TransferParticipateInfo(projectId string, in *bxcore.ParticipateActionReq)
|
|
|
//保存或更新新跟踪人
|
|
|
if !IC.BaseMysql.ExecTx("划转参标信息", func(tx *sql.Tx) bool {
|
|
|
var (
|
|
|
- b1 = true
|
|
|
- b2, b3 bool
|
|
|
- now = time.Now()
|
|
|
- content = "%s划转给%s%s"
|
|
|
- lastNotes = ",保留原参标人"
|
|
|
- fromUserNames []string
|
|
|
- ids []int
|
|
|
+ b1 = true
|
|
|
+ b2, b3 bool
|
|
|
+ now = time.Now()
|
|
|
+ content = "%s划转给%s%s"
|
|
|
+ lastNotes = ",保留原参标人"
|
|
|
+ fromEntUserNames, toEntUserNames, toEntUserIds []string
|
|
|
+ ids []int
|
|
|
)
|
|
|
partInfo := IC.BaseMysql.SelectBySqlByTx(tx, "SELECT id,position_id FROM "+ParticipateUserTable+" WHERE project_id = ? AND ent_id = ? AND state > -1", projectId, in.EntId)
|
|
|
if partInfo == nil || len(*partInfo) == 0 {
|
|
@@ -67,11 +67,11 @@ func TransferParticipateInfo(projectId string, in *bxcore.ParticipateActionReq)
|
|
|
positionId := MC.Int64All(v["position_id"])
|
|
|
userInfo := IC.Middleground.UserCenter.IdentityByPositionId(positionId)
|
|
|
if userInfo.EntUserName != "" {
|
|
|
- fromUserNames = append(fromUserNames, userInfo.EntUserName)
|
|
|
+ fromEntUserNames = append(fromEntUserNames, userInfo.EntUserName)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if len(fromUserNames) == 0 {
|
|
|
+ if len(fromEntUserNames) == 0 {
|
|
|
logx.Info("原参标人信息查询有误")
|
|
|
return false
|
|
|
}
|
|
@@ -89,48 +89,70 @@ func TransferParticipateInfo(projectId string, in *bxcore.ParticipateActionReq)
|
|
|
"update_date": date.FormatDate(&now, date.Date_Full_Layout),
|
|
|
})
|
|
|
}
|
|
|
- //查询划转人信息
|
|
|
- entUserId, _ := strconv.ParseInt(in.ToEntUserId, 10, 64)
|
|
|
- userInfo := IC.Middleground.UserCenter.IdentityByEntUserId(entUserId)
|
|
|
- positionId := userInfo.PositionId
|
|
|
- content = fmt.Sprintf(content, strings.Join(fromUserNames, ","), userInfo.EntUserName, lastNotes)
|
|
|
+ //移动端 划转对象是多选
|
|
|
+ //划转对象entuserid 解密
|
|
|
+ for _, toEntUserId := range strings.Split(in.ToEntUserId, ",") {
|
|
|
+ toEntUserId = encrypt.SE.Decode4HexByCheck(toEntUserId)
|
|
|
+ if toEntUserId == "" {
|
|
|
+ logx.Info("划转对象不能为空", in.ProjectIds, in.EntId)
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ //查询划转人信息
|
|
|
+ entUserId, _ := strconv.ParseInt(toEntUserId, 10, 64)
|
|
|
+ userInfo := IC.Middleground.UserCenter.IdentityByEntUserId(entUserId)
|
|
|
+ positionId := userInfo.PositionId
|
|
|
+ //保存参标--participate_user
|
|
|
+ //查看是否参标过当前项目
|
|
|
+ if c := IC.BaseMysql.CountBySql("SELECT count(id) FROM "+ParticipateUserTable+" WHERE position_id = ? AND project_id = ? AND ent_id = ?", positionId, projectId, in.EntId); c > 0 {
|
|
|
+ //更新
|
|
|
+ b3 = IC.BaseMysql.UpdateByTx(tx, ParticipateUserTable, map[string]interface{}{
|
|
|
+ "position_id": positionId,
|
|
|
+ "project_id": projectId,
|
|
|
+ "ent_id": in.EntId,
|
|
|
+ }, map[string]interface{}{
|
|
|
+ "state": 0,
|
|
|
+ "mark": 1, //0:参标;1:被划入;-1:终止参标;-2:被划走
|
|
|
+ "update_date": date.FormatDate(&now, date.Date_Full_Layout),
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ //保存
|
|
|
+ b3 = IC.BaseMysql.InsertByTx(tx, ParticipateUserTable, map[string]interface{}{
|
|
|
+ "ent_id": in.EntId,
|
|
|
+ "ent_user_id": entUserId,
|
|
|
+ "position_id": positionId,
|
|
|
+ "project_id": projectId,
|
|
|
+ "user_id": in.MgoUserId,
|
|
|
+ "state": 0,
|
|
|
+ "mark": 1, //0:参标;1:被划入;-1:终止参标;-2:被划走
|
|
|
+ "create_date": date.FormatDate(&now, date.Date_Full_Layout),
|
|
|
+ "update_date": date.FormatDate(&now, date.Date_Full_Layout),
|
|
|
+ }) > 0
|
|
|
+ }
|
|
|
+ if b3 {
|
|
|
+ toEntUserIds = append(toEntUserIds, toEntUserId)
|
|
|
+ toEntUserNames = append(toEntUserNames, userInfo.EntUserName)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //保存多个用户时 如果个别用户划转参标项目异常,直接跳过此用户,保存其他用户信息
|
|
|
+ //防止最后一个用户保存异常
|
|
|
+ if len(toEntUserIds) > 0 {
|
|
|
+ b3 = true
|
|
|
+ }
|
|
|
+ //移动端单个项目划转给多个用户,划转记录保存一份,当前企业下参过标的或当前正在参标的人都能看到次记录
|
|
|
+ //企业下 根据企业id 和项目id查询划转记录
|
|
|
+ //个人版 根据职位id 和项目id查询划转记录
|
|
|
//划转记录
|
|
|
b2 = IC.BaseMysql.InsertByTx(tx, ParticipateBidRecordsTable, map[string]interface{}{
|
|
|
- "ent_id": in.EntId,
|
|
|
- "ent_user_id": entUserId,
|
|
|
- "position_id": positionId,
|
|
|
- "project_id": projectId,
|
|
|
- "record_type": 0,
|
|
|
- "record_content": content,
|
|
|
- "create_date": date.FormatDate(&now, date.Date_Full_Layout),
|
|
|
+ "ent_id": in.EntId,
|
|
|
+ "ent_user_id": in.EntUserId,
|
|
|
+ "position_id": in.PositionId,
|
|
|
+ "project_id": projectId,
|
|
|
+ "record_type": 0,
|
|
|
+ "transfer_ent_user_id": strings.Join(toEntUserIds, ","),
|
|
|
+ "record_content": fmt.Sprintf(content, strings.Join(fromEntUserNames, "、"), strings.Join(toEntUserNames, "、"), lastNotes),
|
|
|
+ "create_date": date.FormatDate(&now, date.Date_Full_Layout),
|
|
|
}) > 0
|
|
|
- //保存参标--participate_user
|
|
|
- //查看是否参标过当前项目
|
|
|
- if c := IC.BaseMysql.CountBySql("SELECT count(id) FROM "+ParticipateUserTable+" WHERE position_id = ? AND project_id = ? AND ent_id = ?", positionId, projectId, in.EntId); c > 0 {
|
|
|
- //更新
|
|
|
- b3 = IC.BaseMysql.UpdateByTx(tx, ParticipateUserTable, map[string]interface{}{
|
|
|
- "position_id": positionId,
|
|
|
- "project_id": projectId,
|
|
|
- "ent_id": in.EntId,
|
|
|
- }, map[string]interface{}{
|
|
|
- "state": 0,
|
|
|
- "mark": 1, //0:参标;1:被划入;-1:终止参标;-2:被划走
|
|
|
- "update_date": date.FormatDate(&now, date.Date_Full_Layout),
|
|
|
- })
|
|
|
- } else {
|
|
|
- //保存
|
|
|
- b3 = IC.BaseMysql.InsertByTx(tx, ParticipateUserTable, map[string]interface{}{
|
|
|
- "ent_id": in.EntId,
|
|
|
- "ent_user_id": entUserId,
|
|
|
- "position_id": positionId,
|
|
|
- "project_id": projectId,
|
|
|
- "user_id": in.MgoUserId,
|
|
|
- "state": 0,
|
|
|
- "mark": 1, //0:参标;1:被划入;-1:终止参标;-2:被划走
|
|
|
- "create_date": date.FormatDate(&now, date.Date_Full_Layout),
|
|
|
- "update_date": date.FormatDate(&now, date.Date_Full_Layout),
|
|
|
- }) > 0
|
|
|
- }
|
|
|
+
|
|
|
return b1 && b2 && b3
|
|
|
}) {
|
|
|
logx.Info(in.PositionId, "---终止---", projectId)
|
|
@@ -196,13 +218,13 @@ func SaveParticipateInfo(in *bxcore.ParticipateActionReq) error {
|
|
|
if c := IC.BaseMysql.CountBySql("SELECT count(id) FROM "+ParticipateUserTable+" WHERE position_id = ? AND project_id = ? AND ent_id = ?", in.PositionId, in.ProjectIds, in.EntId); c > 0 {
|
|
|
//更新
|
|
|
b1 = IC.BaseMysql.UpdateByTx(tx, ParticipateUserTable, map[string]interface{}{
|
|
|
- "state": 0,
|
|
|
- "mark": 0,
|
|
|
- "update_date": date.FormatDate(&now, date.Date_Full_Layout),
|
|
|
- }, map[string]interface{}{
|
|
|
"position_id": in.PositionId,
|
|
|
"ent_id": in.EntId,
|
|
|
"project_id": in.ProjectIds,
|
|
|
+ }, map[string]interface{}{
|
|
|
+ "state": 0,
|
|
|
+ "mark": 0,
|
|
|
+ "update_date": date.FormatDate(&now, date.Date_Full_Layout),
|
|
|
})
|
|
|
} else {
|
|
|
//保存
|
|
@@ -236,10 +258,10 @@ func SaveParticipateInfo(in *bxcore.ParticipateActionReq) error {
|
|
|
}
|
|
|
//保存或更新项目信息
|
|
|
//有问题 其他回滚,项目信息不用回滚
|
|
|
- b3 = UpdateProjectInfo(in.ProjectIds, es.GetProjectInfo(in.ProjectIds), es.GetBiddingInfo(in.BidIds)) == nil
|
|
|
+ b3 = UpdateProjectInfo(in.ProjectIds, es.GetProjectInfo(in.ProjectIds)) == nil
|
|
|
return b1 && b2 && b3
|
|
|
}) {
|
|
|
- logx.Info(in.PositionId, "---保存---", in.BidIds)
|
|
|
+ logx.Info(in.PositionId, "---保存---", in.ProjectIds)
|
|
|
return fmt.Errorf("保存参标信息出错")
|
|
|
}
|
|
|
return nil
|
|
@@ -249,7 +271,7 @@ func SaveParticipateInfo(in *bxcore.ParticipateActionReq) error {
|
|
|
func IsParticipatedByBidId(in *bxcore.ParticipateActionReq) bool {
|
|
|
defer MC.Catch()
|
|
|
//如果不允许多人参标 当前项目是否已经有企业其他人员参标
|
|
|
- query := fmt.Sprintf(`SELECT count(id) FROM `+ParticipateUserTable+` WHERE %s AND project_id = %s AND state >-1`, "%s", in.BidIds)
|
|
|
+ query := fmt.Sprintf(`SELECT count(id) FROM `+ParticipateUserTable+` WHERE %s AND project_id = %s AND state >-1`, "%s", in.ProjectIds)
|
|
|
if in.PositionType > 0 { //企业版
|
|
|
query = fmt.Sprintf(query, fmt.Sprintf("ent_id = %d", in.EntId))
|
|
|
} else { //个人版
|
|
@@ -374,7 +396,7 @@ func GetParticipateSetInfo(in *bxcore.ParticipateSetUpInfoReq) (*bxcore.Particip
|
|
|
}
|
|
|
|
|
|
//保存或更新tidb 项目信息
|
|
|
-func UpdateProjectInfo(id string, pInfo map[string]interface{}, bInfo map[string]interface{}) error {
|
|
|
+func UpdateProjectInfo(id string, pInfo map[string]interface{}) error {
|
|
|
//id 项目id
|
|
|
//name 项目名称
|
|
|
//area 省份
|
|
@@ -382,8 +404,8 @@ func UpdateProjectInfo(id string, pInfo map[string]interface{}, bInfo map[string
|
|
|
//buyer 采购单位
|
|
|
//budget 预算
|
|
|
//bid_open_time 开标时间
|
|
|
- //bid_time 招标时间 bidding表
|
|
|
- //bid_end_time 开标结束时间 bidding表
|
|
|
+ //zbtime 招标时间
|
|
|
+ //bid_end_time 开标结束时间 bidding表 由 数据组 重新生索引到project表
|
|
|
//pici 批次 轮询更新数据
|
|
|
//
|
|
|
projectInfo := map[string]interface{}{
|
|
@@ -407,8 +429,8 @@ func UpdateProjectInfo(id string, pInfo map[string]interface{}, bInfo map[string
|
|
|
bidTime := pInfo["zbtime"]
|
|
|
projectInfo["bid_time"] = date.FormatDateWithObj(&bidTime, date.Date_Full_Layout)
|
|
|
}
|
|
|
- if bInfo["bidendtime"] != nil {
|
|
|
- bidEndTime := bInfo["bidendtime"]
|
|
|
+ if pInfo["bidendtime"] != nil {
|
|
|
+ bidEndTime := pInfo["bidendtime"]
|
|
|
projectInfo["bid_end_time"] = date.FormatDateWithObj(&bidEndTime, date.Date_Full_Layout)
|
|
|
}
|
|
|
if c := IC.BaseMysql.CountBySql(`SELECT COUNT(id) FROM project WHERE id = ?`, id); c > 0 {
|
|
@@ -585,8 +607,9 @@ func ParticipateListSql(in *bxcore.ParticipateListReq) string {
|
|
|
func SingleParticipateList(in *bxcore.ParticipateListReq, conditionSql string) (data *bxcore.ParticipateData, err error) {
|
|
|
defer MC.Catch()
|
|
|
data = &bxcore.ParticipateData{
|
|
|
- Count: 0,
|
|
|
- List: []*bxcore.ParticipateList{},
|
|
|
+ NowTime: time.Now().Unix(),
|
|
|
+ Count: 0,
|
|
|
+ List: []*bxcore.ParticipateList{},
|
|
|
}
|
|
|
//员工|个人列表
|
|
|
singlePersonSql := `SELECT %s FROM ` + ParticipateUserTable + ` pug LEFT JOIN project pt ON pug.project_id = pt.id WHERE pug.position_id = ? `
|
|
@@ -601,15 +624,38 @@ func SingleParticipateList(in *bxcore.ParticipateListReq, conditionSql string) (
|
|
|
list := IC.BaseMysql.SelectBySql(listSql, in.PositionId)
|
|
|
if list != nil && len(*list) > 0 {
|
|
|
for _, v := range *list {
|
|
|
+ bidTimeStr := MC.ObjToString(v["bid_time"])
|
|
|
+ bidEndTimeStr := MC.ObjToString(v["bid_end_time"])
|
|
|
+ bidOpenTimeStr := MC.ObjToString(v["bid_open_time"])
|
|
|
+ updateStatusTimeStr := MC.ObjToString(v["update_date"])
|
|
|
+ var bidTime, bidEndTime, bidOpenTime, updateStatusTime int64
|
|
|
+ if bidTimeStr != "" {
|
|
|
+ bidTime_, _ := time.ParseInLocation(date.Date_Full_Layout, bidTimeStr, time.Local)
|
|
|
+ bidTime = bidTime_.Unix()
|
|
|
+ }
|
|
|
+
|
|
|
+ if bidEndTimeStr != "" {
|
|
|
+ bidEndTime_, _ := time.ParseInLocation(date.Date_Full_Layout, bidEndTimeStr, time.Local)
|
|
|
+ bidEndTime = bidEndTime_.Unix()
|
|
|
+ }
|
|
|
+
|
|
|
+ if bidOpenTimeStr != "" {
|
|
|
+ bidOpenTime_, _ := time.ParseInLocation(date.Date_Full_Layout, bidOpenTimeStr, time.Local)
|
|
|
+ bidOpenTime = bidOpenTime_.Unix()
|
|
|
+ }
|
|
|
+ if updateStatusTimeStr != "" {
|
|
|
+ updateStatusTime_, _ := time.ParseInLocation(date.Date_Full_Layout, updateStatusTimeStr, time.Local)
|
|
|
+ updateStatusTime = updateStatusTime_.Unix()
|
|
|
+ }
|
|
|
data.List = append(data.List, &bxcore.ParticipateList{
|
|
|
Id: encrypt.EncodeArticleId2ByCheck(MC.ObjToString(v["id"])),
|
|
|
ProjectName: MC.ObjToString(v["name"]),
|
|
|
Buyer: MC.ObjToString(v["buyer"]),
|
|
|
Budget: MC.ObjToString(v["budget"]),
|
|
|
- BidTime: MC.ObjToString(v["bid_time"]),
|
|
|
- BidEndTime: MC.ObjToString(v["bid_end_time"]),
|
|
|
- BidOpenTime: MC.ObjToString(v["bid_open_time"]),
|
|
|
- UpdateStatusTime: MC.ObjToString(v["update_date"]),
|
|
|
+ BidTime: bidTime,
|
|
|
+ BidEndTime: bidEndTime,
|
|
|
+ BidOpenTime: bidOpenTime,
|
|
|
+ UpdateStatusTime: updateStatusTime,
|
|
|
UpdateStatusCon: GetParticipateContent("s", in.PositionId, MC.ObjToString(v["id"])), //查询最后一次 投标状态更新,
|
|
|
})
|
|
|
}
|
|
@@ -624,8 +670,9 @@ func SingleParticipateList(in *bxcore.ParticipateListReq, conditionSql string) (
|
|
|
func AdminParticipateList(in *bxcore.ParticipateListReq, conditionSql string) (data *bxcore.ParticipateData, err error) {
|
|
|
defer MC.Catch()
|
|
|
data = &bxcore.ParticipateData{
|
|
|
- Count: 0,
|
|
|
- List: []*bxcore.ParticipateList{},
|
|
|
+ NowTime: time.Now().Unix(),
|
|
|
+ Count: 0,
|
|
|
+ List: []*bxcore.ParticipateList{},
|
|
|
}
|
|
|
adminSql := `SELECT %s FROM (SELECT pu.ent_id, pu.project_id, GROUP_CONCAT(pu.ent_user_id SEPARATOR ',') ent_user_id, MAX(pu.update_date) update_date,MAX(pu.state) state FROM ` + ParticipateUserTable + ` pu WHERE pu.ent_id = ? AND NOT EXISTS ( SELECT 1 FROM ` + ParticipateUserTable + ` WHERE project_id = pu.project_id AND state > pu. state ) GROUP BY pu.project_id ) pug LEFT JOIN project pt ON pug.project_id = pt.id`
|
|
|
adminCountSql := fmt.Sprintf(adminSql, "COUNT(pt.id)") + conditionSql
|
|
@@ -638,15 +685,39 @@ func AdminParticipateList(in *bxcore.ParticipateListReq, conditionSql string) (d
|
|
|
list := IC.BaseMysql.SelectBySql(adminListSql, in.EntId)
|
|
|
if list != nil && len(*list) > 0 {
|
|
|
for _, v := range *list {
|
|
|
+ bidTimeStr := MC.ObjToString(v["bid_time"])
|
|
|
+ bidEndTimeStr := MC.ObjToString(v["bid_end_time"])
|
|
|
+ bidOpenTimeStr := MC.ObjToString(v["bid_open_time"])
|
|
|
+ updateStatusTimeStr := MC.ObjToString(v["update_date"])
|
|
|
+ var bidTime, bidEndTime, bidOpenTime, updateStatusTime int64
|
|
|
+ if bidTimeStr != "" {
|
|
|
+ bidTime_, _ := time.ParseInLocation(date.Date_Full_Layout, bidTimeStr, time.Local)
|
|
|
+ bidTime = bidTime_.Unix()
|
|
|
+ }
|
|
|
+
|
|
|
+ if bidEndTimeStr != "" {
|
|
|
+ bidEndTime_, _ := time.ParseInLocation(date.Date_Full_Layout, bidEndTimeStr, time.Local)
|
|
|
+ bidEndTime = bidEndTime_.Unix()
|
|
|
+ }
|
|
|
+
|
|
|
+ if bidOpenTimeStr != "" {
|
|
|
+ bidOpenTime_, _ := time.ParseInLocation(date.Date_Full_Layout, bidOpenTimeStr, time.Local)
|
|
|
+ bidOpenTime = bidOpenTime_.Unix()
|
|
|
+ }
|
|
|
+ if updateStatusTimeStr != "" {
|
|
|
+ updateStatusTime_, _ := time.ParseInLocation(date.Date_Full_Layout, updateStatusTimeStr, time.Local)
|
|
|
+ updateStatusTime = updateStatusTime_.Unix()
|
|
|
+ }
|
|
|
+
|
|
|
data.List = append(data.List, &bxcore.ParticipateList{
|
|
|
Id: encrypt.EncodeArticleId2ByCheck(MC.ObjToString(v["id"])),
|
|
|
ProjectName: MC.ObjToString(v["name"]),
|
|
|
Buyer: MC.ObjToString(v["buyer"]),
|
|
|
Budget: MC.ObjToString(v["budget"]),
|
|
|
- BidTime: MC.ObjToString(v["bid_time"]),
|
|
|
- BidEndTime: MC.ObjToString(v["bid_end_time"]),
|
|
|
- BidOpenTime: MC.ObjToString(v["bid_open_time"]),
|
|
|
- UpdateStatusTime: MC.ObjToString(v["update_date"]),
|
|
|
+ BidTime: bidTime,
|
|
|
+ BidEndTime: bidEndTime,
|
|
|
+ BidOpenTime: bidOpenTime,
|
|
|
+ UpdateStatusTime: updateStatusTime,
|
|
|
UpdateStatusCon: GetParticipateContent("e", in.EntId, MC.ObjToString(v["id"])), //查询最后一次 投标状态更新
|
|
|
Participants: GetParticipateUserName(MC.ObjToString(v["ent_user_id"])), //参标人信息
|
|
|
})
|
|
@@ -828,7 +899,55 @@ func ParticipateProjectEnt(entId int64, projectId []string) *[]map[string]interf
|
|
|
value = append(value, projectId[i])
|
|
|
}
|
|
|
argStr := strings.Join(arg, ",")
|
|
|
- query := "select GROUP_CONCAT(ent_user_id) as personIds ,project_id from " + EntnicheUserTable + " where ent_id=? and project_id in (%s) and state=0 group by project_id "
|
|
|
+ query := "select GROUP_CONCAT(ent_user_id) as personIds ,project_id from " + ParticipateUserTable + " where ent_id=? and project_id in (%s) and state=0 group by project_id "
|
|
|
rs := IC.BaseMysql.SelectBySql(fmt.Sprintf(query, argStr), value...)
|
|
|
return rs
|
|
|
}
|
|
|
+
|
|
|
+//查询企业人员信息
|
|
|
+func GetPersonInfo(entId, entUserId int64, participateMap map[int64]bool) []*bxcore.ParticipatePerson {
|
|
|
+ r := IC.MainMysql.SelectBySql(`SELECT a.id,a.pid,a.name,c.id as user_id,c.name as user_name,c.phone as user_phone,c.power as user_power,e.name as role from entniche_department a
|
|
|
+ INNER JOIN entniche_department_user b on (a.ent_id=? and a.id=b.dept_id)
|
|
|
+ INNER JOIN entniche_user c on (b.user_id=c.id)
|
|
|
+ LEFT JOIN entniche_user_role d on (c.id=d.user_id)
|
|
|
+ LEFT JOIN entniche_role e on (d.role_id=e.id)
|
|
|
+ order by a.id,convert(c.name using gbk) COLLATE gbk_chinese_ci asc`, entId)
|
|
|
+ var (
|
|
|
+ list []*bxcore.ParticipatePerson
|
|
|
+ prevId int64 = 0
|
|
|
+ )
|
|
|
+ for _, v := range *r {
|
|
|
+ if entUserId == MC.Int64All(v["user_id"]) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ id := MC.Int64All(v["id"])
|
|
|
+ userId := strconv.FormatInt(MC.Int64All(v["user_id"]), 10)
|
|
|
+ user := &bxcore.ParticipatePerson{
|
|
|
+ Id: encrypt.SE.Encode2HexByCheck(userId),
|
|
|
+ Power: MC.Int64All(v["user_power"]),
|
|
|
+ Name: MC.ObjToString(v["user_name"]),
|
|
|
+ Phone: MC.ObjToString(v["user_phone"]),
|
|
|
+ Role: MC.ObjToString(v["role"]),
|
|
|
+ }
|
|
|
+ if participateMap != nil {
|
|
|
+ if participateMap[MC.Int64All(v["user_id"])] {
|
|
|
+ user.IsPart = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if prevId == id {
|
|
|
+ users := list[len(list)-1].Users
|
|
|
+ users = append(users, user)
|
|
|
+ list[len(list)-1].Users = users
|
|
|
+ } else {
|
|
|
+ seId := strconv.FormatInt(id, 10)
|
|
|
+ list = append(list, &bxcore.ParticipatePerson{
|
|
|
+ Id: encrypt.SE.Encode2HexByCheck(seId),
|
|
|
+ Name: MC.ObjToString(v["name"]),
|
|
|
+ Pid: MC.Int64All(v["pid"]),
|
|
|
+ Users: []*bxcore.ParticipatePerson{user},
|
|
|
+ })
|
|
|
+ }
|
|
|
+ prevId = id
|
|
|
+ }
|
|
|
+ return list
|
|
|
+}
|