正在显示
9 个修改的文件
包含
68 行增加
和
15 行删除
@@ -448,7 +448,7 @@ func (srv AuthService) CompanySignUp(companySignUpCommand *command.CompanySignUp | @@ -448,7 +448,7 @@ func (srv AuthService) CompanySignUp(companySignUpCommand *command.CompanySignUp | ||
448 | // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 448 | // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
449 | //} | 449 | //} |
450 | creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{}) | 450 | creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{}) |
451 | - result, err := creationUserGateway.AuthCompanySignUp(allied_creation_user.ReqAuthCompanySignUp{ | 451 | + _, err := creationUserGateway.AuthCompanySignUp(allied_creation_user.ReqAuthCompanySignUp{ |
452 | CompanyName: companySignUpCommand.CompanyName, | 452 | CompanyName: companySignUpCommand.CompanyName, |
453 | Phone: companySignUpCommand.Phone, | 453 | Phone: companySignUpCommand.Phone, |
454 | Password: companySignUpCommand.Password, | 454 | Password: companySignUpCommand.Password, |
@@ -459,7 +459,7 @@ func (srv AuthService) CompanySignUp(companySignUpCommand *command.CompanySignUp | @@ -459,7 +459,7 @@ func (srv AuthService) CompanySignUp(companySignUpCommand *command.CompanySignUp | ||
459 | if err != nil { | 459 | if err != nil { |
460 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 460 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
461 | } | 461 | } |
462 | - return result, err | 462 | + return companySignUpCommand, err |
463 | } | 463 | } |
464 | 464 | ||
465 | // ResetPassword 重置密码(找回密码) | 465 | // ResetPassword 重置密码(找回密码) |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + | ||
6 | + "github.com/beego/beego/v2/core/validation" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | ||
8 | +) | ||
9 | + | ||
10 | +type AuditAllCooperationApplicationCommand struct { | ||
11 | + //操作人 | ||
12 | + Operator domain.Operator `json:"-"` | ||
13 | + // 审核动作,1同意,2拒绝 | ||
14 | + CooperationApplicationStatus int `json:"cooperationApplicationStatus" valid:"Required"` | ||
15 | + // 共创申请审核描述 | ||
16 | + CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription" valid:"Required"` | ||
17 | +} | ||
18 | + | ||
19 | +func (listCooperationApplicationQuery *AuditAllCooperationApplicationCommand) Valid(validation *validation.Validation) { | ||
20 | + | ||
21 | +} | ||
22 | + | ||
23 | +func (listCooperationApplicationQuery *AuditAllCooperationApplicationCommand) ValidateQuery() error { | ||
24 | + valid := validation.Validation{} | ||
25 | + b, err := valid.Valid(listCooperationApplicationQuery) | ||
26 | + if err != nil { | ||
27 | + return err | ||
28 | + } | ||
29 | + if !b { | ||
30 | + for _, validErr := range valid.Errors { | ||
31 | + return fmt.Errorf("%s %s", validErr.Key, validErr.Message) | ||
32 | + } | ||
33 | + } | ||
34 | + return nil | ||
35 | +} |
@@ -156,3 +156,18 @@ func (srv CooperationApplicationsService) PersonSearchCooperationApplications(ap | @@ -156,3 +156,18 @@ func (srv CooperationApplicationsService) PersonSearchCooperationApplications(ap | ||
156 | // } | 156 | // } |
157 | return resultApplications, nil | 157 | return resultApplications, nil |
158 | } | 158 | } |
159 | + | ||
160 | +// CooperationApplicationsOneclickApproval 企业一键审核申请 | ||
161 | +func (srv CooperationApplicationsService) CooperationApplicationsOneclickApproval(auditCommand *command.AuditAllCooperationApplicationCommand) (interface{}, error) { | ||
162 | + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | ||
163 | + auditCommand.Operator) | ||
164 | + _, err := creationCooperationGateway.CooperationApplicationsOneclickApproval( | ||
165 | + allied_creation_cooperation.ReqCooperationApplicationOneclickApproval{ | ||
166 | + CooperationApplicationDescription: auditCommand.CooperationApplicationVerifyDescription, | ||
167 | + Action: auditCommand.CooperationApplicationStatus, | ||
168 | + }) | ||
169 | + if err != nil { | ||
170 | + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | ||
171 | + } | ||
172 | + return auditCommand, nil | ||
173 | +} |
@@ -139,7 +139,7 @@ func (cooperationModeService *CooperationModeService) EnableCooperationMode(upda | @@ -139,7 +139,7 @@ func (cooperationModeService *CooperationModeService) EnableCooperationMode(upda | ||
139 | if err != nil { | 139 | if err != nil { |
140 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 140 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
141 | } | 141 | } |
142 | - return nil, nil | 142 | + return updateCooperationModeCommand, nil |
143 | } | 143 | } |
144 | 144 | ||
145 | func NewCooperationModeService(options map[string]interface{}) *CooperationModeService { | 145 | func NewCooperationModeService(options map[string]interface{}) *CooperationModeService { |
@@ -12,18 +12,12 @@ type CreateDividendsOrderCommand struct { | @@ -12,18 +12,12 @@ type CreateDividendsOrderCommand struct { | ||
12 | Operator domain.Operator `json:"-"` | 12 | Operator domain.Operator `json:"-"` |
13 | //客户名称 | 13 | //客户名称 |
14 | CustomerName string `json:"customerName" valid:"Required"` | 14 | CustomerName string `json:"customerName" valid:"Required"` |
15 | - //分红订单金额 | ||
16 | - DividendsOrderAmount float64 `json:"dividendsOrderAmount" valid:"Required"` | ||
17 | - //分红订单号 | ||
18 | - DividendsOrderNumber string `json:"dividendsOrderNumber" valid:"Required"` | ||
19 | //分红订单原单号 | 15 | //分红订单原单号 |
20 | DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum" valid:"Required"` | 16 | DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum" valid:"Required"` |
21 | //订单产生时间 时间戳 秒 | 17 | //订单产生时间 时间戳 秒 |
22 | OrderTime int64 `json:"orderTime" valid:"Required"` | 18 | OrderTime int64 `json:"orderTime" valid:"Required"` |
23 | //备注 | 19 | //备注 |
24 | Remarks string `json:"remarks" valid:"Required"` | 20 | Remarks string `json:"remarks" valid:"Required"` |
25 | - //订单业务员uid | ||
26 | - SalesmanUid string `json:"salesmanUid"` | ||
27 | //订单操作人uid | 21 | //订单操作人uid |
28 | OperatorUid string `json:"operatorUid"` | 22 | OperatorUid string `json:"operatorUid"` |
29 | //区域名称 | 23 | //区域名称 |
@@ -36,13 +36,10 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD | @@ -36,13 +36,10 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD | ||
36 | result, err := creationCooperationGateway.DividendsOrderAdd(allied_creation_cooperation.ReqDividendsOrderAdd{ | 36 | result, err := creationCooperationGateway.DividendsOrderAdd(allied_creation_cooperation.ReqDividendsOrderAdd{ |
37 | CompanyId: int(createDividendsOrderCommand.Operator.CompanyId), | 37 | CompanyId: int(createDividendsOrderCommand.Operator.CompanyId), |
38 | CustomerName: createDividendsOrderCommand.CustomerName, | 38 | CustomerName: createDividendsOrderCommand.CustomerName, |
39 | - DividendsOrderAmount: createDividendsOrderCommand.DividendsOrderAmount, | ||
40 | - DividendsOrderNumber: createDividendsOrderCommand.DividendsOrderNumber, | ||
41 | DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum, | 39 | DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum, |
42 | OperatorUid: int(createDividendsOrderCommand.Operator.UserId), | 40 | OperatorUid: int(createDividendsOrderCommand.Operator.UserId), |
43 | OrderTime: t, | 41 | OrderTime: t, |
44 | Remarks: createDividendsOrderCommand.Remarks, | 42 | Remarks: createDividendsOrderCommand.Remarks, |
45 | - SalesmanUid: createDividendsOrderCommand.SalesmanUid, | ||
46 | RegionName: createDividendsOrderCommand.RegionName, | 43 | RegionName: createDividendsOrderCommand.RegionName, |
47 | OrderGoods: orderGoods, | 44 | OrderGoods: orderGoods, |
48 | }) | 45 | }) |
@@ -64,14 +64,11 @@ type ( | @@ -64,14 +64,11 @@ type ( | ||
64 | ReqDividendsOrderAdd struct { | 64 | ReqDividendsOrderAdd struct { |
65 | CompanyId int `json:"companyId"` | 65 | CompanyId int `json:"companyId"` |
66 | CustomerName string `json:"customerName"` //客户名称 | 66 | CustomerName string `json:"customerName"` //客户名称 |
67 | - DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额 | ||
68 | - DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号 | ||
69 | DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号 | 67 | DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号 |
70 | OperatorUid int `json:"operatorUid"` //订单操作人id | 68 | OperatorUid int `json:"operatorUid"` //订单操作人id |
71 | OrderGoods []DividendsOrderGoods `json:"orderGoods"` //订单产品列表 | 69 | OrderGoods []DividendsOrderGoods `json:"orderGoods"` //订单产品列表 |
72 | OrderTime time.Time `json:"orderTime"` //订单产生时间 | 70 | OrderTime time.Time `json:"orderTime"` //订单产生时间 |
73 | Remarks string `json:"remarks"` //备注 | 71 | Remarks string `json:"remarks"` //备注 |
74 | - SalesmanUid string `json:"salesmanUid"` //订单业务员uid | ||
75 | UserId int `json:"userId"` // | 72 | UserId int `json:"userId"` // |
76 | RegionName string `json:"regionName"` //区域名称 | 73 | RegionName string `json:"regionName"` //区域名称 |
77 | } | 74 | } |
@@ -66,6 +66,20 @@ func (controller *CooperationController) AuditCooperationApplication() { | @@ -66,6 +66,20 @@ func (controller *CooperationController) AuditCooperationApplication() { | ||
66 | controller.Response(data, err) | 66 | controller.Response(data, err) |
67 | } | 67 | } |
68 | 68 | ||
69 | +//AuditAllCooperationApplication 公司一键审核申请 | ||
70 | +func (controller *CooperationController) AuditAllCooperationApplication() { | ||
71 | + svr := service.CooperationApplicationsService{} | ||
72 | + cmd := &command.AuditAllCooperationApplicationCommand{} | ||
73 | + err := controller.Unmarshal(cmd) | ||
74 | + if err != nil { | ||
75 | + controller.Response(nil, err) | ||
76 | + return | ||
77 | + } | ||
78 | + cmd.Operator = controller.GetOperator() | ||
79 | + data, err := svr.CooperationApplicationsOneclickApproval(cmd) | ||
80 | + controller.Response(data, err) | ||
81 | +} | ||
82 | + | ||
69 | func (controller *CooperationController) SearchCooperationApplication() { | 83 | func (controller *CooperationController) SearchCooperationApplication() { |
70 | svr := service.CooperationApplicationsService{} | 84 | svr := service.CooperationApplicationsService{} |
71 | cmd := &command.ListCooperationApplicationQuery{} | 85 | cmd := &command.ListCooperationApplicationQuery{} |
@@ -13,6 +13,7 @@ func init() { | @@ -13,6 +13,7 @@ func init() { | ||
13 | /***** 共创申请服务 企业端 *****/ | 13 | /***** 共创申请服务 企业端 *****/ |
14 | web.Router("/v1/app/cooperation-applications/:applicationId", &mobile_client.CooperationController{}, "Get:GetCooperationApplication") | 14 | web.Router("/v1/app/cooperation-applications/:applicationId", &mobile_client.CooperationController{}, "Get:GetCooperationApplication") |
15 | web.Router("/v1/app/cooperation-applications/audit", &mobile_client.CooperationController{}, "Put:AuditCooperationApplication") | 15 | web.Router("/v1/app/cooperation-applications/audit", &mobile_client.CooperationController{}, "Put:AuditCooperationApplication") |
16 | + web.Router("/v1/app/cooperation-applications/oneclick-approval", &mobile_client.CooperationController{}, "Post:AuditAllCooperationApplication") | ||
16 | web.Router("/v1/app/cooperation-applications/search", &mobile_client.CooperationController{}, "Post:SearchCooperationApplication") | 17 | web.Router("/v1/app/cooperation-applications/search", &mobile_client.CooperationController{}, "Post:SearchCooperationApplication") |
17 | 18 | ||
18 | /***** 共创申请服务 共创用户端 *****/ | 19 | /***** 共创申请服务 共创用户端 *****/ |
-
请 注册 或 登录 后发表评论