factroy store
This commit is contained in:
@@ -41,6 +41,11 @@ type WebStatus struct {
|
||||
Status int32 `json:"status" gorm:"status"` // 状态,1是正常,2为申请,3为一审核,4为二审核中,5为拒绝申请,6为审核失败,7为删除
|
||||
}
|
||||
|
||||
type AddressSaleInfo struct {
|
||||
SaleId int64 `json:"sale_id" gorm:"sale_id"` // 销售ID
|
||||
GroupId int64 `json:"group_id" gorm:"group_id"` // 分组ID
|
||||
}
|
||||
|
||||
type WebAddressInfo struct {
|
||||
Id int64 `json:"id" gorm:"id"`
|
||||
District string `json:"district" gorm:"district"` // 地区
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"lone-services/pkg/modelbase"
|
||||
"lone-services/pkg/utils"
|
||||
"lone-services/services/order/internal/dao"
|
||||
"lone-services/services/order/internal/model"
|
||||
"strconv"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
type UpdateAddressSaleInfoLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewUpdateAddressSaleInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateAddressSaleInfoLogic {
|
||||
return &UpdateAddressSaleInfoLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateAddressSaleInfoLogic) UpdateAddressSaleInfo(in *order.UpdateAddressSaleInfoRequest) (*order.UpdateAddressSaleInfoResponse, error) {
|
||||
data := dao.AddressSaleInfo{
|
||||
GroupId: in.GroupId,
|
||||
SaleId: in.SaleId,
|
||||
}
|
||||
|
||||
w := modelbase.Params{Eq: map[string]string{
|
||||
"target_id": strconv.FormatInt(in.Id, utils.NumberTen),
|
||||
"type": strconv.Itoa(dao.AddressTypeStore),
|
||||
}}
|
||||
|
||||
row, err := model.AddressModel{}.Init().Edit(w, &data)
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
return &order.UpdateAddressSaleInfoResponse{Num: int32(row)}, nil
|
||||
}
|
||||
@@ -113,16 +113,23 @@ func (s *OrderServer) OrderInfo(ctx context.Context, in *order.IdRequest) (*orde
|
||||
return l.OrderInfo(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) UpdateAddressSaleInfo(ctx context.Context, in *order.UpdateAddressSaleInfoRequest) (*order.UpdateAddressSaleInfoResponse, error) {
|
||||
l := logic.NewUpdateAddressSaleInfoLogic(ctx, s.svcCtx)
|
||||
return l.UpdateAddressSaleInfo(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) UpdateOrderDeliverStatus(ctx context.Context, in *order.UpdateOrderDeliverStatusRequest) (*order.UpdateOrderDeliverStatusResponse, error) {
|
||||
l := logic.NewUpdateOrderDeliverStatusLogic(ctx, s.svcCtx)
|
||||
return l.UpdateOrderDeliverStatus(in)
|
||||
}
|
||||
|
||||
// type 1为销售 2为门店 3为个人
|
||||
func (s *OrderServer) GetOrderInfo(ctx context.Context, in *order.GetOrderInfoRequest) (*order.OrderInfoResponse, error) {
|
||||
l := logic.NewGetOrderInfoLogic(ctx, s.svcCtx)
|
||||
return l.GetOrderInfo(in)
|
||||
}
|
||||
|
||||
// status 1 为已支付 4 支付失败,其它的返回错误
|
||||
func (s *OrderServer) UpdateOrderPayStatus(ctx context.Context, in *order.UpdateOrderPayStatusRequest) (*order.UpdateOrderPayStatusResponse, error) {
|
||||
l := logic.NewUpdateOrderPayStatusLogic(ctx, s.svcCtx)
|
||||
return l.UpdateOrderPayStatus(in)
|
||||
|
||||
Reference in New Issue
Block a user