京东商城建店
This commit is contained in:
@@ -44,7 +44,7 @@ func (c *BaseScheduler) CreateWaybillOnProviders(ctx *jxcontext.Context, order *
|
|||||||
stores, _ := dao.GetStoreList(dao.GetDB(), []int{order.StoreID}, nil, nil, nil, "")
|
stores, _ := dao.GetStoreList(dao.GetDB(), []int{order.StoreID}, nil, nil, nil, "")
|
||||||
if len(stores) > 0 {
|
if len(stores) > 0 {
|
||||||
if stores[0].PayPercentage <= 50 {
|
if stores[0].PayPercentage <= 50 {
|
||||||
order.NewEarningPrice = (order.TotalShopMoney - bill.DesiredFee) * int64((100 - stores[0].PayPercentage/2)) / 10000
|
order.NewEarningPrice = (order.TotalShopMoney - bill.DesiredFee) * int64((100 - stores[0].PayPercentage/2)) / 100
|
||||||
dao.UpdateEntity(dao.GetDB(), order, "NewEarningPrice")
|
dao.UpdateEntity(dao.GetDB(), order, "NewEarningPrice")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1585,31 +1585,28 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
|||||||
|
|
||||||
var stores []*model.Store
|
var stores []*model.Store
|
||||||
sql := `
|
sql := `
|
||||||
SELECT b.*
|
SELECT a.*
|
||||||
FROM store_map a, store b
|
FROM store a
|
||||||
WHERE a.store_id = b.id
|
LEFT JOIN store_map b ON a.id = b.store_id AND b.vendor_id = 5 AND b.deleted_at = '1970-01-01 00:00:00'
|
||||||
AND a.vendor_store_id = '' AND a.vendor_id = 5 AND a.deleted_at = ?
|
WHERE 1=1
|
||||||
AND b.deleted_at = ?
|
AND (a.status = 1 OR a.status = 0)
|
||||||
and a.jds_street_code = 0
|
AND b.id IS NULL
|
||||||
|
AND a.deleted_at = '1970-01-01 00:00:00'
|
||||||
`
|
`
|
||||||
sqlParams := []interface{}{utils.DefaultTimeValue, utils.DefaultTimeValue}
|
err = dao.GetRows(db, &stores, sql, nil)
|
||||||
err = dao.GetRows(db, &stores, sql, sqlParams)
|
|
||||||
result1, _ := api.JdShopAPI.GetProvince()
|
|
||||||
for _, v := range stores {
|
for _, v := range stores {
|
||||||
place, _ := dao.GetPlaceByCode(db, v.DistrictCode)
|
storeMap := &model.StoreMap{
|
||||||
for _, vv := range result1 {
|
Status: 1,
|
||||||
result2, _ := api.JdShopAPI.GetCity(vv.AreaID)
|
VendorID: model.VendorIDJDShop,
|
||||||
for _, vvv := range result2 {
|
AutoPickup: 1,
|
||||||
result3, _ := api.JdShopAPI.GetCounty(vvv.AreaID)
|
DeliveryCompetition: 1,
|
||||||
for _, vvvv := range result3 {
|
PricePercentage: 100,
|
||||||
if vvvv.AreaName == place.Name {
|
IsSync: 1,
|
||||||
place.JdsCode = vvvv.AreaID
|
SyncRule: 1,
|
||||||
dao.UpdateEntity(db, place, "JdsCode")
|
}
|
||||||
break
|
_, err = cms.AddStoreVendorMap(ctx, db, model.VendorIDJDShop, "", v.ID, storeMap)
|
||||||
}
|
if err != nil {
|
||||||
}
|
continue
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|||||||
25
controllers/jds_callback.go
Normal file
25
controllers/jds_callback.go
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
|
"github.com/astaxie/beego"
|
||||||
|
)
|
||||||
|
|
||||||
|
type JdsController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *JdsController) Msg(msgType string) {
|
||||||
|
c.Data["json"] = mtwmapi.Err2CallbackResponse(nil, "")
|
||||||
|
msg, callbackResponse := api.MtwmAPI.GetCallbackMsg(c.Ctx.Request)
|
||||||
|
if callbackResponse == nil {
|
||||||
|
callbackResponse = mtwm.OnCallbackMsg(msg)
|
||||||
|
if callbackResponse == nil {
|
||||||
|
callbackResponse = mtwmapi.Err2CallbackResponse(nil, "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
c.Data["json"] = callbackResponse
|
||||||
|
c.ServeJSON()
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user