...
|
...
|
@@ -16,9 +16,9 @@ type DividendsOrderService struct { |
|
|
|
|
|
// 创建分红订单实体对象
|
|
|
func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createDividendsOrderCommand *command.CreateDividendsOrderCommand) (interface{}, error) {
|
|
|
if err := createDividendsOrderCommand.ValidateCommand(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
// if err := createDividendsOrderCommand.ValidateCommand(); err != nil {
|
|
|
// return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
// }
|
|
|
orderGoods := []allied_creation_cooperation.DividendsOrderGoodAdd{}
|
|
|
for _, v := range createDividendsOrderCommand.OrderGoods {
|
|
|
good := allied_creation_cooperation.DividendsOrderGoodAdd{
|
...
|
...
|
@@ -53,9 +53,9 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD |
|
|
|
|
|
// 返回分红订单实体对象
|
|
|
func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividendsOrderQuery *query.GetDividendsOrderQuery) (interface{}, error) {
|
|
|
if err := getDividendsOrderQuery.ValidateQuery(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
// if err := getDividendsOrderQuery.ValidateQuery(); err != nil {
|
|
|
// return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
// }
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(getDividendsOrderQuery.Operator)
|
|
|
result, err := creationCooperationGateway.DividendsOrderGet(allied_creation_cooperation.ReqDividendsOrderGet{
|
|
|
DividendsOrderId: getDividendsOrderQuery.DividendsOrderId,
|
...
|
...
|
@@ -68,9 +68,9 @@ func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividen |
|
|
|
|
|
// 移除分红订单实体对象
|
|
|
func (dividendsOrderService *DividendsOrderService) RemoveDividendsOrder(removeDividendsOrderCommand *command.RemoveDividendsOrderCommand) (interface{}, error) {
|
|
|
if err := removeDividendsOrderCommand.ValidateCommand(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
// if err := removeDividendsOrderCommand.ValidateCommand(); err != nil {
|
|
|
// return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
// }
|
|
|
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsOrderCommand.Operator)
|
|
|
_, err := creationCooperationGateway.DividendsOrderBatchRemove(allied_creation_cooperation.ReqDividendsOrderBatchRemove{
|
...
|
...
|
@@ -84,9 +84,9 @@ func (dividendsOrderService *DividendsOrderService) RemoveDividendsOrder(removeD |
|
|
|
|
|
// 查询分红订单方法
|
|
|
func (dividendsOrderService *DividendsOrderService) SearchDividendsOrder(searchDividendsOrderQuery *query.SearchDividendsOrderQuery) (int, interface{}, error) {
|
|
|
if err := searchDividendsOrderQuery.ValidateQuery(); err != nil {
|
|
|
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
// if err := searchDividendsOrderQuery.ValidateQuery(); err != nil {
|
|
|
// return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
// }
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(searchDividendsOrderQuery.Operator)
|
|
|
result, err := creationCooperationGateway.DividendsOrderSearch(allied_creation_cooperation.ReqDividendsOrderSearch{
|
|
|
PageNumber: searchDividendsOrderQuery.PageNumber,
|
...
|
...
|
@@ -107,9 +107,9 @@ func (dividendsOrderService *DividendsOrderService) SearchDividendsOrder(searchD |
|
|
|
|
|
// 更新分红订单实体对象
|
|
|
func (dividendsOrderService *DividendsOrderService) UpdateDividendsOrder(updateDividendsOrderCommand *command.UpdateDividendsOrderCommand) (interface{}, error) {
|
|
|
if err := updateDividendsOrderCommand.ValidateCommand(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
// if err := updateDividendsOrderCommand.ValidateCommand(); err != nil {
|
|
|
// return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
// }
|
|
|
orderGoods := []allied_creation_cooperation.DividendsOrderGoods{}
|
|
|
for _, v := range updateDividendsOrderCommand.OrderGoods {
|
|
|
good := allied_creation_cooperation.DividendsOrderGoods{
|
...
|
...
|
|