正在显示
8 个修改的文件
包含
65 行增加
和
6 行删除
| @@ -784,7 +784,8 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent | @@ -784,7 +784,8 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent | ||
| 784 | orderGoodSavedIds = append(orderGoodSavedIds, dividendsEstimate.OrderGoodId) | 784 | orderGoodSavedIds = append(orderGoodSavedIds, dividendsEstimate.OrderGoodId) |
| 785 | } | 785 | } |
| 786 | 786 | ||
| 787 | - // 获取订单产品 | 787 | + // 更新订单产品分红状态 |
| 788 | + var orderGoodsSaved []*domain.OrderGood | ||
| 788 | if len(orderGoodSavedIds) > 0 { | 789 | if len(orderGoodSavedIds) > 0 { |
| 789 | if countOrderGood, orderGoodsFound, err := orderGoodRepository.Find(map[string]interface{}{ | 790 | if countOrderGood, orderGoodsFound, err := orderGoodRepository.Find(map[string]interface{}{ |
| 790 | "orderGoodIds": orderGoodSavedIds, | 791 | "orderGoodIds": orderGoodSavedIds, |
| @@ -795,6 +796,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent | @@ -795,6 +796,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent | ||
| 795 | for i, _ := range orderGoodsFound { | 796 | for i, _ := range orderGoodsFound { |
| 796 | orderGoodsFound[i].OrderGoodDividendsStatus = int32(2) // 已分红 | 797 | orderGoodsFound[i].OrderGoodDividendsStatus = int32(2) // 已分红 |
| 797 | } | 798 | } |
| 799 | + orderGoodsSaved = orderGoodsFound | ||
| 798 | if _, err6 := orderGoodRepository.UpdateMany(orderGoodsFound); err6 != nil { | 800 | if _, err6 := orderGoodRepository.UpdateMany(orderGoodsFound); err6 != nil { |
| 799 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err6.Error()) | 801 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err6.Error()) |
| 800 | } | 802 | } |
| @@ -834,12 +836,21 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent | @@ -834,12 +836,21 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent | ||
| 834 | } else { | 836 | } else { |
| 835 | if countDividendsOrdersFound > 0 { | 837 | if countDividendsOrdersFound > 0 { |
| 836 | for i, dividendsOrderFound := range dividendsOrdersFound { | 838 | for i, dividendsOrderFound := range dividendsOrdersFound { |
| 839 | + for i, _ := range dividendsOrderFound.Goods { | ||
| 840 | + for _, good := range orderGoodsSaved { | ||
| 841 | + if dividendsOrderFound.Goods[i].OrderGoodId == good.OrderGoodId { | ||
| 842 | + dividendsOrderFound.Goods[i].OrderGoodDividendsStatus = good.OrderGoodDividendsStatus | ||
| 843 | + } | ||
| 844 | + } | ||
| 845 | + } | ||
| 846 | + | ||
| 837 | var dividendsGoodCount int | 847 | var dividendsGoodCount int |
| 838 | for _, orderGood := range dividendsOrderFound.Goods { | 848 | for _, orderGood := range dividendsOrderFound.Goods { |
| 839 | if orderGood.OrderGoodDividendsStatus == 2 { | 849 | if orderGood.OrderGoodDividendsStatus == 2 { |
| 840 | dividendsGoodCount = dividendsGoodCount + 1 | 850 | dividendsGoodCount = dividendsGoodCount + 1 |
| 841 | } | 851 | } |
| 842 | } | 852 | } |
| 853 | + | ||
| 843 | if dividendsGoodCount == len(dividendsOrderFound.Goods) { // 2已分红 | 854 | if dividendsGoodCount == len(dividendsOrderFound.Goods) { // 2已分红 |
| 844 | dividendsOrdersFound[i].DividendStatus = 2 | 855 | dividendsOrdersFound[i].DividendStatus = 2 |
| 845 | } else if dividendsGoodCount > 0 && dividendsGoodCount < len(dividendsOrderFound.Goods) { // 3部分分红 | 856 | } else if dividendsGoodCount > 0 && dividendsGoodCount < len(dividendsOrderFound.Goods) { // 3部分分红 |
| @@ -848,6 +859,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent | @@ -848,6 +859,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent | ||
| 848 | dividendsOrdersFound[i].DividendStatus = 1 | 859 | dividendsOrdersFound[i].DividendStatus = 1 |
| 849 | } | 860 | } |
| 850 | } | 861 | } |
| 862 | + | ||
| 851 | // 保存订单状态 | 863 | // 保存订单状态 |
| 852 | if _, err6 := dividendsOrderRepository.UpdateMany(dividendsOrdersFound); err6 != nil { | 864 | if _, err6 := dividendsOrderRepository.UpdateMany(dividendsOrdersFound); err6 != nil { |
| 853 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 865 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
| @@ -867,6 +879,14 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent | @@ -867,6 +879,14 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent | ||
| 867 | } else { | 879 | } else { |
| 868 | if countDividendsReturnedOrdersFound > 0 { | 880 | if countDividendsReturnedOrdersFound > 0 { |
| 869 | for i, dividendsReturnedOrderFound := range dividendsReturnedOrdersFound { | 881 | for i, dividendsReturnedOrderFound := range dividendsReturnedOrdersFound { |
| 882 | + for i, _ := range dividendsReturnedOrderFound.Goods { | ||
| 883 | + for _, good := range orderGoodsSaved { | ||
| 884 | + if dividendsReturnedOrderFound.Goods[i].OrderGoodId == good.OrderGoodId { | ||
| 885 | + dividendsReturnedOrderFound.Goods[i].OrderGoodDividendsStatus = good.OrderGoodDividendsStatus | ||
| 886 | + } | ||
| 887 | + } | ||
| 888 | + } | ||
| 889 | + | ||
| 870 | var dividendsGoodCount int | 890 | var dividendsGoodCount int |
| 871 | for _, orderGood := range dividendsReturnedOrderFound.Goods { | 891 | for _, orderGood := range dividendsReturnedOrderFound.Goods { |
| 872 | if orderGood.OrderGoodDividendsStatus == 2 { | 892 | if orderGood.OrderGoodDividendsStatus == 2 { |
| @@ -1307,10 +1327,12 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti | @@ -1307,10 +1327,12 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti | ||
| 1307 | "orgId": searchDividendsIncentivesEstimateQuery.OrgId, | 1327 | "orgId": searchDividendsIncentivesEstimateQuery.OrgId, |
| 1308 | }) | 1328 | }) |
| 1309 | if err != nil { | 1329 | if err != nil { |
| 1330 | + log.Logger.Error(err.Error()) | ||
| 1310 | continue | 1331 | continue |
| 1311 | //return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 1332 | //return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
| 1312 | } | 1333 | } |
| 1313 | if dividendsOrder == nil { | 1334 | if dividendsOrder == nil { |
| 1335 | + log.Logger.Info(fmt.Sprintf("分红订单%s不存在", orderGood.DividendsOrderNumber)) | ||
| 1314 | continue | 1336 | continue |
| 1315 | //return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsOrderNumber)) | 1337 | //return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsOrderNumber)) |
| 1316 | } | 1338 | } |
| @@ -1326,10 +1348,12 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti | @@ -1326,10 +1348,12 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti | ||
| 1326 | "orgId": searchDividendsIncentivesEstimateQuery.OrgId, | 1348 | "orgId": searchDividendsIncentivesEstimateQuery.OrgId, |
| 1327 | }) | 1349 | }) |
| 1328 | if err != nil { | 1350 | if err != nil { |
| 1351 | + log.Logger.Error(err.Error()) | ||
| 1329 | continue | 1352 | continue |
| 1330 | //return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 1353 | //return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
| 1331 | } | 1354 | } |
| 1332 | if dividendsReturnedOrder == nil { | 1355 | if dividendsReturnedOrder == nil { |
| 1356 | + log.Logger.Info(fmt.Sprintf("分红退货单%s不存在", orderGood.DividendsReturnedOrderNumber)) | ||
| 1333 | continue | 1357 | continue |
| 1334 | //return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsReturnedOrderNumber)) | 1358 | //return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsReturnedOrderNumber)) |
| 1335 | } | 1359 | } |
| @@ -1401,12 +1425,11 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE | @@ -1401,12 +1425,11 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE | ||
| 1401 | stageAndUndertaker := make([]*dto.StageAndUndertaker, 0) | 1425 | stageAndUndertaker := make([]*dto.StageAndUndertaker, 0) |
| 1402 | 1426 | ||
| 1403 | // 初始化阶段承接人map | 1427 | // 初始化阶段承接人map |
| 1428 | + | ||
| 1404 | for _, rule := range cooperationContract.MoneyIncentivesRules { | 1429 | for _, rule := range cooperationContract.MoneyIncentivesRules { |
| 1405 | stageUndertakerMap[rule.MoneyIncentivesStage] = make([]*domain.Undertaker, 0) | 1430 | stageUndertakerMap[rule.MoneyIncentivesStage] = make([]*domain.Undertaker, 0) |
| 1406 | } | 1431 | } |
| 1407 | 1432 | ||
| 1408 | - // TODO 校验当前时间和激励阶段是否匹配 | ||
| 1409 | - | ||
| 1410 | log.Logger.Info("阶段承接人map初始化", map[string]interface{}{ | 1433 | log.Logger.Info("阶段承接人map初始化", map[string]interface{}{ |
| 1411 | "stageUndertakerMap": stageUndertakerMap, | 1434 | "stageUndertakerMap": stageUndertakerMap, |
| 1412 | }) | 1435 | }) |
| @@ -1424,6 +1447,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE | @@ -1424,6 +1447,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE | ||
| 1424 | "orgId": cooperationContract.Org.OrgId, | 1447 | "orgId": cooperationContract.Org.OrgId, |
| 1425 | "dividendsUserId": undertaker.UserId, | 1448 | "dividendsUserId": undertaker.UserId, |
| 1426 | "offsetLimit": false, | 1449 | "offsetLimit": false, |
| 1450 | + "dividendsParticipateType": int32(1), | ||
| 1427 | }); err != nil { | 1451 | }); err != nil { |
| 1428 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 1452 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
| 1429 | } else { | 1453 | } else { |
| @@ -1445,7 +1469,20 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE | @@ -1445,7 +1469,20 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE | ||
| 1445 | } | 1469 | } |
| 1446 | } | 1470 | } |
| 1447 | 1471 | ||
| 1448 | - // TODO 去除没有承接人的阶段 | 1472 | + // 校验当前时间和激励阶段是否匹配 |
| 1473 | + currentTime := time.Now() | ||
| 1474 | + for _, rule := range cooperationContract.MoneyIncentivesRules { | ||
| 1475 | + if currentTime.After(rule.MoneyIncentivesTime) || currentTime.Equal(rule.MoneyIncentivesTime) { | ||
| 1476 | + delete(stageUndertakerMap, rule.MoneyIncentivesStage) | ||
| 1477 | + } | ||
| 1478 | + } | ||
| 1479 | + | ||
| 1480 | + // 去除没有承接人的阶段 | ||
| 1481 | + for k, v := range stageUndertakerMap { | ||
| 1482 | + if len(v) == 0 { | ||
| 1483 | + delete(stageUndertakerMap, k) | ||
| 1484 | + } | ||
| 1485 | + } | ||
| 1449 | 1486 | ||
| 1450 | log.Logger.Info("阶段承接人map", map[string]interface{}{ | 1487 | log.Logger.Info("阶段承接人map", map[string]interface{}{ |
| 1451 | "stageUndertakerMap": stageUndertakerMap, | 1488 | "stageUndertakerMap": stageUndertakerMap, |
| @@ -8,6 +8,8 @@ type CooperationContractUndertaker struct { | @@ -8,6 +8,8 @@ type CooperationContractUndertaker struct { | ||
| 8 | CooperationContractUndertakerId int64 `json:"cooperationContractUndertakerId,string"` | 8 | CooperationContractUndertakerId int64 `json:"cooperationContractUndertakerId,string"` |
| 9 | // 共创合约编号 | 9 | // 共创合约编号 |
| 10 | CooperationContractNumber string `json:"cooperationContractNumber"` | 10 | CooperationContractNumber string `json:"cooperationContractNumber"` |
| 11 | + // 合约ID | ||
| 12 | + CooperationContractId int64 `json:"cooperationContractId"` | ||
| 11 | // 共创合约承接人 | 13 | // 共创合约承接人 |
| 12 | Undertaker *Undertaker `json:"undertaker"` | 14 | Undertaker *Undertaker `json:"undertaker"` |
| 13 | // 创建时间 | 15 | // 创建时间 |
| @@ -10,6 +10,8 @@ type Undertaker struct { | @@ -10,6 +10,8 @@ type Undertaker struct { | ||
| 10 | UserBaseId int64 `json:"userBaseId,string"` | 10 | UserBaseId int64 `json:"userBaseId,string"` |
| 11 | // 共创合约编号 | 11 | // 共创合约编号 |
| 12 | CooperationContractNumber string `json:"cooperationContractNumber"` | 12 | CooperationContractNumber string `json:"cooperationContractNumber"` |
| 13 | + // 共创合约ID | ||
| 14 | + CooperationContractId int64 `json:"cooperationContractId"` | ||
| 13 | // 用户所属组织机构 | 15 | // 用户所属组织机构 |
| 14 | Org *Org `json:"org"` | 16 | Org *Org `json:"org"` |
| 15 | // 用户关联的组织机构 | 17 | // 用户关联的组织机构 |
| @@ -11,6 +11,8 @@ type CooperationContractUndertaker struct { | @@ -11,6 +11,8 @@ type CooperationContractUndertaker struct { | ||
| 11 | CooperationContractUndertakerId int64 `comment:"共创合约承接人id" pg:",pk"` | 11 | CooperationContractUndertakerId int64 `comment:"共创合约承接人id" pg:",pk"` |
| 12 | // 共创合约编号 | 12 | // 共创合约编号 |
| 13 | CooperationContractNumber string `comment:"共创合约编号"` | 13 | CooperationContractNumber string `comment:"共创合约编号"` |
| 14 | + // 共创合约ID | ||
| 15 | + CooperationContractId int64 `comment:"共创合约ID"` | ||
| 14 | // 共创合约承接人uid | 16 | // 共创合约承接人uid |
| 15 | UserId int64 `comment:"共创合约承接人uid"` | 17 | UserId int64 `comment:"共创合约承接人uid"` |
| 16 | // 用户基础数据id | 18 | // 用户基础数据id |
| @@ -43,6 +43,8 @@ type DividendsEstimate struct { | @@ -43,6 +43,8 @@ type DividendsEstimate struct { | ||
| 43 | OperateTime time.Time `comment:"操作时间"` | 43 | OperateTime time.Time `comment:"操作时间"` |
| 44 | // 取消状态 | 44 | // 取消状态 |
| 45 | IsCanceled bool `comment:"取消状态"` | 45 | IsCanceled bool `comment:"取消状态"` |
| 46 | + // 产品ID | ||
| 47 | + OrderGoodId int64 `comment:"产品ID"` | ||
| 46 | // 创建时间 | 48 | // 创建时间 |
| 47 | CreatedAt time.Time `comment:"创建时间"` | 49 | CreatedAt time.Time `comment:"创建时间"` |
| 48 | // 删除时间 | 50 | // 删除时间 |
| @@ -27,6 +27,7 @@ func TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel | @@ -27,6 +27,7 @@ func TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel | ||
| 27 | Operator: dividendsEstimateModel.Operator, | 27 | Operator: dividendsEstimateModel.Operator, |
| 28 | OperateTime: dividendsEstimateModel.OperateTime, | 28 | OperateTime: dividendsEstimateModel.OperateTime, |
| 29 | IsCanceled: dividendsEstimateModel.IsCanceled, | 29 | IsCanceled: dividendsEstimateModel.IsCanceled, |
| 30 | + OrderGoodId: dividendsEstimateModel.OrderGoodId, | ||
| 30 | CreatedAt: dividendsEstimateModel.CreatedAt, | 31 | CreatedAt: dividendsEstimateModel.CreatedAt, |
| 31 | DeletedAt: dividendsEstimateModel.DeletedAt, | 32 | DeletedAt: dividendsEstimateModel.DeletedAt, |
| 32 | UpdatedAt: dividendsEstimateModel.UpdatedAt, | 33 | UpdatedAt: dividendsEstimateModel.UpdatedAt, |
| @@ -145,6 +145,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | @@ -145,6 +145,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | ||
| 145 | for _, undertaker := range cooperationContract.Undertakers { | 145 | for _, undertaker := range cooperationContract.Undertakers { |
| 146 | undertakersModel = append(undertakersModel, &models.CooperationContractUndertaker{ | 146 | undertakersModel = append(undertakersModel, &models.CooperationContractUndertaker{ |
| 147 | CooperationContractNumber: cooperationContract.CooperationContractNumber, | 147 | CooperationContractNumber: cooperationContract.CooperationContractNumber, |
| 148 | + CooperationContractId: cooperationContract.CooperationContractId, | ||
| 148 | UserId: undertaker.UserId, | 149 | UserId: undertaker.UserId, |
| 149 | UserBaseId: undertaker.UserBaseId, | 150 | UserBaseId: undertaker.UserBaseId, |
| 150 | Org: undertaker.Org, | 151 | Org: undertaker.Org, |
| @@ -445,6 +446,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | @@ -445,6 +446,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | ||
| 445 | cooperationContractUndertakersToAddModels = append(cooperationContractUndertakersToAddModels, &models.CooperationContractUndertaker{ | 446 | cooperationContractUndertakersToAddModels = append(cooperationContractUndertakersToAddModels, &models.CooperationContractUndertaker{ |
| 446 | CooperationContractUndertakerId: undertakerDomain.UndertakerId, | 447 | CooperationContractUndertakerId: undertakerDomain.UndertakerId, |
| 447 | CooperationContractNumber: undertakerDomain.CooperationContractNumber, | 448 | CooperationContractNumber: undertakerDomain.CooperationContractNumber, |
| 449 | + CooperationContractId: undertakerDomain.CooperationContractId, | ||
| 448 | UserId: undertakerDomain.UserId, | 450 | UserId: undertakerDomain.UserId, |
| 449 | UserBaseId: undertakerDomain.UserBaseId, | 451 | UserBaseId: undertakerDomain.UserBaseId, |
| 450 | Org: undertakerDomain.Org, | 452 | Org: undertakerDomain.Org, |
| @@ -498,6 +500,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | @@ -498,6 +500,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | ||
| 498 | undertakerModelsToUpdate[i] = &models.CooperationContractUndertaker{ | 500 | undertakerModelsToUpdate[i] = &models.CooperationContractUndertaker{ |
| 499 | CooperationContractUndertakerId: undertaker.UndertakerId, | 501 | CooperationContractUndertakerId: undertaker.UndertakerId, |
| 500 | CooperationContractNumber: undertaker.CooperationContractNumber, | 502 | CooperationContractNumber: undertaker.CooperationContractNumber, |
| 503 | + CooperationContractId: undertaker.CooperationContractId, | ||
| 501 | UserId: undertaker.UserId, | 504 | UserId: undertaker.UserId, |
| 502 | UserBaseId: undertaker.UserBaseId, | 505 | UserBaseId: undertaker.UserBaseId, |
| 503 | Org: undertaker.Org, | 506 | Org: undertaker.Org, |
| @@ -1233,7 +1236,7 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in | @@ -1233,7 +1236,7 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in | ||
| 1233 | Where("org->>'orgId' = '?'", cooperationContractModel.Org.OrgId). | 1236 | Where("org->>'orgId' = '?'", cooperationContractModel.Org.OrgId). |
| 1234 | Where("cooperation_contract_number = ?", cooperationContractModel.CooperationContractNumber). | 1237 | Where("cooperation_contract_number = ?", cooperationContractModel.CooperationContractNumber). |
| 1235 | Select(); err != nil { | 1238 | Select(); err != nil { |
| 1236 | - return 0, nil, fmt.Errorf("合约相关的承接人列表不存在") | 1239 | + return 0, nil, fmt.Errorf("合约关联的承接人列表不存在") |
| 1237 | } | 1240 | } |
| 1238 | // 获取相关人列表 | 1241 | // 获取相关人列表 |
| 1239 | var cooperationContractRelevantModels []*models.CooperationContractRelevant | 1242 | var cooperationContractRelevantModels []*models.CooperationContractRelevant |
| @@ -1243,7 +1246,7 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in | @@ -1243,7 +1246,7 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in | ||
| 1243 | Where("org->>'orgId' = '?'", cooperationContractModel.Org.OrgId). | 1246 | Where("org->>'orgId' = '?'", cooperationContractModel.Org.OrgId). |
| 1244 | Where("cooperation_contract_number = ?", cooperationContractModel.CooperationContractNumber). | 1247 | Where("cooperation_contract_number = ?", cooperationContractModel.CooperationContractNumber). |
| 1245 | Select(); err != nil { | 1248 | Select(); err != nil { |
| 1246 | - return 0, nil, fmt.Errorf("合约相关的相关人列表不存在") | 1249 | + return 0, nil, fmt.Errorf("合约关联的相关人列表不存在") |
| 1247 | } | 1250 | } |
| 1248 | if cooperationContract, err := transform.TransformToCooperationContractDomainModelFromPgModels( | 1251 | if cooperationContract, err := transform.TransformToCooperationContractDomainModelFromPgModels( |
| 1249 | cooperationContractModel, | 1252 | cooperationContractModel, |
| @@ -44,6 +44,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | @@ -44,6 +44,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | ||
| 44 | "operator", | 44 | "operator", |
| 45 | "operate_time", | 45 | "operate_time", |
| 46 | "is_canceled", | 46 | "is_canceled", |
| 47 | + "order_good_id", | ||
| 47 | "created_at", | 48 | "created_at", |
| 48 | "deleted_at", | 49 | "deleted_at", |
| 49 | "updated_at", | 50 | "updated_at", |
| @@ -81,6 +82,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | @@ -81,6 +82,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | ||
| 81 | ÷ndsEstimate.Operator, | 82 | ÷ndsEstimate.Operator, |
| 82 | ÷ndsEstimate.OperateTime, | 83 | ÷ndsEstimate.OperateTime, |
| 83 | ÷ndsEstimate.IsCanceled, | 84 | ÷ndsEstimate.IsCanceled, |
| 85 | + ÷ndsEstimate.OrderGoodId, | ||
| 84 | ÷ndsEstimate.CreatedAt, | 86 | ÷ndsEstimate.CreatedAt, |
| 85 | ÷ndsEstimate.DeletedAt, | 87 | ÷ndsEstimate.DeletedAt, |
| 86 | ÷ndsEstimate.UpdatedAt, | 88 | ÷ndsEstimate.UpdatedAt, |
| @@ -104,6 +106,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | @@ -104,6 +106,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | ||
| 104 | dividendsEstimate.Operator, | 106 | dividendsEstimate.Operator, |
| 105 | dividendsEstimate.OperateTime, | 107 | dividendsEstimate.OperateTime, |
| 106 | dividendsEstimate.IsCanceled, | 108 | dividendsEstimate.IsCanceled, |
| 109 | + dividendsEstimate.OrderGoodId, | ||
| 107 | dividendsEstimate.CreatedAt, | 110 | dividendsEstimate.CreatedAt, |
| 108 | nil, | 111 | nil, |
| 109 | dividendsEstimate.UpdatedAt, | 112 | dividendsEstimate.UpdatedAt, |
| @@ -131,6 +134,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | @@ -131,6 +134,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | ||
| 131 | ÷ndsEstimate.Operator, | 134 | ÷ndsEstimate.Operator, |
| 132 | ÷ndsEstimate.OperateTime, | 135 | ÷ndsEstimate.OperateTime, |
| 133 | ÷ndsEstimate.IsCanceled, | 136 | ÷ndsEstimate.IsCanceled, |
| 137 | + ÷ndsEstimate.OrderGoodId, | ||
| 134 | ÷ndsEstimate.CreatedAt, | 138 | ÷ndsEstimate.CreatedAt, |
| 135 | ÷ndsEstimate.DeletedAt, | 139 | ÷ndsEstimate.DeletedAt, |
| 136 | ÷ndsEstimate.UpdatedAt, | 140 | ÷ndsEstimate.UpdatedAt, |
| @@ -154,6 +158,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | @@ -154,6 +158,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | ||
| 154 | dividendsEstimate.Operator, | 158 | dividendsEstimate.Operator, |
| 155 | dividendsEstimate.OperateTime, | 159 | dividendsEstimate.OperateTime, |
| 156 | dividendsEstimate.IsCanceled, | 160 | dividendsEstimate.IsCanceled, |
| 161 | + dividendsEstimate.OrderGoodId, | ||
| 157 | dividendsEstimate.CreatedAt, | 162 | dividendsEstimate.CreatedAt, |
| 158 | nil, | 163 | nil, |
| 159 | dividendsEstimate.UpdatedAt, | 164 | dividendsEstimate.UpdatedAt, |
| @@ -196,6 +201,7 @@ func (repository *DividendsEstimateRepository) SaveMany(dividendsEstimates []*do | @@ -196,6 +201,7 @@ func (repository *DividendsEstimateRepository) SaveMany(dividendsEstimates []*do | ||
| 196 | Operator: dividendsEstimate.Operator, | 201 | Operator: dividendsEstimate.Operator, |
| 197 | OperateTime: dividendsEstimate.OperateTime, | 202 | OperateTime: dividendsEstimate.OperateTime, |
| 198 | IsCanceled: dividendsEstimate.IsCanceled, | 203 | IsCanceled: dividendsEstimate.IsCanceled, |
| 204 | + OrderGoodId: dividendsEstimate.OrderGoodId, | ||
| 199 | CreatedAt: dividendsEstimate.CreatedAt, | 205 | CreatedAt: dividendsEstimate.CreatedAt, |
| 200 | DeletedAt: dividendsEstimate.DeletedAt, | 206 | DeletedAt: dividendsEstimate.DeletedAt, |
| 201 | UpdatedAt: dividendsEstimate.UpdatedAt, | 207 | UpdatedAt: dividendsEstimate.UpdatedAt, |
| @@ -241,6 +247,7 @@ func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []* | @@ -241,6 +247,7 @@ func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []* | ||
| 241 | Operator: dividendsEstimate.Operator, | 247 | Operator: dividendsEstimate.Operator, |
| 242 | OperateTime: dividendsEstimate.OperateTime, | 248 | OperateTime: dividendsEstimate.OperateTime, |
| 243 | IsCanceled: dividendsEstimate.IsCanceled, | 249 | IsCanceled: dividendsEstimate.IsCanceled, |
| 250 | + OrderGoodId: dividendsEstimate.OrderGoodId, | ||
| 244 | CreatedAt: dividendsEstimate.CreatedAt, | 251 | CreatedAt: dividendsEstimate.CreatedAt, |
| 245 | DeletedAt: dividendsEstimate.DeletedAt, | 252 | DeletedAt: dividendsEstimate.DeletedAt, |
| 246 | UpdatedAt: time.Now(), | 253 | UpdatedAt: time.Now(), |
| @@ -315,6 +322,9 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte | @@ -315,6 +322,9 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte | ||
| 315 | if v, ok := queryOptions["cooperationContractNumbers"]; ok && len(v.([]string)) > 0 { | 322 | if v, ok := queryOptions["cooperationContractNumbers"]; ok && len(v.([]string)) > 0 { |
| 316 | query.Where("cooperation_contract_number in (?)", pg.In(v)) | 323 | query.Where("cooperation_contract_number in (?)", pg.In(v)) |
| 317 | } | 324 | } |
| 325 | + if dividendsParticipateType, ok := queryOptions["dividendsParticipateType"]; ok && dividendsParticipateType.(int32) != 0 { | ||
| 326 | + query.Where("dividends_participate_type = ?", dividendsParticipateType) | ||
| 327 | + } | ||
| 318 | if cooperationContractNumber, ok := queryOptions["cooperationContractNumber"]; ok && cooperationContractNumber != "" { | 328 | if cooperationContractNumber, ok := queryOptions["cooperationContractNumber"]; ok && cooperationContractNumber != "" { |
| 319 | query.Where("cooperation_contract_number = ?", cooperationContractNumber) | 329 | query.Where("cooperation_contract_number = ?", cooperationContractNumber) |
| 320 | } | 330 | } |
-
请 注册 或 登录 后发表评论