parent
							
								
									f74442bb19
								
							
						
					
					
						commit
						15ad1fe6e4
					
				| 
						 | 
				
			
			@ -42,8 +42,15 @@ public class AccountApplicationBillPlugin extends AbstractBillPlugIn implements
 | 
			
		|||
            try {
 | 
			
		||||
                DynamicObject dataEntity = this.getModel().getDataEntity(true);
 | 
			
		||||
 | 
			
		||||
                String finorgtype = dataEntity.getString("finorgtype");
 | 
			
		||||
                if (!"0".equals(finorgtype)) {
 | 
			
		||||
                    logger.info("金融机构类型不为银行,无法带出");
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                boolean issetbankinterface = dataEntity.getBoolean("issetbankinterface");
 | 
			
		||||
                if (!issetbankinterface) {
 | 
			
		||||
                    logger.info("未勾选开通银企接口,无需带出");
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -99,6 +99,12 @@ public class AccountbanksFormPlugin extends AbstractFormPlugin {
 | 
			
		|||
            try {
 | 
			
		||||
                DynamicObject dataEntity = this.getModel().getDataEntity(true);
 | 
			
		||||
 | 
			
		||||
                String finorgtype = dataEntity.getString("finorgtype");
 | 
			
		||||
                if (!"0".equals(finorgtype)) {
 | 
			
		||||
                    logger.info("金融机构类型不为银行,无法带出");
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                boolean issetbankinterface = dataEntity.getBoolean("issetbankinterface");
 | 
			
		||||
                if (!issetbankinterface) {
 | 
			
		||||
                    return;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,54 @@
 | 
			
		|||
package shkd.sys.sys.plugin.operation;
 | 
			
		||||
 | 
			
		||||
import kd.bos.dataentity.entity.DynamicObject;
 | 
			
		||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
 | 
			
		||||
import kd.bos.entity.plugin.args.BeforeOperationArgs;
 | 
			
		||||
import kd.bos.logging.Log;
 | 
			
		||||
import kd.bos.logging.LogFactory;
 | 
			
		||||
import kd.bos.orm.query.QCP;
 | 
			
		||||
import kd.bos.orm.query.QFilter;
 | 
			
		||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
 | 
			
		||||
import kd.sdk.plugin.Plugin;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 开户申请操作校验
 | 
			
		||||
 */
 | 
			
		||||
public class AccountApplicationOP extends AbstractOperationServicePlugIn implements Plugin {
 | 
			
		||||
    private static final Log logger = LogFactory.getLog(AccountApplicationOP.class);
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
 | 
			
		||||
        super.beforeExecuteOperationTransaction(e);
 | 
			
		||||
        String operationKey = e.getOperationKey();
 | 
			
		||||
        DynamicObject[] objects = e.getDataEntities();
 | 
			
		||||
        // 账户类型
 | 
			
		||||
        String acctstyle = objects[0].getString("acctstyle");
 | 
			
		||||
 | 
			
		||||
        if (!"basic".equals(acctstyle)) {
 | 
			
		||||
            logger.info("非基本存款账户,不需要校验");
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 开户公司编码
 | 
			
		||||
        DynamicObject openorg = objects[0].getDynamicObject("openorg");
 | 
			
		||||
        Object openorg_id = openorg.getPkValue();
 | 
			
		||||
        logger.info("获取开户公司编码:{}", openorg.getString("number"));
 | 
			
		||||
 | 
			
		||||
        DynamicObject[] dynamicObjects = BusinessDataServiceHelper.load("am_accountbank", "id,bankaccountnumber,acctstyle,openorg", new QFilter("openorg", QCP.equals, openorg_id).toArray());
 | 
			
		||||
 | 
			
		||||
        boolean result = false;
 | 
			
		||||
 | 
			
		||||
        for (DynamicObject dynamicObject : dynamicObjects) {
 | 
			
		||||
            String acctstyleObj = dynamicObject.getString("acctstyle");
 | 
			
		||||
            if ("basic".equals(acctstyleObj)) {
 | 
			
		||||
                result = true;
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (result) {
 | 
			
		||||
            e.setCancel(true);
 | 
			
		||||
            e.setCancelMessage("开户单位已存在基本存款账户(一个开户单位只允许存在一个基本户)");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue