moved complain-related changes from develop to feature1
This commit is contained in:
@@ -245,70 +245,123 @@ public class Helper {
|
||||
}
|
||||
|
||||
public void saveOrUpdateBillerData(BillDataResponse responseWrapper,
|
||||
BillFetchByBillIdRequest billFetchByBillIdRequest) {
|
||||
BillMaster billMaster =new BillMaster();
|
||||
billMaster.setBillId("12333333hjsdfjsfdj");
|
||||
billMaster.setRefId(responseWrapper.getRefId());
|
||||
billMaster.setBillerId(responseWrapper.getBillerId());
|
||||
billMaster.setStatus(responseWrapper.getStatus());
|
||||
billMaster.setActionType(responseWrapper.getActionType());
|
||||
billMaster.setUserId(responseWrapper.getUserId());
|
||||
billMaster.setReqId(billFetchByBillIdRequest.getReqId()); // if available from your API request
|
||||
billMaster.setTxnId("jhnjhbhj"); // give it from method
|
||||
BillFetchByBillIdRequest billFetchByBillIdRequest) {
|
||||
|
||||
// ---- BILLER RESPONSE ----
|
||||
BillerResponse billerResponse = new BillerResponse();
|
||||
if (responseWrapper.getBillerResponse() != null) {
|
||||
billerResponse.setBillId(responseWrapper.getBillerResponse().getBillId());
|
||||
billerResponse.setAmount(responseWrapper.getBillerResponse().getAmount());
|
||||
billerResponse.setBillDate(responseWrapper.getBillerResponse().getBillDate());
|
||||
billerResponse.setBillNumber(responseWrapper.getBillerResponse().getBillNumber());
|
||||
billerResponse.setBillPeriod(responseWrapper.getBillerResponse().getBillPeriod());
|
||||
billerResponse.setCustConvFee(responseWrapper.getBillerResponse().getCustConvFee());
|
||||
billerResponse.setCouCustConvFee(responseWrapper.getBillerResponse().getCouCustConvFee());
|
||||
billerResponse.setDueDate(responseWrapper.getBillerResponse().getDueDate());
|
||||
billerResponse.setCustomerName(responseWrapper.getBillerResponse().getCustomerName());
|
||||
billerResponse.setAmountOption(responseWrapper.getBillerResponse().isAmountOption());
|
||||
billerResponse.setBillMaster(billMaster); // maintain mapping
|
||||
}
|
||||
billMaster.setBillerResponse(billerResponse);
|
||||
// ---- ADDITIONAL INFO ----
|
||||
List<AdditionalInfoBill> additionalInfos = new ArrayList<>();
|
||||
if (responseWrapper.getAdditionalInfo() != null) {
|
||||
for (AdditionalInfoBillDTO info : responseWrapper.getAdditionalInfo()) {
|
||||
AdditionalInfoBill entity = new AdditionalInfoBill();
|
||||
entity.setName(info.getName());
|
||||
entity.setValue(info.getValue());
|
||||
entity.setBillMaster(billMaster); // maintain mapping
|
||||
additionalInfos.add(entity);
|
||||
|
||||
}
|
||||
}
|
||||
billMaster.setAdditionalInfo(additionalInfos);
|
||||
// ------------------------------------------------------------
|
||||
// 🔥 1. STATIC ADDITIONAL INFO LIST (overwrite before mapping)
|
||||
// ------------------------------------------------------------
|
||||
List<AdditionalInfoBillDTO> staticAdditional = new ArrayList<>();
|
||||
|
||||
// ---- CUSTOMER PARAMS ----
|
||||
List<CustomerParamBill> customerParams = new ArrayList<>();
|
||||
if (responseWrapper.getCustomerParams() != null) {
|
||||
for (CustomerParamDAO param : responseWrapper.getCustomerParams()) {
|
||||
CustomerParamBill entity = new CustomerParamBill();
|
||||
entity.setName(param.getName());
|
||||
entity.setValue(param.getValue());
|
||||
entity.setType(param.getType());
|
||||
entity.setBillMaster(billMaster);
|
||||
customerParams.add(entity);
|
||||
}
|
||||
}
|
||||
billMaster.setCustomerParams(customerParams);
|
||||
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"));
|
||||
|
||||
// ---- DATES ----
|
||||
billMaster.setCreationDate(responseWrapper.getCreationDate());
|
||||
billMaster.setModifiedDate(responseWrapper.getModifiedDate());
|
||||
billMaster.setCreatedEpochDate(responseWrapper.getCreatedEpochDate());
|
||||
billMaster.setModifiedEpochDate(responseWrapper.getModifiedEpochDate());
|
||||
|
||||
billMasterRepository.save(billMaster);
|
||||
// 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();
|
||||
|
||||
billMaster.setBillId("12333333hjsdfjsfdj");
|
||||
billMaster.setRefId(responseWrapper.getRefId());
|
||||
billMaster.setBillerId(responseWrapper.getBillerId());
|
||||
billMaster.setStatus(responseWrapper.getStatus());
|
||||
billMaster.setActionType(responseWrapper.getActionType());
|
||||
billMaster.setUserId(responseWrapper.getUserId());
|
||||
billMaster.setReqId(billFetchByBillIdRequest.getReqId());
|
||||
billMaster.setTxnId("jhnjhbhj");
|
||||
|
||||
|
||||
// BILLER RESPONSE
|
||||
BillerResponse billerResponse = new BillerResponse();
|
||||
if (responseWrapper.getBillerResponse() != null) {
|
||||
billerResponse.setBillId(responseWrapper.getBillerResponse().getBillId());
|
||||
billerResponse.setAmount(responseWrapper.getBillerResponse().getAmount());
|
||||
billerResponse.setBillDate(responseWrapper.getBillerResponse().getBillDate());
|
||||
billerResponse.setBillNumber(responseWrapper.getBillerResponse().getBillNumber());
|
||||
billerResponse.setBillPeriod(responseWrapper.getBillerResponse().getBillPeriod());
|
||||
billerResponse.setCustConvFee(responseWrapper.getBillerResponse().getCustConvFee());
|
||||
billerResponse.setCouCustConvFee(responseWrapper.getBillerResponse().getCouCustConvFee());
|
||||
billerResponse.setDueDate(responseWrapper.getBillerResponse().getDueDate());
|
||||
billerResponse.setCustomerName(responseWrapper.getBillerResponse().getCustomerName());
|
||||
billerResponse.setAmountOption(responseWrapper.getBillerResponse().isAmountOption());
|
||||
billerResponse.setBillMaster(billMaster);
|
||||
}
|
||||
billMaster.setBillerResponse(billerResponse);
|
||||
|
||||
|
||||
|
||||
// ADDITIONAL INFO
|
||||
List<AdditionalInfoBill> additionalInfos = new ArrayList<>();
|
||||
if (responseWrapper.getAdditionalInfo() != null) {
|
||||
for (AdditionalInfoBillDTO info : responseWrapper.getAdditionalInfo()) {
|
||||
AdditionalInfoBill entity = new AdditionalInfoBill();
|
||||
entity.setName(info.getName());
|
||||
entity.setValue(info.getValue());
|
||||
entity.setBillMaster(billMaster);
|
||||
additionalInfos.add(entity);
|
||||
}
|
||||
}
|
||||
billMaster.setAdditionalInfo(additionalInfos);
|
||||
|
||||
|
||||
|
||||
// CUSTOMER PARAMS
|
||||
List<CustomerParamBill> customerParams = new ArrayList<>();
|
||||
if (responseWrapper.getCustomerParams() != null) {
|
||||
for (CustomerParamDAO param : responseWrapper.getCustomerParams()) {
|
||||
CustomerParamBill entity = new CustomerParamBill();
|
||||
entity.setName(param.getName());
|
||||
entity.setValue(param.getValue() == null ? "" : param.getValue());
|
||||
entity.setType(param.getType() == null ? "" : param.getType());
|
||||
entity.setBillMaster(billMaster);
|
||||
customerParams.add(entity);
|
||||
}
|
||||
}
|
||||
billMaster.setCustomerParams(customerParams);
|
||||
|
||||
|
||||
|
||||
// DATES
|
||||
billMaster.setCreationDate(responseWrapper.getCreationDate());
|
||||
billMaster.setModifiedDate(responseWrapper.getModifiedDate());
|
||||
billMaster.setCreatedEpochDate(responseWrapper.getCreatedEpochDate());
|
||||
billMaster.setModifiedEpochDate(responseWrapper.getModifiedEpochDate());
|
||||
|
||||
|
||||
billMasterRepository.save(billMaster);
|
||||
}
|
||||
|
||||
}
|
||||
public void saveBillValidation(FetchBillValidateResponse responseWrapper, BillFetchByBillIdRequest billRequest) {
|
||||
System.out.println("responseWrapper");
|
||||
ModelMapper modelMapper = new ModelMapper();
|
||||
|
||||
Reference in New Issue
Block a user