Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway into dev
正在显示
20 个修改的文件
包含
196 行增加
和
40 行删除
| @@ -90,14 +90,14 @@ type ContractUndertaker struct { | @@ -90,14 +90,14 @@ type ContractUndertaker struct { | ||
| 90 | HasReferrer bool `json:"hasReferrer"` | 90 | HasReferrer bool `json:"hasReferrer"` |
| 91 | HasSalesman bool `json:"hasSalesman"` | 91 | HasSalesman bool `json:"hasSalesman"` |
| 92 | ReferrerUser struct { | 92 | ReferrerUser struct { |
| 93 | - UserId int `json:"userId,string"` | 93 | + UserId int `json:"userId,string,"` |
| 94 | UserInfo domain.UserInfo `json:"userInfo"` | 94 | UserInfo domain.UserInfo `json:"userInfo"` |
| 95 | } `json:"referrerUser"` | 95 | } `json:"referrerUser"` |
| 96 | SalesmanUser struct { | 96 | SalesmanUser struct { |
| 97 | - UserId int `json:"userId,string"` | 97 | + UserId int `json:"userId,string,"` |
| 98 | UserInfo domain.UserInfo `json:"userInfo"` | 98 | UserInfo domain.UserInfo `json:"userInfo"` |
| 99 | - } | ||
| 100 | - UserId int `json:"userId,string"` | 99 | + } `json:"salesmanUser"` |
| 100 | + UserId int `json:"userId,string,"` | ||
| 101 | UserInfo domain.UserInfo `json:"userInfo"` | 101 | UserInfo domain.UserInfo `json:"userInfo"` |
| 102 | } | 102 | } |
| 103 | type CooperationContractInfo struct { | 103 | type CooperationContractInfo struct { |
| @@ -203,7 +203,6 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon | @@ -203,7 +203,6 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon | ||
| 203 | UndertakerTypesUncheckedAvailable: undertakerTypesUncheckedAvailable, | 203 | UndertakerTypesUncheckedAvailable: undertakerTypesUncheckedAvailable, |
| 204 | } | 204 | } |
| 205 | return &data | 205 | return &data |
| 206 | - | ||
| 207 | } | 206 | } |
| 208 | 207 | ||
| 209 | type CooperationContractUndertake struct { | 208 | type CooperationContractUndertake struct { |
| @@ -223,3 +223,16 @@ func (cooperationContractService *CooperationContractService) SearchCooperationC | @@ -223,3 +223,16 @@ func (cooperationContractService *CooperationContractService) SearchCooperationC | ||
| 223 | data := []dto.CooperationContractUndertake{{}} | 223 | data := []dto.CooperationContractUndertake{{}} |
| 224 | return 10, data, err | 224 | return 10, data, err |
| 225 | } | 225 | } |
| 226 | + | ||
| 227 | +// 移除共创合约详情 | ||
| 228 | +func (cooperationContractService *CooperationContractService) RemoveCooperationContract(removeCooperationContractCommand *command.RemoveCooperationContractCommand) (interface{}, error) { | ||
| 229 | + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeCooperationContractCommand.Operator) | ||
| 230 | + _, err := creationCooperationGateway.CooperationContractBatchRemove(allied_creation_cooperation.ReqCooperationContractBatchRemove{ | ||
| 231 | + CooperationContractIds: removeCooperationContractCommand.CooperationContractId, | ||
| 232 | + }) | ||
| 233 | + if err != nil { | ||
| 234 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 235 | + } | ||
| 236 | + | ||
| 237 | + return removeCooperationContractCommand, nil | ||
| 238 | +} |
| @@ -4,7 +4,7 @@ import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domai | @@ -4,7 +4,7 @@ import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domai | ||
| 4 | 4 | ||
| 5 | type PayCreditAccountCommand struct { | 5 | type PayCreditAccountCommand struct { |
| 6 | Operator domain.Operator `json:"-"` //操作人 | 6 | Operator domain.Operator `json:"-"` //操作人 |
| 7 | - CreditAccountId int `json:"creditAccountId"` //账期结算id | 7 | + CreditAccountId int `json:"creditAccountId,string"` //账期结算id |
| 8 | ActuallyPaidAmount float64 `json:"actuallyPaidAmount"` //实际金额 | 8 | ActuallyPaidAmount float64 `json:"actuallyPaidAmount"` //实际金额 |
| 9 | Remarks string `json:"remarks"` //备注 | 9 | Remarks string `json:"remarks"` //备注 |
| 10 | Attachment domain.Attachment `json:"attachment"` //附件 | 10 | Attachment domain.Attachment `json:"attachment"` //附件 |
| @@ -5,5 +5,5 @@ import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domai | @@ -5,5 +5,5 @@ import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domai | ||
| 5 | type RemoveCreditAccountCommand struct { | 5 | type RemoveCreditAccountCommand struct { |
| 6 | //操作人 | 6 | //操作人 |
| 7 | Operator domain.Operator `json:"-"` | 7 | Operator domain.Operator `json:"-"` |
| 8 | - CreditAccountId int `json:"creditAccountId"` //账期结算id | 8 | + CreditAccountId int `json:"creditAccountId,string"` //账期结算id |
| 9 | } | 9 | } |
| @@ -38,16 +38,16 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *Cred | @@ -38,16 +38,16 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *Cred | ||
| 38 | ActuallyPaidAmount: param.ActuallyPaidAmount, | 38 | ActuallyPaidAmount: param.ActuallyPaidAmount, |
| 39 | CreditAccountOrderNum: param.CreditAccountOrderNum, | 39 | CreditAccountOrderNum: param.CreditAccountOrderNum, |
| 40 | PaymentStatus: param.PaymentStatus, | 40 | PaymentStatus: param.PaymentStatus, |
| 41 | - PaymentTime: param.PaymentTime.Unix(), | 41 | + PaymentTime: param.PaymentTime.UnixNano() / 1e6, |
| 42 | SettlementAmount: param.SettlementAmount, | 42 | SettlementAmount: param.SettlementAmount, |
| 43 | - SettlementTime: param.SettlementTime.Unix(), | 43 | + SettlementTime: param.SettlementTime.UnixNano() / 1e6, |
| 44 | CooperationContractNumber: param.CooperationContractNumber, | 44 | CooperationContractNumber: param.CooperationContractNumber, |
| 45 | ParticipateType: param.ParticipateType, // 参与类型 | 45 | ParticipateType: param.ParticipateType, // 参与类型 |
| 46 | PaymentDocumentAttachment: param.PaymentDocumentAttachment, // 支付凭证附件 | 46 | PaymentDocumentAttachment: param.PaymentDocumentAttachment, // 支付凭证附件 |
| 47 | Org: param.Org, // 数据所属组织机构 | 47 | Org: param.Org, // 数据所属组织机构 |
| 48 | Company: param.Company, // 公司 | 48 | Company: param.Company, // 公司 |
| 49 | - CreatedAt: param.CreatedAt.Unix(), // 创建时间 | ||
| 50 | - UpdatedAt: param.UpdatedAt.Unix(), // 更新时间 | 49 | + CreatedAt: param.CreatedAt.UnixNano() / 1e6, // 创建时间 |
| 50 | + UpdatedAt: param.UpdatedAt.UnixNano() / 1e6, // 更新时间 | ||
| 51 | AccountDetail: param.AccountDetail, | 51 | AccountDetail: param.AccountDetail, |
| 52 | } | 52 | } |
| 53 | data.Participator.UserName = param.Participator.UserName | 53 | data.Participator.UserName = param.Participator.UserName |
| @@ -11,10 +11,7 @@ import ( | @@ -11,10 +11,7 @@ import ( | ||
| 11 | type EstimateDividendsIncentivesCommand struct { | 11 | type EstimateDividendsIncentivesCommand struct { |
| 12 | //操作人 | 12 | //操作人 |
| 13 | Operator domain.Operator `json:"-"` | 13 | Operator domain.Operator `json:"-"` |
| 14 | - // 分红订单号/退货单号 | ||
| 15 | - OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` | ||
| 16 | - // 合约编号 | ||
| 17 | - CooperationContractNumber string `json:"cooperationContractNumber" ` | 14 | + OrderGoodIds []string `json:"orderGoodIds"` |
| 18 | } | 15 | } |
| 19 | 16 | ||
| 20 | func (estimateDividendsIncentivesCommand *EstimateDividendsIncentivesCommand) Valid(validation *validation.Validation) { | 17 | func (estimateDividendsIncentivesCommand *EstimateDividendsIncentivesCommand) Valid(validation *validation.Validation) { |
| @@ -10,12 +10,14 @@ import ( | @@ -10,12 +10,14 @@ import ( | ||
| 10 | type EstimateMoneyIncentivesCommand struct { | 10 | type EstimateMoneyIncentivesCommand struct { |
| 11 | //操作人 | 11 | //操作人 |
| 12 | Operator domain.Operator `json:"-"` | 12 | Operator domain.Operator `json:"-"` |
| 13 | - // 共创项目合约编号 | ||
| 14 | - CooperationContractNumber string `json:"cooperationContractNumber" valid:"Required"` | 13 | + // 共创项目合约id |
| 14 | + CooperationContractId string `json:"cooperationContractId" valid:"Required"` | ||
| 15 | // 承接人UID | 15 | // 承接人UID |
| 16 | - UndertakerUid string `json:"undertakerUid,omitempty"` | 16 | + UndertakerUids []string `json:"undertakerUids,omitempty"` |
| 17 | //分红阶段 | 17 | //分红阶段 |
| 18 | DividendsIncentivesStage int `json:"dividendsIncentivesStage"` | 18 | DividendsIncentivesStage int `json:"dividendsIncentivesStage"` |
| 19 | + //action [1:获取预算结果] [2:确认结果保存数据] | ||
| 20 | + CmdType int `json:"cmdType"` | ||
| 19 | } | 21 | } |
| 20 | 22 | ||
| 21 | func (estimateMoneyIncentivesCommand *EstimateMoneyIncentivesCommand) Valid(validation *validation.Validation) { | 23 | func (estimateMoneyIncentivesCommand *EstimateMoneyIncentivesCommand) Valid(validation *validation.Validation) { |
| @@ -10,6 +10,7 @@ type MoneyIncentivesItem struct { | @@ -10,6 +10,7 @@ type MoneyIncentivesItem struct { | ||
| 10 | 10 | ||
| 11 | //业绩分红列表 | 11 | //业绩分红列表 |
| 12 | type DividendsEstimateDividendItem struct { | 12 | type DividendsEstimateDividendItem struct { |
| 13 | + OrderGoodId int `json:"orderGoodId,string"` | ||
| 13 | CooperationContractNumber string `json:"cooperationContractNumber"` //共创合约编号 | 14 | CooperationContractNumber string `json:"cooperationContractNumber"` //共创合约编号 |
| 14 | CustomerName string `json:"customerName"` //客户名称 | 15 | CustomerName string `json:"customerName"` //客户名称 |
| 15 | DividendsIncentivesAmount float64 `json:"dividendsIncentivesAmount"` //业绩激励分红金额 | 16 | DividendsIncentivesAmount float64 `json:"dividendsIncentivesAmount"` //业绩激励分红金额 |
| @@ -23,6 +24,7 @@ func ToDividendsEstimateDividendItem(param *allied_creation_cooperation.DataDivi | @@ -23,6 +24,7 @@ func ToDividendsEstimateDividendItem(param *allied_creation_cooperation.DataDivi | ||
| 23 | var listdata []DividendsEstimateDividendItem | 24 | var listdata []DividendsEstimateDividendItem |
| 24 | for _, v := range param.List { | 25 | for _, v := range param.List { |
| 25 | item := DividendsEstimateDividendItem{ | 26 | item := DividendsEstimateDividendItem{ |
| 27 | + OrderGoodId: v.OrderGoodId, | ||
| 26 | CooperationContractNumber: v.CooperationContractNumber, | 28 | CooperationContractNumber: v.CooperationContractNumber, |
| 27 | CustomerName: v.CustomerName, | 29 | CustomerName: v.CustomerName, |
| 28 | DividendsIncentivesAmount: v.OrderAmount, | 30 | DividendsIncentivesAmount: v.OrderAmount, |
| @@ -29,8 +29,7 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncen | @@ -29,8 +29,7 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncen | ||
| 29 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | 29 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( |
| 30 | estimateDividendsIncentivesCommand.Operator) | 30 | estimateDividendsIncentivesCommand.Operator) |
| 31 | _, err := creationCooperationGateway.DividendsEstimateDividendsIncentives(allied_creation_cooperation.ReqDividendsEstimateDividendsIncentives{ | 31 | _, err := creationCooperationGateway.DividendsEstimateDividendsIncentives(allied_creation_cooperation.ReqDividendsEstimateDividendsIncentives{ |
| 32 | - CooperationContractNumber: estimateDividendsIncentivesCommand.CooperationContractNumber, | ||
| 33 | - OrderOrReturnedOrderNum: estimateDividendsIncentivesCommand.OrderOrReturnedOrderNum, | 32 | + OrderGoodIds: estimateDividendsIncentivesCommand.OrderGoodIds, |
| 34 | }) | 33 | }) |
| 35 | if err != nil { | 34 | if err != nil { |
| 36 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 35 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
| @@ -43,14 +42,25 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentive | @@ -43,14 +42,25 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentive | ||
| 43 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | 42 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( |
| 44 | estimateMoneyIncentivesCommand.Operator) | 43 | estimateMoneyIncentivesCommand.Operator) |
| 45 | result, err := creationCooperationGateway.DividendsEstimatesEstimateMoneys(allied_creation_cooperation.ReqDividendsEstimateMoneyIncentives{ | 44 | result, err := creationCooperationGateway.DividendsEstimatesEstimateMoneys(allied_creation_cooperation.ReqDividendsEstimateMoneyIncentives{ |
| 46 | - CooperationContractNumber: estimateMoneyIncentivesCommand.CooperationContractNumber, | 45 | + CooperationContractId: estimateMoneyIncentivesCommand.CooperationContractId, |
| 47 | DividendsIncentivesStage: estimateMoneyIncentivesCommand.DividendsIncentivesStage, | 46 | DividendsIncentivesStage: estimateMoneyIncentivesCommand.DividendsIncentivesStage, |
| 48 | - UndertakerUid: estimateMoneyIncentivesCommand.UndertakerUid, | 47 | + UndertakerUids: estimateMoneyIncentivesCommand.UndertakerUids, |
| 48 | + Action: estimateMoneyIncentivesCommand.CmdType, | ||
| 49 | }) | 49 | }) |
| 50 | if err != nil { | 50 | if err != nil { |
| 51 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 51 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
| 52 | } | 52 | } |
| 53 | - return result, nil | 53 | + data := []map[string]interface{}{} |
| 54 | + for i := range result { | ||
| 55 | + item := map[string]interface{}{ | ||
| 56 | + "userId": result[i].DividendsUser.UserId, | ||
| 57 | + "userName": result[i].DividendsUser.UserName, | ||
| 58 | + "DividendsAmount": result[i].DividendsAmount, | ||
| 59 | + } | ||
| 60 | + data = append(data, item) | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + return data, nil | ||
| 54 | } | 64 | } |
| 55 | 65 | ||
| 56 | // 查询分红预算单列表 | 66 | // 查询分红预算单列表 |
| @@ -111,7 +121,7 @@ func NewDividendsEstimateService(options map[string]interface{}) *DividendsEstim | @@ -111,7 +121,7 @@ func NewDividendsEstimateService(options map[string]interface{}) *DividendsEstim | ||
| 111 | return newDividendsEstimateService | 121 | return newDividendsEstimateService |
| 112 | } | 122 | } |
| 113 | 123 | ||
| 114 | -func (dividendsEmmateService *DividendsEstimateService) MoneyIncentivesSelector(queryParam query.MoneyIncentiveSelectorQuery) (interface{}, error) { | 124 | +func (dividendsEmmateService *DividendsEstimateService) MoneyIncentivesSelector(queryParam *query.MoneyIncentiveSelectorQuery) (interface{}, error) { |
| 115 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | 125 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( |
| 116 | queryParam.Operator) | 126 | queryParam.Operator) |
| 117 | resultContract, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{ | 127 | resultContract, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{ |
| @@ -134,7 +144,7 @@ func (dividendsEmmateService *DividendsEstimateService) MoneyIncentivesSelector( | @@ -134,7 +144,7 @@ func (dividendsEmmateService *DividendsEstimateService) MoneyIncentivesSelector( | ||
| 134 | for _, v := range contractData.MoneyIncentivesRules { | 144 | for _, v := range contractData.MoneyIncentivesRules { |
| 135 | r := dto.MoneyIncentivesRule{ | 145 | r := dto.MoneyIncentivesRule{ |
| 136 | MoneyIncentivesStage: v.MoneyIncentivesStage, | 146 | MoneyIncentivesStage: v.MoneyIncentivesStage, |
| 137 | - MoneyIncentivesStageStart: int(v.MoneyIncentivesTime.Unix()), | 147 | + MoneyIncentivesStageStart: int(v.MoneyIncentivesTime.UnixNano() / 1e6), |
| 138 | } | 148 | } |
| 139 | rules = append(rules, r) | 149 | rules = append(rules, r) |
| 140 | } | 150 | } |
| @@ -259,3 +259,34 @@ func (gateway HttplibAlliedCreationCooperation) CooperationContractsBatchOperate | @@ -259,3 +259,34 @@ func (gateway HttplibAlliedCreationCooperation) CooperationContractsBatchOperate | ||
| 259 | err = gateway.GetResponseData(result, &data) | 259 | err = gateway.GetResponseData(result, &data) |
| 260 | return &data, err | 260 | return &data, err |
| 261 | } | 261 | } |
| 262 | + | ||
| 263 | +// CooperationContractBatchRemove 批量移除共创合约 | ||
| 264 | +func (gateway HttplibAlliedCreationCooperation) CooperationContractBatchRemove(param ReqCooperationContractBatchRemove) (*DataCooperationContractBatchRemove, error) { | ||
| 265 | + url := gateway.baseUrL + "/cooperation-contracts/batch-remove" | ||
| 266 | + method := "DELETE" | ||
| 267 | + req := gateway.CreateRequest(url, method) | ||
| 268 | + log.Logger.Debug("向业务模块请求数据:移除共创合约。", map[string]interface{}{ | ||
| 269 | + "api": method + ":" + url, | ||
| 270 | + "param": param, | ||
| 271 | + }) | ||
| 272 | + req, err := req.JSONBody(param) | ||
| 273 | + if err != nil { | ||
| 274 | + return nil, fmt.Errorf("请求移除共创合约失败:%w", err) | ||
| 275 | + } | ||
| 276 | + | ||
| 277 | + byteResult, err := req.Bytes() | ||
| 278 | + if err != nil { | ||
| 279 | + return nil, fmt.Errorf("获取移除共创合约失败:%w", err) | ||
| 280 | + } | ||
| 281 | + log.Logger.Debug("获取业务模块请求数据:移除共创合约。", map[string]interface{}{ | ||
| 282 | + "result": string(byteResult), | ||
| 283 | + }) | ||
| 284 | + var result service_gateway.GatewayResponse | ||
| 285 | + err = json.Unmarshal(byteResult, &result) | ||
| 286 | + if err != nil { | ||
| 287 | + return nil, fmt.Errorf("解析移除共创合约:%w", err) | ||
| 288 | + } | ||
| 289 | + var data DataCooperationContractBatchRemove | ||
| 290 | + err = gateway.GetResponseData(result, &data) | ||
| 291 | + return &data, err | ||
| 292 | +} |
| @@ -134,7 +134,7 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesCancel(param R | @@ -134,7 +134,7 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesCancel(param R | ||
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | // DividendsEstimatesEstimateMoneys 确定预算金额激励分红 | 136 | // DividendsEstimatesEstimateMoneys 确定预算金额激励分红 |
| 137 | -func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesEstimateMoneys(param ReqDividendsEstimateMoneyIncentives) (*DataDividendsEstimateMoneyIncentives, error) { | 137 | +func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesEstimateMoneys(param ReqDividendsEstimateMoneyIncentives) (DataDividendsEstimateMoneyIncentives, error) { |
| 138 | url := gateway.baseUrL + "/dividends-estimates/estimate-money-incentives" | 138 | url := gateway.baseUrL + "/dividends-estimates/estimate-money-incentives" |
| 139 | method := "POST" | 139 | method := "POST" |
| 140 | req := gateway.CreateRequest(url, method) | 140 | req := gateway.CreateRequest(url, method) |
| @@ -161,7 +161,7 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesEstimateMoneys | @@ -161,7 +161,7 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesEstimateMoneys | ||
| 161 | } | 161 | } |
| 162 | var data DataDividendsEstimateMoneyIncentives | 162 | var data DataDividendsEstimateMoneyIncentives |
| 163 | err = gateway.GetResponseData(result, &data) | 163 | err = gateway.GetResponseData(result, &data) |
| 164 | - return &data, err | 164 | + return data, err |
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | // DividendsEstimatesBatchCancel 批量取消分红预算 | 167 | // DividendsEstimatesBatchCancel 批量取消分红预算 |
| @@ -245,6 +245,16 @@ type ( | @@ -245,6 +245,16 @@ type ( | ||
| 245 | } | 245 | } |
| 246 | ) | 246 | ) |
| 247 | 247 | ||
| 248 | +//移除共创合约 | ||
| 249 | +type ( | ||
| 250 | + ReqCooperationContractBatchRemove struct { | ||
| 251 | + CooperationContractIds []string `json:"cooperationContractIds"` | ||
| 252 | + } | ||
| 253 | + | ||
| 254 | + DataCooperationContractBatchRemove struct { | ||
| 255 | + } | ||
| 256 | +) | ||
| 257 | + | ||
| 248 | //返回共创合约列表 | 258 | //返回共创合约列表 |
| 249 | type ( | 259 | type ( |
| 250 | ReqCooperationContractList struct { | 260 | ReqCooperationContractList struct { |
| @@ -15,7 +15,7 @@ type ( | @@ -15,7 +15,7 @@ type ( | ||
| 15 | Total int `json:"total"` | 15 | Total int `json:"total"` |
| 16 | List []struct { | 16 | List []struct { |
| 17 | // 分红订单产品ID | 17 | // 分红订单产品ID |
| 18 | - OrderGoodId int64 `json:"orderGoodId,string"` | 18 | + OrderGoodId int `json:"orderGoodId,string"` |
| 19 | // 共创合约编号 | 19 | // 共创合约编号 |
| 20 | CooperationContractNumber string `json:"cooperationContractNumber"` | 20 | CooperationContractNumber string `json:"cooperationContractNumber"` |
| 21 | // 分红订单号或退货单号、 | 21 | // 分红订单号或退货单号、 |
| @@ -29,7 +29,7 @@ type ( | @@ -29,7 +29,7 @@ type ( | ||
| 29 | // 订单金额 | 29 | // 订单金额 |
| 30 | OrderAmount float64 `json:"orderAmount"` | 30 | OrderAmount float64 `json:"orderAmount"` |
| 31 | // 订单/退货单日期 | 31 | // 订单/退货单日期 |
| 32 | - OrderDate time.Time `json:"-"` //TODO 等待数据调整 | 32 | + OrderDate time.Time `json:"orderData"` |
| 33 | } `json:"list"` | 33 | } `json:"list"` |
| 34 | } | 34 | } |
| 35 | ) | 35 | ) |
| @@ -125,13 +125,56 @@ type ( | @@ -125,13 +125,56 @@ type ( | ||
| 125 | //确定预算金额激励分红 | 125 | //确定预算金额激励分红 |
| 126 | type ( | 126 | type ( |
| 127 | ReqDividendsEstimateMoneyIncentives struct { | 127 | ReqDividendsEstimateMoneyIncentives struct { |
| 128 | - //合约编码 | 128 | + // 共创合约ID |
| 129 | + CooperationContractId string `json:"cooperationContractId"` //cname:"共创合约ID" | ||
| 130 | + // 分红阶段 | ||
| 131 | + DividendsIncentivesStage int `json:"dividendsIncentivesStage"` //cname:"分红阶段" | ||
| 132 | + // 承接人UID | ||
| 133 | + UndertakerUids []string `json:"undertakerUids"` //cname:"承接人UID列表" | ||
| 134 | + //action [1:获取预算结果] [2:确认结果保存数据] | ||
| 135 | + Action int `json:"action"` | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + DataDividendsEstimateMoneyIncentives []struct { | ||
| 139 | + // 承接人分红预算记录ID | ||
| 140 | + DividendsEstimateId int64 `json:"dividendsEstimateId,string"` | ||
| 141 | + // 分红结算状态,1待结算,2已结算 | ||
| 142 | + DividendsAccountStatus int32 `json:"dividendsAccountStatus"` | ||
| 143 | + // 分红金额 | ||
| 144 | + DividendsAmount float64 `json:"dividendsAmount"` | ||
| 145 | + // 承接人分红预算单号 | ||
| 146 | + DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` | ||
| 147 | + // 分红预算时间 | ||
| 148 | + DividendsEstimateTime time.Time `json:"dividendsEstimateTime"` | ||
| 149 | + // 参与分红类型,1承接人,2推荐人,3关联业务员 | ||
| 150 | + DividendsParticipateType int32 `json:"dividendsParticipateType"` | ||
| 151 | + // 分红类型,1订单分红,2退货冲销,3金额激励 | ||
| 152 | + DividendsType int32 `json:"dividendsType"` | ||
| 153 | + // 分红类型名称 | ||
| 154 | + DividendsTypeName string `json:"dividendsTypeName"` | ||
| 155 | + // 分红订单号或退货单号 | ||
| 156 | + OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` | ||
| 157 | + // 共创项目合约编号,自生成,生成规则:XM+6位年月日+#+3位流水,例XM210601#001 | ||
| 129 | CooperationContractNumber string `json:"cooperationContractNumber"` | 158 | CooperationContractNumber string `json:"cooperationContractNumber"` |
| 130 | - DividendsIncentivesStage int `json:"dividendsIncentivesStage"` | ||
| 131 | - UndertakerUid string `json:"undertakerUid"` | ||
| 132 | - } | ||
| 133 | - | ||
| 134 | - DataDividendsEstimateMoneyIncentives struct { | 159 | + // 分红用户(共创参与) |
| 160 | + DividendsUser *struct { | ||
| 161 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
| 162 | + UserId int64 `json:"userId,string"` | ||
| 163 | + // 用户基本id | ||
| 164 | + UserBaseId int64 `json:"userBaseId,string"` | ||
| 165 | + // 用户类型 | ||
| 166 | + UserType int32 `json:"userType"` | ||
| 167 | + // 用户姓名 | ||
| 168 | + UserName string `json:"userName"` | ||
| 169 | + // 用户手机号 | ||
| 170 | + UserPhone string `json:"userPhone"` | ||
| 171 | + } `json:"dividendsUser"` | ||
| 172 | + // 分红阶段 | ||
| 173 | + DividendsStage int32 `json:"dividendsStage"` | ||
| 174 | + // 操作时间 | ||
| 175 | + OperateTime time.Time `json:"operateTime"` | ||
| 176 | + // 取消状态 | ||
| 177 | + IsCanceled bool `json:"isCanceled"` | ||
| 135 | } | 178 | } |
| 136 | ) | 179 | ) |
| 137 | 180 | ||
| @@ -184,10 +227,9 @@ type ( | @@ -184,10 +227,9 @@ type ( | ||
| 184 | //确定业绩分红激励 | 227 | //确定业绩分红激励 |
| 185 | type ( | 228 | type ( |
| 186 | ReqDividendsEstimateDividendsIncentives struct { | 229 | ReqDividendsEstimateDividendsIncentives struct { |
| 187 | - CooperationContractNumber string `json:"cooperationContractNumber"` | ||
| 188 | - OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` | 230 | + OrderGoodIds []string `json:"orderGoodIds"` |
| 189 | } | 231 | } |
| 190 | 232 | ||
| 191 | - DataDividendsEstimateDividendsIncentives struct { | 233 | + DataDividendsEstimateDividendsIncentives []struct { |
| 192 | } | 234 | } |
| 193 | ) | 235 | ) |
| @@ -81,3 +81,14 @@ func (controller *CooperationContractController) SearchCooperationContractsByUnd | @@ -81,3 +81,14 @@ func (controller *CooperationContractController) SearchCooperationContractsByUnd | ||
| 81 | cnt, data, err := cooperationContractService.SearchCooperationContractsByUndertake(listCooperationContractQuery) | 81 | cnt, data, err := cooperationContractService.SearchCooperationContractsByUndertake(listCooperationContractQuery) |
| 82 | controller.ReturnPageListData(int64(cnt), data, err, listCooperationContractQuery.PageNumber) | 82 | controller.ReturnPageListData(int64(cnt), data, err, listCooperationContractQuery.PageNumber) |
| 83 | } | 83 | } |
| 84 | + | ||
| 85 | +func (controller *CooperationContractController) RemoveCooperationContract() { | ||
| 86 | + cooperationContractService := service.NewCooperationContractService(nil) | ||
| 87 | + removeCooperationContractCommand := &command.RemoveCooperationContractCommand{} | ||
| 88 | + err := controller.Unmarshal(removeCooperationContractCommand) | ||
| 89 | + if err != nil { | ||
| 90 | + log.Logger.Debug("json err:" + err.Error()) | ||
| 91 | + } | ||
| 92 | + data, err := cooperationContractService.RemoveCooperationContract(removeCooperationContractCommand) | ||
| 93 | + controller.Response(data, err) | ||
| 94 | +} |
| @@ -21,7 +21,7 @@ func (controller *CreditAccountController) ListCreditAccount() { | @@ -21,7 +21,7 @@ func (controller *CreditAccountController) ListCreditAccount() { | ||
| 21 | } | 21 | } |
| 22 | listQuery.Operator = controller.GetOperator() | 22 | listQuery.Operator = controller.GetOperator() |
| 23 | cnt, data, err := creditAccountService.ListCreditAccount(listQuery) | 23 | cnt, data, err := creditAccountService.ListCreditAccount(listQuery) |
| 24 | - controller.ReturnListData(cnt, data, err) | 24 | + controller.ReturnPageListData(cnt, data, err, listQuery.PageNumber) |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | //GetCreditAccount 返回账期结算详情 | 27 | //GetCreditAccount 返回账期结算详情 |
| @@ -88,3 +88,16 @@ func (controller *DividendsEstimateController) EstimateDividendsIncentives() { | @@ -88,3 +88,16 @@ func (controller *DividendsEstimateController) EstimateDividendsIncentives() { | ||
| 88 | data, err := dividendsEstimateService.EstimateDividendsIncentives(estimateDividendsIncentivesCommand) | 88 | data, err := dividendsEstimateService.EstimateDividendsIncentives(estimateDividendsIncentivesCommand) |
| 89 | controller.Response(data, err) | 89 | controller.Response(data, err) |
| 90 | } | 90 | } |
| 91 | + | ||
| 92 | +//MoneyIncentivesSelector | ||
| 93 | +func (controller *DividendsEstimateController) MoneyIncentivesSelector() { | ||
| 94 | + dividendsEstimateService := service.NewDividendsEstimateService(nil) | ||
| 95 | + moneyIncentivesSelectorQuery := &query.MoneyIncentiveSelectorQuery{} | ||
| 96 | + err := controller.Unmarshal(moneyIncentivesSelectorQuery) | ||
| 97 | + if err != nil { | ||
| 98 | + log.Logger.Debug("json err:" + err.Error()) | ||
| 99 | + } | ||
| 100 | + moneyIncentivesSelectorQuery.Operator = controller.GetOperator() | ||
| 101 | + data, err := dividendsEstimateService.MoneyIncentivesSelector(moneyIncentivesSelectorQuery) | ||
| 102 | + controller.Response(data, err) | ||
| 103 | +} |
| @@ -10,6 +10,8 @@ func init() { | @@ -10,6 +10,8 @@ func init() { | ||
| 10 | web.Router("/v1/web/cooperation-contracts/:contractId", &web_client.CooperationContractController{}, "Put:UpdateCooperationContract") | 10 | web.Router("/v1/web/cooperation-contracts/:contractId", &web_client.CooperationContractController{}, "Put:UpdateCooperationContract") |
| 11 | web.Router("/v1/web/cooperation-contracts/:contractId", &web_client.CooperationContractController{}, "Get:GetCooperationContract") | 11 | web.Router("/v1/web/cooperation-contracts/:contractId", &web_client.CooperationContractController{}, "Get:GetCooperationContract") |
| 12 | web.Router("/v1/web/cooperation-contracts/search", &web_client.CooperationContractController{}, "Post:ListCooperationContract") | 12 | web.Router("/v1/web/cooperation-contracts/search", &web_client.CooperationContractController{}, "Post:ListCooperationContract") |
| 13 | - web.Router("/v1/web/cooperation-contracts/enable", &web_client.CooperationContractController{}, "Put:EnableCooperationContract") | 13 | + web.Router("/v1/web/cooperation-contracts/enable", &web_client.CooperationContractController{}, "Post:EnableCooperationContract") |
| 14 | web.Router("/v1/web/cooperation-contracts/undertaker", &web_client.CooperationContractController{}, "Post:SearchCooperationContractsByUndertake") | 14 | web.Router("/v1/web/cooperation-contracts/undertaker", &web_client.CooperationContractController{}, "Post:SearchCooperationContractsByUndertake") |
| 15 | + web.Router("/v1/web/cooperation-contracts/remove", &web_client.CooperationContractController{}, "Post:RemoveCooperationContract") | ||
| 16 | + | ||
| 15 | } | 17 | } |
| 1 | +package routers | ||
| 2 | + | ||
| 3 | +import ( | ||
| 4 | + "github.com/beego/beego/v2/server/web" | ||
| 5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client" | ||
| 6 | +) | ||
| 7 | + | ||
| 8 | +func init() { | ||
| 9 | + web.Router("/v1/web/credit-accounts/:creditAccountId", &web_client.CreditAccountController{}, "Get:GetCreditAccount") | ||
| 10 | + web.Router("/v1/web/credit-accounts/search", &web_client.CreditAccountController{}, "Post:ListCreditAccount") | ||
| 11 | + web.Router("/v1/web/credit-accounts/remove", &web_client.CreditAccountController{}, "Post:RemoveCreditAccount") | ||
| 12 | + web.Router("/v1/web/credit-accounts/pay", &web_client.CreditAccountController{}, "Post:PayCreditAccount") | ||
| 13 | +} |
| @@ -12,4 +12,5 @@ func init() { | @@ -12,4 +12,5 @@ func init() { | ||
| 12 | web.Router("/v1/web/dividends-estimate/money-incentives/search", &web_client.DividendsEstimateController{}, "Post:SearchMoneyIncentives") | 12 | web.Router("/v1/web/dividends-estimate/money-incentives/search", &web_client.DividendsEstimateController{}, "Post:SearchMoneyIncentives") |
| 13 | web.Router("/v1/web/dividends-estimate/money-incentives/estimate", &web_client.DividendsEstimateController{}, "Post:EstimateMoneyIncentives") | 13 | web.Router("/v1/web/dividends-estimate/money-incentives/estimate", &web_client.DividendsEstimateController{}, "Post:EstimateMoneyIncentives") |
| 14 | web.Router("/v1/web/dividends-estimate/dividends-incentives/estimate", &web_client.DividendsEstimateController{}, "Post:EstimateDividendsIncentives") | 14 | web.Router("/v1/web/dividends-estimate/dividends-incentives/estimate", &web_client.DividendsEstimateController{}, "Post:EstimateDividendsIncentives") |
| 15 | + web.Router("/v1/web/dividends-estimate/money-incentives/selector", &web_client.DividendsEstimateController{}, "Post:MoneyIncentivesSelector") | ||
| 15 | } | 16 | } |
-
请 注册 或 登录 后发表评论