Ver código fonte

Merge branch 'develop' into bin2107

bin2107 5 anos atrás
pai
commit
da3c15da8d

+ 2 - 0
src/main/java/com/style24/persistence/domain/Batch.java

@@ -19,6 +19,8 @@ public class Batch extends TscBaseDomain {
 	private String bizGb;		// 업무구분
 	private String batchFrq;	// 배치주기
 	private String batchDesc;	// 배치설명
+	private String batchUrl;	// 배치URL
+	private String batchStat;	// 배치상태
 	private String useYn;		// 사용여부
 
 	// 배치 목록 검색조건

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

@@ -2979,7 +2979,7 @@
 	<!-- 동영상  수정 -->
 	<update id="updateGoodsVideo" parameterType="GoodsVideo">
 		/* TsaGoods.saveGoodsVideo */
-		UPDATE TB_VIDEO SET
+		UPDATE TB_GOODS_VIDEO SET
 		           DISP_YN = #{dispYn}
 		         , VIDEO_GB = #{videoGb}
 		         , KMC_KEY = #{kmcKey}

+ 8 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaSystem.xml

@@ -781,6 +781,8 @@
 		     , BIZ_GB
 		     , BATCH_FRQ
 		     , BATCH_DESC
+		     , BATCH_URL
+		     , BATCH_STAT
 		     , USE_YN
 		FROM   TB_BATCH
 		WHERE  1 = 1
@@ -809,6 +811,7 @@
 		     , BIZ_GB
 		     , BATCH_FRQ
 		     , BATCH_DESC
+		     , BATCH_URL
 		     , USE_YN
 		     , REG_NO
 		     , REG_DT
@@ -821,6 +824,7 @@
 		     , #{bizGb}
 		     , #{batchFrq}
 		     , #{batchDesc}
+		     , #{batchUrl}
 		     , #{useYn}
 		     , #{regNo}
 		     , NOW()
@@ -832,6 +836,7 @@
 		     , BIZ_GB = #{bizGb}
 		     , BATCH_FRQ = #{batchFrq}
 		     , BATCH_DESC = #{batchDesc}
+		     , BATCH_URL = #{batchUrl}
 		     , USE_YN = #{useYn}
 		     , UPD_NO = #{updNo}
 		     , UPD_DT = NOW()
@@ -851,6 +856,9 @@
 		FROM   TB_BATCH B
 		     , TB_BATCH_LOG BL
 		WHERE  B.BATCH_ID = BL.BATCH_ID
+		<if test="batchId != null and batchId != ''">
+		AND    B.BATCH_ID = #{batchId}
+		</if>
 		<if test="bizGb != null and bizGb != ''">
 		AND    B.BIZ_GB = #{bizGb}
 		</if>

+ 1 - 0
src/main/resources/config/application-locd.yml

@@ -19,6 +19,7 @@ logging:
 domain:
     admin: //ldadmin.style24.com
     front: //ldfront.style24.com
+    batch: //ldbatch.style24.com
     image: //ldimage.style24.com
     uximage: //ldadmin.style24.com
 

+ 5 - 4
src/main/resources/config/application-locp.yml

@@ -17,10 +17,11 @@ logging:
     config: classpath:log/logback-locp.xml
     
 domain:
-    admin: //lpadmin.wivismall.com
-    wivis: //lpfront.wivismall.com
-    image: //image.wivismall.com/speedy_image-wivismall
-    uximage: //lpadmin.wivismall.com
+    admin: //lpadmin.style24.com
+    front: //lpfront.style24.com
+    batch: //lpbatch.style24.com
+    image: //lpimage.style24.com
+    uximage: //lpadmin.style24.com
 
 upload:
     dext.target.path: /WIDE/workspace/files/data/style24/dext

+ 2 - 1
src/main/resources/config/application-run.yml

@@ -28,7 +28,8 @@ logging.config: classpath:log/logback-run.xml
 
 domain:
     admin: //bos.style24.com
-    style24: //www.style24.com
+    front: //www.style24.com
+    batch: //batch.style24.com
     image: //image.istyle24.com/Upload
     uximage: //bos.style24.com
 

+ 1 - 2
src/main/resources/config/application-style.yml

@@ -30,10 +30,9 @@ logging:
 
 domain:
     admin: //bos.style24.com
-    style24: //www.style24.com
     front: //www.style24.com
+    batch: //batch.style24.com
     image: //image.istyle24.com/Upload
-    cdnimage: //image.istyle24.com/Upload
     uximage: //bos.style24.com
 
 upload:

+ 66 - 4
src/main/webapp/WEB-INF/views/system/BatchForm.html

@@ -29,6 +29,8 @@
 		<div class="panelStyle">
 			<!-- Search -->
 			<form id="searchForm" name="searchForm" action="#" th:action="@{'/system/batch/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+				<input type="hidden" name="batchId"/>
+				
 				<table class="frmStyle" aria-describedby="검색조건">
 					<colgroup>
 						<col style="width:10%;"/>
@@ -138,6 +140,12 @@
 									<textarea class="textareaR2" name="batchDesc"></textarea>
 								</td>
 							</tr>
+							<tr>
+								<th>배치URL</th>
+								<td colspan="3">
+									<input type="text" name="batchUrl" placeholder="" maxlength="100"/>
+								</td>
+							</tr>
 							<tr>
 								<th>사용여부<em class="required" title="필수"></em></th>
 								<td colspan="3">
@@ -179,7 +187,7 @@
 		},
 		{headerName: "배치명", field: "batchNm", width: 200},
 		{
-			headerName: "업무구분", field: "bizGb", width: 80, cellClass: 'text-center',
+			headerName: "업무구분", field: "bizGb", width: 100, cellClass: 'text-center',
 			cellRenderer: function (params) { return gagaAgGrid.lookupValue(bizGbList, params.value); }
 		},
 		{
@@ -192,7 +200,25 @@
 				return batchFrqNm;
 			}
 		},
