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

finance
杨赟 2 years ago
commit 3ef221bcd0

@ -0,0 +1,67 @@
package batchSku
import (
"context"
"git.oa00.com/supply-chain/service/client"
)
type banner struct {
}
type BannerItem struct {
Id uint `json:"id"`
Img string `json:"img"`
SkuId uint `json:"skuId"`
}
// All @Title 全部轮播图
func (b *banner) All(ctx context.Context) (reply []BannerItem, err error) {
xClient, err := client.GetClient(b)
if err != nil {
return
}
args := 0
err = xClient.Call(ctx, "All", args, &reply)
return
}
type ArgsSkuBannerEdit struct {
Id uint
SkuId uint
Img string
}
// Edit @Title 编辑轮播图
func (b *banner) Edit(ctx context.Context, args ArgsSkuBannerEdit) (err error) {
xClient, err := client.GetClient(b)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Edit", args, &reply)
}
// Del @Title 删除轮播图
func (b *banner) Del(ctx context.Context, id uint) (err error) {
xClient, err := client.GetClient(b)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Del", id, &reply)
}
type ArgsSkuBannerAdd struct {
SkuId uint
Img string
}
// Add @Title 添加轮播图
func (b *banner) Add(ctx context.Context, args ArgsSkuBannerAdd) error {
xClient, err := client.GetClient(b)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "Add", args, &reply)
}

@ -0,0 +1,8 @@
package batchSku
type BatchSku struct {
Banner banner
Type skuType
Sale sale
Item item
}

@ -0,0 +1,96 @@
package batchSku
import (
"context"
"git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
)
type item struct {
}
type ReplySkuItemHandle struct {
SkuId uint `json:"skuId"`
Error string `json:"error"`
}
type ArgsSkuItemAdd struct {
SkuTypeId uint
SkuIds []uint
}
// Add @Title 添加商品
func (i *item) Add(ctx context.Context, args ArgsSkuItemAdd) (reply []ReplySkuItemHandle, err error) {
xClient, err := client.GetClient(i)
if err != nil {
return nil, err
}
err = xClient.Call(ctx, "Add", args, &reply)
return
}
type ArgsSkuItemDel struct {
SkuTypeId uint
SkuIds []uint
}
// Del @Title 删除商品
func (i *item) Del(ctx context.Context, args ArgsSkuItemDel) error {
xClient, err := client.GetClient(i)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "Del", args, &reply)
}
type ArgsSkuItemLists struct {
SkuTypeId uint
SkuId uint
Page bean.Page
}
type ReplySkuItemLists struct {
Total int64 `json:"total"`
Lists []SkuItem `json:"lists"`
}
type SkuItem struct {
Id uint `json:"id"`
SkuId uint `json:"skuId"`
}
// Lists @Title 商品列表
func (i *item) Lists(ctx context.Context, args ArgsSkuItemLists) (reply ReplySkuItemLists, err error) {
xClient, err := client.GetClient(i)
if err != nil {
return ReplySkuItemLists{}, err
}
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)
}
type ArgsBySkuIds struct {
SkuIds []uint
SkuTypeId uint
}
// FindBySkuIds @Title 根据SkuId查询数据
func (i *item) FindBySkuIds(ctx context.Context, args ArgsBySkuIds) (reply []SkuItem, err error) {
xClient, err := client.GetClient(i)
if err != nil {
return nil, err
}
err = xClient.Call(ctx, "FindBySkuIds", args, &reply)
return
}

@ -0,0 +1,102 @@
package batchSku
import (
"context"
"git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
)
type sale struct {
}
type SaleHandleItem struct {
SkuId uint `json:"skuId"`
Error string `json:"error"`
}
// Add @Title 添加
func (s *sale) Add(ctx context.Context, skuIds []uint) (reply []SaleHandleItem, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return nil, err
}
err = xClient.Call(ctx, "Add", skuIds, &reply)
return
}
type ArgsSaleLists struct {
SkuId uint
Page bean.Page
}
// Lists @Title 商品列表
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", args, &reply)
return
}
type ReplySaleSkuItemLists struct {
Total int64 `json:"total"`
Lists []SaleSkuItem `json:"lists"`
}
type SaleSkuItem struct {
Id uint `json:"id"`
SkuId uint `json:"skuId"`
}
// Del @Title 删除商品
func (s *sale) Del(ctx context.Context, ids []uint) error {
xClient, err := client.GetClient(s)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "Del", ids, &reply)
}
// SetImg @Title 设置区域导图
func (s *sale) SetImg(ctx context.Context, path string) error {
xClient, err := client.GetClient(s)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "SetImg", path, &reply)
}
// GetImg @Title 获取区域导图
func (s *sale) GetImg(ctx context.Context) (reply string, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return "", err
}
args := 0
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)
}
// FindBySkuIds @Title 根据SkuId查询数据
func (s *sale) FindBySkuIds(ctx context.Context, skuIds []uint) (reply []SaleSkuItem, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return nil, err
}
err = xClient.Call(ctx, "FindBySkuIds", skuIds, &reply)
return
}

