作者 yangfu

统计修改

... ... @@ -7,6 +7,7 @@ import (
"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"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
"time"
)
// 个人端统计 【0%】
... ... @@ -50,30 +51,33 @@ func (srv PersonStatisticsService) IndexStatistics(cmd *command.IndexStatisticsC
"contractStoppedSum": cs.ContractStoppedSum, //停止的合约数
"companySum": users.Count, //共创企业数
}
year, month, _ := time.Now().Date()
beginTime := time.Date(year, month, 1, 0, 0, 0, 0, time.Local)
endTime := beginTime.AddDate(0, 1, 0)
// 2.本月分红统计 - 个人
dividendStatisticsResult, err := gateway.CooperationStatistics(allied_creation_cooperation.DividendsStatistics, map[string]interface{}{
dividendStatisticsResult, err := gateway.CooperationStatistics(allied_creation_cooperation.CreditAccountStatistics, map[string]interface{}{
"userBaseId": cmd.Operator.UserBaseId,
"beginTime": beginTime,
"endTime": endTime,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
type AnnualDividend struct {
AnnualDividends struct {
Accounted int `json:"accounted"`
Accounting int `json:"accounting"`
Paid int `json:"paid"`
Total int `json:"total"`
} `json:"annualDividends"`
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())
}
dividendStatistics := map[string]interface{}{
"dividendAmount": annualDividend.AnnualDividends.Total, // 分红金额
"paidAmount": annualDividend.AnnualDividends.Paid, // 已支付
"unPaidAmount": annualDividend.AnnualDividends.Total - annualDividend.AnnualDividends.Paid, // 未支付
"dividendAmount": annualDividend.Total, // 分红金额
"paidAmount": annualDividend.Paid, // 已支付
"unPaidAmount": annualDividend.Unpaid, // 未支付
}
return map[string]interface{}{
... ...
... ... @@ -89,12 +89,12 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
roleListQuery.Operator)
roleList, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
Offset: (roleListQuery.PageNumber - 1) * roleListQuery.PageSize,
Limit: roleListQuery.PageSize,
OrgName: roleListQuery.OrgName,
RoleName: roleListQuery.RoleName,
InOrgIds: roleListQuery.Operator.OrgIds,
RoleType: roleListQuery.RoleType,
Offset: (roleListQuery.PageNumber - 1) * roleListQuery.PageSize,
Limit: roleListQuery.PageSize,
OrgName: roleListQuery.OrgName,
MatchRoleName: roleListQuery.RoleName,
InOrgIds: roleListQuery.Operator.OrgIds,
RoleType: roleListQuery.RoleType,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -35,6 +35,8 @@ type (
OrgId int64 `json:"orgId"`
// 匹配多个组织
InOrgIds []int64 `cname:"匹配多个组织" json:"inOrgIds,omitempty"`
// 角色名称
MatchRoleName string `cname:"匹配角色名称" json:"matchRoleName,omitempty"`
}
DataRoleSearch struct {
... ...