Formulář ag. Služební cesty / Aktuální požadavky
• přidáno textové pole "Cizí osoby" • upraven popisek formuláře • upraven vzhled a zarovnání prvků • přidána kontrola ukazatele při promazávání souborů na disku i v databázi • sjednocena maska pro formátování data v <datebox> closes #197
This commit is contained in:
@@ -1,16 +1,30 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
import info.bukova.isspst.storage.EntityWithAttachment;
|
||||
import org.hibernate.annotations.LazyCollection;
|
||||
import org.hibernate.annotations.LazyCollectionOption;
|
||||
import org.hibernate.search.annotations.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embedded;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.LazyCollection;
|
||||
import org.hibernate.annotations.LazyCollectionOption;
|
||||
import org.hibernate.search.annotations.Analyze;
|
||||
import org.hibernate.search.annotations.Field;
|
||||
import org.hibernate.search.annotations.Index;
|
||||
import org.hibernate.search.annotations.Indexed;
|
||||
import org.hibernate.search.annotations.IndexedEmbedded;
|
||||
|
||||
@Entity
|
||||
@Table(name = "TRIPREQUIREMENT")
|
||||
@Indexed
|
||||
@@ -32,6 +46,11 @@ public class TripRequirement extends RequirementBase implements EntityWithAttach
|
||||
@LazyCollection(LazyCollectionOption.TRUE)
|
||||
@JoinTable(name="TRIPREQUIREMENT_PASSANGER", joinColumns={@JoinColumn(name="TRIPREQUIREMENT_ID")}, inverseJoinColumns={@JoinColumn(name="USER_ID")})
|
||||
private List<User> passengers;
|
||||
|
||||
@Column(name = "FOREIGN_PERSONS")
|
||||
@Field(index = Index.YES, analyze = Analyze.YES)
|
||||
private String foreignPersons;
|
||||
|
||||
@Embedded
|
||||
private Vehicle vehicle;
|
||||
@Column(name = "REQUIRE_DOWN_PAYMENT")
|
||||
@@ -99,6 +118,16 @@ public class TripRequirement extends RequirementBase implements EntityWithAttach
|
||||
this.passengers = passengers;
|
||||
}
|
||||
|
||||
public String getForeignPersons()
|
||||
{
|
||||
return foreignPersons;
|
||||
}
|
||||
|
||||
public void setForeignPersons(String foreignPersons)
|
||||
{
|
||||
this.foreignPersons = foreignPersons;
|
||||
}
|
||||
|
||||
public Vehicle getVehicle() {
|
||||
return vehicle;
|
||||
}
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
package info.bukova.isspst.storage;
|
||||
|
||||
import info.bukova.isspst.dao.QueryDao;
|
||||
import info.bukova.isspst.data.FileContent;
|
||||
import info.bukova.isspst.data.FileMetainfo;
|
||||
import info.bukova.isspst.services.fulltext.Extractor;
|
||||
import info.bukova.isspst.services.fulltext.ExtractorFactory;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SQLQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.*;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*
|
||||
@@ -245,12 +252,17 @@ public class DocumentFileStorageImpl extends AbstractFileStorage<FileMetainfo> i
|
||||
boolean fileExists = false;
|
||||
|
||||
for (FileMetainfo info : infos) {
|
||||
if (info.getContent().getPathInFilesystem().equals(f.getName())) {
|
||||
FileContent fileContent = info.getContent();
|
||||
|
||||
if ((fileContent != null) && f.isFile() && fileContent.getPathInFilesystem().equals(f.getName()))
|
||||
{
|
||||
fileExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!fileExists && f.isFile()) {
|
||||
if (!fileExists && f.isFile())
|
||||
{
|
||||
f.delete();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user