Commit 9dc93347 by liuyang

2024-07-15 业务账期维护变更

parent fd05d0ae
......@@ -70,7 +70,7 @@ public class HGCW001 extends DaoEPBase {
private String companyName = " "; /* 公司名称*/
private String accountYear = " "; /* 会计年度*/
private String accountPeriod = " "; /* 会计期*/
private Integer accountPeriodStatus; /* 会计期状态0:关账1:开账*/
private Integer accountPeriodStatus = 1; /* 会计期状态0:关账1:开账*/
private String accountPeriodDateStart = " "; /* 账期开始日期*/
private String accountPeriodDateEnd = " "; /* 账期结束日期*/
private String createdBy = " "; /* 记录创建者*/
......
......@@ -47,10 +47,10 @@
ACCOUNT_PERIOD_STATUS = #accountPeriodStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodDateStart">
ACCOUNT_PERIOD_DATE_START = #accountPeriodDateStart#
ACCOUNT_PERIOD_DATE_START >= #accountPeriodDateStart#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodDateEnd">
ACCOUNT_PERIOD_DATE_END = #accountPeriodDateEnd#
ACCOUNT_PERIOD_DATE_END &lt;= #accountPeriodDateEnd#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
......@@ -76,6 +76,12 @@
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodStart">
ACCOUNT_PERIOD >= #accountPeriodStart#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodEnd">
ACCOUNT_PERIOD &lt;= #accountPeriodEnd#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -104,7 +110,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
ACCOUNT_YEAR desc, ACCOUNT_PERIOD desc, ID desc
</isEmpty>
</dynamic>
......
......@@ -7,6 +7,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Objects;
/**
......@@ -56,6 +57,28 @@ public class DateUtil {
return "";
}
/**
* 获取上个月的最后一天
* @param date 日期
* @param i 月数
* @return
*/
public static String getLastDayInMonth(Date date, int i) {
return getLastDayInMonth(date, i, -1,DATE8_PATTERN);
}
public static String getLastDayInMonth(Date date, int i, int day, String pattern) {
SimpleDateFormat format = new SimpleDateFormat(pattern);
if (date == null) {
return null;
} else {
GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(date);
calendar.add(2, i + 1);
calendar.set(5, 1);
calendar.add(5, day);
return format.format(calendar.getTime());
}
}
/**、
* 返回月份天数
* @param dateStr 日期
......
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