Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #618 from egovernments/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rahuldevgarg authored Oct 18, 2023
2 parents 87e9b09 + 401948b commit 965d256
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 18 deletions.
50 changes: 50 additions & 0 deletions frontend/mgramseva/lib/model/localization/language.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,53 @@ class LanguageList {
return data;
}
}
class PSPCLIntegration{
List<AccountNumberGpMapping>? accountNumberGpMapping;

PSPCLIntegration({this.accountNumberGpMapping});

PSPCLIntegration.fromJson(Map<String, dynamic> json) {
if (json['accountNumberGpMapping'] != null) {
accountNumberGpMapping = <AccountNumberGpMapping>[];
json['accountNumberGpMapping'].forEach((v) {
accountNumberGpMapping!.add(new AccountNumberGpMapping.fromJson(v));
});
}
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.accountNumberGpMapping != null) {
data['accountNumberGpMapping'] =
this.accountNumberGpMapping!.map((v) => v.toJson()).toList();
}
return data;
}
}
class AccountNumberGpMapping {
String? accountNumber;
String? departmentEntityName;
String? departmentEntityCode;

AccountNumberGpMapping(
{this.accountNumber,
this.departmentEntityName,
this.departmentEntityCode});

AccountNumberGpMapping.fromJson(Map<String, dynamic> json) {
accountNumber = json['accountNumber'];
departmentEntityName = json['departmentEntityName'];
departmentEntityCode = json['departmentEntityCode'];
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['accountNumber'] = this.accountNumber;
data['departmentEntityName'] = this.departmentEntityName;
data['departmentEntityCode'] = this.departmentEntityCode;
return data;
}
}
class MdmsRes {
CommonMasters? commonMasters;
BillingService? billingService;
Expand All @@ -40,6 +86,7 @@ class MdmsRes {
SubCategory? subCategory;
TaxPeriodListModel? taxPeriodList;
WCBillingSlabs? wcBillingSlabList;
PSPCLIntegration? pspclIntegration;

MdmsRes({this.commonMasters});

Expand Down Expand Up @@ -71,6 +118,9 @@ class MdmsRes {
wcBillingSlabList = json['ws-services-calculation'] != null
? new WCBillingSlabs.fromJson(json['ws-services-calculation'])
: null;
pspclIntegration = json['pspcl-integration'] != null
? new PSPCLIntegration.fromJson(json['pspcl-integration'])
: null;
}

Map<String, dynamic> toJson() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class InactiveConsumerReportData {
this.inactiveDate, this.inactivatedByUuid, this.inactivatedByName);

InactiveConsumerReportData.fromJson(Map<String, dynamic> json) {
tenantName = json['tenantName'];
connectionNo = json['connectionno'];
status = json['status'];
tenantName = json['tenantName']??'';
connectionNo = json['connectionno']??'-';
status = json['status']??'-';
inactiveDate = json['inactiveDate'];
inactivatedByUuid = json['inactivatedByUuid'];
inactivatedByName = json['inactivatedByName'];
inactivatedByUuid = json['inactivatedByUuid']??'-';
inactivatedByName = json['inactivatedByName']??'-';
}

Map<String, dynamic> toJson() {
Expand Down
12 changes: 12 additions & 0 deletions frontend/mgramseva/lib/providers/expenses_details_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ class ExpensesDetailsProvider with ChangeNotifier {
var expenditure = await ExpensesRepository().searchExpense(query);
if (expenditure != null && expenditure.isNotEmpty) {
expenditureDetails = expenditure.first;
if(expenditureDetails.expenseType=='ELECTRICITY_BILL'){
expenditureDetails.allowEdit = false;
}
getStoreFileDetails();
} else {
streamController.add(i18.expense.NO_EXPENSE_RECORD_FOUND);
Expand Down Expand Up @@ -432,6 +435,8 @@ class ExpensesDetailsProvider with ChangeNotifier {
var res = await CoreRepository().getMdms(getExpenseMDMS(
commonProvider.userDetails!.userRequest!.tenantId.toString()));
languageList = res;
var pspcl = await CoreRepository().getPSPCLGpwscFromMdms(commonProvider.userDetails!.userRequest!.tenantId.toString().substring(0,2));
languageList?.mdmsRes?.pspclIntegration = pspcl;
notifyListeners();
} catch (e, s) {
ErrorHandler.logError(e.toString(), s);
Expand Down Expand Up @@ -520,7 +525,14 @@ class ExpensesDetailsProvider with ChangeNotifier {
}

List<DropdownMenuItem<Object>> getExpenseTypeList() {
var commonProvider = Provider.of<CommonProvider>(
navigatorKey.currentContext!,
listen: false);
if (languageList?.mdmsRes?.expense?.expenseList != null) {
var res = languageList?.mdmsRes?.pspclIntegration?.accountNumberGpMapping?.where((element) => element.departmentEntityCode==commonProvider.userDetails?.selectedtenant?.city?.code).toList();
if(res!.isNotEmpty){
languageList?.mdmsRes?.expense?.expenseList!.removeWhere((element) => element.code=="20101");
}
return (languageList?.mdmsRes?.expense?.expenseList ?? <ExpenseType>[])
.map((value) {
return DropdownMenuItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class HouseHoldProvider with ChangeNotifier {
value.demands?.first.demandDetails?.first.taxHeadMasterCode ==
'WS_ADVANCE_CARRYFORWARD' &&
((waterConnection?.fetchBill?.bill ?? []).length == 0) ||
(waterConnection?.fetchBill?.bill?.first.totalAmount ?? 0) < 0) {
((waterConnection?.fetchBill?.bill??[]).length>0?(waterConnection?.fetchBill?.bill?.first.totalAmount ?? 0):0) < 0) {
isfirstdemand = false;
} else {
isfirstdemand = true;
Expand Down
13 changes: 7 additions & 6 deletions frontend/mgramseva/lib/providers/reports_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class ReportsProvider with ChangeNotifier {
TableHeader(i18.common.STATUS),
TableHeader(i18.common.INACTIVATED_DATE),
TableHeader(i18.common.INACTIVATED_BY_NAME),
TableHeader(i18.common.INACTIVATED_BY_UUID),
];

void onChangeOfPageLimit(
Expand Down Expand Up @@ -172,7 +171,6 @@ class ReportsProvider with ChangeNotifier {
TableData('${data.status??'-'}'),
TableData('${inactivatedDate ?? '-'}'),
TableData('${inactivatedBy ?? '-'}'),
TableData('${data.inactivatedByUuid ?? ''}'),
]);
}
void callNotifier() {
Expand Down Expand Up @@ -322,7 +320,8 @@ class ReportsProvider with ChangeNotifier {
optionalData: [
'Demand Report',
'$selectedBillPeriod',
'${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(commonProvider.userDetails!.selectedtenant!.code!)} ${commonProvider.userDetails?.selectedtenant?.code?.substring(3)}',
'${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(commonProvider.userDetails!.selectedtenant!.code!)}',
'${commonProvider.userDetails?.selectedtenant?.code?.substring(3)}',
'Downloaded On ${DateFormats.timeStampToDate(DateTime.now().millisecondsSinceEpoch, format: 'dd/MMM/yyyy')}'
]);
} else {
Expand Down Expand Up @@ -387,7 +386,8 @@ class ReportsProvider with ChangeNotifier {
optionalData: [
'Collection Report',
'$selectedBillPeriod',
'${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(commonProvider.userDetails!.selectedtenant!.code!)} ${commonProvider.userDetails?.selectedtenant?.code?.substring(3)}',
'${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(commonProvider.userDetails!.selectedtenant!.code!)}',
'${commonProvider.userDetails?.selectedtenant?.code?.substring(3)}',
'Downloaded On ${DateFormats.timeStampToDate(DateTime.now().millisecondsSinceEpoch, format: 'dd/MMM/yyyy')}'
]);
} else {
Expand Down Expand Up @@ -450,9 +450,10 @@ class ReportsProvider with ChangeNotifier {
title:
'InactiveConsumers_${commonProvider.userDetails?.selectedtenant?.code?.substring(3)}_${selectedBillPeriod.toString().replaceAll('/', '_')}',
optionalData: [
'Collection Report',
'Inactive Consumer Report',
'$selectedBillPeriod',
'${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(commonProvider.userDetails!.selectedtenant!.code!)} ${commonProvider.userDetails?.selectedtenant?.code?.substring(3)}',
'${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(commonProvider.userDetails!.selectedtenant!.code!)}',
'${commonProvider.userDetails?.selectedtenant?.code?.substring(3)}',
'Downloaded On ${DateFormats.timeStampToDate(DateTime.now().millisecondsSinceEpoch, format: 'dd/MMM/yyyy')}'
]);
} else {
Expand Down
35 changes: 35 additions & 0 deletions frontend/mgramseva/lib/repository/core_repo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,41 @@ class CoreRepository extends BaseService {
}
return languageList.mdmsRes?.wcBillingSlabList;
}
Future<PSPCLIntegration?> getPSPCLGpwscFromMdms(String tenantId) async {
var body = {
"MdmsCriteria": {
"tenantId": tenantId,
"moduleDetails": [
{
"moduleName": "pspcl-integration",
"masterDetails": [
{
"name": "accountNumberGpMapping"
}
]
}
]
}
};
late LanguageList languageList;
var res = await makeRequest(
url: Url.MDMS,
body: body,
method: RequestType.POST,
requestInfo: RequestInfo(
APIConstants.API_MODULE_NAME,
APIConstants.API_VERSION,
APIConstants.API_TS,
"_search",
APIConstants.API_DID,
APIConstants.API_KEY,
APIConstants.API_MESSAGE_ID,
""));
if (res != null) {
languageList = LanguageList.fromJson(res);
}
return languageList.mdmsRes?.pspclIntegration;
}

Future<PaymentType> getPaymentTypeMDMS(Map body) async {
late PaymentType paymentType;
Expand Down
4 changes: 2 additions & 2 deletions frontend/mgramseva/lib/repository/reports_repo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ class ReportsRepo extends BaseService{
requestInfo: requestInfo,
body: {},
method: RequestType.POST);
if (res != null && res['InactiveConsumerReportData'] != null) {
if (res != null && res['InactiveConsumerReport'] != null) {
try {
inactiveConsumers = [];
res['InactiveConsumerReportData'].forEach((val){
res['InactiveConsumerReport'].forEach((val){
inactiveConsumers?.add(InactiveConsumerReportData.fromJson(val));
});
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/mgramseva/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mgramseva",
"version": "1.2.8",
"version": "1.2.9",
"license": "egov"
}
2 changes: 1 addition & 1 deletion frontend/mgramseva/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.2.8+29
version: 1.2.9+30

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ public WaterConnectionResponse getWaterConnectionList(SearchCriteria criteria, R
connectionResponse = WaterConnectionResponse.builder().waterConnection(waterConnectionList)
.totalCount(openWaterRowMapper.getFull_count()).build();
} else {

log.info("HouseHold Register Query",query);
log.info("Prepared Statement of household register ",preparedStatement.toArray());
waterConnectionList = jdbcTemplate.query(query, preparedStatement.toArray(), waterRowMapper);
Map<String, Object> counter = new HashMap();
if (criteria.getIsPropertyCount()!= null && criteria.getIsPropertyCount()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class WsQueryBuilder {
+ " conn.locality, conn.isoldapplication, conn.roadtype, document.id as doc_Id, document.documenttype, document.filestoreid, document.active as doc_active, plumber.id as plumber_id,"
+ " plumber.name as plumber_name, plumber.licenseno, roadcuttingInfo.id as roadcutting_id, roadcuttingInfo.roadtype as roadcutting_roadtype, roadcuttingInfo.roadcuttingarea as roadcutting_roadcuttingarea, roadcuttingInfo.roadcuttingarea as roadcutting_roadcuttingarea,"
+ " roadcuttingInfo.active as roadcutting_active, plumber.mobilenumber as plumber_mobileNumber, plumber.gender as plumber_gender, plumber.fatherorhusbandname, plumber.correspondenceaddress,"
+ " plumber.relationship, " + "{holderSelectValues}, " + "{pendingAmountValue}," + "{lastDemandDate}"
+ " plumber.relationship, " + "{holderSelectValues}, " + "{pendingAmountValue}," + "{taxamount}, "+ "{lastDemandDate}"
+ " FROM eg_ws_connection conn " + INNER_JOIN_STRING + " eg_ws_service wc ON wc.connection_id = conn.id"
+ LEFT_OUTER_JOIN_STRING + "eg_ws_applicationdocument document ON document.wsid = conn.id"
+ LEFT_OUTER_JOIN_STRING + "eg_ws_plumberinfo plumber ON plumber.wsid = conn.id" + LEFT_OUTER_JOIN_STRING
Expand Down Expand Up @@ -474,6 +474,10 @@ private String addPaginationWrapper(String query, List<Object> preparedStmtList,
}
finalQuery = finalQuery.replace("{pendingAmountValue}",
"(select sum(dd.taxamount) - sum(dd.collectionamount) as pendingamount from egbs_demand_v1 d join egbs_demanddetail_v1 dd on d.id = dd.demandid group by d.consumercode, d.status having d.status = 'ACTIVE' and d.consumercode = conn.connectionno ) as pendingamount");

finalQuery=finalQuery.replace("{taxamount}",
"(select sum(dd.taxamount) as taxamount from egbs_demand_v1 d join egbs_demanddetail_v1 dd on d.id=dd.demandid group by d.consumercode,d.status having d.status ='ACTIVE' and d.consumercode=conn.connectionno ) as taxamount");

finalQuery = finalQuery.replace("{lastDemandDate}",
"(select d.taxperiodto as taxperiodto from egbs_demand_v1 d where d.consumercode = conn.connectionno order by d.createdtime desc limit 1) as taxperiodto");
if (criteria.getLimit() == null && criteria.getOffset() == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public List<WaterConnection> extractData(ResultSet rs) throws SQLException, Data
additionalDetails.put(WCConstants.LOCALITY, rs.getString("locality"));
additionalDetails.put("collectionAmount", rs.getString("collectionamount"));
additionalDetails.put("collectionPendingAmount", rs.getString("pendingamount"));
additionalDetails.put("totalamount",rs.getString("taxamount"));
additionalDetails.put("lastDemandGeneratedDate", rs.getString("taxperiodto"));

currentWaterConnection.setAdditionalDetails(additionalDetails);
Expand Down

0 comments on commit 965d256

Please sign in to comment.