切换导航条
此项目
正在载入...
登录
allied-creation
/
allied-creation-gateway
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
yangfu
3 years ago
提交
4df346d5f23a3f5b5f23ba328da56fd6d1e1551c
1 个父辈
edde724d
test
...
dev
dev_liujunxiong
feature_sign_up
master
master20211012
master20211013
master20211108
master20211123
master20211216
master20211221
v1.1.1
用户导入修改
隐藏空白字符变更
内嵌
并排对比
正在显示
8 个修改的文件
包含
86 行增加
和
21 行删除
pkg/application/mobile/cooperation/service/cooperation_projects.go
pkg/application/mobile/cooperation/service/statistics_person.go
pkg/application/web/excelData/command/import_data_command.go
pkg/application/web/excelData/service/service.go
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_project.go
pkg/infrastructure/service_gateway/allied_creation_user/module_user.go
pkg/infrastructure/service_gateway/allied_creation_user/param_user.go
pkg/port/beego/controllers/mobile_client/cooperation_controller.go
pkg/application/mobile/cooperation/service/cooperation_projects.go
查看文件 @
4df346d
...
...
@@ -119,3 +119,22 @@ func (srv CooperationProjectService) PersonSearchCooperationProject(projectQuery
}
return
int
(
result
.
Total
),
result
.
List
,
nil
}
// PersonSearchCooperationProject 共创用户获取共创项目列表
//func (srv CooperationProjectService) PersonRecommendCooperationProject(projectQuery *command.PersonSearchCooperationProjectQuery) (int, interface{}, error) {
// creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// projectQuery.Operator)
// //orgidStr := strconv.Itoa(projectQuery.OrgId)
// result, err := creationCooperationGateway.CooperationProjectsSearch(allied_creation_cooperation.ReqCooperationProjectSearch{
// PageNumber: projectQuery.PageNumber + 1, //手机序号从0开始的
// PageSize: projectQuery.PageSize,
// OrgId: projectQuery.OrgId,
// Status: 1, //搜索状态为“招标中”项目
// Keyword: projectQuery.Keyword,
// //UserBaseId: projectQuery.Operator.UserBaseId,
// })
// if err != nil {
// return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
// }
// return int(result.Total), result.List, nil
//}
...
...
pkg/application/mobile/cooperation/service/statistics_person.go
查看文件 @
4df346d
...
...
@@ -158,8 +158,9 @@ func (srv PersonStatisticsService) CooperationProjectRecommend(projectQuery *com
creationCooperationGateway
:=
allied_creation_cooperation
.
NewHttplibAlliedCreationCooperation
(
projectQuery
.
Operator
)
result
,
err
:=
creationCooperationGateway
.
CooperationProjectsSearch
(
allied_creation_cooperation
.
ReqCooperationProjectSearch
{
PageNumber
:
projectQuery
.
PageNumber
,
PageSize
:
projectQuery
.
PageSize
,
PageNumber
:
projectQuery
.
PageNumber
,
PageSize
:
projectQuery
.
PageSize
,
CooperationProjectUndertakerType
:
3
,
})
if
err
!=
nil
{
return
0
,
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
...
...
pkg/application/web/excelData/command/import_data_command.go
查看文件 @
4df346d
...
...
@@ -12,7 +12,7 @@ type ImportDataCommand struct {
Operator
domain
.
Operator
`json:"-"`
Reader
io
.
Reader
`json:"-"`
// 业务编码
Code
string
`
json
:"code"`
Code
string
`
form
:"code"`
}
func
(
importDataCommand
*
ImportDataCommand
)
Valid
(
validation
*
validation
.
Validation
)
{
...
...
pkg/application/web/excelData/service/service.go
查看文件 @
4df346d
...
...
@@ -182,13 +182,13 @@ func (srv ExcelDataService) ImportCompanyUser(importDataCommand *command.ImportD
excelImport
:=
excel
.
NewExcelImport
()
excelImport
.
RowBegin
=
2
//第二行开始读取
excelImport
.
DataFields
=
[]
excel
.
DataField
{
{
EnName
:
"UserCode"
,
CnName
:
"*用户编号"
},
{
EnName
:
"UserName"
,
CnName
:
"*用户姓名"
},
{
EnName
:
"Organization"
,
CnName
:
"*组织机构"
},
{
EnName
:
"Department"
,
CnName
:
"*所属部门"
},
{
EnName
:
"Phone"
,
CnName
:
"*手机号"
},
{
EnName
:
"Email"
,
CnName
:
"邮箱"
},
{
EnName
:
"Status"
,
CnName
:
"状态"
},
{
EnName
:
"userCode"
,
CnName
:
"*用户编号"
},
{
EnName
:
"userName"
,
CnName
:
"*用户姓名"
},
{
EnName
:
"organization"
,
CnName
:
"*组织机构"
},
{
EnName
:
"department"
,
CnName
:
"*所属部门"
},
{
EnName
:
"phone"
,
CnName
:
"*手机号"
},
{
EnName
:
"email"
,
CnName
:
"邮箱"
},
{
EnName
:
"enableStatus"
,
CnName
:
"状态"
},
}
excelData
,
err
:=
excelImport
.
OpenExcelFromIoReader
(
importDataCommand
.
Reader
)
if
err
!=
nil
{
...
...
@@ -199,15 +199,15 @@ func (srv ExcelDataService) ImportCompanyUser(importDataCommand *command.ImportD
item
:=
allied_creation_user
.
BatchAddUserItem
{
CompanyId
:
importDataCommand
.
Operator
.
CompanyId
,
UserType
:
domain
.
UserTypeEmployee
,
UserCode
:
v
[
"UserCode"
],
Org
:
v
[
"Organization"
],
Department
:
v
[
"Department"
],
UserName
:
v
[
"UserName"
],
Phone
:
v
[
"Phone"
],
Email
:
v
[
"Email"
],
UserCode
:
v
[
"userCode"
],
Org
:
v
[
"organization"
],
Department
:
v
[
"department"
],
UserName
:
v
[
"userName"
],
Phone
:
v
[
"phone"
],
Email
:
v
[
"email"
],
EnableStatus
:
domain
.
UserStatusEnable
,
}
if
status
,
ok
:=
v
[
"
S
tatus"
];
ok
{
if
status
,
ok
:=
v
[
"
s
tatus"
];
ok
{
if
strings
.
TrimSpace
(
status
)
!=
"启用"
{
item
.
EnableStatus
=
domain
.
UserStatusDisable
}
...
...
@@ -222,7 +222,15 @@ func (srv ExcelDataService) ImportCompanyUser(importDataCommand *command.ImportD
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
return
result
,
nil
return
srv
.
importResultWithHeader
(
map
[
string
]
interface
{}{
"userCode"
:
"*用户编号"
,
"userName"
:
"*用户姓名"
,
"organization"
:
"*组织机构"
,
"department"
:
"*所属部门"
,
"phone"
:
"*手机号"
,
"email"
:
"邮箱"
,
"enableStatus"
:
"状态"
,
},
result
.
FailRows
,
len
(
excelData
)),
nil
}
func
(
srv
ExcelDataService
)
ImportOrganization
(
importDataCommand
*
command
.
ImportDataCommand
)
(
interface
{},
error
)
{
...
...
@@ -256,3 +264,22 @@ func (srv ExcelDataService) ImportOrganization(importDataCommand *command.Import
}
return
result
,
nil
}
// 导入结果
func
(
srv
ExcelDataService
)
importResultWithHeader
(
header
interface
{},
failRows
[]
interface
{},
totalRow
int
)
interface
{}
{
var
result
=
map
[
string
]
interface
{}{
"successCount"
:
0
,
"fail"
:
struct
{}{},
}
if
len
(
failRows
)
==
0
{
result
[
"successCount"
]
=
totalRow
}
if
len
(
failRows
)
>
0
{
fail
:=
map
[
string
]
interface
{}{
"body"
:
failRows
,
}
fail
[
"header"
]
=
header
result
[
"fail"
]
=
fail
}
return
result
}
...
...
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_project.go
查看文件 @
4df346d
...
...
@@ -166,6 +166,8 @@ type (
//OffsetLimitFlag bool `json:"offsetLimitFlag"`
// 用户基础数据id
UserBaseId
int64
`cname:"用户基础数据ID" json:"userBaseId"`
// 共创项目承接对象,1员工,2共创用户,4公开,可以多选
CooperationProjectUndertakerType
int32
`json:"cooperationProjectUndertakerType"`
}
DataCooperationProjectSearchItem
struct
{
CooperationProjectID
string
`json:"cooperationProjectId"`
...
...
pkg/infrastructure/service_gateway/allied_creation_user/module_user.go
查看文件 @
4df346d
...
...
@@ -238,7 +238,7 @@ func (gateway HttplibAlliedCreationUser) UserBatchResetPassword(param ReqBatchRe
}
// UserBatchAdd 批量添加用户
func
(
gateway
HttplibAlliedCreationUser
)
UserBatchAdd
(
param
ReqBatchAddUser
)
(
*
Data
BatchAddUser
,
error
)
{
func
(
gateway
HttplibAlliedCreationUser
)
UserBatchAdd
(
param
ReqBatchAddUser
)
(
*
Data
ImportResponse
,
error
)
{
url
:=
fmt
.
Sprintf
(
"%s%s"
,
gateway
.
baseUrL
,
"/user/batch-add2"
)
method
:=
"post"
req
:=
gateway
.
CreateRequest
(
url
,
method
)
...
...
@@ -264,7 +264,7 @@ func (gateway HttplibAlliedCreationUser) UserBatchAdd(param ReqBatchAddUser) (*D
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"解析批量添加用户:%w"
,
err
)
}
var
data
Data
BatchAddUser
var
data
Data
ImportResponse
err
=
gateway
.
GetResponseData
(
result
,
&
data
)
return
&
data
,
err
}
...
...
pkg/infrastructure/service_gateway/allied_creation_user/param_user.go
查看文件 @
4df346d
...
...
@@ -350,7 +350,8 @@ type (
Password
string
`json:"password"`
}
DataBatchAddUser
struct
{
DataImportResponse
struct
{
FailRows
[]
interface
{}
`json:"failRows"`
}
//BatchAddUserItem struct {
...
...
@@ -396,5 +397,7 @@ type (
CooperationCompany
string
`json:"cooperationCompany"`
// 共创到期时间 (yyyy-MM-dd) cooperationDeadline
CooperationDeadline
time
.
Time
`json:"cooperationDeadline"`
// 失败理由
FailReason
string
`json:"failReason"`
}
)
...
...
pkg/port/beego/controllers/mobile_client/cooperation_controller.go
查看文件 @
4df346d
...
...
@@ -227,6 +227,19 @@ func (controller *CooperationController) PersonSearchCooperationProject() {
controller
.
ReturnPageListData
(
int64
(
total
),
data
,
err
,
cmd
.
PageNumber
)
}
//func (controller *CooperationController) PersonRecommendCooperationProject() {
// svr := service.CooperationProjectService{}
// cmd := &command.PersonSearchCooperationProjectQuery{}
// err := controller.Unmarshal(cmd)
// if err != nil {
// controller.Response(nil, err)
// return
// }
// cmd.Operator = controller.GetOperator()
// total, data, err := svr.PersonRecommendCooperationProject(cmd)
// controller.ReturnPageListData(int64(total), data, err, cmd.PageNumber)
//}
/***** CompanyCreditAccountService 企业端账期结算 *****/
func
(
controller
*
CooperationController
)
CreditAccountSearch
()
{
svr
:=
service
.
CompanyCreditAccountService
{}
...
...
请
注册
或
登录
后发表评论