Compare commits
2 Commits
V202512180
...
V202512180
| Author | SHA1 | Date | |
|---|---|---|---|
| d8620a484b | |||
|
|
874910231f |
@@ -1802,6 +1802,13 @@
|
|||||||
WHERE OBJID = #{OBJID}
|
WHERE OBJID = #{OBJID}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!-- 반제품검사 행 잠금 해제 (IS_LOCKED = 'N') -->
|
||||||
|
<update id="unlockSemiProductInspection" parameterType="map">
|
||||||
|
UPDATE PMS_QUALITY_SEMI_PRODUCT_INSPECTION
|
||||||
|
SET IS_LOCKED = 'N'
|
||||||
|
WHERE OBJID = #{OBJID}
|
||||||
|
</update>
|
||||||
|
|
||||||
<!-- 반제품검사 데이터 삭제 (OBJID로 단건 삭제) -->
|
<!-- 반제품검사 데이터 삭제 (OBJID로 단건 삭제) -->
|
||||||
<delete id="deleteSemiProductInspectionByObjId" parameterType="map">
|
<delete id="deleteSemiProductInspectionByObjId" parameterType="map">
|
||||||
DELETE FROM PMS_QUALITY_SEMI_PRODUCT_INSPECTION
|
DELETE FROM PMS_QUALITY_SEMI_PRODUCT_INSPECTION
|
||||||
|
|||||||
@@ -158,6 +158,20 @@ String loginUserId = CommonUtils.checkNull(person.getUserId());
|
|||||||
background: #2b6cb0;
|
background: #2b6cb0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn_edit {
|
||||||
|
padding: 6px 20px;
|
||||||
|
background: #e67e22;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 3px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn_edit:hover {
|
||||||
|
background: #d35400;
|
||||||
|
}
|
||||||
|
|
||||||
.btn_close {
|
.btn_close {
|
||||||
padding: 6px 20px;
|
padding: 6px 20px;
|
||||||
background: #718096;
|
background: #718096;
|
||||||
@@ -232,7 +246,8 @@ String loginUserId = CommonUtils.checkNull(person.getUserId());
|
|||||||
<div class="btn_group">
|
<div class="btn_group">
|
||||||
<button type="button" class="btn_add" id="btnAddLeft">+ 행 추가</button>
|
<button type="button" class="btn_add" id="btnAddLeft">+ 행 추가</button>
|
||||||
<button type="button" class="btn_del" id="btnDelLeft">- 행 삭제</button>
|
<button type="button" class="btn_del" id="btnDelLeft">- 행 삭제</button>
|
||||||
<button type="button" class="btn_save" id="btnSaveLeft" style="margin-left:10px;">저장</button>
|
<button type="button" class="btn_save" id="btnSaveLeft" style="margin-left:10px;">행잠금</button>
|
||||||
|
<button type="button" class="btn_edit" id="btnEditLeft" style="margin-left:5px;">잠금해제</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel_body">
|
<div class="panel_body">
|
||||||
@@ -247,7 +262,9 @@ String loginUserId = CommonUtils.checkNull(person.getUserId());
|
|||||||
<div class="btn_group">
|
<div class="btn_group">
|
||||||
<button type="button" class="btn_add" id="btnAddRight">+ 행 추가</button>
|
<button type="button" class="btn_add" id="btnAddRight">+ 행 추가</button>
|
||||||
<button type="button" class="btn_del" id="btnDelRight">- 행 삭제</button>
|
<button type="button" class="btn_del" id="btnDelRight">- 행 삭제</button>
|
||||||
|
<!-- 불량상세 저장버튼 주석처리
|
||||||
<button type="button" class="btn_save" id="btnSaveRight" style="margin-left:10px;">저장</button>
|
<button type="button" class="btn_save" id="btnSaveRight" style="margin-left:10px;">저장</button>
|
||||||
|
-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel_body" id="rightPanelBody">
|
<div class="panel_body" id="rightPanelBody">
|
||||||
@@ -314,8 +331,9 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
// 버튼 이벤트
|
// 버튼 이벤트
|
||||||
$("#btnSave").click(fn_save); // 하단 저장: 전체 DB 저장
|
$("#btnSave").click(fn_save); // 하단 저장: 전체 DB 저장
|
||||||
$("#btnSaveLeft").click(fn_saveSelectedLeft); // 좌측 저장: UI 잠금만 (DB 저장 X)
|
$("#btnSaveLeft").click(fn_saveSelectedLeft); // 좌측 행저장: 락 처리
|
||||||
$("#btnSaveRight").click(fn_saveSelectedRight); // 우측 저장: UI 잠금만 (DB 저장 X)
|
$("#btnEditLeft").click(fn_editSelectedLeft); // 좌측 행수정: 락 해제
|
||||||
|
// $("#btnSaveRight").click(fn_saveSelectedRight); // 우측 저장: 주석처리
|
||||||
$("#btnClose").click(function(){ window.close(); });
|
$("#btnClose").click(function(){ window.close(); });
|
||||||
$("#btnAddLeft").click(fn_addLeftRow);
|
$("#btnAddLeft").click(fn_addLeftRow);
|
||||||
$("#btnDelLeft").click(fn_delLeftRow);
|
$("#btnDelLeft").click(fn_delLeftRow);
|
||||||
@@ -478,9 +496,13 @@ function fn_initLeftGrid(){
|
|||||||
selectable: 1, // 단일 선택
|
selectable: 1, // 단일 선택
|
||||||
// 저장된 행 시각적 표시
|
// 저장된 행 시각적 표시
|
||||||
rowFormatter: function(row){
|
rowFormatter: function(row){
|
||||||
if(row.getData().IS_SAVED){
|
var data = row.getData();
|
||||||
|
if(data.IS_SAVED || data.IS_LOCKED === 'Y'){
|
||||||
row.getElement().style.backgroundColor = "#e8f5e9"; // 연한 초록색
|
row.getElement().style.backgroundColor = "#e8f5e9"; // 연한 초록색
|
||||||
row.getElement().style.color = "#555";
|
row.getElement().style.color = "#555";
|
||||||
|
} else {
|
||||||
|
row.getElement().style.backgroundColor = ""; // 원래 색상
|
||||||
|
row.getElement().style.color = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -594,9 +616,13 @@ function fn_initRightGrid(){
|
|||||||
selectable: true,
|
selectable: true,
|
||||||
// 저장된 행 시각적 표시
|
// 저장된 행 시각적 표시
|
||||||
rowFormatter: function(row){
|
rowFormatter: function(row){
|
||||||
if(row.getData().IS_SAVED){
|
var data = row.getData();
|
||||||
|
if(data.IS_SAVED || data.IS_LOCKED === 'Y'){
|
||||||
row.getElement().style.backgroundColor = "#e8f5e9"; // 연한 초록색
|
row.getElement().style.backgroundColor = "#e8f5e9"; // 연한 초록색
|
||||||
row.getElement().style.color = "#555";
|
row.getElement().style.color = "#555";
|
||||||
|
} else {
|
||||||
|
row.getElement().style.backgroundColor = ""; // 원래 색상
|
||||||
|
row.getElement().style.color = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -998,6 +1024,68 @@ function fn_loadData(objid, inspectionGroupId){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// 좌측 행수정: 락이 걸린 행을 수정 가능하도록 해제
|
||||||
|
// =====================================================
|
||||||
|
function fn_editSelectedLeft(){
|
||||||
|
console.log("===== fn_editSelectedLeft 호출됨 =====");
|
||||||
|
|
||||||
|
if(!selectedLeftRowId){
|
||||||
|
Swal.fire({ icon: 'warning', title: '알림', text: '수정할 양품 정보를 선택해주세요.' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var selectedRow = leftGrid.getSelectedRows()[0];
|
||||||
|
if(!selectedRow){
|
||||||
|
Swal.fire({ icon: 'warning', title: '알림', text: '수정할 양품 정보를 선택해주세요.' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var rowData = selectedRow.getData();
|
||||||
|
|
||||||
|
// 락이 걸려있지 않으면 이미 수정 가능 상태
|
||||||
|
if(rowData.IS_LOCKED !== 'Y' && !rowData.IS_SAVED){
|
||||||
|
Swal.fire({ icon: 'info', title: '알림', text: '이미 수정 가능한 상태입니다.' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'question',
|
||||||
|
title: '행수정',
|
||||||
|
text: '선택한 행의 잠금을 해제하고 수정 가능하게 하시겠습니까?',
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: '확인',
|
||||||
|
cancelButtonText: '취소'
|
||||||
|
}).then((result) => {
|
||||||
|
if(result.isConfirmed){
|
||||||
|
var objId = rowData.OBJID;
|
||||||
|
|
||||||
|
// DB에 잠금 해제 요청
|
||||||
|
$.ajax({
|
||||||
|
url: "/quality/unlockSemiProductInspection.do",
|
||||||
|
type: "POST",
|
||||||
|
data: { objIds: JSON.stringify([objId]) },
|
||||||
|
dataType: "json",
|
||||||
|
success: function(result){
|
||||||
|
if(result.result){
|
||||||
|
// UI에서 잠금 해제
|
||||||
|
selectedRow.update({ IS_SAVED: false, IS_LOCKED: 'N' });
|
||||||
|
// 행 스타일 원래대로 (초록색 -> 기본색)
|
||||||
|
selectedRow.getElement().style.backgroundColor = "";
|
||||||
|
selectedRow.getElement().style.color = "";
|
||||||
|
Swal.fire({ icon: 'success', title: '완료', text: '잠금이 해제되어 수정 가능합니다.' });
|
||||||
|
} else {
|
||||||
|
Swal.fire({ icon: 'error', title: '오류', text: result.msg || '잠금 해제에 실패했습니다.' });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error){
|
||||||
|
Swal.fire({ icon: 'error', title: '오류', text: '잠금 해제 중 오류가 발생했습니다.' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// =====================================================
|
// =====================================================
|
||||||
// 좌측 행 저장+잠금: 선택된 양품 행을 DB에 저장하고 수정 불가로 변경
|
// 좌측 행 저장+잠금: 선택된 양품 행을 DB에 저장하고 수정 불가로 변경
|
||||||
// =====================================================
|
// =====================================================
|
||||||
|
|||||||
@@ -696,6 +696,15 @@ public class QualityController {
|
|||||||
return service.lockSemiProductInspection(paramMap);
|
return service.lockSemiProductInspection(paramMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 반제품검사 잠금 해제
|
||||||
|
*/
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/quality/unlockSemiProductInspection.do")
|
||||||
|
public Map unlockSemiProductInspection(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||||
|
return service.unlockSemiProductInspection(paramMap);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 반제품검사 엑셀 다운로드 (JSP 방식)
|
* 반제품검사 엑셀 다운로드 (JSP 방식)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1802,6 +1802,13 @@
|
|||||||
WHERE OBJID = #{OBJID}
|
WHERE OBJID = #{OBJID}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!-- 반제품검사 행 잠금 해제 (IS_LOCKED = 'N') -->
|
||||||
|
<update id="unlockSemiProductInspection" parameterType="map">
|
||||||
|
UPDATE PMS_QUALITY_SEMI_PRODUCT_INSPECTION
|
||||||
|
SET IS_LOCKED = 'N'
|
||||||
|
WHERE OBJID = #{OBJID}
|
||||||
|
</update>
|
||||||
|
|
||||||
<!-- 반제품검사 데이터 삭제 (OBJID로 단건 삭제) -->
|
<!-- 반제품검사 데이터 삭제 (OBJID로 단건 삭제) -->
|
||||||
<delete id="deleteSemiProductInspectionByObjId" parameterType="map">
|
<delete id="deleteSemiProductInspectionByObjId" parameterType="map">
|
||||||
DELETE FROM PMS_QUALITY_SEMI_PRODUCT_INSPECTION
|
DELETE FROM PMS_QUALITY_SEMI_PRODUCT_INSPECTION
|
||||||
|
|||||||
@@ -1086,6 +1086,46 @@ public class QualityService extends BaseService{
|
|||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 반제품검사 행 잠금 해제 (IS_LOCKED = 'N')
|
||||||
|
*/
|
||||||
|
public Map unlockSemiProductInspection(Map paramMap){
|
||||||
|
Map resultMap = new HashMap();
|
||||||
|
SqlSession sqlSession = null;
|
||||||
|
try{
|
||||||
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||||||
|
|
||||||
|
String objIdsJson = CommonUtils.checkNull(paramMap.get("objIds"));
|
||||||
|
|
||||||
|
if(!objIdsJson.equals("") && !objIdsJson.equals("[]")){
|
||||||
|
org.json.simple.parser.JSONParser parser = new org.json.simple.parser.JSONParser();
|
||||||
|
org.json.simple.JSONArray objIdArr = (org.json.simple.JSONArray) parser.parse(objIdsJson);
|
||||||
|
|
||||||
|
for(int i = 0; i < objIdArr.size(); i++){
|
||||||
|
String objId = CommonUtils.checkNull(objIdArr.get(i));
|
||||||
|
if(!objId.equals("")){
|
||||||
|
Map unlockParam = new HashMap();
|
||||||
|
unlockParam.put("OBJID", objId);
|
||||||
|
sqlSession.update("quality.unlockSemiProductInspection", unlockParam);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sqlSession.commit();
|
||||||
|
resultMap.put("result", true);
|
||||||
|
resultMap.put("msg", "잠금 해제되었습니다.");
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
resultMap.put("result", false);
|
||||||
|
resultMap.put("msg", "잠금 해제에 실패했습니다.");
|
||||||
|
if(sqlSession != null) sqlSession.rollback();
|
||||||
|
e.printStackTrace();
|
||||||
|
}finally{
|
||||||
|
if(sqlSession != null) sqlSession.close();
|
||||||
|
}
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 반제품검사 삭제 (OBJID 목록으로 삭제)
|
* 반제품검사 삭제 (OBJID 목록으로 삭제)
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user