|
|
@@ -3,12 +3,8 @@ package com.style24.admin.biz.service;
|
|
|
import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collection;
|
|
|
-import java.util.Iterator;
|
|
|
-import java.util.List;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.apache.ibatis.session.SqlSession;
|
|
|
-import org.mybatis.spring.SqlSessionTemplate;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.env.Environment;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -20,6 +16,10 @@ import com.gagaframework.web.util.GagaFileUtil;
|
|
|
import com.gagaframework.web.util.GagaStringUtil;
|
|
|
import com.style24.admin.biz.dao.TsaPlanDao;
|
|
|
import com.style24.admin.support.security.session.TsaSession;
|
|
|
+import com.style24.persistence.domain.Goods;
|
|
|
+import com.style24.persistence.domain.MktmailManagement;
|
|
|
+import com.style24.persistence.domain.MktmailManagementGoods;
|
|
|
+import com.style24.persistence.domain.MktmailManagementTc;
|
|
|
import com.style24.persistence.domain.Plan;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -110,16 +110,6 @@ public class TsaPlanService {
|
|
|
|
|
|
log.debug("planSq : {}", param.getPlanSq());
|
|
|
|
|
|
- // 웹용 소스
|
|
|
-// if (StringUtils.isNotBlank(param.getFsrcPc())) {
|
|
|
-// createPlanFsrcPc(param);
|
|
|
-// }
|
|
|
-//
|
|
|
-// // 모바일용 소스
|
|
|
-// if (StringUtils.isNotBlank(param.getFsrcMobile())) {
|
|
|
-// createPlanFsrcMobile(param);
|
|
|
-// }
|
|
|
-
|
|
|
//기획전 응모이벤트
|
|
|
// if (StringUtils.isNotBlank(param.getPrivacyPolicy())) {
|
|
|
// int i = 0;
|
|
|
@@ -137,109 +127,7 @@ public class TsaPlanService {
|
|
|
// }
|
|
|
|
|
|
}
|
|
|
- /*
|
|
|
- * 기획전 웹용 소스 등록
|
|
|
- */
|
|
|
- @Transactional("shopTxnManager")
|
|
|
- public Plan createPlanFsrcPc(Plan param) {
|
|
|
- int fsrcPcTotalCnt = param.getFsrcPc().toCharArray().length;
|
|
|
- int byteCnt = 1500;
|
|
|
-
|
|
|
- // 기존 소스 삭제
|
|
|
- param.setFrontGb("P");
|
|
|
- //planDao.deletePlanFsrcInfo(param);
|
|
|
- if (fsrcPcTotalCnt > byteCnt) { // 4000 바이트 이상 일 때 파싱.
|
|
|
- StringBuilder sbStr = new StringBuilder(4000);
|
|
|
-
|
|
|
- int cnt = 0;
|
|
|
- int getCnt = 0;
|
|
|
- int tempCnt = 1500;
|
|
|
-
|
|
|
- for (char ch : param.getFsrcPc().toCharArray()) {
|
|
|
- getCnt++;
|
|
|
- sbStr.append(ch);
|
|
|
-
|
|
|
- if (getCnt == tempCnt || getCnt == fsrcPcTotalCnt) {
|
|
|
- Plan planPc = new Plan();
|
|
|
- planPc.setPlanSq(param.getPlanSq());
|
|
|
- planPc.setFrontGb("P");
|
|
|
- planPc.setSeq(cnt + 1);
|
|
|
- planPc.setRegNo(param.getRegNo());
|
|
|
- planPc.setFsrc(sbStr.toString());
|
|
|
-
|
|
|
- // 초기화
|
|
|
- sbStr.delete(0, tempCnt);
|
|
|
- cnt++;
|
|
|
- tempCnt += byteCnt;
|
|
|
-
|
|
|
- planDao.savePlanFsrcInfo(planPc);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- } else {
|
|
|
- Plan planPc = new Plan();
|
|
|
- planPc.setPlanSq(param.getPlanSq());
|
|
|
- planPc.setFrontGb("P");
|
|
|
- planPc.setSeq(1);
|
|
|
- planPc.setRegNo(param.getRegNo());
|
|
|
- planPc.setFsrc(param.getFsrcPc());
|
|
|
-
|
|
|
- planDao.savePlanFsrcInfo(planPc);
|
|
|
- }
|
|
|
- return param;
|
|
|
- }
|
|
|
-
|
|
|
- /*
|
|
|
- * 기획전 모바일 소스 등록
|
|
|
- */
|
|
|
- @Transactional("shopTxnManager")
|
|
|
- public Plan createPlanFsrcMobile(Plan param) {
|
|
|
- int fsrcMobileTotalCnt = param.getFsrcMobile().toCharArray().length;
|
|
|
- int byteCnt = 1500;
|
|
|
-
|
|
|
- // 기존 소스 삭제
|
|
|
- param.setFrontGb("M");
|
|
|
- //planDao.deletePlanFsrcInfo(param);
|
|
|
- if (fsrcMobileTotalCnt > byteCnt) { // 4000 바이트 이상 일 때 파싱.
|
|
|
- StringBuilder sbStr = new StringBuilder(4000);
|
|
|
-
|
|
|
- int cnt = 0;
|
|
|
- int getCnt = 0;
|
|
|
- int tempCnt = 1500;
|
|
|
-
|
|
|
- for (char ch : param.getFsrcMobile().toCharArray()) {
|
|
|
- getCnt++;
|
|
|
- sbStr.append(ch);
|
|
|
-
|
|
|
- if (getCnt == tempCnt || getCnt == fsrcMobileTotalCnt) {
|
|
|
- Plan planMobile = new Plan();
|
|
|
- planMobile.setPlanSq(param.getPlanSq());
|
|
|
- planMobile.setFrontGb("M");
|
|
|
- planMobile.setSeq(++cnt);
|
|
|
- planMobile.setRegNo(param.getRegNo());
|
|
|
- planMobile.setFsrc(sbStr.toString());
|
|
|
-
|
|
|
- // 초기화
|
|
|
- sbStr.delete(0, tempCnt);
|
|
|
- // cnt++;
|
|
|
- tempCnt += byteCnt;
|
|
|
-
|
|
|
- planDao.savePlanFsrcInfo(planMobile);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- Plan planMobile = new Plan();
|
|
|
- planMobile.setPlanSq(param.getPlanSq());
|
|
|
- planMobile.setFrontGb("M");
|
|
|
- planMobile.setSeq(1);
|
|
|
- planMobile.setRegNo(param.getRegNo());
|
|
|
- planMobile.setFsrc(param.getFsrcMobile());
|
|
|
|
|
|
- planDao.savePlanFsrcInfo(planMobile);
|
|
|
- }
|
|
|
- return param;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 기획전 목록
|
|
|
*
|
|
|
@@ -432,22 +320,6 @@ public class TsaPlanService {
|
|
|
// 최종업데이트
|
|
|
planDao.updatePlanInfo(param);
|
|
|
|
|
|
- // 웹용 소스
|
|
|
-// if (StringUtils.isNotBlank(param.getFsrcPc())) {
|
|
|
-// createPlanFsrcPc(param);
|
|
|
-// } else {
|
|
|
-// param.setFrontGb("P");
|
|
|
-// planDao.deletePlanFsrcInfo(param);
|
|
|
-// }
|
|
|
-//
|
|
|
-// // 모바일용 소스
|
|
|
-// if (StringUtils.isNotBlank(param.getFsrcMobile())) {
|
|
|
-// createPlanFsrcMobile(param);
|
|
|
-// } else {
|
|
|
-// param.setFrontGb("M");
|
|
|
-// planDao.deletePlanFsrcInfo(param);
|
|
|
-// }
|
|
|
-
|
|
|
//기획전 응모이벤트
|
|
|
// if (StringUtils.isNotBlank(param.getPrivacyPolicy())) {
|
|
|
// int i = 0;
|
|
|
@@ -504,35 +376,6 @@ public class TsaPlanService {
|
|
|
planDao.createPlanCateCopy(plan);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- // 02. 기획전 코너 목록 조회
|
|
|
-// Plan serchCorner = new Plan();
|
|
|
-// serchCorner.setPlanSq(param.getCopyPlanSq());
|
|
|
-// Collection<TsaPlan> cornerList = marketingDao.getPlanCornerList(serchCorner);
|
|
|
-//
|
|
|
-// for (TsaPlan cornerInfo : cornerList) {
|
|
|
-// // 03. 기획전 코너 복사
|
|
|
-// TsaPlan copyCorner = new TsaPlan();
|
|
|
-// copyCorner.setPlanSq(plan.getPlanSq());
|
|
|
-// copyCorner.setCopyPlanDtlSq(cornerInfo.getPlanDtlSq());
|
|
|
-// copyCorner.setRegId(userId);
|
|
|
-// copyCorner.setUpdId(userId);
|
|
|
-// marketingDao.createPlanCornerCopy(copyCorner);
|
|
|
-// plan.setPlanDtlSq(copyCorner.getPlanDtlSq());
|
|
|
-//
|
|
|
-// // 04. 상품 조회
|
|
|
-// TsaPlan searchGoods = new TsaPlan();
|
|
|
-// searchGoods.setPlanDtlSq(cornerInfo.getPlanDtlSq());
|
|
|
-// Collection<TsaPlan> goodsList = marketingDao.getPlanGoodsList(searchGoods);
|
|
|
-//
|
|
|
-// // 05. 상품 복사
|
|
|
-// for (TsaPlan goodsInfo : goodsList) {
|
|
|
-// goodsInfo.setPlanDtlSq(plan.getPlanDtlSq());
|
|
|
-// goodsInfo.setRegId(userId);
|
|
|
-// goodsInfo.setUpdId(userId);
|
|
|
-// marketingDao.createPlanGoodsCopy(goodsInfo);
|
|
|
-// }
|
|
|
-// }
|
|
|
|
|
|
return plan;
|
|
|
}
|
|
|
@@ -860,44 +703,327 @@ public class TsaPlanService {
|
|
|
*/
|
|
|
public void createPlanContents(Plan param) {
|
|
|
Integer regNo = TsaSession.getInfo().getUserNo();
|
|
|
- // 리뷰 등록
|
|
|
- Plan rePlan = new Plan();
|
|
|
- System.out.println("====="+param.getReTitle());
|
|
|
- System.out.println("====="+param.getReDispYn());
|
|
|
- System.out.println("====="+param.getMultiPlanReview().length);
|
|
|
- //리뷰 등록 - tb_plan_contents
|
|
|
- if(!param.getReTitle().equals(null) || param.getMultiPlanReview().length>0) {
|
|
|
- rePlan.setRegNo(regNo);
|
|
|
- rePlan.setUpdNo(regNo);
|
|
|
- rePlan.setTmplType("G082_20");
|
|
|
- rePlan.setPlanSq(param.getPlanSq());
|
|
|
- rePlan.setTitle(param.getReTitle());
|
|
|
- rePlan.setDispYn(param.getReDispYn());
|
|
|
- rePlan.setDispOrd(param.getReDispOrd());
|
|
|
- planDao.createPlanContents(rePlan);
|
|
|
-
|
|
|
- //리뷰 아이템 등록
|
|
|
- if(param.getMultiPlanReview().length>0) {
|
|
|
- String[] reItemVal = param.getMultiPlanReview();
|
|
|
- String[] startDate = param.getMultiPlanReviewStartD();
|
|
|
- String[] startTime = param.getMultiPlanReviewStartT();
|
|
|
- String[] endDate = param.getMultiPlanReviewEndD();
|
|
|
- String[] endTime = param.getMultiPlanReviewEndT();
|
|
|
- // 기획전 브랜드 insert
|
|
|
- for (int j = 0; j < reItemVal.length; j++) {
|
|
|
- rePlan.setItemVal(reItemVal[j]);
|
|
|
- rePlan.setReviewDispStdt(startDate[j] + ' ' +startTime[j]);
|
|
|
- rePlan.setReviewDispEddt(endDate[j] + ' ' +endTime[j]);
|
|
|
+
|
|
|
+ param.setRegNo(regNo);
|
|
|
+
|
|
|
+ if (param.getMode().equals("C")) {
|
|
|
+ // 리뷰 등록
|
|
|
+ Plan rePlan = new Plan();
|
|
|
+ //리뷰 등록 - tb_plan_contents
|
|
|
+ if(param.getReTitle() != "" || param.getMultiPlanReview().length>0) {
|
|
|
+ rePlan.setRegNo(regNo);
|
|
|
+ rePlan.setUpdNo(regNo);
|
|
|
+ rePlan.setTmplType("G082_10");
|
|
|
+ rePlan.setPlanSq(param.getPlanSq());
|
|
|
+ rePlan.setTitle(param.getReTitle());
|
|
|
+ rePlan.setDispYn(param.getReDispYn());
|
|
|
+ rePlan.setDispOrd(param.getReDispOrd());
|
|
|
+ planDao.createPlanContents(rePlan);
|
|
|
+
|
|
|
+ //리뷰 아이템 등록
|
|
|
+ if(param.getMultiPlanReview().length>0) {
|
|
|
+ String[] reItemVal = param.getMultiPlanReview();
|
|
|
+ String[] startDate = param.getMultiPlanReviewStartD();
|
|
|
+ String[] startTime = param.getMultiPlanReviewStartT();
|
|
|
+ String[] endDate = param.getMultiPlanReviewEndD();
|
|
|
+ String[] endTime = param.getMultiPlanReviewEndT();
|
|
|
+ // 기획전 브랜드 insert
|
|
|
+ for (int j = 0; j < reItemVal.length; j++) {
|
|
|
+ rePlan.setItemVal(reItemVal[j]);
|
|
|
+ rePlan.setReviewDispStdt(startDate[j] + ' ' +startTime[j]);
|
|
|
+ rePlan.setReviewDispEddt(endDate[j] + ' ' +endTime[j]);
|
|
|
+ planDao.createPlanContentsItem(rePlan);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 쿠폰등록
|
|
|
+ Plan cuPlan = new Plan();
|
|
|
+ //쿠폰 등록 - tb_plan_contents
|
|
|
+ if(param.getCuTitle() != "" || param.getMultiPlanCoupon().length>0) {
|
|
|
+ cuPlan.setRegNo(regNo);
|
|
|
+ cuPlan.setUpdNo(regNo);
|
|
|
+ cuPlan.setTmplType("G082_20");
|
|
|
+ cuPlan.setPlanSq(param.getPlanSq());
|
|
|
+ cuPlan.setTitle(param.getCuTitle());
|
|
|
+ cuPlan.setDispYn(param.getCuDispYn());
|
|
|
+ cuPlan.setDispOrd(param.getCuDispOrd());
|
|
|
+ planDao.createPlanContents(cuPlan);
|
|
|
+
|
|
|
+ //쿠폰아이템 등록
|
|
|
+ if(param.getMultiPlanCoupon().length>0) {
|
|
|
+ String[] cuItemVal = param.getMultiPlanCoupon();
|
|
|
+
|
|
|
+ // 기획전 브랜드 insert
|
|
|
+ for (int j = 0; j < cuItemVal.length; j++) {
|
|
|
+ cuPlan.setItemVal(cuItemVal[j]);
|
|
|
+ planDao.createPlanContentsItem(cuPlan);
|
|
|
+ }
|
|
|
}
|
|
|
- planDao.createPlanContentsItem(rePlan);
|
|
|
}
|
|
|
+
|
|
|
+ //이미지등록
|
|
|
+ Plan filePlan = new Plan();
|
|
|
+ if(param.getMultiPlanFile().length>0) {
|
|
|
+ filePlan.setRegNo(regNo);
|
|
|
+ filePlan.setUpdNo(regNo);
|
|
|
+ filePlan.setTmplType("G082_30");
|
|
|
+ filePlan.setPlanSq(param.getPlanSq());
|
|
|
+ filePlan.setDispYn(param.getFileDispYn());
|
|
|
+ filePlan.setDispOrd(param.getFileDispOrd());
|
|
|
+ planDao.createPlanContents(filePlan);
|
|
|
+
|
|
|
+ //파일아이템 등록
|
|
|
+ if(param.getMultiPlanFile().length>0) {
|
|
|
+ String[] fileItemVal = param.getMultiPlanFile();
|
|
|
+
|
|
|
+ // 기획전 브랜드 insert
|
|
|
+ for (int j = 0; j < fileItemVal.length; j++) {
|
|
|
+ filePlan.setItemVal(fileItemVal[j]);
|
|
|
+ planDao.createPlanContentsItem(filePlan);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //HTML[상단] 등록
|
|
|
+ Plan fsrcTop = new Plan();
|
|
|
+ if(param.getFsrcMobileTop() != "" || param.getFsrcPcTop() != "") {
|
|
|
+ //tb_plan_contents 등록
|
|
|
+ fsrcTop.setRegNo(regNo);
|
|
|
+ fsrcTop.setUpdNo(regNo);
|
|
|
+ fsrcTop.setTmplType("G082_40");
|
|
|
+ fsrcTop.setPlanSq(param.getPlanSq());
|
|
|
+ fsrcTop.setDispYn(param.getTopFsrcDispYn());
|
|
|
+ fsrcTop.setDispOrd(param.getTopFsrcDispOrd());
|
|
|
+
|
|
|
+ planDao.createPlanContents(fsrcTop);
|
|
|
+
|
|
|
+ // 웹용 상단PC 등록
|
|
|
+ if (StringUtils.isNotBlank(param.getFsrcPcTop())) {
|
|
|
+ createPlanFsrcPcTop(param);
|
|
|
+ }
|
|
|
+ // 웹용 상단MOBILE 등록
|
|
|
+ if (StringUtils.isNotBlank(param.getFsrcMobileTop())) {
|
|
|
+ createPlanFsrcMobileTop(param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //HTML[하단] 등록
|
|
|
+ Plan fsrcBtm = new Plan();
|
|
|
+ if(param.getFsrcMobileBtm() != "" || param.getFsrcPcBtm() != "") {
|
|
|
+ //tb_plan_contents 등록
|
|
|
+ fsrcBtm.setRegNo(regNo);
|
|
|
+ fsrcBtm.setUpdNo(regNo);
|
|
|
+ fsrcBtm.setTmplType("G082_41");
|
|
|
+ fsrcBtm.setPlanSq(param.getPlanSq());
|
|
|
+ fsrcBtm.setDispYn(param.getBtmFsrcDispYn());
|
|
|
+ fsrcBtm.setDispOrd(param.getBtmFsrcDispOrd());
|
|
|
+
|
|
|
+ planDao.createPlanContents(fsrcBtm);
|
|
|
+
|
|
|
+ // 웹용 상단PC 등록
|
|
|
+ if (StringUtils.isNotBlank(param.getFsrcPcBtm())) {
|
|
|
+ createPlanFsrcPcBtm(param);
|
|
|
+ }
|
|
|
+ // 웹용 상단MOBILE 등록
|
|
|
+ if (StringUtils.isNotBlank(param.getFsrcMobileBtm())) {
|
|
|
+ createPlanFsrcMobileBtm(param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //상품 등록
|
|
|
+
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 기획전 템플릿 HTML[상단] PC 소스 등록
|
|
|
+ */
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
+ public Plan createPlanFsrcPcTop(Plan param) {
|
|
|
+ Plan fsrcTop = new Plan();
|
|
|
+ int fsrcPcTotalCnt = param.getFsrcPcTop().toCharArray().length;
|
|
|
+ int byteCnt = 1500;
|
|
|
|
|
|
- // 쿠폰등록
|
|
|
|
|
|
+ fsrcTop.setFrontGb("P");
|
|
|
+ fsrcTop.setRegNo(param.getRegNo());
|
|
|
+ fsrcTop.setPlanSq(param.getPlanSq());
|
|
|
|
|
|
+ if (fsrcPcTotalCnt > byteCnt) { // 4000 바이트 이상 일 때 파싱.
|
|
|
+ StringBuilder sbStr = new StringBuilder(4000);
|
|
|
+
|
|
|
+ int cnt = 0;
|
|
|
+ int getCnt = 0;
|
|
|
+ int tempCnt = 1500;
|
|
|
+
|
|
|
+ for (char ch : param.getFsrcPcTop().toCharArray()) {
|
|
|
+ getCnt++;
|
|
|
+ sbStr.append(ch);
|
|
|
+
|
|
|
+ if (getCnt == tempCnt || getCnt == fsrcPcTotalCnt) {
|
|
|
+ fsrcTop.setSeq(cnt + 1);
|
|
|
+ fsrcTop.setFsrcTop(sbStr.toString());
|
|
|
+
|
|
|
+ // 초기화
|
|
|
+ sbStr.delete(0, tempCnt);
|
|
|
+ cnt++;
|
|
|
+ tempCnt += byteCnt;
|
|
|
+
|
|
|
+ planDao.savePlanFsrcInfo(fsrcTop);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ fsrcTop.setSeq(1);
|
|
|
+ fsrcTop.setFsrcTop(param.getFsrcPcTop());
|
|
|
+
|
|
|
+ planDao.savePlanFsrcInfo(fsrcTop);
|
|
|
+ }
|
|
|
+ return param;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 기획전 템플릿 HTML[상단] mobile 소스 등록
|
|
|
+ */
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
+ public Plan createPlanFsrcMobileTop(Plan param) {
|
|
|
+ Plan fsrcMobile = new Plan();
|
|
|
+
|
|
|
+ int fsrcMobileTotalCnt = param.getFsrcMobileTop().toCharArray().length;
|
|
|
+ int byteCnt = 1500;
|
|
|
+
|
|
|
+ fsrcMobile.setFrontGb("M");
|
|
|
+ fsrcMobile.setRegNo(param.getRegNo());
|
|
|
+ fsrcMobile.setPlanSq(param.getPlanSq());
|
|
|
+
|
|
|
+ if (fsrcMobileTotalCnt > byteCnt) { // 4000 바이트 이상 일 때 파싱.
|
|
|
+ StringBuilder sbStr = new StringBuilder(4000);
|
|
|
+
|
|
|
+ int cnt = 0;
|
|
|
+ int getCnt = 0;
|
|
|
+ int tempCnt = 1500;
|
|
|
+
|
|
|
+ for (char ch : param.getFsrcMobileTop().toCharArray()) {
|
|
|
+ getCnt++;
|
|
|
+ sbStr.append(ch);
|
|
|
+
|
|
|
+ if (getCnt == tempCnt || getCnt == fsrcMobileTotalCnt) {
|
|
|
+
|
|
|
+ fsrcMobile.setSeq(cnt+1);
|
|
|
+ fsrcMobile.setFsrcTop(sbStr.toString());
|
|
|
+
|
|
|
+ // 초기화
|
|
|
+ sbStr.delete(0, tempCnt);
|
|
|
+ cnt++;
|
|
|
+ tempCnt += byteCnt;
|
|
|
+
|
|
|
+ planDao.savePlanFsrcInfo(fsrcMobile);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ fsrcMobile.setSeq(1);
|
|
|
+ fsrcMobile.setFsrcTop(param.getFsrcMobileTop());
|
|
|
+ planDao.savePlanFsrcInfo(fsrcMobile);
|
|
|
+ }
|
|
|
+ return param;
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ * 기획전 템플릿 HTML[하단] PC 소스 등록
|
|
|
+ */
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
+ public Plan createPlanFsrcPcBtm(Plan param) {
|
|
|
+ Plan fsrcBtm = new Plan();
|
|
|
+ int fsrcPcTotalCnt = param.getFsrcPcBtm().toCharArray().length;
|
|
|
+ int byteCnt = 1500;
|
|
|
+
|
|
|
+
|
|
|
+ fsrcBtm.setFrontGb("P");
|
|
|
+ fsrcBtm.setRegNo(param.getRegNo());
|
|
|
+ fsrcBtm.setPlanSq(param.getPlanSq());
|
|
|
+
|
|
|
+ if (fsrcPcTotalCnt > byteCnt) { // 4000 바이트 이상 일 때 파싱.
|
|
|
+ StringBuilder sbStr = new StringBuilder(4000);
|
|
|
+
|
|
|
+ int cnt = 0;
|
|
|
+ int getCnt = 0;
|
|
|
+ int tempCnt = 1500;
|
|
|
+
|
|
|
+ for (char ch : param.getFsrcPcBtm().toCharArray()) {
|
|
|
+ getCnt++;
|
|
|
+ sbStr.append(ch);
|
|
|
+
|
|
|
+ if (getCnt == tempCnt || getCnt == fsrcPcTotalCnt) {
|
|
|
+ fsrcBtm.setSeq(cnt + 1);
|
|
|
+ fsrcBtm.setFsrcBtm(sbStr.toString());
|
|
|
+
|
|
|
+ // 초기화
|
|
|
+ sbStr.delete(0, tempCnt);
|
|
|
+ cnt++;
|
|
|
+ tempCnt += byteCnt;
|
|
|
+
|
|
|
+ planDao.savePlanFsrcInfo(fsrcBtm);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ fsrcBtm.setSeq(1);
|
|
|
+ fsrcBtm.setFsrcBtm(param.getFsrcPcBtm());
|
|
|
+
|
|
|
+ planDao.savePlanFsrcInfo(fsrcBtm);
|
|
|
+ }
|
|
|
+ return param;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 기획전 템플릿 HTML[하단] mobile 소스 등록
|
|
|
+ */
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
+ public Plan createPlanFsrcMobileBtm(Plan param) {
|
|
|
+ Plan fsrcMobile = new Plan();
|
|
|
+
|
|
|
+ int fsrcMobileTotalCnt = param.getFsrcMobileBtm().toCharArray().length;
|
|
|
+ int byteCnt = 1500;
|
|
|
+
|
|
|
+ fsrcMobile.setFrontGb("M");
|
|
|
+ fsrcMobile.setRegNo(param.getRegNo());
|
|
|
+ fsrcMobile.setPlanSq(param.getPlanSq());
|
|
|
+
|
|
|
+ if (fsrcMobileTotalCnt > byteCnt) { // 4000 바이트 이상 일 때 파싱.
|
|
|
+ StringBuilder sbStr = new StringBuilder(4000);
|
|
|
+
|
|
|
+ int cnt = 0;
|
|
|
+ int getCnt = 0;
|
|
|
+ int tempCnt = 1500;
|
|
|
+
|
|
|
+ for (char ch : param.getFsrcMobileBtm().toCharArray()) {
|
|
|
+ getCnt++;
|
|
|
+ sbStr.append(ch);
|
|
|
+
|
|
|
+ if (getCnt == tempCnt || getCnt == fsrcMobileTotalCnt) {
|
|
|
+
|
|
|
+ fsrcMobile.setSeq(cnt+1);
|
|
|
+ fsrcMobile.setFsrcBtm(sbStr.toString());
|
|
|
+
|
|
|
+ // 초기화
|
|
|
+ sbStr.delete(0, tempCnt);
|
|
|
+ cnt++;
|
|
|
+ tempCnt += byteCnt;
|
|
|
+
|
|
|
+ planDao.savePlanFsrcInfo(fsrcMobile);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ fsrcMobile.setSeq(1);
|
|
|
+ fsrcMobile.setFsrcBtm(param.getFsrcMobileBtm());
|
|
|
+ planDao.savePlanFsrcInfo(fsrcMobile);
|
|
|
+ }
|
|
|
+ return param;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 기획전 템플릿 목록 카운트 조회
|
|
|
* @param param
|
|
|
@@ -921,4 +1047,6 @@ public class TsaPlanService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
}
|