作者 yangfu

共创首页统计

正在显示 30 个修改的文件 包含 360 行增加30 行删除
... ... @@ -278,6 +278,21 @@ func (svr AuthService) GetUserInfo(userInfoCommand *command.UserInfoCommand) (in
}, nil
}
//GetUserMenus 获取用户信息-额外的数据
func (svr AuthService) GetUserInfoExtra(userInfoCommand *command.UserInfoCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userInfoCommand.Operator)
resultUser, err := creationUserGateway.UserGet(allied_creation_user.ReqGetUser{
UserId: int(userInfoCommand.Operator.UserId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"favoriteMenus": resultUser.FavoriteMenus,
}, nil
}
//GetUserMenus 获取用户菜单
func (svr AuthService) GetUserMenus(userMenusCommand *command.UserMenusCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
... ... @@ -442,6 +457,8 @@ func (svr AuthService) getUserInfo(operator domain.Operator) (interface{}, error
"companyId": resultUser.Company.CompanyId,
"companyName": resultUser.Company.CompanyName,
"logo": resultUser.Company.Log,
"systemName": resultUser.Company.SystemName,
"address": resultUser.Company.Address,
},
"im": resultUser.IM,
"org": map[string]interface{}{
... ... @@ -450,7 +467,8 @@ func (svr AuthService) getUserInfo(operator domain.Operator) (interface{}, error
"orgCode": resultOrg.OrgCode,
"companyId": resultOrg.CompanyID,
},
//"currentLoginOrg":resultUser.Org,
"currentLoginOrg": resultUser.Org,
"favoriteMenus": resultUser.FavoriteMenus,
}
return user, nil
}
... ... @@ -493,6 +511,11 @@ loopUser1:
loginToken.UserId = int64(currentUser.UserId)
loginToken.UserBaseId = int64(currentUser.UserBaseId)
loginToken.CompanyId = int64(currentUser.Company.CompanyId)
var orgIds []int64
for i := range currentUser.UserOrg {
orgIds = append(orgIds, int64(currentUser.UserOrg[i].OrgID))
}
loginToken.OrgIds = orgIds
// 2. 更新currentAccess信息
transactionContext, err := factory.CreateTransactionContext(nil)
... ... @@ -528,6 +551,7 @@ loopUser1:
currentAccess.Platform = loginToken.Platform
currentAccess.CompanyId = int64(loginToken.CompanyId)
currentAccess.OrganizationId = loginToken.OrgId
currentAccess.OrgIds = loginToken.OrgIds
currentAccess.UpdatedTime = time.Now()
accessTokenStr, err := loginToken.GenerateAccessToken()
... ...
... ... @@ -11,9 +11,9 @@ type AuditAllCooperationApplicationCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 审核动作,1同意,2拒绝
CooperationApplicationStatus int `json:"cooperationApplicationStatus" valid:"Required"`
CooperationApplicationStatus int `json:"action" valid:"Required"`
// 共创申请审核描述
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription" valid:"Required"`
CooperationApplicationVerifyDescription string `json:"cooperationApplicationDescription" valid:"Required"`
}
func (listCooperationApplicationQuery *AuditAllCooperationApplicationCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -10,6 +10,12 @@ import (
type CooperationDividendsStatisticsCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 查询偏离量
PageNumber int `json:"pageIndex" valid:"Required"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
//审核状态 1:正序 2:倒序
SortByActuallyPaidAmount int `json:"sortByActuallyPaidAmount"`
}
func (cmd *CooperationDividendsStatisticsCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -10,6 +10,12 @@ import (
type GoodsStatisticsCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 查询偏离量
PageNumber int `json:"pageIndex"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
// 排行榜类型,1月榜,2年榜 3总榜,默认展示年榜
RankingType int `json:"rankingType"`
}
func (cmd *GoodsStatisticsCommand) Valid(validation *validation.Validation) {
... ...
package dto
type IndexStatistics struct {
ProjectOverviewStatistics struct {
ContractSum int `json:"contractSum"`
CooperationUserCount int `json:"cooperationUserCount"`
ProjectSum int `json:"projectSum"`
} `json:"projectOverviewStatistics"`
Org struct {
OrgName string `json:"orgName"`
OrgID float64 `json:"orgId"`
} `json:"org"`
CurrentMonthDividendsStatistics struct {
CreditAccount float64 `json:"creditAccount"`
DividendsEstimate float64 `json:"dividendsEstimate"`
OrderAmount float64 `json:"orderAmount"`
} `json:"currentMonthDividendsStatistics"`
CooperationModeStatistics []struct {
CooperationPeople float64 `json:"cooperationPeople"`
DividendsEstimate float64 `json:"dividendsEstimate"`
OrderAmount float64 `json:"orderAmount"`
CooperationMode struct {
CooperationModeID int `json:"cooperationModeId"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"`
} `json:"cooperationModeStatistics"`
CooperationModes []struct {
CooperationModeID int `json:"cooperationModeId"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationModes"`
CooperationGoodsStatistics []struct {
GoodAmount float64 `json:"goodAmount"`
GoodName string `json:"goodName"`
GoodRatio float64 `json:"goodRatio"`
Rank int `json:"rank"`
} `json:"cooperationGoodsStatistics"`
}
... ...
... ... @@ -4,10 +4,10 @@ type DividendsEstimatesDto struct {
CooperationProjectNumber string `json:"cooperationProjectNumber"`
DividendsAccountStatus int `json:"dividendsAccountStatus"`
DividendsAmount float64 `json:"dividendsAmount"`
DividendsOrderAmount string `json:"dividendsOrderAmount"`
DividendsOrderAmount float64 `json:"dividendsOrderAmount"`
DividendsEstimateID int `json:"dividendsEstimateId"`
DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
DividendsEstimateTime string `json:"dividendsEstimateTime"`
DividendsEstimateTime int64 `json:"dividendsEstimateTime"`
DividendsParticipateType int `json:"dividendsParticipateType"`
DividendsType int `json:"dividendsType"`
DividendsUser struct {
... ... @@ -22,6 +22,10 @@ type DividendsEstimatesDto struct {
UserType int `json:"userType"`
} `json:"dividendsUser"`
OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"`
// 客户姓名
CustomerName string `json:"customerName"`
// 订单产品名称
OrderGoodName string `json:"orderGoodName"`
}
func (d *DividendsEstimatesDto) LoadDto() {
... ...
... ... @@ -64,7 +64,7 @@ func (srv CompanyStatisticsService) DividendsStatistics(userMenusCommand *comman
}, nil
}
// SearchDividendsEstimates 企业的合约明细列表(分红预算信息)
// SearchDividendsEstimates TODO:企业的合约明细列表(分红预算信息)
func (srv CompanyStatisticsService) SearchDividendsEstimates(userMenusCommand *command.SearchDividendsEstimatesCommand) (int64, interface{}, error) {
var items []*dto.DividendsEstimatesDto
for i := 0; i < 2; i++ {
... ...
... ... @@ -58,7 +58,7 @@ func (srv PersonDividendsService) DividendsStatistics(userMenusCommand *command.
}, nil
}
// SearchDividendsEstimates 企业的合约明细列表(分红预算信息)
// SearchDividendsEstimates TODO:企业的合约明细列表(分红预算信息)
func (srv PersonDividendsService) SearchDividendsEstimates(userMenusCommand *command.SearchDividendsEstimatesCommand) (int64, interface{}, error) {
var items []*dto.DividendsEstimatesDto
for i := 0; i < 2; i++ {
... ...
... ... @@ -173,6 +173,7 @@ func (srv CooperationApplicationsService) CooperationApplicationsOneclickApprova
allied_creation_cooperation.ReqCooperationApplicationOneclickApproval{
CooperationApplicationDescription: auditCommand.CooperationApplicationVerifyDescription,
Action: auditCommand.CooperationApplicationStatus,
Code: "a1-2",
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ...
package service
import (
"fmt"
"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/infrastructure/service_gateway/allied_creation_cooperation"
"math/rand"
"time"
)
// 企业端统计 【0%】
... ... @@ -9,16 +15,44 @@ type CompanyStatisticsService struct {
}
// IndexStatistics TODO:首页统计 (入口页面统计数据)
func (srv CompanyStatisticsService) IndexStatistics(userMenusCommand *command.IndexStatisticsCommand) (interface{}, error) {
//creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
// userMenusCommand.Operator)
//resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
// UserId: int(userMenusCommand.Operator.UserId),
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return map[string]interface{}{}, nil
func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatisticsCommand) (interface{}, error) {
value := dto.IndexStatistics{}
value.ProjectOverviewStatistics.ContractSum = 20
value.ProjectOverviewStatistics.CooperationUserCount = 5
value.ProjectOverviewStatistics.ProjectSum = 5
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
companyDividendsStatistics, err := gateway.CooperationStatistics(allied_creation_cooperation.CompanyDividendsStatistics, map[string]interface{}{
"companyId": cmd.Operator.CompanyId,
"orgId": cmd.Operator.OrgId,
"action": 1, //当前月
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
cooperationModeStatistics, err := gateway.CooperationStatistics(allied_creation_cooperation.CooperationModeStatistics, map[string]interface{}{
"companyId": cmd.Operator.CompanyId,
"orgId": cmd.Operator.OrgId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
cooperationGoodsStatistics, err := gateway.CooperationStatistics(allied_creation_cooperation.CooperationGoodsStatistics, map[string]interface{}{
"companyId": cmd.Operator.CompanyId,
"orgId": cmd.Operator.OrgId,
"rankType": 1, //月榜
"top": 5,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"currentMonthDividendsStatistics": companyDividendsStatistics,
"cooperationModeStatistics": cooperationModeStatistics,
"CooperationGoodsStatistics": cooperationGoodsStatistics,
}, nil
}
// CooperationPersonStatistics TODO:共创人员统计(共创人员明细)
... ... @@ -27,11 +61,58 @@ func (srv CompanyStatisticsService) CooperationPersonStatistics(userMenusCommand
}
// GoodsStatistics TODO:产品统计排行榜 年月榜
func (srv CompanyStatisticsService) GoodsStatistics(userMenusCommand *command.GoodsStatisticsCommand) (interface{}, error) {
return map[string]interface{}{}, nil
func (srv CompanyStatisticsService) GoodsStatistics(userMenusCommand *command.GoodsStatisticsCommand) (int64, interface{}, error) {
type rankItem struct {
GoodAmount float64 `json:"goodAmount"`
GoodName string `json:"goodName"`
GoodRatio float64 `json:"goodRatio"`
Rank int `json:"rank"`
}
var items []rankItem
for i := 0; i < 5; i++ {
item := rankItem{
GoodAmount: 2000,
GoodName: fmt.Sprintf("商品%v", rand.Intn(100)),
GoodRatio: 20,
Rank: i + 1,
}
items = append(items, item)
}
return 5, items, nil
}
// CooperationDividendsStatistics TODO:公司共创人员列表(分红支出统计)
func (srv CompanyStatisticsService) CooperationDividendsStatistics(userMenusCommand *command.CooperationDividendsStatisticsCommand) (interface{}, error) {
return map[string]interface{}{}, nil
func (srv CompanyStatisticsService) CooperationDividendsStatistics(userMenusCommand *command.CooperationDividendsStatisticsCommand) (int64, interface{}, error) {
type cooperationDividendItem struct {
CooperationTime int64 `json:"cooperationTime"`
DividendsOrderAmount float64 `json:"dividendsOrderAmount"`
ActuallyPaidAmount float64 `json:"actuallyPaidAmount"`
UnPaidAmount float64 `json:"unPaidAmount"`
Participator struct {
UserType int `json:"userType"`
UserInfo struct {
// 用户姓名
UserName string `json:"userName,omitempty"`
// 手机号码
UserPhone string `json:"userPhone,omitempty"`
// 头像
//Avatar string `json:"avatar,omitempty"`
// 邮箱
//Email string `json:"email,omitempty"`
} `json:"userInfo"`
} `json:"participator"` // 参与人
}
var results []cooperationDividendItem
for i := 0; i < 5; i++ {
item := cooperationDividendItem{
CooperationTime: time.Now().Unix() * 1000,
DividendsOrderAmount: 6000,
ActuallyPaidAmount: 5000,
UnPaidAmount: 1000,
}
item.Participator.UserInfo.UserName = fmt.Sprintf("用户%v", rand.Intn(100))
results = append(results, item)
}
return 5, results, nil
}
... ...
... ... @@ -171,10 +171,31 @@ func (srv UserService) MessagesList(cmd *query.MessagesListQuery) (int64, interf
for i := 0; i < 5; i++ {
results = append(results, dto.NewMessageDto())
}
//gateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
// cmd.Operator)
//_,err:= gateway.NoticePersonal(allied_creation_basic.ReqNoticePersonal{
// PageIndex: cmd.PageNumber,
// PageSize: cmd.PageSize,
// UserId: cmd.Operator.UserId,
//})
//if err!=nil{
// return 0,nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return 2, results, nil
}
//MessagesList 消息列表
func (srv UserService) MessagesMarkRead(cmd *command.MessageMarkReadCommand) (interface{}, error) {
//gateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
// cmd.Operator)
//_,err:= gateway.ReadNotice(allied_creation_basic.ReqReadNotice{
// MsgId: cmd.MsgId,
// ReadAll: cmd.ReadAll,
// UserId: cmd.Operator.UserId,
//})
//if err!=nil{
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return struct{}{}, nil
}
... ...
... ... @@ -187,6 +187,9 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje
// "cooperationProjectName": item.CooperationProjectName,
// })
//}
for i := range result.List {
result.List[i].CooperationProjectUndertakerType = result.List[i].CooperationProjectUndertakerTypes
}
return int64(result.Total), result.List, nil
}
... ...
... ... @@ -13,7 +13,7 @@ type RoleMenuEditCommand struct {
// 角色ID
RoleId string `json:"roleId" valid:"Required"`
// 关联菜单的id
MenuId []string `json:"menuId"`
MenuId []string `json:"accessMenus"`
}
func (roleMenuEditQuery *RoleMenuEditCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -91,6 +91,7 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
Limit: roleListQuery.PageSize,
OrgName: roleListQuery.OrgName,
RoleName: roleListQuery.RoleName,
InOrgIds: roleListQuery.Operator.OrgIds,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -186,6 +186,7 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co
DepName: companyUserListQuery.DepartmentName,
Phone: "",
UserType: domain.UserTypeEmployee,
InOrgIds: companyUserListQuery.Operator.OrgIds,
})
if err != nil {
... ... @@ -370,6 +371,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *
DepName: "",
Phone: "",
UserType: domain.UserTypeCooperation,
InOrgIds: cooperationUserListQuery.Operator.OrgIds,
})
var (
listData []dto.CooperationUserItem
... ...
... ... @@ -43,6 +43,7 @@ type LoginAccess struct {
LoginAccessId int64 `json:"loginAccessId"`
UserBaseId int64 `json:"userBaseId"`
UserId int64 `json:"userId"`
OrgIds []int64 `json:"orgIds"`
// 账号
Account string `json:"account"`
// 对应平台
... ...
... ... @@ -26,7 +26,7 @@ type LoginToken struct {
// 组织id
OrgId int64 `json:"orgId"`
// 用户关联的组织列表
Orgs []int64 `json:"orgs"`
OrgIds []int64 `json:"orgIds"`
// 会话模式 1: 短时效模式 2: 长时效模式(默认)
SessionMode int `json:"sessionMode"`
}
... ...
... ... @@ -8,4 +8,5 @@ type Operator struct {
UserBaseId int64 `json:"userBaseId"`
Phone string `json:"phone"`
Token string `json:"token"`
OrgIds []int64 `json:"orgIds"` //当前用户关联的组织ID列表
}
... ...
package allied_creation_basic
import (
"encoding/json"
"fmt"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
// NoticeSettingUpdate 获取消息列表
func (gateway HttplibAlliedCreationBasic) NoticePersonal(param ReqNoticePersonal) (*DataNoticePersonal, error) {
url := gateway.baseUrL + "/notice-personal"
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 DataNoticePersonal
err = gateway.GetResponseData(result, &data)
return &data, err
}
// NoticeSettingAdd 消息标记已读
func (gateway HttplibAlliedCreationBasic) ReadNotice(param ReqReadNotice) (*DataReadNotice, error) {
url := gateway.baseUrL + "/notice-personal/read"
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 DataReadNotice
err = gateway.GetResponseData(result, &data)
return &data, err
}
... ...
package allied_creation_basic
//返回编排消息通知内容列表
type (
ReqNoticePersonal struct {
IsRead int `json:"isRead"`
PageIndex int `json:"pageIndex"`
PageSize int `json:"pageSize"`
UserId int64 `json:"userId"`
}
DataNoticePersonal struct {
NoticePersonal []struct {
CompanyID int `json:"companyId"`
Content string `json:"content"`
CreatedAt string `json:"createdAt"`
DeletedAt string `json:"deletedAt"`
Extend string `json:"extend"`
IsRead string `json:"isRead"`
Module string `json:"module"`
ModuleAction string `json:"moduleAction"`
NoticePersonalID int `json:"noticePersonalId"`
OrganizationID int `json:"organizationId"`
SysCode string `json:"sysCode"`
UpdatedAt string `json:"updatedAt"`
UserID int `json:"userId"`
} `json:"noticePersonal"`
Count float64 `json:"count"`
}
)
//返回编排消息通知内容列表
type (
ReqReadNotice struct {
IsRead int `json:"isRead"`
MsgId int `json:"msgId"`
ReadAll int `json:"readAll"`
UserId int64 `json:"userId"`
}
DataReadNotice struct {
}
)
... ...
... ... @@ -74,7 +74,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationApplicationsBatchAppr
// CooperationApplicationsBatchApproval 共创申请审核
func (gateway HttplibAlliedCreationCooperation) CooperationApplicationsApproval(param ReqCooperationApplicationApproval) (*DataCooperationApplicationApproval, error) {
url := gateway.baseUrL + "/cooperation-applications/agree-cooperation-application"
url := gateway.baseUrL + "/cooperation-applications/approval-cooperation-application"
method := "POST"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:共创申请批量审核。", map[string]interface{}{
... ...
... ... @@ -13,6 +13,13 @@ const (
SearchContractDividends = "SearchContractDividends"
// 获取分红合约详情
GetContractDividends = "GetContractDividends"
// 企业-商品统计
CooperationGoodsStatistics = "cooperationGoodsStatistics"
// 企业-共创模式统计
CooperationModeStatistics = "CooperationModeStatistics"
// 企业-分红统计
CompanyDividendsStatistics = "CompanyDividendsStatistics"
)
// CooperationStatistics 共创统计
... ...
... ... @@ -216,6 +216,7 @@ type (
ReqCooperationApplicationOneclickApproval struct {
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //审核描述
Action int `json:"action"` //审核动作,1同意,2拒绝
Code string `cname:"菜单编码" json:"code" valid:"Required"`
}
DataCooperationApplicationOneclickApproval struct {
... ...
... ... @@ -220,6 +220,7 @@ type (
//IsOrganization bool `json:"isOrganization"`
} `json:"department"`
CooperationProjectUndertakerTypes []int `json:"cooperationProjectUndertakerTypes"`
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"`
Org struct {
OrgID string `json:"orgId"`
OrgName string `json:"orgName"`
... ...
... ... @@ -63,6 +63,8 @@ type UserDetail struct {
ImToken string `json:"imToken"`
CsAccountID string `json:"csAccountId"`
} `json:"im"`
// 收藏的菜单(工作台)(菜单编码列表)
FavoriteMenus []string `json:"favoriteMenus"`
}
//搜索用户列表
... ...
... ... @@ -85,6 +85,19 @@ func (controller *AuthController) GetUserInfo() {
controller.Response(data, err)
}
func (controller *AuthController) GetUserInfoExtra() {
authService := service.AuthService{}
userInfoCommand := &command.UserInfoCommand{}
err := controller.Unmarshal(userInfoCommand)
if err != nil {
controller.Response(nil, err)
return
}
userInfoCommand.Operator = controller.GetOperator()
data, err := authService.GetUserInfoExtra(userInfoCommand)
controller.Response(data, err)
}
func (controller *AuthController) GetUserMenus() {
authService := service.AuthService{}
userMenusCommand := &command.UserMenusCommand{}
... ...
... ... @@ -90,6 +90,7 @@ func (controller *BaseController) GetOperator() domain.Operator {
UserBaseId: loginToken.UserBaseId,
Phone: loginToken.Account,
Token: token,
OrgIds: loginToken.OrgIds,
}
// TODO:测试数据后期删除
if op.UserId == 0 {
... ... @@ -99,7 +100,7 @@ func (controller *BaseController) GetOperator() domain.Operator {
op.UserBaseId = 1
}
// TODO:打印测试日志
//log.Logger.Debug("operator " + json.MarshalToString(op))
log.Logger.Debug("operator " + json.MarshalToString(op))
return op
}
... ...
... ... @@ -495,8 +495,8 @@ func (controller *CooperationController) GoodsStatistics() {
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.GoodsStatistics(cmd)
controller.Response(data, err)
total, data, err := svr.GoodsStatistics(cmd)
controller.ReturnPageListData(total, data, err, 0)
}
func (controller *CooperationController) CooperationDividendsStatistics() {
... ... @@ -508,8 +508,8 @@ func (controller *CooperationController) CooperationDividendsStatistics() {
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.CooperationDividendsStatistics(cmd)
controller.Response(data, err)
total, data, err := svr.CooperationDividendsStatistics(cmd)
controller.ReturnPageListData(total, data, err, 0)
}
/***** PersonStatistics 用户端统计 *****/
... ...
... ... @@ -12,7 +12,7 @@ func init() {
/***** 共创申请服务 企业端 *****/
web.Router("/v1/app/cooperation-applications/:applicationId", &mobile_client.CooperationController{}, "Get:GetCooperationApplication")
web.Router("/v1/app/cooperation-applications/audit", &mobile_client.CooperationController{}, "Put:AuditCooperationApplication")
web.Router("/v1/app/cooperation-applications/audit", &mobile_client.CooperationController{}, "Post:AuditCooperationApplication")
web.Router("/v1/app/cooperation-applications/oneclick-approval", &mobile_client.CooperationController{}, "Post:AuditAllCooperationApplication")
web.Router("/v1/app/cooperation-applications/search", &mobile_client.CooperationController{}, "Post:SearchCooperationApplication")
... ...
... ... @@ -11,6 +11,7 @@ func init() {
web.Router("/v1/user/company-orgs", &controllers.AuthController{}, "Post:GetCompanyOrgsByUser")
web.Router("/v1/user/user-info", &controllers.AuthController{}, "Post:GetUserInfo")
web.Router("/v1/user/user-info-extra", &controllers.AuthController{}, "Post:GetUserInfoExtra")
web.Router("/v1/user/user-menu", &controllers.AuthController{}, "Post:GetUserMenus")
web.Router("/v1/user/user-orgs", &controllers.AuthController{}, "Post:GetUserOrg")
... ...