|
|
@@ -6,11 +6,15 @@ import java.util.List;
|
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+import com.gagaframework.web.util.GagaDateUtil;
|
|
|
+import com.gagaframework.web.util.GagaFileUtil;
|
|
|
import com.style24.persistence.TscPageRequest;
|
|
|
import com.style24.persistence.domain.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.env.Environment;
|
|
|
+import org.springframework.core.io.InputStreamResource;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
@@ -37,6 +41,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
import com.gagaframework.web.rest.server.GagaResponse;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+
|
|
|
/**
|
|
|
* 마케팅 Controller
|
|
|
* @author xodud1202
|
|
|
@@ -574,10 +580,50 @@ public class TsaMarketingController extends TsaBaseController {
|
|
|
* @author bin2107
|
|
|
* @since 2021. 1. 5
|
|
|
*/
|
|
|
-
|
|
|
@PostMapping("/morebetter/save")
|
|
|
@ResponseBody
|
|
|
- public GagaResponse saveMorebetterDetail(@RequestBody MoreBetter moreBetter){
|
|
|
+ public GagaMap saveMorebetterDetail(@RequestBody MoreBetter moreBetter){
|
|
|
+ String result = "";
|
|
|
+ GagaMap map = new GagaMap();
|
|
|
+
|
|
|
+ String[] multiSupplyCompCd = moreBetter.getSupplyCompArr().split(",");
|
|
|
+ String[] multiBrand = moreBetter.getBrandArr().split(",");
|
|
|
+ String[] multiGoods = moreBetter.getGoodsArr().split(",");
|
|
|
+
|
|
|
+ MoreBetterGoods moreBetterGoods = new MoreBetterGoods();
|
|
|
+
|
|
|
+ moreBetterGoods.setMultiSupplyCompCd(multiSupplyCompCd);
|
|
|
+ moreBetterGoods.setMultiBrand(multiBrand);
|
|
|
+ moreBetterGoods.setMultiGoods(multiGoods);
|
|
|
+ log.info("[1 saveMorebetterDetail moreBetterGoods]{}",moreBetterGoods);
|
|
|
+
|
|
|
+ // TMTB_GOODS_TEMP TABLE TRUNCATE -> 다른 다다에서 사용중인 상품 조회 -> INSERT
|
|
|
+ morebetterService.createMorebetterGoodsTemp(moreBetterGoods);
|
|
|
+ //log.info("[saveMorebetterDetail createMorebetterGoodsTemp a]{}");
|
|
|
+ // 다른 다다에서 사용중인 상품 조회
|
|
|
+ Collection<MoreBetterGoods> duplicateGoodsList = morebetterService.getMorebetterDuplicateList(moreBetterGoods);
|
|
|
+
|
|
|
+ log.info("[1 duplicateGoodsList size]{}",duplicateGoodsList.size());
|
|
|
+
|
|
|
+ // SELECT -> 지금 내가 선택한 업체&브랜드 + 적용상품에 해당하는 상품 조회 MINUS TMTB_GOODS_TEMP 상품
|
|
|
+ // 조회 건수 있으면 -> 해당 상품코드 엑셀로 던져주기
|
|
|
+ if(duplicateGoodsList.size() > 0){
|
|
|
+ map.set("duplicateYn","Y");
|
|
|
+ map.set("msg", result);
|
|
|
+ map.set("duplicateGoodsList",duplicateGoodsList);
|
|
|
+ }else{
|
|
|
+ // 조회 건수 없으면 -> 저장으로 넘어감
|
|
|
+ //morebetterService.saveMoreBetterDetail(moreBetter);
|
|
|
+ map.set("duplicateYn","N");
|
|
|
+ map.set("msg", message.getMessage("SUCC_0001"));
|
|
|
+ }
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/morebetter/save2")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaResponse saveMorebetterDetail2(@RequestBody MoreBetter moreBetter){
|
|
|
String[] multiSupplyCompCd = moreBetter.getSupplyCompArr().split(",");
|
|
|
String[] multiBrand = moreBetter.getBrandArr().split(",");
|
|
|
String[] multiGoods = moreBetter.getGoodsArr().split(",");
|