From 92cd70f7e2d662e9bfd93ac0b8da199709259da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 4 Feb 2020 10:20:16 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E5=95=86=E5=9F=8E=E6=8E=A8=E8=8D=90?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=8F=96=E4=BA=AC=E8=A5=BF=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/act/act.go | 88 ++++++++++++++++++++++++++++++--- business/model/dao/store_sku.go | 2 +- 2 files changed, 81 insertions(+), 9 deletions(-) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index ae6f11519..219a31a09 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -14,6 +14,7 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/partner" "git.rosy.net.cn/jx-callback/globals" + "github.com/360EntSecGroup-Skylar/excelize" "git.rosy.net.cn/jx-callback/business/jxutils/jsonerr" "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" @@ -70,6 +71,20 @@ type tActRuleInfo struct { type ActManager struct { } +type SheetParamAct struct { + StoreIDCol int + SkuIDCol int + SkuPricePercentageCol int + ActPriceCol int + EarningPriceCol int + StockCol int + ActTypeCol int + ActPricePercentageCol int + ActNameCol int + BeginTimeCol int + EndTimeCol int +} + var ( FixedActManager *ActManager @@ -1316,18 +1331,38 @@ func CreateActByExcel(ctx *jxcontext.Context, files []*multipart.FileHeader, ven } func CreateActByExcelBin(ctx *jxcontext.Context, reader io.Reader, vendorID int, vendorOrgCode string, mixType int, isFocus, isSync, isAsync, isContinueWhenError bool) (hint string, err error) { + sheetParam := &SheetParamAct{ + StoreIDCol: 0, + SkuIDCol: 2, + SkuPricePercentageCol: 4, + ActPriceCol: 5, + EarningPriceCol: 6, + StockCol: 7, + ActTypeCol: 8, + ActPricePercentageCol: 9, + ActNameCol: 10, + BeginTimeCol: 11, + EndTimeCol: 12, + } taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) { + var ( + actObj = &model.Act{} + actStoreSkuList []*ActStoreSkuParam + ) switch step { case 0: //读取excel文件 - // xlsx, err := excelize.OpenReader(reader) - // if err != nil { - // return "", err - // } - // rows, _ := xlsx.GetRows(xlsx.GetSheetName(1)) - // for rowNum, row := range rows { - - // } + xlsx, err := excelize.OpenReader(reader) + if err != nil { + return result, err + } + rows, _ := xlsx.GetRows(xlsx.GetSheetName(1)) + for rowNum, row := range rows { + if rowNum < 1 { + continue + } + err = loadExcelForCreateAct(rowNum, mixType, row, sheetParam, actObj, actStoreSkuList) + } case 1: } return result, err @@ -1342,3 +1377,40 @@ func CreateActByExcelBin(ctx *jxcontext.Context, reader io.Reader, vendorID int, } return hint, err } + +func loadExcelForCreateAct(rowNum, mixType int, row []string, sheetParam *SheetParamAct, actObj *model.Act, actStoreSkuList []*ActStoreSkuParam) (err error) { + for k, cell := range row { + if rowNum == 1 { + if k == sheetParam.ActTypeCol { + var actType int + for k, v := range model.ActTypeName { + if cell == v { + actType = k + } + } + actObj.Type = actType + } + if k == sheetParam.ActPricePercentageCol { + actObj.PricePercentage = int(utils.Str2Int64(cell) * 10) + } + if k == sheetParam.ActNameCol { + actObj.Name = cell + } + // if k == sheetParam.BeginTimeCol { + // actObj.BeginAt = cell + // } + // if k == sheetParam.EndTimeCol { + // actObj.EndAt = cell + // } + } + //一行一行 + if mixType == 1 { + + } + //叉乘 + if mixType == 2 { + + } + } + return err +} diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index d6bbafb11..dfd58edc3 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -1044,7 +1044,7 @@ func GetTopSkusByStoreIDs(db *DaoDB, storeIDs []int) (storeSkuNameExt []*StoreSk } err = GetRows(db, &skus, sql2, sqlParams2...) v.Skus = skus - err = UpdateActPrice4StoreSkuNameNew(db, storeIDs, []int{v.SkuID}, skuNamesInfo, -1) + err = UpdateActPrice4StoreSkuNameNew(db, storeIDs, []int{v.SkuID}, skuNamesInfo, model.VendorIDJX) } return storeSkuNameExt, err } From e0a5710e7d0bc8785560b9059d969be8b45c7d23 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 21 Jan 2020 17:46:39 +0800 Subject: [PATCH 02/10] comment --- business/model/act.go | 1 + 1 file changed, 1 insertion(+) diff --git a/business/model/act.go b/business/model/act.go index 471c26eaf..3003d0792 100644 --- a/business/model/act.go +++ b/business/model/act.go @@ -75,6 +75,7 @@ type Act struct { Remark string `orm:"size(255)" json:"remark"` } +// test func (*Act) TableUnique() [][]string { return [][]string{ []string{"Name", "Type", "DeletedAt"}, From a3f93c3a96a2dd5310d8dee28507c82a829c26b3 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 22 Jan 2020 12:20:15 +0800 Subject: [PATCH 03/10] model.ActCreateTypeAPI --- business/model/dao/act.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/business/model/dao/act.go b/business/model/dao/act.go index e1710e829..9a7d8a41c 100644 --- a/business/model/dao/act.go +++ b/business/model/dao/act.go @@ -380,7 +380,7 @@ func GetEffectiveActStoreSkuInfo(db *DaoDB, actID int, vendorIDs []int, actType JOIN act_store_sku t2 ON t2.act_id = t1.id AND t2.deleted_at = ? JOIN act_store_sku_map t3 ON t3.bind_id = t2.id AND t3.act_id = t1.id AND (t3.sync_status & ? = 0 OR t1.type = ?) JOIN act_map t4 ON t4.act_id = t1.id AND t4.vendor_id = t3.vendor_id AND t4.deleted_at = ? AND (t4.sync_status & ? = 0 OR t1.type = ?) - WHERE t1.deleted_at = ? AND t1.status = ? AND NOT (t1.begin_at > ? OR t1.end_at < ?)` + WHERE t1.deleted_at = ? AND t1.status = ? AND NOT (t1.begin_at > ? OR t1.end_at < ?) AND t1.create_type = ?` sqlParams := []interface{}{ utils.DefaultTimeValue, @@ -388,7 +388,7 @@ func GetEffectiveActStoreSkuInfo(db *DaoDB, actID int, vendorIDs []int, actType model.ActSkuFake, utils.DefaultTimeValue, model.SyncFlagNewMask, model.ActSkuFake, - utils.DefaultTimeValue, model.ActStatusCreated, endAt, beginAt, + utils.DefaultTimeValue, model.ActStatusCreated, endAt, beginAt, model.ActCreateTypeAPI, } if len(vendorIDs) > 0 { sql += " AND (t1.vendor_mask & ?) <> 0 AND t3.vendor_id IN (" + GenQuestionMarks(len(vendorIDs)) + ")" From 1bd36385f94199d7de993c1e8ce886bf5d890f38 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 3 Feb 2020 11:31:25 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E5=BF=BD=E7=95=A5=E9=A5=BF=E7=99=BE?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=94=99=E8=AF=AF201101?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/ebai/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/partner/purchase/ebai/store.go b/business/partner/purchase/ebai/store.go index 6e525a83a..d92b0ed58 100644 --- a/business/partner/purchase/ebai/store.go +++ b/business/partner/purchase/ebai/store.go @@ -478,7 +478,7 @@ func (c *PurchaseHandler) UpdateStoreStatus(ctx *jxcontext.Context, vendorOrgCod if err != nil { if remoteStatus, err2 := c.GetStoreStatus(ctx, vendorOrgCode, storeID, vendorStoreID); err2 == nil && remoteStatus == status { err = nil - } else if intErr, ok := err.(*utils.ErrorWithCode); ok && intErr.IntCode() == 201100 { + } else if intErr, ok := err.(*utils.ErrorWithCode); ok && intErr.IntCode() == 201100 || intErr.IntCode() == 201101 { // 兼容假错误:商户开业饿了么侧成功 err = nil } } From aed8dffa43d9b1110d5d36aed6b93f1555351bfe Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 3 Feb 2020 17:41:30 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E9=A5=BF=E7=99=BE=E8=8F=9C=E5=B8=82?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E5=90=8D=E4=BB=8E=E4=BA=AC=E8=A5=BF=E8=8F=9C?= =?UTF-8?q?=E5=B8=82=E6=94=B9=E4=B8=BA=E9=A5=BF=E9=B2=9C=E8=BE=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxutils/jxutils_cms.go | 8 ++++++-- business/model/const.go | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/business/jxutils/jxutils_cms.go b/business/jxutils/jxutils_cms.go index a7d04b834..110bdd1fe 100644 --- a/business/jxutils/jxutils_cms.go +++ b/business/jxutils/jxutils_cms.go @@ -99,10 +99,14 @@ func SplitStoreName(fullName, separator, defaultPrefix string) (prefix, bareName func ComposeStoreName(bareName string, vendorID int) (fullName string) { bareName = TrimDecorationChar(strings.Trim(bareName, "-")) + storeName := globals.StoreName if vendorID == model.VendorIDJD { - fullName = globals.StoreName + "-" + bareName + fullName = storeName + "-" + bareName } else { - fullName = globals.StoreName + "(" + bareName + ")" + if globals.IsMainProductEnv() && model.ShopChineseNames[vendorID] != "" { + storeName = model.ShopChineseNames[vendorID] + } + fullName = storeName + "(" + bareName + ")" } return fullName } diff --git a/business/model/const.go b/business/model/const.go index 60f6d1e4e..42627e5ce 100644 --- a/business/model/const.go +++ b/business/model/const.go @@ -24,9 +24,9 @@ var ( ShopChineseNames = map[int]string{ VendorIDJD: "京西菜市", - VendorIDMTWM: "美好菜市", - VendorIDELM: "好菜鲜生", - VendorIDEBAI: "好菜鲜生", + VendorIDMTWM: "京西菜市", + VendorIDELM: "饿鲜达", //"好菜鲜生", + VendorIDEBAI: "饿鲜达", //"好菜鲜生", VendorIDJX: "京西商城", VendorIDWSC: "微盟微商城", } From c1c7dd1d33ae0d1b00f3365eac13afeb6c467072 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 3 Feb 2020 20:56:49 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=EF=BC=8C=E9=A5=BF?= =?UTF-8?q?=E7=99=BE=E4=B8=8D=E5=90=8C=E6=AD=A5=E9=85=8D=E9=80=81=E8=8C=83?= =?UTF-8?q?=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/ebai/store.go | 6 +++--- business/partner/purchase/jd/store.go | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/business/partner/purchase/ebai/store.go b/business/partner/purchase/ebai/store.go index d92b0ed58..8f88b77a7 100644 --- a/business/partner/purchase/ebai/store.go +++ b/business/partner/purchase/ebai/store.go @@ -408,9 +408,9 @@ func genStoreMapFromStore(store *tEbaiStoreInfo) map[string]interface{} { params["longitude"] = jxutils.IntCoordinate2Standard(store.Lng) params["latitude"] = jxutils.IntCoordinate2Standard(store.Lat) params["coord_type"] = ebaiapi.CoordTypeAutonavi - if deliveryRegion := JxDeliveryRegion2Ebai(&store.Store); deliveryRegion != nil { - params["delivery_region"] = deliveryRegion - } + // if deliveryRegion := JxDeliveryRegion2Ebai(&store.Store); deliveryRegion != nil { + // params["delivery_region"] = deliveryRegion + // } if store.ProvinceID != 0 { params["province"] = store.ProvinceID } diff --git a/business/partner/purchase/jd/store.go b/business/partner/purchase/jd/store.go index e4c9fdfd1..4a9b73857 100644 --- a/business/partner/purchase/jd/store.go +++ b/business/partner/purchase/jd/store.go @@ -156,7 +156,6 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin } if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreAddress) != 0 { storeParams.StationAddress = store.Address - storeParams.DeliveryRangeType = store.DeliveryRangeType storeParams.CoordinateType = jdapi.CoordinateTypeAutonavi // 一直用高德 storeParams.Lng = jxutils.IntCoordinate2Standard(store.Lng) storeParams.Lat = jxutils.IntCoordinate2Standard(store.Lat) @@ -166,11 +165,12 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin if store.JdDistrictCode != 0 { storeParams.County = store.JdDistrictCode } - if store.DeliveryRangeType == model.DeliveryRangeTypePolygon { - storeParams.CoordinatePoints = store.DeliveryRange - } else { - storeParams.DeliveryRangeRadius = int(utils.Str2Int64WithDefault(store.DeliveryRange, 0)) - } + // storeParams.DeliveryRangeType = store.DeliveryRangeType + // if store.DeliveryRangeType == model.DeliveryRangeTypePolygon { + // storeParams.CoordinatePoints = store.DeliveryRange + // } else { + // storeParams.DeliveryRangeRadius = int(utils.Str2Int64WithDefault(store.DeliveryRange, 0)) + // } } if specialDistrictMap[storeParams.County] != 0 { storeParams.City = storeParams.County @@ -183,7 +183,7 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin _, storeParams.CloseStatus = JxStoreStatus2JdStatus(jxutils.MergeStoreStatus(store.Status, store.JdStoreStatus)) } fillOpTimeParams(storeParams, store.GetOpTimeList()) - globals.SugarLogger.Debug(utils.Format4Output(storeParams, false)) + // globals.SugarLogger.Debug(utils.Format4Output(storeParams, false)) errList := errlist.New() if globals.EnableJdStoreWrite { errList.AddErr(a.UpdateStoreInfo4Open2(storeParams, modifyCloseStatus)) From 72db973e8be78838567288ecbeb532b4e5b2ca7f Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 4 Feb 2020 08:41:55 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E5=8E=BB=E6=8E=89ProxySNSxx=E5=87=BD?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E6=B7=BB=E5=8A=A0getWxApp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth2/authprovider/weixin/weixin_mini.go | 67 ++++++++++++++----- controllers/auth2.go | 21 +++--- 2 files changed, 58 insertions(+), 30 deletions(-) diff --git a/business/auth2/authprovider/weixin/weixin_mini.go b/business/auth2/authprovider/weixin/weixin_mini.go index 5737e6233..4c2d41db2 100644 --- a/business/auth2/authprovider/weixin/weixin_mini.go +++ b/business/auth2/authprovider/weixin/weixin_mini.go @@ -37,7 +37,8 @@ func init() { func (a *MiniAuther) VerifySecret(dummy, jsCode string) (authBindEx *auth2.AuthBindEx, err error) { globals.SugarLogger.Debugf("weixin mini VerifySecret jsCode:%s", jsCode) - sessionInfo, err := ProxySNSCode2Session(jsCode) + appID, jsCode := SplitJsCode(jsCode) + sessionInfo, err := getWxApp(appID).SNSCode2Session(jsCode) if err == nil { sessionKey := sessionInfo.SessionKey sessionInfo.SessionKey = "" @@ -52,8 +53,9 @@ func (a *MiniAuther) VerifySecret(dummy, jsCode string) (authBindEx *auth2.AuthB func (a *MiniAuther) DecryptData(authInfo *auth2.AuthInfo, jsCode, encryptedData, iv string) (decryptedDataBase64 string, err error) { globals.SugarLogger.Debugf("weixin mini DecryptData jsCode:%s, encryptedData:%s, iv:%s", jsCode, encryptedData, iv) var sessionKey string + appID, jsCode := SplitJsCode(jsCode) if jsCode != "" { - sessionInfo, err := ProxySNSCode2Session(jsCode) + sessionInfo, err := getWxApp(appID).SNSCode2Session(jsCode) if err == nil { if authBindEx, err := a.UnionFindAuthBind(AuthTypeMini, []string{AuthTypeMini}, sessionInfo.OpenID, "", nil); err == nil { if authBindEx.UserID != authInfo.GetID() { @@ -72,7 +74,8 @@ func (a *MiniAuther) DecryptData(authInfo *auth2.AuthInfo, jsCode, encryptedData } sessionKey = authInfo.AuthBindInfo.UserData.(string) } - decryptedData, err := ProxySNSDecodeMiniProgramData(encryptedData, sessionKey, iv) + // decryptedData, err := ProxySNSDecodeMiniProgramData(encryptedData, sessionKey, iv) + decryptedData, err := weixinapi.SNSDecodeMiniProgramData(encryptedData, sessionKey, iv) if err != nil { return "", err } @@ -84,21 +87,51 @@ func (a *MiniAuther) GetUserType() (userType int8) { return model.UserTypeStoreBoss } -func ProxySNSCode2Session(jsCode string) (sessionInfo *weixinapi.SessionInfo, err error) { - miniApi := api.WeixinMiniAPI - list := strings.Split(jsCode, ",") - if len(list) >= 2 && len(list[0]) == len("wx4b5930c13f8b1170") { - if list[0] == api.WeixinMiniAppID2 { - miniApi = api.WeixinMiniAPI2 - } - jsCode = strings.Join(list[1:], ",") +func getWxApp(appID string) (miniApi *weixinapi.API) { + miniApi = api.WeixinMiniAPI + if len(appID) > 0 && appID == api.WeixinMiniAppID2 { + miniApi = api.WeixinMiniAPI2 } - sessionInfo, err = miniApi.SNSCode2Session(jsCode) - return sessionInfo, err + return miniApi } -func ProxySNSDecodeMiniProgramData(encryptedData, sessionKey, iv string) (decryptedData []byte, err error) { - globals.SugarLogger.Debugf("ProxySNSDecodeMiniProgramData, encryptedData:%s, sessionKey:%s, iv:%s", encryptedData, sessionKey, iv) - decryptedData, err = api.WeixinMiniAPI.SNSDecodeMiniProgramData(encryptedData, sessionKey, iv) - return decryptedData, err +func SplitJsCode(jsCode string) (appID, realJsCode string) { + list := strings.Split(jsCode, ",") + if len(list) == 2 { + appID = list[0] + realJsCode = list[1] + } else if len(list) == 1 { + realJsCode = jsCode + } else { + globals.SugarLogger.Warnf("SplitJsCode abnormal jsCode:%s", jsCode) + } + return appID, realJsCode } + +func ComposeJsCode(appID, jsCode string) (composedCode string) { + composedCode = strings.Join([]string{ + appID, + jsCode, + }, ",") + return composedCode +} + +// func ProxySNSCode2Session(jsCode string) (sessionInfo *weixinapi.SessionInfo, err error) { +// miniApi := api.WeixinMiniAPI +// list := strings.Split(jsCode, ",") +// if len(list) >= 2 && len(list[0]) == len("wx4b5930c13f8b1170") { +// if list[0] == api.WeixinMiniAppID2 { +// miniApi = api.WeixinMiniAPI2 +// } +// miniApi = getWxApp(list[0]) +// jsCode = strings.Join(list[1:], ",") +// } +// sessionInfo, err = miniApi.SNSCode2Session(jsCode) +// return sessionInfo, err +// } + +// func ProxySNSDecodeMiniProgramData(encryptedData, sessionKey, iv string) (decryptedData []byte, err error) { +// globals.SugarLogger.Debugf("ProxySNSDecodeMiniProgramData, encryptedData:%s, sessionKey:%s, iv:%s", encryptedData, sessionKey, iv) +// decryptedData, err = api.WeixinMiniAPI.SNSDecodeMiniProgramData(encryptedData, sessionKey, iv) +// return decryptedData, err +// } diff --git a/controllers/auth2.go b/controllers/auth2.go index c9ce8311a..a09e18fea 100644 --- a/controllers/auth2.go +++ b/controllers/auth2.go @@ -18,19 +18,14 @@ import ( ) func GetComposedCode(c *beego.Controller, code string) (composedCode string) { - if code != "" { - composedCode = code - referer := c.Ctx.Request.Referer() - globals.SugarLogger.Debugf("GetComposedCode referer:%s", referer) - index := strings.Index(referer, "//") - if index > 0 { - list := strings.Split(referer[index+2:], "/") - if len(list) >= 2 { - composedCode = strings.Join([]string{ - list[1], - code, - }, ",") - } + composedCode = code + referer := c.Ctx.Request.Referer() + globals.SugarLogger.Debugf("GetComposedCode referer:%s", referer) + index := strings.Index(referer, "//") + if index > 0 { + list := strings.Split(referer[index+2:], "/") + if len(list) >= 2 { + composedCode = weixin.ComposeJsCode(list[1], code) } } return composedCode From 077cf1ba2bcf32c3ed96fb9458528bec71838c4f Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 4 Feb 2020 09:24:56 +0800 Subject: [PATCH 08/10] ProfitSharing=Y --- business/partner/pay/wxpay/wxpay.go | 5 +++-- business/partner/purchase/jx/localjx/wxpay.go | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/business/partner/pay/wxpay/wxpay.go b/business/partner/pay/wxpay/wxpay.go index ee161d7ed..b0f1d767a 100644 --- a/business/partner/pay/wxpay/wxpay.go +++ b/business/partner/pay/wxpay/wxpay.go @@ -36,8 +36,9 @@ func (p *PayHandler) CreatePay(ctx *jxcontext.Context, createParam *pay.CreatePa TradeType: vendorPayType2WxpayType(createParam.VendorPayType), TotalFee: createParam.TotalFee, - TimeStart: wxpayapi.Time2PayTime(createParam.TimeStart), - TimeExpire: wxpayapi.Time2PayTime(createParam.TimeExpire), + TimeStart: wxpayapi.Time2PayTime(createParam.TimeStart), + TimeExpire: wxpayapi.Time2PayTime(createParam.TimeExpire), + ProfitSharing: wxpayapi.OptYes, } if isOffline { param.TradeType = wxpayapi.TradeTypeNative diff --git a/business/partner/purchase/jx/localjx/wxpay.go b/business/partner/purchase/jx/localjx/wxpay.go index 453533def..edebf972e 100644 --- a/business/partner/purchase/jx/localjx/wxpay.go +++ b/business/partner/purchase/jx/localjx/wxpay.go @@ -35,6 +35,7 @@ func pay4OrderByWX(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp TimeStart: wxpayapi.Time2PayTime(payCreatedAt), // TimeExpire: wxpayapi.Time2PayTime(payCreatedAt.Add(PayWaitingTime)), + ProfitSharing: wxpayapi.OptYes, } if authInfo, err := ctx.GetV2AuthInfo(); err == nil && authInfo.GetAuthType() == weixin.AuthTypeMini { param.OpenID = authInfo.GetAuthID() From 71638faaab7ce0d1ddc6ffd2b5523adb57593e22 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 4 Feb 2020 09:55:53 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E6=9A=82=E6=97=B6=E7=A6=81=E7=94=A8isSyn?= =?UTF-8?q?c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 8be4eedba..8b3c58128 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -698,6 +698,10 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa if payload["autoEnableAt"] != nil { payload["autoEnableAt"] = utils.Time2Date(utils.Str2Time(utils.Interface2String(payload["autoEnableAt"]))) } + // 暂时不开放isSync + if payload["isSync"] != nil { + delete(payload, "isSync") + } valid := dao.StrictMakeMapByStructObject2(payload, store, &outStore, userName) if err = checkStoreDeliveryRange(utils.Interface2String(valid["deliveryRange"])); err != nil { return 0, err @@ -1073,6 +1077,7 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend storeMap.Status = model.StoreStatusOpened storeMap.DeliveryType = model.StoreDeliveryTypeByStore storeMap.SyncStatus = 0 + storeMap.IsSync = 1 // 暂时禁用isSync if vendorID != model.VendorIDJX { if storeMap.VendorOrgCode == "" { return nil, fmt.Errorf("必须指定平台分账号信息") From 37d6458cb8496837d8f08c59c64a4c0691035bec Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 4 Feb 2020 10:19:06 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E4=BF=9D=E7=95=99isSync=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E6=94=B9=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 8b3c58128..f71cc6186 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -698,10 +698,6 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa if payload["autoEnableAt"] != nil { payload["autoEnableAt"] = utils.Time2Date(utils.Str2Time(utils.Interface2String(payload["autoEnableAt"]))) } - // 暂时不开放isSync - if payload["isSync"] != nil { - delete(payload, "isSync") - } valid := dao.StrictMakeMapByStructObject2(payload, store, &outStore, userName) if err = checkStoreDeliveryRange(utils.Interface2String(valid["deliveryRange"])); err != nil { return 0, err @@ -1077,7 +1073,6 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend storeMap.Status = model.StoreStatusOpened storeMap.DeliveryType = model.StoreDeliveryTypeByStore storeMap.SyncStatus = 0 - storeMap.IsSync = 1 // 暂时禁用isSync if vendorID != model.VendorIDJX { if storeMap.VendorOrgCode == "" { return nil, fmt.Errorf("必须指定平台分账号信息") @@ -1171,6 +1166,10 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor return 0, ErrCanNotFindVendor } } + // 暂时不开放isSync + if payload["isSync"] != nil { + payload["isSync"] = 1 + } if db == nil { db = dao.GetDB() }