|
@@ -2,7 +2,6 @@ package com.lemon.lifecenter.controller;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
-import java.util.Random;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -22,10 +21,11 @@ import com.lemon.lifecenter.common.LifeCenterController;
|
|
|
import com.lemon.lifecenter.common.LifeCenterFunction;
|
|
|
import com.lemon.lifecenter.common.LifeCenterPaging;
|
|
|
import com.lemon.lifecenter.common.LifeCenterSessionController;
|
|
|
-import com.lemon.lifecenter.dto.StaffManagerDTO;
|
|
|
+import com.lemon.lifecenter.dto.ApiManagerDTO;
|
|
|
import com.lemon.lifecenter.dto.CenterInfoDTO;
|
|
|
-import com.lemon.lifecenter.service.StaffManagerService;
|
|
|
+import com.lemon.lifecenter.dto.StaffManagerDTO;
|
|
|
import com.lemon.lifecenter.service.CenterService;
|
|
|
+import com.lemon.lifecenter.service.StaffManagerService;
|
|
|
|
|
|
@Controller
|
|
|
@RequestMapping("/staffManager")
|
|
@@ -38,16 +38,23 @@ public class StaffManagerController extends LifeCenterController {
|
|
|
@Autowired
|
|
|
private CenterService centerService;
|
|
|
|
|
|
- @RequestMapping("/medicalinfo")
|
|
|
- public ModelAndView staffMediCalInfo(
|
|
|
+ @Autowired
|
|
|
+ private LifeCenterConfigVO config;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private LifeCenterPaging paging;
|
|
|
+
|
|
|
+ @RequestMapping("/info")
|
|
|
+ public ModelAndView staffManagerInfo(
|
|
|
@ModelAttribute("dto") StaffManagerDTO dto,
|
|
|
+ @RequestParam(value="gubun", required=false, defaultValue="M") String inputgubun,
|
|
|
HttpServletRequest request,HttpServletResponse response) {
|
|
|
|
|
|
String sesCenterCode = LifeCenterSessionController.getSession( request, "sesCenterCode" );
|
|
|
dto.setCenterCode(Integer.valueOf(sesCenterCode));
|
|
|
- dto.setGubun("M");
|
|
|
+ dto.setGubun(inputgubun);
|
|
|
|
|
|
- ModelAndView mv = setMV("staff/manager/medicalinfo");
|
|
|
+ ModelAndView mv = setMV("staff/manager/info");
|
|
|
|
|
|
int total = service.selectStaffManagerCount(dto);
|
|
|
|
|
@@ -56,7 +63,7 @@ public class StaffManagerController extends LifeCenterController {
|
|
|
ndto = service.selectStaffManagerInfo(dto);
|
|
|
} else {
|
|
|
ndto.setCenterCode(Integer.valueOf(sesCenterCode));
|
|
|
- ndto.setGubun("M");
|
|
|
+ ndto.setGubun(inputgubun);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -66,14 +73,15 @@ public class StaffManagerController extends LifeCenterController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @RequestMapping("/medicaledit")
|
|
|
- public ModelAndView staffMediCalEdit(
|
|
|
+ @RequestMapping("/edit")
|
|
|
+ public ModelAndView staffManagerEdit(
|
|
|
@ModelAttribute("dto") StaffManagerDTO dto,
|
|
|
+ @RequestParam(value="gubun", required=false, defaultValue="M") String inputgubun,
|
|
|
HttpServletRequest request,HttpServletResponse response) {
|
|
|
|
|
|
String sesCenterCode = LifeCenterSessionController.getSession( request, "sesCenterCode" );
|
|
|
dto.setCenterCode(Integer.valueOf(sesCenterCode));
|
|
|
- dto.setGubun("M");
|
|
|
+ dto.setGubun(inputgubun);
|
|
|
|
|
|
int total = service.selectStaffManagerCount(dto);
|
|
|
StaffManagerDTO ndto = new StaffManagerDTO();
|
|
@@ -82,29 +90,33 @@ public class StaffManagerController extends LifeCenterController {
|
|
|
ndto.setStatus("U");
|
|
|
} else {
|
|
|
ndto.setCenterCode(Integer.valueOf(sesCenterCode));
|
|
|
- ndto.setGubun("M");
|
|
|
+ ndto.setGubun(inputgubun);
|
|
|
ndto.setStatus("I");
|
|
|
}
|
|
|
|
|
|
- ModelAndView mv = setMV("staff/manager/medicaledit");
|
|
|
+ ModelAndView mv = setMV("staff/manager/edit");
|
|
|
|
|
|
mv.addObject("list", ndto);
|
|
|
|
|
|
return mv;
|
|
|
}
|
|
|
|
|
|
- @RequestMapping( value = "/medicalupdate", method = RequestMethod.POST)
|
|
|
- public String staffMediCalUpdate(
|
|
|
+ @RequestMapping( value = "/staffupdate", method = RequestMethod.POST)
|
|
|
+ public String staffManagerUpdate(
|
|
|
@ModelAttribute("dto") final StaffManagerDTO dto,
|
|
|
HttpServletRequest request,HttpServletResponse response) {
|
|
|
String sesId = LifeCenterSessionController.getSession( request, "sesId" );
|
|
|
String sesCenterCode = LifeCenterSessionController.getSession( request, "sesCenterCode" );
|
|
|
String sesCenterName = LifeCenterSessionController.getSession( request, "sesCenterName" );
|
|
|
|
|
|
- dto.setGubun("M");
|
|
|
dto.setCenterCode(Integer.valueOf(sesCenterCode));
|
|
|
|
|
|
- if (dto.getStatus().equals("I")) {
|
|
|
+ int total = service.selectStaffManagerCount(dto);
|
|
|
+
|
|
|
+ if (total > 0) {
|
|
|
+ dto.setUpdateById(sesId);
|
|
|
+ service.updateStaffManager(dto);
|
|
|
+ } else {
|
|
|
dto.setCreateById(sesId);
|
|
|
|
|
|
CenterInfoDTO cdto = new CenterInfoDTO();
|
|
@@ -114,17 +126,51 @@ public class StaffManagerController extends LifeCenterController {
|
|
|
//검색용으로 저장
|
|
|
dto.setLocationCode(cdto.getLocationCode());
|
|
|
dto.setCenterName(sesCenterName);
|
|
|
-
|
|
|
service.insertStaffManager(dto);
|
|
|
- } else if (dto.getStatus().equals("U")) {
|
|
|
- dto.setUpdateById(sesId);
|
|
|
- service.updateStaffManager(dto);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- LifeCenterFunction.scriptMessage( response, "alertBox({ txt: '저장을 완료하였습니다.', callBack : function(){ location.href='/staffManager/medicalinfo'; } });" );
|
|
|
+ LifeCenterFunction.scriptMessage( response, "alertBox({ txt: '저장을 완료하였습니다.', callBack : function(){ location.href='/staffManager/info?gubun="+ dto.getGubun() +"'; } });" );
|
|
|
return "/common/blank";
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping("/list")
|
|
|
+ public ModelAndView staffManagerList(
|
|
|
+ @ModelAttribute("dto") StaffManagerDTO dto,
|
|
|
+ @RequestParam(value="gubun", required=false, defaultValue="M") String inputgubun,
|
|
|
+ @RequestParam(value="locationCode", required=false, defaultValue="") String inputlocationCode,
|
|
|
+ @RequestParam(value="centerName", required=false, defaultValue="") String inputCenterName,
|
|
|
+ @RequestParam(value="page", required=false, defaultValue="1") int page,
|
|
|
+
|
|
|
+ HttpServletRequest request,HttpServletResponse response) {
|
|
|
+
|
|
|
+ dto.setLimit( ( Integer.valueOf( page ) - 1 ) * config.pageDataSize );
|
|
|
+ dto.setLimitMax( config.pageDataSize );
|
|
|
+ dto.setGubun(inputgubun);
|
|
|
+
|
|
|
+ int total = service.selectStaffManagerCount(dto);
|
|
|
+ List<StaffManagerDTO> list = new ArrayList<StaffManagerDTO>();
|
|
|
+ if (total > 0) {
|
|
|
+ list = service.selectStaffManagerList(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ String param = "locationCode="+inputlocationCode+"¢erlName="+inputCenterName+"&gubun="+inputgubun;
|
|
|
+ paging = LifeCenterPaging.getInstance();
|
|
|
+ paging.paging(config, total, page, param);
|
|
|
+
|
|
|
+ ModelAndView mv = setMV("api/list");
|
|
|
+
|
|
|
+ mv.addObject("total", total);
|
|
|
+ mv.addObject("list", list);
|
|
|
+ mv.addObject("gubun", inputgubun);
|
|
|
+ mv.addObject("locationCode", inputlocationCode);
|
|
|
+ mv.addObject("centerName", inputCenterName);
|
|
|
+
|
|
|
+ mv.addObject("paging", paging);
|
|
|
+ mv.addObject("page", page);
|
|
|
+ mv.addObject("pageSize", dto.getLimitMax());
|
|
|
+
|
|
|
+ return mv;
|
|
|
+ }
|
|
|
+
|
|
|
}
|