作者 yangfu
1 -{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego\\routers":1628060696735619100}  
  1 +{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego\\routers":1628574006679578700}
@@ -451,7 +451,7 @@ func (srv AuthService) CompanySignUp(companySignUpCommand *command.CompanySignUp @@ -451,7 +451,7 @@ func (srv AuthService) CompanySignUp(companySignUpCommand *command.CompanySignUp
451 // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 451 // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
452 //} 452 //}
453 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{}) 453 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
454 - result, err := creationUserGateway.AuthCompanySignUp(allied_creation_user.ReqAuthCompanySignUp{ 454 + _, err := creationUserGateway.AuthCompanySignUp(allied_creation_user.ReqAuthCompanySignUp{
455 CompanyName: companySignUpCommand.CompanyName, 455 CompanyName: companySignUpCommand.CompanyName,
456 Phone: companySignUpCommand.Phone, 456 Phone: companySignUpCommand.Phone,
457 Password: companySignUpCommand.Password, 457 Password: companySignUpCommand.Password,
@@ -462,7 +462,7 @@ func (srv AuthService) CompanySignUp(companySignUpCommand *command.CompanySignUp @@ -462,7 +462,7 @@ func (srv AuthService) CompanySignUp(companySignUpCommand *command.CompanySignUp
462 if err != nil { 462 if err != nil {
463 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 463 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
464 } 464 }
465 - return result, err 465 + return companySignUpCommand, err
466 } 466 }
467 467
468 // ResetPassword 重置密码(找回密码) 468 // 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 +}
@@ -5,47 +5,19 @@ import ( @@ -5,47 +5,19 @@ import (
5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
6 ) 6 )
7 7
8 -//合约模式  
9 -type CooperationMode struct {  
10 - CooperationModeId int `json:"cooperationModeId,string"`  
11 - CooperationModeName string `json:"cooperationModeName"`  
12 - CooperationModeNumber string `json:"cooperationModeNumber"`  
13 -}  
14 -  
15 -//部门  
16 -type Department struct {  
17 - DepartmentNumber string `json:"departmentNumber"`  
18 - DepartmentId int `json:"departmentId,string,"`  
19 - DepartmentName string `json:"departmentName"`  
20 -}  
21 -  
22 -//用户  
23 -type UserInfo struct {  
24 - UsersName string `json:"usersName"`  
25 - Phone string `json:"phone"`  
26 - UsersId int `json:"userId,string"`  
27 -}  
28 -  
29 -//公司  
30 -type CompanyData struct {  
31 - CompanyID int `json:"companyId"`  
32 - CompanyLogo string `json:"companyLogo"`  
33 - CompanyName string `json:"companyName"`  
34 -}  
35 -  
36 //CooperationProjectItem 返回共创项目列表项 8 //CooperationProjectItem 返回共创项目列表项
37 type CooperationProjectItem struct { 9 type CooperationProjectItem struct {
38 - CooperationMode CooperationMode `json:"cooperationMode"` //项目模式 10 + CooperationMode domain.CooperationMode `json:"cooperationMode"` //项目模式
39 CooperationProjectID int `json:"cooperationProjectId,string,"` //id 11 CooperationProjectID int `json:"cooperationProjectId,string,"` //id
40 CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称 12 CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
41 CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号 13 CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
42 CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象 14 CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象
43 - Department Department `json:"department"` //项目发起部门 15 + Department domain.Department `json:"department"` //项目发起部门
44 Status int `json:"status"` //项目状态 16 Status int `json:"status"` //项目状态
45 CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"` 17 CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"`
46 CooperationProjectSponsor struct { 18 CooperationProjectSponsor struct {
47 UsersId int `json:"usersId"` 19 UsersId int `json:"usersId"`
48 - UserInfo UserInfo `json:"UserInfo"` 20 + UserInfo domain.UserInfo `json:"UserInfo"`
49 } `json:"cooperationProjectSponsor"` //共创发起人 21 } `json:"cooperationProjectSponsor"` //共创发起人
50 } 22 }
51 23
@@ -69,18 +41,18 @@ func ToCooperationProjectItem(projecetParam *allied_creation_cooperation.Coopera @@ -69,18 +41,18 @@ func ToCooperationProjectItem(projecetParam *allied_creation_cooperation.Coopera
69 41
70 //CooperationProjectInfo 返回共创项目详情 42 //CooperationProjectInfo 返回共创项目详情
71 type CooperationProjectInfo struct { 43 type CooperationProjectInfo struct {
72 - CooperationMode CooperationMode `json:"cooperationMode"` //共创模式 44 + CooperationMode domain.CooperationMode `json:"cooperationMode"` //共创模式
73 CooperationProjectID int `json:"cooperationProjectId,string,"` //id 45 CooperationProjectID int `json:"cooperationProjectId,string,"` //id
74 CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称 46 CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
75 CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号 47 CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
76 CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"` //共创项目发布时间 48 CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"` //共创项目发布时间
77 CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象 49 CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象
78 CooperationProjectDescription string `json:"cooperationProjectDescription"` //共创描述 50 CooperationProjectDescription string `json:"cooperationProjectDescription"` //共创描述
79 - Department Department `json:"department"` //项目发起部门 51 + Department domain.Department `json:"department"` //项目发起部门
80 Status int `json:"status"` //项目状态 52 Status int `json:"status"` //项目状态
81 CooperationProjectSponsor struct { 53 CooperationProjectSponsor struct {
82 UsersId int `json:"usersId"` 54 UsersId int `json:"usersId"`
83 - UserInfo UserInfo `json:"UserInfo"` 55 + UserInfo domain.UserInfo `json:"UserInfo"`
84 } `json:"cooperationProjectSponsor"` //共创发起人 56 } `json:"cooperationProjectSponsor"` //共创发起人
85 Attachment []domain.Attachment `json:"attachment"` //图片附件 57 Attachment []domain.Attachment `json:"attachment"` //图片附件
86 } 58 }
@@ -106,11 +78,11 @@ func ToCooperationProjectInfo(projecetParam *allied_creation_cooperation.Coopera @@ -106,11 +78,11 @@ func ToCooperationProjectInfo(projecetParam *allied_creation_cooperation.Coopera
106 } 78 }
107 79
108 type CooperationApplication struct { 80 type CooperationApplication struct {
109 - Company CompanyData `json:"company"` 81 + Company domain.CompanyData `json:"company"`
110 CooperationApplicationApplicant struct { 82 CooperationApplicationApplicant struct {
111 UserId int `json:"userId"` 83 UserId int `json:"userId"`
112 - UserInfo UserInfo `json:"userInfo"`  
113 - Department Department `json:"department"` //申请人部门 84 + UserInfo domain.UserInfo `json:"userInfo"`
  85 + Department domain.Department `json:"department"` //申请人部门
114 } `json:"cooperationApplicationApplicant"` //申请人 86 } `json:"cooperationApplicationApplicant"` //申请人
115 CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件信息 87 CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件信息
116 CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //申请描述 88 CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //申请描述
@@ -40,7 +40,7 @@ func (srv CompanyStatisticsService) DividendsStatistics(userMenusCommand *comman @@ -40,7 +40,7 @@ func (srv CompanyStatisticsService) DividendsStatistics(userMenusCommand *comman
40 }, nil 40 }, nil
41 } 41 }
42 42
43 -// IndexStatistics TODO:企业的合约明细列表(分红预算信息) 43 +// IndexStatistics 企业的合约明细列表(分红预算信息)
44 func (srv CompanyStatisticsService) SearchDividendsEstimates(userMenusCommand *command.SearchDividendsEstimatesCommand) (interface{}, error) { 44 func (srv CompanyStatisticsService) SearchDividendsEstimates(userMenusCommand *command.SearchDividendsEstimatesCommand) (interface{}, error) {
45 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 45 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
46 userMenusCommand.Operator) 46 userMenusCommand.Operator)
@@ -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 {
@@ -75,29 +75,12 @@ func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProj @@ -75,29 +75,12 @@ func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProj
75 75
76 type CooperationApplicationItem struct { 76 type CooperationApplicationItem struct {
77 CooperationApplicationApplicant struct { 77 CooperationApplicationApplicant struct {
78 - Company struct {  
79 - CompanyID int `json:"companyId"`  
80 - CompanyLogo string `json:"companyLogo"`  
81 - CompanyName string `json:"companyName"`  
82 - } `json:"company"`  
83 - Department struct {  
84 - DepartmentID int `json:"departmentId"`  
85 - DepartmentName string `json:"departmentName"`  
86 - DepartmentNumber string `json:"departmentNumber"`  
87 - } `json:"department"`  
88 - Org struct {  
89 - OrgID int `json:"orgId"`  
90 - OrgName string `json:"orgName"`  
91 - } `json:"org"` 78 + Company domain.CompanyData `json:"company"`
  79 + Department domain.Department `json:"department"`
  80 + Org domain.Org `json:"org"`
92 UserBaseID int `json:"userBaseId"` 81 UserBaseID int `json:"userBaseId"`
93 UserID int `json:"userId"` 82 UserID int `json:"userId"`
94 - UserInfo struct {  
95 - UserAccount string `json:"userAccount"`  
96 - UserAvatar string `json:"userAvatar"`  
97 - UserEmail string `json:"userEmail"`  
98 - UserName string `json:"userName"`  
99 - UserPhone string `json:"userPhone"`  
100 - } `json:"userInfo"` 83 + UserInfo domain.UserInfo `json:"userInfo"`
101 UserType int `json:"userType"` 84 UserType int `json:"userType"`
102 } `json:"cooperationApplicationApplicant"` //申请人 85 } `json:"cooperationApplicationApplicant"` //申请人
103 CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述 86 CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
@@ -109,12 +92,24 @@ type CooperationApplicationItem struct { @@ -109,12 +92,24 @@ type CooperationApplicationItem struct {
109 92
110 func ToCooperationApplicationItem(param *allied_creation_cooperation.CooperationApplication) *CooperationApplicationItem { 93 func ToCooperationApplicationItem(param *allied_creation_cooperation.CooperationApplication) *CooperationApplicationItem {
111 data := CooperationApplicationItem{ 94 data := CooperationApplicationItem{
112 - CooperationApplicationApplicant: param.CooperationApplicationApplicant,  
113 CooperationApplicationDescription: param.CooperationApplicationDescription, 95 CooperationApplicationDescription: param.CooperationApplicationDescription,
114 CooperationApplicationID: param.CooperationApplicationID, 96 CooperationApplicationID: param.CooperationApplicationID,
115 CooperationApplicationStatus: param.CooperationApplicationStatus, 97 CooperationApplicationStatus: param.CooperationApplicationStatus,
116 CooperationApplyTime: int(param.CooperationApplyTime.Unix()), 98 CooperationApplyTime: int(param.CooperationApplyTime.Unix()),
117 CooperationApplicationAttachment: param.CooperationApplicationAttachment, 99 CooperationApplicationAttachment: param.CooperationApplicationAttachment,
118 } 100 }
  101 + data.CooperationApplicationApplicant.Company.CompanyID = param.CooperationApplicationApplicant.Company.CompanyID
  102 + // data.CooperationApplicationApplicant.Company.CompanyLogo = param.CooperationApplicationApplicant.Company.CompanyLogo
  103 + data.CooperationApplicationApplicant.Company.CompanyName = param.CooperationApplicationApplicant.Company.CompanyName
  104 + data.CooperationApplicationApplicant.Department.DepartmentId = param.CooperationApplicationApplicant.Department.DepartmentID
  105 + data.CooperationApplicationApplicant.Department.DepartmentName = param.CooperationApplicationApplicant.Department.DepartmentName
  106 + data.CooperationApplicationApplicant.Department.DepartmentNumber = param.CooperationApplicationApplicant.Department.DepartmentNumber
  107 + data.CooperationApplicationApplicant.Org.OrgID = param.CooperationApplicationApplicant.Org.OrgID
  108 + data.CooperationApplicationApplicant.Org.OrgName = param.CooperationApplicationApplicant.Org.OrgName
  109 + data.CooperationApplicationApplicant.UserID = param.CooperationApplicationApplicant.UserID
  110 + data.CooperationApplicationApplicant.UserType = param.CooperationApplicationApplicant.UserType
  111 + data.CooperationApplicationApplicant.UserInfo.Phone = param.CooperationApplicationApplicant.UserInfo.UserPhone
  112 + data.CooperationApplicationApplicant.UserInfo.UsersName = param.CooperationApplicationApplicant.UserInfo.UserName
  113 + data.CooperationApplicationApplicant.UserInfo.UsersId = param.CooperationApplicationApplicant.UserID
119 return &data 114 return &data
120 } 115 }
@@ -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 //区域名称
1 package service 1 package service
2 2
3 import ( 3 import (
4 - "strconv"  
5 "time" 4 "time"
6 5
7 "github.com/linmadan/egglib-go/core/application" 6 "github.com/linmadan/egglib-go/core/application"
@@ -37,13 +36,10 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD @@ -37,13 +36,10 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
37 result, err := creationCooperationGateway.DividendsOrderAdd(allied_creation_cooperation.ReqDividendsOrderAdd{ 36 result, err := creationCooperationGateway.DividendsOrderAdd(allied_creation_cooperation.ReqDividendsOrderAdd{
38 CompanyId: int(createDividendsOrderCommand.Operator.CompanyId), 37 CompanyId: int(createDividendsOrderCommand.Operator.CompanyId),
39 CustomerName: createDividendsOrderCommand.CustomerName, 38 CustomerName: createDividendsOrderCommand.CustomerName,
40 - DividendsOrderAmount: createDividendsOrderCommand.DividendsOrderAmount,  
41 - DividendsOrderNumber: createDividendsOrderCommand.DividendsOrderNumber,  
42 DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum, 39 DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum,
43 OperatorUid: int(createDividendsOrderCommand.Operator.UserId), 40 OperatorUid: int(createDividendsOrderCommand.Operator.UserId),
44 OrderTime: t, 41 OrderTime: t,
45 Remarks: createDividendsOrderCommand.Remarks, 42 Remarks: createDividendsOrderCommand.Remarks,
46 - SalesmanUid: createDividendsOrderCommand.SalesmanUid,  
47 RegionName: createDividendsOrderCommand.RegionName, 43 RegionName: createDividendsOrderCommand.RegionName,
48 OrderGoods: orderGoods, 44 OrderGoods: orderGoods,
49 }) 45 })
@@ -80,16 +76,15 @@ func (dividendsOrderService *DividendsOrderService) RemoveDividendsOrder(removeD @@ -80,16 +76,15 @@ func (dividendsOrderService *DividendsOrderService) RemoveDividendsOrder(removeD
80 if err := removeDividendsOrderCommand.ValidateCommand(); err != nil { 76 if err := removeDividendsOrderCommand.ValidateCommand(); err != nil {
81 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 77 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
82 } 78 }
83 - dividendsOrderId := []int{}  
84 - for _, v := range removeDividendsOrderCommand.DividendsOrderId {  
85 - id, _ := strconv.Atoi(v)  
86 - dividendsOrderId = append(dividendsOrderId, id)  
87 - } 79 +
88 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsOrderCommand.Operator) 80 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsOrderCommand.Operator)
89 - creationCooperationGateway.DividendsOrderRemove(allied_creation_cooperation.ReqDividendsOrderRemove{  
90 - DividendsOrderId: 0, ///TODO 改换为批量删除 81 + _, err := creationCooperationGateway.DividendsOrderBatchRemove(allied_creation_cooperation.ReqDividendsOrderBatchRemove{
  82 + DividendsOrderIds: removeDividendsOrderCommand.DividendsOrderId,
91 }) 83 })
92 - return nil, nil 84 + if err != nil {
  85 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  86 + }
  87 + return removeDividendsOrderCommand, nil
93 } 88 }
94 89
95 // 查询分红订单方法 90 // 查询分红订单方法
@@ -9,7 +9,7 @@ const SERVICE_NAME = "allied-creation-gateway" @@ -9,7 +9,7 @@ const SERVICE_NAME = "allied-creation-gateway"
9 9
10 var LOG_LEVEL = "debug" 10 var LOG_LEVEL = "debug"
11 11
12 -var HTTP_PORT int = 8081 12 +var HTTP_PORT int = 8083
13 13
14 //天联共创基础模块 14 //天联共创基础模块
15 var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080" 15 var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080"
  1 +package domain
  2 +
  3 +//公司
  4 +type CompanyData struct {
  5 + CompanyID int `json:"companyId"`
  6 + CompanyLogo string `json:"companyLogo"`
  7 + CompanyName string `json:"companyName"`
  8 +}
  1 +package domain
  2 +
  3 +//合约模式
  4 +type CooperationMode struct {
  5 + CooperationModeId int `json:"cooperationModeId,string"`
  6 + CooperationModeName string `json:"cooperationModeName"`
  7 + CooperationModeNumber string `json:"cooperationModeNumber"`
  8 +}
  1 +package domain
  2 +
  3 +//部门
  4 +type Department struct {
  5 + DepartmentNumber string `json:"departmentNumber"`
  6 + DepartmentId int `json:"departmentId,string,"`
  7 + DepartmentName string `json:"departmentName"`
  8 +}
  1 +package domain
  2 +
  3 +//组织
  4 +type Org struct {
  5 + OrgID int `json:"orgId"`
  6 + OrgName string `json:"orgName"`
  7 +}
  1 +package domain
  2 +
  3 +//用户
  4 +type UserInfo struct {
  5 + UsersName string `json:"usersName"`
  6 + Phone string `json:"phone"`
  7 + UsersId int `json:"userId,string"`
  8 + UserCode string `json:"userCode"`
  9 +}
@@ -226,3 +226,34 @@ func (gateway HttplibAlliedCreationCooperation) DividendsOrderGet(param ReqDivid @@ -226,3 +226,34 @@ func (gateway HttplibAlliedCreationCooperation) DividendsOrderGet(param ReqDivid
226 err = gateway.GetResponseData(result, &data) 226 err = gateway.GetResponseData(result, &data)
227 return &data, err 227 return &data, err
228 } 228 }
  229 +
  230 +// DividendsOrderBatchRemove 批量移除分红订单
  231 +func (gateway HttplibAlliedCreationCooperation) DividendsOrderBatchRemove(param ReqDividendsOrderBatchRemove) (*DataDividendsOrderBatchRemove, error) {
  232 + url := gateway.baseUrL + "/dividends-orders/batch-remove"
  233 + method := "DELETE"
  234 + req := gateway.CreateRequest(url, method)
  235 + log.Logger.Debug("向业务模块请求数据:移除分红订单。", map[string]interface{}{
  236 + "api": method + ":" + url,
  237 + "param": param,
  238 + })
  239 + req, err := req.JSONBody(param)
  240 + if err != nil {
  241 + return nil, fmt.Errorf("请求移除分红订单失败:%w", err)
  242 + }
  243 +
  244 + byteResult, err := req.Bytes()
  245 + if err != nil {
  246 + return nil, fmt.Errorf("获取移除分红订单失败:%w", err)
  247 + }
  248 + log.Logger.Debug("获取业务模块请求数据:移除分红订单。", map[string]interface{}{
  249 + "result": string(byteResult),
  250 + })
  251 + var result service_gateway.GatewayResponse
  252 + err = json.Unmarshal(byteResult, &result)
  253 + if err != nil {
  254 + return nil, fmt.Errorf("解析移除分红订单:%w", err)
  255 + }
  256 + var data DataDividendsOrderBatchRemove
  257 + err = gateway.GetResponseData(result, &data)
  258 + return &data, err
  259 +}
@@ -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 }
@@ -162,3 +159,13 @@ type ( @@ -162,3 +159,13 @@ type (
162 DividendsOrder 159 DividendsOrder
163 } 160 }
164 ) 161 )
  162 +
  163 +//移除分红订单
  164 +type (
  165 + ReqDividendsOrderBatchRemove struct {
  166 + DividendsOrderIds []string `json:"dividendsOrderIds"`
  167 + }
  168 +
  169 + DataDividendsOrderBatchRemove struct {
  170 + }
  171 +)
@@ -11,6 +11,7 @@ type CooperationController struct { @@ -11,6 +11,7 @@ type CooperationController struct {
11 } 11 }
12 12
13 /***** CooperationApplicationsService 共创申请服务 *****/ 13 /***** CooperationApplicationsService 共创申请服务 *****/
  14 +//SearchFeedback 承接人反馈
14 func (controller *CooperationController) SearchFeedback() { 15 func (controller *CooperationController) SearchFeedback() {
15 svr := service.UndertakerFeedbackService{} 16 svr := service.UndertakerFeedbackService{}
16 cmd := &command.SearchFeedbackCommand{} 17 cmd := &command.SearchFeedbackCommand{}
@@ -24,6 +25,7 @@ func (controller *CooperationController) SearchFeedback() { @@ -24,6 +25,7 @@ func (controller *CooperationController) SearchFeedback() {
24 controller.Response(data, err) 25 controller.Response(data, err)
25 } 26 }
26 27
  28 +// SearchFeedback 创建承接人反馈
27 func (controller *CooperationController) CreateFeedback() { 29 func (controller *CooperationController) CreateFeedback() {
28 svr := service.UndertakerFeedbackService{} 30 svr := service.UndertakerFeedbackService{}
29 cmd := &command.CreateFeedbackCommand{} 31 cmd := &command.CreateFeedbackCommand{}
@@ -64,6 +66,20 @@ func (controller *CooperationController) AuditCooperationApplication() { @@ -64,6 +66,20 @@ func (controller *CooperationController) AuditCooperationApplication() {
64 controller.Response(data, err) 66 controller.Response(data, err)
65 } 67 }
66 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 +
67 func (controller *CooperationController) SearchCooperationApplication() { 83 func (controller *CooperationController) SearchCooperationApplication() {
68 svr := service.CooperationApplicationsService{} 84 svr := service.CooperationApplicationsService{}
69 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 /***** 共创申请服务 共创用户端 *****/