update in

This commit is contained in:
Kana
2024-01-22 09:15:12 +09:00
parent c4776ac8a2
commit fd2d273f54
3 changed files with 43 additions and 6 deletions

View File

@@ -79,13 +79,37 @@ public class InController {
@PostMapping("/create_process")
@ResponseBody
public boolean createProcess(InDto dto) {
int j = inService.checkIfExistsStock(dto);
if(j == 1) {
int k = inService.updateStockProcess(dto);
if(k == 1) {
int i = inService.createProcess(dto);
int j = inService.createProcess2(dto);
if (i == 1 & i == j) {
if(i == k) {
System.out.println("달라서 새로만듬");
return true;
}else {
return false;
}
}else {
return false;
}
}else if(j == 0) {
int k = inService.createStockProcess(dto);
if(k == 1) {
int i = inService.createProcess(dto);
if(i == k) {
System.out.println("같아서 합침");
return true;
}else {
return false;
}
}else {
return false;
}
}else {
return false;
}
}
@PostMapping("/read")
@@ -172,7 +196,7 @@ public class InController {
@RequestParam(name = "p", defaultValue = "1") int page,
@RequestParam String name, String product_id, ModelAndView mav){
int perPage = 9; // 한 페이지에 보일 글의 갯수
int perPage = 5; // 한 페이지에 보일 글의 갯수
int startRow = (page - 1) * perPage;
List<Map<String, Object>> list = null;

View File

@@ -13,5 +13,8 @@ public interface InMapper {
int createProcess2(InDto dto);
InDto selectById (String id);
int updateById(InDto dto);
int checkIfExistsStock(InDto dto);
int updateStockProcess(InDto dto);
int createStockProcess(InDto dto);
}

View File

@@ -46,6 +46,16 @@ public class InService {
return mapper.updateById(dto);
}
public int checkIfExistsStock(InDto dto) {
return mapper.checkIfExistsStock(dto);
}
public int updateStockProcess(InDto dto) {
return mapper.updateStockProcess(dto);
}
public int createStockProcess(InDto dto) {
return mapper.createStockProcess(dto);
}
}