Просмотр исходного кода

项目列表管理页面调整(收费金额字段,并统计筛选后的收费金额;增加项目列表 项目类别 筛选)

[user3] 3 лет назад
Родитель
Сommit
162b2f1dc0

+ 6 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectMessageAllDao.java

@@ -102,4 +102,10 @@ public interface RuralProjectMessageAllDao extends CrudDao<RuralProjectRecords>
      * @return
      */
     List<DownloadProjectRecords> getProjectMaterialListByDownload(@Param("projectIdList") List<String> projectIdList);
+
+    /**
+     * 项目列表项目开票总价
+     * @return
+     */
+    String getListMoney(RuralProjectRecords ruralProjectRecords);
 }

+ 10 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java

@@ -253,6 +253,8 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	private Integer recordState; //是否超期归档状态
 	private String completionStatus; //完成状态
 
+	private String money; //收费金额
+
 	private List<String> civilProjectList = Lists.newArrayList();
 	private List<WorkClientAttachment> workAttachments = Lists.newArrayList();
 
@@ -1838,4 +1840,12 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	public void setCompletionStatus(String completionStatus) {
 		this.completionStatus = completionStatus;
 	}
+
+	public String getMoney() {
+		return money;
+	}
+
+	public void setMoney(String money) {
+		this.money = money;
+	}
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageAllService.java

@@ -22,6 +22,7 @@ import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
 import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
 import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
+import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import jersey.repackaged.com.google.common.collect.Lists;
@@ -1055,4 +1056,12 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
         page.setList(recordsList);
         return page;
     }
+    public String getMoneyAll(RuralProjectRecords ruralProjectRecords){
+        ruralProjectRecords.setPage(new Page<RuralProjectRecords>());
+        String getSumMoney = dao.getListMoney(ruralProjectRecords);
+        if(com.jeeplus.common.utils.StringUtils.isBlank(getSumMoney)){
+            getSumMoney = "0";
+        }
+        return getSumMoney;
+    }
 }

+ 20 - 2
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageAllController.java

@@ -117,8 +117,17 @@ public class RuralProjectMessageAllController extends BaseController {
         }
         //添加查询类型(工程咨询)
         List<String> typeList = Lists.newArrayList();
-        typeList.add("1");
-        typeList.add("2");
+        String oldProjectSort = null;
+        if (StringUtils.isBlank(projectRecords.getAttachmentProjectSort())){
+            typeList.add("1");
+            typeList.add("2");
+        }else {
+            oldProjectSort=projectRecords.getAttachmentProjectSort();
+            String attachmentProjectSort=projectRecords.getAttachmentProjectSort();
+            typeList.add(attachmentProjectSort.split("-")[0]);
+            projectRecords.setAttachmentProjectSort(attachmentProjectSort.split("-")[1]);
+        }
+
         //查询总审人员信息
         List<User> auditUserList = userService.getAuditUserList();
         model.addAttribute("userList", auditUserList);
@@ -150,9 +159,18 @@ public class RuralProjectMessageAllController extends BaseController {
         if(StringUtils.isNotBlank(oldSubmitMoney)){
             projectRecords.setSubmitMoney(oldSubmitMoney);
         }
+        //查询工程类型
+        if (projectRecords.getEngineeringType()!=null){
+            ProjectEngineeringInfo engineeringInfo=engineeringService.get(projectRecords.getEngineeringType());
+            model.addAttribute("engineeringInfo", engineeringInfo);
+        }
         model.addAttribute("beginDate", projectRecords.getBeginDate());
         model.addAttribute("endDate", projectRecords.getEndDate());
+        model.addAttribute("moneyAll", ruralProjectMessageAllService.getMoneyAll(projectRecords));
         model.addAttribute("reportSwitch", BaseController.REPORTSWITCH);
+        if (StringUtils.isNotBlank(oldProjectSort)){
+            model.addAttribute("oldProjectSort", oldProjectSort);
+        }
         return "modules/ruralprojectrecords/ruralporjectmessage/all/ruralProjectMessageAllList";
     }
 

+ 232 - 1
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml

