Commit 7535be84 authored by Roberto Loayza Miljanovich's avatar Roberto Loayza Miljanovich

Merge branch 'dev_marcos' into 'developer'

Dev marcos

See merge request ByteBot/web/bytebot-service!19
parents 8c48bb1f 8bb9f91d
...@@ -23,6 +23,8 @@ public class SchedulerTaskBean implements Serializable { ...@@ -23,6 +23,8 @@ public class SchedulerTaskBean implements Serializable {
@Expose @Expose
private String stringParameters; private String stringParameters;
@Expose @Expose
private Integer etlId;
@Expose
private String calendarID; private String calendarID;
@Expose @Expose
private String calendarName; private String calendarName;
......
...@@ -43,7 +43,7 @@ public class GoalService extends XDFService<Goal, Map, Long> { ...@@ -43,7 +43,7 @@ public class GoalService extends XDFService<Goal, Map, Long> {
model = new Goal(); model = new Goal();
} }
model.setId((Long) map.get("id")); model.setId((Long) map.get("id"));
model.setIdentifier(String.valueOf(map.get("ident"))); model.setIdentifier(String.valueOf(map.get("identifier")));
model.setAgenId((Long) map.get("agentId")); model.setAgenId((Long) map.get("agentId"));
return model; return model;
} }
...@@ -52,7 +52,7 @@ public class GoalService extends XDFService<Goal, Map, Long> { ...@@ -52,7 +52,7 @@ public class GoalService extends XDFService<Goal, Map, Long> {
protected Map toBean(Goal model) { protected Map toBean(Goal model) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("id",model.getId()); map.put("id",model.getId());
map.put("ident", model.getIdentifier()); map.put("identifier", model.getIdentifier());
map.put("agentId", model.getAgenId()); map.put("agentId", model.getAgenId());
return map; return map;
} }
...@@ -72,13 +72,13 @@ public class GoalService extends XDFService<Goal, Map, Long> { ...@@ -72,13 +72,13 @@ public class GoalService extends XDFService<Goal, Map, Long> {
throw new NotFoundException("Debe poseer minimo un action."); throw new NotFoundException("Debe poseer minimo un action.");
} }
Long agenId = Long.valueOf(body.get("AgentId").toString()); Long agenId = Long.valueOf(body.get("agentId").toString());
if (!agentRepository.existsById(agenId)) { if (!agentRepository.existsById(agenId)) {
throw new NotFoundException("Agente no registrado."); throw new NotFoundException("Agente no registrado.");
} }
String ident = body.get("Ident").toString(); String ident = body.get("identifier").toString();
Optional<Goal> goalOptional= goalRepository.findByAgentAndIdent(agenId, ident); Optional<Goal> goalOptional= goalRepository.findByAgentAndIdent(agenId, ident);
if (goalOptional.isPresent()) { if (goalOptional.isPresent()) {
...@@ -120,8 +120,8 @@ public class GoalService extends XDFService<Goal, Map, Long> { ...@@ -120,8 +120,8 @@ public class GoalService extends XDFService<Goal, Map, Long> {
throw new NotFoundException("Debe poseer minimo un action."); throw new NotFoundException("Debe poseer minimo un action.");
} }
Long agenId = Long.valueOf(body.get("AgentId").toString()); Long agenId = Long.valueOf(body.get("agentId").toString());
String ident = body.get("Ident").toString(); String ident = body.get("identifier").toString();
if (!agentRepository.existsById(agenId)) { if (!agentRepository.existsById(agenId)) {
throw new NotFoundException("Agente no registrado."); throw new NotFoundException("Agente no registrado.");
...@@ -161,8 +161,8 @@ public class GoalService extends XDFService<Goal, Map, Long> { ...@@ -161,8 +161,8 @@ public class GoalService extends XDFService<Goal, Map, Long> {
} }
result.put("id", goal.get().getId()); result.put("id", goal.get().getId());
result.put("AgentId", goal.get().getAgenId()); result.put("agentId", goal.get().getAgenId());
result.put("Ident", goal.get().getIdentifier()); result.put("identifier", goal.get().getIdentifier());
result.put("actionList", listAction); result.put("actionList", listAction);
return result; return result;
} }
......
...@@ -37,7 +37,7 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas ...@@ -37,7 +37,7 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas
} }
BeanUtils.copyProperties(bean, model); BeanUtils.copyProperties(bean, model);
model.setInternals("Y".equals(bean.getInternals())); model.setInternals("Y".equals(bean.getInternals()));
model.setProcessETL(bean.getEtlId());
if (bean.getCalendarID() == null) { if (bean.getCalendarID() == null) {
throw new NotFoundException("Calendar can not be null"); throw new NotFoundException("Calendar can not be null");
} }
...@@ -47,7 +47,6 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas ...@@ -47,7 +47,6 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas
throw new NotFoundException("Calendar not found " + bean.getCalendarID()); throw new NotFoundException("Calendar not found " + bean.getCalendarID());
} }
// model.setCalendar(calendarOptional.get()); // model.setCalendar(calendarOptional.get());
return model; return model;
} }
...@@ -57,7 +56,7 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas ...@@ -57,7 +56,7 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas
BeanUtils.copyProperties(model, bean); BeanUtils.copyProperties(model, bean);
bean.setInternals(model.getInternals().booleanValue() ? "Y" : "N"); bean.setInternals(model.getInternals().booleanValue() ? "Y" : "N");
bean.setCalendarID(bean.getCalendarID().trim()); bean.setCalendarID(bean.getCalendarID().trim());
bean.setEtlId(model.getProcessETL());
// CalendarBean found = this.CalendarService.getById(bean.getCalendarID()); // CalendarBean found = this.CalendarService.getById(bean.getCalendarID());
Optional<Calendar> calendarOptional = this.calendarRepository.findById(bean.getCalendarID()); Optional<Calendar> calendarOptional = this.calendarRepository.findById(bean.getCalendarID());
if (!calendarOptional.isPresent()) { if (!calendarOptional.isPresent()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment