浏览代码

活动页限制处理

anderx 7 年之前
父节点
当前提交
c505e1ae78
共有 1 个文件被更改,包括 41 次插入9 次删除
  1. 41 9
      src/main/java/com/goafanti/common/controller/PortalController.java

+ 41 - 9
src/main/java/com/goafanti/common/controller/PortalController.java

@@ -166,22 +166,54 @@ public class PortalController extends BaseController {
 	public ModelAndView portalActivityDetails(ModelAndView modelAndView){
 	public ModelAndView portalActivityDetails(ModelAndView modelAndView){
 		modelAndView.setViewName("/portal/invRegister");
 		modelAndView.setViewName("/portal/invRegister");
 		//随机项目抵用券
 		//随机项目抵用券
-		List<JtVoucherListBo> list=voucherService.selectVoucherByClassify( null,null, 4);
-		for (JtVoucherListBo j : list) {
-			System.out.println(j.getMoney());
+		List<JtVoucherListBo> vlist=voucherService.selectVoucherByClassify( null,null, 4);
+		for (JtVoucherListBo j : vlist) {
+			if (j.getName().length()>12) {
+				j.setName(j.getName().substring(0, 11)+"…");
+			}
 		}
 		}
-		modelAndView.addObject("vouchers",list);
+		modelAndView.addObject("vouchers",vlist);
 		//高企服务
 		//高企服务
-		modelAndView.addObject( "gqfw",jtBusinessService.getKJListByIds(2, 0, 2));
+		List<JtBusinessProject> glist=jtBusinessService.getKJListByIds(2, 0, 2);
+		for (JtBusinessProject j : glist) {
+			if (j.getName().length()>5) {
+				j.setName(j.getName().substring(0, 4)+"…");
+			}
+		}
+		modelAndView.addObject( "gqfw",glist);
 		//随机热门项目
 		//随机热门项目
 		Pagination<JtBusinessProjectResult> p=jtBusinessService.getProjects(null,null,null,null, 3,1,null,2,null,1,null,null,null);
 		Pagination<JtBusinessProjectResult> p=jtBusinessService.getProjects(null,null,null,null, 3,1,null,2,null,1,null,null,null);
-		modelAndView.addObject("hotProject", (List<JtBusinessProjectResult>) p.getList());
+		List<JtBusinessProjectResult> plist=(List<JtBusinessProjectResult>) p.getList();
+		for (JtBusinessProjectResult j : plist) {
+			if (j.getName().length()>8) {
+				j.setName(j.getName().substring(0, 7)+"…");
+			}
+		}
+		modelAndView.addObject("hotProject",plist);
 		//军民融合
 		//军民融合
-		modelAndView.addObject( "jmrh",jtBusinessService.getKJListByIds(3, 0, 3));
+		List<JtBusinessProject> jlist=jtBusinessService.getKJListByIds(3, 0, 3);
+		for (JtBusinessProject j : jlist) {
+			if (j.getName().length()>12) {
+				j.setName(j.getName().substring(0, 11)+"…");
+			}
+		}
+		modelAndView.addObject( "jmrh",jlist);
 		//知识产权
 		//知识产权
-		modelAndView.addObject( "zscq",jtBusinessService.getKJListByIds(1, 0, 3));
+		List<JtBusinessProject> zlist=jtBusinessService.getKJListByIds(1, 0, 3);
+		for (JtBusinessProject j : zlist) {
+			if (j.getName().length()>8) {
+				j.setName(j.getName().substring(0, 7)+"…");
+			}
+		}
+		modelAndView.addObject( "zscq",zlist);
 		//政府扶持
 		//政府扶持
-		modelAndView.addObject( "zffc",jtBusinessService.getProjectByTag("政府扶持", 4));
+		List<JtBusinessProject> zfList=jtBusinessService.getProjectByTag("政府扶持", 4);
+		for (JtBusinessProject j : zlist) {
+			if (j.getName().length()>11) {
+				j.setName(j.getName().substring(0, 10)+"…");
+			}
+		}
+		modelAndView.addObject( "zffc",zfList);
 		
 		
 		
 		
 		return modelAndView;
 		return modelAndView;