소스 검색

매출반영 실패건 재전송 기능 로직 수정

gagamel 4 년 전
부모
커밋
87710dfe19

+ 10 - 6
src/main/java/com/style24/admin/biz/web/TsaSettleController.java

@@ -515,14 +515,18 @@ public class TsaSettleController extends TsaBaseController {
 	public GagaResponse uploadHansaeFailedSales(@RequestBody Erp erp) {
 		log.info("{}", erp);
 
-		// 매출반영 실패건 ERP 옵션 정보로 Update
-		int updCnt = settleService.updateFailedSalesUploadListToErpInfo(erp);
-		if (updCnt == 0) {
-			throw new IllegalStateException("매출반영 실패건 중 ERP 옵션 정보가 변경된 건이 없습니다.");
-		}
-
 		// 매출반영 실패한 브랜드 목록 (브랜드 단위로 처리를 위해)
 		Collection<String> brandList = settleService.getFailedSalesUploadBrandList(erp);
+		if (brandList == null || brandList.isEmpty()) {
+			throw new IllegalStateException((HansaeErp.ErpGb.HANSAE_MK.value().equals(erp.getErpGb()) ? "한세MK" : "한세드림")
+				+ "의 판매기간(" + erp.getStartDt() + "~" + erp.getEndDt() + ") 내에 매출반영 실패건이 없습니다.");
+		}
+
+		// 매출반영 실패건 ERP 옵션 정보로 Update
+		int updCnt = settleService.updateFailedSalesUploadListToErpInfo(erp);
+//		if (updCnt == 0) {
+//			throw new IllegalStateException("매출반영 실패건 중 ERP 옵션 정보가 변경된 건이 없습니다.");
+//		}
 
 		for (String brandCd : brandList) {
 			erp.setBrandCd(brandCd);

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

@@ -833,6 +833,7 @@
 		AND    CD_SALEBILL IS NULL
 		AND    DS_ERROR IS NOT NULL
 		</if>
+		ORDER  BY ERP_GB, DT_SALE, BRAND_CD, CD_STYLE, CD_COLOR, CD_SIZE
 	</select>
 	
 	<!-- 한세스타일매핑 정보 -->
@@ -914,7 +915,7 @@
 		                         AND    CD_COLOR = HS.CD_COLOR
 		                         AND    CD_SIZE = HS.CD_SIZE
 		                        ),CD_SIZE)
-		WHERE  ERP_GB = #{ERP_GB}
+		WHERE  ERP_GB = #{erpGb}
 		AND    DT_SALE BETWEEN REPLACE(#{startDt},'-','') AND REPLACE(#{endDt},'-','')
 		AND    CD_SALEBILL IS NULL /*매출반영후실패한넘*/
 		AND    DS_ERROR IS NOT NULL /*매출반영후실패한넘*/

+ 8 - 8
src/main/webapp/WEB-INF/views/settle/HansaeSalesUploadForm.html

@@ -109,10 +109,10 @@
 <script th:inline="javascript">
 /*<![CDATA[*/
 	let columnDefs = [
-		{
-			width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false,
-			checkboxSelection: function (params) { return !gagajf.isNull(params.data.dsError) ? true : false; }
-		},
+// 		{
+// 			width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false,
+// 			checkboxSelection: function (params) { return !gagajf.isNull(params.data.dsError) ? true : false; }
+// 		},
 		{
 			headerName: "ERP구분", field: "erpGb", width: 80, cellClass: 'text-center',
 			cellRenderer: function(params) { return params.value == 'hsmk' ? '한세MK' : '한세드림'; }
@@ -123,8 +123,8 @@
 			cellRenderer: function(params) { return params.value == '1' ? '판매' : '환불'; }
 		},
 		{ headerName: "스타일코드", field: "cdStyle", width: 120, cellClass: 'text-center' },
-		{ headerName: "색상코드", field: "cdColor", width: 100, cellClass: 'text-center' },
-		{ headerName: "사이즈코드", field: "cdSize", width: 100, cellClass: 'text-center' },
+		{ headerName: "색상코드", field: "cdColor", width: 80, cellClass: 'text-center' },
+		{ headerName: "사이즈코드", field: "cdSize", width: 90, cellClass: 'text-center' },
 		{
 			headerName: "판매수량", field: "qtSale", width: 100, cellClass: 'text-center',
 			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
@@ -135,7 +135,7 @@
 			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
 			cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
 		},
-		{ headerName: "I/F번호", field: "ifNo", width: 200, cellClass: 'text-center' },
+		{ headerName: "I/F번호", field: "noIf", width: 150, cellClass: 'text-center' },
 		{ headerName: "판매전표번호", field: "cdSalebill", width: 150, cellClass: 'text-center' },
 		{ 
 			headerName: "실패메시지", field: "dsError", width: 300,
@@ -250,7 +250,7 @@
 					endDt : $('#endDt').val()
 				});
 				
-				gagajf.ajaxJsonSubmit('/settle/failedSales/list/upload', jsonData, function() {
+				gagajf.ajaxJsonSubmit('/settle/hansae/failedSales/upload', jsonData, function() {
 					$('#btnSearch').trigger('click');
 				});
 			}