From 290d2f4693f74fb5a4a40e52094f8742b53aaa64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 12 Jun 2020 15:03:43 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=8A=E4=B8=8B=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jdshop/store_sku.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/partner/purchase/jdshop/store_sku.go b/business/partner/purchase/jdshop/store_sku.go index ec850a914..d860cb8e6 100644 --- a/business/partner/purchase/jdshop/store_sku.go +++ b/business/partner/purchase/jdshop/store_sku.go @@ -777,7 +777,7 @@ func buildUpdateSkusParam(storeSku *dao.StoreSkuSyncInfo, v *dao.StoreSkuSyncInf OuterID: utils.Int2Str(v.SkuID), } //库存设置 - if v.Status == model.SkuStatusNormal { + if v.StoreSkuStatus == model.SkuStatusNormal { sku.StockNum = "9999" } else { sku.StockNum = "0" From bb0d49efd445b0d819f179ee59f43c3fc261ea1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 12 Jun 2020 17:13:27 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=BA=8F=E6=8D=9F?= =?UTF-8?q?=E8=A7=84=E5=88=99=EF=BC=8C=E6=9F=A5=E8=AF=A2=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=B8=A6=E9=97=A8=E5=BA=97=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/scheduler/defsch/defsch.go | 2 +- business/model/dao/store_sku.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/business/jxcallback/scheduler/defsch/defsch.go b/business/jxcallback/scheduler/defsch/defsch.go index 6080c5bc4..05a191a65 100644 --- a/business/jxcallback/scheduler/defsch/defsch.go +++ b/business/jxcallback/scheduler/defsch/defsch.go @@ -1443,7 +1443,7 @@ func OrderProfitWarning(order *model.GoodsOrder) { if storeDetail != nil && err == nil { payPercentage := storeDetail.PayPercentage if payPercentage >= 50 { - profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney-order.EarningPrice)) / 100 + profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney-order.ShopPrice)) / 100 } else { profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney*int64(payPercentage)/200)) / 100 } diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index b58bf9e50..93ca0e6e2 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -1558,6 +1558,7 @@ type tStoreSkuAudit struct { MidUnitPrice int `json:"midUnitPrice"` CityName string `json:"cityName"` PayPercentage int `json:"payPercentage"` + StoreLevel string `json:"StoreLevel"` } func GetStoreSkuAudit(db *DaoDB, storeIDs, nameIDs, skuIDs, statuss, types []int, name, remark, keyword, marketManPhone, cityName string, applyTimeStart, applyTimeEnd, auditTimeStart, auditTimeEnd time.Time, pageSize, offset int) (pagedInfo *model.PagedInfo, err error) { @@ -1565,7 +1566,7 @@ func GetStoreSkuAudit(db *DaoDB, storeIDs, nameIDs, skuIDs, statuss, types []int sql := ` SELECT SQL_CALC_FOUND_ROWS DISTINCT a.*, c.name sku_name, c.prefix, c.unit, c.spec_quality, c.spec_unit, c.img, - d.name store_name, b.name, e.mid_unit_price, f.name city_name, d.pay_percentage + d.name store_name, b.name, e.mid_unit_price, f.name city_name, d.pay_percentage, d.store_level FROM store_sku_audit a LEFT JOIN user b ON a.user_id = b.user_id LEFT JOIN sku_name c ON c.id = a.name_id AND c.deleted_at = ? From 07593d28869904f945064fc0b07f2670913c6038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 12 Jun 2020 17:17:20 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=A4=A7=E5=86=99=E7=9A=84S?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/model/dao/store_sku.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index 93ca0e6e2..5468ea5f1 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -1558,7 +1558,7 @@ type tStoreSkuAudit struct { MidUnitPrice int `json:"midUnitPrice"` CityName string `json:"cityName"` PayPercentage int `json:"payPercentage"` - StoreLevel string `json:"StoreLevel"` + StoreLevel string `json:"storeLevel"` } func GetStoreSkuAudit(db *DaoDB, storeIDs, nameIDs, skuIDs, statuss, types []int, name, remark, keyword, marketManPhone, cityName string, applyTimeStart, applyTimeEnd, auditTimeStart, auditTimeEnd time.Time, pageSize, offset int) (pagedInfo *model.PagedInfo, err error) { From ccc6fbb0e27a37d162b4cf2a7eed70f5397dc30e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 12 Jun 2020 17:35:40 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=BA=8F=E6=8D=9F?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=BB=99=E9=97=A8=E5=BA=97=E8=B4=9F=E8=B4=A3?= =?UTF-8?q?=E4=BA=BA=E7=BB=84=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jxcallback/scheduler/defsch/defsch.go | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/business/jxcallback/scheduler/defsch/defsch.go b/business/jxcallback/scheduler/defsch/defsch.go index 05a191a65..ab88ab3eb 100644 --- a/business/jxcallback/scheduler/defsch/defsch.go +++ b/business/jxcallback/scheduler/defsch/defsch.go @@ -6,6 +6,10 @@ import ( "sync" "time" + "git.rosy.net.cn/jx-callback/business/jxstore/cms" + + "git.rosy.net.cn/jx-callback/business/authz" + "git.rosy.net.cn/jx-callback/business/authz/autils" "git.rosy.net.cn/jx-callback/business/jxutils/ddmsg" "git.rosy.net.cn/jx-callback/business/partner/purchase/jdshop" @@ -1449,11 +1453,34 @@ func OrderProfitWarning(order *model.GoodsOrder) { } if profit < 0 { operatorPhone, operatorName := getOrderOperatorInfo(order, storeDetail) + operatorRole := getOrderOperatorRoleInfo(order, storeDetail) if operatorPhone != "" { + var ( + roleList []*authz.RoleInfo + userIDs []string + flag = false + ) + roleList = append(roleList, autils.NewRole(operatorRole, 0)) + userIDMap, err := cms.GetRolesUserList(jxcontext.AdminCtx, roleList) noticeMsg := fmt.Sprintf("利润 :[%v],运营负责人:[%v],门店ID:[%v],平台门店ID[%v],门店名:[%v],订单序号:[%v],订单号(点击进入详情):%v", profit, operatorName, order.StoreID, order.VendorStoreID, order.StoreName, order.OrderSeq, globals.BackstageHost+"/#/ordermanager/"+order.VendorOrderID) user, err := dao.GetUserByID(db, "mobile", operatorPhone) if user != nil && err == nil { - ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "警告!此订单利润低于0", noticeMsg) + for _, v := range userIDMap { + for _, vv := range v { + userIDs = append(userIDs, vv) + } + } + for _, v := range userIDs { + if v == user.UserID { + flag = true + } + } + if !flag { + userIDs = append(userIDs, user.UserID) + } + for _, v := range userIDs { + ddmsg.SendUserMessage(dingdingapi.MsgTyeText, v, "警告!此订单利润低于0", noticeMsg) + } } } } @@ -1502,3 +1529,15 @@ func getOrderOperatorInfo(order *model.GoodsOrder, storeDetail *dao.StoreDetail) } return operatorPhone, operatorName } + +func getOrderOperatorRoleInfo(order *model.GoodsOrder, storeDetail *dao.StoreDetail) (roleName string) { + switch order.VendorID { + case model.VendorIDJD: + roleName = storeDetail.OperatorRole + case model.VendorIDMTWM: + roleName = storeDetail.OperatorRole2 + case model.VendorIDEBAI: + roleName = storeDetail.OperatorRole3 + } + return roleName +} From 90a55cc5c26c5bc42de644abfd9c5b49c3950eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 12 Jun 2020 17:59:08 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=B0=B4=E5=8D=B0?= =?UTF-8?q?=E5=92=8C=E5=90=88=E6=88=90=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 6 +++++- business/model/sku.go | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index d4c168b3c..00e809004 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -589,6 +589,8 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku, isQueryMidPric t1.img, t1.img2, t1.img3, + t1.img_watermark, + t1.img_mix, t1.status, t1.is_spu, t1.desc_img, @@ -626,6 +628,8 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku, isQueryMidPric t1.img, t1.img2, t1.img3, + t1.img_watermark, + t1.img_mix, t1.status, t1.is_spu, t1.desc_img, @@ -905,7 +909,7 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf } } globals.SugarLogger.Debugf("UpdateSkuName valid:%s", utils.Format4Output(valid, false)) - for _, imgName := range []string{"img", "img2", "img3"} { + for _, imgName := range []string{"img", "img2", "img3", "img_watermark", "img_mix"} { if valid[imgName] != nil { if imgStr := utils.Interface2String(valid[imgName]); imgStr != "" { _, err2 := datares.TryRegisterDataResource(ctx, skuName.Name, valid[imgName].(string), model.ImgTypeMain, true) diff --git a/business/model/sku.go b/business/model/sku.go index 82598d7fe..405c2836f 100644 --- a/business/model/sku.go +++ b/business/model/sku.go @@ -168,9 +168,11 @@ type SkuName struct { SpecUnit string `orm:"size(8)" json:"-"` // 为份必然为克,这个主要作用只是用于确保SkuName的唯一性 Price int `json:"price"` // 单位为分,标准价,不为份的就为实际标准价,为份的为每市斤价,实际还要乘质量。todo 为份的确定必须有质量 - Img string `orm:"size(512)" json:"img"` - Img2 string `orm:"size(512)" json:"img2"` // 第二张图片 - Img3 string `orm:"size(512)" json:"img3"` //第三张图片 + Img string `orm:"size(512)" json:"img"` + Img2 string `orm:"size(512)" json:"img2"` // 第二张图片 + Img3 string `orm:"size(512)" json:"img3"` //第三张图片 + ImgWatermark string `orm:"size(512)" json:"imgWatermark"` //图片水印 + ImgMix string `orm:"size(512)" json:"imgMix"` //图片混合水印的图片 // ImgEbai string `orm:"size(255)" json:"imgEbai"` // 饿百图片地址 // ImgHashCode string `orm:"size(255);index" json:"img_hash_code"` From f187dbc5cb76751718aefe974a6c5fee77e4d8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 15 Jun 2020 11:02:45 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=95=86=E5=93=81=E5=87=86=E5=A4=87?= =?UTF-8?q?=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 2 +- business/model/sku.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index d25feca42..681a0ffec 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -1107,7 +1107,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs skuBind.Status = tmpStatus } if globals.IsAddEvent { - err = AddEventDetail(db, ctx, model.OperateAdd, v.RealSkuID, model.ThingTypeSku, storeID, "", "") + err = AddEventDetail(db, ctx, model.OperateAdd, v.RealSkuID, model.ThingTypeSku, storeID, "", utils.Int2Str(skuBind.UnitPrice)) } setStoreSkuBindStatus(skuBind, model.SyncFlagNewMask) dao.WrapAddIDCULDEntity(skuBind, userName) diff --git a/business/model/sku.go b/business/model/sku.go index 405c2836f..b736e0b9c 100644 --- a/business/model/sku.go +++ b/business/model/sku.go @@ -187,8 +187,9 @@ type SkuName struct { // JdSyncStatus int8 `orm:"default(2)" json:"jdSyncStatus"` // LinkID int `orm:"column(link_id);null;index" json:"linkID"` - YbNameSuffix string `json:"ybNameSuffix"` //银豹商品后缀 - JdsStockSwitch int8 `orm:"default(1)" json:"jdsStockSwitch"` + YbNameSuffix string `json:"ybNameSuffix"` //银豹商品后缀 + JdsStockSwitch int8 `orm:"default(1)" json:"jdsStockSwitch"` + PreparationTime int `orm:"default(1)" json:"preparationTime"` } func (*SkuName) TableUnique() [][]string {