Преглед на файлове

Merge branch 'develop' of http://112.172.147.34:4936/style24/style24.core into develop

jsshin преди 4 години
родител
ревизия
5058798cec

+ 16 - 6
src/main/java/com/style24/core/biz/service/TscOrderChangeService.java

@@ -193,6 +193,9 @@ public class TscOrderChangeService {
 		// 3. 주문변경정보, 주문정보, 환불정보 (배송정책코드 별)
 		List<Payment> pgList = new ArrayList<>();
 		List<GiftCard> cashReceiptsList = new ArrayList<>();
+		
+		log.info("cancelDelvRefundList.size() ::: {}", cancelDelvRefundList.size());
+		
 		for (Order obj : cancelDelvRefundList) {
 			// 취소금액 있을 시 처리
 			if (obj.getCnclRtnAmt() > 0) {
@@ -318,8 +321,6 @@ public class TscOrderChangeService {
 							orderDetailItem.setRegNo(userNo);
 							orderDetailItem.setUpdNo(userNo);
 							orderDetailItem.setOrdDtlStat(ordDtlStat);
-
-							orderChangeDao.updateOrderDetailItem(orderDetailItem);
 							
 							// 2021.06.25 취소완료 (취소) (정산구분값추가)
 							// 품절취소
@@ -335,6 +336,8 @@ public class TscOrderChangeService {
 
 							orderChangeDao.createOrderDetailItemHst(orderDetailItem);
 
+							orderChangeDao.updateOrderDetailItem(orderDetailItem);
+
 							index++;
 						}
 
@@ -458,7 +461,7 @@ public class TscOrderChangeService {
 					orderChangeDao.createSellQty(orderChange);
 				}
 
-				// 3-4. PG 결제 취소 정보 설정 (상품권으로만 결제 시 PG점프)
+				// 3-4. PG 결제 취소 정보 설정 (상품권으로만 결제 시 PG점프)				
 				int spanRealCnclRtnAmt = obj.getRealOrdAmt();			// 취소금액합계
 				int sumDeliveryFee = obj.getDelvFee();					// 배송비합계
 				int spanDelvCpnDcAmt = obj.getDelvCpnDcAmt();			// 배송비쿠폰금액
@@ -512,6 +515,9 @@ public class TscOrderChangeService {
 				pg.setRegNo(userNo);
 				pg.setUpdNo(userNo);
 				
+				log.info("pg.getPartCancelAmt() ::: {}", pg.getPartCancelAmt());
+				log.info("pg.getLeftAmt() ::: {}", pg.getLeftAmt());
+				
 				if (spanRefundAmt > 0) {
 					pgList.add(pg);
 				}
@@ -1583,9 +1589,13 @@ public class TscOrderChangeService {
 		orderChangeDao.createOrderDetailHstForAllCancel(orderDetail);
 
 		// 주문상세단품정보 수정 및 이력 등록
-		orderChangeDao.updateOrderDetailItemForAllCancel(orderDetail);
+		// 2021.06.25 전체취소 (취소완료) (정산구분값추가)
+		orderDetail.setOrdChgSq(ordChgSq);
+		orderDetail.setOrdDtlStat(TscConstants.OrdDtlItemStat.SALE_RETURN_CANCEL.value());
 		orderChangeDao.createOrderDetailItemHstForAllCancel(orderDetail);
 		
+		orderChangeDao.updateOrderDetailItemForAllCancel(orderDetail);
+		
 		// 10. WMS 취소 처리
 		List<Order> wmsList = new ArrayList<>();
 		if(orderChange.getOrdDtlNoArr() != null && orderChange.getOrdDtlNoArr().length > 0) {
@@ -2094,8 +2104,6 @@ public class TscOrderChangeService {
 							orderDetailItem.setRegNo(userNo);
 							orderDetailItem.setUpdNo(userNo);
 							orderDetailItem.setOrdDtlStat(ordDtlStat);
-
-							orderChangeDao.updateOrderDetailItem(orderDetailItem);
 							
 							// 2021.06.25 환불컨펌 (반품완료) (정산구분값추가)
 							orderDetailItem.setOrdDtlStat(TscConstants.OrdDtlItemStat.SALE_RETURN_RETURN_COMPLETE.value());
@@ -2103,6 +2111,8 @@ public class TscOrderChangeService {
 							orderDetailItem.setOrdChgSq(ordChgSq);
 							orderChangeDao.createOrderDetailItemHst(orderDetailItem);
 
+							orderChangeDao.updateOrderDetailItem(orderDetailItem);
+
 							index++;
 						}
 

+ 30 - 19
src/main/java/com/style24/core/biz/service/TscShoplinkerService.java

@@ -892,19 +892,11 @@ public class TscShoplinkerService {
 			}
 
 			// 생성 파일삭제
-			// GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(map.getXmlPath(), xmlFileName.toString()));
+			GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(map.getXmlPath(), xmlFileName.toString()));
 
 		} catch (Exception e) {
 			log.error("error", e);
-			// 임시
-			StringBuilder xmlFileName = new StringBuilder();
-			xmlFileName.append(fileNm+"_"+fileAddNm).append(".xml");
-			String xmlPath = GagaFileUtil.getConcatenationPath(map.getXmlPath(), xmlFileName.toString());
-			String xmlUrl = GagaFileUtil.getConcatenationPath(map.getDomainUrl(), xmlFileName.toString());
-			String slFolder = GagaFileUtil.getConcatenationPath(env.getProperty("shoplinker.xml.path"));
-			File slPath = new File(slFolder);
-			map.setXmlTxt(slPath.exists()+"\n"+xmlPath+"\n"+xmlUrl+"\n\n"+sbRequest.toString());
-			//map.setXmlTxt(sbRequest.toString());
+			map.setXmlTxt(sbRequest.toString());
 			map.setApiResult("error");
 			map.setApiMessage("API 통신오류");
 		}
@@ -1004,7 +996,7 @@ public class TscShoplinkerService {
 		currentlyPage = map.getInt("currentlyPage");
 		currListCount = map.getInt("currListCount");
 
-		slkSearch.setTxt(shoplinkerOrder.getApiStDate()+ " 총페이지: "+totalPage+ "("+totalCount+"건) || "+currentlyPage);
+		slkSearch.setTxt("["+shoplinkerOrder.getInfoStr()+"]"+ " 총페이지: "+totalPage+ "("+totalCount+"건) || "+currentlyPage);
 		updateCallApiRunable(slkSearch);
 
 		if( currentlyPage < 1 ) currentlyPage = 1;
@@ -1068,9 +1060,14 @@ public class TscShoplinkerService {
 			*/
 			sbRequest.append("			<customer_id>").append("a0021915").append("</customer_id>\n");
 			sbRequest.append("			<shoplinker_id><![CDATA[").append("yes2424").append("]]></shoplinker_id>\n");
-			sbRequest.append("			<order_flag>004</order_flag>\n");// 테스트용
-			sbRequest.append("			<st_date>").append(shoplinkerOrder.getApiStDate().replace("-", "")).append("</st_date>\n");
-			sbRequest.append("			<ed_date>").append(shoplinkerOrder.getApiStDate().replace("-", "")).append("</ed_date>\n");
+			sbRequest.append("			<order_flag>004</order_flag>\n"); // 테스트용
+			sbRequest.append("			<st_date>").append(shoplinkerOrder.getStDate().replace("-", "")).append("</st_date>\n");
+			sbRequest.append("			<ed_date>").append(shoplinkerOrder.getEdDate().replace("-", "")).append("</ed_date>\n");
+			if( "BATCH".equals(shoplinkerOrder.getAcType())){
+				sbRequest.append("			<sdt_time>").append(shoplinkerOrder.getStTime()).append("</sdt_time>\n");
+				sbRequest.append("			<edt_time>").append(shoplinkerOrder.getEdTime()).append("</edt_time>\n");
+			}
+
 			sbRequest.append("			<page_no>").append(shoplinkerOrder.getOrderPageNo()).append("</page_no>\n");
 
 			sbRequest.append("		</Order>\n");
@@ -1171,8 +1168,8 @@ public class TscShoplinkerService {
 
 			}else {
 				// 테스트용
-				xmlUrl = "http://ts5000.ipdisk.co.kr:8999/shoplinker/order/0409/order_real_"+shoplinkerOrder.getOrderPageNo()+".xml";
-				xmlUrl = "http://ts5000.ipdisk.co.kr:8999/shoplinker/order/order_time.xml";
+				xmlUrl = "http://ts5000.ipdisk.co.kr:8999/shoplinker/order/0528/order_real_"+shoplinkerOrder.getOrderPageNo()+".xml";
+				//xmlUrl = "http://ts5000.ipdisk.co.kr:8999/shoplinker/order/order_time.xml";
 
 				try {
 					// API 호출
@@ -1259,7 +1256,7 @@ public class TscShoplinkerService {
 			returnMap.setString("RESULT_TYPE", "TRUE");
 
 			// 생성 파일삭제
-			GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(shoplinkerOrder.getXmlPath(), xmlFileName.toString()));
+			// GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(shoplinkerOrder.getXmlPath(), xmlFileName.toString()));
 
 		}catch(Exception e) {
 			log.error("xml 생성오류 ", e);
@@ -1479,7 +1476,12 @@ public class TscShoplinkerService {
 					resultMsg = (com.gagaframework.shoplinker.domain.invoice.ResultMessage)shoplinkerUtil.unmarshal(com.gagaframework.shoplinker.domain.invoice.ResultMessage.class, responseXmlData);
 
 					apiHstMap.setApiType("INVOICE");
-					apiHstMap.setXmlTxt(sbRequest.toString());
+
+					String slFolder = GagaFileUtil.getConcatenationPath(env.getProperty("shoplinker.xml.path")+"/invoice");
+					File slPath = new File(slFolder);
+					apiHstMap.setXmlTxt(slPath.exists()+"\n"+xmlPath+"\n"+xmlUrl+"\n\n"+sbRequest.toString());
+
+					//apiHstMap.setXmlTxt(sbRequest.toString());
 					apiHstMap.setOrdDtlNo(info.getOrdDtlNo());
 					apiHstMap.setApiResult(resultMsg.getResult());
 					apiHstMap.setApiMessage(resultMsg.getMessage());
@@ -1490,7 +1492,16 @@ public class TscShoplinkerService {
 				} catch (Exception e) {
 					log.error("error", e);
 					apiHstMap.setApiType("INVOICE");
-					apiHstMap.setXmlTxt(sbRequest.toString());
+
+					StringBuilder xmlFileName = new StringBuilder();
+					xmlFileName.append("invoice_"+info.getOrdDtlNo()+"_"+fileAddNm).append(".xml");
+					String xmlPath = GagaFileUtil.getConcatenationPath(shoplinkerInvoice.getXmlPath(), xmlFileName.toString());
+					String xmlUrl = GagaFileUtil.getConcatenationPath(shoplinkerInvoice.getDomainUrl(), xmlFileName.toString());
+					String slFolder = GagaFileUtil.getConcatenationPath(env.getProperty("shoplinker.xml.path")+"/invoice");
+					File slPath = new File(slFolder);
+					apiHstMap.setXmlTxt(slPath.exists()+"\n"+xmlPath+"\n"+xmlUrl+"\n\n"+sbRequest.toString());
+
+					// apiHstMap.setXmlTxt(sbRequest.toString());
 					apiHstMap.setOrdDtlNo(info.getOrdDtlNo());
 					apiHstMap.setApiResult("error");
 					apiHstMap.setApiMessage("API 통신오류");

+ 9 - 9
src/main/java/com/style24/persistence/domain/Order.java

@@ -426,12 +426,12 @@ public class Order extends TscBaseDomain {
 	private String bankNm;
 
 	public String getAccountNo() {
-		this.accountNo = CryptoUtils.decryptAES(this.accountNo);
+		this.accountNo = CryptoUtils.decryptYes24AES(this.accountNo);
 		return this.accountNo;
 	}
 
 	public void encryptData () {
-		this.encodedAccountNo = CryptoUtils.encryptAES(this.accountNo);
+		this.encodedAccountNo = CryptoUtils.encryptYes24AES(this.accountNo);
 	}
 
 	private int realDelvAmt;
@@ -606,27 +606,27 @@ public class Order extends TscBaseDomain {
 
 	// 암호화 대상 복호화 처리
 	public String getCustNm() {
-		this.custNm = CryptoUtils.decryptAES(this.custNm);
+		this.custNm = CryptoUtils.decryptYes24AES(this.custNm);
 		return this.custNm;
 	}
 
 	public String getEmail() {
-		this.email = CryptoUtils.decryptAES(this.email);
+		this.email = CryptoUtils.decryptYes24AES(this.email);
 		return this.email;
 	}
 
 	public String getCellPhnno() {
-		this.cellPhnno = CryptoUtils.decryptAES(this.cellPhnno);
+		this.cellPhnno = CryptoUtils.decryptYes24AES(this.cellPhnno);
 		return this.cellPhnno;
 	}
 
 	public String getRecipBaseAddr() {
-		this.recipBaseAddr = CryptoUtils.decryptAES(this.recipBaseAddr);
+		this.recipBaseAddr = CryptoUtils.decryptYes24AES(this.recipBaseAddr);
 		return this.recipBaseAddr;
 	}
 
 	public String getRecipDtlAddr() {
-		this.recipDtlAddr = CryptoUtils.decryptAES(this.recipDtlAddr);
+		this.recipDtlAddr = CryptoUtils.decryptYes24AES(this.recipDtlAddr);
 		return this.recipDtlAddr;
 	}
 
@@ -685,12 +685,12 @@ public class Order extends TscBaseDomain {
 	private String birthGen;			// 보증보험(생년월일 + 성별)
 
 	public String getBirthYmd() {
-		this.birthYmd = CryptoUtils.decryptAES(this.birthYmd);
+		this.birthYmd = CryptoUtils.decryptYes24AES(this.birthYmd);
 		return this.birthYmd;
 	}
 
 	public String getSexGb() {
-		this.sexGb = CryptoUtils.decryptAES(this.sexGb);
+		this.sexGb = CryptoUtils.decryptYes24AES(this.sexGb);
 		return this.sexGb;
 	}
 

+ 6 - 2
src/main/java/com/style24/persistence/domain/ShoplinkerOrder.java

@@ -19,10 +19,13 @@ public class ShoplinkerOrder extends TscBaseDomain {
 	private String customerId; 					// 고객사 코드(샵링커 가입코드)
 	private String shoplinkerId;
 	private String orderFlag; 					// 주문타입 - 일반[신규OR발주]:000/ 발주확인:007/ 정산확정: 002/ 송장등록:003/ 송장전송완료:004
-	private String stDate;
-	private String edDate;
+	private String stDate;						// 시작날짜 YYYMMDD
+	private String edDate;						// 종료날짜 YYMMDD
+	private String stTime;						// 시작시간 HH24MISS
+	private String edTime;						// 종료시간 HH24MISS
 	private Integer orderPageNo;
 	private String apiStDate;
+	private String infoStr;
 
 	// Response
 	private Integer orderIfIdx; 				// 주문수집차수
@@ -113,6 +116,7 @@ public class ShoplinkerOrder extends TscBaseDomain {
 	private int pageUnit = 10;
 
 	private String sid;
+	private String acType = "";					// 실행위치 BATCH:배치 /  ADMIN :관리자
 
 	public ShoplinkerOrder() {
 

+ 17 - 12
src/main/java/com/style24/persistence/mybatis/shop/TscOrderChange.xml

@@ -565,16 +565,16 @@
 		     , OD.ORD_QTY
 		     , #{cnclRtnAmt}
 		     , #{cnclRtnQty}
-		     , #{cpn1DcAmt}
-		     , #{tmtb1DcAmt}
-		     , #{tmtb2DcAmt}
-		     , #{goodsCpnDcAmt}
-		     , #{cartCpnDcAmt}
-		     , #{pntDcAmt}
-		     , #{prePntDcAmt}
-		     , #{savePntAmt}
-		     , #{realOrdAmt}
-		     , #{gfcdUseAmt}
+		     , ODI.CPN1_DC_AMT - #{cpn1DcAmt}
+		     , ODI.TMTB1_DC_AMT - #{tmtb1DcAmt}
+		     , ODI.TMTB2_DC_AMT - #{tmtb2DcAmt}
+		     , ODI.GOODS_CPN_DC_AMT - #{goodsCpnDcAmt}
+		     , ODI.CART_CPN_DC_AMT - #{cartCpnDcAmt}
+		     , ODI.PNT_DC_AMT - #{pntDcAmt}
+		     , ODI.PRE_PNT_DC_AMT - #{prePntDcAmt}
+		     , ODI.SAVE_PNT_AMT - #{savePntAmt}
+		     , ODI.REAL_ORD_AMT - #{realOrdAmt}
+		     , ODI.GFCD_USE_AMT - #{gfcdUseAmt}
 		     , #{ordChgSq}
 		     , #{regNo}
 		     , NOW()
@@ -2388,6 +2388,7 @@
 		     , SAVE_PNT_AMT
 		     , REAL_ORD_AMT
 		     , GFCD_USE_AMT
+		     , ORD_CHG_SQ
 		     , REG_NO
 		     , REG_DT
 		     , UPD_NO
@@ -2396,7 +2397,7 @@
 		SELECT ODI.ORD_DTL_ITEM_SQ
 		     , ODI.ORD_DTL_NO
 		     , ODI.ORD_NO
-		     , 'G720_30'
+		     , #{ordDtlStat}
 		     , ODI.ITEM_CD
 		     , ODI.OPT_CD
 		     , ODI.OPT_CD1
@@ -2410,7 +2411,7 @@
 		     , ODI.DISP_ORD
 		     , ODI.ORD_AMT
 		     , OD.ORD_QTY
-		     , ODI.CNCL_RTN_AMT
+		     , ODI.ORD_AMT
 		     , OD.CNCL_RTN_QTY
 		     , ODI.CPN1_DC_AMT
 		     , ODI.TMTB1_DC_AMT
@@ -2422,6 +2423,7 @@
 		     , ODI.SAVE_PNT_AMT
 		     , ODI.REAL_ORD_AMT
 		     , ODI.GFCD_USE_AMT
+		     , #{ordChgSq}
 		     , #{regNo}
 		     , NOW()
 		     , #{updNo}
@@ -3005,6 +3007,9 @@
 		     , Z.PAY_STAT
 		     , Z.CASH_AUTH_NO
 		     , Z.DELV_YN
+		 ORDER BY Z.DELV_FEE_CD
+		     , Z.ORD_NO
+		     , Z.ORD_DTL_NO
 	</select>
 	
 	<!-- 결제취소 환불정보 수정 -->