Prechádzať zdrojové kódy

git-svn-id: https://192.168.57.71/svn/hbghj@41 201dd7a2-ec1b-f84b-8b06-88221118ff88

ld_liufl 9 rokov pred
rodič
commit
113a22f9ac

+ 3 - 3
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/access/Help.mxml

@@ -12,7 +12,7 @@
 			import com.jtgh.yjpt.common.util.Constants;
 			import com.jtgh.yjpt.common.util.Utils;
 			import com.jtgh.yjpt.vo.common.CodeVo;
-			
+			import com.jtgh.yjpt.common.Global;
 			import mx.events.CloseEvent;
 			import mx.events.FlexEvent;
 			import mx.rpc.events.ResultEvent;
@@ -21,13 +21,13 @@
 
 			protected function init(event:FlexEvent):void
 			{
-				Utils.callRemote("configController","findById",function(r:ResultEvent):void{
+				Utils.callRemote("codeController","findHelpBySzd",function(r:ResultEvent):void{
 					var bc:BusinessContext = r.result as BusinessContext;
 					var vo:CodeVo = bc.result as CodeVo;
 					if(vo!=null){
 						helpStr = vo.bz;
 					}
-				},Constants.GGDM_ID_HELP);
+				},Global.user.szd);
 			}
 
 		]]>

+ 2 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/common/Constants.java

@@ -432,6 +432,8 @@ public class Constants {
 	public final static Long GGDM_ID_GLZD_AQGLZD = 10000535l;
 	/** 管理制度-操作规程 */
 	public final static Long GGDM_ID_GLZD_CZGC = 10000536l;
+	/**默认帮助信息*/
+	public final static Long GGDM_ID_HELP=11200013l;
 
 	// **********************************附件所属类型***********************************
 	/** 应急预案附件 */

+ 26 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/common/CodeController.java

@@ -208,4 +208,30 @@ public class CodeController extends BaseController {
 			bc.setResult(list.get(0));
 		return bc;
 	}
+	
+	/**
+	 * 根据所在地获取帮助信息
+	 * @param szd
+	 * @return
+	 */
+	public BusinessContext findHelpBySzd(CodeEntity szd){
+		BusinessContext bc = new BusinessContext();
+		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
+		if(szd!=null){
+			addNotEmptyModel(filterList, "parent.id", szd.getByzd3(),
+					PredicateModel.Operator.EQ);
+		}
+		addNotEmptyModel(filterList, "groupcode", "HELP",
+				PredicateModel.Operator.EQ);
+		Specification<CodeEntity> spec = SpecificationCreater
+				.searchByPredicateModels(filterList);
+		List<CodeEntity> list = new ArrayList<CodeEntity>();
+		list = codeService.findAll(spec);
+		if(list !=null && list.size()>0){
+			bc.setResult(list.get(0));
+		} else{
+			bc.setResult(codeService.findOne(Constants.GGDM_ID_HELP));
+		}
+		return bc;
+	}
 }