fix: 信用卡账单,bug修复。

This commit is contained in:
tianyongbao
2024-10-23 13:57:01 +08:00
parent e31521d85c
commit da1530295a
3 changed files with 15 additions and 2 deletions

View File

@@ -26,5 +26,8 @@ public class CreditCardBillVo extends CreditCardBill
@Excel(name = "信用卡")
private String bankNameCode;
@ApiModelProperty(value="POS刷卡占比)")
private String posRate;
}

View File

@@ -14,6 +14,7 @@ import com.ruoyi.invest.service.ICreditCardBillService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
@@ -58,10 +59,19 @@ public class CreditCardBillServiceImpl implements ICreditCardBillService
{
List<CreditCardBillVo> creditCardBillList=creditCardBillMapper.selectCreditCardBillList(creditCardBillDto);
//修改名称加卡号
DecimalFormat decimalFormat = new DecimalFormat("#.###");
for (CreditCardBillVo creditCardBill : creditCardBillList) {
if(creditCardBill.getBankName()!=null){
creditCardBill.setBankNameCode(creditCardBill.getBankName()+""+ StringUtils.getLastNumberChars(4,creditCardBill.getBankCode()+""));
}
int totalCount=Integer.parseInt(creditCardBill.getPosCount())+Integer.parseInt(creditCardBill.getDailyExpensesCount());
if(totalCount>0){
String posRate=decimalFormat.format((Integer.parseInt(creditCardBill.getPosCount())* 100L)/totalCount)+"%";
creditCardBill.setPosRate(posRate);
}else{
creditCardBill.setPosRate("--");
}
}
return creditCardBillList;
}

View File

@@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
2)>= to_char(adr.create_time,
'yyyy-MM-dd')
and adr.deal_category = '5'
and adr.del_flag='0'
) as pos_count,
(
select
@@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
2)>= to_char(adr.create_time,
'yyyy-MM-dd')
and adr.deal_category = '1'
and adr.del_flag='0'
) as daily_expenses_count
from
credit_card_bill a