결제관리 > 요금 사용내역 ==> 오류 수정
This commit is contained in:
parent
04f56b42f9
commit
234f3ccd27
@ -174,7 +174,6 @@ public final class DateUtils {
|
||||
// 총 기간이 지정한 개월 수를 넘는지 확인
|
||||
if (isValid) {
|
||||
long monthsBetween = ChronoUnit.MONTHS.between(startDate, endDate);
|
||||
System.out.println("monthsBetween : "+ monthsBetween);
|
||||
if (monthsBetween >= months) {
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
48
src/main/java/itn/com/cmm/util/PayUtils.java
Normal file
48
src/main/java/itn/com/cmm/util/PayUtils.java
Normal file
@ -0,0 +1,48 @@
|
||||
package itn.com.cmm.util;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : PayUtil.java
|
||||
* @date : 2024.07.16
|
||||
* @description : pay 다루는 Util
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2023.04.06 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class PayUtils {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : getTrimToFirstDecimal
|
||||
* @author : 이호영
|
||||
* @date : 2023.07.16
|
||||
* @description : 소수점 첫째자리 빼고 다 버림
|
||||
* @return ex) 0000.0
|
||||
*/
|
||||
public static String getTrimToFirstDecimal(String input) {
|
||||
|
||||
try {
|
||||
// 쉼표 제거
|
||||
String normalizedInput = input.replace(",", "");
|
||||
// Double로 변환
|
||||
double value = Double.parseDouble(normalizedInput);
|
||||
// 소수점 첫째자리까지만 남기고 나머지는 버림
|
||||
double trimmedValue = Math.floor(value * 10) / 10.0;
|
||||
// 숫자가 너무 커지면 지수 표기법으로 나타내서 방지하기 위한 구문
|
||||
DecimalFormat df = new DecimalFormat("#.0");
|
||||
// 문자열로 변환하여 반환
|
||||
return df.format(trimmedValue);
|
||||
} catch (NumberFormatException e) {
|
||||
System.err.println("Number format exception: " + e.getMessage());
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -72,6 +72,7 @@ import itn.com.cmm.service.EgovCmmUseService;
|
||||
import itn.com.cmm.service.FileVO;
|
||||
import itn.com.cmm.util.DateUtils;
|
||||
import itn.com.cmm.util.MJUtil;
|
||||
import itn.com.cmm.util.PayUtils;
|
||||
import itn.com.cmm.util.RedirectUrlMaker;
|
||||
import itn.com.cmm.util.StringUtil;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
@ -2129,7 +2130,7 @@ public class MjonPayController {
|
||||
List<MjonPayVO> resultList = mjonPayService.selectPayList(mjonPayVO);
|
||||
|
||||
|
||||
model.addAttribute("totChgPay", resultList.size() > 0 ? resultList.get(0).getTotChgPay() : 0);
|
||||
model.addAttribute("totChgPay", resultList.size() > 0 ? PayUtils.getTrimToFirstDecimal(resultList.get(0).getTotChgPay()) : 0);
|
||||
|
||||
|
||||
model.addAttribute("resultList", resultList);
|
||||
@ -2802,16 +2803,14 @@ public class MjonPayController {
|
||||
paginationInfo.setTotalRecordCount(payUserSWList.size()> 0 ? payUserSWList.get(0).getTotCnt() : 0);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
model.addAttribute("payUserSWList", payUserSWList);
|
||||
|
||||
|
||||
|
||||
String totSuccSendPrice = payUserSWList.get(0).getTotSuccSendPrice();
|
||||
model.addAttribute("totSuccSendPrice", payUserSWList.size() > 0 ? totSuccSendPrice : 0);
|
||||
model.addAttribute("totSuccSendPrice", payUserSWList.size() > 0 ? PayUtils.getTrimToFirstDecimal(payUserSWList.get(0).getTotSuccSendPrice()) : 0);
|
||||
|
||||
model.addAttribute("mjonMsgVO", mjonMsgVO);
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("PayUserSWListAjax Controller Error!!! " + e);
|
||||
}
|
||||
|
||||
|
||||
@ -403,7 +403,7 @@ function fnShowPdfPrintPopup(){
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<td colspan="5">
|
||||
검색 결과가 없습니다.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user