作者 tangxuhui

添加合约查询

... ... @@ -180,3 +180,36 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon
return &data
}
type CooperationContractUndertake struct {
Undertaker struct {
UsersName string `json:"userName"`
Phone string `json:"phone"`
UserId int `json:"userId,string,"`
UserCode string `json:"userCode"`
} `json:"undertaker"`
CooperationContractDescription string `json:"cooperationContractDescription"`
CooperationContractId int `json:"cooperationContractId,string,"`
CooperationContractName string `json:"cooperationContractName"`
CooperationContractNumber string `json:"cooperationContractNumber"`
CooperationContractSponsor struct {
UsersName string `json:"userName"`
Phone string `json:"phone"`
UserId int `json:"userId,string,"`
UserCode string `json:"userCode"`
} `json:"cooperationContractSponsor"`
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"`
Org struct {
OrgName string `json:"orgName"`
} `json:"org"`
Attachment []domain.Attachment `json:"attachment"`
}
func ToCooperationContractUndertake(allied_creation_cooperation.DataCooperationContractSearchByUndertaker) *CooperationContractUndertake {
data := CooperationContractUndertake{}
return &data
}
... ...
... ... @@ -201,14 +201,16 @@ func NewCooperationContractService(options map[string]interface{}) *CooperationC
return newCooperationContractService
}
func (cooperationContractService *CooperationContractService) SearchCooperationContractsByUndertake(queryParam query.SearchCooperationContractsByUndertake) (interface{}, error) {
func (cooperationContractService *CooperationContractService) SearchCooperationContractsByUndertake(queryParam *query.SearchCooperationContractsByUndertake) (
int, interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(queryParam.Operator)
result, err := creationCooperationGateway.CooperationContractsSearchByUndertaker(
_, err := creationCooperationGateway.CooperationContractsSearchByUndertaker(
allied_creation_cooperation.ReqCooperationContractSearchByUndertaker{
CooperationContractName: queryParam.CooperationContractName,
SponsorName: queryParam.ContractSponsor,
PageNumber: queryParam.PageNumber,
PageIndex: queryParam.PageSize,
})
return result, err
data := []dto.CooperationContractUndertake{{}}
return 10, data, err
}
... ...
... ... @@ -79,11 +79,11 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
dataList := []dto.DividendsReturnedOrderInfo{}
for i := range result.List {
item := dto.ToDividendsReturnedOrderInfo(&result.List[i])
for i := range result.Grid.List {
item := dto.ToDividendsReturnedOrderInfo(&result.Grid.List[i])
dataList = append(dataList, *item)
}
return result.Total, dataList, nil
return result.Grid.Total, dataList, nil
}
// 更新分红退货单服务
... ...
... ... @@ -96,8 +96,10 @@ type (
}
DataDividendsReturnedOrderSearch struct {
Grid struct {
Total int `json:"total"`
List []DividendsReturnedOrder `json:"list"`
} `json:"grid"`
}
)
... ...
... ... @@ -69,3 +69,15 @@ func (controller *CooperationContractController) EnableCooperationContract() {
data, err := cooperationContractService.EnableCooperationContract(enableCooperationContractCommand)
controller.Response(data, err)
}
func (controller *CooperationContractController) SearchCooperationContractsByUndertake() {
cooperationContractService := service.NewCooperationContractService(nil)
listCooperationContractQuery := &query.SearchCooperationContractsByUndertake{}
err := controller.Unmarshal(listCooperationContractQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
listCooperationContractQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationContractService.SearchCooperationContractsByUndertake(listCooperationContractQuery)
controller.ReturnPageListData(int64(cnt), data, err, listCooperationContractQuery.PageNumber)
}
... ...
... ... @@ -11,4 +11,5 @@ func init() {
web.Router("/v1/web/cooperation-contracts/:contractId", &web_client.CooperationContractController{}, "Get:GetCooperationContract")
web.Router("/v1/web/cooperation-contracts/search", &web_client.CooperationContractController{}, "Post:ListCooperationContract")
web.Router("/v1/web/cooperation-contracts/enable", &web_client.CooperationContractController{}, "Put:EnableCooperationContract")
web.Router("/v1/web/cooperation-contracts/undertaker", &web_client.CooperationContractController{}, "Post:SearchCooperationContractsByUndertake")
}
... ...