Procházet zdrojové kódy

项目附件类型设置功能变更

user5 před 4 roky
rodič
revize
6fea00d36a

+ 7 - 3
src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryRelationController.java

@@ -59,6 +59,8 @@ public class ProjectAccessoryRelationController extends BaseController {
 	@RequestMapping(value = {"list", ""})
 	public String list(ProjectAccessoryRelationInfo projectAccessoryRelationInfo,Model model) {
 		model.addAttribute("projectAccessoryRelationInfo",projectAccessoryRelationInfo);
+		model.addAttribute("attachmentProjectType",projectAccessoryRelationInfo.getAttachmentProjectType());
+		model.addAttribute("attachmentProjectSortStr",projectAccessoryRelationInfo.getAttachmentProjectSort());
 		return "modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationList";
 	}
 
@@ -71,11 +73,13 @@ public class ProjectAccessoryRelationController extends BaseController {
 			map.put("data",new ArrayList<ProjectAccessoryRelationInfo>());
 			return map;
 		}
+		//判断项目类别是否未空值
 		if(StringUtils.isNotBlank(projectAccessoryRelationInfo.getAttachmentProjectSort())){
-			Integer decide = projectAccessoryRelationService.decideAttachmentProjectSort(projectAccessoryRelationInfo.getAttachmentProjectSort());
-			if(1 == decide || StringUtils.isNotBlank(projectAccessoryRelationInfo.getAttachmentProjectApprovalMoney())){
+			//判断项目类别是否为打包项目判定
+			//Integer decide = projectAccessoryRelationService.decideAttachmentProjectSort(projectAccessoryRelationInfo.getAttachmentProjectSort());
+			//if(1 == decide || StringUtils.isNotBlank(projectAccessoryRelationInfo.getAttachmentProjectApprovalMoney())){
 				return projectAccessoryRelationService.findListTree(projectAccessoryRelationInfo);
-			}
+			//}
 		}
 		map.put("data",new ArrayList<ProjectAccessoryRelationInfo>());
 		return map;

+ 11 - 8
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageController.java

@@ -171,32 +171,35 @@ public class RuralCostProjectMessageController extends BaseController {
 
         //根据条件查询附件必填项
         //判断项目类别是否为打包项目(1:打包项目,0:非打包项目)
-        Integer projectSort = projectAccessoryRelationService.decideAttachmentProjectSort(records.getAttachmentProjectSort());
+        /*Integer projectSort = projectAccessoryRelationService.decideAttachmentProjectSort(records.getAttachmentProjectSort());
 
         Boolean flag = false;
         //如果是打包项目或者报告送审价不为null则可进行查询附件类型
         if(1 == projectSort || null != projectcontentinfo.getProjectReportData().getReviewFee()){
             flag = true;
         }
-        if(flag) {
+        if(flag) {*/
             ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
             //添加项目类型
             relateInfo.setAttachmentProjectType(records.getProjectType());
             relateInfo.setAttachmentProjectSort(records.getAttachmentProjectSort());
             //判断是否为打包项目,打包项目无需查看项目送审金额是否为500w以上判定
-            if(0 == projectSort){
+            /*if(0 == projectSort){*/
                 //查看送审金额是否为500w以上金额
                 Integer approvalMoney = projectAccessoryRelationService.decideAttachmentProjectApprovalMoney(projectcontentinfo.getProjectReportData().getReviewFee());
-                if(1 == approvalMoney){
+                if(0 == approvalMoney){
+                    //金额为0
+                    relateInfo.setAttachmentProjectApprovalMoney(null);
+                }else if(1 == approvalMoney){
                     //500w以下金额状态
                     relateInfo.setAttachmentProjectApprovalMoney("1");
                 }else{
                     //500w以上金额状态
                     relateInfo.setAttachmentProjectApprovalMoney("2");
                 }
-            }else{
+            /*}else{
                 relateInfo.setAttachmentProjectApprovalMoney(null);
-            }
+            }*/
 
             //添加报告类型
             relateInfo.setRequiredStage(1);
@@ -218,10 +221,10 @@ public class RuralCostProjectMessageController extends BaseController {
                 }
 
             }
-        }
+        /*}*/
 
         model.addAttribute("projectcontentinfo", projectcontentinfo);
-        model.addAttribute("projectSort", projectSort);
+        /*model.addAttribute("projectSort", projectSort);*/
         if (projectReportData != null && projectReportData.getCreateBy() != null && StringUtils.isNotBlank(projectReportData.getCreateBy().getId()) && projectReportData.getCreateBy().getId().equals(UserUtils.getUser().getId())) {
             return "modules/ruralprojectrecords/cost/projectcontentinfo/reportForm";
         } else if (projectReportData == null || StringUtils.isBlank(projectReportData.getId())) {

+ 12 - 9
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java

@@ -184,32 +184,35 @@ public class RuralProjectMessageController extends BaseController {
 
         //根据条件查询附件必填项
         //判断项目类别是否为打包项目(1:打包项目,0:非打包项目)
-        Integer projectSort = projectAccessoryRelationService.decideAttachmentProjectSort(records.getAttachmentProjectSort());
+        //Integer projectSort = projectAccessoryRelationService.decideAttachmentProjectSort(records.getAttachmentProjectSort());
 
-        Boolean flag = false;
+        /*Boolean flag = false;
         //如果是打包项目或者报告送审价不为null则可进行查询附件类型
         if(1 == projectSort || null != projectcontentinfo.getProjectReportData().getReviewFee()){
             flag = true;
         }
-        if(flag) {
+        if(flag) {*/
             ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
             //添加项目类型
             relateInfo.setAttachmentProjectType(records.getProjectType());
             relateInfo.setAttachmentProjectSort(records.getAttachmentProjectSort());
             //判断是否为打包项目,打包项目无需查看项目送审金额是否为500w以上判定
-            if(0 == projectSort){
+            /*if(0 == projectSort){*/
                 //查看送审金额是否为500w以上金额
                 Integer approvalMoney = projectAccessoryRelationService.decideAttachmentProjectApprovalMoney(projectcontentinfo.getProjectReportData().getReviewFee());
-                if(1 == approvalMoney){
+                if(0 == approvalMoney){
+                    //金额为0
+                    relateInfo.setAttachmentProjectApprovalMoney(null);
+                }else if(1 == approvalMoney){
                     //500w以下金额状态
                     relateInfo.setAttachmentProjectApprovalMoney("1");
                 }else{
                     //500w以上金额状态
                     relateInfo.setAttachmentProjectApprovalMoney("2");
                 }
-            }else{
+            /*}else{
                 relateInfo.setAttachmentProjectApprovalMoney(null);
-            }
+            }*/
 
             //添加报告类型
             relateInfo.setRequiredStage(1);
@@ -231,10 +234,10 @@ public class RuralProjectMessageController extends BaseController {
                 }
 
             }
-        }
+        /*}*/
 
         model.addAttribute("projectcontentinfo", projectcontentinfo);
-        model.addAttribute("projectSort", projectSort);
+        /*model.addAttribute("projectSort", projectSort);*/
         if (projectReportData != null && projectReportData.getCreateBy() != null && StringUtils.isNotBlank(projectReportData.getCreateBy().getId()) && projectReportData.getCreateBy().getId().equals(UserUtils.getUser().getId())) {
             return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportForm";
         } else if (projectReportData == null || StringUtils.isBlank(projectReportData.getId())) {

+ 8 - 3
src/main/resources/mappings/modules/projectAccessory/ProjectAccessoryRelationDao.xml

@@ -44,9 +44,14 @@
 			<if test="attachmentProjectSort!=null and attachmentProjectSort != ''">
 				and a.attachment_project_sort = #{attachmentProjectSort}
 			</if>
-			<if test="attachmentProjectApprovalMoney!=null and attachmentProjectApprovalMoney != ''">
-				and a.attachment_project_approval_money = #{attachmentProjectApprovalMoney}
-			</if>
+			<choose>
+				<when test="attachmentProjectApprovalMoney!=null and attachmentProjectApprovalMoney!=''">
+					and a.attachment_project_approval_money = #{attachmentProjectApprovalMoney}
+				</when>
+				<otherwise>
+					and a.attachment_project_approval_money is null
+				</otherwise>
+			</choose>
 		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">

+ 8 - 3
src/main/resources/mappings/modules/projectAccessory/ProjectTemplateDao.xml

@@ -282,9 +282,14 @@
 			<if test="attachmentProjectSort != null and attachmentProjectSort!=''">
 				and b.attachment_project_sort = #{attachmentProjectSort}
 			</if>
-			<if test="attachmentProjectApprovalMoney != null and attachmentProjectApprovalMoney!=''">
-				and b.attachment_project_approval_money = #{attachmentProjectApprovalMoney}
-			</if>
+			<choose>
+				<when test="attachmentProjectApprovalMoney!=null and attachmentProjectApprovalMoney!=''">
+					and b.attachment_project_approval_money = #{attachmentProjectApprovalMoney}
+				</when>
+				<otherwise>
+					and b.attachment_project_approval_money is null
+				</otherwise>
+			</choose>
 		</where>
 
 		<choose>

+ 55 - 32
src/main/webapp/webpage/modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationList.jsp

@@ -43,8 +43,32 @@
 , trigger: 'click'
 			});
 
+			var attachmentProjectType = $("#attachmentProjectType").val();
+			var attachmentProjectSort = $("#attachmentProjectSortStr").val();
+			if(undefined != attachmentProjectType && null != attachmentProjectType && "" != attachmentProjectType){
 
-			var attachmentProjectSort = $("#attachmentProjectSort").val()
+				$.ajax({
+					type:"post",
+					url:'${ctx}/projectAccessoryRelation/projectAccessoryRelation/getMessage',
+					data:{"type":attachmentProjectType},
+					dataType:"json",
+					async: false,
+					success:function(data){
+						if(data.success) {
+							for (var info in data.data){
+								if(data.data[info].value == attachmentProjectSort){
+									$('#attachmentProjectSort').append(new Option(data.data[info].label,data.data[info].value,true,true));
+								}else{
+									$('#attachmentProjectSort').append(new Option(data.data[info].label,data.data[info].value));
+								}
+							}
+						}
+					}
+				})
+				layui.form.render("select");
+			}
+
+			/*var attachmentProjectSort = $("#attachmentProjectSort").val()
 			if(undefined != attachmentProjectSort && null != attachmentProjectSort && "" != attachmentProjectSort){
 				$.ajax({
 					type:"post",
@@ -68,7 +92,7 @@
 			}else{
 				document.getElementById("attachmentProjectApprovalMoney").disabled=false;
 				document.getElementById("attachmentProjectApprovalMoney").style="background-color:#FFFFFF"
-			}
+			}*/
 		});
 
 		function reset() {
@@ -175,7 +199,7 @@
 		/**
 		 * 项目类别变更进行处理
 		 */
-		function projectSortChange() {
+		/*function projectSortChange() {
 			var attachmentProjectType = $("#attachmentProjectType").val()
 			var attachmentProjectSort = $("#attachmentProjectSort").val()
 			var attachmentProjectApprovalMoney = $("#attachmentProjectApprovalMoney").val()
@@ -211,7 +235,7 @@
 				document.getElementById("attachmentProjectApprovalMoney").disabled=false;
 				document.getElementById("attachmentProjectApprovalMoney").style="background-color:#FFFFFF"
 			}
-		}
+		}*/
 	</script>
 	<style>
 		body{
@@ -229,27 +253,28 @@
 	<div class="layui-row">
 		<div class="full-width fl">
 			<div class="layui-row contentShadow shadowLR" id="queryDiv">
-				<form:form id="searchForm" modelAttribute="projectAccessoryRelationInfo" action="${ctx}/projectAccessoryRelation/projectAccessoryRelation/list" method="post" class="form-inline">
-				<%--<form:form id="searchForm" modelAttribute="projectAccessoryRelationInfo" action="${ctx}/projectAccessoryRelation/projectAccessoryRelation/list" method="post" class="form-horizontal layui-form">--%>
+				<%--<form:form id="searchForm" modelAttribute="projectAccessoryRelationInfo" action="${ctx}/projectAccessoryRelation/projectAccessoryRelation/list" method="post" class="form-inline">--%>
+				<form:form id="searchForm" modelAttribute="projectAccessoryRelationInfo" action="${ctx}/projectAccessoryRelation/projectAccessoryRelation/list" method="post" class="form-horizontal layui-form">
 					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
 					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+					<input id="attachmentProjectSortStr" name="attachmentProjectSortStr" type="hidden" value="${attachmentProjectSortStr}"/>
 					<div class="commonQuery lw6">
-						<div class="layui-item query athird ">
+						<%--<div class="layui-item query athird ">
 							<label class="layui-form-label">项目类型:</label>
 							<div class="layui-input-block">
-								<form:select path="attachmentProjectType" class=" form-control  simple-select" onchange="projectSortChange()">
+								<form:select path="attachmentProjectType" class=" form-control  simple-select">
 									<form:option value="" label=""/>
 									<form:options items="${fns:getMainDictList('attachment_project_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
 								</form:select>
 							</div>
-						</div>
-						<%--<div class="layui-item query athird ">
+						</div>--%>
+						<div class="layui-item query athird ">
 							<label class="layui-form-label">项目类型:</label>
 							<div class="layui-input-block">
 								<select name="attachmentProjectType" id="attachmentProjectType" lay-filter="typeFilter">
 									<option value=""></option>
-									<option value="1" >工程咨询</option>
-									<option value="2" >造价审核</option>
+									<option value="1" <c:if test="${attachmentProjectType=='1'}">selected</c:if>>工程咨询</option>
+									<option value="2" <c:if test="${attachmentProjectType=='2'}">selected</c:if>>造价审核</option>
 								</select>
 							</div>
 						</div>
@@ -258,38 +283,31 @@
 							<div class="layui-input-block">
 								<select id="attachmentProjectSort" name="attachmentProjectSort" value="" lay-filter="sortFilter"></select>
 							</div>
-						</div>--%>
+						</div>
 
-						<div class="layui-item query athird ">
+						<%--<div class="layui-item query athird ">
 							<label class="layui-form-label">项目类别:</label>
 							<div class="layui-input-block">
-								<form:select path="attachmentProjectSort" class=" form-control  simple-select" onchange="projectSortChange()">
+								<form:select path="attachmentProjectSort" class=" form-control  simple-select">
 									<form:option value="" label=""/>
-									<form:options id="sort" cssStyle="display: none" items="${fns:getMainDictList('attachment_project_sort')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
-									<form:options id="sortCost" cssStyle="display: none" items="${fns:getMainDictList('attachment_project_sort_cost')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+									<form:options items="${fns:getMainDictList('attachment_project_sort')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
 								</form:select>
 							</div>
-						</div>
-						<%--<div class="layui-item query athird ">
-							<label class="layui-form-label">送审金额:</label>
-							<div class="layui-input-block">
-								<select id="attachmentProjectApprovalMoney" name="attachmentProjectApprovalMoney" value="" lay-filter="moneyFilter"></select>
-							</div>
 						</div>--%>
-						<%--<div class="layui-item athird">
+						<div class="layui-item athird">
 							<div class="input-group">
 								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
 								<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
 								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
 							</div>
-						</div>--%>
+						</div>
 						<div style="    clear:both;"></div>
 					</div>
-					<div id="moresees" style="clear:both;/*display:none;*/" class="lw6">
+					<div id="moresees" style="clear:both;display:none;" class="lw6">
 						<div class="layui-item query athird ">
 							<label class="layui-form-label">送审金额:</label>
 							<div class="layui-input-block">
-								<form:select path="attachmentProjectApprovalMoney" class=" form-control  simple-select" onchange="projectSortChange()">
+								<form:select path="attachmentProjectApprovalMoney" class=" form-control  simple-select">
 									<form:option value="" label=""/>
 									<form:options items="${fns:getMainDictList('attachment_project_approval_money')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
 								</form:select>
@@ -457,15 +475,15 @@
 				}
 			}
 		});
-/*
+
 		layui.form.on('select(typeFilter)',function(data) {
 			if (data.value == "") {
 				$('#attachmentProjectSort').html('<option value=""></option>');
-				$('#attachmentProjectApprovalMoney').html('<option value=""></option>')
+				/*$('#attachmentProjectApprovalMoney').html('<option value=""></option>')*/
 				layui.form.render("select");
 			} else {
 				$('#attachmentProjectSort').html('<option value=""></option>')
-				$('#attachmentProjectApprovalMoney').html('<option value=""></option>')
+				/*$('#attachmentProjectApprovalMoney').html('<option value=""></option>')*/
 				$.ajax({
 					type:"post",
 					url:'${ctx}/projectAccessoryRelation/projectAccessoryRelation/getMessage',
@@ -475,7 +493,12 @@
 					success:function(data){
 						if(data.success) {
 							for (var info in data.data){
-								$('#attachmentProjectSort').append(new Option(data.data[info].label,data.data[info].value));
+								if(info == 0){
+									$('#attachmentProjectSort').append(new Option(data.data[info].label,data.data[info].value,true,true));
+								}else{
+									$('#attachmentProjectSort').append(new Option(data.data[info].label,data.data[info].value));
+								}
+
 							}
 						}
 					}
@@ -484,7 +507,7 @@
 			}
 		});
 
