|
@@ -1,8 +1,10 @@
|
|
|
package com.style24.admin.biz.web;
|
|
package com.style24.admin.biz.web;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.Collection;
|
|
import java.util.Collection;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -412,8 +414,11 @@ public class TsaOrderChangeController extends TsaBaseController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/rtn/req/form")
|
|
@GetMapping("/rtn/req/form")
|
|
|
public ModelAndView rtnReqForm(Order order) {
|
|
public ModelAndView rtnReqForm(Order order) {
|
|
|
-
|
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
+ List<Integer> ordDtlNoList = new ArrayList<>();
|
|
|
|
|
+ List<Integer> chgQtyList = new ArrayList<>();
|
|
|
|
|
+ String ordChgGb = order.getOrdChgGb();
|
|
|
|
|
+ String chgStat = "";
|
|
|
|
|
|
|
|
// 1. 반품가능 주문상세상탭값 설정
|
|
// 1. 반품가능 주문상세상탭값 설정
|
|
|
String[] ordDtlStatArr = new String[4];
|
|
String[] ordDtlStatArr = new String[4];
|
|
@@ -429,26 +434,18 @@ public class TsaOrderChangeController extends TsaBaseController {
|
|
|
List<Order> orderChangeDetailList = coreOrderChangeService.getOrderChangeDetailList(order);
|
|
List<Order> orderChangeDetailList = coreOrderChangeService.getOrderChangeDetailList(order);
|
|
|
Collection<Order> orderInfoList = coreOrderService.getOrderInfoList(order);
|
|
Collection<Order> orderInfoList = coreOrderService.getOrderInfoList(order);
|
|
|
|
|
|
|
|
- String chgStat = "";
|
|
|
|
|
|
|
+ // 반품상세화면 처리
|
|
|
if (order.getOrdChgSq() > 0) {
|
|
if (order.getOrdChgSq() > 0) {
|
|
|
- // 교환TO교환 처리 시 미착 수량 설정
|
|
|
|
|
Collection<Order> returnDetailList;
|
|
Collection<Order> returnDetailList;
|
|
|
- String ordChgGb = order.getOrdChgGb();
|
|
|
|
|
|
|
|
|
|
|
|
+ // 반품TO반품 처리 시 미착 수량 설정
|
|
|
if (StringUtils.isNotBlank(ordChgGb) && TscConstants.ChangeGb.RETURN_TO_RETURN.value().equals(ordChgGb.toUpperCase())) {
|
|
if (StringUtils.isNotBlank(ordChgGb) && TscConstants.ChangeGb.RETURN_TO_RETURN.value().equals(ordChgGb.toUpperCase())) {
|
|
|
returnDetailList = coreOrderChangeService.getNonArrivalInfo(order);
|
|
returnDetailList = coreOrderChangeService.getNonArrivalInfo(order);
|
|
|
} else {
|
|
} else {
|
|
|
returnDetailList = orderChangeDetailList;
|
|
returnDetailList = orderChangeDetailList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Collection<Order> exchangeInfoList = coreOrderChangeService.getExchangeInfo(order);
|
|
|
|
|
- // mav.addObject("exchangeInfoList" , exchangeInfoList); // 교환정보
|
|
|
|
|
- mav.addObject("ordChgGb" , StringUtils.isBlank(ordChgGb) ? "" : ordChgGb.toUpperCase()); // 주문변경요쳥변경구분
|
|
|
|
|
- mav.addObject("recallExceptionInfo" , coreOrderChangeService.getRecallExceptionInfo(order)); // 회수 예외 정보
|
|
|
|
|
-
|
|
|
|
|
// 반품상세 정보 설정
|
|
// 반품상세 정보 설정
|
|
|
- List<Integer> ordDtlNoList = new ArrayList<>();
|
|
|
|
|
- List<Integer> chgQtyList = new ArrayList<>();
|
|
|
|
|
if (returnDetailList != null && returnDetailList.size() > 0) {
|
|
if (returnDetailList != null && returnDetailList.size() > 0) {
|
|
|
for (Order tmp : returnDetailList) {
|
|
for (Order tmp : returnDetailList) {
|
|
|
if (tmp.getChgQty() > 0 && !ordDtlNoList.contains(tmp.getOrdDtlNo())) {
|
|
if (tmp.getChgQty() > 0 && !ordDtlNoList.contains(tmp.getOrdDtlNo())) {
|
|
@@ -460,23 +457,35 @@ public class TsaOrderChangeController extends TsaBaseController {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- List<Order> tmpList = new ArrayList<>();
|
|
|
|
|
- for (Order tmp : cancelRequestTargetList) {
|
|
|
|
|
- if(ordDtlNoList.contains(tmp.getOrdDtlNo())) {
|
|
|
|
|
- int chgQty = chgQtyList.get(ordDtlNoList.indexOf(tmp.getOrdDtlNo()));
|
|
|
|
|
- tmp.setChgQty(chgQty);
|
|
|
|
|
-
|
|
|
|
|
- if (StringUtils.isNotBlank(ordChgGb) && TscConstants.ChangeGb.RETURN_TO_RETURN.value().equals(ordChgGb.toUpperCase())) {
|
|
|
|
|
- tmp.setOrdCanChgQty(chgQty);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 회수 예외 정보 설정
|
|
|
|
|
+ mav.addObject("recallExceptionInfo" , coreOrderChangeService.getRecallExceptionInfo(order));
|
|
|
|
|
+ }
|
|
|
|
|
+ // 확정후품절 처리
|
|
|
|
|
+ else if (TscConstants.ChangeGb.SOLDOUT_AFTER_DECISION.value().equals(ordChgGb)) {
|
|
|
|
|
+ ordDtlNoList = Arrays.stream(order.getOrdDtlNoArr()).boxed().collect(Collectors.toList());
|
|
|
|
|
+ chgQtyList = Arrays.stream(order.getCnclRtnReqQtyArr()).boxed().collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- tmpList.add(tmp);
|
|
|
|
|
|
|
+ // 반품 대상 목록 설정
|
|
|
|
|
+ if (ordDtlNoList.size() > 0) {
|
|
|
|
|
+ List<Order> tmpList = new ArrayList<>();
|
|
|
|
|
+ for (Order tmp : cancelRequestTargetList) {
|
|
|
|
|
+ if (ordDtlNoList.contains(tmp.getOrdDtlNo())) {
|
|
|
|
|
+ int chgQty = chgQtyList.get(ordDtlNoList.indexOf(tmp.getOrdDtlNo()));
|
|
|
|
|
+ tmp.setChgQty(chgQty);
|
|
|
|
|
+
|
|
|
|
|
+ // 반품TO반품, 확정후품절 수량 설정
|
|
|
|
|
+ if (StringUtils.isNotBlank(ordChgGb) && (TscConstants.ChangeGb.RETURN_TO_RETURN.value().equals(ordChgGb.toUpperCase()) || TscConstants.ChangeGb.SOLDOUT_AFTER_DECISION.value().equals(ordChgGb.toUpperCase()))) {
|
|
|
|
|
+ tmp.setOrdCanChgQty(chgQty);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- cancelRequestTargetList = tmpList;
|
|
|
|
|
|
|
+ tmpList.add(tmp);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ cancelRequestTargetList = tmpList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 2021.01.26 취소요청 화면, 취소요청정보확인 화면 통합
|
|
// 2021.01.26 취소요청 화면, 취소요청정보확인 화면 통합
|
|
@@ -493,6 +502,7 @@ public class TsaOrderChangeController extends TsaBaseController {
|
|
|
mav.addObject("TelExcNoList" , rendererService.getAvailCommonCodeList("G095")); // 전화번호국번
|
|
mav.addObject("TelExcNoList" , rendererService.getAvailCommonCodeList("G095")); // 전화번호국번
|
|
|
mav.addObject("PhnExcNoList" , rendererService.getAvailCommonCodeList("G096")); // (휴대전화)번호국번
|
|
mav.addObject("PhnExcNoList" , rendererService.getAvailCommonCodeList("G096")); // (휴대전화)번호국번
|
|
|
mav.addObject("chgStat" , chgStat); // 변경상태
|
|
mav.addObject("chgStat" , chgStat); // 변경상태
|
|
|
|
|
+ mav.addObject("ordChgGb" , StringUtils.isBlank(ordChgGb) ? "" : ordChgGb.toUpperCase()); // 주문변경요쳥변경구분
|
|
|
|
|
|
|
|
mav.setViewName("order/RtnReqForm");
|
|
mav.setViewName("order/RtnReqForm");
|
|
|
|
|
|
|
@@ -525,10 +535,8 @@ public class TsaOrderChangeController extends TsaBaseController {
|
|
|
GagaMap refundPreInfo = coreOrderChangeService.getRefundPreInfo(rtnReq);
|
|
GagaMap refundPreInfo = coreOrderChangeService.getRefundPreInfo(rtnReq);
|
|
|
List<Order> cnclReqList = (List<Order>) refundPreInfo.get("cnclReqList");
|
|
List<Order> cnclReqList = (List<Order>) refundPreInfo.get("cnclReqList");
|
|
|
|
|
|
|
|
- GagaMap map = new GagaMap();
|
|
|
|
|
-
|
|
|
|
|
// 3. 환불예상금액계산
|
|
// 3. 환불예상금액계산
|
|
|
- map = coreOrderRefundService.cnclRtnRefundAmt(cnclReqList);
|
|
|
|
|
|
|
+ GagaMap map = coreOrderRefundService.cnclRtnRefundAmt(cnclReqList);
|
|
|
|
|
|
|
|
// 4. 주문변경기본정보설정
|
|
// 4. 주문변경기본정보설정
|
|
|
map.set("ordNo" , rtnReq.getOrdNo()); // 주문번호
|
|
map.set("ordNo" , rtnReq.getOrdNo()); // 주문번호
|
|
@@ -763,7 +771,7 @@ public class TsaOrderChangeController extends TsaBaseController {
|
|
|
@GetMapping("/exchange/request/form")
|
|
@GetMapping("/exchange/request/form")
|
|
|
public ModelAndView exchangeRequestFrom(Order order) {
|
|
public ModelAndView exchangeRequestFrom(Order order) {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
ModelAndView mav = new ModelAndView();
|
|
|
-
|
|
|
|
|
|
|
+ String ordChgGb = order.getOrdChgGb();
|
|
|
Integer ordChgSq = order.getOrdChgSq();
|
|
Integer ordChgSq = order.getOrdChgSq();
|
|
|
|
|
|
|
|
if (ordChgSq == null || ordChgSq == 0) {
|
|
if (ordChgSq == null || ordChgSq == 0) {
|
|
@@ -788,7 +796,6 @@ public class TsaOrderChangeController extends TsaBaseController {
|
|
|
|
|
|
|
|
// 교환TO교환 처리 시 미착 수량 설정
|
|
// 교환TO교환 처리 시 미착 수량 설정
|
|
|
Collection<Order> exchangeDetailList;
|
|
Collection<Order> exchangeDetailList;
|
|
|
- String ordChgGb = order.getOrdChgGb();
|
|
|
|
|
if (StringUtils.isNotBlank(ordChgGb) && TscConstants.ChangeGb.EXCHANGE_TO_EXCHANGE.value().equals(ordChgGb.toUpperCase())) {
|
|
if (StringUtils.isNotBlank(ordChgGb) && TscConstants.ChangeGb.EXCHANGE_TO_EXCHANGE.value().equals(ordChgGb.toUpperCase())) {
|
|
|
exchangeDetailList = coreOrderChangeService.getNonArrivalInfo(order);
|
|
exchangeDetailList = coreOrderChangeService.getNonArrivalInfo(order);
|
|
|
} else {
|
|
} else {
|
|
@@ -825,13 +832,15 @@ public class TsaOrderChangeController extends TsaBaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String chgOrdDtlStat = "";
|
|
String chgOrdDtlStat = "";
|
|
|
|
|
+ String wdGb = "";
|
|
|
if (exchangeInfoList != null && exchangeInfoList.size() > 0) {
|
|
if (exchangeInfoList != null && exchangeInfoList.size() > 0) {
|
|
|
chgOrdDtlStat = exchangeInfoList.iterator().next().getOrdDtlStat();
|
|
chgOrdDtlStat = exchangeInfoList.iterator().next().getOrdDtlStat();
|
|
|
|
|
+ wdGb = exchangeInfoList.iterator().next().getWdGb();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
mav.addObject("exchangeInfoList" , exchangeInfoList); // 교환정보
|
|
mav.addObject("exchangeInfoList" , exchangeInfoList); // 교환정보
|
|
|
- mav.addObject("ordChgGb" , StringUtils.isBlank(ordChgGb) ? "" : ordChgGb.toUpperCase()); // 주문변경요쳥변경정보
|
|
|
|
|
mav.addObject("chgOrdDtlStat" , chgOrdDtlStat); // 교환상품상세상태
|
|
mav.addObject("chgOrdDtlStat" , chgOrdDtlStat); // 교환상품상세상태
|
|
|
|
|
+ mav.addObject("wdGb" , wdGb); // 회수방법
|
|
|
mav.addObject("recallExceptionInfo" , coreOrderChangeService.getRecallExceptionInfo(order)); // 회수 예외 정보
|
|
mav.addObject("recallExceptionInfo" , coreOrderChangeService.getRecallExceptionInfo(order)); // 회수 예외 정보
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -850,6 +859,7 @@ public class TsaOrderChangeController extends TsaBaseController {
|
|
|
mav.addObject("TelExcNoList" , rendererService.getAvailCommonCodeList("G095")); // 전화번호국번
|
|
mav.addObject("TelExcNoList" , rendererService.getAvailCommonCodeList("G095")); // 전화번호국번
|
|
|
mav.addObject("PhnExcNoList" , rendererService.getAvailCommonCodeList("G096")); // (휴대전화)번호국번
|
|
mav.addObject("PhnExcNoList" , rendererService.getAvailCommonCodeList("G096")); // (휴대전화)번호국번
|
|
|
mav.addObject("chgStat" , chgStat); // 변경상태
|
|
mav.addObject("chgStat" , chgStat); // 변경상태
|
|
|
|
|
+ mav.addObject("ordChgGb" , StringUtils.isBlank(ordChgGb) ? "" : ordChgGb.toUpperCase()); // 주문변경요쳥변경정보
|
|
|
|
|
|
|
|
mav.setViewName("order/ExchangeRequestForm");
|
|
mav.setViewName("order/ExchangeRequestForm");
|
|
|
|
|
|