Compare commits
4 Commits
1265bcde17
...
cdb6c0a3fc
| Author | SHA1 | Date | |
|---|---|---|---|
| cdb6c0a3fc | |||
| 0a29c2dd80 | |||
| f8733a55f1 | |||
| abbb8263ef |
@@ -59,6 +59,11 @@ $(document).ready(function(){
|
||||
fn_registActionPopUp();
|
||||
});
|
||||
|
||||
// 삭제
|
||||
$("#btnDelete").click(function(){
|
||||
fn_delete();
|
||||
});
|
||||
|
||||
fn_search();
|
||||
});
|
||||
|
||||
@@ -239,6 +244,67 @@ function fn_FileRegist(objId, docType, docTypeName){
|
||||
|
||||
fn_centerPopup(popup_width, popup_height, url);
|
||||
}
|
||||
|
||||
// 삭제
|
||||
function fn_delete(){
|
||||
var selected = _tabulGrid.getSelectedData();
|
||||
if(selected.length == 0){
|
||||
Swal.fire("삭제할 데이터를 선택해주세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
// 선택된 OBJID 목록 추출
|
||||
var objIds = [];
|
||||
for(var i = 0; i < selected.length; i++){
|
||||
objIds.push(selected[i].OBJID);
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: '삭제 확인',
|
||||
text: selected.length + '건의 데이터를 삭제하시겠습니까?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#d33',
|
||||
cancelButtonColor: '#3085d6',
|
||||
confirmButtonText: '삭제',
|
||||
cancelButtonText: '취소'
|
||||
}).then((result) => {
|
||||
if(result.isConfirmed){
|
||||
$.ajax({
|
||||
url: "/quality/deleteCustomerCs.do",
|
||||
type: "POST",
|
||||
data: {
|
||||
objIds: JSON.stringify(objIds)
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(response){
|
||||
if(response.result){
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: '삭제 완료',
|
||||
text: response.msg
|
||||
}).then(function(){
|
||||
fn_search();
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: '삭제 실패',
|
||||
text: response.msg
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: '오류',
|
||||
text: '삭제 중 오류가 발생했습니다.'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
@@ -257,6 +323,7 @@ function fn_FileRegist(objId, docType, docTypeName){
|
||||
<div class="btnArea">
|
||||
<input type="button" class="plm_btns" value="고객 이슈 등록" id="btnRegistDefect">
|
||||
<input type="button" class="plm_btns" value="조치결과 등록" id="btnRegistAction">
|
||||
<input type="button" class="plm_btns btn_red" value="삭제" id="btnDelete">
|
||||
<input type="button" class="plm_btns" value="조회" id="btnSearch">
|
||||
</div>
|
||||
</div>
|
||||
@@ -284,25 +351,22 @@ function fn_FileRegist(objId, docType, docTypeName){
|
||||
</select>
|
||||
</td> -->
|
||||
<td><label>품번</label></td>
|
||||
<td><input type="text" name="search_product_no" id="search_product_no" style="width:150px;" autocomplete="off"></td>
|
||||
<td><input type="text" name="search_product_no" id="search_product_no" style="width:210px;" autocomplete="off"></td>
|
||||
<td><label>품명</label></td>
|
||||
<td><input type="text" name="search_product_name" id="search_product_name" style="width:150px;" autocomplete="off"></td>
|
||||
<td><label>부품품번</label></td>
|
||||
<!-- <td><label>부품품번</label></td>
|
||||
<td><input type="text" name="search_part_no" id="search_part_no" style="width:215px;" autocomplete="off"></td>
|
||||
<td><label>부품품명</label></td>
|
||||
<td><input type="text" name="search_part_name" id="search_part_name" style="" autocomplete="off"></td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="search_part_name" id="search_part_name" style="" autocomplete="off"></td> -->
|
||||
<td><label>S/N</label></td>
|
||||
<td><input type="text" name="search_serial_no" id="search_serial_no" style="width:215px;" autocomplete="off"></td>
|
||||
<td><label>제조사</label></td>
|
||||
<td><input type="text" name="search_manufacturer" id="search_manufacturer" style="width:230px;" autocomplete="off"></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>귀책판정</label></td>
|
||||
<td>
|
||||
<select name="search_blame_decision" id="search_blame_decision" class="select2" autocomplete="off" style="">
|
||||
<select name="search_blame_decision" id="search_blame_decision" class="select2" autocomplete="off" style="width:212px;">
|
||||
<option value="">전체</option>
|
||||
<option value="R">RPS</option>
|
||||
<option value="C">고객사</option>
|
||||
@@ -312,7 +376,7 @@ function fn_FileRegist(objId, docType, docTypeName){
|
||||
</td>
|
||||
<td><label>상태</label></td>
|
||||
<td>
|
||||
<select name="search_status" id="search_status" class="select2" autocomplete="off" style="">
|
||||
<select name="search_status" id="search_status" class="select2" autocomplete="off" style="width:230px;">
|
||||
<option value="">전체</option>
|
||||
<option value="Open">Open</option>
|
||||
<option value="Closed">Closed</option>
|
||||
|
||||
@@ -141,17 +141,6 @@ function fn_search(){
|
||||
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/quality/processInspectionGridList.do", columns, true);
|
||||
}
|
||||
|
||||
// 검색조건 초기화
|
||||
function fn_reset(){
|
||||
$("#search_inspection_date_from").val("");
|
||||
$("#search_inspection_date_to").val("");
|
||||
$("#search_inspector").val("");
|
||||
$("#search_project_no").val("");
|
||||
$("#search_part_no").val("");
|
||||
$("#search_part_name").val("");
|
||||
$("#search_inspection_result").val("");
|
||||
}
|
||||
|
||||
// 공정검사 등록 팝업
|
||||
function fn_registPopUp(){
|
||||
var popup_width = 1500;
|
||||
@@ -184,7 +173,8 @@ function fn_excelDownload(){
|
||||
search_inspection_date_from: $("#search_inspection_date_from").val() || "",
|
||||
search_inspection_date_to: $("#search_inspection_date_to").val() || "",
|
||||
search_inspector: $("#search_inspector").val() || "",
|
||||
search_inspection_result: $("#search_inspection_result").val() || ""
|
||||
search_inspection_result: $("#search_inspection_result").val() || "",
|
||||
search_process_cd: $("#search_process_cd").val() || ""
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
@@ -351,7 +341,7 @@ async function fn_createExcelFile(data){
|
||||
|
||||
<td><label for="">작업환경상태</label></td>
|
||||
<td>
|
||||
<select name="search_work_env_status" id="search_work_env_status" style="">
|
||||
<select name="search_work_env_status" class="select2" id="search_work_env_status" style="">
|
||||
<option value="">전체</option>
|
||||
<option value="OK">양호</option>
|
||||
<option value="NG">불량</option>
|
||||
@@ -360,7 +350,7 @@ async function fn_createExcelFile(data){
|
||||
|
||||
<td><label for="">측정기</label></td>
|
||||
<td>
|
||||
<select name="search_measuring_device" id="search_measuring_device" style="">
|
||||
<select name="search_measuring_device" id="search_measuring_device" class="select2" style="">
|
||||
<option value="">전체</option>
|
||||
<option value="OK">양호</option>
|
||||
<option value="NG">불량</option>
|
||||
@@ -384,12 +374,20 @@ async function fn_createExcelFile(data){
|
||||
|
||||
<td><label for="">검사결과</label></td>
|
||||
<td>
|
||||
<select name="search_inspection_result" id="search_inspection_result" style="width:210px;">
|
||||
<select name="search_inspection_result" id="search_inspection_result" class="select2" style="width:210px;">
|
||||
<option value="">전체</option>
|
||||
<option value="OK">OK</option>
|
||||
<option value="NG">NG</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="">진행공정</label></td>
|
||||
<td>
|
||||
<select name="search_process_cd" id="search_process_cd" style="width:150px;" class="select2" autocomplete="off">
|
||||
<option value="">전체</option>
|
||||
${code_map.process_cd}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -58,6 +58,15 @@ $(document).ready(function(){
|
||||
$('.select2').select2();
|
||||
fnc_datepick();
|
||||
|
||||
// DOM 렌더링 완료 후 그리드 높이 계산
|
||||
setTimeout(function() {
|
||||
fnc_calculateContentHeight("gridDiv", 10);
|
||||
}, 100);
|
||||
|
||||
$(window).resize(function() {
|
||||
fnc_calculateContentHeight("gridDiv", 10);
|
||||
});
|
||||
|
||||
$("input").keyup(function(e){
|
||||
if(e.keyCode == 13){
|
||||
$("#page").val("1");
|
||||
@@ -92,7 +101,9 @@ function fn_excelDownload(){
|
||||
search_part_no: $("#search_part_no").val() || "",
|
||||
search_part_name: $("#search_part_name").val() || "",
|
||||
search_inspection_date: $("#search_inspection_date").val() || "",
|
||||
search_writer: $("#search_writer").val() || ""
|
||||
search_writer: $("#search_writer").val() || "",
|
||||
search_defect_type: $("#search_defect_type").val() || "",
|
||||
search_responsible_dept: $("#search_responsible_dept").val() || ""
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
@@ -243,9 +254,70 @@ var columns = [
|
||||
}
|
||||
];
|
||||
|
||||
// 조회
|
||||
// 조회 (Total 합계 표시 포함)
|
||||
function fn_search(){
|
||||
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/quality/semiProductInspectionGridList.do", columns, true);
|
||||
var formData = $("#form1").serializeObject();
|
||||
|
||||
$.ajax({
|
||||
url: "/quality/semiProductInspectionGridList.do",
|
||||
type: "POST",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
beforeSend: function(){
|
||||
_startLoading("Loading...");
|
||||
},
|
||||
complete: function(){
|
||||
_endLoading();
|
||||
},
|
||||
success: function(response) {
|
||||
// 그리드 데이터 설정
|
||||
if(_tabulGrid){
|
||||
_tabulGrid.setData(response.RESULTLIST || []);
|
||||
} else {
|
||||
_tabulGrid = new Tabulator("#mainGrid", {
|
||||
height: "100%",
|
||||
layout: _tabul_layout_fitColumns,
|
||||
columns: columns,
|
||||
data: response.RESULTLIST || [],
|
||||
selectable: true
|
||||
});
|
||||
}
|
||||
|
||||
// Total 합계 계산
|
||||
var totalReceiptQty = 0; // 총 입고수량
|
||||
var totalGoodQty = 0; // 총 양품수량
|
||||
var totalDefectiveQty = 0; // 총 불량수량
|
||||
var totalRegenerationQty = 0; // 총 재생수량
|
||||
var totalFinalGoodQty = 0; // 총 최종양품수량
|
||||
|
||||
if(response.RESULTLIST && response.RESULTLIST.length > 0) {
|
||||
response.RESULTLIST.forEach(function(row) {
|
||||
totalReceiptQty += parseFloat(row.RECEIPT_QTY || 0);
|
||||
totalGoodQty += parseFloat(row.GOOD_QTY || 0);
|
||||
totalDefectiveQty += parseFloat(row.DEFECTIVE_QTY || 0);
|
||||
totalRegenerationQty += parseFloat(row.REGENERATION_QTY || 0);
|
||||
totalFinalGoodQty += parseFloat(row.FINAL_GOOD_QTY || 0);
|
||||
});
|
||||
}
|
||||
|
||||
// 합계 표시
|
||||
$("#totalReceiptQty").text(Number(totalReceiptQty).toLocaleString());
|
||||
$("#totalGoodQty").text(Number(totalGoodQty).toLocaleString());
|
||||
$("#totalDefectiveQty").text(Number(totalDefectiveQty).toLocaleString());
|
||||
$("#totalRegenerationQty").text(Number(totalRegenerationQty).toLocaleString());
|
||||
$("#totalFinalGoodQty").text(Number(totalFinalGoodQty).toLocaleString());
|
||||
|
||||
// 페이징 HTML 업데이트
|
||||
if(response.PAGE_HTML){
|
||||
$(".table_paging_wrap").html(response.PAGE_HTML);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
_endLoading();
|
||||
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||
console.error("Error:", error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 검사일 클릭 시 검사결과 확인/수정 팝업
|
||||
@@ -370,9 +442,37 @@ function fn_registPopUp(){
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="">불량유형</label></td>
|
||||
<td>
|
||||
<select name="search_defect_type" id="search_defect_type" class="select2" style="width:150px;" autocomplete="off">
|
||||
<option value="">전체</option>
|
||||
${code_map.defect_type}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="">귀책부서</label></td>
|
||||
<td>
|
||||
<select name="search_responsible_dept" id="search_responsible_dept" class="select2" style="width:150px;" autocomplete="off">
|
||||
<option value="">전체</option>
|
||||
${code_map.responsible_dept}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Total 합계 표시 영역 -->
|
||||
<div style="padding:5px 10px; background: #f5f5f5; border: 1px solid #ddd; margin-bottom: 5px;">
|
||||
<span style="font-weight: bold; font-size: 13px;">
|
||||
Total 총 입고수량: <span id="totalReceiptQty" style="color: #2196F3;">0</span>EA
|
||||
Total 총 양품수량: <span id="totalGoodQty" style="color: #4CAF50;">0</span>EA
|
||||
Total 총 불량수량: <span id="totalDefectiveQty" style="color: #dc3545;">0</span>EA
|
||||
Total 총 재생수량: <span id="totalRegenerationQty" style="color: #FF9800;">0</span>EA
|
||||
Total 총 최종양품수량: <span id="totalFinalGoodQty" style="color: #9C27B0;">0</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -524,8 +524,10 @@ public class QualityController {
|
||||
code_map.put("project_no", commonService.bizMakeOptionList("", (String)paramMap.get("search_project_no"), "common.getProjectNameList"));
|
||||
// 검사자 목록
|
||||
code_map.put("inspector_id", commonService.bizMakeOptionList("", (String)paramMap.get("search_inspector"), "common.getUserselect"));
|
||||
//제품구분
|
||||
// 제품구분
|
||||
code_map.put("product_cd", commonService.bizMakeOptionList("0000001", (String)paramMap.get("productType"),"common.getCodeselect"));
|
||||
// 진행공정 목록
|
||||
code_map.put("process_cd", commonService.bizMakeOptionList("0001870", (String)paramMap.get("search_process_cd"),"common.getCodeselect"));
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -642,6 +644,10 @@ public class QualityController {
|
||||
code_map.put("inspection_date", commonService.bizMakeOptionList("", (String)paramMap.get("search_inspection_date"), "quality.getSemiProductInspectionDateList"));
|
||||
// 검사자 드롭박스
|
||||
code_map.put("writer", commonService.bizMakeOptionList("", (String)paramMap.get("search_writer"), "quality.getSemiProductWriterList"));
|
||||
// 불량유형 드롭박스
|
||||
code_map.put("defect_type", commonService.bizMakeOptionList("", (String)paramMap.get("search_defect_type"), "quality.getSemiProductDefectTypeList"));
|
||||
// 귀책부서 드롭박스
|
||||
code_map.put("responsible_dept", commonService.bizMakeOptionList("", (String)paramMap.get("search_responsible_dept"), "quality.getSemiProductResponsibleDeptList"));
|
||||
request.setAttribute("code_map", code_map);
|
||||
|
||||
// 엑셀 다운로드
|
||||
@@ -840,6 +846,15 @@ public class QualityController {
|
||||
return service.saveCustomerCsAction(request, paramMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 고객 CS 삭제
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("/quality/deleteCustomerCs.do")
|
||||
public Map deleteCustomerCs(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||
return service.deleteCustomerCs(paramMap);
|
||||
}
|
||||
|
||||
// =====================================================
|
||||
// ECR 관리
|
||||
// =====================================================
|
||||
|
||||
@@ -1208,6 +1208,12 @@
|
||||
AND (SELECT CASE WHEN COUNT(CASE WHEN PID.INSPECTION_RESULT = 'NG' THEN 1 END) > 0 THEN 'NG' ELSE 'OK' END
|
||||
FROM PROCESS_INSPECTION_DETAIL PID WHERE PID.MASTER_OBJID = PIM.OBJID) = #{search_inspection_result}
|
||||
</if>
|
||||
/* 진행공정 */
|
||||
<if test="search_process_cd != null and search_process_cd != ''">
|
||||
AND EXISTS (SELECT 1 FROM PROCESS_INSPECTION_DETAIL PID
|
||||
WHERE PID.MASTER_OBJID = PIM.OBJID
|
||||
AND PID.PROCESS_CD = #{search_process_cd})
|
||||
</if>
|
||||
ORDER BY PIM.REG_DATE DESC
|
||||
</select>
|
||||
|
||||
@@ -1411,6 +1417,10 @@
|
||||
<if test="search_inspection_result != null and search_inspection_result != ''">
|
||||
AND PID.INSPECTION_RESULT = #{search_inspection_result}
|
||||
</if>
|
||||
/* 진행공정 */
|
||||
<if test="search_process_cd != null and search_process_cd != ''">
|
||||
AND PID.PROCESS_CD = #{search_process_cd}
|
||||
</if>
|
||||
ORDER BY PIM.INSPECTION_DATE DESC, PIM.REG_DATE DESC, PID.REG_DATE
|
||||
</select>
|
||||
|
||||
@@ -1486,17 +1496,17 @@
|
||||
AND (T2.INSPECTOR IS NOT NULL OR T2.WRITER IS NOT NULL)) sub
|
||||
WHERE val IS NOT NULL AND val != ''
|
||||
) AS WRITER_NAME
|
||||
<!-- 수량 집계 -->
|
||||
, SUM(T.RECEIPT_QTY) AS RECEIPT_QTY
|
||||
, SUM(T.GOOD_QTY) AS GOOD_QTY
|
||||
, SUM(T.DEFECT_QTY) AS DEFECTIVE_QTY
|
||||
<!-- 수량 집계 (입고수량은 양품 데이터에서만 합산) -->
|
||||
, SUM(CASE WHEN T.DATA_TYPE = 'GOOD' THEN T.RECEIPT_QTY ELSE 0 END) AS RECEIPT_QTY
|
||||
, SUM(CASE WHEN T.DATA_TYPE = 'GOOD' THEN T.GOOD_QTY ELSE 0 END) AS GOOD_QTY
|
||||
, SUM(CASE WHEN T.DATA_TYPE = 'DEFECT' THEN T.DEFECT_QTY ELSE 0 END) AS DEFECTIVE_QTY
|
||||
, CASE
|
||||
WHEN SUM(T.RECEIPT_QTY) > 0
|
||||
THEN ROUND(SUM(T.DEFECT_QTY) * 100.0 / SUM(T.RECEIPT_QTY), 2)
|
||||
WHEN SUM(CASE WHEN T.DATA_TYPE = 'GOOD' THEN T.RECEIPT_QTY ELSE 0 END) > 0
|
||||
THEN ROUND(SUM(CASE WHEN T.DATA_TYPE = 'DEFECT' THEN T.DEFECT_QTY ELSE 0 END) * 100.0 / SUM(CASE WHEN T.DATA_TYPE = 'GOOD' THEN T.RECEIPT_QTY ELSE 0 END), 2)
|
||||
ELSE 0
|
||||
END AS DEFECT_RATE
|
||||
, SUM(CASE WHEN T.DISPOSITION_TYPE = '수정' THEN T.DEFECT_QTY ELSE 0 END) AS REGENERATION_QTY
|
||||
, SUM(T.GOOD_QTY) + SUM(CASE WHEN T.DISPOSITION_TYPE = '수정' THEN T.DEFECT_QTY ELSE 0 END) AS FINAL_GOOD_QTY
|
||||
, SUM(CASE WHEN T.DATA_TYPE = 'DEFECT' AND T.DISPOSITION_TYPE = '수정' THEN T.DEFECT_QTY ELSE 0 END) AS REGENERATION_QTY
|
||||
, SUM(CASE WHEN T.DATA_TYPE = 'GOOD' THEN T.GOOD_QTY ELSE 0 END) + SUM(CASE WHEN T.DATA_TYPE = 'DEFECT' AND T.DISPOSITION_TYPE = '수정' THEN T.DEFECT_QTY ELSE 0 END) AS FINAL_GOOD_QTY
|
||||
FROM (
|
||||
SELECT SPI.OBJID
|
||||
, COALESCE(SPI.MODEL_NAME, '') AS MODEL_NAME
|
||||
@@ -1537,6 +1547,14 @@
|
||||
<if test="search_writer != null and search_writer != ''">
|
||||
AND SPI.WRITER = #{search_writer}
|
||||
</if>
|
||||
<!-- 불량유형 검색 -->
|
||||
<if test="search_defect_type != null and search_defect_type != ''">
|
||||
AND UPPER(SPI.DEFECT_TYPE) LIKE UPPER('%' || #{search_defect_type} || '%')
|
||||
</if>
|
||||
<!-- 귀책부서 검색 -->
|
||||
<if test="search_responsible_dept != null and search_responsible_dept != ''">
|
||||
AND UPPER(SPI.RESPONSIBLE_DEPT) LIKE UPPER('%' || #{search_responsible_dept} || '%')
|
||||
</if>
|
||||
) T
|
||||
GROUP BY T.INSPECTION_GROUP_ID
|
||||
ORDER BY MIN(T.INSPECTION_DATE) DESC, T.INSPECTION_GROUP_ID
|
||||
@@ -1645,6 +1663,24 @@
|
||||
ORDER BY NAME
|
||||
</select>
|
||||
|
||||
<!-- 반제품검사 불량유형 드롭박스 목록 (CODE, NAME 형태) -->
|
||||
<select id="getSemiProductDefectTypeList" parameterType="map" resultType="map">
|
||||
SELECT DISTINCT SPI.DEFECT_TYPE AS CODE
|
||||
, SPI.DEFECT_TYPE AS NAME
|
||||
FROM PMS_QUALITY_SEMI_PRODUCT_INSPECTION SPI
|
||||
WHERE SPI.DEFECT_TYPE IS NOT NULL AND SPI.DEFECT_TYPE != ''
|
||||
ORDER BY NAME
|
||||
</select>
|
||||
|
||||
<!-- 반제품검사 귀책부서 드롭박스 목록 (CODE, NAME 형태) -->
|
||||
<select id="getSemiProductResponsibleDeptList" parameterType="map" resultType="map">
|
||||
SELECT DISTINCT SPI.RESPONSIBLE_DEPT AS CODE
|
||||
, SPI.RESPONSIBLE_DEPT AS NAME
|
||||
FROM PMS_QUALITY_SEMI_PRODUCT_INSPECTION SPI
|
||||
WHERE SPI.RESPONSIBLE_DEPT IS NOT NULL AND SPI.RESPONSIBLE_DEPT != ''
|
||||
ORDER BY NAME
|
||||
</select>
|
||||
|
||||
<!-- 반제품검사 상세 조회 -->
|
||||
<select id="getSemiProductInspectionInfo" parameterType="map" resultType="map">
|
||||
SELECT SPI.OBJID
|
||||
@@ -2092,6 +2128,18 @@
|
||||
WHERE OBJID = #{OBJID}
|
||||
</update>
|
||||
|
||||
<!-- 고객 CS 삭제 -->
|
||||
<delete id="deleteCustomerCs" parameterType="map">
|
||||
DELETE FROM CUSTOMER_CS WHERE OBJID = #{OBJID}
|
||||
</delete>
|
||||
|
||||
<!-- 고객 CS 첨부파일 삭제 (이미지, 조치첨부) -->
|
||||
<delete id="deleteCustomerCsAttachFiles" parameterType="map">
|
||||
DELETE FROM ATTACH_FILE_INFO
|
||||
WHERE TARGET_OBJID = #{OBJID}
|
||||
AND DOC_TYPE IN ('CUSTOMER_CS_IMAGE', 'CUSTOMER_CS_ACTION')
|
||||
</delete>
|
||||
|
||||
<!-- =====================================================
|
||||
ECR 관리
|
||||
===================================================== -->
|
||||
|
||||
@@ -1605,6 +1605,58 @@ public class QualityService extends BaseService{
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 고객 CS 삭제
|
||||
*/
|
||||
public Map deleteCustomerCs(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);
|
||||
|
||||
int deletedCount = 0;
|
||||
for(int i = 0; i < objIdArr.size(); i++){
|
||||
String objId = CommonUtils.checkNull(objIdArr.get(i));
|
||||
if(!objId.equals("")){
|
||||
Map deleteParam = new HashMap();
|
||||
deleteParam.put("OBJID", objId);
|
||||
|
||||
// 첨부파일 삭제 (이미지, 조치첨부)
|
||||
sqlSession.delete("quality.deleteCustomerCsAttachFiles", deleteParam);
|
||||
|
||||
// 고객 CS 데이터 삭제
|
||||
int cnt = sqlSession.delete("quality.deleteCustomerCs", deleteParam);
|
||||
if(cnt > 0) deletedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
sqlSession.commit();
|
||||
resultMap.put("result", true);
|
||||
resultMap.put("msg", deletedCount + "건이 삭제되었습니다.");
|
||||
} else {
|
||||
resultMap.put("result", false);
|
||||
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;
|
||||
}
|
||||
|
||||
// =====================================================
|
||||
// ECR 관리
|
||||
// =====================================================
|
||||
|
||||
Reference in New Issue
Block a user