From 163087857a721d406efd17e7be0cdae5d0292660 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 4 Nov 2019 15:41:41 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=AF=B9=E5=95=86=E5=93=81=E5=90=8D?= =?UTF-8?q?=E8=BF=9B=E8=A1=8Ctrim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index f17b43b31..f2c46b0a4 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -541,6 +541,7 @@ func AddSkuName(ctx *jxcontext.Context, skuNameExt *model.SkuNameExt, userName s } } + skuNameExt.Name = utils.TrimBlankChar(skuNameExt.Name) if hasSensitiveWord, err := CheckHasSensitiveWord(skuNameExt.Name); hasSensitiveWord { return nil, err } @@ -658,9 +659,12 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf return 0, err } - newSkuName := utils.Interface2String(payload["name"]) - if hasSensitiveWord, err := CheckHasSensitiveWord(newSkuName); hasSensitiveWord { - return 0, err + if payload["name"] != nil { + newSkuName := utils.TrimBlankChar(utils.Interface2String(payload["name"])) + if hasSensitiveWord, err := CheckHasSensitiveWord(newSkuName); hasSensitiveWord { + return 0, err + } + payload["name"] = newSkuName } delete(payload, "isSpu") From a09e3379f372ec0170fd68b246cdf9e732e027ab Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 4 Nov 2019 16:03:31 +0800 Subject: [PATCH 2/4] =?UTF-8?q?SendMsg2Somebod=E6=94=AF=E6=8C=81=E5=BB=BA?= =?UTF-8?q?=E8=AE=AEy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/cms.go | 15 +++++++++++++-- controllers/cms.go | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/cms.go b/business/jxstore/cms/cms.go index 9aa2f3da6..61a09669b 100644 --- a/business/jxstore/cms/cms.go +++ b/business/jxstore/cms/cms.go @@ -28,6 +28,7 @@ import ( const ( SendMsgTypeOpenStoreRequest = "openStoreRequest" + SendMsgTypeSuggestRequest = "suggestRequest" ) var ( @@ -44,6 +45,14 @@ var ( // "徐建华", // "周扬", }, + SendMsgTypeSuggestRequest: []string{ + "石锋", + // "徐建华", + // "周扬", + }, + } + needConfirmRequestMap = map[string]int{ + SendMsgTypeOpenStoreRequest: 1, } ) @@ -162,8 +171,10 @@ func GetCoordinateDistrictCode(ctx *jxcontext.Context, lng, lat float64) (code i } func SendMsg2Somebody(ctx *jxcontext.Context, mobileNum, verifyCode, msgType, msgContent string) (err error) { - if _, err = mobile.AutherObj.VerifySecret(mobileNum, verifyCode); err != nil { - return err + if needConfirmRequestMap[msgType] == 1 { + if _, err = mobile.AutherObj.VerifySecret(mobileNum, verifyCode); err != nil { + return err + } } db := dao.GetDB() for _, v := range receiveMsgUsersMap[msgType] { diff --git a/controllers/cms.go b/controllers/cms.go index 9bd8cb168..4114e181b 100644 --- a/controllers/cms.go +++ b/controllers/cms.go @@ -223,7 +223,7 @@ func (c *CmsController) FakeNewOrder() { // @Title 发送消息给相关人员 // @Description 发送消息给相关人员 // @Param mobile formData string true "手机号" -// @Param verifyCode formData string true "验证码" +// @Param verifyCode formData string false "验证码" // @Param msgType formData string true "消息类型" // @Param msgContent formData string true "消息内容" // @Success 200 {object} controllers.CallResult From 99868cd068a586e0167c88d753b14f175a56b8c3 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 4 Nov 2019 17:06:31 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E5=8C=85=E6=97=B6=EF=BC=8C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E5=95=86=E5=93=81=E5=90=8C=E6=AD=A5=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=9A=84=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/cms.go | 17 ++++++++++++----- business/model/dao/store_sku.go | 6 +++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/business/jxstore/cms/cms.go b/business/jxstore/cms/cms.go index 61a09669b..346ca1a4f 100644 --- a/business/jxstore/cms/cms.go +++ b/business/jxstore/cms/cms.go @@ -348,13 +348,20 @@ func UpdateConfig(ctx *jxcontext.Context, key, configType, value string) (hint s return "", err } dao.Commit(db) + vendorStoreMap := make(map[int][]int) for _, v := range storeMapList { - if _, err = dao.UpdateEntityLogicallyAndUpdateSyncStatus(db, &model.StoreSkuBind{}, nil, ctx.GetUserName(), map[string]interface{}{ - model.FieldStoreID: v.StoreID, - }, dao.GetSyncStatusStructField(model.VendorNames[v.VendorID]), model.SyncFlagPriceMask); err != nil { - return "", err - } + vendorStoreMap[v.VendorID] = append(vendorStoreMap[v.VendorID], v.StoreID) } + for vendorID, storeIDs := range vendorStoreMap { + dao.SetStoreSkuSyncStatus(db, vendorID, storeIDs, nil, model.SyncFlagPriceMask) + } + // for _, v := range storeMapList { + // if _, err = dao.UpdateEntityLogicallyAndUpdateSyncStatus(db, &model.StoreSkuBind{}, nil, ctx.GetUserName(), map[string]interface{}{ + // model.FieldStoreID: v.StoreID, + // }, dao.GetSyncStatusStructField(model.VendorNames[v.VendorID]), model.SyncFlagPriceMask); err != nil { + // return "", err + // } + // } case model.ConfigTypeFreightPack: dao.Commit(db) storeMapList, err := dao.GetStoresMapList(db, nil, nil, model.StoreStatusAll, model.StoreIsSyncYes, "") diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index d61410ad5..1b0b9be91 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -380,9 +380,9 @@ func SetStoreSkuSyncStatus(db *DaoDB, vendorID int, storeIDs []int, skuIDs []int ` fmtParams = append(fmtParams, fieldPrefix) } - sql += " WHERE (t1.deleted_at = ?)" - // fmtParams = append(fmtParams, fieldPrefix) - sqlParams = append(sqlParams, utils.DefaultTimeValue) + sql += " WHERE t1.deleted_at = ? AND t1.%s_sync_status & ? = 0" + fmtParams = append(fmtParams, fieldPrefix) + sqlParams = append(sqlParams, utils.DefaultTimeValue, model.SyncFlagDeletedMask) if len(storeIDs) > 0 { sql += " AND t1.store_id IN (" + GenQuestionMarks(len(storeIDs)) + ")" sqlParams = append(sqlParams, storeIDs) From 0034be1bef1b29f5387b46d922c0463c364e832d Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 4 Nov 2019 17:14:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=BB=93=E7=AE=97=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E4=B8=8D=E8=AE=BE=E7=BD=AE=E5=BE=85=E5=88=9B=E5=BB=BA=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/act/act.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index 8b9d77067..d84c4a540 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -144,6 +144,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac } if act.Type == model.ActSkuFake { actSkuMap.ActualActPrice = 0 + actSkuMap.SyncStatus = 0 } else { if v.ActPrice != 0 { actSkuMap.ActualActPrice = v.ActPrice @@ -410,6 +411,9 @@ func CreateAct(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, actRules SyncStatus: model.SyncFlagNewMask, } + if act.Type == model.ActSkuFake { + actMap.SyncStatus = 0 + } dao.WrapAddIDCULDEntity(actMap, ctx.GetUserName()) actMapList = append(actMapList, actMap) }