diff --git a/WebContent/WEB-INF/view/partMng/openBomReportExcelImportPopUp.jsp b/WebContent/WEB-INF/view/partMng/openBomReportExcelImportPopUp.jsp index 25085fc..006260e 100644 --- a/WebContent/WEB-INF/view/partMng/openBomReportExcelImportPopUp.jsp +++ b/WebContent/WEB-INF/view/partMng/openBomReportExcelImportPopUp.jsp @@ -22,6 +22,11 @@ var grid; $(document).ready(function(){ + // 품번/품명 Select2 AJAX 초기화 (common.js의 새 함수 사용) + // initPartSelect2Ajax("#bom_part_no", "#bom_part_name", "#bom_part_objid", { + // debug: false // 디버깅 모드 비활성화 + // }); + $(".dataTr").each(function(i){ var lev = $(this).attr("data-LEVEL"); if(lev == 1){ @@ -168,9 +173,9 @@ $(document).ready(function(){ location.href="/template/BOM_REPORT_EXCEL_IMPORT_TEMPLATE.xlsx"; }); - var unit_cd = $.parseJSON($("#unit_cd").val()); //jqGrid 구분 + //var unit_cd = $.parseJSON($("#unit_cd").val()); //jqGrid 구분 var part_type = $.parseJSON($("#part_type").val()); //jqGrid 구분 - var sup_code = $.parseJSON($("#sup_code").val()); //jqGrid 구분 + //var sup_code = $.parseJSON($("#sup_code").val()); //jqGrid 구분 //Excel File Upload된 파일 목록 부분을 초기화 한다. $("#excelImportList").hide(); @@ -181,7 +186,7 @@ $(document).ready(function(){ grid = $("#expenseDetailGrid").jqGrid({ url: "" ,datatype: "local" - ,colNames: ["상태","모품번","자품번","품명","수량","재질","사양(규격)","후처리","MAKER","부품 유형","REMARK"] + ,colNames: ["상태","모품번","품번","품명","수량","항목수량","재료","열처리경도","열처리방법","표면처리","공급업체","범주이름"] ,colModel: [ {name:"NOTE",index:"NOTE", width: 160, align:"center", hidden: false, sortable:false, editable:true ,editoptions:{ @@ -190,56 +195,70 @@ $(document).ready(function(){ } } } - ,{name:"PARENT_PART_NO",index:"PARENT_PART_NO", width: 160, align:"center", hidden: false, sortable:false, editable:true + ,{name:"PARENT_PART_NO",index:"PARENT_PART_NO", width: 140, align:"center", hidden: false, sortable:false, editable:true ,editoptions:{ dataInit : function(e){ e.style.fontSize = 13; } } } - ,{name:"PART_NO",index:"PART_NO", width: 160, align:"center", hidden: false, sortable:false, editable:true - ,editoptions:{ - dataInit : function(e){ - e.style.fontSize = 13; - } - } - } - ,{name:"PART_NAME",index:"PART_NAME", width: 270, align:"center", hidden: false, sortable:false, editable:true + ,{name:"PART_NO",index:"PART_NO", width: 140, align:"center", hidden: false, sortable:false, editable:true ,editoptions:{ dataInit : function(e){ e.style.fontSize = 13; } } } - ,{name:"QTY",index:"QTY", width: 50, align:"center", hidden: false, sortable:false, editable:true + ,{name:"PART_NAME",index:"PART_NAME", width: 200, align:"center", hidden: false, sortable:false, editable:true ,editoptions:{ dataInit : function(e){ e.style.fontSize = 13; } } } - ,{name:"MATERIAL",index:"MATERIAL", width: 150, align:"center", hidden: false, sortable:false, editable:true - ,editoptions:{ - dataInit : function(e){ - e.style.fontSize = 13; - } - } - } - ,{name:"SPEC",index:"SPEC", width: 150, align:"center", hidden: false, sortable:false, editable:true + ,{name:"QTY",index:"QTY", width: 60, align:"center", hidden: false, sortable:false, editable:true ,editoptions:{ dataInit : function(e){ e.style.fontSize = 13; } } } - ,{name:"POST_PROCESSING",index:"POST_PROCESSING", width: 100, align:"center", hidden: false, sortable:false, editable:true + ,{name:"ITEM_QTY",index:"ITEM_QTY", width: 80, align:"center", hidden: false, sortable:false, editable:true ,editoptions:{ dataInit : function(e){ e.style.fontSize = 13; } } } - ,{name:"MAKER",index:"MAKER", width: 150, align:"center", hidden: false, sortable:false, editable:true + ,{name:"MATERIAL",index:"MATERIAL", width: 120, align:"center", hidden: false, sortable:false, editable:true + ,editoptions:{ + dataInit : function(e){ + e.style.fontSize = 13; + } + } + } + ,{name:"HEAT_TREATMENT_HARDNESS",index:"HEAT_TREATMENT_HARDNESS", width: 100, align:"center", hidden: false, sortable:false, editable:true + ,editoptions:{ + dataInit : function(e){ + e.style.fontSize = 13; + } + } + } + ,{name:"HEAT_TREATMENT_METHOD",index:"HEAT_TREATMENT_METHOD", width: 100, align:"center", hidden: false, sortable:false, editable:true + ,editoptions:{ + dataInit : function(e){ + e.style.fontSize = 13; + } + } + } + ,{name:"SURFACE_TREATMENT",index:"SURFACE_TREATMENT", width: 100, align:"center", hidden: false, sortable:false, editable:true + ,editoptions:{ + dataInit : function(e){ + e.style.fontSize = 13; + } + } + } + ,{name:"SUPPLIER",index:"SUPPLIER", width: 120, align:"center", hidden: false, sortable:false, editable:true ,editoptions:{ dataInit : function(e){ e.style.fontSize = 13; @@ -257,14 +276,7 @@ $(document).ready(function(){ } } } - ,{name:"REMARK",index:"REMARK", width: 170, align:"center", hidden: false, sortable:false, editable:true - ,editoptions:{ - dataInit : function(e){ - e.style.fontSize = 13; - } - } - } - ] + ] //,cellEdit : true //,cellsubmit : "clientArray" ,rownumbers : true @@ -830,11 +842,43 @@ function fn_save(){ - + + + + + + + + + + + + + + + + + + + "+sqlMap); sqlSession.insert("partMng.createBOMReportStructureStandardInfo", sqlMap); + // BOM 데이터 저장 (프로젝트 연결 없이) + /* String newPartNo1Surffix = ""; String masterPartNo1 = ""; String UNIT_CODE2 = ""; @@ -3822,12 +4015,12 @@ public class PartMngService extends BaseService { UNIT_CODE2 = CommonUtils.checkNull((String)unitInfoMap.get("code")); utf8Bytes = unitName.getBytes("UTF-8"); - utf8unitName = new String(utf8Bytes, "UTF-8"); - filepath = Constants.FILE_STORAGE+"\\PART_DATA\\"; - filepathFull = filepath+projectNo+File.separator+unitName+File.separator; + utf8unitName = new String(utf8Bytes, "UTF-8"); + filepath = Constants.FILE_STORAGE+"\\PART_DATA\\"; + filepathFull = filepath+projectNo+File.separator+unitName+File.separator; //BOM REPORT OBJID - objid = CommonUtils.createObjId(); //키 새로 생성 + objid = CommonUtils.createObjId(); //키 새로 생성 sqlMap.clear(); sqlMap.put("OBJID", objid); sqlMap.put("MULTI_YN", "Y"); @@ -3845,107 +4038,75 @@ public class PartMngService extends BaseService { //엑셀 등록 //sqlSession.insert("partMng.relateexcelPartInfo", sqlMap); } + */ Map insertMap = new HashMap(); Map resultMap = new HashMap(); Map partobjMap = new HashMap(); - String newPartNo1 = ""; - //bom qty/part insert + + //bom qty/part insert (프로젝트 연결 없이 직접 저장) for(int i=0; i -1){ - newPartNo1Surffix = PART_NO.substring(PART_NO.lastIndexOf("-")); - } - masterPartNo1 = PART_NO; - }else { - PART_NO = projectNo; // + newPartNo1Surffix; - newPartNo1 = PART_NO; - } - } - - + String part_no = ""; + String PART_NO = CommonUtils.checkNull((String)insertMap.get("PART_NO")); + String PARENT_PART_NO = CommonUtils.checkNull((String)insertMap.get("PARENT_PART_NO")); - /* - if(!isMaster && i == 0) { //PART_NO.equals(masterProjectNo) - insertMap.put("PART_NO", projectNo); //1레벨은 part_no를 해당 project no로 변경 - } - */ - - insertMap.put("OBJID", CommonUtils.createObjId()); - insertMap.put("BOM_REPORT_OBJID", objid); - //insertMap.put("OBJID", CommonUtils.createObjId()); -// if(i == 1 && !isMaster){//sub BOM들은 1레벨 part_no가 바뀌어서 변경 -// insertMap.put("PARENT_PART_NO", CommonUtils.checkNull(newPartNo1)); -// }else { -// } - if(isMaster){ - insertMap.put("PARENT_PART_NO", PARENT_PART_NO); //PARENT_PART_NOT_NO - }else { - insertMap.put("PARENT_PART_NO", PARENT_PART_NO.equals(masterPartNo1) ? newPartNo1 : PARENT_PART_NO); //sub BOM들은 1레벨 part_no가 바뀌어서 변경 - } - insertMap.put("PART_NO", PART_NO); - insertMap.put("PART_NAME", CommonUtils.checkNull((String)insertMap.get("PART_NAME"))); - //insertMap.put("PART_NAME", java.util.regex.Matcher.quoteReplacement(CommonUtils.checkNull((String)insertMap.get("PART_NAME")))); - insertMap.put("QTY", CommonUtils.checkNull((String)insertMap.get("QTY"))); - insertMap.put("UNIT", CommonUtils.checkNull((String)insertMap.get("UNIT"))); - insertMap.put("SPEC", CommonUtils.checkNull((String)insertMap.get("SPEC"))); - insertMap.put("MATERIAL", CommonUtils.checkNull((String)insertMap.get("MATERIAL"))); - insertMap.put("THICKNESS", CommonUtils.checkNull((String)insertMap.get("THICKNESS"))); - insertMap.put("WIDTH", CommonUtils.checkNull((String)insertMap.get("WIDTH"))); - insertMap.put("HEIGHT", CommonUtils.checkNull((String)insertMap.get("HEIGHT"))); - insertMap.put("OUT_DIAMETER", CommonUtils.checkNull((String)insertMap.get("OUT_DIAMETER"))); - insertMap.put("IN_DIAMETER", CommonUtils.checkNull((String)insertMap.get("IN_DIAMETER"))); - insertMap.put("LENGTH", CommonUtils.checkNull((String)insertMap.get("LENGTH"))); - insertMap.put("PART_TYPE", CommonUtils.checkNull((String)insertMap.get("PART_TYPE"))); - insertMap.put("REMARK", CommonUtils.checkNull((String)insertMap.get("REMARK"))); - insertMap.put("SUPPLY_CODE", CommonUtils.checkNull((String)insertMap.get("SUP_CODE"))); - insertMap.put("MAKER", CommonUtils.checkNull((String)insertMap.get("MAKER"))); - insertMap.put("POST_PROCESSING", CommonUtils.checkNull((String)insertMap.get("POST_PROCESSING"))); - - insertMap.put("CONTRACT_OBJID", CommonUtils.checkNull((String)paramMap.get("CONTRACT_OBJID"))); - insertMap.put("PRODUCT_MGMT_OBJID", CommonUtils.checkNull((String)paramMap.get("product_mgmt_objid"))); - insertMap.put("CONNECTUSERID", CommonUtils.checkNull((String)paramMap.get("CONNECTUSERID"))); - - partobjMap.put("PART_NO", PART_NO); - resultMap = (HashMap)sqlSession.selectOne("partMng.getPartObjid", partobjMap); //part_no로 is_last = 1 건 조회 - if(null!=resultMap){ - part_no = CommonUtils.checkNull((String)resultMap.get("part_objid")); - }else{ - part_no = CommonUtils.createObjId(); - //PART저장 - insertMap.put("PART_OBJID", part_no); - sqlSession.insert("partMng.insertpartInfo", insertMap); + insertMap.put("OBJID", CommonUtils.createObjId()); + insertMap.put("BOM_REPORT_OBJID", objid); + insertMap.put("PARENT_PART_NO", PARENT_PART_NO); + insertMap.put("PART_NO", PART_NO); + insertMap.put("PART_NAME", CommonUtils.checkNull((String)insertMap.get("PART_NAME"))); + insertMap.put("QTY", CommonUtils.checkNull((String)insertMap.get("QTY"))); + insertMap.put("UNIT", CommonUtils.checkNull((String)insertMap.get("UNIT"))); + insertMap.put("SPEC", CommonUtils.checkNull((String)insertMap.get("SPEC"))); + insertMap.put("MATERIAL", CommonUtils.checkNull((String)insertMap.get("MATERIAL"))); + insertMap.put("THICKNESS", CommonUtils.checkNull((String)insertMap.get("THICKNESS"))); + insertMap.put("WIDTH", CommonUtils.checkNull((String)insertMap.get("WIDTH"))); + insertMap.put("HEIGHT", CommonUtils.checkNull((String)insertMap.get("HEIGHT"))); + insertMap.put("OUT_DIAMETER", CommonUtils.checkNull((String)insertMap.get("OUT_DIAMETER"))); + insertMap.put("IN_DIAMETER", CommonUtils.checkNull((String)insertMap.get("IN_DIAMETER"))); + insertMap.put("LENGTH", CommonUtils.checkNull((String)insertMap.get("LENGTH"))); + insertMap.put("PART_TYPE", CommonUtils.checkNull((String)insertMap.get("PART_TYPE"))); + insertMap.put("REMARK", CommonUtils.checkNull((String)insertMap.get("REMARK"))); + insertMap.put("SUPPLY_CODE", CommonUtils.checkNull((String)insertMap.get("SUP_CODE"))); + insertMap.put("MAKER", CommonUtils.checkNull((String)insertMap.get("MAKER"))); + insertMap.put("POST_PROCESSING", CommonUtils.checkNull((String)insertMap.get("POST_PROCESSING"))); + + insertMap.put("CONTRACT_OBJID", CommonUtils.checkNull((String)paramMap.get("CONTRACT_OBJID"))); + insertMap.put("PRODUCT_MGMT_OBJID", CommonUtils.checkNull((String)paramMap.get("product_mgmt_objid"))); + insertMap.put("CONNECTUSERID", CommonUtils.checkNull((String)paramMap.get("CONNECTUSERID"))); - Map fileMap = new HashMap(); - fileMap.put("FILE_PATH",filepathFull); - fileMap.put("WRITER",(String)paramMap.get("CONNECTUSERID")); + partobjMap.put("PART_NO", PART_NO); + resultMap = (HashMap)sqlSession.selectOne("partMng.getPartObjid", partobjMap); //part_no로 is_last = 1 건 조회 + if(null!=resultMap){ + part_no = CommonUtils.checkNull((String)resultMap.get("part_objid")); + }else{ + part_no = CommonUtils.createObjId(); + //PART저장 + insertMap.put("PART_OBJID", part_no); + sqlSession.insert("partMng.insertpartInfo", insertMap); + + // 파일 저장 부분 주석처리 (프로젝트 경로 정보 없음) + /* + Map fileMap = new HashMap(); + fileMap.put("FILE_PATH",filepathFull); + fileMap.put("WRITER",(String)paramMap.get("CONNECTUSERID")); - //첨부저장 PDF 저장 - //sqlSession.insert("part.insertpartfileInfo", fileMap); - - //dwg - fileMap.put("OBJID", CommonUtils.createObjId()); - fileMap.put("TARGET_OBJID", part_no); - fileMap.put("SAVED_FILE_NAME", CommonUtils.checkNull((String)insertMap.get("PART_NO")+".dwg")); - fileMap.put("REAL_FILE_NAME",CommonUtils.checkNull((String)insertMap.get("PART_NO")+".dwg")); - fileMap.put("DOC_TYPE" ,"2D_DRAWING_CAD"); - fileMap.put("DOC_TYPE_NAME","2D(Drawing) CAD 첨부파일"); - fileMap.put("FILE_SIZE","167941"); - fileMap.put("FILE_EXT","DWG"); + //첨부저장 PDF 저장 + //sqlSession.insert("part.insertpartfileInfo", fileMap); + + //dwg + fileMap.put("OBJID", CommonUtils.createObjId()); + fileMap.put("TARGET_OBJID", part_no); + fileMap.put("SAVED_FILE_NAME", CommonUtils.checkNull((String)insertMap.get("PART_NO")+".dwg")); + fileMap.put("REAL_FILE_NAME",CommonUtils.checkNull((String)insertMap.get("PART_NO")+".dwg")); + fileMap.put("DOC_TYPE" ,"2D_DRAWING_CAD"); + fileMap.put("DOC_TYPE_NAME","2D(Drawing) CAD 첨부파일"); + fileMap.put("FILE_SIZE","167941"); + fileMap.put("FILE_EXT","DWG"); System.out.println("fileMap --->"+ fileMap); System.out.println(filepathFull+CommonUtils.checkNull((String)insertMap.get("PART_NO")+".dwg")); @@ -3976,8 +4137,10 @@ public class PartMngService extends BaseService { //첨부저장이 존재 할때만 DWG 저장 sqlSession.insert("part.insertpartfileInfo", fileMap); } + */ } + String parent_part_no = ""; partobjMap.put("PART_NO", CommonUtils.checkNull((String)insertMap.get("PARENT_PART_NO"))); resultMap = (HashMap)sqlSession.selectOne("partMng.getPartObjid", partobjMap); if(null!=resultMap){ @@ -4001,14 +4164,6 @@ public class PartMngService extends BaseService { System.out.println(" insertMap--->"+insertMap); - /* #{BOM_REPORT_OBJID}, - #{OBJID}, - #{PARENT_OBJID}, - #{CHILD_OBJID}, - #{PARENT_PART_NO}, - #{PART_NO}, - #{QTY}::INTEGER,*/ - //BOM저장 //BOM에 구조 추가할경우 상태값 변경 if(!"".equals(bomobjid)){ @@ -4020,8 +4175,6 @@ public class PartMngService extends BaseService { sqlSession.insert("partMng.relatePartInfo", insertMap); }//end of gridDataList - }//end of APPLICATION_PROJECT_NO - }//end of j<11 sqlSession.commit();