1
This commit is contained in:
@@ -72,6 +72,14 @@ const (
|
||||
AlarmFee = 1500 // 配送费报警阈值
|
||||
)
|
||||
|
||||
const (
|
||||
InvoiceStatusInit = "1" // INIT-初始化,未受理
|
||||
InvoiceStatusFailUre = "2" // APPLY_FAILURE-申请受理失败
|
||||
InvoiceStatusBilling = "3" // 开具中
|
||||
InvoiceStatusBillingSuccess = "4" // 开具成功
|
||||
InvoiceStatusBillingFail = "5" // 开具失败
|
||||
)
|
||||
|
||||
type VendorInfo struct {
|
||||
Name string `json:"name"`
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
@@ -9,12 +10,12 @@ import (
|
||||
|
||||
func GetInvoiceInfo(db *DaoDB, vendorOrderId string) (*model.InvoiceMsg, error) {
|
||||
data := &model.InvoiceMsg{}
|
||||
sql := ` SELECT * FROM invoice_msg WHERE order_id = ? `
|
||||
err := GetRow(db, data, sql, []interface{}{vendorOrderId}...)
|
||||
sql := ` SELECT * FROM invoice_msg WHERE order_id = ? OR remark LIKE ?`
|
||||
err := GetRow(db, data, sql, []interface{}{vendorOrderId, "%" + fmt.Sprintf("%s", vendorOrderId) + "%"}...)
|
||||
return data, err
|
||||
}
|
||||
|
||||
func GetStoreInvoiceList(storeID int, startTime, endTime time.Time, status string, offset, pageSize int) (info *model.PagedInfo, err error) {
|
||||
func GetStoreInvoiceList(storeID, vendorId int, startTime, endTime time.Time, status string, offset, pageSize int) (info *model.PagedInfo, err error) {
|
||||
parameter := []interface{}{}
|
||||
sql := ` SELECT * FROM invoice_msg WHERE 1=1 `
|
||||
if storeID != 0 {
|
||||
@@ -29,6 +30,10 @@ func GetStoreInvoiceList(storeID int, startTime, endTime time.Time, status strin
|
||||
sql += ` AND created_at <= ? `
|
||||
parameter = append(parameter, endTime)
|
||||
}
|
||||
if vendorId != 0 {
|
||||
sql += ` AND vendor_id = ? `
|
||||
parameter = append(parameter, vendorId)
|
||||
}
|
||||
if status != "" {
|
||||
switch status {
|
||||
case "1": // 未回复
|
||||
@@ -53,3 +58,24 @@ func GetStoreInvoiceList(storeID int, startTime, endTime time.Time, status strin
|
||||
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func GetInvoiceInfoByTaskId(db *DaoDB, taskId string) (*model.InvoiceMsg, error) {
|
||||
data := &model.InvoiceMsg{}
|
||||
sql := ` SELECT * FROM invoice_msg WHERE invoice_task_id = ?`
|
||||
err := GetRow(db, data, sql, []interface{}{taskId}...)
|
||||
return data, err
|
||||
}
|
||||
|
||||
func GetInvoiceByStoreId(db *DaoDB, storeId, vendorId int) ([]*model.InvoiceMsg, error) {
|
||||
param := []interface{}{}
|
||||
data := make([]*model.InvoiceMsg, 0, 0)
|
||||
sql := ` SELECT * FROM invoice_msg WHERE store_id = ? `
|
||||
param = append(param, storeId)
|
||||
if vendorId != 0 {
|
||||
sql += ` AND vendor_id = ?`
|
||||
param = append(param, vendorId)
|
||||
|
||||
}
|
||||
err := GetRows(db, data, sql, param...)
|
||||
return data, err
|
||||
}
|
||||
|
||||
@@ -131,6 +131,7 @@ type StoreSkuSyncInfo struct {
|
||||
QuaPictures string // 资质图片
|
||||
QuaEffectiveDate int64 // 资质有效期
|
||||
QuaApprovalDate int64 // 批准日期
|
||||
SpecialPictures string // 商品扩展规则(营业成分)
|
||||
|
||||
VendorVendorCatID int64 `orm:"column(vendor_vendor_cat_id)"` // 平台商品分类(叶子结点)
|
||||
CategoryName string `json:"categoryName"` //分类名
|
||||
@@ -591,7 +592,7 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty boo
|
||||
%s vendor_sku_id, t1.%s_sync_status sku_sync_status, t1.%s_price vendor_price, t1.%s_lock_time lock_time,t1.vendor_son_sku_id,t1.vendor_sku_attr_id,t1.vendor_main_id,
|
||||
t1.store_id, t1.deleted_at bind_deleted_at,t1.status_sale_begin,t1.status_sale_end, t1.jds_ware_id, t1.stock, t1.mt_ladder_box_price,t1.location_code,
|
||||
t2.*,
|
||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.category_id name_category_id, t3.yb_name_suffix,t3.tiktok_attribute,t3.mt_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,
|
||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.category_id name_category_id, t3.yb_name_suffix,t3.tiktok_attribute,t3.mt_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,t3.special_pictures,
|
||||
t3.sell_point,t3.sell_point_times,t3.jds_stock_switch, t3.preparation_time, t3.img_watermark, t3.ex_vendor_id, t3.img img_origin,t3.upc_brand_name,t3.upc_tiktok_brand_id,
|
||||
IF(t11.%s <> '', t11.%s, t3.img) img,
|
||||
IF(t12.%s <> '', t12.%s, t3.img2) img2,
|
||||
@@ -722,7 +723,7 @@ func GetFullStoreSkus(db *DaoDB, vendorID, storeID int) (skus []*StoreSkuSyncInf
|
||||
t1.store_id, t1.deleted_at bind_deleted_at, t1.stock,t1.location_code,
|
||||
t2.*, t2.id sku_id, t2m.vendor_thing_id vendor_sku_id,
|
||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.ex_prefix, t3.ex_prefix_begin, t3.ex_prefix_end, t3.category_id name_category_id,t3.tiktok_attribute,
|
||||
t3.mt_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,t3.sell_point,t3.sell_point_times,t3.upc_brand_name,t3.upc_tiktok_brand_id,
|
||||
t3.mt_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,t3.special_pictures,t3.sell_point,t3.sell_point_times,t3.upc_brand_name,t3.upc_tiktok_brand_id,
|
||||
IF(t11.%s <> '', t11.%s, t3.img) img,
|
||||
IF(t12.%s <> '', t12.%s, t3.img2) img2,
|
||||
IF(t13.%s <> '', t13.%s, t3.desc_img) desc_img,
|
||||
|
||||
@@ -6,6 +6,7 @@ type InvoiceMsg struct {
|
||||
StoreID int `orm:"column(store_id)" json:"storeID"` // 外部系统里记录的 jxstoreid
|
||||
VendorID int `orm:"column(vendor_id);size(2)" json:"vendorID"` // 平台ID
|
||||
InvoiceTaskId string `orm:"column(invoice_task_id);size(64)" json:"invoiceTaskId"` // 任务ID
|
||||
Status string `orm:"column(status);size(8)" json:"status"` // 发票状态 INIT-初始化,未受理 1 APPLY_FAILURE-申请受理失败 2 BILLING-开具中 3 BILLING_SUCCESS-开具成功 4 BILLING_FAILURE- 开具失败 5
|
||||
PushType int `orm:"column(push_type);size(2)" json:"pushType"` // 消息类型,1-开发票,3-催发票
|
||||
InvoiceTitle string `orm:"column(invoice_title);size(256)" json:"invoiceTitle"` // 发票抬头,为用户填写的开发票的抬头。
|
||||
TaxpayerId string `orm:"column(taxpayer_id);size(32)" json:"taxpayerId"` // 纳税人识别号
|
||||
@@ -18,6 +19,7 @@ type InvoiceMsg struct {
|
||||
InvoiceAmount int64 `orm:"column(invoice_amount);size(16)" json:"invoiceAmount"` // 商家开票金额,单位分
|
||||
InvoiceUrl string `orm:"column(invoice_url);size(512)" json:"invoiceUrl"` // 发票文件链接
|
||||
InvoiceId string `orm:"column(invoice_id);size(32)" json:"invoiceId"` // 发票号码
|
||||
Remark string `orm:"column(remark);size(512)" json:"remark"` // 备注
|
||||
}
|
||||
|
||||
func (o *InvoiceMsg) TableUnique() [][]string {
|
||||
@@ -27,5 +29,6 @@ func (o *InvoiceMsg) TableIndex() [][]string {
|
||||
return [][]string{
|
||||
[]string{"CreatedAt", "StoreID"},
|
||||
[]string{"OrderId"},
|
||||
[]string{"InvoiceTaskId"},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,6 +196,7 @@ type SkuName struct {
|
||||
QuaPictures string `orm:"column(qua_pictures);size(512)" json:"quaPictures"` // 商品资质图片,非必填,医疗器械必须传,保健食品、特殊医学配方食品建议传
|
||||
QuaEffectiveDate int64 `orm:"column(qua_effective_date)" json:"quaEffectiveDate"` // 商品资质有效期,传10位秒级的时间戳。-1:永久有效。
|
||||
QuaApprovalDate int64 `orm:"column(qua_approval_date)" json:"quaApprovalDate"` // 批准日期,格式为10位秒级的时间戳。
|
||||
SpecialPictures string `orm:"column(special_pictures);type(text)" json:"specialPictures"` // 批准日期,格式为10位秒级的时间戳。
|
||||
}
|
||||
|
||||
func (*SkuName) TableUnique() [][]string {
|
||||
|
||||
Reference in New Issue
Block a user