feat: Ship Last Postion Update Job Modify #5

병합
HYOJIN feature/last_position_update 에서 develop 로 1 commits 를 머지했습니다 2026-02-23 17:28:18 +09:00
7개의 변경된 파일27개의 추가작업 그리고 31개의 파일을 삭제
Showing only changes of commit c880b749c4 - Show all commits

파일 보기

@ -432,14 +432,6 @@ export const batchApi = {
resetCollectionPeriod: (apiKey: string) =>
postJson<{ success: boolean; message: string }>(`${BASE}/collection-periods/${apiKey}/reset`),
updateCollectionPeriod: (apiKey: string, body: { rangeFromDate: string; rangeToDate: string }) => {
return fetch(`${BASE}/collection-periods/${apiKey}`, {
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 }>;
});
},
updateCollectionPeriod: (apiKey: string, body: { rangeFromDate: string; rangeToDate: string }) =>
postJson<{ success: boolean; message: string }>(`${BASE}/collection-periods/${apiKey}/update`, body),
};

파일 보기

@ -523,7 +523,7 @@ public class BatchController {
}
@Operation(summary = "수집 기간 수정", description = "특정 API의 수집 기간을 수정합니다")
@PutMapping("/collection-periods/{apiKey}")
@PostMapping("/collection-periods/{apiKey}/update")
public ResponseEntity<Map<String, Object>> updateCollectionPeriod(
@Parameter(description = "API Key") @PathVariable String apiKey,
@RequestBody Map<String, String> request) {

파일 보기

@ -13,7 +13,8 @@ import org.springframework.web.bind.annotation.GetMapping;
public class WebViewController {
@GetMapping({"/", "/jobs", "/executions", "/executions/{id:\\d+}",
"/execution-detail", "/schedules", "/schedule-timeline"})
"/recollects", "/recollects/{id:\\d+}",
"/schedules", "/schedule-timeline"})
public String forward() {
return "forward:/index.html";
}

파일 보기

@ -31,7 +31,7 @@ public class ShipLastPositionUpdateJobConfig extends BaseJobConfig<TargetEnhance
private final ShipLastPositionDataWriter shipLastPositionDataWriter;
@Value("${app.batch.target-schema.name}")
@Value("${app.batch.service-schema.name}")
private String targetSchema;
@Override

파일 보기

@ -47,11 +47,11 @@ public class ShipLastPositionDataReader extends BaseApiReader<TargetEnhancedDto>
}
private String getTargetTable(){
return targetSchema + ".core20";
return targetSchema + ".tb_ship_main_info";
}
private String getImoQuery() {
return "SELECT lrno FROM " + getTargetTable() + " ORDER BY lrno";
return "SELECT imo_no FROM " + getTargetTable() + " ORDER BY imo_no";
}
@Override

파일 보기

@ -17,10 +17,10 @@ import java.util.List;
@Repository("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;
@Value("${app.batch.target-schema.tables.ship-027}")
@Value("${app.batch.service-schema.tables.service-001}")
private String tableName;
public ShipLastPositionRepositoryImpl(JdbcTemplate jdbcTemplate) {
@ -56,21 +56,21 @@ public class ShipLastPositionRepositoryImpl extends BaseJdbcRepository<TargetEnh
protected String getUpdateSql() {
return """
UPDATE %s
SET lastseen = ?::timestamptz,
lastport = ?,
position_latitude = ?,
position_longitude = ?,
destination = ?,
eta = ?::timestamptz,
heading = ?,
speedservice = ?,
SET last_cptr_hr_utc = ?::timestamptz,
last_port = ?,
now_position_lat = ?,
now_position_lon = ?,
ship_dest = ?,
arvl_prnmnt_hr = ?::timestamptz,
bow_drctn = ?,
cog = ?,
navstat = ?,
tonnes_cargo = ?,
extra_info = ?,
sog = ?,
ship_nav_status = ?,
cargo_ton = ?,
add_info = ?,
in_sts = ?,
on_berth = ?
WHERE lrno = ?;
ancrg_yn = ?
WHERE imo_no = ?;
""".formatted(getTableName());
}

파일 보기

@ -145,8 +145,11 @@ app:
risk-compliance-001: tb_ship_risk_info
risk-compliance-002: tb_ship_compliance_info
risk-compliance-003: tb_company_compliance_info
ship-027: core20
ship-028: ship_detail_hash_json
service-schema:
name: t_std_snp_svc
tables:
service-001: tb_ship_main_info
api:
url: https://api.example.com/data
timeout: 30000