作者 yangfu
... ... @@ -66,8 +66,8 @@ func (cooperationModeService *CooperationModeService) ListCooperationMode(listCo
OrganizationName: listCooperationModeQuery.OrganizationName,
CompanyId: listCooperationModeQuery.Operator.CompanyId,
UserId: 0,
OrgIds: nil,
OrgId: listCooperationModeQuery.Operator.OrgId,
OrgIds: listCooperationModeQuery.Operator.OrgIds,
OrgId: 0,
UserBaseId: 0,
})
if err != nil {
... ... @@ -138,3 +138,39 @@ func NewCooperationModeService(options map[string]interface{}) *CooperationModeS
newCooperationModeService := &CooperationModeService{}
return newCooperationModeService
}
//CooperationModeSelector 返回共创模式可选列表
func (cooperationModeService *CooperationModeService) CooperationModeSelector(listCooperationModeQuery *query.ListCooperationModeQuery) (int64, interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationModeQuery.Operator)
result, err := creationCooperationGateway.CooperationModesSearch(allied_creation_cooperation.ReqCooperationModesSearch{
PageNumber: listCooperationModeQuery.PageNumber,
PageSize: listCooperationModeQuery.PageSize,
CooperationModeName: listCooperationModeQuery.CooperationModeName,
OrganizationName: listCooperationModeQuery.OrganizationName,
CompanyId: listCooperationModeQuery.Operator.CompanyId,
UserId: 0,
OrgIds: nil,
OrgId: listCooperationModeQuery.Operator.OrgId,
UserBaseId: 0,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
var (
listData = make([]dto.CooperationModeItem, 0)
item dto.CooperationModeItem
)
for _, v := range result.List {
item = dto.CooperationModeItem{
CooperationModeId: v.CooperationModeId,
CooperationModeName: v.CooperationModeName,
Remarks: v.Remarks,
Status: v.Status,
CooperationModeNumber: v.CooperationModeNumber,
Org: v.Org,
}
listData = append(listData, item)
}
return int64(result.Total), listData, nil
}
... ...
... ... @@ -92,7 +92,7 @@ func (controller *CooperationModeController) ListCooperationMode() {
listCooperationModeQuery.Operator = controller.GetOperator()
listCooperationModeQuery.PageNumber = 1
listCooperationModeQuery.PageSize = 999
cnt, data, err := cooperationModeService.ListCooperationMode(listCooperationModeQuery)
cnt, data, err := cooperationModeService.CooperationModeSelector(listCooperationModeQuery)
controller.ReturnListData(cnt, data, err)
}
... ...
... ... @@ -12,5 +12,5 @@ func init() {
web.Router("/v1/web/cooperation-modes/remove", &web_client.CooperationModeController{}, "Post:RemoveCooperationMode")
web.Router("/v1/web/cooperation-modes/search", &web_client.CooperationModeController{}, "Post:SearchCooperationMode")
web.Router("/v1/web/cooperation-modes/enable", &web_client.CooperationModeController{}, "Put:EnableCooperationMode")
web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Get:ListCooperationMode")
web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Get:ListCooperationMode") //下拉选择
}
... ...