切换导航条
此项目
正在载入...
登录
allied-creation
/
allied-creation-gateway
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
yangfu
4 years ago
提交
5a8530af2cf57f076df52f195b9c224f0d02fb54
1 个父辈
b751930f
共创项目修改
显示空白字符变更
内嵌
并排对比
正在显示
15 个修改的文件
包含
146 行增加
和
37 行删除
pkg/application/mobile/cooperation/command/ca_audit_cooperation_application.go
pkg/application/mobile/cooperation/command/cp_update_cooperation_project.go
pkg/application/mobile/cooperation/service/cooperation_applications.go
pkg/application/mobile/cooperation/service/cooperation_projects.go
pkg/application/mobile/org/dto/department_users_dto.go
pkg/application/web/cooperationApplication/service/cooperation_application.go
pkg/application/web/cooperationProject/command/create_cooperation_project.go
pkg/application/web/orgs/dto/department_users_dto.go
pkg/domain/attachment.go
pkg/infrastructure/service_gateway/allied_creation_cooperation/module_cooperation_application.go
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_contract_undertaker_feedback.go
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_application.go
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_project.go
pkg/port/beego/controllers/base_controller.go
pkg/port/beego/controllers/mobile_client/cooperation_controller.go
pkg/application/mobile/cooperation/command/ca_audit_cooperation_application.go
查看文件 @
5a8530a
...
...
@@ -11,7 +11,7 @@ type AuditCooperationApplicationCommand struct {
//操作人
Operator
domain
.
Operator
`json:"-"`
// 共创申请ID
CooperationApplicationId
[]
int
`json:"cooperationApplicationId" valid:"Required"`
CooperationApplicationId
int
`json:"cooperationApplicationId" valid:"Required"`
// 审核动作,1同意,2拒绝
CooperationApplicationStatus
int
`json:"cooperationApplicationStatus" valid:"Required"`
// 共创申请审核描述
...
...
pkg/application/mobile/cooperation/command/cp_update_cooperation_project.go
查看文件 @
5a8530a
...
...
@@ -25,7 +25,9 @@ type UpdateCooperationProjectCommand struct {
// 共创项目描述
CooperationProjectDescription
string
`json:"cooperationProjectDescription" valid:"Required"`
//图片
Images
[]
string
`json:"images"`
//Images []string `json:"images"`
// 附件列表
Attachment
[]
domain
.
Attachment
`json:"attachment"`
}
func
(
updateCooperationProjectCommand
*
UpdateCooperationProjectCommand
)
Valid
(
validation
*
validation
.
Validation
)
{
...
...
pkg/application/mobile/cooperation/service/cooperation_applications.go
查看文件 @
5a8530a
...
...
@@ -24,16 +24,23 @@ func (srv CooperationApplicationsService) GetCooperationApplications(application
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
//resultProject, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
// CooperationProjectId: resultApplication.CooperationProject.CooperationProjectID,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
resultProject
,
err
:=
creationCooperationGateway
.
CooperationProjectGet
(
allied_creation_cooperation
.
ReqCooperationProjectGet
{
CooperationProjectId
:
resultApplication
.
CooperationProject
.
CooperationProjectID
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
//data := map[string]interface{}{
// "cooperationApplication": dto.ToCooperationApplication(&resultApplication.CooperationApplication),
// "cooperationProject": dto.ToCooperationProjectInfo(&resultProject.CooperationProject),
//}
resultApplication
.
CooperationProject
.
CooperationMode
.
CooperationModeNumber
=
resultProject
.
CooperationMode
.
CooperationModeNumber
resultApplication
.
CooperationProject
.
CooperationMode
.
CooperationModeName
=
resultProject
.
CooperationMode
.
CooperationModeName
resultApplication
.
CooperationProject
.
CooperationMode
.
CooperationModeId
=
resultProject
.
CooperationMode
.
CooperationModeId
return
resultApplication
,
nil
}
...
...
@@ -41,15 +48,16 @@ func (srv CooperationApplicationsService) GetCooperationApplications(application
func
(
srv
CooperationApplicationsService
)
AuditCooperationApplications
(
auditCommand
*
command
.
AuditCooperationApplicationCommand
)
(
interface
{},
error
)
{
creationCooperationGateway
:=
allied_creation_cooperation
.
NewHttplibAlliedCreationCooperation
(
auditCommand
.
Operator
)
applicationIds
:=
[]
string
{}
for
_
,
v
:=
range
auditCommand
.
CooperationApplicationId
{
idStr
:=
strconv
.
Itoa
(
v
)
applicationIds
=
append
(
applicationIds
,
idStr
)
}
_
,
err
:=
creationCooperationGateway
.
CooperationApplicationsBatchApproval
(
allied_creation_cooperation
.
ReqCooperationApplicationBatchApproval
{
CooperationApplicationIds
:
applicationIds
,
//applicationIds := []string{strconv.Itoa(auditCommand.CooperationApplicationId)}
//for _, v := range auditCommand.CooperationApplicationId {
// idStr := strconv.Itoa(v)
// applicationIds = append(applicationIds, idStr)
//}
_
,
err
:=
creationCooperationGateway
.
CooperationApplicationsApproval
(
allied_creation_cooperation
.
ReqCooperationApplicationApproval
{
CooperationApplicationId
:
strconv
.
Itoa
(
auditCommand
.
CooperationApplicationId
),
CooperationApplicationDescription
:
auditCommand
.
CooperationApplicationVerifyDescription
,
Action
:
auditCommand
.
CooperationApplicationStatus
,
Code
:
"a1-2"
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
...
...
pkg/application/mobile/cooperation/service/cooperation_projects.go
查看文件 @
5a8530a
...
...
@@ -6,7 +6,6 @@ import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
...
...
@@ -66,12 +65,12 @@ func (srv CooperationProjectService) GetCooperationProject(projectQuery *command
// UpdateCooperationProject 更新项目
func
(
srv
CooperationProjectService
)
UpdateCooperationProject
(
updateCooperationProjectCommand
*
command
.
UpdateCooperationProjectCommand
)
(
interface
{},
error
)
{
creationCooperationGateway
:=
allied_creation_cooperation
.
NewHttplibAlliedCreationCooperation
(
updateCooperationProjectCommand
.
Operator
)
var
images
[]
domain
.
Attachment
for
_
,
v
:=
range
updateCooperationProjectCommand
.
Images
{
images
=
append
(
images
,
domain
.
Attachment
{
Url
:
v
,
})
}
//var images []domain.Attachment
//for _, v := range updateCooperationProjectCommand.Images {
// images = append(images, domain.Attachment{
// Url: v,
// })
//}
_
,
err
:=
creationCooperationGateway
.
CooperationProjectUpdate
(
allied_creation_cooperation
.
ReqCooperationProjectUpdate
{
CooperationProjectId
:
updateCooperationProjectCommand
.
CooperationProjectId
,
CooperationProjectName
:
updateCooperationProjectCommand
.
CooperationProjectName
,
...
...
@@ -80,7 +79,7 @@ func (srv CooperationProjectService) UpdateCooperationProject(updateCooperationP
SponsorUid
:
strconv
.
Itoa
(
int
(
updateCooperationProjectCommand
.
CooperationProjectSponsor
)),
PublisherUid
:
strconv
.
Itoa
(
int
(
updateCooperationProjectCommand
.
Operator
.
UserId
)),
CooperationProjectDescription
:
updateCooperationProjectCommand
.
CooperationProjectDescription
,
Attachment
:
images
,
Attachment
:
updateCooperationProjectCommand
.
Attachment
,
OrgId
:
updateCooperationProjectCommand
.
OrgId
,
})
if
err
!=
nil
{
...
...
pkg/application/mobile/org/dto/department_users_dto.go
查看文件 @
5a8530a
...
...
@@ -14,6 +14,7 @@ type Department struct {
}
type
User
struct
{
UserID
int
`json:"userId"`
UserCode
string
`json:"userCode"`
UserInfo
map
[
string
]
interface
{}
`json:"userInfo"`
}
...
...
@@ -30,6 +31,10 @@ func (dto *DepartmentUsersDto) LoadDto(dataType int, subDepartment *allied_creat
return
nil
}
var
mapDepartment
=
make
(
map
[
int64
]
*
Department
)
mapDepartment
[
-
1
]
=
&
Department
{
DepartmentID
:
-
1
,
DepartmentName
:
"共创部门"
,
}
for
i
:=
range
subDepartment
.
Orgs
{
org
:=
subDepartment
.
Orgs
[
i
]
...
...
@@ -44,16 +49,20 @@ func (dto *DepartmentUsersDto) LoadDto(dataType int, subDepartment *allied_creat
for
i
:=
range
userSearch
.
Users
{
user
:=
userSearch
.
Users
[
i
]
if
user
.
Department
==
nil
{
continue
}
if
v
,
ok
:=
mapDepartment
[
int64
(
user
.
Department
.
DepartmentId
)];
ok
{
v
.
Users
=
append
(
v
.
Users
,
User
{
u
:=
User
{
UserID
:
user
.
UserId
,
UserCode
:
user
.
UserCode
,
UserInfo
:
map
[
string
]
interface
{}{
"userName"
:
user
.
UserInfo
.
UserName
,
"phone"
:
user
.
UserInfo
.
Phone
,
},
})
}
if
user
.
Department
==
nil
{
mapDepartment
[
-
1
]
.
Users
=
append
(
mapDepartment
[
-
1
]
.
Users
,
u
)
continue
}
if
v
,
ok
:=
mapDepartment
[
int64
(
user
.
Department
.
DepartmentId
)];
ok
{
v
.
Users
=
append
(
v
.
Users
,
u
)
}
}
return
nil
...
...
pkg/application/web/cooperationApplication/service/cooperation_application.go
查看文件 @
5a8530a
...
...
@@ -76,7 +76,7 @@ func (cooperationApplicationService *CooperationApplicationService) ListCooperat
// item := dto.ToCooperationApplicationItem(&result.Grid.List[i])
// dataList = append(dataList, *item)
//}
return
int64
(
result
.
Grid
.
Total
),
result
.
Grid
,
nil
return
int64
(
result
.
Grid
.
Total
),
result
.
Grid
.
List
,
nil
}
func
NewCooperationApplicationService
(
options
map
[
string
]
interface
{})
*
CooperationApplicationService
{
...
...
pkg/application/web/cooperationProject/command/create_cooperation_project.go
查看文件 @
5a8530a
...
...
@@ -13,13 +13,13 @@ type CreateCooperationProjectCommand struct {
// 模式编码,唯一确定
CooperationModeNumber
string
`json:"cooperationModeNumber" valid:"Required"`
// 发起组织ID
OrgId
int64
`json:"departmentId"
valid:"Required"
`
OrgId
int64
`json:"departmentId"`
// 共创项目名称
CooperationProjectName
string
`json:"cooperationProjectName" valid:"Required"`
// 共创发起人id
CooperationProjectSponsor
int
`json:"cooperationProjectSponsor,string,"`
// 项目承接对象
CooperationProjectUndertakerType
[]
int
`json:"cooperationProjectUndertakerType"`
CooperationProjectUndertakerType
[]
int
`json:"cooperationProjectUndertakerType
s
"`
// 共创项目描述
CooperationProjectDescription
string
`json:"cooperationProjectDescription" valid:"Required"`
//图片
...
...
pkg/application/web/orgs/dto/department_users_dto.go
查看文件 @
5a8530a
...
...
@@ -13,6 +13,7 @@ type Department struct {
}
type
User
struct
{
UserID
int
`json:"userId,string"`
UserCode
string
`json:"userCode"`
UserInfo
map
[
string
]
interface
{}
`json:"userInfo"`
}
...
...
@@ -38,8 +39,10 @@ func (dto *DepartmentUsersDto) LoadDto(subDepartment *allied_creation_user.DataO
if
v
,
ok
:=
mapDepartment
[
int64
(
user
.
Department
.
DepartmentId
)];
ok
{
v
.
Users
=
append
(
v
.
Users
,
User
{
UserID
:
user
.
UserId
,
UserCode
:
user
.
UserCode
,
UserInfo
:
map
[
string
]
interface
{}{
"userName"
:
user
.
UserInfo
.
UserName
,
"phone"
:
user
.
UserInfo
.
Phone
,
},
})
}
...
...
pkg/domain/attachment.go
查看文件 @
5a8530a
...
...
@@ -9,5 +9,5 @@ type Attachment struct {
// 附件地址
Url
string
`json:"url"`
// 附件文件大小
FileSize
int64
`json:"fileSize
,string
"`
FileSize
int64
`json:"fileSize"`
}
...
...
pkg/infrastructure/service_gateway/allied_creation_cooperation/module_cooperation_application.go
查看文件 @
5a8530a
...
...
@@ -72,6 +72,37 @@ func (gateway HttplibAlliedCreationCooperation) CooperationApplicationsBatchAppr
return
&
data
,
err
}
// CooperationApplicationsBatchApproval 共创申请审核
func
(
gateway
HttplibAlliedCreationCooperation
)
CooperationApplicationsApproval
(
param
ReqCooperationApplicationApproval
)
(
*
DataCooperationApplicationApproval
,
error
)
{
url
:=
gateway
.
baseUrL
+
"/cooperation-applications/agree-cooperation-application"
method
:=
"POST"
req
:=
gateway
.
CreateRequest
(
url
,
method
)
log
.
Logger
.
Debug
(
"向业务模块请求数据:共创申请批量审核。"
,
map
[
string
]
interface
{}{
"api"
:
method
+
":"
+
url
,
"param"
:
param
,
})
req
,
err
:=
req
.
JSONBody
(
param
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"请求共创申请批量审核失败:%w"
,
err
)
}
byteResult
,
err
:=
req
.
Bytes
()
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"获取共创申请批量审核失败:%w"
,
err
)
}
log
.
Logger
.
Debug
(
"获取业务模块请求数据:共创申请批量审核。"
,
map
[
string
]
interface
{}{
"result"
:
string
(
byteResult
),
})
var
result
service_gateway
.
GatewayResponse
err
=
json
.
Unmarshal
(
byteResult
,
&
result
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"解析共创申请批量审核:%w"
,
err
)
}
var
data
DataCooperationApplicationApproval
err
=
gateway
.
GetResponseData
(
result
,
&
data
)
return
&
data
,
err
}
// CooperationApplicationCancel 取消共创申请
func
(
gateway
HttplibAlliedCreationCooperation
)
CooperationApplicationCancel
(
param
ReqCooperationApplicationCancel
)
(
*
DataCooperationApplicationCancel
,
error
)
{
url
:=
gateway
.
baseUrL
+
"/cooperation-applications/"
+
strconv
.
Itoa
(
param
.
ApplicationId
)
+
"/cancel-application"
...
...
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_contract_undertaker_feedback.go
查看文件 @
5a8530a
package
allied_creation_cooperation
import
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
import
(
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/util/jtime"
)
//创建共创合约反馈信息
type
(
...
...
@@ -51,7 +54,15 @@ type (
Company
interface
{}
`json:"company"`
//UpdatedAt time.Time `json:"updatedAt"`
//DeletedAt time.Time `json:"deletedAt"`
//CreatedAt time.Time `json:"createdAt"`
CreatedAt
jtime
.
TimeToUnixMsec
`json:"createdAt"`
CooperationMode
struct
{
// 共创模式ID
CooperationModeId
int
`json:"cooperationModeId,string"`
// 共创模式编码,唯一确定
CooperationModeNumber
string
`json:"cooperationModeNumber"`
// 模式名称,唯一确定
CooperationModeName
string
`json:"cooperationModeName"`
}
`json:"cooperationMode"`
}
`json:"list"`
Total
int
`json:"total"`
}
`json:"grid"`
...
...
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_application.go
查看文件 @
5a8530a
...
...
@@ -38,11 +38,19 @@ type CooperationApplication struct {
CooperationProjectNumber
string
`json:"cooperationProjectNumber"`
CooperationProjectDescription
string
`json:"cooperationProjectDescription"`
CooperationProjectName
string
`json:"cooperationProjectName"`
CooperationMode
struct
{
// 共创模式ID
CooperationModeId
int
`json:"cooperationModeId,string"`
// 共创模式编码,唯一确定
CooperationModeNumber
string
`json:"cooperationModeNumber"`
// 模式名称,唯一确定
CooperationModeName
string
`json:"cooperationModeName"`
}
`json:"cooperationMode"`
Attachment
[]
struct
{
FileType
string
`json:"fileType"`
Name
string
`json:"name"`
URL
string
`json:"url"`
FileSize
string
`json:"fileSize"`
FileSize
int64
`json:"fileSize"`
}
`json:"attachment"`
}
`json:"cooperationProject"`
Org
struct
{
...
...
@@ -79,6 +87,19 @@ type (
}
)
//共创申请批量审核
type
(
ReqCooperationApplicationApproval
struct
{
CooperationApplicationId
string
`json:"cooperationApplicationId"`
CooperationApplicationDescription
string
`json:"cooperationApplicationDescription"`
//描述
Action
int
`json:"action"`
//审核动作,1同意,2拒绝
Code
string
`cname:"菜单编码" json:"code" valid:"Required"`
}
DataCooperationApplicationApproval
struct
{
}
)
//取消共创申请
type
(
ReqCooperationApplicationCancel
struct
{
...
...
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_project.go
查看文件 @
5a8530a
...
...
@@ -108,7 +108,7 @@ type (
CooperationProjectName
string
`json:"cooperationProjectName"`
CooperationModeNumber
string
`json:"cooperationModeNumber"`
// 承接对象,1员工,2共创用户,3公开,可以多选
CooperationProjectUndertakerType
[]
int32
`json:"cooperationProjectUndertakerType"`
CooperationProjectUndertakerType
[]
int32
`json:"cooperationProjectUndertakerType
s
"`
// 共创项目发起人uid
SponsorUid
string
`json:"sponsorUid"`
// 共创项目发布人uid
...
...
pkg/port/beego/controllers/base_controller.go
查看文件 @
5a8530a
package
controllers
import
(
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/utils/json"
"github.com/linmadan/egglib-go/web/beego"
"github.com/linmadan/egglib-go/web/beego/utils"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
...
...
@@ -31,6 +33,28 @@ func (controller *BaseController) ReturnListData(count int64, data interface{},
controller
.
Response
(
dataMap
,
err
)
}
func
(
controller
*
BaseController
)
Response
(
data
interface
{},
err
error
)
{
var
response
utils
.
JsonResponse
if
err
!=
nil
{
if
_
,
ok
:=
err
.
(
*
application
.
ServiceError
);
!
ok
{
controller
.
Data
[
"json"
]
=
map
[
string
]
interface
{}{
"code"
:
1
,
"msg"
:
err
.
Error
(),
}
log
.
Logger
.
Error
(
err
.
Error
())
controller
.
ServeJSON
()
return
}
}
if
err
!=
nil
{
response
=
utils
.
ResponseError
(
controller
.
Ctx
,
err
)
}
else
{
response
=
utils
.
ResponseData
(
controller
.
Ctx
,
data
)
}
controller
.
Data
[
"json"
]
=
response
controller
.
ServeJSON
()
}
func
(
controller
*
BaseController
)
GetUserId
()
int64
{
return
1
}
...
...
pkg/port/beego/controllers/mobile_client/cooperation_controller.go
查看文件 @
5a8530a
...
...
@@ -50,6 +50,7 @@ func (controller *CooperationController) GetCooperationApplication() {
return
}
cmd
.
Operator
=
controller
.
GetOperator
()
cmd
.
CooperationApplicationId
,
_
=
controller
.
GetInt64
(
":applicationId"
)
data
,
err
:=
svr
.
GetCooperationApplications
(
cmd
)
controller
.
Response
(
data
,
err
)
}
...
...
请
注册
或
登录
后发表评论