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
7a4b79a3
Commit
7a4b79a3
authored
Nov 12, 2018
by
zhangyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
80514e88
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
23 deletions
+18
-23
WebMvcConfig.java
src/main/java/com/egolm/shop/config/WebMvcConfig.java
+2
-2
OpenInterceptor.java
...va/com/egolm/shop/config/interceptor/OpenInterceptor.java
+9
-3
GoodsServiceImpl.java
...in/java/com/egolm/shop/service/impl/GoodsServiceImpl.java
+5
-18
ShopContstrant.java
src/main/java/com/egolm/shop/util/ShopContstrant.java
+2
-0
No files found.
src/main/java/com/egolm/shop/config/WebMvcConfig.java
View file @
7a4b79a3
...
@@ -13,9 +13,9 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
...
@@ -13,9 +13,9 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
private
OpenInterceptor
openInterceptor
;
private
OpenInterceptor
openInterceptor
;
@Override
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
//注册自定义拦截器,添加拦截路径和排除拦截路径
/*
//注册自定义拦截器,添加拦截路径和排除拦截路径
System.out.println("-addInterceptors------");
System.out.println("-addInterceptors------");
registry.addInterceptor(openInterceptor).excludePathPatterns("api/path/login");
registry.addInterceptor(openInterceptor).excludePathPatterns("api/path/login");
super
.
addInterceptors
(
registry
);
super.addInterceptors(registry);
*/
}
}
}
}
src/main/java/com/egolm/shop/config/interceptor/OpenInterceptor.java
View file @
7a4b79a3
...
@@ -53,9 +53,15 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
...
@@ -53,9 +53,15 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
String
value
=
req
.
getParameter
(
key
);
String
value
=
req
.
getParameter
(
key
);
parameters
.
put
(
key
,
value
);
parameters
.
put
(
key
,
value
);
}
}
String
md5Key
=
(
String
)
redisTemplate
.
opsForValue
().
get
(
ShopContstrant
.
CLIENT_MD5KEY
);
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
redisTemplate
.
opsForHash
().
get
(
ShopContstrant
.
SystemCtl_Redis_Base_Key
,
ShopContstrant
.
CLIENT_MD5KEY
);
parameters
.
put
(
"md5Key"
,
md5Key
);
System
.
out
.
println
(
map
);
if
(
map
!=
null
)
{
parameters
.
put
(
"md5Key"
,
map
.
get
(
"sValue1"
)+
""
);
}
else
{
logger
.
info
(
"从redis中获取 计算签名用的md5key 获取失败"
);
throw
new
XException
(
I18NUtils
.
getMessage
(
langID
,
"Msg_Sign_failure"
));
}
logger
.
info
(
"request sign >>>>>>"
+
sign
);
logger
.
info
(
"request sign >>>>>>"
+
sign
);
String
createSign
=
MD5Util
.
createSign
(
encoding
,
parameters
);
String
createSign
=
MD5Util
.
createSign
(
encoding
,
parameters
);
...
...
src/main/java/com/egolm/shop/service/impl/GoodsServiceImpl.java
View file @
7a4b79a3
...
@@ -73,24 +73,11 @@ public class GoodsServiceImpl implements GoodsService {
...
@@ -73,24 +73,11 @@ public class GoodsServiceImpl implements GoodsService {
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getHotSaleGoods
(
Map
<
String
,
Object
>
map
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
getHotSaleGoods
(
Map
<
String
,
Object
>
map
,
Page
page
)
{
String
sql
=
"SELECT "
String
sql
=
"SELECT GoodsID = agd.nGoodsID,ContractNO = agd.sAgentContractNO ,SaleQty = sum(agd.nSaleQty), ImageUrl = isnull(g.sURL ,'') "
+
"GoodsID = a.nGoodsID, "
+
" FROM tAgentGoodsDailyOnline agd JOIN tAgentContractGoods acg ON agd.sAgentContractNO = acg.sAgentContractNO "
+
"GoodsNO = g.sGoodsNO, "
+
" LEFT JOIN tGoodsPic g ON agd.nGoodsID = g.nGoodsID AND g.sPicTypeID = '1' AND g.nItem = 1 AND g.nTag&1=0 "
+
"GoodsName = g.sGoodsDesc, "
+
" WHERE acg.nTag&1=0 AND acg.sOrgNO = ? "
+
"Price = acg.nSalePrice, "
+
" GROUP BY agd.nGoodsID,agd.sAgentContractNO,g.sURL "
;
+
"MinQty = acg.nMinSaleQty, "
+
"SaleUnit = acg.nSaleUnits, "
+
"Unit = acg.sUnit, "
+
"MarketPrice = acg.nMarketPrice, "
+
"MarketUnit = acg.sMarketUnit, "
+
"SaleQty = sum(a.nSaleQty) "
+
"FROM tAgentGoodsDailyOnline a "
+
"JOIN tGoods g ON a.nGoodsID = g.nGoodsID "
+
"JOIN tAgentContractGoods acg ON a.sAgentContractNO = acg.sAgentContractNO "
+
"and a.nGoodsID = acg.nGoodsID "
+
"WHERE acg.sOrgNO = ? "
+
"GROUP BY a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, "
+
"acg.nSalePrice, acg.nMinSaleQty, acg.nSaleUnits,acg.sUnit, acg.nMarketPrice, acg.sMarketUnit "
;
String
OrgNO
=(
String
)
map
.
get
(
"OrgNO"
);
String
OrgNO
=(
String
)
map
.
get
(
"OrgNO"
);
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
...
...
src/main/java/com/egolm/shop/util/ShopContstrant.java
View file @
7a4b79a3
...
@@ -11,6 +11,8 @@ public class ShopContstrant {
...
@@ -11,6 +11,8 @@ public class ShopContstrant {
public
static
final
String
SMS_TEMPLATE_CODE
=
"SmsTemplate"
;
//模板字典 code tcommon表
public
static
final
String
SMS_TEMPLATE_CODE
=
"SmsTemplate"
;
//模板字典 code tcommon表
public
static
final
String
SystemCtl_Redis_Base_Key
=
"SystemCtl"
;
//与job服务中缓存的Key一样 存放在 opsForHash中
public
static
final
String
CLIENT_MD5KEY
=
"Client_Md5Key"
;
//客户端计算签名的MD5 Key
public
static
final
String
CLIENT_MD5KEY
=
"Client_Md5Key"
;
//客户端计算签名的MD5 Key
}
}
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