|
|
@ -17,6 +17,7 @@ import javax.sql.DataSource; |
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Qualifier; |
|
|
import org.springframework.beans.factory.annotation.Qualifier; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.core.env.Environment; |
|
|
import org.springframework.core.env.Environment; |
|
|
import org.springframework.jdbc.core.JdbcTemplate; |
|
|
import org.springframework.jdbc.core.JdbcTemplate; |
|
|
import org.springframework.jdbc.core.PreparedStatementCreator; |
|
|
import org.springframework.jdbc.core.PreparedStatementCreator; |
|
|
@ -34,14 +35,34 @@ public class RegisterService { |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private JdbcTemplate jdbcTemplate; |
|
|
private JdbcTemplate jdbcTemplate; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
@Value("${fileBaseUrl}") |
|
|
|
|
|
|
|
|
|
|
|
private String fileBaseUrl; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private Environment environment; |
|
|
private Environment environment; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private JdbcTemplate roadwarjdbcTemplate; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
public void setDataSource(@Qualifier("mysqlRoadWarDataSource") DataSource dataSource) { |
|
|
public void setDataSource(@Qualifier("mysqlRoadWarDataSource") DataSource dataSource) { |
|
|
this.jdbcTemplate = new JdbcTemplate(dataSource); |
|
|
this.jdbcTemplate = new JdbcTemplate(dataSource); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
public void setDataSource2(@Qualifier("mysqlGccRoadWarSource") DataSource DataSource) { |
|
|
|
|
|
this.roadwarjdbcTemplate = new JdbcTemplate(DataSource); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public RegisterService(Environment environment) { |
|
|
|
|
|
|
|
|
|
|
|
this.environment = environment; |
|
|
|
|
|
|
|
|
|
|
|
this.fileBaseUrl = environment.getProperty("fileBaseUrl"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public List<Map<String, Object>> ViewZoneDropdown() { |
|
|
public List<Map<String, Object>> ViewZoneDropdown() { |
|
|
String sql = "SELECT zone_name " |
|
|
String sql = "SELECT zone_name " |
|
|
@ -397,6 +418,48 @@ public class RegisterService { |
|
|
refid); |
|
|
refid); |
|
|
|
|
|
|
|
|
result.put("relayingDetails", relayingDetails); |
|
|
result.put("relayingDetails", relayingDetails); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> fileDetails =jdbcTemplate.queryForList( |
|
|
|
|
|
"SELECT *, CONCAT('" + fileBaseUrl + "/gccofficialapp/files',file_path) as file_url " |
|
|
|
|
|
+" FROM road_master_files " |
|
|
|
|
|
+ " WHERE road_ref_id = ? AND is_active=1 AND is_delete=0 ", |
|
|
|
|
|
refid); |
|
|
|
|
|
|
|
|
|
|
|
for (Map<String, Object> row : fileDetails) { |
|
|
|
|
|
for (Map.Entry<String, Object> entry : row.entrySet()) { |
|
|
|
|
|
if (entry.getValue() == null) { |
|
|
|
|
|
entry.setValue(""); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result.put("fileDetails", fileDetails); |
|
|
|
|
|
|
|
|
|
|
|
String roadId = String.valueOf(road.get("road_id")); |
|
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> inspectiondetails=roadwarjdbcTemplate.queryForList( |
|
|
|
|
|
"select ssd.road_id,ssd.start_latitude,ssd.start_longitude, CONCAT('" + fileBaseUrl + "/gccofficialapp/files',ssd.start_img) as start_img, " |
|
|
|
|
|
+ "CONCAT('" + fileBaseUrl + "/gccofficialapp/files',csd.centre_img) as centre_img, " |
|
|
|
|
|
+ "CONCAT('" + fileBaseUrl + "/gccofficialapp/files',esd.end_img) as end_img " |
|
|
|
|
|
+ "from start_street_details ssd " |
|
|
|
|
|
+ "left join centre_street_details csd on ssd.road_id = csd.road_id " |
|
|
|
|
|
+ "left join end_street_details esd on ssd.road_id = esd.road_id " |
|
|
|
|
|
+ "where ssd.road_id = ? and ssd.isactive = 1 and ssd.isdelete = 0 limit 1 ", |
|
|
|
|
|
roadId |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
for (Map<String, Object> row : inspectiondetails) { |
|
|
|
|
|
for (Map.Entry<String, Object> entry : row.entrySet()) { |
|
|
|
|
|
if (entry.getValue() == null) { |
|
|
|
|
|
entry.setValue(""); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result.put("inspectiondetails", inspectiondetails); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.put("status", true); |
|
|
result.put("status", true); |
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
|