正在显示
4 个修改的文件
包含
17 行增加
和
9 行删除
@@ -1278,7 +1278,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | @@ -1278,7 +1278,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | ||
1278 | cooperationContractByte := *(*[]byte)(unsafe.Pointer(&cooperationContract.DividendsIncentivesRules)) | 1278 | cooperationContractByte := *(*[]byte)(unsafe.Pointer(&cooperationContract.DividendsIncentivesRules)) |
1279 | cooperationContractHashValue := md5.Sum(cooperationContractByte) | 1279 | cooperationContractHashValue := md5.Sum(cooperationContractByte) |
1280 | cooperationContractHashString := hex.EncodeToString(cooperationContractHashValue[:]) | 1280 | cooperationContractHashString := hex.EncodeToString(cooperationContractHashValue[:]) |
1281 | - //if !cooperationContract.DividendsIncentivesRuleSliceEqualBCE(cooperationContractFound.DividendsIncentivesRules, cooperationContract.DividendsIncentivesRules) { | 1281 | + |
1282 | if cooperationContractFoundHashString != cooperationContractHashString { | 1282 | if cooperationContractFoundHashString != cooperationContractHashString { |
1283 | // 业绩分红-->业绩分红 | 1283 | // 业绩分红-->业绩分红 |
1284 | 1284 | ||
@@ -1309,7 +1309,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | @@ -1309,7 +1309,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | ||
1309 | // 拼接规则变更 | 1309 | // 拼接规则变更 |
1310 | incentivesRuleChangeDetail = dividendsIncentivesRuleOriginalTmp + " 变更为 " + dividendsIncentivesRuleChangedTmp | 1310 | incentivesRuleChangeDetail = dividendsIncentivesRuleOriginalTmp + " 变更为 " + dividendsIncentivesRuleChangedTmp |
1311 | } | 1311 | } |
1312 | - } else if cooperationContractFound.IncentivesType == domain.MONEY_INCENTIVES { // 金额激励规则内容变更 | 1312 | + } else if cooperationContractFound.IncentivesType == domain.TYPE_MONEY_INCENTIVES { // 金额激励规则内容变更 |
1313 | // 计算原合约哈希值 | 1313 | // 计算原合约哈希值 |
1314 | cooperationContractFoundByte := *(*[]byte)(unsafe.Pointer(&cooperationContractFound.MoneyIncentivesRules)) | 1314 | cooperationContractFoundByte := *(*[]byte)(unsafe.Pointer(&cooperationContractFound.MoneyIncentivesRules)) |
1315 | cooperationContractFoundHashValue := md5.Sum(cooperationContractFoundByte) | 1315 | cooperationContractFoundHashValue := md5.Sum(cooperationContractFoundByte) |
@@ -1320,7 +1320,6 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | @@ -1320,7 +1320,6 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | ||
1320 | cooperationContractHashValue := md5.Sum(cooperationContractByte) | 1320 | cooperationContractHashValue := md5.Sum(cooperationContractByte) |
1321 | cooperationContractHashString := hex.EncodeToString(cooperationContractHashValue[:]) | 1321 | cooperationContractHashString := hex.EncodeToString(cooperationContractHashValue[:]) |
1322 | 1322 | ||
1323 | - //if !cooperationContract.MoneyIncentivesRuleSliceEqualBCE(cooperationContractFound.MoneyIncentivesRules, cooperationContract.MoneyIncentivesRules) { | ||
1324 | if cooperationContractFoundHashString != cooperationContractHashString { | 1323 | if cooperationContractFoundHashString != cooperationContractHashString { |
1325 | incentivesRuleChange = cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractFound.IncentivesType)) + "-->" + cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContract.IncentivesType)) | 1324 | incentivesRuleChange = cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractFound.IncentivesType)) + "-->" + cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContract.IncentivesType)) |
1326 | //【第一阶段:20,2021-01-01~2021-12-31,,,;第二阶段:20,2021-01-01~2021-12-31,30,10】变更为【第一阶段:20,2021-01-01~2021-12-31,,,;】 | 1325 | //【第一阶段:20,2021-01-01~2021-12-31,,,;第二阶段:20,2021-01-01~2021-12-31,30,10】变更为【第一阶段:20,2021-01-01~2021-12-31,,,;】 |
@@ -1361,8 +1360,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | @@ -1361,8 +1360,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | ||
1361 | cooperationContractHashValue := md5.Sum(cooperationContractByte) | 1360 | cooperationContractHashValue := md5.Sum(cooperationContractByte) |
1362 | cooperationContractHashString := hex.EncodeToString(cooperationContractHashValue[:]) | 1361 | cooperationContractHashString := hex.EncodeToString(cooperationContractHashValue[:]) |
1363 | 1362 | ||
1364 | - //if !cooperationContract.UndertakerSliceEqualBCE(cooperationContractFound.Undertakers, cooperationContract.Undertakers) { // 【1(张三,李四,王五)2(买买买,,)】变更为【1(张三,,)】 | ||
1365 | - if cooperationContractFoundHashString != cooperationContractHashString { | 1363 | + if cooperationContractFoundHashString != cooperationContractHashString { // 【1(张三,李四,王五)2(买买买,,)】变更为【1(张三,,)】 |
1366 | // 原承接人 | 1364 | // 原承接人 |
1367 | var undertakersOriginal string | 1365 | var undertakersOriginal string |
1368 | for i, undertaker := range cooperationContractFound.Undertakers { | 1366 | for i, undertaker := range cooperationContractFound.Undertakers { |
@@ -635,7 +635,7 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro | @@ -635,7 +635,7 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro | ||
635 | } else { | 635 | } else { |
636 | if count > 0 { | 636 | if count > 0 { |
637 | for _, cooperationApplication := range cooperationApplications { | 637 | for _, cooperationApplication := range cooperationApplications { |
638 | - applicantTypes[cooperationApplication.CooperationApplicationApplicant.UserType] = cooperationApplication.CooperationApplicationApplicant.UserType | 638 | + applicantTypes[cooperationApplication.CooperationApplicationApplicant.UserType] = 1 |
639 | } | 639 | } |
640 | } | 640 | } |
641 | } | 641 | } |
@@ -652,7 +652,7 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro | @@ -652,7 +652,7 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro | ||
652 | } | 652 | } |
653 | } | 653 | } |
654 | if k1 != 0 && k2 != 0 { | 654 | if k1 != 0 && k2 != 0 { |
655 | - undertakerTypes = append(undertakerTypes, 4) | 655 | + undertakerTypes = append(undertakerTypes, 3) |
656 | } | 656 | } |
657 | // 校验可以修改的承接人(申请人)类型 | 657 | // 校验可以修改的承接人(申请人)类型 |
658 | for _, t := range undertakerTypes { | 658 | for _, t := range undertakerTypes { |
@@ -3,6 +3,7 @@ package dao | @@ -3,6 +3,7 @@ package dao | ||
3 | import ( | 3 | 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/linmadan/egglib-go/persistent/pg/sqlbuilder" | 7 | "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder" |
7 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | 8 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" |
8 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | 9 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" |
@@ -69,7 +70,11 @@ func (dao *CooperationContractDao) CheckUndertakerTypesUncheckedAvailable(queryO | @@ -69,7 +70,11 @@ func (dao *CooperationContractDao) CheckUndertakerTypesUncheckedAvailable(queryO | ||
69 | query = query.Where(`cooperation_contract.org @> '{"orgId":"?"}'`, orgId) | 70 | query = query.Where(`cooperation_contract.org @> '{"orgId":"?"}'`, orgId) |
70 | } | 71 | } |
71 | if user, ok := queryOptions["user"]; ok && user.(bool) != false { | 72 | if user, ok := queryOptions["user"]; ok && user.(bool) != false { |
72 | - query = query.Where("user_type = ?", 1) | 73 | + query.WhereGroup(func(q *orm.Query) (*orm.Query, error) { |
74 | + q.WhereOr("user_type = ?", 1) | ||
75 | + q.WhereOr("user_type = ?", 1025) | ||
76 | + return q, nil | ||
77 | + }) | ||
73 | } | 78 | } |
74 | if partner, ok := queryOptions["partner"]; ok && partner.(bool) != false { | 79 | if partner, ok := queryOptions["partner"]; ok && partner.(bool) != false { |
75 | query = query.Where("user_type = ?", 2) | 80 | query = query.Where("user_type = ?", 2) |
@@ -2,6 +2,7 @@ package dao | @@ -2,6 +2,7 @@ package dao | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | + "github.com/go-pg/pg/v10/orm" | ||
5 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | 6 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" |
6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models" | 7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models" |
7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | 8 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" |
@@ -73,7 +74,11 @@ func (dao *CooperationProjectDao) CheckUndertakerTypesUncheckedAvailable(queryOp | @@ -73,7 +74,11 @@ func (dao *CooperationProjectDao) CheckUndertakerTypesUncheckedAvailable(queryOp | ||
73 | queryUndertaker := tx.Model(&cooperationContractUndertakerModels) | 74 | queryUndertaker := tx.Model(&cooperationContractUndertakerModels) |
74 | queryUndertaker.Where("cooperation_contract_number = ?", cooperationContractModel.CooperationContractNumber) | 75 | queryUndertaker.Where("cooperation_contract_number = ?", cooperationContractModel.CooperationContractNumber) |
75 | if user, ok := queryOptions["user"]; ok && user.(bool) != false { | 76 | if user, ok := queryOptions["user"]; ok && user.(bool) != false { |
76 | - query = query.Where("user_type = ?", 1) | 77 | + query.WhereGroup(func(q *orm.Query) (*orm.Query, error) { |
78 | + q.WhereOr("user_type = ?", 1) | ||
79 | + q.WhereOr("user_type = ?", 1025) | ||
80 | + return q, nil | ||
81 | + }) | ||
77 | } | 82 | } |
78 | if partner, ok := queryOptions["partner"]; ok && partner.(bool) != false { | 83 | if partner, ok := queryOptions["partner"]; ok && partner.(bool) != false { |
79 | query = query.Where("user_type = ?", 2) | 84 | query = query.Where("user_type = ?", 2) |
-
请 注册 或 登录 后发表评论