对接巡检管理

master
张萌 3 years ago
parent ad17ad1593
commit 87cc037d52

@ -8,9 +8,9 @@ class InspectionCheckDetialModel {
String? name;
int? type;
String? completeDate;
List<CheckFBIVoList>? checkFBIVoList;
List<ImgModel>? faceImg;
List<ImgModel>? spaceImg;
List<CheckFBIVoList>? checkList;
List<ImgModel>? faceImgList;
List<ImgModel>? 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<String, dynamic> json) {
id = json['id'];
@ -30,22 +30,22 @@ class InspectionCheckDetialModel {
name = json['name'];
type = json['type'];
completeDate = json['completeDate'];
if (json['checkFBIVoList'] != null) {
checkFBIVoList = <CheckFBIVoList>[];
json['checkFBIVoList'].forEach((v) {
checkFBIVoList!.add(new CheckFBIVoList.fromJson(v));
if (json['checkList'] != null) {
checkList = <CheckFBIVoList>[];
json['checkList'].forEach((v) {
checkList!.add(new CheckFBIVoList.fromJson(v));
});
}
if (json['faceImg'] != null) {
faceImg = <ImgModel>[];
json['faceImg'].forEach((v) {
faceImg!.add(new ImgModel.fromJson(v));
if (json['faceImgList'] != null) {
faceImgList = <ImgModel>[];
json['faceImgList'].forEach((v) {
faceImgList!.add(new ImgModel.fromJson(v));
});
}
if (json['spaceImg'] != null) {
spaceImg = <ImgModel>[];
json['spaceImg'].forEach((v) {
spaceImg!.add(new ImgModel.fromJson(v));
if (json['spaceImgList'] != null) {
spaceImgList = <ImgModel>[];
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;
}

@ -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<String, dynamic> json) {
id = json['id'];
name = json['name'];
checkNum = json['checkNum'];
completeDate = json['completeDate'];
longitude = json['longitude'];
latitude = json['latitude'];
}
Map<String, dynamic> 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;
}
}

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

@ -3,20 +3,20 @@ class InspectionQRCodeModel {
String? code;
String? name;
int? type;
List<CheckVoList>? checkVoList;
List<CheckVoList>? 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<String, dynamic> json) {
id = json['id'];
code = json['code'];
name = json['name'];
type = json['type'];
if (json['checkVoList'] != null) {
checkVoList = <CheckVoList>[];
if (json['checkList'] != null) {
checkList = <CheckVoList>[];
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;
}

@ -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,8 +577,8 @@ class _InspectionManageDetailsPageState
Future _uploadLocation(
int executeId, double longitude, double latitude) async {
BaseModel baseModel = await NetUtil().post(API.manage.uploadLocation,
params: {
BaseModel baseModel = await NetUtil()
.post(SAASAPI.inspection.uploadLocation, params: {
"executeId": executeId,
"longitude": longitude,
"latitude": latitude

@ -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<InspectionMangeView> {
@override
Widget build(BuildContext context) {
return BeeListView(
path: API.manage.inspectionList,
path: SAASAPI.inspection.list,
controller: _easyRefreshController,
extraParams: {"inspectionStatus": widget.inspectionStatus},
convert: (models) {

@ -80,9 +80,7 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
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<InspectionPointDetailPage> {
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<InspectionPointDetailPage> {
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,

@ -63,9 +63,8 @@ class _InspectionPointInputPageState extends State<InspectionPointInputPage> {
[],
);
_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<InspectionPointInputPage> {
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,11 +92,10 @@ class _InspectionPointInputPageState extends State<InspectionPointInputPage> {
bottom: AkuButton(
onPressed: canSubmit
? () async {
_submitModel.inspectionFaceImgPath = await NetUtil()
_submitModel.inspectionFaceImg = await NetUtil()
.uploadFiles(_selfPhotos!, API.upload.uploadInspectionFace);
_submitModel.inspectionSpaceImgPath = await NetUtil()
.uploadFiles(
_submitModel.inspectionSpaceImg = await NetUtil().uploadFiles(
_scenePhots!, API.upload.uploadInspectionSpace);
BaseModel baseModel =
await (ManageFunc.getSubmitPoint(_submitModel));
@ -247,7 +245,7 @@ class _InspectionPointInputPageState extends State<InspectionPointInputPage> {
maxLines: 10,
autofocus: false,
onChanged: (value) {
_submitModel.executeCheckList![index].remarkes = value;
_submitModel.executeCheckList![index].remakes = value;
},
decoration: InputDecoration(
hintText: '请输入备注信息',

@ -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<InspectionDetailModel> 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<List<InspectionPointModel>> 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<List<InspectionPointModel>> 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<BaseModel> 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;

Loading…
Cancel
Save