14 changed files with 588 additions and 77 deletions
-
27src/main/java/com/gcc/communityHall/controller/TestController.java
-
81src/main/java/com/gcc/communityHall/entity/ApplicationLogs.java
-
83src/main/java/com/gcc/communityHall/entity/BookingCalendar.java
-
48src/main/java/com/gcc/communityHall/entity/BookingHistory.java
-
63src/main/java/com/gcc/communityHall/entity/EbDetails.java
-
13src/main/java/com/gcc/communityHall/entity/HallDetails.java
-
47src/main/java/com/gcc/communityHall/paymentService/controller/PaymentController.java
-
5src/main/java/com/gcc/communityHall/paymentService/service/PaymentGatewayServiceImpl.java
-
9src/main/java/com/gcc/communityHall/repository/ApplicationLogsRepository.java
-
8src/main/java/com/gcc/communityHall/repository/BookingCalendarRepository.java
-
5src/main/java/com/gcc/communityHall/service/ApplicationLogService.java
-
11src/main/java/com/gcc/communityHall/service/BookingService.java
-
23src/main/java/com/gcc/communityHall/service/Impl/ApplicationLogServiceImpl.java
-
242src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java
@ -1,23 +1,94 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.Column; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.gcc.communityHall.others.UserSession; |
|||
import jakarta.persistence.*; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Entity |
|||
public class ApplicationLogs { |
|||
|
|||
@Autowired |
|||
@Transient |
|||
private UserSession userSession; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private Long logId; |
|||
|
|||
private String logType; |
|||
private int bookingId; |
|||
private int loginId; |
|||
private int loginId = userSession.getUserId(); |
|||
private String comments; |
|||
|
|||
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP") |
|||
private Date cdate = new Date(); |
|||
|
|||
|
|||
|
|||
public Long getLogId() { |
|||
return logId; |
|||
} |
|||
|
|||
public void setLogId(Long logId) { |
|||
this.logId = logId; |
|||
} |
|||
|
|||
public String getLogType() { |
|||
return logType; |
|||
} |
|||
|
|||
public void setLogType(String logType) { |
|||
this.logType = logType; |
|||
} |
|||
|
|||
public int getBookingId() { |
|||
return bookingId; |
|||
} |
|||
|
|||
public void setBookingId(int bookingId) { |
|||
this.bookingId = bookingId; |
|||
} |
|||
|
|||
public int getLoginId() { |
|||
return loginId; |
|||
} |
|||
|
|||
public void setLoginId(int loginId) { |
|||
this.loginId = loginId; |
|||
} |
|||
|
|||
public String getComments() { |
|||
return comments; |
|||
} |
|||
|
|||
public void setComments(String comments) { |
|||
this.comments = comments; |
|||
} |
|||
|
|||
public Date getCdate() { |
|||
return cdate; |
|||
} |
|||
|
|||
public void setCdate(Date cdate) { |
|||
this.cdate = cdate; |
|||
} |
|||
|
|||
|
|||
public enum logsOfMsg{ |
|||
SENDING_SMS,USER_CANCELLED_BOOKING,USER_INVALID,PAYMENT_STARTED,PAYMENT_COMPLETED,PAYMENT,FAILURE, |
|||
GCC_REJECTED,GCC_BLOCKED_DATE |
|||
}; |
|||
|
|||
@Transient |
|||
private ApplicationLogs.logsOfMsg logsOfMsg; |
|||
|
|||
public ApplicationLogs.logsOfMsg getLogsOfMsg() { |
|||
return logsOfMsg; |
|||
} |
|||
|
|||
public void setLogsOfMsg(ApplicationLogs.logsOfMsg logsOfMsg) { |
|||
this.logsOfMsg = logsOfMsg; |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.ApplicationLogs; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface ApplicationLogsRepository extends JpaRepository<ApplicationLogs,Long> { |
|||
} |
|||
@ -0,0 +1,5 @@ |
|||
package com.gcc.communityHall.service; |
|||
|
|||
public interface ApplicationLogService { |
|||
void saveLog(int bookingId,String logType,String comments); |
|||
} |
|||
@ -1,14 +1,21 @@ |
|||
package com.gcc.communityHall.service; |
|||
|
|||
import com.gcc.communityHall.entity.BookingCalendar; |
|||
import com.gcc.communityHall.entity.BookingDetails; |
|||
import com.gcc.communityHall.entity.EbDetails; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
|
|||
import java.util.Map; |
|||
|
|||
public interface BookingService { |
|||
BookingDetails getBookingsById(int BookingId); |
|||
BookingDetails updateBookingHistory(BookingDetails bd); |
|||
public String confirmTheDateAndSlot(String fromDate, String toDate, int days, int fromStartingSlot, int fromEndingSlot, int toStartingSlot, int toEndingSlot, int bookingId,int userId); |
|||
|
|||
public String saveBookingDetails(Map<String,Object> formData); |
|||
public BookingDetails updateBookingStatusById( int bookingId, BookingDetails.BookingStatus status,String comments); |
|||
public EbDetails updateEbDetails(int bookingId,double startUnit,double endUnit,char status); |
|||
|
|||
//typeOfCancel depends { } |
|||
String cancelBooking(int bookingId,BookingDetails.BookingStatus currentStatus,String comments); |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.gcc.communityHall.service.Impl; |
|||
|
|||
import com.gcc.communityHall.entity.ApplicationLogs; |
|||
import com.gcc.communityHall.repository.ApplicationLogsRepository; |
|||
import com.gcc.communityHall.service.ApplicationLogService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Service |
|||
public class ApplicationLogServiceImpl implements ApplicationLogService { |
|||
|
|||
@Autowired |
|||
private ApplicationLogsRepository applicationLogsRepository; |
|||
@Override |
|||
public void saveLog(int bookingId, String logType, String comments) { |
|||
ApplicationLogs applicationLogs = new ApplicationLogs(); |
|||
applicationLogs.setBookingId(bookingId); |
|||
applicationLogs.setLogType(logType); |
|||
applicationLogs.setComments(comments); |
|||
applicationLogsRepository.save(applicationLogs); |
|||
|
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue