Forráskód Böngészése

附件问题

git-svn-id: https://192.168.57.71/svn/hbghj@57 201dd7a2-ec1b-f84b-8b06-88221118ff88
ld_liufl 9 éve
szülő
commit
83438aa921

+ 2 - 0
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/model/aqsszpsc/AqsszpscModel.as

@@ -353,6 +353,8 @@ package com.jtgh.yjpt.model.aqsszpsc
 				var bc:BusinessContext = r.result as BusinessContext;
 				editView.parentView = thisView;
 				editView.vo=bc.getAttribute("record") as AqsszpscVo;
+				editView.filesList = bc.getAttribute("filesList") as  ArrayCollection;
+				editView.fileTypeList = bc.getAttribute("fileTypeList") as ArrayCollection;
 				if(editView.vo.recordStatus==Constants.RECORD_STATE_VALID||editView.vo.recordStatus==Constants.RECORD_STATE_REJECT)
 					Utils.popupWindow("编辑", editView, thisView as DisplayObject, thisView.pager.doQuery, 780, 600);
 				else

+ 8 - 2
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/model/bagl/aqpjjgba/AqpjjgbaModel.as

@@ -350,7 +350,7 @@ package com.jtgh.yjpt.model.bagl.aqpjjgba
 		 */
 		public function doDateSave(event:MouseEvent):void
 		{
-			if(!editView.validParams()||!editView.submitVaildParams()){
+			if(!editView.validParams()){
 				return;
 			}
 			editView.vo.szd=editView.szd.selectedVO as CodeVo;
@@ -408,7 +408,13 @@ package com.jtgh.yjpt.model.bagl.aqpjjgba
 			}
 			editView.mode = Constants.mode_edit;
 			editView.model = this;
-			Utils.popupWindow(resourceManager.getString("common","btn.edit"),editView as DisplayObject,thisView as DisplayObject,thisView.pager.doQuery,700,600);
+			Utils.callRemote("aqpjjgbaController","doEditInit",function(r:ResultEvent):void{
+				var bc:BusinessContext = r.result as BusinessContext;
+				editView.filesList = bc.getAttribute("") as ArrayCollection;
+				editView.fileTypeList = bc.getAttribute("fileTypeList") as ArrayCollection;
+				Utils.popupWindow(resourceManager.getString("common","btn.edit"),editView as DisplayObject,thisView as DisplayObject,thisView.pager.doQuery,700,600);
+			},editView.vo);
+			
 		}
 
 

+ 3 - 0
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/model/zyfzndjy/GkwxhwzyfzblhhzModel.as

@@ -352,6 +352,9 @@ package com.jtgh.yjpt.model.zyfzndjy
 				editView.model.yaList=bc.getAttribute("yaList") as ArrayCollection;
 				editView.model.ssList=bc.getAttribute("wzList") as ArrayCollection;
 				editView.model.fzs = bc.getAttribute("fzList") as ArrayCollection; 
+				//初始化附件和附件类型
+				editView.filesList = bc.getAttribute("filesList") as ArrayCollection;
+				editView.fileTypeList = bc.getAttribute("fileTypeList") as ArrayCollection;
 //				editView.hwpm.text = editView.model.concatWhpm()["hwpmStr"];
 				Utils.popupWindow(resourceManager.getString('common','btn.edit'), editView as DisplayObject, thisView as DisplayObject, thisView.pager.doQuery, 780, 500);
 			},vo)

+ 20 - 12
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/aqsszpsc/AqsszpscEdit.mxml

