|
@@ -64,6 +64,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.File;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLDecoder;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@@ -218,12 +219,29 @@ public class RuralProjectRecordsController extends BaseController {
|
|
|
//查询工程分类
|
|
|
ProjectEngineeringInfo engineeringInfo=engineeringService.get(projectRecords.getEngineeringType());
|
|
|
model.addAttribute("engineeringInfo", engineeringInfo);
|
|
|
+ //获取项目计划信息
|
|
|
+ ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
|
|
|
+ //将项目id放入项目计划表中
|
|
|
+ projectPlanInfo.setProjectId(projectRecords.getId());
|
|
|
+ //获取项目计划信息
|
|
|
+ List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
|
|
|
+ if(projectPlanList.size()>0){
|
|
|
+ String startDate = projectPlanList.get(0).getEndDate();
|
|
|
+ String endDate = projectPlanList.get(projectPlanList.size()-1).getBeginDate();
|
|
|
+ model.addAttribute("projectStartDate", startDate);
|
|
|
+ model.addAttribute("projectEndDate", endDate);
|
|
|
+ }else{
|
|
|
+ model.addAttribute("projectStartDate", "");
|
|
|
+ model.addAttribute("projectEndDate", "");
|
|
|
+ }
|
|
|
}else {
|
|
|
projectRecords.setCreateBy(UserUtils.getUser());
|
|
|
projectRecords.setCreateDate(new Date());
|
|
|
projectRecords.setLeaderIds(UserUtils.getUser().getId());
|
|
|
projectRecords.setLeaderNameStr(UserUtils.getUser().getName());
|
|
|
projectRecords.setCreateReportFlag(true);
|
|
|
+ model.addAttribute("projectStartDate", "");
|
|
|
+ model.addAttribute("projectEndDate", "");
|
|
|
}
|
|
|
|
|
|
model.addAttribute("ruralProjectRecords", projectRecords);
|
|
@@ -298,6 +316,21 @@ public class RuralProjectRecordsController extends BaseController {
|
|
|
RuralProjectRecords t = projectRecordsService.get(projectRecords.getId());//从数据库取出记录的值
|
|
|
//if(t.getProjectStatus() == 3 || t.getProjectStatus() == 1) {
|
|
|
MyBeanUtils.copyBeanNotNull2Bean(projectRecords, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
+ //判断是否存在项目计划,存在将计划开始时间和计划结束时间进行修改
|
|
|
+ //获取项目计划信息
|
|
|
+ ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
|
|
|
+ //将项目id放入项目计划表中
|
|
|
+ projectPlanInfo.setProjectId(projectRecords.getId());
|
|
|
+ //获取项目计划信息
|
|
|
+ List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
|
|
|
+ if(projectPlanList.size()>0){
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ String startDate = formatter.format(projectRecords.getStartDate());
|
|
|
+ String endDate = formatter.format(projectRecords.getEndingDate());
|
|
|
+ projectPlanList.get(0).setBeginDate(startDate);
|
|
|
+ projectPlanList.get(projectPlanList.size()-1).setEndDate(endDate);
|
|
|
+ t.setProjectPlanList(projectPlanList);
|
|
|
+ }
|
|
|
projectRecordsService.saveProject(t, ProjectStatusEnum.SIGNED);//保存
|
|
|
/*}else if(t.getProjectStatus() == 2){
|
|
|
addMessage(redirectAttributes, "项目已送审,无法重复送审");
|
|
@@ -1160,10 +1193,16 @@ public class RuralProjectRecordsController extends BaseController {
|
|
|
@ResponseBody
|
|
|
public String engineeringTreeMenu(){
|
|
|
LinkedHashSet<EngineeringTree> trees=new LinkedHashSet<>();
|
|
|
+ LinkedHashSet<EngineeringTree> list = new LinkedHashSet<>();
|
|
|
+ EngineeringTree emptyInfo = new EngineeringTree();
|
|
|
+ emptyInfo.setId("");
|
|
|
+ emptyInfo.setTitle("请选择");
|
|
|
//查询所有工程分类
|
|
|
List<ProjectEngineeringInfo> engineeringInfos=engineeringService.findList(new ProjectEngineeringInfo());
|
|
|
childs(engineeringInfos,trees,"0");
|
|
|
- JSONArray jsonArray=new JSONArray(trees);
|
|
|
+ list.add(emptyInfo);
|
|
|
+ list.addAll(trees);
|
|
|
+ JSONArray jsonArray=new JSONArray(list);
|
|
|
return jsonArray.toString();
|
|
|
}
|
|
|
|