|
@@ -69,12 +69,19 @@ public class ProjectDailyPlanController extends BaseController {
|
|
//删除操作
|
|
//删除操作
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@RequestMapping(value = "deleteAll")
|
|
@RequestMapping(value = "deleteAll")
|
|
- public AjaxJson deleteAll(ProjectDailyPlan projectDailyPlan,String ids,HttpServletRequest request){
|
|
|
|
|
|
+ public AjaxJson deleteAll(ProjectDailyPlan projectDailyPlan,String ids,String projectNames,HttpServletRequest request){
|
|
AjaxJson ajaxJson = new AjaxJson();
|
|
AjaxJson ajaxJson = new AjaxJson();
|
|
ProjectDailyPlan dailyPlan = null;
|
|
ProjectDailyPlan dailyPlan = null;
|
|
try {
|
|
try {
|
|
|
|
+ String comment = URLDecoder.decode(projectNames, "UTF-8");
|
|
|
|
+ List<String> list = new ArrayList<>();
|
|
if (ids.contains(",")){
|
|
if (ids.contains(",")){
|
|
String[] split = ids.split(",");
|
|
String[] split = ids.split(",");
|
|
|
|
+ String[] names = comment.split(",");
|
|
|
|
+ for (String name:names){
|
|
|
|
+ list.add(name);
|
|
|
|
+ }
|
|
|
|
+ projectDailyPlanService.updateNoMartailDaily(list);
|
|
for (String str : split){
|
|
for (String str : split){
|
|
dailyPlan = new ProjectDailyPlan();
|
|
dailyPlan = new ProjectDailyPlan();
|
|
dailyPlan.setId(str);
|
|
dailyPlan.setId(str);
|
|
@@ -83,6 +90,8 @@ public class ProjectDailyPlanController extends BaseController {
|
|
}else {
|
|
}else {
|
|
dailyPlan = new ProjectDailyPlan();
|
|
dailyPlan = new ProjectDailyPlan();
|
|
dailyPlan.setId(ids);
|
|
dailyPlan.setId(ids);
|
|
|
|
+ list.add(comment);
|
|
|
|
+ projectDailyPlanService.updateNoMartailDaily(list);
|
|
projectDailyPlanService.delete(dailyPlan);
|
|
projectDailyPlanService.delete(dailyPlan);
|
|
}
|
|
}
|
|
ajaxJson.setSuccess(true);
|
|
ajaxJson.setSuccess(true);
|
|
@@ -114,13 +123,32 @@ public class ProjectDailyPlanController extends BaseController {
|
|
return j;
|
|
return j;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //下载导入模板
|
|
|
|
+ @ResponseBody
|
|
|
|
+ @RequestMapping(value = "exportTim")
|
|
|
|
+ public AjaxJson exportTim(ProjectDailyPlan projectDailyPlan, HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
+ AjaxJson j = new AjaxJson();
|
|
|
|
+ try {
|
|
|
|
+ String fileName = "日计划安排表模板.xlsx";
|
|
|
|
+ List<ProjectDailyPlan> projectDailyPlans = new ArrayList<ProjectDailyPlan>();
|
|
|
|
+ new ExportExcel("日计划安排表", ProjectDailyPlan.class).setDataList(projectDailyPlans).write(response, fileName).dispose();
|
|
|
|
+ j.setSuccess(true);
|
|
|
|
+ j.setMsg("导出成功!");
|
|
|
|
+ return j;
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ j.setSuccess(false);
|
|
|
|
+ j.setMsg("导出日计划安排记录失败!失败信息:"+e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ return j;
|
|
|
|
+ }
|
|
|
|
+
|
|
//新增日计划选择项目定义号,或者项目名称后走的方法(可不选)
|
|
//新增日计划选择项目定义号,或者项目名称后走的方法(可不选)
|
|
@RequestMapping(value = "initAddDailyPlan")
|
|
@RequestMapping(value = "initAddDailyPlan")
|
|
public String getInitAddDailyPlan(ProjectDailyPlan projectDailyPlan,Model model,HttpServletRequest request){
|
|
public String getInitAddDailyPlan(ProjectDailyPlan projectDailyPlan,Model model,HttpServletRequest request){
|
|
try {
|
|
try {
|
|
String comment1 = URLDecoder.decode(projectDailyPlan.getProjectName(), "UTF-8");
|
|
String comment1 = URLDecoder.decode(projectDailyPlan.getProjectName(), "UTF-8");
|
|
projectDailyPlan.setProjectName(comment1);
|
|
projectDailyPlan.setProjectName(comment1);
|
|
- //获取所有为安排的日计划
|
|
|
|
|
|
+ //获取所有未安排的日计划
|
|
List<ProjectDailyPlan> projectDailyPlans = projectDailyPlanService.getProjectDailyPlan();
|
|
List<ProjectDailyPlan> projectDailyPlans = projectDailyPlanService.getProjectDailyPlan();
|
|
List<ProjectDailyPlan> sxDailyPlan = projectDailyPlanService.getSxDailyPlan(projectDailyPlans, projectDailyPlan);
|
|
List<ProjectDailyPlan> sxDailyPlan = projectDailyPlanService.getSxDailyPlan(projectDailyPlans, projectDailyPlan);
|
|
for (ProjectDailyPlan plan:sxDailyPlan){
|
|
for (ProjectDailyPlan plan:sxDailyPlan){
|
|
@@ -179,11 +207,24 @@ public class ProjectDailyPlanController extends BaseController {
|
|
if (!projectPlans.isEmpty()&&!strings.isEmpty()){
|
|
if (!projectPlans.isEmpty()&&!strings.isEmpty()){
|
|
projectDailyPlanService.addPlanDaily(projectPlans,strings);
|
|
projectDailyPlanService.addPlanDaily(projectPlans,strings);
|
|
}
|
|
}
|
|
|
|
+ //判断书否二次涉电
|
|
|
|
+ boolean flag = false;
|
|
|
|
+ for (ProjectDailyPlan plans:projectPlans){
|
|
|
|
+ //二次设电项目
|
|
|
|
+ if (plans.getFlagYesElectricity().equals("1")){
|
|
|
|
+ flag = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
List<Map<String,Object>> objects = Lists.newArrayList();
|
|
List<Map<String,Object>> objects = Lists.newArrayList();
|
|
List<Map<String, Object>> bookStrapTree = BookStrapTreeUtil.getDailyBookStrapTree(objects, projectPlans);
|
|
List<Map<String, Object>> bookStrapTree = BookStrapTreeUtil.getDailyBookStrapTree(objects, projectPlans);
|
|
j.setMapListTree(bookStrapTree);
|
|
j.setMapListTree(bookStrapTree);
|
|
j.setSuccess(true);
|
|
j.setSuccess(true);
|
|
- j.setMessage("安排日计划成功");
|
|
|
|
|
|
+ if (flag){
|
|
|
|
+ j.setMessage("安排日计划成功:您所安排的项目中有二次涉电项目,列表已标红");
|
|
|
|
+ }else {
|
|
|
|
+ j.setMessage("安排日计划成功");
|
|
|
|
+ }
|
|
return j;
|
|
return j;
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -261,6 +302,38 @@ public class ProjectDailyPlanController extends BaseController {
|
|
return ajaxJson;
|
|
return ajaxJson;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //新增日计划备注按钮
|
|
|
|
+ @ResponseBody
|
|
|
|
+ @RequestMapping(value = "remarksBack")
|
|
|
|
+ public Result remarksBack(String ids,String remarks,HttpServletRequest request){
|
|
|
|
+ Result j = new Result();
|
|
|
|
+ List<String> strings = PackagingUtil.getString(ids);
|
|
|
|
+ try {
|
|
|
|
+ String comment = URLDecoder.decode(remarks, "UTF-8");
|
|
|
|
+ List<ProjectDailyPlan> projectPlans = (List<ProjectDailyPlan>)request.getSession().getAttribute("sxDailyPlan");
|
|
|
|
+ for (ProjectDailyPlan plan:projectPlans){
|
|
|
|
+ for (String s:strings){
|
|
|
|
+ if (plan.getId().equals(s)){
|
|
|
|
+ plan.setRemarks(comment);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<Map<String,Object>> objects = Lists.newArrayList();
|
|
|
|
+ List<Map<String, Object>> bookStrapTree = BookStrapTreeUtil.getDailyBookStrapTree(objects, projectPlans);
|
|
|
|
+ j.setMapListTree(bookStrapTree);
|
|
|
|
+ j.setSuccess(true);
|
|
|
|
+ j.setMessage("取消计划成功");
|
|
|
|
+ j.setSuccess(true);
|
|
|
|
+ j.setMessage("备注成功");
|
|
|
|
+ return j;
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ j.setSuccess(false);
|
|
|
|
+ j.setMessage("备注失败");
|
|
|
|
+ return j;
|
|
|
|
+ }
|
|
|
|
+
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@RequestMapping(value = "sureInspection")
|
|
@RequestMapping(value = "sureInspection")
|
|
public AjaxJson sureInspection(String ids,ProjectDailyPlan projectDailyPlan,Model model,HttpServletRequest request,HttpServletResponse response){
|
|
public AjaxJson sureInspection(String ids,ProjectDailyPlan projectDailyPlan,Model model,HttpServletRequest request,HttpServletResponse response){
|