eskim 5 лет назад
Родитель
Сommit
3a1c17e23e

+ 20 - 0
src/main/java/com/style24/admin/biz/dao/TsaGoodsDao.java

@@ -22,6 +22,7 @@ import com.style24.persistence.domain.GoodsSafeNo;
 import com.style24.persistence.domain.GoodsSearch;
 import com.style24.persistence.domain.GoodsTnmRes;
 import com.style24.persistence.domain.GoodsVideo;
+import com.style24.persistence.domain.IfIncomelot;
 import com.style24.persistence.domain.Itemkind;
 import com.style24.persistence.domain.NotiInfo;
 import com.style24.persistence.domain.Notice;
@@ -1219,5 +1220,24 @@ public interface TsaGoodsDao {
 	 * @since 2021. 04. 27
 	 */
 	void saveGoodsModelInfo(GoodsImg goodsImg);
+	
+	
+	/**
+	 * WMS입고단품목록 건수
+	 * @param goodsSearch
+	 * @return Collection<WmsGoods>
+	 * @author eskim
+	 * @since 2021. 06. 28
+	 */
+	int getGoodsWmsIncomelotSkuListCount(IfIncomelot iIfIncomelot);
+
+	/**
+	 * WMS입고단품목록 조회
+	 * @param goodsSearch
+	 * @return Collection<WmsGoods>
+	 * @author eskim
+	 * @since 2021. 06. 28
+	 */
+	Collection<WmsGoods> getGoodsWmsIncomelotSkuList(IfIncomelot ifIncomelot);
 
 }

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

@@ -42,6 +42,7 @@ import com.style24.persistence.domain.GoodsSafeNo;
 import com.style24.persistence.domain.GoodsSearch;
 import com.style24.persistence.domain.GoodsTnmRes;
 import com.style24.persistence.domain.GoodsVideo;
+import com.style24.persistence.domain.IfIncomelot;
 import com.style24.persistence.domain.Itemkind;
 import com.style24.persistence.domain.NaverLowestPrice;
 import com.style24.persistence.domain.NotiInfo;
@@ -3748,4 +3749,28 @@ public class TsaGoodsService {
 		goodsDao.saveGoodsModelInfo(goodsImg);
 	}
 
+	/**
+	 * WMS입고단품목록 건수
+	 *
+	 * @param goodsSearch
+	 * @return Collection<WmsGoods>
+	 * @author eskim
+	 * @since 2021. 06. 28
+	 */
+	public int getGoodsWmsIncomelotSkuListCount(IfIncomelot iIfIncomelot) {
+		return goodsDao.getGoodsWmsIncomelotSkuListCount(iIfIncomelot);
+	}
+
+	/**
+	 * WMS입고단품목록 조회
+	 *
+	 * @param goodsSearch
+	 * @return Collection<WmsGoods>
+	 * @author eskim
+	 * @since 2021. 06. 28
+	 */
+	public Collection<WmsGoods> getGoodsWmsIncomelotSkuList(IfIncomelot ifIncomelot) {
+		return goodsDao.getGoodsWmsIncomelotSkuList(ifIncomelot);
+	}
+
 }

+ 47 - 0
src/main/java/com/style24/admin/biz/web/TsaGoodsController.java

@@ -56,6 +56,7 @@ import com.style24.persistence.domain.GoodsSafeNo;
 import com.style24.persistence.domain.GoodsSearch;
 import com.style24.persistence.domain.GoodsTnmRes;
 import com.style24.persistence.domain.GoodsVideo;
+import com.style24.persistence.domain.IfIncomelot;
 import com.style24.persistence.domain.Itemkind;
 import com.style24.persistence.domain.NotiInfo;
 import com.style24.persistence.domain.Notice;
@@ -3115,4 +3116,50 @@ public class TsaGoodsController extends TsaBaseController {
 		return goodsService.getItemkindList(itemkind);
 	}
 
