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