添加仅针对矿山下组织下的逻辑
This commit is contained in:
		
							parent
							
								
									32ee5602e9
								
							
						
					
					
						commit
						a15bdb2293
					
				| 
						 | 
				
			
			@ -7,6 +7,7 @@ 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 zcgj.zcdev.zcdev.fs.utils.OrgCheckUtils;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
  对公报销单提交校验插件:校验往来单位与开票公司是否一致,不一致需填写特殊说明
 | 
			
		||||
| 
						 | 
				
			
			@ -34,21 +35,28 @@ public class PublicReimburPayeriOp extends AbstractOperationServicePlugIn {
 | 
			
		|||
            ExtendedDataEntity[] extendedDataEntities = this.getDataEntities();
 | 
			
		||||
            for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) {
 | 
			
		||||
                DynamicObject dataEntity = extendedDataEntity.getDataEntity();
 | 
			
		||||
                DynamicObjectCollection invoiceEntryCollection = dataEntity.getDynamicObjectCollection("invoiceentry");//发票信息
 | 
			
		||||
                if (invoiceEntryCollection.size() > 0) {
 | 
			
		||||
                    DynamicObject billPayerId = dataEntity.getDynamicObject("billpayerid");//往来单位
 | 
			
		||||
                    String zcgj_invoiceremark = dataEntity.getString("zcgj_invoiceremark");//特殊说明
 | 
			
		||||
                    if (billPayerId != null) {
 | 
			
		||||
                        String billPayerIdName = billPayerId.getString("name");
 | 
			
		||||
                        for (DynamicObject invoiceEntry : invoiceEntryCollection) {
 | 
			
		||||
                            String makeOutCompName = invoiceEntry.getString("makeoutcompname");//开票公司
 | 
			
		||||
                            if (!makeOutCompName.equals(billPayerIdName) && "".equals(zcgj_invoiceremark)) {
 | 
			
		||||
                                //开票公司与往来单位名称不一致,且特殊说明为空
 | 
			
		||||
                                this.addFatalErrorMessage(extendedDataEntity, "开票公司与往来单位存在不一致!请填写特殊说明!");
 | 
			
		||||
                DynamicObject costCompany = dataEntity.getDynamicObject("costcompany");//费用承担公司
 | 
			
		||||
                if (costCompany != null) {
 | 
			
		||||
                    Long companyId = costCompany.getLong("id");
 | 
			
		||||
                    if (OrgCheckUtils.isKS(companyId)) {
 | 
			
		||||
                        //仅针对矿山下组织下的逻辑
 | 
			
		||||
                        DynamicObjectCollection invoiceEntryCollection = dataEntity.getDynamicObjectCollection("invoiceentry");//发票信息
 | 
			
		||||
                        if (invoiceEntryCollection.size() > 0) {
 | 
			
		||||
                            DynamicObject billPayerId = dataEntity.getDynamicObject("billpayerid");//往来单位
 | 
			
		||||
                            String zcgj_invoiceremark = dataEntity.getString("zcgj_invoiceremark");//特殊说明
 | 
			
		||||
                            if (billPayerId != null) {
 | 
			
		||||
                                String billPayerIdName = billPayerId.getString("name");
 | 
			
		||||
                                for (DynamicObject invoiceEntry : invoiceEntryCollection) {
 | 
			
		||||
                                    String makeOutCompName = invoiceEntry.getString("makeoutcompname");//开票公司
 | 
			
		||||
                                    if (!makeOutCompName.equals(billPayerIdName) && "".equals(zcgj_invoiceremark)) {
 | 
			
		||||
                                        //开票公司与往来单位名称不一致,且特殊说明为空
 | 
			
		||||
                                        this.addFatalErrorMessage(extendedDataEntity, "开票公司与往来单位存在不一致!请填写特殊说明!");
 | 
			
		||||
                                    }
 | 
			
		||||
                                }
 | 
			
		||||
                            } else {
 | 
			
		||||
                                this.addFatalErrorMessage(extendedDataEntity, "往来单位为空");
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    } else {
 | 
			
		||||
                        this.addFatalErrorMessage(extendedDataEntity, "往来单位为空");
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue