1、saleorder_config.xml中修改InitDataListener
<bean id="InitDataListener"
class="nc.ui.pubapp.uif2app.model.DefaultFuncNodeInitDataListener">
<property name="context" ref="context" />
<property name="model" ref="ManageAppModel" />
<property name="voClassName" value="nc.vo.so.m30.entity.SaleOrderVO" />
<property name="autoShowUpComponent" ref="billFormEditor" />
<property name="queryAction" ref="queryAction" />
<!-- by hqh in 2023-10-9 推单初始化处理类 -->
<property name="processorMap">
<map>
<entry>
<key>
<value>8888</value>
</key>
<bean class="nc.ui.so.m30.billui.refbill.InitDataProcessorForPrivate">
<property name="transferProcessor" ref="transferViewProcessorForPrivate" />
</bean>
</entry>
</map>
</property>
</bean>
<!-- by hqh in 2023-10-9 转单处理类 -->
<bean id="transferViewProcessorForPrivate" class="nc.ui.pubapp.billref.dest.TransferViewProcessor">
<property name="list" ref="listView" />
<property name="actionContainer" ref="actionsOfList" />
<property name="cardActionContainer" ref="actionsOfCard" />
<property name="transferLogic" ref="defaultBillDataLogicForPrivate" />
<property name="billForm" ref="billFormEditor" />
<property name="cancelAction" ref="cancelAction" />
<property name="saveAction" ref="saveAction" />
<!-- 单据提交按钮 -->
<property name="commitAction" ref="sendApproveAction" />
</bean>
<!-- by hqh in 2023-10-9 转单处理类 -->
<bean id="defaultBillDataLogicForPrivate" class="nc.ui.so.m30.billui.refbill.M30Ref4CTRansferBillPrivateDataLogic">
<property name="billForm" ref="billFormEditor" />
</bean>
2、saleorder_config.java中加如下的内容
public nc.ui.pubapp.uif2app.model.DefaultFuncNodeInitDataListener getInitDataListener(){
if(context.get("InitDataListener")!=null)
return (nc.ui.pubapp.uif2app.model.DefaultFuncNodeInitDataListener)context.get("InitDataListener");
nc.ui.pubapp.uif2app.model.DefaultFuncNodeInitDataListener bean = new nc.ui.pubapp.uif2app.model.DefaultFuncNodeInitDataListener();
context.put("InitDataListener",bean);
bean.setContext(getContext());
bean.setModel(getManageAppModel());
bean.setVoClassName("nc.vo.so.m30.entity.SaleOrderVO");
bean.setAutoShowUpComponent(getBillFormEditor());
bean.setQueryAction(getQueryAction());
bean.setProcessorMap(getManagedMap888());
setBeanFacotryIfBeanFacatoryAware(bean);
invokeInitializingBean(bean);
return bean;
}
private Map getManagedMap888(){ Map map = new HashMap(); map.put("Private",getInitDataProcessorForPrivate()); return map;}
public nc.ui.so.m30.billui.refbill.InitDataProcessorForPrivate getInitDataProcessorForPrivate(){
if(context.get("initDataProcessorForPrivate")!=null)
return (nc.ui.so.m30.billui.refbill.InitDataProcessorForPrivate)context.get("initDataProcessorForPrivate");
nc.ui.so.m30.billui.refbill.InitDataProcessorForPrivate bean = new nc.ui.so.m30.billui.refbill.InitDataProcessorForPrivate();
context.put("initDataProcessorForPrivate",bean);
bean.setTransferProcessor(getTransferViewProcessorForPrivate());
setBeanFacotryIfBeanFacatoryAware(bean);
invokeInitializingBean(bean);
return bean;
}
public nc.ui.pubapp.billref.dest.TransferViewProcessor getTransferViewProcessorForPrivate(){
if(context.get("transferViewProcessorForPrivate")!=null)
return (nc.ui.pubapp.billref.dest.TransferViewProcessor)context.get("transferViewProcessorForPrivate");
nc.ui.pubapp.billref.dest.TransferViewProcessor bean = new nc.ui.pubapp.billref.dest.TransferViewProcessor();
context.put("transferViewProcessorForPrivate",bean);
bean.setList(getListView());
bean.setActionContainer(getActionsOfList());
bean.setCardActionContainer(getActionsOfCard());
bean.setTransferLogic(getDefaultBillDataLogicForPrivate());
bean.setBillForm(getBillFormEditor());
bean.setCancelAction(getCancelAction());
bean.setSaveAction(getSaveAction());
bean.setCommitAction(getSendApproveAction());
setBeanFacotryIfBeanFacatoryAware(bean);
invokeInitializingBean(bean);
return bean;
}
public nc.ui.so.m30.billui.refbill.M30Ref4CTRansferBillPrivateDataLogic getDefaultBillDataLogicForPrivate(){
if(context.get("defaultBillDataLogicForPrivate")!=null)
return (nc.ui.so.m30.billui.refbill.M30Ref4CTRansferBillPrivateDataLogic)context.get("defaultBillDataLogicForPrivate");
nc.ui.so.m30.billui.refbill.M30Ref4CTRansferBillPrivateDataLogic bean = new nc.ui.so.m30.billui.refbill.M30Ref4CTRansferBillPrivateDataLogic();
context.put("defaultBillDataLogicForPrivate",bean);
bean.setBillForm(getBillFormEditor());
setBeanFacotryIfBeanFacatoryAware(bean);
invokeInitializingBean(bean);
return bean;
}
3、代码增加InitDataProcessorForPrivate类
package nc.ui.so.m30.billui.refbill;
import nc.funcnode.ui.FuncletInitData;
import nc.ui.pubapp.billref.dest.TransferViewProcessor;
import nc.ui.pubapp.uif2app.model.DefaultFuncNodeInitDataListener;
import nc.ui.pubapp.uif2app.view.BillForm;
import nc.vo.so.m30.entity.SaleOrderVO;
public class InitDataProcessorForPrivate implements DefaultFuncNodeInitDataListener.IInitDataProcessor {
private TransferViewProcessor transferProcessor;
public TransferViewProcessor getTransferProcessor() {
return transferProcessor;
}
public void setTransferProcessor(TransferViewProcessor transferProcessor) {
this.transferProcessor = transferProcessor;
}
public void process(FuncletInitData initData) {
BillForm editor = this.getTransferProcessor().getBillForm();
editor.getModel().initModel(null);
SaleOrderVO[] vos = (SaleOrderVO[])initData.getInitData();
this.getTransferProcessor().processBillTransfer(vos);
}
}
4.代码增加M30Ref4CTRansferBillPrivateDataLogic类
package nc.ui.so.m30.billui.refbill;
import nc.ui.pub.bill.BillCardPanel;
import nc.ui.pubapp.billref.dest.DefaultBillDataLogic;
import nc.ui.so.pub.keyvalue.CardKeyValue;
import nc.vo.so.m30.rule.HeadTotalCalculateRule;
import nc.vo.so.pub.keyvalue.IKeyValue;
public class M30Ref4CTRansferBillPrivateDataLogic extends DefaultBillDataLogic {
@Override
public void doTransferAddLogic(Object selectedData) {
// 把数据设置在界面上
super.doTransferAddLogic(selectedData);
// 基于界面卡片填充值运算
BillCardPanel cardPanel = this.getBillForm().getBillCardPanel();
IKeyValue keyValue = new CardKeyValue(cardPanel);
// 2.表头合计
HeadTotalCalculateRule totalrule = new HeadTotalCalculateRule(keyValue);
totalrule.calculateHeadTotal();
}
}
5、销售出库单上增加的按钮中添加如下代码
FuncletInitData initData = new FuncletInitData();
initData.setInitType(8888); //initType和下游初始化监听设置的一致
initData.setInitData(aggVO);//aggVO是销售订单aggvo,aggvo可以数组
FuncRegisterVO funvo = WorkbenchEnvironment.getInstance().getFuncRegisterVO("40060301");
FuncletWindowLauncher.openFuncNodeInTabbedPane(getModel().getContext().getEntranceUI(), funvo, initData, null, false);