Commit 9e0d1cfb authored by zhangyong's avatar zhangyong

11

parent 9866fead
......@@ -13,9 +13,9 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
private OpenInterceptor openInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
/* //注册自定义拦截器,添加拦截路径和排除拦截路径
System.out.println("-addInterceptors------");
//注册自定义拦截器,添加拦截路径和排除拦截路径
/*System.out.println("-addInterceptors------");
registry.addInterceptor(openInterceptor).excludePathPatterns("api/path/login");
super.addInterceptors(registry);*/
super.addInterceptors(registry); */
}
}
......@@ -16,7 +16,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import com.egolm.common.GsonUtil;
import com.egolm.common.HttpUtil;
import com.egolm.common.MD5Util;
import com.egolm.common.StringUtil;
import com.egolm.shop.config.XException;
......@@ -29,7 +28,7 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
String encoding = "UTF-8";
@Autowired
private RedisTemplate redisTemplate;
private RedisTemplate<String,Object> redisTemplate;
/*签名规则:1.按照参数字段名ASCII码排序;2.参数进行url拼接;3.加上签名字符串secret;4.得到字符串后进行SHA1签名;5.将签名得到的字符串加入参数列表中,字段名为sig*/
@Override
......@@ -53,6 +52,9 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
String value = req.getParameter(key);
parameters.put(key,value);
}
redisTemplate.opsForHash().put("SystemCtl1111", "test","111");
System.out.println(redisTemplate.opsForHash().get("SystemCtl1111", "test"));
Map<String,Object> map = (Map<String,Object>)redisTemplate.opsForHash().get(ShopContstrant.SystemCtl_Redis_Base_Key, ShopContstrant.CLIENT_MD5KEY);
System.out.println(map);
......
......@@ -65,7 +65,7 @@ public class BrandController {
Page page = new Page();
page.setIndex(Long.valueOf(index));
page.setLimit(Long.valueOf(limit));
page.setLimitKey("BannerID asc");
page.setLimitKey(" Idx asc");
List<Map<String, Object>> detailList = brandService.listBanner(param, page);
return Rjx.jsonOk().set("list", detailList).setPage(page).toString();
......
......@@ -28,8 +28,15 @@ public class BrandServiceImpl implements BrandService {
@Override
public List<Map<String,Object>> listBanner(Map<String,Object> params, Page page){
String orgNO = params.get("orgNO")+"";
String sql = "select nItem BannerID, nIdx Idx, sTitle Title, sLinkType LinkType, sLinkPath LinkUrl, sImagePath ImgPath from tBanner where sOrgList like '%" + orgNO + "%'";
// return jdbcTemplate.queryForList(sql);
String sql = "select nItem BannerID, nIdx Idx, sTitle Title, sLinkType LinkType, sLinkPath LinkUrl, sImagePath ImgPath from tBanner"
+ " where CONVERT(varchar(100), dStartTime, 23) <= CONVERT(varchar(100),getdate(), 23) "
+ " AND CONVERT(varchar(100), dEndTime, 23) >= CONVERT(varchar(100),getdate(), 23) "
+ " AND nTag&1=0 ";
if(!orgNO.equals("-1")) {
sql += " AND (sOrgList like '%"+orgNO+"%' or sOrgList = '-1') "; //全部
}else {
sql +=" AND sOrgList like '%"+orgNO+"%' ";
}
jdbcTemplate.setDialect(new SqlServerDialect());
return jdbcTemplate.limit(sql, page);
}
......
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