mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-05 04:03:45 +09:00
Merge branch 'master' of https://github.com/suhf/No1WMS
# Conflicts: # src/main/java/com/no1/wms/vendor/VendorDto.java # src/main/resources/mappers/VendorMapper.xml # src/main/webapp/WEB-INF/views/vendor/create.jsp # src/main/webapp/WEB-INF/views/vendor/list.jsp # src/main/webapp/WEB-INF/views/vendor/read.jsp # src/main/webapp/WEB-INF/views/vendor/update.jsp
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package com.no1.wms.account;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.no1.wms.authority.AuthorityDto;
|
||||
import com.no1.wms.authority.AuthorityService;
|
||||
import com.no1.wms.utils.ConstantValues;
|
||||
@@ -11,7 +9,6 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.io.StringReader;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
@@ -27,11 +24,32 @@ public class AccountController {
|
||||
AuthorityService authorityService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public ModelAndView list(ModelAndView mav, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "0") int start){
|
||||
public ModelAndView list(ModelAndView mav,@RequestParam(defaultValue = "0") int searchn, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "1") int page){
|
||||
int perPage = 10;
|
||||
int startRow = (page - 1) * perPage;
|
||||
int count = accountService.count(searchn, search, startRow, perPage);
|
||||
|
||||
List<AccountDto> list = accountService.selectAll(search, start, ConstantValues.PER_PAGE);
|
||||
|
||||
int pageNum = 4;//보여질 페이지 번호 수
|
||||
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
||||
|
||||
|
||||
|
||||
|
||||
//스톡서비스로 재고 리스트 출력 메서트 작성
|
||||
List<AccountDto> list = accountService.selectAll(searchn, search, searchn, perPage);
|
||||
|
||||
int begin = (page - 1) / pageNum * pageNum + 1;
|
||||
int end = begin + pageNum - 1;
|
||||
if (end > totalPages) {
|
||||
end = totalPages;
|
||||
}
|
||||
mav.addObject("list", list);
|
||||
mav.addObject("end", end);
|
||||
mav.addObject("searchn", searchn);
|
||||
mav.addObject("search", search);
|
||||
mav.addObject("page", startRow);
|
||||
mav.addObject("begin", begin);
|
||||
mav.setViewName("account/list");
|
||||
return mav;
|
||||
}
|
||||
@@ -120,7 +138,7 @@ public class AccountController {
|
||||
}else if(name.equals("dept")){
|
||||
list = accountService.selectDeptAll(search, start, ConstantValues.PER_PAGE);
|
||||
}else if(name.equals("pos")){
|
||||
list = accountService.selectPosAll(search, start, ConstantValues.PER_PAGE);
|
||||
list = accountService.selectPosAll(10, search, start);
|
||||
}
|
||||
//
|
||||
mav.addObject("list", list);
|
||||
|
||||
@@ -31,4 +31,6 @@ public interface AccountMapper {
|
||||
int delete(AccountDto dto);
|
||||
|
||||
AccountDto selectByLogin(AccountDto dto);
|
||||
|
||||
int count(Map<String, Object> m);
|
||||
}
|
||||
|
||||
@@ -29,11 +29,12 @@ public class AccountService {
|
||||
return mapper.selectById(dto);
|
||||
}
|
||||
|
||||
public List<AccountDto> selectAll(String search, int start, int perPage){
|
||||
public List<AccountDto> selectAll(int searchn, 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);
|
||||
map.put("searchn", searchn);
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +50,7 @@ public class AccountService {
|
||||
return mapper.selectDeptAll(map);
|
||||
}
|
||||
|
||||
List<PositionDto> selectPosAll(String search, int start, int perPage){
|
||||
List<PositionDto> selectPosAll(int perPage, String search, int start){
|
||||
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("search", search);
|
||||
map.put("start", start);
|
||||
@@ -69,4 +70,13 @@ public class AccountService {
|
||||
return mapper.selectByLogin(dto);
|
||||
}
|
||||
|
||||
int count(int searchn, String search, int start, int perPage){
|
||||
HashMap<String, Object> m = new HashMap<>();
|
||||
m.put("searchn", searchn);
|
||||
m.put("search", search);
|
||||
m.put("start", start);
|
||||
m.put("perPage", perPage);
|
||||
return mapper.count(m);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class AuthAspect {
|
||||
|
||||
|
||||
AuthData authData = auth.get(packageName);
|
||||
if(packageName.equals("base")){
|
||||
if(packageName.equals("base") || packageName.equals("mypage")){
|
||||
return joinPoint.proceed();
|
||||
}else if( authData != null ){
|
||||
String methodName = joinPoint.getSignature().getName().toLowerCase();
|
||||
|
||||
@@ -202,6 +202,8 @@ public class CategoryController {
|
||||
return "modal/categorysearch";
|
||||
};
|
||||
|
||||
|
||||
//서식 다운로드
|
||||
@GetMapping("/category/downlodeCategoryForm")
|
||||
public void downlodeCategoryForm (HttpServletResponse response) throws IOException{
|
||||
String categoryFormName = "카테고리 데이터 입력 서식.xlsx";
|
||||
|
||||
@@ -166,4 +166,6 @@ public class PriceController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
import com.no1.wms.category.CategoryDto;
|
||||
import com.no1.wms.category.CategoryService;
|
||||
import com.no1.wms.price.PriceDto;
|
||||
import com.no1.wms.vendor.VendorDto;
|
||||
import com.no1.wms.vendor.VendorService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/product")
|
||||
@@ -26,6 +28,8 @@ public class ProductController {
|
||||
ProductService productService;
|
||||
@Autowired
|
||||
CategoryService categoryService;
|
||||
@Autowired
|
||||
VendorService service;
|
||||
|
||||
/*
|
||||
@GetMapping("list")
|
||||
@@ -141,7 +145,7 @@ public class ProductController {
|
||||
@RequestParam(name = "p", defaultValue = "1") int page, ModelAndView m, String name) {
|
||||
int count = categoryService.count(searchn, search);
|
||||
|
||||
int perPage = 10; // 한 페이지에 보일 글의 개수
|
||||
int perPage =9; // 한 페이지에 보일 글의 개수
|
||||
int startRow = (page - 1) * perPage;
|
||||
|
||||
List<CategoryDto> dto = categoryService.categoryList2(searchn, search, startRow ,perPage);
|
||||
@@ -171,6 +175,44 @@ public class ProductController {
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/show_modal2")
|
||||
public ModelAndView vendorShowModal(@RequestParam(name = "searchn", defaultValue = "0") int searchn,
|
||||
@RequestParam(name = "search", defaultValue = "") String search,
|
||||
@RequestParam(name = "p", defaultValue = "1") int page, ModelAndView m, String name) {
|
||||
|
||||
int count = service.count(searchn, search);
|
||||
|
||||
int perPage = 9; // 한 페이지에 보일 글의 갯수
|
||||
int startRow = (page - 1) * perPage;
|
||||
|
||||
//스톡서비스로 재고 리스트 출력 메서트 작성
|
||||
List<VendorDto> dto = service.list(searchn, search, startRow ,perPage);
|
||||
|
||||
|
||||
m.addObject("vlist", dto);
|
||||
m.addObject("start", startRow + 1);
|
||||
|
||||
int pageNum = 5;//보여질 페이지 번호 수
|
||||
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
||||
|
||||
int begin = (page - 1) / pageNum * pageNum + 1;
|
||||
int end = begin + pageNum - 1;
|
||||
if (end > totalPages) {
|
||||
end = totalPages;
|
||||
}
|
||||
m.addObject("searchn", searchn);
|
||||
m.addObject("search", search);
|
||||
m.addObject("begin", begin);
|
||||
m.addObject("end", end);
|
||||
m.addObject("pageNum", pageNum);
|
||||
m.addObject("totalPages", totalPages);
|
||||
m.addObject("p" , page);
|
||||
m.setViewName(name);
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,124 +1,124 @@
|
||||
package com.no1.wms.vendor;
|
||||
|
||||
import com.no1.wms.warehouse.WarehouseDto;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class VendorController {
|
||||
|
||||
@Autowired
|
||||
VendorService service;
|
||||
|
||||
// 재고 리스트 출력
|
||||
@GetMapping("vendor/list")
|
||||
public String list(@RequestParam(name = "searchn", defaultValue = "0") int searchn,
|
||||
@RequestParam(name = "search", defaultValue = "") String search,
|
||||
@RequestParam(name = "p", defaultValue = "1") int page, Model m) {
|
||||
|
||||
int count = service.count(searchn, search);
|
||||
|
||||
int perPage = 10; // 한 페이지에 보일 글의 갯수
|
||||
int startRow = (page - 1) * perPage;
|
||||
|
||||
//스톡서비스로 재고 리스트 출력 메서트 작성
|
||||
List<VendorDto> dto = service.list(searchn, search, startRow ,perPage);
|
||||
|
||||
|
||||
m.addAttribute("vlist", dto);
|
||||
m.addAttribute("start", startRow + 1);
|
||||
|
||||
int pageNum = 5;//보여질 페이지 번호 수
|
||||
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
||||
|
||||
int begin = (page - 1) / pageNum * pageNum + 1;
|
||||
int end = begin + pageNum - 1;
|
||||
if (end > totalPages) {
|
||||
end = totalPages;
|
||||
}
|
||||
m.addAttribute("searchn", searchn);
|
||||
m.addAttribute("search", search);
|
||||
m.addAttribute("begin", begin);
|
||||
m.addAttribute("end", end);
|
||||
m.addAttribute("pageNum", pageNum);
|
||||
m.addAttribute("totalPages", totalPages);
|
||||
m.addAttribute("p" , page);
|
||||
|
||||
return "vendor/list";
|
||||
}
|
||||
|
||||
|
||||
// 재고 상세페이지
|
||||
@PostMapping("vendor/read")
|
||||
public String read(String id, Model m) {
|
||||
//스톡서비스로 재고 상세페이지 출력 메서드 작성
|
||||
|
||||
VendorDto One = service.vendorOne(id);
|
||||
System.out.println("one :: " + One);
|
||||
log.debug("One테스트 :: " + One);
|
||||
|
||||
m.addAttribute("One", One);
|
||||
|
||||
return "vendor/read";
|
||||
}
|
||||
|
||||
|
||||
// 수정 - 폼
|
||||
@PostMapping("/vendor/update")
|
||||
public String update(String id, Model m) {
|
||||
VendorDto dto = service.vendorOne(id);
|
||||
m.addAttribute("dto", dto);
|
||||
return "vendor/update";
|
||||
}
|
||||
|
||||
|
||||
// 수정 프로세스
|
||||
@PutMapping("/vendor/update_process")
|
||||
@ResponseBody
|
||||
public boolean updateProcess(VendorDto dto) {
|
||||
|
||||
int i = service.updateVendor(dto);
|
||||
if (i == 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 생성 폼
|
||||
@PostMapping("/vendor/create")
|
||||
public String create()
|
||||
{
|
||||
return "vendor/create";
|
||||
}
|
||||
|
||||
|
||||
// 생성 프로세스
|
||||
@PostMapping("/vendor/create_process")
|
||||
@ResponseBody
|
||||
public boolean createProcess(VendorDto dto) {
|
||||
int i = service.createVendor(dto);
|
||||
if (i == 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 삭제
|
||||
@DeleteMapping("/vendor/delete")
|
||||
@ResponseBody
|
||||
public int delete(String id) {
|
||||
int i = service.deleteVendor(id);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
package com.no1.wms.vendor;
|
||||
|
||||
import com.no1.wms.warehouse.WarehouseDto;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class VendorController {
|
||||
|
||||
@Autowired
|
||||
VendorService service;
|
||||
|
||||
// 재고 리스트 출력
|
||||
@GetMapping("vendor/list")
|
||||
public String list(@RequestParam(name = "searchn", defaultValue = "0") int searchn,
|
||||
@RequestParam(name = "search", defaultValue = "") String search,
|
||||
@RequestParam(name = "p", defaultValue = "1") int page, Model m) {
|
||||
|
||||
int count = service.count(searchn, search);
|
||||
|
||||
int perPage = 10; // 한 페이지에 보일 글의 갯수
|
||||
int startRow = (page - 1) * perPage;
|
||||
|
||||
//스톡서비스로 재고 리스트 출력 메서트 작성
|
||||
List<VendorDto> dto = service.list(searchn, search, startRow ,perPage);
|
||||
|
||||
|
||||
m.addAttribute("vlist", dto);
|
||||
m.addAttribute("start", startRow + 1);
|
||||
|
||||
int pageNum = 5;//보여질 페이지 번호 수
|
||||
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
||||
|
||||
int begin = (page - 1) / pageNum * pageNum + 1;
|
||||
int end = begin + pageNum - 1;
|
||||
if (end > totalPages) {
|
||||
end = totalPages;
|
||||
}
|
||||
m.addAttribute("searchn", searchn);
|
||||
m.addAttribute("search", search);
|
||||
m.addAttribute("begin", begin);
|
||||
m.addAttribute("end", end);
|
||||
m.addAttribute("pageNum", pageNum);
|
||||
m.addAttribute("totalPages", totalPages);
|
||||
m.addAttribute("p" , page);
|
||||
|
||||
return "vendor/list";
|
||||
}
|
||||
|
||||
|
||||
// 재고 상세페이지
|
||||
@PostMapping("vendor/read")
|
||||
public String read(String id, Model m) {
|
||||
//스톡서비스로 재고 상세페이지 출력 메서드 작성
|
||||
|
||||
VendorDto One = service.vendorOne(id);
|
||||
System.out.println("one :: " + One);
|
||||
log.debug("One테스트 :: " + One);
|
||||
|
||||
m.addAttribute("One", One);
|
||||
|
||||
return "vendor/read";
|
||||
}
|
||||
|
||||
|
||||
// 수정 - 폼
|
||||
@PostMapping("/vendor/update")
|
||||
public String update(String id, Model m) {
|
||||
VendorDto dto = service.vendorOne(id);
|
||||
m.addAttribute("dto", dto);
|
||||
return "vendor/update";
|
||||
}
|
||||
|
||||
|
||||
// 수정 프로세스
|
||||
@PutMapping("/vendor/update_process")
|
||||
@ResponseBody
|
||||
public boolean updateProcess(VendorDto dto) {
|
||||
|
||||
int i = service.updateVendor(dto);
|
||||
if (i == 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 생성 폼
|
||||
@PostMapping("/vendor/create")
|
||||
public String create()
|
||||
{
|
||||
return "vendor/create";
|
||||
}
|
||||
|
||||
|
||||
// 생성 프로세스
|
||||
@PostMapping("/vendor/create_process")
|
||||
@ResponseBody
|
||||
public boolean createProcess(VendorDto dto) {
|
||||
int i = service.createVendor(dto);
|
||||
if (i == 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 삭제
|
||||
@DeleteMapping("/vendor/delete")
|
||||
@ResponseBody
|
||||
public int delete(String id) {
|
||||
int i = service.deleteVendor(id);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
package com.no1.wms.vendor;
|
||||
|
||||
import com.no1.wms.warehouse.WarehouseDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface VendorMapper {
|
||||
|
||||
List<VendorDto> list(Map<String, Object> m);
|
||||
|
||||
int count(Map<String, Object> m);//검색 글 갯수
|
||||
|
||||
VendorDto vendorOne(String id);
|
||||
|
||||
int updateVendor(VendorDto dto);
|
||||
|
||||
int createVendor(VendorDto dto);
|
||||
|
||||
int deleteVendor(String id);
|
||||
|
||||
|
||||
}
|
||||
package com.no1.wms.vendor;
|
||||
|
||||
import com.no1.wms.warehouse.WarehouseDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface VendorMapper {
|
||||
|
||||
List<VendorDto> list(Map<String, Object> m);
|
||||
|
||||
int count(Map<String, Object> m);//검색 글 갯수
|
||||
|
||||
VendorDto vendorOne(String id);
|
||||
|
||||
int updateVendor(VendorDto dto);
|
||||
|
||||
int createVendor(VendorDto dto);
|
||||
|
||||
int deleteVendor(String id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
114
src/main/java/com/no1/wms/vendor/VendorService.java
vendored
114
src/main/java/com/no1/wms/vendor/VendorService.java
vendored
@@ -1,57 +1,57 @@
|
||||
package com.no1.wms.vendor;
|
||||
|
||||
import com.no1.wms.warehouse.WarehouseDto;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class VendorService {
|
||||
@Autowired
|
||||
VendorMapper mapper;
|
||||
|
||||
public int count(int searchn, String search) {
|
||||
|
||||
Map<String, Object> m = new HashMap<String, Object>();
|
||||
m.put("searchn", searchn);
|
||||
m.put("search", search);
|
||||
return mapper.count(m);
|
||||
}
|
||||
|
||||
|
||||
public List<VendorDto> list(int searchn, String search, int start, int perPage) {
|
||||
|
||||
System.out.println(searchn + search);
|
||||
|
||||
Map<String, Object> m = new HashMap<String, Object>();
|
||||
m.put("searchn", searchn);
|
||||
m.put("search", search);
|
||||
m.put("start", start);
|
||||
m.put("perPage", perPage);
|
||||
|
||||
return mapper.list(m);
|
||||
}
|
||||
|
||||
public VendorDto vendorOne(String id) {
|
||||
return mapper.vendorOne(id);
|
||||
}
|
||||
|
||||
public int updateVendor(VendorDto dto) {
|
||||
return mapper.updateVendor(dto);
|
||||
}
|
||||
|
||||
|
||||
public int createVendor(VendorDto dto) {
|
||||
return mapper.createVendor(dto);
|
||||
}
|
||||
|
||||
|
||||
public int deleteVendor(String id) {
|
||||
return mapper.deleteVendor(id);
|
||||
}
|
||||
}
|
||||
package com.no1.wms.vendor;
|
||||
|
||||
import com.no1.wms.warehouse.WarehouseDto;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class VendorService {
|
||||
@Autowired
|
||||
VendorMapper mapper;
|
||||
|
||||
public int count(int searchn, String search) {
|
||||
|
||||
Map<String, Object> m = new HashMap<String, Object>();
|
||||
m.put("searchn", searchn);
|
||||
m.put("search", search);
|
||||
return mapper.count(m);
|
||||
}
|
||||
|
||||
|
||||
public List<VendorDto> list(int searchn, String search, int start, int perPage) {
|
||||
|
||||
System.out.println(searchn + search);
|
||||
|
||||
Map<String, Object> m = new HashMap<String, Object>();
|
||||
m.put("searchn", searchn);
|
||||
m.put("search", search);
|
||||
m.put("start", start);
|
||||
m.put("perPage", perPage);
|
||||
|
||||
return mapper.list(m);
|
||||
}
|
||||
|
||||
public VendorDto vendorOne(String id) {
|
||||
return mapper.vendorOne(id);
|
||||
}
|
||||
|
||||
public int updateVendor(VendorDto dto) {
|
||||
return mapper.updateVendor(dto);
|
||||
}
|
||||
|
||||
|
||||
public int createVendor(VendorDto dto) {
|
||||
return mapper.createVendor(dto);
|
||||
}
|
||||
|
||||
|
||||
public int deleteVendor(String id) {
|
||||
return mapper.deleteVendor(id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user