품목 컬럼 추가로 인한 봄 엑셀 업로드 수정(api관련)

This commit is contained in:
2026-02-12 17:11:34 +09:00
parent 111889ad09
commit f0f2a5f1e1
2 changed files with 183 additions and 5 deletions

View File

@@ -250,7 +250,8 @@ $(document).ready(function(){
grid = $("#expenseDetailGrid").jqGrid({
url: ""
,datatype: "local"
,colNames: ["상태","모품번","품번","품명","수량","항목수량","재료","열처리경도","열처리방법","표면처리","메이커","범주이름","계정구분","조달구분"]
,colNames: ["상태","모품번","품번","품명","수량","항목수량","재료","열처리경도","열처리방법","표면처리","메이커","범주이름","규격","계정구분","조달구분",
"재고단위","관리단위","환산수량","LOT구분","사용여부","검사여부","SET품여부","의뢰여부","개당길이","개당소요량"]
,colModel: [
{name:"NOTE",index:"NOTE", width: 200, align:"center", hidden: false, sortable:false, editable:true
,editoptions:{
@@ -354,6 +355,13 @@ $(document).ready(function(){
}
}
}
,{name:"SPEC",index:"SPEC", width: 100, align:"center", hidden: false, sortable:false, editable:true
,editoptions:{
dataInit : function(e){
e.style.fontSize = 13;
}
}
}
,{name:"ACCTFG" ,index:"ACCTFG" , width:80, align:"center", hidden:false, sortable:false, editable: true
,edittype :"select"
,formatter :"select"
@@ -369,13 +377,103 @@ $(document).ready(function(){
,edittype :"select"
,formatter :"select"
,editoptions:{
value: {"":"선택","0":"구매","1":"생산"}
value: {"":"선택","0":"구매","1":"생산","8":"Phantom"}
,dataInit : function(e){
e.style.width = "92%";
e.style.fontSize = 13;
}
}
}
,{name:"UNIT_DC",index:"UNIT_DC", width: 70, align:"center", hidden: false, sortable:false, editable:true
,editoptions:{
dataInit : function(e){
e.style.fontSize = 13;
}
}
}
,{name:"UNITMANG_DC",index:"UNITMANG_DC", width: 70, align:"center", hidden: false, sortable:false, editable:true
,editoptions:{
dataInit : function(e){
e.style.fontSize = 13;
}
}
}
,{name:"UNITCHNG_NB",index:"UNITCHNG_NB", width: 70, align:"center", hidden: false, sortable:false, editable:true
,editoptions:{
dataInit : function(e){
e.style.fontSize = 13;
}
}
}
,{name:"LOT_FG" ,index:"LOT_FG" , width:70, align:"center", hidden:false, sortable:false, editable: true
,edittype :"select"
,formatter :"select"
,editoptions:{
value: {"0":"미사용","1":"사용"}
,dataInit : function(e){
e.style.width = "92%";
e.style.fontSize = 13;
}
}
}
,{name:"USE_YN" ,index:"USE_YN" , width:70, align:"center", hidden:false, sortable:false, editable: true
,edittype :"select"
,formatter :"select"
,editoptions:{
value: {"1":"사용","0":"미사용"}
,dataInit : function(e){
e.style.width = "92%";
e.style.fontSize = 13;
}
}
}
,{name:"QC_FG" ,index:"QC_FG" , width:70, align:"center", hidden:false, sortable:false, editable: true
,edittype :"select"
,formatter :"select"
,editoptions:{
value: {"0":"무검사","1":"검사"}
,dataInit : function(e){
e.style.width = "92%";
e.style.fontSize = 13;
}
}
}
,{name:"SETITEM_FG" ,index:"SETITEM_FG" , width:70, align:"center", hidden:false, sortable:false, editable: true
,edittype :"select"
,formatter :"select"
,editoptions:{
value: {"0":"부","1":"여"}
,dataInit : function(e){
e.style.width = "92%";
e.style.fontSize = 13;
}
}
}
,{name:"REQ_FG" ,index:"REQ_FG" , width:70, align:"center", hidden:false, sortable:false, editable: true
,edittype :"select"
,formatter :"select"
,editoptions:{
value: {"0":"부","1":"여"}
,dataInit : function(e){
e.style.width = "92%";
e.style.fontSize = 13;
}
}
}
,{name:"UNIT_LENGTH",index:"UNIT_LENGTH", width: 70, align:"center", hidden: false, sortable:false, editable:true
,editoptions:{
dataInit : function(e){
e.style.fontSize = 13;
}
}
}
,{name:"UNIT_QTY",index:"UNIT_QTY", width: 80, align:"center", hidden: false, sortable:false, editable:true
,editoptions:{
dataInit : function(e){
e.style.fontSize = 13;
}
}
}
]
//,cellEdit : true
//,cellsubmit : "clientArray"

View File

@@ -3527,9 +3527,21 @@ public class PartMngService extends BaseService {
String surfaceTreatment = getCsvValue(values, colIndex++, emptyColCnt); // 8: 표면처리
String supplier = getCsvValue(values, colIndex++, emptyColCnt); // 9: 공급업체
String partType = getCsvValue(values, colIndex++, emptyColCnt); // 10: 범주이름
// 계정구분/조달구분은 CSV에 있을 수도 없을 수도 있음
String acctfg = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 11: 계정구분
String odrfg = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 12: 조달구분
// CSV 컬럼 순서: 11: 규격, 12: 계정구분, 13: 조달구분, 14: 재고단위, 15: 관리단위, 16: 환산수량
// 17: LOT구분, 18: 사용여부, 19: 검사여부, 20: SET품여부, 21: 의뢰여부, 22: 개당길이, 23: 개당소요량
String spec = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 11: 규격
String acctfg = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 12: 계정구분
String odrfg = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 13: 조달구분
String unitDc = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 14: 재고단위
String unitmangDc = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 15: 관리단위
String unitchngNb = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 16: 환산수량
String lotFg = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 17: LOT구분
String useYn = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 18: 사용여부
String qcFg = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 19: 검사여부
String setitemFg = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 20: SET품여부
String reqFg = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 21: 의뢰여부
String unitLength = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 22: 개당길이
String unitQty = colIndex < values.length ? getCsvValue(values, colIndex++, emptyColCnt) : ""; // 23: 개당소요량
// 수준으로부터 부모 품번 찾기
String parentPartNo = "";
@@ -3634,6 +3646,7 @@ public class PartMngService extends BaseService {
partMap.put("SURFACE_TREATMENT", surfaceTreatment);
partMap.put("MAKER", makerValue); // MAKER에 저장
partMap.put("PART_TYPE", partTypeCode);
partMap.put("SPEC", spec.trim()); // 규격
// 계정구분(ACCTFG) - 한글명 입력 시 코드값으로 변환
if(!StringUtils.isBlank(acctfg)){
if(acctfg.matches("\\d+")) {
@@ -3665,6 +3678,73 @@ public class PartMngService extends BaseService {
} else {
partMap.put("ODRFG", "");
}
// ERP 연동 필드
partMap.put("UNIT_DC", unitDc.trim());
partMap.put("UNITMANG_DC", unitmangDc.trim());
partMap.put("UNITCHNG_NB", unitchngNb.trim());
// LOT구분 - 한글명 입력 시 코드값으로 변환 (0:미사용, 1:사용)
if(!CommonUtils.isBlank(lotFg)){
if("사용".equals(lotFg.trim())){
partMap.put("LOT_FG", "1");
} else if("미사용".equals(lotFg.trim())){
partMap.put("LOT_FG", "0");
} else {
partMap.put("LOT_FG", lotFg.trim());
}
} else {
partMap.put("LOT_FG", "");
}
// 사용여부 - 한글명 입력 시 코드값으로 변환 (0:미사용, 1:사용)
if(!CommonUtils.isBlank(useYn)){
if("사용".equals(useYn.trim())){
partMap.put("USE_YN", "1");
} else if("미사용".equals(useYn.trim())){
partMap.put("USE_YN", "0");
} else {
partMap.put("USE_YN", useYn.trim());
}
} else {
partMap.put("USE_YN", "");
}
// 검사여부 - 한글명 입력 시 코드값으로 변환 (0:무검사, 1:검사)
if(!CommonUtils.isBlank(qcFg)){
if("검사".equals(qcFg.trim())){
partMap.put("QC_FG", "1");
} else if("무검사".equals(qcFg.trim())){
partMap.put("QC_FG", "0");
} else {
partMap.put("QC_FG", qcFg.trim());
}
} else {
partMap.put("QC_FG", "");
}
// SET품여부 - 한글명 입력 시 코드값으로 변환 (0:부, 1:여)
if(!CommonUtils.isBlank(setitemFg)){
if("".equals(setitemFg.trim())){
partMap.put("SETITEM_FG", "1");
} else if("".equals(setitemFg.trim())){
partMap.put("SETITEM_FG", "0");
} else {
partMap.put("SETITEM_FG", setitemFg.trim());
}
} else {
partMap.put("SETITEM_FG", "");
}
// 의뢰여부 - 한글명 입력 시 코드값으로 변환 (0:부, 1:여)
if(!CommonUtils.isBlank(reqFg)){
if("".equals(reqFg.trim())){
partMap.put("REQ_FG", "1");
} else if("".equals(reqFg.trim())){
partMap.put("REQ_FG", "0");
} else {
partMap.put("REQ_FG", reqFg.trim());
}
} else {
partMap.put("REQ_FG", "");
}
// 개당길이, 개당소요량
partMap.put("UNIT_LENGTH", unitLength.trim());
partMap.put("UNIT_QTY", unitQty.trim());
partMap.put("NOTE", noteMsg);
if(!StringUtils.isBlank(noteMsg) || emptyColCnt.intValue() < 9) {