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";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -247,48 +247,6 @@ public class Helper {
|
||||
public void saveOrUpdateBillerData(BillDataResponse responseWrapper,
|
||||
BillFetchByBillIdRequest billFetchByBillIdRequest) {
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// 🔥 1. STATIC ADDITIONAL INFO LIST (overwrite before mapping)
|
||||
// ------------------------------------------------------------
|
||||
List<AdditionalInfoBillDTO> staticAdditional = new ArrayList<>();
|
||||
|
||||
staticAdditional.add(new AdditionalInfoBillDTO("123", "Student Name", "AGAMJOT TEST "));
|
||||
staticAdditional.add(new AdditionalInfoBillDTO("333", "Father Name", "VIRENDER SINGH"));
|
||||
staticAdditional.add(new AdditionalInfoBillDTO("908", "Class", "STD I"));
|
||||
staticAdditional.add(new AdditionalInfoBillDTO("097", "Section", "A"));
|
||||
staticAdditional.add(new AdditionalInfoBillDTO("321", "TUITION FEE", "8670"));
|
||||
staticAdditional.add(new AdditionalInfoBillDTO("121", "E-CARE FEE", "900"));
|
||||
staticAdditional.add(new AdditionalInfoBillDTO("111", "COMPUTER FEE", "1350"));
|
||||
staticAdditional.add(new AdditionalInfoBillDTO("121", "EXAM FEE", "500"));
|
||||
|
||||
// Static set (overwrite)
|
||||
responseWrapper.setAdditionalInfo(staticAdditional);
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// 🔥 2. STATIC CUSTOMER PARAMS LIST (overwrite before mapping)
|
||||
// ------------------------------------------------------------
|
||||
List<CustomerParamDAO> staticCustomerParams = new ArrayList<>();
|
||||
|
||||
staticCustomerParams.add(new CustomerParamDAO(
|
||||
"Admission No/Application No/GR No", "LF3130", "test"
|
||||
));
|
||||
|
||||
staticCustomerParams.add(new CustomerParamDAO(
|
||||
"Date Of Birth (DD-MM-YYYY)", "10/08/2000", "test"
|
||||
));
|
||||
|
||||
staticCustomerParams.add(new CustomerParamDAO(
|
||||
"Mobile No", "9241842248", "test"
|
||||
));
|
||||
|
||||
// Static set (overwrite)
|
||||
responseWrapper.setCustomerParams(staticCustomerParams);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// 🔥 REST OF YOUR ORIGINAL LOGIC — NO CHANGE
|
||||
// ------------------------------------------------------------
|
||||
|
||||
BillMaster billMaster = new BillMaster();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user