QinGang_interested/lib/http/modules/special_work_api.dart

253 lines
7.1 KiB
Dart
Raw Normal View History

2025-12-12 09:11:30 +08:00
import 'package:qhd_prevention/http/ApiService.dart';
import 'package:qhd_prevention/http/HttpManager.dart';
2026-04-08 15:03:56 +08:00
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;
2025-12-12 09:11:30 +08:00
class SpecialWorkApi {
2026-04-08 15:03:56 +08:00
// 获取作业步骤
static Future<Map<String, dynamic>> getSpecialWorkStepList(String workType) {
return HttpManager().request(
basePath + '/eightwork',
'/taskFlow/getFlowByWorkType/$workType',
method: Method.get,
data: {
}
);
}
2025-12-12 09:11:30 +08:00
/// 特殊作业初始化
static Future<Map<String, dynamic>> specialWorkInit(String gateway) {
return HttpManager().request(
2026-04-08 15:03:56 +08:00
basePath + '/eightwork',
'/taskFlow/getWorkInit',
2025-12-12 09:11:30 +08:00
method: Method.post,
data: {
'workType': gateway,
},
);
}
2026-04-08 15:03:56 +08:00
// 特殊作业级别
static Future<Map<String, dynamic>> specialWorkLevelList(String workType) {
return HttpManager().request(
basePath + '/eightwork',
'/eightworkTask/listByWorkType',
method: Method.post,
data: {
'workType': workType,
},
);
}
2025-12-12 09:11:30 +08:00
/// 特殊作业新增
2026-04-08 15:03:56 +08:00
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);
});
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);
});
2025-12-12 09:11:30 +08:00
return HttpManager().request(
2026-04-08 15:03:56 +08:00
basePath + '/eightwork',
'/taskLog/saveDraft',
2025-12-12 09:11:30 +08:00
method: Method.post,
data: {...data},
);
}
/// 初始化流程
static Future<Map<String, dynamic>> specialWorkFlowInit(Map data) {
return HttpManager().request(
2026-04-08 15:03:56 +08:00
basePath + '/eightwork',
'/taskFlow/getFlowInit',
2025-12-12 09:11:30 +08:00
method: Method.post,
data: {...data},
);
}
/// 代办列表
static Future<Map<String, dynamic>> specialWorkTaskLogList(Map data) {
return HttpManager().request(
2026-04-08 15:03:56 +08:00
basePath + '/eightwork',
'/taskLog/list',
2025-12-12 09:11:30 +08:00
method: Method.post,
data: {...data},
);
}
2026-04-08 15:03:56 +08:00
// 台账
static Future<Map<String, dynamic>> specialWorkList(Map data) {
return HttpManager().request(
basePath + '/eightwork',
'/eightworkInfo/list',
method: Method.post,
data: {...data},
);
}
/// 获取流程详情
2025-12-12 09:11:30 +08:00
static Future<Map<String, dynamic>> specialWorkTaskLogDetail(String id) {
return HttpManager().request(
2026-04-08 15:03:56 +08:00
basePath + '/eightwork',
'/taskLog/$id',
method: Method.get,
data: {},
);
}
/// 获取台账详情
static Future<Map<String, dynamic>> specialWorkDetail(String id) {
return HttpManager().request(
basePath + '/eightwork',
'/eightworkInfo/$id',
2025-12-12 09:11:30 +08:00
method: Method.get,
data: {},
);
}
/// 获取安全措施列表
static Future<Map<String, dynamic>> specialWorkMeasureList(String eqWorkType) {
return HttpManager().request(
2026-04-08 15:03:56 +08:00
basePath + '/eightwork',
'/measures/listAll',
2025-12-12 09:11:30 +08:00
method: Method.post,
data: {'eqWorkType': eqWorkType},
);
}
2026-04-08 15:03:56 +08:00
/// 安全措施签字步骤 获取安全措施列表
static Future<Map<String, dynamic>> specialWorkSignMeasureList(Map data) {
return HttpManager().request(
basePath + '/eightwork',
'/measuresLogs/list',
method: Method.post,
data: {...data},
);
}
2025-12-12 09:11:30 +08:00
/// 特殊作业下一步taskLog/nextStep
static Future<Map<String, dynamic>> specialWorkNextStep(Map data) {
return HttpManager().request(
2026-04-08 15:03:56 +08:00
basePath + '/eightwork',
'/taskLog/nextStep',
2025-12-12 09:11:30 +08:00
method: Method.post,
data: {...data},
);
}
/// 查看流程图
static Future<Map<String, dynamic>> specialWorkFlowList(String workId) {
return HttpManager().request(
2026-04-08 15:03:56 +08:00
basePath + '/eightwork',
'/taskLog/listAll/$workId',
2025-12-12 09:11:30 +08:00
method: Method.get,
data: {},
);
}
/// 获取作业安全措施详情
static Future<Map<String, dynamic>> specialWorkMeasureDetail(String workId) {
return HttpManager().request(
2026-04-08 15:03:56 +08:00
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',
2025-12-12 09:11:30 +08:00
method: Method.get,
data: {},
);
}
2026-04-08 15:03:56 +08:00
// 获取特殊作业总待办数
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
},
);
}
2025-12-12 09:11:30 +08:00
}