+	/**
+	 * WMS입고단품목록 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2021. 06. 28
+	 */
+	@GetMapping("/wms/incomelot/sku/form")
+	public ModelAndView wmsInstockSkuForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 공급업체
+		String supplyCompCd = "";
+		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, "Y"));
+		// 상품상태
+		String[] exceptCds = {"G008_00"};
+		mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
+		// 품목
+		mav.addObject("itemkindList", rendererService.getAllItemkindList());
+
+		mav.setViewName("goods/GoodsWmsIncomelotSkuForm");
+
+		return mav;
+	}
+
+	/**
+	 * WMS입고단품목록 조회
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2021. 06. 28
+	 */
+	@PostMapping("/wms/incomelot/sku/list")
+	@ResponseBody
+	public GagaMap getWmsIncomelotSkuList(@RequestBody IfIncomelot ifIncomelot) {
+
+		GagaMap result = new GagaMap();
+
+		ifIncomelot.setPageable(new TscPageRequest(ifIncomelot.getPageNo() - 1, ifIncomelot.getPageSize()));
+		ifIncomelot.getPageable().setTotalCount(goodsService.getGoodsWmsIncomelotSkuListCount(ifIncomelot));
+
+		result.set("pageing", ifIncomelot);
+		result.set("goodsList", goodsService.getGoodsWmsIncomelotSkuList(ifIncomelot));
+
+		return result;
+	}
 }

+ 49 - 0
src/main/java/com/style24/persistence/domain/IfIncomelot.java

@@ -0,0 +1,49 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TscPageRequest;
+
+import lombok.Data;
+
+/**
+ * wms 입고 재고  Domain
+ *
+ * @author eskim
+ * @since 2021. 06. 28
+ */
+@SuppressWarnings("serial")
+@Data
+public class IfIncomelot extends TscBaseDomain {
+
+	private Integer lotno;			//입고번호
+	private Integer purchaseno;		//발주번호
+	private Integer providerno;		//공급처번호
+	private String providername;	//공급처명
+	private Integer brandno;		//브랜드번호
+	private String brandname;		//브랜드명
+	
+	private Integer itemno;			//입고항목번호
+	private Integer wmsitemno;		//
+	private String dateincome;		//WMS생성일
+	private String productno;		//상품번호
+	private String productcode;		//상품코드
+	private String productname;		//상품명
+	private String skucode;			//옵션번호
+	private Integer normalqty;		//일반수량
+	private Integer brokenqty;		//불량수량
+	private Integer totalqty;		//총수량
+	private String skumodelno;		//옵션 모델 번호
+	
+	private String supplyCompCd;
+	private String brandCd;
+	private String goodsCd;
+	private String stDate;
+	private String edDate;
+
+	// Pagination
+	private TscPageRequest pageable;
+	private int pageNo = 1;
+	private int pageSize = 50;
+	private int pageUnit = 10;
+	
+}

+ 98 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml

@@ -4683,4 +4683,102 @@
 		      ,UPD_DT = NOW()
 	</insert>	
 	
