正在显示
31 个修改的文件
包含
104 行增加
和
56 行删除
| @@ -14,7 +14,7 @@ type SearchContractUndertakerFeedbackQuery struct { | @@ -14,7 +14,7 @@ type SearchContractUndertakerFeedbackQuery struct { | ||
| 14 | // 组织机构ID | 14 | // 组织机构ID |
| 15 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 15 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 16 | // 关联的组织机构ID列表 | 16 | // 关联的组织机构ID列表 |
| 17 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 17 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 18 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 18 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 19 | UserId int64 `cname:"用户ID" json:"userId"` | 19 | UserId int64 `cname:"用户ID" json:"userId"` |
| 20 | // 用户基础数据id | 20 | // 用户基础数据id |
| @@ -26,7 +26,7 @@ type SearchCooperationApplicationQuery struct { | @@ -26,7 +26,7 @@ type SearchCooperationApplicationQuery struct { | ||
| 26 | // 组织机构ID | 26 | // 组织机构ID |
| 27 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 27 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 28 | // 关联的组织机构ID列表 | 28 | // 关联的组织机构ID列表 |
| 29 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 29 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 30 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 30 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 31 | UserId int64 `cname:"用户ID" json:"userId"` | 31 | UserId int64 `cname:"用户ID" json:"userId"` |
| 32 | // 用户基础数据id | 32 | // 用户基础数据id |
| @@ -22,7 +22,7 @@ type SearchCooperationContractQuery struct { | @@ -22,7 +22,7 @@ type SearchCooperationContractQuery struct { | ||
| 22 | // 组织机构ID | 22 | // 组织机构ID |
| 23 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 23 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 24 | // 关联的组织机构ID列表 | 24 | // 关联的组织机构ID列表 |
| 25 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 25 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 26 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 26 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 27 | UserId int64 `cname:"用户ID" json:"userId"` | 27 | UserId int64 `cname:"用户ID" json:"userId"` |
| 28 | // 用户基础数据id | 28 | // 用户基础数据id |
| @@ -18,7 +18,7 @@ type SearchCooperationContractByUndertakerQuery struct { | @@ -18,7 +18,7 @@ type SearchCooperationContractByUndertakerQuery struct { | ||
| 18 | // 组织机构ID | 18 | // 组织机构ID |
| 19 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 19 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 20 | // 关联的组织机构ID列表 | 20 | // 关联的组织机构ID列表 |
| 21 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 21 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 22 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 22 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 23 | UserId int64 `cname:"用户ID" json:"userId"` | 23 | UserId int64 `cname:"用户ID" json:"userId"` |
| 24 | // 用户基础数据id | 24 | // 用户基础数据id |
| @@ -22,7 +22,7 @@ type SearchCooperationContractChangeLogQuery struct { | @@ -22,7 +22,7 @@ type SearchCooperationContractChangeLogQuery struct { | ||
| 22 | // 组织机构ID | 22 | // 组织机构ID |
| 23 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 23 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 24 | // 关联的组织机构ID列表 | 24 | // 关联的组织机构ID列表 |
| 25 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 25 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 26 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 26 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 27 | UserId int64 `cname:"用户ID" json:"userId"` | 27 | UserId int64 `cname:"用户ID" json:"userId"` |
| 28 | // 用户基础数据id | 28 | // 用户基础数据id |
| @@ -24,7 +24,7 @@ type SearchCooperationModeQuery struct { | @@ -24,7 +24,7 @@ type SearchCooperationModeQuery struct { | ||
| 24 | // 组织机构ID | 24 | // 组织机构ID |
| 25 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 25 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 26 | // 关联的组织机构ID列表 | 26 | // 关联的组织机构ID列表 |
| 27 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 27 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 28 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 28 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 29 | UserId int64 `cname:"用户ID" json:"userId"` | 29 | UserId int64 `cname:"用户ID" json:"userId"` |
| 30 | // 用户基础数据id | 30 | // 用户基础数据id |
| @@ -26,7 +26,7 @@ type SearchCooperationProjectQuery struct { | @@ -26,7 +26,7 @@ type SearchCooperationProjectQuery struct { | ||
| 26 | // 组织机构ID | 26 | // 组织机构ID |
| 27 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 27 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 28 | // 关联的组织机构ID列表 | 28 | // 关联的组织机构ID列表 |
| 29 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 29 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 30 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 30 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 31 | UserId int64 `cname:"用户ID" json:"userId"` | 31 | UserId int64 `cname:"用户ID" json:"userId"` |
| 32 | // 用户基础数据id | 32 | // 用户基础数据id |
| @@ -27,7 +27,7 @@ type SearchCreditAccountQuery struct { | @@ -27,7 +27,7 @@ type SearchCreditAccountQuery struct { | ||
| 27 | // 组织机构ID | 27 | // 组织机构ID |
| 28 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 28 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 29 | // 关联的组织机构ID列表 | 29 | // 关联的组织机构ID列表 |
| 30 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 30 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 31 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 31 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 32 | UserId int64 `cname:"用户ID" json:"userId"` | 32 | UserId int64 `cname:"用户ID" json:"userId"` |
| 33 | // 用户基础数据id | 33 | // 用户基础数据id |
| @@ -19,7 +19,7 @@ type SearchDividendsEstimateQuery struct { | @@ -19,7 +19,7 @@ type SearchDividendsEstimateQuery struct { | ||
| 19 | // 组织机构ID | 19 | // 组织机构ID |
| 20 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 20 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 21 | // 关联的组织机构ID列表 | 21 | // 关联的组织机构ID列表 |
| 22 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 22 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 23 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 23 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 24 | UserId int64 `cname:"用户ID" json:"userId"` | 24 | UserId int64 `cname:"用户ID" json:"userId"` |
| 25 | // 用户基础数据id | 25 | // 用户基础数据id |
| @@ -19,7 +19,7 @@ type SearchDividendsIncentivesEstimateQuery struct { | @@ -19,7 +19,7 @@ type SearchDividendsIncentivesEstimateQuery struct { | ||
| 19 | // 组织机构ID | 19 | // 组织机构ID |
| 20 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 20 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 21 | // 关联的组织机构ID列表 | 21 | // 关联的组织机构ID列表 |
| 22 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 22 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 23 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 23 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 24 | UserId int64 `cname:"用户ID" json:"userId"` | 24 | UserId int64 `cname:"用户ID" json:"userId"` |
| 25 | // 用户基础数据id | 25 | // 用户基础数据id |
| @@ -19,7 +19,7 @@ type SearchMoneyIncentivesEstimateQuery struct { | @@ -19,7 +19,7 @@ type SearchMoneyIncentivesEstimateQuery struct { | ||
| 19 | // 组织机构ID | 19 | // 组织机构ID |
| 20 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 20 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 21 | // 关联的组织机构ID列表 | 21 | // 关联的组织机构ID列表 |
| 22 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 22 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 23 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 23 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 24 | UserId int64 `cname:"用户ID" json:"userId"` | 24 | UserId int64 `cname:"用户ID" json:"userId"` |
| 25 | // 用户基础数据id | 25 | // 用户基础数据id |
| @@ -22,7 +22,7 @@ type SearchDividendsOrderQuery struct { | @@ -22,7 +22,7 @@ type SearchDividendsOrderQuery struct { | ||
| 22 | // 组织机构ID | 22 | // 组织机构ID |
| 23 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 23 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 24 | // 关联的组织机构ID列表 | 24 | // 关联的组织机构ID列表 |
| 25 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 25 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 26 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 26 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 27 | UserId int64 `cname:"用户ID" json:"userId"` | 27 | UserId int64 `cname:"用户ID" json:"userId"` |
| 28 | // 用户基础数据id | 28 | // 用户基础数据id |
| @@ -30,7 +30,6 @@ type SearchDividendsOrderQuery struct { | @@ -30,7 +30,6 @@ type SearchDividendsOrderQuery struct { | ||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | func (searchDividendsOrderQuery *SearchDividendsOrderQuery) Valid(validation *validation.Validation) { | 32 | func (searchDividendsOrderQuery *SearchDividendsOrderQuery) Valid(validation *validation.Validation) { |
| 33 | - //validation.SetError("CustomValid", "未实现的自定义认证") | ||
| 34 | } | 33 | } |
| 35 | 34 | ||
| 36 | func (searchDividendsOrderQuery *SearchDividendsOrderQuery) ValidateQuery() error { | 35 | func (searchDividendsOrderQuery *SearchDividendsOrderQuery) ValidateQuery() error { |
| @@ -16,7 +16,7 @@ type SearchDividendsOrderNumberQuery struct { | @@ -16,7 +16,7 @@ type SearchDividendsOrderNumberQuery struct { | ||
| 16 | // 组织机构ID | 16 | // 组织机构ID |
| 17 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 17 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 18 | // 关联的组织机构ID列表 | 18 | // 关联的组织机构ID列表 |
| 19 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 19 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 20 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 20 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| 21 | UserId int64 `cname:"用户ID" json:"userId"` | 21 | UserId int64 `cname:"用户ID" json:"userId"` |
| 22 | // 用户基础数据id | 22 | // 用户基础数据id |
| @@ -278,7 +278,18 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -278,7 +278,18 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
| 278 | } | 278 | } |
| 279 | 279 | ||
| 280 | // 返回信息表头定义 | 280 | // 返回信息表头定义 |
| 281 | - var tableHeader = []string{"错误详情", "行号", "来源单号", "客户名称", "产品名称", "订单日期", "订单区域", "产品数量", "产品价格", "费用", "项目合约编号"} | 281 | + var tableHeader = map[string]interface{}{ |
| 282 | + "failReason": "错误详情", | ||
| 283 | + "originalOrderNum": "来源单号", | ||
| 284 | + "dividendsCustomerName": "客户名称", | ||
| 285 | + "orderGoodName": "产品名称", | ||
| 286 | + "orderTime": "订单日期", | ||
| 287 | + "regionName": "订单区域", | ||
| 288 | + "orderGoodQuantity": "产品数量", | ||
| 289 | + "orderGoodPrice": "产品价格", | ||
| 290 | + "expense": "费用", | ||
| 291 | + "cooperationContractNumber": "项目合约编号", | ||
| 292 | + } | ||
| 282 | 293 | ||
| 283 | // 空文件校验 | 294 | // 空文件校验 |
| 284 | if len(importDividendsOrderCommand.DividendsOrderData) == 0 { | 295 | if len(importDividendsOrderCommand.DividendsOrderData) == 0 { |
| @@ -326,8 +337,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -326,8 +337,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
| 326 | return map[string]interface{}{ | 337 | return map[string]interface{}{ |
| 327 | "successCount": 0, | 338 | "successCount": 0, |
| 328 | "fail": map[string]interface{}{ | 339 | "fail": map[string]interface{}{ |
| 329 | - "tableHeader": tableHeader, | ||
| 330 | - "tableData": nullCellError, | 340 | + "header": tableHeader, |
| 341 | + "body": nullCellError, | ||
| 331 | }, | 342 | }, |
| 332 | }, nil | 343 | }, nil |
| 333 | } | 344 | } |
| @@ -431,8 +442,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -431,8 +442,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
| 431 | return map[string]interface{}{ | 442 | return map[string]interface{}{ |
| 432 | "successCount": 0, | 443 | "successCount": 0, |
| 433 | "fail": map[string]interface{}{ | 444 | "fail": map[string]interface{}{ |
| 434 | - "tableHeader": tableHeader, | ||
| 435 | - "tableData": typeError, | 445 | + "header": tableHeader, |
| 446 | + "body": typeError, | ||
| 436 | }, | 447 | }, |
| 437 | }, nil | 448 | }, nil |
| 438 | } | 449 | } |
| @@ -539,8 +550,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -539,8 +550,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
| 539 | return map[string]interface{}{ | 550 | return map[string]interface{}{ |
| 540 | "successCount": 0, | 551 | "successCount": 0, |
| 541 | "fail": map[string]interface{}{ | 552 | "fail": map[string]interface{}{ |
| 542 | - "tableHeader": tableHeader, | ||
| 543 | - "tableData": aggregateErrorList, | 553 | + "header": tableHeader, |
| 554 | + "body": aggregateErrorList, | ||
| 544 | }, | 555 | }, |
| 545 | }, nil | 556 | }, nil |
| 546 | } | 557 | } |
| @@ -602,8 +613,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -602,8 +613,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
| 602 | return map[string]interface{}{ | 613 | return map[string]interface{}{ |
| 603 | "successCount": successDataCount, | 614 | "successCount": successDataCount, |
| 604 | "fail": map[string]interface{}{ | 615 | "fail": map[string]interface{}{ |
| 605 | - "tableHeader": tableHeader, | ||
| 606 | - "tableData": failureDataList, | 616 | + "header": tableHeader, |
| 617 | + "body": failureDataList, | ||
| 607 | }, | 618 | }, |
| 608 | }, nil | 619 | }, nil |
| 609 | } | 620 | } |
| @@ -733,8 +744,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | @@ -733,8 +744,8 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD | ||
| 733 | return map[string]interface{}{ | 744 | return map[string]interface{}{ |
| 734 | "successCount": successDataCount, | 745 | "successCount": successDataCount, |
| 735 | "fail": map[string]interface{}{ | 746 | "fail": map[string]interface{}{ |
| 736 | - "tableHeader": tableHeader, | ||
| 737 | - "tableData": failureDataList, | 747 | + "header": tableHeader, |
| 748 | + "body": failureDataList, | ||
| 738 | }, | 749 | }, |
| 739 | }, nil | 750 | }, nil |
| 740 | } | 751 | } |
| @@ -20,7 +20,7 @@ type SearchDividendsReturnedOrderQuery struct { | @@ -20,7 +20,7 @@ type SearchDividendsReturnedOrderQuery struct { | ||
| 20 | // 公司ID,通过集成REST上下文获取 | 20 | // 公司ID,通过集成REST上下文获取 |
| 21 | CompanyId int64 `cname:"公司ID" json:"companyId"` | 21 | CompanyId int64 `cname:"公司ID" json:"companyId"` |
| 22 | // 关联的组织机构ID列表 | 22 | // 关联的组织机构ID列表 |
| 23 | - OrgIds []string `cname:"关联的组织机构ID列表" json:"orgIds"` | 23 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` |
| 24 | // 组织机构ID | 24 | // 组织机构ID |
| 25 | OrgId int64 `cname:"组织机构ID" json:"orgId"` | 25 | OrgId int64 `cname:"组织机构ID" json:"orgId"` |
| 26 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 26 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
| @@ -10,6 +10,7 @@ import ( | @@ -10,6 +10,7 @@ import ( | ||
| 10 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | 10 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" |
| 11 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models" | 11 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models" |
| 12 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/transform" | 12 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/transform" |
| 13 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
| 13 | ) | 14 | ) |
| 14 | 15 | ||
| 15 | type ContractUndertakerFeedbackRepository struct { | 16 | type ContractUndertakerFeedbackRepository struct { |
| @@ -162,8 +163,9 @@ func (repository *ContractUndertakerFeedbackRepository) Find(queryOptions map[st | @@ -162,8 +163,9 @@ func (repository *ContractUndertakerFeedbackRepository) Find(queryOptions map[st | ||
| 162 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 163 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 163 | query.Where("org->>'orgId' = '?'", orgId) | 164 | query.Where("org->>'orgId' = '?'", orgId) |
| 164 | } | 165 | } |
| 165 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 166 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 166 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 167 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 168 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 167 | } | 169 | } |
| 168 | // 搜索内容包括项目合约名称、承接人姓名、承接内容关键字 | 170 | // 搜索内容包括项目合约名称、承接人姓名、承接内容关键字 |
| 169 | if matchWord, ok := queryOptions["matchWord"]; ok && matchWord != "" { | 171 | if matchWord, ok := queryOptions["matchWord"]; ok && matchWord != "" { |
| @@ -3,6 +3,7 @@ package repository | @@ -3,6 +3,7 @@ package repository | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| 5 | "github.com/go-pg/pg/v10" | 5 | "github.com/go-pg/pg/v10" |
| 6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
| 6 | "time" | 7 | "time" |
| 7 | 8 | ||
| 8 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" | 9 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" |
| @@ -243,8 +244,9 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string | @@ -243,8 +244,9 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string | ||
| 243 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 244 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 244 | query.Where("org->>'orgId' = '?'", orgId) | 245 | query.Where("org->>'orgId' = '?'", orgId) |
| 245 | } | 246 | } |
| 246 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 247 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 247 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 248 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 249 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 248 | } | 250 | } |
| 249 | offsetLimitFlag := true | 251 | offsetLimitFlag := true |
| 250 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { | 252 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { |
| @@ -3,6 +3,7 @@ package repository | @@ -3,6 +3,7 @@ package repository | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| 5 | "github.com/go-pg/pg/v10" | 5 | "github.com/go-pg/pg/v10" |
| 6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
| 6 | 7 | ||
| 7 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" | 8 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" |
| 8 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | 9 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" |
| @@ -171,8 +172,9 @@ func (repository *CooperationContractChangeLogRepository) Find(queryOptions map[ | @@ -171,8 +172,9 @@ func (repository *CooperationContractChangeLogRepository) Find(queryOptions map[ | ||
| 171 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 172 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 172 | query.Where("org->>'orgId' = '?'", orgId) | 173 | query.Where("org->>'orgId' = '?'", orgId) |
| 173 | } | 174 | } |
| 174 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 175 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 175 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 176 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 177 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 176 | } | 178 | } |
| 177 | if offsetLimitFlag { | 179 | if offsetLimitFlag { |
| 178 | query.SetOffsetAndLimit(20) | 180 | query.SetOffsetAndLimit(20) |
| @@ -3,6 +3,7 @@ package repository | @@ -3,6 +3,7 @@ package repository | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| 5 | "github.com/go-pg/pg/v10" | 5 | "github.com/go-pg/pg/v10" |
| 6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
| 6 | 7 | ||
| 7 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" | 8 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" |
| 8 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | 9 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" |
| @@ -176,8 +177,9 @@ func (repository *CooperationContractRelevantRepository) Find(queryOptions map[s | @@ -176,8 +177,9 @@ func (repository *CooperationContractRelevantRepository) Find(queryOptions map[s | ||
| 176 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 177 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 177 | query.Where("org->>'orgId' = '?'", orgId) | 178 | query.Where("org->>'orgId' = '?'", orgId) |
| 178 | } | 179 | } |
| 179 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 180 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 180 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 181 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 182 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 181 | } | 183 | } |
| 182 | if userBaseId, ok := queryOptions["userBaseId"]; ok && userBaseId.(int64) != 0 { | 184 | if userBaseId, ok := queryOptions["userBaseId"]; ok && userBaseId.(int64) != 0 { |
| 183 | query.Where("user_base_id = ?", userBaseId) | 185 | query.Where("user_base_id = ?", userBaseId) |
| @@ -995,8 +995,9 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in | @@ -995,8 +995,9 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in | ||
| 995 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 995 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 996 | query.Where("org->>'orgId' = '?'", orgId) | 996 | query.Where("org->>'orgId' = '?'", orgId) |
| 997 | } | 997 | } |
| 998 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 999 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 998 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 999 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 1000 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 1000 | } | 1001 | } |
| 1001 | if incentivesType, ok := queryOptions["incentivesType"]; ok && incentivesType.(int32) != 0 { | 1002 | if incentivesType, ok := queryOptions["incentivesType"]; ok && incentivesType.(int32) != 0 { |
| 1002 | query.Where("incentives_type = ?", incentivesType) | 1003 | query.Where("incentives_type = ?", incentivesType) |
| @@ -3,6 +3,7 @@ package repository | @@ -3,6 +3,7 @@ package repository | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| 5 | "github.com/go-pg/pg/v10" | 5 | "github.com/go-pg/pg/v10" |
| 6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
| 6 | 7 | ||
| 7 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" | 8 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" |
| 8 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | 9 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" |
| @@ -187,8 +188,9 @@ func (repository *CooperationContractUndertakerRepository) Find(queryOptions map | @@ -187,8 +188,9 @@ func (repository *CooperationContractUndertakerRepository) Find(queryOptions map | ||
| 187 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 188 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 188 | query.Where("org->>'orgId' = '?'", orgId) | 189 | query.Where("org->>'orgId' = '?'", orgId) |
| 189 | } | 190 | } |
| 190 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 191 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 191 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 192 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 193 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 192 | } | 194 | } |
| 193 | if userBaseId, ok := queryOptions["userBaseId"]; ok && userBaseId.(int64) != 0 { | 195 | if userBaseId, ok := queryOptions["userBaseId"]; ok && userBaseId.(int64) != 0 { |
| 194 | query.Where("user_base_id = ? ", userBaseId) | 196 | query.Where("user_base_id = ? ", userBaseId) |
| @@ -9,6 +9,7 @@ import ( | @@ -9,6 +9,7 @@ import ( | ||
| 9 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | 9 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" |
| 10 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models" | 10 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models" |
| 11 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/transform" | 11 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/transform" |
| 12 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
| 12 | ) | 13 | ) |
| 13 | 14 | ||
| 14 | type CooperationModeRepository struct { | 15 | type CooperationModeRepository struct { |
| @@ -190,8 +191,9 @@ func (repository *CooperationModeRepository) Find(queryOptions map[string]interf | @@ -190,8 +191,9 @@ func (repository *CooperationModeRepository) Find(queryOptions map[string]interf | ||
| 190 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 191 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 191 | query.Where("org->>'orgId' = '?'", orgId) | 192 | query.Where("org->>'orgId' = '?'", orgId) |
| 192 | } | 193 | } |
| 193 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 194 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 194 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 195 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 196 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 195 | } | 197 | } |
| 196 | offsetLimitFlag := true | 198 | offsetLimitFlag := true |
| 197 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { | 199 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { |
| @@ -3,6 +3,7 @@ package repository | @@ -3,6 +3,7 @@ package repository | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| 5 | "github.com/go-pg/pg/v10" | 5 | "github.com/go-pg/pg/v10" |
| 6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
| 6 | "time" | 7 | "time" |
| 7 | 8 | ||
| 8 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" | 9 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" |
| @@ -252,8 +253,9 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int | @@ -252,8 +253,9 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int | ||
| 252 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 253 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 253 | query.Where("org->>'orgId' = '?'", orgId) | 254 | query.Where("org->>'orgId' = '?'", orgId) |
| 254 | } | 255 | } |
| 255 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 256 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 256 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 257 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 258 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 257 | } | 259 | } |
| 258 | if v, ok := queryOptions["status"]; ok && v.(int32) > 0 { | 260 | if v, ok := queryOptions["status"]; ok && v.(int32) > 0 { |
| 259 | query.Where("status =? ", v) | 261 | query.Where("status =? ", v) |
| @@ -3,6 +3,7 @@ package repository | @@ -3,6 +3,7 @@ package repository | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| 5 | "github.com/go-pg/pg/v10" | 5 | "github.com/go-pg/pg/v10" |
| 6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
| 6 | 7 | ||
| 7 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" | 8 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" |
| 8 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | 9 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" |
| @@ -218,8 +219,9 @@ func (repository *CreditAccountRepository) Find(queryOptions map[string]interfac | @@ -218,8 +219,9 @@ func (repository *CreditAccountRepository) Find(queryOptions map[string]interfac | ||
| 218 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 219 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 219 | query.Where("org->>'orgId' = '?'", orgId) | 220 | query.Where("org->>'orgId' = '?'", orgId) |
| 220 | } | 221 | } |
| 221 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 222 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 222 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 223 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 224 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 223 | } | 225 | } |
| 224 | offsetLimitFlag := true | 226 | offsetLimitFlag := true |
| 225 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { | 227 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { |
| @@ -3,6 +3,7 @@ package repository | @@ -3,6 +3,7 @@ package repository | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| 5 | "github.com/go-pg/pg/v10" | 5 | "github.com/go-pg/pg/v10" |
| 6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
| 6 | "time" | 7 | "time" |
| 7 | 8 | ||
| 8 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" | 9 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" |
| @@ -301,8 +302,9 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte | @@ -301,8 +302,9 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte | ||
| 301 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 302 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 302 | query.Where("org->>'orgId' = '?'", orgId) | 303 | query.Where("org->>'orgId' = '?'", orgId) |
| 303 | } | 304 | } |
| 304 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 305 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 305 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 306 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 307 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 306 | } | 308 | } |
| 307 | offsetLimitFlag := true | 309 | offsetLimitFlag := true |
| 308 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { | 310 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { |
| @@ -3,6 +3,7 @@ package repository | @@ -3,6 +3,7 @@ package repository | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| 5 | "github.com/go-pg/pg/v10" | 5 | "github.com/go-pg/pg/v10" |
| 6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
| 6 | 7 | ||
| 7 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" | 8 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" |
| 8 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | 9 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" |
| @@ -171,8 +172,9 @@ func (repository *DividendsIncentivesRuleRepository) Find(queryOptions map[strin | @@ -171,8 +172,9 @@ func (repository *DividendsIncentivesRuleRepository) Find(queryOptions map[strin | ||
| 171 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 172 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 172 | query.Where("org->>'orgId' = '?'", orgId) | 173 | query.Where("org->>'orgId' = '?'", orgId) |
| 173 | } | 174 | } |
| 174 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 175 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 175 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 176 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 177 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 176 | } | 178 | } |
| 177 | offsetLimitFlag := true | 179 | offsetLimitFlag := true |
| 178 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { | 180 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { |
| @@ -413,8 +413,9 @@ func (repository *DividendsOrderRepository) Find(queryOptions map[string]interfa | @@ -413,8 +413,9 @@ func (repository *DividendsOrderRepository) Find(queryOptions map[string]interfa | ||
| 413 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 413 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 414 | query.Where("org->>'orgId' = '?'", orgId) | 414 | query.Where("org->>'orgId' = '?'", orgId) |
| 415 | } | 415 | } |
| 416 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 417 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 416 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 417 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 418 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 418 | } | 419 | } |
| 419 | offsetLimitFlag := true | 420 | offsetLimitFlag := true |
| 420 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { | 421 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { |
| @@ -415,8 +415,9 @@ func (repository *DividendsReturnedOrderRepository) Find(queryOptions map[string | @@ -415,8 +415,9 @@ func (repository *DividendsReturnedOrderRepository) Find(queryOptions map[string | ||
| 415 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 415 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 416 | query.Where("org->>'orgId' = '?'", orgId) | 416 | query.Where("org->>'orgId' = '?'", orgId) |
| 417 | } | 417 | } |
| 418 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 419 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 418 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 419 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 420 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 420 | } | 421 | } |
| 421 | offsetLimitFlag := true | 422 | offsetLimitFlag := true |
| 422 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { | 423 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { |
| @@ -3,6 +3,7 @@ package repository | @@ -3,6 +3,7 @@ package repository | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| 5 | "github.com/go-pg/pg/v10" | 5 | "github.com/go-pg/pg/v10" |
| 6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
| 6 | 7 | ||
| 7 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" | 8 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" |
| 8 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | 9 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" |
| @@ -171,8 +172,9 @@ func (repository *MoneyIncentivesRuleRepository) Find(queryOptions map[string]in | @@ -171,8 +172,9 @@ func (repository *MoneyIncentivesRuleRepository) Find(queryOptions map[string]in | ||
| 171 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 172 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 172 | query.Where("org->>'orgId' = '?'", orgId) | 173 | query.Where("org->>'orgId' = '?'", orgId) |
| 173 | } | 174 | } |
| 174 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 175 | - query.Where("org->>'orgId' in (?)", pg.In(orgIds)) | 175 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 176 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 177 | + query.Where("org->>'orgId' in (?)", pg.In(newOrgIds)) | ||
| 176 | } | 178 | } |
| 177 | offsetLimitFlag := true | 179 | offsetLimitFlag := true |
| 178 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { | 180 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { |
| @@ -4,6 +4,7 @@ import ( | @@ -4,6 +4,7 @@ import ( | ||
| 4 | "fmt" | 4 | "fmt" |
| 5 | "github.com/go-pg/pg/v10" | 5 | "github.com/go-pg/pg/v10" |
| 6 | "github.com/go-pg/pg/v10/orm" | 6 | "github.com/go-pg/pg/v10/orm" |
| 7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
| 7 | 8 | ||
| 8 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" | 9 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" |
| 9 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | 10 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" |
| @@ -184,8 +185,9 @@ func (repository *OrderGoodRepository) Find(queryOptions map[string]interface{}) | @@ -184,8 +185,9 @@ func (repository *OrderGoodRepository) Find(queryOptions map[string]interface{}) | ||
| 184 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 185 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
| 185 | query.Where("org_id = '?'", orgId) | 186 | query.Where("org_id = '?'", orgId) |
| 186 | } | 187 | } |
| 187 | - if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]string)) > 0 { | ||
| 188 | - query.Where("org_id in (?)", pg.In(orgIds)) | 188 | + if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 { |
| 189 | + newOrgIds := utils.SliceItoa(orgIds.([]int64)) | ||
| 190 | + query.Where("org_id in (?)", pg.In(newOrgIds)) | ||
| 189 | } | 191 | } |
| 190 | offsetLimitFlag := true | 192 | offsetLimitFlag := true |
| 191 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { | 193 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { |
| @@ -45,6 +45,7 @@ func Difference(slice1, slice2 []int64) []int64 { | @@ -45,6 +45,7 @@ func Difference(slice1, slice2 []int64) []int64 { | ||
| 45 | return nn | 45 | return nn |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | +// SliceAtoi 字符创数组转数字数组 | ||
| 48 | func SliceAtoi(sa []string) ([]int64, error) { | 49 | func SliceAtoi(sa []string) ([]int64, error) { |
| 49 | si := make([]int64, 0, len(sa)) | 50 | si := make([]int64, 0, len(sa)) |
| 50 | for _, a := range sa { | 51 | for _, a := range sa { |
| @@ -57,6 +58,16 @@ func SliceAtoi(sa []string) ([]int64, error) { | @@ -57,6 +58,16 @@ func SliceAtoi(sa []string) ([]int64, error) { | ||
| 57 | return si, nil | 58 | return si, nil |
| 58 | } | 59 | } |
| 59 | 60 | ||
| 61 | +// SliceItoa 数字数组转字符创数组 | ||
| 62 | +func SliceItoa(sa []int64) []string { | ||
| 63 | + si := make([]string, 0, len(sa)) | ||
| 64 | + for _, a := range sa { | ||
| 65 | + s := strconv.Itoa(int(a)) | ||
| 66 | + si = append(si, s) | ||
| 67 | + } | ||
| 68 | + return si | ||
| 69 | +} | ||
| 70 | + | ||
| 60 | func Round(value float64, places int32) float64 { | 71 | func Round(value float64, places int32) float64 { |
| 61 | quantity := decimal.NewFromFloat(value) | 72 | quantity := decimal.NewFromFloat(value) |
| 62 | d := quantity.Round(places) | 73 | d := quantity.Round(places) |
-
请 注册 或 登录 后发表评论