作者 tangxuhui

调试

... ... @@ -14,9 +14,8 @@ type CreateDividendsReturnedOrderCommand struct {
//货品
OrderGoods []allied_creation_cooperation.DividendsReturnedOrderGoods `json:"orderGoods"`
DividendsReturnedDate int `json:"dividendsReturnedDate"` //退货日期
OrderDate int `json:"orderDate"` //订单日期
DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期
OrderDate int64 `json:"orderDate"` //订单日期
Remarks string `json:"remarks"` //
RegionName string `json:"regionName"`
}
... ...
... ... @@ -8,5 +8,16 @@ import (
type UpdateDividendsReturnedOrderCommand struct {
//操作人
Operator domain.Operator `json:"-"`
allied_creation_cooperation.ReqDividendsReturnedOrderUpdate
DividendsReturnedOrderID int `json:"dividendsReturnedOrderId,string"` //分红退货单记录id
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号
OriginalOrderNum string `json:"originalOrderNum"` //源单号
//货品
OrderGoods []allied_creation_cooperation.DividendsReturnedOrderGoods `json:"orderGoods"`
DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期
OrderDate int64 `json:"orderDate"` //订单日期
Remarks string `json:"remarks"` //
RegionName string `json:"regionName"`
}
... ...
... ... @@ -2,6 +2,7 @@ package service
import (
"strconv"
"time"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command"
... ... @@ -16,23 +17,24 @@ type DividendsReturnedOrderService struct {
// 创建分红退货单服务
func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDividendsReturnedOrder(createDividendsReturnedOrderCommand *command.CreateDividendsReturnedOrderCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createDividendsReturnedOrderCommand.Operator)
_, err := creationCooperationGateway.DividendsReturnedOrderAdd(allied_creation_cooperation.ReqDividendsReturnedOrderAdd{
// DividendsReturnedCustomerName:createDividendsReturnedOrderCommand.DividendsReturnedCustomerName,
// DividendsOrderAmount :a
// DividendsOrderNumber
// DividendsReturnedOrderNumber
// OriginalOrderNum
// OrderGoods
// DividendsReturnedDate
// Remarks
// RegionName
dividendsReturnedDate := time.Unix(createDividendsReturnedOrderCommand.DividendsReturnedDate, 0)
orderDate := time.Unix(createDividendsReturnedOrderCommand.OrderDate, 0)
result, err := creationCooperationGateway.DividendsReturnedOrderAdd(allied_creation_cooperation.ReqDividendsReturnedOrderAdd{
DividendsReturnedCustomerName: createDividendsReturnedOrderCommand.DividendsReturnedCustomerName,
DividendsOrderNumber: createDividendsReturnedOrderCommand.DividendsOrderNumber,
OriginalOrderNum: createDividendsReturnedOrderCommand.OriginalOrderNum,
OrderGoods: createDividendsReturnedOrderCommand.OrderGoods,
DividendsReturnedDate: dividendsReturnedDate,
OrderData: orderDate,
OrgId: int(createDividendsReturnedOrderCommand.Operator.OrgId),
Remarks: createDividendsReturnedOrderCommand.Remarks,
RegionName: createDividendsReturnedOrderCommand.RegionName,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return createDividendsReturnedOrderCommand, nil
return dto.ToDividendsReturnedOrderInfo(&result.DividendsReturnedOrder), nil
}
// 返回分红退货单服务
... ... @@ -87,7 +89,20 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide
// 更新分红退货单服务
func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDividendsReturnedOrder(updateDividendsReturnedOrderCommand *command.UpdateDividendsReturnedOrderCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateDividendsReturnedOrderCommand.Operator)
_, err := creationCooperationGateway.DividendsReturnedOrderUpdate(updateDividendsReturnedOrderCommand.ReqDividendsReturnedOrderUpdate)
dividendsReturnedDate := time.Unix(updateDividendsReturnedOrderCommand.DividendsReturnedDate, 0)
orderDate := time.Unix(updateDividendsReturnedOrderCommand.OrderDate, 0)
_, err := creationCooperationGateway.DividendsReturnedOrderUpdate(allied_creation_cooperation.ReqDividendsReturnedOrderUpdate{
DividendsReturnedOrderID: updateDividendsReturnedOrderCommand.DividendsReturnedOrderID,
DividendsReturnedCustomerName: updateDividendsReturnedOrderCommand.DividendsReturnedCustomerName,
DividendsOrderNumber: updateDividendsReturnedOrderCommand.DividendsOrderNumber,
OriginalOrderNum: updateDividendsReturnedOrderCommand.OriginalOrderNum,
OrderGoods: updateDividendsReturnedOrderCommand.OrderGoods,
DividendsReturnedDate: dividendsReturnedDate,
OrderData: orderDate,
OrgId: int(updateDividendsReturnedOrderCommand.Operator.OrgId),
Remarks: updateDividendsReturnedOrderCommand.Remarks,
RegionName: updateDividendsReturnedOrderCommand.RegionName,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
... ...
... ... @@ -53,6 +53,8 @@ type DividendsOrder struct {
type (
//订单产品
DividendsOrderGoods struct {
// 订单产品
OrderGoodId int64 `json:"orderGoodId,string"`
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号
OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
... ... @@ -60,6 +62,7 @@ type (
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
OrderGoodDividendsStatus int32 `json:"OrderGoodDividendsStatus"` // 订单产品分红状态, 1待分红,2已分红
}
ReqDividendsOrderAdd struct {
CompanyId int `json:"companyId,string"`
... ...
... ... @@ -5,11 +5,13 @@ import "time"
//创建分红退货单
type (
DividendsReturnedOrderGoods struct {
OrderGoodId int64 `json:"orderGoodId,string"` // 订单产品id
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
}
DividendsReturnedOrder struct {
... ... @@ -48,36 +50,37 @@ type (
ReqDividendsReturnedOrderAdd struct {
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"`
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号
DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"`
OriginalOrderNum string `json:"originalOrderNum"`
OrderGoods []DividendsReturnedOrderGoods `json:"orderGoods"`
DividendsReturnedDate time.Time `json:"orderTime"`
DividendsReturnedDate time.Time `json:"dividendsReturnedDate"`
OrderData time.Time `json:"orderData"`
OrgId int `json:"orgId"`
Remarks string `json:"remarks"`
RegionName string `json:"regionName"`
}
DataDividendsReturnedOrderAdd struct {
DividendsReturnedOrder
}
)
//更新分红退货单
type (
ReqDividendsReturnedOrderUpdate struct {
DividendsReturnedOrderID int `json:"dividendsReturnedOrderId"` //分红退货单记录id
CustomerName string `json:"customerName"`
DividendsOrderAmount string `json:"dividendsOrderAmount"`
DividendsOrderNumber string `json:"dividendsOrderNumber"`
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`
DividendsReturnedOrderID int `json:"dividendsReturnedOrderId,string"` //分红退货单记录id
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"`
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号
OriginalOrderNum string `json:"originalOrderNum"`
OrderGoods []DividendsReturnedOrderGoods `json:"orderGoods"`
OrderTime time.Time `json:"orderTime"`
DividendsReturnedDate time.Time `json:"orderTime"`
OrderData time.Time `json:"orderData"`
OrgId int `json:"orgId"`
Remarks string `json:"remarks"`
SalesmanUid string `json:"salesmanUid"`
RegionName string `json:"regionName"`
}
DataDividendsReturnedOrderUpdate struct {
DividendsReturnedOrder
}
)
... ...