...
|
...
|
@@ -280,63 +280,63 @@ func (postData *postOrderGood) Valid() error { |
|
|
// return
|
|
|
// }
|
|
|
|
|
|
func (c *OrderInfoController) addOrderPurpose(param postPurposeOrderDetail) error {
|
|
|
// func (c *OrderInfoController) addOrderPurpose(param postPurposeOrderDetail) error {
|
|
|
|
|
|
newGoods := []orderCmd.OrderGoodData{}
|
|
|
for _, v := range param.Product {
|
|
|
g := orderCmd.OrderGoodData{
|
|
|
GoodName: v.ProductName,
|
|
|
PlanGoodNumber: v.OrderNum,
|
|
|
Price: v.Univalence,
|
|
|
PartnerBonusPercent: v.PartnerRatio,
|
|
|
}
|
|
|
newGoods = append(newGoods, g)
|
|
|
}
|
|
|
companyId := c.GetUserCompany()
|
|
|
createcmd := orderCmd.CreateOrderCommand{
|
|
|
OrderType: domain.OrderIntention,
|
|
|
OrderCode: param.OrderId,
|
|
|
DeliveryCode: "",
|
|
|
BuyerName: param.BuyerName,
|
|
|
OrderRegion: param.OrderDist,
|
|
|
PartnerId: param.PartnerId,
|
|
|
SalesmanBonusPercent: param.CommissionProportion,
|
|
|
Goods: newGoods,
|
|
|
CompanyId: companyId,
|
|
|
}
|
|
|
orderSrv := orderService.NewOrderInfoService(nil)
|
|
|
_, err := orderSrv.CreateNewOrder(createcmd)
|
|
|
return err
|
|
|
}
|
|
|
// newGoods := []orderCmd.OrderGoodData{}
|
|
|
// for _, v := range param.Product {
|
|
|
// g := orderCmd.OrderGoodData{
|
|
|
// GoodName: v.ProductName,
|
|
|
// PlanGoodNumber: v.OrderNum,
|
|
|
// Price: v.Univalence,
|
|
|
// PartnerBonusPercent: v.PartnerRatio,
|
|
|
// }
|
|
|
// newGoods = append(newGoods, g)
|
|
|
// }
|
|
|
// companyId := c.GetUserCompany()
|
|
|
// createcmd := orderCmd.CreateOrderCommand{
|
|
|
// OrderType: domain.OrderIntention,
|
|
|
// OrderCode: param.OrderId,
|
|
|
// DeliveryCode: "",
|
|
|
// BuyerName: param.BuyerName,
|
|
|
// OrderRegion: param.OrderDist,
|
|
|
// PartnerId: param.PartnerId,
|
|
|
// SalesmanBonusPercent: param.CommissionProportion,
|
|
|
// Goods: newGoods,
|
|
|
// CompanyId: companyId,
|
|
|
// }
|
|
|
// orderSrv := orderService.NewOrderInfoService(nil)
|
|
|
// _, err := orderSrv.CreateNewOrder(createcmd)
|
|
|
// return err
|
|
|
// }
|
|
|
|
|
|
func (c *OrderInfoController) editOrderPurpose(param postPurposeOrderDetail) error {
|
|
|
orderSrv := orderService.NewOrderInfoService(nil)
|
|
|
newGoods := []orderCmd.OrderGoodData{}
|
|
|
for _, v := range param.Product {
|
|
|
g := orderCmd.OrderGoodData{
|
|
|
GoodName: v.ProductName,
|
|
|
PlanGoodNumber: v.OrderNum,
|
|
|
Price: v.Univalence,
|
|
|
PartnerBonusPercent: v.PartnerRatio,
|
|
|
}
|
|
|
newGoods = append(newGoods, g)
|
|
|
}
|
|
|
companyId := c.GetUserCompany()
|
|
|
updatecmd := orderCmd.UpdateOrderCommand{
|
|
|
Id: param.Id,
|
|
|
OrderType: domain.OrderIntention,
|
|
|
OrderCode: param.OrderId,
|
|
|
DeliveryCode: "",
|
|
|
BuyerName: param.BuyerName,
|
|
|
OrderRegion: param.OrderDist,
|
|
|
PartnerId: param.PartnerId,
|
|
|
SalesmanBonusPercent: param.CommissionProportion,
|
|
|
Goods: newGoods,
|
|
|
CompanyId: companyId,
|
|
|
}
|
|
|
_, err := orderSrv.UpdateOrderData(updatecmd)
|
|
|
return err
|
|
|
}
|
|
|
// func (c *OrderInfoController) editOrderPurpose(param postPurposeOrderDetail) error {
|
|
|
// orderSrv := orderService.NewOrderInfoService(nil)
|
|
|
// newGoods := []orderCmd.OrderGoodData{}
|
|
|
// for _, v := range param.Product {
|
|
|
// g := orderCmd.OrderGoodData{
|
|
|
// GoodName: v.ProductName,
|
|
|
// PlanGoodNumber: v.OrderNum,
|
|
|
// Price: v.Univalence,
|
|
|
// PartnerBonusPercent: v.PartnerRatio,
|
|
|
// }
|
|
|
// newGoods = append(newGoods, g)
|
|
|
// }
|
|
|
// companyId := c.GetUserCompany()
|
|
|
// updatecmd := orderCmd.UpdateOrderCommand{
|
|
|
// Id: param.Id,
|
|
|
// OrderType: domain.OrderIntention,
|
|
|
// OrderCode: param.OrderId,
|
|
|
// DeliveryCode: "",
|
|
|
// BuyerName: param.BuyerName,
|
|
|
// OrderRegion: param.OrderDist,
|
|
|
// PartnerId: param.PartnerId,
|
|
|
// SalesmanBonusPercent: param.CommissionProportion,
|
|
|
// Goods: newGoods,
|
|
|
// CompanyId: companyId,
|
|
|
// }
|
|
|
// _, err := orderSrv.UpdateOrderData(updatecmd)
|
|
|
// return err
|
|
|
// }
|
|
|
|
|
|
type postOrderPurposeDelivery struct {
|
|
|
ShipmentsId string `json:"shipmentsId"` //发货单号
|
...
|
...
|
@@ -543,6 +543,8 @@ func (c *OrderInfoController) GetOrderReal() { |
|
|
"product": allGoods,
|
|
|
"create_time": orderinfo.CreateTime.Local().Format("2006-01-02 15:04:06"),
|
|
|
"update_time": orderinfo.UpdateTime.Local().Format("2006-01-02 15:04:06"),
|
|
|
"partnerCategoryId": orderinfo.PartnerCategory.Id,
|
|
|
"partnerCategoryName": orderinfo.PartnerCategory.Name,
|
|
|
}
|
|
|
if orderinfo.OrderCompute.UseOrderAmount >= 0 {
|
|
|
rsp["orderNumCountControl"] = fmt.Sprint(orderinfo.OrderCompute.UseOrderCount)
|
...
|
...
|
@@ -557,7 +559,8 @@ func (c *OrderInfoController) GetOrderReal() { |
|
|
//实际订单
|
|
|
type postRealOrderDetail struct {
|
|
|
postPurposeOrderDetail
|
|
|
ShipmentsId string `json:"shipmentsId"` //发货单号
|
|
|
PartnerCategory int64 `json:"partner_category"`
|
|
|
ShipmentsId string `json:"shipmentsId"` //发货单号
|
|
|
}
|
|
|
|
|
|
func (postData *postRealOrderDetail) Valid() error {
|
...
|
...
|
@@ -622,6 +625,7 @@ func (c *OrderInfoController) addOrderReal(param postRealOrderDetail) error { |
|
|
SalesmanBonusPercent: param.CommissionProportion,
|
|
|
Goods: newGoods,
|
|
|
CompanyId: companyId,
|
|
|
PartnerCategory: param.PartnerCategory,
|
|
|
}
|
|
|
_, err := orderSrv.CreateNewOrder(createcmd)
|
|
|
return err
|
...
|
...
|
@@ -651,6 +655,7 @@ func (c *OrderInfoController) editOrderReal(param postRealOrderDetail) error { |
|
|
SalesmanBonusPercent: param.CommissionProportion,
|
|
|
Goods: newGoods,
|
|
|
CompanyId: companyId,
|
|
|
PartnerCategory: param.PartnerCategory,
|
|
|
}
|
|
|
orderSrv := orderService.NewOrderInfoService(nil)
|
|
|
_, err := orderSrv.UpdateOrderData(updatecmd)
|
...
|
...
|
|