rsbi 4 år sedan
förälder
incheckning
797d9c384b

+ 3 - 0
src/main/java/com/ruisitech/bi/entity/portal/Portal.java

@@ -1,5 +1,6 @@
 package com.ruisitech.bi.entity.portal;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruisitech.bi.entity.common.BaseEntity;
 import com.ruisitech.bi.util.RSBIUtils;
 
@@ -15,7 +16,9 @@ public class Portal extends BaseEntity {
 	private String is3g;
 	private Integer cataId;
 	private String cataName;
+	@JsonFormat(pattern = "yyyy-MM-dd")
 	private Date crtDate;
+	@JsonFormat(pattern = "yyyy-MM-dd")
 	private Date updateDate;
 	
 	public String getPageId() {

+ 22 - 26
src/main/java/com/ruisitech/bi/web/portal/PortalIndexController.java

@@ -1,6 +1,10 @@
 package com.ruisitech.bi.web.portal;
 
 import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.ruisitech.bi.entity.common.PageParam;
+import com.ruisitech.bi.entity.frame.User;
 import com.ruisitech.bi.entity.portal.Portal;
 import com.ruisitech.bi.service.portal.PortalService;
 import com.ruisitech.bi.util.BaseController;
@@ -20,25 +24,6 @@ public class PortalIndexController extends BaseController {
 	
 	@Autowired
 	private PortalService portalService;
-
-	@RequestMapping(value="/customization.action")
-	public String customization(String pageId, String menus, String is3g, ModelMap model) {
-		if(menus != null && menus.length() > 0){
-			JSONObject obj = JSONObject.parseObject(menus);
-			model.addAttribute("menuDisp", obj);
-		}
-		String pageInfo = pageId == null ? null : portalService.getPortalCfg(pageId);
-		model.addAttribute("pageInfo", pageInfo);
-		model.addAttribute("is3g", is3g);
-		return "portal/PortalIndex-customiz";
-	}
-	
-	@RequestMapping(value="/PortalIndex.action")
-	public String index(ModelMap model) {
-		List<Portal> ls = portalService.listPortal();
-		model.addAttribute("ls", ls);
-		return "portal/PortalIndex";
-	}
 	
 	@RequestMapping(value="/delete.action")
 	public @ResponseBody
@@ -46,6 +31,24 @@ public class PortalIndexController extends BaseController {
 		portalService.deletePortal(pageId);
 		return this.buildSucces();
 	}
+
+	@RequestMapping(value="/get.action")
+	public @ResponseBody
+	Object get(String pageId) {
+		String str = portalService.getPortalCfg(pageId);
+		return this.buildSucces(str);
+	}
+
+	@RequestMapping(value="/list.action")
+	public @ResponseBody
+	Object list(PageParam page) {
+		if(page != null && page.getPage() != null && page.getRows() != null){
+			PageHelper.startPage(page.getPage(), page.getRows());
+		}
+		List<Portal> ls = portalService.listPortal();
+		PageInfo<Portal> pageInfo=new PageInfo<>(ls);
+		return this.buildSucces(pageInfo);
+	}
 	
 	@RequestMapping(value="/rename.action", method = RequestMethod.POST)
 	public @ResponseBody
@@ -54,13 +57,6 @@ public class PortalIndexController extends BaseController {
 		return this.buildSucces();
 	}
 	
-	@RequestMapping(value="/show.action")
-	public String show(String pageId, String income, ModelMap model) {
-		model.addAttribute("pageId", pageId);
-		model.addAttribute("income", income);
-		return "portal/PortalIndex-show";
-	}
-	
 	@RequestMapping(value="/save.action", method = RequestMethod.POST)
 	public @ResponseBody
     Object save(Portal portal){