Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
go_sku_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
afbeec05
authored
May 15, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-可选批次以及交期-20260515' into dev
parents
bdc747ab
d10ccdf7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
model/ly_sku.go
service/service_ly_common.go
service/service_sku_batch.go
model/ly_sku.go
View file @
afbeec05
...
@@ -105,7 +105,6 @@ type LySku struct {
...
@@ -105,7 +105,6 @@ type LySku struct {
Cost
float64
`json:"cost"`
Cost
float64
`json:"cost"`
CostUs
float64
`json:"cost_us"`
CostUs
float64
`json:"cost_us"`
IsZiying
int
`json:"is_ziying"`
IsZiying
int
`json:"is_ziying"`
Batch
string
`json:"-"`
BatchFormat
interface
{}
`json:"batch_format"`
BatchFormat
interface
{}
`json:"batch_format"`
}
}
...
@@ -313,8 +312,6 @@ func InitSkuData(sku string) (data LySku) {
...
@@ -313,8 +312,6 @@ func InitSkuData(sku string) (data LySku) {
data
.
AbilityLevel
=
int
(
gjson
.
Get
(
sku
,
"ability_level"
)
.
Int
())
data
.
AbilityLevel
=
int
(
gjson
.
Get
(
sku
,
"ability_level"
)
.
Int
())
data
.
Batch
=
gjson
.
Get
(
sku
,
"batch"
)
.
String
()
return
return
}
}
...
...
service/service_ly_common.go
View file @
afbeec05
...
@@ -252,7 +252,6 @@ func (ls *LyService) GetIsBuy(sku model.LySku) (isBuy int) {
...
@@ -252,7 +252,6 @@ func (ls *LyService) GetIsBuy(sku model.LySku) (isBuy int) {
if
len
(
sku
.
LadderPrice
)
==
0
{
if
len
(
sku
.
LadderPrice
)
==
0
{
return
return
}
}
//L0016691 L0015730 L0015835 L0016793 L0016887 L0016886 L0016784
//L0016691 L0015730 L0015835 L0016793 L0016887 L0016886 L0016784
if
sku
.
AbilityLevel
==
0
&&
sku
.
OrgId
==
1
&&
(
sku
.
Canal
!=
"L0015730"
&&
sku
.
Canal
!=
"L0015835"
&&
sku
.
Canal
!=
"L0016691"
&&
sku
.
Canal
!=
"L0016793"
&&
sku
.
Canal
!=
"L0016887"
&&
sku
.
Canal
!=
"L0016886"
&&
sku
.
Canal
!=
"L0016784"
)
{
if
sku
.
AbilityLevel
==
0
&&
sku
.
OrgId
==
1
&&
(
sku
.
Canal
!=
"L0015730"
&&
sku
.
Canal
!=
"L0015835"
&&
sku
.
Canal
!=
"L0016691"
&&
sku
.
Canal
!=
"L0016793"
&&
sku
.
Canal
!=
"L0016887"
&&
sku
.
Canal
!=
"L0016886"
&&
sku
.
Canal
!=
"L0016784"
)
{
return
return
...
...
service/service_sku_batch.go
View file @
afbeec05
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"encoding/json"
"encoding/json"
"go_sku_server/model"
"go_sku_server/model"
"go_sku_server/pkg/gredis"
"go_sku_server/pkg/gredis"
"regexp"
"strconv"
"strconv"
"strings"
"strings"
...
@@ -11,6 +12,8 @@ import (
...
@@ -11,6 +12,8 @@ import (
"github.com/tidwall/gjson"
"github.com/tidwall/gjson"
)
)
var
fourDigitRegex
=
regexp
.
MustCompile
(
`^\d{4}$`
)
var
batchCodeMap
=
map
[
int
]
string
{
var
batchCodeMap
=
map
[
int
]
string
{
-
1
:
"无法指定"
,
-
1
:
"无法指定"
,
1
:
"任意批次"
,
1
:
"任意批次"
,
...
@@ -22,17 +25,24 @@ var batchCodeMap = map[int]string{
...
@@ -22,17 +25,24 @@ var batchCodeMap = map[int]string{
}
}
func
(
ls
*
LyService
)
GetSkuBatchFormat
(
sku
*
model
.
LySku
)
{
func
(
ls
*
LyService
)
GetSkuBatchFormat
(
sku
*
model
.
LySku
)
{
if
sku
.
Batch
!=
""
{
if
sku
.
BatchSn
!=
""
{
var
batchObj
map
[
string
]
interface
{}
if
err
:=
json
.
Unmarshal
([]
byte
(
sku
.
Batch
),
&
batchObj
);
err
==
nil
{
var
items
[]
model
.
BatchFormatItem
var
items
[]
model
.
BatchFormatItem
var
batchObj
map
[
string
]
interface
{}
if
err
:=
json
.
Unmarshal
([]
byte
(
sku
.
BatchSn
),
&
batchObj
);
err
==
nil
{
for
k
,
v
:=
range
batchObj
{
for
k
,
v
:=
range
batchObj
{
items
=
append
(
items
,
model
.
BatchFormatItem
{
Name
:
k
,
Value
:
v
})
items
=
append
(
items
,
model
.
BatchFormatItem
{
Name
:
k
,
Value
:
v
})
}
}
sku
.
BatchFormat
=
items
}
else
if
sku
.
IsZiying
==
1
&&
fourDigitRegex
.
MatchString
(
sku
.
BatchSn
)
{
items
=
append
(
items
,
model
.
BatchFormatItem
{
Name
:
sku
.
BatchSn
[
:
2
]
+
"+"
,
Value
:
sku
.
BatchSn
,
})
}
else
{
}
else
{
sku
.
BatchFormat
=
sku
.
Batch
items
=
append
(
items
,
model
.
BatchFormatItem
{
Value
:
sku
.
BatchSn
})
}
}
sku
.
BatchFormat
=
items
return
return
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment