SUPPORT-9484: fix
This commit is contained in:
parent
67001a31d8
commit
c38fb71b9b
7 changed files with 43 additions and 13 deletions
|
|
@ -182,7 +182,7 @@ public class EmployeeInfoFileUploadService {
|
|||
fileStatus.setStatus(uploadSuccess ? "Загрузка" : "Невозможно проверить файл ЛК РП");
|
||||
interactionService.setStatus(fileInfo.getFileId(), fileStatus.getStatus(),
|
||||
multipartFile.getOriginalFilename(), employeeInfoFileFormType.getFilePatternCode(),
|
||||
Timestamp.valueOf(now), fio, ervuId
|
||||
Timestamp.valueOf(now), fio, ervuId, offset
|
||||
);
|
||||
|
||||
fileInfo.setFileStatus(fileStatus);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package ru.micord.ervu.journal.mapper;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
import ervu_lkrp_ul.ervu_lkrp_ul.db_beans.public_.tables.records.InteractionLogRecord;
|
||||
import ru.micord.ervu.journal.JournalDto;
|
||||
|
|
@ -14,9 +16,12 @@ public class JournalDtoMapper {
|
|||
public static JournalDto mapToJournalDto(JournalFileInfo journalFileInfo,
|
||||
JournalFileInfo.JournalFileDetails journalFileDetails) {
|
||||
SenderInfo senderInfo = journalFileInfo.getSenderInfo();
|
||||
ZonedDateTime utcZoned = journalFileDetails.getDepartureDateTime().atZone(ZoneOffset.UTC);
|
||||
ZoneOffset offset = ZoneOffset.of(journalFileDetails.getTimeZone());
|
||||
ZonedDateTime zonedDateTime = utcZoned.withZoneSameInstant(offset);
|
||||
return new JournalDto()
|
||||
.setFileId(journalFileDetails.getFileId())
|
||||
.setDepartureDateTime(Timestamp.valueOf(journalFileDetails.getDepartureDateTime()).toString())
|
||||
.setDepartureDateTime(zonedDateTime.toString())
|
||||
.setFileName(journalFileDetails.getFileName())
|
||||
.setFilePatternCode(journalFileDetails.getFilePatternCode())
|
||||
.setSenderFio(convertToFio(senderInfo.getFirstName(), senderInfo.getMiddleName(),
|
||||
|
|
@ -30,8 +35,12 @@ public class JournalDtoMapper {
|
|||
}
|
||||
|
||||
public static JournalDto mapToJournalDto(InteractionLogRecord record) {
|
||||
ZonedDateTime utcZoned = record.getSentDate().toInstant().atZone(ZoneOffset.UTC);
|
||||
//заменит на offset после обновления бинов
|
||||
ZoneOffset offset = ZoneOffset.of(record.getStatus());
|
||||
ZonedDateTime zonedDateTime = utcZoned.withZoneSameInstant(offset);
|
||||
return new JournalDto()
|
||||
.setDepartureDateTime(record.getSentDate().toString())
|
||||
.setDepartureDateTime(zonedDateTime.toString())
|
||||
.setFileName(record.getFileName())
|
||||
.setFilePatternCode(Integer.valueOf(record.getForm()))
|
||||
.setSenderFio(record.getSender())
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public interface InteractionService {
|
|||
|
||||
List<InteractionLogRecord> get(String ervuId, String[] excludedStatuses);
|
||||
|
||||
void setStatus(String fileId, String status, String fileName, String form, Timestamp timestamp, String sender, String ervuId);
|
||||
void setStatus(String fileId, String status, String fileName, String form, Timestamp timestamp, String sender, String ervuId, String offset);
|
||||
|
||||
void updateStatus(String fileId, String status, String ervuId);
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class InteractionServiceImpl implements InteractionService {
|
|||
}
|
||||
|
||||
public void setStatus(String fileId, String status, String fileName, String form,
|
||||
Timestamp timestamp, String sender, String ervuId) {
|
||||
Timestamp timestamp, String sender, String ervuId, String offset) {
|
||||
dslContext.insertInto(INTERACTION_LOG)
|
||||
.set(INTERACTION_LOG.FILE_ID, fileId)
|
||||
.set(INTERACTION_LOG.STATUS, status)
|
||||
|
|
@ -42,6 +42,7 @@ public class InteractionServiceImpl implements InteractionService {
|
|||
.set(INTERACTION_LOG.SENDER, sender)
|
||||
.set(INTERACTION_LOG.FILE_NAME, fileName)
|
||||
.set(INTERACTION_LOG.ERVU_ID, ervuId)
|
||||
//.set(INTERACTION_LOG.OFFSET, offset)
|
||||
.execute();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
|
||||
<changeSet id="001" author="tihomirov">
|
||||
<comment>create offset column in interaction_log table</comment>
|
||||
<addColumn schemaName="public" tableName="interaction_log">
|
||||
<column name="offset" type="varchar(10)"/>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
|
|
@ -8,5 +8,7 @@
|
|||
<include file="2024-08-29--01-create-table-okopf-records.xml" relativeToChangelogFile="true"/>
|
||||
<include file="2024-09-11--01-create-table-interaction-log.xml" relativeToChangelogFile="true"/>
|
||||
<include file="2024-09-18--02-add-shedlock-table.xml" relativeToChangelogFile="true"/>
|
||||
<include file="2025-10-20-create-offset-column.xml" relativeToChangelogFile="true"/>
|
||||
|
||||
|
||||
</databaseChangeLog>
|
||||
Loading…
Add table
Add a link
Reference in a new issue