动态添加风险预警方法
This commit is contained in:
parent
168b82726f
commit
a901f563c5
@ -5,6 +5,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import javax.script.Bindings;
|
||||
import javax.script.Invocable;
|
||||
@ -155,6 +156,24 @@ public class DefaultScenarioContextLoader extends ScenarioContextLoader{
|
||||
}
|
||||
}
|
||||
|
||||
public String getString( Object obj ) {
|
||||
if ( obj == null ) {
|
||||
return "";
|
||||
}
|
||||
return obj.toString();
|
||||
}
|
||||
|
||||
public Map<String, String> convertMapToMapString( Map<String, Object> params ) {
|
||||
if ( params == null || params.isEmpty() ) {
|
||||
return null;
|
||||
}
|
||||
Map<String, String> result = new ConcurrentHashMap<String, String>();
|
||||
for ( java.util.Map.Entry<String, Object> p : params.entrySet() ) {
|
||||
result.put( p.getKey(), getString( p.getValue() ) );
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* 根据产品的阶段和流程步骤视图处理类来处理加载检查项
|
||||
*/
|
||||
@ -175,6 +194,9 @@ public class DefaultScenarioContextLoader extends ScenarioContextLoader{
|
||||
if(null!=flowModel.getAttribute("FlOWPAGECHECK")&&flowModel.getAttribute("FlOWPAGECHECK").getString().length()>0){
|
||||
try {
|
||||
custCheckNode=flowModel.getAttribute("FlOWPAGECHECK").getString();
|
||||
Map<String, String> flowParams = convertMapToMapString( cparam );
|
||||
flowParams.putAll( GetFlowAction.getFlowParamByFlowUnid( cparam.get( "ObjectNo" ).toString() ) );
|
||||
productGroup.setFlowFixedParam( flowParams );
|
||||
ScriptEngineManager factory = new ScriptEngineManager();
|
||||
//每次生成一个engine实例
|
||||
ScriptEngine engine = factory.getEngineByName("groovy");
|
||||
|
||||
@ -2,9 +2,9 @@ package com.tenwa.flow.treeview.action;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.amarsoft.app.alarm.CheckItem;
|
||||
import com.amarsoft.app.alarm.ItemGroup;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectQuery;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
@ -13,9 +13,15 @@ public class ProductCheckItemGroup {
|
||||
|
||||
|
||||
public List<CheckItem> checkItemList = new ArrayList<CheckItem>(); //Ä£ÐÍÁбí
|
||||
|
||||
private Map<String,String> flowFixedParam;
|
||||
|
||||
public void addProductCheckByCode(String codeno)throws Exception{
|
||||
public Map<String, String> getFlowFixedParam() {
|
||||
return flowFixedParam;
|
||||
}
|
||||
public void setFlowFixedParam(Map<String, String> flowFixedParam) {
|
||||
this.flowFixedParam = flowFixedParam;
|
||||
}
|
||||
public void addProductCheckByCode(String codeno)throws Exception{
|
||||
String query = "Select \"O.*\" from O where "+
|
||||
"O.Status=:Status and O.scenarioid='»ù´¡×Ó±íУÑé' and O.SUBTYPENO in('"+codeno+"')";
|
||||
query += " order by SortNo asc";
|
||||
@ -63,6 +69,14 @@ public class ProductCheckItemGroup {
|
||||
checkItemList.add(checkItem[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void addProductCheckByCondition( String condition, String modelId ) throws Exception {
|
||||
String[] kv = condition.split( "=" );
|
||||
if ( this.flowFixedParam != null && kv[ 1 ].trim().equals( this.flowFixedParam.get( kv[ 0 ].trim() ) ) ) {
|
||||
this.addProductCheckByModelId( modelId );
|
||||
}
|
||||
}
|
||||
|
||||
public void addProductCheckByModelId(String codeno) throws Exception{
|
||||
String query = "Select \"O.*\" from O where "+
|
||||
"O.Status=:Status and O.scenarioid='»ù´¡×Ó±íУÑé' and O.MODELID in("+codeno+")";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user