+		{headerName: "상태", field: "batchStat", width: 80, cellClass: 'text-center', hide: true},
+		{
+			headerName: "실행", field: "btnNm", width: 120, cellClass: 'text-center',
+			cellRenderer: function(params) {
+				let btnNm = '';
+				if (params.data.useYn == 'N') {
+					btnNm = '미사용';
+				} else {
+					if (gagajf.isNull(params.data.batchStat) || params.data.batchStat == 'F') {
+						btnNm = '<button type="button" class="btn btn-base btn-lg" onclick="fnExcuteBatch(\'' + params.data.batchId + '\',\'' + params.data.batchStat + '\',\'' + params.data.batchUrl + '\');">실행</button>';
+					} else {
+						btnNm = '실행중';
+					}
+				}
+				return btnNm;
+			}
+		},
 		{headerName: "배치설명", field: "batchDesc", width: 400, hide: true},
+		{headerName: "배치URL", field: "batchUrl", width: 200},
 		{headerName: "사용여부", field: "useYn", width: 80, cellClass: 'text-center'}
 	];
 	
@@ -233,9 +259,10 @@
 
 	// Cell Click
 	gridOptions1.onCellClicked = function(event) {
-		if (event.colDef.field != 'batchId')
-			return;
-
+		if (event.colDef.field != 'batchId') {
+			return false;
+		}
+		
 		$('#detailForm input[name=mode]').val('U');
 		$('#detailForm input[name=batchId]').val(event.data.batchId);
 		$('#detailForm input[name=batchId]').attr('readonly', true);
@@ -243,6 +270,7 @@
 		$('#detailForm select[name=bizGb]').val(event.data.bizGb);
 		$('#detailForm select[name=batchFrq]').val(event.data.batchFrq);
 		$('#detailForm textarea[name=batchDesc]').val(event.data.batchDesc);
+		$('#detailForm input[name=batchUrl]').val(event.data.batchUrl);
 
 		if (event.data.useYn == 'Y') {
 			$("#detailForm input:checkbox[name=chkUseYn]").prop('checked', true);
@@ -253,6 +281,34 @@
 		}
 		
 		$('#detailForm input:checkbox[name=chkUseYn]').attr('readonly', false);
+		
+		// 배치로그 조회
+		fnGetBatchLogByBatchId(event.data.batchId);
+	}
+	
+	// 배치 실행
+	var fnExcuteBatch = function(batchId, batchStat, batchUrl) {
+		if (batchStat == 'I') {
+			mcxDialog.alert("실행중입니다. 종료되면 실행해 주세요.");
+			return false;
+		}
+		
+		if (gagajf.isNull(batchUrl)) {
+			mcxDialog.alert("배치URL 정보가 없습니다. 등록 후 실행해 주세요.");
+			return false;
+		}
+		
+		mcxDialog.confirm("배치는 몇 분이 소요될 수 있으며 나중에 확인하셔야 할 수도 있습니다.<br/>계속 진행하시겠습니까?", {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function() {
+				let actionUrl = [[${@environment.getProperty('domain.batch')}]] + batchUrl;
+				$.get(actionUrl, function(result) {
+					// 배치로그 조회
+					fnGetBatchLogByBatchId(batchId);
+				});
+			}
+		});
 	}
 
 	// 조회
@@ -295,6 +351,12 @@
 			}
 		});
 	});
+	
+	// 배치로그 조회
+	var fnGetBatchLogByBatchId = function(batchId) {
+		$('#searchForm input[name=batchId]').val(batchId);
+		gagaAgGrid.fetch('/system/batch/log/list', gridOptions2, '#searchForm');
+	}
 
 	$(document).ready(function() {
 		cfnCreateCalendar('#terms', 'batchStdt', 'batchEddt');