This commit is contained in:
hero920103 committed 2026-10-19 01:13:17 +08:00
1 parent 5718a00e31
commit 1850ac640e
226 files changed
+37772 -12071

No files matched your search

+61 -30
View File
@@ -11,6 +11,7 @@ import (
beego "github.com/beego/beego/v2/server/web"
"github.com/beego/beego/v2/client/orm"
"server/pkg/identity"
)
// =============================================================
@@ -45,7 +46,8 @@ type tenderAnnouncePayload struct {
func (c *BackendCrmBiddingTenderAnnounceController) List() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
tenderID, _ := c.GetInt64("tender_id")
@@ -67,7 +69,8 @@ func (c *BackendCrmBiddingTenderAnnounceController) List() {
func (c *BackendCrmBiddingTenderAnnounceController) Create() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
raw, _ := io.ReadAll(c.Ctx.Request.Body)
@@ -107,7 +110,8 @@ func (c *BackendCrmBiddingTenderAnnounceController) Create() {
func (c *BackendCrmBiddingTenderAnnounceController) Publish() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -152,7 +156,8 @@ func (c *BackendCrmBiddingTenderAnnounceController) Publish() {
func (c *BackendCrmBiddingTenderAnnounceController) Delete() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -194,7 +199,8 @@ type tenderSupplierPayload struct {
func (c *BackendCrmBiddingTenderSupplierController) List() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
tenderID, _ := c.GetInt64("tender_id")
@@ -216,7 +222,8 @@ func (c *BackendCrmBiddingTenderSupplierController) List() {
func (c *BackendCrmBiddingTenderSupplierController) Create() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
raw, _ := io.ReadAll(c.Ctx.Request.Body)
@@ -260,7 +267,8 @@ func (c *BackendCrmBiddingTenderSupplierController) Create() {
func (c *BackendCrmBiddingTenderSupplierController) Update() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -305,7 +313,8 @@ func (c *BackendCrmBiddingTenderSupplierController) Update() {
func (c *BackendCrmBiddingTenderSupplierController) Delete() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -369,7 +378,8 @@ func calcTotalScore(p tenderEvaluationPayload) float64 {
func (c *BackendCrmBiddingTenderEvaluationController) List() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
tenderID, _ := c.GetInt64("tender_id")
@@ -391,7 +401,8 @@ func (c *BackendCrmBiddingTenderEvaluationController) List() {
func (c *BackendCrmBiddingTenderEvaluationController) Create() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
raw, _ := io.ReadAll(c.Ctx.Request.Body)
@@ -455,7 +466,8 @@ func resortEvaluationRanking(tenderID uint64, tenantID string) {
func (c *BackendCrmBiddingTenderEvaluationController) Delete() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -483,7 +495,8 @@ type BackendCrmBiddingTenderResultController struct {
func (c *BackendCrmBiddingTenderResultController) List() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
tenderID, _ := c.GetInt64("tender_id")
@@ -505,7 +518,8 @@ func (c *BackendCrmBiddingTenderResultController) List() {
func (c *BackendCrmBiddingTenderResultController) Detail() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -540,7 +554,8 @@ type bidApprovalPayload struct {
func (c *BackendCrmBiddingBidApprovalController) List() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
bidID, _ := c.GetInt64("bid_id")
@@ -562,7 +577,8 @@ func (c *BackendCrmBiddingBidApprovalController) List() {
func (c *BackendCrmBiddingBidApprovalController) Create() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
raw, _ := io.ReadAll(c.Ctx.Request.Body)
@@ -616,7 +632,8 @@ func (c *BackendCrmBiddingBidApprovalController) Create() {
func (c *BackendCrmBiddingBidApprovalController) Approve() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -688,7 +705,8 @@ type bidDocumentPayload struct {
func (c *BackendCrmBiddingBidDocumentController) List() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
bidID, _ := c.GetInt64("bid_id")
@@ -710,7 +728,8 @@ func (c *BackendCrmBiddingBidDocumentController) List() {
func (c *BackendCrmBiddingBidDocumentController) Create() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
raw, _ := io.ReadAll(c.Ctx.Request.Body)
@@ -751,7 +770,8 @@ func (c *BackendCrmBiddingBidDocumentController) Create() {
func (c *BackendCrmBiddingBidDocumentController) Update() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -797,7 +817,8 @@ func (c *BackendCrmBiddingBidDocumentController) Update() {
func (c *BackendCrmBiddingBidDocumentController) Delete() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -835,7 +856,8 @@ type bidTemplatePayload struct {
func (c *BackendCrmBiddingBidTemplateController) List() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
keyword := strings.TrimSpace(c.GetString("keyword"))
@@ -869,7 +891,8 @@ func (c *BackendCrmBiddingBidTemplateController) List() {
func (c *BackendCrmBiddingBidTemplateController) Create() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
raw, _ := io.ReadAll(c.Ctx.Request.Body)
@@ -910,7 +933,8 @@ func (c *BackendCrmBiddingBidTemplateController) Create() {
func (c *BackendCrmBiddingBidTemplateController) Update() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -950,7 +974,8 @@ func (c *BackendCrmBiddingBidTemplateController) Update() {
func (c *BackendCrmBiddingBidTemplateController) Delete() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -994,7 +1019,8 @@ type bidQualificationPayload struct {
func (c *BackendCrmBiddingBidQualificationController) List() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
keyword := strings.TrimSpace(c.GetString("keyword"))
@@ -1049,7 +1075,8 @@ func (c *BackendCrmBiddingBidQualificationController) List() {
func (c *BackendCrmBiddingBidQualificationController) Create() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
raw, _ := io.ReadAll(c.Ctx.Request.Body)
@@ -1095,7 +1122,8 @@ func (c *BackendCrmBiddingBidQualificationController) Create() {
func (c *BackendCrmBiddingBidQualificationController) Update() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -1146,7 +1174,8 @@ func (c *BackendCrmBiddingBidQualificationController) Update() {
func (c *BackendCrmBiddingBidQualificationController) Delete() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
id, _ := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
@@ -1200,7 +1229,8 @@ func sumField(table, field, tenantID string) float64 {
func (c *BackendCrmBiddingStatisticsController) Tender() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
tid := pipelineTenantID(claims)
@@ -1223,7 +1253,8 @@ func (c *BackendCrmBiddingStatisticsController) Tender() {
func (c *BackendCrmBiddingStatisticsController) Bid() {
claims, err := pipelineClaims(&c.Controller)
if err != nil {
pipelineErr(&c.Controller, 401, 401, err.Error())
code := identity.Status(err)
pipelineErr(&c.Controller, code, code, err.Error())
return
}
tid := pipelineTenantID(claims)