1.矿山组织下差旅报销单、费用报销单、对公报销单、预付单超预算提醒

2.科目的科目类型过滤
This commit is contained in:
zhangzhiguo 2025-01-03 15:33:50 +08:00
parent dd9a29bb62
commit 4b27343203
6 changed files with 225 additions and 16 deletions

View File

@ -0,0 +1,69 @@
package zcgj.zcdev.zcdev.fs.plugin.form;
import com.alibaba.fastjson.JSONObject;
import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.ExtendedDataEntity;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.plugin.PreparePropertysEventArgs;
import kd.bos.entity.validate.AbstractValidator;
import kd.bos.exception.KDBizException;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.servicehelper.DispatchServiceHelper;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* 对公报销单差旅报销单费用报销单超预算提醒
*/
public class BeyondBalancePlugin extends AbstractOperationServicePlugIn {
private static final Log log = LogFactory.getLog(zcgj.zcdev.zcdev.fs.plugin.form.BeyondBalancePlugin.class);
@Override
public void onPreparePropertys(PreparePropertysEventArgs e) {
super.onPreparePropertys(e);
e.getFieldKeys().add("formid");
e.getFieldKeys().add("id");
e.getFieldKeys().add("costdept");
}
public BeyondBalancePlugin() {
}
public void onAddValidators(AddValidatorsEventArgs e) {
super.onAddValidators(e);
//当前切换选择的组织
Long currentOrgId = RequestContext.get().getOrgId();
//获取费用承担部门 costdept
e.addValidator(new AbstractValidator() {
public void validate() {
ExtendedDataEntity[] dataEntities = this.getDataEntities();
//当前提交的探亲单据id集合
for (ExtendedDataEntity extendedDataEntity : dataEntities) {
DynamicObject dataEntity = extendedDataEntity.getDataEntity();
DynamicObject costcompany = dataEntity.getDynamicObject("costdept");
long costcompanyId = costcompany.getLong("id");
if(OrgCheckUtils.isKS(costcompanyId)){
String operateKey = this.getOperateKey();
DynamicObject[] dynamicObjects = (DynamicObject[])((List) Arrays.stream(dataEntities).map((k) -> {
return k.getDataEntity();
}).collect(Collectors.toList())).toArray(new DynamicObject[0]);
Object obj = DispatchServiceHelper.invokeBizService("epm", "eb", "BgControlService", "isBeyond", new Object[]{dynamicObjects, operateKey});
JSONObject json = (JSONObject)obj;
if (json != null) {
if (!"true".equals(json.get("canBeyond"))) {
throw new KDBizException(json.getString("message"));
}
this.addWarningMessage(dataEntities[0], json.getString("message"));
}
}
}
}
});
}
}

View File

@ -0,0 +1,76 @@
package zcgj.zcdev.zcdev.fs.plugin.form;
import com.alibaba.fastjson.JSONObject;
import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.ExtendedDataEntity;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.plugin.PreparePropertysEventArgs;
import kd.bos.entity.validate.AbstractValidator;
import kd.bos.exception.KDBizException;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.servicehelper.DispatchServiceHelper;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* 预付单超预算提醒
*/
public class BeyondBalancePrepaybillPlugin extends AbstractOperationServicePlugIn {
private static final Log log = LogFactory.getLog(BeyondBalancePrepaybillPlugin.class);
@Override
public void onPreparePropertys(PreparePropertysEventArgs e) {
super.onPreparePropertys(e);
e.getFieldKeys().add("formid");
e.getFieldKeys().add("id");
e.getFieldKeys().add("expenseentryentity");
e.getFieldKeys().add("expenseentryentity.entrycostdept");
}
public BeyondBalancePrepaybillPlugin() {
}
public void onAddValidators(AddValidatorsEventArgs e) {
super.onAddValidators(e);
//当前切换选择的组织
Long currentOrgId = RequestContext.get().getOrgId();
//获取费用承担部门 costdept
e.addValidator(new AbstractValidator() {
public void validate() {
ExtendedDataEntity[] dataEntities = this.getDataEntities();
//当前提交的探亲单据id集合
for (ExtendedDataEntity extendedDataEntity : dataEntities) {
DynamicObject dataEntity = extendedDataEntity.getDataEntity();
DynamicObjectCollection dynamicObjectCollection = dataEntity.getDynamicObjectCollection("expenseentryentity");
if(dynamicObjectCollection!=null){
//判断预付信息中第一条费用承担部门
DynamicObject dynamicObject = dynamicObjectCollection.get(0);
DynamicObject entrycostdept = dynamicObject.getDynamicObject("entrycostdept");
long costcompanyId = entrycostdept.getLong("id");
if(OrgCheckUtils.isKS(costcompanyId)){
String operateKey = this.getOperateKey();
DynamicObject[] dynamicObjects = (DynamicObject[])((List) Arrays.stream(dataEntities).map((k) -> {
return k.getDataEntity();
}).collect(Collectors.toList())).toArray(new DynamicObject[0]);
Object obj = DispatchServiceHelper.invokeBizService("epm", "eb", "BgControlService", "isBeyond", new Object[]{dynamicObjects, operateKey});
JSONObject json = (JSONObject)obj;
if (json != null) {
if (!"true".equals(json.get("canBeyond"))) {
throw new KDBizException(json.getString("message"));
}
this.addWarningMessage(dataEntities[0], json.getString("message"));
}
}
}
}
}
});
}
}

