세션의 공통코드 관리방식 변경
parent
02e620ffeb
commit
887a89c59f
|
|
@ -22,7 +22,7 @@ public class BaseController {
|
||||||
if(loginUser == null){
|
if(loginUser == null){
|
||||||
mav = new ModelAndView("redirect:/login");
|
mav = new ModelAndView("redirect:/login");
|
||||||
}else{
|
}else{
|
||||||
session.setAttribute("commonCodeList", codeMgtService.selectCodeCatgAndChild());
|
session.setAttribute("commonCodeList", codeMgtService.selectCommonCodeList());
|
||||||
mav = new ModelAndView("redirect:/dashboard");
|
mav = new ModelAndView("redirect:/dashboard");
|
||||||
}
|
}
|
||||||
return mav;
|
return mav;
|
||||||
|
|
@ -30,7 +30,7 @@ public class BaseController {
|
||||||
|
|
||||||
@GetMapping("/refreshSession")
|
@GetMapping("/refreshSession")
|
||||||
public void getSession(HttpSession session){
|
public void getSession(HttpSession session){
|
||||||
session.setAttribute("commonCodeList", codeMgtService.selectCodeCatgAndChild());
|
session.setAttribute("commonCodeList", codeMgtService.selectCommonCodeList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/login")
|
@GetMapping("/login")
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,5 @@ import java.util.Optional;
|
||||||
public interface CodeMgtRepository extends JpaRepository<CodeMgt, CodeMgt.CodeMgtId> {
|
public interface CodeMgtRepository extends JpaRepository<CodeMgt, CodeMgt.CodeMgtId> {
|
||||||
|
|
||||||
List<CodeMgt> findByCategoryCdOrderByItemCdAsc(String categoryCd);
|
List<CodeMgt> findByCategoryCdOrderByItemCdAsc(String categoryCd);
|
||||||
|
List<CodeMgt> findByUseChkOrderByItemCdAsc(String useChk);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,4 +41,8 @@ public class CodeMgtService{
|
||||||
}
|
}
|
||||||
return codeCatgList;
|
return codeCatgList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<CodeMgt> selectCommonCodeList() {
|
||||||
|
return codeMgtRepository.findByUseChkOrderByItemCdAsc("T");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,13 @@ $(document).on('click', '#itemAddBtn', function (){
|
||||||
$('#itemTable').find('tbody').append(
|
$('#itemTable').find('tbody').append(
|
||||||
'<tr class="itemTr">' +
|
'<tr class="itemTr">' +
|
||||||
'<td><button class="btn btn-sm btn-outline-danger rowDeleteBtn"><i class="bi bi-x"></i></button></td>'+
|
'<td><button class="btn btn-sm btn-outline-danger rowDeleteBtn"><i class="bi bi-x"></i></button></td>'+
|
||||||
'<td><input type="text" class="form-control form-control-sm itemInput" name="itemCd"></td>'+
|
'<td><input type="text" class="form-control form-control-sm itemInput" name="itemCd" value="'+codeCategoryList[selectedCategoryIdx].categoryCd+'"></td>'+
|
||||||
'<td><input type="text" class="form-control form-control-sm itemInput" name="itemValue"></td>'+
|
'<td><input type="text" class="form-control form-control-sm itemInput" name="itemValue"></td>'+
|
||||||
'<td></td>'+
|
'<td></td>'+
|
||||||
'</tr>'
|
'</tr>'
|
||||||
)
|
)
|
||||||
codeCategoryList[selectedCategoryIdx].itemList.push({categoryCd:codeCategoryList[selectedCategoryIdx].categoryCd, itemCd:"", itemValue: "", useChk: "", status:"new"})
|
codeCategoryList[selectedCategoryIdx].itemList
|
||||||
|
.push({categoryCd:codeCategoryList[selectedCategoryIdx].categoryCd, itemCd:codeCategoryList[selectedCategoryIdx].categoryCd, itemValue: "", useChk: "T", status:"new"})
|
||||||
})
|
})
|
||||||
|
|
||||||
$(document).on('click', '.rowDeleteBtn', function (){
|
$(document).on('click', '.rowDeleteBtn', function (){
|
||||||
|
|
@ -149,7 +150,7 @@ function makeItemTr(itemList){
|
||||||
'<td>'+(item.status==="new"?'<button class="btn btn-sm btn-outline-danger rowDeleteBtn"><i class="bi bi-x"></i></button>':'')+'</td>'+
|
'<td>'+(item.status==="new"?'<button class="btn btn-sm btn-outline-danger rowDeleteBtn"><i class="bi bi-x"></i></button>':'')+'</td>'+
|
||||||
'<td><input type="text" class="form-control form-control-sm itemInput" name="itemCd" value="'+item.itemCd+'"></td>'+
|
'<td><input type="text" class="form-control form-control-sm itemInput" name="itemCd" value="'+item.itemCd+'"></td>'+
|
||||||
'<td><input type="text" class="form-control form-control-sm itemInput" name="itemValue" value="'+item.itemValue+'"></td>'+
|
'<td><input type="text" class="form-control form-control-sm itemInput" name="itemValue" value="'+item.itemValue+'"></td>'+
|
||||||
'<td><input type="checkbox" class="itemInput" name="useChk" '+(item.useChk==="T"?'checked':'')+'></td>'+
|
'<td>'+(item.status==="new"?'':'<input type="checkbox" class="itemInput" name="useChk" '+(item.useChk==="T"?'checked':'')+'>')+'</td>'+
|
||||||
'</tr>'
|
'</tr>'
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue