Bläddra i källkod

총알배송 자사브랜드 추가

sowon4187 4 år sedan
förälder
incheckning
88742c1032

+ 10 - 0
src/main/java/com/style24/admin/biz/dao/TsaPlanDao.java

@@ -624,4 +624,14 @@ public interface TsaPlanDao {
 	 * @since 2021. 06. 09
 	 */
 	Collection<Plan> getPlanAttendCoupon(Plan param);
+	
+	/**
+	 * 총알배송 자사브랜드 조회
+	 *
+	 * @param plan
+	 * @return
+	 * @author sowon
+	 * @since 2021. 06. 25
+	 */
+	Collection<Plan> getShotSelfBrandList();
 }

+ 25 - 181
src/main/java/com/style24/admin/biz/service/TsaPlanService.java

@@ -90,26 +90,7 @@ public class TsaPlanService {
 			param.setMainPimg("/planning/" + yearMonth + "/" + newFilename);
 			param.setMainMimg("/planning/" + yearMonth + "/" + newFilename);
 		}
-//		if(param.getMainMimg() != null && !"".equals(param.getMainMimg())){
-//			String imgInd = String.valueOf(ind);
-//			if (ind < 10) {
-//				imgInd = "0" + imgInd;
-//			}
-//			String planUploadPath = env.getProperty("upload.default.target.path");
-//			String yearMonth = GagaDateUtil.getToday().substring(0, 6);
-//			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
-//			File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, param.getMainMimg()));
-//			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
-//			String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(param.getMainMimg());
-//			File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
-//			// Rename a file
-//			File path = new File(planUploadPath);
-//			if (!path.exists()) {
-//				path.mkdir();
-//			}
-//			newFile.renameTo(uniqueFile);
-//			param.setMainMimg("/planning/" + yearMonth + "/" + newFilename);
-//		}
+
 		planDao.createPlanInfo(param);
 		
 		String[] brand = param.getMultiBrand();
@@ -168,24 +149,28 @@ public class TsaPlanService {
 			planDao.savePlanAttendBenefit(attendInfo);
 		}
 		
-
-		log.debug("planSq : {}", param.getPlanSq());
-
-		//기획전 응모이벤트
-//		if (StringUtils.isNotBlank(param.getPrivacyPolicy())) {
-//			int i = 0;
-//			for (String planQtitle : param.getPlanQtitle()) {
-//				PlanQuestAnswer planQuestAnswer = new PlanQuestAnswer();
-//				planQuestAnswer.setPlanSq(param.getPlanSq());
-//				planQuestAnswer.setPlanQtitle(planQtitle);
-//				planQuestAnswer.setAttachYn(param.getAttachYn()[i]);
-//				planQuestAnswer.setQuestNo(i);
-//				planQuestAnswer.setRegNo(param.getRegNo());
-//				planQuestAnswer.setUpdNo(param.getUpdNo());
-//				planDao.savePlanQuestion(planQuestAnswer);
-//				i++;
-//			}
-//		}
+		// 총알배송일떼 -- 코너에 자동으로 자사브랜드 insert
+		String planGb = param.getPlanGb();
+		if ("S".equals(planGb)) {
+			
+			Collection<Plan> brandList = planDao.getShotSelfBrandList();
+			int idx = 1;
+			for (Plan corner : brandList) {
+				// 5열 전시 default
+				corner.setRegNo(TsaSession.getInfo().getUserNo());
+				corner.setUpdNo(TsaSession.getInfo().getUserNo());
+				corner.setPlanSq(param.getPlanSq());
+				corner.setDispStdt(param.getDispStdt());
+				corner.setDispEddt(param.getDispEddt());
+				corner.setCornerDispType("G045_5");
+				corner.setDispOrd(idx);
+				corner.setCornerNm(corner.getBrandNm());
+				
+				planDao.savePlanCornerInfo(corner);
+				idx++;
+			}
+			
+		}
 
 	}
 
@@ -389,29 +374,7 @@ public class TsaPlanService {
 			}
 			
 		}
-//		if(param.getMainMimg() != null && !"".equals(param.getMainMimg())){
-//			String imgInd = String.valueOf(ind);
-//			if (ind < 10) {
-//				imgInd = "0" + imgInd;
-//			}
-//			if(!param.getMainMimg().contains("planning")) {
-//				String planUploadPath = env.getProperty("upload.default.target.path");
-//				String yearMonth = GagaDateUtil.getToday().substring(0, 6);
-//				planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
-//				File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, param.getMainMimg()));
-//				planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
-//				String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(param.getMainMimg());
-//				File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
-//				// Rename a file
-//				File path = new File(planUploadPath);
-//				if (!path.exists()) {
-//					path.mkdir();
-//				}
-//				newFile.renameTo(uniqueFile);
-//				param.setMainMimg("/planning/" + yearMonth + "/" + newFilename);
-//			}
-//			
-//		}
+
 		// 이벤트 출석체크
 		planDao.deletePlanAttendBenefitList(param);
 		
@@ -426,21 +389,6 @@ public class TsaPlanService {
 		// 최종업데이트 
 		planDao.updatePlanInfo(param);
 
-		//기획전 응모이벤트
-//		if (StringUtils.isNotBlank(param.getPrivacyPolicy())) {
-//			int i = 0;
-//			for (String planQtitle : param.getPlanQtitle()) {
-//				PlanQuestAnswer planQuestAnswer = new TsaPlanQuestAnswer();
-//				planQuestAnswer.setPlanSq(param.getPlanSq());
-//				planQuestAnswer.setPlanQtitle(planQtitle);
-//				planQuestAnswer.setAttachYn(param.getAttachYn()[i]);
-//				planQuestAnswer.setQuestNo(i);
-//				planQuestAnswer.setRegNo(param.getRegNo());
-//				planQuestAnswer.setUpdNo(param.getUpdNo());
-//				planDao.savePlanQuestion(planQuestAnswer);
-//				i++;
-//			}
-//		}
 	}
 	
 	/**
@@ -1568,10 +1516,6 @@ public class TsaPlanService {
 	@Transactional("shopTxnManager")
 	public Plan createPlanFsrcPcTop(Plan param) {
 		Plan fsrcTop = new Plan();
-		int fsrcPcTotalCnt = param.getFsrcPcTop().toCharArray().length;
-		int fsrcMobileTotalCnt = param.getFsrcMobileTop().toCharArray().length;
-		int byteCnt = 1500;
-		
 		
 		fsrcTop.setFrontGb("T");                 
 		fsrcTop.setRegNo(param.getRegNo());      
@@ -1582,54 +1526,6 @@ public class TsaPlanService {
 		fsrcTop.setFsrcMob(param.getFsrcMobileTop());
 		planDao.savePlanFsrcInfo(fsrcTop);
 		
-//		if (fsrcPcTotalCnt > byteCnt || fsrcMobileTotalCnt > 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.setFsrcPc(sbStr.toString());
-//
-//					// 초기화
-//					sbStr.delete(0, tempCnt);
-//					cnt++;
-//					tempCnt += byteCnt;
-//
-//					//planDao.savePlanFsrcInfo(fsrcTop);
-//				}
-//			}
-//		
-//			for (char ch : param.getFsrcMobileTop().toCharArray()) {
-//				getCnt++;
-//				sbStr.append(ch);
-//
-//				if (getCnt == tempCnt || getCnt == fsrcPcTotalCnt) {
-//					fsrcTop.setSeq(cnt + 1);
-//					fsrcTop.setFsrcMob(sbStr.toString());
-//
-//					// 초기화
-//					sbStr.delete(0, tempCnt);
-//					cnt++;
-//					tempCnt += byteCnt;
-//					
-//				}
-//			}		
-//			planDao.savePlanFsrcInfo(fsrcTop);
-//		} 
-//		else {
-//			fsrcTop.setSeq(1);
-//			fsrcTop.setFsrcPc(param.getFsrcPcTop());
-//			fsrcTop.setFsrcMob(param.getFsrcMobileTop());
-//
-//			planDao.savePlanFsrcInfo(fsrcTop);
-//		}
 		return param;
 	}
 
@@ -1640,10 +1536,6 @@ public class TsaPlanService {
 	@Transactional("shopTxnManager")
 	public Plan createPlanFsrcPcBtm(Plan param) {
 		Plan fsrcBtm = new Plan();
-		int fsrcPcTotalCnt = param.getFsrcPcBtm().toCharArray().length;
-		int fsrcMobileTotalCnt = param.getFsrcMobileBtm().toCharArray().length;
-		int byteCnt = 1500;
-		
 		
 		fsrcBtm.setFrontGb("B");                 
 		fsrcBtm.setRegNo(param.getRegNo());      
@@ -1652,55 +1544,7 @@ public class TsaPlanService {
 		fsrcBtm.setFsrcPc(param.getFsrcPcBtm());
 		fsrcBtm.setFsrcMob(param.getFsrcMobileBtm());
 		planDao.savePlanFsrcInfo(fsrcBtm);
-		
-//		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.setFsrcPc(sbStr.toString());
-//
-//					// 초기화
-//					sbStr.delete(0, tempCnt);
-//					cnt++;
-//					tempCnt += byteCnt;
-//
-//				}
-//
-//			}
-//			
-//			for (char ch : param.getFsrcMobileBtm().toCharArray()) {
-//				getCnt++;
-//				sbStr.append(ch);
-//
-//				if (getCnt == tempCnt || getCnt == fsrcPcTotalCnt) {
-//					fsrcBtm.setSeq(cnt + 1);
-//					fsrcBtm.setFsrcMob(sbStr.toString());
-//
-//					// 초기화
-//					sbStr.delete(0, tempCnt);
-//					cnt++;
-//					tempCnt += byteCnt;
-//					
-//				}
-//			}		
-//			
-//			planDao.savePlanFsrcInfo(fsrcBtm);
-//		} else {
-//			fsrcBtm.setSeq(1);
-//			fsrcBtm.setFsrcPc(param.getFsrcPcBtm());
-//			fsrcBtm.setFsrcMob(param.getFsrcMobileBtm());
-//
-//			planDao.savePlanFsrcInfo(fsrcBtm);
-//		}
+
 		return param;
 	}
 

+ 1 - 0
src/main/java/com/style24/admin/biz/service/TsaPollService.java

@@ -81,6 +81,7 @@ public class TsaPollService {
 	 * @author sowon
 	 * @since 2021. 5. 2
 	 */
+	@Transactional("shopTxnManager")
 	public void removeQuestion(Poll poll) {
 		pollDao.removeQuestion(poll);
 	}

+ 1 - 0
src/main/java/com/style24/persistence/domain/Plan.java

@@ -80,6 +80,7 @@ public class Plan extends TscBaseDomain{
 		private String custJoinStdt;		//회원가입시작일시
 		private String custJoinEddt;		//회원가입종료일시
 		private String sysImgNm;			//이미지
+		private String brandNm;
 
 		// 기획전 소스
 		private Integer seq;					//일련번호

+ 16 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaPlan.xml

@@ -1511,6 +1511,22 @@
 		AND C.CPN_STAT = 'G232_11'
 		AND NOW() <![CDATA[<=]]> IF (C.PD_GB = 'D', CONCAT(CURRENT_DATE + INTERVAL C.AVAIL_DAYS DAY, ' 23:59:59'), C.AVAIL_EDDT)
 	</select>
+	
+	<select id="getShotSelfBrandList" parameterType="Plan" resultType="Plan">
+		/* TsaPlan.getShotSelfBrandList */
+		SELECT  B.BRAND_CD 
+		      , CASE BG.DISP_NM_LANG WHEN 'EN' THEN BG.BRAND_GROUP_ENM
+		                  ELSE BG.BRAND_GROUP_KNM
+		        END                                                    AS BRAND_NM
+		FROM TB_BRAND B INNER JOIN TB_BRAND_GROUP BG 
+		  ON B.BRAND_GROUP_NO = BG.BRAND_GROUP_NO
+		WHERE 1 = 1
+		  AND B.USE_YN  = 'Y'
+		  AND B.SELF_YN = 'Y'
+		  AND BG.USE_YN = 'Y'
+		ORDER  BY B.SUPPLY_COMP_CD
+		         ,BG.DISP_ORD
+	</select>
 </mapper>