@@ -260,6 +260,7 @@ END) as projectScale*/
 		,ifnull(prd.verify_rate ,"") as "verifyRate"
 		,prd.audit_pass_date as "reportAuditDate"
 		,prdt.audit_pass_date as "reportTwoAuditDate"
+		,SUM(wi.money) as "money"
 		FROM rural_project_records a
 		LEFT JOIN sys_area area ON area.id = a.area_id
 		left join rural_project_records_reported rprr on rprr.id = a.id
@@ -282,6 +283,8 @@ END) as projectScale*/
 		LEFT JOIN project_material_defect_record pmdr on prd.id = pmdr.report_id
 		left join rural_project_report_record_down prrd on prrd.report_id = prd.id
 		left join project_paper_filing ppf on ppf.project_id = a.id
+		LEFT JOIN work_invoice_project_relation wip ON wip.project_id = a.id
+		LEFT JOIN work_invoice wi ON wi.id = wip.invoice_id
 		<where>
 			a.status = 5
 			<if test="bzshbUserId!=null and bzshbUserId!=''">
@@ -397,7 +400,12 @@ END) as projectScale*/
 				</choose>
 			</if>
 
-
+			<if test="engineeringType !=null and engineeringType !=''">
+				and a.engineering_type= #{engineeringType}
+			</if>
+			<if test="attachmentProjectSort !=null and attachmentProjectSort !=''">
+				and a.attachment_project_sort= #{attachmentProjectSort}
+			</if>
 			<if test="projectReportStatus != null and projectReportStatus != ''">
 				AND prd.status = #{projectReportStatus}
 			</if>
@@ -453,6 +461,8 @@ END) as projectScale*/
 				AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id})${sqlMap.dsf} )
 			</if>
 		</where>
+		GROUP BY
+		a.project_id
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -579,6 +589,12 @@ END) as projectScale*/
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
 				and prd.number like concat('%',#{reportData.number},'%')
 			</if>
+			<if test="engineeringType !=null and engineeringType !=''">
+				and a.engineering_type= #{engineeringType}
+			</if>
+			<if test="attachmentProjectSort !=null and attachmentProjectSort !=''">
+				and a.attachment_project_sort= #{attachmentProjectSort}
+			</if>
 			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}
 			</if>-->
@@ -1059,4 +1075,219 @@ END) as projectScale*/
 			and pmdr.status = 5
 		</where>
 	</select>
+	<select id="getListMoney" resultType="java.lang.String">
+		SELECT
+		format(sum( wii.money ),2)
+		FROM
+			work_invoice wii
+		WHERE
+				wii.id IN (
+				SELECT DISTINCT
+					wi.id
+				FROM
+					rural_project_records a
+					LEFT JOIN sys_area area ON area.id = a.area_id
+					left join rural_project_records_reported rprr on rprr.id = a.id
+					LEFT JOIN project_flingbatch_relation pfp on pfp.project_id=a.id
+					LEFT JOIN project_filingbatch pfb on pfb.id=pfp.filing_batch
+					LEFT JOIN sys_user sua on a.create_by = sua.id
+					<if test="leaderNameStr !=null and leaderNameStr !=''">
+						LEFT JOIN work_project_user w on a.id = w.project_id
+						LEFT JOIN sys_user su on w.user_id = su.id
+					</if>
+					LEFT JOIN sys_user sub on a.project_master_id = sub.id
+					LEFT JOIN sys_office sob ON sob.id = sub.office_id
+					LEFT JOIN work_project_user w1 on a.id = w1.project_id
+					LEFT JOIN work_contract_info wci on a.contract_id = wci.id
+					LEFT JOIN work_client_info wct on wci.client_id = wct.id
+					LEFT JOIN sys_office o ON o.id = a.office_id
+					left join project_report_data prd on prd.project_id = a.id
+					left join project_report_data_two prdt on prdt.project_id = a.id
+					left join rural_project_report_record prr on prr.report_id = prd.id
+					LEFT JOIN project_material_defect_record pmdr on prd.id = pmdr.report_id
+					left join rural_project_report_record_down prrd on prrd.report_id = prd.id
+					left join project_paper_filing ppf on ppf.project_id = a.id
+						LEFT JOIN work_invoice_project_relation wip ON wip.project_id = a.id
+						LEFT JOIN work_invoice wi ON wi.id = wip.invoice_id
+				WHERE
+					a.STATUS = 5
+				  AND a.project_type IN ( 1, 2 )
+				  AND a.STATUS != 7
+				  AND a.del_flag = 0
+				  AND wip.is_project = 1
+					<if test="bzshbUserId!=null and bzshbUserId!=''">
+						and prd.bzshb_user_id=#{bzshbUserId}
+					</if>
+					<if test="projectId != null and projectId != ''">
+						AND a.project_id like concat('%',#{projectId},'%')
+					</if>
+					<if test="projectName != null and projectName != ''">
+						AND a.project_name like concat(concat('%',#{projectName}),'%')
+					</if>
+					<if test="scaleType != null and scaleType != ''">
+						AND a.scale_type = #{scaleType}
+					</if>
+					<if test="scaleUnit != null and scaleUnit != ''">
+						AND a.scale_unit = #{scaleUnit}
+					</if>
+					<if test="scaleQuantity != null and scaleQuantity != ''">
+						AND a.scale_quantity = #{scaleQuantity}
+					</if>
+					<if test="projectSite != null and projectSite != ''">
+						AND a.project_site LIKE concat('%',#{projectSite},'%')
+					</if>
+					<if test="remarks != null and remarks != ''">
+						AND a.remarks LIKE concat('%',#{remarks},'%')
+					</if>
+					<if test="projectDesc != null and projectDesc != ''">
+						AND a.project_desc LIKE concat('%',#{projectDesc},'%')
+					</if>
+					<if test="area != null and area.id != null and area.id != ''">
+						AND a.area_id = #{area.id}
+					</if>
+					<if test="workContractInfo !=null and workContractInfo.name !=null and workContractInfo.name !=''">
+						AND wci.name like concat(concat('%',#{workContractInfo.name}),'%')
+					</if>
+					<if test="workContractInfo !=null and workContractInfo.contractNum !=null and workContractInfo.contractNum !=''">
+						AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
+					</if>
+					<if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
+						AND wci.contract_price = #{workContractInfo.contractPrice}
+					</if>
+					<if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
+						AND wci.contract_type = #{workContractInfo.contractType}
+					</if>
+					<if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
+						AND wct.name like concat(concat('%',#{workContractInfo.client.name}),'%')
+					</if>
+					<!--<if test="leaderNameStr !=null and leaderNameStr !=''">
+						AND su.name like concat(concat('%',#{leaderNameStr}),'%') AND w.is_master = '1' AND w.del_flag='0'
+					</if>-->
+					<if test="(leaderNameStr != null and leaderNameStr != '') or (leaderId != null and leaderId != '')">
+						AND ((w.user_id = #{leaderId}) or su.name like concat('%',#{leaderNameStr},'%')) AND w.is_master = '1' AND w.del_flag='0'
+					</if>
+					<if test="projectStatus !=null">
+						AND a.status = #{projectStatus}
+					</if>
+					<if test="beginDate !=null">
+						AND a.create_date >= #{beginDate}
+					</if>
+					<if test="endDate !=null">
+						AND a.create_date &lt; #{endDate}
+					</if>
+					<if test="emergencyProject !=null and emergencyProject != ''">
+						<choose>
+							<when test="emergencyProject == 0">
+								AND (a.emergency_project = #{emergencyProject} or a.emergency_project is null)
+							</when>
+							<otherwise>
+								AND a.emergency_project = #{emergencyProject}
+							</otherwise>
+						</choose>
+					</if>
+					<!--<if test="createBy != null and createBy.id !=null and createBy.id !=''">
+						AND a.create_by = #{createBy.id}
+					 </if>-->
+					<if test="createBy != null and((createBy.id != null and createBy.id != '') or (createBy.name != null and createBy.name != ''))">
+						AND (a.create_by = #{createBy.id} or sua.name like concat('%',#{createBy.name},'%'))
+					</if>
+					<choose>
+						<when test="downProjectReportRecordStatus == 0">
+							AND( pfp.status is null or ppf.status is null )
+						</when>
+						<otherwise>
+							<if test="downProjectReportRecordStatus!=null and downProjectReportRecordStatus !=''">
+								AND (pfp.status = #{downProjectReportRecordStatus} or ppf.status = #{downProjectReportRecordStatus})
+							</if>
+						</otherwise>
+					</choose>
+					<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
+						and prd.number like concat('%',#{reportData.number},'%')
+					</if>
+					<!--<if test="office!=null and office.id!=null and office.id!=''">
+						and  a.office_id = #{office.id}
+					</if>-->
+					<if test="office!=null and office.id=='' and office.name!=null and office.name!='' ">
+						and  o.name like concat('%',#{office.name},'%')
+					</if>
+					<if test="officeIdList!=null and officeIdList.size!=0">
+						and a.office_id in
+						<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+							#{officeId}
+						</foreach>
+					</if>
+
+					<if test="reportedState !=null and reportedState !=''">
+						<choose>
+							<when test="reportedState == 0">
+								AND a.reported_state is null
+							</when>
+							<otherwise>
+								AND a.reported_state = #{reportedState}
+							</otherwise>
+						</choose>
+					</if>
+					<if test="engineeringType !=null and engineeringType !=''">
+						and a.engineering_type= #{engineeringType}
+					</if>
+					<if test="attachmentProjectSort !=null and attachmentProjectSort !=''">
+						and a.attachment_project_sort= #{attachmentProjectSort}
+					</if>
+
+					<if test="projectReportStatus != null and projectReportStatus != ''">
+						AND prd.status = #{projectReportStatus}
+					</if>
+					<if test="submitMoney != null and submitMoney != ''">
+						AND a.submit_money = #{submitMoney}
+					</if>
+					<choose>
+						<when test="projectReportRecordStatus != null and projectReportRecordStatus != '' and projectReportRecordStatus != 0">
+							<choose>
+								<when test="projectReportRecordStatus == 6 or projectReportRecordStatus == 7">
+									<choose>
+										<when test="projectReportRecordStatus == 6">
+											AND a.record_state= #{projectReportRecordStatus} and prr.status is null
+										</when>
+										<otherwise>
+											AND prr.status = #{projectReportRecordStatus}
+										</otherwise>
+									</choose>
+								</when>
+								<otherwise>
+									AND prr.status = #{projectReportRecordStatus}
+								</otherwise>
+							</choose>
+						</when>
+						<otherwise>
+							<choose>
+								<when test="projectReportRecordStatus == 0">
+									AND prr.status is null
+								</when>
+							</choose>
+						</otherwise>
+					</choose>
+
+					<if test="typeList !=null and typeList !=''">
+						and a.project_type in
+						<foreach collection="typeList" item="id" index="index" open="(" close=")" separator=",">
+							#{id}
+						</foreach>
+					</if>
+					<choose>
+						<when test="projectReportStatusTwo == 0">
+							AND prdt.status is null
+						</when>
+						<otherwise>
+							<if test="projectReportStatusTwo!=null and projectReportStatusTwo !=''">
+								AND prdt.status = #{projectReportStatusTwo}
+							</if>
+						</otherwise>
+					</choose>
+					<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+						AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id})${sqlMap.dsf} )
+					</if>
+				ORDER BY
+					a.update_date DESC
+			)
+	</select>
 </mapper>

+ 1 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsForm.jsp

@@ -1106,7 +1106,7 @@
                     <div class="layui-input-block readOnlyFFF">
                         <form:select placeholder="请选择" path="attachmentProjectSort" class="form-control judgment editable-select layui-input" id="attachmentProjectSort" value="${attachmentProjectSort}">
                             <form:option value=""/>
-                            <form:options items="${fns:getMainDictList('attachment_project_sort_cost')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                            <form:options items="${fns:getMainDictList('attachment_project_sort_cost')}" itemLabel="value" itemValue="value" htmlEscape="false"/>
                         </form:select>
                         <span class="spanzj">与归档资料关联,请仔细选择</span>
                     </div>

+ 56 - 2
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/all/ruralProjectMessageAllList.jsp

@@ -4,6 +4,8 @@
 <head>
 	<title>项目列表</title>
 	<meta name="decorator" content="default"/>
+	<script type="text/javascript" src="${ctxStatic}/layui/layuidown.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/layuidown.css"/>
 	<script type="text/javascript">
 		$(document).ready(function() {
 
@@ -42,6 +44,28 @@
 					});
 				})
 			})
+			layui.use(['dropdown', 'util', 'layer'], function () {
+				var form = layui.form;
+				$.ajax({
+					type : "POST",
+					url : "${ctx}/ruralProject/ruralProjectRecords/engineeringTreeMenu",
+					//请求成功
+					success : function(result) {
+						var str=jQuery.parseJSON(result);
+						//工程类型树形菜单
+						layui.dropdown.render({
+							elem: '#demo100'
+							,style: 'width: 320px;'
+							,data:str
+							,click: function(item){
+								$("#demo100").val(item.title)
+								$("#demo101").val(item.id)
+							}
+						});
+					}
+				});
+			})
+
 		});
 
 		function reset() {
@@ -639,6 +663,33 @@
 												cssStyle="background-color:#fff" title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="false" allowInput="true" />
 							</div>
 						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">工程类别:</label>
+							<div class="layui-input-block">
+								<input id="demo100" value="${engineeringInfo.engineeringName}" readonly="true" style="background-color: #fff" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+								<form:input id="demo101" path="engineeringType" readonly="true" cssStyle="background-color: #fff;display: none"  htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">项目类别:</label>
+							<div class="layui-input-block readOnlyFFF">
+								<select name="attachmentProjectSort">
+									<option value="">请选择问题</option>
+									<optgroup label="造价审核">
+										<c:forEach items="${fns:getMainDictList('attachment_project_sort_cost')}" var="cost">
+											<c:set var="costvar" value="2-${cost.value}"/>
+											<option value="2-${cost.value}" <c:if test="${oldProjectSort == costvar}"> selected</c:if> >${cost.label}</option>
+										</c:forEach>
+									</optgroup>
+									<optgroup label="工程咨询">
+										<c:forEach items="${fns:getMainDictList('attachment_project_sort')}" var="cost">
+											<c:set var="costvar" value="1-${cost.value}"/>
+											<option value="1-${cost.value}" <c:if test="${oldProjectSort == costvar}"> selected</c:if> >${cost.label}</option>
+										</c:forEach>
+									</optgroup>
+								</select>
+							</div>
+						</div>
 						<div class="layui-item query athird ">
 							<label class="layui-form-label">合同名称:</label>
 							<div class="layui-input-block">
@@ -754,6 +805,9 @@
 							<a href="javascript:void(0)" style='background-color: #FFB800' onclick="downloadDialogre('上报信息导出', '${ctx}/ruralProject/ruralProjectMessageAll/skipDownloadReportedForm','40%', '70%','','下载,关闭')" class="layui-btn layui-btn-sm layui-bg-blue" > 上报信息导出</a>
 						</shiro:hasPermission>
 						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+						<div class=" layui-btn-sm" style="float: right;width: 300px">
+							<span style="color: red">金额汇总(收费金额):${moneyAll}(元)</span>
+						</div>
 					</div>
 					<shiro:hasPermission name="ruralProject:ruralCostProjectMessage:reportSwitch">
 						<div style="float: right;margin-right: 30px;">
@@ -772,8 +826,6 @@
 	</div>
 	<div id="changewidth"></div>
 </div>
-
-<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
 <script>
 
     layui.use('table', function(){
@@ -821,6 +873,7 @@
 				,{field: 'client', align:'center', title: '委托方',width:200,templet: function(d){
 						return "<font style = 'font-size:14px;font-weight:500;'>"+d.client+"</font>";
 					}}
+                ,{field:'money',align:'center', title: '收费金额',  width:80}
                 ,{field:'createName',align:'center', title: '登记人',  width:80}
                 ,{field: 'createDate', align:'center', title: '创建日期/打包时间',width:100,templet: function(d){
 					var date=d.createDate;
@@ -994,6 +1047,7 @@
 					,"ppfId":"${projectRecords.ppfId}"
 					,"ppfProcessInstanceId":"${projectRecords.ppfProcessInstanceId}"
 					,"submitMoney":"${projectRecords.submitMoney}"
+					,"money":"${projectRecords.money}"
 					,"falg":
 					<c:choose>
 						<c:when test="${fns:getUser().id == projectRecords.leaderIds || fns:getUser().id eq projectRecords.createBy.id}">