jira-and-tim-connector: correction on OrderSyncInfo
- In OrderSyncInfoDAO the method name findByKeyAndConnectorId is changed to findByKeyOrderAndConnectorId and a parameter Order is added. The files that uses this method are modified accordingly - In JiraSynchronizationController refresh added. If OrderSyncInfo is saved the jira sync info screen will be updated to show the change
This commit is contained in:
parent
2fc452d1b7
commit
cea2996917
5 changed files with 11 additions and 5 deletions
|
|
@ -65,10 +65,11 @@ public interface IOrderSyncInfoDAO extends IGenericDAO<OrderSyncInfo, Long> {
|
|||
*
|
||||
* @param key
|
||||
* the unique key with in connector id
|
||||
* @param order the order
|
||||
* @param connectorId
|
||||
* the connector id
|
||||
*/
|
||||
OrderSyncInfo findByKeyAndConnectorId(String key, String connectorId);
|
||||
OrderSyncInfo findByKeyOrderAndConnectorId(String key, Order order, String connectorId);
|
||||
|
||||
/**
|
||||
* Finds the {@link OrderSyncInfo}s for the specified
|
||||
|
|
|
|||
|
|
@ -63,9 +63,10 @@ public class OrderSyncInfoDAO extends GenericDAOHibernate<OrderSyncInfo, Long>
|
|||
}
|
||||
|
||||
@Override
|
||||
public OrderSyncInfo findByKeyAndConnectorId(String key, String connectorId) {
|
||||
public OrderSyncInfo findByKeyOrderAndConnectorId(String key, Order order, String connectorId) {
|
||||
Criteria criteria = getSession().createCriteria(OrderSyncInfo.class);
|
||||
criteria.add(Restrictions.eq("key", key));
|
||||
criteria.add(Restrictions.eq("order", order));
|
||||
criteria.add(Restrictions.eq("connectorId", connectorId));
|
||||
return (OrderSyncInfo) criteria.uniqueResult();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,7 +247,8 @@ public class ExportTimesheetsToTim implements IExportTimesheetsToTim {
|
|||
@Override
|
||||
public Void execute() {
|
||||
OrderSyncInfo orderSyncInfo = orderSyncInfoDAO
|
||||
.findByKeyAndConnectorId(productCode,
|
||||
.findByKeyOrderAndConnectorId(productCode,
|
||||
order,
|
||||
PredefinedConnectors.TIM.getName());
|
||||
if (orderSyncInfo == null) {
|
||||
orderSyncInfo = OrderSyncInfo.create(productCode,
|
||||
|
|
|
|||
|
|
@ -441,8 +441,9 @@ public class JiraOrderElementSynchronizer implements IJiraOrderElementSynchroniz
|
|||
@Override
|
||||
@Transactional
|
||||
public void saveSyncInfo(String key, Order order) {
|
||||
OrderSyncInfo orderSyncInfo = orderSyncInfoDAO.findByKeyAndConnectorId(
|
||||
key, PredefinedConnectors.JIRA.getName());
|
||||
OrderSyncInfo orderSyncInfo = orderSyncInfoDAO
|
||||
.findByKeyOrderAndConnectorId(key, order,
|
||||
PredefinedConnectors.JIRA.getName());
|
||||
if (orderSyncInfo == null) {
|
||||
orderSyncInfo = OrderSyncInfo.create(key, order,
|
||||
PredefinedConnectors.JIRA.getName());
|
||||
|
|
|
|||
|
|
@ -215,6 +215,8 @@ public class JiraSynchronizationController extends GenericForwardComposer {
|
|||
|
||||
jiraOrderElementSynchronizer.saveSyncInfo(label, order);
|
||||
|
||||
updateOrderLastSyncInfoScreen();
|
||||
|
||||
if (jirasyncPopup != null) {
|
||||
jirasyncPopup.close();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue