资金计划申请默认期间
This commit is contained in:
parent
e510a01769
commit
ed3c4100f9
|
@ -41,14 +41,16 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
|
|||
//设置期间
|
||||
DynamicObject org = (DynamicObject) this.getModel().getValue("zcgj_org");
|
||||
if(org!=null){
|
||||
//查询组织下对应的当前期间数据
|
||||
/*//查询组织下对应的当前期间数据
|
||||
DynamicObject[] orgByCurperiod = BusinessDataServiceHelper.load("gl_accountbook",
|
||||
"org,curperiod",
|
||||
new QFilter[]{new QFilter("enable", QCP.equals, Boolean.TRUE).
|
||||
and("status", QCP.equals, "C").and("org.id", QCP.equals, org.getLong("id"))});
|
||||
if(orgByCurperiod!=null && orgByCurperiod.length>0){
|
||||
this.getModel().setValue("zcgj_period",orgByCurperiod[0].getDynamicObject("curperiod"));
|
||||
}
|
||||
}*/
|
||||
//设置期间
|
||||
carryCurrentPeriodAndDate();
|
||||
//初始化值
|
||||
initData(org);
|
||||
}
|
||||
|
@ -156,4 +158,19 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
|
|||
return LocalDate.of(year, 12, 31);
|
||||
}
|
||||
|
||||
|
||||
protected void carryCurrentPeriodAndDate() {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
int year = cal.get(1);
|
||||
int month = cal.get(2) + 1;
|
||||
QFilter yearFilter = new QFilter("periodyear", "=", year);
|
||||
QFilter monthFilter = new QFilter("periodnumber", "=", month);
|
||||
DynamicObject bdPeriod = BusinessDataServiceHelper.loadSingle("bd_period", "id,name,begindate,enddate", new QFilter[]{yearFilter, monthFilter});
|
||||
if (bdPeriod != null) {
|
||||
this.getModel().setValue("zcgj_period", bdPeriod.getPkValue());
|
||||
//this.getModel().setValue("begindate", bdPeriod.get("begindate"));
|
||||
// this.getModel().setValue("enddate", bdPeriod.get("enddate"));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue