Browse Source

批量归档添加项目名称和报告号查询功能

user5 6 months ago
parent
commit
aa0c09870f

+ 10 - 1
src/main/java/com/jeeplus/modules/projectFilingBatch/dao/ProjectFilingBatchDao.java

@@ -37,7 +37,16 @@ public interface ProjectFilingBatchDao extends CrudDao<ProjectFilingBatch> {
      * @param childrenBatch
      * @return
      */
-    List<ProjectFilingbatchRelation> getRelationList(ProjectFilingBatch childrenBatch);
+    List<ProjectFilingbatchRelation> getRelationList(@Param("childrenBatch")ProjectFilingBatch childrenBatch, @Param("projectName")String projectName, @Param("reportNumber")String reportNumber);
+
+
+    /**
+     * 根据批次id查询项目信息
+     * @param projectName
+     * @param reportNumber
+     * @return
+     */
+    List<ProjectFilingbatchRelation> getProjectRelationList(@Param("projectName")String projectName, @Param("reportNumber")String reportNumber);
 
     /**
      * 根据批次id查询项目信息

+ 19 - 0
src/main/java/com/jeeplus/modules/projectFilingBatch/entity/ProjectFilingBatch.java

@@ -49,12 +49,15 @@ public class ProjectFilingBatch extends DataEntity<ProjectFilingBatch> {
     private String createId;     //创建人id
     private Integer notifyFlag; //代办判定条件
     private String notifyId; //代办判定条件
+    private String projectName; //项目名称
     private String reportNumber; //报告号
     private Date auditPassDate; //批量归档审核通过时间
 
     private Date auditBeginDate;    //审核通过开始时间
     private Date auditEndDate;  //审核通过结束时间
 
+    private List<String> filingBatchIdList;
+
     public String getProcessinstanceId() {
         return processinstanceId;
     }
@@ -268,6 +271,14 @@ public class ProjectFilingBatch extends DataEntity<ProjectFilingBatch> {
         this.notifyId = notifyId;
     }
 
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
     public String getReportNumber() {
         return reportNumber;
     }
@@ -299,4 +310,12 @@ public class ProjectFilingBatch extends DataEntity<ProjectFilingBatch> {
     public void setAuditEndDate(Date auditEndDate) {
         this.auditEndDate = auditEndDate;
     }
+
+    public List<String> getFilingBatchIdList() {
+        return filingBatchIdList;
+    }
+
+    public void setFilingBatchIdList(List<String> filingBatchIdList) {
+        this.filingBatchIdList = filingBatchIdList;
+    }
 }

+ 78 - 2
src/main/java/com/jeeplus/modules/projectFilingBatch/service/ProjectFilingBatchService.java

@@ -1,5 +1,6 @@
 package com.jeeplus.modules.projectFilingBatch.service;
 
+import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
@@ -161,7 +162,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
             ProjectFilingBatch childrenBatch = new ProjectFilingBatch();
             childrenBatch.setId(batch.getId());
             //查询对应子项目数据
-            List<ProjectFilingbatchRelation> relationList = dao.getRelationList(childrenBatch);
+            List<ProjectFilingbatchRelation> relationList = dao.getRelationList(childrenBatch,projectFilingBatch.getProjectName(),projectFilingBatch.getReportNumber());
 
             //项目名称不为空则进行所有项目的查询和处理
             for (ProjectFilingbatchRelation relation: relationList) {
@@ -176,6 +177,81 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
     }
 
 
+
+    @Transactional(readOnly = false)
+    public Map<String,List> getProjectList(ProjectFilingBatch projectFilingBatch, HttpServletRequest request, HttpServletResponse response) {
+
+        Map<String,List> map = new HashMap<>();
+        //查询对应子项目数据
+        List<ProjectFilingbatchRelation> projectRelationList = dao.getProjectRelationList(projectFilingBatch.getProjectName(),projectFilingBatch.getReportNumber());
+        List<String> filingBatchIdList = Lists.newArrayList();
+        if(projectRelationList.size()>0){
+            Set<String> set = new HashSet<>();
+            for (ProjectFilingbatchRelation relation : projectRelationList) {
+                set.add(relation.getFilingBatch());
+            }
+            // 使用 ArrayList 构造器转换
+            filingBatchIdList = new ArrayList<>(set);
+        }
+        //如果查出了相关项目信息,则根据项目得批量归档id查询信息,否则返回空值
+        if(filingBatchIdList.size()>0){
+            projectFilingBatch.setFilingBatchIdList(filingBatchIdList);
+
+            //查询所有和当前登陆人有关的项目的审核
+            WorkProjectNotify workProjectNotify = new WorkProjectNotify();
+            workProjectNotify.setUser(UserUtils.getUser());
+            workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
+            workProjectNotify.setRemarks("待审批");
+            //添加发票对应编号
+            workProjectNotify.setType("100");
+            //查询所有需要当前登录人进行处理的项目信息
+            List<WorkProjectNotify> notifyList = workProjectNotifyService.findList(workProjectNotify);
+
+            //添加查询类型(工程咨询)
+            Page<ProjectFilingBatch> page = this.findPage(new Page<ProjectFilingBatch>(request, response), projectFilingBatch);
+
+            //无合同状态下,获取委托方的名称
+            List<ProjectFilingBatch> list = page.getList();
+            List<ProjectFilingBatchTree> dataList = new ArrayList<>();
+            for (int i = 0; i < list.size(); i++) {
+                ProjectFilingBatchTree batchData = new ProjectFilingBatchTree();
+                ProjectFilingBatch batch = list.get(i);
+                //新增批量归档
+                for (WorkProjectNotify notify: notifyList) {
+                    if(notify.getNotifyId().equals(batch.getId())){
+                        batch.setNotifyId(notify.getId());
+                        if("待审批".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
+                            batch.setNotifyFlag(1);
+                        }
+                        break;
+                    }
+                }
+                batchData = getParentInfo(batch);
+                dataList.add(batchData);
+                //获取子项目信息
+                ProjectFilingBatch childrenBatch = new ProjectFilingBatch();
+                childrenBatch.setId(batch.getId());
+                //查询对应子项目数据
+                List<ProjectFilingbatchRelation> relationList = dao.getRelationList(childrenBatch,projectFilingBatch.getProjectName(),projectFilingBatch.getReportNumber());
+
+                //项目名称不为空则进行所有项目的查询和处理
+                for (ProjectFilingbatchRelation relation: relationList) {
+                    ProjectFilingBatchTree treeData = getSubInfo(relation);
+                    dataList.add(treeData);
+
+                }
+            }
+
+            map.put("data",dataList);
+            return map;
+
+        }
+
+        return map;
+
+    }
+
+
     private ProjectFilingBatchTree getParentInfo(ProjectFilingBatch info){
         ProjectFilingBatchTree treeData = new ProjectFilingBatchTree();
         //将界面需要展示数据放入类中
@@ -233,7 +309,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
         //查询批次下所有数据
         List<ProjectFilingBatchProInfo> attachmentList = projectFilingBatchProInfoDao.getListByFilingBatchId(projectFilingBatch.getId());
         //查询批次项目信息
-        List<ProjectFilingbatchRelation> relationList = dao.getRelationList(projectFilingBatch);
+        List<ProjectFilingbatchRelation> relationList = dao.getRelationList(projectFilingBatch,"","");
 
         List<ProjectFilingBatchTree> dataList = new ArrayList<>();
         Map<String,List> map = new HashMap<>();

+ 6 - 1
src/main/java/com/jeeplus/modules/projectFilingBatch/web/ProjectFilingBatchController.java

@@ -116,7 +116,12 @@ public class ProjectFilingBatchController extends BaseController {
         if(StringUtils.isNotBlank(projectFilingBatch.getCreateName())){
             projectFilingBatch.setCreateNameStr(projectFilingBatch.getCreateName());
         }
-        Map<String, List> map = projectFilingBatchService.getList(projectFilingBatch, request, response);
+        Map<String, List> map = new HashMap<>();
+        if(StringUtils.isNotBlank(projectFilingBatch.getProjectName()) || StringUtils.isNotBlank(projectFilingBatch.getReportNumber())){
+            map = projectFilingBatchService.getProjectList(projectFilingBatch, request, response);
+        }else{
+            map = projectFilingBatchService.getList(projectFilingBatch, request, response);
+        }
         return map;
     }
 

+ 4 - 2
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java

@@ -3214,7 +3214,8 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
             if(StringUtils.isNotBlank(projectReportSignatureInfo.getConstructionUnitAssessmentFee())){
                 data.put("constructionUnitAssessmentFee",projectReportSignatureInfo.getConstructionUnitAssessmentFee());
             }else{
-                data.put("constructionUnitAssessmentFee","");
+                projectReportSignatureInfo.setConstructionUnitAssessmentFee("0");
+                data.put("constructionUnitAssessmentFee","0");
             }
             //扣除考核费后审定金额  扣除考核费后审定金额=审定金额-施工单位考核费
             if(StringUtils.isNotBlank(projectReportSignatureInfo.getAuthorizeFee()) && StringUtils.isNotBlank(projectReportSignatureInfo.getAuthorizeFee())){
@@ -3228,7 +3229,8 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
                 String strVal = decimalFormat.format(value);
                 data.put("authorizeFeeDeductAssessmentFee",strVal);
             }else{
-                data.put("authorizeFeeDeductAssessmentFee","");
+                projectReportSignatureInfo.setAuthorizeFeeDeductAssessmentFee("0");
+                data.put("authorizeFeeDeductAssessmentFee","0");
             }
             //施工单位
             if(StringUtils.isNotBlank(projectReportSignatureInfo.getConstructionUnit())){

+ 62 - 1
src/main/resources/mappings/modules/projectGuidang/ProjectFilingBatchDao.xml

@@ -145,6 +145,13 @@
 			<if test="auditEndDate !=null">
 				AND a.audit_pass_date &lt; #{auditEndDate}
 			</if>
+			<if test="filingBatchIdList!=null and filingBatchIdList.size!=0">
+				a.id in
+				<foreach collection="filingBatchIdList" item="filingBatchId" separator="," open="(" close=")">
+					#{filingBatchId}
+				</foreach>
+			</if>
+
 			AND a.del_flag='0'
 			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
 				${sqlMap.dsf}
@@ -182,6 +189,14 @@
 			<if test="auditEndDate !=null">
 				AND a.audit_pass_date &lt; #{auditEndDate}
 			</if>
+
+			<if test="filingBatchIdList!=null and filingBatchIdList.size!=0">
+				a.id in
+				<foreach collection="filingBatchIdList" item="filingBatchId" separator="," open="(" close=")">
+					#{filingBatchId}
+				</foreach>
+			</if>
+
 			AND a.del_flag='0'
 			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
 				${sqlMap.dsf}
@@ -287,7 +302,53 @@
 		LEFT JOIN rural_project_records r on a.project_id=r.id
 		LEFT JOIN project_report_data prd on prd.project_id=r.id
 		LEFT JOIN sys_user su on r.create_by=su.id
-		WHERE a.filing_batch = #{id}
+		<where>
+			a.del_flag = 0
+			and a.filing_batch = #{childrenBatch.id}
+			<if test="null != projectName and '' != projectName">
+				and r.project_name like concat('%',#{projectName},'%')
+			</if>
+			<if test="null != reportNumber and '' != reportNumber">
+				and prd.number like concat('%',#{reportNumber},'%')
+			</if>
+		</where>
+		order by a.sort asc,prd.number asc,a.create_date desc
+	</select>
+
+
+	<select id="getProjectRelationList" resultType="com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation">
+		SELECT
+		  a.id as "id",
+		  a.create_by as "createBy.id",
+		  r.create_date as "createDate",
+		  a.update_by as "updateBy.id",
+		  a.update_date as "updateDate",
+		  a.del_flag as "delFlag",
+		  a.filing_batch as "filingBatch",
+		  a.project_id as "projectId",
+		  a.status as "status",
+		  a.box_num as "boxNum",
+		  a.sort as "sort",
+		  a.re_box_num as "reBoxNum",
+		  r.project_name as "projectName",
+		  r.project_id as "projectNum",
+		  r.project_id as "projectRecordsId",
+		  prd.number as "number",
+		  su.name as "createName"
+		FROM project_flingbatch_relation a
+		LEFT JOIN project_filingbatch f on a.id=f.filing_batch
+		LEFT JOIN rural_project_records r on a.project_id=r.id
+		LEFT JOIN project_report_data prd on prd.project_id=r.id
+		LEFT JOIN sys_user su on r.create_by=su.id
+		<where>
+			a.del_flag = 0
+			<if test="null != projectName and '' != projectName">
+				and r.project_name like concat('%',#{projectName},'%')
+			</if>
+			<if test="null != reportNumber and '' != reportNumber">
+				and prd.number like concat('%',#{reportNumber},'%')
+			</if>
+		</where>
 		order by a.sort asc,prd.number asc,a.create_date desc
 	</select>
 

+ 15 - 1
src/main/webapp/webpage/modules/projectFilingBatch/projectFilingBatchList.jsp

@@ -277,6 +277,18 @@
                         <div style="    clear:both;"></div>
                     </div>
                     <div id="moresees" style="clear:both;display:none;" class="commonQuery lw6">
+                        <div class="layui-item query athird">
+                            <label class="layui-form-label">项目名称:</label>
+                            <div class="layui-input-block">
+                                <form:input path="projectName" htmlEscape="false" maxlength="64"  class=" form-control  layui-input"/>
+                            </div>
+                        </div>
+                        <div class="layui-item query athird">
+                            <label class="layui-form-label">报告号:</label>
+                            <div class="layui-input-block">
+                                <form:input path="reportNumber" htmlEscape="false" maxlength="64"  class=" form-control  layui-input"/>
+                            </div>
+                        </div>
                         <div class="layui-item query athird ">
                             <label class="layui-form-label">状态:</label>
                             <div class="layui-input-block">
@@ -384,6 +396,8 @@
         var renderTable = function () {
             var filingName = $("#filingName").val();
             var filingBatch = $("#filingBatch").val();
+            var projectName = $("#projectName").val();
+            var reportNumber = $("#reportNumber").val();
             var filingStatus = $("#filingStatus").val();
 
             var beginDate = $("#beginDate").val();
@@ -401,7 +415,7 @@
                 treeDefaultClose: true,//是否默认折叠
                 treeLinkage: true,//父级展开时是否自动展开所有子级
                 elem: '#permissionTable',
-                url: '${ctx}/projectFilingBatch/projectFilingBatchInfo/getFilingBatchList?filingName='+filingName+'&pageNo=${page.pageNo}&filingStatus='+filingStatus+'&beginDate='+beginDate+'&endDate='+endDate+'&auditBeginDate='+auditBeginDate+'&auditEndDate='+auditEndDate+'&createId='+createId+'&createName='+createName+'&filingBatch='+filingBatch,
+                url: '${ctx}/projectFilingBatch/projectFilingBatchInfo/getFilingBatchList?filingName='+filingName+'&pageNo=${page.pageNo}&filingStatus='+filingStatus+'&beginDate='+beginDate+'&endDate='+endDate+'&auditBeginDate='+auditBeginDate+'&auditEndDate='+auditEndDate+'&createId='+createId+'&createName='+createName+'&filingBatch='+filingBatch+'&projectName='+projectName+'&reportNumber='+reportNumber,
                 page: false,
                 cols: [[
                     /*{type: 'numbers', align:'center', title: '序号' ,width:80},*/