@ -0,0 +1,60 @@
package batchSku
import (
"context"
"git.oa00.com/supply-chain/service/client"
)
type skuType struct {
}
type ArgsSkuTypeEdit struct {
Id uint
Name string
}
// Edit @Title 编辑分类
func (s *skuType) Edit(ctx context.Context, args ArgsSkuTypeEdit) error {
xClient, err := client.GetClient(s)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "Edit", args, &reply)
}
// Add @Title 添加分类
func (s *skuType) Add(ctx context.Context, name string) error {
xClient, err := client.GetClient(s)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "Add", name, &reply)
}
// Del @Title 删除分类
func (s *skuType) Del(ctx context.Context, id uint) error {
xClient, err := client.GetClient(s)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "Del", id, &reply)
}
type TypeItem struct {
Id uint `json:"id"`
Name string `json:"name"`
}
// All @Title 全部分类
func (s *skuType) All(ctx context.Context) (reply []TypeItem, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return nil, err
}
args := 0
err = xClient.Call(ctx, "All", args, &reply)
return
}

@ -1,6 +1,7 @@
package customer package customer
import ( import (
"git.oa00.com/supply-chain/service/customer/batchSku"
"git.oa00.com/supply-chain/service/customer/service" "git.oa00.com/supply-chain/service/customer/service"
"git.oa00.com/supply-chain/service/customer/sku" "git.oa00.com/supply-chain/service/customer/sku"
) )
@ -9,4 +10,5 @@ type Customer struct {
User user User user
Service service.Service Service service.Service
Sku sku.Sku Sku sku.Sku
BatchSku batchSku.BatchSku
} }

