收付款申请单通用插件优化
This commit is contained in:
parent
eda4addf1c
commit
7dc92a5a2e
|
|
@ -45,49 +45,57 @@ public class ContractSelectProjectPlugin extends AbstractBillPlugIn implements P
|
|||
String name = e.getProperty().getName();
|
||||
if (name.equals("zcgj_hqrec")) {
|
||||
//总部代收
|
||||
ChangeData changeData = e.getChangeSet()[0];
|
||||
Object newValue = changeData.getNewValue();
|
||||
if (newValue != null && newValue.equals("20")) {
|
||||
DynamicObject fiaccountorg = (DynamicObject) this.getModel().getValue("fiaccountorg");//财务记账组织
|
||||
DynamicObject org = (DynamicObject) this.getModel().getValue("org");//所属组织
|
||||
if (fiaccountorg != null && org != null) {
|
||||
QFilter filter = new QFilter("zcgj_companyblentry.zcgj_org", QCP.equals, fiaccountorg.getPkValue());//组织
|
||||
DynamicObject zcgj_companybelong = BusinessDataServiceHelper.loadSingle("zcgj_companybelong", "zcgj_headquarters",
|
||||
new QFilter[]{filter});//"公司归属区域"
|
||||
if (zcgj_companybelong != null) {
|
||||
DynamicObject zcgj_headquarters = zcgj_companybelong.getDynamicObject("zcgj_headquarters");//本部
|
||||
this.getModel().setValue("zcgj_hqorg", zcgj_headquarters);//总部代收组织
|
||||
String dataEntityTypeName = this.getModel().getDataEntity().getDataEntityType().getName();
|
||||
if (dataEntityTypeName.equals("ec_incomeapply")) {
|
||||
//收款申请进行下面逻辑
|
||||
ChangeData changeData = e.getChangeSet()[0];
|
||||
Object newValue = changeData.getNewValue();
|
||||
if (newValue != null && newValue.equals("20")) {
|
||||
DynamicObject fiaccountorg = (DynamicObject) this.getModel().getValue("fiaccountorg");//财务记账组织
|
||||
DynamicObject org = (DynamicObject) this.getModel().getValue("org");//所属组织
|
||||
if (fiaccountorg != null && org != null) {
|
||||
QFilter filter = new QFilter("zcgj_companyblentry.zcgj_org", QCP.equals, fiaccountorg.getPkValue());//组织
|
||||
DynamicObject zcgj_companybelong = BusinessDataServiceHelper.loadSingle("zcgj_companybelong", "zcgj_headquarters",
|
||||
new QFilter[]{filter});//"公司归属区域"
|
||||
if (zcgj_companybelong != null) {
|
||||
DynamicObject zcgj_headquarters = zcgj_companybelong.getDynamicObject("zcgj_headquarters");//本部
|
||||
this.getModel().setValue("zcgj_hqorg", zcgj_headquarters);//总部代收组织
|
||||
}
|
||||
} else {
|
||||
this.getView().showErrorNotification("请先选择财务记账组织");
|
||||
this.getModel().setValue("zcgj_hqrec", null);
|
||||
this.getModel().setValue("zcgj_hqorg", null);
|
||||
}
|
||||
} else {
|
||||
this.getView().showErrorNotification("请先选择财务记账组织");
|
||||
this.getModel().setValue("zcgj_hqrec", null);
|
||||
this.getModel().setValue("zcgj_hqorg", null);
|
||||
this.getModel().setValue("zcgj_hqorg", null);//总部代收组织
|
||||
}
|
||||
} else {
|
||||
this.getModel().setValue("zcgj_hqorg", null);//总部代收组织
|
||||
}
|
||||
} else if (name.equals("fiaccountorg")) {
|
||||
//财务记账组织
|
||||
ChangeData changeData = e.getChangeSet()[0];
|
||||
Object newValue = changeData.getNewValue();
|
||||
if (newValue != null) {
|
||||
DynamicObject fiaccountorg = (DynamicObject) newValue;
|
||||
QFilter filter1 = new QFilter("zcgj_companyblentry.zcgj_org", QCP.equals, fiaccountorg.getPkValue());//组织
|
||||
DynamicObject zcgj_companybelong1 = BusinessDataServiceHelper.loadSingle("zcgj_companybelong",
|
||||
"zcgj_headquarters,zcgj_zbbankaccount",
|
||||
new QFilter[]{filter1});//"公司归属区域"
|
||||
if (zcgj_companybelong1 != null) {
|
||||
DynamicObject zcgj_headquarters = zcgj_companybelong1.getDynamicObject("zcgj_headquarters");//本部
|
||||
DynamicObject zcgj_zbbankaccount = zcgj_companybelong1.getDynamicObject("zcgj_zbbankaccount");//本部银行账户
|
||||
this.getModel().setValue("zcgj_zborg", zcgj_headquarters);//总部组织
|
||||
this.getModel().setValue("zcgj_zbbankaccount", zcgj_zbbankaccount);//总部账号
|
||||
String dataEntityTypeName = this.getModel().getDataEntity().getDataEntityType().getName();
|
||||
if (dataEntityTypeName.equals("ec_incomeapply")) {
|
||||
//收款申请进行下面逻辑
|
||||
ChangeData changeData = e.getChangeSet()[0];
|
||||
Object newValue = changeData.getNewValue();
|
||||
if (newValue != null) {
|
||||
DynamicObject fiaccountorg = (DynamicObject) newValue;
|
||||
QFilter filter1 = new QFilter("zcgj_companyblentry.zcgj_org", QCP.equals, fiaccountorg.getPkValue());//组织
|
||||
DynamicObject zcgj_companybelong1 = BusinessDataServiceHelper.loadSingle("zcgj_companybelong",
|
||||
"zcgj_headquarters,zcgj_zbbankaccount",
|
||||
new QFilter[]{filter1});//"公司归属区域"
|
||||
if (zcgj_companybelong1 != null) {
|
||||
DynamicObject zcgj_headquarters = zcgj_companybelong1.getDynamicObject("zcgj_headquarters");//本部
|
||||
DynamicObject zcgj_zbbankaccount = zcgj_companybelong1.getDynamicObject("zcgj_zbbankaccount");//本部银行账户
|
||||
this.getModel().setValue("zcgj_zborg", zcgj_headquarters);//总部组织
|
||||
this.getModel().setValue("zcgj_zbbankaccount", zcgj_zbbankaccount);//总部账号
|
||||
} else {
|
||||
this.getModel().setValue("zcgj_zborg", null);//总部组织
|
||||
this.getModel().setValue("zcgj_zbbankaccount", null);//总部账号
|
||||
}
|
||||
} else {
|
||||
this.getModel().setValue("zcgj_zborg", null);//总部组织
|
||||
this.getModel().setValue("zcgj_zbbankaccount", null);//总部账号
|
||||
}
|
||||
} else {
|
||||
this.getModel().setValue("zcgj_zborg", null);//总部组织
|
||||
this.getModel().setValue("zcgj_zbbankaccount", null);//总部账号
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue