From 702713933db3f247faca8da044ac5da33dcdcf57 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 27 Aug 2019 14:27:58 +0800 Subject: [PATCH 1/7] =?UTF-8?q?-=20=E8=B0=83=E6=95=B4TransferLegacyWeixins?= =?UTF-8?q?=E7=9A=84=E8=B0=83=E7=94=A8=E6=97=B6=E6=9C=BA=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E5=9C=A8UnbindMobile=E4=B8=8EBindMobile2=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/user.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/business/jxstore/cms/user.go b/business/jxstore/cms/user.go index 05fb5b8bc..beedf913e 100644 --- a/business/jxstore/cms/user.go +++ b/business/jxstore/cms/user.go @@ -121,7 +121,7 @@ func BindMobile2Store(ctx *jxcontext.Context, mobile string, storeID int) (num i } if err == nil { jxutils.HandleUserWXRemark(db, mobile, false) - TransferLegacyWeixins(mobile) + // TransferLegacyWeixins(mobile) } return num, err } @@ -156,7 +156,7 @@ func AddMobile2Mobile(ctx *jxcontext.Context, parentMobile, mobile string) (num } if err == nil { jxutils.HandleUserWXRemark(db, mobile, false) - TransferLegacyWeixins(mobile) + // TransferLegacyWeixins(mobile) } return num, err } @@ -167,10 +167,10 @@ func ChangeMobile(ctx *jxcontext.Context, curMobile, expectedMobile string) (num }, map[string]interface{}{ "Tel": curMobile, }) - if err == nil { - TransferLegacyWeixins(curMobile) - TransferLegacyWeixins(expectedMobile) - } + // if err == nil { + // TransferLegacyWeixins(curMobile) + // TransferLegacyWeixins(expectedMobile) + // } return num, err } From af5947288db04af0f178eb5c27800cbcfadbe935 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 27 Aug 2019 14:36:18 +0800 Subject: [PATCH 2/7] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8DTransferLegacyWeixins?= =?UTF-8?q?=E4=B8=AD=E5=88=A0=E9=99=A4=E8=A7=92=E8=89=B2=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/authz.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/business/jxstore/cms/authz.go b/business/jxstore/cms/authz.go index 945f2c249..2c0a422b2 100644 --- a/business/jxstore/cms/authz.go +++ b/business/jxstore/cms/authz.go @@ -115,7 +115,14 @@ func TransferLegacyWeixins(mobile string) (err error) { } } else { if mobile != "" { - api2.RoleMan.DeleteRole4User(user.GetID(), autils.NewRole(authz.StoreRoleBoss, v.JxStoreID)) + rList, err2 := api2.RoleMan.GetUserRoleList(user.GetID()) + if err = err2; err == nil { + for _, role := range rList { + if role.StoreID > 0 { + api2.RoleMan.DeleteRole4User(user.GetID(), autils.NewRole(authz.StoreRoleBoss, role.StoreID)) + } + } + } } } } From ebb8b8ed4469fb293d264c858908e61442b8e3f6 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 27 Aug 2019 14:44:10 +0800 Subject: [PATCH 3/7] =?UTF-8?q?-=20RegisterUser=E4=B8=AD=E8=AF=AF=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEUserTypeBoss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/user2.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/business/jxstore/cms/user2.go b/business/jxstore/cms/user2.go index f2f35026b..473afb9dc 100644 --- a/business/jxstore/cms/user2.go +++ b/business/jxstore/cms/user2.go @@ -89,9 +89,11 @@ func RegisterUser(user *model.User, mobileVerifyCode string, inAuthInfo *auth2.A if !mobileAuth.IsUserEmpty() { return nil, jsonerr.New(mobileAuth, model.ErrCodeJsonActSkuConflict) } - user.Type = model.UserTypeConsumer | model.UserTypeBoss + user.Type = model.UserTypeConsumer if inAuthInfo.AuthBindInfo.Type == dingding.AuthTypeStaff { user.Type |= model.UserTypeOperator + } else { + user.Type |= model.UserTypeStoreBoss } if err = CreateUser(user, "RegisterUser"); err == nil { if outAuthInfo, err = auth2.BindUser(mobileAuth, user); err == nil && inAuthInfo != nil { From 11f44688468d7bbf127e2cb1db5132a65d9806fa Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 27 Aug 2019 14:56:21 +0800 Subject: [PATCH 4/7] =?UTF-8?q?-=20=E5=86=8D=E6=AC=A1=E8=B0=83=E6=95=B4Tra?= =?UTF-8?q?nsferLegacyWeixins=E7=9A=84=E8=B0=83=E7=94=A8=E6=97=B6=E6=9C=BA?= =?UTF-8?q?=EF=BC=8C=E5=9B=9E=E5=88=B0=E4=B9=8B=E5=89=8D=E5=87=A0=E4=B8=AA?= =?UTF-8?q?=E7=82=B9=E9=83=BD=E8=A6=81=E8=B0=83=E7=94=A8=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/user.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/business/jxstore/cms/user.go b/business/jxstore/cms/user.go index beedf913e..05fb5b8bc 100644 --- a/business/jxstore/cms/user.go +++ b/business/jxstore/cms/user.go @@ -121,7 +121,7 @@ func BindMobile2Store(ctx *jxcontext.Context, mobile string, storeID int) (num i } if err == nil { jxutils.HandleUserWXRemark(db, mobile, false) - // TransferLegacyWeixins(mobile) + TransferLegacyWeixins(mobile) } return num, err } @@ -156,7 +156,7 @@ func AddMobile2Mobile(ctx *jxcontext.Context, parentMobile, mobile string) (num } if err == nil { jxutils.HandleUserWXRemark(db, mobile, false) - // TransferLegacyWeixins(mobile) + TransferLegacyWeixins(mobile) } return num, err } @@ -167,10 +167,10 @@ func ChangeMobile(ctx *jxcontext.Context, curMobile, expectedMobile string) (num }, map[string]interface{}{ "Tel": curMobile, }) - // if err == nil { - // TransferLegacyWeixins(curMobile) - // TransferLegacyWeixins(expectedMobile) - // } + if err == nil { + TransferLegacyWeixins(curMobile) + TransferLegacyWeixins(expectedMobile) + } return num, err } From 71495be821c6ce095ff0bae1acf56d091f181ac2 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 27 Aug 2019 15:05:09 +0800 Subject: [PATCH 5/7] - fk --- business/jxstore/cms/user2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/jxstore/cms/user2.go b/business/jxstore/cms/user2.go index 473afb9dc..88e896b2b 100644 --- a/business/jxstore/cms/user2.go +++ b/business/jxstore/cms/user2.go @@ -87,7 +87,7 @@ func RegisterUser(user *model.User, mobileVerifyCode string, inAuthInfo *auth2.A mobileAuth, err2 := auth2.Login(auth2.AuthTypeMobile, user.Mobile, auth2.UserIDMobile, mobileVerifyCode) if err = err2; err == nil { if !mobileAuth.IsUserEmpty() { - return nil, jsonerr.New(mobileAuth, model.ErrCodeJsonActSkuConflict) + return nil, jsonerr.New(mobileAuth, model.ErrCodeJsonUserAlreadyExist) } user.Type = model.UserTypeConsumer if inAuthInfo.AuthBindInfo.Type == dingding.AuthTypeStaff { From b52d1ae51e9eb7980ec7c6ccfffeb63865853e63 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 27 Aug 2019 16:18:10 +0800 Subject: [PATCH 6/7] =?UTF-8?q?-=20"=E6=82=A8=E5=A5=BD=EF=BC=8C=E8=BF=91?= =?UTF-8?q?=E6=9C=9F=E9=A5=BF=E7=99=BE=E9=9B=B6=E5=94=AE=E5=BC=80=E6=94=BE?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=AF=B9=E8=AE=A2=E5=8D=95=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=B8=AD=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E8=B0=83=E6=95=B4=EF=BC=8C=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=B0=86=E4=BB=8E8=E6=9C=8829=E6=97=A5=E8=B5=B7=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E9=97=A8=E5=BA=97=E7=BB=B4=E5=BA=A6=E9=80=90=E6=AD=A5?= =?UTF-8?q?=E7=81=B0=E5=BA=A6=EF=BC=8C=E9=A2=84=E8=AE=A19=E6=9C=88?= =?UTF-8?q?=E5=BA=95=E5=85=A8=E9=87=8F=E3=80=82=E8=AF=B7=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E8=80=85=E5=85=B3=E6=B3=A8"=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/ebai/waybill.go | 1 + 1 file changed, 1 insertion(+) diff --git a/business/partner/purchase/ebai/waybill.go b/business/partner/purchase/ebai/waybill.go index 5b81bf2e1..781adb430 100644 --- a/business/partner/purchase/ebai/waybill.go +++ b/business/partner/purchase/ebai/waybill.go @@ -22,6 +22,7 @@ var ( ebaiapi.WaybillStatusSelfDelivery: model.WaybillStatusUnknown, ebaiapi.WaybillStatusDontDeliver: model.WaybillStatusCanceled, ebaiapi.WaybillStatusDeliveryRejected: model.WaybillStatusCanceled, + ebaiapi.WaybillStatusCourierArrived: model.WaybillStatusCourierArrived, } ) From c8926056fb69a253f43f9e1ab27a026eec0cd54a Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 27 Aug 2019 17:11:53 +0800 Subject: [PATCH 7/7] =?UTF-8?q?-=20=E4=BA=AC=E4=B8=9C=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/model/const.go | 44 +++++++++++------------ business/partner/purchase/jd/order_afs.go | 4 +-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/business/model/const.go b/business/model/const.go index 3776c5020..662611d01 100644 --- a/business/model/const.go +++ b/business/model/const.go @@ -172,17 +172,17 @@ var ( }, } AfsReasonTypeName = map[int]string{ - AfsReasonTypeGoodsQuality: "商品质量", - AfsReasonTypeWrongGoods: "错误的商品", - AfsReasonTypeMissingGoods: "缺少部分商品", - AfsReasonTypeNoGoods: "全部商品未收到", - AfsReasonTypeDamagedGoods: "商品有损伤", - AfsReasonTypeGoodsQuantity: "缺斤少两", - AfsReasonTypeAgreedByMerchant: "与商家协商一致", - AfsReasonTypeGoodsNoSame: "商品与描述不符", - AfsReasonWrongPurchase: "误购", - AfsReasonNotReceivedIntime: "未在时效内送达", - AfsReasonNotOthers: "其它", + AfsReasonTypeGoodsQuality: "商品质量", + AfsReasonTypeWrongGoods: "错误的商品", + AfsReasonTypeMissingGoods: "缺少部分商品", + AfsReasonTypeNoGoods: "全部商品未收到", + AfsReasonTypeDamagedGoods: "商品有损伤", + AfsReasonTypeGoodsQuantity: "缺斤少两", + AfsReasonTypeGoodsAbsent: "商家通知我缺货", + AfsReasonTypeGoodsNoSame: "商品与描述不符", + AfsReasonWrongPurchase: "误购", + AfsReasonNotReceivedIntime: "未在时效内送达", + AfsReasonNotOthers: "其它", } AfsAppealTypeName = map[int]string{ AfsAppealTypeRefund: "仅退款", @@ -342,17 +342,17 @@ const ( ) const ( - AfsReasonTypeGoodsQuality = 1 // 商品质量 - AfsReasonTypeWrongGoods = 2 // 错误的商品 - AfsReasonTypeMissingGoods = 3 // 缺少部分商品 - AfsReasonTypeNoGoods = 4 // 全部商品未收到 - AfsReasonTypeDamagedGoods = 5 // 商品有损伤 - AfsReasonTypeGoodsQuantity = 6 // 缺斤少两 - AfsReasonTypeAgreedByMerchant = 7 // 与商家协商一致 - AfsReasonTypeGoodsNoSame = 8 // 商品与描述不符 - AfsReasonWrongPurchase = 9 // 误购 - AfsReasonNotReceivedIntime = 10 // 未在时效内送达 - AfsReasonNotOthers = 0 // 其它 + AfsReasonTypeGoodsQuality = 1 // 商品质量 + AfsReasonTypeWrongGoods = 2 // 错误的商品 + AfsReasonTypeMissingGoods = 3 // 缺少部分商品 + AfsReasonTypeNoGoods = 4 // 全部商品未收到 + AfsReasonTypeDamagedGoods = 5 // 商品有损伤 + AfsReasonTypeGoodsQuantity = 6 // 缺斤少两 + AfsReasonTypeGoodsAbsent = 7 // 商家通知缺货 + AfsReasonTypeGoodsNoSame = 8 // 商品与描述不符 + AfsReasonWrongPurchase = 9 // 误购 + AfsReasonNotReceivedIntime = 10 // 未在时效内送达 + AfsReasonNotOthers = 0 // 其它 ) const ( diff --git a/business/partner/purchase/jd/order_afs.go b/business/partner/purchase/jd/order_afs.go index c85931128..bc9c2faf5 100644 --- a/business/partner/purchase/jd/order_afs.go +++ b/business/partner/purchase/jd/order_afs.go @@ -41,7 +41,7 @@ var ( jdapi.AfsReasonTypeNoGoods: model.AfsReasonTypeNoGoods, jdapi.AfsReasonTypeDamagedGoods: model.AfsReasonTypeDamagedGoods, jdapi.AfsReasonTypeGoodsQuantity: model.AfsReasonTypeGoodsQuantity, - jdapi.AfsReasonTypeAgreedByMerchant: model.AfsReasonTypeAgreedByMerchant, + jdapi.AfsReasonTypeGoodsAbsent: model.AfsReasonTypeGoodsAbsent, jdapi.AfsReasonTypeGoodsSizeNoSame: model.AfsReasonTypeGoodsNoSame, jdapi.AfsReasonTypeGoodsColorNoSame: model.AfsReasonTypeGoodsNoSame, jdapi.AfsReasonWrongPurchase: model.AfsReasonWrongPurchase, @@ -218,7 +218,7 @@ func (c *PurchaseHandler) RefundOrder(ctx *jxcontext.Context, order *model.Goods // 发起部分退款 func (c *PurchaseHandler) PartRefundOrder(ctx *jxcontext.Context, order *model.GoodsOrder, refundSkuList []*model.OrderSku, reason string) (err error) { if globals.EnableJdStoreWrite { - _, err = api.JdAPI.AfsSubmit(order.VendorOrderID, ctx.GetUserName(), utils.Int2Str(jdapi.AfsReasonTypeAgreedByMerchant), reason, "", order.ConsigneeName, order.ConsigneeMobile, order.ConsigneeAddress, orderSkus2AfsSkus(refundSkuList)) + _, err = api.JdAPI.AfsSubmit(order.VendorOrderID, ctx.GetUserName(), utils.Int2Str(jdapi.AfsReasonWrongPurchase), reason, "", order.ConsigneeName, order.ConsigneeMobile, order.ConsigneeAddress, orderSkus2AfsSkus(refundSkuList)) } return err }