fix:외사장비현황 수정

TaehunPark 2022-10-05 16:09:43 +09:00
parent a5f2b90a29
commit a999cfec84
7 changed files with 48 additions and 45 deletions

View File

@ -48,8 +48,13 @@ public class EquipController {
}
@GetMapping("/equipEditModal")
public ModelAndView equipEditModal() {
public ModelAndView equipEditModal(@AuthenticationPrincipal UserInfo loginUser) {
ModelAndView mav = new ModelAndView("equip/equipEditModal");
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/equipStatus").get(0).getAccessAuth();
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
mav.addObject("userOrgan", loginUser.getOgCd());
mav.addObject("accessAuth", accessAuth);
return mav;
}
@ -65,7 +70,6 @@ public class EquipController {
@PostMapping("/saveEquip")
public void saveEquip(@AuthenticationPrincipal UserInfo loginUser,Equip equip, MultipartHttpServletRequest request){
equip.setWrtNm(loginUser.getUserId());
equip.setMgtOrgan(loginUser.getOgCd());
equip.setWrtOrgan(loginUser.getOgCd());
equip.setWrtDt(LocalDateTime.now());
equipService.saveEquip(equip,request);

View File

@ -145,7 +145,7 @@ public class EquipService {
Equip equipTmp = new Equip();
equipTmp.setEquKey(dbEquip.getEquKey());
equipTmp.setVersionNo(dbEquip.getVersionNo()+1);
equipTmp.setMgtOrgan(dbEquip.getMgtOrgan());
equipTmp.setMgtOrgan(equip.getMgtOrgan());
equipTmp.setEquType(equip.getEquType());
equipTmp.setDetailType(equip.getDetailType());
equipTmp.setStoredYear(equip.getStoredYear());

View File

@ -347,21 +347,14 @@
select (select item_value from code_mgt cm where cm.item_cd = el.equ_type) as equ_type,
(select item_value from code_mgt cm where cm.item_cd = el.detail_type) as detail_name,
detail_type,
case
when oc.organ_type = 'OGC001' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd )
when oc.organ_type = 'OGC002' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd )
else (select item_value from code_mgt cm where cm.item_cd = oc.parent_organ )
end as sosok,
case
when oc.organ_type = 'OGC003' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd )
else null
end as detail_sosok,
(select item_value from code_mgt where item_cd = wrt_organ) as sosok,
(select item_value from code_mgt where item_cd = ofc_cd ) as detail_sosok,
el_contents,
wrt_nm,
wrt_dt
el.wrt_dt
from equ_log el,
organ_config oc
where el.wrt_organ = oc.organ_cd
user_info ui
where el.wrt_nm = ui.user_id
and wrt_organ in
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
#{item}
@ -376,21 +369,14 @@
select (select item_value from code_mgt cm where cm.item_cd = el.equ_type) as equ_type,
(select item_value from code_mgt cm where cm.item_cd = el.detail_type) as detail_name,
detail_type,
case
when oc.organ_type = 'OGC001' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd )
when oc.organ_type = 'OGC002' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd )
else (select item_value from code_mgt cm where cm.item_cd = oc.parent_organ )
end as sosok,
case
when oc.organ_type = 'OGC003' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd )
else null
end as detail_sosok,
(select item_value from code_mgt where item_cd = wrt_organ) as sosok,
(select item_value from code_mgt where item_cd = ofc_cd ) as detail_sosok,
el_contents,
wrt_nm,
wrt_dt
el.wrt_dt
from equ_log el,
organ_config oc
where el.wrt_organ = oc.organ_cd
user_info ui
where el.wrt_nm = ui.user_id
and wrt_organ in
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
#{item}

View File

@ -54,6 +54,11 @@ $(document).on('change', '#equType', function (){
});
$(document).on('click', '#saveEquip', function (){
if($('#mgtOrgan').val() == ''){
alert("관리처를 선택해주세요.");
$('#mgtOrgan').focus();
return false;
}
if($('#equType').val() == ''){
alert("분류를 선택해주세요.");
$('#equType').focus();
@ -70,6 +75,7 @@ $(document).on('click', '#saveEquip', function (){
return false;
}
if(confirm("저장하시겠습니까?")){
document.getElementById("mgtOrgan").disabled = false;
let ajaxUrl = "/equip/saveEquip";
const formData = new FormData($("#equipEditForm")[0]);
contentFade("in");
@ -142,12 +148,18 @@ function deleteImg(equKey,versionNo){
}
$(document).on('click', '#updateEquip', function (){
if($('#mMgtOrgan').val() == ''){
alert("관리처를 선택해주세요.");
$('#mMgtOrgan').focus();
return false;
}
if($('#mItemQty').val() == ''){
alert("수량을 입력해주세요.");
$('#mItemQty').focus();
return false;
}
if(confirm("수정하시겠습니까?")){
document.getElementById("mMgtOrgan").disabled = false;
let ajaxUrl = "/equip/updateEquip";
const formData = new FormData($("#equipModifyForm")[0]);
contentFade("in");

View File

@ -12,7 +12,14 @@
<div class="row mb-3">
<label for="cat1Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">관리처</label>
<div class="col-sm-6">
<input type="text" class="form-control" value="사용자 소속처 자동입력" readonly>
<select class="form-select form-select-sm" id="mgtOrgan" name="mgtOrgan" th:disabled="${accessAuth ne 'ACC003'}">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<th:block th:if="${#lists.contains(mgtOrganList, commonCode.itemCd)}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq userOrgan}"></option>
</th:block>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">

View File

@ -34,17 +34,6 @@
</div>
<div class="col-auto">
<div class="row justify-content-end">
<div class="col-auto">
<select class="form-select form-select-sm" name="ofcCd">
<option value="">부서 선택</option>
<th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</select>
</div>
<div class="col-auto">
<input type="text" class="form-control form-control-sm" name="userId">
</div>
<input type="submit" class="btn btn-sm btn-primary col-auto" id="searchBtn" value="검색">
</div>
</div>
@ -58,21 +47,21 @@
<table class="table table-striped">
<thead>
<tr>
<th>소속</th>
<th>세부소속</th>
<th>분류</th>
<th>세부분류</th>
<th>관서</th>
<th>부서</th>
<th>수정자</th>
<th>수정내용</th>
<th>수정일시</th>
</tr>
</thead>
<tbody>
<tr th:each="log:${logList}">
<td th:text="${log.sosok}"></td>
<td th:text="${log.detailSosok}"></td>
<tr th:each="log:${logList}">
<td th:text="${log.equType}"></td>
<td th:text="${log.detailName}" style="color: blue; cursor:pointer;" th:onclick="|location.href='@{/equip/List(detailType=${log.detailType})}'|"></td>
<td th:text="${log.sosok}"></td>
<td th:text="${log.detailSosok}"></td>
<td th:text="${log.wrtNm}"></td>
<td th:text="${log.elContents}"></td>
<td th:text="${#temporals.format(log.wrtDt, 'yyyy-MM-dd')}"></td>

View File

@ -14,7 +14,12 @@
<div class="row mb-3">
<label for="cat1Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">관리처</label>
<div class="col-sm-6">
<input type="text" class="form-control" value="사용자 소속처 자동입력" readonly>
<select class="form-select form-select-sm" id="mMgtOrgan" name="mgtOrgan" th:disabled="${accessAuth ne 'ACC003'}">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd} == ${equInfo.mgtOrgan}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">