Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 62a88fd045 | |||
| 548386407f |
+1
-1
@@ -7,7 +7,7 @@ nbactions.xml
|
|||||||
*.log
|
*.log
|
||||||
docker.sock
|
docker.sock
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.settings/
|
||||||
.classpath
|
.classpath
|
||||||
.factorypath
|
.factorypath
|
||||||
.settings/
|
|
||||||
.project
|
.project
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import static ch.qos.logback.classic.Level.DEBUG
|
||||||
|
import static ch.qos.logback.classic.Level.INFO
|
||||||
|
import static ch.qos.logback.classic.Level.ALL
|
||||||
|
|
||||||
|
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
|
||||||
|
import ch.qos.logback.core.rolling.RollingFileAppender
|
||||||
|
import ch.qos.logback.core.rolling.TimeBasedRollingPolicy
|
||||||
|
|
||||||
|
import java.nio.charset.Charset
|
||||||
|
|
||||||
|
def patternString = '%d{YYYY-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg %ex{20}%n'
|
||||||
|
def userHome = System.getProperty("user.home")
|
||||||
|
|
||||||
|
appender("applicationLogFile", RollingFileAppender) {
|
||||||
|
rollingPolicy(TimeBasedRollingPolicy) {
|
||||||
|
fileNamePattern = "$userHome/.unicenta/unicenta-%d{yyyy-MM-dd}.log"
|
||||||
|
maxHistory = "5"
|
||||||
|
}
|
||||||
|
encoder(PatternLayoutEncoder) {
|
||||||
|
charset = Charset.forName("UTF-8")
|
||||||
|
pattern = patternString
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
appender('console', ConsoleAppender) {
|
||||||
|
encoder(PatternLayoutEncoder) {
|
||||||
|
pattern = patternString
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
logger('com.unicenta', DEBUG)
|
||||||
|
|
||||||
|
root(DEBUG, ['console', 'applicationLogFile'])
|
||||||
@@ -24,120 +24,124 @@ import com.unicenta.data.loader.DataRead;
|
|||||||
import com.unicenta.data.loader.IKeyed;
|
import com.unicenta.data.loader.IKeyed;
|
||||||
import com.unicenta.data.loader.SerializerRead;
|
import com.unicenta.data.loader.SerializerRead;
|
||||||
|
|
||||||
|
|
||||||
public class VoucherInfo implements IKeyed {
|
public class VoucherInfo implements IKeyed {
|
||||||
private String id;
|
private String id;
|
||||||
private String voucherNumber;
|
private String voucherNumber;
|
||||||
private String customerName;
|
private String customerName;
|
||||||
private double amount;
|
private double amount;
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
public VoucherInfo() {
|
public VoucherInfo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public VoucherInfo(
|
public VoucherInfo(
|
||||||
String id,
|
String id,
|
||||||
String voucherNumber,
|
String voucherNumber,
|
||||||
String customerName,
|
String customerName,
|
||||||
double amount,
|
double amount,
|
||||||
String status) {
|
String status)
|
||||||
this.id = id;
|
{
|
||||||
this.voucherNumber = voucherNumber;
|
this.id = id;
|
||||||
this.customerName = customerName;
|
this.voucherNumber = voucherNumber;
|
||||||
this.amount = amount;
|
this.customerName = customerName;
|
||||||
this.status = status;
|
this.amount = amount;
|
||||||
}
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object getKey() {
|
|
||||||
return getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* @return the id
|
public Object getKey() {
|
||||||
*/
|
return getId();
|
||||||
public String getId() {
|
}
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param id the id to set
|
* @return the id
|
||||||
*/
|
*/
|
||||||
public void setId(String id) {
|
public String getId() {
|
||||||
this.id = id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the voucherNumber
|
* @param id the id to set
|
||||||
*/
|
*/
|
||||||
public String getVoucherNumber() {
|
public void setId(String id) {
|
||||||
return voucherNumber;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param voucherNumber the voucherNumber to set
|
* @return the voucherNumber
|
||||||
*/
|
*/
|
||||||
public void setVoucherNumber(String voucherNumber) {
|
public String getVoucherNumber() {
|
||||||
this.voucherNumber = voucherNumber;
|
return voucherNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the customerName
|
* @param voucherNumber the voucherNumber to set
|
||||||
*/
|
*/
|
||||||
public String getCustomerName() {
|
public void setVoucherNumber(String voucherNumber) {
|
||||||
return customerName;
|
this.voucherNumber = voucherNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param customerName the customerName to set
|
* @return the customerName
|
||||||
*/
|
*/
|
||||||
public void setCustomerName(String customerName) {
|
public String getCustomerName() {
|
||||||
this.customerName = customerName;
|
return customerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the amount
|
* @param customerName the customerName to set
|
||||||
*/
|
*/
|
||||||
public double getAmount() {
|
public void setCustomerName(String customerName) {
|
||||||
return amount;
|
this.customerName = customerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param amount the amount to set
|
* @return the amount
|
||||||
*/
|
*/
|
||||||
public void setAmount(double amount) {
|
public double getAmount() {
|
||||||
this.amount = amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public String toString() {
|
* @param amount the amount to set
|
||||||
return voucherNumber;
|
*/
|
||||||
}
|
public void setAmount(double amount) {
|
||||||
|
this.amount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the status
|
|
||||||
*/
|
|
||||||
public String getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* @param status the status to set
|
public String toString() {
|
||||||
*/
|
return voucherNumber;
|
||||||
public void setStatus(String status) {
|
}
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static SerializerRead getSerializerRead() {
|
/**
|
||||||
return new SerializerRead() {
|
* @return the status
|
||||||
@Override
|
*/
|
||||||
public Object readValues(DataRead dr) throws BasicException {
|
public String getStatus() {
|
||||||
return new VoucherInfo(
|
return status;
|
||||||
dr.getString(1),
|
}
|
||||||
dr.getString(2),
|
|
||||||
dr.getString(3),
|
/**
|
||||||
dr.getDouble(4),
|
* @param status the status to set
|
||||||
dr.getString(5));
|
*/
|
||||||
}
|
public void setStatus(String status) {
|
||||||
};
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static SerializerRead getSerializerRead() {
|
||||||
|
return new SerializerRead()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public Object readValues(DataRead dr) throws BasicException {
|
||||||
|
return new VoucherInfo(
|
||||||
|
dr.getString(1),
|
||||||
|
dr.getString(2),
|
||||||
|
dr.getString(3),
|
||||||
|
dr.getDouble(4),
|
||||||
|
dr.getString(5));
|
||||||
|
}};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user