|
@@ -7,21 +7,23 @@ import java.util.List;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import com.lemon.lifecenter.common.LifeCenterConfigVO;
|
|
|
+import com.lemon.lifecenter.common.LifeCenterController;
|
|
|
+import com.lemon.lifecenter.common.LifeCenterFunction;
|
|
|
+import com.lemon.lifecenter.common.LifeCenterSessionController;
|
|
|
+import com.lemon.lifecenter.dto.PushDTO;
|
|
|
+import com.lemon.lifecenter.service.PushService;
|
|
|
+
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
-import com.lemon.lifecenter.common.LifeCenterConfigVO;
|
|
|
-import com.lemon.lifecenter.common.LifeCenterController;
|
|
|
-import com.lemon.lifecenter.common.LifeCenterFunction;
|
|
|
-import com.lemon.lifecenter.common.LifeCenterSessionController;
|
|
|
-import com.lemon.lifecenter.dto.PushDTO;
|
|
|
-import com.lemon.lifecenter.service.PushService;
|
|
|
-
|
|
|
@Controller
|
|
|
@RequestMapping("/mobile")
|
|
|
public class MobilePushController extends LifeCenterController {
|
|
@@ -35,7 +37,9 @@ public class MobilePushController extends LifeCenterController {
|
|
|
private PushService pushService;
|
|
|
|
|
|
@RequestMapping("/push/list")
|
|
|
- public ModelAndView pushList(@RequestParam(value="ym", required=false, defaultValue="") String ym,
|
|
|
+ public ModelAndView pushList(
|
|
|
+ @RequestParam(value="ym", required=false, defaultValue="") String ym,
|
|
|
+ @RequestParam(value = "page", required = false, defaultValue = "1") int page,
|
|
|
HttpServletRequest request, HttpServletResponse response) throws ParseException {
|
|
|
|
|
|
String sesMpIdx = LifeCenterSessionController.getSession(request, "sesMpIdx");
|
|
@@ -46,6 +50,9 @@ public class MobilePushController extends LifeCenterController {
|
|
|
|
|
|
PushDTO dto = new PushDTO();
|
|
|
|
|
|
+ dto.setLimit((Integer.valueOf(page) - 1) * config.pageDataSize);
|
|
|
+ dto.setLimitMax(config.pageDataSize);
|
|
|
+
|
|
|
String ym2 = ym.replace("-", "");
|
|
|
dto.setYm(ym2);
|
|
|
dto.setPatientIdx(Integer.parseInt(sesMpIdx));
|
|
@@ -66,6 +73,50 @@ public class MobilePushController extends LifeCenterController {
|
|
|
mv.addObject("nowMonth", LifeCenterFunction.getNow( "yyyy-MM" ));
|
|
|
mv.addObject("listCount", listCount);
|
|
|
mv.addObject("pushList", pushList);
|
|
|
+ mv.addObject("page", page);
|
|
|
return mv;
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping( value="/push/list/more", method=RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public ModelAndView pushListMore(
|
|
|
+ @RequestParam(value = "ym", required = false, defaultValue = "") String ym,
|
|
|
+ @RequestParam(value = "page", required = false, defaultValue = "1") int page,
|
|
|
+ HttpServletRequest request, HttpServletResponse response) throws ParseException {
|
|
|
+ page = Integer.valueOf( page );
|
|
|
+
|
|
|
+ String sesMpIdx = LifeCenterSessionController.getSession(request, "sesMpIdx");
|
|
|
+
|
|
|
+ if (ym.equals("")) {
|
|
|
+ ym = LifeCenterFunction.getNow("yyyy-MM");
|
|
|
+ }
|
|
|
+
|
|
|
+ PushDTO dto = new PushDTO();
|
|
|
+
|
|
|
+ dto.setLimit((Integer.valueOf(page) - 1) * config.pageDataSize);
|
|
|
+ dto.setLimitMax(config.pageDataSize);
|
|
|
+
|
|
|
+ String ym2 = ym.replace("-", "");
|
|
|
+ dto.setYm(ym2);
|
|
|
+ dto.setPatientIdx(Integer.parseInt(sesMpIdx));
|
|
|
+ int total = pushService.selectPushResultTableCount(dto);
|
|
|
+
|
|
|
+ int listCount = 0;
|
|
|
+ List<PushDTO> pushList = new ArrayList<PushDTO>();
|
|
|
+ if (total > 0) {
|
|
|
+ listCount = pushService.mobilePushMessageBoxCount(dto);
|
|
|
+ pushList = pushService.mobilePushMessageBox(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ ModelAndView mv = setMobileMV("push/list");
|
|
|
+ mv.addObject("total", total);
|
|
|
+ mv.addObject("date", ym);
|
|
|
+ mv.addObject("prevMonth", LifeCenterFunction.getPrevMonth(ym));
|
|
|
+ mv.addObject("nextMonth", LifeCenterFunction.getNextMonth(ym));
|
|
|
+ mv.addObject("nowMonth", LifeCenterFunction.getNow("yyyy-MM"));
|
|
|
+ mv.addObject("listCount", listCount);
|
|
|
+ mv.addObject("pushList", pushList);
|
|
|
+
|
|
|
+ return mv;
|
|
|
+ }
|
|
|
}
|