feat: AciDlivyTasklet processDelivery 수정 - 0건 스킵, dlivyCdNb Java 통일, orderLogMap 누락값 추가
This commit is contained in:
@@ -230,7 +230,15 @@ public class AciDlivyTasklet implements Tasklet {
|
||||
*/
|
||||
private void processDelivery(AciDlivyOrderVO orderVO) {
|
||||
|
||||
// 출고 gc_goods_export 처리
|
||||
// ① 주문 상품 옵션 목록 먼저 조회 (0건이면 출고처리 전체 스킵)
|
||||
List<DataMap> itemList = aciDlivyMapper.selectAciDlivyTargetItemList(orderVO);
|
||||
if (itemList.isEmpty()) {
|
||||
log.warn("[AciDlivyBatch] 주문 상품 옵션 없음 - 출고처리 스킵 (ORDR_DLVY_INNB={})", orderVO.getOrdrDlvyInnb());
|
||||
return;
|
||||
}
|
||||
log.debug("[AciDlivyBatch] 주문 상품 옵션 수={} (ORDR_DLVY_INNB={})", itemList.size(), orderVO.getOrdrDlvyInnb());
|
||||
|
||||
// ② gc_goods_export 처리 (selectKey로 dlivyInnb 채번)
|
||||
int exportCnt = aciDlivyMapper.selectGoodsExportCount(orderVO);
|
||||
if (exportCnt > 0) {
|
||||
aciDlivyMapper.updateGoodsExport(orderVO);
|
||||
@@ -238,14 +246,16 @@ public class AciDlivyTasklet implements Tasklet {
|
||||
aciDlivyMapper.insertGoodsExport(orderVO);
|
||||
}
|
||||
|
||||
// 출고코드 생성 (GC_GOODS_EXPORT의 DLIVY_CD_NB 규칙 따름)
|
||||
// ③ dlivyCdNb 생성 (insertGoodsExport 실행 후, dlivyInnb 채번 완료 후)
|
||||
String dlivyCdNb = "D" + new SimpleDateFormat("yyMMddHH").format(new Date()) + orderVO.getDlivyInnb();
|
||||
orderVO.setDlivyCdNb(dlivyCdNb);
|
||||
|
||||
// 주문 상품 옵션 목록 조회 및 건별 처리 (gc_order_item_option)
|
||||
List<DataMap> itemList = aciDlivyMapper.selectAciDlivyTargetItemList(orderVO);
|
||||
log.debug("[AciDlivyBatch] 주문 상품 옵션 수={} (ORDR_DLVY_INNB={})", itemList.size(), orderVO.getOrdrDlvyInnb());
|
||||
// ④ INSERT 경로: DLIVY_CD_NB 업데이트 (INSERT 시 #{dlivyCdNb}가 null이었으므로)
|
||||
if (exportCnt == 0) {
|
||||
aciDlivyMapper.updateGoodsExportDlivyCdNb(orderVO);
|
||||
}
|
||||
|
||||
// ⑤ 주문 상품 옵션별 처리 (gc_goods_export_item, gc_order_item_option)
|
||||
for (DataMap itemMap : itemList) {
|
||||
Object qyObj = itemMap.get("qy");
|
||||
if (qyObj == null) continue;
|
||||
@@ -289,19 +299,21 @@ public class AciDlivyTasklet implements Tasklet {
|
||||
aciDlivyMapper.insertGoodsExportLog(exportLogMap);
|
||||
}
|
||||
|
||||
// gc_order_shipping 상태 UPDATE (모든 item_option 처리 완료 후 일괄)
|
||||
// ⑥ gc_order_shipping 상태 UPDATE (모든 item_option 처리 완료 후 일괄)
|
||||
aciDlivyMapper.updateOrderShippingStatus(orderVO);
|
||||
|
||||
// gc_order 상태 UPDATE (모든 shipping 처리 완료 후 일괄)
|
||||
// ⑦ gc_order 상태 UPDATE (모든 shipping 처리 완료 후 일괄)
|
||||
aciDlivyMapper.updateOrderStatus(orderVO);
|
||||
|
||||
// 주문 로그 INSERT
|
||||
// ⑧ 주문 로그 INSERT
|
||||
DataMap orderLogMap = new DataMap();
|
||||
orderLogMap.put("ordrInnb", orderVO.getOrdrInnb());
|
||||
orderLogMap.put("sopmalCd", orderVO.getSopmalCd());
|
||||
orderLogMap.put("logSj", "출고처리(" + dlivyCdNb + ")");
|
||||
orderLogMap.put("logDtlCn", "[ACI 배치] 배치 출고처리 완료");
|
||||
orderLogMap.put("aditInfoCn", null);
|
||||
orderLogMap.put("dlivyCdNb", dlivyCdNb);
|
||||
orderLogMap.put("refundCdNb", null);
|
||||
orderLogMap.put("logDvCd", "01");
|
||||
orderLogMap.put("dvCd", "BATCH");
|
||||
orderLogMap.put("opetrNm", "ACI 배치");
|
||||
|
||||
Reference in New Issue
Block a user