切换导航条
此项目
正在载入...
登录
allied-creation
/
allied-creation-gateway
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
tangxuhui
3 years ago
提交
6f3efff8f0142b8d307d79463c513086e1b0b90f
2 个父辈
99e21713
14c9c4f5
Merge branch 'dev' of
http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway
into dev
隐藏空白字符变更
内嵌
并排对比
正在显示
9 个修改的文件
包含
101 行增加
和
16 行删除
pkg/application/auth/service/service.go
pkg/application/mobile/cooperation/command/cca_credit_account_pay_search.go
pkg/application/mobile/cooperation/dto/credit_account_item.go
pkg/application/mobile/cooperation/service/credit_accounts_company.go
pkg/application/mobile/cooperation/service/credit_accounts_person.go
pkg/application/mobile/user/service/service.go
pkg/application/web/orgs/service/orgs.go
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_credit_account.go
pkg/infrastructure/service_gateway/allied_creation_user/param_user.go
pkg/application/auth/service/service.go
查看文件 @
6f3efff
...
...
@@ -677,6 +677,7 @@ func (svr AuthService) GetCompanyOrgsByUser(queryParam *query.GetCompanyOrgsByUs
Phone
:
queryParam
.
Operator
.
Phone
,
UserType
:
domain
.
UserTypeEmployee
,
PullRealTime
:
true
,
EnableStatus
:
domain
.
UserStatusEnable
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
...
...
pkg/application/mobile/cooperation/command/cca_credit_account_pay_search.go
查看文件 @
6f3efff
...
...
@@ -19,7 +19,7 @@ type CreditAccountPaySearchCommand struct {
// 开始时间
BeginTime
int64
`json:"beginTime"`
// 结算时间
EndTime
int64
`json:"
begin
Time"`
EndTime
int64
`json:"
end
Time"`
}
func
(
cmd
*
CreditAccountPaySearchCommand
)
Valid
(
validation
*
validation
.
Validation
)
{
...
...
pkg/application/mobile/cooperation/dto/credit_account_item.go
查看文件 @
6f3efff
...
...
@@ -29,12 +29,12 @@ type CreditAccountItem struct {
//Email string `json:"email,omitempty"`
}
`json:"userInfo"`
}
`json:"participator"`
// 参与人
ParticipateType
string
`json:"participateType"`
// 参与类型
PaymentDocumentAttachment
[]
domain
.
Attachment
`json:"paymentDocumentAttachment"`
// 支付凭证附件,复数
Org
domain
.
Org
`json:"org"`
// 数据所属组织机构
Company
domain
.
CompanyData
`json:"company"`
// 公司
CreatedAt
int64
`json:"createdAt"`
// 创建时间
UpdatedAt
int64
`json:"updatedAt"`
// 更新时间
ParticipateType
string
`json:"participateType"`
// 参与类型
PaymentDocumentAttachment
[]
domain
.
Attachment
`json:"paymentDocumentAttachments"`
// 支付凭证附件,复数
Org
domain
.
Org
`json:"org"`
// 数据所属组织机构
Company
domain
.
CompanyData
`json:"company"`
// 公司
CreatedAt
int64
`json:"createdAt"`
// 创建时间
UpdatedAt
int64
`json:"updatedAt"`
// 更新时间
AccountDetail
[]
struct
{
DividendsEstimateOrderNumber
string
`json:"dividendsEstimateOrderNumber"`
DividendsType
int
`json:"dividendsType"`
...
...
pkg/application/mobile/cooperation/service/credit_accounts_company.go
查看文件 @
6f3efff
package
service
import
(
"github.com/linmadan/egglib-go/utils/json"
"time"
"github.com/linmadan/egglib-go/core/application"
...
...
@@ -83,24 +84,59 @@ func (srv CompanyCreditAccountService) CreditAccountPay(cmd *command.CreditAccou
func
(
srv
CompanyCreditAccountService
)
CreditAccountPaySearch
(
cmd
*
command
.
CreditAccountPaySearchCommand
)
(
interface
{},
error
)
{
gateway
:=
allied_creation_cooperation
.
NewHttplibAlliedCreationCooperation
(
cmd
.
Operator
)
resultMenu
,
err
:=
gateway
.
CreditAccountsSearch
(
allied_creation_cooperation
.
ReqCreditAccountsSearch
{
var
beginTime
,
endTime
time
.
Time
if
cmd
.
BeginTime
>
0
{
beginTime
=
time
.
Unix
(
cmd
.
BeginTime
/
1000
,
0
)
}
if
cmd
.
EndTime
>
0
{
endTime
=
time
.
Unix
(
cmd
.
EndTime
/
1000
,
0
)
}
req
:=
allied_creation_cooperation
.
ReqCreditAccountsSearch
{
PageNumber
:
cmd
.
PageNumber
+
1
,
//手机序号从0开始的
PageSize
:
cmd
.
PageSize
,
PaymentStatus
:
2
,
//TODO:时间段过滤
})
OrgId
:
cmd
.
Operator
.
OrgId
,
BeginTime
:
beginTime
,
EndTime
:
endTime
,
}
resultMenu
,
err
:=
gateway
.
CreditAccountsSearch
(
req
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
var
items
[]
*
dto
.
CreditAccountItem
queryOptions
:=
map
[
string
]
interface
{}{
"orgId"
:
cmd
.
Operator
.
OrgId
,
}
if
cmd
.
BeginTime
>
0
{
queryOptions
[
"beginTime"
]
=
beginTime
}
if
cmd
.
EndTime
>
0
{
queryOptions
[
"endTime"
]
=
endTime
}
// 2.分红统计
dividendStatisticsResult
,
err
:=
gateway
.
CooperationStatistics
(
allied_creation_cooperation
.
CreditAccountStatistics
,
queryOptions
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
type
AnnualDividend
struct
{
Total
float64
`json:"total"`
Accounting
float64
`json:"accounting"`
Accounted
float64
`json:"accounted"`
Paid
float64
`json:"paid"`
Unpaid
float64
`json:"unpaid"`
}
var
annualDividend
=
&
AnnualDividend
{}
if
err
:=
json
.
UnmarshalFromString
(
json
.
MarshalToString
(
dividendStatisticsResult
),
annualDividend
);
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
var
items
=
make
([]
*
dto
.
CreditAccountItem
,
0
)
for
i
:=
0
;
i
<
len
(
resultMenu
.
Grid
.
List
);
i
++
{
items
=
append
(
items
,
dto
.
ToCreditAccountItem
(
&
resultMenu
.
Grid
.
List
[
i
]))
}
return
map
[
string
]
interface
{}{
"grid"
:
map
[
string
]
interface
{}{
"list"
:
items
,
//TODO:sum 时间段支付金额
"sum"
:
6000
,
"sum"
:
annualDividend
.
Paid
,
},
},
nil
}
...
...
pkg/application/mobile/cooperation/service/credit_accounts_person.go
查看文件 @
6f3efff
...
...
@@ -2,7 +2,9 @@ package service
import
(
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/utils/json"
"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/infrastructure/service_gateway/allied_creation_cooperation"
"time"
)
...
...
@@ -15,19 +17,58 @@ type PersonCreditAccountService struct {
func
(
srv
PersonCreditAccountService
)
CreditAccountPaySearch
(
cmd
*
command
.
CreditAccountPaySearchCommand
)
(
interface
{},
error
)
{
gateway
:=
allied_creation_cooperation
.
NewHttplibAlliedCreationCooperation
(
cmd
.
Operator
)
var
beginTime
,
endTime
time
.
Time
if
cmd
.
BeginTime
>
0
{
beginTime
=
time
.
Unix
(
cmd
.
BeginTime
/
1000
,
0
)
}
if
cmd
.
EndTime
>
0
{
endTime
=
time
.
Unix
(
cmd
.
EndTime
/
1000
,
0
)
}
resultMenu
,
err
:=
gateway
.
CreditAccountsSearch
(
allied_creation_cooperation
.
ReqCreditAccountsSearch
{
PageNumber
:
cmd
.
PageNumber
+
1
,
//手机序号从0开始的
PageSize
:
cmd
.
PageSize
,
PaymentStatus
:
2
,
UserBaseId
:
cmd
.
Operator
.
UserBaseId
,
BeginTime
:
beginTime
,
EndTime
:
endTime
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
queryOptions
:=
map
[
string
]
interface
{}{
"userBaseId"
:
cmd
.
Operator
.
UserBaseId
,
}
if
cmd
.
BeginTime
>
0
{
queryOptions
[
"beginTime"
]
=
beginTime
}
if
cmd
.
EndTime
>
0
{
queryOptions
[
"endTime"
]
=
endTime
}
// 2.分红统计
dividendStatisticsResult
,
err
:=
gateway
.
CooperationStatistics
(
allied_creation_cooperation
.
CreditAccountStatistics
,
queryOptions
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
type
AnnualDividend
struct
{
Total
float64
`json:"total"`
Accounting
float64
`json:"accounting"`
Accounted
float64
`json:"accounted"`
Paid
float64
`json:"paid"`
Unpaid
float64
`json:"unpaid"`
}
var
annualDividend
=
&
AnnualDividend
{}
if
err
:=
json
.
UnmarshalFromString
(
json
.
MarshalToString
(
dividendStatisticsResult
),
annualDividend
);
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
var
items
=
make
([]
*
dto
.
CreditAccountItem
,
0
)
for
i
:=
0
;
i
<
len
(
resultMenu
.
Grid
.
List
);
i
++
{
items
=
append
(
items
,
dto
.
ToCreditAccountItem
(
&
resultMenu
.
Grid
.
List
[
i
]))
}
return
map
[
string
]
interface
{}{
"grid"
:
map
[
string
]
interface
{}{
"list"
:
resultMenu
.
Grid
.
List
,
"sum"
:
6000
,
"list"
:
items
,
"sum"
:
annualDividend
.
Paid
,
},
},
nil
}
...
...
pkg/application/mobile/user/service/service.go
查看文件 @
6f3efff
...
...
@@ -188,6 +188,7 @@ func (srv UserService) DepartmentsUsers(departmentsUsersQuery *query.Departments
CompanyId
:
departmentsUsersQuery
.
Operator
.
CompanyId
,
OrganizationId
:
departmentsUsersQuery
.
Operator
.
OrgId
,
UserType
:
domain
.
UserTypeEmployee
,
//TODO:是否要共创用户
InEnableStatus
:
[]
int
{
domain
.
UserStatusEnable
,
domain
.
UserStatusDisable
},
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
...
...
pkg/application/web/orgs/service/orgs.go
查看文件 @
6f3efff
package
service
import
(
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"strconv"
"github.com/linmadan/egglib-go/core/application"
...
...
@@ -163,6 +164,7 @@ func (orgsService OrgsService) DepartmentsUsers(departmentsUsersQuery *query.Dep
CompanyId
:
departmentsUsersQuery
.
Operator
.
CompanyId
,
OrganizationId
:
departmentsUsersQuery
.
Operator
.
OrgId
,
Limit
:
1000
,
InEnableStatus
:
[]
int
{
domain
.
UserStatusEnable
,
domain
.
UserStatusDisable
},
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
...
...
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_credit_account.go
查看文件 @
6f3efff
...
...
@@ -87,7 +87,9 @@ type (
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId
int64
`cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId
int64
`cname:"用户基础数据ID" json:"userBaseId"`
UserBaseId
int64
`cname:"用户基础数据ID" json:"userBaseId"`
BeginTime
time
.
Time
`json:"beginTime"`
EndTime
time
.
Time
`json:"endTime"`
}
DataCreditAccountsSearch
struct
{
...
...
pkg/infrastructure/service_gateway/allied_creation_user/param_user.go
查看文件 @
6f3efff
...
...
@@ -101,6 +101,8 @@ type (
PullRealTime
bool
`cname:"拉取最新数据" json:"pullRealTime,omitempty"`
// 状态(1:启用 2:禁用 3:注销)
EnableStatus
int
`cname:"状态(1:启用 2:禁用 3:注销)" json:"enableStatus,omitempty"`
// 状态(1:启用 2:禁用 3:注销)
InEnableStatus
[]
int
`cname:"状态(1:启用 2:禁用 3:注销)" json:"inEnableStatus,omitempty"`
}
//DataUserSearch 搜索用户列表
...
...
请
注册
或
登录
后发表评论