兖州公司座位等级发生改变事件校验插件(未完成)
This commit is contained in:
parent
d3e6c72bab
commit
7cc8d86549
|
@ -0,0 +1,73 @@
|
||||||
|
package zcgj.zcdev.zcdev.fs.plugin.form;
|
||||||
|
|
||||||
|
import com.alibaba.druid.util.StringUtils;
|
||||||
|
import kd.bos.bill.AbstractBillPlugIn;
|
||||||
|
import kd.bos.bill.BillShowParameter;
|
||||||
|
import kd.bos.bill.OperationStatus;
|
||||||
|
import kd.bos.context.RequestContext;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
|
import kd.bos.entity.datamodel.events.ChangeData;
|
||||||
|
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||||
|
import kd.bos.form.control.Button;
|
||||||
|
import kd.bos.form.control.Control;
|
||||||
|
import kd.bos.form.control.events.ItemClickEvent;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
import kd.sdk.plugin.Plugin;
|
||||||
|
import zcgj.zcdev.zcdev.fs.utils.OrgCheckUtils;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.DayOfWeek;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.EventObject;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 差旅报销单-兖州公司座位等级发生改变事件校验插件
|
||||||
|
*/
|
||||||
|
public class TriprMulseatgradeCkPlugin extends AbstractBillPlugIn implements Plugin {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void propertyChanged(PropertyChangedArgs e) {
|
||||||
|
//当前切换选择的组织
|
||||||
|
Object company = this.getModel().getValue("costcompany");//核算组织(费用承担公司)
|
||||||
|
Long currentOrgId = RequestContext.get().getOrgId();
|
||||||
|
if(company!=null){
|
||||||
|
String yzCompanyNumber ="10006475"; //兖州中材建设有限公司
|
||||||
|
DynamicObject companyObj = (DynamicObject)company;
|
||||||
|
Long companyId = companyObj.getLong("id");
|
||||||
|
if(OrgCheckUtils.isKS(companyId)){
|
||||||
|
String name = e.getProperty().getName();
|
||||||
|
|
||||||
|
if(name.equals("mulseatgrade")){//座位等级
|
||||||
|
boolean childrenOrg = OrgCheckUtils.isChildrenOrg(yzCompanyNumber, companyId);
|
||||||
|
if(childrenOrg){
|
||||||
|
this.getView().showErrorNotification("当前组织不允许改变座位等级。");
|
||||||
|
}
|
||||||
|
}else if(name.equals("comment")){//座位等级
|
||||||
|
boolean childrenOrg = OrgCheckUtils.isChildrenOrg(yzCompanyNumber, companyId);
|
||||||
|
// if(childrenOrg){
|
||||||
|
this.getView().showErrorNotification("当前组织不允许改变座位等级。");
|
||||||
|
ChangeData[] changeSet = e.getChangeSet();
|
||||||
|
String oldValue = (String) changeSet[0].getOldValue();
|
||||||
|
int rowIndex = changeSet[0].getRowIndex();
|
||||||
|
|
||||||
|
// DynamicObject data = this.getModel().getDataEntity(true);
|
||||||
|
// DynamicObjectCollection entry = data.getDynamicObjectCollection("tripentry");
|
||||||
|
// DynamicObject row = entry.get(rowIndex);//entry
|
||||||
|
// this.getModel().setValue("comment", oldValue);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.propertyChanged(e);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue