QinGang_interested/lib/http/modules/special_work_api.dart

253 lines
7.1 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import 'package:qhd_prevention/http/ApiService.dart';
import 'package:qhd_prevention/http/HttpManager.dart';
import 'package:qhd_prevention/pages/home/Tap/special_header.dart';
import 'package:qhd_prevention/tools/tools.dart';
// String basePath = 'http://192.168.198.8:30140';
String basePath = ApiService.basePath;
class SpecialWorkApi {
// 获取作业步骤
static Future<Map<String, dynamic>> getSpecialWorkStepList(String workType) {
return HttpManager().request(
basePath + '/eightwork',
'/taskFlow/getFlowByWorkType/$workType',
method: Method.get,
data: {
}
);
}
/// 特殊作业初始化
static Future<Map<String, dynamic>> specialWorkInit(String gateway) {
return HttpManager().request(
basePath + '/eightwork',
'/taskFlow/getWorkInit',
method: Method.post,
data: {
'workType': gateway,
},
);
}
// 特殊作业级别
static Future<Map<String, dynamic>> specialWorkLevelList(String workType) {
return HttpManager().request(
basePath + '/eightwork',
'/eightworkTask/listByWorkType',
method: Method.post,
data: {
'workType': workType,
},
);
}
/// 特殊作业新增
static Future<Map<String, dynamic>> specialWorkSave(Map data, SpecialWorkTypeEnum type) {
final info = data['info'];
printLongString('未处理前的info----$info');
// info中有很多不需要的数据根据不同作业提交模版列表删除不需要的数据
List<String> ruleList = SpecialListInitData().getInitData(type);
info.removeWhere((key, value) {
return !ruleList.contains(key) && !key.contains('skip');
});
printLongString('处理后的info----$info');
printLongString('-----------------');
printLongString('-----------------');
return HttpManager().request(
basePath + '/eightwork',
'/taskLog/save',
method: Method.post,
data: {...data},
);
}
// 特殊作业暂存
static Future<Map<String, dynamic>> specialWorkSaveTemp(Map data, SpecialWorkTypeEnum type) {
final info = data['info'];
// info中有很多不需要的数据根据不同作业提交模版列表删除不需要的数据
List<String> ruleList = SpecialListInitData().getInitData(type);
info.removeWhere((key, value) {
return !ruleList.contains(key) && !key.contains('skip');
});
return HttpManager().request(
basePath + '/eightwork',
'/taskLog/saveDraft',
method: Method.post,
data: {...data},
);
}
/// 初始化流程
static Future<Map<String, dynamic>> specialWorkFlowInit(Map data) {
return HttpManager().request(
basePath + '/eightwork',
'/taskFlow/getFlowInit',
method: Method.post,
data: {...data},
);
}
/// 代办列表
static Future<Map<String, dynamic>> specialWorkTaskLogList(Map data) {
return HttpManager().request(
basePath + '/eightwork',
'/taskLog/list',
method: Method.post,
data: {...data},
);
}
// 台账
static Future<Map<String, dynamic>> specialWorkList(Map data) {
return HttpManager().request(
basePath + '/eightwork',
'/eightworkInfo/list',
method: Method.post,
data: {...data},
);
}
/// 获取流程详情
static Future<Map<String, dynamic>> specialWorkTaskLogDetail(String id) {
return HttpManager().request(
basePath + '/eightwork',
'/taskLog/$id',
method: Method.get,
data: {},
);
}
/// 获取台账详情
static Future<Map<String, dynamic>> specialWorkDetail(String id) {
return HttpManager().request(
basePath + '/eightwork',
'/eightworkInfo/$id',
method: Method.get,
data: {},
);
}
/// 获取安全措施列表
static Future<Map<String, dynamic>> specialWorkMeasureList(String eqWorkType) {
return HttpManager().request(
basePath + '/eightwork',
'/measures/listAll',
method: Method.post,
data: {'eqWorkType': eqWorkType},
);
}
/// 安全措施签字步骤 获取安全措施列表
static Future<Map<String, dynamic>> specialWorkSignMeasureList(Map data) {
return HttpManager().request(
basePath + '/eightwork',
'/measuresLogs/list',
method: Method.post,
data: {...data},
);
}
/// 特殊作业下一步taskLog/nextStep
static Future<Map<String, dynamic>> specialWorkNextStep(Map data) {
return HttpManager().request(
basePath + '/eightwork',
'/taskLog/nextStep',
method: Method.post,
data: {...data},
);
}
/// 查看流程图
static Future<Map<String, dynamic>> specialWorkFlowList(String workId) {
return HttpManager().request(
basePath + '/eightwork',
'/taskLog/flowChart/$workId',
method: Method.get,
data: {},
);
}
/// 获取作业安全措施详情
static Future<Map<String, dynamic>> specialWorkMeasureDetail(String workId) {
return HttpManager().request(
basePath + '/eightwork',
'/measuresLogs/listAll/$workId',
method: Method.get,
data: {},
);
}
// 获取各个作业内待办数
static Future<Map<String, dynamic>> specialWorkTaskLogCount(String eqWorkType) {
return HttpManager().request(
basePath + '/eightwork',
'/taskLog/getTodoCountForWork/$eqWorkType',
method: Method.get,
data: {},
);
}
// 获取特殊作业总待办数
static Future<Map<String, dynamic>> specialWorkTaskLogTotalCount() {
return HttpManager().request(
basePath + '/eightwork',
'/taskLog/getTodoCount',
method: Method.get,
data: {},
);
}
// 气体分析、延时监火列表
static Future<Map<String, dynamic>> specialWorkGasFireList(Map data) {
return HttpManager().request(
basePath + '/eightwork',
'/eightworkSupplementaryInfo/list',
method: Method.post,
data: {
...data
},
);
}
// 有限空间台账表
static Future<Map<String, dynamic>> specialWorkLimitedSpaceList(Map data) {
return HttpManager().request(
basePath + '/eightwork',
'/confinedSpace/list',
method: Method.post,
data: {
...data
},
);
}
// 有限空间台账新增
static Future<Map<String, dynamic>> specialWorkLimitedSpaceSave(Map data) {
return HttpManager().request(
basePath + '/eightwork',
'/confinedSpace/save',
method: Method.post,
data: {
...data
},
);
}
// 有限空间台账详情
static Future<Map<String, dynamic>> specialWorkLimitedSpaceDetail(String id) {
return HttpManager().request(
basePath + '/eightwork',
'/confinedSpace/$id',
method: Method.get,
data: {},
);
}
// 删除作业票
static Future<Map<String, dynamic>> specialWorkDelete(String id) {
return HttpManager().request(
basePath + '/eightwork',
'/eightworkInfo/$id',
method: Method.delete,
data: {},
);
}
// 撤回作业票
static Future<Map<String, dynamic>> specialWorkWithdraw(String id) {
return HttpManager().request(
basePath + '/eightwork',
'/eightworkInfo/withdraw',
method: Method.post,
data: {
'id': id
},
);
}
}