added checkTxn and removed static bill
This commit is contained in:
@@ -8,6 +8,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.modelmapper.convention.MatchingStrategies;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -24,6 +26,7 @@ import com.billpaymentservice.bbps.dto.response.AmountOptionsResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.ComplaintHistoryStatusResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.ComplaintStatusResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.PlanResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.ViewComplainByIdResponse;
|
||||
import com.billpaymentservice.bbps.entites.AdditionalInfoPlans;
|
||||
import com.billpaymentservice.bbps.entites.AmountOptionByBillerId;
|
||||
import com.billpaymentservice.bbps.entites.AmountOptionDetails;
|
||||
@@ -31,7 +34,9 @@ import com.billpaymentservice.bbps.entites.BillerCategoryIcon;
|
||||
import com.billpaymentservice.bbps.entites.BillerCategoryWise;
|
||||
import com.billpaymentservice.bbps.entites.CategoryResponseList;
|
||||
import com.billpaymentservice.bbps.entites.ComplainStatus;
|
||||
import com.billpaymentservice.bbps.entites.ComplaintDetails;
|
||||
import com.billpaymentservice.bbps.entites.ComplaintHistory;
|
||||
import com.billpaymentservice.bbps.entites.ComplaintStatusDetails;
|
||||
import com.billpaymentservice.bbps.entites.CustomerParamGroupById;
|
||||
import com.billpaymentservice.bbps.entites.GroupParam;
|
||||
import com.billpaymentservice.bbps.entites.Plan;
|
||||
@@ -49,6 +54,9 @@ import com.billpaymentservice.bbps.repository.FetchBillValidateRepository;
|
||||
import com.billpaymentservice.bbps.repository.PlanResponseRepository;
|
||||
import com.billpaymentservice.bbps.repository.ReOpenComplaintRepository;
|
||||
|
||||
import com.billpaymentservice.bbps.repository.ComplainDetailRepository;
|
||||
import com.billpaymentservice.bbps.serviceImpl.AgentServiceImpl;
|
||||
|
||||
@Component
|
||||
public class BillerMapperHelper {
|
||||
|
||||
@@ -63,6 +71,8 @@ public class BillerMapperHelper {
|
||||
private final ComplaintStatusRepository complaintStatusRepository;
|
||||
private final ReOpenComplaintRepository reOpenComplaintRepository;
|
||||
private final ComplaintHistoryRepository complaintHistoryRepository;
|
||||
|
||||
private final ComplainDetailRepository complainDetailRepository;
|
||||
|
||||
public BillerMapperHelper(BillerCategoryWiseRepository billerRepo,
|
||||
CustomerParamGroupByBillerIdRepository customerParamGroupByBillerIdRepo,
|
||||
@@ -71,7 +81,8 @@ public class BillerMapperHelper {
|
||||
CategoryResponseListRepository categoryResponseListRepository,
|
||||
FetchBillValidateRepository fetchBillValidateRepository,
|
||||
ComplaintStatusRepository complaintStatusRepository, ReOpenComplaintRepository reOpenComplaintRepository,
|
||||
ComplaintHistoryRepository complaintHistoryRepository) {
|
||||
ComplaintHistoryRepository complaintHistoryRepository,
|
||||
ComplainDetailRepository complainDetailRepository) {
|
||||
this.billerRepo = billerRepo;
|
||||
this.customerParamGroupByBillerIdRepo = customerParamGroupByBillerIdRepo;
|
||||
this.amountOptionByBillerIdRepository = amountOptionByBillerIdRepository;
|
||||
@@ -81,6 +92,7 @@ public class BillerMapperHelper {
|
||||
this.complaintStatusRepository = complaintStatusRepository;
|
||||
this.reOpenComplaintRepository = reOpenComplaintRepository;
|
||||
this.complaintHistoryRepository = complaintHistoryRepository;
|
||||
this.complainDetailRepository = complainDetailRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -619,4 +631,31 @@ public class BillerMapperHelper {
|
||||
}
|
||||
|
||||
|
||||
public String saveComplainStatusDetail(ViewComplainByIdResponse responseWrapper, String reqId, String txnId) {
|
||||
|
||||
ModelMapper mapper = new ModelMapper();
|
||||
mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
|
||||
|
||||
// Map list → ComplaintStatusDetails list
|
||||
List<ComplaintStatusDetails> entityList = responseWrapper.getComplaintsList()
|
||||
.stream()
|
||||
.map(c -> mapper.map(c, ComplaintStatusDetails.class))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// Set extra fields
|
||||
for (ComplaintStatusDetails entity : entityList) {
|
||||
entity.setReqId(reqId);
|
||||
entity.setTxnId(txnId);
|
||||
}
|
||||
|
||||
// Save to repository
|
||||
complainDetailRepository.saveAll(entityList);
|
||||
|
||||
return "SUCCESS";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user