Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
shop
Commits
3c8965d8
Commit
3c8965d8
authored
Nov 11, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
fe16a0ab
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
88 deletions
+31
-88
CartController.java
src/main/java/com/egolm/shop/controller/CartController.java
+1
-1
PromoController.java
src/main/java/com/egolm/shop/controller/PromoController.java
+0
-54
PromoService.java
src/main/java/com/egolm/shop/service/PromoService.java
+0
-2
CartServiceImpl.java
...ain/java/com/egolm/shop/service/impl/CartServiceImpl.java
+30
-25
PromoServiceImpl.java
...in/java/com/egolm/shop/service/impl/PromoServiceImpl.java
+0
-6
No files found.
src/main/java/com/egolm/shop/controller/CartController.java
View file @
3c8965d8
...
...
@@ -70,7 +70,7 @@ public class CartController {
@ApiOperation
(
"加入购物车(JSON格式)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"data"
,
dataType
=
"String"
,
required
=
false
,
value
=
"JSON格式"
,
defaultValue
=
"{\"shopNO\": \"00029975\",\"cartList\": [{\"goodsID\": \"30771\",\"goodsTypeID\": 0,\"saleQty\": \"24\",\"agentContractNO\": \"600327002\",\"promoGroupNO\":\"\",\"promoPaperNO\":\"00001810100007\"}]}"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"data"
,
dataType
=
"String"
,
required
=
false
,
value
=
"JSON格式"
,
defaultValue
=
"{\"shopNO\": \"00029975\",\"cartList\": [{\"goodsID\": \"30771\",\"goodsTypeID\": 0,\"saleQty\": \"24\",
\"setPrice\": \"10.5\",
\"agentContractNO\": \"600327002\",\"promoGroupNO\":\"\",\"promoPaperNO\":\"00001810100007\"}]}"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
...
...
src/main/java/com/egolm/shop/controller/PromoController.java
View file @
3c8965d8
...
...
@@ -102,58 +102,4 @@ public class PromoController {
return
Rjx
.
jsonOk
().
set
(
"data"
,
promoMap
).
set
(
"list"
,
list
).
set
(
"DLPicList"
,
DLPicList
).
set
(
"BNPicList"
,
BNPicList
).
toJson
();
}
@ApiOperation
(
"获取秒杀促销列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"shopNo"
,
dataType
=
"String"
,
required
=
true
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
true
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@GetMapping
(
"getFlashSaleList"
)
public
Object
getFlashSaleList
(
String
orgNo
,
String
shopNo
,
Long
index
,
Long
limit
)
{
index
=
index
==
null
?
1
:
index
;
limit
=
limit
==
null
?
20
:
limit
;
Page
page
=
new
Page
(
index
,
limit
);
List
<
Map
<
String
,
Object
>>
list
=
service
.
getFlashSaleList
(
orgNo
,
shopNo
,
page
);
return
Rjx
.
jsonOk
().
set
(
"list"
,
list
).
set
(
"page"
,
page
).
toJson
();
}
@ApiOperation
(
"获取限时购促销列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"shopNo"
,
dataType
=
"String"
,
required
=
true
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
true
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@GetMapping
(
"getTimeLimitList"
)
public
Object
getTimeLimitList
(
String
orgNo
,
String
shopNo
,
Long
index
,
Long
limit
)
{
index
=
index
==
null
?
1
:
index
;
limit
=
limit
==
null
?
20
:
limit
;
Page
page
=
new
Page
(
index
,
limit
);
List
<
Map
<
String
,
Object
>>
list
=
null
;
return
Rjx
.
jsonOk
().
set
(
"list"
,
list
).
set
(
"page"
,
page
).
toJson
();
}
@ApiOperation
(
"获取砍价促销列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"shopNo"
,
dataType
=
"String"
,
required
=
true
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
true
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@GetMapping
(
"getBargainList"
)
public
Object
getBargainList
(
String
orgNo
,
String
shopNo
,
Long
index
,
Long
limit
)
{
index
=
index
==
null
?
1
:
index
;
limit
=
limit
==
null
?
20
:
limit
;
Page
page
=
new
Page
(
index
,
limit
);
List
<
Map
<
String
,
Object
>>
list
=
null
;
return
Rjx
.
jsonOk
().
set
(
"list"
,
list
).
set
(
"page"
,
page
).
toJson
();
}
}
src/main/java/com/egolm/shop/service/PromoService.java
View file @
3c8965d8
...
...
@@ -15,6 +15,4 @@ public interface PromoService {
Map
<
String
,
Object
>
getPromoDetail
(
String
promoPaperNO
);
List
<
Map
<
String
,
Object
>>
getFlashSaleList
(
String
orgNo
,
String
shopNo
,
Page
page
);
}
src/main/java/com/egolm/shop/service/impl/CartServiceImpl.java
View file @
3c8965d8
...
...
@@ -25,6 +25,10 @@ public class CartServiceImpl implements CartService {
@Autowired
private
CartQueryService
cartRedisService
;
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
Util
.
objTo
(
"190.0999"
,
BigDecimal
.
class
,
null
));
}
public
String
append
(
JSONObject
obj
,
String
terminal
)
{
String
shopNO
=
obj
.
getString
(
"shopNO"
);
String
orgNo
=
obj
.
getString
(
"orgNo"
);
...
...
@@ -41,6 +45,7 @@ public class CartServiceImpl implements CartService {
Integer
nGoodsTypeID
=
Util
.
objTo
(
cartObj
.
get
(
"goodsTypeID"
),
Integer
.
class
,
0
);
Integer
nSaleQty
=
Util
.
objTo
(
cartObj
.
get
(
"saleQty"
),
Integer
.
class
,
null
);
BigDecimal
nSetPrice
=
Util
.
objTo
(
cartObj
.
get
(
"setPrice"
),
BigDecimal
.
class
,
null
);
Integer
nGoodsID
=
Util
.
objTo
(
cartObj
.
get
(
"goodsID"
),
Integer
.
class
,
null
);
String
sAgentContractNO
=
Util
.
objTo
(
cartObj
.
get
(
"agentContractNO"
),
String
.
class
);
String
sPromoPaperNO
=
Util
.
objTo
(
cartObj
.
get
(
"promoPaperNO"
),
String
.
class
,
null
);
...
...
@@ -49,32 +54,32 @@ public class CartServiceImpl implements CartService {
if
(
StringUtil
.
isNotBlank
(
sPromoPaperNO
)
&&
StringUtil
.
isNotBlank
(
sPromoGroupNO
))
{
}
else
{
List
<
String
>
strs
=
new
ArrayList
<
String
>();
strs
.
add
(
"sOrgNO = '"
+
orgNo
+
"'"
);
strs
.
add
(
"sShopNO = '"
+
shopNO
+
"'"
);
strs
.
add
(
"nTag = "
+
nGoodsTypeID
);
strs
.
add
(
"sAgentContractNO = '"
+
sAgentContractNO
+
"'"
);
strs
.
add
(
"nGoodsID = "
+
nGoodsID
);
if
(
StringUtil
.
isNotBlank
(
sPromoPaperNO
))
{
strs
.
add
(
"sPromoPaperNO = '"
+
sPromoPaperNO
+
"'"
);
}
else
{
strs
.
add
(
"(sPromoPaperNO = '' or sPromoPaperNO is null)"
);
}
if
(
StringUtil
.
isNotBlank
(
sPromoGroupNO
))
{
strs
.
add
(
"sPromoGroupNO = '"
+
sPromoGroupNO
+
"'"
);
}
else
{
strs
.
add
(
"(sPromoGroupNO = '' or sPromoGroupNO is null)"
);
}
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
queryForList
(
"select nIdx, nSaleQty, sPromoPaperNO from tCart"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
strs
));
if
(
list
.
size
()
==
0
)
{
Object
[]
args
=
new
Object
[]{
shopNO
,
orgNo
,
++
nMaxIdx
,
nGoodsTypeID
,
sAgentContractNO
,
nGoodsID
,
nSaleQty
,
sPromoPaperNO
,
sPromoGroupNO
};
jdbcTemplate
.
executeUpdate
(
"insert into tCart (sShopNO, sOrgNO, nIdx, nTag, sAgentContractNO, nGoodsID, nSaleQty, dLastUpdateTime, sPromoPaperNO, sPromoGroupNO) values (?, ?, ?, ?, ?, ?, ?, getdate(), ?, ?)"
,
args
);
}
else
{
Integer
nIdx
=
Util
.
objTo
(
list
.
get
(
0
).
get
(
"nIdx"
),
Integer
.
class
);
Double
nQty
=
Util
.
objTo
(
list
.
get
(
0
).
get
(
"nSaleQty"
),
Double
.
class
);
jdbcTemplate
.
executeUpdate
(
"update tCart set nSaleQty = "
+
(
nSaleQty
+
nQty
)
+
" where sOrgNO = '"
+
orgNo
+
"' and sShopNO = '"
+
shopNO
+
"' and nIdx = "
+
nIdx
);
}
List
<
String
>
strs
=
new
ArrayList
<
String
>();
strs
.
add
(
"sOrgNO = '"
+
orgNo
+
"'"
);
strs
.
add
(
"sShopNO = '"
+
shopNO
+
"'"
);
strs
.
add
(
"nTag = "
+
nGoodsTypeID
);
strs
.
add
(
"sAgentContractNO = '"
+
sAgentContractNO
+
"'"
);
strs
.
add
(
"nGoodsID = "
+
nGoodsID
);
if
(
StringUtil
.
isNotBlank
(
sPromoPaperNO
))
{
strs
.
add
(
"sPromoPaperNO = '"
+
sPromoPaperNO
+
"'"
);
}
else
{
strs
.
add
(
"(sPromoPaperNO = '' or sPromoPaperNO is null)"
);
}
if
(
StringUtil
.
isNotBlank
(
sPromoGroupNO
))
{
strs
.
add
(
"sPromoGroupNO = '"
+
sPromoGroupNO
+
"'"
);
}
else
{
strs
.
add
(
"(sPromoGroupNO = '' or sPromoGroupNO is null)"
);
}
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
queryForList
(
"select nIdx, nSaleQty, sPromoPaperNO from tCart"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
strs
));
if
(
list
.
size
()
==
0
)
{
Object
[]
args
=
new
Object
[]{
shopNO
,
orgNo
,
++
nMaxIdx
,
nGoodsTypeID
,
sAgentContractNO
,
nGoodsID
,
nSaleQty
,
nSetPrice
,
sPromoPaperNO
,
sPromoGroupNO
};
jdbcTemplate
.
executeUpdate
(
"insert into tCart (sShopNO, sOrgNO, nIdx, nTag, sAgentContractNO, nGoodsID, nSaleQty, nSetPrice, dLastUpdateTime, sPromoPaperNO, sPromoGroupNO) values (?, ?, ?, ?, ?, ?, ?, ?, getdate(), ?, ?)"
,
args
);
}
else
{
Integer
nIdx
=
Util
.
objTo
(
list
.
get
(
0
).
get
(
"nIdx"
),
Integer
.
class
);
Double
nQty
=
Util
.
objTo
(
list
.
get
(
0
).
get
(
"nSaleQty"
),
Double
.
class
);
jdbcTemplate
.
executeUpdate
(
"update tCart set nSaleQty = "
+
(
nSaleQty
+
nQty
)
+
", nSetPrice = ? where sOrgNO = ? and sShopNO = ? and nIdx = ?"
,
nSetPrice
,
orgNo
,
shopNO
,
nIdx
);
}
}
}
}
return
Rjx
.
jsonOk
().
set
(
"count"
,
count
(
orgNo
,
shopNO
)).
toJson
();
...
...
src/main/java/com/egolm/shop/service/impl/PromoServiceImpl.java
View file @
3c8965d8
...
...
@@ -113,10 +113,4 @@ public class PromoServiceImpl implements PromoService {
return
jdbcTemplate
.
queryForMap
(
"select * from tPromo where sPromoPaperNO = ? and nTag&3 = 2"
,
promoPaperNO
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
getFlashSaleList
(
String
orgNo
,
String
shopNo
,
Page
page
)
{
return
null
;
}
}
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