-		layui.form.on('select(sortFilter)',function(data) {
+		/*layui.form.on('select(sortFilter)',function(data) {
 			if (data.value == "") {
 				$('#attachmentProjectApprovalMoney').html('<option value=""></option>');
 				layui.form.render("select");

+ 4 - 4
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportForm.jsp

@@ -343,14 +343,14 @@
 		}
 
 		function getAttachment() {
-        	var projectSort = $("#projectSort").val();
+        	/*var projectSort = $("#projectSort").val();
         	//0为非打包项目
-        	if(projectSort == 0){
+        	if(projectSort == 0){*/
 				var reviewFee = $("#reviewFee").val();
 				$("#upTable").load(location.href+"&reviewFee="+reviewFee + " #upTable");
 				$("#gistdata_upTable").load(location.href+"&reviewFee="+reviewFee + " #gistdata_upTable");
 				$("#upTable_other").load(location.href+"&reviewFee="+reviewFee + " #upTable_other");
-			}
+			/*}*/
 		}
 
 		function getApprovalFee() {
@@ -467,7 +467,7 @@
 		<form:hidden path="projectReportData.id"/>
 		<form:hidden path="projectReportData.createBy.id"/>
 		<form:hidden path="project.id"/>
-		<input type="hidden" id="projectSort" value="${projectSort}">
+		<%--<input type="hidden" id="projectSort" value="${projectSort}">--%>
 		<sys:message content="${message}"/>
 		<div class="form-group layui-row first lw12">
 			<div class="form-group-label"><h2>基本信息</h2></div>