Compare commits

..

No commits in common. "d91a700fbed7b34e565ae46eab53cf09dd9c0524" and "b880d268f658997b955d6a27a3652af0cc8fb905" have entirely different histories.

1 changed files with 3 additions and 52 deletions

View File

@ -7,16 +7,12 @@ import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.datamodel.events.BizDataEventArgs;
import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.sdk.plugin.Plugin;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.*;
import java.util.EventObject;
import java.util.HashSet;
import java.util.Set;
/**
* 资金计划申请插件
@ -36,51 +32,6 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
item.set("zcgj_setttype",type);
}
getView().updateView("zcgj_fin_approved_amount");
//设置期间
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"));
}
}
}
}
@Override
public void propertyChanged(PropertyChangedArgs e) {
super.propertyChanged(e);
String name = e.getProperty().getName();
ChangeData changeData = e.getChangeSet()[0];
if(name.equals("zcgj_setttype")){
String setttype = (String) changeData.getNewValue();
int rowIndex = changeData.getRowIndex();
DynamicObjectCollection zcgjFinApprovedAmount = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fin_approved_amount");
if(zcgjFinApprovedAmount!=null){
boolean isOk = true;
for (int i = 0; i < zcgjFinApprovedAmount.size(); i++) {
if(rowIndex != i){
String zcgjSetttype = zcgjFinApprovedAmount.get(i).getString("zcgj_setttype");
if(zcgjSetttype!=null && zcgjSetttype.equals(setttype)){
isOk = false;
}
}
}
if(!isOk){
this.getView().showErrorNotification("财务部核定金额的结算方式不允许重复,请重新选择");
zcgjFinApprovedAmount.get(rowIndex).set("zcgj_setttype",null);
this.getView().updateView("zcgj_setttype",rowIndex);
}
}
}
}
}