Search in sources :

Example 1 with ActionItemNoteDetailDto

use of edu.cornell.kfs.sys.dataaccess.ActionItemNoteDetailDto in project cu-kfs by CU-CommunityApps.

the class DocumentMaintenanceDaoJdbc method getActionNotesToBeRequeued.

@Override
public List<ActionItemNoteDetailDto> getActionNotesToBeRequeued() {
    CuSqlQuery sqlQuery = buildActionNoteQuery();
    RowMapper<ActionItemNoteDetailDto> actionItemNoteMapper = (resultSet, rowNum) -> {
        ActionItemNoteDetailDto actionItemNote = new ActionItemNoteDetailDto();
        actionItemNote.setPrincipalId(resultSet.getString(1));
        actionItemNote.setDocHeaderId(resultSet.getString(2));
        actionItemNote.setActionNote(resultSet.getString(3));
        actionItemNote.setNoteTimeStamp(resultSet.getTimestamp(4, Calendar.getInstance()));
        actionItemNote.setOriginalActionItemId(resultSet.getString(5));
        return actionItemNote;
    };
    return queryForValues(sqlQuery, actionItemNoteMapper);
}
Also used : KewApiConstants(org.kuali.kfs.kew.api.KewApiConstants) CuSqlChunk(edu.cornell.kfs.sys.util.CuSqlChunk) Collection(java.util.Collection) ActionItemNoteDetailDto(edu.cornell.kfs.sys.dataaccess.ActionItemNoteDetailDto) PlatformAwareDaoBaseJdbc(org.kuali.kfs.core.framework.persistence.jdbc.dao.PlatformAwareDaoBaseJdbc) Collectors(java.util.stream.Collectors) CUKFSParameterKeyConstants(edu.cornell.kfs.sys.CUKFSParameterKeyConstants) DocumentMaintenanceDao(edu.cornell.kfs.sys.dataaccess.DocumentMaintenanceDao) SqlParameterValue(org.springframework.jdbc.core.SqlParameterValue) MessageFormat(java.text.MessageFormat) CUKFSConstants(edu.cornell.kfs.sys.CUKFSConstants) List(java.util.List) Calendar(java.util.Calendar) Logger(org.apache.logging.log4j.Logger) RowMapper(org.springframework.jdbc.core.RowMapper) ParameterService(org.kuali.kfs.coreservice.framework.parameter.ParameterService) CuSqlQuery(edu.cornell.kfs.sys.util.CuSqlQuery) LogManager(org.apache.logging.log4j.LogManager) DocumentRequeueStep(edu.cornell.kfs.sys.batch.DocumentRequeueStep) CuSqlQuery(edu.cornell.kfs.sys.util.CuSqlQuery) ActionItemNoteDetailDto(edu.cornell.kfs.sys.dataaccess.ActionItemNoteDetailDto)

Example 2 with ActionItemNoteDetailDto

use of edu.cornell.kfs.sys.dataaccess.ActionItemNoteDetailDto in project cu-kfs by CU-CommunityApps.

the class DocumentMaintenanceServiceImpl method requeueDocumentByDocumentId.

@Transactional
private void requeueDocumentByDocumentId(List<ActionItemNoteDetailDto> noteDetails, String docId) {
    LOG.info("requeueDocumentByDocumentId: Requesting requeue for document: " + docId);
    documentRefreshQueue.refreshDocument(docId);
    List<ActionItemNoteDetailDto> noteDetailsForDocument = findNoteDetailsForDocument(noteDetails, docId);
    for (ActionItemNoteDetailDto detailDto : noteDetailsForDocument) {
        ActionItem actionItem = findActionItem(detailDto);
        if (ObjectUtils.isNotNull(actionItem)) {
            ActionItemExtension actionItemExtension = findActionItemExtension(actionItem.getId());
            if (ObjectUtils.isNull(actionItemExtension)) {
                actionItemExtension = buildActionItemExtension(detailDto, actionItem);
                LOG.info("requeueDocumentByDocumentId, adding note details " + detailDto.toString() + " to action item " + actionItem.getId());
            } else {
                actionItemExtension.setActionNote(detailDto.getActionNote());
                LOG.info("requeueDocumentByDocumentId, updating note details " + detailDto.toString() + " to action item " + actionItem.getId());
            }
            businessObjectService.save(actionItemExtension);
        }
    }
}
Also used : ActionItemExtension(edu.cornell.kfs.kew.actionitem.ActionItemExtension) ActionItem(org.kuali.kfs.kew.actionitem.ActionItem) ActionItemNoteDetailDto(edu.cornell.kfs.sys.dataaccess.ActionItemNoteDetailDto) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

ActionItemNoteDetailDto (edu.cornell.kfs.sys.dataaccess.ActionItemNoteDetailDto)2 ActionItemExtension (edu.cornell.kfs.kew.actionitem.ActionItemExtension)1 CUKFSConstants (edu.cornell.kfs.sys.CUKFSConstants)1 CUKFSParameterKeyConstants (edu.cornell.kfs.sys.CUKFSParameterKeyConstants)1 DocumentRequeueStep (edu.cornell.kfs.sys.batch.DocumentRequeueStep)1 DocumentMaintenanceDao (edu.cornell.kfs.sys.dataaccess.DocumentMaintenanceDao)1 CuSqlChunk (edu.cornell.kfs.sys.util.CuSqlChunk)1 CuSqlQuery (edu.cornell.kfs.sys.util.CuSqlQuery)1 MessageFormat (java.text.MessageFormat)1 Calendar (java.util.Calendar)1 Collection (java.util.Collection)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 LogManager (org.apache.logging.log4j.LogManager)1 Logger (org.apache.logging.log4j.Logger)1 PlatformAwareDaoBaseJdbc (org.kuali.kfs.core.framework.persistence.jdbc.dao.PlatformAwareDaoBaseJdbc)1 ParameterService (org.kuali.kfs.coreservice.framework.parameter.ParameterService)1 ActionItem (org.kuali.kfs.kew.actionitem.ActionItem)1 KewApiConstants (org.kuali.kfs.kew.api.KewApiConstants)1 RowMapper (org.springframework.jdbc.core.RowMapper)1