View File

@ -23,6 +23,7 @@ import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.org.OrgUnitServiceHelper;
import kd.bos.servicehelper.user.UserServiceHelper;
import kd.bos.tree.TreeFilterParameter;
import kd.sdk.plugin.Plugin;
import java.util.ArrayList;
@ -60,6 +61,10 @@ public class DailyloanbillExpAccPlugin extends AbstractBillPlugIn implements Plu
//分录值改变的行号
private static Integer selectRow = null;
//借款单
private static String BILL_TYPE ="er_dailyloanbill";
@Override
public void registerListener(EventObject e) {
super.registerListener(e);
@ -98,7 +103,8 @@ public class DailyloanbillExpAccPlugin extends AbstractBillPlugIn implements Plu
}
if(id!=null){
QFilter nameQFilter = new QFilter(prefix+"_accounts", QCP.equals,id);
DynamicObject dynamicObject1 = BusinessDataServiceHelper.loadSingle(MAP_TABLE, "createorg,zcgj_entryentity,zcgj_entryentity.zcgj_entity_items", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject dynamicObject1 = BusinessDataServiceHelper.loadSingle(MAP_TABLE, "createorg,zcgj_entryentity,zcgj_entryentity.zcgj_entity_items", new QFilter[]{nameQFilter,billTypeQFilter});
DynamicObject dynamicObject2 = this.getModel().getDataEntity(true).getDynamicObjectCollection(EXPENSE_ENTRY_ENTITY).get(selectRow);
boolean isEx = false;
if(dynamicObject2!=null){
@ -120,7 +126,8 @@ public class DailyloanbillExpAccPlugin extends AbstractBillPlugIn implements Plu
if(inputValue!=null){
String id = String.valueOf(inputValue) ;
QFilter nameQFilter = new QFilter(prefix+"_entryentity.zcgj_entity_items.id", QCP.equals,Long.valueOf(id));
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter,billTypeQFilter});
Object value = this.getModel().getValue(ACCOUNT_ITEM, selectRow);
if(value==null && load!=null && load.length>0){
DynamicObject dynamicObject = load[0];
@ -137,6 +144,15 @@ public class DailyloanbillExpAccPlugin extends AbstractBillPlugIn implements Plu
String name = arg0.getProperty().getName();
if(name.equals(ACCOUNT_ITEM)){
selectRow = arg0.getRow();
//会计科目根据左树根据科目表编码过滤
String zcgjAccounttableNumber = (String)this.getModel().getValue("zcgj_accounttable_number");
QFilter accountTableFilter = new QFilter("number",QCP.equals,zcgjAccounttableNumber);
DynamicObject accountTableFilterObj = BusinessDataServiceHelper.loadSingle("bd_accounttable", "id,number", new QFilter[]{accountTableFilter});
if(accountTableFilterObj!=null){
long id = accountTableFilterObj.getLong("id");
ListShowParameter param = (ListShowParameter) arg0.getFormShowParameter();
param.getTreeFilterParameter().getQFilters().add(new QFilter("accounttableid", QCP.equals, id));
}
if("setItemByIdFromClient".equals(arg0.getSourceMethod()) ){
selectRow = arg0.getRow();
((BasedataEdit) arg0.getSource()).addAfterF7SelectListener(this);
@ -177,7 +193,8 @@ public class DailyloanbillExpAccPlugin extends AbstractBillPlugIn implements Plu
this.getModel().setValue(EXPENSE_ITEM,listSelectedRow.getPrimaryKeyValue(),index);
if(accountItem==null){
QFilter nameQFilter = new QFilter(prefix+"_entryentity.zcgj_entity_items.id", QCP.equals,listSelectedRow.getPrimaryKeyValue());
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter,billTypeQFilter});
if(load!=null && load.length>0){
DynamicObject dynamicObject = load[0];
long aLong = dynamicObject.getLong("zcgj_accounts_id");
@ -191,7 +208,8 @@ public class DailyloanbillExpAccPlugin extends AbstractBillPlugIn implements Plu
//Object accountItem = this.getModel().getValue(ACCOUNT_ITEM, index);
//if(accountItem == null){
QFilter nameQFilter = new QFilter(prefix+"_entryentity.zcgj_entity_items.id", QCP.equals,listSelectedRow.getPrimaryKeyValue());
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter,billTypeQFilter});
if(load!=null && load.length>0){
DynamicObject dynamicObject = load[0];
DynamicObject zcgjAccounts = dynamicObject.getDynamicObject("zcgj_accounts");

View File

@ -57,6 +57,8 @@ public class DailyreimbursExpAccPlugin extends AbstractBillPlugIn implements Plu
//分录值改变的行号
private static Integer selectRow = null;
private static String BILL_TYPE ="er_dailyreimbursebill";
@Override
public void registerListener(EventObject e) {
super.registerListener(e);
@ -95,7 +97,8 @@ public class DailyreimbursExpAccPlugin extends AbstractBillPlugIn implements Plu
}
if(id!=null){
QFilter nameQFilter = new QFilter(prefix+"_accounts",QCP.equals,id);
DynamicObject dynamicObject1 = BusinessDataServiceHelper.loadSingle(MAP_TABLE, "createorg,zcgj_entryentity,zcgj_entryentity.zcgj_entity_items", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject dynamicObject1 = BusinessDataServiceHelper.loadSingle(MAP_TABLE, "createorg,zcgj_entryentity,zcgj_entryentity.zcgj_entity_items", new QFilter[]{nameQFilter,billTypeQFilter});
DynamicObject dynamicObject2 = this.getModel().getDataEntity(true).getDynamicObjectCollection(EXPENSE_ENTRY_ENTITY).get(selectRow);
boolean isEx = false;
if(dynamicObject2!=null){
@ -117,7 +120,8 @@ public class DailyreimbursExpAccPlugin extends AbstractBillPlugIn implements Plu
if(inputValue!=null){
String id = String.valueOf(inputValue) ;
QFilter nameQFilter = new QFilter(prefix+"_entryentity.zcgj_entity_items.id", QCP.equals,Long.valueOf(id));
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts,zcgj_entryentity.zcgj_rim_expense_type", new QFilter[]{nameQFilter,billTypeQFilter});
Object value = this.getModel().getValue(ACCOUNT_ITEM, selectRow);
if(value==null && load!=null && load.length>0){
DynamicObject dynamicObject = load[0];
@ -134,6 +138,15 @@ public class DailyreimbursExpAccPlugin extends AbstractBillPlugIn implements Plu
String name = arg0.getProperty().getName();
if(name.equals(ACCOUNT_ITEM)){
selectRow = arg0.getRow();
//会计科目根据左树根据科目表编码过滤
String zcgjAccounttableNumber = (String)this.getModel().getValue("zcgj_accounttable_number");
QFilter accountTableFilter = new QFilter("number",QCP.equals,zcgjAccounttableNumber);
DynamicObject accountTableFilterObj = BusinessDataServiceHelper.loadSingle("bd_accounttable", "id,number", new QFilter[]{accountTableFilter});
if(accountTableFilterObj!=null){
long id = accountTableFilterObj.getLong("id");
ListShowParameter param = (ListShowParameter) arg0.getFormShowParameter();
param.getTreeFilterParameter().getQFilters().add(new QFilter("accounttableid", QCP.equals, id));
}
if("setItemByIdFromClient".equals(arg0.getSourceMethod()) ){
selectRow = arg0.getRow();
((BasedataEdit) arg0.getSource()).addAfterF7SelectListener(this);
@ -175,7 +188,8 @@ public class DailyreimbursExpAccPlugin extends AbstractBillPlugIn implements Plu
this.getModel().setValue(EXPENSE_ITEM,listSelectedRow.getPrimaryKeyValue(),index);
if(accountItem==null){
QFilter nameQFilter = new QFilter(prefix+"_entryentity.zcgj_entity_items.id", QCP.equals,listSelectedRow.getPrimaryKeyValue());
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter,billTypeQFilter});
if(load!=null && load.length>0){
DynamicObject dynamicObject = load[0];
long aLong = dynamicObject.getLong("zcgj_accounts_id");
@ -189,7 +203,8 @@ public class DailyreimbursExpAccPlugin extends AbstractBillPlugIn implements Plu
//Object accountItem = this.getModel().getValue(ACCOUNT_ITEM, index);
//if(accountItem == null){
QFilter nameQFilter = new QFilter(prefix+"_entryentity.zcgj_entity_items.id", QCP.equals,listSelectedRow.getPrimaryKeyValue());
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter,billTypeQFilter});
if(load!=null && load.length>0){
DynamicObject dynamicObject = load[0];
DynamicObject zcgjAccounts = dynamicObject.getDynamicObject("zcgj_accounts");

View File

@ -60,6 +60,8 @@ public class PrepaybillExpAccPlugin extends AbstractBillPlugIn implements Plugin
//分录值改变的行号
private static Integer selectRow = null;
private static String BILL_TYPE ="er_prepaybill";
@Override
public void registerListener(EventObject e) {
super.registerListener(e);
@ -99,7 +101,8 @@ public class PrepaybillExpAccPlugin extends AbstractBillPlugIn implements Plugin
}
if(id!=null){
QFilter nameQFilter = new QFilter(prefix+"_accounts", QCP.equals,id);
DynamicObject dynamicObject1 = BusinessDataServiceHelper.loadSingle(MAP_TABLE, "createorg,zcgj_entryentity,zcgj_entryentity.zcgj_entity_items", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject dynamicObject1 = BusinessDataServiceHelper.loadSingle(MAP_TABLE, "createorg,zcgj_entryentity,zcgj_entryentity.zcgj_entity_items", new QFilter[]{nameQFilter,billTypeQFilter});
DynamicObject dynamicObject2 = this.getModel().getDataEntity(true).getDynamicObjectCollection(EXPENSE_ENTRY_ENTITY).get(selectRow);
boolean isEx = false;
if(dynamicObject2!=null){
@ -121,7 +124,8 @@ public class PrepaybillExpAccPlugin extends AbstractBillPlugIn implements Plugin
if(inputValue!=null){
String id = String.valueOf(inputValue) ;
QFilter nameQFilter = new QFilter(prefix+"_entryentity.zcgj_entity_items.id", QCP.equals,Long.valueOf(id));
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter,billTypeQFilter});
Object value = this.getModel().getValue(ACCOUNT_ITEM, selectRow);
if(value==null && load!=null && load.length>0){
DynamicObject dynamicObject = load[0];
@ -138,6 +142,15 @@ public class PrepaybillExpAccPlugin extends AbstractBillPlugIn implements Plugin
String name = arg0.getProperty().getName();
if(name.equals(ACCOUNT_ITEM)){
selectRow = arg0.getRow();
//会计科目根据左树根据科目表编码过滤
String zcgjAccounttableNumber = (String)this.getModel().getValue("zcgj_accounttable_number");
QFilter accountTableFilter = new QFilter("number",QCP.equals,zcgjAccounttableNumber);
DynamicObject accountTableFilterObj = BusinessDataServiceHelper.loadSingle("bd_accounttable", "id,number", new QFilter[]{accountTableFilter});
if(accountTableFilterObj!=null){
long id = accountTableFilterObj.getLong("id");
ListShowParameter param = (ListShowParameter) arg0.getFormShowParameter();
param.getTreeFilterParameter().getQFilters().add(new QFilter("accounttableid", QCP.equals, id));
}
if("setItemByIdFromClient".equals(arg0.getSourceMethod()) ){
selectRow = arg0.getRow();
((BasedataEdit) arg0.getSource()).addAfterF7SelectListener(this);
@ -178,7 +191,8 @@ public class PrepaybillExpAccPlugin extends AbstractBillPlugIn implements Plugin
this.getModel().setValue(EXPENSE_ITEM,listSelectedRow.getPrimaryKeyValue(),index);
if(accountItem==null){
QFilter nameQFilter = new QFilter(prefix+"_entryentity.zcgj_entity_items.id", QCP.equals,listSelectedRow.getPrimaryKeyValue());
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter,billTypeQFilter});
if(load!=null && load.length>0){
DynamicObject dynamicObject = load[0];
long aLong = dynamicObject.getLong("zcgj_accounts_id");
@ -192,7 +206,8 @@ public class PrepaybillExpAccPlugin extends AbstractBillPlugIn implements Plugin
//Object accountItem = this.getModel().getValue(ACCOUNT_ITEM, index);
//if(accountItem == null){
QFilter nameQFilter = new QFilter(prefix+"_entryentity.zcgj_entity_items.id", QCP.equals,listSelectedRow.getPrimaryKeyValue());
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter,billTypeQFilter});
if(load!=null && load.length>0){
DynamicObject dynamicObject = load[0];
DynamicObject zcgjAccounts = dynamicObject.getDynamicObject("zcgj_accounts");

View File

@ -60,6 +60,9 @@ public class PublicreimbursebillExpAccPlugin extends AbstractBillPlugIn implemen
//分录值改变的行号
private static Integer selectRow = null;
//对公报销单
private static String BILL_TYPE ="er_publicreimbursebill";
@Override
public void registerListener(EventObject e) {
super.registerListener(e);
@ -98,7 +101,8 @@ public class PublicreimbursebillExpAccPlugin extends AbstractBillPlugIn implemen
}
if(id!=null){
QFilter nameQFilter = new QFilter(prefix+"_accounts", QCP.equals,id);
DynamicObject dynamicObject1 = BusinessDataServiceHelper.loadSingle(MAP_TABLE, "createorg,zcgj_entryentity,zcgj_entryentity.zcgj_entity_items", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject dynamicObject1 = BusinessDataServiceHelper.loadSingle(MAP_TABLE, "createorg,zcgj_entryentity,zcgj_entryentity.zcgj_entity_items", new QFilter[]{nameQFilter,billTypeQFilter});
DynamicObject dynamicObject2 = this.getModel().getDataEntity(true).getDynamicObjectCollection(EXPENSE_ENTRY_ENTITY).get(selectRow);
boolean isEx = false;
if(dynamicObject2!=null){
@ -120,7 +124,8 @@ public class PublicreimbursebillExpAccPlugin extends AbstractBillPlugIn implemen
if(inputValue!=null){
String id = String.valueOf(inputValue) ;
QFilter nameQFilter = new QFilter(prefix+"_entryentity.zcgj_entity_items.id", QCP.equals,Long.valueOf(id));
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter,billTypeQFilter});
Object value = this.getModel().getValue(ACCOUNT_ITEM, selectRow);
if(value==null && load!=null && load.length>0){
DynamicObject dynamicObject = load[0];
@ -137,6 +142,15 @@ public class PublicreimbursebillExpAccPlugin extends AbstractBillPlugIn implemen
String name = arg0.getProperty().getName();
if(name.equals(ACCOUNT_ITEM)){
selectRow = arg0.getRow();
//会计科目根据左树根据科目表编码过滤
String zcgjAccounttableNumber = (String)this.getModel().getValue("zcgj_accounttable_number");
QFilter accountTableFilter = new QFilter("number",QCP.equals,zcgjAccounttableNumber);
DynamicObject accountTableFilterObj = BusinessDataServiceHelper.loadSingle("bd_accounttable", "id,number", new QFilter[]{accountTableFilter});
if(accountTableFilterObj!=null){
long id = accountTableFilterObj.getLong("id");
ListShowParameter param = (ListShowParameter) arg0.getFormShowParameter();
param.getTreeFilterParameter().getQFilters().add(new QFilter("accounttableid", QCP.equals, id));
}
if("setItemByIdFromClient".equals(arg0.getSourceMethod()) ){
selectRow = arg0.getRow();
((BasedataEdit) arg0.getSource()).addAfterF7SelectListener(this);
@ -177,7 +191,8 @@ public class PublicreimbursebillExpAccPlugin extends AbstractBillPlugIn implemen
this.getModel().setValue(EXPENSE_ITEM,listSelectedRow.getPrimaryKeyValue(),index);
if(accountItem==null){
QFilter nameQFilter = new QFilter(prefix+"_entryentity.zcgj_entity_items.id", QCP.equals,listSelectedRow.getPrimaryKeyValue());
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter,billTypeQFilter});
if(load!=null && load.length>0){
DynamicObject dynamicObject = load[0];
long aLong = dynamicObject.getLong("zcgj_accounts_id");
@ -191,7 +206,8 @@ public class PublicreimbursebillExpAccPlugin extends AbstractBillPlugIn implemen
//Object accountItem = this.getModel().getValue(ACCOUNT_ITEM, index);
//if(accountItem == null){
QFilter nameQFilter = new QFilter(prefix+"_entryentity.zcgj_entity_items.id", QCP.equals,listSelectedRow.getPrimaryKeyValue());
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter});
QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE);
DynamicObject[] load = BusinessDataServiceHelper.load(MAP_TABLE, "createorg,zcgj_accounts", new QFilter[]{nameQFilter,billTypeQFilter});
if(load!=null && load.length>0){
DynamicObject dynamicObject = load[0];
DynamicObject zcgjAccounts = dynamicObject.getDynamicObject("zcgj_accounts");