|
|
@@ -17,6 +17,7 @@ import com.gagaframework.excel.xssf.GagaExcelResultHandler;
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
import com.gagaframework.web.rest.server.GagaResponseStatus;
|
|
|
import com.style24.core.biz.dao.TscOrderDao;
|
|
|
+import com.style24.core.biz.dao.TscScmDao;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.core.support.message.TscMessageByLocale;
|
|
|
import com.style24.persistence.domain.Order;
|
|
|
@@ -42,6 +43,9 @@ public class TscOrderService {
|
|
|
|
|
|
@Autowired
|
|
|
private TscOrderDao orderDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TscScmDao scmDao;
|
|
|
|
|
|
@Autowired
|
|
|
private TscPointService pointService;
|
|
|
@@ -200,7 +204,7 @@ public class TscOrderService {
|
|
|
* @since 2020. 11. 30
|
|
|
*/
|
|
|
public Collection<Order> getOrderSellerUnorderList(Order order) {
|
|
|
- return orderDao.getOrderSellerUnorderList(order);
|
|
|
+ return scmDao.getOrderSellerUnorderList(order);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -216,7 +220,7 @@ public class TscOrderService {
|
|
|
// 1. 임시테이블 삭제
|
|
|
Order deleteOrder = new Order();
|
|
|
deleteOrder.setRegNo(userNo);
|
|
|
- orderDao.deleteEntryExcelDownTmp(deleteOrder);
|
|
|
+ scmDao.deleteEntryExcelDownTmp(deleteOrder);
|
|
|
|
|
|
for (Order oneData : orderList) {
|
|
|
|
|
|
@@ -229,21 +233,24 @@ public class TscOrderService {
|
|
|
updateData.setRegNo(userNo);
|
|
|
updateData.setUpdNo(userNo);
|
|
|
|
|
|
- // 2. 주문상세상태값 변경
|
|
|
- // 2.1 2020.12.15 주문상태체크추가 (결제완료 상태만 상품준비중 변경)
|
|
|
- int result = orderDao.updateOrderDetailStat(updateData);
|
|
|
+ log.info("updateData={}", updateData);
|
|
|
|
|
|
+ // 2. 주문상세상태값 변경
|
|
|
+ int result = scmDao.updateOrderDetailStat(updateData);
|
|
|
if (result > 0) {
|
|
|
// 3. 주문상세상태 변경 이력생성
|
|
|
orderDao.createOrderDetailHst(updateData);
|
|
|
+
|
|
|
+ // 202010419 xodud1202 주문상품상세 상태 변경
|
|
|
+ updateData.setOrdDtlStat(TscConstants.OrderDetailStat.GOODS_PREPARE.value());
|
|
|
+ scmDao.updateOrderDetailItemStat(updateData);
|
|
|
}
|
|
|
|
|
|
// 4. 엑셀 다운로드용 임시테이블 데이타 체크
|
|
|
- result = orderDao.getEntryUploadExcelCheck(updateData);
|
|
|
+ result = scmDao.getEntryUploadExcelCheck(updateData);
|
|
|
if (result < 1) {
|
|
|
-
|
|
|
// 5. 엑셀 다운로드용 임시테이블 저장
|
|
|
- orderDao.createEntryExcelDownTmp(updateData);
|
|
|
+ scmDao.createEntryExcelDownTmp(updateData);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -260,99 +267,87 @@ public class TscOrderService {
|
|
|
|
|
|
// 헤더 title 설정 (23)
|
|
|
String[] listTitles = {
|
|
|
- "입점업체"
|
|
|
- , "브랜드"
|
|
|
- , "상품타입"
|
|
|
- , "상품코드"
|
|
|
- , "상품명"
|
|
|
- , "주문번호"
|
|
|
- , "주문상세번호"
|
|
|
- , "주문상세상태"
|
|
|
- , "주문자명"
|
|
|
- , "주문일시"
|
|
|
- , "결제수단"
|
|
|
- , "주문자휴대전화"
|
|
|
- , "수령자명"
|
|
|
- , "수령자휴대전화"
|
|
|
- , "수령자우편번호"
|
|
|
- , "수령자기본주소"
|
|
|
- , "수령자상세주소"
|
|
|
- , "업체상품코드"
|
|
|
- , "단품코드"
|
|
|
- , "단품상품명"
|
|
|
- , "칼라"
|
|
|
- , "사이즈"
|
|
|
- , "주문수량"
|
|
|
- , "주문금액"
|
|
|
- , "할인금액"
|
|
|
- , "실결제금액"
|
|
|
- , "송장"
|
|
|
+ "입점업체"
|
|
|
+ , "브랜드"
|
|
|
+ , "주문번호"
|
|
|
+ , "주문상세번호"
|
|
|
+ , "주문상세상태"
|
|
|
+ , "주문자명"
|
|
|
+ , "주문일시"
|
|
|
+ , "결제수단"
|
|
|
+ , "주문자휴대전화"
|
|
|
+ , "수령자명"
|
|
|
+ , "수령자휴대전화"
|
|
|
+ , "수령자우편번호"
|
|
|
+ , "수령자기본주소"
|
|
|
+ , "수령자상세주소"
|
|
|
+ , "업체상품코드"
|
|
|
+ , "상품코드"
|
|
|
+ , "상품명"
|
|
|
+ , "사이즈"
|
|
|
+ , "주문수량"
|
|
|
+ , "주문금액"
|
|
|
+ , "할인금액"
|
|
|
+ , "실결제금액"
|
|
|
+ , "송장"
|
|
|
};
|
|
|
|
|
|
// DB 처리 시 사용되는 파라미터명(셀명) 설정 (23)
|
|
|
String[] cellNames = {
|
|
|
- "supplyCompNm"
|
|
|
- , "brandKnm"
|
|
|
- , "goodsTypeNm"
|
|
|
- , "goodsCd"
|
|
|
- , "goodsNm"
|
|
|
- , "ordNo"
|
|
|
- , "ordDtlNo"
|
|
|
- , "ordDtlStatNm"
|
|
|
- , "ordNm"
|
|
|
- , "ordDt"
|
|
|
- , "payMeansNm"
|
|
|
- , "ordPhnno"
|
|
|
- , "recipNm"
|
|
|
- , "recipPhnno"
|
|
|
- , "recipZipNo"
|
|
|
- , "recipBaseAddr"
|
|
|
- , "recipDtlAddr"
|
|
|
- , "supplyGoodsCd"
|
|
|
- , "itemCd"
|
|
|
- , "itemNm"
|
|
|
- , "optCd1"
|
|
|
- , "optCd2"
|
|
|
- , "itemOrdQty"
|
|
|
- , "ordAmt"
|
|
|
- , "totDcAmt"
|
|
|
- , "realOrdAmt"
|
|
|
- , "invoiceNo"
|
|
|
+ "supplyCompNm"
|
|
|
+ , "brandKnm"
|
|
|
+ , "ordNo"
|
|
|
+ , "ordDtlNo"
|
|
|
+ , "ordDtlStatNm"
|
|
|
+ , "ordNm"
|
|
|
+ , "ordDt"
|
|
|
+ , "payMeansNm"
|
|
|
+ , "ordPhnno"
|
|
|
+ , "recipNm"
|
|
|
+ , "recipPhnno"
|
|
|
+ , "recipZipcode"
|
|
|
+ , "recipBaseAddr"
|
|
|
+ , "recipDtlAddr"
|
|
|
+ , "supplyGoodsCd"
|
|
|
+ , "goodsCd"
|
|
|
+ , "goodsNm"
|
|
|
+ , "optCd2"
|
|
|
+ , "ordQty"
|
|
|
+ , "ordAmt"
|
|
|
+ , "totDcAmt"
|
|
|
+ , "realOrdAmt"
|
|
|
+ , "invoiceNo"
|
|
|
};
|
|
|
|
|
|
String[] cellTypes = {
|
|
|
- GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
- , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
+ , GagaExcelConstants.CellType.CHAR_CENTER.name()
|
|
|
};
|
|
|
|
|
|
GagaExcelResultHandler<Order> handler = new GagaExcelResultHandler<>(excelFilenameWithPath, "출고배송목록(입점)", listTitles, cellNames, cellTypes);
|
|
|
|
|
|
- orderDao.getSellerUnorderList(order, handler);
|
|
|
+ scmDao.getSellerUnorderList(order, handler);
|
|
|
|
|
|
handler.close();
|
|
|
}
|
|
|
@@ -387,25 +382,24 @@ public class TscOrderService {
|
|
|
updateData.setSupplyCompCd(oneData.getSupplyCompCd());
|
|
|
updateData.setRegNo(userNo);
|
|
|
updateData.setUpdNo(userNo);
|
|
|
- updateData.setItemCd(oneData.getItemCd());
|
|
|
+ updateData.setGoodsCd(oneData.getGoodsCd());
|
|
|
updateData.setOptCd2(oneData.getOptCd2());
|
|
|
+ updateData.setOrdQty(oneData.getOrdQty());
|
|
|
updateData.setShipCompCd(oneData.getShipCompCd());
|
|
|
updateData.setInvoiceNo(oneData.getInvoiceNo().replace("-", ""));
|
|
|
|
|
|
// 3. 원주문 상세정보 조회
|
|
|
// 2020.12.15 세트상품의 경우에는 2개 이상의 row 가 표시됨 (주문상세번호 + 상풐코드로 + 사이즈코드) 변경
|
|
|
- Order orgOrder = orderDao.getOrderDetailInfo(oneData);
|
|
|
+ Order orgOrder = scmDao.getOrderDetailInfo(oneData);
|
|
|
if (orgOrder == null) {
|
|
|
- failedGoodCdStr += updateData.getItemCd() + " / " + updateData.getOptCd2() + "(Error1)<br/>"; // 상품정보 (상품명 + 칼라명) / 사이즈코드
|
|
|
+ failedGoodCdStr += updateData.getGoodsCd() + " / " + updateData.getOptCd2() + "(Error1)<br/>"; // 상품정보 (상품명 + 칼라명) / 사이즈코드
|
|
|
failedCount++;
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- // 4. 상품코드, 사이즈, 주문수량 체크 (세트상품도 단품 단위로 업로드 요청)
|
|
|
- // 2020.12.15 세트상품 때문에 단품단위로 비교
|
|
|
- if (!orgOrder.getItemCd().equals(updateData.getItemCd())
|
|
|
- || !orgOrder.getOptCd2().equals(updateData.getOptCd2()) ) {
|
|
|
- failedGoodCdStr += updateData.getItemCd() + " / " + updateData.getOptCd2() + "(Error2)<br/>";
|
|
|
+ // 4. 상품코드, 사이즈, 주문수량 체크
|
|
|
+ if (!orgOrder.getGoodsCd().equals(updateData.getGoodsCd()) || !orgOrder.getOptCd2().equals(updateData.getOptCd2()) || orgOrder.getOrdQty() != updateData.getOrdQty()) {
|
|
|
+ failedGoodCdStr += updateData.getGoodsCd() + " / " + updateData.getOptCd2() + "(Error2)<br/>";
|
|
|
failedCount++;
|
|
|
continue;
|
|
|
}
|
|
|
@@ -414,14 +408,16 @@ public class TscOrderService {
|
|
|
updateData.setSupplyCompCd(orgOrder.getSupplyCompCd());
|
|
|
|
|
|
// 6. 송장번호등록
|
|
|
- int result = orderDao.updateOrderDetailInvoice(updateData);
|
|
|
+ int result = scmDao.updateOrderDetailInvoice(updateData);
|
|
|
|
|
|
// 7. 주문상세상태 변경 이력 등록
|
|
|
if (result > 0) {
|
|
|
successCount++;
|
|
|
+ updateData.setOrdDtlStat(TscConstants.OrderDetailStat.DELIVERY_PREPARE.value());
|
|
|
+ scmDao.updateOrderDetailItemStat(updateData);
|
|
|
orderDao.createOrderDetailHst(updateData);
|
|
|
} else {
|
|
|
- failedGoodCdStr += updateData.getItemCd() + " / " + updateData.getOptCd2() + "(Error3)<br/>";
|
|
|
+ failedGoodCdStr += updateData.getGoodsCd() + " / " + updateData.getOptCd2() + "(Error3)<br/>";
|
|
|
failedCount++;
|
|
|
}
|
|
|
}
|