作者 yangfu
@@ -180,3 +180,36 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon @@ -180,3 +180,36 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon
180 return &data 180 return &data
181 181
182 } 182 }
  183 +
  184 +type CooperationContractUndertake struct {
  185 + Undertaker struct {
  186 + UsersName string `json:"userName"`
  187 + Phone string `json:"phone"`
  188 + UserId int `json:"userId,string,"`
  189 + UserCode string `json:"userCode"`
  190 + } `json:"undertaker"`
  191 + CooperationContractDescription string `json:"cooperationContractDescription"`
  192 + CooperationContractId int `json:"cooperationContractId,string,"`
  193 + CooperationContractName string `json:"cooperationContractName"`
  194 + CooperationContractNumber string `json:"cooperationContractNumber"`
  195 + CooperationContractSponsor struct {
  196 + UsersName string `json:"userName"`
  197 + Phone string `json:"phone"`
  198 + UserId int `json:"userId,string,"`
  199 + UserCode string `json:"userCode"`
  200 + } `json:"cooperationContractSponsor"`
  201 + CooperationMode struct {
  202 + CooperationModeId int `json:"cooperationModeId,string"`
  203 + CooperationModeName string `json:"cooperationModeName"`
  204 + CooperationModeNumber string `json:"cooperationModeNumber"`
  205 + } `json:"cooperationMode"`
  206 + Org struct {
  207 + OrgName string `json:"orgName"`
  208 + } `json:"org"`
  209 + Attachment []domain.Attachment `json:"attachment"`
  210 +}
  211 +
  212 +func ToCooperationContractUndertake(allied_creation_cooperation.DataCooperationContractSearchByUndertaker) *CooperationContractUndertake {
  213 + data := CooperationContractUndertake{}
  214 + return &data
  215 +}
@@ -201,14 +201,16 @@ func NewCooperationContractService(options map[string]interface{}) *CooperationC @@ -201,14 +201,16 @@ func NewCooperationContractService(options map[string]interface{}) *CooperationC
201 return newCooperationContractService 201 return newCooperationContractService
202 } 202 }
203 203
204 -func (cooperationContractService *CooperationContractService) SearchCooperationContractsByUndertake(queryParam query.SearchCooperationContractsByUndertake) (interface{}, error) { 204 +func (cooperationContractService *CooperationContractService) SearchCooperationContractsByUndertake(queryParam *query.SearchCooperationContractsByUndertake) (
  205 + int, interface{}, error) {
205 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(queryParam.Operator) 206 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(queryParam.Operator)
206 - result, err := creationCooperationGateway.CooperationContractsSearchByUndertaker( 207 + _, err := creationCooperationGateway.CooperationContractsSearchByUndertaker(
207 allied_creation_cooperation.ReqCooperationContractSearchByUndertaker{ 208 allied_creation_cooperation.ReqCooperationContractSearchByUndertaker{
208 CooperationContractName: queryParam.CooperationContractName, 209 CooperationContractName: queryParam.CooperationContractName,
209 SponsorName: queryParam.ContractSponsor, 210 SponsorName: queryParam.ContractSponsor,
210 PageNumber: queryParam.PageNumber, 211 PageNumber: queryParam.PageNumber,
211 PageIndex: queryParam.PageSize, 212 PageIndex: queryParam.PageSize,
212 }) 213 })
213 - return result, err 214 + data := []dto.CooperationContractUndertake{{}}
  215 + return 10, data, err
214 } 216 }
@@ -2,6 +2,7 @@ package command @@ -2,6 +2,7 @@ package command
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
  5 + "strconv"
