作者 陈志颖

fix:分红订单参数调整

@@ -18,27 +18,6 @@ import ( @@ -18,27 +18,6 @@ import (
18 type CooperationApplicationService struct { 18 type CooperationApplicationService struct {
19 } 19 }
20 20
21 -// ApprovalCooperationApplication 审核共创申请  
22 -func (cooperationApplicationService *CooperationApplicationService) ApprovalCooperationApplication(approvalCooperationApplicationCommand *command.ApprovalCooperationApplicationCommand) (interface{}, error) {  
23 - if err := approvalCooperationApplicationCommand.ValidateCommand(); err != nil {  
24 - return nil, application.ThrowError(application.ARG_ERROR, err.Error())  
25 - }  
26 - transactionContext, err := factory.CreateTransactionContext(nil)  
27 - if err != nil {  
28 - return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())  
29 - }  
30 - if err := transactionContext.StartTransaction(); err != nil {  
31 - return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())  
32 - }  
33 - defer func() {  
34 - _ = transactionContext.RollbackTransaction()  
35 - }()  
36 - if err := transactionContext.CommitTransaction(); err != nil {  
37 - return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())  
38 - }  
39 - return nil, nil  
40 -}  
41 -  
42 // ApplyForCooperation 申请共创 21 // ApplyForCooperation 申请共创
43 func (cooperationApplicationService *CooperationApplicationService) ApplyForCooperation(applyForCooperationCommand *command.ApplyForCooperationCommand) (interface{}, error) { 22 func (cooperationApplicationService *CooperationApplicationService) ApplyForCooperation(applyForCooperationCommand *command.ApplyForCooperationCommand) (interface{}, error) {
44 if err := applyForCooperationCommand.ValidateCommand(); err != nil { 23 if err := applyForCooperationCommand.ValidateCommand(); err != nil {
@@ -68,8 +47,6 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop @@ -68,8 +47,6 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
68 } 47 }
69 if cooperationProject == nil { 48 if cooperationProject == nil {
70 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", applyForCooperationCommand.CooperationProjectNumber)) 49 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", applyForCooperationCommand.CooperationProjectNumber))
71 - } else {  
72 -  
73 } 50 }
74 51
75 // 用户REST服务初始化 52 // 用户REST服务初始化
@@ -156,9 +133,73 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop @@ -156,9 +133,73 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
156 } 133 }
157 } 134 }
158 135
159 -// BatchApprovalCooperationApplication 一键审核共创申请  
160 -func (cooperationApplicationService *CooperationApplicationService) BatchApprovalCooperationApplication(batchApprovalCooperationApplicatonCommand *command.BatchApprovalCooperationApplicationCommand) (interface{}, error) {  
161 - if err := batchApprovalCooperationApplicatonCommand.ValidateCommand(); err != nil { 136 +// ApprovalCooperationApplication 审核共创申请
  137 +func (cooperationApplicationService *CooperationApplicationService) ApprovalCooperationApplication(approvalCooperationApplicationCommand *command.ApprovalCooperationApplicationCommand) (interface{}, error) {
  138 + if err := approvalCooperationApplicationCommand.ValidateCommand(); err != nil {
  139 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  140 + }
  141 + transactionContext, err := factory.CreateTransactionContext(nil)
  142 + if err != nil {
  143 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  144 + }
  145 + if err := transactionContext.StartTransaction(); err != nil {
  146 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  147 + }
  148 + defer func() {
  149 + _ = transactionContext.RollbackTransaction()
  150 + }()
  151 + var cooperationApplicationRepository domain.CooperationApplicationRepository
  152 + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
  153 + "transactionContext": transactionContext,
  154 + }); err != nil {
  155 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  156 + } else {
  157 + cooperationApplicationRepository = value
  158 + }
  159 + cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": approvalCooperationApplicationCommand.CooperationApplicationId})
  160 + if err != nil {
  161 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  162 + }
  163 + if cooperationApplication == nil {
  164 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(approvalCooperationApplicationCommand.CooperationApplicationId, 10)))
  165 + }
  166 + if err := cooperationApplication.Update(tool_funs.SimpleStructToMap(approvalCooperationApplicationCommand)); err != nil {
  167 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  168 + }
  169 + if cooperationApplicationSaved, err := cooperationApplicationRepository.Save(cooperationApplication); err != nil {
  170 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  171 + } else {
  172 + if err := transactionContext.CommitTransaction(); err != nil {
  173 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  174 + }
  175 + return cooperationApplicationSaved, nil
  176 + }
  177 +}
  178 +
  179 +// BatchApprovalCooperationApplication 批量审核共创申请
  180 +func (cooperationApplicationService *CooperationApplicationService) BatchApprovalCooperationApplication(batchApprovalCooperationApplicationCommand *command.BatchApprovalCooperationApplicationCommand) (interface{}, error) {
  181 + if err := batchApprovalCooperationApplicationCommand.ValidateCommand(); err != nil {
  182 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  183 + }
  184 + transactionContext, err := factory.CreateTransactionContext(nil)
  185 + if err != nil {
  186 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  187 + }
  188 + if err := transactionContext.StartTransaction(); err != nil {
  189 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  190 + }
  191 + defer func() {
  192 + _ = transactionContext.RollbackTransaction()
  193 + }()
  194 + if err := transactionContext.CommitTransaction(); err != nil {
  195 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  196 + }
  197 + return nil, nil
  198 +}
  199 +
  200 +// OneClickApprovalCooperationApplication 一键审核共创申请
  201 +func (cooperationApplicationService *CooperationApplicationService) OneClickApprovalCooperationApplication(oneClickApprovalCooperationApplicationCommand *command.OneClickApprovalCooperationApplicationCommand) (interface{}, error) {
  202 + if err := oneClickApprovalCooperationApplicationCommand.ValidateCommand(); err != nil {
162 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 203 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
163 } 204 }
164 transactionContext, err := factory.CreateTransactionContext(nil) 205 transactionContext, err := factory.CreateTransactionContext(nil)
@@ -35,8 +35,6 @@ type CreateDividendsOrderCommand struct { @@ -35,8 +35,6 @@ type CreateDividendsOrderCommand struct {
35 Remarks string `cname:"备注" json:"remarks" valid:"Required"` 35 Remarks string `cname:"备注" json:"remarks" valid:"Required"`
36 // 订单区域名称 36 // 订单区域名称
37 RegionName string `cname:"订单区域名称" json:"regionName,omitempty"` 37 RegionName string `cname:"订单区域名称" json:"regionName,omitempty"`
38 - // 订单业务员uid  
39 - SalesmanUid string `cname:"订单业务员uid" json:"salesmanUid,omitempty"`  
40 // 订单操作人uid 38 // 订单操作人uid
41 OperatorUid string `cname:"订单操作人uid" json:"operatorUid,omitempty"` 39 OperatorUid string `cname:"订单操作人uid" json:"operatorUid,omitempty"`
42 // 订单产品列表 40 // 订单产品列表
@@ -83,15 +83,6 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD @@ -83,15 +83,6 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
83 operator = data 83 operator = data
84 } 84 }
85 85
86 - // 获取业务员  
87 - commandSalesmanUid, _ := strconv.ParseInt(createDividendsOrderCommand.SalesmanUid, 10, 64)  
88 - var salesman *domain.Salesman  
89 - if data, err := userService.SalesmanFrom(createDividendsOrderCommand.CompanyId, createDividendsOrderCommand.OrgId, commandSalesmanUid); err != nil {  
90 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())  
91 - } else {  
92 - salesman = data  
93 - }  
94 -  
95 // 分红订单DAO初始化 86 // 分红订单DAO初始化
96 var dividendsOrderDao *dao.DividendsOrderDao 87 var dividendsOrderDao *dao.DividendsOrderDao
97 if value, err := factory.CreateDividendsOrderDao(map[string]interface{}{ 88 if value, err := factory.CreateDividendsOrderDao(map[string]interface{}{
@@ -154,7 +145,6 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD @@ -154,7 +145,6 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
154 DividendsOrderNumber: dividendsOrderNumber, 145 DividendsOrderNumber: dividendsOrderNumber,
155 DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum, 146 DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum,
156 DividendsOrderAmount: dividendsOrderAmount, 147 DividendsOrderAmount: dividendsOrderAmount,
157 - OrderSalesman: salesman,  
158 OrderTime: orderTime, 148 OrderTime: orderTime,
159 DividendTime: time.Time{}, 149 DividendTime: time.Time{},
160 DividendStatus: 0, 150 DividendStatus: 0,
@@ -260,7 +250,7 @@ func (dividendsOrderService *DividendsOrderService) ListDividendsOrders(listDivi @@ -260,7 +250,7 @@ func (dividendsOrderService *DividendsOrderService) ListDividendsOrders(listDivi
260 } 250 }
261 return map[string]interface{}{ 251 return map[string]interface{}{
262 "grid": map[string]interface{}{ 252 "grid": map[string]interface{}{
263 - "total": count, "list": dividendsOrders, 253 + "total": count, "list": dividendsOrders,
264 }, 254 },
265 }, nil 255 }, nil
266 } 256 }
@@ -40,6 +40,7 @@ type CooperationApplication struct { @@ -40,6 +40,7 @@ type CooperationApplication struct {
40 40
41 type CooperationApplicationRepository interface { 41 type CooperationApplicationRepository interface {
42 Save(cooperationApplication *CooperationApplication) (*CooperationApplication, error) 42 Save(cooperationApplication *CooperationApplication) (*CooperationApplication, error)
  43 + UpdateMany(cooperationApplications []*CooperationApplication) ([]*CooperationApplication, error)
43 Remove(cooperationApplication *CooperationApplication) (*CooperationApplication, error) 44 Remove(cooperationApplication *CooperationApplication) (*CooperationApplication, error)
44 FindOne(queryOptions map[string]interface{}) (*CooperationApplication, error) 45 FindOne(queryOptions map[string]interface{}) (*CooperationApplication, error)
45 Find(queryOptions map[string]interface{}) (int64, []*CooperationApplication, error) 46 Find(queryOptions map[string]interface{}) (int64, []*CooperationApplication, error)
@@ -12,8 +12,6 @@ type DividendsOrder struct { @@ -12,8 +12,6 @@ type DividendsOrder struct {
12 DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` 12 DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`
13 // 分红订单金额 13 // 分红订单金额
14 DividendsOrderAmount float64 `json:"dividendsOrderAmount"` 14 DividendsOrderAmount float64 `json:"dividendsOrderAmount"`
15 - // 订单业务员  
16 - OrderSalesman *Salesman `json:"orderSalesman"`  
17 // 订单日期 15 // 订单日期
18 OrderTime time.Time `json:"orderTime"` 16 OrderTime time.Time `json:"orderTime"`
19 // 分红订单分红时间 17 // 分红订单分红时间
@@ -69,45 +67,6 @@ func (dividendsOrder *DividendsOrder) Update(data map[string]interface{}) error @@ -69,45 +67,6 @@ func (dividendsOrder *DividendsOrder) Update(data map[string]interface{}) error
69 if dividendsOrderAmount, ok := data["dividendsOrderAmount"]; ok { 67 if dividendsOrderAmount, ok := data["dividendsOrderAmount"]; ok {
70 dividendsOrder.DividendsOrderAmount = dividendsOrderAmount.(float64) 68 dividendsOrder.DividendsOrderAmount = dividendsOrderAmount.(float64)
71 } 69 }
72 - if userId, ok := data["userId"]; ok {  
73 - dividendsOrder.OrderSalesman.UserId = userId.(int64)  
74 - }  
75 - if userBaseId, ok := data["userBaseId"]; ok {  
76 - dividendsOrder.OrderSalesman.UserBaseId = userBaseId.(int64)  
77 - }  
78 - if orgId, ok := data["orgId"]; ok {  
79 - dividendsOrder.OrderSalesman.Org.OrgId = orgId.(int64)  
80 - }  
81 - if orgName, ok := data["orgName"]; ok {  
82 - dividendsOrder.OrderSalesman.Org.OrgName = orgName.(string)  
83 - }  
84 - if companyId, ok := data["companyId"]; ok {  
85 - dividendsOrder.OrderSalesman.Org.Company.CompanyId = companyId.(int64)  
86 - }  
87 - if companyLogo, ok := data["companyLogo"]; ok {  
88 - dividendsOrder.OrderSalesman.Org.Company.CompanyLogo = companyLogo.(string)  
89 - }  
90 - if companyName, ok := data["companyName"]; ok {  
91 - dividendsOrder.OrderSalesman.Org.Company.CompanyName = companyName.(string)  
92 - }  
93 - if userAvatar, ok := data["userAvatar"]; ok {  
94 - dividendsOrder.OrderSalesman.UserInfo.UserAvatar = userAvatar.(string)  
95 - }  
96 - if userEmail, ok := data["userEmail"]; ok {  
97 - dividendsOrder.OrderSalesman.UserInfo.UserEmail = userEmail.(string)  
98 - }  
99 - if userName, ok := data["userName"]; ok {  
100 - dividendsOrder.OrderSalesman.UserInfo.UserName = userName.(string)  
101 - }  
102 - if userPhone, ok := data["userPhone"]; ok {  
103 - dividendsOrder.OrderSalesman.UserInfo.UserPhone = userPhone.(string)  
104 - }  
105 - if userAccount, ok := data["userAccount"]; ok {  
106 - dividendsOrder.OrderSalesman.UserInfo.UserAccount = userAccount.(string)  
107 - }  
108 - if userType, ok := data["userType"]; ok {  
109 - dividendsOrder.OrderSalesman.UserType = userType.(int32)  
110 - }  
111 if orderTime, ok := data["orderTime"]; ok { 70 if orderTime, ok := data["orderTime"]; ok {
112 dividendsOrder.OrderTime = orderTime.(time.Time) 71 dividendsOrder.OrderTime = orderTime.(time.Time)
113 } 72 }
@@ -15,8 +15,6 @@ type DividendsOrder struct { @@ -15,8 +15,6 @@ type DividendsOrder struct {
15 DividendsOriginalOrderNum string `comment:"分红订单原单号"` 15 DividendsOriginalOrderNum string `comment:"分红订单原单号"`
16 // 分红订单金额 16 // 分红订单金额
17 DividendsOrderAmount float64 `comment:"分红订单金额"` 17 DividendsOrderAmount float64 `comment:"分红订单金额"`
18 - // 订单业务员  
19 - OrderSalesman *domain.Salesman `comment:"订单业务员"`  
20 // 订单产生时间 18 // 订单产生时间
21 OrderTime time.Time `comment:"订单产生时间"` 19 OrderTime time.Time `comment:"订单产生时间"`
22 // 分红订单分红时间 20 // 分红订单分红时间
@@ -28,7 +28,6 @@ func TransformToDividendsOrderDomainModelFromPgModels(dividendsOrderModel *model @@ -28,7 +28,6 @@ func TransformToDividendsOrderDomainModelFromPgModels(dividendsOrderModel *model
28 DividendsOrderNumber: dividendsOrderModel.DividendsOrderNumber, 28 DividendsOrderNumber: dividendsOrderModel.DividendsOrderNumber,
29 DividendsOriginalOrderNum: dividendsOrderModel.DividendsOriginalOrderNum, 29 DividendsOriginalOrderNum: dividendsOrderModel.DividendsOriginalOrderNum,
30 DividendsOrderAmount: dividendsOrderModel.DividendsOrderAmount, 30 DividendsOrderAmount: dividendsOrderModel.DividendsOrderAmount,
31 - OrderSalesman: dividendsOrderModel.OrderSalesman,  
32 OrderTime: dividendsOrderModel.OrderTime, 31 OrderTime: dividendsOrderModel.OrderTime,
33 DividendTime: dividendsOrderModel.DividendTime, 32 DividendTime: dividendsOrderModel.DividendTime,
34 DividendStatus: dividendsOrderModel.DividendStatus, 33 DividendStatus: dividendsOrderModel.DividendStatus,
@@ -3,6 +3,7 @@ package repository @@ -3,6 +3,7 @@ package repository
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 "github.com/go-pg/pg/v10" 5 "github.com/go-pg/pg/v10"
  6 + "time"
6 7
7 "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" 8 "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
8 pgTransaction "github.com/linmadan/egglib-go/transaction/pg" 9 pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
@@ -141,6 +142,35 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication @@ -141,6 +142,35 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication
141 return cooperationApplication, nil 142 return cooperationApplication, nil
142 } 143 }
143 144
  145 +func (repository *CooperationApplicationRepository) UpdateMany(cooperationApplications []*domain.CooperationApplication) ([]*domain.CooperationApplication, error) {
  146 + tx := repository.transactionContext.PgTx
  147 + var cooperationApplicationModels []*models.CooperationApplication
  148 + for _, cooperationApplication := range cooperationApplications {
  149 + cooperationApplicationModels = append(cooperationApplicationModels, &models.CooperationApplication{
  150 + CooperationApplicationId: cooperationApplication.CooperationApplicationId,
  151 + CooperationApplicationApplicant: cooperationApplication.CooperationApplicationApplicant,
  152 + CooperationApplicationAttachment: cooperationApplication.CooperationApplicationAttachment,
  153 + CooperationApplicationDescription: cooperationApplication.CooperationApplicationDescription,
  154 + CooperationApplicationStatus: cooperationApplication.CooperationApplicationStatus,
  155 + CooperationApplicationVerifier: cooperationApplication.CooperationApplicationVerifier,
  156 + CooperationApplicationVerifyDescription: cooperationApplication.CooperationApplicationVerifyDescription,
  157 + CooperationApplicationVerifyTime: cooperationApplication.CooperationApplicationVerifyTime,
  158 + CooperationApplyTime: cooperationApplication.CooperationApplyTime,
  159 + CooperationProjectNumber: cooperationApplication.CooperationProject.CooperationProjectNumber,
  160 + Org: cooperationApplication.Org,
  161 + IsCanceled: cooperationApplication.IsCanceled,
  162 + Company: cooperationApplication.Company,
  163 + CreatedAt: cooperationApplication.CreatedAt,
  164 + DeletedAt: cooperationApplication.DeletedAt,
  165 + UpdatedAt: time.Now(),
  166 + })
  167 + }
  168 + if _, err := tx.Model(&cooperationApplicationModels).WherePK().Update(); err != nil {
  169 + return nil, err
  170 + }
  171 + return cooperationApplications, nil
  172 +}
  173 +
144 func (repository *CooperationApplicationRepository) Remove(cooperationApplication *domain.CooperationApplication) (*domain.CooperationApplication, error) { 174 func (repository *CooperationApplicationRepository) Remove(cooperationApplication *domain.CooperationApplication) (*domain.CooperationApplication, error) {
145 tx := repository.transactionContext.PgTx 175 tx := repository.transactionContext.PgTx
146 cooperationApplicationModel := new(models.CooperationApplication) 176 cooperationApplicationModel := new(models.CooperationApplication)
@@ -33,7 +33,6 @@ func (repository *DividendsOrderRepository) Save(dividendsOrder *domain.Dividend @@ -33,7 +33,6 @@ func (repository *DividendsOrderRepository) Save(dividendsOrder *domain.Dividend
33 "dividends_order_number", 33 "dividends_order_number",
34 "dividends_original_order_num", 34 "dividends_original_order_num",
35 "dividends_order_amount", 35 "dividends_order_amount",
36 - "order_salesman",  
37 "order_time", 36 "order_time",
38 "dividend_time", 37 "dividend_time",
39 "dividend_status", 38 "dividend_status",
@@ -67,7 +66,6 @@ func (repository *DividendsOrderRepository) Save(dividendsOrder *domain.Dividend @@ -67,7 +66,6 @@ func (repository *DividendsOrderRepository) Save(dividendsOrder *domain.Dividend
67 &dividendsOrder.DividendsOrderNumber, 66 &dividendsOrder.DividendsOrderNumber,
68 &dividendsOrder.DividendsOriginalOrderNum, 67 &dividendsOrder.DividendsOriginalOrderNum,
69 &dividendsOrder.DividendsOrderAmount, 68 &dividendsOrder.DividendsOrderAmount,
70 - &dividendsOrder.OrderSalesman,  
71 &dividendsOrder.OrderTime, 69 &dividendsOrder.OrderTime,
72 &dividendsOrder.DividendTime, 70 &dividendsOrder.DividendTime,
73 &dividendsOrder.DividendStatus, 71 &dividendsOrder.DividendStatus,
@@ -87,7 +85,6 @@ func (repository *DividendsOrderRepository) Save(dividendsOrder *domain.Dividend @@ -87,7 +85,6 @@ func (repository *DividendsOrderRepository) Save(dividendsOrder *domain.Dividend
87 dividendsOrder.DividendsOrderNumber, 85 dividendsOrder.DividendsOrderNumber,
88 dividendsOrder.DividendsOriginalOrderNum, 86 dividendsOrder.DividendsOriginalOrderNum,
89 dividendsOrder.DividendsOrderAmount, 87 dividendsOrder.DividendsOrderAmount,
90 - dividendsOrder.OrderSalesman,  
91 dividendsOrder.OrderTime, 88 dividendsOrder.OrderTime,
92 dividendsOrder.DividendTime, 89 dividendsOrder.DividendTime,
93 dividendsOrder.DividendStatus, 90 dividendsOrder.DividendStatus,
@@ -131,7 +128,6 @@ func (repository *DividendsOrderRepository) Save(dividendsOrder *domain.Dividend @@ -131,7 +128,6 @@ func (repository *DividendsOrderRepository) Save(dividendsOrder *domain.Dividend
131 &dividendsOrder.DividendsOrderNumber, 128 &dividendsOrder.DividendsOrderNumber,
132 &dividendsOrder.DividendsOriginalOrderNum, 129 &dividendsOrder.DividendsOriginalOrderNum,
133 &dividendsOrder.DividendsOrderAmount, 130 &dividendsOrder.DividendsOrderAmount,
134 - &dividendsOrder.OrderSalesman,  
135 &dividendsOrder.OrderTime, 131 &dividendsOrder.OrderTime,
136 &dividendsOrder.DividendTime, 132 &dividendsOrder.DividendTime,
137 &dividendsOrder.DividendStatus, 133 &dividendsOrder.DividendStatus,
@@ -151,7 +147,6 @@ func (repository *DividendsOrderRepository) Save(dividendsOrder *domain.Dividend @@ -151,7 +147,6 @@ func (repository *DividendsOrderRepository) Save(dividendsOrder *domain.Dividend
151 dividendsOrder.DividendsOrderNumber, 147 dividendsOrder.DividendsOrderNumber,
152 dividendsOrder.DividendsOriginalOrderNum, 148 dividendsOrder.DividendsOriginalOrderNum,
153 dividendsOrder.DividendsOrderAmount, 149 dividendsOrder.DividendsOrderAmount,
154 - dividendsOrder.OrderSalesman,  
155 dividendsOrder.OrderTime, 150 dividendsOrder.OrderTime,
156 dividendsOrder.DividendTime, 151 dividendsOrder.DividendTime,
157 dividendsOrder.DividendStatus, 152 dividendsOrder.DividendStatus,
@@ -62,6 +62,19 @@ func (controller *CooperationContractController) BatchApprovalCooperationApplica @@ -62,6 +62,19 @@ func (controller *CooperationContractController) BatchApprovalCooperationApplica
62 controller.Response(data, err) 62 controller.Response(data, err)
63 } 63 }
64 64
  65 +func (controller *CooperationApplicationController) OneClickApprovalCooperationApplication() {
  66 + cooperationApplicationService := service.NewCooperationApplicationService(nil)
  67 + oneClickApprovalCooperationApplicationCommand := &command.OneClickApprovalCooperationApplicationCommand{}
  68 + _ = controller.Unmarshal(oneClickApprovalCooperationApplicationCommand)
  69 + header := controller.GetRequestHeader(controller.Ctx)
  70 + oneClickApprovalCooperationApplicationCommand.CompanyId = header.CompanyId
  71 + oneClickApprovalCooperationApplicationCommand.OrgId = header.OrgId
  72 + oneClickApprovalCooperationApplicationCommand.UserId = header.UserId
  73 + oneClickApprovalCooperationApplicationCommand.UserBaseId = header.UserBaseId
  74 + data, err := cooperationApplicationService.OneClickApprovalCooperationApplication(oneClickApprovalCooperationApplicationCommand)
  75 + controller.Response(data, err)
  76 +}
  77 +
65 func (controller *CooperationApplicationController) CreateCooperationApplication() { 78 func (controller *CooperationApplicationController) CreateCooperationApplication() {
66 cooperationApplicationService := service.NewCooperationApplicationService(nil) 79 cooperationApplicationService := service.NewCooperationApplicationService(nil)
67 createCooperationApplicationCommand := &command.CreateCooperationApplicationCommand{} 80 createCooperationApplicationCommand := &command.CreateCooperationApplicationCommand{}
@@ -6,14 +6,15 @@ import ( @@ -6,14 +6,15 @@ import (
6 ) 6 )
7 7
8 func init() { 8 func init() {
9 - web.Router("/cooperation-applications/apply-for-cooperation", &controllers.CooperationApplicationController{}, "Post:ApplyForCooperation") // 申请共创  
10 - web.Router("/cooperation-applications/cancel-application", &controllers.CooperationApplicationController{}, "Post:CancelCooperationApplication")  
11 - web.Router("/cooperation-applications/agree-cooperation-application", &controllers.CooperationApplicationController{}, "Post:ApprovalCooperationApplication") // 同意共创申请  
12 - web.Router("/cooperation-applications/batch-approval", &controllers.CooperationContractController{}, "Post:BatchApprovalCooperationApplication") // 一键审核  
13 - web.Router("/cooperation-applications/", &controllers.CooperationApplicationController{}, "Post:CreateCooperationApplication") // 新增共创申请  
14 - web.Router("/cooperation-applications/:cooperationApplicationId", &controllers.CooperationApplicationController{}, "Put:UpdateCooperationApplication") // 编辑共创申请  
15 - web.Router("/cooperation-applications/:cooperationApplicationId", &controllers.CooperationApplicationController{}, "Get:GetCooperationApplication") // 获取共创申请详情  
16 - web.Router("/cooperation-applications/:cooperationApplicationId", &controllers.CooperationApplicationController{}, "Delete:RemoveCooperationApplication") // 移除共创申请  
17 - web.Router("/cooperation-applications/search", &controllers.CooperationApplicationController{}, "Post:SearchCooperationApplication") // 搜索返回共创申请列表  
18 - web.Router("/cooperation-applications/", &controllers.CooperationApplicationController{}, "Get:ListCooperationApplication") // 返回共创申请列表 9 + web.Router("/cooperation-applications/apply-for-cooperation", &controllers.CooperationApplicationController{}, "Post:ApplyForCooperation") // 申请共创
  10 + web.Router("/cooperation-applications/cancel-application", &controllers.CooperationApplicationController{}, "Post:CancelCooperationApplication") // 取消共创申请
  11 + web.Router("/cooperation-applications/approval-cooperation-application", &controllers.CooperationApplicationController{}, "Post:ApprovalCooperationApplication") // 同意共创申请
  12 + web.Router("/cooperation-applications/batch-approval", &controllers.CooperationContractController{}, "Post:BatchApprovalCooperationApplication") // 批量审核共创申请
  13 + web.Router("/cooperation-applications/oneclick-approval", &controllers.CooperationApplicationController{}, "Post:OneClickApprovalCooperationApplication") // 一键审核共创申请
  14 + web.Router("/cooperation-applications/", &controllers.CooperationApplicationController{}, "Post:CreateCooperationApplication") // 新增共创申请
  15 + web.Router("/cooperation-applications/:cooperationApplicationId", &controllers.CooperationApplicationController{}, "Put:UpdateCooperationApplication") // 编辑共创申请
  16 + web.Router("/cooperation-applications/:cooperationApplicationId", &controllers.CooperationApplicationController{}, "Get:GetCooperationApplication") // 获取共创申请详情
  17 + web.Router("/cooperation-applications/:cooperationApplicationId", &controllers.CooperationApplicationController{}, "Delete:RemoveCooperationApplication") // 移除共创申请
  18 + web.Router("/cooperation-applications/search", &controllers.CooperationApplicationController{}, "Post:SearchCooperationApplication") // 搜索返回共创申请列表
  19 + web.Router("/cooperation-applications/", &controllers.CooperationApplicationController{}, "Get:ListCooperationApplication") // 返回共创申请列表
19 } 20 }