فهرست منبع

ST24PRJ-138 [결함][촬영SCM] 입고현황 메뉴 생성

card007 4 سال پیش
والد
کامیت
7713847c8d

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

@@ -0,0 +1,60 @@
+package com.style24.persistence.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+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;
+	
+	private String condition; 
+	private String condition2; 
+	private String condition3; 
+	
+	
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] conditionList;
+	private String[] conditionList2;
+	private String[] conditionList3;
+
+	// Pagination
+	private TscPageRequest pageable;
+	private int pageNo = 1;
+	private int pageSize = 50;
+	private int pageUnit = 10;
+	
+}

+ 250 - 0
src/main/java/com/style24/persistence/mybatis/shop/TssGoods.xml

@@ -3117,4 +3117,254 @@
     WHERE B.BRAND_CD = #{brandCd}
     AND B.SELF_YN  = 'Y'
   </select>
+
+	<!-- WMS입고상품 목록 건수 -->
+	<select id="getGoodsWmsIncomelotListCount" parameterType="WmsGoods" resultType="int">
+		/* TsaGoods.getGoodsWmsIncomelotListCount */
+		SELECT COUNT(*)
+		  FROM TB_WMS_GOODS A
+		 INNER JOIN TB_BRAND B ON A.BRAND_NO = B.BRAND_NO
+		   AND B.SELF_YN  = 'Y'
+		   AND B.USE_YN  = 'Y'
+		 INNER JOIN TB_BRAND_SUPPLY S ON B.BRAND_CD = S.BRAND_CD
+		 WHERE NULLIF(GOODS_REG_GB,'') IS NULL                                     /* 온라인 미등록 상품 */
+		<if test="modelNo != null and modelNo != ''">
+		   AND UPPER(A.MODEL_NO) LIKE CONCAT(UPPER(#{modelNo}),'%')
+		</if>
+		<if test="stDate != null and stDate != ''">
+		   AND A.REG_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
+		</if>
+		<if test="edDate != null and edDate != ''">
+			<![CDATA[
+		   AND A.REG_DT < DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
+		]]>
+		</if>
+		<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>
+		 ORDER BY A.UPD_DT DESC
+	</select>
+
+	<!-- WMS입고상품 목록 -->
+	<select id="getGoodsWmsIncomelotList" parameterType="WmsGoods" resultType="WmsGoods">
+		/* TsaGoods.getGoodsWmsIncomelotList */
+		SELECT Q.* FROM (
+		    SELECT Z.* FROM (
+		        SELECT A.* FROM (
+		            SELECT A.PRODUCT_NO
+		                 , A.PRODUCT_CODE
+		                 , A.PRODUCT_NAME
+		                 , A.MODEL_NO
+		                 , A.PROVIDER_NO
+		                 , A.PROVIDER_NAME
+		                 , A.BRAND_NO
+		                 , A.BRAND_NAME
+		                 , A.GOODS_REG_DT
+		                 , A.GOODS_REG_GB
+		                 , B.BRAND_CD
+		                 , B.BRAND_ENM
+		                 , A.REG_NO
+		                 , FN_GET_USER_NM(A.REG_NO) AS REG_NM
+		                 , DATE_FORMAT(A.REG_DT,'%Y%m%d%H%i%S') AS REG_DT
+		                 , A.UPD_NO
+		                 , FN_GET_USER_NM(A.UPD_NO) AS UPD_NM
+		                 , DATE_FORMAT(A.UPD_DT,'%Y%m%d%H%i%S') AS UPD_DT
+		              FROM TB_WMS_GOODS A
+		             INNER JOIN TB_BRAND B ON A.BRAND_NO = B.BRAND_NO
+		               AND B.SELF_YN  = 'Y'
+		               AND B.USE_YN  = 'Y'
+		             INNER JOIN TB_BRAND_SUPPLY S ON B.BRAND_CD = S.BRAND_CD
+		             WHERE NULLIF(GOODS_REG_GB,'') IS NULL   /* 온라인 미등록 상품 */
+		<if test="modelNo != null and modelNo != ''">
+		               AND UPPER(A.MODEL_NO) LIKE CONCAT(UPPER(#{modelNo}),'%')
+		</if>
+		<if test="stDate != null and stDate != ''">
+		               AND A.REG_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
+		</if>
+		<if test="edDate != null and edDate != ''">
+		               AND A.REG_DT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
+		</if>
+		<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>
+		             ORDER BY A.UPD_DT DESC
+		<include refid="getListLimitPagingCondition_sql"/>
+	</select>
+
+	<!-- 사은품 등록 -->
+	<insert id="saveFreeGoods" parameterType="FreeGoods">
+		/* TssGoods.saveFreeGoods */
+		INSERT INTO TB_FREE_GOODS (
+		       PRODUCT_NO
+		     , PRODUCT_CODE
+		     , BRAND_CD
+		     , GOODS_NM
+		     , USE_YN
+		     , SYS_IMG_NM
+		     , REG_NO
+		     , REG_DT
+		     , UPD_NO
+		     , UPD_DT
+		)
+		VALUES (
+		       #{productNo}
+		     , #{productCode}
+		     , #{brandCd}
+		     , #{goodsNm}
+		     , #{useYn}
+		     , NULL
+		     , #{regNo}
+		     , NOW()
+		     , #{updNo}
+		     , NOW()
+		)
+		    ON DUPLICATE KEY UPDATE
+		       UPD_NO = #{updNo}
+		      ,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 AND INSTR(REPLACE(B.SKUMODELNO, ' ' , ''), '-') <![CDATA[<]]> 10 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='conditionList != null and conditionList.length>0'>
+		   AND (
+			<foreach collection="conditionList" item="item" index="index" separator="or">
+		        Z.GOODS_CD LIKE CONCAT(UPPER(#{item}),'%')
+			</foreach>
+		       )
+		</if>
+
+		<if test='conditionList2 != null and conditionList2.length>0'>
+		   AND (
+			<foreach collection="conditionList2" item="item2" index="index" separator="or">
+		        Z.PRODUCTNO LIKE CONCAT(UPPER(#{item2}),'%')
+			</foreach>
+		       )
+		</if>
+
+		<if test='conditionList3 != null and conditionList3.length>0'>
+		   AND (
+			<foreach collection="conditionList3" item="item3" index="index" separator="or">
+		        Z.SKUCODE LIKE CONCAT(UPPER(#{item3}),'%')
+			</foreach>
+		       )
+		</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 AND INSTR(REPLACE(B.SKUMODELNO, ' ' , ''), '-') <![CDATA[<]]> 10 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='conditionList != null and conditionList.length>0'>
+		                   AND (
+			<foreach collection="conditionList" item="item" index="index" separator="or">
+		                        Z.GOODS_CD LIKE CONCAT(UPPER(#{item}),'%')
+			</foreach>
+		                       )
+		</if>
+
+		<if test='conditionList2 != null and conditionList2.length>0'>
+		                   AND (
+			<foreach collection="conditionList2" item="item2" index="index" separator="or">
+		                        Z.PRODUCTNO LIKE CONCAT(UPPER(#{item2}),'%')
+			</foreach>
+		                       )
+		</if>
+
+		<if test='conditionList3 != null and conditionList3.length>0'>
+		                   AND (
+			<foreach collection="conditionList3" item="item3" index="index" separator="or">
+		                        Z.SKUCODE LIKE CONCAT(UPPER(#{item3}),'%')
+			</foreach>
+		                       )
+		</if>
+		                 ORDER BY LOTNO, DATEINCOME, SKUCODE
+		        ) Q
+		 LIMIT #{pageable.limitStartRow} ,  #{pageable.pageSize}
+	</select>
 </mapper>

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

@@ -19,6 +19,7 @@ import com.style24.persistence.domain.GoodsNotiInfo;
 import com.style24.persistence.domain.GoodsSafeNo;
 import com.style24.persistence.domain.GoodsSearch;
 import com.style24.persistence.domain.GoodsSupplyPrice;
+import com.style24.persistence.domain.IfIncomelot;
 import com.style24.persistence.domain.IfProductSku;
 import com.style24.persistence.domain.Itemkind;
 import com.style24.persistence.domain.NotiInfo;
@@ -720,4 +721,49 @@ public interface TssGoodsDao {
 	 */
 	int getBrandSupplyCount(Brand brand);
 
+	/**
+	 * WMS입고상품관리 목록 건수
+	 * @param WmsGoods
+	 * @return int
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	int getGoodsWmsIncomelotListCount(WmsGoods wmsGoods);
+
+	/**
+	 * WMS입고상품관리 목록 조회
+	 * @param WmsGoods
+	 * @return Collection<WmsGoods>
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	Collection<WmsGoods> getGoodsWmsIncomelotList(WmsGoods wmsGoods);
+
+	/**
+	 *  WMS 입고상품 사은품 등록
+	 * @param FreeGoods
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	void saveFreeGoods(FreeGoods freeGoods);
+
+	/**
+	 * WMS입고단품목록 건수
+	 * 
+	 * @param IfIncomelot
+	 * @return int
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	int getGoodsWmsIncomelotSkuListCount(IfIncomelot iIfIncomelot);
+
+	/**
+	 * WMS입고단품목록 조회
+	 * 
+	 * @param IfIncomelot
+	 * @return Collection<WmsGoods>
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	Collection<WmsGoods> getGoodsWmsIncomelotSkuList(IfIncomelot ifIncomelot);
 }

+ 72 - 0
src/main/java/com/style24/scm/biz/service/TssGoodsService.java

@@ -38,6 +38,7 @@ import com.style24.persistence.domain.GoodsNotiInfo;
 import com.style24.persistence.domain.GoodsSafeNo;
 import com.style24.persistence.domain.GoodsSearch;
 import com.style24.persistence.domain.GoodsSupplyPrice;
+import com.style24.persistence.domain.IfIncomelot;
 import com.style24.persistence.domain.IfProductSku;
 import com.style24.persistence.domain.Itemkind;
 import com.style24.persistence.domain.NotiInfo;
@@ -4738,4 +4739,75 @@ public class TssGoodsService {
 	public String getGoodsDefaultImageName(GoodsImg goodsImg) {
 		return goodsDao.getGoodsDefaultImageName(goodsImg);
 	}
+
+	/**
+	 * WMS입고상품관리 목록 건수
+	 *
+	 * @param WmsGoods
+	 * @return int
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	public int getGoodsWmsIncomelotListCount(WmsGoods wmsGoods) {
+		return goodsDao.getGoodsWmsIncomelotListCount(wmsGoods);
+	}
+
+	/**
+	 * WMS입고상품관리 목록 조회
+	 *
+	 * @param WmsGoods
+	 * @return Collection<WmsGoods>
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	public Collection<WmsGoods> getGoodsWmsIncomelotList(WmsGoods wmsGoods) {
+		return goodsDao.getGoodsWmsIncomelotList(wmsGoods);
+	}
+
+	/**
+	 * WMS 입고상품 사은품 등록
+	 * @param wmsGoodsList
+	 * @author eskim
+	 * @since 2021. 01. 05
+	 */
+	@Transactional("shopTxnManager")
+	public void saveFreeGoods(Collection<IfIncomelot> wmsGoodsList) {
+
+		for (IfIncomelot wmsGoods : wmsGoodsList) {
+			FreeGoods freeGoods = new FreeGoods();
+			freeGoods.setProductNo(Integer.parseInt(wmsGoods.getProductno()));
+			freeGoods.setProductCode(wmsGoods.getProductcode());
+			freeGoods.setGoodsNm(wmsGoods.getProductname());
+			freeGoods.setBrandCd(wmsGoods.getBrandCd());
+			freeGoods.setUseYn("Y");
+			freeGoods.setUpdNo(TssSession.getInfo().getUserNo());
+			freeGoods.setRegNo(TssSession.getInfo().getUserNo());
+			goodsDao.saveFreeGoods(freeGoods);
+
+		}
+	}
+
+	/**
+	 * WMS입고단품목록 건수
+	 *
+	 * @param IfIncomelot
+	 * @return int
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	public int getGoodsWmsIncomelotSkuListCount(IfIncomelot iIfIncomelot) {
+		return goodsDao.getGoodsWmsIncomelotSkuListCount(iIfIncomelot);
+	}
+
+	/**
+	 * WMS입고단품목록 조회
+	 *
+	 * @param IfIncomelot
+	 * @return Collection<WmsGoods>
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	public Collection<WmsGoods> getGoodsWmsIncomelotSkuList(IfIncomelot ifIncomelot) {
+		return goodsDao.getGoodsWmsIncomelotSkuList(ifIncomelot);
+	}
 }

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

@@ -1,6 +1,6 @@
 package com.style24.scm.biz.web;
 
-import java.awt.Image;
+import java.awt.*;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -9,9 +9,8 @@ import java.util.Collection;
 
 import javax.imageio.ImageIO;
 import javax.servlet.http.HttpServletRequest;
-import javax.swing.ImageIcon;
+import javax.swing.*;
 
-import com.style24.core.biz.service.TscExcelService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
@@ -36,6 +35,7 @@ import com.gagaframework.web.rest.server.GagaResponseStatus;
 import com.gagaframework.web.util.GagaDateUtil;
 import com.gagaframework.web.util.GagaFileUtil;
 import com.gagaframework.web.util.GagaStringUtil;
+import com.style24.core.biz.service.TscExcelService;
 import com.style24.core.support.env.TscConstants.GoodsType;
 import com.style24.core.support.message.TscMessageByLocale;
 import com.style24.persistence.TscPageRequest;
@@ -50,12 +50,14 @@ import com.style24.persistence.domain.GoodsNotiInfo;
 import com.style24.persistence.domain.GoodsSafeNo;
 import com.style24.persistence.domain.GoodsSearch;
 import com.style24.persistence.domain.GoodsSupplyPrice;
+import com.style24.persistence.domain.IfIncomelot;
 import com.style24.persistence.domain.Itemkind;
 import com.style24.persistence.domain.NotiInfo;
 import com.style24.persistence.domain.Notice;
 import com.style24.persistence.domain.NoticeGoods;
 import com.style24.persistence.domain.Option;
 import com.style24.persistence.domain.SupplyCompany;
+import com.style24.persistence.domain.WmsGoods;
 import com.style24.scm.biz.service.TssBusinessService;
 import com.style24.scm.biz.service.TssCommonService;
 import com.style24.scm.biz.service.TssGoodsService;
@@ -2080,4 +2082,130 @@ public class TssGoodsController extends TssBaseController {
 
 		return "";
 	}
+
+	/**
+	 * WMS입고상품관리 화면
+	 *
+	 * @return ModelAndView
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	@GetMapping("/wms/incomelot/form")
+	public ModelAndView wmsInstockForm() {
+		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/GoodsWmsIncomelotForm");
+
+		return mav;
+	}
+
+	/**
+	 * WMS입고상품관리 목록 조회
+	 *
+	 * @param WmsGoods
+	 * @return GagaMap
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	@PostMapping("/wms/incomelot/list")
+	@ResponseBody
+	public GagaMap getGoodsWmsIncomelotList(@RequestBody WmsGoods wmsGoods) {
+
+		GagaMap result = new GagaMap();
+
+		wmsGoods.setPageable(new TscPageRequest(wmsGoods.getPageNo() - 1, wmsGoods.getPageSize()));
+		wmsGoods.getPageable().setTotalCount(goodsService.getGoodsWmsIncomelotListCount(wmsGoods));
+
+		result.set("pageing", wmsGoods);
+		result.set("goodsList", goodsService.getGoodsWmsIncomelotList(wmsGoods));
+
+		return result;
+	}
+
+	/**
+	 * WMS 입고상품 사은품 등록
+	 *
+	 * @param Collection<IfIncomelot>
+	 * @return GagaResponse
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	@PostMapping("/free/goods/save")
+	@ResponseBody
+	public GagaResponse saveFreeGoods(@RequestBody Collection<IfIncomelot> wmsGoodsList) {
+		goodsService.saveFreeGoods(wmsGoodsList);
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+
+	/**
+	 * WMS입고단품목록 화면
+	 *
+	 * @return ModelAndView
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	@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입고단품목록 조회
+	 *
+	 * @param IfIncomelot
+	 * @return GagaMap
+	 * @author card007
+	 * @since 2021. 11. 25
+	 */
+	@PostMapping("/wms/incomelot/sku/list")
+	@ResponseBody
+	public GagaMap getWmsIncomelotSkuList(@RequestBody IfIncomelot ifIncomelot) {
+
+		GagaMap result = new GagaMap();
+
+		// multi row 검색관련 처리
+		if (!StringUtils.isBlank(ifIncomelot.getCondition())) {
+			ifIncomelot.setConditionList(ifIncomelot.getCondition().replaceAll("\r", "").trim().split("\n"));
+		}
+
+		// wms상품번호
+		if (!StringUtils.isBlank(ifIncomelot.getCondition2())) {
+			ifIncomelot.setConditionList2(ifIncomelot.getCondition2().replaceAll("\r", "").trim().split("\n"));
+		}
+
+		// sku코드
+		if (!StringUtils.isBlank(ifIncomelot.getCondition3())) {
+			ifIncomelot.setConditionList3(ifIncomelot.getCondition3().replaceAll("\r", "").trim().split("\n"));
+		}
+
+		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;
+	}
 }

+ 293 - 0
src/main/webapp/WEB-INF/views/goods/GoodsWmsIncomelotForm.html

@@ -0,0 +1,293 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : GoodsWmsIncomelotForm.html
+ * @desc    : WMS입고상품관리 화면
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2021 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.11.25   card007     최초 작성
+ *******************************************************************************
+ -->	
+	<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/list'}">
+		<input type="hidden" id="searchGb" name="searchGb" />
+ 		<!-- 패널 영역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="modelNo" name=modelNo 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: "brandCd", width: 100, cellClass: 'text-center'},
+		{headerName: "브랜드명", field: "brandEnm", width: 130, cellClass: 'text-center'},
+		{headerName: "WMS상품번호", field: "productNo", width: 120, cellClass: 'text-center'},
+		{headerName: "WMS상품코드", field: "productCode", width: 120, cellClass: 'text-center'},
+		{headerName: "WMS상품명", field: "productName", width: 300, cellClass: 'text-left'},
+		{headerName: "모델번호", field: "modelNo" , width: 120, cellClass: 'text-center'},
+		{headerName: "등록일시", field: "regDt", width: 150, cellClass: 'text-center',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
+			}
+		},
+		{headerName: "등록자", field: "regNm", width: 100, cellClass: 'text-center'
+			,valueFormatter: function(params) {
+				if (params.data.regNo == 0) {
+					return '배치';
+				}else{
+					return params.value;
+				}
+			}
+		},
+		{headerName: "수정일시", field: "updDt", width: 150, cellClass: 'text-center',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
+			}
+		},
+		{headerName: "수정자", field: "updNm", width: 100, cellClass: 'text-center'
+			,valueFormatter: function(params) {
+				if (params.data.updNo == 0) {
+					return '배치';
+				}else{
+					return params.value;
+				}
+			}
+		}
+	];
+	
+	// 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('BASIC');
+	});
+
+	// 조회
+	var fnGoodsWmsIncomelotListSearch = function(gbn) {
+
+		if (typeof(gbn) != 'undefined' &&  gbn == 'EXCEL'){
+			$("#goodsWmsIncomelotForm input[name=searchGb]").val("EXCEL");
+		}else{
+			$("#goodsWmsIncomelotForm input[name=searchGb]").val("BASIC");
+		}
+		
+		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($("#goodsWmsIncomelotForm input[name=searchGb]").val());
+	});
+	
+	
+	//검색 조건 확인
+	var fnConditionCheck = function(){
+		var formId = '#goodsWmsIncomelotForm';
+		var form = document.goodsWmsIncomelotForm;
+
+		if($("#goodsWmsIncomelotForm input[name=searchGb]").val() == "EXCEL") {
+			return true;
+		}
+		
+		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>

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

@@ -0,0 +1,300 @@
+<!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="70%"/>
+						<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 rowspan="2">상품코드<em class="required" title="필수"></em></th>
+						<td rowspan="2">
+							<textarea class="textareaR2 w100p" name="condition" id="condition"></textarea>
+						</td>
+					</tr>
+					<tr>
+						<th>입고일<em class="required" title="필수"></em></th>
+						<td id="sellTerms"></td>
+					</tr>
+					<tr>
+						<th>WMS상품번호</th>
+						<td >
+						<textarea class="textareaR2 w200" name="condition2" id="condition2"></textarea>
+						</td>
+						<th>SKU코드</th>
+						<td >
+						<textarea class="textareaR2 w100p" name="condition3" id="condition3"></textarea>
+						</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">
+					<button type="button" class="btn btn-primary btn-lg"  id="btnCreateFreeGoods">사은품 등록</button>
+					검색결과 : <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 = [
+		{width: 40, minWidth: 40, cellClass: 'text-right', headerCheckboxSelection: true, checkboxSelection: true, filter: false}, 
+		{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") == "textarea" || ($(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]'), "[전체]", "");
+	});
+	
+	// 사은품 등록 클릭시
+	$('#btnCreateFreeGoods').on('click', function() {
+		
+		//선택된 상품
+		var selectedData = gridOptions.api.getSelectedRows();
+		
+		if (selectedData.length == 0) {
+			mcxDialog.alert('선택된 행이 없습니다.');
+			return;
+		}
+		
+		mcxDialog.confirm('사은품 등록을 하시겠습니까?', {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function(){
+				var jsonData = JSON.stringify(selectedData);
+				gagajf.ajaxJsonSubmit('/goods/free/goods/save', jsonData, fnCreateFreeGoodsCollback);
+			}
+		});
+	});
+	
+	var fnCreateFreeGoodsCollback = function(result){
+		
+	}
+	
+	
+	$(document).ready(function() {
+
+		cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '등록일');
+		
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+	});
+
+/*]]>*/
+</script>
+ 	
+</html>