|
|
@@ -2,6 +2,7 @@ package com.style24.admin.biz.web;
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
@@ -14,6 +15,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
import com.gagaframework.web.rest.server.GagaResponse;
|
|
|
import com.style24.admin.biz.service.TsaDeliveryService;
|
|
|
+import com.style24.admin.biz.service.TsaOcmService;
|
|
|
import com.style24.admin.biz.service.TsaRendererService;
|
|
|
import com.style24.admin.biz.service.TsaWithdrawService;
|
|
|
import com.style24.admin.biz.service.TsaWmsWithdrawService;
|
|
|
@@ -21,9 +23,11 @@ import com.style24.admin.support.controller.TsaBaseController;
|
|
|
import com.style24.admin.support.security.session.TsaSession;
|
|
|
import com.style24.core.biz.service.TscKakaotalkService;
|
|
|
import com.style24.core.biz.service.TscOrderChangeService;
|
|
|
+import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.core.support.message.TscMessageByLocale;
|
|
|
import com.style24.core.support.session.TscSession;
|
|
|
import com.style24.persistence.TscPageRequest;
|
|
|
+import com.style24.persistence.domain.Extmall;
|
|
|
import com.style24.persistence.domain.Order;
|
|
|
import com.style24.persistence.domain.OrderChange;
|
|
|
import com.style24.persistence.domain.Withdraw;
|
|
|
@@ -65,6 +69,9 @@ public class TsaWithdrawController extends TsaBaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private TscKakaotalkService kakaotalkService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TsaOcmService ocmService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -235,6 +242,16 @@ public class TsaWithdrawController extends TsaBaseController {
|
|
|
public ModelAndView withdrawExceptionListForm() throws Exception {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
mav.addObject("reasonCodeList", rendererService.getAvailCommonCodeList("G325"));
|
|
|
+
|
|
|
+ // 2021.10.06 제휴몰 검색기능 추가
|
|
|
+ // 제휴몰벤더
|
|
|
+ mav.addObject("vendorList", rendererService.getCommonCodeList("G003", "Y", TsaSession.getInfo().getSupplyCompCd()));
|
|
|
+
|
|
|
+ // 제휴몰
|
|
|
+ Extmall extmall = new Extmall();
|
|
|
+ extmall.setVendorId(TscConstants.VendorId.SHOPLINKER.value()); // 샵링커
|
|
|
+ mav.addObject("extmallList", ocmService.getExtmallList(extmall));
|
|
|
+
|
|
|
mav.setViewName("/withdraw/WithdrawExceptionListForm");
|
|
|
|
|
|
return mav;
|
|
|
@@ -254,6 +271,45 @@ public class TsaWithdrawController extends TsaBaseController {
|
|
|
public GagaMap getWithdrawExceptionList(@RequestBody WithdrawExc withdrawExc) throws Exception {
|
|
|
|
|
|
GagaMap result = new GagaMap();
|
|
|
+
|
|
|
+ // 2021.10.06 샾링커 관련 주문번호
|
|
|
+ if (!StringUtils.isBlank(withdrawExc.getCondition()) || !StringUtils.isBlank(withdrawExc.getExtmallId())) {
|
|
|
+ if (StringUtils.isBlank(withdrawExc.getCondition())) {
|
|
|
+ withdrawExc.setSearch("");
|
|
|
+ } else {
|
|
|
+ withdrawExc.setConditions(withdrawExc.getCondition().replaceAll("\r", "").trim().split("\n"));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 데이타변환
|
|
|
+ WmsWithdraw wmsWithdraw = new WmsWithdraw();
|
|
|
+ wmsWithdraw.setExtmallId(withdrawExc.getExtmallId());
|
|
|
+ wmsWithdraw.setSearch(withdrawExc.getSearch());
|
|
|
+ wmsWithdraw.setConditions(withdrawExc.getConditions());
|
|
|
+ wmsWithdraw.setStDate(withdrawExc.getStDate());
|
|
|
+ wmsWithdraw.setEdDate(withdrawExc.getEdDate());
|
|
|
+
|
|
|
+ // 외부몰 주문번호 조회
|
|
|
+ Collection<WmsWithdraw> widthdrawExtmallList = deliveryService.getWithdrawExtmallList(wmsWithdraw);
|
|
|
+
|
|
|
+ if (widthdrawExtmallList != null && widthdrawExtmallList.size() > 0) {
|
|
|
+ int [] ordNoList = new int[widthdrawExtmallList.size()];
|
|
|
+ int idx = 0;
|
|
|
+ for (WmsWithdraw vo : widthdrawExtmallList) {
|
|
|
+ ordNoList[idx] = vo.getOrdNo();
|
|
|
+ idx++;
|
|
|
+ }
|
|
|
+ withdrawExc.setOrdNoList(ordNoList);
|
|
|
+ } else {
|
|
|
+ int [] ordNoList = new int[1];
|
|
|
+ ordNoList[0] = 123;
|
|
|
+ withdrawExc.setOrdNoList(ordNoList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (withdrawExc.getOrdNoList() != null) {
|
|
|
+ log.info("withdrawExc.getOrdNoList()[0] ::: {}", withdrawExc.getOrdNoList()[0]);
|
|
|
+ }
|
|
|
+
|
|
|
withdrawExc.setPageable(new TscPageRequest(withdrawExc.getPageNo() - 1, withdrawExc.getPageSize()));
|
|
|
withdrawExc.getPageable().setTotalCount(withdrawService.getWithdrawExceptionListCount(withdrawExc));
|
|
|
TscSession.setAttribute("maskingYn", TsaSession.getInfo().getMaskingYn());
|
|
|
@@ -360,6 +416,15 @@ public class TsaWithdrawController extends TsaBaseController {
|
|
|
@ResponseBody
|
|
|
public ModelAndView wmsWithdrawListForm() throws Exception {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
+
|
|
|
+ // 2021.10.06 제휴몰 검색기능 추가
|
|
|
+ // 제휴몰벤더
|
|
|
+ mav.addObject("vendorList", rendererService.getCommonCodeList("G003", "Y", TsaSession.getInfo().getSupplyCompCd()));
|
|
|
+
|
|
|
+ // 제휴몰
|
|
|
+ Extmall extmall = new Extmall();
|
|
|
+ extmall.setVendorId(TscConstants.VendorId.SHOPLINKER.value()); // 샵링커
|
|
|
+ mav.addObject("extmallList", ocmService.getExtmallList(extmall));
|
|
|
mav.setViewName("/withdraw/WmsWithdrawListForm");
|
|
|
|
|
|
return mav;
|
|
|
@@ -379,6 +444,30 @@ public class TsaWithdrawController extends TsaBaseController {
|
|
|
public GagaMap getWmsWithdrawList(@RequestBody WmsWithdraw wmsWithdraw) throws Exception {
|
|
|
|
|
|
GagaMap result = new GagaMap();
|
|
|
+
|
|
|
+ // 2021.10.06 샾링커 관련 주문번호
|
|
|
+ if (!StringUtils.isBlank(wmsWithdraw.getCondition()) || !StringUtils.isBlank(wmsWithdraw.getExtmallId())) {
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(wmsWithdraw.getCondition())) {
|
|
|
+ wmsWithdraw.setSearch("");
|
|
|
+ } else {
|
|
|
+ wmsWithdraw.setConditions(wmsWithdraw.getCondition().replaceAll("\r", "").trim().split("\n"));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 외부몰 주문번호 조회
|
|
|
+ Collection<WmsWithdraw> widthdrawExtmallList = deliveryService.getWithdrawExtmallList(wmsWithdraw);
|
|
|
+
|
|
|
+ if (widthdrawExtmallList != null && widthdrawExtmallList.size() > 0) {
|
|
|
+ int [] ordNoList = new int[widthdrawExtmallList.size()];
|
|
|
+ int idx = 0;
|
|
|
+ for (WmsWithdraw vo : widthdrawExtmallList) {
|
|
|
+ ordNoList[idx] = vo.getOrdNo();
|
|
|
+ idx++;
|
|
|
+ }
|
|
|
+ wmsWithdraw.setOrdNoList(ordNoList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
wmsWithdraw.setPageable(new TscPageRequest(wmsWithdraw.getPageNo() - 1, wmsWithdraw.getPageSize()));
|
|
|
wmsWithdraw.getPageable().setTotalCount(wmsWithdrawService.getWmsWithdrawListCount(wmsWithdraw));
|
|
|
TscSession.setAttribute("maskingYn", TsaSession.getInfo().getMaskingYn());
|
|
|
@@ -386,13 +475,13 @@ public class TsaWithdrawController extends TsaBaseController {
|
|
|
if ("N".equals(wmsWithdraw.getPageingYn())) {
|
|
|
wmsWithdraw.setPageable(null);
|
|
|
}
|
|
|
+
|
|
|
result.set("pageing", wmsWithdraw);
|
|
|
Collection<WmsWithdraw> wmsList = wmsWithdrawService.getWmsWithdrawList(wmsWithdraw);
|
|
|
|
|
|
wmsList = withdrawService.getOptionInfo(wmsList);
|
|
|
|
|
|
result.set("wmsWithdrawList", wmsList);
|
|
|
-
|
|
|
|
|
|
return result;
|
|
|
}
|