Procházet zdrojové kódy

입점상품 판매가,수수료율 변경시 입점상품가격승인으로 처리

tsit05 před 4 roky
rodič
revize
002ea9cc36

+ 31 - 10
src/main/java/com/style24/scm/biz/service/TssGoodsService.java

@@ -2881,10 +2881,18 @@ public class TssGoodsService {
 		}
 
 		if ("N".equals(goods.getChDataYn()) && "N".equals(goods.getChkDescKeep()) && "N".equals(goods.getChNotiYn())) {
-			goods.setGoodsRegMsg("변경정보 없음");
-			goods.setGoodsStat("10");
-			this.setGoodsRegResult(goods, goodsMass, procJob);
-			return goods.getGoodsStat();
+			if (!UPDATE_NO_PATTERN.equals(goodsMass.getCurrPrice().trim()) || !UPDATE_NO_PATTERN.equals(goodsMass.getSellFeeRate().trim())) {
+				goods.setGoodsRegMsg("판매가/수수료율 승인요청");
+				goods.setGoodsStat("10");
+				this.setGoodsRegResult(goods, goodsMass, procJob);
+				return goods.getGoodsStat();
+			}else {
+				goods.setGoodsRegMsg("변경정보 없음");
+				goods.setGoodsStat("10");
+				this.setGoodsRegResult(goods, goodsMass, procJob);
+				return goods.getGoodsStat();
+			}
+		
 		}
 
 		//상품 기본정보 변경여부 와 촬영업체가 아닌경우
@@ -3093,7 +3101,7 @@ public class TssGoodsService {
 			return goods;
 		}
 		if (UPDATE_NO_PATTERN.equals(goodsMass.getCurrPrice().trim())) {
-			goods.setCurrPrice(0);
+			goods.setCurrPrice(goodsOrigin.getCurrPrice());
 		} else {
 
 			if (!GagaStringUtil.replace(goodsMass.getCurrPrice().trim(), ",", "").matches(NUMBER_PATTERN)) {
@@ -3106,6 +3114,11 @@ public class TssGoodsService {
 				goods.setGoodsStat("10");
 				return goods;
 			}
+			if (Integer.parseInt(goodsMass.getCurrPrice().trim()) > goodsOrigin.getListPrice()) {
+				goods.setGoodsRegMsg("판매가 오류(정상가보다 높음)");
+				goods.setGoodsStat("10");
+				return goods;
+			}
 		}
 		//판매수수료율
 		if (StringUtils.isBlank(goodsMass.getSellFeeRate())) {
@@ -3115,7 +3128,7 @@ public class TssGoodsService {
 		}
 		float sellFeeRate = 0f;
 		if (UPDATE_NO_PATTERN.equals(goodsMass.getSellFeeRate().trim())) {
-			goods.setSellFeeRate(0);
+			goods.setSellFeeRate(goodsOrigin.getSellFeeRate());
 		} else {
 			try {
 				sellFeeRate = Float.valueOf(goodsMass.getSellFeeRate().trim());
@@ -3160,12 +3173,20 @@ public class TssGoodsService {
 				//입점
 				GoodsSupplyPrice goodsSupplyPrice = new GoodsSupplyPrice();
 				goodsSupplyPrice.setGoodsCd(goods.getGoodsCd());
-				if (goods.getCurrPrice() != goods.getCurrPriceOrg()) {
-					goodsSupplyPrice.setSupplyGoodsPrice(goods.getCurrPrice());
+				//if (goods.getCurrPrice() != goodsOrigin.getCurrPrice()) {
+				if (!UPDATE_NO_PATTERN.equals(goodsMass.getCurrPrice().trim())) {
+					goodsSupplyPrice.setSupplyGoodsPrice(Integer.parseInt(GagaStringUtil.replace(goodsMass.getCurrPrice().trim(), ",", "")));
+				}else {
+					goodsSupplyPrice.setSupplyGoodsPrice(goodsOrigin.getCurrPrice());
 				}
-				if (goods.getSellFeeRate() != goods.getSellFeeRateOrg()) {
-					goodsSupplyPrice.setSupplySellFeeRate(goods.getSellFeeRate());
+				//}
+				//if (goods.getSellFeeRate() != goodsOrigin.getSellFeeRate()) {
+				if (!UPDATE_NO_PATTERN.equals(goodsMass.getSellFeeRate().trim())) {
+					goodsSupplyPrice.setSupplySellFeeRate(Float.valueOf(goodsMass.getSellFeeRate().trim()));
+				}else {
+					goodsSupplyPrice.setSupplySellFeeRate(goodsOrigin.getSellFeeRate());
 				}
+				//}
 				goodsSupplyPrice.setCfrmYn("N");
 				goodsSupplyPrice.setRegNo(goods.getRegNo());
 				goodsSupplyPrice.setUpdNo(goods.getUpdNo());