diff --git a/lib/models/manager/inspection/inspection_check_detail_model.dart b/lib/models/manager/inspection/inspection_check_detail_model.dart index 04d5ac5..526e21c 100644 --- a/lib/models/manager/inspection/inspection_check_detail_model.dart +++ b/lib/models/manager/inspection/inspection_check_detail_model.dart @@ -8,9 +8,9 @@ class InspectionCheckDetialModel { String? name; int? type; String? completeDate; - List? checkFBIVoList; - List? faceImg; - List? spaceImg; + List? checkList; + List? faceImgList; + List? spaceImgList; InspectionCheckDetialModel( {required this.id, @@ -19,9 +19,9 @@ class InspectionCheckDetialModel { this.name, this.type, this.completeDate, - this.checkFBIVoList, - this.faceImg, - this.spaceImg}); + this.checkList, + this.faceImgList, + this.spaceImgList}); InspectionCheckDetialModel.fromJson(Map json) { id = json['id']; @@ -30,22 +30,22 @@ class InspectionCheckDetialModel { name = json['name']; type = json['type']; completeDate = json['completeDate']; - if (json['checkFBIVoList'] != null) { - checkFBIVoList = []; - json['checkFBIVoList'].forEach((v) { - checkFBIVoList!.add(new CheckFBIVoList.fromJson(v)); + if (json['checkList'] != null) { + checkList = []; + json['checkList'].forEach((v) { + checkList!.add(new CheckFBIVoList.fromJson(v)); }); } - if (json['faceImg'] != null) { - faceImg = []; - json['faceImg'].forEach((v) { - faceImg!.add(new ImgModel.fromJson(v)); + if (json['faceImgList'] != null) { + faceImgList = []; + json['faceImgList'].forEach((v) { + faceImgList!.add(new ImgModel.fromJson(v)); }); } - if (json['spaceImg'] != null) { - spaceImg = []; - json['spaceImg'].forEach((v) { - spaceImg!.add(new ImgModel.fromJson(v)); + if (json['spaceImgList'] != null) { + spaceImgList = []; + json['spaceImgList'].forEach((v) { + spaceImgList!.add(new ImgModel.fromJson(v)); }); } } @@ -58,15 +58,14 @@ class InspectionCheckDetialModel { data['name'] = this.name; data['type'] = this.type; data['completeDate'] = this.completeDate; - if (this.checkFBIVoList != null) { - data['checkFBIVoList'] = - this.checkFBIVoList!.map((v) => v.toJson()).toList(); + if (this.checkList != null) { + data['checkList'] = this.checkList!.map((v) => v.toJson()).toList(); } - if (this.faceImg != null) { - data['faceImg'] = this.faceImg!.map((v) => v.toJson()).toList(); + if (this.faceImgList != null) { + data['faceImgList'] = this.faceImgList!.map((v) => v.toJson()).toList(); } - if (this.spaceImg != null) { - data['spaceImg'] = this.spaceImg!.map((v) => v.toJson()).toList(); + if (this.spaceImgList != null) { + data['spaceImgList'] = this.spaceImgList!.map((v) => v.toJson()).toList(); } return data; } @@ -75,7 +74,7 @@ class InspectionCheckDetialModel { switch (this.type) { case 1: return '巡检模式1'; - + default: return '未知'; } diff --git a/lib/models/manager/inspection/inspection_point_model.dart b/lib/models/manager/inspection/inspection_point_model.dart index 781743e..2bc093c 100644 --- a/lib/models/manager/inspection/inspection_point_model.dart +++ b/lib/models/manager/inspection/inspection_point_model.dart @@ -3,14 +3,19 @@ class InspectionPointModel { String? name; int? checkNum; String? completeDate; + int? longitude; + int? latitude; - InspectionPointModel({required this.id, this.name, this.checkNum, this.completeDate}); + InspectionPointModel( + {required this.id, this.name, this.checkNum, this.completeDate}); InspectionPointModel.fromJson(Map json) { id = json['id']; name = json['name']; checkNum = json['checkNum']; completeDate = json['completeDate']; + longitude = json['longitude']; + latitude = json['latitude']; } Map toJson() { @@ -19,6 +24,8 @@ class InspectionPointModel { data['name'] = this.name; data['checkNum'] = this.checkNum; data['completeDate'] = this.completeDate; + data['longitude'] = this.longitude; + data['latitude'] = this.latitude; return data; } } diff --git a/lib/models/manager/inspection/inspection_point_submit_model.dart b/lib/models/manager/inspection/inspection_point_submit_model.dart index ab480ef..ae20275 100644 --- a/lib/models/manager/inspection/inspection_point_submit_model.dart +++ b/lib/models/manager/inspection/inspection_point_submit_model.dart @@ -3,10 +3,10 @@ class InspectionPointSubmitModel { int executePointId; List? executeCheckList; - List? inspectionFaceImgPath; - List? inspectionSpaceImgPath; + List? inspectionFaceImg; + List? inspectionSpaceImg; InspectionPointSubmitModel(this.executePointId, this.executeCheckList, - {this.inspectionFaceImgPath, this.inspectionSpaceImgPath}); + {this.inspectionFaceImg, this.inspectionSpaceImg}); Map? executeCheckListToJson() { final Map data = new Map(); @@ -22,14 +22,14 @@ class InspectionPointSubmitModel { class ExecuteCheckList { int? id; int status; - String remarkes; - ExecuteCheckList(this.id, this.status, this.remarkes); + String remakes; + ExecuteCheckList(this.id, this.status, this.remakes); Map toJson() { final Map data = { "id": this.id, "status": this.status, - "remakes": this.remarkes, + "remakes": this.remakes, }; return data; } diff --git a/lib/models/manager/inspection/inspection_qrcode_model.dart b/lib/models/manager/inspection/inspection_qrcode_model.dart index b4cebbf..d64c7a6 100644 --- a/lib/models/manager/inspection/inspection_qrcode_model.dart +++ b/lib/models/manager/inspection/inspection_qrcode_model.dart @@ -3,20 +3,20 @@ class InspectionQRCodeModel { String? code; String? name; int? type; - List? checkVoList; + List? checkList; InspectionQRCodeModel( - {required this.id, this.code, this.name, this.type, this.checkVoList}); + {required this.id, this.code, this.name, this.type, this.checkList}); InspectionQRCodeModel.fromJson(Map json) { id = json['id']; code = json['code']; name = json['name']; type = json['type']; - if (json['checkVoList'] != null) { - checkVoList = []; + if (json['checkList'] != null) { + checkList = []; json['checkVoList'].forEach((v) { - checkVoList!.add(new CheckVoList.fromJson(v)); + checkList!.add(new CheckVoList.fromJson(v)); }); } } @@ -27,8 +27,8 @@ class InspectionQRCodeModel { data['code'] = this.code; data['name'] = this.name; data['type'] = this.type; - if (this.checkVoList != null) { - data['checkVoList'] = this.checkVoList!.map((v) => v.toJson()).toList(); + if (this.checkList != null) { + data['checkList'] = this.checkList!.map((v) => v.toJson()).toList(); } return data; } @@ -37,7 +37,7 @@ class InspectionQRCodeModel { switch (this.type) { case 1: return '巡检模式1'; - + default: return '未知'; } diff --git a/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart index f956fa3..bc41648 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart @@ -1,8 +1,7 @@ // Dart imports: import 'dart:async'; -// Project imports: -import 'package:aku_new_community_manager/const/api.dart'; +import 'package:aku_new_community_manager/const/saas_api.dart'; import 'package:aku_new_community_manager/models/manager/inspection/inspection_detail_model.dart'; import 'package:aku_new_community_manager/models/manager/inspection/inspection_point_model.dart'; import 'package:aku_new_community_manager/models/manager/inspection/inspection_qrcode_model.dart'; @@ -167,7 +166,7 @@ class _InspectionManageDetailsPageState onPressed: _detailModel!.status == 1 ? () async { BaseModel _baseModel = await NetUtil().get( - API.manage.inspectionStart, + SAASAPI.inspection.startInspection, params: {"executeId": widget.executeId}); if (_baseModel.success!) { BotToast.showText(text: _baseModel.msg); @@ -578,12 +577,12 @@ class _InspectionManageDetailsPageState Future _uploadLocation( int executeId, double longitude, double latitude) async { - BaseModel baseModel = await NetUtil().post(API.manage.uploadLocation, - params: { - "executeId": executeId, - "longitude": longitude, - "latitude": latitude - }); + BaseModel baseModel = await NetUtil() + .post(SAASAPI.inspection.uploadLocation, params: { + "executeId": executeId, + "longitude": longitude, + "latitude": latitude + }); return baseModel; } } diff --git a/lib/ui/manage_pages/inspection_manage/inspection_manage_view.dart b/lib/ui/manage_pages/inspection_manage/inspection_manage_view.dart index a192511..00ffdd2 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_manage_view.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_manage_view.dart @@ -1,6 +1,6 @@ // Flutter imports: // Project imports: -import 'package:aku_new_community_manager/const/api.dart'; +import 'package:aku_new_community_manager/const/saas_api.dart'; import 'package:aku_new_community_manager/models/manager/inspection/inspection_list_model.dart'; import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_manage_card.dart'; import 'package:aku_new_community_manager/ui/widgets/common/bee_list_view.dart'; @@ -36,7 +36,7 @@ class _InspectionMangeViewState extends State { @override Widget build(BuildContext context) { return BeeListView( - path: API.manage.inspectionList, + path: SAASAPI.inspection.list, controller: _easyRefreshController, extraParams: {"inspectionStatus": widget.inspectionStatus}, convert: (models) { diff --git a/lib/ui/manage_pages/inspection_manage/inspection_point_detail_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_point_detail_page.dart index 2435616..695641a 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_point_detail_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_point_detail_page.dart @@ -80,9 +80,7 @@ class _InspectionPointDetailPageState extends State { 16.w.heightBox, _inspectionHeadCard(_detialModel), 16.w.heightBox, - ..._detialModel.checkFBIVoList! - .map((e) => _bodyCard(e)) - .toList(), + ..._detialModel.checkList!.map((e) => _bodyCard(e)).toList(), _selfPhotoCard(), _scenePhotoCard(), ], @@ -124,7 +122,8 @@ class _InspectionPointDetailPageState extends State { child: FadeInImage.assetNetwork( fit: BoxFit.fill, placeholder: R.ASSETS_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(_detialModel.faceImg)!)), + image: + API.image(ImgModel.first(_detialModel.faceImgList)!)), ) : DottedBorder( borderType: BorderType.RRect, @@ -176,7 +175,8 @@ class _InspectionPointDetailPageState extends State { child: FadeInImage.assetNetwork( fit: BoxFit.fill, placeholder: R.ASSETS_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(_detialModel.spaceImg)!)), + image: + API.image(ImgModel.first(_detialModel.spaceImgList)!)), ) : DottedBorder( borderType: BorderType.RRect, diff --git a/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart index a547877..78fab12 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart @@ -63,9 +63,8 @@ class _InspectionPointInputPageState extends State { [], ); _submitModel.executeCheckList = List.generate( - widget.qrModel!.checkVoList!.length, - (index) => - ExecuteCheckList(widget.qrModel!.checkVoList![index].id, -1, ''), + widget.qrModel!.checkList!.length, + (index) => ExecuteCheckList(widget.qrModel!.checkList![index].id, -1, ''), ); } @@ -83,8 +82,8 @@ class _InspectionPointInputPageState extends State { 16.w.heightBox, _inspectionHeadCard(), 16.w.heightBox, - ..._model!.checkVoList! - .map((e) => _meterCard(e.name, _model!.checkVoList!.indexOf(e))) + ..._model!.checkList! + .map((e) => _meterCard(e.name, _model!.checkList!.indexOf(e))) .toList(), _selfPhotoCard(), _scenePhotoCard(), @@ -93,12 +92,11 @@ class _InspectionPointInputPageState extends State { bottom: AkuButton( onPressed: canSubmit ? () async { - _submitModel.inspectionFaceImgPath = await NetUtil() + _submitModel.inspectionFaceImg = await NetUtil() .uploadFiles(_selfPhotos!, API.upload.uploadInspectionFace); - _submitModel.inspectionSpaceImgPath = await NetUtil() - .uploadFiles( - _scenePhots!, API.upload.uploadInspectionSpace); + _submitModel.inspectionSpaceImg = await NetUtil().uploadFiles( + _scenePhots!, API.upload.uploadInspectionSpace); BaseModel baseModel = await (ManageFunc.getSubmitPoint(_submitModel)); if (baseModel.success!) { @@ -247,7 +245,7 @@ class _InspectionPointInputPageState extends State { maxLines: 10, autofocus: false, onChanged: (value) { - _submitModel.executeCheckList![index].remarkes = value; + _submitModel.executeCheckList![index].remakes = value; }, decoration: InputDecoration( hintText: '请输入备注信息', diff --git a/lib/ui/sub_pages/manage_func.dart b/lib/ui/sub_pages/manage_func.dart index 6f4db28..744a9c3 100644 --- a/lib/ui/sub_pages/manage_func.dart +++ b/lib/ui/sub_pages/manage_func.dart @@ -4,6 +4,7 @@ // Project imports: import 'package:aku_new_community_manager/const/api.dart'; +import 'package:aku_new_community_manager/const/saas_api.dart'; import 'package:aku_new_community_manager/models/manager/decoration/decoration_detail_model.dart'; import 'package:aku_new_community_manager/models/manager/inspection/inspection_detail_model.dart'; import 'package:aku_new_community_manager/models/manager/inspection/inspection_point_model.dart'; @@ -36,7 +37,7 @@ class ManageFunc { static Future getInspectionDetail( int /*!*/ executeId) async { BaseModel baseModel = - await NetUtil().get(API.manage.inspectionFindDetailByld, params: { + await NetUtil().get(SAASAPI.inspection.detail, params: { "executeId": executeId, }); return InspectionDetailModel.fromJson(baseModel.data); @@ -45,7 +46,7 @@ class ManageFunc { static Future> getInspectionPointByPlanId( {required int planId}) async { BaseModel baseModel = - await NetUtil().get(API.manage.inspectionPointByPlanId, params: { + await NetUtil().get(SAASAPI.inspection.findPointByPlanId, params: { "planId": planId, }); return (baseModel.data as List) @@ -55,8 +56,8 @@ class ManageFunc { static Future> getInspectionPointByExcuteId( {required int /*!*/ excuteId}) async { - BaseModel baseModel = await NetUtil() - .get(API.manage.inspecntionFindPointByExecuteId, params: { + BaseModel baseModel = + await NetUtil().get(SAASAPI.inspection.findPointByExecuteId, params: { "executeId": excuteId, }); return (baseModel.data as List) @@ -67,20 +68,20 @@ class ManageFunc { static Future getInspectionFindCheckDetailByQr( int executeId, String executePointCode) async { BaseModel baseModel = await NetUtil().get( - API.manage.inspectionFindCheckDetailByQR, + SAASAPI.inspection.findCheckDetailByQR, params: {"executeId": executeId, "executePointCode": executePointCode}); return baseModel; } static Future getSubmitPoint(InspectionPointSubmitModel model) async { BaseModel baseModel = - await NetUtil().post(API.manage.submitPointDetail, params: { - "executePointId": model.executePointId, + await NetUtil().post(SAASAPI.inspection.submit, params: { + "id": model.executePointId, "executeCheckList": model.executeCheckList! - .map((e) => ExecuteCheckList(e.id, e.status, e.remarkes).toJson()) + .map((e) => ExecuteCheckList(e.id, e.status, e.remakes).toJson()) .toList(), - "inspectionFaceImg": model.inspectionFaceImgPath, - "inspectionSpaceImg": model.inspectionSpaceImgPath + "inspectionFaceImg": model.inspectionFaceImg, + "inspectionSpaceImg": model.inspectionSpaceImg }); return baseModel; @@ -88,15 +89,15 @@ class ManageFunc { static Future getInspectionPointCheckDetail(int executePointId) async { BaseModel baseModel = - await NetUtil().get(API.manage.inspectionPointCheckDetail, params: { + await NetUtil().get(SAASAPI.inspection.findExecutePointInfo, params: { "executePointId": executePointId, }); return baseModel; } static Future getInspectionPointCheckDetailUnbegin(int planPointId) async { - BaseModel baseModel = await NetUtil() - .get(API.manage.inspectionPointCheckDetailUnbegin, params: { + BaseModel baseModel = + await NetUtil().get(SAASAPI.inspection.findExecutePointInfo, params: { "planPointId": planPointId, }); return baseModel;