فهرست منبع

브랜드관리에 판매수수료율 항목 삭제

eskim 5 سال پیش
والد
کامیت
42e84e1cc4

+ 1 - 1
src/main/java/com/style24/admin/biz/dao/TsaBusinessDao.java

@@ -80,7 +80,7 @@ public interface TsaBusinessDao {
 	 * @author gagamel
 	 * @since 2020. 11. 24
 	 */
-	Collection<DelvFeePolicy> getDeliveryFeePolicyList(String supplyCompCd);
+	Collection<DelvFeePolicy> getDeliveryFeePolicyList(DelvFeePolicy delvFeePolicy);
 
 	/**
 	 * 배송비정책 생성

+ 2 - 2
src/main/java/com/style24/admin/biz/service/TsaBusinessService.java

@@ -107,8 +107,8 @@ public class TsaBusinessService {
 	 * @author gagamel
 	 * @since 2020. 11. 24
 	 */
-	public Collection<DelvFeePolicy> getDeliveryFeePolicyList(String supplyCompCd) {
-		return businessDao.getDeliveryFeePolicyList(supplyCompCd);
+	public Collection<DelvFeePolicy> getDeliveryFeePolicyList(DelvFeePolicy delvFeePolicy) {
+		return businessDao.getDeliveryFeePolicyList(delvFeePolicy);
 	}
 
 	/**

+ 28 - 7
src/main/java/com/style24/admin/biz/service/TsaGoodsService.java

@@ -22,6 +22,7 @@ import com.style24.persistence.domain.AdKeyword;
 import com.style24.persistence.domain.AdKeywordGoods;
 import com.style24.persistence.domain.Brand;
 import com.style24.persistence.domain.Color;
+import com.style24.persistence.domain.DelvFeePolicy;
 import com.style24.persistence.domain.FreeGoods;
 import com.style24.persistence.domain.Goods;
 import com.style24.persistence.domain.GoodsCategory;
@@ -46,6 +47,7 @@ import com.style24.persistence.domain.NoticeGoods;
 import com.style24.persistence.domain.Option;
 import com.style24.persistence.domain.ReinboundInform;
 import com.style24.persistence.domain.SearchData;
+import com.style24.persistence.domain.SupplyCompany;
 import com.style24.persistence.domain.Video;
 import com.style24.persistence.domain.WmsColorMapping;
 import com.style24.persistence.domain.WmsGoods;
@@ -873,7 +875,7 @@ public class TsaGoodsService {
 			}
 			goodsDao.updateGoodsSnm(goods);
 
-			//상품 등록후에는 고시정보는 품목과 상관없이 변경처리 가능하게 
+			//상품 등록후에는 고시정보는 품목과 상관없이 변경처리 가능하게
 //			Collection<GoodsNotiInfo> goodsNotiInfoList = goodsDao.getNewNotiInfo(goods);
 //			goodsDao.deleteGoodsNotiInfo(goods);
 //
@@ -1353,6 +1355,11 @@ public class TsaGoodsService {
 				regGoods.setSupplyCompCd(extendGoods.getSupplyCompCd());
 				regGoods.setFormalGb(extendGoods.getFormalGb());
 			}
+
+			if ("Y".equals(goodsCompose.getRepYn())) {
+				regGoods.setListPrice(extendGoods.getCurrPrice());
+				regGoods.setCurrPrice(extendGoods.getCurrPrice());
+			}
 		}
 
 		this.createGoodsExtend(regGoods, goodsComposeList); // 딜상품 관련 정보 저장
@@ -1459,8 +1466,6 @@ public class TsaGoodsService {
 
 		float pntPrate = 0f;
 		float pntMrate = 0f;
-		float sellFeeRate = 0f;
-		//String delvFeeCd = "";
 		for (Brand tmpBrand : brandList) {
 
 			if ("10".equals(regGoods.getFormalGb())) {
@@ -1470,15 +1475,31 @@ public class TsaGoodsService {
 				pntPrate = tmpBrand.getPntPrate20();
 				pntMrate = tmpBrand.getPntMrate20();
 			}
-			sellFeeRate = tmpBrand.getSellFeeRate();
-			//delvFeeCd = tmpBrand.getDelvFeeCd();
 		}
-		//regGoods.setDelvFeeCd(delvFeeCd);// 배송비전책코드
+
 		regGoods.setPntPrate(pntPrate); // 포인트적립율(PC)
 		regGoods.setPntMrate(pntMrate); // 포인트적립율(MOBILE)
-		regGoods.setSellFeeRate(sellFeeRate); // 판매수수료율
+
 		regGoods.setSelfGoodsYn("Y");
 
+		SupplyCompany supplyCompany = new SupplyCompany();
+		supplyCompany.setSupplyCompCd(regGoods.getSupplyCompCd());
+		Collection<SupplyCompany> supplyCompanyList = businessService.getSupplyCompanyList(supplyCompany);
+		if (supplyCompanyList == null || supplyCompanyList.isEmpty()) {
+			throw new IllegalStateException(message.getMessage("구성상품 중 기준 상품의 업체(판매수수율를 확인해 주세요."));
+		}
+		regGoods.setSellFeeRate(supplyCompanyList.iterator().next().getSellFeeRate()); // 판매수수료율
+
+
+		DelvFeePolicy delvFeePolicy = new DelvFeePolicy();
+		delvFeePolicy.setSupplyCompCd(regGoods.getSupplyCompCd());
+		Collection<DelvFeePolicy> deliveryFeePolicyList = businessService.getDeliveryFeePolicyList(delvFeePolicy);
+		if (deliveryFeePolicyList == null || deliveryFeePolicyList.isEmpty()) {
+			throw new IllegalStateException(message.getMessage("구성상품 중 기준 상품의 업체(배송비정책)를 확인해 주세요."));
+		}
+		regGoods.setDelvFeeCd(deliveryFeePolicyList.iterator().next().getDelvFeeCd());// 배송비정책코드
+
+
 		// 스타일 연도
 		regGoods.setStyleYear(regGoods.getStyleYear());
 

+ 3 - 1
src/main/java/com/style24/admin/biz/web/TsaBusinessController.java

@@ -249,7 +249,9 @@ public class TsaBusinessController extends TsaBaseController {
 	@GetMapping("/delivery/fee/policy/list/{supplyCompCd}")
 	@ResponseBody
 	public Collection<DelvFeePolicy> getDeliveryFeePolicyList(@PathVariable String supplyCompCd) {
-		return businessService.getDeliveryFeePolicyList(supplyCompCd);
+		DelvFeePolicy delvFeePolicy = new DelvFeePolicy();
+		delvFeePolicy.setSupplyCompCd(supplyCompCd);
+		return businessService.getDeliveryFeePolicyList(delvFeePolicy);
 	}
 
 	/**

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

@@ -32,7 +32,7 @@ public class Brand extends TscBaseDomain {
 //	private String delvFeeCd;		// 배송비정책코드
 //	private int delvFee;			// 기본배송비
 //	private int minOrdAmt;			// 무료배송비최소주문금액
-	private float sellFeeRate;		// 판매수수료율
+//	private float sellFeeRate;		// 판매수수료율
 	private float pntPrate10;		// 포인트적립율(PC정상)
 	private float pntMrate10;		// 포인트적립율(모바일정상)
 	private float pntPrate20;		// 포인트적립율(PC이월)

+ 1 - 14
src/main/java/com/style24/persistence/mybatis/shop/TsaBusiness.xml

@@ -272,7 +272,7 @@
 	</update>
 	
 	<!-- 배송비정책 목록 -->
-	<select id="getDeliveryFeePolicyList" parameterType="String" resultType="DelvFeePolicy">
+	<select id="getDeliveryFeePolicyList" parameterType="DelvFeePolicy" resultType="DelvFeePolicy">
 		/* TsaBusiness.getDeliveryFeePolicyList */
 		SELECT DELV_FEE_CD    /*배송비정책코드*/
 		     , SUPPLY_COMP_CD /*공급업체코드*/
@@ -477,14 +477,9 @@
 		     , A.DISP_NM_LANG                /*노출명언어*/
 		     , A.RGB_CD                      /*RGB코드*/
 		     , A.DISTRIBUTION_GB             /*유통구분*/
-		     -- , A.SUPPLY_COMP_CD              /*업체코드*/
 		     , B.SUPPLY_COMP_NM              /*업체명*/
-		     -- , A.DELV_LOC_CD                 /*출고처코드*/
-		     , C.DELV_LOC_NM                 /*출고처명*/
 		     , A.ERP_BRAND_CD                /*ERP브랜드코드*/
 		     , A.SELF_YN                     /*자사여부*/
-		     -- , A.DELV_FEE_CD                 /*배송비정책코드*/
-		     , A.SELL_FEE_RATE               /*판매수수료율*/
 		     , A.USE_YN                      /*사용여부*/
 		     , A.PNT_PRATE10                 /*포인트적립율(PC)*/
 		     , A.PNT_MRATE10                 /*포인트적립율(모바일)*/
@@ -492,13 +487,8 @@
 		     , A.PNT_MRATE20                 /*포인트적립율(모바일)*/
 		     , A.LOGO_FILE_NM                 /*로고파일명*/
 		     , A.DISP_ORD                    /*표시순서*/
-		    -- , D.MIN_ORD_AMT                 /*무료배송최소금액*/
-		    -- , D.DELV_FEE                    /*배송비*/
 		FROM   TB_BRAND A
 		INNER JOIN TB_SUPPLY_COMPANY B ON A.SUPPLY_COMP_CD = B.SUPPLY_COMP_CD
-		LEFT OUTER JOIN TB_DELIVERY_LOC C ON A.DELV_LOC_CD = C.DELV_LOC_CD
-		-- LEFT OUTER JOIN TB_DELV_FEE_POLICY D ON A.SUPPLY_COMP_CD = D.SUPPLY_COMP_CD
-		--                                  AND A.DELV_FEE_CD =  D.DELV_FEE_CD
 		WHERE  1 = 1
 		<if test='supplyCompCd != null and supplyCompCd != ""'>
 		AND    A.SUPPLY_COMP_CD = #{supplyCompCd}
@@ -660,7 +650,6 @@
 		     , DISTRIBUTION_GB
 		     , SELF_YN
 		     , ERP_BRAND_CD
-		     , SELL_FEE_RATE
 		     , PNT_PRATE10
 		     , PNT_MRATE10
 		     , PNT_PRATE20
@@ -689,7 +678,6 @@
 		            ELSE 'N'
 		       END
 		     , #{erpBrandCd}
-		     , IFNULL(#{sellFeeRate},0)
 		     , IFNULL(#{pntPrate10},0)
 		     , IFNULL(#{pntMrate10},0)
 		     , IFNULL(#{pntPrate20},0)
@@ -724,7 +712,6 @@
 		                      ELSE 'N'
 		                 END
 		     , ERP_BRAND_CD = #{erpBrandCd}
-		     , SELL_FEE_RATE = IFNULL(#{sellFeeRate},0)
 		     , PNT_PRATE10 = IFNULL(#{pntPrate10},0)
 		     , PNT_MRATE10 = IFNULL(#{pntMrate10},0)
 		     , PNT_PRATE20 = IFNULL(#{pntPrate20},0)

+ 17 - 12
src/main/webapp/WEB-INF/views/business/BrandForm.html

@@ -141,11 +141,12 @@
 							<input type="text" class="w100" name="supplyCompNm" readonly="readonly"/>
 							<input type="hidden" class="w100" name="supplyCompCd" />
 						</td>
-					-->	
+					
 						<th>판매수수료율<i class="required" title="필수"></i></th>
 						<td>
 							<input type="text" class="w100 aR" name="sellFeeRate" value="0" maxlength="3" required="required" data-valid-name="판매수수료율" data-valid-type="real"/>%
 						</td>
+					-->		
 						<th>유통구분<i class="required" title="필수"></i></th>
 						<td>
 							<select name="distributionGb" required="required" data-valid-name="유통구분">
@@ -153,6 +154,12 @@
 								<option th:if="${distributionGbList}" th:each="oneData, status : ${distributionGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
 						</td>
+						<th>사용여부<i class="required" title="필수"></i></th>
+						<td>
+							<label class="rdoBtn"><input type="radio" name="useYn" value="Y" checked="checked">Yes</label>
+							<label class="rdoBtn"><input type="radio" name="useYn" value="N">No</label>
+							<span class="marL10 cRed"><i class="fa fa-info-circle" aria-hidden="true"></i> No에 체크하면 "프론트"에 노출되지 않습니다.</span>
+						</td>
 					</tr>
 					<!--  <tr>	
 						<th>출고처<i class="required" title="필수"></i></th>
@@ -194,14 +201,6 @@
 						<td class="infoTxt">
 							<input type="text" class="w100 aR" name="dispOrd" maxlength="5" required="required" data-valid-name="노출순서" data-valid-type="numeric"/>
 						</td>
-						<th>사용여부<i class="required" title="필수"></i></th>
-						<td>
-							<label class="rdoBtn"><input type="radio" name="useYn" value="Y" checked="checked">Yes</label>
-							<label class="rdoBtn"><input type="radio" name="useYn" value="N">No</label>
-							<span class="marL10 cRed"><i class="fa fa-info-circle" aria-hidden="true"></i> No에 체크하면 "프론트"에 노출되지 않습니다.</span>
-						</td>
-					</tr>
-					<tr>
 						<th>RGB코드</th>
 						<td  colspan="3">
 							<input type="text" class="w100 aR" name="rgbCd" maxlength="6" data-valid-name="REG코드" />
@@ -307,8 +306,8 @@
 				{headerName: "기본배송비", field: "delvFee", width: 120, cellClass: 'text-center', valueFormatter: function(params) { return Number(params.value).addComma(); }},
 				{headerName: "최소주문금액", field: "minOrdAmt", width: 120, cellClass: 'text-center', valueFormatter: function(params) { return Number(params.value).addComma(); }}
 			]
-		},*/
-		{headerName: "판매수수료율(%)", field: "sellFeeRate", width: 150, cellClass: 'text-center'},
+		},
+		{headerName: "판매수수료율(%)", field: "sellFeeRate", width: 150, cellClass: 'text-center'}, */
 		{
 			headerName: "포인트적립율(%)",
 			children : [
@@ -373,7 +372,7 @@
 		
 		//$("#detailForm input[name=delvFee]").val(Number(event.data.delvFee).addComma());
 		//$("#detailForm input[name=minOrdAmt]").val(Number(event.data.minOrdAmt).addComma());
-		$("#detailForm input[name=sellFeeRate]").val(event.data.sellFeeRate);
+		//$("#detailForm input[name=sellFeeRate]").val(event.data.sellFeeRate);
 		$("#detailForm input[name=pntPrate10]").val(event.data.pntPrate10);
 		$("#detailForm input[name=pntMrate10]").val(event.data.pntMrate10);
 		$("#detailForm input[name=pntPrate20]").val(event.data.pntPrate20);
@@ -742,6 +741,12 @@
 		// 로고이미지 영역은 수정 시 노출
 		$("#brandImgArea").removeClass("on").addClass("off");
 		
+		// 그리드 삭제
+		var allData = gagaAgGrid.getAllRowData(gridOptions2);
+		allData.forEach(function(item, index) {
+			gridOptions2.api.updateRowData({remove: [item]});
+		});
+		
 	});
 	
 	//이미지 클릭시 미리보기

+ 9 - 20
src/main/webapp/WEB-INF/views/goods/GoodsDealForm.html

@@ -51,15 +51,19 @@
 						<col width="10%"/>
 						<col/>
 						<col width="10%"/>
-						<col width="20%"/>
-						<col width="10%"/>
 						<col width="24%"/>
+						<col width="10%"/>
+						<col width="20%"/>
 					</colgroup>
 					<tr>
 						<th>상품명<em class="required" title="필수"></em></th>
 						<td><input type="text" id="goodsNm" name="goodsNm" maxlength="60"/></td>
-						<th>판매가<em class="required" title="필수"></em></th>
-						<td><input type="text" class="w100" id="currPrice" name="currPrice" maxlength="8" data-valid-type="numeric"/></td>
+						<th>성별<em class="required" title="필수"></em></th>
+						<td><select  name="sexGb" id="sexGb">
+								<option value="">[전체]</option>
+								<option th:if="${sexGbList}" th:each="oneData, status : ${sexGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+						</td>
 						<th>제조년월일<em class="required" title="필수"></em></th>
 						<td><input type="text" class="w100" id="makeYmd" name="makeYmd" maxlength="8" data-valid-type="date"/></td>
 					</tr>
@@ -74,12 +78,6 @@
 								<option th:if="${seasonList}" th:each="oneData, status : ${seasonList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
 						</td>
-						<th>성별<em class="required" title="필수"></em></th>
-						<td><select  name="sexGb" id="sexGb">
-								<option value="">[전체]</option>
-								<option th:if="${sexGbList}" th:each="oneData, status : ${sexGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-							</select>
-						</td>
 						<th>원산지<em class="required" title="필수"></em></th>
 						<td ><select name="makeOriginCd" id="makeOriginCd">
 								<option value="">[전체]</option>
@@ -87,6 +85,7 @@
 							</select>
 							<input type="hidden" id="makeNm" name="makeNm" />
 						</td>
+						<td colspan="2"></td>
 					</tr>
 				</table>
 			</div>	
@@ -336,16 +335,6 @@
 			return false;
 		}
 		
-		if(gagajf.isNull($("#goodsDealForm input[name=currPrice]").val())){
-			mcxDialog.alertC('판매가를 입력해 주세요.', {
-				sureBtnText: "확인",
-				sureBtnClick: function() {
-					$("#goodsDealForm input[name=currPrice]").focus();
-				}
-			});	
-			return false;
-		}
-		
 		if(Number($("#goodsDealForm input[name=currPrice]").val()) <= 0){
 			mcxDialog.alertC('판매가를 바르게 입력해 주세요.', {
 				sureBtnText: "확인",