upc限制份
This commit is contained in:
@@ -826,7 +826,10 @@ func AddSkuName(ctx *jxcontext.Context, skuNameExt *model.SkuNameExt, userName s
|
||||
} else if !jxutils.IsUpcValid(upc) {
|
||||
return nil, fmt.Errorf("upc:%s不合法,请仔细检查", upc)
|
||||
}
|
||||
|
||||
//有upc码时,单位不能为份
|
||||
if len(upc) != 0 && skuNameExt.Unit == "份" {
|
||||
return nil, errors.New("商品有Upc码时,规格不能为份")
|
||||
}
|
||||
db := dao.GetDB()
|
||||
skuNameExt.SkuName.Status = model.SkuStatusNormal
|
||||
if skuNameExt.IsSpu == 1 {
|
||||
@@ -982,6 +985,11 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf
|
||||
} else if !jxutils.IsUpcValid(upc) {
|
||||
return 0, fmt.Errorf("upc:%s不合法,请仔细检查", upc)
|
||||
}
|
||||
//有upc码时,单位不能为份
|
||||
upc1 := valid["Upc"].(string)
|
||||
if len(upc1) != 0 && valid["unit"] != nil && valid["unit"].(string) == "份" {
|
||||
return 0, errors.New("商品有Upc码时,规格不能为份")
|
||||
}
|
||||
}
|
||||
// globals.SugarLogger.Debugf("UpdateSkuName valid:%s", utils.Format4Output(valid, false))
|
||||
// for _, imgName := range []string{"img", "img2", "img3", "img4", "img5"} {
|
||||
@@ -2356,6 +2364,10 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader, categoryID
|
||||
retVal = []*CreateUpcSkuByExcelErr{buildCreateUpcSkuByExcelErr(v, "请输入正确的商品条码!")}
|
||||
return retVal, err
|
||||
}
|
||||
//有upc码时,单位不能为份
|
||||
if v.Unit == "份" {
|
||||
return nil, errors.New("商品有Upc码时,规格不能为份")
|
||||
}
|
||||
skuName.Upc = v.Upc
|
||||
} else {
|
||||
retVal = []*CreateUpcSkuByExcelErr{buildCreateUpcSkuByExcelErr(v, "商品的条码不能为空!")}
|
||||
|
||||
@@ -427,7 +427,7 @@ func Init() {
|
||||
//cms.SetMTPSStatus(jxcontext.AdminCtx, 0, 0)
|
||||
cms.SetMTPSStatus2(0)
|
||||
//售后单如果超过12小时没有审核,就自动通过
|
||||
RefreshAfsOrderStatusAccess(jxcontext.AdminCtx)
|
||||
//RefreshAfsOrderStatusAccess(jxcontext.AdminCtx)
|
||||
//刷新门店分组管理
|
||||
cms.RefreshStoreBind(jxcontext.AdminCtx)
|
||||
//更新所有门店的上下线状态
|
||||
@@ -677,7 +677,7 @@ func doDailyWork() {
|
||||
//同步美团配送与否状态及美团门店是否存在
|
||||
cms.SetMTPSStatus(jxcontext.AdminCtx, 0, 0)
|
||||
//售后单如果超过12小时没有审核,就自动通过
|
||||
RefreshAfsOrderStatusAccess(jxcontext.AdminCtx)
|
||||
//RefreshAfsOrderStatusAccess(jxcontext.AdminCtx)
|
||||
//刷新京东商城订单结算价
|
||||
orderman.RefreshJdShopOrdersEarningPrice(jxcontext.AdminCtx, utils.Time2Str(time.Now().AddDate(0, 0, -2)), utils.Time2Str(time.Now()))
|
||||
//刷新门店分组管理
|
||||
@@ -706,22 +706,22 @@ func refreshPointOrderNewEarningPrice() {
|
||||
}
|
||||
}
|
||||
|
||||
func RefreshAfsOrderStatusAccess(ctx *jxcontext.Context) {
|
||||
var (
|
||||
offset = 0
|
||||
pageSize = 9999
|
||||
db = dao.GetDB()
|
||||
)
|
||||
afsOrderList, _, err := dao.GetAfsOrdersByPage(db, "", "", "", time.Now().AddDate(0, 0, -7), time.Now(), offset, pageSize)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
for _, v := range afsOrderList {
|
||||
if v.Status == model.AfsOrderStatusWait4Approve && time.Now().Sub(v.AfsCreatedAt).Hours() > 12 {
|
||||
defsch.FixedScheduler.AgreeOrRefuseRefund(ctx, v.AfsOrderID, v.VendorID, model.AfsTypePartRefund, "超时系统同意")
|
||||
}
|
||||
}
|
||||
}
|
||||
//func RefreshAfsOrderStatusAccess(ctx *jxcontext.Context) {
|
||||
// var (
|
||||
// offset = 0
|
||||
// pageSize = 9999
|
||||
// db = dao.GetDB()
|
||||
// )
|
||||
// afsOrderList, _, err := dao.GetAfsOrdersByPage(db, "", "", "", time.Now().AddDate(0, 0, -7), time.Now(), offset, pageSize)
|
||||
// if err != nil {
|
||||
// return
|
||||
// }
|
||||
// for _, v := range afsOrderList {
|
||||
// if v.Status == model.AfsOrderStatusWait4Approve && time.Now().Sub(v.AfsCreatedAt).Hours() > 12 {
|
||||
// defsch.FixedScheduler.AgreeOrRefuseRefund(ctx, v.AfsOrderID, v.VendorID, model.AfsTypePartRefund, "超时系统同意")
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
func RefreshRealMobile(ctx *jxcontext.Context, vendorID int, fromTime, toTime time.Time, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
handler := partner.GetPurchasePlatformFromVendorID(vendorID)
|
||||
|
||||
Reference in New Issue
Block a user