user id addded in this code
This commit is contained in:
@@ -239,7 +239,8 @@ public class BillerMapperHelper {
|
||||
return billerRepo.saveAll(entities);
|
||||
}
|
||||
|
||||
public CustomerParamGroupsDTO saveCustomerParamGroups(CustomerParamGroupsDTO dtos, String requestId, String txnId) {
|
||||
public CustomerParamGroupsDTO saveCustomerParamGroups(CustomerParamGroupsDTO dtos, String requestId, String txnId,
|
||||
String userId) {
|
||||
if (dtos == null || dtos.getGroups() == null || dtos.getGroups().isEmpty()) {
|
||||
return new CustomerParamGroupsDTO(); // Return empty DTO if no groups exist
|
||||
}
|
||||
@@ -248,8 +249,10 @@ public class BillerMapperHelper {
|
||||
|
||||
// Loop through the top-level groups and save them (including nested groups)
|
||||
for (GroupDTO groupDTO : dtos.getGroups()) {
|
||||
CustomerParamGroupById entity = saveGroupWithChildren(groupDTO, null, requestId, txnId); // null is for root
|
||||
// (no
|
||||
CustomerParamGroupById entity = saveGroupWithChildren(groupDTO, null, requestId, txnId, userId); // null is
|
||||
// for
|
||||
// root
|
||||
// (no
|
||||
// parent group)
|
||||
entities.add(entity); // Add the saved entity to the list
|
||||
|
||||
@@ -263,7 +266,7 @@ public class BillerMapperHelper {
|
||||
}
|
||||
|
||||
private CustomerParamGroupById saveGroupWithChildren(GroupDTO groupDTO, CustomerParamGroupById parentGroup,
|
||||
String requestId, String txnId) {
|
||||
String requestId, String txnId, String userId) {
|
||||
|
||||
// Create a new entity for the group
|
||||
CustomerParamGroupById groupEntity = new CustomerParamGroupById();
|
||||
@@ -273,6 +276,7 @@ public class BillerMapperHelper {
|
||||
groupEntity.setParentGroup(parentGroup); // Link to the parent group (if exists)
|
||||
groupEntity.setRequestId(requestId);
|
||||
groupEntity.setTxnId(txnId);
|
||||
groupEntity.setUserId(userId);
|
||||
groupEntity.setCreateDateTime(new Date());
|
||||
// Save group parameters (if any)
|
||||
if (groupDTO.getParams() != null && !groupDTO.getParams().isEmpty()) {
|
||||
@@ -290,8 +294,8 @@ public class BillerMapperHelper {
|
||||
if (groupDTO.getGroups() != null && !groupDTO.getGroups().isEmpty()) {
|
||||
List<CustomerParamGroupById> childEntities = new ArrayList<>();
|
||||
for (GroupDTO childGroupDTO : groupDTO.getGroups()) {
|
||||
CustomerParamGroupById childEntity = saveGroupWithChildren(childGroupDTO, groupEntity, requestId,
|
||||
txnId); // Pass
|
||||
CustomerParamGroupById childEntity = saveGroupWithChildren(childGroupDTO, groupEntity, requestId, txnId,
|
||||
userId); // Pass
|
||||
// current
|
||||
// group
|
||||
// as
|
||||
@@ -346,7 +350,8 @@ public class BillerMapperHelper {
|
||||
}
|
||||
|
||||
// Method to save AmountOptionsResponse and AmountOption entities
|
||||
public String saveAmountOptionsResponse(AmountOptionsResponse responseWrapper, String requestId, String txnId) {
|
||||
public String saveAmountOptionsResponse(AmountOptionsResponse responseWrapper, String requestId, String txnId,
|
||||
String userId) {
|
||||
// Convert AmountOptionsResponseDTO to AmountOptionsResponse entity
|
||||
|
||||
if (responseWrapper == null) {
|
||||
@@ -358,14 +363,10 @@ public class BillerMapperHelper {
|
||||
|
||||
// Map AmountOptionDTO list to AmountOptionDetails entities
|
||||
List<AmountOptionDetails> amountOptionDetailsList = mapAmountOptionDTOToEntity(
|
||||
responseWrapper.getAmountOptionDAOS(), requestId, txnId);
|
||||
|
||||
// Set the mapped AmountOptionDetails list to AmountOptionByBillerId entity
|
||||
responseWrapper.getAmountOptionDAOS(), requestId, txnId, userId);
|
||||
entity.setAmountOptionDetails(amountOptionDetailsList);
|
||||
entity.setCreateDateTime(new Date());
|
||||
|
||||
// Save AmountOptionByBillerId entity (this will also save related
|
||||
// AmountOptionDetails entities)
|
||||
amountOptionByBillerIdRepository.save(entity); // Saves the entity and cascades to AmountOptionDetails
|
||||
|
||||
// Return success message
|
||||
@@ -373,7 +374,7 @@ public class BillerMapperHelper {
|
||||
}
|
||||
|
||||
private List<AmountOptionDetails> mapAmountOptionDTOToEntity(List<AmountOptionDTO> amountOptionDTOs,
|
||||
String requestId, String txnId) {
|
||||
String requestId, String txnId, String userId) {
|
||||
|
||||
// If the list is null or empty, return an empty list of entities
|
||||
if (amountOptionDTOs == null || amountOptionDTOs.isEmpty()) {
|
||||
@@ -397,13 +398,14 @@ public class BillerMapperHelper {
|
||||
amountOptionDetails.setAmountOptionId(dto.getAmountOptionId());
|
||||
amountOptionDetails.setRequestId(requestId);
|
||||
amountOptionDetails.setTxnId(txnId);
|
||||
amountOptionDetails.setUserId(userId);
|
||||
|
||||
// Return the mapped AmountOptionDetails entity
|
||||
return amountOptionDetails;
|
||||
})).collect(Collectors.toList()); // Collect them into a list and return
|
||||
}
|
||||
|
||||
public PlanResponses savePlanResponse(PlanResponse planResponse, String reqId, String txnId) {
|
||||
public PlanResponses savePlanResponse(PlanResponse planResponse, String reqId, String txnId, String userId) {
|
||||
PlanResponses response = new PlanResponses();
|
||||
response.setRequestId(reqId);
|
||||
response.setPageNo(planResponse.getPageNo());
|
||||
@@ -411,6 +413,7 @@ public class BillerMapperHelper {
|
||||
response.setTotalElements(planResponse.getTotalElements());
|
||||
response.setTotalPages(planResponse.getTotalPages());
|
||||
response.setTxnId(txnId);
|
||||
response.setUserId(userId);
|
||||
response.setCreateDateTime(new Date());
|
||||
|
||||
PlansList plansList = new PlansList();
|
||||
@@ -472,7 +475,7 @@ public class BillerMapperHelper {
|
||||
return planResponseRepository.save(response);
|
||||
}
|
||||
|
||||
public String saveCategoryItems(List<String> categoryRespList, String requestId, String txnId) {
|
||||
public String saveCategoryItems(List<String> categoryRespList, String requestId, String txnId, String userId) {
|
||||
int savedCount = 0; // To track how many items were saved
|
||||
|
||||
if (categoryRespList == null || categoryRespList.isEmpty()) {
|
||||
@@ -485,13 +488,14 @@ public class BillerMapperHelper {
|
||||
category.setRequestId(txnId);
|
||||
category.setRequestId(requestId);
|
||||
category.setCreateDateTime(new Date());
|
||||
category.setUserId(userId);
|
||||
categoryResponseListRepository.save(category);
|
||||
savedCount++;
|
||||
}
|
||||
return savedCount + " items were successfully saved.";
|
||||
}
|
||||
|
||||
public String saveComplaintStatus(TicketCheckStatusResponse response, String reqId, String txnId) {
|
||||
public String saveComplaintStatus(TicketCheckStatusResponse response, String reqId, String txnId, String userId) {
|
||||
|
||||
if (response == null || response.getTicketDetails() == null) {
|
||||
throw new CustomException("Invalid response received!", "FAILURE", 500, "Response Null");
|
||||
@@ -531,6 +535,7 @@ public class BillerMapperHelper {
|
||||
entity.setNpciTicketStatus(dto.getNpciTicketStatus());
|
||||
entity.setCreatedTime(dto.getCreatedTime());
|
||||
entity.setCreateDateTime(new Date());
|
||||
entity.setUserId(userId);
|
||||
|
||||
try {
|
||||
ComplainStatus saved = complaintStatusRepository.save(entity);
|
||||
@@ -541,7 +546,8 @@ public class BillerMapperHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public String saveComplaintHistory(ComplaintHistoryStatusResponse responseWrapper, String reqId, String txnId) {
|
||||
public String saveComplaintHistory(ComplaintHistoryStatusResponse responseWrapper, String reqId, String txnId,
|
||||
String userId) {
|
||||
if (responseWrapper == null || responseWrapper.getTicketHistories() == null
|
||||
|| responseWrapper.getTicketHistories().isEmpty()) {
|
||||
return "No complaint history data found to save.";
|
||||
@@ -560,6 +566,7 @@ public class BillerMapperHelper {
|
||||
entity.setReqId(reqId);
|
||||
entity.setTxnId(txnId);
|
||||
entity.setCreateDateTime(new Date());
|
||||
entity.setUserId(userId);
|
||||
|
||||
complaintHistoryRepository.save(entity);
|
||||
savedCount++;
|
||||
@@ -656,7 +663,8 @@ public class BillerMapperHelper {
|
||||
return finalJson;
|
||||
}
|
||||
|
||||
public String saveComplainStatusDetail(ViewComplainByIdResponse responseWrapper, String reqId, String txnId) {
|
||||
public String saveComplainStatusDetail(ViewComplainByIdResponse responseWrapper, String reqId, String txnId,
|
||||
String userId) {
|
||||
|
||||
ModelMapper mapper = new ModelMapper();
|
||||
mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
|
||||
@@ -674,6 +682,7 @@ public class BillerMapperHelper {
|
||||
entity.setPage(String.valueOf(responseWrapper.getPage()));
|
||||
entity.setPageSize(String.valueOf(responseWrapper.getPageSize()));
|
||||
entity.setCreateDateTime(new Date());
|
||||
entity.setUserId(userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -794,7 +803,7 @@ public class BillerMapperHelper {
|
||||
}
|
||||
|
||||
public String saveTicketDisoptionDetails(List<TicketDispositionsDTO> dispositionsList, String requestId,
|
||||
String txnId) {
|
||||
String txnId, String userId) {
|
||||
|
||||
if (dispositionsList == null || dispositionsList.isEmpty()) {
|
||||
return "No disposition data received.";
|
||||
@@ -820,7 +829,7 @@ public class BillerMapperHelper {
|
||||
entity.setCreateDateTime(new Date());
|
||||
entity.setTxnId(txnId);
|
||||
entity.setReqId(requestId);
|
||||
|
||||
entity.setUserId(userId);
|
||||
ticketDispositionRepository.save(entity);
|
||||
savedCount++;
|
||||
}
|
||||
@@ -833,7 +842,8 @@ public class BillerMapperHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public String saveAllComplaints(ViewAllComplaintsTicketsResponse responseWrapper, String reqId, String txnId) {
|
||||
public String saveAllComplaints(ViewAllComplaintsTicketsResponse responseWrapper, String reqId, String txnId,
|
||||
String userId) {
|
||||
|
||||
ModelMapper mapper = new ModelMapper();
|
||||
mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
|
||||
@@ -851,6 +861,7 @@ public class BillerMapperHelper {
|
||||
entity.setTotalPages(String.valueOf(responseWrapper.getTotalPages()));
|
||||
entity.setTotalElements(String.valueOf(responseWrapper.getTotalElements()));
|
||||
entity.setCreateDateTime(new Date());
|
||||
entity.setUserId(userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -907,6 +918,7 @@ public class BillerMapperHelper {
|
||||
billMaster.setUserId(responseWrapper.getUserId());
|
||||
billMaster.setReqId(billFetchByBillIdRequest.getReqId());
|
||||
billMaster.setTxnId(txnId);
|
||||
billMaster.setClientUserId(billFetchByBillIdRequest.getClientUserId());
|
||||
|
||||
// BILLER RESPONSE
|
||||
BillerResponse billerResponse = new BillerResponse();
|
||||
@@ -961,7 +973,8 @@ public class BillerMapperHelper {
|
||||
billMasterRepository.save(billMaster);
|
||||
}
|
||||
|
||||
public void saveBillValidation(FetchBillValidateResponse responseWrapper, BillFetchByBillIdRequest billRequest) {
|
||||
public void saveBillValidation(FetchBillValidateResponse responseWrapper, BillFetchByBillIdRequest billRequest,
|
||||
String txnId) {
|
||||
System.out.println("responseWrapper");
|
||||
ModelMapper modelMapper = new ModelMapper();
|
||||
|
||||
@@ -988,6 +1001,9 @@ public class BillerMapperHelper {
|
||||
return ai;
|
||||
}).collect(Collectors.toList());
|
||||
billEntity.setAdditionalInfo(additionalInfos);
|
||||
billEntity.setClientUserId(billRequest.getClientUserId());
|
||||
billEntity.setTxnId(txnId);
|
||||
billEntity.setRefId(billRequest.getReqId());
|
||||
|
||||
}
|
||||
// ✅ Save everything (cascade handles child)
|
||||
@@ -1198,7 +1214,8 @@ public class BillerMapperHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public String saveComplaintResponseEntity(ComplaintResponse responseWrapper, String requestId, String txnId,String userId) {
|
||||
public String saveComplaintResponseEntity(ComplaintResponse responseWrapper, String requestId, String txnId,
|
||||
String userId) {
|
||||
|
||||
// 1. Convert ComplaintResponse DTO to ComplaintResponseEntity
|
||||
ComplaintResponseEntity complaintResponseEntity = new ComplaintResponseEntity();
|
||||
|
||||
Reference in New Issue
Block a user