|
|
|
@ -8,6 +8,8 @@ import java.util.HashMap; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.http.HttpStatus; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
@ -27,6 +29,51 @@ public class GreenCommitteeController { |
|
|
|
@Autowired |
|
|
|
GreenCommitteeService greenCommitteeService; |
|
|
|
|
|
|
|
@GetMapping("/getcompnatureforpublic") |
|
|
|
public ResponseEntity<?> getCompNatureForPublic() { |
|
|
|
try { |
|
|
|
List<Map<String, Object>> list = greenCommitteeService.getCompNatureForPublic(); |
|
|
|
|
|
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
|
response.put("status", "success"); |
|
|
|
response.put("data", list); |
|
|
|
|
|
|
|
return ResponseEntity.ok(response); |
|
|
|
|
|
|
|
} catch (Exception ex) { |
|
|
|
ex.printStackTrace(); |
|
|
|
|
|
|
|
Map<String, Object> error = new HashMap<>(); |
|
|
|
error.put("status", "error"); |
|
|
|
error.put("message", ex.getMessage()); |
|
|
|
|
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/getcompnaturefordept") |
|
|
|
public ResponseEntity<?> getCompNatureForDept() { |
|
|
|
try { |
|
|
|
List<Map<String, Object>> list = greenCommitteeService.getCompNatureForDept(); |
|
|
|
|
|
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
|
response.put("status", "success"); |
|
|
|
response.put("data", list); |
|
|
|
|
|
|
|
return ResponseEntity.ok(response); |
|
|
|
|
|
|
|
} catch (Exception ex) { |
|
|
|
ex.printStackTrace(); |
|
|
|
|
|
|
|
Map<String, Object> error = new HashMap<>(); |
|
|
|
error.put("status", "error"); |
|
|
|
error.put("message", ex.getMessage()); |
|
|
|
|
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getInspectionBy") |
|
|
|
public List<?> getInspectionBy( |
|
|
|
@RequestParam(value = "loginId", required = true) String loginId) { |
|
|
|
|