feat: Ship Last Postion Update Job Modify
This commit is contained in:
부모
92152d0c50
커밋
c880b749c4
@ -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
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user