作者 陈志颖

fix:共创申请查询增加过取消滤参数

... ... @@ -17,6 +17,8 @@ type SearchCooperationApplicationQuery struct {
ApplicantName string `cname:"申请人姓名" json:"applicantName,omitempty"`
// 共创申请审核状态,1待审核,2已同意,3已拒绝
CooperationApplicationStatus int32 `cname:"共创申请审核状态" json:"cooperationApplicationStatus,omitempty"`
// 是否被取消标记 1正常,2取消,3所有
IsCanceled int32 `cname:"取消状态" json:"isCanceled,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 页面大小
... ...
... ... @@ -26,7 +26,7 @@ type CooperationApplication struct {
CooperationProject *CooperationProject `json:"cooperationProject"`
// 数据所属组织机构
Org *Org `json:"org"`
// 是否被取消标志位
// 是否被取消标志位 1未取消,2取消
IsCanceled int32 `json:"isCanceled"`
// 公司
Company *Company `json:"company"`
... ...
... ... @@ -50,6 +50,8 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst
for _, dividendsEstimate := range dividendsEstimates {
// 根据当前分红预算单的分红订单号或退货单号获取分红预算单
if countRelative, dividendsEstimatesRelative, err2 := dividendsEstimateRepository.Find(map[string]interface{}{
"companyId": dividendsEstimate.Company.CompanyId,
"orgId": dividendsEstimate.Org.OrgId,
"orderOrReturnedOrderNum": dividendsEstimate.OrderOrReturnedOrderNum,
}); err2 != nil {
return nil, err2
... ... @@ -86,6 +88,8 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst
// 获取分红订单
if countDividendsOrder, orders, err4 := dividendsOrderRepository.Find(map[string]interface{}{
"companyId": dividendsEstimates[0].Company.CompanyId,
"orgId": dividendsEstimates[0].Org.OrgId,
"dividendsOrderNumbers": orderNums,
}); err4 != nil {
return nil, err4
... ... @@ -103,6 +107,8 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst
// 获取分红退货单
if countDividendsReturnedOrder, returnedOrders, err5 := dividendsReturnedOrderRepository.Find(map[string]interface{}{
"companyId": dividendsEstimates[0].Company.CompanyId,
"orgId": dividendsEstimates[0].Org.OrgId,
"dividendsReturnedOrderNumbers": returnedOrderNums,
}); err5 != nil {
return nil, err5
... ...
... ... @@ -248,6 +248,9 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string
if userBaseId, ok := queryOptions["userBaseId"]; ok && userBaseId.(int64) != 0 {
query.Where(`(cooperation_application.cooperation_application_applicant->>'userBaseId' ='?')`, userBaseId)
}
if isCanceled, ok := queryOptions["isCanceled"]; ok && isCanceled.(int32) != 3 {
query.Where("is_canceled = ?", isCanceled)
}
if companyId, ok := queryOptions["companyId"]; ok && companyId.(int64) != 0 {
query.Where("company->>'companyId' = '?'", companyId)
}
... ... @@ -265,7 +268,7 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
}
query.Where("is_canceled = ?", 1)
query.SetOrderDirect("cooperation_application_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
return 0, cooperationApplications, err
... ...