new create admin order,express add company

This commit is contained in:
2026-09-02 18:02:57 +08:00
parent 02819d159a
commit e0a63bbef9
38 changed files with 3023 additions and 265 deletions
@@ -44,9 +44,8 @@ func (l *OrderCreateLogic) OrderCreate(in *order.AdminCreateOrderRequest) (*orde
w := modelbase.Params{
Eq: map[string]string{
"id": strconv.FormatInt(in.AddressId, utils.NumberTen),
"type": strconv.Itoa(dao.OrderTypeStore),
"target_id": strconv.FormatInt(adminInfo.ID, utils.NumberTen),
"id": strconv.FormatInt(in.AddressId, utils.NumberTen),
"type": strconv.Itoa(dao.OrderTypeStore),
},
}
var address dao.Address
@@ -65,25 +64,18 @@ func (l *OrderCreateLogic) OrderCreate(in *order.AdminCreateOrderRequest) (*orde
Address: address.Address,
Addressee: address.Name,
DistrictIds: address.DistrictIds,
DeliverType: dao.OrderDeliverTypeSend,
}
ww := modelbase.Params{
Eq: map[string]string{
"type": strconv.Itoa(dao.OrderTypeStore),
"store_id": strconv.FormatInt(adminInfo.ID, utils.NumberTen),
},
if in.Type != dao.OrderDeliverTypeNotSend {
data.DeliverType = dao.OrderDeliverTypeNotSend
data.DeliverStatus = dao.SendStatusOver
data.SignTime = utils.Now()
}
data.StoreId = int(adminInfo.ID)
data.StoreName = adminInfo.Name
data.SaleId = int(adminInfo.SaleId)
data.GroupId = int(adminInfo.GroupId)
data.SaleMobile = adminInfo.SaleMobile
data.SaleProvince = int(adminInfo.SaleProvince)
data.CreateType = dao.OrderTypeStore
data.Type = dao.OrderTypeStore
data.OrderSn = svc.GetOrderSn(strconv.Itoa(dao.OrderTypeStore), adminInfo.ID)
var cart dao.Cart
data.OrderSn = svc.GetOrderSn(strconv.Itoa(dao.OrderTypeStore), address.TargetId)
ids, pErr := svc.GetCartInfo(in.Info)
if pErr != utils.Ok {
@@ -140,12 +132,6 @@ func (l *OrderCreateLogic) OrderCreate(in *order.AdminCreateOrderRequest) (*orde
}
}
_, err = model.CartModel{}.Init().Del(ww, &cart)
if err != nil {
mobileObj.Rollback()
return l.fail(utils.Fail)
}
cli, err := svc.GetRpcClient(l.svcCtx.ProductSvcName)
if err != nil {
mobileObj.Rollback()