Commit d430a272 by liuyang

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

parent 7aa95d79
......@@ -24,7 +24,10 @@ import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
......@@ -136,14 +139,12 @@ public class HGCWTools {
paramMap.put(HGCW001.FIELD_ACCOUNT_PERIOD, DateUtils.formatShort(accountPeriod.substring(0, 7)));
List<HGCW001> list =DaoBase.getInstance().query(HGCW001.QUERY, paramMap);
if (list.size() > 0) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
Date account = formatter.parse(list.get(0).getAccountPeriodDateEnd());
String dateEnd = DateUtil.getLastDayInMonth(account,0,0,DateUtil.DATE10_PATTERN);//DateUtils.yesterdayEnd(dateStart,-1);
inInfo.set(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_START, dateEnd);
//SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
//Date account = formatter.parse(list.get(0).getAccountPeriodDateEnd());
//String dateEnd = DateUtil.getLastDayInMonth(account,0,0,DateUtil.DATE10_PATTERN);
inInfo.set(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_START, DateUtils.yesterdayEnd(list.get(0).getAccountPeriodDateEnd(),1));
}else {
/*获取当前最后时间*/
//
//
/*获取当前开始时间*/
inInfo.set(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_START, (accountPeriodStr.substring(0,7).concat("-01")));
}
}catch (Exception e){
......
......@@ -91,7 +91,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
* @return
*/
public static String yesterdayEnd(String date,Integer day) {
return LocalDate.parse(date).minusDays(day).format(DATE);
return LocalDate.parse(date, SHORT_DATE).plusDays(day).format(DATE);
}
/**
* 获取日期字符串(yyyy-MM-dd)
......
......@@ -38,7 +38,7 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="1">
<EF:EFCodeOption codeName="hggp.cw.accountPeriodStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="accountPeriodDateStart" cname="账期开始日期" enable="false" width="100" align="center"
<EF:EFColumn ename="accountPeriodDateStart" cname="账期开始日期" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="accountPeriodDateEnd" cname="账期结束日期" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
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