作者 yangfu
... ... @@ -38,14 +38,14 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
data := struct {
CooperationProjectId int `json:"cooperationProjectId"`
command.CreateCooperationProjectCommand
}{
CooperationProjectId: result.CooperationProjectId,
CreateCooperationProjectCommand: *createCooperationProjectCommand,
}
return data, nil
// data := struct {
// CooperationProjectId int `json:"cooperationProjectId"`
// command.CreateCooperationProjectCommand
// }{
// CooperationProjectId: result.CooperationProjectId,
// CreateCooperationProjectCommand: *createCooperationProjectCommand,
// }
return dto.ToCooperationProjectInfo(&result.CooperationProject), nil
}
// GetCooperationProject 返回共创项目明细
... ...
... ... @@ -6,42 +6,20 @@ import (
type DividendsOrder struct {
Company struct {
CompanyID int `json:"companyId"`
CompanyID int `json:"companyId,string"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
CustomerName string `json:"customerName"` //客户名字
DividendStatus int `json:"dividendStatus"` //分红订单分红状态,1待分红,2已分红,3部分分红
DividendTime int64 `json:"dividendTime"` //分红订单分红时间
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderID int `json:"dividendsOrderId"` //分红订单
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OrderSalesman struct { //订单业务员
Department struct {
DepartmentID int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
IsOrganization bool `json:"isOrganization"`
} `json:"department"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UserBaseID int `json:"userBaseId"`
UserID int `json:"userId"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
} `json:"userInfo"`
UserType int `json:"userType"`
} `json:"orderSalesman"`
OrderTime int64 `json:"orderTime"`
Org struct {
OrgID int `json:"orgId"`
CustomerName string `json:"customerName"` //客户名字
DividendStatus int `json:"dividendStatus"` //分红订单分红状态,1待分红,2已分红,3部分分红
DividendTime int64 `json:"dividendTime"` //分红订单分红时间
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderID int `json:"dividendsOrderId"` //分红订单
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OrderTime int64 `json:"orderTime"`
Org struct {
OrgID int `json:"orgId,string"`
OrgName string `json:"orgName"`
} `json:"org"`
Region struct {
... ... @@ -60,7 +38,6 @@ func ToDividendsOrder(param *allied_creation_cooperation.DividendsOrder) *Divide
DividendsOrderID: param.DividendsOrderID,
DividendsOrderNumber: param.DividendsOrderNumber,
DividendsOriginalOrderNum: param.DividendsOriginalOrderNum,
OrderSalesman: param.OrderSalesman,
OrderTime: param.OrderTime.Unix(),
Org: param.Org,
Region: param.Region,
... ...
package service
import (
"time"
"strconv"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsOrder/command"
... ... @@ -32,14 +32,14 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
}
orderGoods = append(orderGoods, good)
}
t := time.Unix(createDividendsOrderCommand.OrderTime, 0)
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createDividendsOrderCommand.Operator)
result, err := creationCooperationGateway.DividendsOrderAdd(allied_creation_cooperation.ReqDividendsOrderAdd{
CompanyId: int(createDividendsOrderCommand.Operator.CompanyId),
UserId: int(createDividendsOrderCommand.Operator.UserId),
CustomerName: createDividendsOrderCommand.CustomerName,
DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum,
OperatorUid: int(createDividendsOrderCommand.Operator.UserId),
OrderTime: t,
OrderTime: strconv.Itoa(int(createDividendsOrderCommand.OrderTime * 1000)),
Remarks: createDividendsOrderCommand.Remarks,
RegionName: createDividendsOrderCommand.RegionName,
OrderGoods: orderGoods,
... ... @@ -129,7 +129,6 @@ func (dividendsOrderService *DividendsOrderService) UpdateDividendsOrder(updateD
}
orderGoods = append(orderGoods, good)
}
t := time.Unix(updateDividendsOrderCommand.OrderTime, 0)
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateDividendsOrderCommand.Operator)
_, err := creationCooperationGateway.DividendsOrderUpdate(allied_creation_cooperation.ReqDividendsOrderUpdate{
DividendsOrderId: updateDividendsOrderCommand.DividendsOrderID,
... ... @@ -138,7 +137,7 @@ func (dividendsOrderService *DividendsOrderService) UpdateDividendsOrder(updateD
DividendsOrderAmount: updateDividendsOrderCommand.DividendsOrderAmount,
DividendsOriginalOrderNum: updateDividendsOrderCommand.DividendsOriginalOrderNum,
OperatorUid: int(updateDividendsOrderCommand.Operator.UserId),
OrderTime: t,
OrderTime: strconv.Itoa(int(updateDividendsOrderCommand.OrderTime * 1000)),
Remarks: updateDividendsOrderCommand.Remarks,
RegionName: updateDividendsOrderCommand.RegionName,
OrderGoods: orderGoods,
... ...
package command
import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
type SearchFeedbackCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 页面大小
PageNumber int64 ` json:"pageNumber"`
// 页面大小
PageSize int64 ` json:"pageSize"`
ContractName string `json:"contractName"`
UndertakerName string `json:"undertakerName"`
}
... ...
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/undertakerFeedback/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// UndertakerFeedbackService 承接反馈服务
type UndertakerFeedbackService struct {
}
// CreateCooperationProject 承接反馈列表
func (srv UndertakerFeedbackService) SearchFeedback(cmd *command.SearchFeedbackCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.ContractUndertakerFeedbackSearch(allied_creation_cooperation.ReqContractUndertakerFeedbackSearch{
PageNumber: cmd.PageNumber,
PageSize: cmd.PageSize,
CooperationContractName: cmd.ContractName,
UndertakerName: cmd.UndertakerName,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
}
... ...
... ... @@ -12,6 +12,7 @@ import (
// DividendsOrderAdd 创建分红订单
func (gateway HttplibAlliedCreationCooperation) DividendsOrderAdd(param ReqDividendsOrderAdd) (*DataDividendsOrderAdd, error) {
param.SalesmanUid = "1" //TODO 调试用删除
url := gateway.baseUrL + "/dividends-orders"
method := "POST"
req := gateway.CreateRequest(url, method)
... ... @@ -43,6 +44,7 @@ func (gateway HttplibAlliedCreationCooperation) DividendsOrderAdd(param ReqDivid
// DividendsOrderUpdate 更新分红订单
func (gateway HttplibAlliedCreationCooperation) DividendsOrderUpdate(param ReqDividendsOrderUpdate) (*DataDividendsOrderUpdate, error) {
param.SalesmanUid = "1" //TODO 调试用删除
url := gateway.baseUrL + "/dividends-orders/" + strconv.Itoa(param.DividendsOrderId)
method := "PUT"
req := gateway.CreateRequest(url, method)
... ...
... ... @@ -36,9 +36,11 @@ type (
type (
ReqContractUndertakerFeedbackSearch struct {
// 页面大小
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
PageNumber int64 `json:"pageNumber"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
PageSize int64 `json:"pageSize"`
UndertakerName string `json:"undertakerName"`
CooperationContractName string `json:"cooperationContractName"`
}
DataContractUndertakerFeedbackSearch struct {
... ...
... ... @@ -175,16 +175,16 @@ type (
//更新共创合约
type (
ReqCooperationContractUpdate struct {
CooperationContractId int `json:"cooperationContractId"` // 共创合约id
CooperationContractDescription string `json:"cooperationContractDescription"` //共创
CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号
CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号,
DepartmentId string `json:"departmentId"` // 共创合约发起部门id
CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"` // 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractName string `json:"cooperationContractName"` // 共创合约名称
CooperationModeNumber string `json:"cooperationModeNumber"` // 共创模式编码,
SponsorUid string `json:"sponsorUid,omitempty,"` // 共创合约发起人uid
DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"` // 金额激励规则列表
CooperationContractId int `json:"cooperationContractId,string"` // 共创合约id
CooperationContractDescription string `json:"cooperationContractDescription"` //共创
CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号
CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号,
DepartmentId string `json:"departmentId"` // 共创合约发起部门id
CooperationContractUndertakerType []int `json:"cooperationContractUndertakerTypes"` // 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractName string `json:"cooperationContractName"` // 共创合约名称
CooperationModeNumber string `json:"cooperationModeNumber"` // 共创模式编码,
SponsorUid string `json:"sponsorUid,omitempty,"` // 共创合约发起人uid
DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"` // 金额激励规则列表
MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"`
Undertakers []Undertaker `json:"undertakers"` // 承接方列表 // 业绩分红激励规则列表
RelevantIds []string `json:"relevantIds"` //关联业务员
... ...
... ... @@ -6,7 +6,7 @@ import "time"
type DividendsOrder struct {
Company struct {
CompanyID int `json:"companyId"`
CompanyID int `json:"companyId,string"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
... ... @@ -14,22 +14,22 @@ type DividendsOrder struct {
DividendStatus int `json:"dividendStatus"` //分红订单分红状态,1待分红,2已分红,3部分分红
DividendTime time.Time `json:"dividendTime"` //分红订单分红时间
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderID int `json:"dividendsOrderId"` //分红订单
DividendsOrderID int `json:"dividendsOrderId,string"` //分红订单
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OrderSalesman struct { //订单业务员
Department struct {
DepartmentID int `json:"departmentId"`
DepartmentID int `json:"departmentId,string"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
IsOrganization bool `json:"isOrganization"`
} `json:"department"`
Org struct {
OrgID int `json:"orgId"`
OrgID int `json:"orgId,string"`
OrgName string `json:"orgName"`
} `json:"org"`
UserBaseID int `json:"userBaseId"`
UserID int `json:"userId"`
UserBaseID int `json:"userBaseId,string"`
UserID int `json:"userId,string"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
... ... @@ -41,7 +41,7 @@ type DividendsOrder struct {
} `json:"orderSalesman"`
OrderTime time.Time `json:"orderTime"`
Org struct {
OrgID int `json:"orgId"`
OrgID int `json:"orgId,string"`
OrgName string `json:"orgName"`
} `json:"org"`
Region struct {
... ... @@ -62,14 +62,15 @@ type (
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
}
ReqDividendsOrderAdd struct {
CompanyId int `json:"companyId"`
CompanyId int `json:"companyId,string"`
CustomerName string `json:"customerName"` //客户名称
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OperatorUid int `json:"operatorUid"` //订单操作人id
OperatorUid int `json:"operatorUid,string"` //订单操作人id
OrderGoods []DividendsOrderGoods `json:"orderGoods"` //订单产品列表
OrderTime time.Time `json:"orderTime"` //订单产生时间
OrderTime string `json:"orderTime"` //订单日期,13位长度字符串类型时间戳
Remarks string `json:"remarks"` //备注
UserId int `json:"userId"` //
UserId int `json:"userId,string"` //
SalesmanUid string `json:"salesmanUid"` //订单业务员uid
RegionName string `json:"regionName"` //区域名称
}
... ... @@ -81,18 +82,18 @@ type (
//更新分红订单
type (
ReqDividendsOrderUpdate struct {
DividendsOrderId int `json:"dividendsOrderId"`
CompanyId int `json:"companyId"`
DividendsOrderId int `json:"dividendsOrderId,string"`
CompanyId int `json:"companyId,string"`
CustomerName string `json:"customerName"` //客户名称
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OperatorUid int `json:"operatorUid"` //订单操作人id
OperatorUid int `json:"operatorUid,string"` //订单操作人id
OrderGoods []DividendsOrderGoods `json:"orderGoods"` //订单产品列表
OrderTime time.Time `json:"orderTime"` //订单产生时间
OrderTime string `json:"orderTime"` //订单日期,13位长度字符串类型时间戳
Remarks string `json:"remarks"` //备注
SalesmanUid string `json:"salesmanUid"` //订单业务员uid
UserId int `json:"userId"` //
UserId int `json:"userId,string"` //
RegionName string `json:"regionName"` //区域名称
}
... ...
... ... @@ -18,6 +18,7 @@ func (controller *DividendsOrderController) CreateDividendsOrder() {
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
createDividendsOrderCommand.Operator = controller.GetOperator()
data, err := dividendsOrderService.CreateDividendsOrder(createDividendsOrderCommand)
controller.Response(data, err)
}
... ... @@ -30,6 +31,7 @@ func (controller *DividendsOrderController) UpdateDividendsOrder() {
log.Logger.Debug("json err:" + err.Error())
}
orderId, _ := controller.GetInt(":orderId")
updateDividendsOrderCommand.Operator = controller.GetOperator()
updateDividendsOrderCommand.DividendsOrderID = orderId
data, err := dividendsOrderService.UpdateDividendsOrder(updateDividendsOrderCommand)
controller.Response(data, err)
... ... @@ -43,6 +45,7 @@ func (controller *DividendsOrderController) RemoveDividendsOrder() {
log.Logger.Debug("json err:" + err.Error())
}
removeDividendsOrderCommand.Operator = controller.GetOperator()
data, err := dividendsOrderService.RemoveDividendsOrder(removeDividendsOrderCommand)
controller.Response(data, err)
}
... ...
package web_client
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/undertakerFeedback/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/undertakerFeedback/service"
)
type UndertakerFeedbackController struct {
baseController
}
//SearchFeedback ...
func (controller *UndertakerFeedbackController) SearchFeedback() {
svr := service.UndertakerFeedbackService{}
cmd := &command.SearchFeedbackCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.SearchFeedback(cmd)
controller.Response(data, err)
}
... ...
package routers
import (
"github.com/beego/beego/v2/server/web"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client"
)
func init() {
web.Router("/v1/web/contract-undertaker-feedbacks/search", &web_client.UndertakerFeedbackController{}, "Post:SearchFeedback")
}
... ...