作者 yangfu
... ... @@ -54,11 +54,14 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *Cred
CooperationContractNumber: param.CooperationContractNumber,
ParticipateType: param.ParticipateType, // 参与类型
PaymentDocumentAttachment: param.PaymentDocumentAttachment, // 支付凭证附件
Org: param.Org, // 数据所属组织机构
Company: param.Company, // 公司
CreatedAt: param.CreatedAt.Unix() * 1000, // 创建时间
UpdatedAt: param.UpdatedAt.Unix() * 1000, // 更新时间
AccountDetail: param.AccountDetail,
Org: domain.Org{
OrgID: param.Org.OrgID,
OrgName: param.Org.OrgName,
}, // 数据所属组织机构
Company: param.Company, // 公司
CreatedAt: param.CreatedAt.Unix() * 1000, // 创建时间
UpdatedAt: param.UpdatedAt.Unix() * 1000, // 更新时间
AccountDetail: param.AccountDetail,
}
data.Participator.UserInfo.UserName = param.Participator.UserName
data.Participator.UserInfo.UserPhone = param.Participator.UserPhone
... ...
... ... @@ -2,13 +2,14 @@ package service
import (
"fmt"
"math/rand"
"time"
"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/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"
"math/rand"
"time"
)
// 企业端统计 【25%】
... ... @@ -48,6 +49,10 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics
models, err := gateway.CooperationModeList(allied_creation_cooperation.ReqCooperationModeList{
PageSize: 20,
PageNumber: 1,
CompanyId: cmd.Operator.CompanyId,
OrgId: cmd.Operator.OrgId,
UserId: cmd.Operator.UserId,
UserBaseId: cmd.Operator.UserBaseId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ...
... ... @@ -184,12 +184,12 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon
}
u.SalesmanUser.UserId = v.Salesman.UserId
u.SalesmanUser.UserInfo.UsersId = v.Salesman.UserId
u.SalesmanUser.UserInfo.UsersName = v.Salesman.UserInfo.UserName
u.SalesmanUser.UserInfo.Phone = v.Salesman.UserInfo.UserPhone
u.SalesmanUser.UserInfo.UsersName = v.Salesman.UserName
u.SalesmanUser.UserInfo.Phone = v.Salesman.UserPhone
u.ReferrerUser.UserId = v.Referrer.UserId
u.ReferrerUser.UserInfo.UsersId = v.Referrer.UserId
u.ReferrerUser.UserInfo.UsersName = v.Referrer.UserInfo.UserName
u.ReferrerUser.UserInfo.Phone = v.Referrer.UserInfo.UserPhone
u.ReferrerUser.UserInfo.UsersName = v.Referrer.UserName
u.ReferrerUser.UserInfo.Phone = v.Referrer.UserPhone
contractUndertaker = append(contractUndertaker, u)
}
undertakerTypesUncheckedAvailable := param.UndertakerTypesUncheckedAvailable
... ... @@ -235,7 +235,7 @@ type CooperationContractUndertake struct {
Attachment []domain.Attachment `json:"attachment"`
}
func ToCooperationContractUndertake(allied_creation_cooperation.DataCooperationContractSearchByUndertaker) *CooperationContractUndertake {
data := CooperationContractUndertake{}
return &data
}
// func ToCooperationContractUndertake(allied_creation_cooperation.DataCooperationContractSearchByUndertaker) *CooperationContractUndertake {
// data := CooperationContractUndertake{}
// return &data
// }
... ...
... ... @@ -219,6 +219,7 @@ func (cooperationContractService *CooperationContractService) SearchCooperationC
SponsorName: queryParam.ContractSponsor,
PageNumber: queryParam.PageNumber,
PageIndex: queryParam.PageSize,
CompanyId: queryParam.Operator.CompanyId,
})
data := []dto.CooperationContractUndertake{{}}
return 10, data, err
... ...
... ... @@ -71,6 +71,10 @@ func (cooperationModeService *CooperationModeService) ListCooperationMode(listCo
PageSize: listCooperationModeQuery.PageSize,
CooperationModeName: listCooperationModeQuery.CooperationModeName,
OrganizationName: listCooperationModeQuery.OrganizationName,
CompanyId: listCooperationModeQuery.Operator.CompanyId,
UserId: 0,
OrgId: 0,
UserBaseId: 0,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -19,13 +19,16 @@ type CreditAccountItem struct {
UserPhone string `json:"userPhone"` // 用户手机号
UserType int `json:"userType"` // 用户类型,1员工,2共创用户,3公开
} `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"` // 更新时间
AccountDetail []struct {
ParticipateType string `json:"participateType"` // 参与类型
PaymentDocumentAttachment domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件
Org struct {
OrgID int `json:"orgId,string"`
OrgName string `json:"orgName"`
} `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"`
DividendsAmount float64 `json:"dividendsAmount"`
... ... @@ -55,12 +58,13 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *Cred
CooperationContractNumber: param.CooperationContractNumber,
ParticipateType: param.ParticipateType, // 参与类型
PaymentDocumentAttachment: param.PaymentDocumentAttachment, // 支付凭证附件
Org: param.Org, // 数据所属组织机构
Company: param.Company, // 公司
CreatedAt: param.CreatedAt.UnixNano() / 1e6, // 创建时间
UpdatedAt: param.UpdatedAt.UnixNano() / 1e6, // 更新时间
AccountDetail: param.AccountDetail,
}
data.Org.OrgID = param.Org.OrgID
data.Org.OrgName = param.Org.OrgName
data.Participator.UserName = param.Participator.UserName
data.Participator.UserPhone = param.Participator.UserPhone
data.Participator.UserType = param.Participator.UserType
... ...
... ... @@ -19,9 +19,9 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
if err := createDividendsOrderCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
orderGoods := []allied_creation_cooperation.DividendsOrderGoods{}
orderGoods := []allied_creation_cooperation.DividendsOrderGoodAdd{}
for _, v := range createDividendsOrderCommand.OrderGoods {
good := allied_creation_cooperation.DividendsOrderGoods{
good := allied_creation_cooperation.DividendsOrderGoodAdd{
CooperationContractNumber: v.CooperationContractNumber,
DividendsOrderNumber: v.DividendsOrderNumber,
OrderGoodAmount: v.OrderGoodAmount,
... ...
... ... @@ -12,7 +12,7 @@ type CooperationContract struct {
CooperationContractName string `json:"cooperationContractName"` // 共创合约名称
CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号
CooperationProjectNumber string `json:"cooperationProjectNumber"`
CooperationContractUndertakerTypes []int `json:"cooperationContractUndertakerType"` // 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractUndertakerTypes []int `json:"cooperationContractUndertakerTypes"` // 共创合约承接对象,1员工,2共创用户,3公开
Department struct {
DepartmentId int `json:"departmentId,string"`
DepartmentName string `json:"departmentName"`
... ... @@ -76,8 +76,11 @@ type CooperationContract struct {
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
Referrer struct {
UserId int `json:"userId,string"`
UserInfo struct {
UserId int `json:"userId,string"`
UserType int32 `json:"userType"` // 用户类型,1员工,2共创用户,3公开
UserName string `json:"userName"` // 用户姓名
UserPhone string `json:"userPhone"` // 用户手机号
UserInfo struct {
UserAvatar string `json:"userAvatar"` // 用户头像
UserEmail string `json:"userEmail"` // 用户邮箱
UserName string `json:"userName"` // 共创人员姓名
... ... @@ -86,8 +89,11 @@ type CooperationContract struct {
} `json:"userInfo"`
} `json:"referrer"`
Salesman struct {
UserId int `json:"userId,string"`
UserInfo struct {
UserId int `json:"userId,string"`
UserType int32 `json:"userType"` // 用户类型,1员工,2共创用户,3公开
UserName string `json:"userName"` // 用户姓名
UserPhone string `json:"userPhone"` // 用户手机号
UserInfo struct {
UserAvatar string `json:"userAvatar"` // 用户头像
UserEmail string `json:"userEmail"` // 用户邮箱
UserName string `json:"userName"` // 共创人员姓名
... ... @@ -235,6 +241,9 @@ type (
SponsorName string `json:"sponsorName"` //项目发起人姓名
PageNumber int `json:"pageNumber"`
PageIndex int `json:"pageIndex"`
CompanyId int64 ` json:"companyId"`
OrgId int64 ` json:"orgId"`
UserBaseId int64 `json:"userBaseId"`
}
DataCooperationContractSearchByUndertaker struct {
... ...
... ... @@ -40,8 +40,12 @@ type (
//返回共创模式列表
type (
ReqCooperationModeList struct {
PageSize int `json:"pageSize"`
PageNumber int `json:"pageNumber"`
PageSize int `json:"pageSize"`
PageNumber int `json:"pageNumber"`
CompanyId int64 `json:"companyId"`
OrgId int64 `json:"orgId"`
UserId int64 `json:"userId"`
UserBaseId int64 `json:"userBaseId"`
}
DataCooperationModeList struct {
... ... @@ -155,6 +159,10 @@ type (
CooperationModeName string `json:"cooperationModeName"`
//组织名称
OrganizationName string `json:"organizationName"`
CompanyId int64 `json:"companyId"`
OrgId int64 `json:"orgId"`
UserId int64 `json:"userId"`
UserBaseId int64 `json:"userBaseId"`
}
DataCooperationModesSearch struct {
... ...
... ... @@ -32,13 +32,16 @@ type CreditAccount struct {
UserPhone string `json:"userPhone"` // 用户手机号
UserInfo domain.UserInfo `json:"userInfo"` //
} `json:"operator"`
ParticipateType string `json:"participateType"` // 参与类型
PaymentDocumentAttachment domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件
Org domain.Org `json:"org"` // 数据所属组织机构
Company domain.CompanyData `json:"company"` // 公司
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
AccountDetail []struct {
ParticipateType string `json:"participateType"` // 参与类型
PaymentDocumentAttachment domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件
Org struct {
OrgID int `json:"orgId,string"`
OrgName string `json:"orgName"`
} `json:"org"` // 数据所属组织机构
Company domain.CompanyData `json:"company"` // 公司
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
AccountDetail []struct {
DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
DividendsType int `json:"dividendsType"`
DividendsAmount float64 `json:"dividendsAmount"`
... ...
... ... @@ -53,9 +53,21 @@ type DividendsOrder struct {
Returned bool `json:"returned"` //是否有退货记录,true:有退货记录,false:无退货记录
}
type DividendsOrderGoods struct {
// 订单产品
OrderGoodId int64 `json:"orderGoodId,string"`
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号
OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
OrderGoodExpense float64 `json:"orderGoodExpense"` //订单产品费用
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity int `json:"orderGoodQuantity,string"` //订单产品数量
OrderGoodDividendsStatus int32 `json:"orderGoodDividendsStatus"` // 订单产品分红状态, 1待分红,2已分红
}
type (
//订单产品
DividendsOrderGoods struct {
DividendsOrderGoodAdd struct {
// 订单产品
OrderGoodId int64 `json:"orderGoodId,string"`
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
... ... @@ -64,20 +76,21 @@ type (
OrderGoodExpense float64 `json:"orderGoodExpense"` //订单产品费用
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity int `json:"orderGoodQuantity,string"` //订单产品数量
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
OrderGoodDividendsStatus int32 `json:"orderGoodDividendsStatus"` // 订单产品分红状态, 1待分红,2已分红
}
//订单产品
ReqDividendsOrderAdd struct {
CompanyId int `json:"companyId,string"`
CustomerName string `json:"customerName"` //客户名称
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OperatorUid int `json:"operatorUid,string"` //订单操作人id
OrderGoods []DividendsOrderGoods `json:"orderGoods"` //订单产品列表
OrderTime string `json:"orderTime"` //订单日期,13位长度字符串类型时间戳
Remarks string `json:"remarks"` //备注
UserId int `json:"userId,string"` //
SalesmanUid string `json:"salesmanUid"` //订单业务员uid
RegionName string `json:"regionName"` //区域名称
CompanyId int `json:"companyId,string"`
CustomerName string `json:"customerName"` //客户名称
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OperatorUid int `json:"operatorUid,string"` //订单操作人id
OrderGoods []DividendsOrderGoodAdd `json:"orderGoods"` //订单产品列表
OrderTime string `json:"orderTime"` //订单日期,13位长度字符串类型时间戳
Remarks string `json:"remarks"` //备注
UserId int `json:"userId,string"` //
SalesmanUid string `json:"salesmanUid"` //订单业务员uid
RegionName string `json:"regionName"` //区域名称
}
DataDividendsOrderAdd struct {
... ...