110 lines
4.7 KiB
Go
110 lines
4.7 KiB
Go
package syb
|
|||
|
|
|
||
|
|
// columnSpec 是货运单列表请求体里 columns 数组的一项:声明服务端
|
||
|
|
// 要返回哪一列。
|
||
|
|
//
|
||
|
|
// `[必须]` 完整照抄 raw_data/shunyunbaoerp_single.py 的 COLUMN_SPECS
|
||
|
|
// (72 项),不要自己删减——docs/admin/08-顺运宝接口.md §4.1 明确说
|
||
|
|
// "服务端可能依赖这批列做联表",删了不知道会不会漏别的字段。
|
||
|
|
type columnSpec struct {
|
||
|
|
TableName string
|
||
|
|
ColName string
|
||
|
|
FieldName string
|
||
|
|
HasAlias int
|
||
|
|
TableAlias string
|
||
|
|
}
|
||
|
|
|
||
|
|
// stockColumnSpecs 是货运单列表查询用到的 72 个列定义,
|
||
|
|
// 逐项抄自 raw_data/shunyunbaoerp_single.py 的 COLUMN_SPECS。
|
||
|
|
var stockColumnSpecs = []columnSpec{
|
||
|
|
{"t_stock", "created", "created", 0, "t"},
|
||
|
|
{"t_stock", "order_code", "orderCode", 0, "t"},
|
||
|
|
{"t_stock", "printer", "printer", 0, "t"},
|
||
|
|
{"t_stock", "weight_time", "weightTime", 0, "t"},
|
||
|
|
{"t_stock", "weight_inputer", "weightInputer", 0, "t"},
|
||
|
|
{"t_stock", "pkg_time", "pkgTime", 0, "t"},
|
||
|
|
{"t_stock", "code", "code", 0, "t"},
|
||
|
|
{"t_stock", "status", "status", 0, "t"},
|
||
|
|
{"t_stock", "order_status", "orderStatus", 0, "t"},
|
||
|
|
{"t_stock", "purchase_status", "purchaseStatus", 0, "t"},
|
||
|
|
{"t_stock", "exp_code", "expCode", 0, "t"},
|
||
|
|
{"t_stock", "exp_page_code", "expPageCode", 0, "t"},
|
||
|
|
{"t_stock", "exp_allow_print", "expAllowPrint", 0, "t"},
|
||
|
|
{"t_stock", "exp_page_status", "expPageStatus", 0, "t"},
|
||
|
|
{"t_stock", "page_id", "pageId", 0, "t"},
|
||
|
|
{"t_stock", "upload_time", "uploadTime", 0, "t"},
|
||
|
|
{"t_stock", "pay_time", "payTime", 0, "t"},
|
||
|
|
{"t_stock", "shop_day_to_ship", "shopDayToShip", 0, "t"},
|
||
|
|
{"t_stock", "remark9", "tsremark9", 1, "t"},
|
||
|
|
{"t_stock", "remark9", "remark9", 0, "t"},
|
||
|
|
{"t_stock", "detail_qty", "detailQty", 0, "t"},
|
||
|
|
{"t_stock", "order_qty", "orderQty", 0, "t"},
|
||
|
|
{"t_stock_detail", "inner_exp_code", "innerExpCode", 0, "t7"},
|
||
|
|
{"t_stock_detail", "shelf_code", "shelfCode", 0, "t7"},
|
||
|
|
{"t_stock", "shelf_code", "tsshelfCode", 1, "t"},
|
||
|
|
{"t_stock", "store_type", "storeType", 0, "t"},
|
||
|
|
{"t_stock", "order_bag_code", "orderBagCode", 0, "t"},
|
||
|
|
{"t_stock", "weight_cust_pkg", "weightCustPkg", 0, "t"},
|
||
|
|
{"t_stock", "weight_consign", "weightConsign", 0, "t"},
|
||
|
|
{"t_stock", "amt_order", "amtOrder", 0, "t"},
|
||
|
|
{"t_stock_append", "offline_amount", "offlineAmount", 0, "t8"},
|
||
|
|
{"t_stock_append", "escrow_amount", "escrowAmount", 0, "t8"},
|
||
|
|
{"t_stock", "exp_cod", "expCod", 0, "t"},
|
||
|
|
{"t_stock", "exp_company", "expCompany", 0, "t"},
|
||
|
|
{"t_stock", "transport", "transport", 0, "t"},
|
||
|
|
{"t_stock", "order_origin", "orderOrigin", 0, "t"},
|
||
|
|
{"t_stock", "exp_out_type", "expOutType", 0, "t"},
|
||
|
|
{"t_stock", "order_platform", "orderPlatform", 0, "t"},
|
||
|
|
{"t_stock", "exp_pkg_type", "expPkgType", 0, "t"},
|
||
|
|
{"t_stock", "exp_pkg_code", "expPkgCode", 0, "t"},
|
||
|
|
{"t_stock", "exp_batch", "expBatch", 0, "t"},
|
||
|
|
{"t_stock", "exp_ti_huo", "expTiHuo", 0, "t"},
|
||
|
|
{"t_stock", "print_time", "printTime", 0, "t"},
|
||
|
|
{"t_stock", "receiver", "receiver", 0, "t"},
|
||
|
|
{"t_stock", "receiver_tel", "receiverTel", 0, "t"},
|
||
|
|
{"t_stock", "receiver_addr", "receiverAddr", 0, "t"},
|
||
|
|
{"t_stock", "receiver_shop_name", "receiverShopName", 0, "t"},
|
||
|
|
{"t_stock", "receiver_shop_code", "receiverShopCode", 0, "t"},
|
||
|
|
{"t_stock", "product_name", "productName", 0, "t"},
|
||
|
|
{"t_stock", "is_cancel", "isCancel", 0, "t"},
|
||
|
|
{"t_stock", "err_msg", "errMsg", 0, "t"},
|
||
|
|
{"t_stock", "remark2", "remark2", 0, "t"},
|
||
|
|
{"t_stock", "remark1", "remark1", 0, "t"},
|
||
|
|
{"t_stock", "note", "note", 0, "t"},
|
||
|
|
{"t_store", "name", "name", 0, "t1"},
|
||
|
|
{"sys_user", "fullname", "sufullname", 1, "t3"},
|
||
|
|
{"sys_user", "dept_label_path", "deptLabelPath", 0, "t3"},
|
||
|
|
{"t_stock", "shop_name", "shopName", 0, "t"},
|
||
|
|
{"t_shop", "shop_id", "shopId", 0, "t6"},
|
||
|
|
{"t_stock", "remark4", "remark4", 0, "t"},
|
||
|
|
{"t_stock", "remark7", "remark7", 0, "t"},
|
||
|
|
{"t_stock", "package_time", "packageTime", 0, "t"},
|
||
|
|
{"t_stock", "packer", "packer", 0, "t"},
|
||
|
|
{"t_stock", "pack_type", "packType", 0, "t"},
|
||
|
|
{"t_stock", "track_status", "trackStatus", 0, "t"},
|
||
|
|
{"t_stock", "track_desc", "trackDesc", 0, "t"},
|
||
|
|
{"t_stock", "err_status", "errStatus", 0, "t"},
|
||
|
|
{"t_stock", "err_time", "errTime", 0, "t"},
|
||
|
|
{"t_stock", "err_msg", "tserrMsg", 1, "t"},
|
||
|
|
{"t_stock", "remark2", "tsremark2", 1, "t"},
|
||
|
|
{"t_stock", "remark1", "tsremark1", 1, "t"},
|
||
|
|
{"t_stock", "product_volume_str", "productVolumeStr", 0, "t"},
|
||
|
|
}
|
||
|
|
|
||
|
|
// columnsPayload 把 stockColumnSpecs 转成请求体要的 JSON 形状:
|
||
|
|
//
|
||
|
|
// {"tableName":"t_stock","colName":"created","fieldName":"created","hasAlias":0,"tableAlias":"t"}
|
||
|
|
func columnsPayload() []map[string]any {
|
||
|
|
out := make([]map[string]any, 0, len(stockColumnSpecs))
|
||
|
|
for _, c := range stockColumnSpecs {
|
||
|
|
out = append(out, map[string]any{
|
||
|
|
"tableName": c.TableName,
|
||
|
|
"colName": c.ColName,
|
||
|
|
"fieldName": c.FieldName,
|
||
|
|
"hasAlias": c.HasAlias,
|
||
|
|
"tableAlias": c.TableAlias,
|
||
|
|
})
|
||
|
|
}
|
||
|
|
return out
|
||
|
|
}
|