@ -155,6 +155,8 @@ func (u *user) ServiceInfo(ctx context.Context, args ArgsUserServiceInfo) (reply
type UserInfoItem struct { type UserInfoItem struct {
Id uint `json:"id"` Id uint `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Phone string `json:"phone"`
Liaison string `json:"liaison"`
} }
// FindByIds @Title 根据用户Ids查询用户信息 // FindByIds @Title 根据用户Ids查询用户信息

@ -198,3 +198,17 @@ func (g *goods) FindBySkuIds(ctx context.Context, skuIds []uint) (reply []ReplyB
err = xClient.Call(ctx, "FindBySkuIds", skuIds, &reply) err = xClient.Call(ctx, "FindBySkuIds", skuIds, &reply)
return return
} }
type ArgsBatchGoodsChange struct {
GoodsIds []uint // 商品id
}
// Change @Title 商品信息变动
func (g *goods) Change(ctx context.Context, args ArgsBatchGoodsChange) (err error) {
xClient, err := client.GetClient(g)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "Change", args, &reply)
}

@ -270,7 +270,7 @@ type OrderReceiver struct {
} }
// Detail @Title 订单详情 // Detail @Title 订单详情
func (o *order) Detail(ctx context.Context, channelId string, orderSn string) (reply OrderItem, err error) { func (o *order) Detail(ctx context.Context, channelId string, orderSn string) (reply ReplyOrderDetail, err error) {
xClient, err := client.GetClient(o) xClient, err := client.GetClient(o)
if err != nil { if err != nil {
return return

@ -83,6 +83,27 @@ func (o *order) StockOut(ctx context.Context, args ArgsOrderStockOut) (err error
return return
} }
//
//type ArgsChangeWaybill struct {
// Id uint
// Source source // 商品来源
// SourceOrderSn string
// WaybillCode string
// LogisticsName string
// LogisticsCode string
//}
//
//// ChangeWaybill @Title 修改运单信息
//func (o *order) ChangeWaybill(ctx context.Context, args ArgsChangeWaybill) (err error) {
// xClient, err := client.GetClient(o)
// if err != nil {
// return
// }
// reply := 0
// err = xClient.Call(ctx, "ChangeWaybill", args, &reply)
// return
//}
type ArgsOrderFinish struct { type ArgsOrderFinish struct {
Source source // 商品来源 Source source // 商品来源
SourceOrderSn string // 供应商订单号 SourceOrderSn string // 供应商订单号

@ -3,6 +3,7 @@ package channel
import ( import (
"context" "context"
"git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
"github.com/shopspring/decimal" "github.com/shopspring/decimal"
"github.com/smallnest/rpcx/share" "github.com/smallnest/rpcx/share"
) )
@ -55,6 +56,7 @@ type ArgsOrderSubmit struct {
type Receiver struct { type Receiver struct {
Name string // 姓名 Name string // 姓名
Mobile string // 手机号 Mobile string // 手机号
HopeStockOutDate string // 期望发货日期
Email string // 邮箱 Email string // 邮箱
ZipCode string // 邮编 ZipCode string // 邮编
} }
@ -108,3 +110,95 @@ func (o *order) Cancel(ctx context.Context, channelId string, args ArgsOrderChan
} }
return xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Cancel", args, &reply) return xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Cancel", args, &reply)
} }
type ArgsOrderLists struct {
Search OrderSearch
Page bean.Page
}
type OrderSearch struct {
Status []uint // 订单状态
CancelStatus uint // 取消状态
OrderSubSn string // 订单号
CreatedStartDate string // 创建开始日期
CreatedEndDate string // 创建结束日期
PayStartDate string // 支付开始日期
PayEndDate string // 支付结束日期
}
type ReplyOrderLists struct {
Lists []OrderItem `json:"lists"`
Total int64 `json:"total"`
}
type OrderItem struct {
Id uint `json:"id"`
ReceiverName string `json:"receiverName"`
ReceiverMobile string `json:"receiverMobile"`
Address string `json:"address"`
OrderSubSn string `json:"orderSubSn"`
SourceOrderSn string `json:"sourceOrderSn"`
OrderSn string `json:"orderSn"`
FreightFee decimal.Decimal `json:"freightFee"`
OrderFee decimal.Decimal `json:"orderFee"`
Status uint `json:"status"`
CancelStatus uint `json:"cancelStatus"`
CreatedAt int64 `json:"createdAt"`
PayTime int64 `json:"payTime"`
FinishAt int64 `json:"finishAt"`
StockOutAt int64 `json:"stockOutAt"`
CloseAt int64 `json:"closeAt"`
Skus []OrderSku `json:"skus"`
Packages []OrderPackage `json:"packages"`
ExpireAt int64 `json:"expireAt"`
PackagesType uint `json:"packagesType"`
}
type OrderPackage struct {
LogisticsName string `json:"logisticsName"`
LogisticsCode string `json:"logisticsCode"`
LogisticsPhone string `json:"logisticsPhone"`
WaybillCode string `json:"waybillCode"`
}
type OrderSku struct {
Img string `json:"img"`
SkuName string `json:"skuName"`
SkuId uint `json:"skuId"`
Size string `json:"size"`
Color string `json:"color"`
PackingRate uint `json:"packingRate"`
SupplyPrice decimal.Decimal `json:"supplyPrice"`
Quantity uint `json:"quantity"`
}
// Lists @Title 订单列表
func (o *order) Lists(ctx context.Context, channelId string, args ArgsOrderLists) (reply ReplyOrderLists, err error) {
xClient, err := client.GetClient(o)
if err != nil {
return ReplyOrderLists{}, err
}
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Lists", args, &reply)
return
}
// SubDetail @Title 子订单详情
func (o *order) SubDetail(ctx context.Context, channelId, orderSn string) (reply OrderItem, err error) {
xClient, err := client.GetClient(o)
if err != nil {
return
}
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "SubDetail", orderSn, &reply)
return
}
// Finish @Title 确认收货
func (o *order) Finish(ctx context.Context, channelId, orderSn string) error {
xClient, err := client.GetClient(o)
if err != nil {
return err
}
reply := 0
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Finish", orderSn, &reply)
return err
}

@ -87,7 +87,15 @@ type SkuEsSearch struct {
MinDiscount decimal.Decimal // 最低折扣 MinDiscount decimal.Decimal // 最低折扣
MaxDiscount decimal.Decimal // 最高折扣 MaxDiscount decimal.Decimal // 最高折扣
Expand []map[string]interface{} // 拓展查询 Expand []map[string]interface{} // 拓展查询
CustomerSearch CustomerSearch // 客户筛选条件
} }
type CustomerSearch struct {
SkuName string
SkuId uint
BrandName string
}
type ArgsSkuListsEs struct { type ArgsSkuListsEs struct {
Search SkuEsSearch Search SkuEsSearch
Page bean.Page Page bean.Page

@ -3,6 +3,7 @@ package wholesale
import ( import (
"context" "context"
"git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
"github.com/shopspring/decimal" "github.com/shopspring/decimal"
) )
@ -44,6 +45,7 @@ func (o *order) Split(ctx context.Context, args ArgsOrderSplit) (err error) {
type ArgsOrderFreightFee struct { type ArgsOrderFreightFee struct {
Source source Source source
OrderFreightFees []OrderFreightFee OrderFreightFees []OrderFreightFee
FreightFile string // 附件
} }
type OrderFreightFee struct { type OrderFreightFee struct {
SourceOrderSn string // 供应商订单号 SourceOrderSn string // 供应商订单号
@ -64,6 +66,7 @@ type ArgsOrderCancel struct {
Source source // 商品来源 Source source // 商品来源
SourceOrderSn string // 供应商订单号 SourceOrderSn string // 供应商订单号
Status uint // 订单取消 Status uint // 订单取消
CancelFile string // 取消订单附件
} }
// Cancel @Title 订单取消 // Cancel @Title 订单取消
@ -117,3 +120,96 @@ func (o *order) Finish(ctx context.Context, args ArgsOrderFinish) (err error) {
err = xClient.Call(ctx, "Finish", args, &reply) err = xClient.Call(ctx, "Finish", args, &reply)
return return
} }
type ArgsOrderLists struct {
Search OrderSearch
Page bean.Page
}
type OrderSearch struct {
OrderSubSn string
Status []uint
CancelStatus uint
CreatedStartDate string
CreatedEndDate string
PayStartDate string
PayEndDate string
}
type ReplyOrderLists struct {
Lists []OrderItem
Total int64
}
type OrderItem struct {
Id uint
OrderSubSn string
SourceOrderSn string
Status uint
CancelStatus uint
OrderFee decimal.Decimal
FreightFee decimal.Decimal
CreatedAt int64
PayAt int64
CloseAt int64
FinishAt int64
}
// Lists @Title 订单列表
func (o *order) Lists(ctx context.Context, args ArgsOrderLists) (reply ReplyOrderLists, err error) {
xClient, err := client.GetClient(o)
if err != nil {
return ReplyOrderLists{}, err
}
err = xClient.Call(ctx, "Lists", args, &reply)
return
}
type ReplyOrderInfo struct {
Id uint
Status uint
CancelStatus uint
OrderSunSu string
SourceOrderSn string
CreatedAt int64
PayAt int64
CloseAt int64
FinishAt int64
OrderFee decimal.Decimal
FreightFee decimal.Decimal
Skus []OrderSkuItem
HopeStockOutAt int64
ChannelId uint
ReceiverName string
ReceiverMobile string
Address string
PackagesType uint
Packages []Packages
}
type OrderSkuItem struct {
Img string
Name string
SkuId uint
Price decimal.Decimal
Quantity uint
PackageRate uint
}
type Packages struct {
Id uint
WaybillCode string
LogisticsName string
LogisticsCode string
LogisticsPhone string
}
// Info @Title 订单列表
func (o *order) Info(ctx context.Context, orderSubSn uint64) (reply ReplyOrderInfo, err error) {
xClient, err := client.GetClient(o)
if err != nil {
return ReplyOrderInfo{}, err
}
err = xClient.Call(ctx, "Info", orderSubSn, &reply)
return
}

@ -396,6 +396,7 @@ type ArgsSkuChangeData struct {
UpcCode string // 商品条码 UpcCode string // 商品条码
Source source // 商品来源 Source source // 商品来源
Specifications []SkuSpecification // 商品参数信息 Specifications []SkuSpecification // 商品参数信息
Imgs []string // 商品图片
Length decimal.Decimal // 长 Length decimal.Decimal // 长
Width decimal.Decimal // 宽 Width decimal.Decimal // 宽
Height decimal.Decimal // 高 Height decimal.Decimal // 高

Loading…
Cancel
Save