Merge branch 'master' of git.oa00.com:supply-chain/service

finance
杨赟 2 years ago
commit b37970138a

@ -12,7 +12,7 @@ type ArgsSupplyApply struct {
ApplyUserId uint // 申请人id
CustomerId uint // 客户id
RateId uint // 费率id
ExpirationAt int64 // 到期时间
ExpirationAt string // 到期时间
Enclosure string // 附件
}

@ -46,6 +46,7 @@ func (i *item) Del(ctx context.Context, args ArgsSkuItemDel) error {
type ArgsSkuItemLists struct {
SkuTypeId uint
SkuId uint
Page bean.Page
}
@ -68,3 +69,13 @@ func (i *item) Lists(ctx context.Context, args ArgsSkuItemLists) (reply ReplySku
err = xClient.Call(ctx, "Lists", args, &reply)
return
}
// DelAll @Title 删除全部商品
func (i *item) DelAll(ctx context.Context, skuTypeId uint) error {
xClient, err := client.GetClient(i)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "DelAll", skuTypeId, &reply)
}

@ -15,7 +15,7 @@ type SaleHandleItem struct {
}
// Add @Title 添加
func (s *sale) Add(ctx context.Context, skuIds []uint) (reply []SaleSkuItem, err error) {
func (s *sale) Add(ctx context.Context, skuIds []uint) (reply []SaleHandleItem, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return nil, err
@ -24,13 +24,18 @@ func (s *sale) Add(ctx context.Context, skuIds []uint) (reply []SaleSkuItem, err
return
}
type ArgsSaleLists struct {
SkuId uint
Page bean.Page
}
// Lists @Title 商品列表
func (s *sale) Lists(ctx context.Context, page bean.Page) (reply ReplySaleSkuItemLists, err error) {
func (s *sale) Lists(ctx context.Context, args ArgsSaleLists) (reply ReplySaleSkuItemLists, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return ReplySaleSkuItemLists{}, err
}
err = xClient.Call(ctx, "Lists", page, &reply)
err = xClient.Call(ctx, "Lists", args, &reply)
return
}
@ -74,3 +79,14 @@ func (s *sale) GetImg(ctx context.Context) (reply string, err error) {
err = xClient.Call(ctx, "GetImg", args, &reply)
return
}
// DelAll @Title 删除全部商品
func (s *sale) DelAll(ctx context.Context) error {
xClient, err := client.GetClient(s)
if err != nil {
return err
}
args := 0
reply := 0
return xClient.Call(ctx, "DelAll", args, &reply)
}

@ -31,6 +31,7 @@ type UserItem struct {
Id uint `json:"id"`
Name string `json:"name"`
Account string `json:"account"`
RateId uint `json:"rateId"`
Liaison string `json:"liaison"`
Phone string `json:"phone"`
Amount decimal.Decimal `json:"amount"`

@ -13,6 +13,7 @@ type walletType uint // 费用类型
const (
WalletTypeIncome walletType = 1 // 收入
WalletTypeExpend walletType = 2 // 支出
WalletTypeBack walletType = 3 // 退款
WalletStatusHandle = 1 // 处理中
WalletStatusSuccess = 2 // 成功

@ -11,9 +11,13 @@ type goods struct {
}
type GoodsSearch struct {
Name string // 商品名称
CategoryId uint64 // 类目id
CategoryIds []uint // 类目id
BrandName string // 品牌名
UpcCode string // 商品条码
Handle uint // 处理状态 1=待处理 2=入库 3=废弃
SkuId uint // 供应商skuId
MinSupplyPrice decimal.Decimal // 最小采购价
MaxSupplyPrice decimal.Decimal // 最大采购价
}
type ArgsGoodsList struct {
Search GoodsSearch
@ -29,8 +33,10 @@ type GoodsItem struct {
BrandId uint `json:"brandId"`
BrandName string `json:"brandName"`
SkuItems []GoodsItemLists `json:"skuItems"`
UpcCodes []string `json:"upcCodes"`
StockCount uint `json:"stockCount"`
MinPrice decimal.Decimal `json:"minPrice"`
GuidePrices []decimal.Decimal `json:"guidePrices"`
SupplyPrices []decimal.Decimal `json:"supplyPrices"`
CreatedAt int64 `json:"createdAt"`
}
@ -41,6 +47,7 @@ type GoodsItemLists struct {
SupplyPrice decimal.Decimal `json:"supplyPrice"`
GoodsId uint `json:"goodsId"`
Img string `json:"img"`
UpcCode string `json:"upcCode"`
}
type GoodsSpecificationItem struct {
@ -110,6 +117,7 @@ type SkuItem struct {
TaxCode string `json:"taxCode"`
Unit string `json:"uint"`
Tax decimal.Decimal `json:"tax"`
Img string `json:"img"`
}
// Info @Title 商品详情
@ -168,3 +176,19 @@ func (g *goods) ReHandle(ctx context.Context, goodsIds []uint) (reply []AdoptIte
err = xClient.Call(ctx, "ReHandle", goodsIds, &reply)
return
}
type ReplyByIdItem struct {
SkuId uint `json:"skuId"`
SupplierId uint `json:"supplierIds"`
SupplierName string `json:"supplierName"`
}
// FindBySkuIds @Title 根据商品Ids获取商品信息
func (g *goods) FindBySkuIds(ctx context.Context, skuIds []uint) (reply []ReplyByIdItem, err error) {
xClient, err := client.GetClient(g)
if err != nil {
return nil, err
}
err = xClient.Call(ctx, "FindBySkuIds", skuIds, &reply)
return
}

@ -151,3 +151,18 @@ func (s *supplier) UpdateWarn(ctx context.Context, args ArgsSupplierUpdateWarn)
reply := 0
return xClient.Call(ctx, "UpdateWarn", args, &reply)
}
type ReplySupplierItem struct {
Id uint `json:"id"`
Name string `json:"name"`
}
// Select @Title 筛选非禁用的供应商
func (s *supplier) Select(ctx context.Context, status uint) (reply []ReplySupplierItem, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return nil, err
}
err = xClient.Call(ctx, "Select", status, &reply)
return
}

@ -4,6 +4,7 @@ import (
"context"
"git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
"github.com/shopspring/decimal"
)
const (
@ -29,6 +30,7 @@ type RetailHistorySearch struct {
}
type RetailHistoryItem struct {
Id uint `json:"id"`
AfterServiceSn uint64 `json:"afterServiceSn"`
OrderSn uint64 `json:"orderSn"`
Name string `json:"name"`
@ -55,3 +57,103 @@ func (a *afterService) RetailAfsHistory(ctx context.Context, args ArgsRetailHist
err = xClient.Call(ctx, "RetailAfsHistory", args, &reply)
return
}
type ArgsAfterServiceDeliver struct {
SourceAfsSn string `json:"sourceAfsSn"`
SourceSkuId string `json:"sourceSkuId"`
SourceOrderSN string `json:"sourceOrderSN"`
}
// Deliver @Title 需要发货
func (a *afterService) Deliver(ctx context.Context, args ArgsAfterServiceDeliver) (err error) {
xClient, err := client.GetClient(a)
if err != nil {
return err
}
reply := 0
err = xClient.Call(ctx, "Deliver", args, &reply)
return
}
type ArgsAfterServiceReceipt struct {
SourceAfsSn string `json:"sourceAfsSn"`
SourceSkuId string `json:"sourceSkuId"`
SourceOrderSN string `json:"sourceOrderSN"`
}
// Receipt @Title 收货处理
func (a *afterService) Receipt(ctx context.Context, args ArgsAfterServiceReceipt) (err error) {
xClient, err := client.GetClient(a)
if err != nil {
return err
}
reply := 0
err = xClient.Call(ctx, "Receipt", args, &reply)
return
}
type ArgsAfterServiceReject struct {
SourceAfsSn string `json:"sourceAfsSn"`
SourceSkuId string `json:"sourceSkuId"`
SourceOrderSN string `json:"sourceOrderSN"`
}
// Reject @Title 驳回
func (a *afterService) Reject(ctx context.Context, args ArgsAfterServiceReject) (err error) {
xClient, err := client.GetClient(a)
if err != nil {
return err
}
reply := 0
err = xClient.Call(ctx, "Reject", args, &reply)
return
}
type ReplyAfterServiceDetail struct {
Id uint `json:"id"`
AfsSn string `json:"afsSn"`
Status uint `json:"status"`
Result string `json:"result"`
CreatedAt int64 `json:"createdAt"`
UpdatedAt int64 `json:"updatedAt"`
SkuName string `json:"skuName"`
ImgUrl string `json:"imgUrl"`
SkuId uint `json:"skuId"`
SupplySkuId uint `json:"supplySkuId"`
Price decimal.Decimal `json:"price"`
SupplyPrice decimal.Decimal `json:"supplyPrice"`
Quantity uint `json:"quantity"`
HopeTypeName string `json:"hopeTypeName"`
TypeReasonName string `json:"typeReasonName"`
Imgs []string `json:"imgs"`
LogisticsCompany string `json:"logisticsCompany"`
WaybillCode string `json:"waybillCode"`
SendAt int64 `json:"sendAt"`
}
// Detail @Title 售后详情
func (a *afterService) Detail(ctx context.Context, afsSn string) (reply ReplyAfterServiceDetail, err error) {
xClient, err := client.GetClient(a)
if err != nil {
return
}
err = xClient.Call(ctx, "Detail", afsSn, &reply)
return
}
type ReplyAfterServiceLogisticsAddress struct {
Name string `json:"name"` // 姓名
Mobile string `json:"mobile"` // 手机号
ZipCode string `json:"zipCode"` // 邮编
Address string `json:"address"` // 地址
}
// LogisticsAddress @Title 寄回地址
func (a *afterService) LogisticsAddress(ctx context.Context, afsSn string) (reply ReplyAfterServiceLogisticsAddress, err error) {
xClient, err := client.GetClient(a)
if err != nil {
return
}
err = xClient.Call(ctx, "LogisticsAddress", afsSn, &reply)
return
}

@ -195,6 +195,9 @@ type ReplyAfterServiceDetail struct {
HopeTypeName string `json:"hopeTypeName"`
TypeReasonName string `json:"typeReasonName"`
Imgs []string `json:"imgs"`
LogisticsCompany string `json:"logisticsCompany"`
WaybillCode string `json:"waybillCode"`
SendAt int64 `json:"sendAt"`
}
// Detail @Title 售后详情

@ -4,4 +4,5 @@ type Channel struct {
Sku sku
Order order
AfterService afterService
Mq mq
}

@ -9,21 +9,52 @@ import (
const (
MqSubscribeNameSkuPriceChange = "sku_price_change" // sku价格变动
MqSubscribeNameSkuChange = "sku_change" // sku信息变动
MqSubscribeNameOrderSplit = "order_split" // 订单拆单
MqSubscribeNameOrderStockOut = "order_stock_out" // 订单出库
MqSubscribeNameOrderFinish = "order_finish" // 订单完成
MqSubscribeNameOrderCancel = "order_cancel" // 订单取消
)
type mq struct {
}
type ArgsMqSubscribe struct {
Name string // 队列名称
AppKey string // 队列名称
}
// Subscribe @Title 订阅mq
func (m *mq) Subscribe(ctx context.Context, channelId string, args ArgsMqSubscribe) (err error) {
func (m *mq) Subscribe(ctx context.Context, channelId string, args ArgsMqSubscribe) (key string, err error) {
xClient, err := client.GetClient(m)
if err != nil {
return
}
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Subscribe", args, &key)
return
}
// SubscribeCancel @Title 订阅取消
func (m *mq) SubscribeCancel(ctx context.Context, channelId string, args ArgsMqSubscribe) (err error) {
reply := 0
xClient, err := client.GetClient(m)
if err != nil {
return
}
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "SubscribeCancel", args, &reply)
return
}
type ArgsMqUser struct {
AppKey string
AppSecret string
}
// User @Title Mq用户
func (m *mq) User(ctx context.Context, channelId string, args ArgsMqUser) (err error) {
reply := 0
xClient, err := client.GetClient(m)
if err != nil {
return
}
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Subscribe", args, &reply)
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "User", args, &reply)
return
}

@ -137,6 +137,7 @@ func (o *order) Cancel(ctx context.Context, channelId string, args ArgsOrderChan
}
type OrderListsSearch struct {
SkuName string // 商品名称
Status []uint // 订单状态
CancelStatus uint // 订单取消状态
OrderSn string // 订单编号
@ -165,6 +166,7 @@ type OrderItem struct {
Status uint `json:"status"`
CancelStatus uint `json:"cancelStatus"`
CreatedAt int64 `json:"createdAt"`
CloseAt int64 `json:"closeAt"`
Skus []OrderSku `json:"skus"`
Packages []OrderPackage `json:"packages"`
}

@ -64,6 +64,7 @@ func (s *sku) Lists(ctx context.Context, channelId string, args ArgsSkuList) (re
}
type SkuEsSearch struct {
SkuIds []uint // 商品SkuIds
Status uint // 1=上架 2=下架
SkuName string // 商品名称
BrandId uint // 品牌id

@ -122,13 +122,12 @@ type RetailOrderItem struct {
SourceName string `json:"sourceName"`
CustomerName string `json:"customerName"`
OrderStatus uint `json:"orderStatus"`
LogisticsName string `json:"logisticsName"`
WaybillCode string `json:"waybillCode"`
OrderFee decimal.Decimal `json:"orderFee"`
FreightFee decimal.Decimal `json:"freightFee"`
SupplyOrderFee decimal.Decimal `json:"supplyOrderFee"`
PayTime int64 `json:"payTime"`
FinishAt int64 `json:"finishAt"`
CloseAt int64 `json:"closeAt"`
}
type ReplyRetailOrderLists struct {

@ -109,12 +109,14 @@ type ArgsSkuLists struct {
}
type SkuListsSearch struct {
Id uint // 瑞库客id
Name string // 商品名称
SourceId uint // 所属供应商 1=京东
Id uint // 瑞库客id
SourceSkuId uint // 供应商skuId
BrandId uint // 品牌Id
ThridCategoryId uint // 三级分类Id
FirstCategoryId uint // 一级分类Id
SecondCategoryId uint // 二级分类Id
ThirdCategoryId uint // 三级分类Id
AdjustType uint // 加价规则
MaxSupplyPrice decimal.Decimal // 最大采购价格
MinSupplyPrice decimal.Decimal // 最小采购价格
@ -141,15 +143,21 @@ type SkuItem struct {
GuidePrice decimal.Decimal `json:"guidePrice"` // 指导价
ImgUrl string `json:"imgUrl"` // 商品主图
PlatformStatus uint `json:"platformStatus"` // 平台状态 1=上架 2=下架
SourceId uint `json:"sourceId"` // 所属供应商
SourceName string `json:"sourceName"` // 供应商名称
SourceSkuId string `json:"sourceSkuId"` // 源skuId
SourceStatus uint `json:"sourceStatus"` // 供应商状态 1=上架 2=下架
CustomerPrice decimal.Decimal `json:"customerPrice"` // 供货最高价
CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` // 供货利润率 供货利润/供货最高价%
CustomerDiscount decimal.Decimal `json:"customerDiscount"` // 折扣
AdjustType uint `json:"adjustType"` // 加价类型
AdjustPrice decimal.Decimal `json:"adjustPrice"` // 加价金额
AfterAdjustType uint `json:"afterAdjustType"` // 改价后加价类型
AfterAdjustPrice decimal.Decimal `json:"afterAdjustPrice"` // 改价后加价金额
AfterPrice decimal.Decimal `json:"afterPrice"` // 改价后金额
AfterDiscount decimal.Decimal `json:"afterDiscount"` // 改价后折扣
AdjustAuditStatus uint `json:"adjustAuditStatus"` // 改价审核状态
Reason string // 改价驳回原因
}
// Lists @Title 商品列表
@ -163,8 +171,12 @@ func (s *sku) Lists(ctx context.Context, args ArgsSkuLists) (reply ReplySkuList,
}
type SkuEsSearch struct {
SourceId uint // 所属供应商
SourceSonId uint // 沙马供应商的供应商Id
SourceSkuId uint // 供应商SkuId
SourceStatus uint // 供应商上下架状态 1=上架 2=下架
PlatformStatus uint // 平台上下架状态 1=上架 2=下架
AuditStatus uint // 改价审核状态 1=待审核 2=通过 3=驳回
SkuId uint // Sku编码
SupplySkuId uint // 供应商Sku编码
SkuName string // 商品名称
@ -177,10 +189,13 @@ type SkuEsSearch struct {
ThirdCategoryId uint // 三级分类id
ThirdCategoryName string // 三级分类名称 全词匹配
AdjustType uint // 加价规则 1=比例 2=金额
Handel uint // 处理状态
MaxSupplyPrice decimal.Decimal // 最高金额
MinSupplyPrice decimal.Decimal // 最低金额
MinDiscount decimal.Decimal // 最低折扣
MaxDiscount decimal.Decimal // 最高折扣
AdjustMinDiscount decimal.Decimal // 改价后最小折扣
AdjustMaxDiscount decimal.Decimal // 改价后最大折扣
}
type ArgsSkuListsEs struct {
Search SkuEsSearch

@ -2,11 +2,9 @@ package supply
import (
"context"
"database/sql"
"git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
"github.com/shopspring/decimal"
"time"
)
type skuAudit struct {
@ -22,28 +20,41 @@ type SkuAuditSearch struct {
AdjustType uint // 加价类型
Status uint // 状态 1=未审核 2=通过 3=驳回
}
type ArgsSkuAuditEsLists struct {
Search SkuAuditEsSearch
Page bean.Page
}
type SkuAuditEsSearch struct {
SourceId uint // 供应商id
SourceSonId uint // 沙马供应商的供应商
AdjustType uint // 加价类型
Status uint // 状态 1=未审核 2=通过 3=驳回
AfterMinDiscount decimal.Decimal // 加价后最低折扣
AfterMaxDiscount decimal.Decimal // 加价后最高折扣
}
type SkuAndAuditItem struct {
AuditId uint `json:"auditId"`
Id uint `json:"id"`
SkuId uint `json:"skuId"`
AfterAdjustType uint `json:"afterAdjustType"`
AfterAdjustPrice decimal.Decimal `json:"afterAdjustPrice"`
Name string `json:"name"`
SupplyPrice decimal.Decimal `json:"supplyPrice"`
GuidePrice decimal.Decimal `json:"guidePrice"`
AdjustType uint `json:"adjustType"`
AdjustPrice decimal.Decimal `json:"adjustPrice"`
CustomerPrice decimal.Decimal `json:"customerPrice"`
Category string `json:"category"`
AfterPrice decimal.Decimal `json:"afterPrice"`
AfterDiscount decimal.Decimal `json:"afterDiscount"`
BrandName string `json:"brandName"`
SourceName string `json:"sourceName"`
AuditUserId uint `json:"auditUserId"`
AuditAt sql.NullTime `json:"auditAt"`
AuditAt int64 `json:"auditAt"`
ImgUrl string `json:"imgUrl"`
Reason string `json:"reason"`
FirstCategoryName string `json:"firstCategoryName"`
SecondCategoryName string `json:"secondCategoryName"`
ThirdCategoryName string `json:"thirdCategoryName"`
CreatedAt time.Time `json:"createdAt"`
CreatedAt int64 `json:"createdAt"`
}
type ReplySkuAuditLists struct {
@ -61,6 +72,16 @@ func (s *skuAudit) Lists(ctx context.Context, args ArgsSkuAuditLists) (reply Rep
return
}
// ListsEs @Title 审核列表
func (s *skuAudit) ListsEs(ctx context.Context, args ArgsSkuAuditEsLists) (reply ReplySkuAuditLists, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return
}
err = xClient.Call(ctx, "ListsEs", args, &reply)
return
}
type ArgsSkuAuditAdopt struct {
AuditUserId uint // 审核人
AuditIds []uint // 审核单id
@ -96,3 +117,66 @@ func (s *skuAudit) Reject(ctx context.Context, args ArgsSkuAuditReject) error {
func (s *skuAudit) Stock() {
}
type ArgsApplyHistory struct {
Search ApplyHistorySearch
Page bean.Page
}
type ApplyHistorySearch struct {
Id uint // 瑞库客id
Name string // 商品名称
SourceId uint // 所属供应商 1=京东
SourceSonId uint // 沙马供应商的供应商
SourceSkuId uint // 供应商skuId
BrandId uint // 品牌Id
ThirdCategoryId uint // 三级分类Id
AdjustType uint // 加价规则
MaxSupplyPrice decimal.Decimal // 最大采购价格
MinSupplyPrice decimal.Decimal // 最小采购价格
CustomerProfitRate uint // 折扣 0=全部 1=5折以下 2=6 3=7 4=8 5=9折以下
Handle uint // 处理状态
AuditStatus uint // 审核状态
SourceStatus uint // 供应商下架状态
PlatformStatus uint // 平台下架状态
}
type ApplyHistoryItem struct {
Id uint `json:"id"`
Name string `json:"name"` // 名称
BrandName string `json:"brandName"` // 品牌名称
FirstCategoryId uint `json:"firstCategoryId"` // 一级分类id
SecondCategoryId uint `json:"secondCategoryId"` // 二级分类id
ThirdCategoryId uint `json:"thirdCategoryId"` // 三级分类id
SupplyPrice decimal.Decimal `json:"supplyPrice"` // 采购价
GuidePrice decimal.Decimal `json:"guidePrice"` // 指导价
ImgUrl string `json:"imgUrl"` // 商品主图
PlatformStatus uint `json:"platformStatus"` // 平台状态 1=上架 2=下架
SourceName string `json:"sourceName"` // 供应商名称
SourceSkuId string `json:"sourceSkuId"` // 源skuId
SourceStatus uint `json:"sourceStatus"` // 供应商状态 1=上架 2=下架
CustomerPrice decimal.Decimal `json:"customerPrice"` // 供货最高价
CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` // 供货利润率 供货利润/供货最高价%
CustomerDiscount decimal.Decimal `json:"customerDiscount"` // 折扣
AdjustType uint `json:"adjustType"` // 加价类型
AdjustPrice decimal.Decimal `json:"adjustPrice"` // 加价金额
AfterAdjustType uint `json:"afterAdjustType"` // 改价后加价类型
AfterAdjustPrice decimal.Decimal `json:"afterAdjustPrice"` // 改价后加价金额
AfterPrice decimal.Decimal `json:"afterPrice"` // 改价记录
Reason string // 改价驳回原因
}
type ReplyApplyHistoryLists struct {
Lists []ApplyHistoryItem `json:"lists"`
Total int64 `json:"total"`
}
// ApplyHistory @Title 改价申请记录
func (s *skuAudit) ApplyHistory(ctx context.Context, args ArgsApplyHistory) (reply []ReplyApplyHistoryLists, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return nil, err
}
err = xClient.Call(ctx, "ApplyHistory", args, &reply)
return
}

Loading…
Cancel
Save