...
|
...
|
@@ -20,11 +20,23 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDivide |
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createDividendsReturnedOrderCommand.Operator)
|
|
|
dividendsReturnedDate := time.Unix(createDividendsReturnedOrderCommand.DividendsReturnedDate/1e3, 0)
|
|
|
orderDate := time.Unix(createDividendsReturnedOrderCommand.OrderDate/1e3, 0)
|
|
|
var orderGooods []allied_creation_cooperation.ReqDividendsReturnedOrderGood
|
|
|
for _, v := range createDividendsReturnedOrderCommand.OrderGoods {
|
|
|
good := allied_creation_cooperation.ReqDividendsReturnedOrderGood{
|
|
|
CooperationContractNumber: v.CooperationContractNumber,
|
|
|
OrderGoodAmount: 0,
|
|
|
OrderGoodName: v.OrderGoodName,
|
|
|
OrderGoodPrice: v.OrderGoodPrice,
|
|
|
OrderGoodQuantity: v.OrderGoodQuantity,
|
|
|
}
|
|
|
good.OrderGoodPrice = good.OrderGoodPrice * float64(good.OrderGoodQuantity)
|
|
|
orderGooods = append(orderGooods, good)
|
|
|
}
|
|
|
result, err := creationCooperationGateway.DividendsReturnedOrderAdd(allied_creation_cooperation.ReqDividendsReturnedOrderAdd{
|
|
|
DividendsReturnedCustomerName: createDividendsReturnedOrderCommand.DividendsReturnedCustomerName,
|
|
|
DividendsOrderNumber: createDividendsReturnedOrderCommand.DividendsOrderNumber,
|
|
|
OriginalOrderNum: createDividendsReturnedOrderCommand.OriginalOrderNum,
|
|
|
OrderGoods: createDividendsReturnedOrderCommand.OrderGoods,
|
|
|
OrderGoods: orderGooods,
|
|
|
DividendsReturnedDate: dividendsReturnedDate,
|
|
|
OrderData: orderDate,
|
|
|
OrgId: int(createDividendsReturnedOrderCommand.Operator.OrgId),
|
...
|
...
|
@@ -86,12 +98,24 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide |
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateDividendsReturnedOrderCommand.Operator)
|
|
|
dividendsReturnedDate := time.Unix(updateDividendsReturnedOrderCommand.DividendsReturnedDate/1e3, 0)
|
|
|
orderDate := time.Unix(updateDividendsReturnedOrderCommand.OrderDate/1e3, 0)
|
|
|
var orderGooods []allied_creation_cooperation.ReqDividendsReturnedOrderGood
|
|
|
for _, v := range updateDividendsReturnedOrderCommand.OrderGoods {
|
|
|
good := allied_creation_cooperation.ReqDividendsReturnedOrderGood{
|
|
|
CooperationContractNumber: v.CooperationContractNumber,
|
|
|
OrderGoodAmount: 0,
|
|
|
OrderGoodName: v.OrderGoodName,
|
|
|
OrderGoodPrice: v.OrderGoodPrice,
|
|
|
OrderGoodQuantity: v.OrderGoodQuantity,
|
|
|
}
|
|
|
good.OrderGoodPrice = good.OrderGoodPrice * float64(good.OrderGoodQuantity)
|
|
|
orderGooods = append(orderGooods, good)
|
|
|
}
|
|
|
_, err := creationCooperationGateway.DividendsReturnedOrderUpdate(allied_creation_cooperation.ReqDividendsReturnedOrderUpdate{
|
|
|
DividendsReturnedOrderID: updateDividendsReturnedOrderCommand.DividendsReturnedOrderID,
|
|
|
DividendsReturnedCustomerName: updateDividendsReturnedOrderCommand.DividendsReturnedCustomerName,
|
|
|
DividendsOrderNumber: updateDividendsReturnedOrderCommand.DividendsOrderNumber,
|
|
|
OriginalOrderNum: updateDividendsReturnedOrderCommand.OriginalOrderNum,
|
|
|
OrderGoods: updateDividendsReturnedOrderCommand.OrderGoods,
|
|
|
OrderGoods: orderGooods,
|
|
|
DividendsReturnedDate: dividendsReturnedDate,
|
|
|
OrderData: orderDate,
|
|
|
OrgId: int(updateDividendsReturnedOrderCommand.Operator.OrgId),
|
...
|
...
|
|