File was renamed from src/main/java/kr/wisestone/owl/web/controller/DepartmentManageController.java |
| | |
| | | package kr.wisestone.owl.web.controller; |
| | | |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.service.DepartmentManageService; |
| | | import kr.wisestone.owl.web.condition.DepartmentManageCondition; |
| | | import kr.wisestone.owl.web.form.DepartmentManageForm; |
| | | import kr.wisestone.owl.service.DepartmentService; |
| | | import kr.wisestone.owl.web.condition.DepartmentCondition; |
| | | import kr.wisestone.owl.web.form.DepartmentForm; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.http.MediaType; |
| | |
| | | * Created by jeong on 2017-08-02. |
| | | */ |
| | | @Controller |
| | | public class DepartmentManageController extends BaseController { |
| | | public class DepartmentController extends BaseController { |
| | | |
| | | @Autowired |
| | | private DepartmentManageService departmentManageService; |
| | | private DepartmentService departmentService; |
| | | |
| | | // 부서 생성 |
| | | @RequestMapping(value = "/departmentManage/add", method = RequestMethod.POST) |
| | | @RequestMapping(value = "/department/add", method = RequestMethod.POST) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> add(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | Map<String, Object> content = params.get(Constants.REQ_KEY_CONTENT); |
| | | this.departmentManageService.addDepartmentManage(DepartmentManageForm.make(content)); |
| | | this.departmentService.add(DepartmentForm.make(content)); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 부서 조회 |
| | | @RequestMapping(value = "/departmentManage/find", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | @RequestMapping(value = "/department/find", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> find(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | Pageable pageable = this.pageUtil.convertPageable(this.getPageVo(params)); |
| | | |
| | | this.departmentManageService.findDepartment(resJsonData, DepartmentManageCondition.make(params.get(Constants.REQ_KEY_CONTENT)), pageable); |
| | | this.departmentService.find(resJsonData, DepartmentCondition.make(params.get(Constants.REQ_KEY_CONTENT)), pageable); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 부서 상세 조회 |
| | | @RequestMapping(value = "/departmentManage/detail", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | @RequestMapping(value = "/department/detail", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> detail(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | this.departmentManageService.detailDepartment(resJsonData, DepartmentManageCondition.make(params.get(Constants.REQ_KEY_CONTENT))); |
| | | this.departmentService.detail(resJsonData, DepartmentCondition.make(params.get(Constants.REQ_KEY_CONTENT))); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 부서 수정 |
| | | @RequestMapping(value = "/departmentManage/modify", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | @RequestMapping(value = "/department/modify", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> modify(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | |
| | | this.departmentManageService.modifyDepartment(DepartmentManageForm.make(params.get(Constants.REQ_KEY_CONTENT))); |
| | | this.departmentService.modify(DepartmentForm.make(params.get(Constants.REQ_KEY_CONTENT))); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 부서 삭제 |
| | | @RequestMapping(value = "/departmentManage/remove", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | @RequestMapping(value = "/department/remove", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> remove(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | Map<String, Object> content = params.get(Constants.REQ_KEY_CONTENT); |
| | | |
| | | this.departmentManageService.removeDepartment(DepartmentManageForm.make(content)); |
| | | this.departmentService.remove(DepartmentForm.make(content)); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | |
| | | // 부서 엑셀 다운로드 |
| | | @RequestMapping(value = "/departmentManage/downloadExcel", method = RequestMethod.POST) |
| | | @RequestMapping(value = "/department/downloadExcel", method = RequestMethod.POST) |
| | | public ModelAndView downloadExcel(HttpServletRequest request, Model model) { |
| | | return this.departmentManageService.downloadExcel(request, model); |
| | | return this.departmentService.downloadExcel(request, model); |
| | | } |
| | | } |
| | | |