diff --git a/WebContent/WEB-INF/classes/com/pms/mapper/admin.xml b/WebContent/WEB-INF/classes/com/pms/mapper/admin.xml index 173d937..eb291e3 100644 --- a/WebContent/WEB-INF/classes/com/pms/mapper/admin.xml +++ b/WebContent/WEB-INF/classes/com/pms/mapper/admin.xml @@ -8525,4 +8525,251 @@ FROM ( ORDER BY V.PATH + + + + + + + + + + + + + + + + + + + + INSERT INTO WAREHOUSE_LOCATION + ( + OBJID, + LOCATION_CODE, + LOCATION_NAME, + LOCATION_DESCRIPTION, + OUT_CODE, + OUT_CO_NAME, + FIT_STATUS, + AVAILABLE_STATUS, + USE_STATUS, + BASE_LOC_CD, + CO_CD, + LOC_NMK, + INSERT_ID, + INSERT_IP, + INSERT_DT, + MODIFY_ID, + MODIFY_IP, + MODIFY_DT, + ATTR_NMK, + WRITER, + REGDATE, + STATUS + ) + VALUES + ( + #{objid}::numeric, + #{location_code}, + #{location_name}, + #{location_description}, + #{out_code}, + #{out_co_name}, + #{fit_status}, + #{available_status}, + COALESCE(#{use_status}, 'Y'), + #{base_loc_cd}, + #{co_cd}, + #{loc_nmk}, + #{insert_id}, + #{insert_ip}, + CASE WHEN #{insert_dt} = '' THEN NOW() ELSE COALESCE(#{insert_dt}::timestamp, NOW()) END, + #{modify_id}, + #{modify_ip}, + CASE WHEN #{modify_dt} = '' THEN NULL ELSE #{modify_dt}::timestamp END, + #{attr_nmk}, + #{writer}, + NOW(), + COALESCE(#{status}, 'ACTIVE') + ) + ON CONFLICT (OBJID) DO UPDATE + SET + LOCATION_CODE = #{location_code}, + LOCATION_NAME = #{location_name}, + LOCATION_DESCRIPTION = #{location_description}, + OUT_CODE = #{out_code}, + OUT_CO_NAME = #{out_co_name}, + FIT_STATUS = #{fit_status}, + AVAILABLE_STATUS = #{available_status}, + USE_STATUS = #{use_status}, + BASE_LOC_CD = #{base_loc_cd}, + CO_CD = #{co_cd}, + LOC_NMK = #{loc_nmk}, + MODIFY_ID = #{modify_id}, + MODIFY_IP = #{modify_ip}, + MODIFY_DT = CASE WHEN #{modify_dt} = '' THEN NOW() ELSE COALESCE(#{modify_dt}::timestamp, NOW()) END, + ATTR_NMK = #{attr_nmk}, + STATUS = #{status} + + + + + INSERT INTO WAREHOUSE_LOCATION_HISTORY + SELECT + #{objid}::numeric, + #{targetObjid}::numeric, + LOCATION_CODE, + LOCATION_NAME, + LOCATION_DESCRIPTION, + OUT_CODE, + OUT_CO_NAME, + FIT_STATUS, + AVAILABLE_STATUS, + USE_STATUS, + BASE_LOC_CD, + CO_CD, + LOC_NMK, + INSERT_ID, + INSERT_IP, + INSERT_DT, + MODIFY_ID, + MODIFY_IP, + MODIFY_DT, + ATTR_NMK, + #{writer}, + NOW(), + STATUS + FROM + WAREHOUSE_LOCATION + WHERE + OBJID = #{targetObjid}::numeric + + + + + + + + DELETE FROM + WAREHOUSE_LOCATION + WHERE + OBJID = #{OBJID}::numeric + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebContent/WEB-INF/view/admin/clientMng/clientMngHistoryList.jsp b/WebContent/WEB-INF/view/admin/clientMng/clientMngHistoryList.jsp new file mode 100644 index 0000000..148310a --- /dev/null +++ b/WebContent/WEB-INF/view/admin/clientMng/clientMngHistoryList.jsp @@ -0,0 +1,182 @@ + + +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="com.pms.common.utils.*"%> +<%@ page import="java.util.*" %> +<%@include file= "/init.jsp" %> + + + + +<%=Constants.SYSTEM_NAME%> + + + + + + + + + + + + +
+ +
+
+

창고관리 이력

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
위치코드위치명위치설명가출고코드가출고거래처명적합여부가용재고여부사용여부BASELOC_CDCO_CDLOC_NMKINSERT_IDINSERT_IPINSERT_DTMODIFY_IDMODIFY_IPMODIFY_DTATTR_NMK
${info.LOCATION_CODE}${info.LOCATION_NAME}${info.LOCATION_DESCRIPTION}${info.OUT_CODE}${info.OUT_CO_NAME}${info.FIT_STATUS}${info.AVAILABLE_STATUS}${info.USE_STATUS}${info.BASE_LOC_CD}${info.CO_CD}${info.LOC_NMK}${info.INSERT_ID}${info.INSERT_IP}${info.INSERT_DT}${info.MODIFY_ID}${info.MODIFY_IP}${info.MODIFY_DT}${info.ATTR_NMK}
조회된 정보가 없습니다.
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
prev   prev   ${nPage}   ${status.index}   nextnext
+

총 ${totalCount}건

+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/WebContent/WEB-INF/view/admin/clientMng/clientMngList.jsp b/WebContent/WEB-INF/view/admin/clientMng/clientMngList.jsp new file mode 100644 index 0000000..bbf1538 --- /dev/null +++ b/WebContent/WEB-INF/view/admin/clientMng/clientMngList.jsp @@ -0,0 +1,287 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="com.pms.common.utils.*"%> +<%@ page import="java.util.*" %> +<%@include file= "/init.jsp" %> +<% + String searchLocationCode = CommonUtils.checkNull(request.getParameter("searchLocationCode")); + String searchLocationName = CommonUtils.checkNull(request.getParameter("searchLocationName")); +%> + + + + +<%=Constants.SYSTEM_NAME%> + + + + + + +
+ +
+
+ +
+
+
+

+ 일반거래처 관리 +

+
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ + <%@include file="/WEB-INF/view/common/common_gridArea.jsp" %> + +
+
+
+ + \ No newline at end of file diff --git a/WebContent/WEB-INF/view/admin/clientMng/clientMngListFormPopUp.jsp b/WebContent/WEB-INF/view/admin/clientMng/clientMngListFormPopUp.jsp new file mode 100644 index 0000000..69be840 --- /dev/null +++ b/WebContent/WEB-INF/view/admin/clientMng/clientMngListFormPopUp.jsp @@ -0,0 +1,482 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="com.pms.common.utils.*"%> +<%@include file="/init.jsp"%> + + + +<%=Constants.SYSTEM_NAME%> + + + +
+
+

일반 거래처 등록/수정

+
+
+
+ + "> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ +
+
+ + diff --git a/WebContent/WEB-INF/view/admin/warehouseList/warehouseHistoryList.jsp b/WebContent/WEB-INF/view/admin/warehouseList/warehouseHistoryList.jsp new file mode 100644 index 0000000..148310a --- /dev/null +++ b/WebContent/WEB-INF/view/admin/warehouseList/warehouseHistoryList.jsp @@ -0,0 +1,182 @@ + + +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="com.pms.common.utils.*"%> +<%@ page import="java.util.*" %> +<%@include file= "/init.jsp" %> + + + + +<%=Constants.SYSTEM_NAME%> + + + + + + + + + + + + +
+ +
+
+

창고관리 이력

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
위치코드위치명위치설명가출고코드가출고거래처명적합여부가용재고여부사용여부BASELOC_CDCO_CDLOC_NMKINSERT_IDINSERT_IPINSERT_DTMODIFY_IDMODIFY_IPMODIFY_DTATTR_NMK
${info.LOCATION_CODE}${info.LOCATION_NAME}${info.LOCATION_DESCRIPTION}${info.OUT_CODE}${info.OUT_CO_NAME}${info.FIT_STATUS}${info.AVAILABLE_STATUS}${info.USE_STATUS}${info.BASE_LOC_CD}${info.CO_CD}${info.LOC_NMK}${info.INSERT_ID}${info.INSERT_IP}${info.INSERT_DT}${info.MODIFY_ID}${info.MODIFY_IP}${info.MODIFY_DT}${info.ATTR_NMK}
조회된 정보가 없습니다.
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
prev   prev   ${nPage}   ${status.index}   nextnext
+

총 ${totalCount}건

+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/WebContent/WEB-INF/view/admin/warehouseList/warehouseListFormPopUp.jsp b/WebContent/WEB-INF/view/admin/warehouseList/warehouseListFormPopUp.jsp new file mode 100644 index 0000000..4deadb9 --- /dev/null +++ b/WebContent/WEB-INF/view/admin/warehouseList/warehouseListFormPopUp.jsp @@ -0,0 +1,180 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="com.pms.common.utils.*"%> +<%@include file="/init.jsp"%> + + + +<%=Constants.SYSTEM_NAME%> + + + +
+
+

창고 등록/수정

+
+
+
+ + "> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
위치코드
위치명
위치설명
가출고코드
가출고거래처명
적합여부 + +
가용재고여부 + +
사용여부 + +
BASELOC_CD
CO_CD
LOC_NMK
INSERT_ID
INSERT_IP
INSERT_DT
MODIFY_ID
MODIFY_IP
MODIFY_DT
ATTR_NMK
+
+
+
+ +
+
+ + \ No newline at end of file diff --git a/WebContent/WEB-INF/view/admin/warehouseList/warehouseMngList.jsp b/WebContent/WEB-INF/view/admin/warehouseList/warehouseMngList.jsp new file mode 100644 index 0000000..b15ad20 --- /dev/null +++ b/WebContent/WEB-INF/view/admin/warehouseList/warehouseMngList.jsp @@ -0,0 +1,166 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="com.pms.common.utils.*"%> +<%@ page import="java.util.*" %> +<%@include file= "/init.jsp" %> +<% + String searchLocationCode = CommonUtils.checkNull(request.getParameter("searchLocationCode")); + String searchLocationName = CommonUtils.checkNull(request.getParameter("searchLocationName")); +%> + + + + +<%=Constants.SYSTEM_NAME%> + + + + + + +
+ +
+
+ +
+
+
+

+ 창고 관리 +

+
+ + + +
+
+
+ + + + + + + + + +
+
+ + <%@include file="/WEB-INF/view/common/common_gridArea.jsp" %> + +
+
+
+ + \ No newline at end of file diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp index 08b0d86..4f8a505 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp @@ -255,6 +255,7 @@ var columns = [ return Number(value).toLocaleString(); } }, + /* 수주수량 컬럼 주석처리 {headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '수주수량', field : 'ORDER_QUANTITY', formatter: function(cell) { var value = cell.getValue(); @@ -262,6 +263,7 @@ var columns = [ return Number(value).toLocaleString(); } }, + */ {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '유/무상', field : 'PAID_TYPE' }, // {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '제품구분', field : 'PRODUCT_NAME' }, // {headerHozAlign : 'center', hozAlign : 'center', width : '88', title : '국내/해외', field : 'AREA_NAME' }, diff --git a/WebContent/WEB-INF/view/contractMgmt/orderMgmtList.jsp b/WebContent/WEB-INF/view/contractMgmt/orderMgmtList.jsp index 81c819d..f27f2fb 100644 --- a/WebContent/WEB-INF/view/contractMgmt/orderMgmtList.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/orderMgmtList.jsp @@ -155,13 +155,15 @@ var columns = [ }, {headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '고객사', field : 'CUSTOMER_NAME' }, {headerHozAlign : 'center', hozAlign : 'left', width : '180', title : '품명', field : 'ITEM_SUMMARY' }, - {headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '견적수량', field : 'ESTIMATE_QUANTITY', - formatter: function(cell) { - var value = cell.getValue(); - if(!value || value === '' || value === '0') return ''; - return Number(value).toLocaleString(); - } - }, + /* 견적수량 컬럼 주석처리 + {headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '견적수량', field : 'ESTIMATE_QUANTITY', + formatter: function(cell) { + var value = cell.getValue(); + if(!value || value === '' || value === '0') return ''; + return Number(value).toLocaleString(); + } + }, + */ {headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '수주수량', field : 'ORDER_QUANTITY', formatter: function(cell) { var value = cell.getValue(); diff --git a/WebContent/WEB-INF/view/salesmgmt/salesMgmt/salesMgmtList.jsp b/WebContent/WEB-INF/view/salesmgmt/salesMgmt/salesMgmtList.jsp index 061fca3..ab44c2f 100644 --- a/WebContent/WEB-INF/view/salesmgmt/salesMgmt/salesMgmtList.jsp +++ b/WebContent/WEB-INF/view/salesmgmt/salesMgmt/salesMgmtList.jsp @@ -564,7 +564,7 @@ function fn_bulkRegister(){
- +
diff --git a/WebContent/WEB-INF/view/salesmgmt/salesMgmt/transactionStatementForm.jsp b/WebContent/WEB-INF/view/salesmgmt/salesMgmt/transactionStatementForm.jsp index f5de57b..d938648 100644 --- a/WebContent/WEB-INF/view/salesmgmt/salesMgmt/transactionStatementForm.jsp +++ b/WebContent/WEB-INF/view/salesmgmt/salesMgmt/transactionStatementForm.jsp @@ -244,22 +244,50 @@ body { .amount-text { font-size: 13pt; font-weight: bold; - flex: 2; + flex: 3; text-align: right; + padding-right: 10px; +} + +.amount-won-wrapper { + display: flex; + align-items: center; + justify-content: center; + flex: 1; + padding: 4px 8px; + font-size: 9pt; +} + +.amount-won-text { + font-size: 9pt; + font-weight: normal; + margin-right: 4px; } .amount-won-symbol { - font-size: 16pt; + font-size: 9pt; + font-weight: normal; +} + +.amount-number-wrapper { + display: flex; + align-items: center; + justify-content: flex-start; + flex: 2; + padding: 4px 8px; +} + +.amount-number-wrapper .amount-won-symbol { + font-size: 15pt; font-weight: bold; - flex: 0.5; - text-align: center; + margin-right: 4px; } .amount-number { font-size: 15pt; font-weight: bold; - flex: 2; text-align: right; + flex: 1; } /* 품목 테이블 */ @@ -525,7 +553,7 @@ function fn_loadEmptyStatement(gridData) { $("#totalQuantity").text("0"); $("#totalSupplyPrice").text("0"); $("#totalVat").text("0"); - $("#totalText").text("0"); + $("#totalText").text("영"); $("#totalNum").text("0"); // contenteditable 셀 변경 시 합계 자동 업데이트 @@ -593,14 +621,14 @@ function fn_loadSavedStatement(projectNo, gridData) { tbody.append(row); } - // 합계 업데이트 - $("#totalQuantity").text(totalQuantity); - $("#totalSupplyPrice").text(fn_num(totalSupply)); - $("#totalVat").text(fn_num(Math.round(totalVat))); - - var total = totalSupply + totalVat; - $("#totalText").text(Math.round(total).toString()); - $("#totalNum").text(fn_num(Math.round(total))); + // 합계 업데이트 + $("#totalQuantity").text(totalQuantity); + $("#totalSupplyPrice").text(fn_num(totalSupply)); + $("#totalVat").text(fn_num(Math.round(totalVat))); + + var total = totalSupply + totalVat; + $("#totalText").text(fn_numberToKorean(Math.round(total))); + $("#totalNum").text(fn_num(Math.round(total))); // contenteditable 셀 변경 시 합계 자동 업데이트 fn_attachCellListeners(); @@ -767,7 +795,7 @@ function fn_fillData(data) { console.log("총 세액:", totalVat); console.log("총 금액:", total); - $("#totalText").text(total.toString()); + $("#totalText").text(fn_numberToKorean(total)); $("#totalNum").text(fn_num(total)); // 비고에 S/N 정보 표시 @@ -829,7 +857,7 @@ function fn_recalculateTotal() { // 상단 합계 금액 업데이트 var total = totalSupply + totalVat; - $("#totalText").text(total.toString()); + $("#totalText").text(fn_numberToKorean(total)); $("#totalNum").text(fn_num(total)); } @@ -837,6 +865,46 @@ function fn_num(n) { return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } +// 숫자를 한글로 변환하는 함수 +function fn_numberToKorean(num) { + if(num === 0) return "영"; + + var units = ["", "만", "억", "조"]; + var smallUnits = ["", "십", "백", "천"]; + var numbers = ["", "일", "이", "삼", "사", "오", "육", "칠", "팔", "구"]; + + var result = ""; + var unitIndex = 0; + + while(num > 0) { + var part = num % 10000; + if(part > 0) { + var partStr = ""; + var digit = 0; + + while(part > 0) { + var n = part % 10; + if(n > 0) { + // 1은 십, 백, 천 앞에서 생략 (예: 십, 백, 천) + if(n === 1 && digit > 0) { + partStr = smallUnits[digit] + partStr; + } else { + partStr = numbers[n] + smallUnits[digit] + partStr; + } + } + part = Math.floor(part / 10); + digit++; + } + + result = partStr + units[unitIndex] + result; + } + num = Math.floor(num / 10000); + unitIndex++; + } + + return result; +} + function fn_save() { if(!confirm("수정한 내용을 저장하시겠습니까?")) { return; @@ -1000,10 +1068,15 @@ function fn_close() {
(공급가액+세액) - 3300000 원정 - - - 3,300,000 + 3300000 + + 원정 + + + + + 3,300,000 +
diff --git a/src/com/pms/controller/AdminController.java b/src/com/pms/controller/AdminController.java index 22b1e92..d58f65a 100644 --- a/src/com/pms/controller/AdminController.java +++ b/src/com/pms/controller/AdminController.java @@ -562,6 +562,7 @@ public class AdminController extends BaseService { return "/ajax/ajaxResult"; } + /** * 고객사 목록을 가져온다. * @param request @@ -1044,6 +1045,14 @@ public class AdminController extends BaseService { } + + + + + + + + @SuppressWarnings("unchecked") @ResponseBody @@ -1350,6 +1359,287 @@ public class AdminController extends BaseService { return "/ajax/ajaxResult"; } + + + + + + /** + * 창고 관리 조회 (JSP 페이지 로딩) 11월 18일 이희진 + * + * @param request + * @param paramMap + * @return + */ + @RequestMapping("/admin/warehouseList.do") + public String getwarehouseList(HttpServletRequest request, @RequestParam Map paramMap){ + return "/admin/warehouseList/warehouseMngList"; + } + + /** + * 창고 관리 조회 (Tabulator Grid용 JSON) 11월 20일 이희진 + * + * @param request + * @param paramMap + * @return + */ + @RequestMapping(value="/admin/warehouseListPagingGridList.do", produces="application/json") + @ResponseBody + public Map getwarehouseListPagingGrid(HttpServletRequest request, @RequestParam Map paramMap){ + commonService.selectListPagingNew("admin.getWarehouseList", request, paramMap); + return paramMap; + } + + /** + * 창고관리 저장 시 중복 여부를 확인한다. 11월 18일 이희진 + * @param request + * @param paramMap + * @return + */ + @RequestMapping("/admin/checkDuplicateWarehouseList.do") + public String checkDuplicateWarehouseList(HttpServletRequest request, @RequestParam Map paramMap){ + ArrayList> existList = new ArrayList(); + try{ + existList = adminService.getDuplicateWarehouseListInfo(request, paramMap); + }catch(Exception e){ + e.printStackTrace(); + } + request.setAttribute("RESULT", CommonUtils.getJsonArray(CommonUtils.toUpperCaseMapKey(existList))); + + return "/ajax/ajaxResult"; + } + + +/** + * 창고 관리 등록 팝업 11월 19일 이희진 + * + * @param request + * @param paramMap + * @return + */ + @RequestMapping("/admin/warehouseListFormPopUp.do") + public String warehouseListFormPopUp(HttpServletRequest request, @RequestParam Map paramMap){ + HashMap info = new HashMap(); + try{ + if(!"".equals(CommonUtils.checkNull(request.getParameter("objid")))){ + info = (HashMap)adminService.getWarehouseListInfo(request, paramMap); + info = CommonUtils.toUpperCaseMapKey(info); + } + }catch(Exception e){ + e.printStackTrace(); + } + request.setAttribute("info", info); + request.setAttribute("OBJID", CommonUtils.checkNull(request.getParameter("objid"))); + return "/admin/warehouseList/warehouseListFormPopUp"; + } + + + /** + * 창고 관리 변경이력 11월 18일 이희진 + * + */ + // @RequestMapping("/admin/warehouseHistoryList.do") + // public String warehouseHistoryList(HttpServletRequest request, @RequestParam Map paramMap){ + // List> list = new ArrayList(); + // try{ + // list = adminService.warehouseHistoryList(request, paramMap); + // }catch(Exception e){ + // e.printStackTrace(); + // } + // request.setAttribute("LIST", CommonUtils.toUpperCaseMapKey(list)); + // return "/admin/warehouseList/warehouseHistoryList"; + // } + + /** + * 창고 관리 데이터를 저장한다. 11월 19일 이희진 + * + * @param request + * @param paramMap + * @return + */ + @RequestMapping("/admin/saveWarehouseListInfo.do") + public String saveWarehouseListInfo(HttpServletRequest request, @RequestParam Map paramMap){ + HashMap resultMap = new HashMap(); + try{ + + ArrayList existList = adminService.getDuplicateWarehouseListInfo(request, paramMap); + if(null != existList && 0 < existList.size()){ + resultMap = CommonUtils.setReqAttrResultMsg(request, "중복된 창고명이 존재 합니다.", "false", null,null); + }else{ + adminService.saveWarehouseListInfo(request, paramMap); + resultMap = CommonUtils.setReqAttrResultMsg(request, "저장하였습니다.", "true", null,null); + } + }catch(Exception e){ + e.printStackTrace(); + resultMap = CommonUtils.setReqAttrResultMsg(request, "오류가 발생하였습니다.", "false", e,null); + } + request.setAttribute("RESULT", CommonUtils.getJsonMap(resultMap)); + + return "/ajax/ajaxResult"; + } + +/** + * 창고 관리 삭제 11월 19일 이희진 + * @param request + * @param paramMap + * @return + */ +@RequestMapping("/admin/deleteWarehouse.do") +public String deleteWarehouse(HttpServletRequest request, @RequestParam Map paramMap){ + HashMap resultMap = new HashMap(); + try{ + adminService.deleteWarehouse(request, paramMap); + resultMap.put("result", true); + resultMap.put("msg", "삭제되었습니다."); + }catch(Exception e){ + e.printStackTrace(); + resultMap.put("result", false); + resultMap.put("msg", "삭제 중 오류가 발생했습니다."); + } + request.setAttribute("RESULT", CommonUtils.getJsonMap(resultMap)); + return "/ajax/ajaxResult"; +} + +// 일반거래처 11월 20일 이희진 + + + +/** + * 일반거래처 관리 조회 (JSP 페이지 로딩) 11월 20일 이희진 + * + * @param request + * @param paramMap + * @return + */ + @RequestMapping("/admin/clientMngList.do") + public String getclientMngList(HttpServletRequest request, @RequestParam Map paramMap){ + return "/admin/clientMng/clientMngList"; + } + + /** + * 일반거래처 관리 조회 (Tabulator Grid용 JSON) 11월 20일 이희진 + * + * @param request + * @param paramMap + * @return + */ + @RequestMapping(value="/admin/clientMngListPagingGridList.do", produces="application/json") + @ResponseBody + public Map getclientMngListPagingGrid(HttpServletRequest request, @RequestParam Map paramMap){ + commonService.selectListPagingNew("admin.getClientMngList", request, paramMap); + return paramMap; + } + + /** + * 일반거래처 관리 저장 시 중복 여부를 확인한다. 11월 20일 이희진 + * @param request + * @param paramMap + * @return + */ + @RequestMapping("/admin/checkDuplicateClientMngList.do") + public String checkDuplicateClientMngList(HttpServletRequest request, @RequestParam Map paramMap){ + ArrayList> existList = new ArrayList(); + try{ + existList = adminService.getDuplicateClientMngListInfo(request, paramMap); + }catch(Exception e){ + e.printStackTrace(); + } + request.setAttribute("RESULT", CommonUtils.getJsonArray(CommonUtils.toUpperCaseMapKey(existList))); + + return "/ajax/ajaxResult"; + } + + +/** + * 일반거래처 관리 등록 팝업 11월 20일 이희진 + * + * @param request + * @param paramMap + * @return + */ + @RequestMapping("/admin/clientMngListFormPopUp.do") + public String clientMngListFormPopUp(HttpServletRequest request, @RequestParam Map paramMap){ + HashMap info = new HashMap(); + try{ + // 임시 주석 - DB 테이블 생성 후 활성화 + //if(!"".equals(CommonUtils.checkNull(request.getParameter("objid")))){ + // info = (HashMap)adminService.getClientMngListInfo(request, paramMap); + // info = CommonUtils.toUpperCaseMapKey(info); + //} + }catch(Exception e){ + e.printStackTrace(); + } + request.setAttribute("info", info); + request.setAttribute("OBJID", CommonUtils.checkNull(request.getParameter("objid"))); + return "/admin/clientMng/clientMngListFormPopUp"; + } + /** + * 일반거래처 관리 데이터를 저장한다. 11월 20일 이희진 + * + * @param request + * @param paramMap + * @return + */ + @RequestMapping("/admin/saveClientMngInfo.do") + public String saveClientMngInfo(HttpServletRequest request, @RequestParam Map paramMap){ + HashMap resultMap = new HashMap(); + try{ + + ArrayList existList = adminService.getDuplicateClientMngListInfo(request, paramMap); + if(null != existList && 0 < existList.size()){ + resultMap = CommonUtils.setReqAttrResultMsg(request, "중복된 일반거래처명이 존재 합니다.", "false", null,null); + }else{ + adminService.saveClientMngInfo(request, paramMap); + resultMap = CommonUtils.setReqAttrResultMsg(request, "저장하였습니다.", "true", null,null); + } + }catch(Exception e){ + e.printStackTrace(); + resultMap = CommonUtils.setReqAttrResultMsg(request, "오류가 발생하였습니다.", "false", e,null); + } + request.setAttribute("RESULT", CommonUtils.getJsonMap(resultMap)); + + return "/ajax/ajaxResult"; + } + +/** + * 일반거래처 관리 삭제 11월 20일 이희진 + * @param request + * @param paramMap + * @return + */ +@RequestMapping("/admin/deleteClient.do") +public String deleteClient(HttpServletRequest request, @RequestParam Map paramMap){ + HashMap resultMap = new HashMap(); + try{ + adminService.deleteClient(request, paramMap); + resultMap.put("result", true); + resultMap.put("msg", "삭제되었습니다."); + }catch(Exception e){ + e.printStackTrace(); + resultMap.put("result", false); + resultMap.put("msg", "삭제 중 오류가 발생했습니다."); + } + request.setAttribute("RESULT", CommonUtils.getJsonMap(resultMap)); + return "/ajax/ajaxResult"; +} + + + + +// 일반거래처 11월 20일 이희진 + + + + + + + + + + + + + /** * 카테고리의 목록을 가져온다. * @return diff --git a/src/com/pms/mapper/admin.xml b/src/com/pms/mapper/admin.xml index 173d937..eb291e3 100644 --- a/src/com/pms/mapper/admin.xml +++ b/src/com/pms/mapper/admin.xml @@ -8525,4 +8525,251 @@ FROM ( ORDER BY V.PATH + + + + + + + + + + + + + + + + + + + + INSERT INTO WAREHOUSE_LOCATION + ( + OBJID, + LOCATION_CODE, + LOCATION_NAME, + LOCATION_DESCRIPTION, + OUT_CODE, + OUT_CO_NAME, + FIT_STATUS, + AVAILABLE_STATUS, + USE_STATUS, + BASE_LOC_CD, + CO_CD, + LOC_NMK, + INSERT_ID, + INSERT_IP, + INSERT_DT, + MODIFY_ID, + MODIFY_IP, + MODIFY_DT, + ATTR_NMK, + WRITER, + REGDATE, + STATUS + ) + VALUES + ( + #{objid}::numeric, + #{location_code}, + #{location_name}, + #{location_description}, + #{out_code}, + #{out_co_name}, + #{fit_status}, + #{available_status}, + COALESCE(#{use_status}, 'Y'), + #{base_loc_cd}, + #{co_cd}, + #{loc_nmk}, + #{insert_id}, + #{insert_ip}, + CASE WHEN #{insert_dt} = '' THEN NOW() ELSE COALESCE(#{insert_dt}::timestamp, NOW()) END, + #{modify_id}, + #{modify_ip}, + CASE WHEN #{modify_dt} = '' THEN NULL ELSE #{modify_dt}::timestamp END, + #{attr_nmk}, + #{writer}, + NOW(), + COALESCE(#{status}, 'ACTIVE') + ) + ON CONFLICT (OBJID) DO UPDATE + SET + LOCATION_CODE = #{location_code}, + LOCATION_NAME = #{location_name}, + LOCATION_DESCRIPTION = #{location_description}, + OUT_CODE = #{out_code}, + OUT_CO_NAME = #{out_co_name}, + FIT_STATUS = #{fit_status}, + AVAILABLE_STATUS = #{available_status}, + USE_STATUS = #{use_status}, + BASE_LOC_CD = #{base_loc_cd}, + CO_CD = #{co_cd}, + LOC_NMK = #{loc_nmk}, + MODIFY_ID = #{modify_id}, + MODIFY_IP = #{modify_ip}, + MODIFY_DT = CASE WHEN #{modify_dt} = '' THEN NOW() ELSE COALESCE(#{modify_dt}::timestamp, NOW()) END, + ATTR_NMK = #{attr_nmk}, + STATUS = #{status} + + + + + INSERT INTO WAREHOUSE_LOCATION_HISTORY + SELECT + #{objid}::numeric, + #{targetObjid}::numeric, + LOCATION_CODE, + LOCATION_NAME, + LOCATION_DESCRIPTION, + OUT_CODE, + OUT_CO_NAME, + FIT_STATUS, + AVAILABLE_STATUS, + USE_STATUS, + BASE_LOC_CD, + CO_CD, + LOC_NMK, + INSERT_ID, + INSERT_IP, + INSERT_DT, + MODIFY_ID, + MODIFY_IP, + MODIFY_DT, + ATTR_NMK, + #{writer}, + NOW(), + STATUS + FROM + WAREHOUSE_LOCATION + WHERE + OBJID = #{targetObjid}::numeric + + + + + + + + DELETE FROM + WAREHOUSE_LOCATION + WHERE + OBJID = #{OBJID}::numeric + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/pms/service/AdminService.java b/src/com/pms/service/AdminService.java index 6d48056..cf16422 100644 --- a/src/com/pms/service/AdminService.java +++ b/src/com/pms/service/AdminService.java @@ -2354,6 +2354,303 @@ public class AdminService extends BaseService { return CommonUtils.toUpperCaseMapKey(resultList); } + + + +//-------------11월 19일 이희진------------- + + /** + * 창고관리 데이터를 저장한다. + * @param request + * @param paramMap + * @return + */ + public String saveWarehouseListInfo(HttpServletRequest request,Map paramMap){ + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(); + String objid = ""; + try{ + HttpSession session = request.getSession(); + PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN); + String writer = CommonUtils.checkNull(person.getUserId()); + paramMap.put("writer", writer); + + objid = CommonUtils.checkNull(request.getParameter("objid")); + if("".equals(objid)){ + objid = CommonUtils.createObjId(); + paramMap.put("objid", objid); + } + + if(!"".equals(objid)){ + sqlSession.update("admin.mergewarehouseListInfo",paramMap); + + //이력 + paramMap.put("objid", CommonUtils.createObjId()); + paramMap.put("targetObjid", objid); + + sqlSession.insert("admin.insertwarehouseListHistory",paramMap); + } + }catch(Exception e){ + throw e; + }finally{ + sqlSession.close(); + } + return objid; + } + + /** + * 창고관리 중복확인 시 사용 + * @param request + * @param paramMap + * @return + */ + public ArrayList> getDuplicateWarehouseListInfo(HttpServletRequest request,Map paramMap){ + ArrayList> resultList = new ArrayList(); + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(); + try{ + resultList = (ArrayList)sqlSession.selectList("admin.getDuplicateWarehouseListInfo",paramMap); + }catch(Exception e){ + throw e; + }finally{ + sqlSession.close(); + } + return CommonUtils.toUpperCaseMapKey(resultList); + } + + /** + * 창고데이터를 가져온다 (단건) + * @param request + * @param paramMap + * @return + */ + public HashMap getWarehouseListInfo(HttpServletRequest request,Map paramMap){ + HashMap warehouseMap = new HashMap(); + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(); + try{ + String objid = CommonUtils.checkNull(request.getParameter("objid")); + + if("".equals(objid)){ + objid = CommonUtils.checkNull(request.getAttribute("objid")); + } + paramMap.put("OBJID", objid); + warehouseMap = sqlSession.selectOne("admin.getWarehouseListInfo",paramMap); + + }catch(Exception e){ + throw e; + }finally{ + sqlSession.close(); + } + return warehouseMap; + } + + /** + * 창고관리 이력 목록을 가져온다. + * @param request + * @param paramMap + * @return + */ + public List> warehouseHistoryList(HttpServletRequest request, Map paramMap){ + List> resultList = new ArrayList(); + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(); + try{ + resultList = sqlSession.selectList("admin.warehouseHistoryList", paramMap); + }catch(Exception e){ + throw e; + }finally{ + sqlSession.close(); + } + return resultList; + } + + + /** + * 창고관리 목록을 조회한다 + * @param request + * @param paramMap + * @return + */ + public ArrayList> getWarehouseList(HttpServletRequest request, Map paramMap){ + ArrayList> resultList = new ArrayList(); + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(); + try{ + resultList = (ArrayList)sqlSession.selectList("admin.getWarehouseList", paramMap); + }catch(Exception e){ + throw e; + }finally{ + sqlSession.close(); + } + return CommonUtils.toUpperCaseMapKey(resultList); +} + + /** + * 창고관리 데이터를 삭제한다. + * @param request + * @param paramMap + */ + public void deleteWarehouse(HttpServletRequest request,Map paramMap){ + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(); + try{ + // paramMap에 이미 OBJID가 들어있음 (AJAX에서 보낸 값) + sqlSession.delete("admin.deleteWarehouse",paramMap); + }catch(Exception e){ + throw e; + }finally{ + sqlSession.close(); + } + } + + + //-------------11월 19일 이희진------------- + + +/** + * 일반거래처 관리 데이터를 저장한다. + * @param request + * @param paramMap + * @return + */ + public String saveClientMngInfo(HttpServletRequest request,Map paramMap){ + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(); + String objid = ""; + try{ + HttpSession session = request.getSession(); + PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN); + String writer = CommonUtils.checkNull(person.getUserId()); + paramMap.put("writer", writer); + + objid = CommonUtils.checkNull(request.getParameter("objid")); + if("".equals(objid)){ + objid = CommonUtils.createObjId(); + paramMap.put("objid", objid); + } + + if(!"".equals(objid)){ + sqlSession.update("admin.mergeClientMngInfo",paramMap); + + //이력 + paramMap.put("objid", CommonUtils.createObjId()); + paramMap.put("targetObjid", objid); + + sqlSession.insert("admin.insertClientMngHistory",paramMap); + } + }catch(Exception e){ + throw e; + }finally{ + sqlSession.close(); + } + return objid; + } + + /** + * 일반거래처 관리 중복확인 시 사용 + * @param request + * @param paramMap + * @return + */ + public ArrayList> getDuplicateClientMngListInfo(HttpServletRequest request,Map paramMap){ + ArrayList> resultList = new ArrayList(); + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(); + try{ + resultList = (ArrayList)sqlSession.selectList("admin.getDuplicateClientMngListInfo",paramMap); + }catch(Exception e){ + throw e; + }finally{ + sqlSession.close(); + } + return CommonUtils.toUpperCaseMapKey(resultList); + } + + /** + * 일반거래처 관리 데이터를 가져온다 (단건) + * @param request + * @param paramMap + * @return + */ + public HashMap getClientMngListInfo(HttpServletRequest request,Map paramMap){ + HashMap clientMngMap = new HashMap(); + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(); + try{ + String objid = CommonUtils.checkNull(request.getParameter("objid")); + + if("".equals(objid)){ + objid = CommonUtils.checkNull(request.getAttribute("objid")); + } + paramMap.put("OBJID", objid); + clientMngMap = sqlSession.selectOne("admin.getClientMngListInfo",paramMap); + + }catch(Exception e){ + throw e; + }finally{ + sqlSession.close(); + } + return clientMngMap; + } + + /** + * 일반거래처 관리 이력 목록을 가져온다. + * @param request + * @param paramMap + * @return + */ + public List> clientMngHistoryList(HttpServletRequest request, Map paramMap){ + List> resultList = new ArrayList(); + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(); + try{ + resultList = sqlSession.selectList("admin.clientMngHistoryList", paramMap); + }catch(Exception e){ + throw e; + }finally{ + sqlSession.close(); + } + return resultList; + } + + + /** + * 일반거래처 관리 목록을 조회한다 + * @param request + * @param paramMap + * @return + */ + public ArrayList> getClientMngList(HttpServletRequest request, Map paramMap){ + ArrayList> resultList = new ArrayList(); + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(); + try{ + resultList = (ArrayList)sqlSession.selectList("admin.getClientMngList", paramMap); + }catch(Exception e){ + throw e; + }finally{ + sqlSession.close(); + } + return CommonUtils.toUpperCaseMapKey(resultList); +} + + /** + * 일반거래처 관리 데이터를 삭제한다. + * @param request + * @param paramMap + */ + public void deleteClient(HttpServletRequest request,Map paramMap){ + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(); + try{ + // paramMap에 이미 OBJID가 들어있음 (AJAX에서 보낸 값) + sqlSession.delete("admin.deleteClient",paramMap); + }catch(Exception e){ + throw e; + }finally{ + sqlSession.close(); + } + } + +//-------------11월 20일 이희진------------- + + + + + + + + + /** * 기술자료 카레고리 데이터를 삭제한다. * @param request