| | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | private Long id; |
| | | private String departmentId; |
| | | |
| | | @ManyToOne(targetEntity = User.class, fetch = FetchType.LAZY) |
| | | @JoinColumn(name="user_id") |
| | | private User user; |
| | | |
| | | public UserDepartment(){} |
| | | private Long departmentId; |
| | | private Long userId; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getDepartmentId() { |
| | | public Long getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | |
| | | public void setDepartmentId(String departmentId) { |
| | | public void setDepartmentId(Long departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | |
| | | public User getUser() { |
| | | return user; |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUser(User user) { |
| | | this.user = user; |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | } |
| | |
| | | package kr.wisestone.owl.mapper; |
| | | |
| | | import kr.wisestone.owl.vo.DepartmentVo; |
| | | import kr.wisestone.owl.web.condition.DepartmentCondition; |
| | | import kr.wisestone.owl.web.condition.UserCondition; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | |
| | | List<Map<String, Object>> findEvent(); |
| | | |
| | | Long findBydepartmentId(Long Id); |
| | | |
| | | List<Map<String, Object>> findByDepartmentIds(UserCondition condition); |
| | | } |
| | |
| | | import kr.wisestone.owl.domain.Department; |
| | | import kr.wisestone.owl.vo.DepartmentVo; |
| | | import kr.wisestone.owl.web.condition.DepartmentCondition; |
| | | import kr.wisestone.owl.web.condition.UserCondition; |
| | | import kr.wisestone.owl.web.form.DepartmentForm; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | |
| | | ModelAndView downloadExcel(HttpServletRequest request, Model model); |
| | | |
| | | boolean department(Long id); |
| | | |
| | | List<Map<String, Object>> findByDepartmentIds( UserCondition condition); |
| | | |
| | | } |
| | |
| | | import kr.wisestone.owl.mapper.DepartmentMapper; |
| | | import kr.wisestone.owl.service.UserService; |
| | | import kr.wisestone.owl.web.condition.DepartmentCondition; |
| | | import kr.wisestone.owl.web.condition.UserCondition; |
| | | import kr.wisestone.owl.web.form.DepartmentForm; |
| | | import org.springframework.ui.Model; |
| | | import com.google.common.collect.Lists; |
| | |
| | | this.departmentRepository.flush(); |
| | | } |
| | | |
| | | |
| | | |
| | | // 부서 목록을 엑셀로 다운로드 한다. |
| | | @Override |
| | | public ModelAndView downloadExcel(HttpServletRequest request, Model model) { |
| | |
| | | return this.departmentMapper.findBydepartmentId(Id) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> findByDepartmentIds(UserCondition condition) { |
| | | return this.departmentMapper.findByDepartmentIds(condition); |
| | | } |
| | | |
| | | |
| | | // 검색 결과를 DepartmentVo 로 변환한다. |
| | | private List<DepartmentVo> convertDepartmentVoToMap(List<Map<String, Object>> results, Long totalDepartmentsCount, Pageable pageable, Map<String, Object> resJsonData) { |
| | |
| | | this.userWorkspaceRepository.saveAll(userWorkspaces); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | private Long id; |
| | | private String departmentName; |
| | | private String departmentDescription; |
| | | private String byName; |
| | | |
| | | private Long departmentCount; |
| | | public DepartmentVo() {} |
| | |
| | | public void setDepartmentCount(Long departmentCount) { |
| | | this.departmentCount = departmentCount; |
| | | } |
| | | |
| | | public String getByName() { |
| | | return byName; |
| | | } |
| | | |
| | | public void setByName(String byName) { |
| | | this.byName = byName; |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.vo; |
| | | |
| | | import kr.wisestone.owl.web.form.UserDepartmentForm; |
| | | |
| | | public class UserDepartmentVo extends BaseVo { |
| | | |
| | | private Long id; |
| | | private Long departmentId; |
| | | private Long userId; |
| | | |
| | | private Long departmentCount; |
| | | public UserDepartmentVo() {} |
| | | |
| | | public UserDepartmentVo(Long id, Long departmentId, Long userId) { |
| | | this.id = id; |
| | | this.departmentId = departmentId; |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | |
| | | public void setDepartmentId(Long departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Long getDepartmentCount() { |
| | | return departmentCount; |
| | | } |
| | | |
| | | public void setDepartmentCount(Long departmentCount) { |
| | | this.departmentCount = departmentCount; |
| | | } |
| | | } |
| | |
| | | package kr.wisestone.owl.web.condition; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | private String departmentName; |
| | | private String departmentDescription; |
| | | private Long departmentCount; |
| | | |
| | | private List<Long> departmentIds = Lists.newArrayList(); |
| | | |
| | | private Integer Page; |
| | | private Integer PageSize; |
| | |
| | | public void setPageSize(Integer pageSize) { |
| | | PageSize = pageSize; |
| | | } |
| | | |
| | | public List<Long> getDepartmentIds() { |
| | | return departmentIds; |
| | | } |
| | | |
| | | public void setDepartmentIds(List<Long> departmentIds) { |
| | | this.departmentIds = departmentIds; |
| | | } |
| | | } |
| | |
| | | @RequestMapping(value = "/department/add", method = RequestMethod.POST) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> add(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> departmentAdd(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | Map<String, Object> content = params.get(Constants.REQ_KEY_CONTENT); |
| | | this.departmentService.add(DepartmentForm.make(content)); |
| | |
| | | @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> departmentFind(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | Pageable pageable = this.pageUtil.convertPageable(this.getPageVo(params)); |
| | | |
| | |
| | | @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> departmentDetail(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | this.departmentService.detail(resJsonData, DepartmentCondition.make(params.get(Constants.REQ_KEY_CONTENT))); |
| | | |
| | |
| | | @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> departmentModify(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | |
| | | this.departmentService.modify(DepartmentForm.make(params.get(Constants.REQ_KEY_CONTENT))); |
| | |
| | | @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> departmentRemove(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | Map<String, Object> content = params.get(Constants.REQ_KEY_CONTENT); |
| | | |
New file |
| | |
| | | package kr.wisestone.owl.web.controller; |
| | | |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.service.UserDepartmentService; |
| | | import kr.wisestone.owl.web.condition.UserCondition; |
| | | import kr.wisestone.owl.web.condition.UserDepartmentCondition; |
| | | import kr.wisestone.owl.web.form.UserDepartmentForm; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.stereotype.Controller; |
| | | 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 java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Controller |
| | | public class UserDepartmentController extends BaseController { |
| | | |
| | | @Autowired |
| | | private UserDepartmentService userDepartmentService; |
| | | |
| | | @RequestMapping(value = "/userWorkspace/modifyDepartment", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> userDepartmentModify(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | |
| | | this.userDepartmentService.userDepartmentModify(UserDepartmentForm.make(params.get(Constants.REQ_KEY_CONTENT))); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/userWorkspace/detailDepartment", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> userDepartmentDetail(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | this.userDepartmentService.userDepartmentDetail(resJsonData, UserCondition.make(params.get(Constants.REQ_KEY_CONTENT))); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | } |
| | |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.service.UserWorkspaceService; |
| | | import kr.wisestone.owl.web.condition.UserWorkspaceCondition; |
| | | import kr.wisestone.owl.web.form.ProjectForm; |
| | | import kr.wisestone.owl.web.form.UserWorkspaceForm; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Pageable; |
| | |
| | | |
| | | @Autowired |
| | | private UserWorkspaceService userWorkspaceService; |
| | | |
| | | |
| | | // 업무공간에 참여하는 사용자 조회 |
| | | @RequestMapping(value = "/userWorkspace/find", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.web.form; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.util.MapUtil; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class UserDepartmentForm { |
| | | private Long id; |
| | | private Long departmentId; |
| | | |
| | | private Long userId; |
| | | private List<Long> ids = Lists.newArrayList(); |
| | | |
| | | public UserDepartmentForm() { |
| | | } |
| | | |
| | | public static UserDepartmentForm make(Map<String, Object> params) { |
| | | UserDepartmentForm form = ConvertUtil.convertMapToClass(params, UserDepartmentForm.class); |
| | | |
| | | if (MapUtil.getLongs(params,"Ids") != null) { |
| | | form.setIds(MapUtil.getLongs(params, "Ids")); |
| | | } |
| | | return form; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | |
| | | public void setDepartmentId(Long departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public List<Long> getIds() { |
| | | return ids; |
| | | } |
| | | |
| | | public void setIds(List<Long> ids) { |
| | | this.ids = ids; |
| | | } |
| | | } |
| | |
| | | |
| | | CREATE TABLE `user_department`( |
| | | `id` BIGINT(11) AUTO_INCREMENT, |
| | | `department_id` VARCHAR(50) NULL, |
| | | `user_id` VARCHAR(50) NULL, |
| | | `department_id` BIGINT(11), |
| | | `user_id` BIGINT(11), |
| | | `register_id` BIGINT(20) NOT NULL, |
| | | `register_date` TIMESTAMP NULL, |
| | | `modify_id` BIGINT(20) NOT NULL, |
| | |
| | | AND d.id like CONCAT('%',#{id},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="findByDepartmentIds" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.UserCondition"> |
| | | SELECT |
| | | d.id as id, |
| | | d.department_name as departmentName, |
| | | d.department_description as departmentDescription |
| | | FROM |
| | | user_department ud |
| | | INNER JOIN department d ON ud.department_id = d.id |
| | | WHERE 1=1 |
| | | <if test="id != '' and id != null"> |
| | | AND ud.user_id = #{id} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | case "USE_DEPARTMENT_LIST" : |
| | | makeTag += "<ul class='ul-not-comma'>"; |
| | | |
| | | makeTag += "<div style='cursor: pointer' ng-click='event.modifyUserDepartments(scope.data.id)'>"; |
| | | makeTag += "<div style='cursor: pointer' ng-click='event.modifyUserDepartments(data.id)'>"; |
| | | angular.forEach(scope.data.departments, function (department) { //departmentVO로 수정 체크 필요 |
| | | makeTag += "<li>" + department.fieldValue + "</li>"; |
| | | }); |
| | |
| | | id : parameter.id, |
| | | form : { |
| | | id : parameter.id, |
| | | /*users : [],*/ |
| | | departmentList : [], // 현재 부서 목록 |
| | | departments : [] // 부서 |
| | | }, |
| | | departmentName : "", //부서명 검색 |
| | |
| | | } |
| | | },*/ |
| | | }; |
| | | // angular.extend(this, $controller('autoCompleteController', {$scope : $scope, $injector : $injector})); |
| | | angular.extend(this, $controller('autoCompleteController', {$scope : $scope, $injector : $injector})); |
| | | |
| | | // 선택 한 부서 제거 |
| | | function removeDepartments(index) { |
| | |
| | | } |
| | | |
| | | function detail() { |
| | | var contents = { |
| | | id : parameter.id |
| | | } |
| | | |
| | | UserWorkspace.userDepartmentDetail($resourceProvider.getContent( |
| | | $scope.vm, |
| | | contents, |
| | | $resourceProvider.getPageContent(0, 1))).then(function (result) { |
| | | |
| | | if (result.data.message.status === "success") { |
| | | if (angular.isDefined(result.data.data)) { |
| | | $scope.vm.form.departments = result.data.data.userDepartmentVos; //체크 필요 |
| | | $scope.vm.form.departmentList = result.data.data; //체크 필요 |
| | | } |
| | | } |
| | | else { |
| | |
| | | $scope.$on("getUserWorkspaceList", function () { |
| | | $scope.fn.getLevels(); |
| | | $scope.fn.getDepartments(); |
| | | $scope.fn.makeTableConfigs(); |
| | | |
| | | $scope.fn.getUserWorkspaceList(0); |
| | | }); |
| | | |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | $scope.fn.makeTableConfigs(); |
| | | } |
| | | ]); |
| | | } |
| | |
| | | var Project = $injector.get("Project"); |
| | | var Workflow = $injector.get("Workflow"); |
| | | var Issue = $injector.get("Issue"); |
| | | // var UserWorkspace = $injector.get("UserWorkspace"); |
| | | var UserWorkspace = $injector.get("UserWorkspace"); |
| | | var $log = $injector.get("$log"); |
| | | var SweetAlert = $injector.get("SweetAlert"); |
| | | |
| | |
| | | $scope.fn.getProjectList = getProjectList; // 프로젝트 목록 정보를 조회한다. |
| | | $scope.fn.getIssueList = getIssueList; // 일감 목록 정보를 조회한다. |
| | | $scope.fn.getWorkflowList = getWorkflowList; // 워크플로우 목록 정보를 조회한다. |
| | | // $scope.fn.getDepartmentList = getDepartmentList; // 부서 목록 정보를 조회한다. |
| | | $scope.fn.getUserDepartmentList = getUserDepartmentList; // 부서 목록 정보를 조회한다. |
| | | |
| | | function getUserList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getDepartmentList(query, excludeList, page, callBack) { //체크 필요 |
| | | function getUserDepartmentList(query, excludeList, page, callBack) { //체크 필요 |
| | | var conditions = { |
| | | departmentName : query, |
| | | excludeIds : (function () { //어떤 역할? 체크 필요 |
| | |
| | | }; |
| | | var deferred = $q.defer(); |
| | | |
| | | UserWorkspace.find($resourceProvider.getContent( // 페이징 업데이트가 필요한 컴포넌트 일경우, page 업데이트가 있을 경우 기본 10개씩 가져오고 아닐경우 25개씩 가져온다. |
| | | UserWorkspace.userDepartmentDetail($resourceProvider.getContent( // 페이징 업데이트가 필요한 컴포넌트 일경우, page 업데이트가 있을 경우 기본 10개씩 가져오고 아닐경우 25개씩 가져온다. |
| | | conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 10 : 25))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | |
| | |
| | | <js-autocomplete-multi data-input-name="departments" |
| | | selected-model="vm.form.departments" |
| | | search="vm.departmentName" |
| | | source="fn.getDepartments(vm.departmentName, vm.form.departments)" |
| | | input-disabled="false"> <!--concat 체크 필요--> |
| | | <!--translation-texts="{ count : 'common.userNum', empty : 'common.emptyUser' }" |
| | | extra-settings="{ displayProp : 'byName' , idProp : 'id', imageable : true, imagePathProp : 'profile', type : 'user', maxlength : 100, autoResize : true }"--> |
| | | </js-autocomplete-multi> |
| | | source="fn.getUserDepartmentList(vm.departmentName, vm.form.users)" |
| | | input-disabled="false" |
| | | translation-texts="{ count : 'common.userNum', empty : 'common.emptyUser' }" |
| | | extra-settings="{ displayProp : 'byName' , idProp : 'id', imageable : false, imagePathProp : 'profile', type : 'user', maxlength : 100, autoResize : true }"></js-autocomplete-multi> |
| | | |
| | | |
| | | <div class="select3-selection__choicediv mt-10"> |
| | | <span class="select3-selection__choice" ng-repeat="department in vm.form.departments"> |