|
|
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.ResponseBody; |
|
|
|
@RequestMapping("/gcc/works") |
|
|
|
@Controller("worksController") |
|
|
|
public class MainController { |
|
|
|
private String BasePath = "modules/works/"; |
|
|
|
private String BasePath = "modules/works/"; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private EstimateService estimateService; |
|
|
|
@ -28,9 +28,9 @@ public class MainController { |
|
|
|
|
|
|
|
private Map<String, List<String>> zoneWardMap = new HashMap<>(); |
|
|
|
|
|
|
|
@GetMapping({"", "/", "/index", "/dashboard"}) |
|
|
|
@GetMapping({ "", "/", "/index", "/dashboard" }) |
|
|
|
public String home(Model model) { |
|
|
|
return BasePath+"index"; |
|
|
|
return BasePath + "index"; |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/erp-works-update") // not in use |
|
|
|
@ -40,12 +40,12 @@ public class MainController { |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
model.addAttribute("zones", zones); |
|
|
|
return BasePath+"erp-works-update"; |
|
|
|
return BasePath + "erp-works-update"; |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/nonerp-works-add") |
|
|
|
public String nonErpCreateRequest(Model model) { |
|
|
|
//List<Integer> zones = new ArrayList<>(); |
|
|
|
// List<Integer> zones = new ArrayList<>(); |
|
|
|
List<String> zones = new ArrayList<>(zoneWardMap.keySet()); |
|
|
|
System.out.println("zones: " + zones); |
|
|
|
|
|
|
|
@ -56,14 +56,14 @@ public class MainController { |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
|
|
|
|
model.addAttribute("zones", zones); |
|
|
|
return BasePath+"non-erp-works-add"; |
|
|
|
return BasePath + "non-erp-works-add"; |
|
|
|
} |
|
|
|
|
|
|
|
public MainController() { |
|
|
|
zoneWardMap.put("00", generateWardList("000", "000")); |
|
|
|
zoneWardMap.put("00", generateWardList("000", "000")); |
|
|
|
zoneWardMap.put("01", generateWardList("001", "014")); |
|
|
|
zoneWardMap.put("02", generateWardList("015", "021")); |
|
|
|
zoneWardMap.put("03", generateWardList("022", "033")); |
|
|
|
zoneWardMap.put("02", generateWardList("015", "022")); |
|
|
|
zoneWardMap.put("03", generateWardList("023", "033")); |
|
|
|
zoneWardMap.put("04", generateWardList("034", "048")); |
|
|
|
zoneWardMap.put("05", generateWardList("049", "063")); |
|
|
|
zoneWardMap.put("06", generateWardList("064", "078")); |
|
|
|
@ -93,49 +93,50 @@ public class MainController { |
|
|
|
public List<String> getWards(@RequestParam String zone) { |
|
|
|
return zoneWardMap.getOrDefault(zone, Collections.emptyList()); |
|
|
|
} |
|
|
|
//ak |
|
|
|
|
|
|
|
// ak |
|
|
|
|
|
|
|
@GetMapping("/erpworkslist") // To diplay updated ERP works |
|
|
|
public String worksList(Model model) { |
|
|
|
//List<Integer> zones = new ArrayList<>(zoneWardMap.keySet()); |
|
|
|
// List<Integer> zones = new ArrayList<>(zoneWardMap.keySet()); |
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
|
|
|
|
//List<Map<String, Object>> workDetails = estimateService.getAllERPWorks(LoginUserId); |
|
|
|
// List<Map<String, Object>> workDetails = |
|
|
|
// estimateService.getAllERPWorks(LoginUserId); |
|
|
|
|
|
|
|
//model.addAttribute("workDetails", workDetails); |
|
|
|
//model.addAttribute("zones", zones); |
|
|
|
return BasePath+"erpworkslist"; |
|
|
|
// model.addAttribute("workDetails", workDetails); |
|
|
|
// model.addAttribute("zones", zones); |
|
|
|
return BasePath + "erpworkslist"; |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/erpworkslist_report") // To diplay updated ERP works |
|
|
|
public String erpworkslist_report(Model model) { |
|
|
|
//List<Integer> zones = new ArrayList<>(zoneWardMap.keySet()); |
|
|
|
// List<Integer> zones = new ArrayList<>(zoneWardMap.keySet()); |
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
|
|
|
|
//List<Map<String, Object>> workDetails = estimateService.getAllERPWorks(LoginUserId); |
|
|
|
// List<Map<String, Object>> workDetails = |
|
|
|
// estimateService.getAllERPWorks(LoginUserId); |
|
|
|
|
|
|
|
//model.addAttribute("workDetails", workDetails); |
|
|
|
//model.addAttribute("zones", zones); |
|
|
|
return BasePath+"erpworkslist_report"; |
|
|
|
// model.addAttribute("workDetails", workDetails); |
|
|
|
// model.addAttribute("zones", zones); |
|
|
|
return BasePath + "erpworkslist_report"; |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/nonerpworkslist") // To display updated Non-ERP Works |
|
|
|
public String nonerpworksList(Model model) { |
|
|
|
List<String> zones = new ArrayList<>(zoneWardMap.keySet()); |
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
|
|
|
|
List<Map<String, Object>> workDetails = estimateService.getAllNonERPWorks(LoginUserId); |
|
|
|
|
|
|
|
model.addAttribute("workDetails", workDetails); |
|
|
|
model.addAttribute("zones", zones); |
|
|
|
return BasePath+"nonerpworkslist"; |
|
|
|
return BasePath + "nonerpworkslist"; |
|
|
|
} |
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////// |
|
|
|
@ -144,82 +145,82 @@ public class MainController { |
|
|
|
public String erpworksList(Model model) { |
|
|
|
List<String> zones = new ArrayList<>(zoneWardMap.keySet()); |
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
|
|
|
|
//List<Map<String, Object>> workDetails = erpestimateService.getAllWorks(LoginUserId); |
|
|
|
// List<Map<String, Object>> workDetails = |
|
|
|
// erpestimateService.getAllWorks(LoginUserId); |
|
|
|
|
|
|
|
//model.addAttribute("workDetails", workDetails); |
|
|
|
// model.addAttribute("workDetails", workDetails); |
|
|
|
model.addAttribute("zones", zones); |
|
|
|
return BasePath+"erp-works-list"; |
|
|
|
return BasePath + "erp-works-list"; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/view-works-details-modal") |
|
|
|
public String worksViewModal(Model model,@RequestParam(value="estid", required = false) String estid) { |
|
|
|
System.out.println("EST ID: "+estid); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
model.addAttribute("estid",estid); |
|
|
|
return BasePath+"works_details_view_modal_page"; |
|
|
|
} |
|
|
|
public String worksViewModal(Model model, @RequestParam(value = "estid", required = false) String estid) { |
|
|
|
System.out.println("EST ID: " + estid); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
model.addAttribute("estid", estid); |
|
|
|
return BasePath + "works_details_view_modal_page"; |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/update-works-details-modal") |
|
|
|
public String worksUpdateModal(Model model,@RequestParam(value="estid", required = false) String estid) { |
|
|
|
System.out.println("EST ID: "+estid); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
model.addAttribute("estid",estid); |
|
|
|
return BasePath+"works_details_update_modal_page"; |
|
|
|
} |
|
|
|
public String worksUpdateModal(Model model, @RequestParam(value = "estid", required = false) String estid) { |
|
|
|
System.out.println("EST ID: " + estid); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
model.addAttribute("estid", estid); |
|
|
|
return BasePath + "works_details_update_modal_page"; |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/user-view-works-details-modal") |
|
|
|
public String userworksViewModal(Model model,@RequestParam(value="estid", required = false) String estid) { |
|
|
|
System.out.println("EST ID: "+estid); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
model.addAttribute("estid",estid); |
|
|
|
return BasePath+"user_works_details_view_modal_page"; |
|
|
|
} |
|
|
|
public String userworksViewModal(Model model, @RequestParam(value = "estid", required = false) String estid) { |
|
|
|
System.out.println("EST ID: " + estid); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
model.addAttribute("estid", estid); |
|
|
|
return BasePath + "user_works_details_view_modal_page"; |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/user-update-works-details-modal") |
|
|
|
public String userworksUpdateModal(Model model,@RequestParam(value="estid", required = false) String estid) { |
|
|
|
System.out.println("EST ID: "+estid); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
model.addAttribute("estid",estid); |
|
|
|
return BasePath+"user_works_details_update_modal_page"; |
|
|
|
} |
|
|
|
public String userworksUpdateModal(Model model, @RequestParam(value = "estid", required = false) String estid) { |
|
|
|
System.out.println("EST ID: " + estid); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
model.addAttribute("estid", estid); |
|
|
|
return BasePath + "user_works_details_update_modal_page"; |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/update_works_stage_modal") |
|
|
|
public String updateWorksStageModal(Model model,@RequestParam(value="estid", required = false) String estid) { |
|
|
|
System.out.println("EST ID: "+estid); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
model.addAttribute("estid",estid); |
|
|
|
return BasePath+"update_works_stage_modal"; |
|
|
|
} |
|
|
|
public String updateWorksStageModal(Model model, @RequestParam(value = "estid", required = false) String estid) { |
|
|
|
System.out.println("EST ID: " + estid); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
model.addAttribute("estid", estid); |
|
|
|
return BasePath + "update_works_stage_modal"; |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/edit_stage_modal") |
|
|
|
public String editStageModal(Model model,@RequestParam(value="estid", required = false) String estid, |
|
|
|
@RequestParam(value="tmid", required = false) String tmid) { |
|
|
|
System.out.println("EST ID: "+estid); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
model.addAttribute("estid",estid); |
|
|
|
model.addAttribute("tmid",tmid); |
|
|
|
return BasePath+"edit_stage_modal"; |
|
|
|
} |
|
|
|
public String editStageModal(Model model, @RequestParam(value = "estid", required = false) String estid, |
|
|
|
@RequestParam(value = "tmid", required = false) String tmid) { |
|
|
|
System.out.println("EST ID: " + estid); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
model.addAttribute("estid", estid); |
|
|
|
model.addAttribute("tmid", tmid); |
|
|
|
return BasePath + "edit_stage_modal"; |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/update_project_status") |
|
|
|
public String updateProjectStatus(Model model) { |
|
|
|
List<Map<String, Object>> projectList = estimateService.getProjectList(); |
|
|
|
List<Map<String, Object>> projectList = estimateService.getProjectList(); |
|
|
|
model.addAttribute("projects", projectList); |
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
|
|
|
|
return BasePath+"project_status_update"; |
|
|
|
} |
|
|
|
return BasePath + "project_status_update"; |
|
|
|
} |
|
|
|
|
|
|
|
} |