|
@@ -1,5 +1,6 @@
|
|
package com.jeeplus.modules.projectFilingBatch.service;
|
|
package com.jeeplus.modules.projectFilingBatch.service;
|
|
|
|
|
|
|
|
+import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
import com.jeeplus.common.persistence.Page;
|
|
import com.jeeplus.common.persistence.Page;
|
|
import com.jeeplus.common.service.CrudService;
|
|
import com.jeeplus.common.service.CrudService;
|
|
@@ -161,7 +162,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
|
|
ProjectFilingBatch childrenBatch = new ProjectFilingBatch();
|
|
ProjectFilingBatch childrenBatch = new ProjectFilingBatch();
|
|
childrenBatch.setId(batch.getId());
|
|
childrenBatch.setId(batch.getId());
|
|
//查询对应子项目数据
|
|
//查询对应子项目数据
|
|
- List<ProjectFilingbatchRelation> relationList = dao.getRelationList(childrenBatch);
|
|
|
|
|
|
+ List<ProjectFilingbatchRelation> relationList = dao.getRelationList(childrenBatch,projectFilingBatch.getProjectName(),projectFilingBatch.getReportNumber());
|
|
|
|
|
|
//项目名称不为空则进行所有项目的查询和处理
|
|
//项目名称不为空则进行所有项目的查询和处理
|
|
for (ProjectFilingbatchRelation relation: relationList) {
|
|
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){
|
|
private ProjectFilingBatchTree getParentInfo(ProjectFilingBatch info){
|
|
ProjectFilingBatchTree treeData = new ProjectFilingBatchTree();
|
|
ProjectFilingBatchTree treeData = new ProjectFilingBatchTree();
|
|
//将界面需要展示数据放入类中
|
|
//将界面需要展示数据放入类中
|
|
@@ -233,7 +309,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
|
|
//查询批次下所有数据
|
|
//查询批次下所有数据
|
|
List<ProjectFilingBatchProInfo> attachmentList = projectFilingBatchProInfoDao.getListByFilingBatchId(projectFilingBatch.getId());
|
|
List<ProjectFilingBatchProInfo> attachmentList = projectFilingBatchProInfoDao.getListByFilingBatchId(projectFilingBatch.getId());
|
|
//查询批次项目信息
|
|
//查询批次项目信息
|
|
- List<ProjectFilingbatchRelation> relationList = dao.getRelationList(projectFilingBatch);
|
|
|
|
|
|
+ List<ProjectFilingbatchRelation> relationList = dao.getRelationList(projectFilingBatch,"","");
|
|
|
|
|
|
List<ProjectFilingBatchTree> dataList = new ArrayList<>();
|
|
List<ProjectFilingBatchTree> dataList = new ArrayList<>();
|
|
Map<String,List> map = new HashMap<>();
|
|
Map<String,List> map = new HashMap<>();
|