SUPPORT-9484: fix

This commit is contained in:
Eduard Tihomiorv 2025-10-20 13:00:19 +03:00
parent 67001a31d8
commit c38fb71b9b
7 changed files with 43 additions and 13 deletions

View file

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

View file

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

View file

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

View file

@ -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();
}

View file

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

View file

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

View file

@ -1094,9 +1094,17 @@
<entry>
<key>valueFormatter</key>
<value>
<complex>
<entry>
<key>dateFormat</key>
<value>
<simple>"DD.MM.YYYY HH:mm:ss (Z)"</simple>
</value>
</entry>
</complex>
<implRef type="TS">
<className>ClientDateTimeFormatter</className>
<packageName>ervu.component.grid.formatter</packageName>
<className>DateFormatter</className>
<packageName>component.grid.formatters</packageName>
</implRef>
</value>
</entry>
@ -1113,10 +1121,7 @@
<entry>
<key>dataConverter</key>
<value>
<implRef type="JAVA">
<className>LocalDateTimeConverter</className>
<packageName>component.field.dataconvert</packageName>
</implRef>
<implRef/>
</value>
</entry>
<entry>
@ -1150,7 +1155,7 @@
<entry>
<key>type</key>
<value>
<simple>"java.sql.Timestamp"</simple>
<simple>"java.time.ZonedDateTime"</simple>
</value>
</entry>
</complex>
@ -1177,7 +1182,7 @@
<entry>
<key>width</key>
<value>
<simple>120</simple>
<simple>140</simple>
</value>
</entry>
<entry>