Commit 8499e9fb authored by hongguangwu's avatar hongguangwu

增减日

parent c282dc98
...@@ -1247,6 +1247,12 @@ public class DateUtil { ...@@ -1247,6 +1247,12 @@ public class DateUtil {
return sdf.format(cal.getTime()); return sdf.format(cal.getTime());
} }
/**
* @Description: 增减(月)
* @Author: hgw
* @Date: 2022/8/3 9:17
* @return: java.util.Date
**/
public static Date addMonthByDate(Date date, int mnt) { public static Date addMonthByDate(Date date, int mnt) {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
if (date != null) { if (date != null) {
...@@ -1256,6 +1262,21 @@ public class DateUtil { ...@@ -1256,6 +1262,21 @@ public class DateUtil {
return cal.getTime(); return cal.getTime();
} }
/**
* @Description: 增减(日)
* @Author: hgw
* @Date: 2022/8/3 9:17
* @return: java.util.Date
**/
public static Date addDayByDate(Date date, int mnt) {
Calendar cal = Calendar.getInstance();
if (date != null) {
cal.setTime(date);
}
cal.add(Calendar.DATE, mnt);
return cal.getTime();
}
/** /**
* @param mnt 增减日的 值 * @param mnt 增减日的 值
* @Description: 增减日 * @Description: 增减日
......
...@@ -140,7 +140,7 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, ...@@ -140,7 +140,7 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
// 将上一个无截止月的增加截止月(本次起始月的上一个月) // 将上一个无截止月的增加截止月(本次起始月的上一个月)
if (lastBase != null) { if (lastBase != null) {
lastBase.setApplyEndDate(DateUtil.addMonthByDate(sysBaseSetInfo.getApplyStartDate(), -1)); lastBase.setApplyEndDate(DateUtil.addDayByDate(sysBaseSetInfo.getApplyStartDate(), -1));
this.updateById(lastBase); this.updateById(lastBase);
} }
this.saveOrUpdateBaseAndFundPro(sysBaseSetInfo); this.saveOrUpdateBaseAndFundPro(sysBaseSetInfo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment