金蝶云苍穹单据转换插件beforeBuildRowCondition事件案例

涎涎原创约 496 字大约 2 分钟...KingdeeKingdee

88-金蝶云苍穹单据转换插件beforeBuildRowCondition事件案例.mdopen in new window

注意

本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。

前置条件

两张单据,例笔者就做了两张单据分别为采购申请单和采购订单

编码

package kd.bos.billzh.plugin;

import kd.bos.entity.botp.plugin.AbstractConvertPlugIn;
import kd.bos.entity.botp.plugin.args.BeforeBuildRowConditionEventArgs;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;

/**
 * <p>Title: </p>
 * <p>
 *    Description:
 *    试验成功
 * </p>
 * <p>Copyright: Copyright (c) 2020</p>
 * @author xx
 * @date 2020年3月16日
 * @version 1.0
 */
public class BeforeBuildRowConditionSample extends AbstractConvertPlugIn {
	/**
	 * <p>Title: </p>
	 * <p>
	 *    Description:
	 * </p>
	 * <p>Copyright: Copyright (c) 2020</p>
	 * @author xx
	 * @date 2020年3月16日
	 * @param param the bare_field_name
	 * @param e
	 * @see kd.bos.entity.botp.plugin.IConvertPlugIn#beforeBuildRowCondition(kd.bos.entity.botp.plugin.args.BeforeBuildRowConditionEventArgs)
	 * @version 1.0
	 */
	@Override
	public void beforeBuildRowCondition(BeforeBuildRowConditionEventArgs e) {
		
		if (!cannotPushLockBill()){
			e.setCustFilterDesc("不允许下推已锁定的单据");		// 给出不允许下推的原因
			
			// 设置条件表达式,用于脚本执行 (必选)
//			e.setCustFilterExpression(" lockstatus = 'A' ");
			e.setCustFilterExpression(" status = 'A' ");//单据状态等于A
			
			// 同时设置具有相同含义的QFilter条件,用于选单数据查询 (必选)
//			QFilter qFilter = new QFilter("lockstatus", QCP.equals, "A"); 
			QFilter qFilter = new QFilter("status", QCP.equals, "A"); 
//			e.getCustQFilters().add(qFilter);
		}
	}
	
	/**
	 * boolean</br>
	 * 
	 * <p>Title: </p>
	 * <p>
	 *    Description:
	 * 读取业务应用的系统参数值
	 * </p>
	 * <p>Copyright: Copyright (c) 2020</p>
	 * @author xx
	 * @date 2020年3月16日
	 * @param param the bare_field_name
	 * @return the bare_field_name
	 * @return
	 * @version 1.0
	 */
	private boolean cannotPushLockBill(){
		// 实际业务系统并没有这个选项,本演示代码,直接返回false,演示添加条件
		return false;
		//return (boolean)SystemParamterServiceHelper.getParameter(0, 0, "sal", "cannotpushlockbill");
	}
}

测试

  1. 注册插件
  1. 预览测试

分割线


相关信息

以上就是我关于 金蝶云苍穹单据转换插件beforeBuildRowCondition事件案例 知识点整理与总结的全部内容,希望对你有帮助。。。。。。。

上次编辑于:
贡献者: 涎涎
评论
  • 按正序
  • 按倒序
  • 按热度
Powered by Waline v2.15.4