feat: Ship Last Postion Update Job Modify #5
@ -432,14 +432,6 @@ export const batchApi = {
|
|||||||
resetCollectionPeriod: (apiKey: string) =>
|
resetCollectionPeriod: (apiKey: string) =>
|
||||||
postJson<{ success: boolean; message: string }>(`${BASE}/collection-periods/${apiKey}/reset`),
|
postJson<{ success: boolean; message: string }>(`${BASE}/collection-periods/${apiKey}/reset`),
|
||||||
|
|
||||||
updateCollectionPeriod: (apiKey: string, body: { rangeFromDate: string; rangeToDate: string }) => {
|
updateCollectionPeriod: (apiKey: string, body: { rangeFromDate: string; rangeToDate: string }) =>
|
||||||
return fetch(`${BASE}/collection-periods/${apiKey}`, {
|
postJson<{ success: boolean; message: string }>(`${BASE}/collection-periods/${apiKey}/update`, body),
|
||||||
method: 'PUT',
|
|
||||||
headers: { 'Content-Type': 'application/json' },
|
|
||||||
body: JSON.stringify(body),
|
|
||||||
}).then(async (res) => {
|
|
||||||
if (!res.ok) throw new Error(`API Error: ${res.status} ${res.statusText}`);
|
|
||||||
return res.json() as Promise<{ success: boolean; message: string }>;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -523,7 +523,7 @@ public class BatchController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "수집 기간 수정", description = "특정 API의 수집 기간을 수정합니다")
|
@Operation(summary = "수집 기간 수정", description = "특정 API의 수집 기간을 수정합니다")
|
||||||
@PutMapping("/collection-periods/{apiKey}")
|
@PostMapping("/collection-periods/{apiKey}/update")
|
||||||
public ResponseEntity<Map<String, Object>> updateCollectionPeriod(
|
public ResponseEntity<Map<String, Object>> updateCollectionPeriod(
|
||||||
@Parameter(description = "API Key") @PathVariable String apiKey,
|
@Parameter(description = "API Key") @PathVariable String apiKey,
|
||||||
@RequestBody Map<String, String> request) {
|
@RequestBody Map<String, String> request) {
|
||||||
|
|||||||
@ -13,7 +13,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
public class WebViewController {
|
public class WebViewController {
|
||||||
|
|
||||||
@GetMapping({"/", "/jobs", "/executions", "/executions/{id:\\d+}",
|
@GetMapping({"/", "/jobs", "/executions", "/executions/{id:\\d+}",
|
||||||
"/execution-detail", "/schedules", "/schedule-timeline"})
|
"/recollects", "/recollects/{id:\\d+}",
|
||||||
|
"/schedules", "/schedule-timeline"})
|
||||||
public String forward() {
|
public String forward() {
|
||||||
return "forward:/index.html";
|
return "forward:/index.html";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ public class ShipLastPositionUpdateJobConfig extends BaseJobConfig<TargetEnhance
|
|||||||
|
|
||||||
private final ShipLastPositionDataWriter shipLastPositionDataWriter;
|
private final ShipLastPositionDataWriter shipLastPositionDataWriter;
|
||||||
|
|
||||||
@Value("${app.batch.target-schema.name}")
|
@Value("${app.batch.service-schema.name}")
|
||||||
private String targetSchema;
|
private String targetSchema;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -47,11 +47,11 @@ public class ShipLastPositionDataReader extends BaseApiReader<TargetEnhancedDto>
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String getTargetTable(){
|
private String getTargetTable(){
|
||||||
return targetSchema + ".core20";
|
return targetSchema + ".tb_ship_main_info";
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getImoQuery() {
|
private String getImoQuery() {
|
||||||
return "SELECT lrno FROM " + getTargetTable() + " ORDER BY lrno";
|
return "SELECT imo_no FROM " + getTargetTable() + " ORDER BY imo_no";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -17,10 +17,10 @@ import java.util.List;
|
|||||||
@Repository("shipLastPositionRepository")
|
@Repository("shipLastPositionRepository")
|
||||||
public class ShipLastPositionRepositoryImpl extends BaseJdbcRepository<TargetEnhancedEntity, Long> implements ShipLastPositionRepository {
|
public class ShipLastPositionRepositoryImpl extends BaseJdbcRepository<TargetEnhancedEntity, Long> implements ShipLastPositionRepository {
|
||||||
|
|
||||||
@Value("${app.batch.target-schema.name}")
|
@Value("${app.batch.service-schema.name}")
|
||||||
private String targetSchema;
|
private String targetSchema;
|
||||||
|
|
||||||
@Value("${app.batch.target-schema.tables.ship-027}")
|
@Value("${app.batch.service-schema.tables.service-001}")
|
||||||
private String tableName;
|
private String tableName;
|
||||||
|
|
||||||
public ShipLastPositionRepositoryImpl(JdbcTemplate jdbcTemplate) {
|
public ShipLastPositionRepositoryImpl(JdbcTemplate jdbcTemplate) {
|
||||||
@ -56,21 +56,21 @@ public class ShipLastPositionRepositoryImpl extends BaseJdbcRepository<TargetEnh
|
|||||||
protected String getUpdateSql() {
|
protected String getUpdateSql() {
|
||||||
return """
|
return """
|
||||||
UPDATE %s
|
UPDATE %s
|
||||||
SET lastseen = ?::timestamptz,
|
SET last_cptr_hr_utc = ?::timestamptz,
|
||||||
lastport = ?,
|
last_port = ?,
|
||||||
position_latitude = ?,
|
now_position_lat = ?,
|
||||||
position_longitude = ?,
|
now_position_lon = ?,
|
||||||
destination = ?,
|
ship_dest = ?,
|
||||||
eta = ?::timestamptz,
|
arvl_prnmnt_hr = ?::timestamptz,
|
||||||
heading = ?,
|
bow_drctn = ?,
|
||||||
speedservice = ?,
|
|
||||||
cog = ?,
|
cog = ?,
|
||||||
navstat = ?,
|
sog = ?,
|
||||||
tonnes_cargo = ?,
|
ship_nav_status = ?,
|
||||||
extra_info = ?,
|
cargo_ton = ?,
|
||||||
|
add_info = ?,
|
||||||
in_sts = ?,
|
in_sts = ?,
|
||||||
on_berth = ?
|
ancrg_yn = ?
|
||||||
WHERE lrno = ?;
|
WHERE imo_no = ?;
|
||||||
""".formatted(getTableName());
|
""".formatted(getTableName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -145,8 +145,11 @@ app:
|
|||||||
risk-compliance-001: tb_ship_risk_info
|
risk-compliance-001: tb_ship_risk_info
|
||||||
risk-compliance-002: tb_ship_compliance_info
|
risk-compliance-002: tb_ship_compliance_info
|
||||||
risk-compliance-003: tb_company_compliance_info
|
risk-compliance-003: tb_company_compliance_info
|
||||||
ship-027: core20
|
|
||||||
ship-028: ship_detail_hash_json
|
ship-028: ship_detail_hash_json
|
||||||
|
service-schema:
|
||||||
|
name: t_std_snp_svc
|
||||||
|
tables:
|
||||||
|
service-001: tb_ship_main_info
|
||||||
api:
|
api:
|
||||||
url: https://api.example.com/data
|
url: https://api.example.com/data
|
||||||
timeout: 30000
|
timeout: 30000
|
||||||
|
|||||||
불러오는 중...
Reference in New Issue
Block a user