marseyes пре 2 година
родитељ
комит
98d4e043ac

+ 16 - 4
src/main/java/com/oqpo/api/service/loanmng/DsptMngService.java

@@ -33,7 +33,10 @@ import org.springframework.transaction.annotation.Transactional;
33 33
 import java.io.PrintWriter;
34 34
 import java.io.StringWriter;
35 35
 import java.io.Writer;
36
+import java.text.SimpleDateFormat;
37
+import java.util.Date;
36 38
 import java.util.List;
39
+import java.util.Locale;
37 40
 import java.util.stream.Collectors;
38 41
 
39 42
 @Service
@@ -160,11 +163,20 @@ public class DsptMngService extends CommonService {
160 163
             infoEntity.setAcctBal(trscAfBal); // 계좌잔액
161 164
             dsptMngMapper.updateLoanMgntBaseInfo4AcctBal(userId, infoEntity);
162 165
 
166
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault());
167
+            Date currentDate = new Date();
168
+            Date nextDate = DateUtil.addSeconds(currentDate, 1);
169
+            String curStr = sdf.format(currentDate);
170
+            String nextStr = sdf.format(nextDate);
171
+
172
+            // System.out.println(curStr.substring(0, 8) + ", " + curStr.substring(8));
173
+            // System.out.println(nextStr.substring(0, 8) + ", " + nextStr.substring(8));
174
+
163 175
             // 여신관리상세이력 등록
164 176
             LoanMgntDtlHstEntity hstEntity1 = new LoanMgntDtlHstEntity();
165 177
             hstEntity1.setLoanMgntUnqNo(infoEntity.getLoanMgntUnqNo());
166
-            hstEntity1.setLoanRegDt(DateUtil.getCurrentDate());
167
-            hstEntity1.setLoanRegTm(DateUtil.getCurrentTime());
178
+            hstEntity1.setLoanRegDt(curStr.substring(0, 8));
179
+            hstEntity1.setLoanRegTm(curStr.substring(8));
168 180
             hstEntity1.setDpstPayDvsn(DpstPayDvsn.DEPOSIT.getCd());
169 181
             hstEntity1.setTrscAmt(procEntity.getDpstAmt()); // 거래금액
170 182
             hstEntity1.setTrscBfBal(trscBfBal);
@@ -208,8 +220,8 @@ public class DsptMngService extends CommonService {
208 220
                 // 3. 여신관리상세이력
209 221
                 LoanMgntDtlHstEntity hstEntity2 = new LoanMgntDtlHstEntity();
210 222
                 hstEntity2.setLoanMgntUnqNo(infoEntity.getLoanMgntUnqNo());
211
-                hstEntity2.setLoanRegDt(DateUtil.getCurrentDate());
212
-                hstEntity2.setLoanRegTm(String.format("%06d", (Integer.parseInt(hstEntity1.getLoanRegTm()) + 1)));
223
+                hstEntity2.setLoanRegDt(nextStr.substring(0, 8));
224
+                hstEntity2.setLoanRegTm(nextStr.substring(8));
213 225
                 hstEntity2.setDpstPayDvsn(DpstPayDvsn.PAYMENT.getCd());
214 226
                 hstEntity2.setMediaDvsn(MediaDvsn.SETTLMENT.getCd());
215 227
                 hstEntity2.setPayType(PayType.STTL_PAY.getCd());

+ 15 - 4
src/main/java/com/oqpo/api/service/loanmng/EasypayPaymentService.java

@@ -30,7 +30,10 @@ import org.springframework.stereotype.Service;
30 30
 import org.springframework.transaction.annotation.Transactional;
31 31
 
32 32
 import javax.servlet.http.HttpServletRequest;
33
+import java.text.SimpleDateFormat;
34
+import java.util.Date;
33 35
 import java.util.List;
36
+import java.util.Locale;
34 37
 
35 38
 @Service
36 39
 @Slf4j
@@ -574,11 +577,19 @@ public class EasypayPaymentService extends CommonService {
574 577
         dsptMngMapper.insertLoanMgntDsptProcInfo(userId, entity);
575 578
 
576 579
         // 3. 여신관리상세이력
580
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault());
581
+        Date currentDate = new Date();
582
+        Date nextDate = DateUtil.addSeconds(currentDate, 1);
583
+        String curStr = sdf.format(currentDate);
584
+        String nextStr = sdf.format(nextDate);
585
+
586
+        // System.out.println(curStr.substring(0, 8) + ", " + curStr.substring(8));
587
+        // System.out.println(nextStr.substring(0, 8) + ", " + nextStr.substring(8));
577 588
         // 3.1 입금 처리
578 589
         LoanMgntDtlHstEntity hstEntity1 = new LoanMgntDtlHstEntity();
579 590
         hstEntity1.setLoanMgntUnqNo(infoEntity.getLoanMgntUnqNo());
580
-        hstEntity1.setLoanRegDt(DateUtil.getCurrentDate());
581
-        hstEntity1.setLoanRegTm(DateUtil.getCurrentTime());
591
+        hstEntity1.setLoanRegDt(curStr.substring(0, 8));
592
+        hstEntity1.setLoanRegTm(curStr.substring(8));
582 593
         hstEntity1.setDpstPayDvsn(DpstPayDvsn.DEPOSIT.getCd());
583 594
         // 11:신용카드, 21:계좌이체
584 595
         if ("11".equals(r_pay_type)) {
@@ -596,8 +607,8 @@ public class EasypayPaymentService extends CommonService {
596 607
         // 3.2 지급 처리
597 608
         LoanMgntDtlHstEntity hstEntity2 = new LoanMgntDtlHstEntity();
598 609
         hstEntity2.setLoanMgntUnqNo(infoEntity.getLoanMgntUnqNo());
599
-        hstEntity2.setLoanRegDt(hstEntity1.getLoanRegDt());
600
-        hstEntity2.setLoanRegTm(String.format("%06d", (Integer.parseInt(hstEntity1.getLoanRegTm()) + 1)));
610
+        hstEntity2.setLoanRegDt(nextStr.substring(0, 8));
611
+        hstEntity2.setLoanRegTm(nextStr.substring(8));
601 612
         hstEntity2.setDpstPayDvsn(DpstPayDvsn.PAYMENT.getCd());
602 613
         hstEntity2.setMediaDvsn(MediaDvsn.SETTLMENT.getCd());
603 614
         hstEntity2.setPayType(PayType.STTL_PAY.getCd());

+ 8 - 3
src/main/java/com/oqpo/api/util/DateUtil.java

@@ -771,8 +771,13 @@ public class DateUtil {
771 771
     }
772 772
 
773 773
     public static void main(String args[]) {
774
-        System.out.println(Integer.parseInt(DateUtil.getCurrentMinTime().substring(0, 2)));
775
-        System.out.println(Integer.parseInt("0420"));
776
-        System.out.println(Math.round(202 * 17.6 * 100) / 100.0);
774
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault());
775
+        Date currentDate = new Date();
776
+        Date nextDate = DateUtil.addSeconds(currentDate, 1);
777
+        String curStr = sdf.format(currentDate);
778
+        String nextStr = sdf.format(nextDate);
779
+
780
+        System.out.println(curStr.substring(0, 8) + ", " + curStr.substring(8));
781
+        System.out.println(nextStr.substring(0, 8) + ", " + nextStr.substring(8));
777 782
     }
778 783
 }