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

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

@@ -0,0 +1,43 @@
+package com.style24.admin.biz.dao;
+
+import java.util.Collection;
+
+import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.Itemkind;
+
+/**
+ * 상품관리 Dao
+ *
+ * @author eskim
+ * @since 2020. 10. 16
+ */
+@ShopDs
+public interface TsaGoodsDao {
+
+	/**
+	 * 품목 목록
+	 * @param itemkind
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	Collection<Itemkind> getItemkindList(Itemkind itemkind);
+
+	/**
+	 * 품목 저장(등록/저장)
+	 * @param itemkind - 품목 정보
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	void saveItemkindInfo(Itemkind itemkind);
+
+	/**
+	 * 품목 삭제
+	 * @param itemkind - 품목 정보
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	void deleteItemkindInfo(Itemkind itemkind);
+
+
+}

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

@@ -0,0 +1,76 @@
+package com.style24.admin.biz.service;
+
+import java.util.Collection;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.style24.admin.biz.dao.TsaGoodsDao;
+import com.style24.admin.support.security.session.TsaSession;
+import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.persistence.domain.Itemkind;
+
+import lombok.extern.slf4j.Slf4j;
+
+import com.gagaframework.web.util.GagaStringUtil;
+
+/**
+ *상품관리 Service
+ *
+ * @author eskim
+ * @since 2020. 10. 16
+ */
+@Service
+@Slf4j
+public class TsaGoodsService {
+
+	@Autowired
+	private TscMessageByLocale message;
+
+	@Autowired
+	private TsaGoodsDao goodsDao;
+
+	/**
+	 * 품목 목록
+	 * @param itemkind
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	public Collection<Itemkind> getItemkindList(Itemkind itemkind) {
+		return goodsDao.getItemkindList(itemkind);
+	}
+
+	/**
+	 * 품목 저장
+	 *
+	 * @param itemkindList - 품목 정보 목록
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@Transactional("shopTxnManager")
+	public void saveItemkindInfo(Collection<Itemkind> itemkindList) {
+		for (Itemkind itemkind : itemkindList) {
+			itemkind.setRegNo(TsaSession.getInfo().getUserNo());
+			itemkind.setUpdNo(TsaSession.getInfo().getUserNo());
+			itemkind.setItemkindNm(GagaStringUtil.replace(GagaStringUtil.replace(itemkind.getItemkindNm(), "&lt;", "<"),"&gt;", ">"));
+			//itemkind.setItemkindEnm(GagaStringUtil.replace(GagaStringUtil.replace(itemkind.getItemkindEnm(), "&lt;", "<"),"&gt;", ">"));
+			goodsDao.saveItemkindInfo(itemkind);
+		}
+	}
+
+	/**
+	 * 품목 삭제
+	 *
+	 * @param itemkindList - 품목 정보 목록
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@Transactional("shopTxnManager")
+	public void deleteItemkindInfo(Collection<Itemkind> itemkindList) {
+		for (Itemkind itemkind : itemkindList) {
+			goodsDao.deleteItemkindInfo(itemkind);
+		}
+	}
+}

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

@@ -0,0 +1,329 @@
+package com.style24.admin.biz.web;
+
+import java.util.Collection;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import com.style24.admin.biz.service.TsaGoodsService;
+import com.style24.admin.biz.service.TsaRendererService;
+import com.style24.admin.support.controller.TsaBaseController;
+import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.persistence.domain.Itemkind;
+
+import lombok.extern.slf4j.Slf4j;
+
+import com.gagaframework.web.rest.server.GagaResponse;
+
+/**
+ * 상품관리 Controller
+ *
+ * @author eskim
+ * @since 2020. 10. 16
+ */
+@Controller
+@RequestMapping("/goods")
+@Slf4j
+public class TsaGoodsController extends TsaBaseController {
+
+	@Autowired
+	private TscMessageByLocale message;
+
+	@Autowired
+	private TsaGoodsService goodsService;
+
+	@Autowired
+	private TsaRendererService rendererService;
+
+	/**
+	 * 품목관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/itemkind/base/form")
+	public ModelAndView itemkindBaseForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 정보고시 목록
+		mav.addObject("niClsfCdList", rendererService.getAvailCommonCodeList("G004"));
+
+		mav.setViewName("goods/ItemkindBaseForm");
+
+		return mav;
+	}
+
+	/**
+	 * 품목관리 조회
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@PostMapping("/itemkind/base/list")
+	@ResponseBody
+	public Collection<Itemkind> getItemkindList(@RequestBody Itemkind itemkind) {
+		return goodsService.getItemkindList(itemkind);
+	}
+
+	/**
+	 * 품목 관리 저장/등록
+	 *
+	 * @param itemkindList
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@PostMapping("/itemkind/save")
+	@ResponseBody
+	public GagaResponse saveItemkindInfo(@RequestBody Collection<Itemkind> itemkindList) {
+		goodsService.saveItemkindInfo(itemkindList);
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+
+	/**
+	 * 품목관리 삭제
+	 *
+	 * @param itemkindList
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@PostMapping("/itemkind/delete")
+	@ResponseBody
+	public GagaResponse deleteItemkindInfo(@RequestBody Collection<Itemkind> itemkindList) {
+		goodsService.deleteItemkindInfo(itemkindList);
+		return super.ok(message.getMessage("SUCC_0003"));
+	}
+
+	/**
+	 * 색상관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/color/form")
+	public ModelAndView colorForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/ColorForm");
+
+		return mav;
+	}
+
+	/**
+	 * 시즌관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/season/form")
+	public ModelAndView seasonForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/SeasonForm");
+
+		return mav;
+	}
+
+	/**
+	 * 고시정보관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/nofitinfo/form")
+	public ModelAndView notiinfoForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/NotiinfoForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품목록 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/list/form")
+	public ModelAndView listForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/GoodsListForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품 대량 등록 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/mass/register/form")
+	public ModelAndView massRegisterForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/GoodsMassRegisterForm");
+
+		return mav;
+	}
+
+	/**
+	 * WMS입고상품관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/wms/instock/form")
+	public ModelAndView wmsInstockForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/GoodsWmsInstockForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품품목관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/itemkind/form")
+	public ModelAndView itemkindForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/GoodsItemkindForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품 가격예약 관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/price/form")
+	public ModelAndView priceForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/GoodsPriceForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품 타이틀예약관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/title/reserve/form")
+	public ModelAndView titleReserveForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/GoodsTitleReserveForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품 동영상관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/video/form")
+	public ModelAndView videoForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/GoodsVideoForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품 EP제외상품관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/ep/skip/form")
+	public ModelAndView epSkipForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/GoodsEpSkipForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품 재입고알림관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/instock/alarm/form")
+	public ModelAndView instockAlarmForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/GoodsInstockAlarmForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품 예약판매관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/reserve/sell/form")
+	public ModelAndView reserveSellForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/GoodsReserveSellForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품 상세공지 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 10. 16
+	 */
+	@GetMapping("/detail/notice/form")
+	public ModelAndView detailNoticeForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/GoodsDetailNoticeForm");
+
+		return mav;
+	}
+
+}

+ 2 - 4
style24.admin/src/main/java/com/style24/persistence/domain/Itemkind.java

@@ -6,7 +6,7 @@ import lombok.Data;
 
 /**
  * 품목 Domain
- * 
+ *
  * @author gagamel
  * @since 2020. 10. 7
  */
@@ -14,11 +14,9 @@ import lombok.Data;
 @Data
 public class Itemkind extends TsaBaseDomain {
 
-	private String supplyCompCd;	// 공급업체코드
 	private String itemkindCd;		// 품목코드
 	private String itemkindNm;		// 품목명
-	private String itemkindEnm;		// 품목영문명
-	private String erpItemkindCd;	// ERP품목코드
+	//private String itemkindEnm;		// 품목영문명
 	private String niClsfCd;		// 고시분류코드
 	private String useYn;			// 사용여부
 

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

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.style24.admin.biz.dao.TsaGoodsDao">
+
+	<!-- 품목 목록 -->
+	<select id="getItemkindList" parameterType="Itemkind" resultType="Itemkind">
+		/* TsaGoods.getItemkindList */
+		SELECT ITEMKIND_CD
+		     , ITEMKIND_NM
+		     /* , ITEMKIND_ENM*/
+		     , NI_CLSF_CD
+		     , USE_YN
+		FROM TB_ITEMKIND
+		WHERE 1 = 1
+		<if test="itemkindCd != null and itemkindCd != ''">
+		AND ITEMKIND_CD = #{itemkindCd} 
+		</if>
+		<if test="useYn != null and useYn != ''">
+		AND USE_YN = #{useYn} 
+		</if>
+		ORDER BY ITEMKIND_CD
+	</select>
+
+	<!-- 품목 등록/저장 -->
+	<insert id="saveItemkindInfo" parameterType="Itemkind">
+		/* TsaGoods.saveItemkindInfo */
+		INSERT INTO TB_ITEMKIND (
+		       ITEMKIND_CD
+		     , ITEMKIND_NM
+		     , NI_CLSF_CD
+		     , USE_YN
+		     , REG_NO
+		     , REG_DT
+		     , UPD_NO
+		     , UPD_DT
+		)
+		VALUES (
+		       #{itemkindCd}
+		     , #{itemkindNm}
+		     , #{niClsfCd}
+		     , #{useYn}
+		     , #{regNo}
+		     , NOW()
+		     , #{updNo}
+		     , NOW()
+		)
+		ON DUPLICATE KEY UPDATE
+		       ITEMKIND_NM = #{itemkindNm}
+		     , NI_CLSF_CD = #{niClsfCd}
+		     , USE_YN = #{useYn}
+		     , UPD_NO = #{updNo}
+		     , UPD_DT = NOW()
+		     
+	</insert>
+	
+	<!-- 품목 삭제 -->
+	<delete id="deleteItemkindInfo" parameterType="Itemkind">
+		/* TsaGoods.deleteItemkindInfo */
+		DELETE FROM TB_ITEMKIND
+		 WHERE ITEMKIND_CD = #{itemkindCd}
+	</delete>
+</mapper>

+ 170 - 0
style24.admin/src/main/webapp/WEB-INF/views/goods/ItemkindBaseForm.html

@@ -0,0 +1,170 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : ItemkindBaseForm.html
+ * @desc    : 품목관리 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.10.16   eskim     최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+		
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc">
+		</div>
+		<!-- //메뉴 설명 -->
+		<form id="searchForm" name="searchForm" action="#" th:action="@{'/goods/itemkind/base/list'}" >
+			<div class="panelStyle">
+				<!-- 버튼 배치 영역 -->
+				<ul class="panelBar">
+					<li>
+						<button type="button" class="btn btn-dark btn-sm" id="btnAddRow">행추가</button>
+						<button type="button" class="btn btn-danger btn-sm" id="btnDeleteRow">행삭제</button>
+					</li>
+					<li  class="right">
+						<button type="button" class="btn btn-success btn-lg" id="btnSave">저장</button>
+					</li>
+				</ul>
+				<!-- //버튼 배치 영역 -->
+				
+				<div id="gridList" style="width: 100%; height: 650px" class="ag-theme-balham"></div>
+			</div>
+		</form>
+	</div>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	var useYnList = { "Y":"Yes", "N":"No" };
+	var niClsfCdList = gagajf.convertToArray([[${niClsfCdList}]]);
+
+	// specify the columns
+	var columnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
+		{headerName: "품목코드", field: "itemkindCd", width: 150, cellClass: 'text-center',
+			editable : function(params){return params.data.crud=='C' ? true : false;},
+			cellEditor: 'textCellEditor',
+			cellEditorParams: { required: true, onblur: '$(this).val($(this).val().toUpperCase())' }
+		},
+		{headerName: "품목명", field: "itemkindNm", width: 350, cellClass: 'text-center',
+			cellEditor: 'textCellEditor',
+			cellEditorParams: { maxlength: 50, required: true }
+		},
+		/* {headerName: "품목영문명", field: "itemkindEnm", width: 350, cellClass: 'text-center',
+			cellEditor: 'textCellEditor',
+			cellEditorParams: { maxlength: 50, required: true }
+		}, */
+		{headerName: "정보고시분류", field: "niClsfCd"	, width: 350, cellClass: 'text-center',
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(niClsfCdList), required: true },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(niClsfCdList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(niClsfCdList, params.newValue); }
+		},
+		{
+			headerName: "사용여부", field: "useYn", width: 100, minWidth: 75, cellClass: 'text-center',
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(useYnList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(useYnList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(useYnList, params.newValue); }
+		}
+	];
+
+	// Get GridOptions
+	var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// Grid editable
+	gridOptions.defaultColDef.editable = true;
+
+	// Add on options
+	gridOptions.suppressRowClickSelection = true;
+	gridOptions.rowSelection = 'multiple';
+
+	gridOptions.stopEditingWhenGridLosesFocus = true;
+
+	// 행추가
+	$('#btnAddRow').on('click', function() {
+		var data = { itemkindCd: null, itemkindNm: null, itemkindEnm: null, erpItemkindCd: null, useYn: "Y" };
+		gagaAgGrid.addRowData(gridOptions, data, "itemkindCd");
+	});
+
+	// 행삭제
+	$('#btnDeleteRow').on('click', function() {
+		var selectedData = gridOptions.api.getSelectedRows();
+		var removedData = gagaAgGrid.removeRowData(gridOptions);
+
+		if (selectedData.length == 0) {
+			mcxDialog.alert('선택된 행이 없습니다.');
+			return;
+		}
+
+		if (removedData.length > 0) {
+
+			mcxDialog.confirm('삭제하시겠습니까?', {
+				cancelBtnText: "취소",
+				sureBtnText: "확인",
+				sureBtnClick: function(){
+					var deleteData = [];
+
+					$.each(removedData, function(idx, item) {
+						deleteData.push(item);
+					});
+
+					var jsonData = JSON.stringify(deleteData);
+					gagajf.ajaxJsonSubmit('/goods/itemkind/delete', jsonData, fnSearch);
+				}
+			});
+		}
+	});
+
+	// 저장
+	$('#btnSave').on('click', function() {
+		// 변경된 데이터
+		var changedData = gagaAgGrid.getChangedData(gridOptions);
+
+		if (changedData.length == 0) {
+			mcxDialog.alert('변경된 데이터가 없습니다.');
+			return;
+		}
+
+		// Validation
+		if (!gagaAgGrid.validation(gridOptions, changedData))
+			return;
+	
+		mcxDialog.confirm('저장하시겠습니까?', {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function(){
+				var jsonData = JSON.stringify(changedData);
+				gagajf.ajaxJsonSubmit('/goods/itemkind/save', jsonData, fnSearch);
+			}
+		});
+
+	});
+
+	$(document).ready(function() {
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+		
+		fnSearch();
+	});
+
+	var fnSearch = function() {
+		var formId = "#searchForm";
+		gagaAgGrid.fetch($(formId).prop('action'), gridOptions, formId);
+	}
+
+/*]]>*/
+</script>
+
+</html>