검색 모달 기능 추가

This commit is contained in:
Suh
2024-01-11 16:32:40 +09:00
parent 6f2cd14220
commit 76e6d3c949
15 changed files with 462 additions and 15 deletions

View File

@@ -3,17 +3,22 @@ package com.no1.wms.account;
import com.no1.wms.utils.ConstantValues;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import java.util.List;
@Controller
@RequestMapping("/account")
public class AccountController {
@Autowired
AccountService accountService;
@GetMapping("/list")
public ModelAndView list(ModelAndView mav, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "0") int start){
List<AccountDto> list = accountService.selectAll(search, start, ConstantValues.PER_PAGE);
@@ -23,4 +28,19 @@ public class AccountController {
return mav;
}
@PostMapping("/create")
public ModelAndView create(ModelAndView mav){
mav.setViewName("account/create");
return mav;
}
@PostMapping("/show_modal")
public ModelAndView showModal(ModelAndView mav, @RequestParam String name){
//db에서 데이터 가져오는거 필요
//
mav.setViewName(name);
return mav;
}
}

View File

@@ -1,5 +1,6 @@
package com.no1.wms.account;
import com.no1.wms.authority.AuthorityDto;
import com.no1.wms.department.DepartmentDto;
import com.no1.wms.position.PositionDto;
import lombok.AllArgsConstructor;
@@ -27,8 +28,14 @@ public class AccountDto {
private Date birth;
private String telephone;
private String address;
private DepartmentDto department;
private PositionDto position;
private String departmentId;
private String positionId;
private DepartmentDto departmentDto;
private PositionDto positionDto;
private AuthorityDto groupAuthorityDto;
private AuthorityDto personalAuthorityDto;
@Builder.Default
private Boolean activation = true;

View File

@@ -25,7 +25,9 @@ public class AccountService {
public List<AccountDto> selectAll(String search, int start, int perPage){
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("search", search);
map.put("start", start);
map.put("perPage", perPage);

View File

@@ -0,0 +1,17 @@
package com.no1.wms.account;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.Alias;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Alias("DeptPositionDto")
public class DeptAndPositionDto {
private String id;
private String name;
}