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개의 파일을 삭제

파일 보기

@ -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