Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
786e8e8c
Commit
786e8e8c
authored
Aug 14, 2018
by
Menethil
Browse files
商品信息添加返回原价
parent
82c54a0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallGoodsService.java
View file @
786e8e8c
...
...
@@ -45,7 +45,7 @@ public class LitemallGoodsService {
public
int
countByCategory
(
List
<
Integer
>
catList
,
int
offset
,
int
limit
)
{
LitemallGoodsExample
example
=
new
LitemallGoodsExample
();
example
.
or
().
andCategoryIdIn
(
catList
).
andDeletedEqualTo
(
false
);
return
(
int
)
goodsMapper
.
countByExample
(
example
);
return
(
int
)
goodsMapper
.
countByExample
(
example
);
}
public
List
<
LitemallGoods
>
queryByCategory
(
Integer
catId
,
int
offset
,
int
limit
)
{
...
...
@@ -59,7 +59,7 @@ public class LitemallGoodsService {
public
int
countByCategory
(
Integer
catId
,
Integer
page
,
Integer
size
)
{
LitemallGoodsExample
example
=
new
LitemallGoodsExample
();
example
.
or
().
andCategoryIdEqualTo
(
catId
).
andDeletedEqualTo
(
false
);
return
(
int
)
goodsMapper
.
countByExample
(
example
);
return
(
int
)
goodsMapper
.
countByExample
(
example
);
}
public
List
<
LitemallGoods
>
querySelective
(
Integer
catId
,
Integer
brandId
,
String
keyword
,
Boolean
isHot
,
Boolean
isNew
,
Integer
offset
,
Integer
limit
,
String
sort
,
String
order
)
{
...
...
@@ -67,23 +67,23 @@ public class LitemallGoodsService {
LitemallGoodsExample
.
Criteria
criteria1
=
example
.
or
();
LitemallGoodsExample
.
Criteria
criteria2
=
example
.
or
();
if
(!
StringUtils
.
isEmpty
(
catId
)
&&
catId
!=
0
){
if
(!
StringUtils
.
isEmpty
(
catId
)
&&
catId
!=
0
)
{
criteria1
.
andCategoryIdEqualTo
(
catId
);
criteria2
.
andCategoryIdEqualTo
(
catId
);
}
if
(!
StringUtils
.
isEmpty
(
brandId
)){
if
(!
StringUtils
.
isEmpty
(
brandId
))
{
criteria1
.
andBrandIdEqualTo
(
brandId
);
criteria2
.
andBrandIdEqualTo
(
brandId
);
}
if
(!
StringUtils
.
isEmpty
(
isNew
)){
if
(!
StringUtils
.
isEmpty
(
isNew
))
{
criteria1
.
andIsNewEqualTo
(
isNew
);
criteria2
.
andIsNewEqualTo
(
isNew
);
}
if
(!
StringUtils
.
isEmpty
(
isHot
)){
if
(!
StringUtils
.
isEmpty
(
isHot
))
{
criteria1
.
andIsHotEqualTo
(
isHot
);
criteria2
.
andIsHotEqualTo
(
isHot
);
}
if
(!
StringUtils
.
isEmpty
(
keyword
)){
if
(!
StringUtils
.
isEmpty
(
keyword
))
{
criteria1
.
andKeywordsLike
(
"%"
+
keyword
+
"%"
);
criteria2
.
andNameLike
(
"%"
+
keyword
+
"%"
);
}
...
...
@@ -94,12 +94,12 @@ public class LitemallGoodsService {
example
.
setOrderByClause
(
sort
+
" "
+
order
);
}
if
(!
StringUtils
.
isEmpty
(
limit
)
&&
!
StringUtils
.
isEmpty
(
offset
))
{
if
(!
StringUtils
.
isEmpty
(
limit
)
&&
!
StringUtils
.
isEmpty
(
offset
))
{
PageHelper
.
startPage
(
offset
,
limit
);
}
Column
[]
columns
=
new
Column
[]{
Column
.
id
,
Column
.
name
,
Column
.
picUrl
,
Column
.
retailPrice
};
return
goodsMapper
.
selectByExampleSelective
(
example
,
columns
);
Column
[]
columns
=
new
Column
[]{
Column
.
id
,
Column
.
name
,
Column
.
picUrl
,
Column
.
counterPrice
,
Column
.
retailPrice
};
return
goodsMapper
.
selectByExampleSelective
(
example
,
columns
);
}
public
int
countSelective
(
Integer
catId
,
Integer
brandId
,
String
keyword
,
Boolean
isHot
,
Boolean
isNew
,
Integer
offset
,
Integer
limit
,
String
sort
,
String
order
)
{
...
...
@@ -107,28 +107,28 @@ public class LitemallGoodsService {
LitemallGoodsExample
.
Criteria
criteria1
=
example
.
or
();
LitemallGoodsExample
.
Criteria
criteria2
=
example
.
or
();
if
(!
StringUtils
.
isEmpty
(
catId
)
&&
catId
!=
0
){
if
(!
StringUtils
.
isEmpty
(
catId
)
&&
catId
!=
0
)
{
criteria1
.
andCategoryIdEqualTo
(
catId
);
criteria2
.
andCategoryIdEqualTo
(
catId
);
}
if
(!
StringUtils
.
isEmpty
(
brandId
)){
if
(!
StringUtils
.
isEmpty
(
brandId
))
{
criteria1
.
andBrandIdEqualTo
(
brandId
);
criteria2
.
andBrandIdEqualTo
(
brandId
);
}
if
(!
StringUtils
.
isEmpty
(
isNew
)){
if
(!
StringUtils
.
isEmpty
(
isNew
))
{
criteria1
.
andIsNewEqualTo
(
isNew
);
criteria2
.
andIsNewEqualTo
(
isNew
);
}
if
(!
StringUtils
.
isEmpty
(
isHot
)){
if
(!
StringUtils
.
isEmpty
(
isHot
))
{
criteria1
.
andIsHotEqualTo
(
isHot
);
criteria2
.
andIsHotEqualTo
(
isHot
);
}
if
(!
StringUtils
.
isEmpty
(
keyword
)){
if
(!
StringUtils
.
isEmpty
(
keyword
))
{
criteria1
.
andKeywordsLike
(
"%"
+
keyword
+
"%"
);
criteria2
.
andNameLike
(
"%"
+
keyword
+
"%"
);
}
return
(
int
)
goodsMapper
.
countByExample
(
example
);
return
(
int
)
goodsMapper
.
countByExample
(
example
);
}
public
LitemallGoods
findById
(
Integer
id
)
{
...
...
@@ -147,17 +147,17 @@ public class LitemallGoodsService {
public
Integer
queryOnSale
()
{
LitemallGoodsExample
example
=
new
LitemallGoodsExample
();
example
.
or
().
andIsOnSaleEqualTo
(
true
).
andDeletedEqualTo
(
false
);
return
(
int
)
goodsMapper
.
countByExample
(
example
);
return
(
int
)
goodsMapper
.
countByExample
(
example
);
}
public
List
<
LitemallGoods
>
querySelective
(
String
goodsSn
,
String
name
,
Integer
page
,
Integer
size
,
String
sort
,
String
order
)
{
LitemallGoodsExample
example
=
new
LitemallGoodsExample
();
LitemallGoodsExample
.
Criteria
criteria
=
example
.
createCriteria
();
if
(!
StringUtils
.
isEmpty
(
goodsSn
)){
if
(!
StringUtils
.
isEmpty
(
goodsSn
))
{
criteria
.
andGoodsSnEqualTo
(
goodsSn
);
}
if
(!
StringUtils
.
isEmpty
(
name
)){
if
(!
StringUtils
.
isEmpty
(
name
))
{
criteria
.
andNameLike
(
"%"
+
name
+
"%"
);
}
criteria
.
andDeletedEqualTo
(
false
);
...
...
@@ -170,15 +170,15 @@ public class LitemallGoodsService {
LitemallGoodsExample
example
=
new
LitemallGoodsExample
();
LitemallGoodsExample
.
Criteria
criteria
=
example
.
createCriteria
();
if
(!
StringUtils
.
isEmpty
(
goodsSn
)){
if
(!
StringUtils
.
isEmpty
(
goodsSn
))
{
criteria
.
andGoodsSnEqualTo
(
goodsSn
);
}
if
(!
StringUtils
.
isEmpty
(
name
)){
if
(!
StringUtils
.
isEmpty
(
name
))
{
criteria
.
andNameLike
(
"%"
+
name
+
"%"
);
}
criteria
.
andDeletedEqualTo
(
false
);
return
(
int
)
goodsMapper
.
countByExample
(
example
);
return
(
int
)
goodsMapper
.
countByExample
(
example
);
}
public
void
updateById
(
LitemallGoods
goods
)
{
...
...
@@ -196,7 +196,7 @@ public class LitemallGoodsService {
public
int
count
()
{
LitemallGoodsExample
example
=
new
LitemallGoodsExample
();
example
.
or
().
andDeletedEqualTo
(
false
);
return
(
int
)
goodsMapper
.
countByExample
(
example
);
return
(
int
)
goodsMapper
.
countByExample
(
example
);
}
public
List
<
Integer
>
getCatIds
(
Integer
brandId
,
String
keyword
,
Boolean
isHot
,
Boolean
isNew
)
{
...
...
@@ -204,26 +204,26 @@ public class LitemallGoodsService {
LitemallGoodsExample
.
Criteria
criteria1
=
example
.
or
();
LitemallGoodsExample
.
Criteria
criteria2
=
example
.
or
();
if
(!
StringUtils
.
isEmpty
(
brandId
)){
if
(!
StringUtils
.
isEmpty
(
brandId
))
{
criteria1
.
andBrandIdEqualTo
(
brandId
);
criteria2
.
andBrandIdEqualTo
(
brandId
);
}
if
(!
StringUtils
.
isEmpty
(
isNew
)){
if
(!
StringUtils
.
isEmpty
(
isNew
))
{
criteria1
.
andIsNewEqualTo
(
isNew
);
criteria2
.
andIsNewEqualTo
(
isNew
);
}
if
(!
StringUtils
.
isEmpty
(
isHot
)){
if
(!
StringUtils
.
isEmpty
(
isHot
))
{
criteria1
.
andIsHotEqualTo
(
isHot
);
criteria2
.
andIsHotEqualTo
(
isHot
);
}
if
(!
StringUtils
.
isEmpty
(
keyword
)){
if
(!
StringUtils
.
isEmpty
(
keyword
))
{
criteria1
.
andKeywordsLike
(
"%"
+
keyword
+
"%"
);
criteria2
.
andNameLike
(
"%"
+
keyword
+
"%"
);
}
List
<
LitemallGoods
>
goodsList
=
goodsMapper
.
selectByExampleSelective
(
example
,
Column
.
categoryId
);
List
<
Integer
>
cats
=
new
ArrayList
<
Integer
>();
for
(
LitemallGoods
goods
:
goodsList
){
for
(
LitemallGoods
goods
:
goodsList
)
{
cats
.
add
(
goods
.
getCategoryId
());
}
return
cats
;
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxOrderController.java
View file @
786e8e8c
...
...
@@ -291,7 +291,7 @@ public class WxOrderController {
}
//团购活动已经过期
if
(
grouponRulesService
.
isExpired
(
rules
))
{
return
ResponseUtil
.
fail
(
402
,
"团购活动已
经
过期!"
);
return
ResponseUtil
.
fail
(
402
,
"团购活动已过期!"
);
}
}
...
...
Write
Preview
Supports
Markdown
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