Browse Source

Ward value updated based on zone in works module

master
KaNi-04 4 weeks ago
parent
commit
ae80d96960
  1. 129
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/MenuController.java
  2. 125
      src/main/java/in/gov/chennaicorporation/gccoffice/works/controller/MainController.java
  3. 258
      src/main/resources/templates/modules/works/non-erp-works-add.html

129
src/main/java/in/gov/chennaicorporation/gccoffice/controller/MenuController.java

@ -51,22 +51,21 @@ public class MenuController {
@ModelAttribute("menuItemsHTML") // This will add the menuItems to the model for all requests @ModelAttribute("menuItemsHTML") // This will add the menuItems to the model for all requests
public String menuHTML() { public String menuHTML() {
if(LoginUserInfo.getLoginUserId() == null || LoginUserInfo.getUserGroupId()==null) {
if (LoginUserInfo.getLoginUserId() == null || LoginUserInfo.getUserGroupId() == null) {
return ""; return "";
} }
List<AppModuleAccessEntity> getAppModuleAccessEntities; List<AppModuleAccessEntity> getAppModuleAccessEntities;
List<AppModuleEntity> getAppModuleEntities; List<AppModuleEntity> getAppModuleEntities;
if(LoginUserInfo.getUserRole().equals("ADMIN")) {
if (LoginUserInfo.getUserRole().equals("ADMIN")) {
getAppModuleEntities = appModuleRepository.showAll(); getAppModuleEntities = appModuleRepository.showAll();
}
else {
} else {
getAppModuleAccessEntities = appModuleAccessRepository.findByUserGroupID(LoginUserInfo.getUserGroupId()); getAppModuleAccessEntities = appModuleAccessRepository.findByUserGroupID(LoginUserInfo.getUserGroupId());
String[] checkModuleId = new String[getAppModuleAccessEntities.size()]; String[] checkModuleId = new String[getAppModuleAccessEntities.size()];
int i=0;
int i = 0;
for (AppModuleAccessEntity accessEntity : getAppModuleAccessEntities) { for (AppModuleAccessEntity accessEntity : getAppModuleAccessEntities) {
checkModuleId[i]=accessEntity.getModuleId().getId().toString();
checkModuleId[i] = accessEntity.getModuleId().getId().toString();
i++; i++;
} }
getAppModuleEntities = appModuleRepository.showAllById(checkModuleId); getAppModuleEntities = appModuleRepository.showAllById(checkModuleId);
@ -76,90 +75,108 @@ public class MenuController {
menuHTML = "<div class=\"nav-item\"><a href=\"/gcc\"><i class=\"ik ik-home\"></i><span>Dashboard</span></a></div>"; menuHTML = "<div class=\"nav-item\"><a href=\"/gcc\"><i class=\"ik ik-home\"></i><span>Dashboard</span></a></div>";
for (AppModuleEntity moduleName : getAppModuleEntities) { for (AppModuleEntity moduleName : getAppModuleEntities) {
menuHTML = menuHTML+"<div class=\"nav-item has-sub\"><a href=\"javascript:void(0)\"><i class=\""+moduleName.getIcon()+"\"></i><span>"+moduleName.getName()+"</span></a><div class=\"submenu-content\">";
menuHTML = menuHTML + "<div class=\"nav-item has-sub\"><a href=\"javascript:void(0)\"><i class=\""
+ moduleName.getIcon() + "\"></i><span>" + moduleName.getName()
+ "</span></a><div class=\"submenu-content\">";
List<MenuItemEntity> getMenuItems; List<MenuItemEntity> getMenuItems;
if(LoginUserInfo.getUserRole().equals("ADMIN")) {
if (LoginUserInfo.getUserRole().equals("ADMIN")) {
getMenuItems = menuItemRepository.getMenuItemByModuleId(moduleName.getId()); getMenuItems = menuItemRepository.getMenuItemByModuleId(moduleName.getId());
}
else {
List<MenuItemAccessEntity> getMenuItemAccess = menuItemAccessRepository.findByUserGroupID(LoginUserInfo.getUserGroupId(), moduleName.getId().toString());
} else {
List<MenuItemAccessEntity> getMenuItemAccess = menuItemAccessRepository
.findByUserGroupID(LoginUserInfo.getUserGroupId(), moduleName.getId().toString());
String[] checkMenuId = new String[getMenuItemAccess.size()]; String[] checkMenuId = new String[getMenuItemAccess.size()];
int j=0;
int j = 0;
for (MenuItemAccessEntity menuAccessEntity : getMenuItemAccess) { for (MenuItemAccessEntity menuAccessEntity : getMenuItemAccess) {
checkMenuId[j]=menuAccessEntity.getMenuItemId().getId().toString();
checkMenuId[j] = menuAccessEntity.getMenuItemId().getId().toString();
j++; j++;
} }
getMenuItems = menuItemRepository.getMenuItemByModuleIdAccess(moduleName.getId(),checkMenuId);
getMenuItems = menuItemRepository.getMenuItemByModuleIdAccess(moduleName.getId(), checkMenuId);
} }
String subMenuHTML = ""; String subMenuHTML = "";
for (MenuItemEntity menuItem : getMenuItems) { for (MenuItemEntity menuItem : getMenuItems) {
if(menuItem.getHasSub()) {
if(LoginUserInfo.getUserRole().equals("ADMIN")) {
List<SubMenuItemEntity> getMenuSubItems = subMenuItemRepository.getSubMenuItemByMenuItemId(menuItem.getId());
if (menuItem.getHasSub()) {
if (LoginUserInfo.getUserRole().equals("ADMIN")) {
List<SubMenuItemEntity> getMenuSubItems = subMenuItemRepository
.getSubMenuItemByMenuItemId(menuItem.getId());
String subSubMenuHTML = ""; String subSubMenuHTML = "";
for (SubMenuItemEntity subMenuItem : getMenuSubItems) { for (SubMenuItemEntity subMenuItem : getMenuSubItems) {
String target = ""; String target = "";
System.err.println(subMenuItem.getExtenalLink());
if(subMenuItem.getExtenalLink()) {
// System.err.println(subMenuItem.getExtenalLink());
if (subMenuItem.getExtenalLink()) {
target = " target=\"_blank\""; target = " target=\"_blank\"";
subSubMenuHTML = subSubMenuHTML+"<a href=\""+subMenuItem.getUrl()+"\" class=\"menu-item\""+target+"><i class=\""+subMenuItem.getIcon()+"\"></i><span>"+subMenuItem.getName()+"</span></a>";
}
else {
subSubMenuHTML = subSubMenuHTML+"<a href=\"/gcc/"+subMenuItem.getUrl()+"\" class=\"menu-item\""+target+"><i class=\""+subMenuItem.getIcon()+"\"></i><span>"+subMenuItem.getName()+"</span></a>";
}
}
if(subSubMenuHTML.equals(""))
{
subMenuHTML = subMenuHTML+"<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i>"+menuItem.getName()+"</a></div>";
}
else {
subMenuHTML = subMenuHTML+"<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i>"+menuItem.getName()+"</a><div class=\"submenu-content\">"+subSubMenuHTML+"</div></div>";
}
}
else {
List<SubMenuItemAccessEntity> getSubMenuItemAccess = subMenuItemAccessRepository.findByUserGroupIDAccess(LoginUserInfo.getUserGroupId(), moduleName.getId().toString(), menuItem.getId().toString());
subSubMenuHTML = subSubMenuHTML + "<a href=\"" + subMenuItem.getUrl()
+ "\" class=\"menu-item\"" + target + "><i class=\"" + subMenuItem.getIcon()
+ "\"></i><span>" + subMenuItem.getName() + "</span></a>";
} else {
subSubMenuHTML = subSubMenuHTML + "<a href=\"/gcc/" + subMenuItem.getUrl()
+ "\" class=\"menu-item\"" + target + "><i class=\"" + subMenuItem.getIcon()
+ "\"></i><span>" + subMenuItem.getName() + "</span></a>";
}
}
if (subSubMenuHTML.equals("")) {
subMenuHTML = subMenuHTML
+ "<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""
+ menuItem.getIcon() + "\"></i>" + menuItem.getName() + "</a></div>";
} else {
subMenuHTML = subMenuHTML
+ "<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""
+ menuItem.getIcon() + "\"></i>" + menuItem.getName()
+ "</a><div class=\"submenu-content\">" + subSubMenuHTML + "</div></div>";
}
} else {
List<SubMenuItemAccessEntity> getSubMenuItemAccess = subMenuItemAccessRepository
.findByUserGroupIDAccess(LoginUserInfo.getUserGroupId(), moduleName.getId().toString(),
menuItem.getId().toString());
String[] checkSubMenuId = new String[getSubMenuItemAccess.size()]; String[] checkSubMenuId = new String[getSubMenuItemAccess.size()];
if(checkSubMenuId.length>0)
{
int k=0;
if (checkSubMenuId.length > 0) {
int k = 0;
for (SubMenuItemAccessEntity subMenuItemAccessEntity : getSubMenuItemAccess) { for (SubMenuItemAccessEntity subMenuItemAccessEntity : getSubMenuItemAccess) {
checkSubMenuId[k]=subMenuItemAccessEntity.getSubMenuItemId().getId().toString();
checkSubMenuId[k] = subMenuItemAccessEntity.getSubMenuItemId().getId().toString();
k++; k++;
} }
List<SubMenuItemEntity> getMenuSubItems = subMenuItemRepository.getSubMenuItemByMenuItemIdAccess(menuItem.getId(),checkSubMenuId);
List<SubMenuItemEntity> getMenuSubItems = subMenuItemRepository
.getSubMenuItemByMenuItemIdAccess(menuItem.getId(), checkSubMenuId);
String subSubMenuHTML = ""; String subSubMenuHTML = "";
for (SubMenuItemEntity subMenuItem : getMenuSubItems) { for (SubMenuItemEntity subMenuItem : getMenuSubItems) {
String target = ""; String target = "";
System.err.println(subMenuItem.getExtenalLink());
if(subMenuItem.getExtenalLink()) {
// System.err.println(subMenuItem.getExtenalLink());
if (subMenuItem.getExtenalLink()) {
target = " target=\"_blank\""; target = " target=\"_blank\"";
subSubMenuHTML = subSubMenuHTML+"<a href=\""+subMenuItem.getUrl()+"\" class=\"menu-item\""+target+"><i class=\""+subMenuItem.getIcon()+"\"></i><span>"+subMenuItem.getName()+"</span></a>";
subSubMenuHTML = subSubMenuHTML + "<a href=\"" + subMenuItem.getUrl()
+ "\" class=\"menu-item\"" + target + "><i class=\"" + subMenuItem.getIcon()
+ "\"></i><span>" + subMenuItem.getName() + "</span></a>";
} else {
subSubMenuHTML = subSubMenuHTML + "<a href=\"/gcc/" + subMenuItem.getUrl()
+ "\" class=\"menu-item\"" + target + "><i class=\"" + subMenuItem.getIcon()
+ "\"></i><span>" + subMenuItem.getName() + "</span></a>";
} }
else {
subSubMenuHTML = subSubMenuHTML+"<a href=\"/gcc/"+subMenuItem.getUrl()+"\" class=\"menu-item\""+target+"><i class=\""+subMenuItem.getIcon()+"\"></i><span>"+subMenuItem.getName()+"</span></a>";
} }
}
subMenuHTML = subMenuHTML+"<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i>"+menuItem.getName()+"</a><div class=\"submenu-content\">"+subSubMenuHTML+"</div></div>";
}
else {
subMenuHTML = subMenuHTML+"<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i>"+menuItem.getName()+"</a></div>";
subMenuHTML = subMenuHTML
+ "<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""
+ menuItem.getIcon() + "\"></i>" + menuItem.getName()
+ "</a><div class=\"submenu-content\">" + subSubMenuHTML + "</div></div>";
} else {
subMenuHTML = subMenuHTML
+ "<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""
+ menuItem.getIcon() + "\"></i>" + menuItem.getName() + "</a></div>";
} }
} }
}
else {
if(menuItem.getOrderby()>0) {
subMenuHTML = subMenuHTML+"<a href=\"/gcc/"+menuItem.getUrl()+"\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i><span>"+menuItem.getName()+"</span></a>";
} else {
if (menuItem.getOrderby() > 0) {
subMenuHTML = subMenuHTML + "<a href=\"/gcc/" + menuItem.getUrl()
+ "\" class=\"menu-item\"><i class=\"" + menuItem.getIcon() + "\"></i><span>"
+ menuItem.getName() + "</span></a>";
} }
} }
} }
menuHTML = menuHTML+subMenuHTML+"</div></div>";
menuHTML = menuHTML + subMenuHTML + "</div></div>";
} }
return menuHTML; return menuHTML;

125
src/main/java/in/gov/chennaicorporation/gccoffice/works/controller/MainController.java

@ -28,9 +28,9 @@ public class MainController {
private Map<String, List<String>> zoneWardMap = new HashMap<>(); private Map<String, List<String>> zoneWardMap = new HashMap<>();
@GetMapping({"", "/", "/index", "/dashboard"})
@GetMapping({ "", "/", "/index", "/dashboard" })
public String home(Model model) { public String home(Model model) {
return BasePath+"index";
return BasePath + "index";
} }
@GetMapping("/erp-works-update") // not in use @GetMapping("/erp-works-update") // not in use
@ -40,12 +40,12 @@ public class MainController {
String LoginUserId = LoginUserInfo.getLoginUserId(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId", LoginUserId); model.addAttribute("LoginUserId", LoginUserId);
model.addAttribute("zones", zones); model.addAttribute("zones", zones);
return BasePath+"erp-works-update";
return BasePath + "erp-works-update";
} }
@GetMapping("/nonerp-works-add") @GetMapping("/nonerp-works-add")
public String nonErpCreateRequest(Model model) { public String nonErpCreateRequest(Model model) {
//List<Integer> zones = new ArrayList<>();
// List<Integer> zones = new ArrayList<>();
List<String> zones = new ArrayList<>(zoneWardMap.keySet()); List<String> zones = new ArrayList<>(zoneWardMap.keySet());
System.out.println("zones: " + zones); System.out.println("zones: " + zones);
@ -56,14 +56,14 @@ public class MainController {
model.addAttribute("LoginUserId", LoginUserId); model.addAttribute("LoginUserId", LoginUserId);
model.addAttribute("zones", zones); model.addAttribute("zones", zones);
return BasePath+"non-erp-works-add";
return BasePath + "non-erp-works-add";
} }
public MainController() { public MainController() {
zoneWardMap.put("00", generateWardList("000", "000")); zoneWardMap.put("00", generateWardList("000", "000"));
zoneWardMap.put("01", generateWardList("001", "014")); 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("04", generateWardList("034", "048"));
zoneWardMap.put("05", generateWardList("049", "063")); zoneWardMap.put("05", generateWardList("049", "063"));
zoneWardMap.put("06", generateWardList("064", "078")); zoneWardMap.put("06", generateWardList("064", "078"));
@ -93,35 +93,36 @@ public class MainController {
public List<String> getWards(@RequestParam String zone) { public List<String> getWards(@RequestParam String zone) {
return zoneWardMap.getOrDefault(zone, Collections.emptyList()); return zoneWardMap.getOrDefault(zone, Collections.emptyList());
} }
//ak
// ak
@GetMapping("/erpworkslist") // To diplay updated ERP works @GetMapping("/erpworkslist") // To diplay updated ERP works
public String worksList(Model model) { public String worksList(Model model) {
//List<Integer> zones = new ArrayList<>(zoneWardMap.keySet());
// List<Integer> zones = new ArrayList<>(zoneWardMap.keySet());
String LoginUserId = LoginUserInfo.getLoginUserId(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
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 @GetMapping("/erpworkslist_report") // To diplay updated ERP works
public String erpworkslist_report(Model model) { public String erpworkslist_report(Model model) {
//List<Integer> zones = new ArrayList<>(zoneWardMap.keySet());
// List<Integer> zones = new ArrayList<>(zoneWardMap.keySet());
String LoginUserId = LoginUserInfo.getLoginUserId(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
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 @GetMapping("/nonerpworkslist") // To display updated Non-ERP Works
@ -129,13 +130,13 @@ public class MainController {
List<String> zones = new ArrayList<>(zoneWardMap.keySet()); List<String> zones = new ArrayList<>(zoneWardMap.keySet());
String LoginUserId = LoginUserInfo.getLoginUserId(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
model.addAttribute("LoginUserId", LoginUserId);
List<Map<String, Object>> workDetails = estimateService.getAllNonERPWorks(LoginUserId); List<Map<String, Object>> workDetails = estimateService.getAllNonERPWorks(LoginUserId);
model.addAttribute("workDetails", workDetails); model.addAttribute("workDetails", workDetails);
model.addAttribute("zones", zones); model.addAttribute("zones", zones);
return BasePath+"nonerpworkslist";
return BasePath + "nonerpworkslist";
} }
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
@ -145,70 +146,70 @@ public class MainController {
List<String> zones = new ArrayList<>(zoneWardMap.keySet()); List<String> zones = new ArrayList<>(zoneWardMap.keySet());
String LoginUserId = LoginUserInfo.getLoginUserId(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
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); model.addAttribute("zones", zones);
return BasePath+"erp-works-list";
return BasePath + "erp-works-list";
} }
@GetMapping("/view-works-details-modal") @GetMapping("/view-works-details-modal")
public String worksViewModal(Model model,@RequestParam(value="estid", required = false) String estid) {
System.out.println("EST ID: "+estid);
public String worksViewModal(Model model, @RequestParam(value = "estid", required = false) String estid) {
System.out.println("EST ID: " + estid);
String LoginUserId = LoginUserInfo.getLoginUserId(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
model.addAttribute("estid",estid);
return BasePath+"works_details_view_modal_page";
model.addAttribute("LoginUserId", LoginUserId);
model.addAttribute("estid", estid);
return BasePath + "works_details_view_modal_page";
} }
@GetMapping("/update-works-details-modal") @GetMapping("/update-works-details-modal")
public String worksUpdateModal(Model model,@RequestParam(value="estid", required = false) String estid) {
System.out.println("EST ID: "+estid);
public String worksUpdateModal(Model model, @RequestParam(value = "estid", required = false) String estid) {
System.out.println("EST ID: " + estid);
String LoginUserId = LoginUserInfo.getLoginUserId(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
model.addAttribute("estid",estid);
return BasePath+"works_details_update_modal_page";
model.addAttribute("LoginUserId", LoginUserId);
model.addAttribute("estid", estid);
return BasePath + "works_details_update_modal_page";
} }
@GetMapping("/user-view-works-details-modal") @GetMapping("/user-view-works-details-modal")
public String userworksViewModal(Model model,@RequestParam(value="estid", required = false) String estid) {
System.out.println("EST ID: "+estid);
public String userworksViewModal(Model model, @RequestParam(value = "estid", required = false) String estid) {
System.out.println("EST ID: " + estid);
String LoginUserId = LoginUserInfo.getLoginUserId(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
model.addAttribute("estid",estid);
return BasePath+"user_works_details_view_modal_page";
model.addAttribute("LoginUserId", LoginUserId);
model.addAttribute("estid", estid);
return BasePath + "user_works_details_view_modal_page";
} }
@GetMapping("/user-update-works-details-modal") @GetMapping("/user-update-works-details-modal")
public String userworksUpdateModal(Model model,@RequestParam(value="estid", required = false) String estid) {
System.out.println("EST ID: "+estid);
public String userworksUpdateModal(Model model, @RequestParam(value = "estid", required = false) String estid) {
System.out.println("EST ID: " + estid);
String LoginUserId = LoginUserInfo.getLoginUserId(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
model.addAttribute("estid",estid);
return BasePath+"user_works_details_update_modal_page";
model.addAttribute("LoginUserId", LoginUserId);
model.addAttribute("estid", estid);
return BasePath + "user_works_details_update_modal_page";
} }
@GetMapping("/update_works_stage_modal") @GetMapping("/update_works_stage_modal")
public String updateWorksStageModal(Model model,@RequestParam(value="estid", required = false) String estid) {
System.out.println("EST ID: "+estid);
public String updateWorksStageModal(Model model, @RequestParam(value = "estid", required = false) String estid) {
System.out.println("EST ID: " + estid);
String LoginUserId = LoginUserInfo.getLoginUserId(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
model.addAttribute("estid",estid);
return BasePath+"update_works_stage_modal";
model.addAttribute("LoginUserId", LoginUserId);
model.addAttribute("estid", estid);
return BasePath + "update_works_stage_modal";
} }
@GetMapping("/edit_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);
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(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
model.addAttribute("estid",estid);
model.addAttribute("tmid",tmid);
return BasePath+"edit_stage_modal";
model.addAttribute("LoginUserId", LoginUserId);
model.addAttribute("estid", estid);
model.addAttribute("tmid", tmid);
return BasePath + "edit_stage_modal";
} }
@GetMapping("/update_project_status") @GetMapping("/update_project_status")
@ -217,9 +218,9 @@ public class MainController {
model.addAttribute("projects", projectList); model.addAttribute("projects", projectList);
String LoginUserId = LoginUserInfo.getLoginUserId(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
model.addAttribute("LoginUserId", LoginUserId);
return BasePath+"project_status_update";
return BasePath + "project_status_update";
} }
} }

258
src/main/resources/templates/modules/works/non-erp-works-add.html

@ -1,17 +1,18 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" dir=""> <html lang="en" dir="">
<html xmlns:th="http://www.thymeleaf.org"> <html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head> <head th:replace="~{fragments/modules/base/head :: head}"></head>
<body> <body>
<link rel="stylesheet" type="text/css"
href="node_modules/jquery.datetimepicker/jquery.datetimepicker.css">
<link rel="stylesheet" type="text/css" href="node_modules/jquery.datetimepicker/jquery.datetimepicker.css">
<!--[if lt IE 8]>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade
your browser</a> to improve your experience.</p> your browser</a> to improve your experience.</p>
<![endif]--> <![endif]-->
<div class="wrapper">
<div class="wrapper">
<!-- header top menu Start --> <!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header> <header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end --> <!-- header top menu end -->
@ -36,8 +37,7 @@
<div class="col-lg-4"> <div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb"> <nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index"><i
class="ik ik-home"></i></a></li>
<li class="breadcrumb-item"><a href="index"><i class="ik ik-home"></i></a></li>
<li class="breadcrumb-item" aria-current="page">Works <li class="breadcrumb-item" aria-current="page">Works
Module Module
</li> </li>
@ -56,8 +56,7 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="card"> <div class="card">
<form class="non-erp-form" id="non-erp-form" method="post" <form class="non-erp-form" id="non-erp-form" method="post"
onsubmit="return savenonERPform();"
enctype="multipart/form-data">
onsubmit="return savenonERPform();" enctype="multipart/form-data">
<div class="card-header"> <div class="card-header">
<h3>Non ERP - Add Form</h3> <h3>Non ERP - Add Form</h3>
</div> </div>
@ -76,18 +75,15 @@
autocomplete="off" required readonly> autocomplete="off" required readonly>
</div>--> </div>-->
<div class="col-md-4"> <div class="col-md-4">
<label for="estdate">Estimate Date <font
style="color: red">*</font></label> <input type="text"
class="form-control"
name="estdate"
id="estdate"
placeholder="Estimate Date"
autocomplete="off"
<label for="estdate">Estimate Date <font style="color: red">*</font>
</label> <input type="text" class="form-control" name="estdate"
id="estdate" placeholder="Estimate Date" autocomplete="off"
required> required>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<label for="zone">Zone <font style="color: red">*</font></label> <label for="zone">Zone <font style="color: red">*</font></label>
<select class="form-control" id="zone" name="zone" onchange="loadWards()" required>
<select class="form-control" id="zone" name="zone"
onchange="loadWards()" required>
<option value="" disabled selected>Select Zone</option> <option value="" disabled selected>Select Zone</option>
<option value="00">00</option> <option value="00">00</option>
<option value="01">01</option> <option value="01">01</option>
@ -116,13 +112,9 @@
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="estdate">File Nummber: <font
style="color: red">*</font></label> <input type="text"
class="form-control"
name="filenumber"
id="filenumber"
placeholder="File Number"
autocomplete="off"
<label for="estdate">File Nummber: <font style="color: red">*</font>
</label> <input type="text" class="form-control" name="filenumber"
id="filenumber" placeholder="File Number" autocomplete="off"
required> required>
</div> </div>
<!-- vishnuchange --> <!-- vishnuchange -->
@ -134,16 +126,15 @@
<div class="col-md-8"> <div class="col-md-8">
<label for="projectname">Project Description <font <label for="projectname">Project Description <font
style="color: red">*</font></label> style="color: red">*</font></label>
<textarea class="form-control" name="projectname"
id="projectname" placeholder="Project Description"
autocomplete="off" required></textarea>
<textarea class="form-control" name="projectname" id="projectname"
placeholder="Project Description" autocomplete="off"
required></textarea>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="location">Location <font
style="color: red">*</font></label>
<textarea class="form-control" name="location"
id="location" placeholder="Location" autocomplete="off"
required></textarea>
<label for="location">Location <font style="color: red">*</font>
</label>
<textarea class="form-control" name="location" id="location"
placeholder="Location" autocomplete="off" required></textarea>
</div> </div>
</div> </div>
@ -155,11 +146,9 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<label for="department">Department <font
style="color: red">*</font></label> <select class="form-control"
id="department"
name="department"
required>
<label for="department">Department <font style="color: red">*</font>
</label> <select class="form-control" id="department"
name="department" required>
<option value="" disabled selected>Select <option value="" disabled selected>Select
Department Department
</option> </option>
@ -168,23 +157,15 @@
<div class="col-md-4"> <div class="col-md-4">
<label for="contractorname">Contractor Name <font <label for="contractorname">Contractor Name <font
style="color: red">*</font></label> <input type="text" style="color: red">*</font></label> <input type="text"
class="form-control"
name="contractorname"
id="contractorname"
placeholder="Contractor Name"
autocomplete="off"
required>
class="form-control" name="contractorname" id="contractorname"
placeholder="Contractor Name" autocomplete="off" required>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="contractorperiod">Contractor Period <font <label for="contractorperiod">Contractor Period <font
style="color: red">*</font></label> <input type="number" style="color: red">*</font></label> <input type="number"
class="form-control"
name="contractorperiod"
id="contractorperiod"
placeholder="Contractor Period"
autocomplete="off"
required step="1"
min="0">
class="form-control" name="contractorperiod"
id="contractorperiod" placeholder="Contractor Period"
autocomplete="off" required step="1" min="0">
</div> </div>
</div> </div>
@ -197,10 +178,8 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<label for="fundsource">Details Source of Fund <font <label for="fundsource">Details Source of Fund <font
style="color: red">*</font></label> <select class="form-control"
id="fundsource"
name="fundsource"
required>
style="color: red">*</font></label> <select
class="form-control" id="fundsource" name="fundsource" required>
<option value="" disabled selected>Select Source <option value="" disabled selected>Select Source
of Fund of Fund
</option> </option>
@ -208,16 +187,13 @@
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="scheme">Scheme<font style="color: red">*</font></label> <label for="scheme">Scheme<font style="color: red">*</font></label>
<select class="form-control" id="scheme" name="scheme"
required>
<select class="form-control" id="scheme" name="scheme" required>
<option value="" disabled selected>Select Scheme</option> <option value="" disabled selected>Select Scheme</option>
</select> </select>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="category">Category<font
style="color: red">*</font></label> <select class="form-control"
id="category"
name="category"
<label for="category">Category<font style="color: red">*</font>
</label> <select class="form-control" id="category" name="category"
required> required>
<option value="" disabled selected>Select <option value="" disabled selected>Select
Category Category
@ -228,26 +204,19 @@
<br> <br>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<label for="subcategory">Sub-Category<font
style="color: red">*</font></label> <select class="form-control"
id="subcategory"
name="subcategory"
required>
<label for="subcategory">Sub-Category<font style="color: red">*
</font></label> <select class="form-control" id="subcategory"
name="subcategory" required>
<option value="" disabled selected>Select <option value="" disabled selected>Select
SubCategory SubCategory
</option> </option>
</select> </select>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="estamount">Estimation Amount<font
style="color: red">*</font></label> <input type="number"
class="form-control"
name="estamount"
id="estamount"
placeholder="Estimation Amount"
autocomplete="off"
required step="1"
min="0">
<label for="estamount">Estimation Amount<font style="color: red">*
</font></label> <input type="number" class="form-control"
name="estamount" id="estamount" placeholder="Estimation Amount"
autocomplete="off" required step="1" min="0">
</div> </div>
</div> </div>
<br> <br>
@ -257,8 +226,10 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<label for="projecttype">Project Type:<font style="color:red">*</font></label>
<select name="projecttype" id="projecttype" class="form-control" style="width: 100%;" required>
<label for="projecttype">Project Type:<font style="color:red">*
</font></label>
<select name="projecttype" id="projecttype" class="form-control"
style="width: 100%;" required>
<option value="" selected>Select</option> <option value="" selected>Select</option>
<option value="1">Capital</option> <option value="1">Capital</option>
<option value="2">Maintenance</option> <option value="2">Maintenance</option>
@ -267,8 +238,10 @@
</select> </select>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="govtfund">Govt. Funded Project:<font style="color:red">*</font></label>
<select name="govtfund" id="govtfund" class="form-control" style="width: 100%;" required>
<label for="govtfund">Govt. Funded Project:<font style="color:red">*
</font></label>
<select name="govtfund" id="govtfund" class="form-control"
style="width: 100%;" required>
<option value="" selected>Select</option> <option value="" selected>Select</option>
<option value="1">Yes</option> <option value="1">Yes</option>
<option value="0">No</option> <option value="0">No</option>
@ -276,8 +249,10 @@
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="specialcat">Special Category:<font style="color:red">*</font></label>
<select name="specialcat" id="specialcat" class="form-control" style="width: 100%;" required>
<label for="specialcat">Special Category:<font style="color:red">*
</font></label>
<select name="specialcat" id="specialcat" class="form-control"
style="width: 100%;" required>
<option value="" selected>Select</option> <option value="" selected>Select</option>
<option value="1">Yes</option> <option value="1">Yes</option>
<option value="0">No</option> <option value="0">No</option>
@ -293,11 +268,11 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<label for="techsanctiondate">Tech Sanction Date<!-- <font style="color:red">*</font> --></label>
<input
type="text" class="form-control" name="techsanctiondate"
<label for="techsanctiondate">Tech Sanction
Date<!-- <font style="color:red">*</font> --></label>
<input type="text" class="form-control" name="techsanctiondate"
id="techsanctiondate" placeholder="Tech Sanction Date" id="techsanctiondate" placeholder="Tech Sanction Date"
autocomplete="off" required>
autocomplete="off">
</div> </div>
<div class="col-md-8"></div> <div class="col-md-8"></div>
</div> </div>
@ -306,32 +281,32 @@
<div class="col-md-4"> <div class="col-md-4">
<label for="adminsanctiondate">Admin Sanction Date <label for="adminsanctiondate">Admin Sanction Date
<!-- <font style="color:red">*</font> --></label> <!-- <font style="color:red">*</font> --></label>
<input type="text" class="form-control"
name="adminsanctiondate" id="adminsanctiondate"
placeholder="Admin Sanction Date" autocomplete="off"
required>
<input type="text" class="form-control" name="adminsanctiondate"
id="adminsanctiondate" placeholder="Admin Sanction Date"
autocomplete="off">
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<label for="adminsanctionfile">Admin Sanction File<!-- <font style="color:red">*</font> --></label>
<label for="adminsanctionfile">Admin Sanction
File<!-- <font style="color:red">*</font> --></label>
<input name="adminsanctionfile" id="adminsanctionfile" <input name="adminsanctionfile" id="adminsanctionfile"
class="form-control" type="file" capture="camera" class="form-control" type="file" capture="camera"
accept="application/pdf, image/*" required>
accept="application/pdf, image/*">
</div> </div>
</div> </div>
<br> <br>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<label for="tendercalldate">Tender Called Date<!-- <font style="color:red">*</font> --></label>
<label for="tendercalldate">Tender Called
Date<!-- <font style="color:red">*</font> --></label>
<input type="text" class="form-control" name="tendercalldate" <input type="text" class="form-control" name="tendercalldate"
id="tendercalldate" placeholder="Tender Called Date" id="tendercalldate" placeholder="Tender Called Date"
autocomplete="off"> autocomplete="off">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="tenderfinalizeddate">Tender Finalized Date <!-- <font style="color:red">*</font> --></label>
<input type="text" class="form-control"
name="tenderfinalizeddate"
id="tenderfinalizeddate"
placeholder="Tender Finalized Date"
<label for="tenderfinalizeddate">Tender Finalized Date
<!-- <font style="color:red">*</font> --></label>
<input type="text" class="form-control" name="tenderfinalizeddate"
id="tenderfinalizeddate" placeholder="Tender Finalized Date"
autocomplete="off"> autocomplete="off">
</div> </div>
</div> </div>
@ -344,52 +319,49 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<label for="loadate">LOA Date<!-- <font style="color:red">*</font> --></label>
<input type="text"
class="form-control"
name="loadate"
id="loadate"
placeholder="LOA Date"
autocomplete="off">
<label for="loadate">LOA
Date<!-- <font style="color:red">*</font> --></label>
<input type="text" class="form-control" name="loadate" id="loadate"
placeholder="LOA Date" autocomplete="off">
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<label for="loafile">LOA File<!-- <font style="color:red">*</font> --></label>
<input
name="loafile" id="loafile" class="form-control"
type="file" capture="camera"
accept="application/pdf, image/*" >
<label for="loafile">LOA
File<!-- <font style="color:red">*</font> --></label>
<input name="loafile" id="loafile" class="form-control" type="file"
capture="camera" accept="application/pdf, image/*">
</div> </div>
</div> </div>
<br> <br>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<label for="agreementdate">Agreement Date<!-- <font style="color:red">*</font> --></label> <input
<label for="agreementdate">Agreement
Date<!-- <font style="color:red">*</font> --></label> <input
type="text" class="form-control" name="agreementdate" type="text" class="form-control" name="agreementdate"
id="agreementdate" placeholder="Agreement Date" id="agreementdate" placeholder="Agreement Date"
autocomplete="off"> autocomplete="off">
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<label for="agreementfile">Agreement File<!-- <font style="color:red">*</font> --></label> <input
name="agreementfile" id="agreementfile"
class="form-control" type="file" capture="camera"
accept="application/pdf, image/*" >
<label for="agreementfile">Agreement
File<!-- <font style="color:red">*</font> --></label> <input
name="agreementfile" id="agreementfile" class="form-control"
type="file" capture="camera" accept="application/pdf, image/*">
</div> </div>
</div> </div>
<br> <br>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<label for="workorderdate">Work Order Date<!-- <font style="color:red">*</font> --></label> <input
<label for="workorderdate">Work Order
Date<!-- <font style="color:red">*</font> --></label> <input
type="text" class="form-control" name="workorderdate" type="text" class="form-control" name="workorderdate"
id="workorderdate" placeholder="Sub-Category" id="workorderdate" placeholder="Sub-Category"
autocomplete="off" >
autocomplete="off">
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<label for="workorderfile">Work Order File <label for="workorderfile">Work Order File
<!-- <font style="color:red">*</font> --></label> <input <!-- <font style="color:red">*</font> --></label> <input
name="workorderfile" id="workorderfile"
class="form-control" type="file" capture="camera"
accept="application/pdf, image/*" >
name="workorderfile" id="workorderfile" class="form-control"
type="file" capture="camera" accept="application/pdf, image/*">
</div> </div>
</div> </div>
<br> <br>
@ -397,16 +369,18 @@
<div class="col-md-4"> <div class="col-md-4">
<label for="workcommenceddate">Work Commenced Date <label for="workcommenceddate">Work Commenced Date
<!-- <font style="color:red">*</font> --></label> <!-- <font style="color:red">*</font> --></label>
<input type="text" class="form-control"
name="workcommenceddate" id="workcommenceddate"
placeholder="Work Commenced Date" autocomplete="off" >
<input type="text" class="form-control" name="workcommenceddate"
id="workcommenceddate" placeholder="Work Commenced Date"
autocomplete="off">
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<label for="ward"><font style="color: red"> </font></label>
<label for="ward">
<font style="color: red"> </font>
</label>
<div style="padding: 10px; font-size: 1.2rem;"> <div style="padding: 10px; font-size: 1.2rem;">
<input type="hidden" id="iconicProjectHidden" name="iconicProject"
value="0">
<input type="hidden" id="iconicProjectHidden"
name="iconicProject" value="0">
<input type="checkbox" id="iconicProject" name="iconicProject" <input type="checkbox" id="iconicProject" name="iconicProject"
value="1" style="width: 20px; height: 20px;"> value="1" style="width: 20px; height: 20px;">
<label for="iconicProject" style="font-size: 1.2rem;">Iconic <label for="iconicProject" style="font-size: 1.2rem;">Iconic
@ -414,15 +388,14 @@
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="Reason">Select Reason:</label><font
style="color: red">*</font>
<label for="Reason">Select Reason:</label>
<font style="color: red">*</font>
<select id="Reason" name="reason" class="form-control" required> <select id="Reason" name="reason" class="form-control" required>
<option value=""></option> <option value=""></option>
</select> </select>
</div> </div>
<div class="col-md-4" id="remarksContainer"
style="display: none;">
<div class="col-md-4" id="remarksContainer" style="display: none;">
<label for="remarks">Remarks</label> <label for="remarks">Remarks</label>
<textarea class="form-control" id="remarks" name="remarks" <textarea class="form-control" id="remarks" name="remarks"
placeholder="Enter remarks if needed" required></textarea> placeholder="Enter remarks if needed" required></textarea>
@ -434,8 +407,7 @@
<button type="reset" class="btn btn-secondary mr-2"> <button type="reset" class="btn btn-secondary mr-2">
<i class="ik ik-refresh-cw"></i>Reset <i class="ik ik-refresh-cw"></i>Reset
</button> </button>
<button type="submit" class="btn btn-success"
id="requestSubmitBtn">
<button type="submit" class="btn btn-success" id="requestSubmitBtn">
<i class="ik ik-save"></i>Save <i class="ik ik-save"></i>Save
</button> </button>
</div> </div>
@ -450,20 +422,19 @@
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div> </div>
</div>
</div>
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script th:replace="~{fragments/modules/base/script :: script}"></script>
<script src="node_modules/jquery.mask/1.14.16/jquery.mask.min.js"></script>
<script src="node_modules/amcharts3/amcharts/amcharts.js"></script>
<script src="node_modules/amcharts3/amcharts/serial.js"></script>
<script src="node_modules/amcharts3/amcharts/themes/light.js"></script>
<script
src="node_modules/jquery.datetimepicker/jquery.datetimepicker.full.min.js"></script>
<script th:inline="javascript">
<script th:replace="~{fragments/modules/base/script :: script}"></script>
<script src="node_modules/jquery.mask/1.14.16/jquery.mask.min.js"></script>
<script src="node_modules/amcharts3/amcharts/amcharts.js"></script>
<script src="node_modules/amcharts3/amcharts/serial.js"></script>
<script src="node_modules/amcharts3/amcharts/themes/light.js"></script>
<script src="node_modules/jquery.datetimepicker/jquery.datetimepicker.full.min.js"></script>
<script th:inline="javascript">
var loginUserID = /*[[${LoginUserId}]]*/''; var loginUserID = /*[[${LoginUserId}]]*/'';
$(document).ready(function () { $(document).ready(function () {
// Input masking for the desired format // Input masking for the desired format
@ -551,8 +522,8 @@
}); });
</script>
<script>
</script>
<script>
function validateDateFormat(dateStr) { function validateDateFormat(dateStr) {
// Regex to validate date in dd-mm-yyyy format // Regex to validate date in dd-mm-yyyy format
@ -970,6 +941,7 @@
</script>
</script>
</body> </body>
</html> </html>
Loading…
Cancel
Save