cs관리 삭제 기능 추가 및 필요없는 검색필터 주석처리
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -840,6 +840,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 관리
|
||||
// =====================================================
|
||||
|
||||
@@ -2092,6 +2092,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