| 
					
				 | 
			
			
				@@ -5,6 +5,9 @@ import kd.bos.bill.BillShowParameter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import kd.bos.context.RequestContext; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import kd.bos.dataentity.entity.DynamicObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import kd.bos.dataentity.entity.DynamicObjectCollection; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import kd.bos.entity.AppInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import kd.bos.entity.AppMetadataCache; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import kd.bos.entity.param.AppParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import kd.bos.form.CloseCallBack; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import kd.bos.form.FormShowParameter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import kd.bos.form.ShowType; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -22,11 +25,13 @@ import kd.bos.permission.api.HasPermOrgResult; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import kd.bos.servicehelper.BusinessDataServiceHelper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import kd.bos.servicehelper.operation.DeleteServiceHelper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import kd.bos.servicehelper.operation.SaveServiceHelper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import kd.bos.servicehelper.parameter.SystemParamServiceHelper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import kd.bos.servicehelper.permission.PermissionServiceHelper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import kd.bos.servicehelper.user.UserServiceHelper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.apache.commons.lang3.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.stream.Collectors; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * 日结执行界面插件 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -39,6 +44,11 @@ public class DailyexcuteFormPlugin extends AbstractBillPlugIn implements CellCli 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private final static String KEY_DAILY = "nckd_daily"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //页面取消按钮标识 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private final static String KEY_UNDAILY = "nckd_undaily"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //开启了日结参数的组织ID集 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void initialize() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        super.initialize(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public void registerListener(EventObject e) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -217,13 +227,45 @@ public class DailyexcuteFormPlugin extends AbstractBillPlugIn implements CellCli 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if("nckd_org".equals(propertyName)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             List<QFilter> qFilters = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //判断用户组织范围 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             HasPermOrgResult userHasPermOrgs = PermissionServiceHelper.getUserHasPermOrgs(Long.parseLong(RequestContext.get().getUserId())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             boolean hasallOrg = userHasPermOrgs.hasAllOrgPerm(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if(hasallOrg==false){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<Long> hasPermOrgs = userHasPermOrgs.getHasPermOrgs(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 qFilters.add(new QFilter("id", QCP.in, hasPermOrgs)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                formShowParameter.getListFilterParameter().setQFilters(qFilters); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //判断组织是否开启了日结参数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<Long> orgIds = new ArrayList<Long>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<Long> orgQueryIds = new ArrayList<Long>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            QFilter qFilter_enable = new QFilter("enable", QCP.equals,"1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            QFilter qFilter_status = new QFilter("status", QCP.equals, "C"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            QFilter qFilter_fisaccounting = new QFilter("fisaccounting", QCP.equals, "1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            DynamicObject[] orgCol = BusinessDataServiceHelper.load("bos_org","id", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    new QFilter[]{qFilter_enable,qFilter_status,qFilter_fisaccounting}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for(DynamicObject orgObj : orgCol){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                orgQueryIds.add(orgObj.getLong("id")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //根据应用编码从缓存中获取应用信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AppInfo cgfwAppInfo = AppMetadataCache.getAppInfo("gl"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //获取应用的主键 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String appId = cgfwAppInfo.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AppParam apm = new AppParam(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            apm.setAppId(appId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            apm.setOrgIds(orgQueryIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Map<String,Map<String, Object>> paramWhole = SystemParamServiceHelper.loadBatchAppParameterByOrg(apm,orgQueryIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Set<String> keysWithNullValues = paramWhole.entrySet().stream().filter(entry -> entry.getValue().size()>0).map(Map.Entry::getKey) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    .collect(Collectors.toSet()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for(String key :keysWithNullValues){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Map valueObj = paramWhole.get(key); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Object nckd_isopendaily = valueObj.get("nckd_isopendaily"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if("true".equals(nckd_isopendaily.toString())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    orgIds.add(Long.valueOf(key)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            qFilters.add(new QFilter("id", QCP.in, orgIds)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            formShowParameter.getListFilterParameter().setQFilters(qFilters); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |