Przeglądaj źródła

Merge branch 'eskim' of http://112.172.147.34:4936/style24/style24.admin.git into eskim

eskim 4 lat temu
rodzic
commit
5549609075

+ 25 - 21
src/main/java/com/style24/admin/biz/service/TsaGoodsService.java

@@ -2121,9 +2121,9 @@ public class TsaGoodsService {
 			goodsPriceRes.setUpdNo(TsaSession.getInfo().getUserNo());
 			goodsPriceRes.setRegNo(TsaSession.getInfo().getUserNo());
 
-			//예약일시 시분 설정
-			goodsPriceRes.setApplyStdt(goodsPriceRes.getApplyStdt() + "0000");
-			goodsPriceRes.setApplyEddt(goodsPriceRes.getApplyEddt() + "5959");
+//			//예약일시 시분 설정
+//			goodsPriceRes.setApplyStdt(goodsPriceRes.getApplyStdt() + "0000");
+//			goodsPriceRes.setApplyEddt(goodsPriceRes.getApplyEddt() + "5959");
 
 			// 엑셀조회를 위한 SEARCH 테이블 생성
 			SearchData searchData = new SearchData();
@@ -2160,7 +2160,7 @@ public class TsaGoodsService {
 				return (cnt + 2) + "행의 예약가격을 확인해주세요.";
 			}
 
-			String nowDate = GagaDateUtil.getToday();	//yyyyMMddHH
+			String nowDate = GagaDateUtil.getToday("yyyyMMddHH");	//yyyyMMddHH
 			SimpleDateFormat dateFormatParser = new SimpleDateFormat("yyyyMMddHH");
 			dateFormatParser.setLenient(false);
 			try {
@@ -2179,7 +2179,7 @@ public class TsaGoodsService {
 			}
 
 			if (Integer.parseInt(goodsPriceRes.getApplyStdt()) <= Integer.parseInt(nowDate)) {
-				return (cnt + 2) + "행의 예약 시작일자는 현재일자 보다 작거나 같을 수 없습니다.";
+				return (cnt + 2) + "행의 예약 시작일시는 현재일시 보다 작거나 같을 수 없습니다.";
 			}
 
 			//정상가와 비교
@@ -2192,14 +2192,19 @@ public class TsaGoodsService {
 			if (goods.getListPrice() < goodsPriceRes.getResGoodsPrice()) {
 				return (cnt + 2) + "행의 상품 정상가보다 예약판매가가 더 큽니다.";
 			}
-			if (!"Y".equals(goods.getSelfGoodsYn())) {
-				return (cnt + 2) + "행의 상품은 자사상품이 아닙니다.";
-			}
+//			if (!"Y".equals(goods.getSelfGoodsYn())) {
+//				return (cnt + 2) + "행의 상품은 자사상품이 아닙니다.";
+//			}
+
+			goodsPriceRes.setApplyStdt(goodsPriceRes.getApplyStdt() + "0000");
+			goodsPriceRes.setApplyEddt(goodsPriceRes.getApplyEddt() + "5959");
 
 			if (goodsDao.getGoodsPriceResDupChkCount(goodsPriceRes) > 0) {
-				return (cnt + 2) + "행은 이미 등록된 상품 가격예약이 존재합니다. \n(상품코드 : " + goodsPriceRes.getGoodsCd() + ")";
+				return (cnt + 2) + "행의 상품 " + goodsPriceRes.getGoodsCd() + "은 이미 등록된 상품 가격예약이 존재합니다.";
 			}
 
+			goodsPriceRes.setEndGoodsPrice(goods.getCurrPrice());
+
 			cnt++;
 		}
 
@@ -2391,7 +2396,6 @@ public class TsaGoodsService {
 		return goodsDao.getGoodsNaverPriceList(goodsSearch);
 	}
 
-	
 	/**
 	 * 상품 네이버 최저가 엑셀다운로드
 	 *
@@ -2402,13 +2406,13 @@ public class TsaGoodsService {
 	 * @since 2021. 07. 09
 	 */
 	public void getGoodsNaverExcelList(GoodsSearch goodsSearch, String excelFilenameWithPath) {
-		
+
 		// 헤더 title 설정
 		String[] listTitles = {"상품코드", "브랜드명", "상품명", "정상가", "판매가", "자사즉시할인가", "네이버최저가", "차액",
 			"최저가몰명", "최저가몰링크"};
 
 		// DB 처리 시 사용되는 파라미터명(셀명) 설정
-		String[] cellNames = {"GOODS_CD", "BRAND_ENM", "GOODS_NM", "LIST_PRICE", "CURR_PRICE", "BENEFIT_PRICE",  "LOWEST_PRICE", "PRICE" , 
+		String[] cellNames = {"GOODS_CD", "BRAND_ENM", "GOODS_NM", "LIST_PRICE", "CURR_PRICE", "BENEFIT_PRICE", "LOWEST_PRICE", "PRICE",
 			"MALL_NM", "MALL_LINK"};
 
 		String[] cellTypes = {
@@ -2418,16 +2422,16 @@ public class TsaGoodsService {
 			GagaExcelConstants.CellType.CHAR_RIGHT.name(), GagaExcelConstants.CellType.CHAR_RIGHT.name(),
 			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name()};
 
-		Collection<GagaMap> dataList = goodsDao.getGoodsNaverExcelList(goodsSearch); 
+		Collection<GagaMap> dataList = goodsDao.getGoodsNaverExcelList(goodsSearch);
 
 		try {
 			GagaExcelUtil.createExcel(excelFilenameWithPath, dataList, "상품 네이버 가격", listTitles, cellNames, cellTypes, TsaConstants.EXCEL_FOOTER_TITLE);
 		} catch (Exception e) {
 			throw new IllegalStateException(e);
 		}
-	
+
 	}
-	
+
 	/**
 	 * 상품 네이버 최저가 목록
 	 *
@@ -3885,11 +3889,11 @@ public class TsaGoodsService {
 		goods.setGoodsNum(goods.getGoodsCd());
 		// 입점상품코드
 		goods.setSupplyGoodsCd(goods.getGoodsCd());
-		
+
 		if (goods.getListPrice() < goods.getCurrPrice()) {
 			throw new IllegalStateException("판매가를 올바르게 입력해주세요.");
 		}
-	
+
 		// 판매수수료율
 		SupplyCompany supplyCompany = new SupplyCompany();
 		supplyCompany.setSupplyCompCd(goods.getSupplyCompCd());
@@ -3996,7 +4000,7 @@ public class TsaGoodsService {
 				index++;
 			}
 		}
-		
+
 		// 상품 색상 , 사이즈 옵션 정보 조회
 		Goods goodsColorSize = goodsDao.getGoodsColorSize(goods);
 		if (goodsColorSize != null && !StringUtils.isBlank(goodsColorSize.getMainColorCd())) {
@@ -4012,7 +4016,7 @@ public class TsaGoodsService {
 
 		// 전시카테고리 작업
 		goodsDao.createCategoryGoods(goods);
-		
+
 		log.info("goods = {}", goods);
 		// 안전안증작업
 		if (!StringUtils.isEmpty(goods.getCertTargetGb())) {
@@ -4023,9 +4027,9 @@ public class TsaGoodsService {
 			goodsSafeNo.setCertType(goods.getCertType());
 			goodsSafeNo.setCertNum(goods.getCertNum());
 			saveGoodsDetailCertNum(goodsSafeNo);
-	
+
 		}
-		
+
 	}
 
 }

+ 15 - 5
src/main/java/com/style24/admin/biz/web/TsaGoodsController.java

@@ -2128,7 +2128,7 @@ public class TsaGoodsController extends TsaBaseController {
 				goodsSearch.setSearchGb("MASTER");
 			}
 		}
-		
+
 		goodsSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		goodsSearch.setPageable(new TscPageRequest(goodsSearch.getPageNo() - 1, goodsSearch.getPageSize()));
 		goodsSearch.getPageable().setTotalCount(goodsService.getGoodsResSellCount(goodsSearch));
@@ -2441,6 +2441,17 @@ public class TsaGoodsController extends TsaBaseController {
 			goodsSearch.setMdNo(TsaSession.getInfo().getUserNo().toString());
 		}
 
+		// multi row 검색관련 처리
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
+			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").trim().split("\n"));
+
+			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
+				goodsSearch.setSearchGb("EXTEND");
+			} else if ("searchMasterGoodsCd".equals(goodsSearch.getSearch())) {
+				goodsSearch.setSearchGb("MASTER");
+			}
+		}
+
 		if (!StringUtils.isBlank(goodsSearch.getBrandList())) {
 			try {
 				String[] arrBrandCd = mapper.readValue(goodsSearch.getBrandList(), String[].class);
@@ -2632,7 +2643,6 @@ public class TsaGoodsController extends TsaBaseController {
 		return goodsService.saveGoodsNaverPrice(goodsSearch);
 	}
 
-	
 	/**
 	 * 네이버 최저가 엑셀다운로드
 	 *
@@ -2663,7 +2673,6 @@ public class TsaGoodsController extends TsaBaseController {
 			}
 		}
 
-		
 		log.info("[goodsSearch] ={}", goodsSearch);
 		goodsSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		goodsSearch.setPageable(new TscPageRequest(goodsSearch.getPageNo() - 1, goodsSearch.getPageSize()));
@@ -2676,6 +2685,7 @@ public class TsaGoodsController extends TsaBaseController {
 
 		return GagaFileUtil.writeFile(request, excelFilenameWithPath);
 	}
+
 	/**
 	 * 광고 키워드 관리  화면
 	 *
@@ -3345,7 +3355,7 @@ public class TsaGoodsController extends TsaBaseController {
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
-		
+
 		goods.setNotiListNew(notiList);
 
 		goodsService.createSalfGoodsDetail(goods);
@@ -3354,5 +3364,5 @@ public class TsaGoodsController extends TsaBaseController {
 		return result;
 
 	}
-	
+
 }

+ 2 - 3
src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml

@@ -2735,7 +2735,6 @@
 		           )
 		</if>
 		WHERE 1=1
-		AND G.SELF_GOODS_YN = #{selfGoodsYn}
 		<if test="searchGb == null or searchGb =='BASIC'" >
 		<include refid="getGoodsListCondition_sql"/>
 		</if>
@@ -2844,9 +2843,9 @@
 		FROM TB_GOODS_PRICE_RES
 		WHERE GOODS_CD = #{goodsCd}
 		<![CDATA[
-		AND APPLY_STDT <= DATE_FORMAT(#{applyStdt}, '%Y%m%d%H%i%S')
+		AND APPLY_STDT <= DATE_FORMAT(#{applyEddt}, '%Y%m%d%H%i%S')
 		]]>
-		AND APPLY_EDDT >= DATE_FORMAT(#{applyEddt}, '%Y%m%d%H%i%S')
+		AND APPLY_EDDT >= DATE_FORMAT(#{applyStdt}, '%Y%m%d%H%i%S')
 	</select>
 
 	<!-- 상품 가격예약 등록 -->

+ 3 - 4
src/main/webapp/WEB-INF/views/goods/GoodsPriceReserveForm.html

@@ -200,8 +200,7 @@
 			}
 		},
 		{headerName: "수정자", field: "updNm", width: 100, cellClass: 'text-center'},
-		{headerName: "상품가겨예약순번", field: "goodsPriceResSq", hide: true},
-		{headerName: "적용여부", field: "applyYn", hide: true}
+		{headerName: "상품가겨예약순번", field: "goodsPriceResSq", hide: true}
 	];
 	
 	// Get GridOptions
@@ -490,8 +489,8 @@
 				});
 				return false;
 			}
-		
-			if ((toDateStr > item.applyStdt) && ("Y" == $('#goodsRsvtTnmForm input[name=applyYn]').val())){
+			
+			if ((toDateStr > item.applyStdt)){
 				chkFlag = true;
 				mcxDialog.alertC("시작된 예약 상품은 삭제할 수 없습니다.", {
 					sureBtnText: "확인",

+ 19 - 4
src/main/webapp/WEB-INF/views/goods/GoodsPriceReservePopupForm.html

@@ -84,7 +84,8 @@
 		},
 		{headerName: "현재판매가", field: "currPrice", width: 120, cellClass: 'text-right'
 			,valueFormatter: function(params) {return params.value.addComma();},
-		}
+		},
+		{headerName: "상품타입", field: "goodsType", width: 120, hide:true}
 		
 	];
 	
@@ -108,7 +109,7 @@
 		var oldData = gagaAgGrid.getAllRowData(rsvtGoodsPriceGridOptions);
 		$.each(result, function(idx, item) {
 			var isInvalid = false;
-			if(item.goodsType == 'G056_D'){
+			if(item.goodsType != 'G056_N'){
 				return true;
 			}
 			if (oldData != null && oldData.length != 0){
@@ -122,7 +123,7 @@
 					return isInvalid;
 				}
 			}
-			gagaAgGrid.addRowData(rsvtGoodsPriceGridOptions, {"goodsCd" : item.goodsCd, "goodsNm" : item.goodsNm, "listPrice" : item.listPrice, "currPrice" : item.currPrice});
+			gagaAgGrid.addRowData(rsvtGoodsPriceGridOptions, {"goodsCd" : item.goodsCd, "goodsNm" : item.goodsNm, "listPrice" : item.listPrice, "currPrice" : item.currPrice, "goodsType" : item.goodsType});
 		});
 		uifnPopupClose('popupGoods');
 		return false;
@@ -197,6 +198,17 @@
 				});	
 				return false;
 			}
+			
+			if ("G056_N"  != item.goodsType ){
+				optCheck = true;
+				mcxDialog.alertC("일반상품이 아닌 상품은 가격예약을 할 수 없습니다.<br/>확인해 주세요", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						rsvtGoodsPriceGridOptions.api.setFocusedCell(index, "goodsCd", null);
+					}
+				});	
+				return false;
+			}
 		});
 
 		if (optCheck) return false;
@@ -312,7 +324,10 @@
 					return isInvalid;
 				}
 			}
-			gagaAgGrid.addRowData(rsvtGoodsPriceGridOptions, {"goodsCd" : item.goodsCd, "goodsNm" : item.goodsNm, "listPrice" : item.listPrice, "currPrice" : item.currPrice});
+			if("G056_N" == item.goodsType){
+				gagaAgGrid.addRowData(rsvtGoodsPriceGridOptions, {"goodsCd" : item.goodsCd, "goodsNm" : item.goodsNm, "listPrice" : item.listPrice, "currPrice" : item.currPrice, "goodsType" : item.goodsType});	
+			}
+			
 		});
 		return;
 	}

+ 2 - 6
src/main/webapp/WEB-INF/views/goods/GoodsSupplyPriceForm.html

@@ -119,11 +119,7 @@
 		{headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
 		{headerName: "업체", field: "supplyCompNm" , width: 100, cellClass: 'text-center'},
 		{headerName: "브랜드", field: "brandEnm" , width: 100, cellClass: 'text-center'},
-		{headerName: "상품코드", field: "goodsCd", width: 130, cellClass: 'text-center'
-			,cellRenderer: function(params) {
-				return '<a href="javascript:void(0);">' + params.value + '</a>';
-			}
-		},
+		{headerName: "상품코드", field: "goodsCd", width: 130, cellClass: 'text-center'},
 		{headerName: "상품명", field: "goodsNm", width: 200, cellClass: 'text-left'
 			,cellRenderer: function(params) {
 				return '<a href="javascript:void(0);">' + params.value + '</a>';
@@ -197,7 +193,7 @@
 	// Row Click
 	gridOptions.onCellClicked = function(event) {
 		var goodsCd = event.data.goodsCd;
-		if (event.colDef.field == "goodsCd"){
+		if (event.colDef.field == "goodsNm"){
 			cfnOpenGoodsDetailPopup('U',goodsCd);
 		}
 	}