5 6
6 "github.com/beego/beego/v2/core/validation" 7 "github.com/beego/beego/v2/core/validation"
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
@@ -14,7 +15,7 @@ type CreateDividendsOrderCommand struct { @@ -14,7 +15,7 @@ type CreateDividendsOrderCommand struct {
14 CustomerName string `json:"customerName" valid:"Required"` 15 CustomerName string `json:"customerName" valid:"Required"`
15 //分红订单原单号 16 //分红订单原单号
16 DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum" valid:"Required"` 17 DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum" valid:"Required"`
17 - //订单产生时间 时间戳 秒 18 + //订单产生时间 时间戳
18 OrderTime int64 `json:"orderTime" valid:"Required"` 19 OrderTime int64 `json:"orderTime" valid:"Required"`
19 //备注 20 //备注
20 Remarks string `json:"remarks" valid:"Required"` 21 Remarks string `json:"remarks" valid:"Required"`
@@ -35,7 +36,12 @@ type CreateDividendsOrderCommand struct { @@ -35,7 +36,12 @@ type CreateDividendsOrderCommand struct {
35 } 36 }
36 37
37 func (createDividendsOrderCommand *CreateDividendsOrderCommand) Valid(validation *validation.Validation) { 38 func (createDividendsOrderCommand *CreateDividendsOrderCommand) Valid(validation *validation.Validation) {
38 - 39 + // 162 92522 89000
  40 + orderTimeStr := strconv.Itoa(int(createDividendsOrderCommand.OrderTime))
  41 + orderTimeStrRune := []rune(orderTimeStr)
  42 + if len(orderTimeStrRune) != 13 {
  43 + validation.AddError("订单产生时间", "格式错误")
  44 + }
39 } 45 }
40 46
41 func (createDividendsOrderCommand *CreateDividendsOrderCommand) ValidateCommand() error { 47 func (createDividendsOrderCommand *CreateDividendsOrderCommand) ValidateCommand() error {
@@ -2,6 +2,7 @@ package command @@ -2,6 +2,7 @@ package command
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
  5 + "strconv"
5 6
6 "github.com/beego/beego/v2/core/validation" 7 "github.com/beego/beego/v2/core/validation"
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
@@ -18,7 +19,7 @@ type UpdateDividendsOrderCommand struct { @@ -18,7 +19,7 @@ type UpdateDividendsOrderCommand struct {
18 DividendsOrderAmount float64 `json:"dividendsOrderAmount" valid:"Required"` 19 DividendsOrderAmount float64 `json:"dividendsOrderAmount" valid:"Required"`
19 //分红订单原单号 20 //分红订单原单号
20 DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum" valid:"Required"` 21 DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum" valid:"Required"`
21 - //订单产生时间 22 + //订单产生时间 时间戳 毫秒
22 OrderTime int64 `json:"orderTime" valid:"Required"` 23 OrderTime int64 `json:"orderTime" valid:"Required"`
23 //备注 24 //备注
24 Remarks string `json:"remarks" valid:"Required"` 25 Remarks string `json:"remarks" valid:"Required"`
@@ -37,7 +38,12 @@ type UpdateDividendsOrderCommand struct { @@ -37,7 +38,12 @@ type UpdateDividendsOrderCommand struct {
37 } 38 }
38 39
39 func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) Valid(validation *validation.Validation) { 40 func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) Valid(validation *validation.Validation) {
40 - 41 + // 162 92522 89000
  42 + orderTimeStr := strconv.Itoa(int(updateDividendsOrderCommand.OrderTime))
  43 + orderTimeStrRune := []rune(orderTimeStr)
  44 + if len(orderTimeStrRune) != 13 {
  45 + validation.AddError("订单产生时间", "格式错误")
  46 + }
41 } 47 }
42 48
43 func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) ValidateCommand() error { 49 func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) ValidateCommand() error {
@@ -14,10 +14,10 @@ type DividendsOrder struct { @@ -14,10 +14,10 @@ type DividendsOrder struct {
14 DividendStatus int `json:"dividendStatus"` //分红订单分红状态,1待分红,2已分红,3部分分红 14 DividendStatus int `json:"dividendStatus"` //分红订单分红状态,1待分红,2已分红,3部分分红
15 DividendTime int64 `json:"dividendTime"` //分红订单分红时间 15 DividendTime int64 `json:"dividendTime"` //分红订单分红时间
16 DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额 16 DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
17 - DividendsOrderID int `json:"dividendsOrderId,string"` //分红订单 17 + DividendsOrderID int `json:"dividendsOrderId,string,"` //分红订单
18 DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号 18 DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号
19 DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号 19 DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
20 - OrderTime int64 `json:"orderTime"` 20 + OrderTime int64 `json:"orderTime"` //订单日日期 13位毫秒输出
21 Org struct { 21 Org struct {
22 OrgID int `json:"orgId,string"` 22 OrgID int `json:"orgId,string"`
23 OrgName string `json:"orgName"` 23 OrgName string `json:"orgName"`
@@ -25,7 +25,9 @@ type DividendsOrder struct { @@ -25,7 +25,9 @@ type DividendsOrder struct {
25 Region struct { 25 Region struct {
26 RegionName string `json:"regionName"` 26 RegionName string `json:"regionName"`
27 RegionNumber string `json:"regionNumber"` 27 RegionNumber string `json:"regionNumber"`
28 - } 28 + } `json:"region"`
  29 + Remarks string `json:"remarks"`
  30 + Goods []allied_creation_cooperation.DividendsOrderGoods
29 } 31 }
30 32
31 func ToDividendsOrder(param *allied_creation_cooperation.DividendsOrder) *DividendsOrder { 33 func ToDividendsOrder(param *allied_creation_cooperation.DividendsOrder) *DividendsOrder {
@@ -38,9 +40,11 @@ func ToDividendsOrder(param *allied_creation_cooperation.DividendsOrder) *Divide @@ -38,9 +40,11 @@ func ToDividendsOrder(param *allied_creation_cooperation.DividendsOrder) *Divide
38 DividendsOrderID: param.DividendsOrderID, 40 DividendsOrderID: param.DividendsOrderID,
39 DividendsOrderNumber: param.DividendsOrderNumber, 41 DividendsOrderNumber: param.DividendsOrderNumber,
40 DividendsOriginalOrderNum: param.DividendsOriginalOrderNum, 42 DividendsOriginalOrderNum: param.DividendsOriginalOrderNum,
41 - OrderTime: param.OrderTime.Unix(), 43 + OrderTime: param.OrderTime.UnixNano() / 1e6, //转为毫米输出
42 Org: param.Org, 44 Org: param.Org,
43 Region: param.Region, 45 Region: param.Region,
  46 + Remarks: param.Remarks,
  47 + Goods: param.Goods,
44 } 48 }
45 return &data 49 return &data
46 } 50 }
@@ -39,7 +39,7 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD @@ -39,7 +39,7 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
39 CustomerName: createDividendsOrderCommand.CustomerName, 39 CustomerName: createDividendsOrderCommand.CustomerName,
40 DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum, 40 DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum,
41 OperatorUid: int(createDividendsOrderCommand.Operator.UserId), 41 OperatorUid: int(createDividendsOrderCommand.Operator.UserId),
42 - OrderTime: strconv.Itoa(int(createDividendsOrderCommand.OrderTime * 1000)), 42 + OrderTime: strconv.Itoa(int(createDividendsOrderCommand.OrderTime)),
43 Remarks: createDividendsOrderCommand.Remarks, 43 Remarks: createDividendsOrderCommand.Remarks,
44 RegionName: createDividendsOrderCommand.RegionName, 44 RegionName: createDividendsOrderCommand.RegionName,
45 OrderGoods: orderGoods, 45 OrderGoods: orderGoods,
@@ -131,7 +131,7 @@ func (dividendsOrderService *DividendsOrderService) UpdateDividendsOrder(updateD @@ -131,7 +131,7 @@ func (dividendsOrderService *DividendsOrderService) UpdateDividendsOrder(updateD
131 DividendsOrderAmount: updateDividendsOrderCommand.DividendsOrderAmount, 131 DividendsOrderAmount: updateDividendsOrderCommand.DividendsOrderAmount,
132 DividendsOriginalOrderNum: updateDividendsOrderCommand.DividendsOriginalOrderNum, 132 DividendsOriginalOrderNum: updateDividendsOrderCommand.DividendsOriginalOrderNum,
133 OperatorUid: int(updateDividendsOrderCommand.Operator.UserId), 133 OperatorUid: int(updateDividendsOrderCommand.Operator.UserId),
134 - OrderTime: strconv.Itoa(int(updateDividendsOrderCommand.OrderTime * 1000)), 134 + OrderTime: strconv.Itoa(int(updateDividendsOrderCommand.OrderTime)),
135 Remarks: updateDividendsOrderCommand.Remarks, 135 Remarks: updateDividendsOrderCommand.Remarks,
136 RegionName: updateDividendsOrderCommand.RegionName, 136 RegionName: updateDividendsOrderCommand.RegionName,
137 OrderGoods: orderGoods, 137 OrderGoods: orderGoods,
@@ -7,14 +7,14 @@ import ( @@ -7,14 +7,14 @@ import (
7 type DividendsReturnedOrderInfo struct { 7 type DividendsReturnedOrderInfo struct {
8 // 公司 8 // 公司
9 Company struct { 9 Company struct {
10 - CompanyID int `json:"companyId"` 10 + CompanyID int `json:"companyId,string"`
11 CompanyLogo string `json:"companyLogo"` 11 CompanyLogo string `json:"companyLogo"`
12 CompanyName string `json:"companyName"` 12 CompanyName string `json:"companyName"`
13 } `json:"company"` 13 } `json:"company"`
14 CreatedAt int64 `json:"createdAt"` 14 CreatedAt int64 `json:"createdAt"`
15 DividendStatus int `json:"dividendStatus"` // 分红订单分红状态,1待分红,2已分红,3部分分红 15 DividendStatus int `json:"dividendStatus"` // 分红订单分红状态,1待分红,2已分红,3部分分红
16 DividendTime int64 `json:"dividendTime"` //分红订单分红时间 16 DividendTime int64 `json:"dividendTime"` //分红订单分红时间
17 - DividendsOrderNumber int `json:"dividendsOrderNumber"` //关联分红订单号 17 + DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号
18 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户姓名 18 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户姓名
19 DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期 19 DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期
20 DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id 20 DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id
@@ -24,8 +24,8 @@ type DividendsReturnedOrderInfo struct { @@ -24,8 +24,8 @@ type DividendsReturnedOrderInfo struct {
24 Remarks string `json:"remarks"` //备注 24 Remarks string `json:"remarks"` //备注
25 //更新时间 25 //更新时间
26 Org struct { 26 Org struct {
27 - OrgID int `json:"orgId"` //  
28 - OrgName string `json:"orgName"` // 27 + OrgID int `json:"orgId,string"` //
  28 + OrgName string `json:"orgName"` //
29 } `json:"org"` //归属组织机构 29 } `json:"org"` //归属组织机构
30 30
31 Region struct { 31 Region struct {
@@ -79,11 +79,11 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide @@ -79,11 +79,11 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide
79 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 79 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
80 } 80 }
81 dataList := []dto.DividendsReturnedOrderInfo{} 81 dataList := []dto.DividendsReturnedOrderInfo{}
82 - for i := range result.List {  
83 - item := dto.ToDividendsReturnedOrderInfo(&result.List[i]) 82 + for i := range result.Grid.List {
  83 + item := dto.ToDividendsReturnedOrderInfo(&result.Grid.List[i])
84 dataList = append(dataList, *item) 84 dataList = append(dataList, *item)
85 } 85 }
86 - return result.Total, dataList, nil 86 + return result.Grid.Total, dataList, nil
87 } 87 }
88 88
89 // 更新分红退货单服务 89 // 更新分红退货单服务
@@ -127,7 +127,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SelectorDivi @@ -127,7 +127,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SelectorDivi
127 "dividendsOrderNumber": v.DividendsOrderNumber, 127 "dividendsOrderNumber": v.DividendsOrderNumber,
128 "dividendsOriginalOrderNum": v.DividendsOriginalOrderNum, 128 "dividendsOriginalOrderNum": v.DividendsOriginalOrderNum,
129 "dividendsOrderId": strconv.Itoa(v.DividendsOrderID), 129 "dividendsOrderId": strconv.Itoa(v.DividendsOrderID),
130 - "dividendTime": v.DividendTime.Unix(), 130 + "orderTime": v.OrderTime.Unix(),
131 } 131 }
132 listData = append(listData, m) 132 listData = append(listData, m)
133 } 133 }
@@ -168,7 +168,7 @@ func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderList(param @@ -168,7 +168,7 @@ func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderList(param
168 168
169 // DividendsReturnedOrderGet 返回分红退货单详情 169 // DividendsReturnedOrderGet 返回分红退货单详情
170 func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderGet(param ReqDividendsReturnedOrderGet) (*DataDividendsReturnedOrderGet, error) { 170 func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderGet(param ReqDividendsReturnedOrderGet) (*DataDividendsReturnedOrderGet, error) {
171 - url := gateway.baseUrL + "/dividends-returned-orders" + strconv.Itoa(param.DividendsReturnedOrderId) 171 + url := gateway.baseUrL + "/dividends-returned-orders/" + strconv.Itoa(param.DividendsReturnedOrderId)
172 method := "GET" 172 method := "GET"
173 req := gateway.CreateRequest(url, method) 173 req := gateway.CreateRequest(url, method)
174 log.Logger.Debug("向业务模块请求数据:返回分红退货单详情。", map[string]interface{}{ 174 log.Logger.Debug("向业务模块请求数据:返回分红退货单详情。", map[string]interface{}{
@@ -48,6 +48,8 @@ type DividendsOrder struct { @@ -48,6 +48,8 @@ type DividendsOrder struct {
48 RegionName string `json:"regionName"` 48 RegionName string `json:"regionName"`
49 RegionNumber string `json:"regionNumber"` 49 RegionNumber string `json:"regionNumber"`
50 } `json:"region"` 50 } `json:"region"`
  51 + Remarks string `json:"remarks"`
  52 + Goods []DividendsOrderGoods `json:"goods"`
51 } 53 }
52 54
53 type ( 55 type (
@@ -61,7 +63,7 @@ type ( @@ -61,7 +63,7 @@ type (
61 OrderGoodExpense float64 `json:"orderGoodExpense"` //订单产品费用 63 OrderGoodExpense float64 `json:"orderGoodExpense"` //订单产品费用
62 OrderGoodName string `json:"orderGoodName"` //订单产品名称 64 OrderGoodName string `json:"orderGoodName"` //订单产品名称
63 OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价 65 OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
64 - OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量 66 + OrderGoodQuantity int `json:"orderGoodQuantity,string"` //订单产品数量
65 OrderGoodDividendsStatus int32 `json:"OrderGoodDividendsStatus"` // 订单产品分红状态, 1待分红,2已分红 67 OrderGoodDividendsStatus int32 `json:"OrderGoodDividendsStatus"` // 订单产品分红状态, 1待分红,2已分红
66 } 68 }
67 ReqDividendsOrderAdd struct { 69 ReqDividendsOrderAdd struct {
@@ -10,21 +10,20 @@ type ( @@ -10,21 +10,20 @@ type (
10 OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额 10 OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
11 OrderGoodName string `json:"orderGoodName"` //订单产品名称 11 OrderGoodName string `json:"orderGoodName"` //订单产品名称
12 OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价 12 OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
13 - OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量  
14 - 13 + OrderGoodQuantity int `json:"orderGoodQuantity,string"` //订单产品数量
15 } 14 }
16 15
17 DividendsReturnedOrder struct { 16 DividendsReturnedOrder struct {
18 // 公司 17 // 公司
19 Company struct { 18 Company struct {
20 - CompanyID int `json:"companyId"` 19 + CompanyID int `json:"companyId,string"`
21 CompanyLogo string `json:"companyLogo"` 20 CompanyLogo string `json:"companyLogo"`
22 CompanyName string `json:"companyName"` 21 CompanyName string `json:"companyName"`
23 } `json:"company"` 22 } `json:"company"`
24 CreatedAt time.Time `json:"createdAt"` 23 CreatedAt time.Time `json:"createdAt"`
25 DividendStatus int `json:"dividendStatus"` // 分红订单分红状态,1待分红,2已分红,3部分分红 24 DividendStatus int `json:"dividendStatus"` // 分红订单分红状态,1待分红,2已分红,3部分分红
26 DividendTime time.Time `json:"dividendTime"` //分红订单分红时间 25 DividendTime time.Time `json:"dividendTime"` //分红订单分红时间
27 - DividendsOrderNumber int `json:"dividendsOrderNumber"` //关联分红订单号 26 + DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号
28 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户姓名 27 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户姓名
29 DividendsReturnedDate time.Time `json:"dividendsReturnedDate"` //退货日期 28 DividendsReturnedDate time.Time `json:"dividendsReturnedDate"` //退货日期
30 DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id 29 DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id
@@ -36,8 +35,8 @@ type ( @@ -36,8 +35,8 @@ type (
36 UpdatedAt string `json:"updatedAt"` 35 UpdatedAt string `json:"updatedAt"`
37 //更新时间 36 //更新时间
38 Org struct { 37 Org struct {
39 - OrgID int `json:"orgId"` //  
40 - OrgName string `json:"orgName"` // 38 + OrgID int `json:"orgId,string"` //
  39 + OrgName string `json:"orgName"` //
41 } `json:"org"` //归属组织机构 40 } `json:"org"` //归属组织机构
42 41
43 Region struct { 42 Region struct {
@@ -72,7 +71,7 @@ type ( @@ -72,7 +71,7 @@ type (
72 DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号 71 DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号
73 OriginalOrderNum string `json:"originalOrderNum"` 72 OriginalOrderNum string `json:"originalOrderNum"`
74 OrderGoods []DividendsReturnedOrderGoods `json:"orderGoods"` 73 OrderGoods []DividendsReturnedOrderGoods `json:"orderGoods"`
75 - DividendsReturnedDate time.Time `json:"orderTime"` 74 + DividendsReturnedDate time.Time `json:"dividendsReturnedDate"`
76 OrderData time.Time `json:"orderData"` 75 OrderData time.Time `json:"orderData"`
77 OrgId int `json:"orgId"` 76 OrgId int `json:"orgId"`
78 Remarks string `json:"remarks"` 77 Remarks string `json:"remarks"`
@@ -97,8 +96,10 @@ type ( @@ -97,8 +96,10 @@ type (
97 } 96 }
98 97
99 DataDividendsReturnedOrderSearch struct { 98 DataDividendsReturnedOrderSearch struct {
100 - Total int `json:"total"`  
101 - List []DividendsReturnedOrder `json:"list"` 99 + Grid struct {
  100 + Total int `json:"total"`
  101 + List []DividendsReturnedOrder `json:"list"`
  102 + } `json:"grid"`
102 } 103 }
103 ) 104 )
104 105
@@ -69,3 +69,15 @@ func (controller *CooperationContractController) EnableCooperationContract() { @@ -69,3 +69,15 @@ func (controller *CooperationContractController) EnableCooperationContract() {
69 data, err := cooperationContractService.EnableCooperationContract(enableCooperationContractCommand) 69 data, err := cooperationContractService.EnableCooperationContract(enableCooperationContractCommand)
70 controller.Response(data, err) 70 controller.Response(data, err)
71 } 71 }
  72 +
  73 +func (controller *CooperationContractController) SearchCooperationContractsByUndertake() {
  74 + cooperationContractService := service.NewCooperationContractService(nil)
  75 + listCooperationContractQuery := &query.SearchCooperationContractsByUndertake{}
  76 + err := controller.Unmarshal(listCooperationContractQuery)
  77 + if err != nil {
  78 + log.Logger.Debug("json err:" + err.Error())
  79 + }
  80 + listCooperationContractQuery.Operator = controller.GetOperator()
  81 + cnt, data, err := cooperationContractService.SearchCooperationContractsByUndertake(listCooperationContractQuery)
  82 + controller.ReturnPageListData(int64(cnt), data, err, listCooperationContractQuery.PageNumber)
  83 +}
@@ -11,4 +11,5 @@ func init() { @@ -11,4 +11,5 @@ func init() {
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{}, "Put:EnableCooperationContract")
  14 + web.Router("/v1/web/cooperation-contracts/undertaker", &web_client.CooperationContractController{}, "Post:SearchCooperationContractsByUndertake")
14 } 15 }