+	<!-- WMS입고단품목록 건수 -->
+	<select id="getGoodsWmsIncomelotSkuListCount" parameterType="IfIncomelot" resultType="int">
+		/* TsaGoods.getGoodsWmsIncomelotSkuListCount */
+		SELECT COUNT(*)
+		FROM (
+		    SELECT A.LOTNO
+		          ,A.BRANDNO
+		          ,A.BRANDNAME
+		          ,A.PROVIDERNAME
+		          ,A.PROVIDERNO
+		          ,DATE_FORMAT(A.DATEINCOME, '%Y%m%d') AS DATEINCOME
+		          ,B.PRODUCTNO
+		          ,B.PRODUCTCODE
+		          ,B.PRODUCTNAME
+		          ,B.SKUCODE
+		          ,B.NORMALQTY
+		          ,B.BROKENQTY
+		          ,B.TOTALQTY
+		          ,B.SKUMODELNO
+		          , (CASE WHEN INSTR(REPLACE(B.SKUMODELNO, ' ' , ''), 'F20') = 1 THEN LEFT(REPLACE(B.SKUMODELNO, ' ' , ''),12)
+		                  WHEN INSTR(REPLACE(B.SKUMODELNO, ' ' , ''), '-') > 0 THEN LEFT(REPLACE(B.SKUMODELNO, ' ' , ''),11)
+		                  ELSE LEFT(REPLACE(B.SKUMODELNO, ' ' , ''),10) END) AS GOODS_CD
+		          FROM TB_IF_INCOMELOT A
+		          INNER JOIN TB_IF_INCOMELOTITEM B ON A.LOTNO = B.LOTNO
+		    WHERE 1 = 1 
+		    <if test="stDate != null and stDate != ''">
+		    AND A.DATEINCOME  >= DATE_FORMAT(#{stDate}, '%Y-%m-%d')
+		    </if>
+		    <if test="edDate != null and edDate != ''">
+		    AND A.DATEINCOME  <![CDATA[<=]]> DATE_FORMAT(#{edDate}, '%Y-%m-%d')
+		    </if>
+		     ) Z
+		    INNER JOIN TB_BRAND B ON Z.BRANDNO = B.BRAND_NO AND B.SELF_YN = 'Y'
+		    INNER JOIN TB_SUPPLY_COMPANY S ON Z.PROVIDERNO = S.PROVIDER_NO
+		    WHERE 1 = 1
+		    <if test="supplyCompCd != null and supplyCompCd != ''">
+		    AND S.SUPPLY_COMP_CD = #{supplyCompCd}
+		    </if>
+		    <if test="brandCd != null and brandCd != ''">
+		    AND B.BRAND_CD = #{brandCd}
+		    </if>
+		    <if test="goodsCd != null and goodsCd != ''">
+		    AND Z.GOODS_CD = #{goodsCd}
+		    </if>
+	</select>
+	
+	<!-- WMS입고단품목록 -->
+	<select id="getGoodsWmsIncomelotSkuList" parameterType="IfIncomelot" resultType="IfIncomelot">
+		/* TsaGoods.getGoodsWmsIncomelotSkuList */
+		SELECT Q.*
+		FROM (     
+		      SELECT Z.*
+		            , B.BRAND_CD
+		      FROM (
+		          SELECT A.LOTNO
+		                ,A.BRANDNO
+		                ,A.BRANDNAME
+		                ,A.PROVIDERNAME
+		                ,A.PROVIDERNO
+		                ,DATE_FORMAT(A.DATEINCOME, '%Y%m%d') AS DATEINCOME
+		                ,B.PRODUCTNO
+		                ,B.PRODUCTCODE
+		                ,B.PRODUCTNAME
+		                ,B.SKUCODE
+		                ,B.NORMALQTY
+		                ,B.BROKENQTY
+		                ,B.TOTALQTY
+		                ,B.SKUMODELNO
+		                , (CASE WHEN INSTR(REPLACE(B.SKUMODELNO, ' ' , ''), 'F20') = 1 THEN LEFT(REPLACE(B.SKUMODELNO, ' ' , ''),12)
+		                        WHEN INSTR(REPLACE(B.SKUMODELNO, ' ' , ''), '-') > 0 THEN LEFT(REPLACE(B.SKUMODELNO, ' ' , ''),11)
+		                        ELSE LEFT(REPLACE(B.SKUMODELNO, ' ' , ''),10) END) AS GOODS_CD
+		                FROM TB_IF_INCOMELOT A
+		                INNER JOIN TB_IF_INCOMELOTITEM B ON A.LOTNO = B.LOTNO
+		          WHERE 1 = 1 
+		          <if test="stDate != null and stDate != ''">
+		          AND A.DATEINCOME  >= DATE_FORMAT(#{stDate}, '%Y-%m-%d')
+		          </if>
+		          <if test="edDate != null and edDate != ''">
+		          AND A.DATEINCOME  <![CDATA[<=]]> DATE_FORMAT(#{edDate}, '%Y-%m-%d')
+		          </if>
+		           ) Z
+		          INNER JOIN TB_BRAND B ON Z.BRANDNO = B.BRAND_NO AND B.SELF_YN = 'Y'
+		          -- INNER JOIN TB_SUPPLY_COMPANY S ON Z.PROVIDERNO = S.PROVIDER_NO
+		          WHERE 1 = 1
+		          <if test="supplyCompCd != null and supplyCompCd != ''">
+		          AND S.SUPPLY_COMP_CD = #{supplyCompCd}
+		          </if>
+		          <if test="brandCd != null and brandCd != ''">
+		          AND B.BRAND_CD = #{brandCd}
+		          </if>
+		          <if test="goodsCd != null and goodsCd != ''">
+		          AND Z.GOODS_CD = #{goodsCd}
+		          </if>
+		            ORDER BY LOTNO, DATEINCOME, SKUCODE
+		          ) Q
+		LIMIT #{pageable.limitStartRow} ,  #{pageable.pageSize}
+	</select>
+	
 </mapper>

+ 262 - 0
src/main/webapp/WEB-INF/views/goods/GoodsWmsIncomelotSkuForm.html

@@ -0,0 +1,262 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : GoodsWmsIncomelotSkuForm.html
+ * @desc    : WMS입고단품목록 화면
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.06.28   eskim       최초 작성
+ *******************************************************************************
+ -->	
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc">
+		</div>
+		<form id="goodsWmsIncomelotForm" name="goodsWmsIncomelotForm" action="#" th:action="@{'/goods/wms/incomelot/sku/list'}">
+ 		<!-- 패널 영역1 -->
+		<div class="panelStyle" >
+			<div class="panelTitle">
+				<h3><i class="fa fa-info-circle"></i>아래 검색조건 중 하나를 꼭 입력해 주세요.</h3>
+			</div>
+			<div class="panelContent">
+				<table class="frmStyle">
+					<colgroup>
+						<col width="10%"/>
+						<col width="40%"/>
+						<col width="10%"/>
+						<col/>
+					</colgroup>
+					<tr>
+						<th>업체/브랜드<em class="required" title="필수"></em></th>
+						<td>
+							<select name="supplyCompCd" id="supplyCompCd">
+								<option value="" th:if="${sessionInfo.roleCd} != 'B000'">[전체]</option>
+								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+							<select name="brandCd" id="brandCd">
+								<option value="">[전체]</option>
+							</select>
+						</td>
+						<th>상품코드<em class="required" title="필수"></em></th>
+						<td>
+							<input id="goodsCd" name=goodsCd type="text" class="w150"  maxlength="20"/>
+						</td>
+					</tr>
+					<tr>
+						<th>입고일<em class="required" title="필수"></em></th>
+						<td colspan="3" id="sellTerms"></td>
+					</tr>
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-gray btn-lg" id="btnInit" >초기화</button>
+						<button type="button" class="btn btn-info btn-lg" id="btnSearch" >조회</button>
+					</li>
+				</ul>
+			</div>
+			<!-- //검색조건 영역 -->
+		</div>
+		<!-- 패널 영역1 -->
+		<div class="panelStyle">
+			<ul class="panelBar">
+				<li class="right">
+					검색결과 : <strong><span id="gridRowTotalCount">0</span> 건</strong>&nbsp;
+					쪽번호 <span id="pgNo">0</span>/ <strong id="endPgNo">0</strong>&nbsp;&nbsp;
+					<select id="pageSize" name="pageSize">
+						<option value="50" selected="selected">50개씩 보기</option>
+						<option value="100">100개씩 보기</option>
+						<option value="500">500개씩 보기</option>
+						<!-- <option value="1000">1000개씩 보기</option> -->
+					</select>
+					<input type="hidden" name="pageNo" id="pageNo" value ="1"/>
+				</li>
+			</ul>
+			<!-- 검색결과 영역 -->
+			<div id="gridList" style="width: 100%; height: 500px;" class="ag-theme-balham"></div>
+			<ul class="panelBar">
+				<li class="center">
+					<div class="tablePaging" id="goodsListPagination"></div>
+				</li>
+			</ul>
+			<!-- 검색결과 영역 -->
+		</div>
+		</form>
+		<!-- //패널 영역2 -->
+	</div>
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=2019072202"></script>
+<script th:inline="javascript">
+/*<![CDATA[*/
+	var sessRoleCd = [[${sessionInfo.roleCd}]];
+	var columnDefs = [
+		{headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
+		{headerName: "입고번호", field: "lotno", width: 100, cellClass: 'text-center'},
+		{headerName: "브랜드", field: "brandCd", width: 100, cellClass: 'text-center'},
+		{headerName: "브랜드명", field: "brandname", width: 130, cellClass: 'text-center'},
+		{headerName: "WMS상품번호", field: "productno", width: 120, cellClass: 'text-center'},
+		{headerName: "SKU코드", field: "skucode", width: 120, cellClass: 'text-center'},
+		{headerName: "WMS상품명", field: "productname", width: 300, cellClass: 'text-left'},
+		{headerName: "상품코드", field: "goodsCd" , width: 120, cellClass: 'text-center'},
+		{headerName: "검품", field: "normalqty" , width: 120, cellClass: 'text-right'},
+		{headerName: "양품", field: "brokenqty" , width: 120, cellClass: 'text-right'},
+		{headerName: "불량", field: "totalqty" , width: 120, cellClass: 'text-right'},
+		{headerName: "등록일시", field: "dateincome", width: 150, cellClass: 'text-center',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDD").format("YYYY-MM-DD") : '';
+			}
+		}
+		
+	];
+	
+	// Get GridOptions
+	var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// 중복 선택 가능
+	//gridOptions.rowSelection = 'multiple';
+	gridOptions.suppressRowClickSelection = true;
+
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+		fnInit();
+	});
+	
+	var fnInit = function(){
+		$('#goodsWmsIncomelotForm')[0].reset();
+		//$("#goodsWmsIncomelotForm input[type=radio]").removeClass("checked");
+		$("#goodsWmsIncomelotForm input[type=checkbox]").removeClass("checked");
+		//$("#goodsWmsIncomelotForm input[type=radio]").parent("label").removeClass("checked");
+		$("#goodsWmsIncomelotForm input[type=checkbox]").parent("label").removeClass("checked");
+		$("#goodsWmsIncomelotForm input[type=radio][checked]").parent("label").addClass("checked");
+	}
+	
+	// 조회클릭시
+	$('#btnSearch').on('click', function() {
+		$("#goodsWmsIncomelotForm input[name=pageNo]").val('1');
+		fnGoodsWmsIncomelotListSearch();
+	});
+
+	// 조회
+	var fnGoodsWmsIncomelotListSearch = function(gbn) {
+
+		if(!fnConditionCheck()) return;
+		
+		//gagaAgGrid.fetch($('#goodsWmsIncomelotForm').prop('action'), gridOptions, '#goodsWmsIncomelotForm');
+		
+		gagaPaging.init('goodsWmsIncomelotForm', fnSearchCallBack, 'goodsListPagination', $('#goodsWmsIncomelotForm').find('#pageSize').val());
+		gagaPaging.load($("#goodsWmsIncomelotForm input[name=pageNo]").val());
+	}
+
+	var fnSearchCallBack = function(result){
+
+		$('#goodsWmsIncomelotForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
+		$('#goodsWmsIncomelotForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
+		$('#goodsWmsIncomelotForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
+		$('#goodsWmsIncomelotForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
+		gridOptions.api.setRowData(result.goodsList);
+		gagaPaging.createPagination(result.pageing.pageable);
+		
+	}
+	
+	//페이징
+	$('#goodsWmsIncomelotForm select[name=pageSize]').on('change', function() {
+		$("#goodsWmsIncomelotForm input[name=pageNo]").val('1');
+		fnGoodsWmsIncomelotListSearch();
+	});
+	
+	
+	//검색 조건 확인
+	var fnConditionCheck = function(){
+		var formId = '#goodsWmsIncomelotForm';
+		var form = document.goodsWmsIncomelotForm;
+		
+		var searchFlag = false;
+		var cnt = 0;
+
+		/* if( !gagajf.isNull($("#goodsWmsIncomelotForm select[name=supplyCompCd]").val())
+				|| !gagajf.isNull($("#goodsWmsIncomelotForm input[name=condition]").val())
+				|| (!gagajf.isNull($("#goodsWmsIncomelotForm input[name=stDate]").val()) && !gagajf.isNull($("#goodsWmsIncomelotForm input[name=edDate]").val()))
+			){
+			searchFlag = true;
+		}else{ */
+			for (i = 0; i < form.elements.length; i++ ) {
+				var el = form.elements[i];
+				
+				if ($(el).prop("type") == "text" || ($(el).prop("type") == "select-one" && el.name != "search" && el.name != "pageSize" )) {
+					if (!(el.value == null || el.value == "")) {
+						cnt++;
+					}
+				}
+			}
+			
+			if(cnt > 0) searchFlag = true;
+			
+		/* } */
+		
+		if(searchFlag == false){
+			mcxDialog.alert("검색조건을 입력하세요.");
+			return false;
+		}
+		
+		var fromDate = $('#goodsWmsIncomelotForm input[name=stDate]').val();
+		var toDate = $('#goodsWmsIncomelotForm input[name=edDate]').val();
+		
+		if (!gagajf.isNull(fromDate) || !gagajf.isNull(toDate)) {
+			
+			if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
+				mcxDialog.alertC("입고일 조회시 시작일자와 종료일자를 입력하세요.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#goodsWmsIncomelotForm input[name=stDate]').focus();
+					}
+				});
+				return false;
+			}
+
+			if (fromDate > toDate) {
+				mcxDialog.alert("입고 시작일자는 종료일자 보다 클 수 없습니다.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#goodsWmsIncomelotForm input[name=stDate]').focus();
+					}
+				});
+				return false;
+			} 
+		}
+
+		return true;
+	}
+	
+	//업체변경시
+	$('#goodsWmsIncomelotForm select[name=supplyCompCd]').on('change', function() {
+		var actionUrl = '/renderer/supplyCompany/brand/list/' + $(this).val();
+
+		if(sessRoleCd == "B000"){
+			actionUrl = '/renderer/brand/AuthBrandlist';
+		}
+		$("#goodsWmsIncomelotForm select[name=brandCd] option:gt(0)").remove();
+
+		cfnCreateCombo(actionUrl, $('#goodsWmsIncomelotForm select[name=brandCd]'), "[전체]", "");
+	});
+	
+	$(document).ready(function() {
+
+		cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '등록일');
+		
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+	});
+
+/*]]>*/
+</script>
+ 	
+</html>