fix: 信用卡账单,bug修复。
This commit is contained in:
@@ -26,5 +26,8 @@ public class CreditCardBillVo extends CreditCardBill
|
|||||||
@Excel(name = "信用卡")
|
@Excel(name = "信用卡")
|
||||||
private String bankNameCode;
|
private String bankNameCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="POS刷卡占比)")
|
||||||
|
private String posRate;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.ruoyi.invest.service.ICreditCardBillService;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -58,10 +59,19 @@ public class CreditCardBillServiceImpl implements ICreditCardBillService
|
|||||||
{
|
{
|
||||||
List<CreditCardBillVo> creditCardBillList=creditCardBillMapper.selectCreditCardBillList(creditCardBillDto);
|
List<CreditCardBillVo> creditCardBillList=creditCardBillMapper.selectCreditCardBillList(creditCardBillDto);
|
||||||
//修改名称加卡号
|
//修改名称加卡号
|
||||||
|
DecimalFormat decimalFormat = new DecimalFormat("#.###");
|
||||||
for (CreditCardBillVo creditCardBill : creditCardBillList) {
|
for (CreditCardBillVo creditCardBill : creditCardBillList) {
|
||||||
if(creditCardBill.getBankName()!=null){
|
if(creditCardBill.getBankName()!=null){
|
||||||
creditCardBill.setBankNameCode(creditCardBill.getBankName()+"("+ StringUtils.getLastNumberChars(4,creditCardBill.getBankCode()+")"));
|
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;
|
return creditCardBillList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
2)>= to_char(adr.create_time,
|
2)>= to_char(adr.create_time,
|
||||||
'yyyy-MM-dd')
|
'yyyy-MM-dd')
|
||||||
and adr.deal_category = '5'
|
and adr.deal_category = '5'
|
||||||
|
and adr.del_flag='0'
|
||||||
) as pos_count,
|
) as pos_count,
|
||||||
(
|
(
|
||||||
select
|
select
|
||||||
@@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
2)>= to_char(adr.create_time,
|
2)>= to_char(adr.create_time,
|
||||||
'yyyy-MM-dd')
|
'yyyy-MM-dd')
|
||||||
and adr.deal_category = '1'
|
and adr.deal_category = '1'
|
||||||
|
and adr.del_flag='0'
|
||||||
) as daily_expenses_count
|
) as daily_expenses_count
|
||||||
from
|
from
|
||||||
credit_card_bill a
|
credit_card_bill a
|
||||||
|
|||||||
Reference in New Issue
Block a user