mirror of
https://github.com/sismics/docs.git
synced 2024-12-22 11:23:48 +01:00
Closes #307: log workflow create/delete in document logs
This commit is contained in:
parent
f336c7ae53
commit
67c8ac1aa3
@ -61,6 +61,7 @@ public class AuditLogDao {
|
||||
queries.add(baseQuery + " where l.LOG_IDENTITY_C in (select f.FIL_ID_C from T_FILE f where f.FIL_IDDOC_C = :documentId) ");
|
||||
queries.add(baseQuery + " where l.LOG_IDENTITY_C in (select c.COM_ID_C from T_COMMENT c where c.COM_IDDOC_C = :documentId) ");
|
||||
queries.add(baseQuery + " where l.LOG_IDENTITY_C in (select a.ACL_ID_C from T_ACL a where a.ACL_SOURCEID_C = :documentId) ");
|
||||
queries.add(baseQuery + " where l.LOG_IDENTITY_C in (select r.RTE_ID_C from T_ROUTE r where r.RTE_IDDOCUMENT_C = :documentId) ");
|
||||
parameterMap.put("documentId", criteria.getDocumentId());
|
||||
}
|
||||
|
||||
|
@ -91,10 +91,15 @@ public class RouteDao {
|
||||
* Deletes a route and the associated steps.
|
||||
*
|
||||
* @param routeId Route ID
|
||||
* @param userId User ID
|
||||
*/
|
||||
public void deleteRoute(String routeId) {
|
||||
public void deleteRoute(String routeId, String userId) {
|
||||
EntityManager em = ThreadLocalContext.get().getEntityManager();
|
||||
|
||||
// Create audit log
|
||||
Route route = em.find(Route.class, routeId);
|
||||
AuditLogUtil.create(route, AuditLogType.DELETE, userId);
|
||||
|
||||
em.createNativeQuery("update T_ROUTE_STEP rs set RTP_DELETEDATE_D = :dateNow where rs.RTP_IDROUTE_C = :routeId and rs.RTP_DELETEDATE_D is null")
|
||||
.setParameter("routeId", routeId)
|
||||
.setParameter("dateNow", new Date())
|
||||
|
@ -326,7 +326,7 @@ public class RouteResource extends BaseResource {
|
||||
|
||||
// Delete the route and the steps
|
||||
RouteDao routeDao = new RouteDao();
|
||||
routeDao.deleteRoute(routeStepDto.getRouteId());
|
||||
routeDao.deleteRoute(routeStepDto.getRouteId(), principal.getId());
|
||||
|
||||
// Always return OK
|
||||
JsonObjectBuilder response = Json.createObjectBuilder()
|
||||
|
Loading…
Reference in New Issue
Block a user