正在显示
6 个修改的文件
包含
218 行增加
和
31 行删除
| @@ -670,16 +670,12 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent | @@ -670,16 +670,12 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent | ||
| 670 | } | 670 | } |
| 671 | } | 671 | } |
| 672 | 672 | ||
| 673 | - dividendsEstimatesSaved, err := dividendsEstimateRepository.SaveMany(dividendsEstimates) | ||
| 674 | - if err != nil { | ||
| 675 | - return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 676 | - } | ||
| 677 | if err := transactionContext.CommitTransaction(); err != nil { | 673 | if err := transactionContext.CommitTransaction(); err != nil { |
| 678 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 674 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
| 679 | } | 675 | } |
| 680 | // TODO 分析成功和失败原因 | 676 | // TODO 分析成功和失败原因 |
| 681 | 677 | ||
| 682 | - return dividendsEstimatesSaved, nil | 678 | + return dividendsEstimatesSavedSuccessfully, nil |
| 683 | } | 679 | } |
| 684 | } | 680 | } |
| 685 | 681 |
| @@ -2,14 +2,26 @@ package command | @@ -2,14 +2,26 @@ package command | ||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| 5 | + "github.com/beego/beego/v2/core/validation" | ||
| 5 | "reflect" | 6 | "reflect" |
| 6 | "strings" | 7 | "strings" |
| 7 | "time" | 8 | "time" |
| 8 | - | ||
| 9 | - "github.com/beego/beego/v2/core/validation" | ||
| 10 | ) | 9 | ) |
| 11 | 10 | ||
| 12 | type ImportDividendsOrderCommand struct { | 11 | type ImportDividendsOrderCommand struct { |
| 12 | + // 订单数据列表 | ||
| 13 | + DividendsOrderData []*DividendsOrderData `cname:"订单数据列表" json:"dividendsOrderData" valid:"Required"` | ||
| 14 | + // 公司ID,通过集成REST上下文获取 | ||
| 15 | + CompanyId int64 `cname:"公司ID" json:"companyId"` | ||
| 16 | + // 组织机构ID | ||
| 17 | + OrgId int64 `cname:"组织机构ID" json:"orgId"` | ||
| 18 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
| 19 | + UserId int64 `cname:"用户ID" json:"userId"` | ||
| 20 | + // 用户基础信息id | ||
| 21 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"` | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +type DividendsOrderData struct { | ||
| 13 | // 客户名称 | 25 | // 客户名称 |
| 14 | CustomerName string `cname:"客户名称" json:"customerName" valid:"Required"` | 26 | CustomerName string `cname:"客户名称" json:"customerName" valid:"Required"` |
| 15 | // 分红订单金额 | 27 | // 分红订单金额 |
| @@ -20,24 +32,16 @@ type ImportDividendsOrderCommand struct { | @@ -20,24 +32,16 @@ type ImportDividendsOrderCommand struct { | ||
| 20 | DividendsOriginalOrderNum string `cname:"分红订单原单号" json:"dividendsOriginalOrderNum" valid:"Required"` | 32 | DividendsOriginalOrderNum string `cname:"分红订单原单号" json:"dividendsOriginalOrderNum" valid:"Required"` |
| 21 | // 订单产生时间 | 33 | // 订单产生时间 |
| 22 | OrderTime time.Time `cname:"订单产生时间" json:"orderTime" valid:"Required"` | 34 | OrderTime time.Time `cname:"订单产生时间" json:"orderTime" valid:"Required"` |
| 23 | - // 备注 | ||
| 24 | - Remarks string `cname:"备注" json:"remarks" valid:"Required"` | ||
| 25 | // 订单区域名称 | 35 | // 订单区域名称 |
| 26 | RegionName string `cname:"订单区域名称" json:"regionName,omitempty"` | 36 | RegionName string `cname:"订单区域名称" json:"regionName,omitempty"` |
| 27 | // 订单业务员uid | 37 | // 订单业务员uid |
| 28 | SalesmanUid string `cname:"订单业务员UID" json:"salesmanUid,omitempty"` | 38 | SalesmanUid string `cname:"订单业务员UID" json:"salesmanUid,omitempty"` |
| 29 | - // 订单操作人uid | ||
| 30 | - OperatorUid string `cname:"订单操作人UID" json:"operatorUid,omitempty"` | ||
| 31 | // 订单产品列表 | 39 | // 订单产品列表 |
| 32 | OrderGoods []*OrderGoods `cname:"订单产品列表" json:"orderGoods,omitempty"` | 40 | OrderGoods []*OrderGoods `cname:"订单产品列表" json:"orderGoods,omitempty"` |
| 33 | - // 公司ID,通过集成REST上下文获取 | ||
| 34 | - CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
| 35 | - // 组织机构ID | ||
| 36 | - OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
| 37 | - // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
| 38 | - UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
| 39 | - // 用户基础信息id | ||
| 40 | - UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | 41 | + // 订单操作人uid |
| 42 | + OperatorUid string `cname:"订单操作人UID" json:"operatorUid,omitempty"` | ||
| 43 | + // 备注 | ||
| 44 | + Remarks string `cname:"备注" json:"remarks,omitempty"` | ||
| 41 | } | 45 | } |
| 42 | 46 | ||
| 43 | func (importDividendsOrderCommand *ImportDividendsOrderCommand) Valid(validation *validation.Validation) { | 47 | func (importDividendsOrderCommand *ImportDividendsOrderCommand) Valid(validation *validation.Validation) { |
| @@ -162,6 +162,7 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD | @@ -162,6 +162,7 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD | ||
| 162 | UpdatedAt: time.Time{}, | 162 | UpdatedAt: time.Time{}, |
| 163 | OperateTime: time.Now(), | 163 | OperateTime: time.Now(), |
| 164 | Operator: operator, | 164 | Operator: operator, |
| 165 | + Remarks: createDividendsOrderCommand.Remarks, | ||
| 165 | } | 166 | } |
| 166 | 167 | ||
| 167 | // 分红订单仓储初始化 | 168 | // 分红订单仓储初始化 |
| @@ -183,6 +184,174 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD | @@ -183,6 +184,174 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD | ||
| 183 | } | 184 | } |
| 184 | } | 185 | } |
| 185 | 186 | ||
| 187 | +// ImportDividendsOrder 导入分红订单实体对象 | ||
| 188 | +func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importDividendsOrderCommand *command.ImportDividendsOrderCommand) (interface{}, error) { | ||
| 189 | + if err := importDividendsOrderCommand.ValidateCommand(); err != nil { | ||
| 190 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
| 191 | + } | ||
| 192 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
| 193 | + if err != nil { | ||
| 194 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 195 | + } | ||
| 196 | + if err := transactionContext.StartTransaction(); err != nil { | ||
| 197 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 198 | + } | ||
| 199 | + defer func() { | ||
| 200 | + _ = transactionContext.RollbackTransaction() | ||
| 201 | + }() | ||
| 202 | + | ||
| 203 | + // 公司REST服务初始化 | ||
| 204 | + var companyService service.CompanyService | ||
| 205 | + if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil { | ||
| 206 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
| 207 | + } else { | ||
| 208 | + companyService = value | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + // 获取公司信息 | ||
| 212 | + var company *domain.Company | ||
| 213 | + if data, err := companyService.CompanyFrom(importDividendsOrderCommand.CompanyId); err != nil { | ||
| 214 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
| 215 | + } else { | ||
| 216 | + company = data | ||
| 217 | + } | ||
| 218 | + | ||
| 219 | + // 组织机构REST服务初始化 | ||
| 220 | + var organizationService service.OrgService | ||
| 221 | + if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil { | ||
| 222 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
| 223 | + } else { | ||
| 224 | + organizationService = value | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + // 获取组织机构信息 | ||
| 228 | + var organization *domain.Org | ||
| 229 | + if data, err := organizationService.OrgFrom(importDividendsOrderCommand.CompanyId, importDividendsOrderCommand.OrgId); err != nil { | ||
| 230 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
| 231 | + } else { | ||
| 232 | + organization = data | ||
| 233 | + } | ||
| 234 | + | ||
| 235 | + // 用户REST服务初始化 | ||
| 236 | + var userService service.UserService | ||
| 237 | + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil { | ||
| 238 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
| 239 | + } else { | ||
| 240 | + userService = value | ||
| 241 | + } | ||
| 242 | + | ||
| 243 | + // 获取操作人 | ||
| 244 | + var operator *domain.User | ||
| 245 | + if data, err := userService.OperatorFrom(importDividendsOrderCommand.CompanyId, importDividendsOrderCommand.OrgId, importDividendsOrderCommand.UserId); err != nil { | ||
| 246 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
| 247 | + } else { | ||
| 248 | + operator = data | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + // 分红订单DAO初始化 | ||
| 252 | + var dividendsOrderDao *dao.DividendsOrderDao | ||
| 253 | + if value, err := factory.CreateDividendsOrderDao(map[string]interface{}{ | ||
| 254 | + "transactionContext": transactionContext, | ||
| 255 | + }); err != nil { | ||
| 256 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 257 | + } else { | ||
| 258 | + dividendsOrderDao = value | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + var dividendsOrderImportFailed []*domain.DividendsOrder | ||
| 262 | + var dividendsOrderImportSuccesfully []*domain.DividendsOrder | ||
| 263 | + | ||
| 264 | + for _, dividendsOrder := range importDividendsOrderCommand.DividendsOrderData { | ||
| 265 | + // 生成分红订单号 | ||
| 266 | + dividendsOrderNumber, err := dividendsOrderDao.GenerateDividendsOrderNumber() | ||
| 267 | + if err != nil { | ||
| 268 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 269 | + } | ||
| 270 | + | ||
| 271 | + // 校验分红订单编号是否唯一 | ||
| 272 | + numberAvailable, err := dividendsOrderDao.CheckDividendsOrderNumberAvailable(map[string]interface{}{ | ||
| 273 | + "companyId": importDividendsOrderCommand.CompanyId, | ||
| 274 | + "orgId": importDividendsOrderCommand.OrgId, | ||
| 275 | + "dividendsOrderNumber": dividendsOrderNumber, | ||
| 276 | + }) | ||
| 277 | + if err != nil { | ||
| 278 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 279 | + } | ||
| 280 | + if !numberAvailable { | ||
| 281 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, "新增分红订单异常") | ||
| 282 | + } | ||
| 283 | + | ||
| 284 | + // 新增订单产品 | ||
| 285 | + var orderGoods []*domain.OrderGood | ||
| 286 | + var dividendsOrderAmount float64 | ||
| 287 | + for _, orderGood := range dividendsOrder.OrderGoods { | ||
| 288 | + orderGoods = append(orderGoods, &domain.OrderGood{ | ||
| 289 | + OrderGoodId: 0, | ||
| 290 | + OrderGoodAmount: orderGood.OrderGoodAmount, | ||
| 291 | + OrderGoodName: orderGood.OrderGoodName, | ||
| 292 | + OrderGoodPrice: orderGood.OrderGoodPrice, | ||
| 293 | + OrderGoodQuantity: orderGood.OrderGoodQuantity, | ||
| 294 | + DividendsOrderNumber: dividendsOrderNumber, | ||
| 295 | + DividendsReturnedOrderNumber: "", | ||
| 296 | + CooperationContractNumber: orderGood.CooperationContractNumber, | ||
| 297 | + OrderGoodExpense: orderGood.OrderGoodExpense, | ||
| 298 | + OrgId: importDividendsOrderCommand.OrgId, | ||
| 299 | + CompanyId: importDividendsOrderCommand.CompanyId, | ||
| 300 | + CreatedAt: time.Time{}, | ||
| 301 | + DeletedAt: time.Time{}, | ||
| 302 | + UpdatedAt: time.Time{}, | ||
| 303 | + }) | ||
| 304 | + // 计算分红订单金额 | ||
| 305 | + dividendsOrderAmount = dividendsOrderAmount + orderGood.OrderGoodAmount | ||
| 306 | + } | ||
| 307 | + | ||
| 308 | + // 新增分红订单 | ||
| 309 | + newDividendsOrder := &domain.DividendsOrder{ | ||
| 310 | + DividendsOrderId: 0, | ||
| 311 | + DividendsOrderNumber: dividendsOrderNumber, | ||
| 312 | + DividendsOriginalOrderNum: dividendsOrder.DividendsOriginalOrderNum, | ||
| 313 | + DividendsOrderAmount: dividendsOrderAmount, | ||
| 314 | + OrderTime: dividendsOrder.OrderTime, | ||
| 315 | + DividendTime: time.Time{}, | ||
| 316 | + DividendStatus: domain.TO_BE_DIVIDEND, | ||
| 317 | + Region: &domain.RegionInfo{ | ||
| 318 | + RegionNumber: "", | ||
| 319 | + RegionName: dividendsOrder.RegionName, | ||
| 320 | + }, | ||
| 321 | + CustomerName: dividendsOrder.CustomerName, | ||
| 322 | + Goods: orderGoods, | ||
| 323 | + Org: organization, | ||
| 324 | + Company: company, | ||
| 325 | + CreatedAt: time.Now(), | ||
| 326 | + DeletedAt: time.Time{}, | ||
| 327 | + UpdatedAt: time.Time{}, | ||
| 328 | + OperateTime: time.Now(), | ||
| 329 | + Operator: operator, | ||
| 330 | + } | ||
| 331 | + | ||
| 332 | + // 分红订单仓储初始化 | ||
| 333 | + var dividendsOrderRepository domain.DividendsOrderRepository | ||
| 334 | + if value, err1 := factory.CreateDividendsOrderRepository(map[string]interface{}{ | ||
| 335 | + "transactionContext": transactionContext, | ||
| 336 | + }); err1 != nil { | ||
| 337 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err1.Error()) | ||
| 338 | + } else { | ||
| 339 | + dividendsOrderRepository = value | ||
| 340 | + } | ||
| 341 | + if dividendsOrderSaved, err2 := dividendsOrderRepository.Save(newDividendsOrder); err2 != nil { | ||
| 342 | + dividendsOrderImportFailed = append(dividendsOrderImportFailed, newDividendsOrder) | ||
| 343 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err2.Error()) | ||
| 344 | + } else { | ||
| 345 | + dividendsOrderImportSuccesfully = append(dividendsOrderImportSuccesfully, dividendsOrderSaved) | ||
| 346 | + return dividendsOrderSaved, nil | ||
| 347 | + } | ||
| 348 | + } | ||
| 349 | + if err3 := transactionContext.CommitTransaction(); err3 != nil { | ||
| 350 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err3.Error()) | ||
| 351 | + } | ||
| 352 | + return nil, nil | ||
| 353 | +} | ||
| 354 | + | ||
| 186 | // GetDividendsOrder 返回分红订单实体对象 | 355 | // GetDividendsOrder 返回分红订单实体对象 |
| 187 | func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividendsOrderQuery *query.GetDividendsOrderQuery) (interface{}, error) { | 356 | func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividendsOrderQuery *query.GetDividendsOrderQuery) (interface{}, error) { |
| 188 | if err := getDividendsOrderQuery.ValidateQuery(); err != nil { | 357 | if err := getDividendsOrderQuery.ValidateQuery(); err != nil { |
| @@ -2,36 +2,41 @@ package command | @@ -2,36 +2,41 @@ package command | ||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| 5 | + "github.com/beego/beego/v2/core/validation" | ||
| 5 | "reflect" | 6 | "reflect" |
| 6 | "strings" | 7 | "strings" |
| 7 | "time" | 8 | "time" |
| 8 | - | ||
| 9 | - "github.com/beego/beego/v2/core/validation" | ||
| 10 | ) | 9 | ) |
| 11 | 10 | ||
| 12 | -type ImportDividendsReturnedOrderCommand struct { | 11 | +// DividendsReturnedOrderData 分红退货单数据 |
| 12 | +type DividendsReturnedOrderData struct { | ||
| 13 | // 退货金额 | 13 | // 退货金额 |
| 14 | DividendsReturnedOrderRefund float64 `cname:"退货金额" json:"dividendsReturnedOrderRefund" valid:"Required"` | 14 | DividendsReturnedOrderRefund float64 `cname:"退货金额" json:"dividendsReturnedOrderRefund" valid:"Required"` |
| 15 | // 退货客户名称 | 15 | // 退货客户名称 |
| 16 | DividendsReturnedCustomerName string `cname:"退货客户名称" json:"dividendsReturnedCustomerName" valid:"Required"` | 16 | DividendsReturnedCustomerName string `cname:"退货客户名称" json:"dividendsReturnedCustomerName" valid:"Required"` |
| 17 | // 来源单号,源单号,订单号 | 17 | // 来源单号,源单号,订单号 |
| 18 | OriginalOrderNum string `cname:"来源单号" json:"originalOrderNum" valid:"Required"` | 18 | OriginalOrderNum string `cname:"来源单号" json:"originalOrderNum" valid:"Required"` |
| 19 | - // 备注 | ||
| 20 | - Remarks string `cname:"备注" json:"remarks" valid:"Required"` | ||
| 21 | // 退货日期 | 19 | // 退货日期 |
| 22 | DividendsReturnedDate time.Time `cname:"退货日期" json:"dividendsReturnedDate" valid:"Required"` | 20 | DividendsReturnedDate time.Time `cname:"退货日期" json:"dividendsReturnedDate" valid:"Required"` |
| 23 | // 退货区域名称 | 21 | // 退货区域名称 |
| 24 | - RegionName string `cname:"退货区域名称" json:"regionName,omitempty"` | 22 | + RegionName string `cname:"退货区域名称" json:"regionName"` |
| 25 | // 订单产品列表 | 23 | // 订单产品列表 |
| 26 | - OrderGoods []*OrderGoods `cname:"订单产品列表" json:"orderGoods,omitempty"` | 24 | + OrderGoods []*OrderGoods `cname:"订单产品列表" json:"orderGoods"` |
| 25 | + // 备注 | ||
| 26 | + Remarks string `cname:"备注" json:"remarks"` | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +type ImportDividendsReturnedOrderCommand struct { | ||
| 30 | + // 分红退货单数据 | ||
| 31 | + DividendsReturnedOrderData []*DividendsReturnedOrderData `cname:"分红退货单数据列表" json:"dividendsReturnedOrderData" valid:"Required"` | ||
| 27 | // 公司ID,通过集成REST上下文获取 | 32 | // 公司ID,通过集成REST上下文获取 |
| 28 | - CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | 33 | + CompanyId int64 `cname:"公司ID" json:"companyId"` |
| 29 | // 组织机构ID | 34 | // 组织机构ID |
| 30 | - OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | 35 | + OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 31 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 36 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 32 | - UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | 37 | + UserId int64 `cname:"用户ID" json:"userId"` |
| 33 | // 用户基础数据id | 38 | // 用户基础数据id |
| 34 | - UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | 39 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"` |
| 35 | } | 40 | } |
| 36 | 41 | ||
| 37 | func (importDividendsReturnedOrderCommand *ImportDividendsReturnedOrderCommand) Valid(validation *validation.Validation) { | 42 | func (importDividendsReturnedOrderCommand *ImportDividendsReturnedOrderCommand) Valid(validation *validation.Validation) { |
| @@ -131,7 +131,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDivide | @@ -131,7 +131,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDivide | ||
| 131 | 131 | ||
| 132 | newDividendsReturnedOrder := &domain.DividendsReturnedOrder{ | 132 | newDividendsReturnedOrder := &domain.DividendsReturnedOrder{ |
| 133 | DividendsReturnedOrderNumber: dividendsReturnedOrderNumber, | 133 | DividendsReturnedOrderNumber: dividendsReturnedOrderNumber, |
| 134 | - DividendsReturnedOrderRefund: 0, | 134 | + DividendsReturnedOrderRefund: createDividendsReturnedOrderCommand.DividendsReturnedOrderRefund, |
| 135 | OriginalOrderNum: createDividendsReturnedOrderCommand.OriginalOrderNum, | 135 | OriginalOrderNum: createDividendsReturnedOrderCommand.OriginalOrderNum, |
| 136 | DividendsOrderNumber: createDividendsReturnedOrderCommand.DividendsOrderNumber, | 136 | DividendsOrderNumber: createDividendsReturnedOrderCommand.DividendsOrderNumber, |
| 137 | DividendsReturnedCustomerName: createDividendsReturnedOrderCommand.DividendsReturnedCustomerName, | 137 | DividendsReturnedCustomerName: createDividendsReturnedOrderCommand.DividendsReturnedCustomerName, |
| @@ -23,6 +23,19 @@ func (controller *DividendsOrderController) CreateDividendsOrder() { | @@ -23,6 +23,19 @@ func (controller *DividendsOrderController) CreateDividendsOrder() { | ||
| 23 | controller.Response(data, err) | 23 | controller.Response(data, err) |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | +func (controller *DividendsOrderController) ImportDividendsOrder() { | ||
| 27 | + dividendsOrderService := service.NewDividendsOrderService(nil) | ||
| 28 | + importDividendsOrderCommand := &command.ImportDividendsOrderCommand{} | ||
| 29 | + _ = controller.Unmarshal(importDividendsOrderCommand) | ||
| 30 | + header := controller.GetRequestHeader(controller.Ctx) | ||
| 31 | + importDividendsOrderCommand.CompanyId = header.CompanyId | ||
| 32 | + importDividendsOrderCommand.OrgId = header.OrgId | ||
| 33 | + importDividendsOrderCommand.UserId = header.UserId | ||
| 34 | + importDividendsOrderCommand.UserBaseId = header.UserBaseId | ||
| 35 | + data, err := dividendsOrderService.ImportDividendsOrder(importDividendsOrderCommand) | ||
| 36 | + controller.Response(data, err) | ||
| 37 | +} | ||
| 38 | + | ||
| 26 | func (controller *DividendsOrderController) UpdateDividendsOrder() { | 39 | func (controller *DividendsOrderController) UpdateDividendsOrder() { |
| 27 | dividendsOrderService := service.NewDividendsOrderService(nil) | 40 | dividendsOrderService := service.NewDividendsOrderService(nil) |
| 28 | updateDividendsOrderCommand := &command.UpdateDividendsOrderCommand{} | 41 | updateDividendsOrderCommand := &command.UpdateDividendsOrderCommand{} |
-
请 注册 或 登录 后发表评论