Merge branch 'main' into logAndException
commit
111ca39b46
|
|
@ -1,59 +0,0 @@
|
|||
2023-05-22-12:55:35 ERROR ERROR (1581): Unerwartetes Zeichen an dieser Stelle der Suchzeile; at position 111.
|
||||
ERROR (1581): Unerwartetes Zeichen an dieser Stelle der Suchzeile; at position 111.
|
||||
at com.bmc.arsys.qual.ParserException.reportError(ParserException.java:69)
|
||||
at com.bmc.arsys.qual.ARQualificationHelper.parseQual(ARQualificationHelper.java:83)
|
||||
at com.bmc.arsys.qual.ARQualificationHelper.parseQualification(ARQualificationHelper.java:135)
|
||||
at com.bmc.arsys.api.ARServerUser.parseQualification(ARServerUser.java:4146)
|
||||
at com.bmc.arsys.api.ARServerUser.parseQualification(ARServerUser.java:4079)
|
||||
at com.nttdata.calender.api.RemedyJavaAPI.queryFieldsById(RemedyJavaAPI.java:202)
|
||||
at com.nttdata.calender.changes.Change.get(Change.java:108)
|
||||
at com.nttdata.calender.api.KalenderRestController.getChanges(KalenderRestController.java:186)
|
||||
at jdk.internal.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
|
||||
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
|
||||
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
|
||||
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
|
||||
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
|
||||
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
|
||||
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
|
||||
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
|
||||
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071)
|
||||
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964)
|
||||
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
|
||||
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
|
||||
at javax.servlet.http.HttpServlet.service(HttpServlet.java:665)
|
||||
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
|
||||
at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
|
||||
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
|
||||
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
|
||||
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
|
||||
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
|
||||
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177)
|
||||
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
|
||||
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
|
||||
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
|
||||
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
|
||||
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
|
||||
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
|
||||
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
|
||||
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
|
||||
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891)
|
||||
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784)
|
||||
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
|
||||
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
|
||||
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
|
||||
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
|
||||
at java.base/java.lang.Thread.run(Thread.java:834)
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
2023-05-22-12:55:35 ERROR []
|
||||
2023-05-22-12:56:47 ERROR ERROR (1581): Unerwartetes Zeichen an dieser Stelle der Suchzeile; at position 111.
|
||||
ERROR (1581): Unerwartetes Zeichen an dieser Stelle der Suchzeile; at position 111.
|
||||
at com.bmc.arsys.qual.ParserException.reportError(ParserException.java:69)
|
||||
at com.bmc.arsys.qual.ARQualificationHelper.parseQual(ARQualificationHelper.java:83)
|
||||
at com.bmc.arsys.qual.ARQualificationHelper.parseQualification(ARQualificationHelper.java:135)
|
||||
at com.bmc.arsys.api.ARServerUser.parseQualification(ARServerUser.java:4146)
|
||||
at com.bmc.arsys.api.ARServerUser.parseQualification(ARServerUser.java:4079)
|
||||
at com.nttdata.calender.api.RemedyJavaAPI.queryFieldsById(RemedyJavaAPI.java:202)
|
||||
at com.nttdata.calender.changes.Change.get(Change.java:108)
|
||||
at com.nttdata.calender.api.KalenderRestController.getChanges(KalenderRestController.java:186)
|
||||
at jdk.internal.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
|
||||
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
|
||||
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
|
||||
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
|
||||
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
|
||||
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
|
||||
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
|
||||
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
|
||||
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071)
|
||||
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964)
|
||||
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
|
||||
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
|
||||
at javax.servlet.http.HttpServlet.service(HttpServlet.java:665)
|
||||
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
|
||||
at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
|
||||
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
|
||||
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
|
||||
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
|
||||
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
|
||||
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177)
|
||||
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
|
||||
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
|
||||
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
|
||||
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
|
||||
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
|
||||
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
|
||||
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
|
||||
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
|
||||
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891)
|
||||
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784)
|
||||
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
|
||||
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
|
||||
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
|
||||
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
|
||||
at java.base/java.lang.Thread.run(Thread.java:834)
|
||||
|
|
@ -35,6 +35,8 @@ import com.nttdata.calender.states.StateChange;
|
|||
import com.nttdata.calender.states.StateChangeRequest;
|
||||
import com.nttdata.calender.states.StateResponse;
|
||||
import com.nttdata.calender.supportgroup.SupportGroup;
|
||||
import com.nttdata.calender.urlConstructor.UrlConstructor;
|
||||
import com.nttdata.calender.urlConstructor.UrlResponse;
|
||||
|
||||
/**
|
||||
* REST Controller for Remedy Data
|
||||
|
|
@ -46,18 +48,20 @@ public class KalenderRestController {
|
|||
private final Implementer implementer;
|
||||
private final PackageType packageType;
|
||||
private final Approval approval;
|
||||
private final UrlConstructor urlConstructor;
|
||||
private final StateChange stateChange;
|
||||
|
||||
private static final Logger applicationLogger = LogManager.getLogger("application");
|
||||
|
||||
@Autowired
|
||||
public KalenderRestController(RemedyJavaAPI javaAPI, Change change, Implementer implementer,
|
||||
PackageType packageType, Approval approval, StateChange stateChange) {
|
||||
PackageType packageType, Approval approval, UrlConstructor urlConstructor, StateChange stateChange) {
|
||||
this.javaAPI = javaAPI;
|
||||
this.change = change;
|
||||
this.implementer = implementer;
|
||||
this.packageType = packageType;
|
||||
this.approval = approval;
|
||||
this.urlConstructor = urlConstructor;
|
||||
this.stateChange = stateChange;
|
||||
}
|
||||
|
||||
|
|
@ -77,20 +81,6 @@ public class KalenderRestController {
|
|||
return state.get();
|
||||
}
|
||||
|
||||
@CrossOrigin("*")
|
||||
@GetMapping("/api/getMany")
|
||||
@ResponseBody
|
||||
public void getMany() {
|
||||
var query = new Query.QueryBuilder("ASF:WI_CFG_CIMaintenanceRel").addFieldId("something", 666000001).build();
|
||||
try {
|
||||
var entries = javaAPI.queryFieldsById("", query.getFieldIds(), query.getFormName(), null, 0, 0);
|
||||
System.out.println(entries.size());
|
||||
} catch (ARException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles GET request to retrieve all support groups.
|
||||
*
|
||||
|
|
@ -108,6 +98,12 @@ public class KalenderRestController {
|
|||
return ResponseEntity.internalServerError().body("Support Groups couldnt be fetched.");
|
||||
}
|
||||
|
||||
@CrossOrigin("*")
|
||||
@GetMapping("/api/getUrl")
|
||||
public UrlResponse getLink() throws ARException {
|
||||
return urlConstructor.construct(javaAPI);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Handles a GET request to retrieve the user's support group.
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ public class Approval {
|
|||
*/
|
||||
public String update(ApprovalUpdateRequest request) throws ARException {
|
||||
remedyJavaAPI.impersonateUser("ext_StanzPa");
|
||||
String user = remedyJavaAPI.getUser();
|
||||
String action = "APPROVAL";
|
||||
|
||||
var queryUpdate = new Query.QueryBuilder("ASF:CHG_CAL_Interactions")
|
||||
|
|
@ -42,19 +41,24 @@ public class Approval {
|
|||
.addFieldValue("ApprovalAction", 1000003264, request.getApprovalActionValue())
|
||||
.build();
|
||||
|
||||
/*
|
||||
String user = remedyJavaAPI.getUser();
|
||||
var queryChanges = new Query.QueryBuilder("ASF:WI_TAS_Paket")
|
||||
.addFieldId("ChangeNr", 1000000182)
|
||||
.addFieldId("ActualStatus", 7)
|
||||
.build();
|
||||
|
||||
|
||||
Entry change = remedyJavaAPI
|
||||
.queryFieldsById("\'Infrastructure Change ID\' = \"" + request.getChangeNrValue().toString() + "\"",
|
||||
queryChanges.getFieldIds(), queryChanges.getFormName(), null, 0, 0)
|
||||
.get(0);
|
||||
|
||||
|
||||
int approvalAction = queryUpdate.getFieldValue("ApprovalAction").getIntValue();
|
||||
var actualStatus = change.get(queryChanges.getFieldId("ActualStatus"));
|
||||
|
||||
|
||||
if (approvalAction == 1 || approvalAction == 2) {
|
||||
if (inApprovalList(user, request.getChangeNr()))
|
||||
return this.remedyJavaAPI.createEntry(queryUpdate);
|
||||
|
|
@ -70,6 +74,9 @@ public class Approval {
|
|||
} else {
|
||||
return "invalid approval status (must be 1, 2 or 3)";
|
||||
}
|
||||
*/
|
||||
|
||||
return this.remedyJavaAPI.createEntry(queryUpdate);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -80,6 +87,7 @@ public class Approval {
|
|||
* @return True if the user is in the approval list, false otherwise
|
||||
* @throws ARException If an error occurs during the query
|
||||
*/
|
||||
/*
|
||||
public boolean inApprovalList(String user, String changeNr) throws ARException {
|
||||
var queryApprovalList = new Query.QueryBuilder("ASF:OverviewConsole_TicketsJoinAPDetailSignature")
|
||||
.addFieldId("Approvers", 13207).build();
|
||||
|
|
@ -90,4 +98,5 @@ public class Approval {
|
|||
String approvers = approversOI.get(0).get(queryApprovalList.getFieldId("Approvers")).toString();
|
||||
return approvers.contains(user);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,8 @@ public class Change {
|
|||
request.getSliceEnd());
|
||||
var entriesSize = api.getFormSize(qualifier, this.queryChange.getFormName());
|
||||
var changes = new ArrayList<ChangeItem>();
|
||||
entries.forEach(entry -> {
|
||||
|
||||
for (var entry : entries) {
|
||||
var change = new ChangeItem(entry.getEntryId());
|
||||
change.setChangeNr(getValueStringByID(entry, "ChangeNr"));
|
||||
change.setSupportGroup(getValueStringByID(entry, "SupportGroup"));
|
||||
|
|
@ -112,17 +113,24 @@ public class Change {
|
|||
change.setChangeImplementerPersonId(getValueStringByID(entry, "ChangeImplementerPersonId"));
|
||||
change.setPackageType(getValueStringByID(entry, "PackageType"));
|
||||
change.setContract(getValueStringByID(entry, "Contract"));
|
||||
|
||||
change.setImplementerEdit(
|
||||
Optional.ofNullable(entry.get(queryChange.getFieldId("ChangeCoordinator")))
|
||||
.map(Object::toString)
|
||||
.filter(peopleFullName::equals)
|
||||
.isPresent());
|
||||
|
||||
var state = getValue(entry, "State").getIntValue();
|
||||
var inApproval = inApprovalList(api.getUser(), getValueStringByID(entry, "ChangeNr"));
|
||||
|
||||
change.setFlagPermit(flagPermit(state));
|
||||
change.setFlagApprove(flagApproval(inApproval, state));
|
||||
change.setFlagReject(flagApproval(inApproval, state));
|
||||
change.setFlagCancel(flagCancel(getValueStringByID(entry, "SupportGroupId"), state));
|
||||
|
||||
changes.add(change);
|
||||
});
|
||||
}
|
||||
|
||||
api.freeImpersonatedUser();
|
||||
|
||||
return new ChangeResponse(entriesSize, changes);
|
||||
}
|
||||
|
||||
|
|
@ -152,12 +160,76 @@ public class Change {
|
|||
return peopleInfos.get(0).get(queryPerson.getFieldId("FullName")).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the change item can be approved based on the approval status
|
||||
* and the current state.
|
||||
*
|
||||
* @param approval The flag indicating whether the change item has been
|
||||
* approved.
|
||||
* @param state The current state of the change item.
|
||||
* @return {@code true} if the change item can be approved, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean flagApproval(boolean approval, int state) {
|
||||
boolean approvableState = (state == 1 || state == 10);
|
||||
return approval && approvableState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the change item can be canceled based on the support group ID
|
||||
* and the current state.
|
||||
*
|
||||
* @param supportGroupId The ID of the support group associated with the change item
|
||||
* @param state The current state of the change item
|
||||
* @return {@code true} if the change item can be canceled, {@code false} otherwise.
|
||||
* @throws ARException if an error occurs during the operation
|
||||
*/
|
||||
public boolean flagCancel(String supportGroupId, int state) throws ARException {
|
||||
var queryRoles = new Query.QueryBuilder("CTM:SupportGroupFuncRoleLookUp").addFieldId("Role", 1000000014)
|
||||
.build();
|
||||
var role = api.queryFieldsById("\'Support Group ID\' = \"" + supportGroupId + "\"",
|
||||
queryRoles.getFieldIds(), queryRoles.getFormName(), null, 0, 0)
|
||||
.get(0).get(queryRoles.getFieldId("Role")).toString();
|
||||
|
||||
boolean approvableState = state == 1;
|
||||
boolean isChangeManager = role.equals("Change Manager");
|
||||
|
||||
return approvableState && isChangeManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the change item has a permit based on the current state.
|
||||
*
|
||||
* @param state The current state of the change item.
|
||||
* @return {@code true} if the change item has a permit, {@code false} otherwise.
|
||||
*/
|
||||
public boolean flagPermit(int state) {
|
||||
return state == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the logged in user is in the approval list for the specified change item.
|
||||
*
|
||||
* @param user The username of the user to check
|
||||
* @param changeNr The change number of the change item
|
||||
* @return {@code true} if the user is in the approval list, {@code false} otherwise.
|
||||
* @throws ARException if an error occurs during the operation
|
||||
*/
|
||||
public boolean inApprovalList(String user, String changeNr) throws ARException {
|
||||
var queryApprovalList = new Query.QueryBuilder("ASF:OverviewConsole_TicketsJoinAPDetailSignature")
|
||||
.addFieldId("Approvers", 13207).build();
|
||||
var approversOI = api.queryFieldsById("\'Ticketnumber\' = \"" + changeNr + "\"",
|
||||
queryApprovalList.getFieldIds(), queryApprovalList.getFormName(), null, 0, 0);
|
||||
var approvers = approversOI.isEmpty() ? null
|
||||
: approversOI.get(0).get(queryApprovalList.getFieldId("Approvers")).toString();
|
||||
return approvers != null ? approvers.contains(user) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link Value} of an entry based on the provided description.
|
||||
*
|
||||
* @param entry the {@link Entry} from which a value will be retrieved
|
||||
* @param description the name of the field from which the value should be
|
||||
* retrieved
|
||||
* @param description the name of the field from which the value should be retrieved
|
||||
* @return the value of the entry
|
||||
*/
|
||||
private Value getValue(Entry entry, String description) {
|
||||
|
|
@ -169,8 +241,7 @@ public class Change {
|
|||
* timestamp is null.
|
||||
*
|
||||
* @param entry the {@link Entry} containing the timestamp value
|
||||
* @param description the description of the field containing the timestamp
|
||||
* value
|
||||
* @param description the description of the field containing the timestamp value
|
||||
* @return the converted {@link Date} or null if the timestamp is null
|
||||
*/
|
||||
private Date timestampToDateById(Entry entry, String description) {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ public class ChangeItem {
|
|||
private Date D2;
|
||||
private Date D3;
|
||||
private Date D4;
|
||||
private boolean flagPermit;
|
||||
private boolean flagApprove;
|
||||
private boolean flagReject;
|
||||
private boolean flagCancel;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -157,7 +161,86 @@ public class ChangeItem {
|
|||
}
|
||||
|
||||
/**
|
||||
* Retrieves the flag indicating whether the change item has a permit.
|
||||
*
|
||||
* @return {@code true} if the change item has a permit, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean getFlagPermit() {
|
||||
return this.flagPermit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the flag indicating whether the change item has a permit.
|
||||
*
|
||||
* @param flagPermit {@code true} if the change item has a permit, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public void setFlagPermit(boolean flagPermit) {
|
||||
this.flagPermit = flagPermit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the flag indicating whether the change item has been approved.
|
||||
*
|
||||
* @return {@code true} if the change item has been approved, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean getFlagApprove() {
|
||||
return this.flagApprove;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the flag indicating whether the change item has been approved.
|
||||
*
|
||||
* @param flagApprove {@code true} if the change item has been approved,
|
||||
* {@code false} otherwise.
|
||||
*/
|
||||
public void setFlagApprove(boolean flagApprove) {
|
||||
this.flagApprove = flagApprove;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the flag indicating whether the change item has been rejected.
|
||||
*
|
||||
* @return {@code true} if the change item has been rejected, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean getFlagReject() {
|
||||
return this.flagReject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the flag indicating whether the change item has been rejected.
|
||||
*
|
||||
* @param flagReject {@code true} if the change item has been rejected,
|
||||
* {@code false} otherwise.
|
||||
*/
|
||||
public void setFlagReject(boolean flagReject) {
|
||||
this.flagReject = flagReject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the flag indicating whether the change item has been canceled.
|
||||
*
|
||||
* @return {@code true} if the change item has been canceled, {@code false}
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean getFlagCancel() {
|
||||
return this.flagCancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the flag indicating whether the change item has been canceled.
|
||||
*
|
||||
* @param flagCancel {@code true} if the change item has been canceled,
|
||||
* {@code false} otherwise.
|
||||
*/
|
||||
public void setFlagCancel(boolean flagCancel) {
|
||||
this.flagCancel = flagCancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status reason of the change item.
|
||||
*
|
||||
* @return String that represents the status reason of the change item.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.nttdata.calender.urlConstructor;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bmc.arsys.api.ARException;
|
||||
import com.bmc.arsys.api.Constants;
|
||||
import com.nttdata.calender.api.RemedyJavaAPI;
|
||||
|
||||
@Service
|
||||
public class UrlConstructor {
|
||||
String viewForm = "/SHR%3ALandingConsole/Default+Administrator+View/?mode=search&F304255500=";
|
||||
String getPkg = "&F1000000076=FormOpenNoAppList&F303647600=SearchTicketWithQual&F304255610=";
|
||||
|
||||
public UrlResponse construct(RemedyJavaAPI api) throws ARException {
|
||||
var server = api.getServer();
|
||||
var setting = new int[] { Constants.AR_SERVER_INFO_SERVER_NAME, Constants.AR_SERVER_INFO_DEFAULT_WEB_PATH };
|
||||
var serverInfo = server.getServerInfo(setting);
|
||||
var midTierLink = serverInfo.get(Constants.AR_SERVER_INFO_DEFAULT_WEB_PATH).getValue().toString() + "/forms/";
|
||||
var shortName = midTierLink.replaceFirst("https://", "").substring(0, midTierLink.indexOf("."));
|
||||
|
||||
var viewFormUrl = midTierLink + shortName + viewForm;
|
||||
|
||||
return new UrlResponse(getPkg, viewFormUrl);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.nttdata.calender.urlConstructor;
|
||||
|
||||
public class UrlResponse {
|
||||
private String entryUrl;
|
||||
private String viewFormUrl;
|
||||
|
||||
public UrlResponse(String entryUrl, String viewFormUrl) {
|
||||
this.entryUrl = entryUrl;
|
||||
this.viewFormUrl = viewFormUrl;
|
||||
}
|
||||
|
||||
public String getEntryUrl() {
|
||||
return this.entryUrl;
|
||||
}
|
||||
|
||||
public void setEntryUrl(String entryUrl) {
|
||||
this.entryUrl = entryUrl;
|
||||
}
|
||||
|
||||
public String getViewFormUrl() {
|
||||
return this.viewFormUrl;
|
||||
}
|
||||
|
||||
public void setViewFormUrl(String viewFormUrl) {
|
||||
this.viewFormUrl = viewFormUrl;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
2023-05-22-12:55:35 ERROR ERROR (1581): Unerwartetes Zeichen an dieser Stelle der Suchzeile; at position 111.
|
||||
com.bmc.arsys.api.ARException: ERROR (1581): Unerwartetes Zeichen an dieser Stelle der Suchzeile; at position 111.
|
||||
at com.bmc.arsys.qual.ParserException.reportError(ParserException.java:69) ~[arapi-91_build009.jar:9.1.10-SNAPSHOT]
|
||||
at com.bmc.arsys.qual.ARQualificationHelper.parseQual(ARQualificationHelper.java:83) ~[arapi-91_build009.jar:9.1.10-SNAPSHOT]
|
||||
at com.bmc.arsys.qual.ARQualificationHelper.parseQualification(ARQualificationHelper.java:135) ~[arapi-91_build009.jar:9.1.10-SNAPSHOT]
|
||||
at com.bmc.arsys.api.ARServerUser.parseQualification(ARServerUser.java:4146) ~[arapi-91_build009.jar:9.1.10-SNAPSHOT]
|
||||
at com.bmc.arsys.api.ARServerUser.parseQualification(ARServerUser.java:4079) ~[arapi-91_build009.jar:9.1.10-SNAPSHOT]
|
||||
at com.nttdata.calender.api.RemedyJavaAPI.queryFieldsById(RemedyJavaAPI.java:202) ~[classes/:?]
|
||||
at com.nttdata.calender.changes.Change.get(Change.java:108) ~[classes/:?]
|
||||
at com.nttdata.calender.api.KalenderRestController.getChanges(KalenderRestController.java:186) ~[classes/:?]
|
||||
at jdk.internal.reflect.GeneratedMethodAccessor37.invoke(Unknown Source) ~[?:?]
|
||||
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
|
||||
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
|
||||
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) [spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) [spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) [spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) [spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at javax.servlet.http.HttpServlet.service(HttpServlet.java:665) [javax.servlet-api-4.0.1.jar:4.0.1]
|
||||
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) [spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at javax.servlet.http.HttpServlet.service(HttpServlet.java:750) [javax.servlet-api-4.0.1.jar:4.0.1]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) [spring-web-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.25.jar:5.3.25]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) [spring-web-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.25.jar:5.3.25]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.25.jar:5.3.25]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at java.lang.Thread.run(Thread.java:834) [?:?]
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
2023-05-22-12:55:35 ERROR []
|
||||
2023-05-22-12:56:47 ERROR ERROR (1581): Unerwartetes Zeichen an dieser Stelle der Suchzeile; at position 111.
|
||||
com.bmc.arsys.api.ARException: ERROR (1581): Unerwartetes Zeichen an dieser Stelle der Suchzeile; at position 111.
|
||||
at com.bmc.arsys.qual.ParserException.reportError(ParserException.java:69) ~[arapi-91_build009.jar:9.1.10-SNAPSHOT]
|
||||
at com.bmc.arsys.qual.ARQualificationHelper.parseQual(ARQualificationHelper.java:83) ~[arapi-91_build009.jar:9.1.10-SNAPSHOT]
|
||||
at com.bmc.arsys.qual.ARQualificationHelper.parseQualification(ARQualificationHelper.java:135) ~[arapi-91_build009.jar:9.1.10-SNAPSHOT]
|
||||
at com.bmc.arsys.api.ARServerUser.parseQualification(ARServerUser.java:4146) ~[arapi-91_build009.jar:9.1.10-SNAPSHOT]
|
||||
at com.bmc.arsys.api.ARServerUser.parseQualification(ARServerUser.java:4079) ~[arapi-91_build009.jar:9.1.10-SNAPSHOT]
|
||||
at com.nttdata.calender.api.RemedyJavaAPI.queryFieldsById(RemedyJavaAPI.java:202) ~[classes/:?]
|
||||
at com.nttdata.calender.changes.Change.get(Change.java:108) ~[classes/:?]
|
||||
at com.nttdata.calender.api.KalenderRestController.getChanges(KalenderRestController.java:186) ~[classes/:?]
|
||||
at jdk.internal.reflect.GeneratedMethodAccessor37.invoke(Unknown Source) ~[?:?]
|
||||
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
|
||||
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
|
||||
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) [spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) [spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) [spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) [spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at javax.servlet.http.HttpServlet.service(HttpServlet.java:665) [javax.servlet-api-4.0.1.jar:4.0.1]
|
||||
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) [spring-webmvc-5.3.25.jar:5.3.25]
|
||||
at javax.servlet.http.HttpServlet.service(HttpServlet.java:750) [javax.servlet-api-4.0.1.jar:4.0.1]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) [spring-web-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.25.jar:5.3.25]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) [spring-web-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.25.jar:5.3.25]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.3.25.jar:5.3.25]
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) [spring-web-5.3.25.jar:5.3.25]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.71.jar:9.0.71]
|
||||
at java.lang.Thread.run(Thread.java:834) [?:?]
|
||||
|
|
@ -19,6 +19,7 @@ export class DataService {
|
|||
private contracts: any [];
|
||||
private paketTypes: any [];
|
||||
private totalSize: number = null;
|
||||
public selectedLanguage: string = 'DE';
|
||||
/**
|
||||
* This constructor builds the dataService and fetches the states from the backend
|
||||
* @param http
|
||||
|
|
@ -230,7 +231,7 @@ export class DataService {
|
|||
console.log(dataJson);
|
||||
this.http.post('http://localhost:8080/api/getChanges', dataJson)
|
||||
.subscribe((response:any)=>{
|
||||
// console.log(response);
|
||||
console.log(response);
|
||||
this.totalSize = response.totalSize;
|
||||
response.changes.forEach(resp=>{
|
||||
let tasks : any[] = [];
|
||||
|
|
@ -274,7 +275,14 @@ export class DataService {
|
|||
);
|
||||
}
|
||||
|
||||
res.push({resourceId: resp.resourceId, approvalStatus: this.validateApproval(resp.approvalStatus), statusReason: resp.statusReason , changeNr: resp.changeNr, resourceName: resp.resourceName, vertrag: resp.contract, vertragName: this.getContractName(resp.contract), isExpand: false ,isRes: true, state: resp.state, stateName: this.getStateNameById(resp.state), supportGroup: resp.supportGroup, tasks: tasks, supportGroupId: resp.supportGroupId, implementerEdit: resp.implementerEdit});
|
||||
res.push({resourceId: resp.resourceId, approvalStatus: this.validateApproval(resp.approvalStatus), statusReason: resp.statusReason,
|
||||
changeNr: resp.changeNr, resourceName: resp.resourceName,
|
||||
vertrag: resp.contract, vertragName: this.getContractName(resp.contract), isExpand: false,
|
||||
isRes: true, state: resp.state, stateName: this.getStateNameById(resp.state),
|
||||
supportGroup: resp.supportGroup, tasks: tasks, supportGroupId: resp.supportGroupId,
|
||||
implementerEdit: resp.implementerEdit, flagApprove: resp.flagApprove, flagCancel: resp.flagChancel, flagPermit: resp.flagPermit, flagReject: resp.flagReject
|
||||
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
|
|
@ -296,11 +304,21 @@ export class DataService {
|
|||
}
|
||||
|
||||
getStateNameById(stateNr): String {
|
||||
for (let state of this.states) {
|
||||
if(stateNr == state.actualState){
|
||||
return state.stateNameDE;
|
||||
}
|
||||
if(this.selectedLanguage == 'EN'){
|
||||
for (let state of this.states) {
|
||||
if(stateNr == state.actualState){
|
||||
return state.stateNameEN;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.selectedLanguage == 'DE'){
|
||||
for (let state of this.states) {
|
||||
if(stateNr == state.actualState){
|
||||
return state.stateNameDE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,44 +1,44 @@
|
|||
<h3 class="filterHeading">Kurzbeschreibung* (Eingabe eines Textteiles filtert alle passenden Pakete)</h3>
|
||||
<h3 class="filterHeading">{{filterLabels[0]}}</h3>
|
||||
<mat-form-field appearance="fill" >
|
||||
<mat-label>Text durchsuchen</mat-label>
|
||||
<mat-label>{{filterLabels[6]}}</mat-label>
|
||||
<input matInput type="text" [(ngModel)]="criteria" >
|
||||
</mat-form-field>
|
||||
|
||||
<h3 class="filterHeading">Gewählte Supportgruppe in der Rolle "Planender IH" oder "Kostenverantwortlicher" (eine)</h3>
|
||||
<h3 class="filterHeading">{{filterLabels[1]}}</h3>
|
||||
<multiselect-autocomplete
|
||||
[placeholder]="'Supportgruppe suchen & auswählen'"
|
||||
[placeholder]="filterLabels[7]"
|
||||
[data]="supportGroups"
|
||||
[key]="'supportGroup'"
|
||||
(result)="onResult($event)">
|
||||
</multiselect-autocomplete>
|
||||
|
||||
<h3 class="filterHeading">Status (einer oder mehrere) des Pakets</h3>
|
||||
<h3 class="filterHeading">{{filterLabels[2]}}</h3>
|
||||
<multiselect-autocomplete
|
||||
[placeholder]="'Status suchen & auswählen'"
|
||||
[placeholder]="filterLabels[8]"
|
||||
[data]="states"
|
||||
[key]="'state'"
|
||||
(result)="onResult($event)">
|
||||
</multiselect-autocomplete>
|
||||
|
||||
<h3 class="filterHeading">Vertrag / Provider-Cluster (einen oder mehrere)</h3>
|
||||
<h3 class="filterHeading">{{filterLabels[3]}}</h3>
|
||||
<multiselect-autocomplete
|
||||
[placeholder]="'Vertrag suchen & auswählen'"
|
||||
[placeholder]="filterLabels[9]"
|
||||
[data]="contracts"
|
||||
[key]="'contract'"
|
||||
(result)="onResult($event)">
|
||||
</multiselect-autocomplete>
|
||||
|
||||
<h3 class="filterHeading">Paket-Typ (einen oder mehrere, exakte Eingabe)</h3>
|
||||
<h3 class="filterHeading">{{filterLabels[4]}}</h3>
|
||||
<multiselect-autocomplete
|
||||
[placeholder]="'Paket-Typ suchen & auswählen'"
|
||||
[placeholder]="filterLabels[10]"
|
||||
[data]="paketTypes"
|
||||
[key]="'paketType'"
|
||||
(result)="onResult($event)">
|
||||
</multiselect-autocomplete>
|
||||
|
||||
<h3 class="filterHeading">Geplantes Start-Datum: Von / Bis</h3>
|
||||
<h3 class="filterHeading">{{filterLabels[5]}}</h3>
|
||||
<mat-form-field appearance="fill">
|
||||
<mat-label>Von</mat-label>
|
||||
<mat-label>{{this.filterLabels[11]}}</mat-label>
|
||||
<input matInput [matDatepicker]="picker1" [(ngModel)]="filterStartDate">
|
||||
<mat-hint>MM/DD/YYYY</mat-hint>
|
||||
<mat-datepicker-toggle matIconSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
</mat-form-field>
|
||||
-
|
||||
<mat-form-field appearance="fill">
|
||||
<mat-label>Bis</mat-label>
|
||||
<mat-label>{{this.filterLabels[12]}}</mat-label>
|
||||
<input matInput [matDatepicker]="picker2" [(ngModel)]="filterEndDate">
|
||||
<mat-hint>MM/DD/YYYY</mat-hint>
|
||||
<mat-datepicker-toggle matIconSuffix [for]="picker2"></mat-datepicker-toggle>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ export class FilterDialogComponent implements OnInit {
|
|||
public contractsFilter = [];
|
||||
public textFilter = [];
|
||||
public dateFilter = [];
|
||||
|
||||
public filterLabels: string[] = [];
|
||||
|
||||
public filterObj;
|
||||
|
||||
|
|
@ -60,12 +60,51 @@ export class FilterDialogComponent implements OnInit {
|
|||
|
||||
constructor(public dialogRef: MatDialogRef<FilterDialogComponent>, @Inject(MAT_DIALOG_DATA) public data: any, private dataService: DataService, private _snackBar: MatSnackBar) {
|
||||
//dialogRef.beforeClosed().subscribe(() => dialogRef.close(this.dataToReturn));
|
||||
this.filterLabels = [];
|
||||
if(this.dataService.selectedLanguage == "DE"){
|
||||
this.filterLabels.push("Kurzbeschreibung* (Eingabe eines Textteiles filtert alle passenden Pakete)");
|
||||
this.filterLabels.push("Gewählte Supportgruppe in der Rolle Planender IH oder Kostenverantwortlicher (eine)");
|
||||
this.filterLabels.push("Status (einer oder mehrere) des Pakets");
|
||||
this.filterLabels.push("Vertrag / Provider-Cluster (einen oder mehrere)");
|
||||
this.filterLabels.push("Paket-Typ (einen oder mehrere, exakte Eingabe)");
|
||||
this.filterLabels.push("Geplantes Start-Datum: Von / Bis");
|
||||
|
||||
this.filterLabels.push("Text durchsuchen");
|
||||
this.filterLabels.push("Supportgruppe suchen & auswählen");
|
||||
this.filterLabels.push("Status suchen & auswählen");
|
||||
this.filterLabels.push("Vertrag suchen & auswählen");
|
||||
this.filterLabels.push("Paket-Typ suchen & auswählen");
|
||||
this.filterLabels.push("Von");
|
||||
this.filterLabels.push("Bis");
|
||||
}else{
|
||||
this.filterLabels.push("Short description* (entering a text part filters all matching packages)");
|
||||
this.filterLabels.push("Selected support group in the role of planning IH or cost manager (one)");
|
||||
this.filterLabels.push("State (one or more) of the package");
|
||||
this.filterLabels.push("Contract / Provider cluster (one or more)");
|
||||
this.filterLabels.push("Package type (one or more, exact input)");
|
||||
this.filterLabels.push("Planned start date: From / To");
|
||||
|
||||
this.filterLabels.push("Text search");
|
||||
this.filterLabels.push("Search & select support group");
|
||||
this.filterLabels.push("Search & select status");
|
||||
this.filterLabels.push("Search & select contract");
|
||||
this.filterLabels.push("Search & select package type");
|
||||
this.filterLabels.push("From");
|
||||
this.filterLabels.push("Until");
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
for (const state of this.dataService.getStates()) {
|
||||
this.states.push(state.stateNameDE);
|
||||
if(this.dataService.selectedLanguage == 'DE'){
|
||||
for (const state of this.dataService.getStates()) {
|
||||
this.states.push(state.stateNameDE);
|
||||
}
|
||||
}else{
|
||||
for (const state of this.dataService.getStates()) {
|
||||
this.states.push(state.stateNameEN);
|
||||
}
|
||||
}
|
||||
|
||||
for (const supportGroup of this.dataService.getSupportGroups()) {
|
||||
this.supportGroups.push(supportGroup.name);
|
||||
}
|
||||
|
|
@ -92,6 +131,7 @@ export class FilterDialogComponent implements OnInit {
|
|||
break;
|
||||
case 'state':
|
||||
// this.statesFilter = event.data;
|
||||
if(this.dataService.selectedLanguage == 'DE'){
|
||||
console.log(event.data);
|
||||
for (const state of event.data) {
|
||||
if(this.dataService.getStates().find((item)=> {return item.stateNameDE == state;})){
|
||||
|
|
@ -99,6 +139,16 @@ export class FilterDialogComponent implements OnInit {
|
|||
}
|
||||
console.log(this.statesFilter);
|
||||
}
|
||||
}else{
|
||||
console.log(event.data);
|
||||
for (const state of event.data) {
|
||||
if(this.dataService.getStates().find((item)=> {return item.stateNameEN == state;})){
|
||||
this.statesFilter.push(this.dataService.getStates().find((item)=> {return item.stateNameEN == state;}).stateNameEN);
|
||||
}
|
||||
console.log(this.statesFilter);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case 'contract':
|
||||
//this.contractsFilter = event.data;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<p style="font-family:arial; margin-top: -3%;">Implementer Eintragen</p>
|
||||
<p style="font-family:arial; margin-top: -3%;">{{this.labels[0]}}</p>
|
||||
<mat-form-field appearance="fill" >
|
||||
<mat-label>Aktion auswählen</mat-label>
|
||||
<mat-label>{{this.labels[1]}}</mat-label>
|
||||
<mat-select [disabled]="diasbled" (selectionChange)="enableButton()" [(ngModel)]="selectedValue" name="state">
|
||||
<mat-option *ngFor="let implementer of possibleImplementers" [value]="implementer.value">
|
||||
{{implementer.viewValue}}
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
|
||||
<mat-dialog-actions align = "end">
|
||||
<button [disabled]="diasbled" mat-raised-button color="warn" matDialogClose>Abbrechen</button>
|
||||
<button [disabled]="bdiasbled" mat-raised-button color="primary" (click)="updateImplementer()">Bestätigen</button>
|
||||
<button [disabled]="diasbled" mat-raised-button color="warn" matDialogClose>{{this.labels[2]}}</button>
|
||||
<button [disabled]="bdiasbled" mat-raised-button color="primary" (click)="updateImplementer()">{{this.labels[3]}}</button>
|
||||
</mat-dialog-actions>
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,11 @@ export class ImplementerDialogComponent implements OnInit {
|
|||
public bdiasbled : boolean = false;
|
||||
public horizontalPosition: MatSnackBarHorizontalPosition = 'end';
|
||||
public verticalPosition: MatSnackBarVerticalPosition = 'bottom';
|
||||
public labels: string[] = [];
|
||||
|
||||
private implementers : any[];
|
||||
|
||||
|
||||
/**
|
||||
* The constructor injects required Dependencies and sets default values for logic and ui
|
||||
* @param dialogRef MatDialog Reference from Angular
|
||||
|
|
@ -39,6 +42,18 @@ export class ImplementerDialogComponent implements OnInit {
|
|||
this.diasbled = false;
|
||||
this.selectedValue = -1;
|
||||
this.possibleImplementers = [];
|
||||
this.labels = [];
|
||||
if(this.dataService.selectedLanguage == 'DE'){
|
||||
this.labels.push("Implementer Eintragen");
|
||||
this.labels.push("Implementer auswählen");
|
||||
this.labels.push("Abbrechen");
|
||||
this.labels.push("Bestätigen");
|
||||
}else{
|
||||
this.labels.push("Enter Implementer");
|
||||
this.labels.push("Select Implementer");
|
||||
this.labels.push("Cancel");
|
||||
this.labels.push("Confirm");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -97,7 +112,16 @@ export class ImplementerDialogComponent implements OnInit {
|
|||
this.progress = (counter/this.data.changes.length)*100;
|
||||
}
|
||||
if(res.status == 500){
|
||||
this._snackBar.open('Implementer Eintragung fehlgeschlagen', 'Schließen', {
|
||||
let msg;
|
||||
let action;
|
||||
if(this.dataService.selectedLanguage == 'DE'){
|
||||
msg = 'Implementer Eintragung fehlgeschlagen';
|
||||
action ='Schließen';
|
||||
}else{
|
||||
msg = 'Implementer Update failed';
|
||||
action ='close';
|
||||
}
|
||||
this._snackBar.open(msg, action, {
|
||||
horizontalPosition: this.horizontalPosition,
|
||||
verticalPosition: this.verticalPosition,
|
||||
panelClass: ['mat-primary']
|
||||
|
|
@ -111,7 +135,16 @@ export class ImplementerDialogComponent implements OnInit {
|
|||
if(this.progress == 100){
|
||||
this.diasbled = false;
|
||||
this.bdiasbled = true;
|
||||
this._snackBar.open('Implementer Eintragung erfolgreich', 'Schließen', {
|
||||
let msg;
|
||||
let action;
|
||||
if(this.dataService.selectedLanguage == 'DE'){
|
||||
msg = 'Implementer Eintragung erfolgreich';
|
||||
action ='Schließen';
|
||||
}else{
|
||||
msg = 'Implementer Update sucessful';
|
||||
action ='close';
|
||||
}
|
||||
this._snackBar.open(msg, action, {
|
||||
horizontalPosition: this.horizontalPosition,
|
||||
verticalPosition: this.verticalPosition,
|
||||
duration: 5000,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<p style="font-family:arial; margin-top: -3%;">Statusübergang ({{data.changes.length}}. Changes)</p>
|
||||
<p style="font-family:arial; margin-top: -3%;">{{this.labels[0]}} ({{data.changes.length}}. Changes)</p>
|
||||
<mat-form-field appearance="fill" >
|
||||
<mat-label>Aktion auswählen</mat-label>
|
||||
<mat-label>{{this.labels[1]}}</mat-label>
|
||||
<mat-select [disabled]="diasbled" (selectionChange)="enableButton()" [(ngModel)]="selectedValue" name="state">
|
||||
<mat-option *ngFor="let state of possibleStates" [value]="state.value">
|
||||
{{state.viewValue}}
|
||||
|
|
@ -11,6 +11,6 @@
|
|||
|
||||
|
||||
<mat-dialog-actions align="end">
|
||||
<button [disabled]="diasbled" mat-raised-button color="warn" matDialogClose>Abbrechen</button>
|
||||
<button [disabled]="bdiasbled" mat-raised-button color="primary" (click)="updateState()">Bestätigen</button>
|
||||
<button [disabled]="diasbled" mat-raised-button color="warn" matDialogClose>{{this.labels[2]}}</button>
|
||||
<button [disabled]="bdiasbled" mat-raised-button color="primary" (click)="updateState()">{{this.labels[3]}}</button>
|
||||
</mat-dialog-actions>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ export class StateDialogComponent implements OnInit {
|
|||
public bdiasbled : boolean = false;
|
||||
public horizontalPosition: MatSnackBarHorizontalPosition = 'end';
|
||||
public verticalPosition: MatSnackBarVerticalPosition = 'bottom';
|
||||
public labels: string[] = [];
|
||||
|
||||
private states : any[];
|
||||
|
||||
|
||||
|
|
@ -43,6 +45,19 @@ export class StateDialogComponent implements OnInit {
|
|||
this.diasbled = false;
|
||||
this.selectedValue = -1;
|
||||
this.possibleStates = [];
|
||||
|
||||
this.labels = [];
|
||||
if(this.dataService.selectedLanguage == 'DE'){
|
||||
this.labels.push("Statusübergang");
|
||||
this.labels.push("Status auswählen");
|
||||
this.labels.push("Abbrechen");
|
||||
this.labels.push("Bestätigen");
|
||||
}else{
|
||||
this.labels.push("State Transition");
|
||||
this.labels.push("Select State");
|
||||
this.labels.push("Cancel");
|
||||
this.labels.push("Confirm");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -96,7 +111,16 @@ export class StateDialogComponent implements OnInit {
|
|||
this.progress = (counter/this.data.changes.length)*100;
|
||||
}
|
||||
if(res.status == 500){
|
||||
this._snackBar.open('Statusübergang fehlgeschlagen', 'Schließen', {
|
||||
let msg;
|
||||
let action;
|
||||
if(this.dataService.selectedLanguage == 'DE'){
|
||||
msg = 'Statusübergang fehlgeschlagen';
|
||||
action ='Schließen';
|
||||
}else{
|
||||
msg = 'State Transition failed';
|
||||
action ='close';
|
||||
}
|
||||
this._snackBar.open(msg, action, {
|
||||
horizontalPosition: this.horizontalPosition,
|
||||
verticalPosition: this.verticalPosition,
|
||||
panelClass: ['mat-primary']
|
||||
|
|
@ -111,7 +135,19 @@ export class StateDialogComponent implements OnInit {
|
|||
if(this.progress==100){
|
||||
this.diasbled = false;
|
||||
this.bdiasbled = true;
|
||||
this._snackBar.open('Statusübergang '+ this.findStateName(change.currentState) +' -> '+this.findStateName(change.nextState)+' erfolgreich', 'Schließen', {
|
||||
let msg1;
|
||||
let msg2;
|
||||
let action;
|
||||
if(this.dataService.selectedLanguage == 'DE'){
|
||||
msg1 = 'Statusübergang';
|
||||
msg2 = 'erfolgreich';
|
||||
action ='Schließen';
|
||||
}else{
|
||||
msg1 = 'State Transition';
|
||||
msg2 = 'successful';
|
||||
action ='close';
|
||||
}
|
||||
this._snackBar.open(msg1 + this.findStateName(change.currentState) +' -> '+this.findStateName(change.nextState) + msg2, action, {
|
||||
horizontalPosition: this.horizontalPosition,
|
||||
verticalPosition: this.verticalPosition,
|
||||
duration: 5000,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div id="topbar">
|
||||
<mat-form-field appearance="fill">
|
||||
<mat-label>Datumsbereich auswählen</mat-label>
|
||||
<mat-label>{{lMap.get('dateRangeLabel')}}</mat-label>
|
||||
<mat-date-range-input [formGroup]="range" [rangePicker]="picker">
|
||||
<input matStartDate formControlName="start" placeholder="Start date" (dateChange)="startDateChanged($event)">
|
||||
<input matEndDate formControlName="end" placeholder="End date" (dateChange)="endDateChanged($event)">
|
||||
|
|
@ -25,11 +25,25 @@
|
|||
</mat-radio-group>
|
||||
<!-- <p>Selected range: {{range.value | json}}</p> -->
|
||||
<div class="toggleContainer">
|
||||
<mat-slide-toggle color="primary" [(ngModel)]="showDetails" [checked]="showDetails" (change)="renderDetails()">Details Anzeigen</mat-slide-toggle>
|
||||
<mat-slide-toggle [disabled]="filters == null" (change)="refreshData()" color="primary" [(ngModel)]="filterEnabled" [checked]="filterEnabled" (change)="applyFilter()">Filter anwenden</mat-slide-toggle>
|
||||
<mat-slide-toggle color="primary" [(ngModel)]="sortEnabled" [checked]="sortEnabled" >Sortieren</mat-slide-toggle>
|
||||
<mat-slide-toggle color="primary" [(ngModel)]="showDetails" [checked]="showDetails" (change)="renderDetails()">{{lMap.get('detailButton')}}</mat-slide-toggle>
|
||||
<mat-slide-toggle [disabled]="filters == null" (change)="refreshData()" color="primary" [(ngModel)]="filterEnabled" [checked]="filterEnabled" (change)="applyFilter()">{{lMap.get('filterButton')}}</mat-slide-toggle>
|
||||
<mat-slide-toggle color="primary" [(ngModel)]="sortEnabled" [checked]="sortEnabled" >{{lMap.get('sortButton')}}</mat-slide-toggle>
|
||||
<button mat-icon-button aria-label="clear Filters and Sort" (click)="clearFilter()">
|
||||
{{lMap.get('clearFilter')}}<mat-icon>clear_all</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<mat-form-field style="width: 5%;">
|
||||
<mat-label>{{lMap.get('language')}}</mat-label>
|
||||
<mat-select (selectionChange)="languageChange($event)" [(value)]="language">
|
||||
<mat-option *ngFor="let language of languages" [value]="language">
|
||||
{{language}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<button style="justify-content: flex-end;" mat-icon-button aria-label="Filtern" (click)="openFilterDialog()">
|
||||
<mat-icon>filter_list</mat-icon>
|
||||
</button>
|
||||
|
|
@ -37,7 +51,8 @@
|
|||
|
||||
|
||||
|
||||
<div id="showSpin" data-bind="visible: spin"
|
||||
<div
|
||||
*ngIf="!this.showNoResultsError" id="showSpin" data-bind="visible: spin"
|
||||
style=" position: absolute; top: auto; left: 45%;">
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/b/b1/Loading_icon.gif" rel="stylesheet"/>
|
||||
</div>
|
||||
|
|
@ -72,6 +87,7 @@
|
|||
[timelineSettings]="timelineSettings"
|
||||
[selectionSettings]="selectionSettings"
|
||||
[tooltipSettings]="tooltipSettings"
|
||||
[splitterSettings] = "splitterSettings"
|
||||
gridLines="Both"
|
||||
|
||||
(actionBegin)="actionBegin($event)"
|
||||
|
|
@ -86,32 +102,42 @@
|
|||
(onIntlChange)="onChange($event)"
|
||||
(queryTaskbarInfo) = "queryTaskbarInfo($event)"
|
||||
(expanding)="onExpand($event)"
|
||||
(splitterResized)="onResizing($event)"
|
||||
>
|
||||
<ng-template #tooltipSettingsTaskbar let-data>
|
||||
<div>
|
||||
<table>
|
||||
<ng-container>
|
||||
<tr>
|
||||
<td style="padding:3px">Name: {{data.taskData.resources[0].resourceName}}</td>
|
||||
<td style="padding:3px">{{lMap.get('tooltipSummary')}}: {{data.taskData.resources[0].resourceName}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:3px">Status: {{dataService.getStateNameById(data.taskData.resources[0].state)}}</td>
|
||||
<td style="padding:3px">{{lMap.get('tooltipState')}}: {{dataService.getStateNameById(data.taskData.resources[0].state)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:3px">Vertrag: {{data.taskData.resources[0].vertragName}}</td>
|
||||
<td style="padding:3px">{{lMap.get('tooltipPaketType')}}: {{data.taskData.resources[0].paketType}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:3px">SupportGruppe: {{data.taskData.resources[0].supportGroup}}</td>
|
||||
<td style="padding:3px">{{lMap.get('tooltipContract')}}: {{data.taskData.resources[0].vertragName}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:3px">Datum: {{data.taskData.StartDate | date:'dd.MM.yyyy'}}</td>
|
||||
<td style="padding:3px"> {{lMap.get('tooltipSupportGroup')}}: {{data.taskData.resources[0].supportGroup}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:3px"> {{lMap.get('tooltipDate')}}: {{data.taskData.resources[0].tasks[1].StartDate | date:'dd.MM.yyyy'}}</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td style="padding:3px"> Date: {{data.TaskID}}</td>
|
||||
</tr> -->
|
||||
|
||||
</ng-container>
|
||||
</table>
|
||||
</div>
|
||||
</ng-template>
|
||||
</ejs-gantt>
|
||||
|
||||
<div *ngIf="this.showNoResultsError && this.language =='DE'"><h2>Die Suche lieferte keine Ergebnisse</h2></div>
|
||||
<div *ngIf="this.showNoResultsError && this.language =='EN'"><h2>The search did not return any results</h2></div>
|
||||
<!-- [filterSettings]="filterSettings" -->
|
||||
|
||||
<mat-paginator #paginator
|
||||
|
|
|
|||
|
|
@ -64,12 +64,20 @@ export class NttGanttComponent implements OnInit {
|
|||
public sliceStart: number;
|
||||
public sliceEnd: number;
|
||||
public filterSettings: object;
|
||||
public splitterSettings : object;
|
||||
public renderGantt: boolean;
|
||||
public firstLoad: boolean;
|
||||
public selectedScalar: string = 'Monat-Woche';
|
||||
public scalars: string[] = ['Woche-Tag', 'Monat-Woche', 'Jahr-Monat'];
|
||||
public selectedScalar: string;
|
||||
public scalars: string[];
|
||||
public showDetails: boolean = true;
|
||||
public panelOpenState:boolean;
|
||||
public showNoResultsError: boolean = false;
|
||||
public languages: string[] = ['DE', 'EN'];
|
||||
public language: string = 'DE';
|
||||
|
||||
public deMap : Map<string, string> = new Map<string, string>()
|
||||
public enMap : Map<string, string> = new Map<string, string>()
|
||||
public lMap : Map<string, string> = new Map<string, string>()
|
||||
public attributes: any[] = [
|
||||
//{value: 'vertrag', viewValue: 'WI Vertrag'},
|
||||
{value: 'resourceName', viewValue: 'Name'},
|
||||
|
|
@ -131,11 +139,95 @@ export class NttGanttComponent implements OnInit {
|
|||
* @param matDialog injects the matDialog
|
||||
*/
|
||||
constructor(public dataService: DataService, public matDialog : MatDialog, private _snackBar: MatSnackBar ) {
|
||||
this.deMap.set('detailButton', 'Details anzeigen');
|
||||
this.enMap.set('detailButton', 'Show Details');
|
||||
this.deMap.set('filterButton', 'Filter anwenden');
|
||||
this.enMap.set('filterButton', 'Apply Filters');
|
||||
this.deMap.set('sortButton', 'Sortierung anwenden');
|
||||
this.enMap.set('sortButton', 'Apply Sort');
|
||||
this.deMap.set('field1', 'Kurzbeschreibung');
|
||||
this.enMap.set('field1', 'Summary');
|
||||
this.deMap.set('dateRangeLabel', 'Datumsbereich auswählen');
|
||||
this.enMap.set('dateRangeLabel', 'Select Date Range');
|
||||
this.deMap.set('language', 'Sprache');
|
||||
this.enMap.set('language', 'Language');
|
||||
this.deMap.set('clearFilter', 'Filter Löschen');
|
||||
this.enMap.set('clearFilter', 'Clear Filter');
|
||||
|
||||
this.deMap.set('tooltipSummary', 'Name');
|
||||
this.enMap.set('tooltipSummary', 'Name');
|
||||
this.deMap.set('tooltipState', 'Status');
|
||||
this.enMap.set('tooltipState', 'State');
|
||||
this.deMap.set('tooltipPaketType', 'Paket Typ');
|
||||
this.enMap.set('tooltipPaketType', 'Package Type');
|
||||
this.deMap.set('tooltipContract', 'Vertrag / Provider Cluster');
|
||||
this.enMap.set('tooltipContract', 'Contract / Provider Cluster');
|
||||
this.deMap.set('tooltipSupportGroup', 'Support Gruppe (IH/KV)');
|
||||
this.enMap.set('tooltipSupportGroup', 'Support Group (IH/KV)');
|
||||
this.deMap.set('tooltipDate', 'Geplantes Start Datum');
|
||||
this.enMap.set('tooltipDate', 'Planned Start Date');
|
||||
|
||||
this.deMap.set('genehmigen', 'Genehmigen');
|
||||
this.enMap.set('genehmigen', 'Approve');
|
||||
this.deMap.set('ablehnen', 'Ablehnen');
|
||||
this.enMap.set('ablehnen', 'Reject');
|
||||
this.deMap.set('stornieren', 'Stornieren');
|
||||
this.enMap.set('stornieren', 'Cancel');
|
||||
this.deMap.set('implementer', 'Implementer Eintragen');
|
||||
this.enMap.set('implementer', 'Enter Implementer');
|
||||
this.deMap.set('stateChange', 'Statusübergang');
|
||||
this.enMap.set('stateChange', 'State Transition');
|
||||
|
||||
if(navigator.language=='de-DE'){
|
||||
this.language = 'DE';
|
||||
}else{
|
||||
this.language = 'EN';
|
||||
}
|
||||
|
||||
this.initLanguge(true);
|
||||
}
|
||||
|
||||
initLanguge(initial: boolean = false){
|
||||
|
||||
if(this.language == 'DE'){
|
||||
this.dataService.selectedLanguage = 'DE';
|
||||
this.lMap = this.deMap;
|
||||
this.scalars = ['Woche-Tag', 'Monat-Woche', 'Jahr-Monat'];
|
||||
this.selectedScalar = 'Monat-Woche';
|
||||
this.columns = [
|
||||
{ field: 'TaskName', headerText: 'Kurzbeschreibung', width: 250 },
|
||||
{ field: 'stateName', headerText: 'Status', width: 250},
|
||||
{ field: 'vertragName', headerText: 'Vertrag / Provider Cluster', width: 150 },
|
||||
{ field: 'supportGroup', headerText: 'Gewählte Support Gruppe' },
|
||||
{ field: 'StartDate', headerText: 'Geplantes Start-Datum', format : {type:'date', format:'dd.MM.yyyy'}}
|
||||
]
|
||||
}
|
||||
else{
|
||||
this.dataService.selectedLanguage = 'EN';
|
||||
this.lMap = this.enMap;
|
||||
this.scalars = ['Week-Day', 'Month-Week', 'Year-Month'];
|
||||
this.selectedScalar = 'Month-Week';
|
||||
this.columns = [
|
||||
{ field: 'TaskName', headerText: 'Summary', width: 250 },
|
||||
{ field: 'stateName', headerText: 'State', width: 250},
|
||||
{ field: 'vertragName', headerText: 'Contract / Provider Cluster', width: 150 },
|
||||
{ field: 'supportGroup', headerText: 'Selected Support Group' },
|
||||
{ field: 'StartDate', headerText: 'Planned Start-Date', format : {type:'date', format:'dd.MM.yyyy'}}
|
||||
]
|
||||
}
|
||||
if(!initial){
|
||||
this.refreshData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public logg(args){
|
||||
console.log(args);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -164,11 +256,12 @@ export class NttGanttComponent implements OnInit {
|
|||
// });
|
||||
// this.renderGantt = true;
|
||||
// });
|
||||
this.refreshData()
|
||||
this.refreshData();
|
||||
this.states = this.dataService.getStates();
|
||||
this.dataService.fetchStates().then((res: any [])=>{
|
||||
this.states = res;
|
||||
this.stateList = res;
|
||||
this.spin = false;
|
||||
console.log(this.states);
|
||||
});
|
||||
|
||||
|
|
@ -257,6 +350,10 @@ export class NttGanttComponent implements OnInit {
|
|||
this.tooltipSettings = {
|
||||
showTooltip: true,
|
||||
}
|
||||
this.splitterSettings = {
|
||||
columnIndex:3
|
||||
};
|
||||
|
||||
|
||||
this.projectStartDate = this.range.controls.start.value;
|
||||
this.projectEndDate = this.range.controls.end.value;
|
||||
|
|
@ -264,6 +361,10 @@ export class NttGanttComponent implements OnInit {
|
|||
|
||||
}
|
||||
|
||||
languageChange(args: any){
|
||||
console.log(this.language);
|
||||
this.initLanguge();
|
||||
}
|
||||
|
||||
/**
|
||||
* The function taskbarEditing catches the corresponding syncfsuions event and cancels the user action if the isFixed flag of a task (Date) is set true
|
||||
|
|
@ -286,7 +387,7 @@ export class NttGanttComponent implements OnInit {
|
|||
}
|
||||
|
||||
public changeScalar(){
|
||||
if(this.selectedScalar == "Woche-Tag"){
|
||||
if(this.selectedScalar == this.scalars[0]){
|
||||
this.timelineSettings= {
|
||||
topTier: {
|
||||
//format: 'WW',
|
||||
|
|
@ -300,7 +401,7 @@ export class NttGanttComponent implements OnInit {
|
|||
};
|
||||
}
|
||||
|
||||
if(this.selectedScalar == "Monat-Woche"){
|
||||
if(this.selectedScalar == this.scalars[1]){
|
||||
this.timelineSettings= {
|
||||
topTier: {
|
||||
//format: 'YYYY',
|
||||
|
|
@ -314,7 +415,7 @@ export class NttGanttComponent implements OnInit {
|
|||
};
|
||||
}
|
||||
|
||||
if(this.selectedScalar == "Jahr-Monat"){
|
||||
if(this.selectedScalar == this.scalars[2]){
|
||||
this.timelineSettings= {
|
||||
topTier: {
|
||||
//format: 'YYYY',
|
||||
|
|
@ -373,8 +474,18 @@ export class NttGanttComponent implements OnInit {
|
|||
if (args.data.taskData.TaskID.includes("D1")||args.data.taskData.TaskID.includes("D4")){
|
||||
if(this.showDetails == false){
|
||||
args.taskbarElement.innerHTML = "";
|
||||
}else{
|
||||
if(args.data.taskData.TaskID.includes("D1")){
|
||||
args.milestoneColor = "#d4d4d4";
|
||||
}
|
||||
if(args.data.taskData.TaskID.includes("D4")){
|
||||
args.milestoneColor = "#a1a1a1";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (args.data.taskData.TaskID.includes("D3")){
|
||||
args.milestoneColor = "#bababa";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -514,15 +625,15 @@ export class NttGanttComponent implements OnInit {
|
|||
}
|
||||
if(allStates){
|
||||
if(this.approvalPending == true){
|
||||
this.toolbar = ['Cancel',{text: "Genehmigen", id: "7"},{text: "Ablehnen", id: "8"}];
|
||||
this.toolbar = ['Cancel',{text: this.lMap.get("genehmigen"), id: "7"},{text:this.lMap.get("ablehnen"), id: "8"}];
|
||||
}
|
||||
else{
|
||||
if(this.selRecs[0].taskData.state > 0 &&this.selRecs[0].taskData.state < 4){
|
||||
this.toolbar = ['Cancel',{text: "Statusübergang", id: "6"} ,{text: "Implementer eintragen", id: "10"}];
|
||||
this.toolbar = ['Cancel',{text: this.lMap.get("stateChange"), id: "6"} ,{text: this.lMap.get("implementer"), id: "10"}];
|
||||
}else{
|
||||
this.toolbar = ['Cancel',{text: "Statusübergang", id: "6"}];
|
||||
this.toolbar = ['Cancel',{text: this.lMap.get("stateChange"), id: "6"}];
|
||||
if(this.selRecs[0].taskData.state == 0){
|
||||
this.toolbar = [{text: "stornieren", id: "11"},{text: "Statusübergang", id: "6"} ,{text: "Implementer eintragen", id: "10"}];
|
||||
this.toolbar = [{text: this.lMap.get("stornieren"), id: "11"},{text:this.lMap.get("stateChange"), id: "6"} ,{text: this.lMap.get("implementer"), id: "10"}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -577,15 +688,15 @@ export class NttGanttComponent implements OnInit {
|
|||
}
|
||||
if(allStates){
|
||||
if(this.approvalPending == true){
|
||||
this.toolbar = ['Cancel',{text: "Genehmigen", id: "7"},{text: "Ablehnen", id: "8"}];
|
||||
this.toolbar = ['Cancel',{text: this.lMap.get("genehmigen"), id: "7"},{text: this.lMap.get("ablehnen"), id: "8"}];
|
||||
}
|
||||
else{
|
||||
if(this.selRecs[0].taskData.state > 0 &&this.selRecs[0].taskData.state < 4){
|
||||
this.toolbar = ['Cancel',{text: "Statusübergang", id: "6"} ,{text: "Implementer eintragen", id: "10"}];
|
||||
this.toolbar = ['Cancel',{text: this.lMap.get("stateChange"), id: "6"} ,{text: this.lMap.get("implementer"), id: "10"}];
|
||||
}else{
|
||||
this.toolbar = ['Cancel',{text: "Statusübergang", id: "6"}];
|
||||
this.toolbar = ['Cancel',{text: this.lMap.get("stateChange"), id: "6"}];
|
||||
if(this.selRecs[0].taskData.state == 0){
|
||||
this.toolbar = [{text: "stornieren", id: "11"},{text: "Statusübergang", id: "6"} ,{text: "Implementer eintragen", id: "10"}];
|
||||
this.toolbar = [{text: this.lMap.get("stornieren"), id: "11"},{text: this.lMap.get("stateChange"), id: "6"} ,{text: this.lMap.get("implementer"), id: "10"}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -604,7 +715,8 @@ export class NttGanttComponent implements OnInit {
|
|||
* @param args
|
||||
*/
|
||||
public toolbarBtnClicked(args :any){
|
||||
if(args.item.text === "Statusübergang"){
|
||||
|
||||
if(args.item.text === "Statusübergang" || args.item.text === "State Transition"){
|
||||
let data = {changes: [], states: this.states};
|
||||
for (const selectedRescourceId of this.selectedRescourceIds) {
|
||||
for (const iterator of this.resources) {
|
||||
|
|
@ -625,7 +737,7 @@ export class NttGanttComponent implements OnInit {
|
|||
});
|
||||
}
|
||||
|
||||
if(args.item.text === "Implementer eintragen"){
|
||||
if(args.item.text === "Implementer Eintragen" || args.item.text === "Enter Implementer"){
|
||||
let data = {changes: []};
|
||||
for (const selectedRescourceId of this.selectedRescourceIds) {
|
||||
for (const change of this.resources) {
|
||||
|
|
@ -642,7 +754,7 @@ export class NttGanttComponent implements OnInit {
|
|||
|
||||
}
|
||||
|
||||
if(args.item.text === "Genehmigen"){
|
||||
if(args.item.text === "Genehmigen" || args.item.text === "Approve"){
|
||||
for (const selectedRescourceId of this.selectedRescourceIds) {
|
||||
for (const change of this.resources) {
|
||||
if(change.resourceId == selectedRescourceId){
|
||||
|
|
@ -655,7 +767,7 @@ export class NttGanttComponent implements OnInit {
|
|||
|
||||
|
||||
|
||||
if(args.item.text === "ablehnen"){
|
||||
if(args.item.text === "ablehnen" || args.item.text === "Reject"){
|
||||
for (const selectedRescourceId of this.selectedRescourceIds) {
|
||||
for (const change of this.resources) {
|
||||
if(change.resourceId == selectedRescourceId){
|
||||
|
|
@ -666,7 +778,7 @@ export class NttGanttComponent implements OnInit {
|
|||
//this.ganttDefault.refresh();
|
||||
}
|
||||
|
||||
if(args.item.text === "stornieren"){
|
||||
if(args.item.text === "stornieren" || args.item.text === "Cancel"){
|
||||
for (const selectedRescourceId of this.selectedRescourceIds) {
|
||||
for (const change of this.resources) {
|
||||
if(change.resourceId == selectedRescourceId){
|
||||
|
|
@ -693,14 +805,27 @@ export class NttGanttComponent implements OnInit {
|
|||
}
|
||||
|
||||
refreshData(){
|
||||
//console.log(this.ganttDefault.splitterModule);
|
||||
this.showNoResultsError = false;
|
||||
this.renderGantt = false;
|
||||
this.dataService.fetchChanges(this.mapRequestJSON()).then((res: any[])=>{
|
||||
this.allResources = res;
|
||||
this.mapTasksToResources(this.sliceStart,this.sliceEnd);
|
||||
// console.log(this.allResources)
|
||||
this.renderGantt = true;
|
||||
if(res.length > 0){
|
||||
this.spin = true;
|
||||
this.renderGantt = true;
|
||||
this.showNoResultsError = false;
|
||||
}else{
|
||||
this.renderGantt = false;
|
||||
this.spin = false;
|
||||
this.showNoResultsError = true;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
// this.mapTasksToResources(this.sliceStart, this.sliceEnd);
|
||||
// this.data = [];
|
||||
// this.resources = this.allResources.slice(this.sliceStart, this.sliceEnd);
|
||||
|
|
@ -711,7 +836,13 @@ export class NttGanttComponent implements OnInit {
|
|||
// }
|
||||
|
||||
}
|
||||
|
||||
clearFilter(){
|
||||
this.filters = null;
|
||||
this.filterEnabled = false;
|
||||
this.sort = null;
|
||||
this.sortEnabled = false;
|
||||
this.refreshData();
|
||||
}
|
||||
mapRequestJSON(){
|
||||
let request =
|
||||
{
|
||||
|
|
@ -836,8 +967,14 @@ private oldFilters:{};
|
|||
this.filters = filter;
|
||||
this.refreshData();
|
||||
}
|
||||
public onResizing(args){
|
||||
let width ='' + args.paneSize[0]+'px';
|
||||
this.splitterSettings = {
|
||||
position: width
|
||||
};
|
||||
}
|
||||
public actionBegin(args: any) {
|
||||
// console.log(args); //custom Action
|
||||
//console.log(args); //custom Action
|
||||
if(args.requestType=='sorting'){
|
||||
let colName = "";
|
||||
let mode = "asc";
|
||||
|
|
|
|||
Loading…
Reference in New Issue