作者 唐旭辉

更新

1 package controllers 1 package controllers
2 2
3 import ( 3 import (
4 - "encoding/json"  
5 "errors" 4 "errors"
6 "fmt" 5 "fmt"
7 - "time"  
8 6
9 - "github.com/GeeTeam/gt3-golang-sdk/geetest"  
10 "github.com/astaxie/beego/logs" 7 "github.com/astaxie/beego/logs"
11 userCmd "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/users/command" 8 userCmd "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/users/command"
12 userService "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/users/service" 9 userService "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/users/service"
@@ -54,27 +51,26 @@ func (c *AdminLoginController) Login() { @@ -54,27 +51,26 @@ func (c *AdminLoginController) Login() {
54 } 51 }
55 52
56 //CaptchaInit 极验初始化 53 //CaptchaInit 极验初始化
57 -func (c *AdminLoginController) CaptchaInit() {  
58 - const (  
59 - captchaID = "33a2abf9c5df0d6bc3b89fb39280114b"  
60 - privateKey = "13320fd2b10199e9a2440a4fbb4d46f7"  
61 - )  
62 - newGeetest := geetest.NewGeetestLib(captchaID, privateKey, 2*time.Second)  
63 - userip := c.Ctx.Input.IP()  
64 - _, responseBt := newGeetest.PreProcess("", userip)  
65 - // c.SetSession("geetest_status", status)  
66 - var geetestRsp geetest.FailbackRegisterRespnse  
67 - json.Unmarshal(responseBt, &geetestRsp)  
68 - //对前端定义的数据格式进行适配。。。  
69 - rspData := map[string]interface{}{  
70 - "success": geetestRsp.Success,  
71 - "gt": geetestRsp.GT,  
72 - "challenge": geetestRsp.Challenge,  
73 - "newCaptcha": geetestRsp.NewCaptcha,  
74 - }  
75 - c.ResponseData(rspData)  
76 - return  
77 -} 54 +// func (c *AdminLoginController) CaptchaInit() {
  55 +// const (
  56 +// captchaID = "33a2abf9c5df0d6bc3b89fb39280114b"
  57 +// privateKey = "13320fd2b10199e9a2440a4fbb4d46f7"
  58 +// )
  59 +// newGeetest := geetest.NewGeetestLib(captchaID, privateKey, 2*time.Second)
  60 +// userip := c.Ctx.Input.IP()
  61 +// _, responseBt := newGeetest.PreProcess("", userip)
  62 +// var geetestRsp geetest.FailbackRegisterRespnse
  63 +// json.Unmarshal(responseBt, &geetestRsp)
  64 +// //对前端定义的数据格式进行适配。。。
  65 +// rspData := map[string]interface{}{
  66 +// "success": geetestRsp.Success,
  67 +// "gt": geetestRsp.GT,
  68 +// "challenge": geetestRsp.Challenge,
  69 +// "newCaptcha": geetestRsp.NewCaptcha,
  70 +// }
  71 +// c.ResponseData(rspData)
  72 +// return
  73 +// }
78 74
79 //AdminpPofile 获取登录用户的权限配置 75 //AdminpPofile 获取登录用户的权限配置
80 func (c *AdminLoginController) AdminpPofile() { 76 func (c *AdminLoginController) AdminpPofile() {
@@ -106,120 +106,6 @@ func (c *OrderDividendController) PageListOrderDividend() { @@ -106,120 +106,6 @@ func (c *OrderDividendController) PageListOrderDividend() {
106 return 106 return
107 } 107 }
108 108
109 -//OrderDividendDetail 订单的分红详情  
110 -// func (c *OrderDividendController) OrderDividendDetail() {  
111 -// type Parameter struct {  
112 -// Id string `json:"id"`  
113 -// }  
114 -// var (  
115 -// param Parameter  
116 -// err error  
117 -// )  
118 -// if err = c.BindJsonData(&param); err != nil {  
119 -// logs.Error(err)  
120 -// c.ResponseError(errors.New("json数据解析失败"))  
121 -// return  
122 -// }  
123 -// orderid, _ := strconv.ParseInt(param.Id, 10, 64)  
124 -// if orderid == 0 {  
125 -// c.ResponseError(errors.New("参数错误"))  
126 -// return  
127 -// }  
128 -// companyId := c.GetUserCompany()  
129 -// orderSrv := orderService.NewOrderInfoService(nil)  
130 -// orderinfo, err := orderSrv.GetOrderDetail(orderQuery.GetOrderQuery{  
131 -// OrderId: orderid,  
132 -// CompanyId: companyId,  
133 -// })  
134 -// if err != nil {  
135 -// c.ResponseError(err)  
136 -// return  
137 -// }  
138 -// if orderinfo.OrderType != domain.OrderReal {  
139 -// c.ResponseError(errors.New("参数错误"))  
140 -// return  
141 -// }  
142 -// allGoods := []map[string]interface{}{}  
143 -// for _, v := range orderinfo.Goods {  
144 -// detail := map[string]interface{}{  
145 -// "productName": v.GoodName,  
146 -// "orderNum": v.PlanGoodNumber,  
147 -// "univalence": v.Price,  
148 -// "partnerRatio": v.PartnerBonusPercent,  
149 -// "orderPrice": v.GoodCompute.PlanAmount,  
150 -// "partnerDividendsReceivable": v.GoodCompute.PlanPartnerBonus,  
151 -// }  
152 -// m := map[string]interface{}{  
153 -// "detail": detail,  
154 -// "quantityControl": "",  
155 -// "id": v.Id,  
156 -// "stateOfPayment": v.BonusStatus,  
157 -// "remark": v.Remark,  
158 -// "amountControl": "",  
159 -// "partnerDividendControl": "",  
160 -// "receivedDividends": v.GoodCompute.PartnerBonusHas,  
161 -// "notReceivedDividend": v.GoodCompute.PartnerBonusNot,  
162 -// "dividendSpending": v.GoodCompute.PartnerBonusExpense,  
163 -// }  
164 -// if v.GoodCompute.UseAmount >= 0 {  
165 -// m["amountControl"] = fmt.Sprint(v.GoodCompute.UseAmount)  
166 -// }  
167 -// if v.UseGoodNumber >= 0 {  
168 -// m["quantityControl"] = fmt.Sprint(v.UseGoodNumber)  
169 -// }  
170 -// if v.GoodCompute.UsePartnerBonus >= 0 {  
171 -// m["partnerDividendControl"] = fmt.Sprint(v.GoodCompute.UsePartnerBonus)  
172 -// }  
173 -// allGoods = append(allGoods, m)  
174 -// }  
175 -// orderData := map[string]interface{}{  
176 -// "buyer": orderinfo.Buyer.BuyerName,  
177 -// "shipmentsId": orderinfo.DeliveryCode,  
178 -// "orderDist": orderinfo.RegionInfo.RegionName,  
179 -// "partner": orderinfo.PartnerInfo.PartnerName,  
180 -// "id": orderinfo.Id,  
181 -// "orderId": orderinfo.OrderCode,  
182 -// "partnerCategoryId": orderinfo.PartnerCategory.Id,  
183 -// "partnerCategoryName": orderinfo.PartnerCategory.Name,  
184 -// }  
185 -// dividendCount := map[string]interface{}{  
186 -// "orderNum": orderinfo.OrderCompute.PlanOrderCount,  
187 -// "orderAmountAdjustment": orderinfo.OrderCompute.PlanOrderAmount,  
188 -// "orderNumControl": "",  
189 -// "orderAmountAdjustmentControl": "",  
190 -// "partnerDividends": orderinfo.OrderCompute.PlanPartnerBonus,  
191 -// "partnerDividendsControl": "",  
192 -// "receivedDividends": orderinfo.OrderCompute.PartnerBonusHas,  
193 -// "notReceivedDividend": orderinfo.OrderCompute.PartnerBonusNot,  
194 -// "dividendSpending": orderinfo.OrderCompute.PartnerBonusExpense,  
195 -// "commissionProportion": orderinfo.SalesmanBonusPercent,  
196 -// "expectedCommission": orderinfo.OrderCompute.SalesmanBonus,  
197 -// }  
198 -// if orderinfo.OrderCompute.UseOrderAmount >= 0 {  
199 -// dividendCount["orderAmountAdjustmentControl"] = fmt.Sprint(orderinfo.OrderCompute.UseOrderAmount)  
200 -// }  
201 -// if orderinfo.OrderCompute.UsePartnerBonus >= 0 {  
202 -// dividendCount["partnerDividendsControl"] = fmt.Sprint(orderinfo.OrderCompute.UsePartnerBonus)  
203 -// }  
204 -// if orderinfo.OrderCompute.UseOrderCount >= 0 {  
205 -// dividendCount["orderNumControl"] = fmt.Sprint(orderinfo.OrderCompute.UseOrderCount)  
206 -// }  
207 -// rsp := map[string]interface{}{  
208 -// "order": orderData,  
209 -// "product": allGoods,  
210 -// "dividendCount": dividendCount,  
211 -// "operationTime": orderinfo.UpdateTime.Local().Format("2006-01-02 15:04:06"),  
212 -// }  
213 -// if orderinfo.OrderCompute.UseOrderAmount >= 0 {  
214 -// rsp["orderNumCountControl"] = fmt.Sprint(orderinfo.OrderCompute.UseOrderAmount)  
215 -// }  
216 -// if orderinfo.OrderCompute.UseOrderCount >= 0 {  
217 -// rsp["orderAmountAdjustmentCountControl"] = fmt.Sprint(orderinfo.OrderCompute.UseOrderCount)  
218 -// }  
219 -// c.ResponseData(rsp)  
220 -// return  
221 -// }  
222 -  
223 func (c *OrderDividendController) OrderDividendDetail() { 109 func (c *OrderDividendController) OrderDividendDetail() {
224 type Parameter struct { 110 type Parameter struct {
225 Id string `json:"id"` 111 Id string `json:"id"`
@@ -261,64 +147,6 @@ type postDividendPayment struct { @@ -261,64 +147,6 @@ type postDividendPayment struct {
261 Remark string `json:"remark"` 147 Remark string `json:"remark"`
262 } 148 }
263 149
264 -// func (c *OrderDividendController) EditOrderDividend() {  
265 -// var (  
266 -// param postOrderDividend  
267 -// err error  
268 -// )  
269 -// if err = c.BindJsonData(&param); err != nil {  
270 -// logs.Error(err)  
271 -// c.ResponseError(errors.New("json数据解析失败"))  
272 -// return  
273 -// }  
274 -  
275 -// if param.Id == 0 {  
276 -// c.ResponseError(errors.New("参数错误"))  
277 -// return  
278 -// }  
279 -// goodbouns := []orderCmd.GoodBouns{}  
280 -// for _, v := range param.DividendPayments {  
281 -// if v.ProductId == 0 {  
282 -// c.ResponseError(errors.New("参数错误"))  
283 -// return  
284 -// }  
285 -// if !(v.StateOfPayment == domain.OrderGoodWaitPay || v.StateOfPayment == domain.OrderGoodHasPay) {  
286 -// c.ResponseError(errors.New("参数错误"))  
287 -// return  
288 -// }  
289 -// g := orderCmd.GoodBouns{  
290 -// GoodId: v.ProductId,  
291 -// Remark: v.Remark,  
292 -// BounsStatus: v.StateOfPayment,  
293 -// }  
294 -// if len(v.QuantityControl) == 0 {  
295 -// g.UseGoodNumber = -1  
296 -// } else {  
297 -// num, err := strconv.Atoi(v.QuantityControl)  
298 -// if err != nil {  
299 -// c.ResponseError(errors.New("参数错误"))  
300 -// return  
301 -// }  
302 -// g.UseGoodNumber = num  
303 -// }  
304 -// goodbouns = append(goodbouns, g)  
305 -// }  
306 -// companyId := c.GetUserCompany()  
307 -// cmd := orderCmd.UpdateGoodBouns{  
308 -// Id: param.Id,  
309 -// GoodBouns: goodbouns,  
310 -// CompanyId: companyId,  
311 -// }  
312 -// orderSrv := orderService.NewOrderInfoService(nil)  
313 -// err = orderSrv.UpdateGoodBouns(cmd)  
314 -// if err != nil {  
315 -// c.ResponseError(err)  
316 -// return  
317 -// }  
318 -// c.ResponseData(nil)  
319 -// return  
320 -// }  
321 -  
322 //OrderDividendDetailForBestshop 海鲜干货的订单分红详情 150 //OrderDividendDetailForBestshop 海鲜干货的订单分红详情
323 func (c *OrderDividendController) OrderDividendDetailForBestshop() { 151 func (c *OrderDividendController) OrderDividendDetailForBestshop() {
324 type Parameter struct { 152 type Parameter struct {
@@ -529,15 +357,6 @@ func (c *OrderDividendController) BatchPayOrderGoodBonus() { @@ -529,15 +357,6 @@ func (c *OrderDividendController) BatchPayOrderGoodBonus() {
529 c.ResponseError(errors.New("json数据解析失败")) 357 c.ResponseError(errors.New("json数据解析失败"))
530 return 358 return
531 } 359 }
532 - // var orderids []int64  
533 - // for _, v := range param.OrderIds {  
534 - // orderid, _ := strconv.ParseInt(v, 10, 64)  
535 - // if orderid == 0 {  
536 - // c.ResponseError(errors.New("参数错误"))  
537 - // return  
538 - // }  
539 - // orderids = append(orderids, orderid)  
540 - // }  
541 adminId := c.GetUserId() 360 adminId := c.GetUserId()
542 orderSrv := orderService.NewOrderInfoService(nil) 361 orderSrv := orderService.NewOrderInfoService(nil)
543 err = orderSrv.BatchPayPartnerBonus(param.OrderIds, adminId) 362 err = orderSrv.BatchPayPartnerBonus(param.OrderIds, adminId)
@@ -33,142 +33,6 @@ func (c *OrderInfoController) Prepare() { @@ -33,142 +33,6 @@ func (c *OrderInfoController) Prepare() {
33 } 33 }
34 } 34 }
35 35
36 -//PageListOrderPurpose 分页获取意向订单列表  
37 -// func (c *OrderInfoController) PageListOrderPurpose() {  
38 -// type Parameter struct {  
39 -// SearchText string `json:"searchText"`  
40 -// Partner int64 `json:"partner"`  
41 -// PageSize int `json:"pageSize"`  
42 -// PageNumber int `json:"pageNumber"`  
43 -// }  
44 -// var (  
45 -// param Parameter  
46 -// err error  
47 -// )  
48 -// if err = c.BindJsonData(&param); err != nil {  
49 -// logs.Error(err)  
50 -// c.ResponseError(errors.New("json数据解析失败"))  
51 -// return  
52 -// }  
53 -// if param.PageNumber == 0 {  
54 -// param.PageNumber = 1  
55 -// }  
56 -// if param.PageSize == 0 {  
57 -// param.PageSize = 20  
58 -// }  
59 -// companyId := c.GetUserCompany()  
60 -// orderSrv := orderService.NewOrderInfoService(nil)  
61 -// orderinfos, cnt, err := orderSrv.PageListOrderBase(orderQuery.ListOrderBaseQuery{  
62 -// PartnerId: param.Partner,  
63 -// OrderCode: param.SearchText,  
64 -// OrderType: domain.OrderIntention,  
65 -// Limit: param.PageSize,  
66 -// Offset: (param.PageNumber - 1) * param.PageSize,  
67 -// CompanyId: companyId,  
68 -// })  
69 -// if err != nil {  
70 -// c.ResponseError(err)  
71 -// return  
72 -// }  
73 -// rsp := []map[string]interface{}{}  
74 -// for i := range orderinfos {  
75 -// orderinfo := orderinfos[i]  
76 -// m := map[string]interface{}{  
77 -// "createTime": orderinfo.CreateTime.Local().Format("2006-01-02 15:04:05"),  
78 -// "updateTime": orderinfo.UpdateTime.Local().Format("2006-01-02 15:04:05"),  
79 -// "buyer": orderinfo.Buyer.BuyerName,  
80 -// "id": orderinfo.Id,  
81 -// "orderId": orderinfo.OrderCode,  
82 -// "partner": orderinfo.PartnerInfo.PartnerName,  
83 -// "orderNum": orderinfo.OrderCompute.PlanOrderCount,  
84 -// "orderPrice": orderinfo.OrderCompute.PlanOrderAmount,  
85 -// "orderDist": orderinfo.RegionInfo.RegionName,  
86 -// }  
87 -// rsp = append(rsp, m)  
88 -// }  
89 -// c.ResponsePageList(rsp, cnt, param.PageNumber)  
90 -// }  
91 -  
92 -//GetOrderPurpose 获取意向订单详情  
93 -// func (c *OrderInfoController) GetOrderPurpose() {  
94 -// type Parameter struct {  
95 -// Id string `json:"id"`  
96 -// }  
97 -// var (  
98 -// param Parameter  
99 -// err error  
100 -// )  
101 -// if err = c.BindJsonData(&param); err != nil {  
102 -// logs.Error(err)  
103 -// c.ResponseError(errors.New("json数据解析失败"))  
104 -// return  
105 -// }  
106 -// orderid, _ := strconv.ParseInt(param.Id, 10, 64)  
107 -// companyId := c.GetUserCompany()  
108 -// orderSrv := orderService.NewOrderInfoService(nil)  
109 -// orderinfo, err := orderSrv.GetOrderDetail(orderQuery.GetOrderQuery{  
110 -// OrderId: orderid,  
111 -// CompanyId: companyId,  
112 -// })  
113 -// if err != nil {  
114 -// c.ResponseError(err)  
115 -// return  
116 -// }  
117 -// if orderinfo.OrderType != domain.OrderIntention {  
118 -// c.ResponseError(errors.New("参数错误"))  
119 -// return  
120 -// }  
121 -// allGoods := []map[string]interface{}{}  
122 -// for _, v := range orderinfo.Goods {  
123 -// m := map[string]interface{}{  
124 -// "id": v.Id,  
125 -// "productName": v.GoodName,  
126 -// "orderNum": v.PlanGoodNumber,  
127 -// "univalence": v.Price,  
128 -// "partnerRatio": v.PartnerBonusPercent,  
129 -// "orderPrice": v.GoodCompute.PlanAmount,  
130 -// }  
131 -// allGoods = append(allGoods, m)  
132 -// }  
133 -// rsp := map[string]interface{}{  
134 -// "buyer": orderinfo.Buyer.BuyerName,  
135 -// "id": orderinfo.Id,  
136 -// "partnerID": orderinfo.PartnerInfo.Id,  
137 -// "partner": orderinfo.PartnerInfo.PartnerName,  
138 -// "orderDist": orderinfo.RegionInfo.RegionName,  
139 -// "orderId": orderinfo.OrderCode,  
140 -// "product": allGoods,  
141 -// "commissionProportion": orderinfo.SalesmanBonusPercent,  
142 -// "orderNumCount": orderinfo.OrderCompute.PlanOrderCount,  
143 -// "orderAmountAdjustmentCount": orderinfo.OrderCompute.PlanOrderAmount,  
144 -// }  
145 -// c.ResponseData(rsp)  
146 -// }  
147 -  
148 -//RemoveOrderPurpose 删除意向订单  
149 -// func (c *OrderInfoController) RemoveOrderPurpose() {  
150 -// type Parameter struct {  
151 -// Id int64 `json:"id"`  
152 -// }  
153 -// var (  
154 -// param Parameter  
155 -// err error  
156 -// )  
157 -// if err = c.BindJsonData(&param); err != nil {  
158 -// logs.Error(err)  
159 -// c.ResponseError(errors.New("json数据解析失败"))  
160 -// return  
161 -// }  
162 -// companyId := c.GetUserCompany()  
163 -// orderSrv := orderService.NewOrderInfoService(nil)  
164 -// err = orderSrv.DeleteOrder(param.Id, companyId)  
165 -// if err != nil {  
166 -// c.ResponseError(err)  
167 -// return  
168 -// }  
169 -// c.ResponseData(nil)  
170 -// }  
171 -  
172 //postPurposeOrderDetail 请求添加/更新的订单数据 36 //postPurposeOrderDetail 请求添加/更新的订单数据
173 type postPurposeOrderDetail struct { 37 type postPurposeOrderDetail struct {
174 Id int64 `json:"id"` 38 Id int64 `json:"id"`
@@ -253,93 +117,6 @@ func (postData *postOrderGood) Valid() error { @@ -253,93 +117,6 @@ func (postData *postOrderGood) Valid() error {
253 return nil 117 return nil
254 } 118 }
255 119
256 -// //UpdateOrderPurpose 更新意向订单  
257 -// func (c *OrderInfoController) UpdateOrderPurpose() {  
258 -// //用与适配前端定义的数据结构  
259 -// var (  
260 -// param postPurposeOrderDetail  
261 -// err error  
262 -// )  
263 -// if err = c.BindJsonData(&param); err != nil {  
264 -// logs.Error(err)  
265 -// c.ResponseError(errors.New("json数据解析失败"))  
266 -// return  
267 -// }  
268 -  
269 -// if err := param.Valid(); err != nil {  
270 -// c.ResponseError(err)  
271 -// return  
272 -// }  
273 -// if param.Id == 0 {  
274 -// err = c.addOrderPurpose(param)  
275 -// } else {  
276 -// err = c.editOrderPurpose(param)  
277 -// }  
278 -// if err != nil {  
279 -// c.ResponseError(err)  
280 -// }  
281 -// c.ResponseData(nil)  
282 -// return  
283 -// }  
284 -  
285 -// func (c *OrderInfoController) addOrderPurpose(param postPurposeOrderDetail) error {  
286 -  
287 -// newGoods := []orderCmd.OrderGoodData{}  
288 -// for _, v := range param.Product {  
289 -// g := orderCmd.OrderGoodData{  
290 -// GoodName: v.ProductName,  
291 -// PlanGoodNumber: v.OrderNum,  
292 -// Price: v.Univalence,  
293 -// PartnerBonusPercent: v.PartnerRatio,  
294 -// }  
295 -// newGoods = append(newGoods, g)  
296 -// }  
297 -// companyId := c.GetUserCompany()  
298 -// createcmd := orderCmd.CreateOrderCommand{  
299 -// OrderType: domain.OrderIntention,  
300 -// OrderCode: param.OrderId,  
301 -// DeliveryCode: "",  
302 -// BuyerName: param.BuyerName,  
303 -// OrderRegion: param.OrderDist,  
304 -// PartnerId: param.PartnerId,  
305 -// SalesmanBonusPercent: param.CommissionProportion,  
306 -// Goods: newGoods,  
307 -// CompanyId: companyId,  
308 -// }  
309 -// orderSrv := orderService.NewOrderInfoService(nil)  
310 -// _, err := orderSrv.CreateNewOrder(createcmd)  
311 -// return err  
312 -// }  
313 -  
314 -// func (c *OrderInfoController) editOrderPurpose(param postPurposeOrderDetail) error {  
315 -// orderSrv := orderService.NewOrderInfoService(nil)  
316 -// newGoods := []orderCmd.OrderGoodData{}  
317 -// for _, v := range param.Product {  
318 -// g := orderCmd.OrderGoodData{  
319 -// GoodName: v.ProductName,  
320 -// PlanGoodNumber: v.OrderNum,  
321 -// Price: v.Univalence,  
322 -// PartnerBonusPercent: v.PartnerRatio,  
323 -// }  
324 -// newGoods = append(newGoods, g)  
325 -// }  
326 -// companyId := c.GetUserCompany()  
327 -// updatecmd := orderCmd.UpdateOrderCommand{  
328 -// Id: param.Id,  
329 -// OrderType: domain.OrderIntention,  
330 -// OrderCode: param.OrderId,  
331 -// DeliveryCode: "",  
332 -// BuyerName: param.BuyerName,  
333 -// OrderRegion: param.OrderDist,  
334 -// PartnerId: param.PartnerId,  
335 -// SalesmanBonusPercent: param.CommissionProportion,  
336 -// Goods: newGoods,  
337 -// CompanyId: companyId,  
338 -// }  
339 -// _, err := orderSrv.UpdateOrderData(updatecmd)  
340 -// return err  
341 -// }  
342 -  
343 type postOrderPurposeDelivery struct { 120 type postOrderPurposeDelivery struct {
344 ShipmentsId string `json:"shipmentsId"` //发货单号 121 ShipmentsId string `json:"shipmentsId"` //发货单号
345 Id string `json:"id"` //订单id 122 Id string `json:"id"` //订单id
@@ -364,51 +141,6 @@ func (postData *postOrderPurposeDelivery) Valid() error { @@ -364,51 +141,6 @@ func (postData *postOrderPurposeDelivery) Valid() error {
364 return nil 141 return nil
365 } 142 }
366 143
367 -//OrderPurposeDelivery 发货 意向订单转实发单  
368 -// func (c *OrderInfoController) OrderPurposeDelivery() {  
369 -// //用与适配前端定义的数据结构  
370 -  
371 -// var (  
372 -// param postOrderPurposeDelivery  
373 -// err error  
374 -// )  
375 -// if err = c.BindJsonData(&param); err != nil {  
376 -// logs.Error(err)  
377 -// c.ResponseError(errors.New("json数据解析失败"))  
378 -// return  
379 -// }  
380 -// param.ShipmentsId = strings.TrimSpace(param.ShipmentsId)  
381 -// orderid, _ := strconv.ParseInt(param.Id, 10, 64)  
382 -// if orderid <= 0 {  
383 -// c.ResponseError(errors.New("参数错误"))  
384 -// return  
385 -// }  
386 -// if err = param.Valid(); err != nil {  
387 -// c.ResponseError(err)  
388 -// return  
389 -// }  
390 -// goods := []orderCmd.OrderGoodData{}  
391 -// for _, v := range param.ProductDetail {  
392 -// g := orderCmd.OrderGoodData{  
393 -// Id: v.Id, GoodName: v.ProductName, PlanGoodNumber: v.OrderNum,  
394 -// Price: v.Univalence, PartnerBonusPercent: v.PartnerRatio,  
395 -// }  
396 -// goods = append(goods, g)  
397 -// }  
398 -// companyId := c.GetUserCompany()  
399 -// deliveryCommand := orderCmd.OrderDeliveryCommand{  
400 -// OrderId: orderid, DeliveryCode: param.ShipmentsId,  
401 -// DeliveryTime: time.Now(), Goods: goods, CompanyId: companyId,  
402 -// }  
403 -// orderSrv := orderService.NewOrderInfoService(nil)  
404 -// err = orderSrv.Delivery(deliveryCommand)  
405 -// if err != nil {  
406 -// c.ResponseError(err)  
407 -// }  
408 -// c.ResponseData(nil)  
409 -// return  
410 -// }  
411 -  
412 //PageListOrderReal 获取实发订单列表 144 //PageListOrderReal 获取实发订单列表
413 func (c *OrderInfoController) PageListOrderReal() { 145 func (c *OrderInfoController) PageListOrderReal() {
414 type Parameter struct { 146 type Parameter struct {
@@ -22,29 +22,18 @@ func init() { @@ -22,29 +22,18 @@ func init() {
22 beego.NSRouter("/add", &controllers.PartnerInfoController{}, "POST:CreatePartnerInfo"), 22 beego.NSRouter("/add", &controllers.PartnerInfoController{}, "POST:CreatePartnerInfo"),
23 beego.NSRouter("/edit", &controllers.PartnerInfoController{}, "POST:UpdatePartnerInfo"), 23 beego.NSRouter("/edit", &controllers.PartnerInfoController{}, "POST:UpdatePartnerInfo"),
24 beego.NSRouter("/detail", &controllers.PartnerInfoController{}, "POST:GetPartnerInfo"), 24 beego.NSRouter("/detail", &controllers.PartnerInfoController{}, "POST:GetPartnerInfo"),
25 - //beego.NSRouter("/set-status", &controllers.PartnerInfoController{}, "POST:PartnerInfoSetState"),  
26 beego.NSRouter("/batchDisabled", &controllers.PartnerInfoController{}, "POST:PartnerInfoSetState"), 25 beego.NSRouter("/batchDisabled", &controllers.PartnerInfoController{}, "POST:PartnerInfoSetState"),
27 ), 26 ),
28 beego.NSNamespace("/dividends", 27 beego.NSNamespace("/dividends",
29 beego.NSRouter("/list", &controllers.OrderDividendController{}, "POST:PageListOrderDividend"), 28 beego.NSRouter("/list", &controllers.OrderDividendController{}, "POST:PageListOrderDividend"),
30 beego.NSRouter("/modify", &controllers.OrderDividendController{}, "POST:EditOrderDividend"), 29 beego.NSRouter("/modify", &controllers.OrderDividendController{}, "POST:EditOrderDividend"),
31 beego.NSRouter("/detail", &controllers.OrderDividendController{}, "POST:OrderDividendDetail"), 30 beego.NSRouter("/detail", &controllers.OrderDividendController{}, "POST:OrderDividendDetail"),
32 - // beego.NSRouter("/mini-program/detail", &controllers.OrderDividendController{}, "POST:OrderDividendDetailForBestshop"),  
33 - //beego.NSRouter("/mini-program/modify", &controllers.OrderDividendController{}, "POST:EditOrderDividendForBestshop"),  
34 beego.NSRouter("/payDividends", &controllers.OrderDividendController{}, "POST:PayOrderGoodBonus"), 31 beego.NSRouter("/payDividends", &controllers.OrderDividendController{}, "POST:PayOrderGoodBonus"),
35 beego.NSRouter("/payDividends/batch", &controllers.OrderDividendController{}, "POST:BatchPayOrderGoodBonus"), 32 beego.NSRouter("/payDividends/batch", &controllers.OrderDividendController{}, "POST:BatchPayOrderGoodBonus"),
36 beego.NSRouter("/remarks", &controllers.OrderDividendController{}, "POST:EditOrderRemarkBonus"), 33 beego.NSRouter("/remarks", &controllers.OrderDividendController{}, "POST:EditOrderRemarkBonus"),
37 beego.NSRouter("/list/excel", &controllers.OrderDividendController{}, "POST:ListOrderBonusForExcel"), 34 beego.NSRouter("/list/excel", &controllers.OrderDividendController{}, "POST:ListOrderBonusForExcel"),
38 - // beego.NSRouter("/business/detail", &controllers.BusinessBonusController{}, "POST:GetBusinessBonus"),  
39 - // beego.NSRouter("/business/edit", &controllers.BusinessBonusController{}, "POST:UpdateBusinessBonus"),  
40 - // beego.NSRouter("/business/list", &controllers.BusinessBonusController{}, "POST:ListBusinessBonus"),  
41 ), 35 ),
42 beego.NSNamespace("/order", 36 beego.NSNamespace("/order",
43 - // beego.NSRouter("/purpose/list", &controllers.OrderInfoController{}, "POST:PageListOrderPurpose"),  
44 - // beego.NSRouter("/purpose/update", &controllers.OrderInfoController{}, "POST:UpdateOrderPurpose"),  
45 - // beego.NSRouter("/purpose/detail", &controllers.OrderInfoController{}, "POST:GetOrderPurpose"),  
46 - // beego.NSRouter("/purpose/del", &controllers.OrderInfoController{}, "POST:RemoveOrderPurpose"),  
47 - // beego.NSRouter("/purpose/sendout", &controllers.OrderInfoController{}, "POST:OrderPurposeDelivery"),  
48 beego.NSRouter("/actual/list", &controllers.OrderInfoController{}, "POST:PageListOrderReal"), 37 beego.NSRouter("/actual/list", &controllers.OrderInfoController{}, "POST:PageListOrderReal"),
49 beego.NSRouter("/actual/list/excel", &controllers.OrderInfoController{}, "POST:ListOrderForExcel"), 38 beego.NSRouter("/actual/list/excel", &controllers.OrderInfoController{}, "POST:ListOrderForExcel"),
50 beego.NSRouter("/actual/detail", &controllers.OrderInfoController{}, "POST:GetOrderReal"), 39 beego.NSRouter("/actual/detail", &controllers.OrderInfoController{}, "POST:GetOrderReal"),