|
@@ -3,7 +3,6 @@ package logic
|
|
import (
|
|
import (
|
|
"app.yhyue.com/moapp/jybase/common"
|
|
"app.yhyue.com/moapp/jybase/common"
|
|
"context"
|
|
"context"
|
|
- "fmt"
|
|
|
|
IC "jyBXCore/rpc/init"
|
|
IC "jyBXCore/rpc/init"
|
|
"jyBXCore/rpc/model/es"
|
|
"jyBXCore/rpc/model/es"
|
|
"jyBXCore/rpc/service"
|
|
"jyBXCore/rpc/service"
|
|
@@ -31,34 +30,41 @@ func NewParticipateContentLogic(ctx context.Context, svcCtx *svc.ServiceContext)
|
|
// 获取投标状态信息
|
|
// 获取投标状态信息
|
|
func (l *ParticipateContentLogic) ParticipateContent(in *bxcore.ParticipateContentReq) (*bxcore.ParticipateContentRes, error) {
|
|
func (l *ParticipateContentLogic) ParticipateContent(in *bxcore.ParticipateContentReq) (*bxcore.ParticipateContentRes, error) {
|
|
// 验证权限
|
|
// 验证权限
|
|
- result := &bxcore.ParticipateContentRes{}
|
|
|
|
|
|
+ result := &bxcore.ParticipateContentRes{
|
|
|
|
+ ErrCode: -1,
|
|
|
|
+ }
|
|
// 1. 判断身份是否有权限 不是超级订阅也不是大会员 则直接返回不展示
|
|
// 1. 判断身份是否有权限 不是超级订阅也不是大会员 则直接返回不展示
|
|
userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
|
|
userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
|
|
// 不是超级订阅 也不是大会员
|
|
// 不是超级订阅 也不是大会员
|
|
if userInfo.Vip.Status <= 0 && userInfo.Member.Status <= 0 {
|
|
if userInfo.Vip.Status <= 0 && userInfo.Member.Status <= 0 {
|
|
- return result, fmt.Errorf("没权限")
|
|
|
|
|
|
+ result.ErrMsg = "没有权限"
|
|
|
|
+ return result, nil
|
|
}
|
|
}
|
|
participateService := service.NewParticipateBid(in.EntId, in.EntUserId, in.PositionType, in.PositionId)
|
|
participateService := service.NewParticipateBid(in.EntId, in.EntUserId, in.PositionType, in.PositionId)
|
|
participateService.EntRoleId = userInfo.Ent.EntRoleId
|
|
participateService.EntRoleId = userInfo.Ent.EntRoleId
|
|
// 信息id解密
|
|
// 信息id解密
|
|
infoList, _ := service.DecodeId(in.Sid)
|
|
infoList, _ := service.DecodeId(in.Sid)
|
|
if len(infoList) == 0 {
|
|
if len(infoList) == 0 {
|
|
- return result, fmt.Errorf("信息id无效")
|
|
|
|
|
|
+ result.ErrMsg = "信息id无效"
|
|
|
|
+ return result, nil
|
|
}
|
|
}
|
|
// 根据标讯id 查询项目信息
|
|
// 根据标讯id 查询项目信息
|
|
projectInfos := es.GetProjectByInfoId(infoList)
|
|
projectInfos := es.GetProjectByInfoId(infoList)
|
|
if projectInfos == nil || len(*projectInfos) == 0 {
|
|
if projectInfos == nil || len(*projectInfos) == 0 {
|
|
- return result, fmt.Errorf("无效的信息id")
|
|
|
|
|
|
+ result.ErrMsg = "未查询到项目信息"
|
|
|
|
+ return result, nil
|
|
}
|
|
}
|
|
// 验证身份
|
|
// 验证身份
|
|
projectId := common.ObjToString((*projectInfos)[0]["_id"])
|
|
projectId := common.ObjToString((*projectInfos)[0]["_id"])
|
|
if !participateService.CheckBidPower(projectId, false) {
|
|
if !participateService.CheckBidPower(projectId, false) {
|
|
- return result, fmt.Errorf("没有权限")
|
|
|
|
|
|
+ result.ErrMsg = "没有查看权限"
|
|
|
|
+ return result, nil
|
|
}
|
|
}
|
|
// 查询
|
|
// 查询
|
|
data := participateService.GetLastBidStatus(projectId)
|
|
data := participateService.GetLastBidStatus(projectId)
|
|
formatData := participateService.ParticipateContentFormat(data)
|
|
formatData := participateService.ParticipateContentFormat(data)
|
|
return &bxcore.ParticipateContentRes{
|
|
return &bxcore.ParticipateContentRes{
|
|
- Data: &formatData,
|
|
|
|
|
|
+ ErrCode: 0,
|
|
|
|
+ Data: &formatData,
|
|
}, nil
|
|
}, nil
|
|
}
|
|
}
|