Browse Source

입점 가격 변경관리 테이블 신규 처리

eskim 4 years ago
parent
commit
4355e70744

+ 7 - 14
src/main/java/com/style24/persistence/domain/GoodsPriceRes.java → src/main/java/com/style24/persistence/domain/GoodsSupplyPrice.java

@@ -7,25 +7,21 @@ import com.style24.persistence.TscPageRequest;
 import lombok.Data;
 
 /**
- * 상품가격변경예약 Domain
+ * 입점상품가격관리 Domain
  * @author eskim
- * @since 2020. 11. 23
+ * @since 2021. 07. 09
  */
 @SuppressWarnings("serial")
 @Data
-public class GoodsPriceRes extends TscBaseDomain {
+public class GoodsSupplyPrice extends TscBaseDomain {
 
-	private Integer goodsPriceResSq;
+	private Integer supplyGoodsPriceSq;
 	private String goodsCd;
-	private int resGoodsPrice;
-	private int endGoodsPrice;
-	private float sellFeeRate;
-	private String applyStdt;
-	private String applyEddt;
+	private int supplyGoodsPrice;
+	private float supplySellFeeRate;
 	private String cfrmYn;
 	private int cfrmNo;
 	private String cfrmDt;
-	private String applyYn;
 
 	private String cfrmNm;
 
@@ -49,10 +45,7 @@ public class GoodsPriceRes extends TscBaseDomain {
 	private String[] arrGoodsCd;
 
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
-	private int[] arrEndGoodsPrice;
-
-	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
-	private int[] arrGoodsPriceResSq;
+	private int[] arrSupplyGoodsPriceSq;
 
 	// Pagination
 	private TscPageRequest pageable;

+ 21 - 33
src/main/java/com/style24/persistence/mybatis/shop/TssGoods.xml

@@ -1521,10 +1521,10 @@
 	</select>
 	
 	<!-- 상품 가격 승인 목록 건수 -->
-	<select id="getGoodsSupplyPriceCount"  parameterType="GoodsPriceRes" resultType="int">
+	<select id="getGoodsSupplyPriceCount"  parameterType="GoodsSupplyPrice" resultType="int">
 		/* TssGoods.getGoodsSupplyPriceCount */
-		SELECT COUNT(A.GOODS_PRICE_RES_SQ)
-		FROM TB_GOODS_PRICE_RES A
+		SELECT COUNT(A.GOODS_SUPPLY_PRICE_SQ)
+		FROM TB_GOODS_SUPPLY_PRICE A
 		INNER JOIN TB_GOODS G ON A.GOODS_CD = G.GOODS_CD
 		                      AND G.SELF_GOODS_YN = 'N'
 		INNER JOIN TB_BRAND B ON G.BRAND_CD = B.BRAND_CD
@@ -1567,7 +1567,7 @@
 	</select>
 	
 	<!-- 상품 가격 승인 목록 -->
-	<select id="getGoodsSupplyPriceList"  parameterType="GoodsPriceRes" resultType="GoodsPriceRes">
+	<select id="getGoodsSupplyPriceList"  parameterType="GoodsSupplyPrice" resultType="GoodsSupplyPrice">
 		/* TssGoods.getGoodsSupplyPriceList */
 		SELECT Q.*
 		FROM (
@@ -1575,39 +1575,35 @@
 		FROM (
 		    SELECT A.* 
 		    FROM (
-		        SELECT X.GOODS_PRICE_RES_SQ
+		        SELECT X.GOODS_SUPPLY_PRICE_SQ
 		             , X.GOODS_CD
-		             , X.RES_GOODS_PRICE
-		             , X.END_GOODS_PRICE
-		             , X.SELL_FEE_RATE
+		             , X.SUPPLY_GOODS_PRICE
+		             , X.SUPPLY_SELL_FEE_RATE
 		             , X.CFRM_YN
 		             , X.CFRM_NM
 		             , X.CFRM_NO
 		             , X.CFRM_DT
-		             , X.APPLY_YN
 		             , X.REG_NM
 		             , X.REG_DT
 		             , X.UPD_NM
 		             , X.UPD_DT
 		             , X.LIST_PRICE
 		             , X.CURR_PRICE
-		            , X.GOODS_STAT
+		             , X.GOODS_STAT
 		             , X.GOODS_SELL_FEE_RATE
 		             , X.SUPPLY_COMP_CD
 		             , X.SUPPLY_COMP_NM
 		             , X.BRAND_CD
 		            , X.BRAND_ENM
 		        FROM (
-		            SELECT A.GOODS_PRICE_RES_SQ
+		            SELECT A.GOODS_SUPPLY_PRICE_SQ
 		                 , A.GOODS_CD
-		                 , A.RES_GOODS_PRICE
-		                 , A.END_GOODS_PRICE
-		                 , A.SELL_FEE_RATE
+		                 , A.SUPPLY_GOODS_PRICE
+		                 , A.SUPPLY_SELL_FEE_RATE
 		                 , A.CFRM_YN
 		                 , FN_GET_USER_NM(A.CFRM_NO) AS CFRM_NM
 		                 , A.CFRM_NO
 		                 , DATE_FORMAT(A.CFRM_DT,'%Y%m%d%H%i%S') AS CFRM_DT
-		                 , A.APPLY_YN
 		                 , FN_GET_USER_NM(A.REG_NO) AS REG_NM
 		                 , DATE_FORMAT(A.REG_DT,'%Y%m%d%H%i%S') AS REG_DT
 		                 , FN_GET_USER_NM(A.UPD_NO) AS UPD_NM
@@ -1621,7 +1617,7 @@
 		                 , B.BRAND_ENM
 		                 , G.SUPPLY_COMP_CD
 		                 , S.SUPPLY_COMP_NM
-		            FROM TB_GOODS_PRICE_RES A
+		            FROM TB_GOODS_SUPPLY_PRICE A
 		            INNER JOIN TB_GOODS G ON A.GOODS_CD = G.GOODS_CD
 		                                  AND G.SELF_GOODS_YN = 'N'
 		            INNER JOIN TB_BRAND B ON G.BRAND_CD = B.BRAND_CD
@@ -1796,21 +1792,17 @@
 		AND GOODS_CD = #{goodsCd}
 	</delete>
 	
-	<!-- 상품 가격예약 등록 -->
-	<insert id="createGoodPriceRes" parameterType="GoodsPriceRes">
-		/* TssGoods.createGoodPriceRes */
-		INSERT INTO TB_GOODS_PRICE_RES (
-		  GOODS_PRICE_RES_SQ
+	<!-- 입점 상품 가격  -->
+	<insert id="createGoodSupplyPrice" parameterType="GoodsSupplyPrice">
+		/* TssGoods.createGoodSupplyPrice */
+		INSERT INTO TB_GOODS_SUPPLY_PRICE (
+		  GOODS_SUPPLY_PRICE_SQ
 		, GOODS_CD
-		, RES_GOODS_PRICE
-		, END_GOODS_PRICE
-		, SELL_FEE_RATE
-		, APPLY_STDT
-		, APPLY_EDDT
+		, SUPPLY_GOODS_PRICE
+		, SUPPLY_SELL_FEE_RATE
 		, CFRM_YN
 		, CFRM_NO
 		, CFRM_DT
-		, APPLY_YN
 		, REG_NO
 		, REG_DT
 		, UPD_NO
@@ -1819,15 +1811,11 @@
 		VALUES(
 		  NULL
 		, #{goodsCd}
-		, #{resGoodsPrice}
-		, #{endGoodsPrice}
-		, #{sellFeeRate}
-		, STR_TO_DATE(#{applyStdt},'%Y%m%d%H%i%S')
-		, STR_TO_DATE(#{applyEddt},'%Y%m%d%H%i%S')
+		, #{supplyGoodsPrice}
+		, #{supplySellFeeRate}
 		, IFNULL(#{cfrmYn},'N')
 		, #{cfrmNo}
 		, #{cfrmDt}
-		, IFNULL(#{applyYn},'N')
 		, #{regNo}
 		, NOW()
 		, #{updNo}

+ 6 - 6
src/main/java/com/style24/scm/biz/dao/TssGoodsDao.java

@@ -14,9 +14,9 @@ import com.style24.persistence.domain.GoodsHst;
 import com.style24.persistence.domain.GoodsImg;
 import com.style24.persistence.domain.GoodsMass;
 import com.style24.persistence.domain.GoodsNotiInfo;
-import com.style24.persistence.domain.GoodsPriceRes;
 import com.style24.persistence.domain.GoodsSafeNo;
 import com.style24.persistence.domain.GoodsSearch;
+import com.style24.persistence.domain.GoodsSupplyPrice;
 import com.style24.persistence.domain.IfProductSku;
 import com.style24.persistence.domain.Itemkind;
 import com.style24.persistence.domain.NotiInfo;
@@ -273,14 +273,14 @@ public interface TssGoodsDao {
 	void saveGoodsNotiInfo(GoodsNotiInfo goodsNotiInfo);
 
 	/**
-	 * 상품 가격예약 등록(화면)
+	 * 입점 상품 가격 변경
 	 *
-	 * @param goodsPriceRes
+	 * @param supplyGoodsPrice
 	 * @return void
 	 * @author eskim
 	 * @since 2020. 11. 13
 	 */
-	void createGoodPriceRes(GoodsPriceRes goodsPriceRes);
+	void createGoodSupplyPrice(GoodsSupplyPrice supplyGoodsPrice);
 
 	/**
 	 * 상품 옵션 존재여부 확인
@@ -300,7 +300,7 @@ public interface TssGoodsDao {
 	 * @author eskim
 	 * @since 2020. 11. 26
 	 */
-	int getGoodsSupplyPriceCount(GoodsPriceRes goodsPriceRes);
+	int getGoodsSupplyPriceCount(GoodsSupplyPrice goodsSupplyPrice);
 
 	/**
 	 * 상품 가격 승인 목록
@@ -310,7 +310,7 @@ public interface TssGoodsDao {
 	 * @author eskim
 	 * @since 2020. 11. 26
 	 */
-	Collection<GoodsPriceRes> getGoodsSupplyPriceList(GoodsPriceRes goodsPriceRes);
+	Collection<GoodsSupplyPrice> getGoodsSupplyPriceList(GoodsSupplyPrice goodsSupplyPrice);
 
 	/**
 	 * 상품 상세공지 목록

+ 23 - 33
src/main/java/com/style24/scm/biz/service/TssGoodsService.java

@@ -27,9 +27,9 @@ import com.style24.persistence.domain.GoodsHst;
 import com.style24.persistence.domain.GoodsImg;
 import com.style24.persistence.domain.GoodsMass;
 import com.style24.persistence.domain.GoodsNotiInfo;
-import com.style24.persistence.domain.GoodsPriceRes;
 import com.style24.persistence.domain.GoodsSafeNo;
 import com.style24.persistence.domain.GoodsSearch;
+import com.style24.persistence.domain.GoodsSupplyPrice;
 import com.style24.persistence.domain.IfProductSku;
 import com.style24.persistence.domain.Itemkind;
 import com.style24.persistence.domain.NotiInfo;
@@ -621,23 +621,18 @@ public class TssGoodsService {
 
 		} else {
 			if ("Y".equals(goods.getChCfrmYn())) {
-				GoodsPriceRes goodsPriceRes = new GoodsPriceRes();
-				goodsPriceRes.setGoodsCd(goods.getGoodsCd());
+				GoodsSupplyPrice GoodsSupplyPrice = new GoodsSupplyPrice();
+				GoodsSupplyPrice.setGoodsCd(goods.getGoodsCd());
 				if (goods.getCurrPrice() != goods.getCurrPriceOrg()) {
-					goodsPriceRes.setResGoodsPrice(goods.getCurrPrice());
-					goodsPriceRes.setEndGoodsPrice(goods.getCurrPrice());
+					GoodsSupplyPrice.setSupplyGoodsPrice(goods.getCurrPrice());
 				}
 				if (goods.getSellFeeRate() != goods.getSellFeeRateOrg()) {
-					goodsPriceRes.setSellFeeRate(goods.getSellFeeRate());
+					GoodsSupplyPrice.setSupplySellFeeRate(goods.getSellFeeRate());
 				}
-				goodsPriceRes.setApplyStdt(GagaDateUtil.getTodayDateTime());	//yyyymmddhhmiss
-				int toYear = Integer.parseInt(GagaDateUtil.getToday("yyyy")) + 4;
-				goodsPriceRes.setApplyEddt(Integer.toString(toYear) + "1231235959");	//yyyymmddhhmiss
-				goodsPriceRes.setCfrmYn("N");
-				goodsPriceRes.setApplyYn("N");
-				goodsPriceRes.setRegNo(goods.getRegNo());
-				goodsPriceRes.setUpdNo(goods.getUpdNo());
-				goodsDao.createGoodPriceRes(goodsPriceRes);
+				GoodsSupplyPrice.setCfrmYn("N");
+				GoodsSupplyPrice.setRegNo(goods.getRegNo());
+				GoodsSupplyPrice.setUpdNo(goods.getUpdNo());
+				goodsDao.createGoodSupplyPrice(GoodsSupplyPrice);
 
 				goods.setCurrPrice(goods.getCurrPriceOrg());
 				goods.setSellFeeRate(goods.getSellFeeRateOrg());
@@ -1045,9 +1040,9 @@ public class TssGoodsService {
 	 * @author eskim
 	 * @since 2020. 11. 26
 	 */
-	public int getGoodsSupplyPriceCount(GoodsPriceRes goodsPriceHst) {
+	public int getGoodsSupplyPriceCount(GoodsSupplyPrice goodsSupplyPrice) {
 
-		return goodsDao.getGoodsSupplyPriceCount(goodsPriceHst);
+		return goodsDao.getGoodsSupplyPriceCount(goodsSupplyPrice);
 	}
 
 	/**
@@ -1058,9 +1053,9 @@ public class TssGoodsService {
 	 * @author eskim
 	 * @since 2020. 11. 26
 	 */
-	public Collection<GoodsPriceRes> getGoodsSupplyPriceList(GoodsPriceRes goodsPriceHst) {
+	public Collection<GoodsSupplyPrice> getGoodsSupplyPriceList(GoodsSupplyPrice goodsSupplyPrice) {
 
-		return goodsDao.getGoodsSupplyPriceList(goodsPriceHst);
+		return goodsDao.getGoodsSupplyPriceList(goodsSupplyPrice);
 	}
 
 	/**
@@ -3098,23 +3093,18 @@ public class TssGoodsService {
 				}
 			} else {
 				//입점
-				GoodsPriceRes goodsPriceRes = new GoodsPriceRes();
-				goodsPriceRes.setGoodsCd(goods.getGoodsCd());
-				if (goods.getCurrPrice() != goodsOrigin.getCurrPrice()) {
-					goodsPriceRes.setResGoodsPrice(goods.getCurrPrice());
-					goodsPriceRes.setEndGoodsPrice(goods.getCurrPrice());
+				GoodsSupplyPrice goodsSupplyPrice = new GoodsSupplyPrice();
+				goodsSupplyPrice.setGoodsCd(goods.getGoodsCd());
+				if (goods.getCurrPrice() != goods.getCurrPriceOrg()) {
+					goodsSupplyPrice.setSupplyGoodsPrice(goods.getCurrPrice());
 				}
-				if (goods.getSellFeeRate() != goodsOrigin.getSellFeeRate()) {
-					goodsPriceRes.setSellFeeRate(sellFeeRate);
+				if (goods.getSellFeeRate() != goods.getSellFeeRateOrg()) {
+					goodsSupplyPrice.setSupplySellFeeRate(goods.getSellFeeRate());
 				}
-				goodsPriceRes.setApplyStdt(GagaDateUtil.getTodayDateTime());	//yyyymmddhhmiss
-				int toYear = Integer.parseInt(GagaDateUtil.getToday("yyyy")) + 4;
-				goodsPriceRes.setApplyEddt(Integer.toString(toYear) + "1231235959");	//yyyymmddhhmiss
-				goodsPriceRes.setCfrmYn("N");
-				goodsPriceRes.setApplyYn("N");
-				goodsPriceRes.setRegNo(goods.getRegNo());
-				goodsPriceRes.setUpdNo(goods.getUpdNo());
-				goodsDao.createGoodPriceRes(goodsPriceRes);
+				goodsSupplyPrice.setCfrmYn("N");
+				goodsSupplyPrice.setRegNo(goods.getRegNo());
+				goodsSupplyPrice.setUpdNo(goods.getUpdNo());
+				goodsDao.createGoodSupplyPrice(goodsSupplyPrice);
 
 				// 상품테이블에 바로 변경하지 않고 입점상품가격관리에서 승인해야함
 				goods.setCurrPrice(goodsOrigin.getCurrPrice());

+ 7 - 7
src/main/java/com/style24/scm/biz/web/TssGoodsController.java

@@ -39,9 +39,9 @@ import com.style24.persistence.domain.GoodsHst;
 import com.style24.persistence.domain.GoodsImg;
 import com.style24.persistence.domain.GoodsMass;
 import com.style24.persistence.domain.GoodsNotiInfo;
-import com.style24.persistence.domain.GoodsPriceRes;
 import com.style24.persistence.domain.GoodsSafeNo;
 import com.style24.persistence.domain.GoodsSearch;
+import com.style24.persistence.domain.GoodsSupplyPrice;
 import com.style24.persistence.domain.Itemkind;
 import com.style24.persistence.domain.NotiInfo;
 import com.style24.persistence.domain.Notice;
@@ -1331,16 +1331,16 @@ public class TssGoodsController extends TssBaseController {
 	 */
 	@PostMapping("/supply/price/list")
 	@ResponseBody
-	public GagaMap getGoodsSupplyPriceList(@RequestBody GoodsPriceRes goodsPriceRes) {
+	public GagaMap getGoodsSupplyPriceList(@RequestBody GoodsSupplyPrice goodsSupplyPrice) {
 
 		GagaMap result = new GagaMap();
 
-		goodsPriceRes.setRegNo(TssSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
-		goodsPriceRes.setPageable(new TscPageRequest(goodsPriceRes.getPageNo() - 1, goodsPriceRes.getPageSize()));
-		goodsPriceRes.getPageable().setTotalCount(goodsService.getGoodsSupplyPriceCount(goodsPriceRes));
+		goodsSupplyPrice.setRegNo(TssSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
+		goodsSupplyPrice.setPageable(new TscPageRequest(goodsSupplyPrice.getPageNo() - 1, goodsSupplyPrice.getPageSize()));
+		goodsSupplyPrice.getPageable().setTotalCount(goodsService.getGoodsSupplyPriceCount(goodsSupplyPrice));
 
-		result.set("pageing", goodsPriceRes);
-		result.set("goodsList", goodsService.getGoodsSupplyPriceList(goodsPriceRes));
+		result.set("pageing", goodsSupplyPrice);
+		result.set("goodsList", goodsService.getGoodsSupplyPriceList(goodsSupplyPrice));
 
 		return result;
 	}

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

@@ -132,12 +132,12 @@
 		{headerName: "온라인 현재판매가", field: "currPrice", width: 120, cellClass: 'text-right'
 			,valueFormatter: function(params) {return params.value.addComma();}
 		},
-		{headerName: "판매가조정대상금액", field: "resGoodsPrice", width: 140, cellClass: 'text-right'
+		{headerName: "판매가조정대상금액", field: "supplyGoodsPrice", width: 140, cellClass: 'text-right'
 			,cellRenderer: function(params) {
-				if (params.data.resGoodsPrice <= 0){
+				if (params.data.supplyGoodsPrice <= 0){
 					return "-";
 				}else{
-					var gapPrice = Number(params.data.currPrice) - Number(params.data.resGoodsPrice);
+					var gapPrice = Number(params.data.currPrice) - Number(params.data.supplyGoodsPrice);
 					
 					if (gapPrice >= 0){
 						return '<font color="red"> '+ params.value.addComma() +'</font>';
@@ -151,17 +151,17 @@
 		{headerName: "온라인 판매수수료", field: "goodsSellFeeRate", width: 140, cellClass: 'text-right'
 			,valueFormatter: function(params) {return params.value.addComma();}
 		},
-		{headerName: "판매수수료 조정대상수수료", field: "sellFeeRate", width: 180, cellClass: 'text-right'
+		{headerName: "판매수수료 조정대상수수료", field: "supplySellFeeRate", width: 180, cellClass: 'text-right'
 			,cellRenderer: function(params) {
-				if (gagajf.isNull(params.data.sellFeeRate)){
+				if (gagajf.isNull(params.data.supplySellFeeRate)){
 					return "-";
 				}else{
-					var gapRate = Number(params.data.goodsSellFeeRate) - Number(params.data.sellFeeRate);
+					var gapRate = Number(params.data.goodsSellFeeRate) - Number(params.data.supplySellFeeRate);
 					
 					if (gapRate >= 0){
-						return '<font color="red"> '+ params.data.sellFeeRate +'</font>';
+						return '<font color="red"> '+ params.data.supplySellFeeRate +'</font>';
 					}else{
-						return '<font color="blue"> '+ params.data.sellFeeRate +'</font>';
+						return '<font color="blue"> '+ params.data.supplySellFeeRate +'</font>';
 					}
 				}	
 			}