作者 陈志颖

fix:分红退货单导入合约存在性校验

@@ -359,7 +359,7 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec @@ -359,7 +359,7 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec
359 undertakerTypesUncheckedAvailable = append(undertakerTypesUncheckedAvailable, 3) 359 undertakerTypesUncheckedAvailable = append(undertakerTypesUncheckedAvailable, 3)
360 } 360 }
361 361
362 - // TODO 判断项目关联的合约承接人类型 362 + // 判断项目关联的合约承接人类型
363 undertakers := make([]*domain.Undertaker, 0) 363 undertakers := make([]*domain.Undertaker, 0)
364 if countContracts, cooperationContracts, err := cooperationContractRepository.Find(map[string]interface{}{ 364 if countContracts, cooperationContracts, err := cooperationContractRepository.Find(map[string]interface{}{
365 "offsetLimit": false, 365 "offsetLimit": false,
@@ -390,6 +390,7 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec @@ -390,6 +390,7 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec
390 undertakerUserTypes = append(undertakerUserTypes, int32(3)) 390 undertakerUserTypes = append(undertakerUserTypes, int32(3))
391 } 391 }
392 392
  393 + // 取项目承接人和合约承接人的交集
393 newUndertakerTypesUncheckedAvailable := utils.Intersect32(undertakerTypesUncheckedAvailable, undertakerUserTypes) 394 newUndertakerTypesUncheckedAvailable := utils.Intersect32(undertakerTypesUncheckedAvailable, undertakerUserTypes)
394 395
395 log.Logger.Info("承接人类型", map[string]interface{}{ 396 log.Logger.Info("承接人类型", map[string]interface{}{
@@ -864,12 +864,14 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) ImportDivide @@ -864,12 +864,14 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) ImportDivide
864 contractNumberExist := false 864 contractNumberExist := false
865 for _, cooperationContract := range cooperationContracts { 865 for _, cooperationContract := range cooperationContracts {
866 if orderGood.CooperationContractNumber == cooperationContract.CooperationContractNumber { 866 if orderGood.CooperationContractNumber == cooperationContract.CooperationContractNumber {
867 - contractNumberExist = true  
868 - break 867 + if cooperationContract.Status == 1 {
  868 + contractNumberExist = true
  869 + break
  870 + }
869 } 871 }
870 } 872 }
871 if !contractNumberExist { 873 if !contractNumberExist {
872 - orderGoodErrMap[dividendsReturnedOrder.OrderGoods[j].LineNumber] = "退货单产品关联的共创合约不存在" 874 + orderGoodErrMap[dividendsReturnedOrder.OrderGoods[j].LineNumber] = "退货单产品关联的共创合约不存在或已暂停"
873 continue 875 continue
874 } 876 }
875 877