- CORRECCIÓN DEL HORARIO EN EL GUARDADO DE GATOS Y TRASFERENCIAS POR SUMA DE +7HR
This commit is contained in:
parent
d44659160b
commit
78d9e09391
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Arrebol Consultancy copyright.
|
* Arrebol Consultancy copyright.
|
||||||
*
|
*
|
||||||
* This code belongs to Arrebol Consultancy
|
* This code belongs to Arrebol Consultancy
|
||||||
* its use, redistribution or modification are prohibited
|
* its use, redistribution or modification are prohibited
|
||||||
* without written authorization from Arrebol Consultancy.
|
* without written authorization from Arrebol Consultancy.
|
||||||
*/
|
*/
|
||||||
package com.arrebol.apc.controller.mobile.controller.exchange;
|
package com.arrebol.apc.controller.mobile.controller.exchange;
|
||||||
@ -22,6 +22,7 @@ import com.arrebol.apc.model.ws.parsed.Exchange;
|
|||||||
import com.arrebol.apc.model.ws.parsed.ExchangeJaxb;
|
import com.arrebol.apc.model.ws.parsed.ExchangeJaxb;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
@ -33,133 +34,138 @@ import org.apache.logging.log4j.Logger;
|
|||||||
*/
|
*/
|
||||||
public class ExchangeEnebledUsersController implements Serializable {
|
public class ExchangeEnebledUsersController implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param userId
|
* @param userId
|
||||||
* @param officeId
|
* @param officeId
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public List<ExchangeEnebledUsersView> findEnebledUsersToUserId(String userId, String officeId) throws Exception {
|
public List<ExchangeEnebledUsersView> findEnebledUsersToUserId(String userId, String officeId) throws Exception {
|
||||||
logger.debug("exchangeEnebledUsersViewRepository");
|
logger.debug("exchangeEnebledUsersViewRepository");
|
||||||
try {
|
try {
|
||||||
List<ModelParameter> parameters = new ArrayList<>();
|
List<ModelParameter> parameters = new ArrayList<>();
|
||||||
|
|
||||||
parameters.add(
|
parameters.add(
|
||||||
new ModelParameter(
|
new ModelParameter(
|
||||||
ExchangeEnebledUsersViewCfg.PARAM_OFFICE_ID,
|
ExchangeEnebledUsersViewCfg.PARAM_OFFICE_ID,
|
||||||
officeId
|
officeId
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
parameters.add(
|
parameters.add(
|
||||||
new ModelParameter(
|
new ModelParameter(
|
||||||
ExchangeEnebledUsersViewCfg.FIELD_VIEW_ID,
|
ExchangeEnebledUsersViewCfg.FIELD_VIEW_ID,
|
||||||
userId
|
userId
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
return exchangeEnebledUsersViewRepository.findEnebledUsersToUserId(
|
return exchangeEnebledUsersViewRepository.findEnebledUsersToUserId(
|
||||||
ExchangeEnebledUsersViewCfg.QUERY_FIND_ENEBLED_USERS_TO_USER_ID,
|
ExchangeEnebledUsersViewCfg.QUERY_FIND_ENEBLED_USERS_TO_USER_ID,
|
||||||
parameters
|
parameters
|
||||||
);
|
);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("findEnebledUsersToUserId", e);
|
logger.error("findEnebledUsersToUserId", e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param jaxb
|
* @param jaxb
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public boolean newExchange(ExchangeJaxb jaxb) throws Exception {
|
public boolean newExchange(ExchangeJaxb jaxb) throws Exception {
|
||||||
logger.debug("newExchange");
|
logger.debug("newExchange");
|
||||||
try {
|
try {
|
||||||
Transfer transfer = new Transfer(
|
Transfer transfer = new Transfer(
|
||||||
new User(jaxb.getSenderId()),
|
new User(jaxb.getSenderId()),
|
||||||
new User(jaxb.getReceiverId()),
|
new User(jaxb.getReceiverId()),
|
||||||
ActiveStatus.ENEBLED,
|
ActiveStatus.ENEBLED,
|
||||||
ActionStatus.PENDING,
|
ActionStatus.PENDING,
|
||||||
jaxb.getAmount(),
|
jaxb.getAmount(),
|
||||||
new Office(jaxb.getOfficeId()),
|
new Office(jaxb.getOfficeId()),
|
||||||
jaxb.getSenderId());
|
jaxb.getSenderId());
|
||||||
|
|
||||||
return transferRepository.addTransfer(transfer);
|
return transferRepository.addTransfer(transfer);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("newExchange", e);
|
logger.error("newExchange", e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param transerId
|
* @param transerId
|
||||||
* @param userId
|
* @param userId
|
||||||
* @param isApproved
|
* @param isApproved
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public boolean updateExchange(String transerId, String userId, boolean isApproved) throws Exception {
|
public boolean updateExchange(String transerId, String userId, boolean isApproved) throws Exception {
|
||||||
logger.debug("updateExchange");
|
logger.debug("updateExchange");
|
||||||
try {
|
try {
|
||||||
List<ModelParameter> parameters = new ArrayList<>();
|
List<ModelParameter> parameters = new ArrayList<>();
|
||||||
|
|
||||||
parameters.add(new ModelParameter(TransferCfg.FIELD_ACTION_STATUS, isApproved ? ActionStatus.APPROVED : ActionStatus.REJECTED));
|
parameters.add(new ModelParameter(TransferCfg.FIELD_ACTION_STATUS, isApproved ? ActionStatus.APPROVED : ActionStatus.REJECTED));
|
||||||
parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_BY, userId));
|
parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_BY, userId));
|
||||||
parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_ON, new Date()));
|
Date date = new Date();
|
||||||
parameters.add(new ModelParameter(TransferCfg.FIELD_ID, transerId));
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_ON, date));
|
||||||
|
parameters.add(new ModelParameter(TransferCfg.FIELD_ID, transerId));
|
||||||
|
|
||||||
return transferRepository.updateTransfer(TransferCfg.QUERY_UPDATE_TRANSFER_BY_ACTION, parameters);
|
return transferRepository.updateTransfer(TransferCfg.QUERY_UPDATE_TRANSFER_BY_ACTION, parameters);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("updateExchange", e);
|
logger.error("updateExchange", e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param userId
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public List<Exchange> exchangesByUsers(String userId) throws Exception {
|
public List<Exchange> exchangesByUsers(String userId) throws Exception {
|
||||||
logger.debug("exchangesByUsers");
|
logger.debug("exchangesByUsers");
|
||||||
try {
|
try {
|
||||||
List<ModelParameter> parameters = new ArrayList<>();
|
List<ModelParameter> parameters = new ArrayList<>();
|
||||||
|
|
||||||
parameters.add(
|
parameters.add(
|
||||||
new ModelParameter(
|
new ModelParameter(
|
||||||
TransferCfg.FIELD_USER_TRANSMITTER,
|
TransferCfg.FIELD_USER_TRANSMITTER,
|
||||||
new User(userId)
|
new User(userId)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
parameters.add(
|
|
||||||
new ModelParameter(
|
|
||||||
TransferCfg.FIELD_USER_RECEIVER,
|
|
||||||
new User(userId)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return transferRepository.findAllTransferByUserIdAndCurdate(TransferCfg.QUERY_FIND_ALL_TRANSFER_BY_USER_ID_AND_CURDATE, parameters);
|
parameters.add(
|
||||||
} catch (Exception e) {
|
new ModelParameter(
|
||||||
logger.error("exchangesByUsers", e);
|
TransferCfg.FIELD_USER_RECEIVER,
|
||||||
throw e;
|
new User(userId)
|
||||||
}
|
)
|
||||||
}
|
);
|
||||||
|
|
||||||
private static final long serialVersionUID = 2625775904919860613L;
|
return transferRepository.findAllTransferByUserIdAndCurdate(TransferCfg.QUERY_FIND_ALL_TRANSFER_BY_USER_ID_AND_CURDATE, parameters);
|
||||||
final Logger logger = LogManager.getLogger(ExchangeEnebledUsersController.class);
|
} catch (Exception e) {
|
||||||
|
logger.error("exchangesByUsers", e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private final ExchangeEnebledUsersViewRepository exchangeEnebledUsersViewRepository;
|
private static final long serialVersionUID = 2625775904919860613L;
|
||||||
private final TransferRepository transferRepository;
|
final Logger logger = LogManager.getLogger(ExchangeEnebledUsersController.class);
|
||||||
|
|
||||||
public ExchangeEnebledUsersController() {
|
private final ExchangeEnebledUsersViewRepository exchangeEnebledUsersViewRepository;
|
||||||
this.exchangeEnebledUsersViewRepository = new ExchangeEnebledUsersViewRepository();
|
private final TransferRepository transferRepository;
|
||||||
this.transferRepository = new TransferRepository();
|
|
||||||
}
|
public ExchangeEnebledUsersController() {
|
||||||
|
this.exchangeEnebledUsersViewRepository = new ExchangeEnebledUsersViewRepository();
|
||||||
|
this.transferRepository = new TransferRepository();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ public class OtherExpense implements Serializable {
|
|||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTime(date);
|
calendar.setTime(date);
|
||||||
calendar.add(Calendar.DAY_OF_YEAR, -1);
|
calendar.add(Calendar.HOUR, -7);
|
||||||
date = calendar.getTime();
|
date = calendar.getTime();
|
||||||
this.createdOn = date;
|
this.createdOn = date;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Arrebol Consultancy copyright.
|
* Arrebol Consultancy copyright.
|
||||||
*
|
*
|
||||||
* This code belongs to Arrebol Consultancy
|
* This code belongs to Arrebol Consultancy
|
||||||
* its use, redistribution or modification are prohibited
|
* its use, redistribution or modification are prohibited
|
||||||
* without written authorization from Arrebol Consultancy.
|
* without written authorization from Arrebol Consultancy.
|
||||||
*/
|
*/
|
||||||
package com.arrebol.apc.model.admin;
|
package com.arrebol.apc.model.admin;
|
||||||
@ -13,8 +13,8 @@ import com.arrebol.apc.model.enums.ActionStatus;
|
|||||||
import com.arrebol.apc.model.enums.ActiveStatus;
|
import com.arrebol.apc.model.enums.ActiveStatus;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
@ -41,257 +41,263 @@ import org.hibernate.annotations.GenericGenerator;
|
|||||||
@Table(name = "APC_TRANSFER")
|
@Table(name = "APC_TRANSFER")
|
||||||
public class Transfer implements Serializable {
|
public class Transfer implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1304758262604329766L;
|
private static final long serialVersionUID = -1304758262604329766L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(generator = "uuid")
|
@GeneratedValue(generator = "uuid")
|
||||||
@GenericGenerator(name = "uuid", strategy = "uuid2")
|
@GenericGenerator(name = "uuid", strategy = "uuid2")
|
||||||
@Column(name = "id", length = 36)
|
@Column(name = "id", length = 36)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||||
@JoinColumn(
|
@JoinColumn(
|
||||||
name = "id_user_transmitter",
|
name = "id_user_transmitter",
|
||||||
referencedColumnName = "id",
|
referencedColumnName = "id",
|
||||||
nullable = false
|
nullable = false
|
||||||
)
|
)
|
||||||
private User userTransmitter;
|
private User userTransmitter;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||||
@JoinColumn(
|
@JoinColumn(
|
||||||
name = "id_user_receiver",
|
name = "id_user_receiver",
|
||||||
referencedColumnName = "id",
|
referencedColumnName = "id",
|
||||||
nullable = false
|
nullable = false
|
||||||
)
|
)
|
||||||
private User userReceiver;
|
private User userReceiver;
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
@Column(name = "active_status", nullable = false)
|
@Column(name = "active_status", nullable = false)
|
||||||
private ActiveStatus activeStatus;
|
private ActiveStatus activeStatus;
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
@Column(name = "action_status", nullable = false)
|
@Column(name = "action_status", nullable = false)
|
||||||
private ActionStatus actionStatus;
|
private ActionStatus actionStatus;
|
||||||
|
|
||||||
@Column(name = "amount_to_transfer", nullable = false)
|
@Column(name = "amount_to_transfer", nullable = false)
|
||||||
private BigDecimal amountToTransfer;
|
private BigDecimal amountToTransfer;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||||
@JoinColumn(
|
@JoinColumn(
|
||||||
name = "id_office",
|
name = "id_office",
|
||||||
referencedColumnName = "id",
|
referencedColumnName = "id",
|
||||||
nullable = false
|
nullable = false
|
||||||
)
|
)
|
||||||
private Office office;
|
private Office office;
|
||||||
|
|
||||||
@Column(name = "created_by", nullable = false, length = 36)
|
@Column(name = "created_by", nullable = false, length = 36)
|
||||||
private String createdBy;
|
private String createdBy;
|
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
@Column(name = "created_on", length = 19)
|
@Column(name = "created_on", length = 19)
|
||||||
private Date createdOn;
|
private Date createdOn;
|
||||||
|
|
||||||
@Column(name = "last_updated_by", length = 36)
|
@Column(name = "last_updated_by", length = 36)
|
||||||
private String lastUpdatedBy;
|
private String lastUpdatedBy;
|
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
@Column(name = "last_updated_on", length = 19)
|
@Column(name = "last_updated_on", length = 19)
|
||||||
private Date lastUpdatedOn;
|
private Date lastUpdatedOn;
|
||||||
|
|
||||||
public Transfer() {
|
public Transfer() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param userTransmitter
|
* @param userTransmitter
|
||||||
* @param userReceiver
|
* @param userReceiver
|
||||||
* @param activeStatus
|
* @param activeStatus
|
||||||
* @param actionStatus
|
* @param actionStatus
|
||||||
* @param amountToTransfer
|
* @param amountToTransfer
|
||||||
* @param office
|
* @param office
|
||||||
* @param createdBy
|
* @param createdBy
|
||||||
*/
|
*/
|
||||||
public Transfer(User userTransmitter, User userReceiver, ActiveStatus activeStatus, ActionStatus actionStatus, BigDecimal amountToTransfer, Office office, String createdBy) {
|
public Transfer(User userTransmitter, User userReceiver, ActiveStatus activeStatus, ActionStatus actionStatus, BigDecimal amountToTransfer, Office office, String createdBy) {
|
||||||
this.userTransmitter = userTransmitter;
|
this.userTransmitter = userTransmitter;
|
||||||
this.userReceiver = userReceiver;
|
this.userReceiver = userReceiver;
|
||||||
this.activeStatus = activeStatus;
|
this.activeStatus = activeStatus;
|
||||||
this.actionStatus = actionStatus;
|
this.actionStatus = actionStatus;
|
||||||
this.amountToTransfer = amountToTransfer;
|
this.amountToTransfer = amountToTransfer;
|
||||||
this.office = office;
|
this.office = office;
|
||||||
this.createdBy = createdBy;
|
this.createdBy = createdBy;
|
||||||
this.createdOn = new Date();
|
Date date = new Date();
|
||||||
}
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
this.createdOn = date;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
public Transfer(String id) {
|
public Transfer(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transfer(String id, User userTransmitter, User userReceiver, ActiveStatus activeStatus, ActionStatus actionStatus, BigDecimal amountToTransfer, Office office, String createdBy) {
|
public Transfer(String id, User userTransmitter, User userReceiver, ActiveStatus activeStatus, ActionStatus actionStatus, BigDecimal amountToTransfer, Office office, String createdBy) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.userTransmitter = userTransmitter;
|
this.userTransmitter = userTransmitter;
|
||||||
this.userReceiver = userReceiver;
|
this.userReceiver = userReceiver;
|
||||||
this.activeStatus = activeStatus;
|
this.activeStatus = activeStatus;
|
||||||
this.actionStatus = actionStatus;
|
this.actionStatus = actionStatus;
|
||||||
this.amountToTransfer = amountToTransfer;
|
this.amountToTransfer = amountToTransfer;
|
||||||
this.office = office;
|
this.office = office;
|
||||||
this.createdBy = createdBy;
|
this.createdBy = createdBy;
|
||||||
this.createdOn = new Date();
|
this.createdOn = new Date();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transfer(String id, User userTransmitter, User userReceiver, ActiveStatus activeStatus, ActionStatus actionStatus, BigDecimal amountToTransfer, Office office, String createdBy, Date createdOn) {
|
public Transfer(String id, User userTransmitter, User userReceiver, ActiveStatus activeStatus, ActionStatus actionStatus, BigDecimal amountToTransfer, Office office, String createdBy, Date createdOn) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.userTransmitter = userTransmitter;
|
this.userTransmitter = userTransmitter;
|
||||||
this.userReceiver = userReceiver;
|
this.userReceiver = userReceiver;
|
||||||
this.activeStatus = activeStatus;
|
this.activeStatus = activeStatus;
|
||||||
this.actionStatus = actionStatus;
|
this.actionStatus = actionStatus;
|
||||||
this.amountToTransfer = amountToTransfer;
|
this.amountToTransfer = amountToTransfer;
|
||||||
this.office = office;
|
this.office = office;
|
||||||
this.createdBy = createdBy;
|
this.createdBy = createdBy;
|
||||||
this.createdOn = createdOn;
|
this.createdOn = createdOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
public void setId(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public User getUserTransmitter() {
|
public User getUserTransmitter() {
|
||||||
return userTransmitter;
|
return userTransmitter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserTransmitter(User userTransmitter) {
|
public void setUserTransmitter(User userTransmitter) {
|
||||||
this.userTransmitter = userTransmitter;
|
this.userTransmitter = userTransmitter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public User getUserReceiver() {
|
public User getUserReceiver() {
|
||||||
return userReceiver;
|
return userReceiver;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserReceiver(User userReceiver) {
|
public void setUserReceiver(User userReceiver) {
|
||||||
this.userReceiver = userReceiver;
|
this.userReceiver = userReceiver;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActiveStatus getActiveStatus() {
|
public ActiveStatus getActiveStatus() {
|
||||||
return activeStatus;
|
return activeStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActiveStatus(ActiveStatus activeStatus) {
|
public void setActiveStatus(ActiveStatus activeStatus) {
|
||||||
this.activeStatus = activeStatus;
|
this.activeStatus = activeStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionStatus getActionStatus() {
|
public ActionStatus getActionStatus() {
|
||||||
return actionStatus;
|
return actionStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActionStatus(ActionStatus actionStatus) {
|
public void setActionStatus(ActionStatus actionStatus) {
|
||||||
this.actionStatus = actionStatus;
|
this.actionStatus = actionStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getAmountToTransfer() {
|
public BigDecimal getAmountToTransfer() {
|
||||||
return amountToTransfer;
|
return amountToTransfer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAmountToTransfer(BigDecimal amountToTransfer) {
|
public void setAmountToTransfer(BigDecimal amountToTransfer) {
|
||||||
this.amountToTransfer = amountToTransfer;
|
this.amountToTransfer = amountToTransfer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCreatedBy() {
|
public String getCreatedBy() {
|
||||||
return createdBy;
|
return createdBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreatedBy(String createdBy) {
|
public void setCreatedBy(String createdBy) {
|
||||||
this.createdBy = createdBy;
|
this.createdBy = createdBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getCreatedOn() {
|
public Date getCreatedOn() {
|
||||||
return createdOn;
|
return createdOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreatedOn(Date createdOn) {
|
public void setCreatedOn(Date createdOn) {
|
||||||
this.createdOn = createdOn;
|
this.createdOn = createdOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLastUpdatedBy() {
|
public String getLastUpdatedBy() {
|
||||||
return lastUpdatedBy;
|
return lastUpdatedBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLastUpdatedBy(String lastUpdatedBy) {
|
public void setLastUpdatedBy(String lastUpdatedBy) {
|
||||||
this.lastUpdatedBy = lastUpdatedBy;
|
this.lastUpdatedBy = lastUpdatedBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getLastUpdatedOn() {
|
public Date getLastUpdatedOn() {
|
||||||
return lastUpdatedOn;
|
return lastUpdatedOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLastUpdatedOn(Date lastUpdatedOn) {
|
public void setLastUpdatedOn(Date lastUpdatedOn) {
|
||||||
this.lastUpdatedOn = lastUpdatedOn;
|
this.lastUpdatedOn = lastUpdatedOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Office getOffice() {
|
public Office getOffice() {
|
||||||
return office;
|
return office;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOffice(Office office) {
|
public void setOffice(Office office) {
|
||||||
this.office = office;
|
this.office = office;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserReceiverRoutes(){
|
public String getUserReceiverRoutes() {
|
||||||
String routes = "";
|
String routes = "";
|
||||||
routes = userReceiver.getHumanResource().getHumanResourceHasRoutes().stream().map((py) -> py.getRouteCtlg().getRoute()).collect(Collectors.joining(", "));
|
routes = userReceiver.getHumanResource().getHumanResourceHasRoutes().stream().map((py) -> py.getRouteCtlg().getRoute()).collect(Collectors.joining(", "));
|
||||||
|
|
||||||
return routes;
|
return routes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserTransmitterRoutes(){
|
public String getUserTransmitterRoutes() {
|
||||||
String routes = "";
|
String routes = "";
|
||||||
routes = userTransmitter.getHumanResource().getHumanResourceHasRoutes().stream().map((py) -> py.getRouteCtlg().getRoute()).collect(Collectors.joining(", "));
|
routes = userTransmitter.getHumanResource().getHumanResourceHasRoutes().stream().map((py) -> py.getRouteCtlg().getRoute()).collect(Collectors.joining(", "));
|
||||||
|
|
||||||
return routes;
|
return routes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getAction(Date lastStableSmallBox) {
|
|
||||||
Date date = createdOn;
|
|
||||||
boolean action = true;
|
|
||||||
try {
|
|
||||||
SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd");
|
|
||||||
|
|
||||||
String dateStr = dt1.format(date);
|
public boolean getAction(Date lastStableSmallBox) {
|
||||||
date = dt1.parse(dateStr);
|
Date date = createdOn;
|
||||||
|
boolean action = true;
|
||||||
|
try {
|
||||||
|
SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
action = date.after(lastStableSmallBox);
|
String dateStr = dt1.format(date);
|
||||||
|
date = dt1.parse(dateStr);
|
||||||
|
|
||||||
} catch (Exception ex) {
|
action = date.after(lastStableSmallBox);
|
||||||
Logger.getLogger(ExpenseCompany.class.getName()).log(Level.SEVERE, null, ex);
|
|
||||||
}
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getActive() {
|
} catch (Exception ex) {
|
||||||
if (activeStatus == ActiveStatus.ENEBLED) {
|
Logger.getLogger(ExpenseCompany.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
return true;
|
}
|
||||||
} else {
|
return action;
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
}
|
public boolean getActive() {
|
||||||
|
if (activeStatus == ActiveStatus.ENEBLED) {
|
||||||
public String conditionEnabled() {
|
return true;
|
||||||
if(getActiveStatus() == ActiveStatus.DISABLED)
|
} else {
|
||||||
return "grayRow";
|
return false;
|
||||||
else
|
}
|
||||||
return null;
|
}
|
||||||
}
|
|
||||||
|
public String conditionEnabled() {
|
||||||
@Override
|
if (getActiveStatus() == ActiveStatus.DISABLED) {
|
||||||
public String toString() {
|
return "grayRow";
|
||||||
return "Transfer{" + "activeStatus=" + activeStatus + ", actionStatus=" + actionStatus + ", createdOn=" + createdOn + '}';
|
} else {
|
||||||
}
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Transfer{" + "activeStatus=" + activeStatus + ", actionStatus=" + actionStatus + ", createdOn=" + createdOn + '}';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user