作者 tangxuhui

添加 账期结算gateway

@@ -198,7 +198,6 @@ func (cooperationContractService *CooperationContractService) SearchCooperationC @@ -198,7 +198,6 @@ func (cooperationContractService *CooperationContractService) SearchCooperationC
198 allied_creation_cooperation.ReqCooperationContractSearchByUndertaker{ 198 allied_creation_cooperation.ReqCooperationContractSearchByUndertaker{
199 CooperationContractName: queryParam.CooperationContractName, 199 CooperationContractName: queryParam.CooperationContractName,
200 SponsorName: queryParam.ContractSponsor, 200 SponsorName: queryParam.ContractSponsor,
201 - UserId: 0,  
202 PageNumber: queryParam.PageNumber, 201 PageNumber: queryParam.PageNumber,
203 PageIndex: queryParam.PageSize, 202 PageIndex: queryParam.PageSize,
204 }) 203 })
  1 +package dto
  2 +
  3 +//MoneyIncentivesItem 金额激励分红列表
  4 +type MoneyIncentivesItem struct {
  5 +}
@@ -13,7 +13,9 @@ type ListMoneyIncentivesQuery struct { @@ -13,7 +13,9 @@ type ListMoneyIncentivesQuery struct {
13 // 查询偏离量 13 // 查询偏离量
14 PageNumber int `json:"pageNumber" valid:"Required"` 14 PageNumber int `json:"pageNumber" valid:"Required"`
15 // 查询限制 15 // 查询限制
16 - PageSize int `json:"pageSize" valid:"Required"` 16 + PageSize int `json:"pageSize" valid:"Required"`
  17 + CooperationContractName string `json:"cooperationContractName"` //合约名称
  18 + DepartmentName string `json:"department"`
17 } 19 }
18 20
19 func (listMoneyIncentivesQuery *ListMoneyIncentivesQuery) Valid(validation *validation.Validation) { 21 func (listMoneyIncentivesQuery *ListMoneyIncentivesQuery) Valid(validation *validation.Validation) {
@@ -13,7 +13,9 @@ type SearchDividendsEstimateQuery struct { @@ -13,7 +13,9 @@ type SearchDividendsEstimateQuery struct {
13 // 承接人分红预算单号 13 // 承接人分红预算单号
14 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` 14 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
15 // 分红类型,1订单分红,2退货冲销,3金额激励 15 // 分红类型,1订单分红,2退货冲销,3金额激励
16 - DividendsType int `json:"dividendsType" valid:"Required"` 16 + DividendsType int `json:"dividendsType"`
  17 + PageNumber int `json:"pageNumber"`
  18 + PageSize int `json:"pageSize"`
17 } 19 }
18 20
19 func (searchDividendsEstimateQuery *SearchDividendsEstimateQuery) Valid(validation *validation.Validation) { 21 func (searchDividendsEstimateQuery *SearchDividendsEstimateQuery) Valid(validation *validation.Validation) {
@@ -11,13 +11,15 @@ type SearchDividendsIncentivesQuery struct { @@ -11,13 +11,15 @@ type SearchDividendsIncentivesQuery struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
13 // 合约编号 13 // 合约编号
14 - CooperationContractNumber string `json:"cooperationContractNumber,omitempty"` 14 + CooperationContractNumber string `json:"cooperationContractNumber"`
15 // 分红订单号/退货单号 15 // 分红订单号/退货单号
16 - OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum,omitempty"` 16 + OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"`
  17 + PageNumber int `json:"pageNumber"`
  18 + PageSize int `json:"pageSize"`
17 } 19 }
18 20
19 func (searchDividendsIncentivesQuery *SearchDividendsIncentivesQuery) Valid(validation *validation.Validation) { 21 func (searchDividendsIncentivesQuery *SearchDividendsIncentivesQuery) Valid(validation *validation.Validation) {
20 - validation.SetError("CustomValid", "未实现的自定义认证") 22 +
21 } 23 }
22 24
23 func (searchDividendsIncentivesQuery *SearchDividendsIncentivesQuery) ValidateQuery() error { 25 func (searchDividendsIncentivesQuery *SearchDividendsIncentivesQuery) ValidateQuery() error {
@@ -9,13 +9,17 @@ import ( @@ -9,13 +9,17 @@ import (
9 9
10 type SearchMoneyIncentivesQuery struct { 10 type SearchMoneyIncentivesQuery struct {
11 //操作人 11 //操作人
12 - Operator domain.Operator `json:"-"`  
13 - // 共创合约名称  
14 - CooperationContractName string `json:"cooperationContractName,omitempty"` 12 + Operator domain.Operator `json:"-"`
  13 + PageNumber int `json:"pageNumber"`
  14 + PageSize int `json:"pageSize"`
  15 + //共创合约名称
  16 + CooperationContractName string `json:"cooperationContractName"`
  17 + //发起部门名称
  18 + DepartmentName string `json:"departmentName"`
15 } 19 }
16 20
17 func (searchMoneyIncentivesQuery *SearchMoneyIncentivesQuery) Valid(validation *validation.Validation) { 21 func (searchMoneyIncentivesQuery *SearchMoneyIncentivesQuery) Valid(validation *validation.Validation) {
18 - validation.SetError("CustomValid", "未实现的自定义认证") 22 +
19 } 23 }
20 24
21 func (searchMoneyIncentivesQuery *SearchMoneyIncentivesQuery) ValidateQuery() error { 25 func (searchMoneyIncentivesQuery *SearchMoneyIncentivesQuery) ValidateQuery() error {
@@ -38,68 +38,55 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentive @@ -38,68 +38,55 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentive
38 return nil, nil 38 return nil, nil
39 } 39 }
40 40
41 -// 返回分红预算服务  
42 -func (dividendsEstimateService *DividendsEstimateService) GetDividendsEstimate(getDividendsEstimateQuery *query.GetDividendsEstimateQuery) (interface{}, error) {  
43 - // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
44 - // getDividendsEstimateQuery.Operator)  
45 - return nil, nil  
46 -  
47 -}  
48 -  
49 -// 返回分红预算服务列表  
50 -func (dividendsEstimateService *DividendsEstimateService) ListDividendsEstimate(listDividendsEstimateQuery *query.ListDividendsEstimateQuery) (interface{}, error) {  
51 - // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
52 - // listDividendsEstimateQuery.Operator)  
53 - return nil, nil  
54 -}  
55 -  
56 -// 返回业绩激励分红  
57 -func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentives(listDividendsIncentivesQuery *query.ListDividendsIncentivesQuery) (interface{}, error) {  
58 - // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
59 - // listDividendsIncentivesQuery.Operator)  
60 - return nil, nil  
61 -}  
62 -  
63 -// 返回金额激励分红  
64 -func (dividendsEstimateService *DividendsEstimateService) ListMoneyIncentives(listMoneyIncentivesQue *query.ListMoneyIncentivesQuery) (interface{}, error) {  
65 - // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
66 - // listMoneyIncentivesQue.Operator)  
67 - return nil, nil  
68 -}  
69 -  
70 -// 移除分红预算服务  
71 -func (dividendsEstimateService *DividendsEstimateService) RemoveDividendsEstimate(removeDividendsEstimateCommand *command.RemoveDividendsEstimateCommand) (interface{}, error) {  
72 - // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
73 - // removeDividendsEstimateCommand.Operator)  
74 - return nil, nil  
75 -}  
76 -  
77 -// 查询分红预算单 41 +// 查询分红预算单列表
78 func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimate(searchDividendsEstimateQuery *query.SearchDividendsEstimateQuery) (interface{}, error) { 42 func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimate(searchDividendsEstimateQuery *query.SearchDividendsEstimateQuery) (interface{}, error) {
79 - // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
80 - // searchDividendsEstimateQuery.Operator)  
81 - return nil, nil 43 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  44 + searchDividendsEstimateQuery.Operator)
  45 + result, err := creationCooperationGateway.DividendsEstimatesSearch(allied_creation_cooperation.ReqDividendsEstimateSearch{
  46 + //承接人分红预算单号
  47 + DividendsEstimateOrderNumber: searchDividendsEstimateQuery.DividendsEstimateOrderNumber,
  48 + //分红类型,1订单分红,2退货冲销,3金额激励
  49 + DividendsType: searchDividendsEstimateQuery.DividendsType,
  50 + PageNumber: searchDividendsEstimateQuery.PageNumber,
  51 + PageSize: searchDividendsEstimateQuery.PageSize,
  52 + })
  53 + if err != nil {
  54 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  55 + }
  56 + return result, nil
82 } 57 }
83 58
84 // 查询业绩分红 59 // 查询业绩分红
85 func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncentives(searchDividendsIncentivesQuery *query.SearchDividendsIncentivesQuery) (interface{}, error) { 60 func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncentives(searchDividendsIncentivesQuery *query.SearchDividendsIncentivesQuery) (interface{}, error) {
86 - // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
87 - // searchDividendsIncentivesQuery.Operator)  
88 - return nil, nil 61 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  62 + searchDividendsIncentivesQuery.Operator)
  63 + result, err := creationCooperationGateway.DividendsEstimateSearchDividends(
  64 + allied_creation_cooperation.ReqDividendsEstimateSearchDividend{
  65 + PageNumber: searchDividendsIncentivesQuery.PageNumber,
  66 + PageSize: searchDividendsIncentivesQuery.PageSize,
  67 + CooperationContractNumber: searchDividendsIncentivesQuery.CooperationContractNumber,
  68 + OrderOrReturnedOrderNum: searchDividendsIncentivesQuery.OrderOrReturnedOrderNum,
  69 + })
  70 + if err != nil {
  71 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  72 + }
  73 + return result, nil
89 } 74 }
90 75
91 // 查询金额激励分红 76 // 查询金额激励分红
92 func (dividendsEmmateService *DividendsEstimateService) SearchMoneyIncentives(searchMoneyIncentivesQuery *query.SearchMoneyIncentivesQuery) (interface{}, error) { 77 func (dividendsEmmateService *DividendsEstimateService) SearchMoneyIncentives(searchMoneyIncentivesQuery *query.SearchMoneyIncentivesQuery) (interface{}, error) {
93 - // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
94 - // searchMoneyIncentivesQuery.Operator)  
95 - return nil, nil  
96 -}  
97 -  
98 -// 更新分红预算服务  
99 -func (dividendsEstimateService *DividendsEstimateService) UpdateDividendsEstimate(updateDividendsEstimateCommand *command.UpdateDividendsEstimateCommand) (interface{}, error) {  
100 - // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
101 - // updateDividendsEstimateCommand.Operator)  
102 - return nil, nil 78 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  79 + searchMoneyIncentivesQuery.Operator)
  80 + result, err := creationCooperationGateway.DividendsEstimatesSearchMoney(allied_creation_cooperation.ReqDividendsEstimateSearchMoney{
  81 + PageNumber: searchMoneyIncentivesQuery.PageNumber,
  82 + PageSize: searchMoneyIncentivesQuery.PageSize,
  83 + CooperationContractName: searchMoneyIncentivesQuery.CooperationContractName,
  84 + DepartmentName: searchMoneyIncentivesQuery.DepartmentName,
  85 + })
  86 + if err != nil {
  87 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  88 + }
  89 + return result, nil
103 } 90 }
104 91
105 func NewDividendsEstimateService(options map[string]interface{}) *DividendsEstimateService { 92 func NewDividendsEstimateService(options map[string]interface{}) *DividendsEstimateService {
  1 +package allied_creation_cooperation
  2 +
  3 +import (
  4 + "encoding/json"
  5 + "fmt"
  6 + "strconv"
  7 +
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
  9 +
  10 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
  11 +)
  12 +
  13 +// CreditAccountCreate 创建账期结算单
  14 +func (gateway HttplibAlliedCreationCooperation) CreditAccountCreate(param ReqCreditAccountCreate) (*DataCreditAccountCreate, error) {
  15 + url := gateway.baseUrL + "/credit-accounts"
  16 + method := "POST"
  17 + req := gateway.CreateRequest(url, method)
  18 + log.Logger.Debug("向业务模块请求数据:创建账期结算单。", map[string]interface{}{
  19 + "api": method + ":" + url,
  20 + "param": param,
  21 + })
  22 + req, err := req.JSONBody(param)
  23 + if err != nil {
  24 + return nil, fmt.Errorf("请求创建账期结算单失败:%w", err)
  25 + }
  26 +
  27 + byteResult, err := req.Bytes()
  28 + if err != nil {
  29 + return nil, fmt.Errorf("获取创建账期结算单失败:%w", err)
  30 + }
  31 + log.Logger.Debug("获取业务模块请求数据:创建账期结算单。", map[string]interface{}{
  32 + "result": string(byteResult),
  33 + })
  34 + var result service_gateway.GatewayResponse
  35 + err = json.Unmarshal(byteResult, &result)
  36 + if err != nil {
  37 + return nil, fmt.Errorf("解析创建账期结算单:%w", err)
  38 + }
  39 + var data DataCreditAccountCreate
  40 + err = gateway.GetResponseData(result, &data)
  41 + return &data, err
  42 +}
  43 +
  44 +// Credit-accountsPay 支付账期结算
  45 +func (gateway HttplibAlliedCreationCooperation) CreditAccountsPay(param ReqCreditAccountsPay) (*DataCreditAccountsPay, error) {
  46 + url := gateway.baseUrL + "/credit-accounts/pay"
  47 + method := "POST"
  48 + req := gateway.CreateRequest(url, method)
  49 + log.Logger.Debug("向业务模块请求数据:支付账期结算。", map[string]interface{}{
  50 + "api": method + ":" + url,
  51 + "param": param,
  52 + })
  53 + req, err := req.JSONBody(param)
  54 + if err != nil {
  55 + return nil, fmt.Errorf("请求支付账期结算失败:%w", err)
  56 + }
  57 +
  58 + byteResult, err := req.Bytes()
  59 + if err != nil {
  60 + return nil, fmt.Errorf("获取支付账期结算失败:%w", err)
  61 + }
  62 + log.Logger.Debug("获取业务模块请求数据:支付账期结算。", map[string]interface{}{
  63 + "result": string(byteResult),
  64 + })
  65 + var result service_gateway.GatewayResponse
  66 + err = json.Unmarshal(byteResult, &result)
  67 + if err != nil {
  68 + return nil, fmt.Errorf("解析支付账期结算:%w", err)
  69 + }
  70 + var data DataCreditAccountsPay
  71 + err = gateway.GetResponseData(result, &data)
  72 + return &data, err
  73 +}
  74 +
  75 +// Credit-accounts[creditAccountId} 更新账期结算单
  76 +func (gateway HttplibAlliedCreationCooperation) CreditAccountUpdate(param ReqCreditAccountUpdate) (*DataCreditAccountUpdate, error) {
  77 + url := gateway.baseUrL + "/credit-accounts/{creditAccountId}"
  78 + method := "PUT"
  79 + req := gateway.CreateRequest(url, method)
  80 + log.Logger.Debug("向业务模块请求数据:更新账期结算单。", map[string]interface{}{
  81 + "api": method + ":" + url,
  82 + "param": param,
  83 + })
  84 + req, err := req.JSONBody(param)
  85 + if err != nil {
  86 + return nil, fmt.Errorf("请求更新账期结算单失败:%w", err)
  87 + }
  88 +
  89 + byteResult, err := req.Bytes()
  90 + if err != nil {
  91 + return nil, fmt.Errorf("获取更新账期结算单失败:%w", err)
  92 + }
  93 + log.Logger.Debug("获取业务模块请求数据:更新账期结算单。", map[string]interface{}{
  94 + "result": string(byteResult),
  95 + })
  96 + var result service_gateway.GatewayResponse
  97 + err = json.Unmarshal(byteResult, &result)
  98 + if err != nil {
  99 + return nil, fmt.Errorf("解析更新账期结算单:%w", err)
  100 + }
  101 + var data DataCreditAccountUpdate
  102 + err = gateway.GetResponseData(result, &data)
  103 + return &data, err
  104 +}
  105 +
  106 +// Credit-accountsSearch 查询账期结算单
  107 +func (gateway HttplibAlliedCreationCooperation) CreditAccountsSearch(param ReqCreditAccountsSearch) (*DataCreditAccountsSearch, error) {
  108 + url := gateway.baseUrL + "/credit-accounts/search"
  109 + method := "POST"
  110 + req := gateway.CreateRequest(url, method)
  111 + log.Logger.Debug("向业务模块请求数据:查询账期结算单。", map[string]interface{}{
  112 + "api": method + ":" + url,
  113 + "param": param,
  114 + })
  115 + req, err := req.JSONBody(param)
  116 + if err != nil {
  117 + return nil, fmt.Errorf("请求查询账期结算单失败:%w", err)
  118 + }
  119 +
  120 + byteResult, err := req.Bytes()
  121 + if err != nil {
  122 + return nil, fmt.Errorf("获取查询账期结算单失败:%w", err)
  123 + }
  124 + log.Logger.Debug("获取业务模块请求数据:查询账期结算单。", map[string]interface{}{
  125 + "result": string(byteResult),
  126 + })
  127 + var result service_gateway.GatewayResponse
  128 + err = json.Unmarshal(byteResult, &result)
  129 + if err != nil {
  130 + return nil, fmt.Errorf("解析查询账期结算单:%w", err)
  131 + }
  132 + var data DataCreditAccountsSearch
  133 + err = gateway.GetResponseData(result, &data)
  134 + return &data, err
  135 +}
  136 +
  137 +// CreditAccountRemove 移除账期结算单
  138 +func (gateway HttplibAlliedCreationCooperation) CreditAccountRemove(param ReqCreditAccountRemove) (*DataCreditAccountRemove, error) {
  139 + url := gateway.baseUrL + "/credit-accounts/" + strconv.Itoa(param.CreditAccountId)
  140 + method := "DELETE"
  141 + req := gateway.CreateRequest(url, method)
  142 + log.Logger.Debug("向业务模块请求数据:移除账期结算单。", map[string]interface{}{
  143 + "api": method + ":" + url,
  144 + "param": param,
  145 + })
  146 + req, err := req.JSONBody(param)
  147 + if err != nil {
  148 + return nil, fmt.Errorf("请求移除账期结算单失败:%w", err)
  149 + }
  150 +
  151 + byteResult, err := req.Bytes()
  152 + if err != nil {
  153 + return nil, fmt.Errorf("获取移除账期结算单失败:%w", err)
  154 + }
  155 + log.Logger.Debug("获取业务模块请求数据:移除账期结算单。", map[string]interface{}{
  156 + "result": string(byteResult),
  157 + })
  158 + var result service_gateway.GatewayResponse
  159 + err = json.Unmarshal(byteResult, &result)
  160 + if err != nil {
  161 + return nil, fmt.Errorf("解析移除账期结算单:%w", err)
  162 + }
  163 + var data DataCreditAccountRemove
  164 + err = gateway.GetResponseData(result, &data)
  165 + return &data, err
  166 +}
  167 +
  168 +// CreditAccountList 返回账期结算单列表
  169 +func (gateway HttplibAlliedCreationCooperation) CreditAccountList(param ReqCreditAccountList) (*DataCreditAccountList, error) {
  170 + url := gateway.baseUrL + "/credit-accounts"
  171 + method := "GET"
  172 + req := gateway.CreateRequest(url, method)
  173 + log.Logger.Debug("向业务模块请求数据:返回账期结算单列表。", map[string]interface{}{
  174 + "api": method + ":" + url,
  175 + "param": param,
  176 + })
  177 + req, err := req.JSONBody(param)
  178 + if err != nil {
  179 + return nil, fmt.Errorf("请求返回账期结算单列表失败:%w", err)
  180 + }
  181 +
  182 + byteResult, err := req.Bytes()
  183 + if err != nil {
  184 + return nil, fmt.Errorf("获取返回账期结算单列表失败:%w", err)
  185 + }
  186 + log.Logger.Debug("获取业务模块请求数据:返回账期结算单列表。", map[string]interface{}{
  187 + "result": string(byteResult),
  188 + })
  189 + var result service_gateway.GatewayResponse
  190 + err = json.Unmarshal(byteResult, &result)
  191 + if err != nil {
  192 + return nil, fmt.Errorf("解析返回账期结算单列表:%w", err)
  193 + }
  194 + var data DataCreditAccountList
  195 + err = gateway.GetResponseData(result, &data)
  196 + return &data, err
  197 +}
  198 +
  199 +// CreditAccountGet 返回账期结算单详情
  200 +func (gateway HttplibAlliedCreationCooperation) CreditAccountGet(param ReqCreditAccountGet) (*DataCreditAccountGet, error) {
  201 + url := gateway.baseUrL + "/credit-accounts/" + strconv.Itoa(param.CreditAccountId)
  202 + method := "GET"
  203 + req := gateway.CreateRequest(url, method)
  204 + log.Logger.Debug("向业务模块请求数据:返回账期结算单详情。", map[string]interface{}{
  205 + "api": method + ":" + url,
  206 + "param": param,
  207 + })
  208 + req, err := req.JSONBody(param)
  209 + if err != nil {
  210 + return nil, fmt.Errorf("请求返回账期结算单详情失败:%w", err)
  211 + }
  212 +
  213 + byteResult, err := req.Bytes()
  214 + if err != nil {
  215 + return nil, fmt.Errorf("获取返回账期结算单详情失败:%w", err)
  216 + }
  217 + log.Logger.Debug("获取业务模块请求数据:返回账期结算单详情。", map[string]interface{}{
  218 + "result": string(byteResult),
  219 + })
  220 + var result service_gateway.GatewayResponse
  221 + err = json.Unmarshal(byteResult, &result)
  222 + if err != nil {
  223 + return nil, fmt.Errorf("解析返回账期结算单详情:%w", err)
  224 + }
  225 + var data DataCreditAccountGet
  226 + err = gateway.GetResponseData(result, &data)
  227 + return &data, err
  228 +}
@@ -195,38 +195,6 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesEstimateMoneys @@ -195,38 +195,6 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesEstimateMoneys
195 return &data, err 195 return &data, err
196 } 196 }
197 197
198 -// DividendAestimatesdivDidendsEstimat 移除分红预算  
199 -func (gateway HttplibAlliedCreationCooperation) DividendAestimatesdivDidendsEstimat(param ReqDividendsEstimateRemove) (  
200 - *DataDividendsEstimateRemove, error) {  
201 - url := gateway.baseUrL + "/dividends-estimates/" + strconv.Itoa(param.DividendsEstimateId)  
202 - method := "DELETE"  
203 - req := gateway.CreateRequest(url, method)  
204 - log.Logger.Debug("向业务模块请求数据:移除分红预算。", map[string]interface{}{  
205 - "api": method + ":" + url,  
206 - "param": param,  
207 - })  
208 - req, err := req.JSONBody(param)  
209 - if err != nil {  
210 - return nil, fmt.Errorf("请求移除分红预算失败:%w", err)  
211 - }  
212 -  
213 - byteResult, err := req.Bytes()  
214 - if err != nil {  
215 - return nil, fmt.Errorf("获取移除分红预算失败:%w", err)  
216 - }  
217 - log.Logger.Debug("获取业务模块请求数据:移除分红预算。", map[string]interface{}{  
218 - "result": string(byteResult),  
219 - })  
220 - var result service_gateway.GatewayResponse  
221 - err = json.Unmarshal(byteResult, &result)  
222 - if err != nil {  
223 - return nil, fmt.Errorf("解析移除分红预算:%w", err)  
224 - }  
225 - var data DataDividendsEstimateRemove  
226 - err = gateway.GetResponseData(result, &data)  
227 - return &data, err  
228 -}  
229 -  
230 // DividendsEstimateListDividend 返回业绩激励分红详情 198 // DividendsEstimateListDividend 返回业绩激励分红详情
231 func (gateway HttplibAlliedCreationCooperation) DividendsEstimateListDividend(param ReqDividendsEstimateListDividend) (*DataDividendsEstimateListDividend, error) { 199 func (gateway HttplibAlliedCreationCooperation) DividendsEstimateListDividend(param ReqDividendsEstimateListDividend) (*DataDividendsEstimateListDividend, error) {
232 url := gateway.baseUrL + "/dividends-estimates/list-dividends-incentives" 200 url := gateway.baseUrL + "/dividends-estimates/list-dividends-incentives"
@@ -351,7 +319,7 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesListMoney(para @@ -351,7 +319,7 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesListMoney(para
351 return &data, err 319 return &data, err
352 } 320 }
353 321
354 -// DividendsEstimatesBatchCancel 取消分红预算 322 +// DividendsEstimatesBatchCancel 批量取消分红预算
355 func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesBatchCancel(param ReqDividendsEstimateBatchCancel) (*DataDividendsEstimateBatchCancel, error) { 323 func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesBatchCancel(param ReqDividendsEstimateBatchCancel) (*DataDividendsEstimateBatchCancel, error) {
356 url := gateway.baseUrL + "/dividends-estimates/batch-cancel" 324 url := gateway.baseUrL + "/dividends-estimates/batch-cancel"
357 method := "POST" 325 method := "POST"
@@ -215,7 +215,6 @@ type ( @@ -215,7 +215,6 @@ type (
215 ReqCooperationContractSearchByUndertaker struct { 215 ReqCooperationContractSearchByUndertaker struct {
216 CooperationContractName string `json:"cooperationContractName"` //合约名称 216 CooperationContractName string `json:"cooperationContractName"` //合约名称
217 SponsorName string `json:"sponsorName"` //项目发起人姓名 217 SponsorName string `json:"sponsorName"` //项目发起人姓名
218 - UserId int `json:"userId"` //合约发起人  
219 PageNumber int `json:"pageNumber"` 218 PageNumber int `json:"pageNumber"`
220 PageIndex int `json:"pageIndex"` 219 PageIndex int `json:"pageIndex"`
221 } 220 }
  1 +package allied_creation_cooperation
  2 +
  3 +//创建账期结算单
  4 +type (
  5 + ReqCreditAccountCreate struct {
  6 + }
  7 +
  8 + DataCreditAccountCreate struct {
  9 + }
  10 +)
  11 +
  12 +//支付账期结算
  13 +type (
  14 + ReqCreditAccountsPay struct {
  15 + }
  16 +
  17 + DataCreditAccountsPay struct {
  18 + }
  19 +)
  20 +
  21 +//更新账期结算单
  22 +type (
  23 + ReqCreditAccountUpdate struct {
  24 + }
  25 +
  26 + DataCreditAccountUpdate struct {
  27 + }
  28 +)
  29 +
  30 +//查询账期结算单
  31 +type (
  32 + ReqCreditAccountsSearch struct {
  33 + }
  34 +
  35 + DataCreditAccountsSearch struct {
  36 + }
  37 +)
  38 +
  39 +//移除账期结算单
  40 +type (
  41 + ReqCreditAccountRemove struct {
  42 + CreditAccountId int
  43 + }
  44 +
  45 + DataCreditAccountRemove struct {
  46 + }
  47 +)
  48 +
  49 +//返回账期结算单列表
  50 +type (
  51 + ReqCreditAccountList struct {
  52 + }
  53 +
  54 + DataCreditAccountList struct {
  55 + }
  56 +)
  57 +
  58 +//返回账期结算单详情
  59 +type (
  60 + ReqCreditAccountGet struct {
  61 + CreditAccountId int
  62 + }
  63 +
  64 + DataCreditAccountGet struct {
  65 + }
  66 +)
@@ -14,6 +14,10 @@ type ( @@ -14,6 +14,10 @@ type (
14 } 14 }
15 15
16 DataDividendsEstimateSearchDividend struct { 16 DataDividendsEstimateSearchDividend struct {
  17 + Grid struct {
  18 + Total int `json:"total"`
  19 + List []struct{} `json:"list"`
  20 + } `json:"grid"`
17 } 21 }
18 ) 22 )
19 23
@@ -75,10 +79,31 @@ type ( @@ -75,10 +79,31 @@ type (
75 79
76 DataDividendsEstimateSearchMoney struct { 80 DataDividendsEstimateSearchMoney struct {
77 Grid struct { 81 Grid struct {
78 - Total int 82 + Total int `json:"total"`
79 List []struct { 83 List []struct {
80 - }  
81 - } 84 + CooperationContractName string `json:"cooperationContractName"` //合约名称
  85 + CooperationContractNumber string `json:"cooperationContractNumber"` //合约编码
  86 + CooperationMode struct {
  87 + CooperationModeId int `json:"cooperationModeId"`
  88 + CooperationModeName string `json:"cooperationModeName"`
  89 + CooperationModeNumber string `json:"cooperationModeNumber"`
  90 + } `json:"cooperationMode"` //共创模式
  91 + CreatedAt time.Time `json:"createdAt"` //合约建立时间
  92 + Department struct {
  93 + DepartmentId int `json:"departmentId"`
  94 + DepartmentName string `json:"departmentName"`
  95 + } `json:"department"` //发起部门
  96 + CooperationContractSponsor struct {
  97 + UserId int `json:"userId"`
  98 + UserInfo struct {
  99 + UsersName string `json:"userName"`
  100 + Phone string `json:"phone"`
  101 + UsersId int `json:"userId,string"`
  102 + UserCode string `json:"userCode"`
  103 + } `json:"userInfo"`
  104 + } `json:"cooperationContractSponsor"` //合约发起人
  105 + } `json:"list"`
  106 + } `json:"grid"`
82 } 107 }
83 ) 108 )
84 109
@@ -95,22 +120,15 @@ type ( @@ -95,22 +120,15 @@ type (
95 //确定预算金额激励分红 120 //确定预算金额激励分红
96 type ( 121 type (
97 ReqDividendsEstimateMoneyIncentives struct { 122 ReqDividendsEstimateMoneyIncentives struct {
  123 + //合约编码
  124 + CooperationContractNumber string
  125 + //
98 } 126 }
99 127
100 DataDividendsEstimateMoneyIncentives struct { 128 DataDividendsEstimateMoneyIncentives struct {
101 } 129 }
102 ) 130 )
103 131
104 -//移除分红预算  
105 -type (  
106 - ReqDividendsEstimateRemove struct {  
107 - DividendsEstimateId int `json:"dividendsEstimateId"`  
108 - }  
109 -  
110 - DataDividendsEstimateRemove struct {  
111 - }  
112 -)  
113 -  
114 //返回业绩激励分红详情 132 //返回业绩激励分红详情
115 type ( 133 type (
116 ReqDividendsEstimateListDividend struct { 134 ReqDividendsEstimateListDividend struct {
@@ -126,6 +144,10 @@ type ( @@ -126,6 +144,10 @@ type (
126 } 144 }
127 145
128 DataDividendsEstimateList struct { 146 DataDividendsEstimateList struct {
  147 + Grid struct {
  148 + Total int
  149 + List []struct{}
  150 + }
129 } 151 }
130 ) 152 )
131 153
@@ -170,6 +192,10 @@ type ( @@ -170,6 +192,10 @@ type (
170 } 192 }
171 193
172 DataDividendsEstimatesListMoney struct { 194 DataDividendsEstimatesListMoney struct {
  195 + Grid struct {
  196 + Total int `json:"total"`
  197 + List []struct{} `json:"list"`
  198 + } `json:"grid"`
173 } 199 }
174 ) 200 )
175 201