ISP, Hosting 백엔드 추가 및 부서 수정
New file |
| | |
| | | package kr.wisestone.owl.domain; |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.GeneratedValue; |
| | | import javax.persistence.GenerationType; |
| | | import javax.persistence.Id; |
| | | import java.io.Serializable; |
| | | |
| | | @Entity |
| | | public class Hosting extends BaseEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | private Long id; |
| | | private String name; |
| | | private String manager; |
| | | private String tel; |
| | | private String email; |
| | | private String memo; |
| | | |
| | | public Hosting() {} |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getManager() { |
| | | return manager; |
| | | } |
| | | |
| | | public void setManager(String manager) { |
| | | this.manager = manager; |
| | | } |
| | | |
| | | public String getTel() { |
| | | return tel; |
| | | } |
| | | |
| | | public void setTel(String tel) { |
| | | this.tel = tel; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.domain; |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.GeneratedValue; |
| | | import javax.persistence.GenerationType; |
| | | import javax.persistence.Id; |
| | | import java.io.Serializable; |
| | | |
| | | @Entity |
| | | public class Isp extends BaseEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | private Long id; |
| | | private String name; |
| | | private String manager; |
| | | private String tel; |
| | | private String email; |
| | | private String memo; |
| | | |
| | | public Isp() {} |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getManager() { |
| | | return manager; |
| | | } |
| | | |
| | | public void setManager(String manager) { |
| | | this.manager = manager; |
| | | } |
| | | |
| | | public String getTel() { |
| | | return tel; |
| | | } |
| | | |
| | | public void setTel(String tel) { |
| | | this.tel = tel; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.mapper; |
| | | |
| | | import kr.wisestone.owl.web.condition.CompanyFieldCondition; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by wisestone on 2018-02-26. |
| | | */ |
| | | @Repository |
| | | public interface HostingMapper { |
| | | List<Map<String, Object>> find(CompanyFieldCondition companyFieldCondition); |
| | | |
| | | Long count(CompanyFieldCondition companyFieldCondition); |
| | | |
| | | List<Map<String, Object>> findEvent(); |
| | | |
| | | Long findByCompany(Long id); |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.mapper; |
| | | |
| | | import kr.wisestone.owl.web.condition.CompanyFieldCondition; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by wisestone on 2018-02-26. |
| | | */ |
| | | @Repository |
| | | public interface IspMapper { |
| | | List<Map<String, Object>> find(CompanyFieldCondition companyFieldCondition); |
| | | |
| | | Long count(CompanyFieldCondition companyFieldCondition); |
| | | |
| | | List<Map<String, Object>> findEvent(); |
| | | |
| | | Long findByCompany(Long id); |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.repository; |
| | | |
| | | import kr.wisestone.owl.domain.CompanyField; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | |
| | | public interface HostingRepository extends JpaRepository<CompanyField, Long> { |
| | | |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.repository; |
| | | |
| | | import kr.wisestone.owl.domain.CompanyField; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | |
| | | public interface IspRepository extends JpaRepository<CompanyField, Long> { |
| | | |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.service; |
| | | |
| | | import kr.wisestone.owl.domain.CompanyField; |
| | | import kr.wisestone.owl.vo.CompanyFieldVo; |
| | | import kr.wisestone.owl.web.condition.CompanyFieldCondition; |
| | | import kr.wisestone.owl.web.form.CompanyFieldForm; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface HostingService { |
| | | CompanyField addCompany(CompanyFieldForm companyFieldForm); |
| | | |
| | | List<CompanyFieldVo> findCompany(Map<String, Object> resJsonData, CompanyFieldCondition make, Pageable pageable); |
| | | |
| | | CompanyField getCompany(Long id); |
| | | |
| | | void detailCompany(Map<String, Object> resJsonData, CompanyFieldCondition make); |
| | | |
| | | void modifyCompany(CompanyFieldForm make); |
| | | |
| | | void removeCompany(CompanyFieldForm make); |
| | | |
| | | ModelAndView downloadExcel(HttpServletRequest request, Model model); |
| | | |
| | | boolean company(Long id); |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.service; |
| | | |
| | | import kr.wisestone.owl.domain.CompanyField; |
| | | import kr.wisestone.owl.vo.CompanyFieldVo; |
| | | import kr.wisestone.owl.web.condition.CompanyFieldCondition; |
| | | import kr.wisestone.owl.web.form.CompanyFieldForm; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface IspService { |
| | | CompanyField addCompany(CompanyFieldForm companyFieldForm); |
| | | |
| | | List<CompanyFieldVo> findCompany(Map<String, Object> resJsonData, CompanyFieldCondition make, Pageable pageable); |
| | | |
| | | CompanyField getCompany(Long id); |
| | | |
| | | void detailCompany(Map<String, Object> resJsonData, CompanyFieldCondition make); |
| | | |
| | | void modifyCompany(CompanyFieldForm make); |
| | | |
| | | void removeCompany(CompanyFieldForm make); |
| | | |
| | | ModelAndView downloadExcel(HttpServletRequest request, Model model); |
| | | |
| | | boolean company(Long id); |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.service.impl; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import kr.wisestone.owl.common.ExcelConditionCheck; |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.constant.MsgConstants; |
| | | import kr.wisestone.owl.domain.CompanyField; |
| | | import kr.wisestone.owl.exception.OwlRuntimeException; |
| | | import kr.wisestone.owl.mapper.CompanyFieldMapper; |
| | | import kr.wisestone.owl.repository.CompanyFieldRepository; |
| | | import kr.wisestone.owl.service.CompanyFieldService; |
| | | import kr.wisestone.owl.service.UserService; |
| | | import kr.wisestone.owl.service.WorkspaceService; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.vo.CompanyFieldVo; |
| | | import kr.wisestone.owl.vo.ExportExcelAttrVo; |
| | | import kr.wisestone.owl.vo.ExportExcelVo; |
| | | import kr.wisestone.owl.vo.ResPage; |
| | | import kr.wisestone.owl.web.condition.CompanyFieldCondition; |
| | | import kr.wisestone.owl.web.form.CompanyFieldForm; |
| | | import kr.wisestone.owl.web.view.ExcelView; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class HostingServiceImpl extends AbstractServiceImpl<CompanyField, Long, JpaRepository<CompanyField, Long>> implements CompanyFieldService { |
| | | |
| | | @Autowired |
| | | private CompanyFieldRepository companyFieldRepository; |
| | | |
| | | @Autowired |
| | | private CompanyFieldMapper companyFieldMapper; |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @Autowired |
| | | private WorkspaceService workspaceService; |
| | | |
| | | @Autowired |
| | | private ExcelView excelView; |
| | | |
| | | @Autowired |
| | | private ExcelConditionCheck excelConditionCheck; |
| | | |
| | | @Override |
| | | protected JpaRepository<CompanyField, Long> getRepository() { |
| | | return this.companyFieldRepository; |
| | | } |
| | | |
| | | // 업체 추가 |
| | | @Override |
| | | public CompanyField addCompany(CompanyFieldForm companyFieldForm) { |
| | | CompanyField companyField = ConvertUtil.copyProperties(companyFieldForm, CompanyField.class); |
| | | companyFieldRepository.saveAndFlush(companyField); |
| | | return companyField; |
| | | } |
| | | |
| | | // 업체 목록을 가져온다. |
| | | @Override |
| | | public List<CompanyFieldVo> findCompany(Map<String, Object> resJsonData, |
| | | CompanyFieldCondition condition, Pageable pageable) { |
| | | condition.setPage(pageable.getPageNumber() * pageable.getPageSize()); |
| | | condition.setPageSize(pageable.getPageSize()); |
| | | |
| | | List<Map<String, Object>> results = this.companyFieldMapper.find(condition); |
| | | Long totalCompanyCount = this.companyFieldMapper.count(condition); |
| | | |
| | | return this.convertCompanyVoToMap(results, totalCompanyCount, pageable, resJsonData); |
| | | } |
| | | |
| | | |
| | | // 업체 상세 조회한다. |
| | | @Override |
| | | public void detailCompany(Map<String, Object> resJsonData, CompanyFieldCondition companyFieldCondition) { |
| | | CompanyFieldVo companyFieldVo = new CompanyFieldVo(); |
| | | |
| | | Long companyId = companyFieldCondition.getId(); |
| | | if (companyId != null) { |
| | | CompanyField companyField = this.getCompany(companyId); |
| | | companyFieldVo = ConvertUtil.copyProperties(companyField, CompanyFieldVo.class); |
| | | } |
| | | resJsonData.put(Constants.REQ_KEY_CONTENT, companyFieldVo); |
| | | } |
| | | |
| | | // 업체 정로를 수정한다. |
| | | @Override |
| | | public void modifyCompany(CompanyFieldForm companyFieldForm) { |
| | | CompanyField companyField = ConvertUtil.copyProperties(companyFieldForm, CompanyField.class); |
| | | companyFieldRepository.saveAndFlush(companyField); |
| | | } |
| | | |
| | | |
| | | // 업체를 삭제한다. |
| | | @Override |
| | | public void removeCompany(CompanyFieldForm companyFieldForm) { |
| | | if (companyFieldForm.getRemoveIds().size() < 1) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.COMPANY_REMOVE_NOT_SELECT)); |
| | | } |
| | | for (Long id : companyFieldForm.getRemoveIds()) { |
| | | if (!this.userService.useUserLevel(id)) { |
| | | this.companyFieldRepository.deleteById(id); |
| | | } else { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.DEPARTMENT_ALREADY_IN_USE)); |
| | | } |
| | | |
| | | } |
| | | this.companyFieldRepository.flush(); |
| | | } |
| | | |
| | | // 업체 목록을 엑셀로 다운로드 한다. |
| | | @Override |
| | | public ModelAndView downloadExcel(HttpServletRequest request, Model model) { |
| | | ModelAndView modelAndView = this.workspaceService.checkUseExcelDownload(model); |
| | | if (modelAndView != null) { |
| | | return modelAndView; |
| | | } |
| | | |
| | | Map<String, Object> conditions = new HashMap<>(); |
| | | // 엑셀 다운로드에 필요한 검색 조건 정보를 추출하고 검색 조건 추출에 오류가 발생하면 경고를 표시해준다. |
| | | modelAndView = this.excelConditionCheck.checkCondition(conditions, request, model); |
| | | if (modelAndView != null) { |
| | | return modelAndView; |
| | | } |
| | | |
| | | CompanyFieldCondition companyFieldCondition = CompanyFieldCondition.make(conditions); |
| | | |
| | | |
| | | List<Map<String, Object>> results = this.companyFieldMapper.find(companyFieldCondition); |
| | | List<CompanyFieldVo> companyFieldVos = ConvertUtil.convertListToListClass(results, CompanyFieldVo.class); |
| | | // code_ko_KR 에 code명 설정 |
| | | ExportExcelVo excelInfo = new ExportExcelVo(); |
| | | excelInfo.setFileName(this.messageAccessor.message("업체 목록")); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyName", this.messageAccessor.message("companyField.companyName"), 6, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyManager", this.messageAccessor.message("companyField.companyManager"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyTel", this.messageAccessor.message("companyField.companyTel"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyEmail", this.messageAccessor.message("companyField.companyEmail"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyMemo", this.messageAccessor.message("companyField.companyMemo"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | |
| | | excelInfo.setDatas(companyFieldVos); |
| | | |
| | | model.addAttribute(Constants.EXCEL, excelInfo); |
| | | return new ModelAndView(this.excelView); |
| | | } |
| | | |
| | | // 삭제 할 업체가 있는지 확인 |
| | | @Override |
| | | public boolean company(Long Id) { |
| | | return this.companyFieldMapper.findByCompany(Id) > 0; |
| | | } |
| | | |
| | | // 검색 결과를 CompanyFieldVo 로 변환한다. |
| | | private List<CompanyFieldVo> convertCompanyVoToMap(List<Map<String, Object>> results, Long totalCompanyCount, Pageable pageable, Map<String, Object> resJsonData) { |
| | | List<CompanyFieldVo> companyFieldVos = Lists.newArrayList(); |
| | | |
| | | for (Map<String, Object> result : results) { |
| | | CompanyFieldVo companyFieldVo = ConvertUtil.convertMapToClass(result, CompanyFieldVo.class); |
| | | companyFieldVos.add(companyFieldVo); |
| | | } |
| | | |
| | | int totalPage = (int) Math.ceil((totalCompanyCount - 1) / pageable.getPageSize()) + 1; |
| | | |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, companyFieldVos); |
| | | resJsonData.put(Constants.REQ_KEY_PAGE_VO, new ResPage(pageable.getPageNumber(), pageable.getPageSize(), |
| | | totalPage, totalCompanyCount)); |
| | | |
| | | return companyFieldVos; |
| | | } |
| | | |
| | | // 업체 ID 로 조회한다 |
| | | @Override |
| | | public CompanyField getCompany(Long id) { |
| | | if (id == null) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.COMPANYFIELD_NOT_EXIST)); |
| | | } |
| | | |
| | | CompanyField companyField = this.findOne(id); |
| | | |
| | | if (companyField == null) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.COMPANYFIELD_NOT_EXIST)); |
| | | } |
| | | return companyField; |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.service.impl; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import kr.wisestone.owl.common.ExcelConditionCheck; |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.constant.MsgConstants; |
| | | import kr.wisestone.owl.domain.CompanyField; |
| | | import kr.wisestone.owl.exception.OwlRuntimeException; |
| | | import kr.wisestone.owl.mapper.CompanyFieldMapper; |
| | | import kr.wisestone.owl.repository.CompanyFieldRepository; |
| | | import kr.wisestone.owl.service.CompanyFieldService; |
| | | import kr.wisestone.owl.service.UserService; |
| | | import kr.wisestone.owl.service.WorkspaceService; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.vo.CompanyFieldVo; |
| | | import kr.wisestone.owl.vo.ExportExcelAttrVo; |
| | | import kr.wisestone.owl.vo.ExportExcelVo; |
| | | import kr.wisestone.owl.vo.ResPage; |
| | | import kr.wisestone.owl.web.condition.CompanyFieldCondition; |
| | | import kr.wisestone.owl.web.form.CompanyFieldForm; |
| | | import kr.wisestone.owl.web.view.ExcelView; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class IspServiceImpl extends AbstractServiceImpl<CompanyField, Long, JpaRepository<CompanyField, Long>> implements CompanyFieldService { |
| | | |
| | | @Autowired |
| | | private CompanyFieldRepository companyFieldRepository; |
| | | |
| | | @Autowired |
| | | private CompanyFieldMapper companyFieldMapper; |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @Autowired |
| | | private WorkspaceService workspaceService; |
| | | |
| | | @Autowired |
| | | private ExcelView excelView; |
| | | |
| | | @Autowired |
| | | private ExcelConditionCheck excelConditionCheck; |
| | | |
| | | @Override |
| | | protected JpaRepository<CompanyField, Long> getRepository() { |
| | | return this.companyFieldRepository; |
| | | } |
| | | |
| | | // 업체 추가 |
| | | @Override |
| | | public CompanyField addCompany(CompanyFieldForm companyFieldForm) { |
| | | CompanyField companyField = ConvertUtil.copyProperties(companyFieldForm, CompanyField.class); |
| | | companyFieldRepository.saveAndFlush(companyField); |
| | | return companyField; |
| | | } |
| | | |
| | | // 업체 목록을 가져온다. |
| | | @Override |
| | | public List<CompanyFieldVo> findCompany(Map<String, Object> resJsonData, |
| | | CompanyFieldCondition condition, Pageable pageable) { |
| | | condition.setPage(pageable.getPageNumber() * pageable.getPageSize()); |
| | | condition.setPageSize(pageable.getPageSize()); |
| | | |
| | | List<Map<String, Object>> results = this.companyFieldMapper.find(condition); |
| | | Long totalCompanyCount = this.companyFieldMapper.count(condition); |
| | | |
| | | return this.convertCompanyVoToMap(results, totalCompanyCount, pageable, resJsonData); |
| | | } |
| | | |
| | | |
| | | // 업체 상세 조회한다. |
| | | @Override |
| | | public void detailCompany(Map<String, Object> resJsonData, CompanyFieldCondition companyFieldCondition) { |
| | | CompanyFieldVo companyFieldVo = new CompanyFieldVo(); |
| | | |
| | | Long companyId = companyFieldCondition.getId(); |
| | | if (companyId != null) { |
| | | CompanyField companyField = this.getCompany(companyId); |
| | | companyFieldVo = ConvertUtil.copyProperties(companyField, CompanyFieldVo.class); |
| | | } |
| | | resJsonData.put(Constants.REQ_KEY_CONTENT, companyFieldVo); |
| | | } |
| | | |
| | | // 업체 정로를 수정한다. |
| | | @Override |
| | | public void modifyCompany(CompanyFieldForm companyFieldForm) { |
| | | CompanyField companyField = ConvertUtil.copyProperties(companyFieldForm, CompanyField.class); |
| | | companyFieldRepository.saveAndFlush(companyField); |
| | | } |
| | | |
| | | |
| | | // 업체를 삭제한다. |
| | | @Override |
| | | public void removeCompany(CompanyFieldForm companyFieldForm) { |
| | | if (companyFieldForm.getRemoveIds().size() < 1) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.COMPANY_REMOVE_NOT_SELECT)); |
| | | } |
| | | for (Long id : companyFieldForm.getRemoveIds()) { |
| | | if (!this.userService.useUserLevel(id)) { |
| | | this.companyFieldRepository.deleteById(id); |
| | | } else { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.DEPARTMENT_ALREADY_IN_USE)); |
| | | } |
| | | |
| | | } |
| | | this.companyFieldRepository.flush(); |
| | | } |
| | | |
| | | // 업체 목록을 엑셀로 다운로드 한다. |
| | | @Override |
| | | public ModelAndView downloadExcel(HttpServletRequest request, Model model) { |
| | | ModelAndView modelAndView = this.workspaceService.checkUseExcelDownload(model); |
| | | if (modelAndView != null) { |
| | | return modelAndView; |
| | | } |
| | | |
| | | Map<String, Object> conditions = new HashMap<>(); |
| | | // 엑셀 다운로드에 필요한 검색 조건 정보를 추출하고 검색 조건 추출에 오류가 발생하면 경고를 표시해준다. |
| | | modelAndView = this.excelConditionCheck.checkCondition(conditions, request, model); |
| | | if (modelAndView != null) { |
| | | return modelAndView; |
| | | } |
| | | |
| | | CompanyFieldCondition companyFieldCondition = CompanyFieldCondition.make(conditions); |
| | | |
| | | |
| | | List<Map<String, Object>> results = this.companyFieldMapper.find(companyFieldCondition); |
| | | List<CompanyFieldVo> companyFieldVos = ConvertUtil.convertListToListClass(results, CompanyFieldVo.class); |
| | | // code_ko_KR 에 code명 설정 |
| | | ExportExcelVo excelInfo = new ExportExcelVo(); |
| | | excelInfo.setFileName(this.messageAccessor.message("업체 목록")); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyName", this.messageAccessor.message("companyField.companyName"), 6, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyManager", this.messageAccessor.message("companyField.companyManager"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyTel", this.messageAccessor.message("companyField.companyTel"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyEmail", this.messageAccessor.message("companyField.companyEmail"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyMemo", this.messageAccessor.message("companyField.companyMemo"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | |
| | | excelInfo.setDatas(companyFieldVos); |
| | | |
| | | model.addAttribute(Constants.EXCEL, excelInfo); |
| | | return new ModelAndView(this.excelView); |
| | | } |
| | | |
| | | // 삭제 할 업체가 있는지 확인 |
| | | @Override |
| | | public boolean company(Long Id) { |
| | | return this.companyFieldMapper.findByCompany(Id) > 0; |
| | | } |
| | | |
| | | // 검색 결과를 CompanyFieldVo 로 변환한다. |
| | | private List<CompanyFieldVo> convertCompanyVoToMap(List<Map<String, Object>> results, Long totalCompanyCount, Pageable pageable, Map<String, Object> resJsonData) { |
| | | List<CompanyFieldVo> companyFieldVos = Lists.newArrayList(); |
| | | |
| | | for (Map<String, Object> result : results) { |
| | | CompanyFieldVo companyFieldVo = ConvertUtil.convertMapToClass(result, CompanyFieldVo.class); |
| | | companyFieldVos.add(companyFieldVo); |
| | | } |
| | | |
| | | int totalPage = (int) Math.ceil((totalCompanyCount - 1) / pageable.getPageSize()) + 1; |
| | | |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, companyFieldVos); |
| | | resJsonData.put(Constants.REQ_KEY_PAGE_VO, new ResPage(pageable.getPageNumber(), pageable.getPageSize(), |
| | | totalPage, totalCompanyCount)); |
| | | |
| | | return companyFieldVos; |
| | | } |
| | | |
| | | // 업체 ID 로 조회한다 |
| | | @Override |
| | | public CompanyField getCompany(Long id) { |
| | | if (id == null) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.COMPANYFIELD_NOT_EXIST)); |
| | | } |
| | | |
| | | CompanyField companyField = this.findOne(id); |
| | | |
| | | if (companyField == null) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.COMPANYFIELD_NOT_EXIST)); |
| | | } |
| | | return companyField; |
| | | } |
| | | } |
| | |
| | | // DepartmentManage에 임시로 Name, Description 값 추가 |
| | | DepartmentManageForm departmentManageForm = new DepartmentManageForm(); |
| | | |
| | | departmentManageForm.setDepartmentName("개발팀"); |
| | | departmentManageForm.setDepartmentDescription("웹사이트 및 앱 서비스 개발"); |
| | | departmentManageForm.setDepartmentName("부서 없음"); |
| | | DepartmentManage departmentManage = this.departmentManageService.addDepartmentManage(departmentManageForm); |
| | | user.setDepartmentManage(departmentManage); |
| | | |
| | |
| | | private Long id; |
| | | private String departmentName; |
| | | private String departmentDescription; |
| | | private String defaultYn; |
| | | |
| | | private Long departmentCount; |
| | | public DepartmentManageVo() {} |
New file |
| | |
| | | package kr.wisestone.owl.vo; |
| | | |
| | | public class HostingVo extends BaseVo{ |
| | | |
| | | private Long id; |
| | | private String name; |
| | | private String manager; |
| | | private String tel; |
| | | private String email; |
| | | private String memo; |
| | | |
| | | public HostingVo() {} |
| | | |
| | | public HostingVo(Long id, String name, String manager, String tel, String email, String memo) { |
| | | |
| | | this.id = id; |
| | | this.name = name; |
| | | this.manager = manager; |
| | | this.tel = tel; |
| | | this.email = email; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getManager() { |
| | | return manager; |
| | | } |
| | | |
| | | public void setManager(String manager) { |
| | | this.manager = manager; |
| | | } |
| | | |
| | | public String getTel() { |
| | | return tel; |
| | | } |
| | | |
| | | public void setTel(String tel) { |
| | | this.tel = tel; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.vo; |
| | | |
| | | public class IspVo extends BaseVo{ |
| | | |
| | | private Long id; |
| | | private String name; |
| | | private String manager; |
| | | private String tel; |
| | | private String email; |
| | | private String memo; |
| | | |
| | | public IspVo() {} |
| | | |
| | | public IspVo(Long id, String name, String manager, String tel, String email, String memo) { |
| | | |
| | | this.id = id; |
| | | this.name = name; |
| | | this.manager = manager; |
| | | this.tel = tel; |
| | | this.email = email; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getManager() { |
| | | return manager; |
| | | } |
| | | |
| | | public void setManager(String manager) { |
| | | this.manager = manager; |
| | | } |
| | | |
| | | public String getTel() { |
| | | return tel; |
| | | } |
| | | |
| | | public void setTel(String tel) { |
| | | this.tel = tel; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.web.condition; |
| | | |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public class HostingCondition { |
| | | private Long id; |
| | | private String name; |
| | | private String manager; |
| | | private String tel; |
| | | private String email; |
| | | private String memo; |
| | | |
| | | private Integer Page; |
| | | private Integer PageSize; |
| | | |
| | | public static HostingCondition make(Map<String, Object> companyFieldCondition) { |
| | | return ConvertUtil.convertMapToClass(companyFieldCondition, HostingCondition.class); |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getManager() { |
| | | return manager; |
| | | } |
| | | |
| | | public void setManager(String manager) { |
| | | this.manager = manager; |
| | | } |
| | | |
| | | public String getTel() { |
| | | return tel; |
| | | } |
| | | |
| | | public void setTel(String tel) { |
| | | this.tel = tel; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public Integer getPage() { |
| | | return Page; |
| | | } |
| | | |
| | | public void setPage(Integer page) { |
| | | Page = page; |
| | | } |
| | | |
| | | public Integer getPageSize() { |
| | | return PageSize; |
| | | } |
| | | |
| | | public void setPageSize(Integer pageSize) { |
| | | PageSize = pageSize; |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.web.condition; |
| | | |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public class IspCondition { |
| | | private Long id; |
| | | private String name; |
| | | private String manager; |
| | | private String tel; |
| | | private String email; |
| | | private String memo; |
| | | |
| | | private Integer Page; |
| | | private Integer PageSize; |
| | | |
| | | public static IspCondition make(Map<String, Object> companyFieldCondition) { |
| | | return ConvertUtil.convertMapToClass(companyFieldCondition, IspCondition.class); |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getManager() { |
| | | return manager; |
| | | } |
| | | |
| | | public void setManager(String manager) { |
| | | this.manager = manager; |
| | | } |
| | | |
| | | public String getTel() { |
| | | return tel; |
| | | } |
| | | |
| | | public void setTel(String tel) { |
| | | this.tel = tel; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public Integer getPage() { |
| | | return Page; |
| | | } |
| | | |
| | | public void setPage(Integer page) { |
| | | Page = page; |
| | | } |
| | | |
| | | public Integer getPageSize() { |
| | | return PageSize; |
| | | } |
| | | |
| | | public void setPageSize(Integer pageSize) { |
| | | PageSize = pageSize; |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.web.controller; |
| | | |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.service.HostingService; |
| | | import kr.wisestone.owl.web.condition.HostingCondition; |
| | | import kr.wisestone.owl.web.form.HostingForm; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Controller |
| | | public class HostingController extends BaseController{ |
| | | |
| | | @Autowired |
| | | private HostingService HostingService; |
| | | |
| | | // 업체 생성 |
| | | @RequestMapping(value = "/hosting/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.HostingService.addCompany(HostingForm.make(content)); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 업체 조회 |
| | | @RequestMapping(value = "/hosting/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.HostingService.findCompany(resJsonData, HostingCondition.make(params.get(Constants.REQ_KEY_CONTENT)), pageable); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 업체 상세 조회 |
| | | @RequestMapping(value = "/hosting/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.HostingService.detailCompany(resJsonData, HostingCondition.make(params.get(Constants.REQ_KEY_CONTENT))); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 업체 수정 |
| | | @RequestMapping(value = "/hosting/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.HostingService.modifyCompany(HostingForm.make(params.get(Constants.REQ_KEY_CONTENT))); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 업체 삭제 |
| | | @RequestMapping(value = "/hosting/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.HostingService.removeCompany(HostingForm.make(content)); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | |
| | | // 업체 엑셀 다운로드 |
| | | @RequestMapping(value = "/hosting/downloadExcel", method = RequestMethod.POST) |
| | | public ModelAndView downloadExcel(HttpServletRequest request, Model model) { |
| | | return this.HostingService.downloadExcel(request, model); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package kr.wisestone.owl.web.controller; |
| | | |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.service.IspService; |
| | | import kr.wisestone.owl.web.condition.IspCondition; |
| | | import kr.wisestone.owl.web.form.IspForm; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Controller |
| | | public class IspController extends BaseController{ |
| | | |
| | | @Autowired |
| | | private IspService IspService; |
| | | |
| | | // 업체 생성 |
| | | @RequestMapping(value = "/isp/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.IspService.addCompany(IspForm.make(content)); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 업체 조회 |
| | | @RequestMapping(value = "/isp/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.IspService.findCompany(resJsonData, IspCondition.make(params.get(Constants.REQ_KEY_CONTENT)), pageable); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 업체 상세 조회 |
| | | @RequestMapping(value = "/isp/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.IspService.detailCompany(resJsonData, IspCondition.make(params.get(Constants.REQ_KEY_CONTENT))); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 업체 수정 |
| | | @RequestMapping(value = "/isp/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.IspService.modifyCompany(IspForm.make(params.get(Constants.REQ_KEY_CONTENT))); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 업체 삭제 |
| | | @RequestMapping(value = "/isp/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.IspService.removeCompany(IspForm.make(content)); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | |
| | | // 업체 엑셀 다운로드 |
| | | @RequestMapping(value = "/isp/downloadExcel", method = RequestMethod.POST) |
| | | public ModelAndView downloadExcel(HttpServletRequest request, Model model) { |
| | | return this.IspService.downloadExcel(request, model); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | CREATE TABLE `department_manage`( |
| | | `id` BIGINT(11) AUTO_INCREMENT, |
| | | `department_name` VARCHAR(50) NOT NULL, |
| | | `department_description` VARCHAR(255) NOT NULL, |
| | | `department_name` VARCHAR(50) NULL, |
| | | `department_description` VARCHAR(255) NULL, |
| | | `register_id` BIGINT(20) NOT NULL, |
| | | `register_date` TIMESTAMP NULL, |
| | | `modify_id` BIGINT(20) NOT NULL, |
| | | `modify_date` TIMESTAMP NULL, |
| | | `default_department` VARCHAR (50) NULL DEFAULT '부서 없음', |
| | | PRIMARY KEY (`id`) USING BTREE |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; |
| | | |
| | |
| | | `modify_date` TIMESTAMP NULL, |
| | | PRIMARY KEY (`id`) USING BTREE |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; |
| | | /* 이메일은 ID 값으로 받고 연락처도 user에 phone에서 받으면 되고*/ |
| | | |
| | | CREATE TABLE `isp`( |
| | | `id` BIGINT(11) AUTO_INCREMENT, |
| | | `name` VARCHAR(50) NOT NULL, |
| | | `manager` VARCHAR(50) NULL, |
| | | `tel` VARCHAR (50) NULL, |
| | | `email` VARCHAR (255) NULL, |
| | | `memo` VARCHAR(255) NULL, |
| | | `register_id` BIGINT(20) NOT NULL, |
| | | `register_date` TIMESTAMP NULL, |
| | | `modify_id` BIGINT(20) NOT NULL, |
| | | `modify_date` TIMESTAMP NULL, |
| | | PRIMARY KEY (`id`) USING BTREE |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; |
| | | |
| | | |
| | | CREATE TABLE `hosting`( |
| | | `id` BIGINT(11) AUTO_INCREMENT, |
| | | `name` VARCHAR(50) NOT NULL, |
| | | `manager` VARCHAR(50) NULL, |
| | | `tel` VARCHAR (50) NULL, |
| | | `email` VARCHAR (255) NULL, |
| | | `memo` VARCHAR(255) NULL, |
| | | `register_id` BIGINT(20) NOT NULL, |
| | | `register_date` TIMESTAMP NULL, |
| | | `modify_id` BIGINT(20) NOT NULL, |
| | | `modify_date` TIMESTAMP NULL, |
| | | PRIMARY KEY (`id`) USING BTREE |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; |
| | | |
| | |
| | | dm.id as id, |
| | | dm.department_name as departmentName, |
| | | dm.department_description as departmentDescription, |
| | | dm.default_department as defalutDepartment, |
| | | (SELECT COUNT(u.id) FROM user u WHERE dm.id = u.department_id) AS departmentCount |
| | | FROM |
| | | department_manage dm |