...
|
...
|
@@ -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())
|
|
|
}
|
...
|
...
|
|