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
a342aeb8
Commit
a342aeb8
authored
Oct 07, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
1ddd0647
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
GoodsController.java
src/main/java/com/egolm/shop/controller/GoodsController.java
+20
-0
GoodsService.java
src/main/java/com/egolm/shop/service/GoodsService.java
+2
-0
GoodsServiceImpl.java
...in/java/com/egolm/shop/service/impl/GoodsServiceImpl.java
+14
-0
No files found.
src/main/java/com/egolm/shop/controller/GoodsController.java
View file @
a342aeb8
...
...
@@ -18,6 +18,7 @@ import com.egolm.common.StringUtil;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.common.web.ServletUtil
;
import
com.egolm.shop.config.XException
;
import
com.egolm.shop.service.GoodsService
;
import
com.egolm.shop.util.I18NUtils
;
...
...
@@ -227,6 +228,25 @@ public class GoodsController {
return
goodsService
.
queryGoodsPrice
(
jsonObj
);
}
@ApiOperation
(
"收藏及取消收藏"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"uid"
,
dataType
=
"String"
,
required
=
true
,
value
=
"商品唯一标识"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"shopNo"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
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
=
""
)
})
@RequestMapping
(
value
=
"/queryStockPrice"
,
method
=
RequestMethod
.
GET
)
public
String
queryStockPrice
(
String
uid
,
String
shopNo
,
String
orgNo
)
{
XException
.
assertNotBlank
(
uid
,
"商品唯一标识不能为空"
);
uid
=
uid
.
replaceAll
(
"\\s+"
,
""
);
String
[]
uidAry
=
uid
.
split
(
","
);
Map
<
String
,
Map
<
String
,
Object
>>
map
=
goodsService
.
queryStockPrice
(
orgNo
,
shopNo
,
uidAry
);
return
Rjx
.
jsonOk
().
setData
(
map
).
toJson
();
}
@ApiOperation
(
"收藏及取消收藏"
)
@ApiImplicitParams
({
...
...
src/main/java/com/egolm/shop/service/GoodsService.java
View file @
a342aeb8
...
...
@@ -50,4 +50,6 @@ public interface GoodsService {
* @throws
*/
public
String
updateFlavor
(
Map
<
String
,
Object
>
params
);
public
Map
<
String
,
Map
<
String
,
Object
>>
queryStockPrice
(
String
orgNo
,
String
shopNo
,
String
[]
uid
);
}
src/main/java/com/egolm/shop/service/impl/GoodsServiceImpl.java
View file @
a342aeb8
...
...
@@ -502,4 +502,18 @@ public class GoodsServiceImpl implements GoodsService {
String
sql
=
"insert into tShopSearchLog (sShopNO, sKeyword, sOriginalKeyWord, sTypeID, dLastUpdateTime) values (?, ?, ?, ?, ?)"
;
jdbcTemplate
.
update
(
sql
,
new
Object
[]{
ShopNO
,
key
,
key
,
typeID
,
new
Date
()});
}
@Override
public
Map
<
String
,
Map
<
String
,
Object
>>
queryStockPrice
(
String
orgNo
,
String
shopNo
,
String
[]
uidAry
)
{
List
<
String
>
args
=
new
ArrayList
<
String
>();
for
(
String
uid
:
uidAry
)
{
String
[]
kv
=
uid
.
split
(
":"
,
2
);
args
.
add
(
"(sAgentContractNO = '"
+
kv
[
0
]
+
"' and nGoodsID = "
+
kv
[
1
]
+
")"
);
}
String
sql
=
"select sAgentContractNO, nGoodsID, nStockQty, nRealSalePrice from V_OrgGoods where sOrgNO = ? "
+
StringUtil
.
join
(
" OR "
,
" and ("
,
")"
,
" and (1 = 0) "
,
args
);
List
<
Map
<
String
,
Object
>>
datas
=
jdbcTemplate
.
queryForList
(
sql
);
Map
<
String
,
Map
<
String
,
Object
>>
mm
=
Util
.
listToMM
(
datas
,
":"
,
"sAgentContractNO"
,
"nGoodsID"
);
return
mm
;
}
}
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