품목 컬럼 추가로 인한 파트 엑셀 업로드 수정(api관련)
This commit is contained in:
@@ -158,15 +158,22 @@
|
||||
P.HEAT_TREATMENT_METHOD,
|
||||
P.SURFACE_TREATMENT,
|
||||
P.ACCTFG,
|
||||
(SELECT CODE_NAME FROM COMM_CODE WHERE CODE_ID = P.ACCTFG) AS ACCTFG_NM,
|
||||
P.ODRFG,
|
||||
CASE WHEN P.ODRFG = '0' THEN '구매' WHEN P.ODRFG = '1' THEN '생산' WHEN P.ODRFG = '8' THEN 'Phantom' ELSE '' END AS ODRFG_NM,
|
||||
P.UNIT_DC,
|
||||
P.UNITMANG_DC,
|
||||
P.UNITCHNG_NB,
|
||||
P.LOT_FG,
|
||||
CASE WHEN P.LOT_FG = '1' THEN '사용' WHEN P.LOT_FG = '0' THEN '미사용' ELSE '' END AS LOT_FG_NM,
|
||||
P.USE_YN,
|
||||
CASE WHEN P.USE_YN = '1' THEN '사용' WHEN P.USE_YN = '0' THEN '미사용' ELSE '' END AS USE_YN_NM,
|
||||
P.QC_FG,
|
||||
CASE WHEN P.QC_FG = '1' THEN '검사' WHEN P.QC_FG = '0' THEN '무검사' ELSE '' END AS QC_FG_NM,
|
||||
P.SETITEM_FG,
|
||||
CASE WHEN P.SETITEM_FG = '1' THEN '여' WHEN P.SETITEM_FG = '0' THEN '부' ELSE '' END AS SETITEM_FG_NM,
|
||||
P.REQ_FG,
|
||||
CASE WHEN P.REQ_FG = '1' THEN '여' WHEN P.REQ_FG = '0' THEN '부' ELSE '' END AS REQ_FG_NM,
|
||||
P.UNIT_LENGTH,
|
||||
P.UNIT_QTY,
|
||||
COALESCE(FILE_CNT.CU01_CNT, 0) CU01_CNT,
|
||||
|
||||
@@ -1441,10 +1441,29 @@ public class BatchService extends BaseService {
|
||||
return result;
|
||||
}
|
||||
|
||||
// ERP로 전송
|
||||
// ERP로 전송 - 전송 데이터 로그 출력
|
||||
System.out.println("====== ERP 전송 데이터 ======");
|
||||
System.out.println("coCd: " + coCd);
|
||||
System.out.println("itemCd(품번): " + itemCd);
|
||||
System.out.println("itemNm(품명): " + itemNm);
|
||||
System.out.println("itemDc(규격): " + itemDc);
|
||||
System.out.println("acctFg(계정구분): " + acctFg);
|
||||
System.out.println("odrFg(조달구분): " + odrFg);
|
||||
System.out.println("unitDc(재고단위): " + unitDc);
|
||||
System.out.println("unitmangDc(관리단위): " + unitmangDc);
|
||||
System.out.println("unitchngNb(환산수량): " + unitchngNb);
|
||||
System.out.println("lotFg(LOT구분): " + lotFg);
|
||||
System.out.println("qcFg(검사여부): " + qcFg);
|
||||
System.out.println("reqFg(의뢰여부): " + reqFg);
|
||||
System.out.println("setitemFg(SET품여부): " + setitemFg);
|
||||
System.out.println("useYn(사용여부): " + useYn);
|
||||
System.out.println("=============================");
|
||||
|
||||
PartErpApiClient partErpClient = new PartErpApiClient();
|
||||
String response = partErpClient.sendPartToErp(baseUrl, coCd, itemCd, itemNm, itemDc,
|
||||
acctFg, odrFg, unitDc, unitmangDc, unitchngNb, lotFg, qcFg, reqFg, setitemFg, useYn);
|
||||
|
||||
System.out.println("ERP 응답: " + response);
|
||||
|
||||
// 응답 확인
|
||||
if (response.contains("\"resultCode\":0") || response.contains("\"resultCode\":\"0\"")) {
|
||||
|
||||
@@ -3066,6 +3066,10 @@ public class PartMngService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
// 규격(SPEC)
|
||||
String specValue = getCellValue(row, columnIndex++, formatter, emptyColCnt);
|
||||
partMap.put("SPEC", specValue.trim());
|
||||
|
||||
// 계정구분(ACCTFG) - 한글명 입력 시 코드값으로 변환
|
||||
String acctfgValue = getCellValue(row, columnIndex++, formatter, emptyColCnt);
|
||||
if(!CommonUtils.isBlank(acctfgValue)){
|
||||
@@ -3085,13 +3089,15 @@ public class PartMngService extends BaseService {
|
||||
} else {
|
||||
partMap.put("ACCTFG", "");
|
||||
}
|
||||
// 조달구분(ODRFG) - 한글명 입력 시 코드값으로 변환
|
||||
// 조달구분(ODRFG) - 한글명 입력 시 코드값으로 변환 (0:구매, 1:생산, 8:Phantom)
|
||||
String odrfgValue = getCellValue(row, columnIndex++, formatter, emptyColCnt);
|
||||
if(!CommonUtils.isBlank(odrfgValue)){
|
||||
if("구매".equals(odrfgValue.trim())){
|
||||
partMap.put("ODRFG", "0");
|
||||
} else if("생산".equals(odrfgValue.trim())){
|
||||
partMap.put("ODRFG", "1");
|
||||
} else if("Phantom".equalsIgnoreCase(odrfgValue.trim())){
|
||||
partMap.put("ODRFG", "8");
|
||||
} else {
|
||||
partMap.put("ODRFG", odrfgValue); // 숫자면 그대로
|
||||
}
|
||||
@@ -3178,6 +3184,14 @@ public class PartMngService extends BaseService {
|
||||
partMap.put("REQ_FG", "0");
|
||||
}
|
||||
|
||||
// 개당길이(UNIT_LENGTH)
|
||||
String unitLength = getCellValue(row, columnIndex++, formatter, emptyColCnt);
|
||||
partMap.put("UNIT_LENGTH", unitLength.trim());
|
||||
|
||||
// 개당소요량(UNIT_QTY)
|
||||
String unitQty = getCellValue(row, columnIndex++, formatter, emptyColCnt);
|
||||
partMap.put("UNIT_QTY", unitQty.trim());
|
||||
|
||||
//비고(REMARK)
|
||||
partMap.put("REMARK", getCellValue(row, columnIndex++, formatter, emptyColCnt));
|
||||
|
||||
@@ -3637,12 +3651,14 @@ public class PartMngService extends BaseService {
|
||||
} else {
|
||||
partMap.put("ACCTFG", "");
|
||||
}
|
||||
// 조달구분(ODRFG) - 한글명 입력 시 코드값으로 변환
|
||||
// 조달구분(ODRFG) - 한글명 입력 시 코드값으로 변환 (0:구매, 1:생산, 8:Phantom)
|
||||
if(!CommonUtils.isBlank(odrfg)){
|
||||
if("구매".equals(odrfg.trim())){
|
||||
partMap.put("ODRFG", "0");
|
||||
} else if("생산".equals(odrfg.trim())){
|
||||
partMap.put("ODRFG", "1");
|
||||
} else if("Phantom".equalsIgnoreCase(odrfg.trim())){
|
||||
partMap.put("ODRFG", "8");
|
||||
} else {
|
||||
partMap.put("ODRFG", odrfg); // 숫자면 그대로
|
||||
}
|
||||
@@ -3900,9 +3916,10 @@ public class PartMngService extends BaseService {
|
||||
// 1: 모품번(PARENT_PART_NO), 2: 품번(PART_NO), 3: 품명(PART_NAME)
|
||||
// 4: 수량(QTY), 5: 항목수량(ITEM_QTY), 6: 재료(MATERIAL)
|
||||
// 7: 열처리경도(HEAT_TREATMENT_HARDNESS), 8: 열처리방법(HEAT_TREATMENT_METHOD), 9: 표면처리(SURFACE_TREATMENT)
|
||||
// 10: 공급업체(SUPPLIER), 11: 범주이름(PART_TYPE), 12: 계정구분(ACCTFG), 13: 조달구분(ODRFG)
|
||||
// 14: 재고단위(UNIT_DC), 15: 관리단위(UNITMANG_DC), 16: 환산수량(UNITCHNG_NB)
|
||||
// 17: LOT구분(LOT_FG), 18: 사용여부(USE_YN), 19: 검사여부(QC_FG), 20: SET품여부(SETITEM_FG), 21: 의뢰여부(REQ_FG)
|
||||
// 10: 공급업체(SUPPLIER), 11: 범주이름(PART_TYPE), 12: 규격(SPEC), 13: 계정구분(ACCTFG), 14: 조달구분(ODRFG)
|
||||
// 15: 재고단위(UNIT_DC), 16: 관리단위(UNITMANG_DC), 17: 환산수량(UNITCHNG_NB)
|
||||
// 18: LOT구분(LOT_FG), 19: 사용여부(USE_YN), 20: 검사여부(QC_FG), 21: SET품여부(SETITEM_FG), 22: 의뢰여부(REQ_FG)
|
||||
// 23: 개당길이(UNIT_LENGTH), 24: 개당소요량(UNIT_QTY)
|
||||
|
||||
String parentPartNo = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // 모품번
|
||||
String partNo = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // 품번
|
||||
@@ -3915,6 +3932,7 @@ public class PartMngService extends BaseService {
|
||||
String surfaceTreatment = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // 표면처리
|
||||
String supplier = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // 공급업체
|
||||
String partType = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // 범주이름
|
||||
String spec = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // 규격
|
||||
String acctfg = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // 계정구분
|
||||
String odrfg = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // 조달구분
|
||||
// ERP 연동 필드 파싱
|
||||
@@ -3926,6 +3944,8 @@ public class PartMngService extends BaseService {
|
||||
String qcFg = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // 검사여부
|
||||
String setitemFg = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // SET품여부
|
||||
String reqFg = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // 의뢰여부
|
||||
String unitLength = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // 개당길이
|
||||
String unitQty = getCellValue(row, columnIndex++, formatter, emptyColCnt).trim(); // 개당소요량
|
||||
|
||||
// 빈 행 체크
|
||||
if(StringUtils.isBlank(partNo) && StringUtils.isBlank(partName)){
|
||||
@@ -4043,6 +4063,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); // 규격
|
||||
// 계정구분(ACCTFG) - 한글명 입력 시 코드값으로 변환
|
||||
if(!StringUtils.isBlank(acctfg)){
|
||||
if(acctfg.matches("\\d+")) {
|
||||
@@ -4060,12 +4081,14 @@ public class PartMngService extends BaseService {
|
||||
} else {
|
||||
partMap.put("ACCTFG", "");
|
||||
}
|
||||
// 조달구분(ODRFG) - 한글명 입력 시 코드값으로 변환
|
||||
// 조달구분(ODRFG) - 한글명 입력 시 코드값으로 변환 (0:구매, 1:생산, 8:Phantom)
|
||||
if(!CommonUtils.isBlank(odrfg)){
|
||||
if("구매".equals(odrfg.trim())){
|
||||
partMap.put("ODRFG", "0");
|
||||
} else if("생산".equals(odrfg.trim())){
|
||||
partMap.put("ODRFG", "1");
|
||||
} else if("Phantom".equalsIgnoreCase(odrfg.trim())){
|
||||
partMap.put("ODRFG", "8");
|
||||
} else {
|
||||
partMap.put("ODRFG", odrfg); // 숫자면 그대로
|
||||
}
|
||||
@@ -4143,6 +4166,10 @@ public class PartMngService extends BaseService {
|
||||
partMap.put("REQ_FG", "0");
|
||||
}
|
||||
|
||||
// 개당길이, 개당소요량
|
||||
partMap.put("UNIT_LENGTH", unitLength);
|
||||
partMap.put("UNIT_QTY", unitQty);
|
||||
|
||||
partMap.put("NOTE", noteMsg);
|
||||
|
||||
if(logging) logger.info("partMap:"+partMap);
|
||||
@@ -4951,6 +4978,9 @@ public class PartMngService extends BaseService {
|
||||
insertMap.put("SETITEM_FG", StringUtils.isBlank(setitemFgVal) ? "0" : setitemFgVal);
|
||||
String reqFgVal = CommonUtils.checkNull((String)insertMap.get("REQ_FG"));
|
||||
insertMap.put("REQ_FG", StringUtils.isBlank(reqFgVal) ? "0" : reqFgVal);
|
||||
// 개당길이, 개당소요량
|
||||
insertMap.put("UNIT_LENGTH", CommonUtils.checkNull((String)insertMap.get("UNIT_LENGTH")));
|
||||
insertMap.put("UNIT_QTY", CommonUtils.checkNull((String)insertMap.get("UNIT_QTY")));
|
||||
insertMap.put("STATUS", "deploy"); // 엑셀 업로드 시 deploy 상태로 저장
|
||||
insertMap.put("WRITER", CommonUtils.checkNull((String)paramMap.get("CONNECTUSERID")));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user