Commit 7a4b79a3 authored by zhangyong's avatar zhangyong

1

parent 80514e88
...@@ -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);*/
} }
} }
...@@ -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);
......
...@@ -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());
......
...@@ -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
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment