|
@@ -3,8 +3,6 @@
|
|
|
*/
|
|
|
package com.jeeplus.modules.ruralprojectrecords.web;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.jeeplus.common.config.Global;
|
|
|
import com.jeeplus.common.oss.OSSClientUtil;
|
|
@@ -18,6 +16,7 @@ import com.jeeplus.modules.act.entity.Act;
|
|
|
import com.jeeplus.modules.act.service.ActTaskService;
|
|
|
import com.jeeplus.modules.act.utils.ActUtils;
|
|
|
import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
|
|
|
+import com.jeeplus.modules.projectEngineering.entity.EngineeringTree;
|
|
|
import com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo;
|
|
|
import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
|
|
|
import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
|
|
@@ -52,6 +51,7 @@ import org.activiti.engine.task.Task;
|
|
|
import org.apache.shiro.authz.annotation.Logical;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.checkerframework.checker.units.qual.A;
|
|
|
+import org.json.JSONArray;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
@@ -194,15 +194,16 @@ public class RuralProjectRecordsController extends BaseController {
|
|
|
if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
|
|
|
projectRecords = projectRecordsService.get(projectRecords.getId());
|
|
|
projectRecordsService.queryProjectDetail(projectRecords);
|
|
|
+ //查询工程分类
|
|
|
+ ProjectEngineeringInfo engineeringInfo=engineeringService.get(projectRecords.getEngineeringType());
|
|
|
+ model.addAttribute("engineeringInfo", engineeringInfo);
|
|
|
}else {
|
|
|
projectRecords.setCreateBy(UserUtils.getUser());
|
|
|
projectRecords.setCreateDate(new Date());
|
|
|
projectRecords.setLeaderIds(UserUtils.getUser().getId());
|
|
|
projectRecords.setLeaderNameStr(UserUtils.getUser().getName());
|
|
|
}
|
|
|
- //查询所有的工程分类
|
|
|
- List<ProjectEngineeringInfo> engineeringInfos=engineeringService.findList(new ProjectEngineeringInfo());
|
|
|
- model.addAttribute("engineeringInfo", engineeringInfos);
|
|
|
+
|
|
|
model.addAttribute("ruralProjectRecords", projectRecords);
|
|
|
return "modules/ruralprojectrecords/ruralProjectRecordsForm";
|
|
|
}
|
|
@@ -367,9 +368,9 @@ public class RuralProjectRecordsController extends BaseController {
|
|
|
act.setTask(taskInfok);
|
|
|
projectRecords.setAct(act);
|
|
|
}
|
|
|
- //查询所有的工程分类
|
|
|
- List<ProjectEngineeringInfo> engineeringInfos=engineeringService.findList(new ProjectEngineeringInfo());
|
|
|
- model.addAttribute("engineeringInfo", engineeringInfos);
|
|
|
+ //查询工程分类
|
|
|
+ ProjectEngineeringInfo engineeringInfo=engineeringService.get(projectRecords.getEngineeringType());
|
|
|
+ model.addAttribute("engInfo", engineeringInfo);
|
|
|
projectRecordsService.queryProjectDetail(projectRecords);
|
|
|
model.addAttribute("projectRecords", projectRecords);
|
|
|
return "modules/ruralprojectrecords/ruralProjectRecordsModify";
|
|
@@ -1066,18 +1067,44 @@ public class RuralProjectRecordsController extends BaseController {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
-// /**
|
|
|
-// * 查询其他文件树形信息
|
|
|
-// */
|
|
|
-// @RequestMapping(value = "engineeringTreeMenu")
|
|
|
-// @ResponseBody
|
|
|
-// public JSONObject engineeringTreeMenu(){
|
|
|
-//// List<>
|
|
|
-// //查询所有工程分类的父类
|
|
|
-// List<ProjectEngineeringInfo> parents=engineeringService.getParentInfo();
|
|
|
-// for(ProjectEngineeringInfo engineeringInfo:parents){
|
|
|
-// ProjectEngineeringInfo child=engineeringService.get(engineeringInfo.getId());
|
|
|
-// }
|
|
|
-// return null;
|
|
|
-// }
|
|
|
+ /**
|
|
|
+ * 查询其他文件树形信息
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "engineeringTreeMenu")
|
|
|
+ @ResponseBody
|
|
|
+ public String engineeringTreeMenu(){
|
|
|
+ LinkedHashSet<EngineeringTree> trees=new LinkedHashSet<>();
|
|
|
+ //查询所有工程分类
|
|
|
+ List<ProjectEngineeringInfo> engineeringInfos=engineeringService.findList(new ProjectEngineeringInfo());
|
|
|
+ childs(engineeringInfos,trees,"0");
|
|
|
+ JSONArray jsonArray=new JSONArray(trees);
|
|
|
+ return jsonArray.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void childs(List<ProjectEngineeringInfo> sourcelist,LinkedHashSet<EngineeringTree> list,String parentId){
|
|
|
+ for (int i=0; i<sourcelist.size(); i++){
|
|
|
+ ProjectEngineeringInfo e = sourcelist.get(i);
|
|
|
+ if (e.getParent()!=null && StringUtils.isNotBlank(e.getParent().getId()) && e.getParent().getId().equals(parentId)){
|
|
|
+ EngineeringTree tree=new EngineeringTree();
|
|
|
+ tree.setTitle(e.getEngineeringName());
|
|
|
+ tree.setId(e.getId());
|
|
|
+ // 判断是否还有子节点, 有则继续获取子节点
|
|
|
+ for (int j=0; j<sourcelist.size(); j++){
|
|
|
+ ProjectEngineeringInfo child = sourcelist.get(j);
|
|
|
+ if (child.getParent()!=null && StringUtils.isNotBlank(child.getParent().getId()) && child.getParent().getId().equals(e.getId())){
|
|
|
+ tree.setType("group");
|
|
|
+ LinkedHashSet<EngineeringTree> childs=new LinkedHashSet<>();
|
|
|
+ childs(sourcelist,childs, e.getId());
|
|
|
+ List<EngineeringTree> childss=new ArrayList<>(childs);
|
|
|
+ tree.setChild(childss);
|
|
|
+ list.add(tree);
|
|
|
+ break;
|
|
|
+ }else{
|
|
|
+ list.add(tree);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|