对接巡检管理

master
张萌 3 years ago
parent ad17ad1593
commit 87cc037d52

@ -8,9 +8,9 @@ class InspectionCheckDetialModel {
String? name; String? name;
int? type; int? type;
String? completeDate; String? completeDate;
List<CheckFBIVoList>? checkFBIVoList; List<CheckFBIVoList>? checkList;
List<ImgModel>? faceImg; List<ImgModel>? faceImgList;
List<ImgModel>? spaceImg; List<ImgModel>? spaceImgList;
InspectionCheckDetialModel( InspectionCheckDetialModel(
{required this.id, {required this.id,
@ -19,9 +19,9 @@ class InspectionCheckDetialModel {
this.name, this.name,
this.type, this.type,
this.completeDate, this.completeDate,
this.checkFBIVoList, this.checkList,
this.faceImg, this.faceImgList,
this.spaceImg}); this.spaceImgList});
InspectionCheckDetialModel.fromJson(Map<String, dynamic> json) { InspectionCheckDetialModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@ -30,22 +30,22 @@ class InspectionCheckDetialModel {
name = json['name']; name = json['name'];
type = json['type']; type = json['type'];
completeDate = json['completeDate']; completeDate = json['completeDate'];
if (json['checkFBIVoList'] != null) { if (json['checkList'] != null) {
checkFBIVoList = <CheckFBIVoList>[]; checkList = <CheckFBIVoList>[];
json['checkFBIVoList'].forEach((v) { json['checkList'].forEach((v) {
checkFBIVoList!.add(new CheckFBIVoList.fromJson(v)); checkList!.add(new CheckFBIVoList.fromJson(v));
}); });
} }
if (json['faceImg'] != null) { if (json['faceImgList'] != null) {
faceImg = <ImgModel>[]; faceImgList = <ImgModel>[];
json['faceImg'].forEach((v) { json['faceImgList'].forEach((v) {
faceImg!.add(new ImgModel.fromJson(v)); faceImgList!.add(new ImgModel.fromJson(v));
}); });
} }
if (json['spaceImg'] != null) { if (json['spaceImgList'] != null) {
spaceImg = <ImgModel>[]; spaceImgList = <ImgModel>[];
json['spaceImg'].forEach((v) { json['spaceImgList'].forEach((v) {
spaceImg!.add(new ImgModel.fromJson(v)); spaceImgList!.add(new ImgModel.fromJson(v));
}); });
} }
} }
@ -58,15 +58,14 @@ class InspectionCheckDetialModel {
data['name'] = this.name; data['name'] = this.name;
data['type'] = this.type; data['type'] = this.type;
data['completeDate'] = this.completeDate; data['completeDate'] = this.completeDate;
if (this.checkFBIVoList != null) { if (this.checkList != null) {
data['checkFBIVoList'] = data['checkList'] = this.checkList!.map((v) => v.toJson()).toList();
this.checkFBIVoList!.map((v) => v.toJson()).toList();
} }
if (this.faceImg != null) { if (this.faceImgList != null) {
data['faceImg'] = this.faceImg!.map((v) => v.toJson()).toList(); data['faceImgList'] = this.faceImgList!.map((v) => v.toJson()).toList();
} }
if (this.spaceImg != null) { if (this.spaceImgList != null) {
data['spaceImg'] = this.spaceImg!.map((v) => v.toJson()).toList(); data['spaceImgList'] = this.spaceImgList!.map((v) => v.toJson()).toList();
} }
return data; return data;
} }
@ -75,7 +74,7 @@ class InspectionCheckDetialModel {
switch (this.type) { switch (this.type) {
case 1: case 1:
return '巡检模式1'; return '巡检模式1';
default: default:
return '未知'; return '未知';
} }

@ -3,14 +3,19 @@ class InspectionPointModel {
String? name; String? name;
int? checkNum; int? checkNum;
String? completeDate; 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<String, dynamic> json) { InspectionPointModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
name = json['name']; name = json['name'];
checkNum = json['checkNum']; checkNum = json['checkNum'];
completeDate = json['completeDate']; completeDate = json['completeDate'];
longitude = json['longitude'];
latitude = json['latitude'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -19,6 +24,8 @@ class InspectionPointModel {
data['name'] = this.name; data['name'] = this.name;
data['checkNum'] = this.checkNum; data['checkNum'] = this.checkNum;
data['completeDate'] = this.completeDate; data['completeDate'] = this.completeDate;
data['longitude'] = this.longitude;
data['latitude'] = this.latitude;
return data; return data;
} }
} }

@ -3,10 +3,10 @@
class InspectionPointSubmitModel { class InspectionPointSubmitModel {
int executePointId; int executePointId;
List<ExecuteCheckList>? executeCheckList; List<ExecuteCheckList>? executeCheckList;
List<String?>? inspectionFaceImgPath; List<String?>? inspectionFaceImg;
List<String?>? inspectionSpaceImgPath; List<String?>? inspectionSpaceImg;
InspectionPointSubmitModel(this.executePointId, this.executeCheckList, InspectionPointSubmitModel(this.executePointId, this.executeCheckList,
{this.inspectionFaceImgPath, this.inspectionSpaceImgPath}); {this.inspectionFaceImg, this.inspectionSpaceImg});
Map<String, dynamic>? executeCheckListToJson() { Map<String, dynamic>? executeCheckListToJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
@ -22,14 +22,14 @@ class InspectionPointSubmitModel {
class ExecuteCheckList { class ExecuteCheckList {
int? id; int? id;
int status; int status;
String remarkes; String remakes;
ExecuteCheckList(this.id, this.status, this.remarkes); ExecuteCheckList(this.id, this.status, this.remakes);
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = { final Map<String, dynamic> data = {
"id": this.id, "id": this.id,
"status": this.status, "status": this.status,
"remakes": this.remarkes, "remakes": this.remakes,
}; };
return data; return data;
} }

@ -3,20 +3,20 @@ class InspectionQRCodeModel {
String? code; String? code;
String? name; String? name;
int? type; int? type;
List<CheckVoList>? checkVoList; List<CheckVoList>? checkList;
InspectionQRCodeModel( 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<String, dynamic> json) { InspectionQRCodeModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
code = json['code']; code = json['code'];
name = json['name']; name = json['name'];
type = json['type']; type = json['type'];
if (json['checkVoList'] != null) { if (json['checkList'] != null) {
checkVoList = <CheckVoList>[]; checkList = <CheckVoList>[];
json['checkVoList'].forEach((v) { 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['code'] = this.code;
data['name'] = this.name; data['name'] = this.name;
data['type'] = this.type; data['type'] = this.type;
if (this.checkVoList != null) { if (this.checkList != null) {
data['checkVoList'] = this.checkVoList!.map((v) => v.toJson()).toList(); data['checkList'] = this.checkList!.map((v) => v.toJson()).toList();
} }
return data; return data;
} }
@ -37,7 +37,7 @@ class InspectionQRCodeModel {
switch (this.type) { switch (this.type) {
case 1: case 1:
return '巡检模式1'; return '巡检模式1';
default: default:
return '未知'; return '未知';
} }

@ -1,8 +1,7 @@
// Dart imports: // Dart imports:
import 'dart:async'; import 'dart:async';
// Project imports: import 'package:aku_new_community_manager/const/saas_api.dart';
import 'package:aku_new_community_manager/const/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_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_point_model.dart';
import 'package:aku_new_community_manager/models/manager/inspection/inspection_qrcode_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 onPressed: _detailModel!.status == 1
? () async { ? () async {
BaseModel _baseModel = await NetUtil().get( BaseModel _baseModel = await NetUtil().get(
API.manage.inspectionStart, SAASAPI.inspection.startInspection,
params: {"executeId": widget.executeId}); params: {"executeId": widget.executeId});
if (_baseModel.success!) { if (_baseModel.success!) {
BotToast.showText(text: _baseModel.msg); BotToast.showText(text: _baseModel.msg);
@ -578,12 +577,12 @@ class _InspectionManageDetailsPageState
Future _uploadLocation( Future _uploadLocation(
int executeId, double longitude, double latitude) async { int executeId, double longitude, double latitude) async {
BaseModel baseModel = await NetUtil().post(API.manage.uploadLocation, BaseModel baseModel = await NetUtil()
params: { .post(SAASAPI.inspection.uploadLocation, params: {
"executeId": executeId, "executeId": executeId,
"longitude": longitude, "longitude": longitude,
"latitude": latitude "latitude": latitude
}); });
return baseModel; return baseModel;
} }
} }

@ -1,6 +1,6 @@
// Flutter imports: // Flutter imports:
// Project 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/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/manage_pages/inspection_manage/inspection_manage_card.dart';
import 'package:aku_new_community_manager/ui/widgets/common/bee_list_view.dart'; import 'package:aku_new_community_manager/ui/widgets/common/bee_list_view.dart';
@ -36,7 +36,7 @@ class _InspectionMangeViewState extends State<InspectionMangeView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeListView( return BeeListView(
path: API.manage.inspectionList, path: SAASAPI.inspection.list,
controller: _easyRefreshController, controller: _easyRefreshController,
extraParams: {"inspectionStatus": widget.inspectionStatus}, extraParams: {"inspectionStatus": widget.inspectionStatus},
convert: (models) { convert: (models) {

@ -80,9 +80,7 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
16.w.heightBox, 16.w.heightBox,
_inspectionHeadCard(_detialModel), _inspectionHeadCard(_detialModel),
16.w.heightBox, 16.w.heightBox,
..._detialModel.checkFBIVoList! ..._detialModel.checkList!.map((e) => _bodyCard(e)).toList(),
.map((e) => _bodyCard(e))
.toList(),
_selfPhotoCard(), _selfPhotoCard(),
_scenePhotoCard(), _scenePhotoCard(),
], ],
@ -124,7 +122,8 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
fit: BoxFit.fill, fit: BoxFit.fill,
placeholder: R.ASSETS_PLACEHOLDER_WEBP, placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(ImgModel.first(_detialModel.faceImg)!)), image:
API.image(ImgModel.first(_detialModel.faceImgList)!)),
) )
: DottedBorder( : DottedBorder(
borderType: BorderType.RRect, borderType: BorderType.RRect,
@ -176,7 +175,8 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
fit: BoxFit.fill, fit: BoxFit.fill,
placeholder: R.ASSETS_PLACEHOLDER_WEBP, placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(ImgModel.first(_detialModel.spaceImg)!)), image:
API.image(ImgModel.first(_detialModel.spaceImgList)!)),
) )
: DottedBorder( : DottedBorder(
borderType: BorderType.RRect, borderType: BorderType.RRect,

@ -63,9 +63,8 @@ class _InspectionPointInputPageState extends State<InspectionPointInputPage> {
[], [],
); );
_submitModel.executeCheckList = List.generate( _submitModel.executeCheckList = List.generate(
widget.qrModel!.checkVoList!.length, widget.qrModel!.checkList!.length,
(index) => (index) => ExecuteCheckList(widget.qrModel!.checkList![index].id, -1, ''),
ExecuteCheckList(widget.qrModel!.checkVoList![index].id, -1, ''),
); );
} }
@ -83,8 +82,8 @@ class _InspectionPointInputPageState extends State<InspectionPointInputPage> {
16.w.heightBox, 16.w.heightBox,
_inspectionHeadCard(), _inspectionHeadCard(),
16.w.heightBox, 16.w.heightBox,
..._model!.checkVoList! ..._model!.checkList!
.map((e) => _meterCard(e.name, _model!.checkVoList!.indexOf(e))) .map((e) => _meterCard(e.name, _model!.checkList!.indexOf(e)))
.toList(), .toList(),
_selfPhotoCard(), _selfPhotoCard(),
_scenePhotoCard(), _scenePhotoCard(),
@ -93,12 +92,11 @@ class _InspectionPointInputPageState extends State<InspectionPointInputPage> {
bottom: AkuButton( bottom: AkuButton(
onPressed: canSubmit onPressed: canSubmit
? () async { ? () async {
_submitModel.inspectionFaceImgPath = await NetUtil() _submitModel.inspectionFaceImg = await NetUtil()
.uploadFiles(_selfPhotos!, API.upload.uploadInspectionFace); .uploadFiles(_selfPhotos!, API.upload.uploadInspectionFace);
_submitModel.inspectionSpaceImgPath = await NetUtil() _submitModel.inspectionSpaceImg = await NetUtil().uploadFiles(
.uploadFiles( _scenePhots!, API.upload.uploadInspectionSpace);
_scenePhots!, API.upload.uploadInspectionSpace);
BaseModel baseModel = BaseModel baseModel =
await (ManageFunc.getSubmitPoint(_submitModel)); await (ManageFunc.getSubmitPoint(_submitModel));
if (baseModel.success!) { if (baseModel.success!) {
@ -247,7 +245,7 @@ class _InspectionPointInputPageState extends State<InspectionPointInputPage> {
maxLines: 10, maxLines: 10,
autofocus: false, autofocus: false,
onChanged: (value) { onChanged: (value) {
_submitModel.executeCheckList![index].remarkes = value; _submitModel.executeCheckList![index].remakes = value;
}, },
decoration: InputDecoration( decoration: InputDecoration(
hintText: '请输入备注信息', hintText: '请输入备注信息',

@ -4,6 +4,7 @@
// Project imports: // Project imports:
import 'package:aku_new_community_manager/const/api.dart'; 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/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_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_point_model.dart';
@ -36,7 +37,7 @@ class ManageFunc {
static Future<InspectionDetailModel> getInspectionDetail( static Future<InspectionDetailModel> getInspectionDetail(
int /*!*/ executeId) async { int /*!*/ executeId) async {
BaseModel baseModel = BaseModel baseModel =
await NetUtil().get(API.manage.inspectionFindDetailByld, params: { await NetUtil().get(SAASAPI.inspection.detail, params: {
"executeId": executeId, "executeId": executeId,
}); });
return InspectionDetailModel.fromJson(baseModel.data); return InspectionDetailModel.fromJson(baseModel.data);
@ -45,7 +46,7 @@ class ManageFunc {
static Future<List<InspectionPointModel>> getInspectionPointByPlanId( static Future<List<InspectionPointModel>> getInspectionPointByPlanId(
{required int planId}) async { {required int planId}) async {
BaseModel baseModel = BaseModel baseModel =
await NetUtil().get(API.manage.inspectionPointByPlanId, params: { await NetUtil().get(SAASAPI.inspection.findPointByPlanId, params: {
"planId": planId, "planId": planId,
}); });
return (baseModel.data as List) return (baseModel.data as List)
@ -55,8 +56,8 @@ class ManageFunc {
static Future<List<InspectionPointModel>> getInspectionPointByExcuteId( static Future<List<InspectionPointModel>> getInspectionPointByExcuteId(
{required int /*!*/ excuteId}) async { {required int /*!*/ excuteId}) async {
BaseModel baseModel = await NetUtil() BaseModel baseModel =
.get(API.manage.inspecntionFindPointByExecuteId, params: { await NetUtil().get(SAASAPI.inspection.findPointByExecuteId, params: {
"executeId": excuteId, "executeId": excuteId,
}); });
return (baseModel.data as List) return (baseModel.data as List)
@ -67,20 +68,20 @@ class ManageFunc {
static Future<BaseModel> getInspectionFindCheckDetailByQr( static Future<BaseModel> getInspectionFindCheckDetailByQr(
int executeId, String executePointCode) async { int executeId, String executePointCode) async {
BaseModel baseModel = await NetUtil().get( BaseModel baseModel = await NetUtil().get(
API.manage.inspectionFindCheckDetailByQR, SAASAPI.inspection.findCheckDetailByQR,
params: {"executeId": executeId, "executePointCode": executePointCode}); params: {"executeId": executeId, "executePointCode": executePointCode});
return baseModel; return baseModel;
} }
static Future getSubmitPoint(InspectionPointSubmitModel model) async { static Future getSubmitPoint(InspectionPointSubmitModel model) async {
BaseModel baseModel = BaseModel baseModel =
await NetUtil().post(API.manage.submitPointDetail, params: { await NetUtil().post(SAASAPI.inspection.submit, params: {
"executePointId": model.executePointId, "id": model.executePointId,
"executeCheckList": model.executeCheckList! "executeCheckList": model.executeCheckList!
.map((e) => ExecuteCheckList(e.id, e.status, e.remarkes).toJson()) .map((e) => ExecuteCheckList(e.id, e.status, e.remakes).toJson())
.toList(), .toList(),
"inspectionFaceImg": model.inspectionFaceImgPath, "inspectionFaceImg": model.inspectionFaceImg,
"inspectionSpaceImg": model.inspectionSpaceImgPath "inspectionSpaceImg": model.inspectionSpaceImg
}); });
return baseModel; return baseModel;
@ -88,15 +89,15 @@ class ManageFunc {
static Future getInspectionPointCheckDetail(int executePointId) async { static Future getInspectionPointCheckDetail(int executePointId) async {
BaseModel baseModel = BaseModel baseModel =
await NetUtil().get(API.manage.inspectionPointCheckDetail, params: { await NetUtil().get(SAASAPI.inspection.findExecutePointInfo, params: {
"executePointId": executePointId, "executePointId": executePointId,
}); });
return baseModel; return baseModel;
} }
static Future getInspectionPointCheckDetailUnbegin(int planPointId) async { static Future getInspectionPointCheckDetailUnbegin(int planPointId) async {
BaseModel baseModel = await NetUtil() BaseModel baseModel =
.get(API.manage.inspectionPointCheckDetailUnbegin, params: { await NetUtil().get(SAASAPI.inspection.findExecutePointInfo, params: {
"planPointId": planPointId, "planPointId": planPointId,
}); });
return baseModel; return baseModel;

Loading…
Cancel
Save