...
|
...
|
@@ -18,16 +18,30 @@ type CompanyCreditAccountService struct { |
|
|
func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (int64, interface{}, error) {
|
|
|
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
|
|
|
cmd.Operator)
|
|
|
|
|
|
cooperationContractNumbers, err := gateway.RelevantCooperationContractNumbers(allied_creation_cooperation.RelevantCooperationContractNumbers, map[string]interface{}{
|
|
|
"companyId": cmd.Operator.CompanyId,
|
|
|
"orgId": cmd.Operator.OrgId,
|
|
|
"userId": cmd.Operator.UserId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
var items = make([]*dto.CreditAccountItem, 0)
|
|
|
if len(cooperationContractNumbers) == 0 {
|
|
|
return 0, items, nil
|
|
|
}
|
|
|
resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
|
|
|
PageNumber: cmd.PageNumber + 1, //手机序号从0开始的
|
|
|
PageSize: cmd.PageSize,
|
|
|
PaymentStatus: cmd.PaymentStatus,
|
|
|
OrgId: cmd.Operator.OrgId,
|
|
|
PageNumber: cmd.PageNumber + 1, //手机序号从0开始的
|
|
|
PageSize: cmd.PageSize,
|
|
|
PaymentStatus: cmd.PaymentStatus,
|
|
|
OrgId: cmd.Operator.OrgId,
|
|
|
CooperationContractNumbers: cooperationContractNumbers,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
var items []*dto.CreditAccountItem
|
|
|
|
|
|
for i := 0; i < len(resultMenu.Grid.List); i++ {
|
|
|
items = append(items, dto.ToCreditAccountItem(&resultMenu.Grid.List[i]))
|
|
|
}
|
...
|
...
|
@@ -84,6 +98,20 @@ func (srv CompanyCreditAccountService) CreditAccountPay(cmd *command.CreditAccou |
|
|
func (srv CompanyCreditAccountService) CreditAccountPaySearch(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
|
|
|
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
|
|
|
cmd.Operator)
|
|
|
|
|
|
cooperationContractNumbers, err := gateway.RelevantCooperationContractNumbers(allied_creation_cooperation.RelevantCooperationContractNumbers, map[string]interface{}{
|
|
|
"companyId": cmd.Operator.CompanyId,
|
|
|
"orgId": cmd.Operator.OrgId,
|
|
|
"userId": cmd.Operator.UserId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
var items = make([]*dto.CreditAccountItem, 0)
|
|
|
if len(cooperationContractNumbers) == 0 {
|
|
|
return items, nil
|
|
|
}
|
|
|
|
|
|
var beginTime, endTime time.Time
|
|
|
if cmd.BeginTime > 0 {
|
|
|
beginTime = time.Unix(cmd.BeginTime/1000, 0)
|
...
|
...
|
@@ -92,19 +120,21 @@ func (srv CompanyCreditAccountService) CreditAccountPaySearch(cmd *command.Credi |
|
|
endTime = time.Unix(cmd.EndTime/1000, 0)
|
|
|
}
|
|
|
req := allied_creation_cooperation.ReqCreditAccountsSearch{
|
|
|
PageNumber: cmd.PageNumber + 1, //手机序号从0开始的
|
|
|
PageSize: cmd.PageSize,
|
|
|
PaymentStatus: 2,
|
|
|
OrgId: cmd.Operator.OrgId,
|
|
|
BeginTime: beginTime,
|
|
|
EndTime: endTime,
|
|
|
PageNumber: cmd.PageNumber + 1, //手机序号从0开始的
|
|
|
PageSize: cmd.PageSize,
|
|
|
PaymentStatus: 2,
|
|
|
OrgId: cmd.Operator.OrgId,
|
|
|
BeginTime: beginTime,
|
|
|
EndTime: endTime,
|
|
|
CooperationContractNumbers: cooperationContractNumbers,
|
|
|
}
|
|
|
resultMenu, err := gateway.CreditAccountsSearch(req)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
queryOptions := map[string]interface{}{
|
|
|
"orgId": cmd.Operator.OrgId,
|
|
|
"orgId": cmd.Operator.OrgId,
|
|
|
"cooperationContractNumbers": cooperationContractNumbers,
|
|
|
}
|
|
|
if cmd.BeginTime > 0 {
|
|
|
queryOptions["beginTime"] = beginTime
|
...
|
...
|
@@ -129,7 +159,7 @@ func (srv CompanyCreditAccountService) CreditAccountPaySearch(cmd *command.Credi |
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
var items = make([]*dto.CreditAccountItem, 0)
|
|
|
//var items = make([]*dto.CreditAccountItem, 0)
|
|
|
for i := 0; i < len(resultMenu.Grid.List); i++ {
|
|
|
items = append(items, dto.ToCreditAccountItem(&resultMenu.Grid.List[i]))
|
|
|
}
|
...
|
...
|
|