@@ -9,7 +9,6 @@
 	<fx:Script>
 		<![CDATA[
 			import com.adobe.utils.StringUtil;
-			import com.jtgh.yjpt.vo.common.AccessoryVo;
 			import com.jtgh.yjpt.common.Global;
 			import com.jtgh.yjpt.common.util.Constants;
 			import com.jtgh.yjpt.common.util.Utils;
@@ -19,10 +18,12 @@
 			import com.jtgh.yjpt.view.jsxmaqsc.DataList;
 			import com.jtgh.yjpt.vo.access.JsfxxwhVo;
 			import com.jtgh.yjpt.vo.aqsszpsc.AqsszpscVo;
+			import com.jtgh.yjpt.vo.common.AccessoryVo;
 			import com.jtgh.yjpt.vo.common.CodeVo;
 			import com.jtgh.yjpt.vo.gkgq.GqVo;
 			import com.jtgh.yjpt.vo.jyr.JyrVo;
 			
+			import mx.collections.ArrayCollection;
 			import mx.controls.Alert;
 			import mx.events.FlexEvent;
 			import mx.resources.ResourceManager;
@@ -43,6 +44,10 @@
 			public var canSee:Boolean = false;
 			[Bindable]
 			public var mode:String=Constants.mode_edit;
+			[Bindable]
+			public var filesList:ArrayCollection = new ArrayCollection;
+			[Bindable]
+			public var  fileTypeList:ArrayCollection = new ArrayCollection;
 			
 			protected function creationComplete(event:FlexEvent):void
 			{
@@ -52,7 +57,7 @@
 			
 			//保存数据
 			private function doSave():void{
-				if(!validParams()||!submitVaildParams()){
+				if(!validParams()){
 					return;
 				}
 				dataValue();
@@ -118,21 +123,24 @@
 			
 			/** 附件判断 */
 			public function submitVaildParams():Boolean{
-				if(mode==Constants.mode_add&&(fileListView==null || fileListView.filesList==null )) {
+				if(fileListView!=null && fileListView.filesList==null ) {
 					Alert.show("附件不能为空","提示");
 					return false;
 				}
-				if(fileListView!=null&& fileListView.filesList==null ) {
-					Alert.show("附件不能为空","提示");
-					return false;
+				if(fileListView!=null && fileListView.filesList!=null ){
+					filesList=fileListView.filesList;
+					fileTypeList= fileListView.fileTypeList;
 				}
 				//判断是否已经上传必填附件
-				if(fileListView!=null && fileListView.filesList!=null ) {
-					for(var i:int=0 ;i <fileListView.fileTypeList.length-1 ;i ++){	
-						var type:CodeVo = fileListView.fileTypeList.getItemAt(i) as CodeVo;
+				if(filesList==null ||filesList.length<=0 ) {
+					Alert.show("附件不能为空","提示");
+					return false;
+				} else {
+					for(var i:int=0 ;i <fileTypeList.length-1 ;i ++){	
+						var type:CodeVo = fileTypeList.getItemAt(i) as CodeVo;
 						var flag:Boolean=true;
-						for(var j:int=0 ;j<fileListView.filesList.length;j++){
-							var file:AccessoryVo=fileListView.filesList.getItemAt(j) as AccessoryVo;
+						for(var j:int=0 ;j<filesList.length;j++){
+							var file:AccessoryVo=filesList.getItemAt(j) as AccessoryVo;
 							if(type.id==file.type.id) {
 								flag=false;
 								break;
@@ -143,7 +151,7 @@
 							Alert.show("附件:"+message+"不能为空","提示");
 							return false;
 						}
-					}								
+					}			
 				}
 				return true;
 			}

+ 20 - 13
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/bagl/aqpjjgba/AqpjjgbaEdit.mxml

@@ -41,6 +41,10 @@
 			public var taskModel:TaskModel;
 			[Bindable]
 			public var canSee:Boolean=false;
+			[Bindable]
+			public var filesList:ArrayCollection=new ArrayCollection;
+			[Bindable]
+			public var fileTypeList:ArrayCollection = new ArrayCollection;
 			protected function group1_creationCompleteHandler(event:FlexEvent):void
 			{
 				if(vo.recordStatus==Constants.RECORD_STATE_REJECT){//退回重提时只能提交
@@ -102,28 +106,31 @@
 					return false;
 				} else {
 					vo.aqpjywfw=aqpjywfw.text;
-				}
-				
+				}				
 				return true;
 				
 			}
 			
 			public function submitVaildParams():Boolean{
-				if(mode==Constants.mode_add&&(fileListView==null || fileListView.filesList==null )) {
-					Alert.show("附件不能为空","提示");
-					return false;
-				}
 				if(fileListView!=null&& fileListView.filesList==null ) {
 					Alert.show("附件不能为空","提示");
 					return false;
 				}
 				//判断是否已经上传必填附件
-				if(fileListView!=null && fileListView.filesList!=null ) {
-					for(var i:int=0 ;i <fileListView.fileTypeList.length ;i ++){	
-						var type:CodeVo = fileListView.fileTypeList.getItemAt(i) as CodeVo;
+				if(fileListView!=null && fileListView.filesList!=null ){
+					filesList=fileListView.filesList;
+					fileTypeList= fileListView.fileTypeList;
+				}
+				//判断是否已经上传必填附件
+				if(filesList==null ||filesList.length<=0 ) {
+					Alert.show("附件不能为空","提示");
+					return false;
+				}else {
+					for(var i:int=0 ;i <fileTypeList.length ;i ++){	
+						var type:CodeVo = fileTypeList.getItemAt(i) as CodeVo;
 						var flag:Boolean=true;
-						for(var j:int=0 ;j<fileListView.filesList.length;j++){
-							var file:AccessoryVo=fileListView.filesList.getItemAt(j) as AccessoryVo;
+						for(var j:int=0 ;j<filesList.length;j++){
+							var file:AccessoryVo=filesList.getItemAt(j) as AccessoryVo;
 							if(type.id==file.type.id) {
 								flag=false;
 								break;
@@ -134,8 +141,8 @@
 							Alert.show("附件:"+message.substring(2,message.length)+"不能为空","提示");
 							return false;
 						}
-					}								
-				}		
+					}		
+				}	
 				return true;
 			}
 			protected function jg_valueCommitHandler(event:FlexEvent):void

+ 21 - 13
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/zyfzndjy/GkwxhwzyfzblhhzEdit.mxml

@@ -7,6 +7,7 @@
 		 creationComplete="creationCompleteHandler(event)" xmlns:aqsszxyssc="com.jtgh.yjpt.view.aqsszxyssc.*" >
 	<fx:Script>
 		<![CDATA[
+			import com.jtgh.yjpt.common.BusinessContext;
 			import com.jtgh.yjpt.common.Global;
 			import com.jtgh.yjpt.common.TypeBase;
 			import com.jtgh.yjpt.common.util.Constants;
@@ -29,6 +30,7 @@
 			import mx.controls.Alert;
 			import mx.events.CloseEvent;
 			import mx.events.FlexEvent;
+			import mx.rpc.events.ResultEvent;
 			
 			import spark.components.gridClasses.GridColumn;
 
@@ -57,6 +59,10 @@
 			public var pm:String="";
 			[Bindable]
 			public var flag:Boolean=false;
+			[Bindable]
+			public var filesList:ArrayCollection=new ArrayCollection;
+			[Bindable]
+			public var fileTypeList:ArrayCollection = new ArrayCollection;
 			/**
 			 * 创建完成
 			 */
@@ -86,7 +92,7 @@
 			}
 			
 			private function doSave():void{
-				if(validParams()&&submitValid()){
+				if(validParams()){
 					doCheck();
 					//复制的附证进行数据初始化
 					if(flag) {
@@ -112,21 +118,24 @@
 			}
 			
 			public function submitValid():Boolean{
-				if(mode==Constants.mode_add&&(fileListView==null || fileListView.filesList==null )) {
-					Alert.show("附件不能为空","提示");
-					return false;
-				}
 				if(fileListView!=null&& fileListView.filesList==null ) {
 					Alert.show("附件不能为空","提示");
 					return false;
 				}
+				if(fileListView!=null && fileListView.filesList!=null ){
+					filesList=fileListView.filesList;
+					fileTypeList= fileListView.fileTypeList;
+				}
 				//判断是否已经上传必填附件
-				if(fileListView!=null && fileListView.filesList!=null ) {
-					for(var i:int=0 ;i <fileListView.fileTypeList.length-1 ;i ++){	
-						var type:CodeVo = fileListView.fileTypeList.getItemAt(i) as CodeVo;
+				if(filesList==null ||filesList.length<=0 ) {
+					Alert.show("附件不能为空","提示");
+					return false;
+				}else {
+					for(var i:int=0 ;i <fileTypeList.length-1 ;i ++){	
+						var type:CodeVo = fileTypeList.getItemAt(i) as CodeVo;
 						var flag:Boolean=true;
-						for(var j:int=0 ;j<fileListView.filesList.length;j++){
-							var file:AccessoryVo=fileListView.filesList.getItemAt(j) as AccessoryVo;
+						for(var j:int=0 ;j<filesList.length;j++){
+							var file:AccessoryVo=filesList.getItemAt(j) as AccessoryVo;
 							if(type.id==file.type.id) {
 								flag=false;
 								break;
@@ -138,7 +147,7 @@
 							return false;
 						}
 					}								
-				}
+				}				
 				if(model.zdAndCzgcList==null ||model.zdAndCzgcList.length<=0){
 					Alert.show("安全管理制度和操作规程不能为空","提示");
 					return false;
@@ -154,8 +163,7 @@
 				if(model.yaList==null ||model.yaList.length<=0){
 					Alert.show("事故应急预案不能为空","提示");
 					return false;
-				}
-				
+				}			
 				return true;
 			}
 			

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

@@ -27,7 +27,7 @@ public class Constants {
 	public static final String RECORD_CODE_JSDW = "8";
 	/** 建设单位角色code */
 	public static final Long SZD_ID_PROVINCE = 42l;
-	
+
 	/** 湖北港航局ID */
 	public static final Long GOV_ID_HB = 1l;
 
@@ -315,7 +315,6 @@ public class Constants {
 	public final static String DEPLOY_MODE_CITY = "1";
 	/** 区域类别:省级 */
 	public final static String DEPLOY_MODE_PROVINCE = "0";
-	
 
 	/** 已签收任务 */
 	public final static String TASK_ASSIGN = "1";
@@ -432,8 +431,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;
+	/** 默认帮助信息 */
+	public final static Long GGDM_ID_HELP = 11200013l;
 
 	// **********************************附件所属类型***********************************
 	/** 应急预案附件 */
@@ -549,7 +548,7 @@ public class Constants {
 	public static final Long FJSSLX_AQSSZXYS_CITYSC = 10000963l;
 	/** 流程文件附件类型-建设项目安全审查-市级审查 */
 	public static final Long FJSSLX_JSXMAQSC_CITYSC = 10000964l;
-	
+
 	/** 流程文件附件类型-安全设施设计专篇-专家意见-市级可见 */
 	public static final Long FJSSLX_AQSSZPSC_ZJ_CITY = 10000965l;
 	/** 流程文件附件类型--安全设施设计专篇-专家意见-经营人可见 */
@@ -560,7 +559,7 @@ public class Constants {
 	public static final Long FJSSLX_AQSSZPSC_ZLSC_JYR = 10000969l;
 	/** 流程文件附件类型--安全设施设计专篇-市级审查 */
 	public static final Long FJSSLX_AQSSZPSC_CITYSC = 10000970l;
-	
+
 	/** 作业附证照片 */
 	public static final long FJSSLX_T_YJPT_FZSQ = 10000509l;
 	/** 公告附件类型 */
@@ -631,6 +630,10 @@ public class Constants {
 	public final static String GROUP_CODE_SUPINFOBACK = "SUPINFOBACK";
 	/** 安全评价机构信息公共代码 */
 	public final static String GROUP_CODE_AQPJJGXX = "AQPJJGXX";
+	/** 安全设施篇审查申请附件类型 */
+	public final static String GROUP_CODE_AQSSZPSC = "AQSSZPSC";
+	public final static String GROUP_CODE_AQPJJGFJLX = "AQPJJGFJLX";
+
 	public final static Long GGDM_ID_SUPERVISE = 10000989L;
 	public final static Long GGDM_ID_SUPERVISE_REPLY = 10000987L;
 	public final static Long GGDM_ID_SUPINFOBACK = 10000988L;
@@ -864,16 +867,13 @@ public class Constants {
 	 * 密钥
 	 */
 	public final static String YJPT_GKJ = "yjpt_gkj";
-	
+
 	/**
-	 * 所属区域类型
-	 * 0:省级
-	 * 1:市级
-	 * 2:省市皆可
+	 * 所属区域类型 0:省级 1:市级 2:省市皆可
 	 */
-	public final static Long SSQY_PROVINCE=0l;
-	public final static Long SSQY_CITY=1l;	
-	public final static Long SSQY_ALL=2l;
+	public final static Long SSQY_PROVINCE = 0l;
+	public final static Long SSQY_CITY = 1l;
+	public final static Long SSQY_ALL = 2l;
 
 	// ************************功能模块********************************************
 	/**
@@ -881,16 +881,16 @@ public class Constants {
 	 */
 	public final static String GNMK_JYRJCXX = "1";
 	public final static String GNMK_JYRJCXX_BW = "2";
-	
+
 	/**
 	 * gis地图
 	 */
-	public  static String GIS_URL="http://192.168.57.83:9980/gisServer/main?token=";
-	
+	public static String GIS_URL = "http://192.168.57.83:9980/gisServer/main?token=";
+
 	/**
 	 * 数据服务
 	 */
-	public  static String DATA_URL="http://192.168.57.83:9880/dataServer";
-	
-	public static int ZCYH_YQSJ=7;
+	public static String DATA_URL = "http://192.168.57.83:9880/dataServer";
+
+	public static int ZCYH_YQSJ = 7;
 }

+ 26 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/aqsszpsc/AqsszpscController.java

@@ -43,6 +43,7 @@ import com.jtgh.yjpt.common.SinglePageRequest;
 import com.jtgh.yjpt.common.SpecificationCreater;
 import com.jtgh.yjpt.common.Utils;
 import com.jtgh.yjpt.common.WorkFlowParam;
+import com.jtgh.yjpt.common.servlet.InitServlet;
 import com.jtgh.yjpt.controller.BaseController;
 import com.jtgh.yjpt.entity.BaseEntity;
 import com.jtgh.yjpt.entity.aqsszpsc.AqsszpscEntity;
@@ -51,6 +52,7 @@ import com.jtgh.yjpt.entity.common.AccessoryEntity;
 import com.jtgh.yjpt.entity.common.TaskInfoEntity;
 import com.jtgh.yjpt.entity.gkgq.GqEntity;
 import com.jtgh.yjpt.entity.jyr.JyrEntity;
+import com.jtgh.yjpt.entity.zyfzndjy.GkwxhwzyfzblhhzEntity;
 import com.jtgh.yjpt.service.aqsszpsc.AqsszpscProService;
 import com.jtgh.yjpt.service.aqsszpsc.AqsszpscService;
 import com.jtgh.yjpt.service.common.AccessoryService;
@@ -619,8 +621,31 @@ public class AqsszpscController extends BaseController {
 				&& data.getProvinceTaskList().size() > 0) {
 			data.getProvinceTaskList().get(0);
 		}
-		return createBusinessContext(data);
+		BusinessContext bc = createBusinessContext(data);
+		bc.setAttribute("filesList", findFilesNoValue(id));
+		bc.setAttribute("fileTypeList", InitServlet.groupcodeMap.get(Constants.GROUP_CODE_AQSSZPSC));
+		return bc;
 	}
+	
+	//返回已经存在的附件类型
+		public List<AccessoryEntity> findFilesNoValue(Long id){
+			// 附件查询
+			List<PredicateModel> filterList = new ArrayList<PredicateModel>();
+			addNotEmptyModel(filterList, "recordStatus",
+					BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+			addNotEmptyModel(filterList, "entityId", id,
+					Operator.EQ);
+			addNotEmptyModel(filterList, "entityType",
+					Constants.GGDM_ID_AQSSZPSC, Operator.EQ);
+			Specification<AccessoryEntity> spec = SpecificationCreater
+					.searchByPredicateModels(filterList);
+			List<AccessoryEntity> list = accessoryService.findAll(spec);
+			//只返回附件类型
+			for(AccessoryEntity acc:list){
+				acc.setContent(null);
+			}
+			return list;
+		}
 
 	/**
 	 * 市级提交审批

+ 57 - 18
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/bagl/aqpjjgba/AqpjjgbaController.java

@@ -44,11 +44,13 @@ import com.jtgh.yjpt.common.SinglePageRequest;
 import com.jtgh.yjpt.common.SpecificationCreater;
 import com.jtgh.yjpt.common.Utils;
 import com.jtgh.yjpt.common.WorkFlowParam;
+import com.jtgh.yjpt.common.servlet.InitServlet;
 import com.jtgh.yjpt.controller.BaseController;
 import com.jtgh.yjpt.entity.BaseEntity;
 import com.jtgh.yjpt.entity.auth.UserEntity;
 import com.jtgh.yjpt.entity.bagl.aqpjjgba.AqpjjgbaEntity;
 import com.jtgh.yjpt.entity.bagl.aqpjjgba.AqpjjgryEntity;
+import com.jtgh.yjpt.entity.common.AccessoryEntity;
 import com.jtgh.yjpt.entity.common.TaskInfoEntity;
 import com.jtgh.yjpt.service.bagl.aqpjjgba.AqpjjgbaProService;
 import com.jtgh.yjpt.service.bagl.aqpjjgba.AqpjjgbaService;
@@ -141,7 +143,7 @@ public class AqpjjgbaController extends BaseController {
 					if (data.getProvinceTaskList() != null
 							&& data.getProvinceTaskList().size() > 0) {
 						data.getProvinceTaskList().get(0);
-					}				
+					}
 				}
 				// 市级页面查询
 				else {
@@ -186,7 +188,8 @@ public class AqpjjgbaController extends BaseController {
 		addNotEmptyModel(filterList, "zzzsbm", zzzsbh, Operator.LIKE);
 		addNotEmptyModel(filterList, "jglx", jglx, Operator.EQ);
 		addNotEmptyModel(filterList, "zzyxq", yxqz, Operator.LTE);
-		addNotEmptyModel(filterList, "sfqxzg", Constants.YES, Operator.NEQ);;
+		addNotEmptyModel(filterList, "sfqxzg", Constants.YES, Operator.NEQ);
+		;
 		addNotEmptyModel(filterList, "recordStatus",
 				Logable.RECORD_STATE_DELETE, Operator.NEQ);
 		addRecordCodeFilter(functionId, filterList);
@@ -238,8 +241,9 @@ public class AqpjjgbaController extends BaseController {
 								root.get("addUser").as(UserEntity.class),
 								Utils.getCurrentUser()));
 					}
-					//省局只检索已完成的数据
-					if(Constants.SZD_ID_PROVINCE.equals(Utils.getCurrentUserSzd())){
+					// 省局只检索已完成的数据
+					if (Constants.SZD_ID_PROVINCE.equals(Utils
+							.getCurrentUserSzd())) {
 						list.add(cb.equal(
 								root.get("recordStatus").as(String.class),
 								BaseEntity.RECORD_STATE_COMPLETED));
@@ -449,7 +453,7 @@ public class AqpjjgbaController extends BaseController {
 	 */
 	public BusinessContext submit(AqpjjgbaEntity entity, Long functionId)
 			throws CloneNotSupportedException {
-		if (null == entity.getId()||entity.getId().equals(0l)) {
+		if (null == entity.getId() || entity.getId().equals(0l)) {
 			entity.setAddDate(new Date());
 			entity.setAddUser(Utils.getCurrentUser());
 			entity.setRecordCode(getCurrentRoleCode(functionId));
@@ -480,21 +484,21 @@ public class AqpjjgbaController extends BaseController {
 
 	public BusinessContext audit(String shyj, Date shsj,
 			AqpjjgbaEntity aqpjjgbaEntity, boolean flag) {
-		if(Constants.SZD_ID_PROVINCE.equals(Utils.getCurrentUserSzd())){
-			if(aqpjjgbaProService.getCandidateTaskByUserAndBusKey(Utils
-				.getCurrentUser().getId().toString(), aqpjjgbaEntity.getId()
-				.toString()) != null) {
+		if (Constants.SZD_ID_PROVINCE.equals(Utils.getCurrentUserSzd())) {
+			if (aqpjjgbaProService.getCandidateTaskByUserAndBusKey(Utils
+					.getCurrentUser().getId().toString(), aqpjjgbaEntity
+					.getId().toString()) != null) {
 				aqpjjgbaProService.claim(aqpjjgbaEntity.getId().toString(),
 						Utils.getCurrentUser().getId().toString());
 			}
 			// 省级完成
-		aqpjjgbaProService.doApprove(aqpjjgbaEntity, flag, shyj);
+			aqpjjgbaProService.doApprove(aqpjjgbaEntity, flag, shyj);
 		} else {
 			if (aqpjjgbaService.getCandidateTaskByUserAndBusKey(Utils
-					.getCurrentUser().getId().toString(), aqpjjgbaEntity.getId()
-					.toString()) != null) {
-					aqpjjgbaService.claim(aqpjjgbaEntity.getId().toString(), Utils
-							.getCurrentUser().getId().toString());
+					.getCurrentUser().getId().toString(), aqpjjgbaEntity
+					.getId().toString()) != null) {
+				aqpjjgbaService.claim(aqpjjgbaEntity.getId().toString(), Utils
+						.getCurrentUser().getId().toString());
 			}
 			// 市级审批
 			WorkFlowParam param = new WorkFlowParam();
@@ -508,10 +512,12 @@ public class AqpjjgbaController extends BaseController {
 			List<Task> l = aqpjjgbaService.complete(param, variables);
 			// 审批完成
 			if (null == l || l.size() == 0) {
-				aqpjjgbaEntity= aqpjjgbaService.findOne(aqpjjgbaEntity.getId());
-				aqpjjgbaEntity.setRecordStatus(BaseEntity.RECORD_STATE_COMPLETED);
+				aqpjjgbaEntity = aqpjjgbaService
+						.findOne(aqpjjgbaEntity.getId());
+				aqpjjgbaEntity
+						.setRecordStatus(BaseEntity.RECORD_STATE_COMPLETED);
 				aqpjjgbaEntity.setSsqy(Constants.SSQY_ALL);
-				aqpjjgbaService.save(aqpjjgbaEntity);				
+				aqpjjgbaService.save(aqpjjgbaEntity);
 			}
 		}
 		return null;
@@ -528,7 +534,7 @@ public class AqpjjgbaController extends BaseController {
 			if (!Utils.getCurrentUserSzd().equals(Constants.SZD_ID_PROVINCE)) {
 				aqpjjgbaService.claim(entity.getId().toString(), Utils
 						.getCurrentUser().getId().toString());
-			} else  {
+			} else {
 				aqpjjgbaProService.claim(entity.getId().toString(), Utils
 						.getCurrentUser().getId().toString());
 			}
@@ -537,4 +543,37 @@ public class AqpjjgbaController extends BaseController {
 		}
 		return createBusinessContext("save.success", true);
 	}
+
+	/**
+	 * 编辑初始化
+	 * 
+	 * @param entity
+	 * @return
+	 */
+	public BusinessContext doEidtInit(AqpjjgbaEntity entity) {
+		BusinessContext bc = new BusinessContext();
+		bc.setAttribute("filesList",findFilesNoValue(entity));
+		bc.setAttribute("fileTypeList",
+				InitServlet.groupcodeMap.get(Constants.GROUP_CODE_AQPJJGFJLX));
+		return bc;
+	}
+
+	// 返回已经存在的附件类型
+	public List<AccessoryEntity> findFilesNoValue(AqpjjgbaEntity entity) {
+		// 附件查询
+		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
+		addNotEmptyModel(filterList, "recordStatus",
+				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+		addNotEmptyModel(filterList, "entityId", entity.getId(), Operator.EQ);
+		addNotEmptyModel(filterList, "entityType",
+				Constants.FJSSLX_AQPJJGBA, Operator.EQ);
+		Specification<AccessoryEntity> spec = SpecificationCreater
+				.searchByPredicateModels(filterList);
+		List<AccessoryEntity> list = accessoryService.findAll(spec);
+		// 只返回附件类型
+		for (AccessoryEntity acc : list) {
+			acc.setContent(null);
+		}
+		return list;
+	}
 }

+ 22 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/zyfzndjy/GkwxhwzyfzblhhzController.java

@@ -724,8 +724,30 @@ public class GkwxhwzyfzblhhzController extends BaseController {
 		bc.setAttribute("wzList", findWzList(vo));
 		bc.setAttribute("fzList", gkwxhwzyfzblhhzService.findByFzsq(vo.getId()));
 		bc.setAttribute("zbList", gkfzzbService.queryByFzid(vo));
+		bc.setAttribute("filesList", findFilesNoValue(vo));
+		bc.setAttribute("fileTypeList", InitServlet.groupcodeMap.get(Constants.GROUP_CODE_GKWXHWZYFZBLHHZ));
 		return bc;
 	}
+	
+	//返回已经存在的附件类型
+	public List<AccessoryEntity> findFilesNoValue(GkwxhwzyfzblhhzEntity vo){
+		// 附件查询
+		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
+		addNotEmptyModel(filterList, "recordStatus",
+				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+		addNotEmptyModel(filterList, "entityId", vo.getId(),
+				Operator.EQ);
+		addNotEmptyModel(filterList, "entityType",
+				Constants.GGDM_ID_GKWXHWZYFZBLHHZ, Operator.EQ);
+		Specification<AccessoryEntity> spec = SpecificationCreater
+				.searchByPredicateModels(filterList);
+		List<AccessoryEntity> list = accessoryService.findAll(spec);
+		//只返回附件类型
+		for(AccessoryEntity acc:list){
+			acc.setContent(null);
+		}
+		return list;
+	}
 
 	public BusinessContext doCopy(GkwxhwzyfzblhhzEntity vo,
 			List<AccessoryEntity> fileList) {