fix:信用卡账单功能完善。

This commit is contained in:
tianyongbao
2025-05-07 14:31:09 +08:00
parent 33c0ae236e
commit c6534ea86a
7 changed files with 53 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 期货基本合约Dto对象 invest_future_base_infor
*
@@ -29,4 +30,8 @@ public class FutureBaseInforDto implements Serializable
@ApiModelProperty(value="标准合约id")
private Long standardId;
/** 最后交易日 */
@ApiModelProperty(value="最后交易日")
private String lastTradingDay;
}

View File

@@ -1,10 +1,14 @@
package com.intc.invest.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.intc.common.core.annotation.Excel;
import com.intc.invest.domain.CreditCardBill;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import java.util.Date;
/**
* 信用卡账单Vo对象 credit_card_bill
*
@@ -29,5 +33,18 @@ public class CreditCardBillVo extends CreditCardBill
@ApiModelProperty(value="POS刷卡占比)")
private String posRate;
@ApiModelProperty(value="可用余额)")
private Double availableLimit;
/** 还款日 */
@ApiModelProperty(value="账单日")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date repaymentDay;
/** 还款日 */
@ApiModelProperty(value="还款日)")
private int payDate;
}

View File

@@ -69,6 +69,7 @@ public class CreditCardBillServiceImpl implements ICreditCardBillService
{
List<CreditCardBillVo> creditCardBillList=creditCardBillMapper.selectCreditCardBillList(creditCardBillDto);
//修改名称加卡号
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // 设置日期格式
DecimalFormat decimalFormat = new DecimalFormat("#.###");
for (CreditCardBillVo creditCardBill : creditCardBillList) {
if(creditCardBill.getBankName()!=null){
@@ -82,6 +83,23 @@ public class CreditCardBillServiceImpl implements ICreditCardBillService
creditCardBill.setPosRate("--");
}
String repaymentDayStr = sdf.format(creditCardBill.getBillDate()).split("-")[0] + "-" + sdf.format(creditCardBill.getBillDate()).split("-")[1] + "-" + String.format("%02d", creditCardBill.getPayDate());
try {
Date repaymentDay=sdf.parse(repaymentDayStr);
if(repaymentDay.before(creditCardBill.getBillDate())){
// 加一个月
Calendar calendar = Calendar.getInstance();
calendar.setTime(repaymentDay);
calendar.add(Calendar.MONTH, 1);
repaymentDay = calendar.getTime();
creditCardBill.setRepaymentDay(repaymentDay);
}else {
creditCardBill.setRepaymentDay(repaymentDay);
}
} catch (ParseException e) {
throw new RuntimeException(e);
}
}
return creditCardBillList;
}

View File

@@ -225,7 +225,10 @@ public class FuturesDailyHistoryServiceImpl implements IFuturesDailyHistoryServi
*/
@Override
public void synTodayFuturesDailyHistory() {
List<FutureBaseInforVo> futureBaseInforVos=futureBaseInforMapper.selectFutureBaseInforList(new FutureBaseInforDto());
FutureBaseInforDto dto=new FutureBaseInforDto();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
dto.setLastTradingDay(formatter.format(new Date()));
List<FutureBaseInforVo> futureBaseInforVos= futureBaseInforMapper.selectFutureBaseInforList(dto);
//
for (FutureBaseInforVo base : futureBaseInforVos) {

View File

@@ -22,6 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" />
<result property="posCount" column="pos_count" />
<result property="dailyExpensesCount" column="daily_expenses_count" />
<result property="availableLimit" column="available_limit" />
<result property="payDate" column="pay_date" />
</resultMap>
<sql id="selectCreditCardBillVo">
@@ -40,7 +42,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.bill_state,
a.remark,
bc."name" as bank_name,
bc.pay_date,
bc.code as bank_code,
a2.available_limit,
(
select
count(*)
@@ -83,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
credit_card_bill a
left join bank_card_lend bc on
bc.id = a.credit_card_id
left join accounts a2 on a2.id =a.credit_card_id
</sql>
<select id="selectCreditCardBillList" parameterType="CreditCardBillDto" resultMap="CreditCardBillResult">

View File

@@ -125,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 数据范围过滤 -->
${params.dataScope}
order by
a.query_institution desc
a.query_date desc
</select>
</mapper>

View File

@@ -67,6 +67,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
<if test="code != null and code != ''"> and a.code = #{code}</if>
<if test="standardId != null "> and a.standard_id = #{standardId}</if>
<if test="lastTradingDay!=null and lastTradingDay !=''">
and to_char(a.last_trading_day, 'yyyy-MM-dd')>=#{lastTradingDay}
</if>
</where>
order by a.create_time desc
</select>