Compare commits
No commits in common. "874977fa9dff77271e85bb01331d467600d707e8" and "65884bbc8f53b378e88dcb55a53a46bf775960f3" have entirely different histories.
874977fa9d
...
65884bbc8f
|
@ -4,38 +4,18 @@ import kd.bos.bill.AbstractBillPlugIn;
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
import kd.bos.entity.datamodel.events.ChangeData;
|
import kd.bos.entity.datamodel.events.ChangeData;
|
||||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||||
import kd.bos.form.field.BasedataEdit;
|
|
||||||
import kd.bos.form.field.ItemClassEdit;
|
|
||||||
import kd.bos.form.field.events.BeforeF7SelectEvent;
|
|
||||||
import kd.bos.form.field.events.BeforeF7SelectListener;
|
|
||||||
import kd.bos.list.ListShowParameter;
|
|
||||||
import kd.bos.orm.query.QCP;
|
|
||||||
import kd.bos.orm.query.QFilter;
|
|
||||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
||||||
import kd.bos.servicehelper.org.OrgUnitServiceHelper;
|
|
||||||
import kd.sdk.plugin.Plugin;
|
import kd.sdk.plugin.Plugin;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单据界面插件,费用承担公司根据支付公司做变化
|
* 单据界面插件,费用承担公司根据支付公司做变化
|
||||||
* 支付公司榆叶飞云组织隔离
|
|
||||||
*/
|
*/
|
||||||
public class CommonCostCompanyPlugin extends AbstractBillPlugIn implements BeforeF7SelectListener, Plugin {
|
public class CommonCostCompanyPlugin extends AbstractBillPlugIn implements Plugin {
|
||||||
|
|
||||||
List<String> orgNumberList = new ArrayList<String>(Arrays.asList("Q-003-010","Q-003-015","Q-003-011","Q-003-012","Q-003-014","Q-003-016","Q-003-017","B-021B-062"));
|
|
||||||
//海南榆叶信息科技有限公司、海南榆叶信息科技有限公司北京分公司、海南榆叶信息科技有限公司杭州分公司、海南榆叶信息科技有限公司上海分公司、海南榆叶信息科技有限公司广州分公司、海南榆叶信息科技有限公司徐州分公司、海南榆叶信息科技有限公司南京分公司、上海挚俊信息科技有限公司
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerListener(EventObject e) {
|
public void registerListener(EventObject e) {
|
||||||
super.registerListener(e);
|
super.registerListener(e);
|
||||||
BasedataEdit edit = this.getView().getControl("paycompany");
|
|
||||||
if (edit != null){
|
|
||||||
edit.addBeforeF7SelectListener(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -60,32 +40,4 @@ public class CommonCostCompanyPlugin extends AbstractBillPlugIn implements Befor
|
||||||
this.getModel().setValue("costcompany",value);
|
this.getModel().setValue("costcompany",value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) {
|
|
||||||
String name = beforeF7SelectEvent.getProperty().getName();
|
|
||||||
if ("paycompany".equals(name)){
|
|
||||||
DynamicObject org = (DynamicObject) this.getModel().getValue("org");
|
|
||||||
if (org != null){
|
|
||||||
Long orgId = org.getLong("id");
|
|
||||||
List<Long> allSuperiorOrges = OrgUnitServiceHelper.getAllSuperiorOrgs("01", orgId);//获取当前组织的所有上级行政组织
|
|
||||||
QFilter numberQF = new QFilter("number", QCP.equals, "16004610");
|
|
||||||
DynamicObject yuye = BusinessDataServiceHelper.loadSingle("bos_adminorg", "id", numberQF.toArray());//查询组织榆叶飞云
|
|
||||||
if (yuye != null){
|
|
||||||
Long yyId= yuye.getLong("id");
|
|
||||||
if (allSuperiorOrges.contains(yyId) || yyId.equals(orgId) ){//当组织为榆叶飞云或者上级组织包含榆叶飞云则认定为归属榆叶飞云
|
|
||||||
//过滤为榆叶飞云下级组织
|
|
||||||
QFilter inNumberQF = new QFilter("number", QCP.in, orgNumberList);
|
|
||||||
ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
|
||||||
formShowParameter.getListFilterParameter().setFilter(inNumberQF);
|
|
||||||
}else {//
|
|
||||||
QFilter inNumberQF = new QFilter("number", QCP.not_in, orgNumberList);
|
|
||||||
ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
|
||||||
formShowParameter.getListFilterParameter().setFilter(inNumberQF);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,23 +8,10 @@ import kd.bos.entity.datamodel.events.AfterDeleteRowEventArgs;
|
||||||
import kd.bos.entity.datamodel.events.BeforeDeleteRowEventArgs;
|
import kd.bos.entity.datamodel.events.BeforeDeleteRowEventArgs;
|
||||||
import kd.bos.entity.datamodel.events.ChangeData;
|
import kd.bos.entity.datamodel.events.ChangeData;
|
||||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||||
import kd.bos.form.field.BasedataEdit;
|
|
||||||
import kd.bos.form.field.ItemClassEdit;
|
|
||||||
import kd.bos.form.field.events.BeforeF7SelectEvent;
|
|
||||||
import kd.bos.form.field.events.BeforeF7SelectListener;
|
|
||||||
import kd.bos.form.plugin.AbstractFormPlugin;
|
import kd.bos.form.plugin.AbstractFormPlugin;
|
||||||
import kd.bos.list.ListShowParameter;
|
|
||||||
import kd.bos.orm.query.QCP;
|
|
||||||
import kd.bos.orm.query.QFilter;
|
|
||||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
||||||
import kd.bos.servicehelper.org.OrgUnitServiceHelper;
|
|
||||||
import kd.sdk.plugin.Plugin;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @projectName: shkd-cosmic-root-project
|
* @projectName: shkd-cosmic-root-project
|
||||||
|
@ -35,23 +22,14 @@ import java.util.List;
|
||||||
* @date: 2024/5/27 16:09
|
* @date: 2024/5/27 16:09
|
||||||
* @version: 1.0
|
* @version: 1.0
|
||||||
*/
|
*/
|
||||||
public class ContractbillFromPlugin extends AbstractFormPlugin implements BeforeF7SelectListener, Plugin {
|
public class ContractbillFromPlugin extends AbstractFormPlugin {
|
||||||
|
|
||||||
List<String> orgNumberList = new ArrayList<String>(Arrays.asList("Q-003-010","Q-003-015","Q-003-011","Q-003-012","Q-003-014","Q-003-016","Q-003-017","B-021B-062"));
|
|
||||||
//海南榆叶信息科技有限公司、海南榆叶信息科技有限公司北京分公司、海南榆叶信息科技有限公司杭州分公司、海南榆叶信息科技有限公司上海分公司、海南榆叶信息科技有限公司广州分公司、海南榆叶信息科技有限公司徐州分公司、海南榆叶信息科技有限公司南京分公司、上海挚俊信息科技有限公司
|
|
||||||
@Override
|
|
||||||
public void registerListener(EventObject e) {
|
|
||||||
super.registerListener(e);
|
|
||||||
ItemClassEdit edit = this.getView().getControl("contractparty");
|
|
||||||
if (edit != null){
|
|
||||||
edit.addBeforeF7SelectListener(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterCreateNewData(EventObject e) {
|
public void afterCreateNewData(EventObject e) {
|
||||||
super.afterCreateNewData(e);
|
super.afterCreateNewData(e);
|
||||||
IDataModel model = this.getModel();
|
IDataModel model = this.getModel();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -129,37 +107,4 @@ public class ContractbillFromPlugin extends AbstractFormPlugin implements Before
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) {
|
|
||||||
String name = beforeF7SelectEvent.getProperty().getName();
|
|
||||||
if ("contractparty".equals(name)){
|
|
||||||
int row = beforeF7SelectEvent.getRow();
|
|
||||||
DynamicObjectCollection t_er_contractparty = this.getModel().getEntryEntity("contractpartyentry");
|
|
||||||
DynamicObject dynamicObject = t_er_contractparty.get(row);//获取当前行数据
|
|
||||||
String signcontract = dynamicObject.getString("signcontract");//获取签约方
|
|
||||||
if ("0".equals(signcontract)){//当签约方为甲方时
|
|
||||||
DynamicObject org = (DynamicObject) this.getModel().getValue("org");
|
|
||||||
if (org != null){
|
|
||||||
Long orgId = org.getLong("id");
|
|
||||||
List<Long> allSuperiorOrges = OrgUnitServiceHelper.getAllSuperiorOrgs("01", orgId);//获取当前组织的所有上级行政组织
|
|
||||||
QFilter numberQF = new QFilter("number", QCP.equals, "16004610");
|
|
||||||
DynamicObject yuye = BusinessDataServiceHelper.loadSingle("bos_adminorg", "id", numberQF.toArray());//查询组织榆叶飞云
|
|
||||||
if (yuye != null){
|
|
||||||
Long yyId= yuye.getLong("id");
|
|
||||||
if (allSuperiorOrges.contains(yyId) || yyId.equals(orgId) ){//当组织为榆叶飞云或者上级组织包含榆叶飞云则认定为归属榆叶飞云
|
|
||||||
//过滤为榆叶飞云下级组织
|
|
||||||
QFilter inNumberQF = new QFilter("number", QCP.in, orgNumberList);
|
|
||||||
ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
|
||||||
formShowParameter.getListFilterParameter().setFilter(inNumberQF);
|
|
||||||
}else {//
|
|
||||||
QFilter inNumberQF = new QFilter("number", QCP.not_in, orgNumberList);
|
|
||||||
ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
|
||||||
formShowParameter.getListFilterParameter().setFilter(inNumberQF);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue