更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -8,14 +8,6 @@ import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// ERP 档案读取核心(两端共用)。
|
||||
//
|
||||
// 商品/分类/仓库/客商在 /backend/erp/** 与 /api/erp/** 各有独立 handler 与路由(接口隔离规范),
|
||||
// 但「按租户过滤 + 关键字命中字段 + 列表补库存与状态」的口径只能有一份实现,放在这里。
|
||||
// 返回值约定与 erp_*_core.go 一致:最后一个 string 为空表示成功,非空时配套 http 状态码。
|
||||
|
||||
// ---- 商品 ----
|
||||
|
||||
type erpProductFilter struct {
|
||||
Keyword string
|
||||
CategoryID uint64
|
||||
@@ -25,7 +17,6 @@ type erpProductFilter struct {
|
||||
OnlyEnabled bool
|
||||
}
|
||||
|
||||
// erpProductListCore 商品列表:出参已补分类名、全仓库存合计与预警状态。
|
||||
func erpProductListCore(a erpActor, f erpProductFilter, page, pageSize int) ([]models.ErpProduct, int64, int, string) {
|
||||
qs := models.Orm.QueryTable(new(models.ErpProduct)).
|
||||
Filter("tenant_id", a.Tid).Filter("delete_time__isnull", true)
|
||||
@@ -74,7 +65,6 @@ func erpProductListCore(a erpActor, f erpProductFilter, page, pageSize int) ([]m
|
||||
return list, total, 200, ""
|
||||
}
|
||||
|
||||
// erpProductDetailCore 商品详情:含分类名与分仓/分批次结存。
|
||||
func erpProductDetailCore(a erpActor, id uint64) (*models.ErpProduct, int, string) {
|
||||
if id == 0 {
|
||||
return nil, 400, "无效的ID"
|
||||
@@ -90,9 +80,6 @@ func erpProductDetailCore(a erpActor, id uint64) (*models.ErpProduct, int, strin
|
||||
return &p, 200, ""
|
||||
}
|
||||
|
||||
// ---- 商品分类 ----
|
||||
|
||||
// erpCategoryListCore 分类列表 + 树,并统计每个分类下的商品数。
|
||||
func erpCategoryListCore(a erpActor) ([]map[string]interface{}, []map[string]interface{}, int, string) {
|
||||
var list []models.ErpProductCategory
|
||||
_, _ = models.Orm.QueryTable(new(models.ErpProductCategory)).
|
||||
@@ -118,9 +105,6 @@ func erpCategoryListCore(a erpActor) ([]map[string]interface{}, []map[string]int
|
||||
return rows, erpCategoryTree(rows, 0), 200, ""
|
||||
}
|
||||
|
||||
// ---- 仓库 ----
|
||||
|
||||
// erpWarehouseListCore 仓库列表:每仓在库品种数与货值,列表直接反映仓库占用情况。
|
||||
func erpWarehouseListCore(a erpActor, keyword, status string, onlyEnabled bool) ([]map[string]interface{}, int, string) {
|
||||
qs := models.Orm.QueryTable(new(models.ErpWarehouse)).
|
||||
Filter("tenant_id", a.Tid).Filter("delete_time__isnull", true)
|
||||
@@ -172,10 +156,6 @@ func erpWarehouseListCore(a erpActor, keyword, status string, onlyEnabled bool)
|
||||
return rows, 200, ""
|
||||
}
|
||||
|
||||
// ---- 客商(供应商/客户统一出参)----
|
||||
|
||||
// erpPartnerRow 移动端开单/对账用的客商精简行:供应商与客户共用一套字段,
|
||||
// 前端按 partner_type 决定「应收/应付」口径,不必分别处理两张表。
|
||||
type erpPartnerRow struct {
|
||||
PartnerID uint64 `json:"partner_id"`
|
||||
PartnerType string `json:"partner_type"`
|
||||
@@ -188,7 +168,6 @@ type erpPartnerRow struct {
|
||||
OpenAmount float64 `json:"open_amount"`
|
||||
}
|
||||
|
||||
// erpPartnerListCore 客商列表(partner_type=supplier|customer),附带未结往来余额。
|
||||
func erpPartnerListCore(a erpActor, partnerType, keyword string, onlyEnabled bool, page, pageSize int) ([]erpPartnerRow, int64, int, string) {
|
||||
nameField := "customer_name"
|
||||
var qTable interface{} = new(models.TenantCrmCustomer)
|
||||
@@ -208,7 +187,6 @@ func erpPartnerListCore(a erpActor, partnerType, keyword string, onlyEnabled boo
|
||||
qs = qs.Filter("status", "1").Filter("is_draft", 0)
|
||||
}
|
||||
if partnerType == "customer" {
|
||||
// 公海客户没有归属,不参与开单
|
||||
qs = qs.Filter("in_pool", 0)
|
||||
}
|
||||
total, _ := qs.Count()
|
||||
@@ -276,7 +254,6 @@ func erpPartnerListCore(a erpActor, partnerType, keyword string, onlyEnabled boo
|
||||
return out, total, 200, ""
|
||||
}
|
||||
|
||||
// erpPartnerDetailCore 客商详情(按 partner_type 回原始档案,字段与 Web 端一致)。
|
||||
func erpPartnerDetailCore(a erpActor, partnerType string, id uint64) (interface{}, int, string) {
|
||||
if id == 0 {
|
||||
return nil, 400, "无效的ID"
|
||||
|
||||
Reference in new issue
Block a user