Commit 33bab768 authored by Quxl's avatar Quxl

Merge branch 'master' of http://key@gitlab.egolm.com/key/shop.git

parents b8265ac0 87647a66
...@@ -22,7 +22,7 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -22,7 +22,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@Api(tags={"页面相关接口"}) @Api(tags={"首页相关接口"})
@RestController @RestController
@RequestMapping("page") @RequestMapping("page")
public class PageController { public class PageController {
...@@ -30,7 +30,84 @@ public class PageController { ...@@ -30,7 +30,84 @@ public class PageController {
@Autowired @Autowired
private PageService pageService; private PageService pageService;
@ApiOperation("查询(只有一条)") @ApiOperation("查询banner")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "LangID", dataType = "String", required = true, 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 = ""),
@ApiImplicitParam(paramType = "query", name = "orgNO", dataType = "String", required = true, value = "组织机构", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "typeID", dataType = "String", required = true, value = "类型", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "index", dataType = "int", required = true, value = "页码", defaultValue = "1"),
@ApiImplicitParam(paramType = "query", name = "limit", dataType = "int", required = true, value = "每页显示数", defaultValue = "10"),
})
@RequestMapping(value = "/queryBanner",method=RequestMethod.GET)
public String queryBanner(HttpServletRequest request) {
String orgNO = request.getParameter("orgNO");
String typeID = request.getParameter("typeID");
String index = request.getParameter("index");
String limit = request.getParameter("limit");
if(!StringUtil.isNotEmpty(orgNO,typeID,index,limit)) {
return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(orgNO,typeID, "Msg_Parameter_empty")).toJson();
}
Map<String,Object> params = new HashMap<String,Object>();
params.put("orgNO", orgNO);
params.put("typeID", typeID);
Page page = new Page();
page.setIndex(Long.valueOf(index));
page.setLimit(Long.valueOf(limit));
page.setLimitKey(" Idx asc");
List<Map<String,Object>> iconList = pageService.queryBanner(params,page);
if(iconList != null && iconList.size() >0) {
return Rjx.jsonOk().set("list", iconList).toString();
}else {
return Rjx.jsonOk().set("list", new HashMap<String,Object>()).toString();
}
}
@ApiOperation("查询快报")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "LangID", dataType = "String", required = true, 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 = ""),
@ApiImplicitParam(paramType = "query", name = "orgNO", dataType = "String", required = true, value = "组织机构", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "msgTypeID", dataType = "String", required = true, value = "快报类型", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "index", dataType = "int", required = true, value = "页码", defaultValue = "1"),
@ApiImplicitParam(paramType = "query", name = "limit", dataType = "int", required = true, value = "每页显示数", defaultValue = "10"),
})
@RequestMapping(value = "/queryNews",method=RequestMethod.GET)
public String queryNews(HttpServletRequest request) {
String orgNO = request.getParameter("orgNO");
String msgTypeID = request.getParameter("msgTypeID");
String index = request.getParameter("index");
String limit = request.getParameter("limit");
if(!StringUtil.isNotEmpty(orgNO,msgTypeID,index,limit)) {
return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(orgNO,msgTypeID, "Msg_Parameter_empty")).toJson();
}
Map<String,Object> params = new HashMap<String,Object>();
params.put("orgNO", orgNO);
params.put("msgTypeID", msgTypeID);
Page page = new Page();
page.setIndex(Long.valueOf(index));
page.setLimit(Long.valueOf(limit));
page.setLimitKey(" Sort desc ,TradeDate desc ");
List<Map<String,Object>> iconList = pageService.queryNews(params,page);
if(iconList != null && iconList.size() >0) {
return Rjx.jsonOk().set("list", iconList).toString();
}else {
return Rjx.jsonOk().set("list", new HashMap<String,Object>()).toString();
}
}
/*@ApiOperation("查询(只有一条)")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "LangID", dataType = "String", required = true, value = "语言", defaultValue = "936"), @ApiImplicitParam(paramType = "query", name = "LangID", dataType = "String", required = true, value = "语言", defaultValue = "936"),
@ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""),
...@@ -86,6 +163,6 @@ public class PageController { ...@@ -86,6 +163,6 @@ public class PageController {
return Rjx.jsonOk().set("list", new HashMap<String,Object>()).toString(); return Rjx.jsonOk().set("list", new HashMap<String,Object>()).toString();
} }
} }*/
} }
...@@ -9,4 +9,9 @@ public interface PageService { ...@@ -9,4 +9,9 @@ public interface PageService {
public List<Map<String, Object>> query(Map<String, Object> params); public List<Map<String, Object>> query(Map<String, Object> params);
public List<Map<String, Object>> queryIcon(Map<String, Object> params,Page page); public List<Map<String, Object>> queryIcon(Map<String, Object> params,Page page);
public List<Map<String, Object>> queryBanner(Map<String, Object> params,Page page);
public List<Map<String, Object>> queryNews(Map<String, Object> params,Page page);
} }
...@@ -51,5 +51,51 @@ public class PageServiceImpl implements PageService { ...@@ -51,5 +51,51 @@ public class PageServiceImpl implements PageService {
return jdbcTemplate.limit(sql, page, iconGroupNO); return jdbcTemplate.limit(sql, page, iconGroupNO);
} }
/**
* 查询banner
* @Title: queryBanner
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param @param params
* @param @param page
* @param @return 设定文件
* @return 返回类型
* @throws
*/
public List<Map<String, Object>> queryBanner(Map<String, Object> params, Page page) {
String orgNO = params.get("orgNO")+"";
String typeID = params.get("typeID")+"";
jdbcTemplate.setDialect(new SqlServerDialect());
String sql = "SELECT BannerAdNO = b.sBannerAdNO, BannerAdTitle = b.sBannerAdTitle,OrgNO = b.sOrgNO,AdPostionTypeID = b.sAdPositionTypeID,AdPostionType = b.sAdPositionType,"
+ " LayoutTypeID = b.sLayoutTypeID,LayoutType = b.sLayoutType,JumpTypeID = b.sJumpTypeID,JumpType = b.sJumpType,JumpList = b.sJumpList,Idx = b.nIdx,ImagePath = b.sImagePath,"
+ " LinkPath = b.sLinkPath "
+ " from tBannerAd b "
+ " WHERE sOrgNO = ? AND sAdPositionTypeID =? AND b.dStartTime <=getdate() AND b.dEndTime >= getdate() AND b.nTag&2 = 2 ";
return jdbcTemplate.limit(sql, page, orgNO,typeID);
}
/**
* 查快报
* @Title: queryNews
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param @param params
* @param @param page
* @param @return 设定文件
* @return 返回类型
* @throws
*/
public List<Map<String, Object>> queryNews(Map<String, Object> params, Page page) {
String orgNO = params.get("orgNO")+"";
String msgTypeID = params.get("msgTypeID")+"";
jdbcTemplate.setDialect(new SqlServerDialect());
String sql = "SELECT BillBoardID = b.nBillboardID, MsgTypeID = b.sMsgTypeID,MsgType = b.sMsgType,Title = b.sTitle,Content = b.sText,Sort = b.nSort,TradeDate = b.dTradeDate"
+ " FROM tBillboard b "
+ " WHERE b.nTag&2=2 AND b.sMsgTypeID = ? ";
return jdbcTemplate.limit(sql, page, msgTypeID);
}
} }
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