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 {
@Expose
private String stringParameters;
@Expose
private Integer etlId;
@Expose
private String calendarID;
@Expose
private String calendarName;
......
......@@ -43,7 +43,7 @@ public class GoalService extends XDFService<Goal, Map, Long> {
model = new Goal();
}
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"));
return model;
}
......@@ -52,7 +52,7 @@ public class GoalService extends XDFService<Goal, Map, Long> {
protected Map toBean(Goal model) {
Map<String, Object> map = new HashMap<>();
map.put("id",model.getId());
map.put("ident", model.getIdentifier());
map.put("identifier", model.getIdentifier());
map.put("agentId", model.getAgenId());
return map;
}
......@@ -72,13 +72,13 @@ public class GoalService extends XDFService<Goal, Map, Long> {
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)) {
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);
if (goalOptional.isPresent()) {
......@@ -120,8 +120,8 @@ public class GoalService extends XDFService<Goal, Map, Long> {
throw new NotFoundException("Debe poseer minimo un action.");
}
Long agenId = Long.valueOf(body.get("AgentId").toString());
String ident = body.get("Ident").toString();
Long agenId = Long.valueOf(body.get("agentId").toString());
String ident = body.get("identifier").toString();
if (!agentRepository.existsById(agenId)) {
throw new NotFoundException("Agente no registrado.");
......@@ -161,8 +161,8 @@ public class GoalService extends XDFService<Goal, Map, Long> {
}
result.put("id", goal.get().getId());
result.put("AgentId", goal.get().getAgenId());
result.put("Ident", goal.get().getIdentifier());
result.put("agentId", goal.get().getAgenId());
result.put("identifier", goal.get().getIdentifier());
result.put("actionList", listAction);
return result;
}
......
......@@ -37,7 +37,7 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas
}
BeanUtils.copyProperties(bean, model);
model.setInternals("Y".equals(bean.getInternals()));
model.setProcessETL(bean.getEtlId());
if (bean.getCalendarID() == null) {
throw new NotFoundException("Calendar can not be null");
}
......@@ -47,7 +47,6 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas
throw new NotFoundException("Calendar not found " + bean.getCalendarID());
}
// model.setCalendar(calendarOptional.get());
return model;
}
......@@ -57,7 +56,7 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas
BeanUtils.copyProperties(model, bean);
bean.setInternals(model.getInternals().booleanValue() ? "Y" : "N");
bean.setCalendarID(bean.getCalendarID().trim());
bean.setEtlId(model.getProcessETL());
// CalendarBean found = this.CalendarService.getById(bean.getCalendarID());
Optional<Calendar> calendarOptional = this.calendarRepository.findById(bean.getCalendarID());
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