adding base Project
This commit is contained in:
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,35 @@
|
||||
package com.realnet;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@SpringBootApplication
|
||||
//@EnableSwagger2
|
||||
//@EnableTransactionManagement
|
||||
//@EnableJpaAuditing
|
||||
//@EnableCaching
|
||||
public class RealNetApp extends SpringBootServletInitializer{
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder){
|
||||
return builder.sources(RealNetApp.class);
|
||||
}
|
||||
//
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(RealNetApp.class, args);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
SpringBoot Notes
|
||||
|
||||
@Bean :tells Spring 'here is an instance of this class, please keep hold of it and give it back to me when I ask'.
|
||||
@Autowired :says 'please give me an instance of this class, for example, one that I created with an @Bean annotation earlier'.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.realnet.WhoCollumn;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Data
|
||||
|
||||
public class Extension extends Who_column {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String extn1;
|
||||
private String extn2;
|
||||
private String extn3;
|
||||
private String extn4;
|
||||
private String extn5;
|
||||
private String extn6;
|
||||
private String extn7;
|
||||
private String extn8;
|
||||
private String extn9;
|
||||
private String extn10;
|
||||
private String extn11;
|
||||
private String extn12;
|
||||
private String extn13;
|
||||
private String extn14;
|
||||
private String extn15;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.realnet.WhoCollumn;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.*;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Who_column {
|
||||
|
||||
@Field("created_at")
|
||||
@CreatedDate
|
||||
private Date createdAt;
|
||||
|
||||
@Field("created_by")
|
||||
@CreatedBy
|
||||
private Long createdBy;
|
||||
|
||||
@Field("updated_by")
|
||||
@LastModifiedBy
|
||||
private Long updatedBy;
|
||||
|
||||
@Field("updated_at")
|
||||
@LastModifiedDate
|
||||
private Date updatedAt;
|
||||
|
||||
@Field("account_id")
|
||||
private Long accountId;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.realnet.config;
|
||||
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.realnet.logging.NoLogging;
|
||||
|
||||
@Configuration
|
||||
public class AppConfig {
|
||||
// @Bean
|
||||
// public HibernateJpaSessionFactoryBean sessionFactory() {
|
||||
// return new HibernateJpaSessionFactoryBean();
|
||||
// }
|
||||
|
||||
@NoLogging
|
||||
@Bean
|
||||
public ModelMapper modelMapper() {
|
||||
return new ModelMapper();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter() {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
|
||||
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(mapper);
|
||||
return converter;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ObjectMapper objectMapper() {
|
||||
return new ObjectMapper().disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.realnet.config;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.realnet.logging.NoLogging;
|
||||
|
||||
|
||||
public class CorsFilter implements javax.servlet.Filter {
|
||||
@NoLogging
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||
HttpServletResponse res = (HttpServletResponse) response;
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
|
||||
res.setHeader("Access-Control-Allow-Origin", "*");
|
||||
res.setHeader("Access-Control-Allow-Credentials", "true");
|
||||
res.setHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT, OPTIONS");
|
||||
res.setHeader("Access-Control-Max-Age", "3600");
|
||||
res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Accept-Encoding, Accept-Language, Host, Referer, Connection, User-Agent, authorization, sw-useragent, sw-version");
|
||||
//res.setHeader("Access-Control-Allow-Headers", "Access-Control-Allow-Headers, Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers");
|
||||
// Just REPLY OK if request method is OPTIONS for CORS (pre-flight)
|
||||
if ( req.getMethod().equals("OPTIONS") ) {
|
||||
res.setStatus(HttpServletResponse.SC_OK);
|
||||
return;
|
||||
}
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
|
||||
// public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
|
||||
// System.out.println("Filtering on...........................................................");
|
||||
// HttpServletResponse response = (HttpServletResponse) res;
|
||||
// response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
// response.setHeader("Access-Control-Allow-Credentials", "true");
|
||||
// response.setHeader("Access-Control-Allow-Methods", "POST, GET, PUT, OPTIONS, DELETE");
|
||||
// response.setHeader("Access-Control-Max-Age", "3600");
|
||||
// response.setHeader("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Authorization, Origin, Accept, Access-Control-Request-Method, Access-Control-Request-Headers");
|
||||
//
|
||||
// chain.doFilter(req, res);
|
||||
//}
|
||||
|
||||
@NoLogging
|
||||
@Override
|
||||
public void destroy() {}
|
||||
|
||||
@NoLogging
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.realnet.config;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mail.MailException;
|
||||
import org.springframework.mail.SimpleMailMessage;
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
import org.springframework.mail.javamail.MimeMessageHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class EmailService {
|
||||
@Autowired
|
||||
private JavaMailSender mailSender;
|
||||
|
||||
public void sendSimpleMessage(String from, String to, String subject, String text) throws MailException {
|
||||
SimpleMailMessage message = new SimpleMailMessage();
|
||||
log.debug("email to sent..");
|
||||
// message.setFrom(from);
|
||||
message.setTo(to);
|
||||
message.setSubject(subject);
|
||||
message.setText(text);
|
||||
mailSender.send(message);
|
||||
log.debug("email sent successfully");
|
||||
}
|
||||
|
||||
public void sendEmailWithAttachment(String to, String subject, String text) throws MessagingException, IOException {
|
||||
|
||||
MimeMessage msg = mailSender.createMimeMessage();
|
||||
|
||||
// true = multipart message
|
||||
MimeMessageHelper helper = new MimeMessageHelper(msg, true);
|
||||
log.debug("email to sent..");
|
||||
helper.setTo(to);
|
||||
|
||||
helper.setSubject(subject);
|
||||
|
||||
// default = text/plain
|
||||
// helper.setText("Check attachment for image!");
|
||||
|
||||
// true = text/html
|
||||
// helper.setText("<h1>Check attachment for image!</h1>", true);
|
||||
|
||||
helper.setText(text, true);
|
||||
|
||||
// hard coded a file path
|
||||
// FileSystemResource file = new FileSystemResource(new
|
||||
// File("path/android.png"));
|
||||
// helper.addAttachment("my_photo.png", new ClassPathResource("android.png"));
|
||||
mailSender.send(msg);
|
||||
log.debug("email sent successfully");
|
||||
}
|
||||
|
||||
public void constructEmail(String em, String subject, String url) {
|
||||
SimpleMailMessage email = new SimpleMailMessage();
|
||||
email.setSubject(subject);
|
||||
email.setText(url);
|
||||
email.setTo(em);
|
||||
mailSender.send(email);
|
||||
|
||||
}
|
||||
|
||||
// FOR ADD USER VIA ADMIN
|
||||
public void adduserviaadmin(String em, String subject, String url) {
|
||||
SimpleMailMessage email = new SimpleMailMessage();
|
||||
email.setSubject(subject);
|
||||
email.setText(url);
|
||||
email.setTo(em);
|
||||
mailSender.send(email);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,521 @@
|
||||
//package com.realnet.config;
|
||||
//
|
||||
//import java.io.BufferedReader;
|
||||
//import java.io.ByteArrayInputStream;
|
||||
//import java.io.ByteArrayOutputStream;
|
||||
//import java.io.File;
|
||||
//import java.io.FileWriter;
|
||||
//import java.io.IOException;
|
||||
//import java.io.InputStream;
|
||||
//import java.io.InputStreamReader;
|
||||
//import java.io.OutputStream;
|
||||
//import java.io.PrintWriter;
|
||||
//import java.nio.file.FileSystems;
|
||||
//import java.nio.file.Path;
|
||||
//import java.nio.file.Paths;
|
||||
//import java.text.DateFormat;
|
||||
//import java.text.SimpleDateFormat;
|
||||
//import java.util.Collection;
|
||||
//import java.util.Date;
|
||||
//import java.util.Enumeration;
|
||||
//import java.util.HashMap;
|
||||
//import java.util.Locale;
|
||||
//import java.util.Map;
|
||||
//
|
||||
//import javax.servlet.Filter;
|
||||
//import javax.servlet.FilterChain;
|
||||
//import javax.servlet.FilterConfig;
|
||||
//import javax.servlet.ReadListener;
|
||||
//import javax.servlet.ServletException;
|
||||
//import javax.servlet.ServletInputStream;
|
||||
//import javax.servlet.ServletOutputStream;
|
||||
//import javax.servlet.ServletRequest;
|
||||
//import javax.servlet.ServletResponse;
|
||||
//import javax.servlet.WriteListener;
|
||||
//import javax.servlet.http.Cookie;
|
||||
//import javax.servlet.http.HttpServletRequest;
|
||||
//import javax.servlet.http.HttpServletRequestWrapper;
|
||||
//import javax.servlet.http.HttpServletResponse;
|
||||
//import javax.servlet.http.HttpSession;
|
||||
//
|
||||
//import org.apache.commons.io.output.TeeOutputStream;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.beans.factory.ObjectFactory;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//import org.springframework.web.context.request.RequestContextHolder;
|
||||
//import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
//
|
||||
//import com.realnet.logging1.service.LoggingService;
|
||||
//import com.realnet.users.entity1.AppUser;
|
||||
//import com.realnet.users.service1.AppUserServiceImpl;
|
||||
//
|
||||
//
|
||||
//
|
||||
//@Component
|
||||
//public class HttpLoggingFilter implements Filter{
|
||||
// public static StringBuilder logInfo;
|
||||
// public static boolean logged=false;
|
||||
// private final Logger LOGGER = LoggerFactory.getLogger(getClass());
|
||||
// public static String sessionLogging = "no";
|
||||
// @Autowired
|
||||
// ObjectFactory<HttpSession> httpSessionFactory;
|
||||
// private AppUserServiceImpl appUserServiceImpl;
|
||||
// private LoggingService loggingService;
|
||||
//
|
||||
// public HttpLoggingFilter(ObjectFactory<HttpSession> httpSessionFactory, AppUserServiceImpl appUserServiceImpl,
|
||||
// LoggingService loggingService) {
|
||||
// super();
|
||||
// this.httpSessionFactory = httpSessionFactory;
|
||||
// this.appUserServiceImpl = appUserServiceImpl;
|
||||
// this.loggingService=loggingService;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void init(FilterConfig filterConfig) throws ServletException {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void doFilter(ServletRequest request, ServletResponse response,
|
||||
// FilterChain chain) throws IOException, ServletException {
|
||||
// try {
|
||||
// HttpServletRequest httpServletRequest = (HttpServletRequest) request;
|
||||
// HttpServletResponse httpServletResponse = (HttpServletResponse) response;
|
||||
//
|
||||
// Map<String, String> requestMap = this.getParameters(httpServletRequest);
|
||||
// BufferedRequestWrapper bufferedRequest = new BufferedRequestWrapper(
|
||||
// httpServletRequest);
|
||||
// BufferedResponseWrapper bufferedResponse = new BufferedResponseWrapper(
|
||||
// httpServletResponse);
|
||||
// Date d = new Date();
|
||||
// DateFormat simple =new SimpleDateFormat("dd MMM yyyy HH:mm:ss");
|
||||
// String timeStamp = simple.format(d);
|
||||
// String servletPath = httpServletRequest.getServletPath();
|
||||
// final StringBuilder logMessage = new StringBuilder(
|
||||
// "["+timeStamp+"]")
|
||||
// .append("REST Request - ").append("[HTTP METHOD:")
|
||||
// .append(httpServletRequest.getMethod())
|
||||
// .append("] [PATH INFO:")
|
||||
// .append(servletPath)
|
||||
// .append("] [REQUEST PARAMETERS:").append(requestMap)
|
||||
// .append("] [REQUEST BODY:")
|
||||
// .append(bufferedRequest.getRequestBody())
|
||||
// .append("] [REMOTE ADDRESS:")
|
||||
// .append(httpServletRequest.getRemoteAddr()).append("]");
|
||||
//
|
||||
// logInfo=logMessage;
|
||||
//
|
||||
// chain.doFilter(bufferedRequest, bufferedResponse);
|
||||
//
|
||||
// if(!servletPath.startsWith("/token/") || !servletPath.startsWith("/api/"))
|
||||
// {
|
||||
// if(httpSessionFactory.getObject().getAttribute("generate_log")==null) {
|
||||
// Long id = appUserServiceImpl.getLoggedInUser().getUserId();
|
||||
// if(loggingService.getOne(id)!=null) {
|
||||
// httpSessionFactory.getObject().setAttribute("generate_log",loggingService.getOne(id).getGenerateLog());
|
||||
// httpSessionFactory.getObject().setAttribute("generate_log",loggingService.getOne(id).getLogLevel());
|
||||
// httpSessionFactory.getObject().setAttribute("generate_log",loggingService.getOne(id).getLogFileName());
|
||||
// }else {
|
||||
// httpSessionFactory.getObject().setAttribute("generate_log","N");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// if(!httpSessionFactory.getObject().getAttribute("generate_log").equals("N")) {
|
||||
// try {
|
||||
// logMessage.append(" [RESPONSE:").append(bufferedResponse.getContent()).append("]");
|
||||
// } catch (Exception ex) {
|
||||
// System.out.println(ex);
|
||||
// }
|
||||
// System.out.println(httpSessionFactory.getObject().getAttribute("LogginLevel"));
|
||||
// if (httpSessionFactory.getObject().getAttribute("LogginLevel").equals("info")) {
|
||||
// AppUser u = appUserServiceImpl.getLoggedInUser();
|
||||
// if (u != null) {
|
||||
// Path root = FileSystems.getDefault().getPath("").toAbsolutePath();
|
||||
// Path filePath = Paths.get(root.toString(),"logs",httpSessionFactory.getObject().getAttribute("LogFileName").toString());
|
||||
// File f=filePath.toFile();
|
||||
// // File f = new File("/home/jboss/EAP-7.1.0/logs/sysadmin2_5463783.log");
|
||||
// FileWriter fw = new FileWriter(f,true);
|
||||
// logInfo = logMessage;
|
||||
// fw.write(logInfo.toString() + "\n");
|
||||
// fw.close();
|
||||
//
|
||||
// }
|
||||
// } else if (httpSessionFactory.getObject().getAttribute("LogginLevel").equals("debug") && logged==false) {
|
||||
// AppUser u = appUserServiceImpl.getLoggedInUser();
|
||||
// if (u != null) {
|
||||
// Path root = FileSystems.getDefault().getPath("").toAbsolutePath();
|
||||
// Path filePath = Paths.get(root.toString(),"logs",httpSessionFactory.getObject().getAttribute("LogFileName").toString());
|
||||
// File f=filePath.toFile();
|
||||
// // File f = new File("/home/jboss/EAP-7.1.0/logs/sysadmin2_5463783.log");
|
||||
// FileWriter fw = new FileWriter(f,true);
|
||||
// logInfo = logMessage;
|
||||
// fw.write(logInfo.toString() + "\n");
|
||||
// fw.close();
|
||||
// }
|
||||
//
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// } catch (Exception a) {
|
||||
// throw a;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// private Map<String, String> getParameters(HttpServletRequest request) {
|
||||
// Map<String, String> typesafeRequestMap = new HashMap<String, String>();
|
||||
// Enumeration<?> requestParamNames = request.getParameterNames();
|
||||
// while (requestParamNames.hasMoreElements()) {
|
||||
// String requestParamName = (String) requestParamNames.nextElement();
|
||||
// String requestParamValue;
|
||||
// if (requestParamName.equalsIgnoreCase("password")) {
|
||||
// requestParamValue = "****";
|
||||
// } else {
|
||||
// requestParamValue = request.getParameter(requestParamName);
|
||||
// }
|
||||
// typesafeRequestMap.put(requestParamName, requestParamValue);
|
||||
// }
|
||||
// return typesafeRequestMap;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void destroy() {
|
||||
// }
|
||||
//
|
||||
// private static final class BufferedRequestWrapper extends
|
||||
// HttpServletRequestWrapper {
|
||||
//
|
||||
// private ByteArrayInputStream bais = null;
|
||||
// private ByteArrayOutputStream baos = null;
|
||||
// private BufferedServletInputStream bsis = null;
|
||||
// private byte[] buffer = null;
|
||||
//
|
||||
// public BufferedRequestWrapper(HttpServletRequest req)
|
||||
// throws IOException {
|
||||
// super(req);
|
||||
// // Read InputStream and store its content in a buffer.
|
||||
// InputStream is = req.getInputStream();
|
||||
// this.baos = new ByteArrayOutputStream();
|
||||
// byte buf[] = new byte[1024];
|
||||
// int read;
|
||||
// while ((read = is.read(buf)) > 0) {
|
||||
// this.baos.write(buf, 0, read);
|
||||
// }
|
||||
// this.buffer = this.baos.toByteArray();
|
||||
// is.close();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ServletInputStream getInputStream() {
|
||||
// this.bais = new ByteArrayInputStream(this.buffer);
|
||||
// this.bsis = new BufferedServletInputStream(this.bais);
|
||||
// return this.bsis;
|
||||
// }
|
||||
//
|
||||
// String getRequestBody() throws IOException {
|
||||
// BufferedReader reader = new BufferedReader(new InputStreamReader(
|
||||
// this.getInputStream()));
|
||||
// String line = null;
|
||||
// StringBuilder inputBuffer = new StringBuilder();
|
||||
// do {
|
||||
// line = reader.readLine();
|
||||
// if (null != line) {
|
||||
// inputBuffer.append(line.trim());
|
||||
// }
|
||||
// } while (line != null);
|
||||
// reader.close();
|
||||
// return inputBuffer.toString().trim();
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// private static final class BufferedServletInputStream extends
|
||||
// ServletInputStream {
|
||||
//
|
||||
// private ByteArrayInputStream bais;
|
||||
//
|
||||
// public BufferedServletInputStream(ByteArrayInputStream bais) {
|
||||
// this.bais = bais;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int available() {
|
||||
// return this.bais.available();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int read() {
|
||||
// return this.bais.read();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int read(byte[] buf, int off, int len) {
|
||||
// return this.bais.read(buf, off, len);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isFinished() {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isReady() {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setReadListener(ReadListener readListener) {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public class TeeServletOutputStream extends ServletOutputStream {
|
||||
//
|
||||
// private final TeeOutputStream targetStream;
|
||||
//
|
||||
// public TeeServletOutputStream(OutputStream one, OutputStream two) {
|
||||
// targetStream = new TeeOutputStream(one, two);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void write(int arg0) throws IOException {
|
||||
// this.targetStream.write(arg0);
|
||||
// }
|
||||
//
|
||||
// public void flush() throws IOException {
|
||||
// super.flush();
|
||||
// this.targetStream.flush();
|
||||
// }
|
||||
//
|
||||
// public void close() throws IOException {
|
||||
// super.close();
|
||||
// this.targetStream.close();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isReady() {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setWriteListener(WriteListener writeListener) {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//public class BufferedResponseWrapper implements HttpServletResponse {
|
||||
//
|
||||
// HttpServletResponse original;
|
||||
// TeeServletOutputStream tee;
|
||||
// ByteArrayOutputStream bos;
|
||||
//
|
||||
// public BufferedResponseWrapper(HttpServletResponse response) {
|
||||
// original = response;
|
||||
// }
|
||||
//
|
||||
// public String getContent() {
|
||||
// return bos.toString();
|
||||
// }
|
||||
//
|
||||
// public PrintWriter getWriter() throws IOException {
|
||||
// return original.getWriter();
|
||||
// }
|
||||
//
|
||||
// public ServletOutputStream getOutputStream() throws IOException {
|
||||
// if (tee == null) {
|
||||
// bos = new ByteArrayOutputStream();
|
||||
// tee = new TeeServletOutputStream(original.getOutputStream(),
|
||||
// bos);
|
||||
// }
|
||||
// return tee;
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getCharacterEncoding() {
|
||||
// return original.getCharacterEncoding();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getContentType() {
|
||||
// return original.getContentType();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setCharacterEncoding(String charset) {
|
||||
// original.setCharacterEncoding(charset);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setContentLength(int len) {
|
||||
// original.setContentLength(len);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setContentLengthLong(long l) {
|
||||
// original.setContentLengthLong(l);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setContentType(String type) {
|
||||
// original.setContentType(type);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setBufferSize(int size) {
|
||||
// original.setBufferSize(size);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getBufferSize() {
|
||||
// return original.getBufferSize();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void flushBuffer() throws IOException {
|
||||
// tee.flush();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void resetBuffer() {
|
||||
// original.resetBuffer();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isCommitted() {
|
||||
// return original.isCommitted();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void reset() {
|
||||
// original.reset();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setLocale(Locale loc) {
|
||||
// original.setLocale(loc);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Locale getLocale() {
|
||||
// return original.getLocale();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void addCookie(Cookie cookie) {
|
||||
// original.addCookie(cookie);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean containsHeader(String name) {
|
||||
// return original.containsHeader(name);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String encodeURL(String url) {
|
||||
// return original.encodeURL(url);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String encodeRedirectURL(String url) {
|
||||
// return original.encodeRedirectURL(url);
|
||||
// }
|
||||
//
|
||||
// @SuppressWarnings("deprecation")
|
||||
// @Override
|
||||
// public String encodeUrl(String url) {
|
||||
// return original.encodeUrl(url);
|
||||
// }
|
||||
//
|
||||
// @SuppressWarnings("deprecation")
|
||||
// @Override
|
||||
// public String encodeRedirectUrl(String url) {
|
||||
// return original.encodeRedirectUrl(url);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void sendError(int sc, String msg) throws IOException {
|
||||
// original.sendError(sc, msg);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void sendError(int sc) throws IOException {
|
||||
// original.sendError(sc);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void sendRedirect(String location) throws IOException {
|
||||
// original.sendRedirect(location);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setDateHeader(String name, long date) {
|
||||
// original.setDateHeader(name, date);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void addDateHeader(String name, long date) {
|
||||
// original.addDateHeader(name, date);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setHeader(String name, String value) {
|
||||
// original.setHeader(name, value);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void addHeader(String name, String value) {
|
||||
// original.addHeader(name, value);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setIntHeader(String name, int value) {
|
||||
// original.setIntHeader(name, value);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void addIntHeader(String name, int value) {
|
||||
// original.addIntHeader(name, value);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setStatus(int sc) {
|
||||
// original.setStatus(sc);
|
||||
// }
|
||||
//
|
||||
// @SuppressWarnings("deprecation")
|
||||
// @Override
|
||||
// public void setStatus(int sc, String sm) {
|
||||
// original.setStatus(sc, sm);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getHeader(String arg0) {
|
||||
// return original.getHeader(arg0);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Collection<String> getHeaderNames() {
|
||||
// return original.getHeaderNames();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Collection<String> getHeaders(String arg0) {
|
||||
// return original.getHeaders(arg0);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getStatus() {
|
||||
// return original.getStatus();
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.realnet.config;
|
||||
|
||||
public class JWTConstant {
|
||||
|
||||
// private static final long VALIDITY_TIME_MS = 10 * 24 * 60 * 60 * 1000;// 10
|
||||
// days Validity
|
||||
public static final long VALIDITY_TIME_MS = 2 * 60 * 60 * 1000; // 2 hours validity
|
||||
|
||||
public static final long ACCESS_TOKEN_VALIDITY_SECONDS = 30 * 24 * 60 * 60;
|
||||
public static final String SECRET_KEY = "realnet";
|
||||
public static final String TOKEN_PREFIX = "Bearer ";
|
||||
public static final String HEADER_STRING = "Authorization";
|
||||
public static final String AUTHORITIES_KEY = "scopes";
|
||||
|
||||
|
||||
public static final String JWT_ILLEGAL_ARGUMENT_MESSAGE = "An error occured during getting username from token";
|
||||
public static final String JWT_EXPIRED_MESSAGE = "The token is expired and not valid anymore";
|
||||
public static final String JWT_SIGNATURE_MESSAGE = "Authentication Failed. Username or Password not valid.";
|
||||
public static final String UNAUTHORIZED_MESSAGE = "You are not authorized to view the resource";
|
||||
public static final String FORBIDDEN_MESSAGE = "You don't have the right to access to this resource";
|
||||
public static final String INVALID_DATA_MESSAGE = "One or many parameters in the request's body are invalid";
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.realnet.config;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.web.AuthenticationEntryPoint;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.realnet.logging.NoLogging;
|
||||
import com.realnet.logging.SecurityNoLogging;
|
||||
|
||||
@Component
|
||||
public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint, Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/*
|
||||
* This is invoked when user tries to access a secured REST resource without supplying any credentials
|
||||
* We should just send a 401 Unauthorized response because there is no 'login page' to redirect to
|
||||
* Here you can place any message you want
|
||||
* */
|
||||
@NoLogging
|
||||
@Override
|
||||
public void commence(HttpServletRequest request, HttpServletResponse response,
|
||||
AuthenticationException authException) throws IOException {
|
||||
|
||||
//response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized");
|
||||
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.realnet.config;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import com.realnet.logging.NoLogging;
|
||||
|
||||
import io.jsonwebtoken.ExpiredJwtException;
|
||||
import io.jsonwebtoken.SignatureException;
|
||||
|
||||
public class JwtAuthenticationFilter extends OncePerRequestFilter {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(JwtAuthenticationFilter.class);
|
||||
|
||||
@Autowired
|
||||
private UserDetailsService userDetailsService;
|
||||
|
||||
@Autowired
|
||||
private TokenProvider jwtTokenUtil;
|
||||
|
||||
|
||||
//////////
|
||||
|
||||
protected void configure(HttpSecurity http) throws Exception
|
||||
{
|
||||
http
|
||||
.csrf().disable()
|
||||
.authorizeRequests()
|
||||
.antMatchers(HttpMethod.OPTIONS,"/path/to/allow").permitAll()//allow CORS option calls
|
||||
.antMatchers("/resources/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
.formLogin()
|
||||
.and()
|
||||
.httpBasic();
|
||||
}
|
||||
|
||||
|
||||
//////////////
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@NoLogging
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest req, HttpServletResponse res, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
String header = req.getHeader(JWTConstant.HEADER_STRING);
|
||||
//System.out.println("HEADER => {}" + header);
|
||||
String username = null;
|
||||
String email = null;
|
||||
String authToken = null;
|
||||
if (header != null && header.startsWith(JWTConstant.TOKEN_PREFIX)) {
|
||||
authToken = header.replace(JWTConstant.TOKEN_PREFIX, "");
|
||||
try {
|
||||
username = jwtTokenUtil.getUsernameFromToken(authToken);
|
||||
//logger.info("getting username from token : {}" + username);
|
||||
email = jwtTokenUtil.getEmailFromToken(authToken);
|
||||
//logger.info("getting email from token : {}" + email);
|
||||
//System.out.println("email => {}" + email);
|
||||
|
||||
} catch (IllegalArgumentException e) {
|
||||
logger.error("an error occured during getting username from token", e);
|
||||
} catch (ExpiredJwtException e) {
|
||||
logger.warn("the token is expired and not valid anymore", e);
|
||||
} catch (SignatureException e) {
|
||||
logger.error("Authentication Failed. Username or Password not valid.");
|
||||
}
|
||||
} else {
|
||||
logger.warn("couldn't find bearer string, will ignore the header");
|
||||
}
|
||||
//if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
|
||||
if (email != null && SecurityContextHolder.getContext().getAuthentication() == null) {
|
||||
|
||||
UserDetails userDetails = userDetailsService.loadUserByUsername(email);
|
||||
|
||||
if (jwtTokenUtil.validateToken(authToken, userDetails)) {
|
||||
UsernamePasswordAuthenticationToken authentication = jwtTokenUtil.getAuthentication(authToken,
|
||||
SecurityContextHolder.getContext().getAuthentication(), userDetails);
|
||||
// UsernamePasswordAuthenticationToken authentication = new
|
||||
// UsernamePasswordAuthenticationToken(userDetails, null, Arrays.asList(new
|
||||
// SimpleGrantedAuthority("ROLE_ADMIN")));
|
||||
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(req));
|
||||
logger.debug("authenticated user " + email + ", setting security context");
|
||||
SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||
}
|
||||
}
|
||||
chain.doFilter(req, res);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.realnet.config;
|
||||
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
|
||||
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
|
||||
|
||||
import com.realnet.logging.NoLogging;
|
||||
|
||||
@Configuration
|
||||
public class MessageSourceConfig {
|
||||
|
||||
@NoLogging
|
||||
@Bean
|
||||
public MessageSource messageSource() {
|
||||
ReloadableResourceBundleMessageSource messageSource
|
||||
= new ReloadableResourceBundleMessageSource();
|
||||
|
||||
messageSource.setBasename("classpath:messages");
|
||||
messageSource.setDefaultEncoding("UTF-8");
|
||||
return messageSource;
|
||||
}
|
||||
@NoLogging
|
||||
@Bean
|
||||
public LocalValidatorFactoryBean getValidator() {
|
||||
LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean();
|
||||
bean.setValidationMessageSource(messageSource());
|
||||
return bean;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
package com.realnet.config;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.info.ProjectInfoProperties.Build;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.caffeine.CaffeineCacheManager;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.WebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.web.access.channel.ChannelProcessingFilter;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.CorsConfigurationSource;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import com.realnet.logging.NoLogging;
|
||||
|
||||
|
||||
/*
|
||||
* @EnableGlobalMethodSecurity annotation is what enables the @PreAuthorize annotation.
|
||||
* */
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||
|
||||
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
//
|
||||
// @Value("${oauth.resource:http://sercverUsingOAuth2}")
|
||||
// private String baseUrl;
|
||||
//
|
||||
// @Value("${oauth.authorize:http://sercverUsingOAuth2/rest/oauth/token}")
|
||||
// private String authorizeUrl;
|
||||
//
|
||||
// @Value("${oauth.token:http://sercverUsingOAuth2/rest/oauth/token}")
|
||||
// private String tokenUrl;
|
||||
|
||||
|
||||
@Autowired
|
||||
private UserDetailsService userDetailsService;
|
||||
|
||||
@Autowired
|
||||
private JwtAuthenticationEntryPoint unauthorizedHandler;
|
||||
|
||||
|
||||
/////
|
||||
|
||||
public void configure12(WebSecurity web) throws Exception {
|
||||
web.ignoring().antMatchers(HttpMethod.OPTIONS, "/**");
|
||||
}
|
||||
|
||||
|
||||
// protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// auth.authenticationProvider(userAuthenticationProvider);
|
||||
// }
|
||||
////
|
||||
//
|
||||
//
|
||||
// protected void configure(HttpSecurity http) throws Exception {
|
||||
// http
|
||||
// .cors() // <-- This let it use "corsConfigurationSource" bean.
|
||||
// .and()
|
||||
// .authorizeRequests()
|
||||
// .anyRequest().authenticated()
|
||||
// .and()
|
||||
//
|
||||
// }
|
||||
|
||||
@Bean
|
||||
protected CorsConfigurationSource corsConfigurationSource() {
|
||||
final CorsConfiguration configuration = new CorsConfiguration();
|
||||
|
||||
configuration.setAllowedOrigins(Collections.singletonList("http://localhost:3000"));
|
||||
configuration.setAllowedMethods(Arrays.asList("HEAD", "GET", "POST", "PUT", "DELETE", "PATCH"));
|
||||
|
||||
// NOTE: setAllowCredentials(true) is important,
|
||||
// otherwise, the value of the 'Access-Control-Allow-Origin' header in the response
|
||||
// must not be the wildcard '*' when the request's credentials mode is 'include'.
|
||||
configuration.setAllowCredentials(true);
|
||||
|
||||
// NOTE: setAllowedHeaders is important!
|
||||
// Without it, OPTIONS preflight request will fail with 403 Invalid CORS request
|
||||
configuration.setAllowedHeaders(Arrays.asList(
|
||||
"Authorization",
|
||||
"Accept",
|
||||
"Cache-Control",
|
||||
"Content-Type",
|
||||
"Origin",
|
||||
"ajax", // <-- This is needed for jQuery's ajax request.
|
||||
"x-csrf-token",
|
||||
"x-requested-with"
|
||||
));
|
||||
|
||||
final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
source.registerCorsConfiguration("/**", configuration);
|
||||
return source;
|
||||
}
|
||||
|
||||
|
||||
protected void configure123(HttpSecurity http) throws Exception
|
||||
{
|
||||
http
|
||||
.csrf().disable()
|
||||
.authorizeRequests()
|
||||
.antMatchers("/resources/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
.formLogin()
|
||||
.and()
|
||||
.httpBasic()
|
||||
.and()
|
||||
.oauth2Login()
|
||||
.and()
|
||||
.cors();
|
||||
|
||||
}
|
||||
|
||||
//////
|
||||
|
||||
|
||||
|
||||
|
||||
@NoLogging
|
||||
@Override
|
||||
@Bean
|
||||
public AuthenticationManager authenticationManagerBean() throws Exception {
|
||||
return super.authenticationManagerBean();
|
||||
}
|
||||
|
||||
@NoLogging
|
||||
@Autowired
|
||||
public void globalUserDetails(AuthenticationManagerBuilder auth) throws Exception {
|
||||
auth.userDetailsService(userDetailsService).passwordEncoder(encoder());
|
||||
}
|
||||
|
||||
@NoLogging
|
||||
@Bean
|
||||
public JwtAuthenticationFilter authenticationTokenFilterBean() throws Exception {
|
||||
return new JwtAuthenticationFilter();
|
||||
}
|
||||
|
||||
@NoLogging
|
||||
@Override
|
||||
public void configure(WebSecurity web) throws Exception {
|
||||
// Filters will not get executed for the resources
|
||||
web.ignoring().antMatchers("/", "/resources/**", "/static/**", "/public/**", "/webui/**", "/h2-console/**",
|
||||
"/configuration/**", "/swagger-ui/**", "/swagger-resources/**", "/webjars/**", "/api-docs",
|
||||
"/api-docs/**", "/v2/api-docs/**", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/**/*.png",
|
||||
"/**/*.jpg", "/**/*.gif", "/**/*.svg", "/**/*.ico", "/**/*.ttf", "/**/*.woff", "/**/*.otf");
|
||||
}
|
||||
|
||||
// If Security is not working check application.properties if it is set to
|
||||
// ignore
|
||||
// @Override
|
||||
// protected void configure(HttpSecurity http) throws Exception {
|
||||
// http.exceptionHandling().and().anonymous().and()
|
||||
// // Disable Cross site references
|
||||
// .csrf().disable()
|
||||
// // Add CORS Filter
|
||||
// .addFilterBefore(new CorsFilter(), ChannelProcessingFilter.class)
|
||||
// // Custom Token based authentication based on the header previously given to the
|
||||
// // client
|
||||
// .addFilterBefore(new VerifyTokenFilter(tokenUtil), UsernamePasswordAuthenticationFilter.class)
|
||||
// // custom JSON based authentication by POST of
|
||||
// // {"username":"<name>","password":"<password>"} which sets the token header
|
||||
// // upon authentication
|
||||
// .addFilterBefore(new GenerateTokenForUserFilter("/session", authenticationManager(), tokenUtil),
|
||||
// UsernamePasswordAuthenticationFilter.class)
|
||||
// .authorizeRequests()
|
||||
// //.antMatchers("/api/instructors/**").hasRole("ADMIN")
|
||||
// //.antMatchers("/api/customers/**").hasRole(role)
|
||||
// .anyRequest().authenticated();
|
||||
// }
|
||||
|
||||
@NoLogging
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http.csrf().disable()
|
||||
// Add CORS Filter //http.cors().and().csrf().disable().
|
||||
.addFilterBefore(new CorsFilter(), ChannelProcessingFilter.class).authorizeRequests()
|
||||
.antMatchers("/token/**").permitAll()
|
||||
.antMatchers("/log2/**").permitAll()
|
||||
.antMatchers("/api/**").permitAll()
|
||||
// .antMatchers("/SqlworkbenchSqlcont/**").hasRole("ADMIN")
|
||||
.anyRequest().authenticated()
|
||||
.and().exceptionHandling()
|
||||
.authenticationEntryPoint(unauthorizedHandler).and().sessionManagement()
|
||||
.sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED);
|
||||
http.addFilterBefore(authenticationTokenFilterBean(), UsernamePasswordAuthenticationFilter.class);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* http.csrf().disable().exceptionHandling().authenticationEntryPoint(
|
||||
* unauthorizedHandler).and()
|
||||
* .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).
|
||||
* and().authorizeRequests() .antMatchers("/token/**",
|
||||
* "/signup").permitAll().antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
|
||||
* .anyRequest().authenticated();
|
||||
*
|
||||
* http.addFilterBefore(authenticationTokenFilterBean(),
|
||||
* UsernamePasswordAuthenticationFilter.class);
|
||||
*/
|
||||
|
||||
/*
|
||||
* If You want to store encoded password in your databases and authenticate user
|
||||
* based on encoded password then uncomment the below method and provde an
|
||||
* encoder
|
||||
*/
|
||||
@NoLogging
|
||||
@Bean
|
||||
public BCryptPasswordEncoder encoder() {
|
||||
return new BCryptPasswordEncoder();
|
||||
}
|
||||
|
||||
// @Bean
|
||||
// public CommonsMultipartResolver getCommonsMultipartResolver() {
|
||||
// CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
|
||||
// multipartResolver.setMaxUploadSize(104857600); // 20MB(20971520 Byte) // 100 mb(104,857,600 Byte)
|
||||
// multipartResolver.setMaxInMemorySize(1048576); // 1MB
|
||||
// return multipartResolver;
|
||||
// }
|
||||
|
||||
// @Bean
|
||||
// public FilterRegistrationBean<HttpLoggingFilter> foo(final HttpLoggingFilter filter) {
|
||||
// final FilterRegistrationBean<HttpLoggingFilter> bean = new FilterRegistrationBean<>();
|
||||
// bean.setFilter(filter);
|
||||
// // bean.addUrlPatterns("");
|
||||
// return bean;
|
||||
// }
|
||||
|
||||
@Bean
|
||||
public Caffeine caffeineConfig() {
|
||||
return Caffeine.newBuilder().expireAfterWrite(60, TimeUnit.MINUTES);
|
||||
}
|
||||
@Bean
|
||||
public CacheManager cacheManager(Caffeine caffeine) {
|
||||
CaffeineCacheManager caffeineCacheManager = new CaffeineCacheManager();
|
||||
caffeineCacheManager.setCaffeine(caffeine);
|
||||
return caffeineCacheManager;
|
||||
}
|
||||
// @Bean
|
||||
// public OAuth2RestOperations oauth2RestTemplate() {
|
||||
// AccessTokenRequest atr = new DefaultAccessTokenRequest();
|
||||
// return new OAuth2RestTemplate(resource(),
|
||||
// new DefaultOAuth2ClientContext(atr));
|
||||
// }
|
||||
//
|
||||
// @Bean
|
||||
// protected OAuth2ProtectedResourceDetails resource() {
|
||||
// AuthorizationCodeResourceDetails resource = new AuthorizationCodeResourceDetails();
|
||||
// resource.setAccessTokenUri("https://oauth2.googleapis.com/token");
|
||||
// resource.setUserAuthorizationUri(authorizeUrl);
|
||||
// resource.setClientId("508783521234-160if49q1ih8mbmkdc1g7km1c5a6hc95.apps.googleusercontent.com");
|
||||
// resource.setClientSecret("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");
|
||||
// resource.setGrantType("authorization_code");
|
||||
// List<String> l = new ArrayList<String>();
|
||||
// l.add("https://www.googleapis.com/auth/gmail.modify");
|
||||
// resource.setScope(l);
|
||||
// return resource;
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.realnet.config;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class SequenceGeneratorService {
|
||||
|
||||
|
||||
public void sequence() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.realnet.config;
|
||||
|
||||
import static com.google.common.collect.Lists.newArrayList;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import com.fasterxml.classmate.TypeResolver;
|
||||
import com.realnet.logging.NoLogging;
|
||||
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.builders.ResponseMessageBuilder;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.service.ApiKey;
|
||||
import springfox.documentation.service.AuthorizationScope;
|
||||
import springfox.documentation.service.SecurityReference;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spi.service.contexts.SecurityContext;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfig {
|
||||
|
||||
@Autowired
|
||||
private TypeResolver typeResolver;
|
||||
|
||||
public static final String AUTHORIZATION_HEADER = "Authorization";
|
||||
public static final String DEFAULT_INCLUDE_PATTERN = "/api/.*";
|
||||
|
||||
@NoLogging
|
||||
private ApiKey apiKey() {
|
||||
// return new ApiKey("Authorization", "", "header"); // <<< === Create a Header
|
||||
//return new ApiKey("JWT", "Authorization", "header");
|
||||
// (We are createing header named "Authorization" here)
|
||||
return new ApiKey("JWT", AUTHORIZATION_HEADER, "header");
|
||||
|
||||
}
|
||||
|
||||
// This path will be called when swagger is loaded first time to get a token
|
||||
/*
|
||||
* @Bean public UiConfiguration uiConfig() { return new
|
||||
* UiConfiguration("session"); }
|
||||
*/
|
||||
|
||||
@NoLogging
|
||||
private SecurityContext securityContext() {
|
||||
return SecurityContext.builder().securityReferences(defaultAuth()).build();
|
||||
}
|
||||
|
||||
@NoLogging
|
||||
private List<SecurityReference> defaultAuth() {
|
||||
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
|
||||
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
|
||||
authorizationScopes[0] = authorizationScope;
|
||||
return Arrays.asList(new SecurityReference("JWT", authorizationScopes));
|
||||
}
|
||||
|
||||
// ApiInfo apiInfo() {
|
||||
// return new ApiInfoBuilder()
|
||||
// .title("API Reference")
|
||||
// .version("1.0.0")
|
||||
// .build();
|
||||
// }
|
||||
|
||||
@NoLogging
|
||||
ApiInfo realItApiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("RealIt APIs")
|
||||
.version("1.0.0")
|
||||
.build();
|
||||
}
|
||||
|
||||
// @Bean
|
||||
// public Docket customImplementation() {
|
||||
// return new Docket(DocumentationType.SWAGGER_2)
|
||||
// .groupName("public")
|
||||
// .apiInfo(apiInfo())
|
||||
// .securityContexts(Arrays.asList(securityContext()))
|
||||
// .securitySchemes(newArrayList(apiKey()))
|
||||
// .select()
|
||||
// .paths(PathSelectors.any())
|
||||
// // .apis(RequestHandlerSelectors.any()) // If you want to list all the apis
|
||||
// // including springboots own
|
||||
// .apis(RequestHandlerSelectors.basePackage("com.app.api"))
|
||||
// .build()
|
||||
// .pathMapping("/")
|
||||
// .useDefaultResponseMessages(false)
|
||||
// .directModelSubstitute(LocalDate.class, String.class)
|
||||
// .genericModelSubstitutes(ResponseEntity.class);
|
||||
// }
|
||||
|
||||
@NoLogging
|
||||
@Bean
|
||||
public Docket realItCustomeImplementation() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.groupName("realit")
|
||||
.apiInfo(realItApiInfo())
|
||||
.securityContexts(Arrays.asList(securityContext()))
|
||||
.securitySchemes(newArrayList(apiKey()))
|
||||
.select()
|
||||
.paths(PathSelectors.any())
|
||||
.apis(RequestHandlerSelectors.basePackage("com.realnet")).build().pathMapping("/")
|
||||
.useDefaultResponseMessages(false)
|
||||
.globalResponseMessage(RequestMethod.GET, newArrayList(
|
||||
new ResponseMessageBuilder()
|
||||
.code(500)
|
||||
.message("Internal Server Error").build(),
|
||||
//.responseModel(new ModelRef("Error")).build(),
|
||||
new ResponseMessageBuilder()
|
||||
.code(403)
|
||||
.message("Forbidden!").build(),
|
||||
new ResponseMessageBuilder()
|
||||
.code(400)
|
||||
.message("Bad Request").build()
|
||||
//.responseModel(new ModelRef("Error")).build()
|
||||
))
|
||||
.directModelSubstitute(LocalDate.class, String.class)
|
||||
.genericModelSubstitutes(ResponseEntity.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.realnet.config;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.realnet.logging.NoLogging;
|
||||
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.Jws;
|
||||
import io.jsonwebtoken.JwtParser;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
|
||||
@Component
|
||||
public class TokenProvider implements Serializable {
|
||||
// private static final Logger logger = LoggerFactory.getLogger(TokenProvider.class);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// get subject (sub) from token
|
||||
@NoLogging
|
||||
public String getUsernameFromToken(String token) {
|
||||
return getClaimFromToken(token, Claims::getSubject);
|
||||
}
|
||||
|
||||
@NoLogging
|
||||
public String getEmailFromToken(String token) {
|
||||
String email = null;
|
||||
try {
|
||||
Claims claims = getAllClaimsFromToken(token);
|
||||
email = claims.getSubject();
|
||||
} catch (Exception e) {
|
||||
email = null;
|
||||
}
|
||||
// logger.info("email = {} ", email);
|
||||
return email;
|
||||
}
|
||||
|
||||
@NoLogging
|
||||
public List<String> getRolesFromToken(String token) {
|
||||
List<String> roles = null;
|
||||
try {
|
||||
Claims claims = getAllClaimsFromToken(token);
|
||||
roles = Arrays.asList((String) claims.get(JWTConstant.AUTHORITIES_KEY));
|
||||
// logger.info("roles = {} ", roles);
|
||||
} catch (Exception e) {
|
||||
roles = null;
|
||||
}
|
||||
return roles;
|
||||
}
|
||||
|
||||
// get expiration (exp) from token
|
||||
public Date getExpirationDateFromToken(String token) {
|
||||
return getClaimFromToken(token, Claims::getExpiration);
|
||||
}
|
||||
|
||||
@NoLogging
|
||||
public <T> T getClaimFromToken(String token, Function<Claims, T> claimsResolver) {
|
||||
final Claims claims = getAllClaimsFromToken(token);
|
||||
return claimsResolver.apply(claims);
|
||||
}
|
||||
|
||||
@NoLogging
|
||||
private Claims getAllClaimsFromToken(String token) {
|
||||
return Jwts.parser().setSigningKey(JWTConstant.SECRET_KEY).parseClaimsJws(token).getBody();
|
||||
}
|
||||
|
||||
@NoLogging
|
||||
private Boolean isTokenExpired(String token) {
|
||||
final Date expiration = getExpirationDateFromToken(token);
|
||||
return expiration.before(new Date());
|
||||
}
|
||||
|
||||
@NoLogging
|
||||
public String generateToken(Authentication authentication) {
|
||||
final String authorities = authentication.getAuthorities().stream().map(GrantedAuthority::getAuthority)
|
||||
.collect(Collectors.joining(","));
|
||||
// logger.info("authorities = {} ", authorities);
|
||||
final List<String> AuthorityList = authentication.getAuthorities().stream().map(GrantedAuthority::getAuthority)
|
||||
.collect(Collectors.toList());
|
||||
//logger.info("authentication.getName() = {} ", authentication.getName());
|
||||
//logger.info("Authority List = {}", AuthorityList);
|
||||
return Jwts.builder().setSubject(authentication.getName()) // USER NAME OR EMAIL
|
||||
.claim(JWTConstant.AUTHORITIES_KEY, authorities) // ROLES
|
||||
.signWith(SignatureAlgorithm.HS256, JWTConstant.SECRET_KEY).setIssuedAt(new Date(System.currentTimeMillis()))
|
||||
.setExpiration(new Date(System.currentTimeMillis() + JWTConstant.ACCESS_TOKEN_VALIDITY_SECONDS * 1000)).compact();
|
||||
}
|
||||
|
||||
@NoLogging
|
||||
public Boolean validateToken(String token, UserDetails userDetails) {
|
||||
// CustomUserDetails user = (CustomUserDetails) userDetails;
|
||||
// System.out.println("validateToken -> jwtUser : " + user);
|
||||
// return (username.equals(user.getUsername()) && !isTokenExpired(token));
|
||||
|
||||
// final String username = getUsernameFromToken(token);
|
||||
final String email = getEmailFromToken(token);
|
||||
return (email.equals(userDetails.getUsername()) && !isTokenExpired(token));
|
||||
|
||||
}
|
||||
|
||||
@NoLogging
|
||||
UsernamePasswordAuthenticationToken getAuthentication(final String token, final Authentication existingAuth,
|
||||
final UserDetails userDetails) {
|
||||
|
||||
final JwtParser jwtParser = Jwts.parser().setSigningKey(JWTConstant.SECRET_KEY);
|
||||
|
||||
final Jws<Claims> claimsJws = jwtParser.parseClaimsJws(token);
|
||||
|
||||
final Claims claims = claimsJws.getBody();
|
||||
|
||||
final Collection<? extends GrantedAuthority> authorities = Arrays
|
||||
.stream(claims.get(JWTConstant.AUTHORITIES_KEY).toString().split(",")).map(SimpleGrantedAuthority::new)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return new UsernamePasswordAuthenticationToken(userDetails, "", authorities);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.realnet.exceptions;
|
||||
|
||||
public class InvalidUserDataException extends RuntimeException {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public InvalidUserDataException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.realnet.exceptions;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NOT_FOUND)
|
||||
public class ResourceNotFoundException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ResourceNotFoundException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.realnet.exceptions;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NOT_FOUND)
|
||||
public class StorageException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public StorageException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public StorageException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.realnet.fnd.controller;
|
||||
|
||||
import org.springframework.stereotype.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@ApiIgnore
|
||||
@Controller // Dont use RestController as this method is mapping to a static file not a JSON
|
||||
public class MainController {
|
||||
|
||||
@RequestMapping(value={"/"})
|
||||
public String index() {
|
||||
return "index.html";
|
||||
}
|
||||
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
package com.realnet.fnd.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.realnet.exceptions.ResourceNotFoundException;
|
||||
import com.realnet.fnd.entity.Rn_Dynamic_Transaction;
|
||||
import com.realnet.fnd.response.Rn_DynamicTransactionResponse;
|
||||
import com.realnet.fnd.service.Rn_DynamicTransactionService;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Api(tags = { "Rn_Dynamic_Transaction" })
|
||||
public class Rn_DynamicTransactionController {
|
||||
|
||||
@Autowired
|
||||
private Rn_DynamicTransactionService rn_dynamicTransactionService;
|
||||
|
||||
// @Autowired
|
||||
// private TokenUtil tokenUtil;
|
||||
|
||||
// GET ALL
|
||||
@ApiOperation(value = "List of Dynamic Transaction", response = Rn_DynamicTransactionResponse.class)
|
||||
@GetMapping("/dynamic_transaction/all")
|
||||
public Rn_DynamicTransactionResponse getDynamicTx(
|
||||
@RequestParam(value = "page", defaultValue = "0", required = false) int page,
|
||||
@RequestParam(value = "size", defaultValue = "20", required = false) int size) {
|
||||
|
||||
Rn_DynamicTransactionResponse resp = new Rn_DynamicTransactionResponse();
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Rn_Dynamic_Transaction> result = rn_dynamicTransactionService.getAll(paging);
|
||||
resp.setPageStats(result, true);
|
||||
resp.setItems(result.getContent());
|
||||
return resp;
|
||||
}
|
||||
|
||||
// GET BY FROM ID (GRID)
|
||||
@ApiOperation(value = "Get A Dynamic Transaction")
|
||||
@GetMapping("/dynamic_transaction")
|
||||
public ResponseEntity<List<Rn_Dynamic_Transaction>> getDynamicTxByFormId(
|
||||
@RequestParam(value = "form_id") int form_id) {
|
||||
List<Rn_Dynamic_Transaction> rn_dynamic_transaction = rn_dynamicTransactionService.getByFormId(form_id);
|
||||
return ResponseEntity.ok().body(rn_dynamic_transaction);
|
||||
}
|
||||
|
||||
// SAVE
|
||||
@ApiOperation(value = "Add A New Dynamic Transaction", response = Rn_DynamicTransactionResponse.class)
|
||||
@PostMapping("/dynamic_transaction")
|
||||
public ResponseEntity<Rn_Dynamic_Transaction> createDynamicTx(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
@Valid @RequestBody Rn_Dynamic_Transaction rn_dynamic_transaction) {
|
||||
// String userId = tokenUtil.getUserId(authToken);
|
||||
// rn_dynamic_transaction.setCreatedBy(userId);
|
||||
// rn_dynamic_transaction.setAccountId(userId);
|
||||
Rn_Dynamic_Transaction savedRn_Dynamic_Transaction = rn_dynamicTransactionService.save(rn_dynamic_transaction);
|
||||
if (savedRn_Dynamic_Transaction == null) {
|
||||
throw new ResourceNotFoundException("Dynamic Transaction Is Not Saved");
|
||||
}
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(savedRn_Dynamic_Transaction);
|
||||
}
|
||||
|
||||
// GET BY ID
|
||||
@ApiOperation(value = "Get a Single Form", response = Rn_Dynamic_Transaction.class)
|
||||
@GetMapping("/dynamic_transaction/{id}")
|
||||
public ResponseEntity<Rn_Dynamic_Transaction> getById(@PathVariable(value = "id") int id,
|
||||
@RequestParam(value = "form_id") int form_id) {
|
||||
Rn_Dynamic_Transaction dynamicTransaction = rn_dynamicTransactionService.getByIdAndFormId(id, form_id);
|
||||
return ResponseEntity.ok().body(dynamicTransaction);
|
||||
}
|
||||
|
||||
// UPDATE
|
||||
@ApiOperation(value = "Update A Dynamic Transaction", response = Rn_Dynamic_Transaction.class)
|
||||
@PutMapping("/dynamic_transaction/{id}")
|
||||
public ResponseEntity<Rn_Dynamic_Transaction> updateDynamicTx(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
@PathVariable(value = "id") int id, @RequestParam(value = "form_id") int form_id,
|
||||
@Valid @RequestBody Rn_Dynamic_Transaction rn_dynamic_transaction) {
|
||||
// String userId = tokenUtil.getUserId(authToken);
|
||||
// rn_dynamic_transaction.setUpdatedBy(userId);
|
||||
Rn_Dynamic_Transaction updatedDynamicTransaction = rn_dynamicTransactionService.updateByFormId(id, form_id,
|
||||
rn_dynamic_transaction);
|
||||
return ResponseEntity.status(HttpStatus.ACCEPTED).body(updatedDynamicTransaction);
|
||||
}
|
||||
|
||||
// DELETE
|
||||
@DeleteMapping("/dynamic_transaction/{id}")
|
||||
public ResponseEntity<Map<String, Boolean>> deleteDynamicTx(@PathVariable(value = "id") int id) {
|
||||
boolean deleted = rn_dynamicTransactionService.deleteById(id);
|
||||
Map<String, Boolean> response = new HashMap<>();
|
||||
response.put("deleted", Boolean.TRUE);
|
||||
// response.put("deleted", deleted);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(response);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
//package com.realnet.fnd.controller;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.HashMap;
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//
|
||||
//import javax.validation.Valid;
|
||||
//
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.http.HttpHeaders;
|
||||
//import org.springframework.http.HttpStatus;
|
||||
//import org.springframework.http.MediaType;
|
||||
//import org.springframework.http.ResponseEntity;
|
||||
//import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
//import org.springframework.web.bind.annotation.GetMapping;
|
||||
//import org.springframework.web.bind.annotation.PathVariable;
|
||||
//import org.springframework.web.bind.annotation.PostMapping;
|
||||
//import org.springframework.web.bind.annotation.PutMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestBody;
|
||||
//import org.springframework.web.bind.annotation.RequestHeader;
|
||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestParam;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//
|
||||
//import com.realnet.FromExtensionJson.Entity.FromExtensionJson_t;
|
||||
//import com.realnet.FromExtensionJson.Services.FromExtensionJson_Service;
|
||||
//import com.realnet.exceptions.ResourceNotFoundException;
|
||||
//import com.realnet.fnd.entity.Rn_Ext_Fields;
|
||||
//import com.realnet.fnd.service.ExtFieldService;
|
||||
//import com.realnet.users.entity1.AppUser;
|
||||
//import com.realnet.users.service1.AppUserServiceImpl;
|
||||
//
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//
|
||||
//@RestController
|
||||
//@RequestMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
//@Api(tags = { "Extension Fields" })
|
||||
//public class Rn_ExtensionController {
|
||||
//
|
||||
// @Value("${angularProjectPath}")
|
||||
// private String angularProjectPath;
|
||||
//
|
||||
// @Autowired
|
||||
// private ExtFieldService extFieldService;
|
||||
//
|
||||
//
|
||||
// @Autowired
|
||||
// private FromExtensionJson_Service formeExtensionJson_Service;
|
||||
//
|
||||
// @Autowired(required = false)
|
||||
// // private UserService userService;
|
||||
// private AppUserServiceImpl userService;
|
||||
//
|
||||
//// @Autowired
|
||||
//// private TokenUtil tokenUtil;
|
||||
//
|
||||
// // GET ALL
|
||||
// @ApiOperation(value = "List of Extensions")
|
||||
// @GetMapping("/extension")
|
||||
// public ResponseEntity<List<Rn_Ext_Fields>> getExtensions() {
|
||||
// List<Rn_Ext_Fields> result = extFieldService.getAll();
|
||||
// return ResponseEntity.ok().body(result);
|
||||
// }
|
||||
//
|
||||
// // GET BY ID
|
||||
// @ApiOperation(value = "Get an Extension")
|
||||
// @GetMapping("/extension/{id}")
|
||||
// public ResponseEntity<Rn_Ext_Fields> getExtensionById(@PathVariable(value = "id") int id) {
|
||||
// Rn_Ext_Fields rn_ext_fields = extFieldService.getById(id);
|
||||
// return ResponseEntity.ok().body(rn_ext_fields);
|
||||
// }
|
||||
//
|
||||
// // SAVE
|
||||
// @ApiOperation(value = "Add new Extension", response = Rn_Ext_Fields.class)
|
||||
// @PostMapping("/extension")
|
||||
// public ResponseEntity<Rn_Ext_Fields> saveExtension(
|
||||
// @RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
// @Valid @RequestBody Rn_Ext_Fields rn_ext_fields) {
|
||||
// // String userId = tokenUtil.getUserId(authToken);
|
||||
// AppUser loggedInUser = userService.getLoggedInUser();
|
||||
// // rn_ext_fields.setCreated_by(loggedInUser.getUserId());
|
||||
// rn_ext_fields.setAccount_id(loggedInUser.getAccount().getAccount_id());
|
||||
// Rn_Ext_Fields savedRn_Ext_Fields = extFieldService.save(rn_ext_fields);
|
||||
// if (savedRn_Ext_Fields == null) {
|
||||
// throw new ResourceNotFoundException("Rn_Ext_Field is not saved");
|
||||
// }
|
||||
// return ResponseEntity.status(HttpStatus.CREATED).body(savedRn_Ext_Fields);
|
||||
// }
|
||||
//
|
||||
// // UPDATE
|
||||
// @ApiOperation(value = "Update an Extension", response = Rn_Ext_Fields.class)
|
||||
// @PutMapping("/extension/{id}")
|
||||
// public ResponseEntity<Rn_Ext_Fields> updateRn_Ext_Field(
|
||||
// @RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
// @PathVariable(value = "id") int id, @Valid @RequestBody Rn_Ext_Fields rn_ext_fields) {
|
||||
//// String userId = tokenUtil.getUserId(authToken);
|
||||
//// // teacher.setAccountId(userId);
|
||||
//// rn_ext_fields.setUpdatedBy(userId);
|
||||
// Rn_Ext_Fields updatedRn_Ext_Field = extFieldService.updateById(id, rn_ext_fields);
|
||||
// return ResponseEntity.status(HttpStatus.ACCEPTED).body(updatedRn_Ext_Field);
|
||||
// }
|
||||
//
|
||||
// // DELETE
|
||||
// @DeleteMapping("/extension/{id}")
|
||||
// public ResponseEntity<Map<String, Boolean>> deleteRn_Ext_Field(@PathVariable(value = "id") int id) {
|
||||
// boolean deleted = extFieldService.deleteById(id);
|
||||
// Map<String, Boolean> response = new HashMap<>();
|
||||
// if (deleted) {
|
||||
// response.put("deleted", Boolean.TRUE);
|
||||
// return ResponseEntity.status(HttpStatus.OK).body(response);
|
||||
// }
|
||||
// return ResponseEntity.status(HttpStatus.NOT_FOUND).body(response);
|
||||
// }
|
||||
//
|
||||
//// @GetMapping("/lookup_values")
|
||||
//// public ResponseEntity<List<String>> getLookUps() {
|
||||
//// List<String> result = extFieldService.getLookupValues();
|
||||
//// System.out.println(result);
|
||||
//// return ResponseEntity.ok().body(result);
|
||||
//// }
|
||||
////
|
||||
//// @GetMapping("/datatypes")
|
||||
//// public ResponseEntity<List<String>> getDataTypes() {
|
||||
//// List<String> result = extFieldService.getDataTypeValues();
|
||||
//// System.out.println(result);
|
||||
//// return ResponseEntity.ok().body(result);
|
||||
//// }
|
||||
//
|
||||
// @GetMapping("/extension_build/{formId}")
|
||||
// public ResponseEntity<?> buildExtension(@RequestParam(value = "account_id", required = false) String account_id,
|
||||
// @RequestParam(value = "form_code", required = false) String form_code, @PathVariable Integer formId) {
|
||||
//
|
||||
// ArrayList<String> list = new ArrayList<>();
|
||||
//
|
||||
// System.out.println("Acc Id" + account_id + " Form Code = " + form_code);
|
||||
// String formCode = extFieldService.buildExtensionByFormCode(account_id, form_code,formId);
|
||||
// list.add(formCode);
|
||||
// Map<String, Boolean> res = new HashMap<String, Boolean>();
|
||||
// res.put("build", true);
|
||||
// FromExtensionJson_t json_t = new FromExtensionJson_t();
|
||||
// json_t.setAccount_id(account_id);
|
||||
// json_t.setForm_code(form_code);
|
||||
//
|
||||
// json_t.setJsonObject(formCode);
|
||||
//
|
||||
// formeExtensionJson_Service.Savedata(json_t);
|
||||
//
|
||||
//
|
||||
// return ResponseEntity.ok().body(list);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.realnet.fnd.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Forms_Setup;
|
||||
import com.realnet.fnd.response.Rn_Forms_SetupResponse;
|
||||
import com.realnet.fnd.service.Rn_Forms_Setup_Service;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Api(tags = { "Rn_Forms_Setup" })
|
||||
public class Rn_Forms_Setup_Controller {
|
||||
|
||||
@Autowired
|
||||
private Rn_Forms_Setup_Service rn_forms_setup_service;
|
||||
|
||||
// @Autowired
|
||||
// private TokenUtil tokenUtil;
|
||||
|
||||
// GET ALL
|
||||
@ApiOperation(value = "List of Forms", response = Rn_Forms_SetupResponse.class)
|
||||
@GetMapping("/form_setup")
|
||||
public Rn_Forms_SetupResponse getForms(
|
||||
@RequestParam(value = "page", defaultValue = "0", required = false) Integer page,
|
||||
@RequestParam(value = "size", defaultValue = "20", required = false) Integer size) {
|
||||
Rn_Forms_SetupResponse resp = new Rn_Forms_SetupResponse();
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Rn_Forms_Setup> result = rn_forms_setup_service.getAll(paging);
|
||||
resp.setPageStats(result, true);
|
||||
resp.setItems(result.getContent());
|
||||
return resp;
|
||||
}
|
||||
|
||||
// GET BY ID
|
||||
@ApiOperation(value = "Get a Form", response = Rn_Forms_Setup.class)
|
||||
@GetMapping("/form_setup/{id}")
|
||||
public ResponseEntity<Rn_Forms_Setup> getFormsById(@PathVariable(value = "id") int id) {
|
||||
Rn_Forms_Setup rn_forms_setup = rn_forms_setup_service.getById(id);
|
||||
return ResponseEntity.ok().body(rn_forms_setup);
|
||||
}
|
||||
|
||||
// SAVE
|
||||
@ApiOperation(value = "Add A New Form", response = Rn_Forms_Setup.class)
|
||||
@PostMapping("/form_setup")
|
||||
public ResponseEntity<Rn_Forms_Setup> createRn_Forms_Setup(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
@Valid @RequestBody Rn_Forms_Setup rn_forms_setup) {
|
||||
// String userId = tokenUtil.getUserId(authToken);
|
||||
// rn_forms_setup.setCreatedBy(userId);
|
||||
// rn_forms_setup.setAccountId(userId);
|
||||
Rn_Forms_Setup savedRn_Forms_Setup = rn_forms_setup_service.save(rn_forms_setup);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(savedRn_Forms_Setup);
|
||||
}
|
||||
|
||||
// UPDATE
|
||||
@ApiOperation(value = "Update A Form", response = Rn_Forms_Setup.class)
|
||||
@PutMapping("/form_setup/{id}")
|
||||
public ResponseEntity<Rn_Forms_Setup> updateRn_Forms_Setup(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
@PathVariable(value = "id") Integer id, @Valid @RequestBody Rn_Forms_Setup rn_forms_setup) {
|
||||
// String userId = tokenUtil.getUserId(authToken);
|
||||
// rn_forms_setup.setUpdatedBy(userId);
|
||||
Rn_Forms_Setup updatedRn_Forms_Setup = rn_forms_setup_service.updateById(id, rn_forms_setup);
|
||||
return ResponseEntity.status(HttpStatus.ACCEPTED).body(updatedRn_Forms_Setup);
|
||||
}
|
||||
|
||||
// DELETE
|
||||
@DeleteMapping("/form_setup/{id}")
|
||||
public ResponseEntity<Map<String, Boolean>> deleteRn_Forms_Setup(@PathVariable(value = "id") Integer id) {
|
||||
boolean deleted = rn_forms_setup_service.deleteById(id);
|
||||
Map<String, Boolean> response = new HashMap<>();
|
||||
response.put("deleted", Boolean.TRUE);
|
||||
// response.put("deleted", deleted);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(response);
|
||||
}
|
||||
|
||||
// BUILD DYNAMIC FORM
|
||||
@GetMapping("/dynamic_form_build")
|
||||
public ResponseEntity<Map<String, Boolean>> buildDynamicForm(@RequestParam(value = "form_id", defaultValue = "0") int form_id) {
|
||||
System.out.println("Dynamic form build form start");
|
||||
rn_forms_setup_service.buildDynamicForm(form_id);
|
||||
Map<String, Boolean> response = new HashMap<>();
|
||||
response.put("deleted", Boolean.TRUE);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(response);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package com.realnet.fnd.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Function_Register;
|
||||
import com.realnet.fnd.response.Rn_Function_Register_Response;
|
||||
import com.realnet.fnd.service.Rn_Function_Register_Service;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Api(tags = { "Function Register" })
|
||||
public class Rn_Function_Register_Controller {
|
||||
|
||||
@Autowired
|
||||
private Rn_Function_Register_Service rn_menu_register_service;
|
||||
|
||||
// @Autowired
|
||||
// private TokenUtil tokenUtil;
|
||||
|
||||
// GET ALL
|
||||
@ApiOperation(value = "List of Functions", response = Rn_Function_Register_Response.class)
|
||||
@GetMapping("/function-register")
|
||||
public Rn_Function_Register_Response getFunctions(
|
||||
@RequestParam(value = "page", defaultValue = "0", required = false) Integer page,
|
||||
@RequestParam(value = "size", defaultValue = "20", required = false) Integer size) {
|
||||
|
||||
// SORTED DATA
|
||||
//Pageable paging = PageRequest.of(page, size, Sort.by("createdAt").descending());
|
||||
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Rn_Function_Register> result = rn_menu_register_service.getAll(paging);
|
||||
Rn_Function_Register_Response resp = new Rn_Function_Register_Response();
|
||||
resp.setPageStats(result, true);
|
||||
resp.setItems(result.getContent());
|
||||
return resp;
|
||||
}
|
||||
|
||||
// GET BY ID
|
||||
@ApiOperation(value = "Get a Function", response = Rn_Function_Register.class)
|
||||
@GetMapping("/function-register/{id}")
|
||||
public ResponseEntity<Rn_Function_Register> getFunctionById(@PathVariable(value = "id") Integer id) {
|
||||
Rn_Function_Register rn_function_register = rn_menu_register_service.getById(id);
|
||||
return ResponseEntity.ok().body(rn_function_register);
|
||||
}
|
||||
|
||||
// SAVE
|
||||
@ApiOperation(value = "Add A New Function", response = Rn_Function_Register.class)
|
||||
@PostMapping("/function-register")
|
||||
public ResponseEntity<Rn_Function_Register> createFunction(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
@Valid @RequestBody Rn_Function_Register rn_function_register) {
|
||||
// String userId = tokenUtil.getUserId(authToken);
|
||||
// rn_function_register.setCreatedBy(userId);
|
||||
// rn_function_register.setAccountId(userId);
|
||||
Rn_Function_Register savedFunction = rn_menu_register_service.save(rn_function_register);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(savedFunction);
|
||||
}
|
||||
|
||||
// UPDATE
|
||||
@ApiOperation(value = "Update A Function", response = Rn_Function_Register.class)
|
||||
@PutMapping("/function-register/{id}")
|
||||
public ResponseEntity<Rn_Function_Register> updateFunction(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
@PathVariable(value = "id") Integer id, @Valid @RequestBody Rn_Function_Register rn_function_register) {
|
||||
// String userId = tokenUtil.getUserId(authToken);
|
||||
// rn_function_register.setUpdatedBy(userId);
|
||||
Rn_Function_Register updatedFunction = rn_menu_register_service.updateById(id, rn_function_register);
|
||||
return ResponseEntity.status(HttpStatus.ACCEPTED).body(updatedFunction);
|
||||
}
|
||||
|
||||
// DELETE
|
||||
@DeleteMapping("/function-register/{id}")
|
||||
public ResponseEntity<Map<String, Boolean>> deleteFunction(@PathVariable(value = "id") Integer id) {
|
||||
boolean deleted = rn_menu_register_service.deleteById(id);
|
||||
Map<String, Boolean> response = new HashMap<>();
|
||||
response.put("deleted", Boolean.TRUE);
|
||||
// response.put("deleted", deleted);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(response);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.realnet.fnd.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Main_Menu;
|
||||
import com.realnet.fnd.response.Rn_Main_Menu_Response;
|
||||
import com.realnet.fnd.service.Rn_Main_Menu_Service;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Api(tags = { "RealNet Menu" })
|
||||
public class Rn_Main_Menu_Controller {
|
||||
|
||||
@Autowired
|
||||
private Rn_Main_Menu_Service rn_main_menu_service;
|
||||
|
||||
// @Autowired
|
||||
// private TokenUtil tokenUtil;
|
||||
|
||||
// GET ALL
|
||||
@ApiOperation(value = "List of Menu", response = Rn_Main_Menu_Response.class)
|
||||
@GetMapping("/realnet-menu")
|
||||
public Rn_Main_Menu_Response getMenus(
|
||||
@RequestParam(value = "page", defaultValue = "0", required = false) Integer page,
|
||||
@RequestParam(value = "size", defaultValue = "20", required = false) Integer size) {
|
||||
|
||||
// SORTED DATA : PageRequest.of(page, size,Sort.by("createdAt").descending());
|
||||
// UN-SORTED DATA : PageRequest.of(page, size);
|
||||
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Rn_Main_Menu> result = rn_main_menu_service.getAll(paging);
|
||||
Rn_Main_Menu_Response resp = new Rn_Main_Menu_Response();
|
||||
resp.setPageStats(result, true);
|
||||
resp.setItems(result.getContent());
|
||||
return resp;
|
||||
}
|
||||
|
||||
// GET BY ID
|
||||
@ApiOperation(value = "Get a Menu", response = Rn_Main_Menu.class)
|
||||
@GetMapping("/realnet-menu/{id}")
|
||||
public ResponseEntity<Rn_Main_Menu> getMenuById(@PathVariable(value = "id") Integer id) {
|
||||
Rn_Main_Menu rn_menu_register = rn_main_menu_service.getById(id);
|
||||
return ResponseEntity.ok().body(rn_menu_register);
|
||||
}
|
||||
|
||||
// getByAccountId
|
||||
// *** NEED MODIFICATION ***
|
||||
// GET BY ACCOUNT_ID
|
||||
@ApiOperation(value = "Get Menu By Accout Id", response = Rn_Main_Menu.class)
|
||||
@GetMapping("/realnet-menu/user-menu")
|
||||
public ResponseEntity<List<Rn_Main_Menu>> getMenuByAccountId(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken) {
|
||||
// String accountId = tokenUtil.getUserId(authToken);
|
||||
// System.out.println("get Menu List by Account Id --> " + accountId);
|
||||
//List<Rn_Main_Menu> rn_menu_register = rn_main_menu_service.getByAccountId(accountId);
|
||||
List<Rn_Main_Menu> rn_menu_register = rn_main_menu_service.getAll();
|
||||
return ResponseEntity.ok().body(rn_menu_register);
|
||||
}
|
||||
|
||||
// SAVE
|
||||
@ApiOperation(value = "Add A New Menu", response = Rn_Main_Menu.class)
|
||||
@PostMapping("/realnet-menu")
|
||||
public ResponseEntity<Rn_Main_Menu> createMenu(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
@Valid @RequestBody Rn_Main_Menu rn_main_menu) {
|
||||
// String userId = tokenUtil.getUserId(authToken);
|
||||
// rn_main_menu.setCreatedBy(userId);
|
||||
// rn_main_menu.setAccountId(userId);
|
||||
Rn_Main_Menu savedMenu = rn_main_menu_service.save(rn_main_menu);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(savedMenu);
|
||||
}
|
||||
|
||||
// UPDATE
|
||||
@ApiOperation(value = "Update A Menu", response = Rn_Main_Menu.class)
|
||||
@PutMapping("/realnet-menu/{id}")
|
||||
public ResponseEntity<Rn_Main_Menu> updateMenu(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
@PathVariable(value = "id") Integer id, @Valid @RequestBody Rn_Main_Menu rn_main_menu) {
|
||||
// String userId = tokenUtil.getUserId(authToken);
|
||||
// rn_main_menu.setUpdatedBy(userId);
|
||||
Rn_Main_Menu updatedMenu = rn_main_menu_service.updateById(id, rn_main_menu);
|
||||
return ResponseEntity.status(HttpStatus.ACCEPTED).body(updatedMenu);
|
||||
}
|
||||
|
||||
// DELETE
|
||||
@DeleteMapping("/realnet-menu/{id}")
|
||||
public ResponseEntity<Map<String, Boolean>> deleteMenu(@PathVariable(value = "id") Integer id) {
|
||||
boolean deleted = rn_main_menu_service.deleteById(id);
|
||||
Map<String, Boolean> response = new HashMap<>();
|
||||
response.put("deleted", Boolean.TRUE);
|
||||
// response.put("deleted", deleted);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(response);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
package com.realnet.fnd.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.realnet.config.TokenProvider;
|
||||
import com.realnet.fnd.entity.Rn_Function_Register;
|
||||
import com.realnet.fnd.entity.Rn_Main_Menu;
|
||||
import com.realnet.fnd.entity.Rn_Menu_Group_Header;
|
||||
import com.realnet.fnd.entity.Rn_Menu_Group_Line;
|
||||
import com.realnet.fnd.entity.Rn_Menu_Register;
|
||||
import com.realnet.fnd.entity.Rn_Sub_Menu;
|
||||
import com.realnet.fnd.response.Rn_Forms_SetupResponse;
|
||||
import com.realnet.fnd.response.Rn_Menu_Group_Response;
|
||||
import com.realnet.fnd.service.Rn_Function_Register_Service;
|
||||
import com.realnet.fnd.service.Rn_Menu_Group_Service;
|
||||
import com.realnet.fnd.service.Rn_Menu_Register_Service;
|
||||
import com.realnet.users.entity1.AppUser;
|
||||
import com.realnet.users.service1.AppUserService;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Api(tags = { "Rn_Menu_Group" })
|
||||
@CrossOrigin("*")
|
||||
public class Rn_Menu_Group_Controller {
|
||||
|
||||
@Autowired
|
||||
private Rn_Menu_Group_Service rn_menu_group_service;
|
||||
|
||||
@Autowired
|
||||
private Rn_Menu_Register_Service rn_menu_register_service;
|
||||
|
||||
@Autowired
|
||||
private Rn_Function_Register_Service rn_function_register_service;
|
||||
|
||||
@Autowired
|
||||
private TokenProvider tokenProvider;
|
||||
|
||||
@Autowired(required=false)
|
||||
private AppUserService userService;
|
||||
|
||||
// GET ALL
|
||||
@ApiOperation(value = "List of Menu Group", response = Rn_Forms_SetupResponse.class)
|
||||
@GetMapping("/menu-group")
|
||||
public Rn_Menu_Group_Response getMenuGroups(
|
||||
@RequestParam(value = "page", defaultValue = "0", required = false) Integer page,
|
||||
@RequestParam(value = "size", defaultValue = "20", required = false) Integer size) {
|
||||
// sorted data
|
||||
Pageable paging = PageRequest.of(page, size, Sort.by("createdAt").descending());
|
||||
Page<Rn_Menu_Group_Header> result = rn_menu_group_service.getAll(paging);
|
||||
|
||||
Rn_Menu_Group_Response resp = new Rn_Menu_Group_Response();
|
||||
resp.setPageStats(result, true);
|
||||
resp.setItems(result.getContent());
|
||||
return resp;
|
||||
}
|
||||
|
||||
// GET BY ID
|
||||
@ApiOperation(value = "Get a Menu Group", response = Rn_Menu_Group_Header.class)
|
||||
@GetMapping("/menu-group/{id}")
|
||||
public ResponseEntity<Rn_Menu_Group_Header> getMenuGroupById(@PathVariable(value = "id") Long id) {
|
||||
Rn_Menu_Group_Header rn_menu_group = rn_menu_group_service.getById(id);
|
||||
return ResponseEntity.ok().body(rn_menu_group);
|
||||
}
|
||||
|
||||
// SAVE
|
||||
@ApiOperation(value = "Save A New Menu Group", response = Rn_Menu_Group_Header.class)
|
||||
@PostMapping("/menu-group")
|
||||
public ResponseEntity<Rn_Menu_Group_Header> createMenuGroup(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
@Valid @RequestBody Rn_Menu_Group_Header rn_menu_group_header) {
|
||||
// String userId = tokenUtil.getUserId(authToken);
|
||||
// rn_menu_group_header.setCreatedBy(userId);
|
||||
// rn_menu_group_header.setAccountId(userId);
|
||||
Rn_Menu_Group_Header savedMenu_group = rn_menu_group_service.save(rn_menu_group_header);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(savedMenu_group);
|
||||
}
|
||||
|
||||
// UPDATE
|
||||
@ApiOperation(value = "Update A Menu Group", response = Rn_Menu_Group_Header.class)
|
||||
@PutMapping("/menu-group/{id}")
|
||||
public ResponseEntity<Rn_Menu_Group_Header> updateMenuGroup(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
@PathVariable(value = "id") Long id, @Valid @RequestBody Rn_Menu_Group_Header rn_menu_group_header) {
|
||||
// String userId = tokenUtil.getUserId(authToken);
|
||||
// rn_menu_group_header.setUpdatedBy(userId);
|
||||
Rn_Menu_Group_Header updatedMenu_Group = rn_menu_group_service.updateById(id, rn_menu_group_header);
|
||||
return ResponseEntity.status(HttpStatus.ACCEPTED).body(updatedMenu_Group);
|
||||
}
|
||||
|
||||
// DELETE
|
||||
@DeleteMapping("/menu-group/{id}")
|
||||
public ResponseEntity<Map<String, Boolean>> deleteMenuGroup(@PathVariable(value = "id") Long id) {
|
||||
boolean deleted = rn_menu_group_service.deleteById(id);
|
||||
Map<String, Boolean> response = new HashMap<>();
|
||||
response.put("deleted", Boolean.TRUE);
|
||||
// response.put("deleted", deleted);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(response);
|
||||
}
|
||||
|
||||
// ---- working code ----
|
||||
@ApiOperation(value = "Menus For Individual Group", response = Rn_Forms_SetupResponse.class)
|
||||
@GetMapping("/load-menus")
|
||||
public ResponseEntity<?> getMenus(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken) {
|
||||
//String userId = tokenProvider.getEmailFromToken(authToken);
|
||||
AppUser user = userService.getLoggedInUser();
|
||||
System.out.println("getMenus controller " + user);
|
||||
Long menu_group_id = user.getUsrGrp().getUsrGrp();
|
||||
System.out.println("getMenus() MENU GROUP ID = " + menu_group_id);
|
||||
|
||||
// from user table, get menu_group_id
|
||||
//int menu_group_id = 1;
|
||||
|
||||
// rn_menu_group_service.loadmenuGroupByUser(menu_group_id);
|
||||
// or
|
||||
|
||||
// Rn_Main_Menu rn_main_menu = new Rn_Main_Menu();
|
||||
// Rn_Sub_Menu rn_sub_menu = new Rn_Sub_Menu();
|
||||
|
||||
List<Rn_Main_Menu> mainMenuList = new ArrayList<Rn_Main_Menu>();
|
||||
// List<Rn_Sub_Menu> subMenuList = new ArrayList<Rn_Sub_Menu>();
|
||||
|
||||
Rn_Menu_Group_Header menu_group_header = rn_menu_group_service.getById(menu_group_id);
|
||||
List<Rn_Menu_Group_Line> menu_group_lines = menu_group_header.getMenu_group_lines();
|
||||
|
||||
// menu_group loop start
|
||||
for (Rn_Menu_Group_Line menu_group_line : menu_group_lines) {
|
||||
// menu id will be diff
|
||||
int menu_id = menu_group_line.getMenu_id();
|
||||
|
||||
// HEADER
|
||||
Rn_Menu_Register rn_menu_register = rn_menu_register_service.getById(menu_id);
|
||||
String main_menu_name = rn_menu_register.getMain_menu_name();
|
||||
String main_menu_action_name = rn_menu_register.getMain_menu_action_name();
|
||||
String main_menu_icon = rn_menu_register.getMain_menu_icon();
|
||||
// boolean main_menu_flag = rn_menu_register.getEnable_flag();
|
||||
|
||||
Rn_Main_Menu rn_main_menu = new Rn_Main_Menu();
|
||||
rn_main_menu.setMenu_name(main_menu_name);
|
||||
rn_main_menu.setMenu_action_link(main_menu_action_name);
|
||||
rn_main_menu.setMenu_icon(main_menu_icon);
|
||||
|
||||
// LINE
|
||||
// List<Rn_Sub_Menu> subMenuList = new ArrayList<Rn_Sub_Menu>();
|
||||
System.out.println("Before Fun Register");
|
||||
List<Rn_Function_Register> functions = rn_function_register_service.getByMenuId(menu_id);
|
||||
System.out.println("After Fun Register");
|
||||
if (!functions.isEmpty()) {
|
||||
List<Rn_Sub_Menu> subMenuList = new ArrayList<Rn_Sub_Menu>();
|
||||
for (Rn_Function_Register function : functions) {
|
||||
String function_name = function.getFunction_name();
|
||||
String function_action_name = function.getFunction_action_name();
|
||||
String function_icon = function.getFunction_icon();
|
||||
// LocalDate function_end_date = function.getEnd_date();
|
||||
// String function_flag = function.getEnable_flag();
|
||||
|
||||
Rn_Sub_Menu rn_sub_menu = new Rn_Sub_Menu();
|
||||
rn_sub_menu.setSub_menu_name(function_name);
|
||||
rn_sub_menu.setSub_menu_action_link(function_action_name);
|
||||
rn_sub_menu.setSub_menu_icon(function_icon);
|
||||
|
||||
subMenuList.add(rn_sub_menu);
|
||||
} // func loop end
|
||||
rn_main_menu.setSub_menus(subMenuList);
|
||||
}
|
||||
// rn_main_menu.setSub_menus(sub_menus);
|
||||
mainMenuList.add(rn_main_menu);
|
||||
} // menu_group loop end
|
||||
|
||||
|
||||
return ResponseEntity.ok().body(mainMenuList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.realnet.fnd.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Menu_Group_Header;
|
||||
import com.realnet.fnd.entity.Rn_Menu_Group_Line;
|
||||
import com.realnet.fnd.service.RnGroupMenuLineServiec;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/lines_m", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Api(tags = { "Rn_Menu_Group" })
|
||||
@CrossOrigin("*")
|
||||
public class Rn_Menu_Group_Line_Controller {
|
||||
|
||||
@Autowired
|
||||
private RnGroupMenuLineServiec rnGroupMenuLineServiec;
|
||||
|
||||
@PostMapping("/create")
|
||||
public ResponseEntity<?> add(@RequestBody Rn_Menu_Group_Line rn_Menu_Group_Line){
|
||||
Rn_Menu_Group_Line addToDb = this.rnGroupMenuLineServiec.addToDb(rn_Menu_Group_Line);
|
||||
return ResponseEntity.ok(addToDb);
|
||||
}
|
||||
|
||||
@GetMapping("/get-one/{id}")
|
||||
public ResponseEntity<?> getone(@PathVariable("id") int id){
|
||||
Rn_Menu_Group_Line getoneById = this.rnGroupMenuLineServiec.getoneById(id);
|
||||
return ResponseEntity.ok(getoneById);
|
||||
}
|
||||
|
||||
@GetMapping("/get-all")
|
||||
public List<?> getAll(){
|
||||
List<Rn_Menu_Group_Line> all = this.rnGroupMenuLineServiec.getAll();
|
||||
return all;
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
public ResponseEntity<?> update(@RequestBody Rn_Menu_Group_Line rn_Menu_Group_Line){
|
||||
Rn_Menu_Group_Line addToDb = this.rnGroupMenuLineServiec.updateToDb(rn_Menu_Group_Line);
|
||||
return ResponseEntity.ok(addToDb);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.realnet.fnd.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Menu_Register;
|
||||
import com.realnet.fnd.response.Rn_Menu_Register_Response;
|
||||
import com.realnet.fnd.service.Rn_Menu_Register_Service;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Api(tags = { "Menu Register" })
|
||||
@CrossOrigin("*")
|
||||
public class Rn_Menu_Register_Controller {
|
||||
|
||||
@Autowired
|
||||
private Rn_Menu_Register_Service rn_menu_register_service;
|
||||
|
||||
// @Autowired
|
||||
// private TokenUtil tokenUtil;
|
||||
|
||||
// GET ALL
|
||||
@ApiOperation(value = "List of Menu", response = Rn_Menu_Register_Response.class)
|
||||
@GetMapping("/menu-register")
|
||||
public Rn_Menu_Register_Response getRegisteredMenu(
|
||||
@RequestParam(value = "page", defaultValue = "0", required = false) Integer page,
|
||||
@RequestParam(value = "size", defaultValue = "20", required = false) Integer size) {
|
||||
|
||||
// SORTED DATA
|
||||
// Pageable paging = PageRequest.of(page, size,
|
||||
// Sort.by("createdAt").descending());
|
||||
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Rn_Menu_Register> result = rn_menu_register_service.getAll(paging);
|
||||
Rn_Menu_Register_Response resp = new Rn_Menu_Register_Response();
|
||||
resp.setPageStats(result, true);
|
||||
resp.setItems(result.getContent());
|
||||
return resp;
|
||||
}
|
||||
|
||||
// GET BY ID
|
||||
@ApiOperation(value = "Get a Menu", response = Rn_Menu_Register.class)
|
||||
@GetMapping("/menu-register/{id}")
|
||||
public ResponseEntity<Rn_Menu_Register> getRegisteredMenuById(@PathVariable(value = "id") Integer id) {
|
||||
Rn_Menu_Register rn_menu_register = rn_menu_register_service.getById(id);
|
||||
return ResponseEntity.ok().body(rn_menu_register);
|
||||
}
|
||||
|
||||
// getByAccountId
|
||||
// *** NEED MODIFICATION ***
|
||||
// GET BY ACCOUNT_ID
|
||||
@ApiOperation(value = "Get Menu By Accout Id", response = Rn_Menu_Register.class)
|
||||
@GetMapping("/menu-register/user-menu")
|
||||
public ResponseEntity<List<Rn_Menu_Register>> getRegisteredMenuByAccountId(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken) {
|
||||
// String accountId = tokenUtil.getUserId(authToken);
|
||||
// System.out.println("get Menu List by Account Id --> " + accountId);
|
||||
// ** NEED TO MODIFY **
|
||||
// List<Rn_Menu_Register> rn_menu_register = rn_menu_register_service.getByAccountId(accountId);
|
||||
List<Rn_Menu_Register> rn_menu_register = rn_menu_register_service.getAll();
|
||||
return ResponseEntity.ok().body(rn_menu_register);
|
||||
}
|
||||
|
||||
// SAVE
|
||||
@ApiOperation(value = "Add A New Menu", response = Rn_Menu_Register.class)
|
||||
@PostMapping("/menu-register")
|
||||
public ResponseEntity<Rn_Menu_Register> SaveMenuRegister(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
@Valid @RequestBody Rn_Menu_Register rn_menu_register) {
|
||||
// String userId = tokenUtil.getUserId(authToken);
|
||||
// rn_menu_register.setCreatedBy(userId);
|
||||
// rn_menu_register.setAccountId(userId);
|
||||
Rn_Menu_Register savedRn_Forms_Setup = rn_menu_register_service.save(rn_menu_register);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(savedRn_Forms_Setup);
|
||||
}
|
||||
|
||||
// UPDATE
|
||||
@ApiOperation(value = "Update A Menu", response = Rn_Menu_Register.class)
|
||||
@PutMapping("/menu-register/{id}")
|
||||
public ResponseEntity<Rn_Menu_Register> updateMenu(
|
||||
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken,
|
||||
@PathVariable(value = "id") Integer id, @Valid @RequestBody Rn_Menu_Register rn_menu_register) {
|
||||
// String userId = tokenUtil.getUserId(authToken);
|
||||
// rn_menu_register.setUpdatedBy(userId);
|
||||
Rn_Menu_Register updatedMenu = rn_menu_register_service.updateById(id, rn_menu_register);
|
||||
return ResponseEntity.status(HttpStatus.ACCEPTED).body(updatedMenu);
|
||||
}
|
||||
|
||||
// DELETE
|
||||
@DeleteMapping("/menu-register/{id}")
|
||||
public ResponseEntity<Map<String, Boolean>> deleteRn_Forms_Setup(@PathVariable(value = "id") Integer id) {
|
||||
boolean deleted = rn_menu_register_service.deleteById(id);
|
||||
Map<String, Boolean> response = new HashMap<>();
|
||||
response.put("deleted", Boolean.TRUE);
|
||||
// response.put("deleted", deleted);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(response);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,355 @@
|
||||
package com.realnet.fnd.controller1;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.realnet.fnd.entity1.GrpMenuAccess;
|
||||
import com.realnet.fnd.entity1.MenuDet;
|
||||
import com.realnet.fnd.repository1.GrpMenuAccessRepository;
|
||||
import com.realnet.fnd.repository1.MenuDetRepository;
|
||||
import com.realnet.users.entity1.AppUser;
|
||||
import com.realnet.users.entity1.AppUserRole;
|
||||
import com.realnet.users.repository1.AppUserRepository;
|
||||
import com.realnet.users.repository1.AppUserRoleRepository;
|
||||
import com.realnet.users.service1.AppUserServiceImpl;
|
||||
|
||||
@RequestMapping(value = "/fndMenu", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@RestController
|
||||
public class LoadMenuController {
|
||||
|
||||
@Autowired
|
||||
private AppUserRoleRepository appUserRoleRepository;
|
||||
@Autowired
|
||||
private MenuDetRepository menuDetRepository;
|
||||
@Autowired
|
||||
private GrpMenuAccessRepository grpMenuAccessRepository;
|
||||
@Autowired
|
||||
private AppUserServiceImpl userService;
|
||||
|
||||
@Autowired
|
||||
private AppUserRepository appUserRepository;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(LoadMenuController.class);
|
||||
|
||||
// GROUP MENU ACCESS MENU LOAD BY USER
|
||||
@GetMapping("/menuloadbyuser")
|
||||
public ResponseEntity<?> setmenuforuser() {
|
||||
AppUser loggedInUser = userService.getLoggedInUser();
|
||||
Long usrGrp = loggedInUser.getUsrGrp().getUsrGrp();
|
||||
|
||||
List<GrpMenuAccess> root = grpMenuAccessRepository.findAllRootsByMenuId(usrGrp); // menu id =0
|
||||
for (int i = 0; i < root.size(); i++) {
|
||||
|
||||
// find menu item id by menu id =0
|
||||
List<GrpMenuAccess> menu = grpMenuAccessRepository.findById(root.get(i).getUsrGrp().getUsrGrp(),
|
||||
root.get(i).getMenuItemId().getMenuItemId()); // menuItem id will be unique
|
||||
for (GrpMenuAccess g : menu) {
|
||||
|
||||
// all submenu by menuid = menu itemid with status
|
||||
List<GrpMenuAccess> allSubmenu = grpMenuAccessRepository
|
||||
.findAllSubmenuByMenuIdWithStatus(g.getMenuItemId().getMenuItemId(), g.getUsrGrp().getUsrGrp()); // find
|
||||
|
||||
g.setSubMenus(allSubmenu);
|
||||
}
|
||||
|
||||
}
|
||||
return new ResponseEntity<>(root, HttpStatus.OK);
|
||||
}
|
||||
|
||||
//// GET LIST OF TABLE
|
||||
// @GetMapping("/loadcolumn/{TABLE_NAME}")
|
||||
// public List<Object> getcolumnname(@PathVariable Object TABLE_NAME) {
|
||||
// List<Object> colun = menuDetRepository.findcolumnbytablename(TABLE_NAME);
|
||||
//
|
||||
// return colun;
|
||||
//
|
||||
// }
|
||||
|
||||
// GET LIST OF USRGRP
|
||||
@GetMapping("/listofusrgrp")
|
||||
public ResponseEntity<?> listofusrgrp() {
|
||||
AppUser loggedInUser = userService.getLoggedInUser();
|
||||
Long usrGrp = loggedInUser.getUsrGrp().getUsrGrp();
|
||||
|
||||
List<GrpMenuAccess> root = grpMenuAccessRepository.findAllRootsByMenuId(usrGrp);
|
||||
return new ResponseEntity<>(root, HttpStatus.OK);
|
||||
|
||||
}
|
||||
|
||||
// GET LIST OF USRGRP
|
||||
@GetMapping("/getuser/{user_id}")
|
||||
public ResponseEntity<?> getuser(@PathVariable Long user_id) {
|
||||
|
||||
AppUser root = appUserRepository.findById(user_id);
|
||||
return new ResponseEntity<>(root, HttpStatus.OK);
|
||||
|
||||
}
|
||||
|
||||
// SINK GRPMENU ACCESS TO SEC MENU DET SUBMENU BY PASSING GMENUID
|
||||
@PutMapping("/sink/{gmenuid}")
|
||||
public ResponseEntity<?> adds(
|
||||
@PathVariable Long gmenuid,
|
||||
@RequestBody GrpMenuAccess gr) {
|
||||
|
||||
List<Object> list = new ArrayList<>();
|
||||
MenuDet formenu = menuDetRepository.findById(gmenuid);
|
||||
|
||||
List<GrpMenuAccess> all = grpMenuAccessRepository.findByGrpAndMenuid1(formenu.getMenuItemId());
|
||||
|
||||
for (GrpMenuAccess a : all) {
|
||||
|
||||
a.setMenuItemId(formenu);
|
||||
a.setItemSeq(formenu.getItemSeq());
|
||||
a.setMenuItemDesc(formenu.getMenuItemDesc());
|
||||
a.setModuleName(formenu.getModuleName());
|
||||
a.setStatus(formenu.getStatus());
|
||||
a.setMain_menu_action_name(formenu.getMain_menu_action_name());
|
||||
a.setMain_menu_icon_name(formenu.getMain_menu_icon_name());
|
||||
a.setMenuId(formenu.getMenuId());
|
||||
GrpMenuAccess save = grpMenuAccessRepository.save(a);
|
||||
list.add(save);
|
||||
}
|
||||
|
||||
List<MenuDet> submenu = menuDetRepository.findAllSubmenuByMenuId(gmenuid);
|
||||
for (int i = 0; i < submenu.size(); i++) {
|
||||
MenuDet m = menuDetRepository.findById(submenu.get(i).getMenuItemId());
|
||||
List<GrpMenuAccess> li = grpMenuAccessRepository.findlist(m.getMenuItemId());
|
||||
|
||||
if (li.isEmpty()) {
|
||||
List<GrpMenuAccess> grp = grpMenuAccessRepository.findAllById(gmenuid);
|
||||
|
||||
for (GrpMenuAccess a : grp) {
|
||||
AppUserRole app = appUserRoleRepository.findById(a.getUsrGrp().getUsrGrp());
|
||||
gr.setUsrGrp(app);
|
||||
gr.setMenuItemId(m);
|
||||
|
||||
gr.setItemSeq(m.getItemSeq());
|
||||
gr.setMenuItemDesc(m.getMenuItemDesc());
|
||||
gr.setModuleName(m.getModuleName());
|
||||
gr.setStatus(m.getStatus());
|
||||
gr.setMain_menu_action_name(m.getMain_menu_action_name());
|
||||
gr.setMain_menu_icon_name(m.getMain_menu_icon_name());
|
||||
gr.setMenuId(m.getMenuId());
|
||||
|
||||
gr.setMCreate("true");
|
||||
gr.setMDelete("true");
|
||||
gr.setMEdit("true");
|
||||
gr.setMQuery("true");
|
||||
gr.setMVisible("true");
|
||||
gr.setIsdisable("true");
|
||||
gr.setMexport("true");
|
||||
|
||||
gr.setCreatedAt(new Date());
|
||||
gr.setUpdatedAt(new Date());
|
||||
|
||||
GrpMenuAccess save2 = grpMenuAccessRepository.save(gr);
|
||||
list.add(save2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
for (GrpMenuAccess g : li) {
|
||||
|
||||
g.setMenuItemId(m);
|
||||
|
||||
g.setItemSeq(m.getItemSeq());
|
||||
g.setMenuItemDesc(m.getMenuItemDesc());
|
||||
g.setModuleName(m.getModuleName());
|
||||
g.setStatus(m.getStatus());
|
||||
g.setMain_menu_action_name(m.getMain_menu_action_name());
|
||||
g.setMain_menu_icon_name(m.getMain_menu_icon_name());
|
||||
g.setMenuId(m.getMenuId());
|
||||
|
||||
GrpMenuAccess save1 = grpMenuAccessRepository.save(g);
|
||||
list.add(save1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new ResponseEntity<>(list, HttpStatus.CREATED);
|
||||
|
||||
}
|
||||
|
||||
// COMPLETED
|
||||
// SINK GRPMENU ACCESS FROM MENU DET BY PASSING MENU ITEM ID OF MENU BY LOGIN USER
|
||||
@PutMapping("/sink1/{gmenuid}")
|
||||
public ResponseEntity<?> sink(@PathVariable Long gmenuid, @RequestBody GrpMenuAccess gr) {
|
||||
|
||||
AppUser loggedInUser = userService.getLoggedInUser();
|
||||
Long usrGrp = loggedInUser.getUsrGrp().getUsrGrp();
|
||||
|
||||
List<Object> list = new ArrayList<>();
|
||||
MenuDet formenu = menuDetRepository.findById(gmenuid);
|
||||
|
||||
GrpMenuAccess a = grpMenuAccessRepository.findAllRootsByMenuIdAndGrp(gmenuid, usrGrp);
|
||||
if (a != null) {
|
||||
|
||||
a.setMenuItemId(formenu);
|
||||
a.setItemSeq(formenu.getItemSeq());
|
||||
a.setMenuItemDesc(formenu.getMenuItemDesc());
|
||||
a.setModuleName(formenu.getModuleName());
|
||||
a.setStatus(formenu.getStatus());
|
||||
a.setMain_menu_action_name(formenu.getMain_menu_action_name());
|
||||
a.setMain_menu_icon_name(formenu.getMain_menu_icon_name());
|
||||
a.setMenuId(formenu.getMenuId());
|
||||
GrpMenuAccess save = grpMenuAccessRepository.save(a);
|
||||
list.add(save);
|
||||
|
||||
List<MenuDet> submenu = menuDetRepository.findAllSubmenuByMenuId(gmenuid);
|
||||
for (int i = 0; i < submenu.size(); i++) {
|
||||
MenuDet m = menuDetRepository.findById(submenu.get(i).getMenuItemId());
|
||||
// List<GrpMenuAccess> listofsubmenu = grpMenuAccessRepository.findAllSubmenuByMenuitemidAndUsrGrp(gmenuid,usrGrp);
|
||||
// for (int j = 0; j < listofsubmenu.size(); j++) {
|
||||
GrpMenuAccess g = grpMenuAccessRepository.findById2(m.getMenuItemId(), usrGrp);
|
||||
if (g != null) {
|
||||
|
||||
g.setMenuItemId(m);
|
||||
|
||||
g.setItemSeq(m.getItemSeq());
|
||||
g.setMenuItemDesc(m.getMenuItemDesc());
|
||||
g.setModuleName(m.getModuleName());
|
||||
g.setStatus(m.getStatus());
|
||||
g.setMain_menu_action_name(m.getMain_menu_action_name());
|
||||
g.setMain_menu_icon_name(m.getMain_menu_icon_name());
|
||||
g.setMenuId(m.getMenuId());
|
||||
|
||||
GrpMenuAccess save1 = grpMenuAccessRepository.save(g);
|
||||
list.add(save1);
|
||||
} else {
|
||||
|
||||
AppUserRole app = appUserRoleRepository.findById(usrGrp);
|
||||
gr.setUsrGrp(app);
|
||||
gr.setMenuItemId(m);
|
||||
|
||||
gr.setItemSeq(m.getItemSeq());
|
||||
gr.setMenuItemDesc(m.getMenuItemDesc());
|
||||
gr.setModuleName(m.getModuleName());
|
||||
gr.setStatus(m.getStatus());
|
||||
gr.setMain_menu_action_name(m.getMain_menu_action_name());
|
||||
gr.setMain_menu_icon_name(m.getMain_menu_icon_name());
|
||||
gr.setMenuId(m.getMenuId());
|
||||
|
||||
gr.setMCreate("true");
|
||||
gr.setMDelete("true");
|
||||
gr.setMEdit("true");
|
||||
gr.setMQuery("true");
|
||||
gr.setMVisible("true");
|
||||
gr.setIsdisable("true");
|
||||
gr.setMexport("true");
|
||||
|
||||
gr.setCreatedAt(new Date());
|
||||
gr.setUpdatedAt(new Date());
|
||||
|
||||
GrpMenuAccess save2 = grpMenuAccessRepository.save(gr);
|
||||
list.add(save2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// }
|
||||
} else {
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
}
|
||||
|
||||
return new ResponseEntity<>(list, HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
// DELETE MENU AND SUBMENU INCLUDING GRPMENU ACCESS by menuItemId
|
||||
@DeleteMapping("/DelMenuWithSub/{menu_item_id}")
|
||||
public void delete(@PathVariable Long menu_item_id) {
|
||||
|
||||
// delete submenu
|
||||
List<MenuDet> submenu = menuDetRepository.findAllSubmenuByMenuId(menu_item_id);
|
||||
for (int i = 0; i < submenu.size(); i++) {
|
||||
MenuDet m = menuDetRepository.findById(submenu.get(i).getMenuItemId());
|
||||
List<GrpMenuAccess> li = grpMenuAccessRepository.findlist(m.getMenuItemId());
|
||||
|
||||
for(GrpMenuAccess g:li) {
|
||||
grpMenuAccessRepository.delete(g);
|
||||
}
|
||||
menuDetRepository.delete(m);
|
||||
}
|
||||
|
||||
//delete menu
|
||||
MenuDet formenu = menuDetRepository.findById(menu_item_id);
|
||||
|
||||
List<GrpMenuAccess> all = grpMenuAccessRepository.findByGrpAndMenuid1(formenu.getMenuItemId());
|
||||
|
||||
for (GrpMenuAccess a : all) {
|
||||
grpMenuAccessRepository.delete(a);
|
||||
}
|
||||
|
||||
menuDetRepository.delete(formenu);
|
||||
|
||||
}
|
||||
|
||||
////LOAD MENU DET' MENU AND SUBMENU BY USER ID
|
||||
//@GetMapping("/loadmenu/{use_by}")
|
||||
//public List<MenuDet> getmenubyuserid(@PathVariable Long use_by) {
|
||||
// List<MenuDet> root = menuDetRepository.findAllrootsbyuseby(use_by);
|
||||
//
|
||||
// for(MenuDet m:root) {
|
||||
//
|
||||
// List<MenuDet> allSubmenu = menuDetRepository.findAllSubmenuByMenuId(m.getMenuItemId());
|
||||
// MenuDet menu = menuDetRepository.findById(m.getMenuItemId()).orElse(null);
|
||||
// menu.setSubMenus(allSubmenu);
|
||||
// }
|
||||
//
|
||||
// return root;
|
||||
//}
|
||||
|
||||
////GROUP MENU ACCESS MENU LOAD BY USER
|
||||
//@GetMapping("/menuloadbyuser")
|
||||
//public ResponseEntity<?> setmenuforuser(){
|
||||
// AppUser loggedInUser = userService.getLoggedInUser();
|
||||
// Long usrGrp = loggedInUser.getUsrGrp().getUsrGrp();
|
||||
//
|
||||
// List<GrpMenuAccess> root = grpMenuAccessRepository.findAllRootsbyusrGrp(usrGrp);
|
||||
// for(int i =0; i <root.size(); i++) {
|
||||
//
|
||||
// GrpMenuAccess menu = grpMenuAccessRepository.findByparent(root.get(i).getParent());
|
||||
// List<GrpMenuAccess> allSubmenu = grpMenuAccessRepository.findAllSubmenu(root.get(i).getParent());
|
||||
// menu.setSubMenus(allSubmenu);
|
||||
// }
|
||||
// return new ResponseEntity<>(root, HttpStatus.OK);
|
||||
//}
|
||||
//DELETE MENU AND SUBMENU IN GRP MENU ACCESS BY MENU ITEM ID
|
||||
@DeleteMapping("/DelMenu_WithSub1/{menu_item_id}/{usrGrp}")
|
||||
public void deletemenuandsubmenu(@PathVariable Long menu_item_id,@PathVariable Long usrGrp) {
|
||||
// AppUser loggedInUser = userService.getLoggedInUser();
|
||||
// Long usrGrp = loggedInUser.getUsrGrp().getUsrGrp();
|
||||
|
||||
// delete submenu
|
||||
List<GrpMenuAccess> li = grpMenuAccessRepository.findAllSubmenuByMenuId(menu_item_id,usrGrp);
|
||||
for(GrpMenuAccess g:li) {
|
||||
grpMenuAccessRepository.delete(g);
|
||||
}
|
||||
|
||||
//delete menu
|
||||
GrpMenuAccess all = grpMenuAccessRepository.findSingle(usrGrp,menu_item_id);
|
||||
grpMenuAccessRepository.delete(all);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,403 @@
|
||||
package com.realnet.fnd.controller1;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.realnet.exceptions.ResourceNotFoundException;
|
||||
import com.realnet.fnd.entity1.GrpMenuAccess;
|
||||
import com.realnet.fnd.entity1.MenuDet;
|
||||
import com.realnet.fnd.entity1.MixMenuNew;
|
||||
import com.realnet.fnd.repository1.GrpMenuAccessRepository;
|
||||
import com.realnet.fnd.repository1.MenuDetRepository;
|
||||
import com.realnet.fnd.service1.GrpMenuAccessServiceImpl;
|
||||
import com.realnet.fnd.service1.MenuDetServiceImpl;
|
||||
import com.realnet.users.entity1.AppUserRole;
|
||||
import com.realnet.users.repository1.AppUserRepository;
|
||||
import com.realnet.users.repository1.AppUserRoleRepository;
|
||||
import com.realnet.users.service1.AppUserServiceImpl;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/api1", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Api(tags = { "Rn_Menu_Group" })
|
||||
@CrossOrigin("*")
|
||||
|
||||
public class MenuController {
|
||||
@Autowired
|
||||
private AppUserServiceImpl userService;
|
||||
|
||||
@Autowired
|
||||
private AppUserRoleRepository appUserRoleRepository;
|
||||
|
||||
@Autowired
|
||||
private AppUserRepository appUserRepository;
|
||||
|
||||
private MenuDetServiceImpl menuDetServiceImpl;
|
||||
private GrpMenuAccessServiceImpl grpMenuAccessServiceImpl;
|
||||
private AppUserServiceImpl appUserServiceImpl;
|
||||
private MenuDetRepository menuDetRepository;
|
||||
private GrpMenuAccessRepository grpMenuAccessRepository;
|
||||
|
||||
@Autowired
|
||||
public MenuController(MenuDetServiceImpl menuDetServiceImpl, GrpMenuAccessServiceImpl grpMenuAccessServiceImpl,
|
||||
AppUserServiceImpl appUserServiceImpl, MenuDetRepository menuDetRepository,
|
||||
GrpMenuAccessRepository grpMenuAccessRepository) {
|
||||
super();
|
||||
this.menuDetServiceImpl = menuDetServiceImpl;
|
||||
this.grpMenuAccessServiceImpl = grpMenuAccessServiceImpl;
|
||||
this.appUserServiceImpl = appUserServiceImpl;
|
||||
this.menuDetRepository = menuDetRepository;
|
||||
this.grpMenuAccessRepository = grpMenuAccessRepository;
|
||||
}
|
||||
|
||||
@GetMapping("/allmenus")
|
||||
public ResponseEntity<?> getallmenu() {
|
||||
List<MixMenuNew> menu = menuDetRepository.getallmenu();
|
||||
return new ResponseEntity<>(menu, HttpStatus.OK);
|
||||
}
|
||||
|
||||
//// // ADD DATA FOR SEC MENU DETAIL
|
||||
@PostMapping("/Sec_menuDet")
|
||||
public ResponseEntity<?> adddata(@RequestBody MenuDet menuDet) {
|
||||
MenuDet save = menuDetRepository.save(menuDet);
|
||||
return new ResponseEntity<>(save, HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
// GET BY MENU ITEM ID
|
||||
@GetMapping("/Sec_menuDet/{menu_item_id}")
|
||||
public ResponseEntity<?> getdata(@PathVariable Long menu_item_id) {
|
||||
MenuDet save = menuDetRepository.findById(menu_item_id)
|
||||
;
|
||||
return new ResponseEntity<>(save, HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
// GET MENU AND SUBMENU of MENU DET
|
||||
@GetMapping("/submenu1")
|
||||
public List<MenuDet> submenu() {
|
||||
List<MenuDet> root = menuDetRepository.findAllRootsByMenuId();
|
||||
|
||||
for (MenuDet m : root) {
|
||||
|
||||
List<MenuDet> allSubmenu = menuDetRepository.findAllSubmenuByMenuId(m.getMenuItemId());
|
||||
MenuDet menu = menuDetRepository.findById(m.getMenuItemId());
|
||||
menu.setSubMenus(allSubmenu);
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
// Get Only SubMenu OF MENU DET
|
||||
@GetMapping("/submenu1/{menu_item_id}")
|
||||
public ResponseEntity<?> getonlysubmenu(@PathVariable Long menu_item_id) {
|
||||
List<MenuDet> submenu = menuDetRepository.findAllSubmenuByMenuId(menu_item_id);
|
||||
|
||||
return new ResponseEntity<>(submenu, HttpStatus.OK);
|
||||
|
||||
}
|
||||
|
||||
// GET MENU AND SUBMENU of GROUP MENU ACCESS
|
||||
@GetMapping("/grpmenuandsubmenu")
|
||||
public List<GrpMenuAccess> GRPMENUACCESS() {
|
||||
List<GrpMenuAccess> root = grpMenuAccessRepository.findAllRoots();
|
||||
|
||||
for (int i = 0; i < root.size(); i++) {
|
||||
|
||||
// find menu item id by menu id =0
|
||||
List<GrpMenuAccess> menu = grpMenuAccessRepository.findById(root.get(i).getUsrGrp().getUsrGrp(),
|
||||
root.get(i).getMenuItemId().getMenuItemId()); // menuItem id will be unique
|
||||
for (GrpMenuAccess g : menu) {
|
||||
|
||||
List<GrpMenuAccess> allSubmenu = grpMenuAccessRepository
|
||||
.findAllSubmenuByMenuId(g.getMenuItemId().getMenuItemId(), g.getUsrGrp().getUsrGrp()); // find
|
||||
// all
|
||||
// submenu
|
||||
// by
|
||||
// menuid
|
||||
// =
|
||||
// menu
|
||||
// itemid
|
||||
g.setSubMenus(allSubmenu);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
// Get Only SubMenu of GROUP MENU ACCESS
|
||||
@GetMapping("/grpmenuandsubmenu/{menu_item_id}")
|
||||
public ResponseEntity<?> grpmenuaccess(@PathVariable Long menu_item_id) {
|
||||
List<GrpMenuAccess> submenu = grpMenuAccessRepository.findAllSubmenu(menu_item_id);
|
||||
|
||||
return new ResponseEntity<>(submenu, HttpStatus.OK);
|
||||
|
||||
}
|
||||
|
||||
// update by menu_item_id
|
||||
@PutMapping("/submenu1/{menu_item_id}")
|
||||
public ResponseEntity<?> updatedata(@RequestBody MenuDet d, @PathVariable Long menu_item_id) {
|
||||
MenuDet menu = menuDetRepository.findById(menu_item_id);
|
||||
|
||||
menu.setItemSeq(d.getItemSeq());
|
||||
menu.setMain_menu_action_name(d.getMain_menu_action_name());
|
||||
menu.setMain_menu_icon_name(d.getMain_menu_icon_name());
|
||||
menu.setMenuId(d.getMenuId());
|
||||
menu.setMenuItemDesc(d.getMenuItemDesc());
|
||||
menu.setModuleName(d.getModuleName());
|
||||
menu.setStatus(d.getStatus());
|
||||
|
||||
MenuDet save = menuDetRepository.save(menu);
|
||||
return new ResponseEntity<>(save, HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
// delete DATA SEC MENU DET WITH GRPMENUACCESS by menuItemId
|
||||
@DeleteMapping("/menu/{menu_item_id}")
|
||||
public void delete(@PathVariable Long menu_item_id) {
|
||||
|
||||
|
||||
List<GrpMenuAccess> findlist = grpMenuAccessRepository.findlist(menu_item_id);
|
||||
for(GrpMenuAccess g:findlist) {
|
||||
grpMenuAccessRepository.delete(g);
|
||||
}
|
||||
|
||||
MenuDet menu = menuDetRepository.findById(menu_item_id);
|
||||
menuDetRepository.delete(menu);
|
||||
}
|
||||
|
||||
// GET GROUP MENU ACCESS BY USR_GROUP with WITH SUBMENU
|
||||
|
||||
@GetMapping("/grpmenuaccess/{usr_grp}")
|
||||
public ResponseEntity<?> GETGROUPMENU(@PathVariable Long usr_grp) {
|
||||
|
||||
List<Object> list = new ArrayList<>();
|
||||
GrpMenuAccess grp = grpMenuAccessRepository.findByUsrGrp(usr_grp);
|
||||
|
||||
// List<MenuDet> sub = menuDetRepository.findAllSubmenuByMenuId(grp.getMenuItemId().getMenuItemId());
|
||||
List<MenuDet> sub = menuDetRepository.findAllSubmenuforusrgrp(grp.getMenuItemId().getMenuItemId());
|
||||
|
||||
list.add(grp);
|
||||
list.add(sub);
|
||||
return new ResponseEntity<>(list, HttpStatus.OK);
|
||||
|
||||
}
|
||||
|
||||
// get all
|
||||
@GetMapping("/getAllData")
|
||||
public ResponseEntity<List<GrpMenuAccess>> getAllGroupMenuAccess() {
|
||||
List<GrpMenuAccess> listgrp = grpMenuAccessRepository.findAll();
|
||||
return new ResponseEntity<>(listgrp, HttpStatus.OK);
|
||||
}
|
||||
|
||||
// get by USRGRP WITHOUT SUBMENU
|
||||
|
||||
// @GetMapping("/getById/{userId}")
|
||||
// public ResponseEntity<?> getGrpMenuByUserId(@PathVariable Long userId){
|
||||
// GrpMenuAccess grpMenuAccess=grpMenuAccessRepository.findByUsrGrp(userId);
|
||||
// if(grpMenuAccess==null)throw new ResourceNotFoundException("no resource found");
|
||||
// return new ResponseEntity<>(grpMenuAccess,HttpStatus.OK);
|
||||
// }
|
||||
|
||||
// update by usr grp id
|
||||
@PutMapping("/updatemenuaccess/{userId}")
|
||||
public ResponseEntity<?> updateMenuAccess(@PathVariable Long userId, @RequestBody GrpMenuAccess grpMenuAccess) {
|
||||
GrpMenuAccess g1 = grpMenuAccessRepository.findByUsrGrp(userId);
|
||||
if (g1 == null) {
|
||||
throw new ResourceNotFoundException("no resource found");
|
||||
}
|
||||
g1.setMCreate(grpMenuAccess.getMCreate());
|
||||
g1.setMDelete(grpMenuAccess.getMDelete());
|
||||
g1.setMEdit(grpMenuAccess.getMEdit());
|
||||
g1.setMQuery(grpMenuAccess.getMQuery());
|
||||
g1.setMVisible(grpMenuAccess.getMVisible());
|
||||
g1.setMexport(grpMenuAccess.getMexport());
|
||||
|
||||
GrpMenuAccess grpMenuAccess2 = grpMenuAccessRepository.save(g1);
|
||||
return new ResponseEntity<>(grpMenuAccess2, HttpStatus.OK);
|
||||
}
|
||||
|
||||
// delete by usrgrp
|
||||
@DeleteMapping("/deleteMenuAcces/{userId}")
|
||||
public void deleteMenuAccess(@PathVariable Long userId) {
|
||||
GrpMenuAccess grpMenuAccess = grpMenuAccessRepository.findByUsrGrp(userId);
|
||||
if (Objects.isNull(grpMenuAccess))
|
||||
throw new ResourceNotFoundException("no resource found");
|
||||
grpMenuAccessRepository.delete(grpMenuAccess);
|
||||
}
|
||||
|
||||
// ADD MULTIPLE DATA FOR GROUP MENU ACCESS
|
||||
@PostMapping("/group")
|
||||
public ResponseEntity<?> addgroupmenuaccess(@RequestBody List<GrpMenuAccess> grp) {
|
||||
|
||||
for (GrpMenuAccess g : grp) {
|
||||
MenuDet menu1 = menuDetRepository.findById(g.getGmenuid());
|
||||
AppUserRole a = appUserRoleRepository.findById(g.getGrpid());
|
||||
|
||||
g.setUsrGrp(a);
|
||||
g.setMenuItemId(menu1);
|
||||
}
|
||||
List<GrpMenuAccess> save = grpMenuAccessRepository.saveAll(grp);
|
||||
return new ResponseEntity<>(save, HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
// ADD DATA FOR group menu access
|
||||
@PostMapping("/singlegroup")
|
||||
public ResponseEntity<?> addsinglegroup(@RequestBody GrpMenuAccess grp) {
|
||||
|
||||
MenuDet menu1 = menuDetRepository.findById(grp.getGmenuid());
|
||||
AppUserRole a = appUserRoleRepository.findById(grp.getGrpid());
|
||||
|
||||
grp.setUsrGrp(a);
|
||||
grp.setMenuItemId(menu1);
|
||||
|
||||
GrpMenuAccess save = grpMenuAccessRepository.save(grp);
|
||||
return new ResponseEntity<>(save, HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
// NEWWWW post MENU AND SUBMENU IN GROUPMENUACCESS
|
||||
|
||||
@PostMapping("/addgrpwithsubmenu")
|
||||
public ResponseEntity<?> adds(@RequestBody GrpMenuAccess g) {
|
||||
|
||||
List<Object> list = new ArrayList<>();
|
||||
|
||||
Optional<GrpMenuAccess> a = grpMenuAccessRepository.findbygrpandmenuid(g.getGmenuid(), g.getGrpid());
|
||||
if (!a.isPresent()) {
|
||||
MenuDet me = menuDetRepository.findById(g.getGmenuid());
|
||||
g.setMenuItemId(me);
|
||||
g.setItemSeq(me.getItemSeq());
|
||||
g.setMenuItemDesc(me.getMenuItemDesc());
|
||||
g.setMenuItemDesc(me.getMenuItemDesc());
|
||||
g.setModuleName(me.getModuleName());
|
||||
g.setStatus(me.getStatus());
|
||||
g.setMain_menu_action_name(me.getMain_menu_action_name());
|
||||
g.setMain_menu_icon_name(me.getMain_menu_icon_name());
|
||||
g.setMenuId(me.getMenuId());
|
||||
|
||||
AppUserRole app1 = appUserRoleRepository.findById(g.getGrpid());
|
||||
g.setUsrGrp(app1);
|
||||
g.setMCreate("true");
|
||||
g.setMDelete("true");
|
||||
g.setMEdit("true");
|
||||
g.setMQuery("true");
|
||||
g.setMVisible("true");
|
||||
g.setIsdisable("true");
|
||||
g.setMexport("true");
|
||||
|
||||
g.setCreatedAt(new Date());
|
||||
g.setUpdatedAt(new Date());
|
||||
|
||||
GrpMenuAccess save1 = grpMenuAccessRepository.save(g);
|
||||
list.add(save1);
|
||||
|
||||
List<MenuDet> submenu = menuDetRepository.findAllSubmenuByMenuId(g.getGmenuid());
|
||||
|
||||
for (int i = 0; i < submenu.size(); i++) {
|
||||
MenuDet m = menuDetRepository.findById(submenu.get(i).getMenuItemId());
|
||||
g.setMenuItemId(m);
|
||||
g.setItemSeq(m.getItemSeq());
|
||||
g.setMenuItemDesc(m.getMenuItemDesc());
|
||||
g.setModuleName(m.getModuleName());
|
||||
g.setStatus(m.getStatus());
|
||||
g.setMain_menu_action_name(m.getMain_menu_action_name());
|
||||
g.setMain_menu_icon_name(m.getMain_menu_icon_name());
|
||||
g.setMenuId(m.getMenuId());
|
||||
|
||||
AppUserRole app = appUserRoleRepository.findById(g.getGrpid());
|
||||
g.setUsrGrp(app);
|
||||
g.setMCreate("true");
|
||||
g.setMDelete("true");
|
||||
g.setMEdit("true");
|
||||
g.setMQuery("true");
|
||||
g.setMVisible("true");
|
||||
g.setIsdisable("true");
|
||||
g.setMexport("true");
|
||||
|
||||
|
||||
g.setCreatedAt(new Date());
|
||||
g.setUpdatedAt(new Date());
|
||||
|
||||
GrpMenuAccess save = grpMenuAccessRepository.save(g);
|
||||
list.add(save);
|
||||
}
|
||||
|
||||
return new ResponseEntity<>(list, HttpStatus.CREATED);
|
||||
|
||||
} else {
|
||||
return new ResponseEntity<>("already added menu", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// GET ALL GRPACCESS BY USRGRP
|
||||
@GetMapping("getusracces1/{usr_grp}")
|
||||
public ResponseEntity<?> getallbyusrgrp(@PathVariable Long usr_grp) {
|
||||
List<GrpMenuAccess> list = grpMenuAccessRepository.findAllByUsrGrp(usr_grp);
|
||||
return new ResponseEntity<>(list, HttpStatus.OK);
|
||||
|
||||
}
|
||||
|
||||
// UPDATE GRP MENU ACCESS BY MENU ITEMID
|
||||
@PutMapping("/update/{menu_item_id}/{usr_grp}")
|
||||
public ResponseEntity<?> updateMenuGRPAccess(@PathVariable Long menu_item_id, @PathVariable Long usr_grp,
|
||||
@RequestBody GrpMenuAccess grpMenuAccess) {
|
||||
GrpMenuAccess g1 = grpMenuAccessRepository.findByUsrgrpAndMenuitemid(menu_item_id, usr_grp);
|
||||
if (g1 == null) {
|
||||
throw new ResourceNotFoundException("no resource found");
|
||||
}
|
||||
g1.setMCreate(grpMenuAccess.getMCreate());
|
||||
g1.setMDelete(grpMenuAccess.getMDelete());
|
||||
g1.setMEdit(grpMenuAccess.getMEdit());
|
||||
g1.setMQuery(grpMenuAccess.getMQuery());
|
||||
g1.setMVisible(grpMenuAccess.getMVisible());
|
||||
g1.setIsdisable(grpMenuAccess.getIsdisable());
|
||||
g1.setItemSeq(grpMenuAccess.getItemSeq());
|
||||
g1.setMain_menu_action_name(grpMenuAccess.getMain_menu_action_name());
|
||||
g1.setMain_menu_icon_name(grpMenuAccess.getMain_menu_action_name());
|
||||
g1.setMenuId(grpMenuAccess.getMenuId());
|
||||
g1.setMenuItemDesc(grpMenuAccess.getMenuItemDesc());
|
||||
g1.setModuleName(grpMenuAccess.getModuleName());
|
||||
g1.setStatus(grpMenuAccess.getStatus());
|
||||
g1.setMexport(grpMenuAccess.getMexport());
|
||||
|
||||
GrpMenuAccess grpMenuAccess2 = grpMenuAccessRepository.save(g1);
|
||||
return new ResponseEntity<>(grpMenuAccess2, HttpStatus.OK);
|
||||
}
|
||||
|
||||
// DELETE GRPMENU ACCESS BY MENUITEMID AND USRGRP
|
||||
@DeleteMapping("/deleteGrpMenuAcces/{menu_item_id}/{usr_grp}")
|
||||
public void deleteGrpMenuAccess(@PathVariable Long menu_item_id, @PathVariable Long usr_grp) {
|
||||
GrpMenuAccess grpMenuAccess = grpMenuAccessRepository.findByUsrgrpAndMenuitemid(menu_item_id, usr_grp);
|
||||
if (Objects.isNull(grpMenuAccess))
|
||||
throw new ResourceNotFoundException("no resource found");
|
||||
grpMenuAccessRepository.delete(grpMenuAccess);
|
||||
}
|
||||
|
||||
// GET GRPMENU ACCESS BY MENUITEM ID BUT NOT WORKING WITH SUBMENU
|
||||
@GetMapping("/getsec/{menu_item_id}")
|
||||
public ResponseEntity<?> getgrpmenuaccess(@PathVariable Long menu_item_id) {
|
||||
GrpMenuAccess get = grpMenuAccessRepository.findById1(menu_item_id);
|
||||
|
||||
return new ResponseEntity<>(get, HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
public class DropDownDTO {
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
public DropDownDTO() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public DropDownDTO(int id, String name) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DropDownDTO [id=" + id + ", name=" + name + "]";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
|
||||
public class Error implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String message;
|
||||
|
||||
private String title;
|
||||
|
||||
public String getMessage ()
|
||||
{
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage (String message)
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getTitle ()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle (String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "ClassPojo [message = "+message+", title = "+title+"]";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
|
||||
public class ErrorPojo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Error error;
|
||||
|
||||
public ErrorPojo() {
|
||||
|
||||
}
|
||||
|
||||
public ErrorPojo(Error error) {
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public Error getError ()
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
public void setError (Error error)
|
||||
{
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "ClassPojo [error = "+error+"]";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ModuleCopyDTO {
|
||||
private int from_projectId;
|
||||
private int from_moduleId;
|
||||
private String to_moduleName;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
public interface Modulemini {
|
||||
|
||||
String getid();
|
||||
String getmodule_name();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
public interface ProjectMini {
|
||||
String getid();
|
||||
String getproject_name();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
|
||||
|
||||
//@MappedSuperclass
|
||||
//@EntityListeners(AuditingEntityListener.class)
|
||||
public abstract class Rn_AuditEntity extends Rn_ExtensionEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// @Temporal(TemporalType.TIMESTAMP)
|
||||
// @Column(name = "CREATED_AT", nullable = false, updatable = false)
|
||||
@CreatedDate
|
||||
private Date createdAt;
|
||||
|
||||
//@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createdAt;
|
||||
|
||||
// @Temporal(TemporalType.TIMESTAMP)
|
||||
// @Column(name = "UPDATED_AT", nullable = false)
|
||||
@LastModifiedDate
|
||||
private Date updatedAt;
|
||||
|
||||
// @Column(name = "CREATED_BY", updatable = false)
|
||||
private String createdBy;
|
||||
|
||||
// @Column(name = "UPDATED_BY")
|
||||
private String updatedBy;
|
||||
|
||||
// @Column(name = "ACCOUNT_ID")
|
||||
private String accountId;
|
||||
|
||||
public Date getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Date createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Date updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getUpdatedBy() {
|
||||
return updatedBy;
|
||||
}
|
||||
|
||||
public void setUpdatedBy(String updatedBy) {
|
||||
this.updatedBy = updatedBy;
|
||||
}
|
||||
|
||||
public String getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
public void setAccountId(String accountId) {
|
||||
this.accountId = accountId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,434 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
//@Entity
|
||||
@Document
|
||||
//@Table(name = "RN_DYNAMIC_TRANSACTION")
|
||||
public class Rn_Dynamic_Transaction extends Rn_Who_Columns {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@Id
|
||||
private String mongoid;
|
||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
// @Column(name = "ID")
|
||||
private int id;
|
||||
|
||||
// @Column(name = "FORM_ID")
|
||||
private int form_id;
|
||||
|
||||
// @Column(name = "FORM_VERSION")
|
||||
private int form_version;
|
||||
|
||||
// @Column(name = "COMP1")
|
||||
private String comp1;
|
||||
|
||||
// @Column(name = "COMP2")
|
||||
private String comp2;
|
||||
|
||||
// @Column(name = "COMP3")
|
||||
private String comp3;
|
||||
|
||||
// @Column(name = "COMP4")
|
||||
private String comp4;
|
||||
|
||||
// @Column(name = "COMP5")
|
||||
private String comp5;
|
||||
|
||||
// @Column(name = "COMP6")
|
||||
private String comp6;
|
||||
|
||||
// @Column(name = "COMP7")
|
||||
private String comp7;
|
||||
|
||||
// @Column(name = "COMP8")
|
||||
private String comp8;
|
||||
|
||||
// @Column(name = "COMP9")
|
||||
private String comp9;
|
||||
|
||||
// @Column(name = "COMP10")
|
||||
private String comp10;
|
||||
|
||||
// @Column(name = "COMP11")
|
||||
private String comp11;
|
||||
|
||||
// @Column(name = "COMP12")
|
||||
private String comp12;
|
||||
//
|
||||
// @Column(name = "COMP13")
|
||||
private String comp13;
|
||||
|
||||
// @Column(name = "COMP14")
|
||||
private String comp14;
|
||||
|
||||
// @Column(name = "COMP15")
|
||||
private String comp15;
|
||||
|
||||
// @Column(name = "COMP16")
|
||||
private String comp16;
|
||||
|
||||
// @Column(name = "COMP17")
|
||||
private String comp17;
|
||||
|
||||
// @Column(name = "COMP18")
|
||||
private String comp18;
|
||||
|
||||
// @Column(name = "COMP19")
|
||||
private String comp19;
|
||||
|
||||
// @Column(name = "COMP20")
|
||||
private String comp20;
|
||||
|
||||
// @Column(name = "COMP21")
|
||||
private String comp21;
|
||||
|
||||
// @Column(name = "COMP22")
|
||||
private String comp22;
|
||||
|
||||
// @Column(name = "COMP23")
|
||||
private String comp23;
|
||||
|
||||
// @Column(name = "COMP24")
|
||||
private String comp24;
|
||||
|
||||
// @Column(name = "COMP25")
|
||||
private String comp25;
|
||||
|
||||
// FOR LONG-TEXT FIELDS
|
||||
// @Lob
|
||||
// @Column(name = "COMP_L26", length = 100000)
|
||||
private String comp_l26;
|
||||
|
||||
// @Lob
|
||||
// @Column(name = "COMP_L27", length = 100000)
|
||||
private String comp_l27;
|
||||
|
||||
// @Lob
|
||||
// @Column(name = "COMP_L28", length = 100000)
|
||||
private String comp_l28;
|
||||
|
||||
// @Lob
|
||||
// @Column(name = "COMP_L29", length = 100000)
|
||||
private String comp_l29;
|
||||
|
||||
// @Lob
|
||||
// @Column(name = "COMP_L30", length = 100000)
|
||||
private String comp_l30;
|
||||
|
||||
public Rn_Dynamic_Transaction() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Rn_Dynamic_Transaction(int id, int form_id, int form_version, String comp1, String comp2, String comp3,
|
||||
String comp4, String comp5, String comp6, String comp7, String comp8, String comp9, String comp10,
|
||||
String comp11, String comp12, String comp13, String comp14, String comp15, String comp16, String comp17,
|
||||
String comp18, String comp19, String comp20, String comp21, String comp22, String comp23, String comp24,
|
||||
String comp25, String comp_l26, String comp_l27, String comp_l28, String comp_l29, String comp_l30) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.form_id = form_id;
|
||||
this.form_version = form_version;
|
||||
this.comp1 = comp1;
|
||||
this.comp2 = comp2;
|
||||
this.comp3 = comp3;
|
||||
this.comp4 = comp4;
|
||||
this.comp5 = comp5;
|
||||
this.comp6 = comp6;
|
||||
this.comp7 = comp7;
|
||||
this.comp8 = comp8;
|
||||
this.comp9 = comp9;
|
||||
this.comp10 = comp10;
|
||||
this.comp11 = comp11;
|
||||
this.comp12 = comp12;
|
||||
this.comp13 = comp13;
|
||||
this.comp14 = comp14;
|
||||
this.comp15 = comp15;
|
||||
this.comp16 = comp16;
|
||||
this.comp17 = comp17;
|
||||
this.comp18 = comp18;
|
||||
this.comp19 = comp19;
|
||||
this.comp20 = comp20;
|
||||
this.comp21 = comp21;
|
||||
this.comp22 = comp22;
|
||||
this.comp23 = comp23;
|
||||
this.comp24 = comp24;
|
||||
this.comp25 = comp25;
|
||||
this.comp_l26 = comp_l26;
|
||||
this.comp_l27 = comp_l27;
|
||||
this.comp_l28 = comp_l28;
|
||||
this.comp_l29 = comp_l29;
|
||||
this.comp_l30 = comp_l30;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getForm_id() {
|
||||
return form_id;
|
||||
}
|
||||
|
||||
public void setForm_id(int form_id) {
|
||||
this.form_id = form_id;
|
||||
}
|
||||
|
||||
public int getForm_version() {
|
||||
return form_version;
|
||||
}
|
||||
|
||||
public void setForm_version(int form_version) {
|
||||
this.form_version = form_version;
|
||||
}
|
||||
|
||||
public String getComp1() {
|
||||
return comp1;
|
||||
}
|
||||
|
||||
public void setComp1(String comp1) {
|
||||
this.comp1 = comp1;
|
||||
}
|
||||
|
||||
public String getComp2() {
|
||||
return comp2;
|
||||
}
|
||||
|
||||
public void setComp2(String comp2) {
|
||||
this.comp2 = comp2;
|
||||
}
|
||||
|
||||
public String getComp3() {
|
||||
return comp3;
|
||||
}
|
||||
|
||||
public void setComp3(String comp3) {
|
||||
this.comp3 = comp3;
|
||||
}
|
||||
|
||||
public String getComp4() {
|
||||
return comp4;
|
||||
}
|
||||
|
||||
public void setComp4(String comp4) {
|
||||
this.comp4 = comp4;
|
||||
}
|
||||
|
||||
public String getComp5() {
|
||||
return comp5;
|
||||
}
|
||||
|
||||
public void setComp5(String comp5) {
|
||||
this.comp5 = comp5;
|
||||
}
|
||||
|
||||
public String getComp6() {
|
||||
return comp6;
|
||||
}
|
||||
|
||||
public void setComp6(String comp6) {
|
||||
this.comp6 = comp6;
|
||||
}
|
||||
|
||||
public String getComp7() {
|
||||
return comp7;
|
||||
}
|
||||
|
||||
public void setComp7(String comp7) {
|
||||
this.comp7 = comp7;
|
||||
}
|
||||
|
||||
public String getComp8() {
|
||||
return comp8;
|
||||
}
|
||||
|
||||
public void setComp8(String comp8) {
|
||||
this.comp8 = comp8;
|
||||
}
|
||||
|
||||
public String getComp9() {
|
||||
return comp9;
|
||||
}
|
||||
|
||||
public void setComp9(String comp9) {
|
||||
this.comp9 = comp9;
|
||||
}
|
||||
|
||||
public String getComp10() {
|
||||
return comp10;
|
||||
}
|
||||
|
||||
public void setComp10(String comp10) {
|
||||
this.comp10 = comp10;
|
||||
}
|
||||
|
||||
public String getComp11() {
|
||||
return comp11;
|
||||
}
|
||||
|
||||
public void setComp11(String comp11) {
|
||||
this.comp11 = comp11;
|
||||
}
|
||||
|
||||
public String getComp12() {
|
||||
return comp12;
|
||||
}
|
||||
|
||||
public void setComp12(String comp12) {
|
||||
this.comp12 = comp12;
|
||||
}
|
||||
|
||||
public String getComp13() {
|
||||
return comp13;
|
||||
}
|
||||
|
||||
public void setComp13(String comp13) {
|
||||
this.comp13 = comp13;
|
||||
}
|
||||
|
||||
public String getComp14() {
|
||||
return comp14;
|
||||
}
|
||||
|
||||
public void setComp14(String comp14) {
|
||||
this.comp14 = comp14;
|
||||
}
|
||||
|
||||
public String getComp15() {
|
||||
return comp15;
|
||||
}
|
||||
|
||||
public void setComp15(String comp15) {
|
||||
this.comp15 = comp15;
|
||||
}
|
||||
|
||||
public String getComp16() {
|
||||
return comp16;
|
||||
}
|
||||
|
||||
public void setComp16(String comp16) {
|
||||
this.comp16 = comp16;
|
||||
}
|
||||
|
||||
public String getComp17() {
|
||||
return comp17;
|
||||
}
|
||||
|
||||
public void setComp17(String comp17) {
|
||||
this.comp17 = comp17;
|
||||
}
|
||||
|
||||
public String getComp18() {
|
||||
return comp18;
|
||||
}
|
||||
|
||||
public void setComp18(String comp18) {
|
||||
this.comp18 = comp18;
|
||||
}
|
||||
|
||||
public String getComp19() {
|
||||
return comp19;
|
||||
}
|
||||
|
||||
public void setComp19(String comp19) {
|
||||
this.comp19 = comp19;
|
||||
}
|
||||
|
||||
public String getComp20() {
|
||||
return comp20;
|
||||
}
|
||||
|
||||
public void setComp20(String comp20) {
|
||||
this.comp20 = comp20;
|
||||
}
|
||||
|
||||
public String getComp21() {
|
||||
return comp21;
|
||||
}
|
||||
|
||||
public void setComp21(String comp21) {
|
||||
this.comp21 = comp21;
|
||||
}
|
||||
|
||||
public String getComp22() {
|
||||
return comp22;
|
||||
}
|
||||
|
||||
public void setComp22(String comp22) {
|
||||
this.comp22 = comp22;
|
||||
}
|
||||
|
||||
public String getComp23() {
|
||||
return comp23;
|
||||
}
|
||||
|
||||
public void setComp23(String comp23) {
|
||||
this.comp23 = comp23;
|
||||
}
|
||||
|
||||
public String getComp24() {
|
||||
return comp24;
|
||||
}
|
||||
|
||||
public void setComp24(String comp24) {
|
||||
this.comp24 = comp24;
|
||||
}
|
||||
|
||||
public String getComp25() {
|
||||
return comp25;
|
||||
}
|
||||
|
||||
public void setComp25(String comp25) {
|
||||
this.comp25 = comp25;
|
||||
}
|
||||
|
||||
public String getComp_l26() {
|
||||
return comp_l26;
|
||||
}
|
||||
|
||||
public void setComp_l26(String comp_l26) {
|
||||
this.comp_l26 = comp_l26;
|
||||
}
|
||||
|
||||
public String getComp_l27() {
|
||||
return comp_l27;
|
||||
}
|
||||
|
||||
public void setComp_l27(String comp_l27) {
|
||||
this.comp_l27 = comp_l27;
|
||||
}
|
||||
|
||||
public String getComp_l28() {
|
||||
return comp_l28;
|
||||
}
|
||||
|
||||
public void setComp_l28(String comp_l28) {
|
||||
this.comp_l28 = comp_l28;
|
||||
}
|
||||
|
||||
public String getComp_l29() {
|
||||
return comp_l29;
|
||||
}
|
||||
|
||||
public void setComp_l29(String comp_l29) {
|
||||
this.comp_l29 = comp_l29;
|
||||
}
|
||||
|
||||
public String getComp_l30() {
|
||||
return comp_l30;
|
||||
}
|
||||
|
||||
public void setComp_l30(String comp_l30) {
|
||||
this.comp_l30 = comp_l30;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
//@Entity
|
||||
//@Table(name = "RN_EXT_FIELD_T")
|
||||
public class Rn_Ext_Fields extends Rn_Who_Columns {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@Id
|
||||
private String mongoid;
|
||||
// @Id
|
||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
// @Column(name = "ID")
|
||||
private int id;
|
||||
|
||||
// @Column(name = "TYPE")
|
||||
private String type;
|
||||
|
||||
// @Column(name = "FIELD_NAME")
|
||||
private String field_name;
|
||||
|
||||
// @Column(name = "MAPPING")
|
||||
private String mapping;
|
||||
|
||||
// @Column(name = "DATA_TYPE")
|
||||
private String data_type;
|
||||
|
||||
// @Column(name = "FORM_CODE")
|
||||
private String form_code;
|
||||
|
||||
// @Column(name = "IS_ACTIVE")
|
||||
private boolean isActive;
|
||||
//
|
||||
// @Column(name = "ACCOUNT_ID")
|
||||
private long account_id;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// @Column(name = "SP_NAME_FOR_AUTOCOMPLETE")
|
||||
// private String sp_name_for_autocomplete;
|
||||
//
|
||||
// @Column(name = "SP_FOR_AUTOCOMPLETE")
|
||||
// private String sp_for_autocomplete;
|
||||
//
|
||||
// @Column(name = "EXT_AUTO_ID")
|
||||
// private String ext_auto_id;
|
||||
//
|
||||
// @Column(name = "EXT_DEPENDENT_ID")
|
||||
// private String ext_dependent_id;
|
||||
//
|
||||
// @Column(name = "EXT_DD_ID")
|
||||
// private String ext_dd_id;
|
||||
//
|
||||
// @Column(name = "SP_NAME")
|
||||
// private String sp_name;
|
||||
//
|
||||
// @Column(name = "DROP_VALUE")
|
||||
// private String drop_value;
|
||||
//
|
||||
// @Column(name = "DROPDOWN")
|
||||
// private String dropdown;
|
||||
//
|
||||
// @Column(name = "MANDATORY")
|
||||
// private String mandatory;
|
||||
//
|
||||
// @Column(name = "HIDDEN")
|
||||
// private String hidden;
|
||||
//
|
||||
// @Column(name = "READONLY")
|
||||
// private String readonly;
|
||||
//
|
||||
// @Column(name = "DEPENDENT")
|
||||
// private String dependent;
|
||||
// @Column(name = "SEQ_NAME")
|
||||
// private String seq_name;
|
||||
//
|
||||
// @Column(name = "DEPENDENT_SP")
|
||||
// private String dependent_sp;
|
||||
//
|
||||
// @Column(name = "DEPENDENT_SP_PARAM")
|
||||
// private String dependent_sp_param;
|
||||
//
|
||||
// @Column(name = "VALIDATION_1")
|
||||
// private String validation_1;
|
||||
//
|
||||
// @Column(name = "VAL_TYPE")
|
||||
// private String val_type;
|
||||
//
|
||||
// @Column(name = "VAL_SP")
|
||||
// private String val_sp;
|
||||
//
|
||||
// @Column(name = "VAL_SP_PARAM")
|
||||
// private String val_sp_param;
|
||||
//
|
||||
// @Column(name = "SEQUENCE")
|
||||
// private String sequence;
|
||||
//
|
||||
// @Column(name = "SEQ_SP")
|
||||
// private String seq_sp;
|
||||
//
|
||||
// @Column(name = "SEQ_SP_PARAM")
|
||||
// private String seq_sp_param;
|
||||
//
|
||||
// @Column(name = "DEFAULT_1")
|
||||
// private String default_1;
|
||||
//
|
||||
// @Column(name = "DEFAULT_TYPE")
|
||||
// private String default_type;
|
||||
//
|
||||
// @Column(name = "DEFAULT_VALUE")
|
||||
// private String default_value;
|
||||
//
|
||||
// @Column(name = "DEFAULT_SP")
|
||||
// private String default_sp;
|
||||
//
|
||||
// @Column(name = "DEFAULT_SP_PARAM")
|
||||
// private String default_sp_param;
|
||||
//
|
||||
// @Column(name = "CALCULATED_FIELD")
|
||||
// private String calculated_field;
|
||||
//
|
||||
// @Column(name = "CAL_SP")
|
||||
// private String cal_sp;
|
||||
//
|
||||
// @Column(name = "CAL_SP_PARAM")
|
||||
// private String cal_sp_param;
|
||||
//
|
||||
// @Column(name = "ADD_TO_GRID")
|
||||
// private String add_to_grid;
|
||||
//
|
||||
// @Column(name = "DEPENDENT_ON")
|
||||
// private String dependent_on;
|
||||
// @Column(name = "RADIO")
|
||||
// private String radio;
|
||||
// @Column(name = "RADIO_OPTION")
|
||||
// private String radio_option;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
//import javax.persistence.Column;
|
||||
//import javax.persistence.MappedSuperclass;
|
||||
|
||||
//@MappedSuperclass
|
||||
public class Rn_ExtensionEntity extends Rn_FlexEntity {
|
||||
// @Column(name = "EXTN1")
|
||||
private String extn1;
|
||||
// @Column(name = "EXTN2")
|
||||
private String extn2;
|
||||
// @Column(name = "EXTN3")
|
||||
private String extn3;
|
||||
// @Column(name = "EXTN4")
|
||||
private String extn4;
|
||||
// @Column(name = "EXTN5")
|
||||
private String extn5;
|
||||
// @Column(name = "EXTN6")
|
||||
private String extn6;
|
||||
// @Column(name = "EXTN7")
|
||||
private String extn7;
|
||||
// @Column(name = "EXTN8")
|
||||
private String extn8;
|
||||
// @Column(name = "EXTN9")
|
||||
private String extn9;
|
||||
// @Column(name = "EXTN10")
|
||||
private String extn10;
|
||||
// @Column(name = "EXTN11")
|
||||
private String extn11;
|
||||
// @Column(name = "EXTN12")
|
||||
private String extn12;
|
||||
// @Column(name = "EXTN13")
|
||||
private String extn13;
|
||||
// @Column(name = "EXTN14")
|
||||
private String extn14;
|
||||
// @Column(name = "EXTN15")
|
||||
private String extn15;
|
||||
|
||||
public Rn_ExtensionEntity() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Rn_ExtensionEntity(String extn1, String extn2, String extn3, String extn4, String extn5, String extn6,
|
||||
String extn7, String extn8, String extn9, String extn10, String extn11, String extn12, String extn13,
|
||||
String extn14, String extn15) {
|
||||
super();
|
||||
this.extn1 = extn1;
|
||||
this.extn2 = extn2;
|
||||
this.extn3 = extn3;
|
||||
this.extn4 = extn4;
|
||||
this.extn5 = extn5;
|
||||
this.extn6 = extn6;
|
||||
this.extn7 = extn7;
|
||||
this.extn8 = extn8;
|
||||
this.extn9 = extn9;
|
||||
this.extn10 = extn10;
|
||||
this.extn11 = extn11;
|
||||
this.extn12 = extn12;
|
||||
this.extn13 = extn13;
|
||||
this.extn14 = extn14;
|
||||
this.extn15 = extn15;
|
||||
}
|
||||
|
||||
public String getExtn1() {
|
||||
return extn1;
|
||||
}
|
||||
|
||||
public void setExtn1(String extn1) {
|
||||
this.extn1 = extn1;
|
||||
}
|
||||
|
||||
public String getExtn2() {
|
||||
return extn2;
|
||||
}
|
||||
|
||||
public void setExtn2(String extn2) {
|
||||
this.extn2 = extn2;
|
||||
}
|
||||
|
||||
public String getExtn3() {
|
||||
return extn3;
|
||||
}
|
||||
|
||||
public void setExtn3(String extn3) {
|
||||
this.extn3 = extn3;
|
||||
}
|
||||
|
||||
public String getExtn4() {
|
||||
return extn4;
|
||||
}
|
||||
|
||||
public void setExtn4(String extn4) {
|
||||
this.extn4 = extn4;
|
||||
}
|
||||
|
||||
public String getExtn5() {
|
||||
return extn5;
|
||||
}
|
||||
|
||||
public void setExtn5(String extn5) {
|
||||
this.extn5 = extn5;
|
||||
}
|
||||
|
||||
public String getExtn6() {
|
||||
return extn6;
|
||||
}
|
||||
|
||||
public void setExtn6(String extn6) {
|
||||
this.extn6 = extn6;
|
||||
}
|
||||
|
||||
public String getExtn7() {
|
||||
return extn7;
|
||||
}
|
||||
|
||||
public void setExtn7(String extn7) {
|
||||
this.extn7 = extn7;
|
||||
}
|
||||
|
||||
public String getExtn8() {
|
||||
return extn8;
|
||||
}
|
||||
|
||||
public void setExtn8(String extn8) {
|
||||
this.extn8 = extn8;
|
||||
}
|
||||
|
||||
public String getExtn9() {
|
||||
return extn9;
|
||||
}
|
||||
|
||||
public void setExtn9(String extn9) {
|
||||
this.extn9 = extn9;
|
||||
}
|
||||
|
||||
public String getExtn10() {
|
||||
return extn10;
|
||||
}
|
||||
|
||||
public void setExtn10(String extn10) {
|
||||
this.extn10 = extn10;
|
||||
}
|
||||
|
||||
public String getExtn11() {
|
||||
return extn11;
|
||||
}
|
||||
|
||||
public void setExtn11(String extn11) {
|
||||
this.extn11 = extn11;
|
||||
}
|
||||
|
||||
public String getExtn12() {
|
||||
return extn12;
|
||||
}
|
||||
|
||||
public void setExtn12(String extn12) {
|
||||
this.extn12 = extn12;
|
||||
}
|
||||
|
||||
public String getExtn13() {
|
||||
return extn13;
|
||||
}
|
||||
|
||||
public void setExtn13(String extn13) {
|
||||
this.extn13 = extn13;
|
||||
}
|
||||
|
||||
public String getExtn14() {
|
||||
return extn14;
|
||||
}
|
||||
|
||||
public void setExtn14(String extn14) {
|
||||
this.extn14 = extn14;
|
||||
}
|
||||
|
||||
public String getExtn15() {
|
||||
return extn15;
|
||||
}
|
||||
|
||||
public void setExtn15(String extn15) {
|
||||
this.extn15 = extn15;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
//import javax.persistence.Column;
|
||||
//import javax.persistence.MappedSuperclass;
|
||||
|
||||
//@MappedSuperclass
|
||||
public class Rn_FlexEntity {
|
||||
// @Column(name = "FLEX1")
|
||||
private String flex1;
|
||||
// @Column(name = "FLEX2")
|
||||
private String flex2;
|
||||
// @Column(name = "FLEX3")
|
||||
private String flex3;
|
||||
// @Column(name = "FLEX4")
|
||||
private String flex4;
|
||||
// @Column(name = "FLEX5")
|
||||
private String flex5;
|
||||
|
||||
public Rn_FlexEntity() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Rn_FlexEntity(String flex1, String flex2, String flex3, String flex4, String flex5) {
|
||||
super();
|
||||
this.flex1 = flex1;
|
||||
this.flex2 = flex2;
|
||||
this.flex3 = flex3;
|
||||
this.flex4 = flex4;
|
||||
this.flex5 = flex5;
|
||||
}
|
||||
|
||||
public String getFlex1() {
|
||||
return flex1;
|
||||
}
|
||||
|
||||
public void setFlex1(String flex1) {
|
||||
this.flex1 = flex1;
|
||||
}
|
||||
|
||||
public String getFlex2() {
|
||||
return flex2;
|
||||
}
|
||||
|
||||
public void setFlex2(String flex2) {
|
||||
this.flex2 = flex2;
|
||||
}
|
||||
|
||||
public String getFlex3() {
|
||||
return flex3;
|
||||
}
|
||||
|
||||
public void setFlex3(String flex3) {
|
||||
this.flex3 = flex3;
|
||||
}
|
||||
|
||||
public String getFlex4() {
|
||||
return flex4;
|
||||
}
|
||||
|
||||
public void setFlex4(String flex4) {
|
||||
this.flex4 = flex4;
|
||||
}
|
||||
|
||||
public String getFlex5() {
|
||||
return flex5;
|
||||
}
|
||||
|
||||
public void setFlex5(String flex5) {
|
||||
this.flex5 = flex5;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
|
||||
//@Data
|
||||
//@EqualsAndHashCode(callSuper = false)
|
||||
//@Entity
|
||||
//@Table(name = "RN_FORMS_COMPONENT_SETUP_T")
|
||||
@Document
|
||||
public class Rn_Forms_Component_Setup extends Rn_Who_Columns {
|
||||
private static final long serialVersionUID = 1L;
|
||||
// @Id
|
||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
// @Column(name = "COMPONENT_ID")
|
||||
|
||||
@Id
|
||||
private String mongoid;
|
||||
|
||||
private int component_id;
|
||||
|
||||
// @Column(name = "LABEL")
|
||||
private String label;
|
||||
|
||||
// @Column(name = "TYPE")
|
||||
private String type;
|
||||
|
||||
// @Column(name = "MAPPING")
|
||||
private String mapping;
|
||||
|
||||
// @Column(name = "MANDATORY")
|
||||
private String mandatory;
|
||||
|
||||
// @Column(name = "READONLY")
|
||||
private String readonly;
|
||||
|
||||
// @Column(name = "DROP_VALUES")
|
||||
private String drop_values;
|
||||
|
||||
// @Column(name = "SP")
|
||||
private String sp;
|
||||
|
||||
// @ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
// @JoinColumn(name = "form_id", nullable = false)
|
||||
// @JsonBackReference
|
||||
private Rn_Forms_Setup rn_forms_setup;
|
||||
|
||||
public int getComponent_id() {
|
||||
return component_id;
|
||||
}
|
||||
|
||||
public void setComponent_id(int component_id) {
|
||||
this.component_id = component_id;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getMapping() {
|
||||
return mapping;
|
||||
}
|
||||
|
||||
public void setMapping(String mapping) {
|
||||
this.mapping = mapping;
|
||||
}
|
||||
|
||||
public String getMandatory() {
|
||||
return mandatory;
|
||||
}
|
||||
|
||||
public void setMandatory(String mandatory) {
|
||||
this.mandatory = mandatory;
|
||||
}
|
||||
|
||||
public String getReadonly() {
|
||||
return readonly;
|
||||
}
|
||||
|
||||
public void setReadonly(String readonly) {
|
||||
this.readonly = readonly;
|
||||
}
|
||||
|
||||
public String getDrop_values() {
|
||||
return drop_values;
|
||||
}
|
||||
|
||||
public void setDrop_values(String drop_values) {
|
||||
this.drop_values = drop_values;
|
||||
}
|
||||
|
||||
public String getSp() {
|
||||
return sp;
|
||||
}
|
||||
|
||||
public void setSp(String sp) {
|
||||
this.sp = sp;
|
||||
}
|
||||
|
||||
public Rn_Forms_Setup getRn_forms_setup() {
|
||||
return rn_forms_setup;
|
||||
}
|
||||
|
||||
public void setRn_forms_setup(Rn_Forms_Setup rn_forms_setup) {
|
||||
this.rn_forms_setup = rn_forms_setup;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonManagedReference;
|
||||
|
||||
//@Data
|
||||
//@EqualsAndHashCode(callSuper = false)
|
||||
//@Entity
|
||||
//@Table(name = "RN_FORMS_SETUP_T")
|
||||
@Document
|
||||
public class Rn_Forms_Setup extends Rn_Who_Columns {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private String mongoid;
|
||||
// @Id
|
||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
// @Column(name = "FORM_ID")
|
||||
private int form_id;
|
||||
|
||||
// @Column(name = "FORM_NAME")
|
||||
private String form_name;
|
||||
|
||||
// @Column(name = "FORM_DESC")
|
||||
private String form_desc;
|
||||
|
||||
// @Column(name = "RELATED_TO")
|
||||
private String related_to;
|
||||
|
||||
// @Column(name = "PAGE_EVENT")
|
||||
private String page_event;
|
||||
|
||||
// @Column(name = "BUTTON_CAPTION")
|
||||
private String button_caption;
|
||||
|
||||
// @OneToMany(mappedBy = "rn_forms_setup", cascade = CascadeType.ALL)
|
||||
// @JsonManagedReference
|
||||
private List<Rn_Forms_Component_Setup> components;
|
||||
|
||||
public int getForm_id() {
|
||||
return form_id;
|
||||
}
|
||||
|
||||
public void setForm_id(int form_id) {
|
||||
this.form_id = form_id;
|
||||
}
|
||||
|
||||
public String getForm_name() {
|
||||
return form_name;
|
||||
}
|
||||
|
||||
public void setForm_name(String form_name) {
|
||||
this.form_name = form_name;
|
||||
}
|
||||
|
||||
public String getForm_desc() {
|
||||
return form_desc;
|
||||
}
|
||||
|
||||
public void setForm_desc(String form_desc) {
|
||||
this.form_desc = form_desc;
|
||||
}
|
||||
|
||||
public String getRelated_to() {
|
||||
return related_to;
|
||||
}
|
||||
|
||||
public void setRelated_to(String related_to) {
|
||||
this.related_to = related_to;
|
||||
}
|
||||
|
||||
public String getPage_event() {
|
||||
return page_event;
|
||||
}
|
||||
|
||||
public void setPage_event(String page_event) {
|
||||
this.page_event = page_event;
|
||||
}
|
||||
|
||||
public String getButton_caption() {
|
||||
return button_caption;
|
||||
}
|
||||
|
||||
public void setButton_caption(String button_caption) {
|
||||
this.button_caption = button_caption;
|
||||
}
|
||||
|
||||
public List<Rn_Forms_Component_Setup> getComponents() {
|
||||
return components;
|
||||
}
|
||||
|
||||
public void setComponents(List<Rn_Forms_Component_Setup> components) {
|
||||
this.components = components;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
//@Entity
|
||||
//@Table(name = "RN_FUNC_REGISTER")
|
||||
@Document
|
||||
public class Rn_Function_Register extends Rn_Who_Columns {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private String mongoid;
|
||||
|
||||
// @Id
|
||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
// @Column(name = "ID")
|
||||
private int id;
|
||||
|
||||
// @Column(name = "MENU_ID")
|
||||
private int menu_id;
|
||||
|
||||
// @Column(name = "FUNCTION_NAME")
|
||||
private String function_name;
|
||||
|
||||
// @Column(name = "FUNCTION_ACTION_NAME")
|
||||
private String function_action_name;
|
||||
|
||||
// @Column(name = "FUNCTION_ICON")
|
||||
private String function_icon;
|
||||
|
||||
// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "MM/dd/yyyy")
|
||||
// @Column(name = "END_DATE")
|
||||
private LocalDate end_date;
|
||||
|
||||
// @Column(name = "ENABLE_FLAG")
|
||||
private String enable_flag;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getMenu_id() {
|
||||
return menu_id;
|
||||
}
|
||||
|
||||
public void setMenu_id(int menu_id) {
|
||||
this.menu_id = menu_id;
|
||||
}
|
||||
|
||||
public String getFunction_name() {
|
||||
return function_name;
|
||||
}
|
||||
|
||||
public void setFunction_name(String function_name) {
|
||||
this.function_name = function_name;
|
||||
}
|
||||
|
||||
public String getFunction_action_name() {
|
||||
return function_action_name;
|
||||
}
|
||||
|
||||
public void setFunction_action_name(String function_action_name) {
|
||||
this.function_action_name = function_action_name;
|
||||
}
|
||||
|
||||
public String getFunction_icon() {
|
||||
return function_icon;
|
||||
}
|
||||
|
||||
public void setFunction_icon(String function_icon) {
|
||||
this.function_icon = function_icon;
|
||||
}
|
||||
|
||||
public LocalDate getEnd_date() {
|
||||
return end_date;
|
||||
}
|
||||
|
||||
public void setEnd_date(LocalDate end_date) {
|
||||
this.end_date = end_date;
|
||||
}
|
||||
|
||||
public String getEnable_flag() {
|
||||
return enable_flag;
|
||||
}
|
||||
|
||||
public void setEnable_flag(String enable_flag) {
|
||||
this.enable_flag = enable_flag;
|
||||
}
|
||||
|
||||
// @Column(name = "MENU_NAME")
|
||||
// private String menu_name;
|
||||
// public String getMenu_name() {
|
||||
// return menu_name;
|
||||
// }
|
||||
// public void setMenu_name(String menu_name) {
|
||||
// this.menu_name = menu_name;
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
//@Entity
|
||||
//@Table(name = "RN_INSTANCE_TYPE_T")
|
||||
|
||||
@Document
|
||||
public class Rn_Instance_Type {
|
||||
// @Id
|
||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
// @Column(name = "ID")
|
||||
|
||||
@Id
|
||||
private String mongoid;
|
||||
|
||||
private Integer id;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
// @Column(name = "INSTANCE_TYPE")
|
||||
private String instanceType;
|
||||
|
||||
public String getInstanceType() {
|
||||
return instanceType;
|
||||
}
|
||||
|
||||
public void setInstanceType(String instanceType) {
|
||||
this.instanceType = instanceType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
|
||||
//@Entity
|
||||
//@Table(name = "RN_LOOKUP_VALUES_T")
|
||||
|
||||
@Document
|
||||
|
||||
public class Rn_Lookup_Values extends Rn_Who_Columns {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private String mongoid;
|
||||
|
||||
// @Id
|
||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
// @Column(name = "ID")
|
||||
private Integer id;
|
||||
|
||||
// @Column(name = "LOOKUP_CODE")
|
||||
private String lookupCode;
|
||||
|
||||
// @Column(name = "MEANING")
|
||||
private String meaning;
|
||||
|
||||
// @Column(name = "DESCRIPTION")
|
||||
private String description;
|
||||
|
||||
// @Column(name = "LOOKUP_TYPE")
|
||||
private String lookupType;
|
||||
|
||||
// @Column(name = "ACTIVE_START_DATE")
|
||||
private Date active_start_date;
|
||||
|
||||
// @Column(name = "ACTIVE_END_DATE")
|
||||
private Date active_end_date;
|
||||
|
||||
// @Column(name = "DROP_VALUE")
|
||||
private String dropValue;
|
||||
|
||||
// @Column(name = "ENABLED_FLAG")
|
||||
private boolean enabled_flag;
|
||||
|
||||
//
|
||||
// @Column(name = "PATIENT_COUNTRY")
|
||||
// private String patientCountry;
|
||||
//
|
||||
//
|
||||
//
|
||||
// @Column(name = "STATE_NAME")
|
||||
// private String stateName;
|
||||
//
|
||||
// @Column(name = "CITY_NAME")
|
||||
// private String cityName;
|
||||
//
|
||||
// @Column(name = "ZIP_CODE")
|
||||
// private String zipCode;
|
||||
//
|
||||
// @Column(name = "COUNTRY_ID")
|
||||
// private int country_id;
|
||||
|
||||
public Rn_Lookup_Values() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getLookupCode() {
|
||||
return lookupCode;
|
||||
}
|
||||
|
||||
public void setLookupCode(String lookupCode) {
|
||||
this.lookupCode = lookupCode;
|
||||
}
|
||||
|
||||
public String getMeaning() {
|
||||
return meaning;
|
||||
}
|
||||
|
||||
public void setMeaning(String meaning) {
|
||||
this.meaning = meaning;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getLookupType() {
|
||||
return lookupType;
|
||||
}
|
||||
|
||||
public void setLookupType(String lookupType) {
|
||||
this.lookupType = lookupType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getDropValue() {
|
||||
return dropValue;
|
||||
}
|
||||
|
||||
public void setDropValue(String dropValue) {
|
||||
this.dropValue = dropValue;
|
||||
}
|
||||
|
||||
public Date getActive_start_date() {
|
||||
return active_start_date;
|
||||
}
|
||||
|
||||
public void setActive_start_date(Date active_start_date) {
|
||||
this.active_start_date = active_start_date;
|
||||
}
|
||||
|
||||
public Date getActive_end_date() {
|
||||
return active_end_date;
|
||||
}
|
||||
|
||||
public void setActive_end_date(Date active_end_date) {
|
||||
this.active_end_date = active_end_date;
|
||||
}
|
||||
|
||||
public boolean isEnabled_flag() {
|
||||
return enabled_flag;
|
||||
}
|
||||
|
||||
public void setEnabled_flag(boolean enabled_flag) {
|
||||
this.enabled_flag = enabled_flag;
|
||||
}
|
||||
|
||||
// @Column(name = "CREATED_BY")
|
||||
// private int created_by;
|
||||
//
|
||||
// @DateTimeFormat(pattern = "dd/mm/yyyy")
|
||||
// @Column(name = "CREATION_DATE")
|
||||
// private Date creation_date = new java.sql.Date(new java.util.Date().getTime());
|
||||
//
|
||||
// @Column(name = "LAST_UPDATED_BY")
|
||||
// private int last_updated_by;
|
||||
//
|
||||
// @DateTimeFormat(pattern = "dd/mm/yyyy")
|
||||
// @Column(name = "LAST_UPDATE_DATE")
|
||||
// private Date last_update_date = new java.sql.Date(new java.util.Date().getTime());
|
||||
|
||||
// public String getPatientCountry() {
|
||||
// return patientCountry;
|
||||
// }
|
||||
//
|
||||
// public void setPatientCountry(String patientCountry) {
|
||||
// this.patientCountry = patientCountry;
|
||||
// }
|
||||
// public String getStateName() {
|
||||
// return stateName;
|
||||
// }
|
||||
//
|
||||
// public void setStateName(String stateName) {
|
||||
// this.stateName = stateName;
|
||||
// }
|
||||
//
|
||||
// public String getCityName() {
|
||||
// return cityName;
|
||||
// }
|
||||
//
|
||||
// public void setCityName(String cityName) {
|
||||
// this.cityName = cityName;
|
||||
// }
|
||||
//
|
||||
// public String getZipCode() {
|
||||
// return zipCode;
|
||||
// }
|
||||
//
|
||||
// public void setZipCode(String zipCode) {
|
||||
// this.zipCode = zipCode;
|
||||
// }
|
||||
//
|
||||
// public int getCountry_id() {
|
||||
// return country_id;
|
||||
// }
|
||||
//
|
||||
// public void setCountry_id(int country_id) {
|
||||
// this.country_id = country_id;
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonManagedReference;
|
||||
|
||||
//@Entity
|
||||
//@Table(name = "RN_MAIN_MENU")
|
||||
@Document
|
||||
public class Rn_Main_Menu extends Rn_Who_Columns {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private String mongoid;
|
||||
|
||||
// @Id
|
||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
// @Column(name = "ID")
|
||||
private Integer id;
|
||||
|
||||
// @Column(name = "MENU_NAME")
|
||||
private String menu_name;
|
||||
|
||||
// @Column(name = "MENU_ACTION_LINK")
|
||||
private String menu_action_link;
|
||||
|
||||
// @Column(name = "MENU_ICON")
|
||||
private String menu_icon;
|
||||
|
||||
// @Column(name = "MENU_TYPE")
|
||||
private String menu_type;
|
||||
|
||||
// @OneToMany(mappedBy = "rn_main_menu", cascade = CascadeType.ALL)
|
||||
// @JsonManagedReference
|
||||
private List<Rn_Sub_Menu> sub_menus;
|
||||
|
||||
public Rn_Main_Menu() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Rn_Main_Menu(Integer id, String menu_name, String menu_action_link, String menu_icon, String menu_type,
|
||||
List<Rn_Sub_Menu> sub_menus) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.menu_name = menu_name;
|
||||
this.menu_action_link = menu_action_link;
|
||||
this.menu_icon = menu_icon;
|
||||
this.menu_type = menu_type;
|
||||
this.sub_menus = sub_menus;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getMenu_name() {
|
||||
return menu_name;
|
||||
}
|
||||
|
||||
public void setMenu_name(String menu_name) {
|
||||
this.menu_name = menu_name;
|
||||
}
|
||||
|
||||
public String getMenu_action_link() {
|
||||
return menu_action_link;
|
||||
}
|
||||
|
||||
public void setMenu_action_link(String menu_action_link) {
|
||||
this.menu_action_link = menu_action_link;
|
||||
}
|
||||
|
||||
public String getMenu_icon() {
|
||||
return menu_icon;
|
||||
}
|
||||
|
||||
public void setMenu_icon(String menu_icon) {
|
||||
this.menu_icon = menu_icon;
|
||||
}
|
||||
|
||||
public String getMenu_type() {
|
||||
return menu_type;
|
||||
}
|
||||
|
||||
public void setMenu_type(String menu_type) {
|
||||
this.menu_type = menu_type;
|
||||
}
|
||||
|
||||
public List<Rn_Sub_Menu> getSub_menus() {
|
||||
return sub_menus;
|
||||
}
|
||||
|
||||
public void setSub_menus(List<Rn_Sub_Menu> sub_menus) {
|
||||
this.sub_menus = sub_menus;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonManagedReference;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
//@Entity
|
||||
//@Table(name = "RN_MENU_GROUP_HEADER")
|
||||
|
||||
@Document
|
||||
public class Rn_Menu_Group_Header extends Rn_Who_Columns {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private String mongoid;
|
||||
// @Id
|
||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
// @Column(name = "ID")
|
||||
private Long id;
|
||||
|
||||
// @Column(name = "MENU_NAME")
|
||||
private String menu_name;
|
||||
|
||||
// @Column(name = "DESCRIPTION")
|
||||
private String description;
|
||||
|
||||
// @Column(name = "ACTIVE")
|
||||
private boolean active;
|
||||
|
||||
// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "MM/dd/yyyy")
|
||||
// @JsonSerialize(using = LocalDateSerializer.class)
|
||||
// @Column(name = "START_DATE")
|
||||
private LocalDate start_date;
|
||||
|
||||
// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "MM/dd/yyyy")
|
||||
// @JsonSerialize(using = LocalDateSerializer.class)
|
||||
// @Column(name = "END_DATE")
|
||||
private LocalDate end_date;
|
||||
|
||||
private String start_date_1;
|
||||
private String end_date_1;
|
||||
|
||||
// header
|
||||
// @OneToMany(mappedBy = "menu_group_header", cascade = CascadeType.ALL)
|
||||
// @JsonManagedReference
|
||||
private List<Rn_Menu_Group_Line> menu_group_lines;
|
||||
|
||||
|
||||
public Rn_Menu_Group_Header() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getMenu_name() {
|
||||
return menu_name;
|
||||
}
|
||||
|
||||
|
||||
public void setMenu_name(String menu_name) {
|
||||
this.menu_name = menu_name;
|
||||
}
|
||||
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
|
||||
public void setActive(boolean active) {
|
||||
this.active = active;
|
||||
}
|
||||
|
||||
|
||||
public LocalDate getStart_date() {
|
||||
return start_date;
|
||||
}
|
||||
|
||||
|
||||
public void setStart_date(LocalDate start_date) {
|
||||
this.start_date = start_date;
|
||||
}
|
||||
|
||||
|
||||
public LocalDate getEnd_date() {
|
||||
return end_date;
|
||||
}
|
||||
|
||||
|
||||
public void setEnd_date(LocalDate end_date) {
|
||||
this.end_date = end_date;
|
||||
}
|
||||
|
||||
|
||||
public String getStart_date_1() {
|
||||
return start_date_1;
|
||||
}
|
||||
|
||||
|
||||
public void setStart_date_1(String start_date_1) {
|
||||
this.start_date_1 = start_date_1;
|
||||
}
|
||||
|
||||
|
||||
public String getEnd_date_1() {
|
||||
return end_date_1;
|
||||
}
|
||||
|
||||
|
||||
public void setEnd_date_1(String end_date_1) {
|
||||
this.end_date_1 = end_date_1;
|
||||
}
|
||||
|
||||
|
||||
public List<Rn_Menu_Group_Line> getMenu_group_lines() {
|
||||
return menu_group_lines;
|
||||
}
|
||||
|
||||
|
||||
public void setMenu_group_lines(List<Rn_Menu_Group_Line> menu_group_lines) {
|
||||
this.menu_group_lines = menu_group_lines;
|
||||
}
|
||||
|
||||
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
|
||||
public Rn_Menu_Group_Header(Long id, String menu_name, String description, boolean active, LocalDate start_date,
|
||||
LocalDate end_date, String start_date_1, String end_date_1, List<Rn_Menu_Group_Line> menu_group_lines) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.menu_name = menu_name;
|
||||
this.description = description;
|
||||
this.active = active;
|
||||
this.start_date = start_date;
|
||||
this.end_date = end_date;
|
||||
this.start_date_1 = start_date_1;
|
||||
this.end_date_1 = end_date_1;
|
||||
this.menu_group_lines = menu_group_lines;
|
||||
}
|
||||
|
||||
// public Rn_Menu_Group_Header(int id, String menu_name, String description, boolean active, LocalDate start_date,
|
||||
// LocalDate end_date, List<Rn_Menu_Group_Line> menu_group_lines) {
|
||||
// super();
|
||||
// this.id = id;
|
||||
// this.menu_name = menu_name;
|
||||
// this.description = description;
|
||||
// this.active = active;
|
||||
// this.start_date = start_date;
|
||||
// this.end_date = end_date;
|
||||
// this.menu_group_lines = menu_group_lines;
|
||||
// }
|
||||
//
|
||||
// public int getId() {
|
||||
// return id;
|
||||
// }
|
||||
//
|
||||
// public void setId(int id) {
|
||||
// this.id = id;
|
||||
// }
|
||||
//
|
||||
// public String getMenu_name() {
|
||||
// return menu_name;
|
||||
// }
|
||||
//
|
||||
// public void setMenu_name(String menu_name) {
|
||||
// this.menu_name = menu_name;
|
||||
// }
|
||||
//
|
||||
// public String getDescription() {
|
||||
// return description;
|
||||
// }
|
||||
//
|
||||
// public void setDescription(String description) {
|
||||
// this.description = description;
|
||||
// }
|
||||
//
|
||||
// public boolean getActive() {
|
||||
// return active;
|
||||
// }
|
||||
//
|
||||
// public void setActive(boolean active) {
|
||||
// this.active = active;
|
||||
// }
|
||||
//
|
||||
// public LocalDate getStart_date() {
|
||||
// return start_date;
|
||||
// }
|
||||
//
|
||||
// public void setStart_date(LocalDate start_date) {
|
||||
// this.start_date = start_date;
|
||||
// }
|
||||
//
|
||||
// public LocalDate getEnd_date() {
|
||||
// return end_date;
|
||||
// }
|
||||
//
|
||||
// public void setEnd_date(LocalDate end_date) {
|
||||
// this.end_date = end_date;
|
||||
// }
|
||||
//
|
||||
// public List<Rn_Menu_Group_Line> getMenu_group_lines() {
|
||||
// return menu_group_lines;
|
||||
// }
|
||||
//
|
||||
// public void setMenu_group_lines(List<Rn_Menu_Group_Line> menu_group_lines) {
|
||||
// this.menu_group_lines = menu_group_lines;
|
||||
// }
|
||||
//
|
||||
// public String getStart_date_1() {
|
||||
// return start_date_1;
|
||||
// }
|
||||
//
|
||||
// public void setStart_date_1(String start_date_1) {
|
||||
// this.start_date_1 = start_date_1;
|
||||
// }
|
||||
//
|
||||
// public String getEnd_date_1() {
|
||||
// return end_date_1;
|
||||
// }
|
||||
//
|
||||
// public void setEnd_date_1(String end_date_1) {
|
||||
// this.end_date_1 = end_date_1;
|
||||
// }
|
||||
//
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
//import javax.persistence.Column;
|
||||
//import javax.persistence.Entity;
|
||||
//import javax.persistence.FetchType;
|
||||
//import javax.persistence.GeneratedValue;
|
||||
//import javax.persistence.GenerationType;
|
||||
//import javax.persistence.Id;
|
||||
//import javax.persistence.JoinColumn;
|
||||
//import javax.persistence.ManyToOne;
|
||||
//import javax.persistence.Table;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
|
||||
//@Entity
|
||||
//@Table(name = "RN_MENU_GROUP_LINE")
|
||||
// @Table(name = "rn_menu_group_line_1")
|
||||
@Document
|
||||
public class Rn_Menu_Group_Line extends Rn_Who_Columns {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private String mongoid;
|
||||
// @Id
|
||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
// @Column(name = "ID")
|
||||
private int id;
|
||||
|
||||
// @Column(name = "MENU_ID")
|
||||
private int menu_id;
|
||||
|
||||
private String menu_name;
|
||||
|
||||
|
||||
|
||||
// @Column(name = "NAME")
|
||||
private String name;
|
||||
|
||||
// @Column(name = "ACTIVE")
|
||||
private boolean active;
|
||||
|
||||
|
||||
// @Column(name = "SEQ")
|
||||
private int seq;
|
||||
|
||||
// @Column(name = "TYPE")
|
||||
private String type;
|
||||
|
||||
// line
|
||||
// @ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
// @JoinColumn(name = "menu_group_header_id", nullable = false)
|
||||
// @JsonBackReference
|
||||
private Rn_Menu_Group_Header menu_group_header;
|
||||
|
||||
public Rn_Menu_Group_Line() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Rn_Menu_Group_Line(int id, String name, boolean active, int menu_id,
|
||||
int seq, String type, Rn_Menu_Group_Header menu_group_header) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.active = active;
|
||||
this.menu_id = menu_id;
|
||||
this.seq = seq;
|
||||
this.type = type;
|
||||
this.menu_group_header = menu_group_header;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public boolean getActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
public void setActive(boolean active) {
|
||||
this.active = active;
|
||||
}
|
||||
|
||||
|
||||
public int getMenu_id() {
|
||||
return menu_id;
|
||||
}
|
||||
|
||||
public void setMenu_id(int menu_id) {
|
||||
this.menu_id = menu_id;
|
||||
}
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public void setSeq(int seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Rn_Menu_Group_Header getMenu_group_header() {
|
||||
return menu_group_header;
|
||||
}
|
||||
|
||||
public void setMenu_group_header(Rn_Menu_Group_Header menu_group_header) {
|
||||
this.menu_group_header = menu_group_header;
|
||||
}
|
||||
|
||||
public String getMenu_name() {
|
||||
return menu_name;
|
||||
}
|
||||
|
||||
public void setMenu_name(String menu_name) {
|
||||
this.menu_name = menu_name;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
//import javax.persistence.Column;
|
||||
//import javax.persistence.Entity;
|
||||
//import javax.persistence.GeneratedValue;
|
||||
//import javax.persistence.GenerationType;
|
||||
//import javax.persistence.Id;
|
||||
//import javax.persistence.Table;
|
||||
//import javax.persistence.Temporal;
|
||||
//import javax.persistence.TemporalType;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
//@Entity
|
||||
//@Table(name = "RN_MENU_REGISTER")
|
||||
public class Rn_Menu_Register extends Rn_Who_Columns {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private String mongoid;
|
||||
// @Id
|
||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
// @Column(name = "ID")
|
||||
private int id;
|
||||
|
||||
// @Column(name = "MAIN_MENU_NAME")
|
||||
private String main_menu_name;
|
||||
|
||||
// @Column(name = "MAIN_MENU_ACTION_NAME")
|
||||
private String main_menu_action_name;
|
||||
|
||||
// @Column(name = "MAIN_MENU_ICON")
|
||||
private String main_menu_icon;
|
||||
|
||||
// @Column(name = "ENABLE_FLAG")
|
||||
private boolean enable_flag;
|
||||
|
||||
// @DateTimeFormat(pattern = "dd/mm/yyyy")
|
||||
// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "MM/dd/yyyy")
|
||||
// @Column(name = "END_DATE")
|
||||
private LocalDate end_date;
|
||||
|
||||
private String end_date_1;
|
||||
|
||||
public Rn_Menu_Register() {}
|
||||
|
||||
public boolean getEnable_flag() {
|
||||
return enable_flag;
|
||||
}
|
||||
|
||||
public void setEnable_flag(boolean enable_flag) {
|
||||
this.enable_flag = enable_flag;
|
||||
}
|
||||
|
||||
public LocalDate getEnd_date() {
|
||||
return end_date;
|
||||
}
|
||||
|
||||
public void setEnd_date(LocalDate end_date) {
|
||||
this.end_date = end_date;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getMain_menu_name() {
|
||||
return main_menu_name;
|
||||
}
|
||||
|
||||
public void setMain_menu_name(String main_menu_name) {
|
||||
this.main_menu_name = main_menu_name;
|
||||
}
|
||||
|
||||
public String getMain_menu_action_name() {
|
||||
return main_menu_action_name;
|
||||
}
|
||||
|
||||
public void setMain_menu_action_name(String main_menu_action_name) {
|
||||
this.main_menu_action_name = main_menu_action_name;
|
||||
}
|
||||
|
||||
public String getMain_menu_icon() {
|
||||
return main_menu_icon;
|
||||
}
|
||||
|
||||
public void setMain_menu_icon(String main_menu_icon) {
|
||||
this.main_menu_icon = main_menu_icon;
|
||||
}
|
||||
|
||||
public String getEnd_date_1() {
|
||||
return end_date_1;
|
||||
}
|
||||
|
||||
public void setEnd_date_1(String end_date_1) {
|
||||
this.end_date_1 = end_date_1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
//import javax.persistence.Column;
|
||||
//import javax.persistence.Entity;
|
||||
//import javax.persistence.FetchType;
|
||||
//import javax.persistence.GeneratedValue;
|
||||
//import javax.persistence.GenerationType;
|
||||
//import javax.persistence.Id;
|
||||
//import javax.persistence.JoinColumn;
|
||||
//import javax.persistence.ManyToOne;
|
||||
//import javax.persistence.Table;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
//@Entity
|
||||
//@Table(name = "RN_SUB_MENU")
|
||||
@Document
|
||||
@Data
|
||||
public class Rn_Sub_Menu extends Rn_Who_Columns {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
private String mongoid;
|
||||
// @Id
|
||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
// @Column(name = "ID")
|
||||
private Integer id;
|
||||
|
||||
// @Column(name = "SUB_MENU_NAME")
|
||||
private String sub_menu_name;
|
||||
|
||||
// @Column(name = "SUB_MENU_ICON")
|
||||
private String sub_menu_icon;
|
||||
|
||||
// @Column(name = "SUB_MENU_ACTION_LINK")
|
||||
private String sub_menu_action_link;
|
||||
|
||||
// @ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
// @JoinColumn(name = "MAIN_MENU_ID")
|
||||
// @JsonBackReference
|
||||
private Rn_Main_Menu rn_main_menu;
|
||||
|
||||
public Rn_Sub_Menu() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Rn_Sub_Menu(Integer id, String sub_menu_name, String sub_menu_icon, String sub_menu_action_link,
|
||||
Rn_Main_Menu rn_main_menu) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.sub_menu_name = sub_menu_name;
|
||||
this.sub_menu_icon = sub_menu_icon;
|
||||
this.sub_menu_action_link = sub_menu_action_link;
|
||||
this.rn_main_menu = rn_main_menu;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSub_menu_name() {
|
||||
return sub_menu_name;
|
||||
}
|
||||
|
||||
public void setSub_menu_name(String sub_menu_name) {
|
||||
this.sub_menu_name = sub_menu_name;
|
||||
}
|
||||
|
||||
public String getSub_menu_icon() {
|
||||
return sub_menu_icon;
|
||||
}
|
||||
|
||||
public void setSub_menu_icon(String sub_menu_icon) {
|
||||
this.sub_menu_icon = sub_menu_icon;
|
||||
}
|
||||
|
||||
public String getSub_menu_action_link() {
|
||||
return sub_menu_action_link;
|
||||
}
|
||||
|
||||
public void setSub_menu_action_link(String sub_menu_action_link) {
|
||||
this.sub_menu_action_link = sub_menu_action_link;
|
||||
}
|
||||
|
||||
public Rn_Main_Menu getRn_main_menu() {
|
||||
return rn_main_menu;
|
||||
}
|
||||
|
||||
public void setRn_main_menu(Rn_Main_Menu rn_main_menu) {
|
||||
this.rn_main_menu = rn_main_menu;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
//import javax.persistence.Column;
|
||||
//import javax.persistence.EntityListeners;
|
||||
//import javax.persistence.MappedSuperclass;
|
||||
//import javax.persistence.Temporal;
|
||||
//import javax.persistence.TemporalType;
|
||||
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
//import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
//@MappedSuperclass
|
||||
//@EntityListeners(AuditingEntityListener.class)
|
||||
public class Rn_Who_AccId_Column implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// @Temporal(TemporalType.TIMESTAMP)
|
||||
// @Column(name = "CREATED_AT", nullable = false, updatable = false)
|
||||
// @CreatedDate
|
||||
private Date createdAt;
|
||||
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createdAt;
|
||||
|
||||
// @Temporal(TemporalType.TIMESTAMP)
|
||||
// @Column(name = "UPDATED_AT", nullable = false)
|
||||
// @LastModifiedDate
|
||||
private Date updatedAt;
|
||||
|
||||
// @Column(name = "CREATED_BY", updatable = false)
|
||||
private Long createdBy;
|
||||
|
||||
// @Column(name = "UPDATED_BY")
|
||||
private Long updatedBy;
|
||||
|
||||
// @Column(name = "ACCOUNT_ID")
|
||||
private Long accountId;
|
||||
|
||||
public Date getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Date createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Date updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Long getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(Long createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public Long getUpdatedBy() {
|
||||
return updatedBy;
|
||||
}
|
||||
|
||||
public void setUpdatedBy(Long updatedBy) {
|
||||
this.updatedBy = updatedBy;
|
||||
}
|
||||
|
||||
public Long getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
public void setAccountId(Long accountId) {
|
||||
this.accountId = accountId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
//import javax.persistence.Column;
|
||||
//import javax.persistence.EntityListeners;
|
||||
//import javax.persistence.MappedSuperclass;
|
||||
//import javax.persistence.Temporal;
|
||||
//import javax.persistence.TemporalType;
|
||||
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
//import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
//@MappedSuperclass
|
||||
//@EntityListeners(AuditingEntityListener.class)
|
||||
public class Rn_Who_Columns implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// @Temporal(TemporalType.TIMESTAMP)
|
||||
// @Column(name = "CREATED_AT", nullable = false, updatable = false)
|
||||
// @CreatedDate
|
||||
private Date createdAt;
|
||||
// @Temporal(TemporalType.TIMESTAMP)
|
||||
// @Column(name = "UPDATED_AT", nullable = false)
|
||||
// @LastModifiedDate
|
||||
private Date updatedAt;
|
||||
// @Column(name = "CREATED_BY", updatable = false)
|
||||
private Long createdBy;
|
||||
// @Column(name = "UPDATED_BY")
|
||||
private Long updatedBy;
|
||||
|
||||
public Date getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Date createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Date updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Long getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(Long createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public Long getUpdatedBy() {
|
||||
return updatedBy;
|
||||
}
|
||||
|
||||
public void setUpdatedBy(Long updatedBy) {
|
||||
this.updatedBy = updatedBy;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SingleSerise {
|
||||
private String name;
|
||||
private BigDecimal value;
|
||||
|
||||
public SingleSerise( String name, BigDecimal value){
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
|
||||
public class Success implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String message;
|
||||
|
||||
private String title;
|
||||
|
||||
public String getMessage ()
|
||||
{
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage (String message)
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getTitle ()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle (String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "ClassPojo [message = "+message+", title = "+title+"]";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
|
||||
public class SuccessPojo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Success success;
|
||||
|
||||
public SuccessPojo() {
|
||||
|
||||
}
|
||||
|
||||
public SuccessPojo(Success success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
|
||||
public Success getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(Success success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "ClassPojo [success = "+success+"]";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.realnet.session.entity.VersionModel;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/version", produces = { "application/json" })
|
||||
@Api(tags = {"Common"})
|
||||
public class Version {
|
||||
@ApiOperation(value = "Gets the version of the REST API", notes = "", response = VersionModel.class)
|
||||
@ApiResponses(value = { @ApiResponse(code = 200, message = "Returns the version info for the REST API.", response = VersionModel.class) })
|
||||
@RequestMapping( method = RequestMethod.GET)
|
||||
public VersionModel getVersion() {
|
||||
//Authentication ath = SecurityContextHolder.getContext().getAuthentication();
|
||||
//TokenUser usr = (TokenUser)ath.getDetails();
|
||||
//String customerId = usr.getUser().getCustomerId()
|
||||
VersionModel r = new VersionModel();
|
||||
r.setVersion("1.0.0");
|
||||
r.setMajor(1);
|
||||
r.setMinor(0);
|
||||
r.setPatch(0);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WireFrameCopyDTO {
|
||||
private int from_projectId;
|
||||
private int from_moduleId;
|
||||
private int from_WireFrameId;
|
||||
private String to_uiName;
|
||||
|
||||
public WireFrameCopyDTO() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.realnet.fnd.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class projectCopyDTO {
|
||||
private int from_projectId;
|
||||
private String to_projectName;
|
||||
private String to_tech_stack;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.realnet.fnd.entity1;
|
||||
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ExtensionModel {
|
||||
|
||||
|
||||
|
||||
private String ext1;
|
||||
private String ext2;
|
||||
private String ext3;
|
||||
private String ext4;
|
||||
private String ext5;
|
||||
private String ext6;
|
||||
private String ext7;
|
||||
private String ext8;
|
||||
private String ext9;
|
||||
private String ext10;
|
||||
|
||||
// @Column(length = 4000)
|
||||
private String bigext1;
|
||||
|
||||
// @Column(length = 4000)
|
||||
private String bigext2;
|
||||
|
||||
// @Column(length = 4000)
|
||||
private String bigext3;
|
||||
|
||||
// @Column(length = 4000)
|
||||
private String bigext4;
|
||||
|
||||
// @Column(length = 4000)
|
||||
private String bigext5;
|
||||
|
||||
private String flex1;
|
||||
private String flex2;
|
||||
|
||||
private String flex3;
|
||||
private String flex4;
|
||||
private String flex5;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.realnet.fnd.entity1;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
//
|
||||
//import javax.persistence.CascadeType;
|
||||
//import javax.persistence.Column;
|
||||
//import javax.persistence.Entity;
|
||||
//import javax.persistence.Id;
|
||||
//import javax.persistence.IdClass;
|
||||
//import javax.persistence.JoinColumn;
|
||||
//import javax.persistence.ManyToOne;
|
||||
//import javax.persistence.OneToMany;
|
||||
//import javax.persistence.Table;
|
||||
//import javax.persistence.Transient;
|
||||
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import com.realnet.users.entity1.AppUserRole;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
//@Entity
|
||||
//@Table(name="SEC_GRP_MENU_ACCESS")
|
||||
//@IdClass(GrpMenuAccesscompositeKey.class)
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
@Document
|
||||
public class GrpMenuAccess {
|
||||
// @Id
|
||||
// @ManyToOne
|
||||
// @JoinColumn(name = "usr_grp")
|
||||
private AppUserRole usrGrp;
|
||||
// @Id
|
||||
// @ManyToOne
|
||||
// @JoinColumn(name = "menu_item_id")
|
||||
private MenuDet menuItemId;
|
||||
private String mCreate;
|
||||
private String mEdit;
|
||||
private String mQuery;
|
||||
private String mDelete;
|
||||
private String mexport;
|
||||
|
||||
|
||||
private Long menuId;
|
||||
private String mVisible;
|
||||
private String createby;
|
||||
private Date createdAt;
|
||||
private String updateby;
|
||||
private Date updatedAt;
|
||||
|
||||
private String isdisable;
|
||||
|
||||
|
||||
// @Column(name = "itemSeq")
|
||||
private Long itemSeq;
|
||||
|
||||
// @Column(name = "MenuItemDesc")
|
||||
private String menuItemDesc;
|
||||
private String status;
|
||||
|
||||
|
||||
// @Column(name = "moduleName")
|
||||
private String moduleName;
|
||||
|
||||
|
||||
|
||||
// @Column(name = "MainMenuActionName")
|
||||
private String main_menu_action_name;
|
||||
|
||||
// @Column(name = "MainMenuIconName")
|
||||
private String main_menu_icon_name;
|
||||
|
||||
// @Transient
|
||||
private List<GrpMenuAccess> subMenus=new ArrayList<GrpMenuAccess>();
|
||||
|
||||
|
||||
// @Transient
|
||||
private Long grpid;
|
||||
// @Transient
|
||||
private Long gmenuid;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.realnet.fnd.entity1;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GrpMenuAccesscompositeKey implements Serializable{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Long menuItemId;
|
||||
private Long usrGrp;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.realnet.fnd.entity1;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class MIXMENUN {
|
||||
private long menuItemId;
|
||||
private String menuItemDesc;
|
||||
private long menuId;
|
||||
|
||||
private String mainMenuActionName;
|
||||
private String mainMenuIconName;
|
||||
private String mCreate;
|
||||
private String mEdit;
|
||||
private String mQuery;
|
||||
private String mDelete;
|
||||
private String mVisible;
|
||||
private List<MIXMENUN> subMenus;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.realnet.fnd.entity1;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
//import javax.persistence.Column;
|
||||
//import javax.persistence.Entity;
|
||||
//import javax.persistence.FetchType;
|
||||
//import javax.persistence.GeneratedValue;
|
||||
//import javax.persistence.GenerationType;
|
||||
//import javax.persistence.Id;
|
||||
//import javax.persistence.JoinColumn;
|
||||
//import javax.persistence.ManyToOne;
|
||||
//import javax.persistence.Table;
|
||||
//import javax.persistence.Temporal;
|
||||
//import javax.persistence.TemporalType;
|
||||
//import javax.persistence.Transient;
|
||||
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
//@Entity
|
||||
//@Table(name = "SEC_MENU_DET")
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
@Document
|
||||
public class MenuDet extends menudet_who{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private String mongoid;
|
||||
|
||||
// @Id
|
||||
// @GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long menuItemId;
|
||||
|
||||
// @Column(name = "itemSeq")
|
||||
private Long itemSeq;
|
||||
|
||||
// @Column(name = "MenuItemDesc")
|
||||
private String menuItemDesc;
|
||||
private String status;
|
||||
|
||||
private Long menuId;
|
||||
|
||||
// @Column(name = "moduleName")
|
||||
private String moduleName;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// @Column(name = "MainMenuActionName")
|
||||
private String main_menu_action_name;
|
||||
|
||||
// @Column(name = "MainMenuIconName")
|
||||
private String main_menu_icon_name;
|
||||
|
||||
// @Transient
|
||||
private List<MenuDet> subMenus=new ArrayList<MenuDet>();;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.realnet.fnd.entity1;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class MixMenu {
|
||||
// private BigDecimal menuItemId;
|
||||
private BigInteger menuItemId;
|
||||
|
||||
private String menuItemDesc;
|
||||
// private BigDecimal menuId;
|
||||
private BigInteger menuId;
|
||||
|
||||
|
||||
private String mainMenuActionName;
|
||||
private String mainMenuIconName;
|
||||
private String mCreate;
|
||||
private String mEdit;
|
||||
private String mQuery;
|
||||
private String mDelete;
|
||||
private String mVisible;
|
||||
private List<MixMenu> subMenus;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.realnet.fnd.entity1;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public interface MixMenuNew {
|
||||
|
||||
BigDecimal getmenu_item_id();
|
||||
String getmenu_item_desc();
|
||||
BigDecimal getmenu_id();
|
||||
String getm_create();
|
||||
String getmain_menu_action_name();
|
||||
String getmain_menu_icon_name();
|
||||
String getm_edit();
|
||||
String getm_query();
|
||||
String getm_delete();
|
||||
String getm_visible();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.realnet.fnd.entity1;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
//import javax.persistence.Column;
|
||||
//import javax.persistence.EntityListeners;
|
||||
//import javax.persistence.MappedSuperclass;
|
||||
//import javax.persistence.Temporal;
|
||||
//import javax.persistence.TemporalType;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
//import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
//@MappedSuperclass
|
||||
//@EntityListeners(AuditingEntityListener.class)
|
||||
public class menudet_who implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// @Temporal(TemporalType.TIMESTAMP)
|
||||
// @Column(name = "CREATED_AT", nullable = false, updatable = false)
|
||||
// @CreatedDate
|
||||
private Date createdAt;
|
||||
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createdAt;
|
||||
|
||||
|
||||
// @Column(name = "CREATED_BY", updatable = false)
|
||||
// private Long createdBy;
|
||||
|
||||
// @Column(name = "UPDATED_BY")
|
||||
// private Long updatedBy;
|
||||
|
||||
// @Temporal(TemporalType.TIMESTAMP)
|
||||
// @Column(name = "UPDATED_AT", nullable = false)
|
||||
// @LastModifiedDate
|
||||
private Date updatedAt;
|
||||
|
||||
// @Column(name = "ACCOUNT_ID")
|
||||
// private Long accountId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.realnet.fnd.repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
//
|
||||
//import org.springframework.data.jpa.repository.JpaRepository;
|
||||
//import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Ext_Fields;
|
||||
|
||||
@Repository
|
||||
public interface ExtFieldRepository extends MongoRepository<Rn_Ext_Fields, String> {
|
||||
|
||||
// @Query(value= "SELECT * FROM rn_ext_field_t WHERE ACCOUNT_ID=:acc_id AND FORM_CODE=:f_code" , nativeQuery = true)
|
||||
|
||||
@Query("{'account_id': ?0, 'form_code': ?1}")
|
||||
List<Rn_Ext_Fields> getExtensionFieldByFormCode(@Param("acc_id")String accountId, @Param("f_code") String form_code);
|
||||
|
||||
@Query("{'id': ?0}")
|
||||
Optional<Rn_Ext_Fields> findById(int id);
|
||||
|
||||
// boolean existsById(int id);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.realnet.fnd.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Lookup_Values;
|
||||
|
||||
@Repository
|
||||
public interface LookUpRepository extends MongoRepository<Rn_Lookup_Values, String> {
|
||||
|
||||
// @Query(value = "SELECT LOOKUP_CODE FROM RN_LOOKUP_VALUES_T WHERE LOOKUP_TYPE ='Form_ext'" , nativeQuery = true)
|
||||
@Query("{'LOOKUP_TYPE': Form_ext}")
|
||||
List<String> getLookupValues();
|
||||
|
||||
// @Query(value = "SELECT LOOKUP_CODE FROM RN_LOOKUP_VALUES_T WHERE LOOKUP_TYPE ='DataType'" , nativeQuery = true)
|
||||
@Query("{'LOOKUP_TYPE': LOOKUP_TYPE}")
|
||||
List<String> getDataTypeValues();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.realnet.fnd.repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Menu_Group_Header;
|
||||
import com.realnet.fnd.entity.Rn_Menu_Group_Line;
|
||||
|
||||
public interface RnGroupLineRepository extends MongoRepository<Rn_Menu_Group_Line, String> {
|
||||
|
||||
@Query("{'id': ?0}")
|
||||
Optional<Rn_Menu_Group_Line> findById(int id);
|
||||
|
||||
// public List<Rn_Menu_Group_Line> findByHeader(Rn_Menu_Group_Header menu_group_header);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.realnet.fnd.repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Dynamic_Transaction;
|
||||
|
||||
@Repository
|
||||
public interface Rn_DynamicTransactionRepository extends MongoRepository<Rn_Dynamic_Transaction, String> {
|
||||
|
||||
// JPQL
|
||||
// @Query("SELECT e from RN_DYNAMIC_TRANSACTION e where e.FORM_ID =:form_id")
|
||||
// @Query("SELECT e from RN_DYNAMIC_TRANSACTION e where e.FORM_ID =:form_id AND e.ID =:id")
|
||||
|
||||
// NATIVE
|
||||
// @Query(value = "SELECT * FROM RN_DYNAMIC_TRANSACTION WHERE FORM_ID =:form_id", nativeQuery = true)
|
||||
// @Query(value = "SELECT * FROM RN_DYNAMIC_TRANSACTION WHERE ID =:id ANDFORM_ID =:form_id" , nativeQuery = true)
|
||||
|
||||
// @Query(value = "SELECT * FROM rn_dynamic_transaction WHERE FORM_ID =:form_id", nativeQuery = true)
|
||||
@Query("{'form_id': ?0}")
|
||||
List<Rn_Dynamic_Transaction> findByFormId(@Param("form_id") int form_id);
|
||||
|
||||
// @Query(value = "SELECT * FROM rn_dynamic_transaction WHERE ID =:id AND FORM_ID =:form_id", nativeQuery = true)
|
||||
@Query("{'id': ?0, 'form_id': ?1}")
|
||||
Optional<Rn_Dynamic_Transaction> findByIdAndFormId(@Param("id") int id, @Param("form_id") int form_id);
|
||||
|
||||
// @Query("{'id': ?0}")
|
||||
// boolean existsById(int id);
|
||||
|
||||
@Query("{'id': ?0}")
|
||||
Optional<Rn_Dynamic_Transaction> findById(int id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.realnet.fnd.repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Forms_Setup;
|
||||
|
||||
@Repository
|
||||
public interface Rn_Forms_Setup_Repository extends MongoRepository<Rn_Forms_Setup, String> {
|
||||
|
||||
// JPQL: @Query("SELECT e from RN_FORMS_SETUP_T e where e.FORM_ID =:form_id")
|
||||
// NATIVE : @Query(value = "SELECT * FROM RN_FORMS_SETUP_T WHERE FORM_ID=:form_id" , nativeQuery = true)
|
||||
|
||||
// @Query(value = "SELECT * FROM RN_FORMS_SETUP_T WHERE FORM_ID=:form_id", nativeQuery = true)
|
||||
@Query("{'form_id': ?0}")
|
||||
List<Rn_Forms_Setup> findByFormId(@Param("form_id") int form_id);
|
||||
|
||||
@Query("{'id': ?0}")
|
||||
Optional<Rn_Forms_Setup> findById(int id);
|
||||
|
||||
// @Query(value = "SELECT * FROM RN_DYNAMIC_TRANSACTION WHERE FORM_ID=:form_id",
|
||||
// nativeQuery = true)
|
||||
// Optional<Rn_Forms_Setup> findByFormId(@Param("form_id") int form_id);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.realnet.fnd.repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Function_Register;
|
||||
|
||||
@Repository
|
||||
public interface Rn_Function_Register_Repository extends MongoRepository<Rn_Function_Register, String> {
|
||||
// for pagination
|
||||
Page<Rn_Function_Register> findAll(Pageable p);
|
||||
|
||||
// @Query(value = "SELECT * FROM RN_FUNC_REGISTER WHERE MENU_ID =:menu_id" , nativeQuery = true)
|
||||
@Query("{'menu_id': ?0}")
|
||||
List<Rn_Function_Register> findByMenuId(@Param("menu_id") int menu_id);
|
||||
|
||||
@Query("{'id': ?0}")
|
||||
Optional<Rn_Function_Register> findById(int id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.realnet.fnd.repository;
|
||||
|
||||
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Instance_Type;
|
||||
|
||||
@Repository
|
||||
public interface Rn_InstanceTypeRepository extends MongoRepository<Rn_Instance_Type, String> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.realnet.fnd.repository;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
//import org.springframework.data.jpa.repository.JpaRepository;
|
||||
//import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Lookup_Values;
|
||||
|
||||
@Repository
|
||||
public interface Rn_LookUpRepository extends MongoRepository<Rn_Lookup_Values, String> {
|
||||
// for pagination
|
||||
Page<Rn_Lookup_Values> findAll(Pageable p);
|
||||
|
||||
// @Query(value = "SELECT LOOKUP_CODE FROM RN_LOOKUP_VALUES_T WHERE LOOKUP_TYPE ='Form_ext'" , nativeQuery = true)
|
||||
@Query("{'LOOKUP_TYPE': Form_ext}")
|
||||
List<String> findLookupValues();
|
||||
|
||||
// @Query(value = "SELECT LOOKUP_CODE FROM RN_LOOKUP_VALUES_T WHERE LOOKUP_TYPE ='DataType'" , nativeQuery = true)
|
||||
@Query("{'LOOKUP_TYPE': DataType}")
|
||||
List<String> findDataTypeValues();
|
||||
|
||||
// @Query(value = "SELECT * FROM RN_LOOKUP_VALUES_T WHERE LOOKUP_TYPE ='Form_ext'" , nativeQuery = true)
|
||||
@Query("{'LOOKUP_TYPE': Form_ext}")
|
||||
List<Rn_Lookup_Values> findExtensions();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.realnet.fnd.repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
//import org.springframework.data.jpa.repository.JpaRepository;
|
||||
//import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Main_Menu;
|
||||
|
||||
@Repository
|
||||
public interface Rn_Main_Menu_Repository extends MongoRepository<Rn_Main_Menu, String> {
|
||||
// for pagination
|
||||
Page<Rn_Main_Menu> findAll(Pageable p);
|
||||
|
||||
// @Query(value = "SELECT * FROM RN_MAIN_MENU WHERE ACCOUNT_ID =:acc_id" , nativeQuery = true)
|
||||
@Query("{'acc_id': ?0}")
|
||||
List<Rn_Main_Menu> findByAccountId(@Param("acc_id") String account_id); // accountId
|
||||
|
||||
@Query("{'id': ?0}")
|
||||
Optional<Rn_Main_Menu> findById(int id);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.realnet.fnd.repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Menu_Group_Header;
|
||||
|
||||
@Repository
|
||||
public interface Rn_Menu_Group_Repository extends MongoRepository<Rn_Menu_Group_Header, String> {
|
||||
|
||||
Optional<Rn_Menu_Group_Header> findById(Long id);
|
||||
|
||||
// JPQL: @Query("SELECT e from RN_FORMS_SETUP_T e where e.FORM_ID =:form_id")
|
||||
// NATIVE : @Query(value = "SELECT * FROM RN_FORMS_SETUP_T WHERE FORM_ID=:form_id" , nativeQuery = true)
|
||||
|
||||
// @Query(value = "SELECT * FROM RN_FORMS_SETUP_T WHERE FORM_ID=:form_id", nativeQuery = true)
|
||||
// List<Rn_Forms_Setup> findByFormId(@Param("form_id") int form_id);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.realnet.fnd.repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Menu_Register;
|
||||
|
||||
@Repository
|
||||
public interface Rn_Menu_Register_Repository extends MongoRepository<Rn_Menu_Register, String> {
|
||||
// for pagination
|
||||
Page<Rn_Menu_Register> findAll(Pageable p);
|
||||
|
||||
// @Query(value = "SELECT * FROM RN_MENU_REGISTER WHERE ACCOUNT_ID =:acc_id" , nativeQuery = true)
|
||||
@Query("{'account_id': ?0}")
|
||||
List<Rn_Menu_Register> findByAccountId(@Param("acc_id") String account_id); // accountId
|
||||
|
||||
@Query("{'id': ?0}")
|
||||
Optional<Rn_Menu_Register> findById(int id);
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.realnet.fnd.repository1;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.realnet.fnd.entity1.GrpMenuAccess;
|
||||
import com.realnet.fnd.entity1.GrpMenuAccesscompositeKey;
|
||||
|
||||
@Repository
|
||||
public interface GrpMenuAccessRepository extends MongoRepository<GrpMenuAccess, GrpMenuAccesscompositeKey> {
|
||||
|
||||
// @Query(value="SELECT * FROM sec_grp_menu_access a where a.usr_grp= ?1", nativeQuery = true)
|
||||
@Query("{'usr_grp': ?0}")
|
||||
GrpMenuAccess findByUsrGrp(Long usr_grp);
|
||||
|
||||
// @Query(value="SELECT * FROM sec_grp_menu_access a where a.usr_grp= ?1 ORDER BY item_seq", nativeQuery = true)
|
||||
@Query("{'usr_grp': ?0}")
|
||||
List<GrpMenuAccess> findAllByUsrGrp(Long usr_grp);
|
||||
|
||||
// @Query(value="SELECT * FROM sec_grp_menu_access a where a.menu_item_id=?1",nativeQuery = true)
|
||||
@Query("{'menu_item_id': ?0}")
|
||||
GrpMenuAccess findbymenuitemid(Long menu_item_id);
|
||||
|
||||
// @Query(value="SELECT * FROM sec_grp_menu_access where child = 0 ", nativeQuery = true)
|
||||
@Query("{'child': 0}")
|
||||
List<GrpMenuAccess> findAllRoots();
|
||||
|
||||
// @Query(value="SELECT * FROM sec_grp_menu_access a where a.child=:parent", nativeQuery = true)
|
||||
@Query("{'parent': ?0}")
|
||||
List<GrpMenuAccess> findAllSubmenu(@Param("parent") Long parent);
|
||||
// @Query(value="SELECT * FROM sec_grp_menu_access a where a.parent=:parent", nativeQuery = true)
|
||||
// GrpMenuAccess findById(@Param("parent") Long parent);
|
||||
|
||||
// @Query(value="SELECT * FROM sec_grp_menu_access where child = 0 and created_for =:created_for ", nativeQuery = true)
|
||||
// List<GrpMenuAccess> findAllRootsbyusrGrp(@Param("created_for") Long created_for);
|
||||
|
||||
// @Query(value="SELECT * FROM sec_grp_menu_access where child = 0 and usr_grp =:usr_grp ", nativeQuery = true)
|
||||
@Query("{'usr_grp': ?0}")
|
||||
List<GrpMenuAccess> findAllRootsbyusrGrp(@Param("usr_grp") Long usr_grp);
|
||||
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access where menu_id = 0 and status= 'Enable' and usr_grp =:usr_grp ORDER BY item_seq;", nativeQuery = true)
|
||||
// @Query("{'menu_id': ?0, 'status': Enable}")
|
||||
// List<GrpMenuAccess> findAllRootsByMenuId(@Param("usr_grp") Long usr_grp);
|
||||
|
||||
@Query("{'menu_id': 0, 'status': 'Enable', 'usr_grp': ?0}")
|
||||
List<GrpMenuAccess> findAllRootsByMenuId(Long usr_grp);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.menu_id=:menu_item_id and a.usr_grp =:usr_grp ORDER BY item_seq", nativeQuery = true)
|
||||
// List<GrpMenuAccess> findAllSubmenuByMenuId(@Param("menu_item_id") Long menu_item_id,@Param("usr_grp") Long usr_grp);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.status= 'Enable' and a.menu_id=:menu_item_id and a.usr_grp =:usr_grp ORDER BY item_seq", nativeQuery = true)
|
||||
// List<GrpMenuAccess> findAllSubmenuByMenuIdWithStatus(@Param("menu_item_id") Long menu_item_id,@Param("usr_grp") Long usr_grp);
|
||||
//
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.menu_item_id=:menu_item_id", nativeQuery = true)
|
||||
// GrpMenuAccess findById1(@Param("menu_item_id") Long menu_item_id);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.menu_item_id=:menu_item_id", nativeQuery = true)
|
||||
// List<GrpMenuAccess> findlist(@Param("menu_item_id") Long menu_item_id);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.menu_item_id=:menu_item_id && a.usr_grp =:usr_grp", nativeQuery = true)
|
||||
// GrpMenuAccess findById2(@Param("menu_item_id") Long menu_item_id, @Param("usr_grp") Long usr_grp);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.menu_item_id=:menu_item_id && a.usr_grp =:usr_grp", nativeQuery = true)
|
||||
// Optional<GrpMenuAccess> findbygrpandmenuid(@Param("menu_item_id") Long menu_item_id,@Param("usr_grp") Long usr_grp);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.usr_grp =:usr_grp and a.menu_item_id=:menu_item_id", nativeQuery = true)
|
||||
// List<GrpMenuAccess> findById(@Param("usr_grp") Long usr_grp,@Param("menu_item_id") Long menu_item_id);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.usr_grp =:usr_grp and a.menu_item_id=:menu_item_id", nativeQuery = true)
|
||||
// GrpMenuAccess findSingle(@Param("usr_grp") Long usr_grp,@Param("menu_item_id") Long menu_item_id);
|
||||
//
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.menu_item_id=:menu_item_id && a.usr_grp =:usr_grp", nativeQuery = true)
|
||||
// GrpMenuAccess findByUsrgrpAndMenuitemid(@Param("menu_item_id") Long menu_item_id,@Param("usr_grp") Long usr_grp);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.menu_item_id=:menu_item_id", nativeQuery = true)
|
||||
// List<GrpMenuAccess> findByGrpAndMenuid1(@Param("menu_item_id") Long menu_item_id);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.menu_id = 0 && a.usr_grp =:usr_grp && a.menu_item_id=:menu_item_id ORDER BY item_seq;", nativeQuery = true)
|
||||
// GrpMenuAccess findAllRootsByMenuIdAndGrp(@Param("menu_item_id") Long menu_item_id,@Param("usr_grp") Long usr_grp);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.menu_id=:menu_item_id", nativeQuery = true)
|
||||
// List<GrpMenuAccess> findAllSubmenuByMenuitemid(@Param("menu_item_id") Long menu_item_id);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.menu_id=:menu_item_id && a.usr_grp =:usr_grp ORDER BY item_seq", nativeQuery = true)
|
||||
// List<GrpMenuAccess> findAllSubmenuByMenuitemidAndUsrGrp(@Param("menu_item_id") Long menu_item_id,@Param("usr_grp") Long usr_grp);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_grp_menu_access a where a.menu_item_id=:menu_item_id", nativeQuery = true)
|
||||
// List<GrpMenuAccess> findAllById(@Param("menu_item_id") Long menu_item_id);
|
||||
|
||||
@Query("{ 'menu_id': ?0, 'usrGrp': ?1 }")
|
||||
List<GrpMenuAccess> findAllSubmenuByMenuId(Long menuItemId, Long usrGrp);
|
||||
|
||||
@Query("{ 'status': 'Enable', 'menu_id': ?0, 'usrGrp': ?1 }")
|
||||
List<GrpMenuAccess> findAllSubmenuByMenuIdWithStatus(Long menuItemId, Long usrGrp);
|
||||
|
||||
@Query("{ 'menuItem_id': ?0 }")
|
||||
GrpMenuAccess findById1(Long menuItemId);
|
||||
|
||||
@Query("{ 'menuItem_id': ?0 }")
|
||||
List<GrpMenuAccess> findlist(Long menuItemId);
|
||||
|
||||
@Query("{ 'menuItem_id': ?0, 'usrGrp': ?1 }")
|
||||
GrpMenuAccess findById2(Long menuItemId, Long usrGrp);
|
||||
|
||||
@Query("{ 'menuItem_id': ?0, 'usrGrp': ?1 }")
|
||||
Optional<GrpMenuAccess> findbygrpandmenuid(Long menuItemId, Long usrGrp);
|
||||
|
||||
@Query("{ 'usrGrp': ?0, 'menuItem_id': ?1 }")
|
||||
List<GrpMenuAccess> findById(Long usrGrp, Long menuItemId);
|
||||
|
||||
@Query("{ 'usrGrp': ?0, 'menuItem_id': ?1 }")
|
||||
GrpMenuAccess findSingle(Long usrGrp, Long menuItemId);
|
||||
|
||||
@Query("{ 'menuItem_id': ?0, 'usrGrp': ?1 }")
|
||||
GrpMenuAccess findByUsrgrpAndMenuitemid(Long menuItemId, Long usrGrp);
|
||||
|
||||
@Query("{ 'menuItem_id': ?0 }")
|
||||
List<GrpMenuAccess> findByGrpAndMenuid1(Long menuItemId);
|
||||
|
||||
@Query("{ 'menu_id': 0, 'usrGrp': ?1, 'menuItem_id': ?0 }")
|
||||
GrpMenuAccess findAllRootsByMenuIdAndGrp(Long menuItemId, Long usrGrp);
|
||||
|
||||
@Query("{ 'menuItem_id': ?0 }")
|
||||
List<GrpMenuAccess> findAllSubmenuByMenuitemid(Long menuItemId);
|
||||
|
||||
@Query("{ 'menu_id': ?0, 'usrGrp': ?1 }")
|
||||
List<GrpMenuAccess> findAllSubmenuByMenuitemidAndUsrGrp(Long menuItemId, Long usrGrp);
|
||||
|
||||
@Query("{ 'menuItem_id': ?0 }")
|
||||
List<GrpMenuAccess> findAllById(Long menuItemId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,401 @@
|
||||
package com.realnet.fnd.repository1;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.realnet.fnd.entity1.GrpMenuAccess;
|
||||
import com.realnet.fnd.entity1.MIXMENUN;
|
||||
import com.realnet.fnd.entity1.MenuDet;
|
||||
import com.realnet.fnd.entity1.MixMenuNew;
|
||||
import com.realnet.users.entity.Role;
|
||||
import com.realnet.users.entity1.AppUser;
|
||||
|
||||
@Repository
|
||||
public interface MenuDetRepository extends MongoRepository<MenuDet, String> {
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc, \n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete\n"
|
||||
//// + "from sec_menu_det a,sec_grp_menu_access b\n"
|
||||
//// + "where b.menu_item_id=a.menu_item_id\n"
|
||||
//// + "order by a.item_seq",
|
||||
//// countQuery="select count(*) "
|
||||
//// + "from sec_menu_det a,sec_grp_menu_access b\n"
|
||||
//// + "where b.menu_item_id=a.menu_item_id\n"
|
||||
//// + "order by a.item_seq",nativeQuery=true)
|
||||
// Page<Object> getAll(Pageable page);
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc, \n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete\n"
|
||||
//// + "from sec_menu_det a,sec_grp_menu_access b\n"
|
||||
//// + "where b.menu_item_id=a.menu_item_id\n"
|
||||
//// + "and b.usr_grp = ?1 "
|
||||
//// + "and a.menu_id = ?2 "
|
||||
//// + "order by a.item_seq",countQuery="select count(*) "
|
||||
//// + "from sec_menu_det a,sec_grp_menu_access b\n"
|
||||
//// + "where b.menu_item_id=a.menu_item_id\n"
|
||||
//// + "and b.usr_grp = ?1 "
|
||||
//// + "and a.menu_id = ?2 "
|
||||
//// + "order by a.item_seq;"
|
||||
//// ,nativeQuery = true)
|
||||
// List<Object> getById(Long usr_grp,Long menu_id);
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name "
|
||||
//// + "from sec_menu_det a,sec_grp_menu_access b\n"
|
||||
//// + "where b.menu_item_id=a.menu_item_id\n"
|
||||
//// + "and b.usr_grp = ?1\n"
|
||||
//// + "and a.menu_id= ?2 "
|
||||
//// + "order by a.item_seq",
|
||||
//// countQuery="select count(*) "
|
||||
//// + "from sec_menu_det a,sec_grp_menu_access b\n"
|
||||
//// + "where b.menu_item_id=a.menu_item_id\n"
|
||||
//// + "and b.usr_grp = ?1"
|
||||
//// + "and a.menu_id= ?2 "
|
||||
//// + "order by a.item_seq",
|
||||
//// nativeQuery=true)
|
||||
//// List<Object> getByUserId(Long usr_grp,Long menu_id);
|
||||
//
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id menu_item_id,a.menu_item_desc menu_item_desc,\n"
|
||||
//// + " a.menu_id menu_id,b.m_create m_create,b.m_visible m_visible,\n"
|
||||
//// + " b.m_edit m_edit,b.m_query m_query,b.m_delete m_delete,\n"
|
||||
//// + " a.main_menu_action_name main_menu_action_name,a.main_menu_icon_name main_menu_icon_name "
|
||||
//// + "from sec_menu_det a,sec_grp_menu_access b\n"
|
||||
//// + "where b.menu_item_id=a.menu_item_id\n"
|
||||
//// + "and b.usr_grp =:usr_grp\n"
|
||||
//// + "and a.menu_id=:menu_id "
|
||||
//// + "order by a.item_seq",
|
||||
////// countQuery="select count(*) "
|
||||
////// + "from sec_menu_det a,sec_grp_menu_access b\n"
|
||||
////// + "where b.menu_item_id=a.menu_item_id\n"
|
||||
////// + "and b.usr_grp = ?1"
|
||||
////// + "and a.menu_id= ?2 "
|
||||
////// + "order by a.item_seq",
|
||||
//// nativeQuery=true)
|
||||
// List<Object> getByUserId(Long usr_grp,Long menu_id);
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id menu_item_id,a.menu_item_desc menu_item_desc,\r\n"
|
||||
//// + " a.menu_id menu_id,b.m_create m_create,b.m_visible m_visible,\r\n"
|
||||
//// + " b.m_edit m_edit,b.m_query m_query,b.m_delete m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name main_menu_action_name,a.main_menu_icon_name main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b \r\n"
|
||||
//// ,
|
||||
//// nativeQuery=true)
|
||||
// List<MixMenuNew> getallmenu();
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id menu_item_id,a.menu_item_desc menu_item_desc,\r\n"
|
||||
//// + " a.menu_id menu_id,b.m_create m_create,b.m_visible m_visible,\r\n"
|
||||
//// + " b.m_edit m_edit,b.m_query m_query,b.m_delete m_delete\r\n"
|
||||
////// + " a.main_menu_action_name main_menu_action_name,a.main_menu_icon_name main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b \r\n"
|
||||
//// ,
|
||||
//// nativeQuery=true)
|
||||
// List<Object> allmenu();
|
||||
//
|
||||
//
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\r\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\r\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b\r\n"
|
||||
//// + " where a.menu_id=100",
|
||||
//// nativeQuery = true)
|
||||
// List<Object> findEqual100();
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\r\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\r\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b \r\n"
|
||||
//// + " where a.menu_id=ANY(SELECT menu_id from sec_menu_det where menu_id >100 && menu_id< 200);",
|
||||
//// nativeQuery = true)
|
||||
// List<Object> findGreater100();
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\r\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\r\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b\r\n"
|
||||
//// + " where a.menu_id=200",
|
||||
//// nativeQuery = true)
|
||||
// List<Object> findEqual200();
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\r\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\r\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b \r\n"
|
||||
//// + " where a.menu_id=ANY(SELECT menu_id from sec_menu_det where menu_id >200 && menu_id< 300);",
|
||||
//// nativeQuery = true)
|
||||
// List<Object> findGreater200();
|
||||
//
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\r\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\r\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b\r\n"
|
||||
//// + " where a.menu_id=300",
|
||||
//// nativeQuery = true)
|
||||
// List<Object> findEqual300();
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\r\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\r\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b \r\n"
|
||||
//// + " where a.menu_id=ANY(SELECT menu_id from sec_menu_det where menu_id >300 && menu_id< 400);",
|
||||
//// nativeQuery = true)
|
||||
// List<Object> findGreater300();
|
||||
//
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\r\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\r\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b\r\n"
|
||||
//// + " where a.menu_id=400",
|
||||
//// nativeQuery = true)
|
||||
// List<Object> findEqual400();
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\r\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\r\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b \r\n"
|
||||
//// + " where a.menu_id=ANY(SELECT menu_id from sec_menu_det where menu_id >400 && menu_id< 500);",
|
||||
//// nativeQuery = true)
|
||||
// List<Object> findGreater400();
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\r\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\r\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b\r\n"
|
||||
//// + " where a.menu_id=500",
|
||||
//// nativeQuery = true)
|
||||
// List<Object> findEqual500();
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\r\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\r\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b \r\n"
|
||||
//// + " where a.menu_id=ANY(SELECT menu_id from sec_menu_det where menu_id >500 && menu_id< 600);",
|
||||
//// nativeQuery = true)
|
||||
// List<Object> findGreater500();
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\r\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\r\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b\r\n"
|
||||
//// + " where a.menu_id=600",
|
||||
//// nativeQuery = true)
|
||||
// List<Object> findEqual600();
|
||||
//
|
||||
//// @Query(value="select a.menu_item_id,a.menu_item_desc,\r\n"
|
||||
//// + " a.menu_id,b.m_create,b.m_visible,\r\n"
|
||||
//// + " b.m_edit,b.m_query,b.m_delete,\r\n"
|
||||
//// + " a.main_menu_action_name,a.main_menu_icon_name \r\n"
|
||||
//// + " from sec_menu_det a,sec_grp_menu_access b \r\n"
|
||||
//// + " where a.menu_id=ANY(SELECT menu_id from sec_menu_det where menu_id >600 && menu_id< 700);",
|
||||
//// nativeQuery = true)
|
||||
// List<Object> findGreater600();
|
||||
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det where menu_id=100", nativeQuery = true)
|
||||
// MenuDet findequalto100();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det a where a.menu_id=ANY(SELECT menu_id from sec_menu_det where menu_id >100 && menu_id< 200)", nativeQuery = true)
|
||||
// List<MenuDet> findgreaterthan100();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det where menu_id=200", nativeQuery = true)
|
||||
// MenuDet findequalto200();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det a where a.menu_id=ANY(SELECT menu_id from sec_menu_det where menu_id >200 && menu_id< 300)", nativeQuery = true)
|
||||
// List<MenuDet> findgreaterthan200();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det where menu_id=300", nativeQuery = true)
|
||||
// MenuDet findequalto300();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det a where a.menu_id=ANY(SELECT menu_id from sec_menu_det where menu_id >300 && menu_id< 400)", nativeQuery = true)
|
||||
// List<MenuDet> findgreaterthan300();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det where menu_id=400", nativeQuery = true)
|
||||
// MenuDet findequalto400();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det a where a.menu_id=ANY(SELECT menu_id from sec_menu_det where menu_id >400 && menu_id< 500)", nativeQuery = true)
|
||||
// List<MenuDet> findgreaterthan400();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det where menu_id=500", nativeQuery = true)
|
||||
// MenuDet findequalto500();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det a where a.menu_id=ANY(SELECT menu_id from sec_menu_det where menu_id >500 && menu_id< 600)", nativeQuery = true)
|
||||
// List<MenuDet> findgreaterthan500();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det where menu_id=600", nativeQuery = true)
|
||||
// MenuDet findequalto600();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det a where a.menu_id=ANY(SELECT menu_id from sec_menu_det where menu_id >600 && menu_id< 700)", nativeQuery = true)
|
||||
// List<MenuDet> findgreaterthan600();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det a where a.menu_id=?1", nativeQuery = true)
|
||||
// List<MenuDet> findAllById(Long menu_id);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det a where a.root_menudet_id is null", nativeQuery = true)
|
||||
// List<MenuDet> findAllRoots();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det a where a.root_menudet_id=:menu_item_id", nativeQuery = true)
|
||||
// List<MenuDet> findAllSubmenu(@Param("menu_item_id") Long menu_item_id);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det a where a.root_menudet_id=:menu_item_id", nativeQuery = true)
|
||||
// List<MenuDet> findAllSubCategoriesInRoot(@Param("menu_item_id") List<Long> menu_item_id);
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det a where a.menu_id = 0 ORDER BY item_seq ASC", nativeQuery = true)
|
||||
// List<MenuDet> findAllRootsByMenuId();
|
||||
//
|
||||
//// @Query(value="SELECT * FROM sec_menu_det a where a.menu_id=:menu_item_id ORDER BY item_seq ASC", nativeQuery = true)
|
||||
// List<MenuDet> findAllSubmenuByMenuId(@Param("menu_item_id") Long menu_item_id);
|
||||
//
|
||||
//// @Query(value="select * from sec_menu_det where menu_item_id = :menu_item_id UNION select * from sec_menu_det where menu_id = :menu_item_id", nativeQuery = true)
|
||||
// List<MenuDet> findAllSubmenuforusrgrp(@Param("menu_item_id") Long menu_item_id);
|
||||
//
|
||||
// @Query(value="SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`='realnet_CNSBE' AND `TABLE_NAME`=:TABLE_NAME", nativeQuery = true)
|
||||
// List<Object> findcolumnbytablename(@Param("TABLE_NAME") Object TABLE_NAME);
|
||||
//
|
||||
// Optional<AppUser> findById(Long gmenuid);
|
||||
|
||||
@Query("{}")
|
||||
Page<Object> getAll(Pageable page);
|
||||
|
||||
@Query("{ 'usrGrp': ?0, 'menu_id': ?1 }")
|
||||
List<Object> getById(Long usrGrp, Long menuId);
|
||||
|
||||
@Query("{ 'usrGrp': ?0, 'menu_id': ?1 }")
|
||||
List<Object> getByUserId(Long usrGrp, Long menuId);
|
||||
|
||||
@Query("{ 'menu_id': 100 }")
|
||||
List<Object> findEqual100();
|
||||
|
||||
@Query("{ 'menu_id': { $gt: 100, $lt: 200 } }")
|
||||
List<Object> findGreater100();
|
||||
|
||||
@Query("{ 'menu_id': 200 }")
|
||||
List<Object> findEqual200();
|
||||
|
||||
@Query("{ 'menu_id': { $gt: 200, $lt: 300 } }")
|
||||
List<Object> findGreater200();
|
||||
|
||||
@Query("{ 'menu_id': 300 }")
|
||||
List<Object> findEqual300();
|
||||
|
||||
@Query("{ 'menu_id': { $gt: 300, $lt: 400 } }")
|
||||
List<Object> findGreater300();
|
||||
|
||||
@Query("{ 'menu_id': 400 }")
|
||||
List<Object> findEqual400();
|
||||
|
||||
@Query("{ 'menu_id': { $gt: 400, $lt: 500 } }")
|
||||
List<Object> findGreater400();
|
||||
|
||||
@Query("{ 'menu_id': 500 }")
|
||||
List<Object> findEqual500();
|
||||
|
||||
@Query("{ 'menu_id': { $gt: 500, $lt: 600 } }")
|
||||
List<Object> findGreater500();
|
||||
|
||||
@Query("{ 'menu_id': 600 }")
|
||||
List<Object> findEqual600();
|
||||
|
||||
@Query("{ 'menu_id': { $gt: 600, $lt: 700 } }")
|
||||
List<Object> findGreater600();
|
||||
|
||||
@Query("{}")
|
||||
List<MixMenuNew> getallmenu();
|
||||
|
||||
@Query("{}")
|
||||
List<Object> allmenu();
|
||||
|
||||
@Query("{ 'menu_id': 100 }")
|
||||
Optional<MenuDet> findequalto100();
|
||||
|
||||
@Query("{ 'menu_id': { $gt: 100, $lt: 200 } }")
|
||||
List<MenuDet> findgreaterthan100();
|
||||
|
||||
@Query("{ 'menu_id': 200 }")
|
||||
Optional<MenuDet> findequalto200();
|
||||
|
||||
@Query("{ 'menu_id': { $gt: 200, $lt: 300 } }")
|
||||
List<MenuDet> findgreaterthan200();
|
||||
|
||||
@Query("{ 'menu_id': 300 }")
|
||||
Optional<MenuDet> findequalto300();
|
||||
|
||||
@Query("{ 'menu_id': { $gt: 300, $lt: 400 } }")
|
||||
List<MenuDet> findgreaterthan300();
|
||||
|
||||
@Query("{ 'menu_id': 400 }")
|
||||
Optional<MenuDet> findequalto400();
|
||||
|
||||
@Query("{ 'menu_id': { $gt: 400, $lt: 500 } }")
|
||||
List<MenuDet> findgreaterthan400();
|
||||
|
||||
@Query("{ 'menu_id': 500 }")
|
||||
Optional<MenuDet> findequalto500();
|
||||
|
||||
@Query("{ 'menu_id': { $gt: 500, $lt: 600 } }")
|
||||
List<MenuDet> findgreaterthan500();
|
||||
|
||||
@Query("{ 'menu_id': 600 }")
|
||||
Optional<MenuDet> findequalto600();
|
||||
|
||||
@Query("{ 'menu_id': { $gt: 600, $lt: 700 } }")
|
||||
List<MenuDet> findgreaterthan600();
|
||||
|
||||
@Query("{ 'menu_id': ?0 }")
|
||||
List<MenuDet> findAllById(Long menu_id);
|
||||
|
||||
@Query("{ 'rootMenudetId': null }")
|
||||
List<MenuDet> findAllRoots();
|
||||
|
||||
@Query("{ 'rootMenudetId': ?0 }")
|
||||
List<MenuDet> findAllSubmenu(Long menu_item_id);
|
||||
|
||||
@Query("{ 'rootMenudetId': { $in: ?0 } }")
|
||||
List<MenuDet> findAllSubCategoriesInRoot(List<Long> menu_item_id);
|
||||
|
||||
@Query("{ 'menu_id': 0 }")
|
||||
List<MenuDet> findAllRootsByMenuId();
|
||||
|
||||
@Query("{ 'menu_id': ?0 }")
|
||||
List<MenuDet> findAllSubmenuByMenuId(Long menu_item_id);
|
||||
|
||||
@Query("{ $or: [{ 'menuItemId': ?0 }, { 'menu_id': ?0 }] }")
|
||||
List<MenuDet> findAllSubmenuforusrgrp(Long menu_item_id);
|
||||
|
||||
// Note: MongoDB doesn't have the equivalent of INFORMATION_SCHEMA, so finding
|
||||
// columns may not be straightforward.
|
||||
|
||||
|
||||
|
||||
// @Query(value="SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`='realnet_CNSBE' AND `TABLE_NAME`=:TABLE_NAME", nativeQuery = true)
|
||||
|
||||
// List<Object> findcolumnbytablename(@Param("TABLE_NAME") Object TABLE_NAME);
|
||||
|
||||
@Query("{'menuItemId': ?0}")
|
||||
MenuDet findById(Long menu_item_id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.realnet.fnd.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CustomResponse extends PageResponse {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
private List<? extends Object> items;
|
||||
//private List<Object> items;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.realnet.fnd.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class EntityResponse {
|
||||
|
||||
private String msg;
|
||||
|
||||
public EntityResponse(String msg) {
|
||||
super();
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
This is the common structure for all responses
|
||||
if the response contains a list(array) then it will have 'items' field
|
||||
if the response contains a single item then it will have 'item' field
|
||||
*/
|
||||
|
||||
|
||||
package com.realnet.fnd.response;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data //for getters and setters
|
||||
public class OperationResponse {
|
||||
public enum ResponseStatusEnum {SUCCESS, ERROR, WARNING, NO_ACCESS};
|
||||
@ApiModelProperty(required = true)
|
||||
private ResponseStatusEnum operationStatus;
|
||||
private String operationMessage;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.realnet.fnd.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Sort;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
//@Data //for getters and setters
|
||||
public class PageResponse extends OperationResponse {
|
||||
@Getter @Setter private boolean first;
|
||||
@Getter @Setter private boolean last;
|
||||
@Getter @Setter private int currentPageNumber;
|
||||
@Getter @Setter private int itemsInPage;
|
||||
@Getter @Setter private int pageSize;
|
||||
@Getter @Setter private int totalPages;
|
||||
@Getter @Setter private long totalItems;
|
||||
@Getter @Setter private Sort sort;
|
||||
private List items;
|
||||
|
||||
public void setPageStats(Page pg, boolean setDefaultMessage){
|
||||
this.first = pg.isFirst();
|
||||
this.last = pg.isLast();
|
||||
this.currentPageNumber = pg.getNumber();
|
||||
this.itemsInPage = pg.getNumberOfElements();
|
||||
this.pageSize = pg.getSize();
|
||||
this.totalPages = pg.getTotalPages();
|
||||
this.totalItems = pg.getTotalElements();
|
||||
//this.items = pg.getContent();
|
||||
this.sort = pg.getSort();
|
||||
if (setDefaultMessage == true){
|
||||
this.setOperationStatus(ResponseStatusEnum.SUCCESS);
|
||||
this.setOperationMessage("Page " + (pg.getNumber()+ 1 ) + " of " + pg.getTotalPages() );
|
||||
}
|
||||
}
|
||||
|
||||
public void setPageTotal(int count, boolean setDefaultMessage){
|
||||
//this.items = list;
|
||||
this.first = true;
|
||||
this.last = true;
|
||||
this.itemsInPage = count;
|
||||
this.totalItems = count;
|
||||
this.totalPages = 1;
|
||||
this.pageSize = count;
|
||||
if (setDefaultMessage == true){
|
||||
this.setOperationStatus(ResponseStatusEnum.SUCCESS);
|
||||
this.setOperationMessage("Total " + count + " items ");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.realnet.fnd.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Dynamic_Transaction;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class Rn_DynamicTransactionResponse extends PageResponse {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
private List<Rn_Dynamic_Transaction> items;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.realnet.fnd.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Forms_Setup;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class Rn_Forms_SetupResponse extends PageResponse {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
private List<Rn_Forms_Setup> items;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.realnet.fnd.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Function_Register;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class Rn_Function_Register_Response extends PageResponse {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
private List<Rn_Function_Register> items;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.realnet.fnd.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Main_Menu;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class Rn_Main_Menu_Response extends PageResponse {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
private List<Rn_Main_Menu> items;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.realnet.fnd.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Menu_Group_Header;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class Rn_Menu_Group_Response extends PageResponse {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
private List<Rn_Menu_Group_Header> items;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.realnet.fnd.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Menu_Register;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class Rn_Menu_Register_Response extends PageResponse {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
private List<Rn_Menu_Register> items;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//This is a common http response model for providing data series
|
||||
|
||||
package com.realnet.fnd.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.realnet.fnd.entity.SingleSerise;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class SingleDataSeriseResponse extends OperationResponse {
|
||||
private List<SingleSerise> items;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.realnet.fnd.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Ext_Fields;
|
||||
|
||||
public interface ExtFieldService {
|
||||
List<Rn_Ext_Fields> getAll();
|
||||
//Page<Rn_Ext_Fields> getAll(Pageable p);
|
||||
Rn_Ext_Fields getById(int id);
|
||||
Rn_Ext_Fields save(Rn_Ext_Fields rn_ext_fields);
|
||||
Rn_Ext_Fields updateById(int id, Rn_Ext_Fields rn_ext_fields);
|
||||
boolean deleteById(int id);
|
||||
|
||||
// // LOOKUP FIELDS (ATTRIBUTE, FLEX)
|
||||
// List<String> getLookupValues();
|
||||
//
|
||||
// // TEXTFIELD, DROPDOWN ETC...
|
||||
// List<String> getDataTypeValues();
|
||||
|
||||
// BUILD HTML FOR EXTENSION
|
||||
String buildExtensionByFormCode(String acc_id, String f_code, Integer formId);
|
||||
|
||||
String stringReplace(String str, String start, String end, String replaceWith);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,260 @@
|
||||
package com.realnet.fnd.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.realnet.exceptions.ResourceNotFoundException;
|
||||
import com.realnet.fnd.entity.Rn_Ext_Fields;
|
||||
import com.realnet.fnd.repository.ExtFieldRepository;
|
||||
import com.realnet.fnd.repository.Rn_LookUpRepository;
|
||||
import com.realnet.utils.WireFrameConstant;
|
||||
|
||||
@Service
|
||||
public class ExtFieldServiceImpl implements ExtFieldService {
|
||||
|
||||
@Value("${angularProjectPath}")
|
||||
private String angularProjectPath;
|
||||
|
||||
@Value("${projectPath}")
|
||||
private String projectPath;
|
||||
|
||||
@Autowired
|
||||
private ExtFieldRepository extFieldRepository;
|
||||
|
||||
@Autowired
|
||||
Rn_LookUpRepository lookUpRepository1;
|
||||
|
||||
@Override
|
||||
public List<Rn_Ext_Fields> getAll() {
|
||||
return extFieldRepository.findAll();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Page<Rn_Ext_Fields> getAll(Pageable page) {
|
||||
// return extFieldRepository.findAll(page);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Rn_Ext_Fields getById(int id) {
|
||||
Rn_Ext_Fields rn_ext_fields = extFieldRepository.findById(id)
|
||||
.orElseThrow(() -> new ResourceNotFoundException("Extension Field not found :: " + id));
|
||||
return rn_ext_fields;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rn_Ext_Fields save(Rn_Ext_Fields rn_ext_fields) {
|
||||
Rn_Ext_Fields savedRn_Ext_Fields = extFieldRepository.save(rn_ext_fields);
|
||||
return savedRn_Ext_Fields;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rn_Ext_Fields updateById(int id, Rn_Ext_Fields extensionRequest) {
|
||||
Rn_Ext_Fields old_ext_field = extFieldRepository.findById(id)
|
||||
.orElseThrow(() -> new ResourceNotFoundException("Extension Field not found :: " + id));
|
||||
|
||||
old_ext_field.setField_name(extensionRequest.getField_name());
|
||||
old_ext_field.setMapping(extensionRequest.getMapping());
|
||||
old_ext_field.setData_type(extensionRequest.getData_type());
|
||||
old_ext_field.setType(extensionRequest.getType());
|
||||
old_ext_field.setActive(extensionRequest.isActive());
|
||||
final Rn_Ext_Fields updated_ext_field = extFieldRepository.save(old_ext_field);
|
||||
return updated_ext_field;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(int id) {
|
||||
if (extFieldRepository.findById(id) == null) {
|
||||
throw new ResourceNotFoundException("Extension Field not found :: " + id);
|
||||
}
|
||||
Rn_Ext_Fields rn_ext_fields = extFieldRepository.findById(id)
|
||||
.orElseThrow(() -> new ResourceNotFoundException("Extension Field not found :: " + id));
|
||||
extFieldRepository.delete(rn_ext_fields);
|
||||
return true;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<String> getLookupValues() {
|
||||
// return lookUpRepository.findLookupValues();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<String> getDataTypeValues() {
|
||||
// return lookUpRepository.findDataTypeValues();
|
||||
// }
|
||||
|
||||
@Override
|
||||
public String buildExtensionByFormCode(String acc_id, String f_code, Integer formId) {
|
||||
|
||||
Optional<Rn_Ext_Fields> extensions = extFieldRepository.findById(formId);
|
||||
// List<Rn_Ext_Fields> extensions = extFieldRepository.getExtensionFieldByFormCode(acc_id, f_code);
|
||||
StringBuilder extension_grid_form = new StringBuilder();
|
||||
StringBuilder extension_entry_form = new StringBuilder();
|
||||
|
||||
if (extensions == null || !extensions.isPresent()) {
|
||||
throw new ResourceNotFoundException("Extension Fields Not Found");
|
||||
} else {
|
||||
|
||||
// extension_entry_form.append("<table [formGroup]=\"extensionForm\">\n");
|
||||
// extension_code.append("<table [formGroup]=\"extensionForm\">\n" + " <div
|
||||
// formGroupName=\"extensions\">\n");
|
||||
|
||||
// for (Rn_Ext_Fields extension : extensions) {
|
||||
// String form_code = extension.getForm_code();
|
||||
Rn_Ext_Fields extension = extensions.get();
|
||||
String type = extension.getType(); // ho, hl
|
||||
String data_type = extension.getData_type();
|
||||
String mapping = extension.getMapping();
|
||||
String field_name = extension.getField_name();
|
||||
|
||||
String ext = ",\"extValue\":\"" + mapping + "\"";
|
||||
|
||||
if (WireFrameConstant.DT_TEXTFIELD.equals(data_type)) {
|
||||
// extension_entry_form.append(" <tr>\r\n" + " <td style=\"width:125px;\">" + field_name
|
||||
// + " </td>\r\n"
|
||||
// + " <td><input colspan=\"2\" style=\"width:180px\" type=\"text\" formControlName=\""
|
||||
// + mapping + "\" placeholder=\"Enter " + field_name + "\"></td>\r\n" + " </tr>\n");
|
||||
|
||||
extension_entry_form.append("{\"fieldName\":\"" + field_name
|
||||
+ "\",\"fieldType\":\"text\",\"fieldValue\":\"\",\"formCode\":\"" + f_code + "\"" + ext + "},");
|
||||
}
|
||||
|
||||
if (WireFrameConstant.DT_DATE.equals(data_type)) {
|
||||
// extension_entry_form.append(" <tr>\r\n" + " <td style=\"width:125px;\">" + field_name
|
||||
// + " </td>\r\n"
|
||||
// + " <td><input colspan=\"2\" style=\"width:180px\" type=\"date\" formControlName=\""
|
||||
// + mapping + "\" placeholder=\"Enter " + field_name + "\"></td>\r\n" + " </tr>\n");
|
||||
extension_entry_form.append("{\"fieldName\":\"" + field_name
|
||||
+ "\",\"fieldType\":\"date\",\"fieldValue\":\"\",\"formCode\":\"" + f_code + "\"" + ext + "},");
|
||||
|
||||
}
|
||||
|
||||
if (WireFrameConstant.DT_LONGTEXT.equals(data_type)) {
|
||||
// extension_entry_form.append(" <tr>\r\n" + " <td style=\"width:125px;\">" + field_name
|
||||
// + " </td>\r\n"
|
||||
// + " <td><textarea rows=\"4\" cols=\"50\" colspan=\"2\" style=\"width:180px\" formControlName=\""
|
||||
// + mapping + "\">" + "Enter " + field_name + "</textarea></td>\r\n" + " </tr>\n");
|
||||
//
|
||||
extension_entry_form.append("{\"fieldName\":\"" + field_name
|
||||
+ "\",\"fieldType\":\"textarea\",\"fieldValue\":\"\",\"formCode\":\"" + f_code + "\"" + ext
|
||||
+ "},");
|
||||
|
||||
}
|
||||
|
||||
if (WireFrameConstant.FIELD_CHECKBOX.equals(data_type)) {
|
||||
// extension_entry_form.append(" <tr>\r\n" + " <td style=\"width:125px;\">" + field_name
|
||||
// + " </td>\r\n"
|
||||
// + " <td><input colspan=\"2\" style=\"width:180px\" type=\"checkbox\" formControlName=\""
|
||||
// + mapping + "\"></td>\r\n" + " </tr>\n");
|
||||
extension_entry_form.append("{\"fieldName\":\"" + field_name
|
||||
+ "\",\"fieldType\":\"checkbox\",\"fieldValue\":\"\",\"formCode\":\"" + f_code + "\"" + ext
|
||||
+ "},");
|
||||
|
||||
}
|
||||
|
||||
// if (TypeConstants.FIELD_CHECKBOX.equals(data_type)) {
|
||||
// extension_entry_form.append(" <tr>\r\n" + " <td style=\"width:125px;\">" + field_name
|
||||
// + " </td>\r\n"
|
||||
// + " <td><input colspan=\"2\" style=\"width:180px\" type=\"radio\" formControlName=\""
|
||||
// + mapping + "\"></td>\r\n" + " </tr>\n");
|
||||
// }
|
||||
if (WireFrameConstant.FIELD_AUTOCOMPLETE.equals(data_type)) {
|
||||
// extension_entry_form.append(" <tr>\r\n" + " <td style=\"width:125px;\">" + field_name
|
||||
// + " </td>\r\n"
|
||||
// + " <td><input colspan=\"2\" style=\"width:180px\" type=\"text\" formControlName=\""
|
||||
// + mapping + "\" autocomplete=\"on\"></td>\r\n" + " </tr>\n");
|
||||
extension_entry_form.append("{\"fieldName\":\"" + field_name
|
||||
+ "\",\"fieldType\":\"text\",\"fieldValue\":\"\",\"formCode\":\"" + f_code + "\"" + ext + "},");
|
||||
}
|
||||
|
||||
// extension grid-view code
|
||||
extension_grid_form.append("{prop: \"" + mapping + "\", name: \"" + field_name + "\", width: 200},\n");
|
||||
|
||||
// extension read-only code
|
||||
|
||||
// extension update code
|
||||
|
||||
}
|
||||
extension_entry_form.deleteCharAt(extension_entry_form.length() - 1);
|
||||
// extension_code.append("\n</div>\n</table>");
|
||||
// extension_entry_form.append("\n</table>");
|
||||
|
||||
// FileWriter fw = null;
|
||||
// BufferedWriter bw = null;
|
||||
// try {
|
||||
//
|
||||
// // ENTRY FORM
|
||||
//// String ngExtEntryPath = angularProjectPath
|
||||
//// + "/src/app/pages/university/teacher/extensions/add-ext/teacher-add-extension.component.html";
|
||||
//
|
||||
// String path = projectPath + "/cns-portal/pages";
|
||||
//
|
||||
// String ngExtEntryPath = path + File.separator + f_code + "_ext.html";
|
||||
//
|
||||
// File ngExtEntryFile1 = new File(path);
|
||||
// if (!ngExtEntryFile1.exists()) {
|
||||
// ngExtEntryFile1.mkdir();
|
||||
// }
|
||||
//
|
||||
// File ngExtEntryFile = new File(ngExtEntryPath);
|
||||
// if (!ngExtEntryFile.exists()) {
|
||||
// ngExtEntryFile.createNewFile();
|
||||
// }
|
||||
// fw = new FileWriter(ngExtEntryFile.getAbsoluteFile());
|
||||
// bw = new BufferedWriter(fw);
|
||||
// bw.write(extension_entry_form.toString());
|
||||
// bw.close();
|
||||
//
|
||||
// // GRID VIEW FORM
|
||||
//// final String start = "// EXTENSION COLUMN START";
|
||||
//// final String end = "// EXTENSION COLUMN END";
|
||||
//// String replaceWith = extension_grid_form.toString();
|
||||
////
|
||||
//// String ngExtGridPath = path + "/teacher-add-extension.component.ts";
|
||||
//// File ngExtGridFile = new File(ngExtGridPath);
|
||||
//// String fileString = FileUtils.readFileToString(ngExtGridFile, StandardCharsets.UTF_8);
|
||||
//// String finalString = stringReplace(fileString, start, end, replaceWith);
|
||||
////
|
||||
//// bw = new BufferedWriter(new FileWriter(ngExtGridFile, false)); // replaced string
|
||||
//// bw.write(finalString);
|
||||
//// bw.close();
|
||||
//
|
||||
// // UPDATE FORM
|
||||
//
|
||||
// // READ-ONLY FORM
|
||||
//
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
return extension_entry_form.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String stringReplace(String str, String start, String end, String replaceWith) {
|
||||
int i = str.indexOf(start);
|
||||
while (i != -1) {
|
||||
int j = str.indexOf(end, i + 1);
|
||||
if (j != -1) {
|
||||
/*
|
||||
* @Include starting and ending string String data = str.substring(0, i +
|
||||
* start.length()) + "\n" + replaceWith + "\n"; String temp = str.substring(j);
|
||||
*
|
||||
* @Not Include starting and ending string String data = str.substring(0, i) +
|
||||
* "\n" + replaceWith + "\n"; String temp = str.substring(j + end.length());
|
||||
*/
|
||||
String data = str.substring(0, i + start.length()) + "\n" + replaceWith + "\n";
|
||||
String temp = str.substring(j);
|
||||
data += temp;
|
||||
str = data;
|
||||
i = str.indexOf(start, i + replaceWith.length() + end.length() + 1);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.realnet.fnd.service;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
//import com.realnet.codeextractor.service.Rn_Bcf_Extractor_Service;
|
||||
import com.realnet.exceptions.StorageException;
|
||||
import com.realnet.users.entity1.AppUser;
|
||||
import com.realnet.users.service1.AppUserServiceImpl;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class FileStorageService {
|
||||
|
||||
//private static final Logger logger = LoggerFactory.getLogger(FileStorageService.class);
|
||||
|
||||
@Autowired
|
||||
private AppUserServiceImpl userService;
|
||||
|
||||
@Autowired
|
||||
// private Rn_Bcf_Extractor_Service extractorService;
|
||||
|
||||
@Value("${projectPath}")
|
||||
private String projectPath;
|
||||
|
||||
public void uploadProfilePicture(MultipartFile file, String location) {
|
||||
if (file.isEmpty()) {
|
||||
throw new StorageException("Failed to store empty file");
|
||||
}
|
||||
// create path for every new File
|
||||
// File fileLoc = new File(location);
|
||||
try {
|
||||
// if(!fileLoc.exists()) {
|
||||
// fileLoc.mkdir();
|
||||
// //System.out.println("Path Created...");
|
||||
// }
|
||||
AppUser user = userService.getLoggedInUser();
|
||||
String UserId = String.valueOf(user.getUserId());
|
||||
String fileName = file.getOriginalFilename();
|
||||
|
||||
String ext = fileName.substring(fileName.lastIndexOf("."));
|
||||
String extension = FilenameUtils.getExtension(fileName); // lol
|
||||
String newName = "profile-pic-" + UserId + ext;
|
||||
|
||||
System.out.println(System.getProperty("java.io.tmpdir"));
|
||||
File convFile = new File(System.getProperty("java.io.tmpdir")+System.getProperty("file.separator")+newName);
|
||||
file.transferTo(convFile);
|
||||
} catch (IOException e) {
|
||||
String msg = String.format("Failed to store file %s", file.getName());
|
||||
log.info(msg);
|
||||
throw new StorageException("Failed to store file ", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ========================== BCF EXTRACTOR =============================
|
||||
// max size 100 mb
|
||||
public void uploadFile(MultipartFile file, String location) {
|
||||
if (file.isEmpty()) {
|
||||
throw new StorageException("Failed to store empty file");
|
||||
}
|
||||
try {
|
||||
String fileName = file.getOriginalFilename();
|
||||
InputStream is = file.getInputStream();
|
||||
Files.copy(is, Paths.get(location + fileName), StandardCopyOption.REPLACE_EXISTING);
|
||||
} catch (IOException e) {
|
||||
String msg = String.format("Failed to store file : %s", file.getName());
|
||||
log.debug(msg);
|
||||
throw new StorageException("Failed to store file", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// private static ArrayList<String> fileList = new ArrayList<String>();
|
||||
//
|
||||
// public ArrayList<String> listOFiles(String directory) throws IOException {
|
||||
// File destDir = new File(directory);
|
||||
// System.out.println("Destination Folder Path = " + directory);
|
||||
// // ArrayList<String> files = new ArrayList<String>();
|
||||
// // Get all files from a directory.
|
||||
// File[] fList = destDir.listFiles();
|
||||
// if (fList != null) {
|
||||
// for (File file : fList) {
|
||||
// if (file.isFile()) {
|
||||
// fileList.add(file.getAbsolutePath());
|
||||
// // System.out.println("directory:" + file.getAbsolutePath());
|
||||
// } else if (file.isDirectory()) {
|
||||
// listOFiles(file.getAbsolutePath());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return fileList;
|
||||
// }
|
||||
|
||||
// =============== MOVE FILE FROM ONE DIRECTORY TO ANTHER ==============
|
||||
// public void move(String fromDir, String toDir) throws IOException {
|
||||
// File fromDirFile = new File(fromDir);
|
||||
// File moveToFile = new File(toDir);
|
||||
//
|
||||
// String fileName = fromDirFile.getName();
|
||||
//
|
||||
// // MOVE ALL FILES INTO PARENT DIRECTORY
|
||||
// System.out.println("File name = " + fileName + "\n" + "Move to = " + toDir);
|
||||
// fromDirFile.renameTo(new File(moveToFile, fromDirFile.getName()));
|
||||
// }
|
||||
|
||||
// ============== DELETE EMPTY DIRECTORY ===========
|
||||
// public static void deleteEmptyDirectory(File dir) {
|
||||
// if (dir.isDirectory()) {
|
||||
// File[] fList = dir.listFiles();
|
||||
// if (fList != null) {
|
||||
// for (File file : fList) {
|
||||
// if (!file.isFile()) {
|
||||
// System.out.println("Removing empty directory : " + file.getName());
|
||||
// file.delete();
|
||||
// deleteEmptyDirectory(file);
|
||||
// }
|
||||
// }
|
||||
// dir.delete();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.realnet.fnd.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Menu_Group_Header;
|
||||
import com.realnet.fnd.entity.Rn_Menu_Group_Line;
|
||||
|
||||
public interface RnGroupMenuLineServiec {
|
||||
|
||||
public Rn_Menu_Group_Line addToDb(Rn_Menu_Group_Line rn_Menu_Group_Line);
|
||||
|
||||
public Rn_Menu_Group_Line getoneById(int id);
|
||||
|
||||
public List<Rn_Menu_Group_Line> getAll();
|
||||
|
||||
public Rn_Menu_Group_Line updateToDb(Rn_Menu_Group_Line rn_Menu_Group_Line);
|
||||
|
||||
// public List<Rn_Menu_Group_Line> getLinesByHeader(Rn_Menu_Group_Header rn_Menu_Group_Header);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.realnet.fnd.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.realnet.fnd.entity.Rn_Menu_Group_Header;
|
||||
import com.realnet.fnd.entity.Rn_Menu_Group_Line;
|
||||
import com.realnet.fnd.repository.RnGroupLineRepository;
|
||||
|
||||
@Service
|
||||
public class RnGroupMenuLineServiecImpl implements RnGroupMenuLineServiec {
|
||||
|
||||
@Autowired
|
||||
private RnGroupLineRepository r;
|
||||
|
||||
@Override
|
||||
public Rn_Menu_Group_Line addToDb(Rn_Menu_Group_Line rn_Menu_Group_Line) {
|
||||
Rn_Menu_Group_Line addToDb = this.r.save(rn_Menu_Group_Line);
|
||||
return addToDb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rn_Menu_Group_Line getoneById(int id) {
|
||||
Optional<Rn_Menu_Group_Line> findById = this.r.findById(id);
|
||||
return findById.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Rn_Menu_Group_Line> getAll() {
|
||||
List<Rn_Menu_Group_Line> all = this.r.findAll();
|
||||
return all;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rn_Menu_Group_Line updateToDb(Rn_Menu_Group_Line rn_Menu_Group_Line) {
|
||||
Rn_Menu_Group_Line addToDb = this.r.save(rn_Menu_Group_Line);
|
||||
return addToDb;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<Rn_Menu_Group_Line> getLinesByHeader(Rn_Menu_Group_Header rn_Menu_Group_Header) {
|
||||
// List<Rn_Menu_Group_Line> lineByHeader = this.r.findLineByHeader(rn_Menu_Group_Header);
|
||||
// return lineByHeader;
|
||||
// }
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user