作者 yangfu
@@ -66,8 +66,8 @@ func (cooperationModeService *CooperationModeService) ListCooperationMode(listCo @@ -66,8 +66,8 @@ func (cooperationModeService *CooperationModeService) ListCooperationMode(listCo
66 OrganizationName: listCooperationModeQuery.OrganizationName, 66 OrganizationName: listCooperationModeQuery.OrganizationName,
67 CompanyId: listCooperationModeQuery.Operator.CompanyId, 67 CompanyId: listCooperationModeQuery.Operator.CompanyId,
68 UserId: 0, 68 UserId: 0,
69 - OrgIds: nil,  
70 - OrgId: listCooperationModeQuery.Operator.OrgId, 69 + OrgIds: listCooperationModeQuery.Operator.OrgIds,
  70 + OrgId: 0,
71 UserBaseId: 0, 71 UserBaseId: 0,
72 }) 72 })
73 if err != nil { 73 if err != nil {
@@ -138,3 +138,39 @@ func NewCooperationModeService(options map[string]interface{}) *CooperationModeS @@ -138,3 +138,39 @@ func NewCooperationModeService(options map[string]interface{}) *CooperationModeS
138 newCooperationModeService := &CooperationModeService{} 138 newCooperationModeService := &CooperationModeService{}
139 return newCooperationModeService 139 return newCooperationModeService
140 } 140 }
  141 +
  142 +//CooperationModeSelector 返回共创模式可选列表
  143 +func (cooperationModeService *CooperationModeService) CooperationModeSelector(listCooperationModeQuery *query.ListCooperationModeQuery) (int64, interface{}, error) {
  144 +
  145 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationModeQuery.Operator)
  146 + result, err := creationCooperationGateway.CooperationModesSearch(allied_creation_cooperation.ReqCooperationModesSearch{
  147 + PageNumber: listCooperationModeQuery.PageNumber,
  148 + PageSize: listCooperationModeQuery.PageSize,
  149 + CooperationModeName: listCooperationModeQuery.CooperationModeName,
  150 + OrganizationName: listCooperationModeQuery.OrganizationName,
  151 + CompanyId: listCooperationModeQuery.Operator.CompanyId,
  152 + UserId: 0,
  153 + OrgIds: nil,
  154 + OrgId: listCooperationModeQuery.Operator.OrgId,
  155 + UserBaseId: 0,
  156 + })
  157 + if err != nil {
  158 + return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  159 + }
  160 + var (
  161 + listData = make([]dto.CooperationModeItem, 0)
  162 + item dto.CooperationModeItem
  163 + )
  164 + for _, v := range result.List {
  165 + item = dto.CooperationModeItem{
  166 + CooperationModeId: v.CooperationModeId,
  167 + CooperationModeName: v.CooperationModeName,
  168 + Remarks: v.Remarks,
  169 + Status: v.Status,
  170 + CooperationModeNumber: v.CooperationModeNumber,
  171 + Org: v.Org,
  172 + }
  173 + listData = append(listData, item)
  174 + }
  175 + return int64(result.Total), listData, nil
  176 +}
@@ -92,7 +92,7 @@ func (controller *CooperationModeController) ListCooperationMode() { @@ -92,7 +92,7 @@ func (controller *CooperationModeController) ListCooperationMode() {
92 listCooperationModeQuery.Operator = controller.GetOperator() 92 listCooperationModeQuery.Operator = controller.GetOperator()
93 listCooperationModeQuery.PageNumber = 1 93 listCooperationModeQuery.PageNumber = 1
94 listCooperationModeQuery.PageSize = 999 94 listCooperationModeQuery.PageSize = 999
95 - cnt, data, err := cooperationModeService.ListCooperationMode(listCooperationModeQuery) 95 + cnt, data, err := cooperationModeService.CooperationModeSelector(listCooperationModeQuery)
96 controller.ReturnListData(cnt, data, err) 96 controller.ReturnListData(cnt, data, err)
97 } 97 }
98 98
@@ -12,5 +12,5 @@ func init() { @@ -12,5 +12,5 @@ func init() {
12 web.Router("/v1/web/cooperation-modes/remove", &web_client.CooperationModeController{}, "Post:RemoveCooperationMode") 12 web.Router("/v1/web/cooperation-modes/remove", &web_client.CooperationModeController{}, "Post:RemoveCooperationMode")
13 web.Router("/v1/web/cooperation-modes/search", &web_client.CooperationModeController{}, "Post:SearchCooperationMode") 13 web.Router("/v1/web/cooperation-modes/search", &web_client.CooperationModeController{}, "Post:SearchCooperationMode")
14 web.Router("/v1/web/cooperation-modes/enable", &web_client.CooperationModeController{}, "Put:EnableCooperationMode") 14 web.Router("/v1/web/cooperation-modes/enable", &web_client.CooperationModeController{}, "Put:EnableCooperationMode")
15 - web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Get:ListCooperationMode") 15 + web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Get:ListCooperationMode") //下拉选择
16 } 16 }