job_sg_repository.dart 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  1. import 'dart:typed_data';
  2. import 'package:domain/entity/response/job_applied_index_s_g_entity.dart';
  3. import 'package:domain/entity/response/job_applied_list_s_g_entity.dart';
  4. import 'package:domain/entity/response/job_list_add_staff_entity.dart';
  5. import 'package:domain/entity/response/job_list_applied_edit_entity.dart';
  6. import 'package:domain/entity/response/job_list_applied_info_entity.dart';
  7. import 'package:domain/entity/response/job_list_applied_staff_list_entity.dart';
  8. import 'package:domain/entity/response/job_list_applied_staff_search_entity.dart';
  9. import 'package:domain/entity/response/job_list_detail_entity.dart';
  10. import 'package:domain/entity/response/job_list_entity.dart';
  11. import 'package:domain/entity/response/job_list_index_entity.dart';
  12. import 'package:domain/entity/response/job_list_remark_view_entity.dart';
  13. import 'package:domain/entity/response/revise_list_s_g_entity.dart';
  14. import 'package:domain/entity/response/revise_log_s_g_entity.dart';
  15. import 'package:domain/entity/response/staff_detail_entity.dart';
  16. import 'package:domain/entity/response/staff_detail_s_g_entity.dart';
  17. import 'package:domain/entity/response/staff_labour_history_entity.dart';
  18. import 'package:domain/entity/response/staff_remark_history_entity.dart';
  19. import 'package:domain/entity/response/staff_review_history_s_g_entity.dart';
  20. import 'package:get/get.dart';
  21. import 'package:plugin_platform/dio_export.dart';
  22. import 'package:plugin_platform/http/http_provider.dart';
  23. import 'package:plugin_platform/http/http_result.dart';
  24. import 'package:shared/utils/util.dart';
  25. import '../constants/api_constants.dart';
  26. import '../entity/response/add_edit_revise_view_s_g_entity.dart';
  27. import '../entity/response/attendance_entity.dart';
  28. import '../entity/response/check_success_entity.dart';
  29. import '../entity/response/job_applied_edit_index_s_g_entity.dart';
  30. import '../entity/response/job_applied_remark_view_s_g_entity.dart';
  31. import '../entity/response/job_applied_staff_s_g_entity.dart';
  32. import '../entity/response/job_list_applied_work_flow_entity.dart';
  33. import '../entity/response/revise_index_s_g_entity.dart';
  34. import '../entity/response/staff_job_history_s_g_entity.dart';
  35. /// 工作相关(新加坡)
  36. class JobSGRepository extends GetxService {
  37. HttpProvider httpProvider;
  38. JobSGRepository({required this.httpProvider});
  39. /// 获取工作已申请的选项
  40. Future<HttpResult<JobAppliedIndexSGEntity>> fetchJobAppliedIndex(
  41. String? jobId, {
  42. CancelToken? cancelToken,
  43. }) async {
  44. //参数
  45. Map<String, String> params = {};
  46. params["job_id"] = jobId ?? "";
  47. final result = await httpProvider.requestNetResult(
  48. ApiConstants.apiJobAppliedIndexSG,
  49. params: params,
  50. cancelToken: cancelToken,
  51. );
  52. //根据返回的结果,封装原始数据为Bean/Entity对象
  53. if (result.isSuccess) {
  54. //重新赋值data或list
  55. final json = result.getDataJson();
  56. var data = JobAppliedIndexSGEntity.fromJson(json!);
  57. //重新赋值data或list
  58. return result.convert<JobAppliedIndexSGEntity>(data: data);
  59. }
  60. return result.convert();
  61. }
  62. /// 获取工作已申请的列表
  63. Future<HttpResult<JobAppliedListSGEntity>> fetchJobAppliedList(
  64. String? jobId,
  65. String? status,
  66. String? keyword, {
  67. required int curPage,
  68. CancelToken? cancelToken,
  69. }) async {
  70. //参数
  71. Map<String, String> params = {};
  72. params["cur_page"] = curPage.toString();
  73. params["page_size"] = "10";
  74. params["job_id"] = jobId ?? "";
  75. if (!Utils.isEmpty(keyword)) {
  76. params["keyword"] = keyword!;
  77. }
  78. if (!Utils.isEmpty(status)) {
  79. params["status"] = status!;
  80. }
  81. final result = await httpProvider.requestNetResult(
  82. ApiConstants.apiJobAppliedListSG,
  83. params: params,
  84. cancelToken: cancelToken,
  85. );
  86. //根据返回的结果,封装原始数据为Bean/Entity对象
  87. if (result.isSuccess) {
  88. //重新赋值data或list
  89. final json = result.getDataJson();
  90. var data = JobAppliedListSGEntity.fromJson(json!);
  91. //重新赋值data或list
  92. return result.convert<JobAppliedListSGEntity>(data: data);
  93. }
  94. return result.convert();
  95. }
  96. /// 根据ID获取主列表的Item数据,用于刷新Item
  97. Future<HttpResult<JobAppliedListSGEntity>> fetchItemByAppliedIds(
  98. String? jobId,
  99. String? appliedIds, {
  100. CancelToken? cancelToken,
  101. }) async {
  102. //参数
  103. Map<String, String> params = {};
  104. params["cur_page"] = "1";
  105. params["page_size"] = "9999";
  106. if (!Utils.isEmpty(appliedIds)) {
  107. params["applied_ids"] = appliedIds!;
  108. }
  109. if (!Utils.isEmpty(jobId)) {
  110. params["job_id"] = jobId!;
  111. }
  112. final result = await httpProvider.requestNetResult(
  113. ApiConstants.apiJobAppliedListSG,
  114. params: params,
  115. isShowLoadingDialog: true,
  116. cancelToken: cancelToken,
  117. );
  118. //根据返回的结果,封装原始数据为Bean/Entity对象
  119. if (result.isSuccess) {
  120. //重新赋值data或list
  121. final json = result.getDataJson();
  122. var data = JobAppliedListSGEntity.fromJson(json!);
  123. //重新赋值data或list
  124. return result.convert<JobAppliedListSGEntity>(data: data);
  125. }
  126. return result.convert();
  127. }
  128. /// 获取工作已申请的列表中添加的员工搜索
  129. Future<HttpResult<JobAppliedStaffSGEntity>> searchJobAppliedStaff(
  130. String? jobId,
  131. String? keyword, {
  132. required int curPage,
  133. CancelToken? cancelToken,
  134. }) async {
  135. //参数
  136. Map<String, String> params = {};
  137. params["cur_page"] = curPage.toString();
  138. params["page_size"] = "20";
  139. params["job_id"] = jobId ?? "";
  140. if (!Utils.isEmpty(keyword)) {
  141. params["keyword"] = keyword!;
  142. }
  143. final result = await httpProvider.requestNetResult(
  144. ApiConstants.apiJobAppliedSearchStaffSG,
  145. params: params,
  146. cancelToken: cancelToken,
  147. );
  148. //根据返回的结果,封装原始数据为Bean/Entity对象
  149. if (result.isSuccess) {
  150. //重新赋值data或list
  151. final json = result.getDataJson();
  152. var data = JobAppliedStaffSGEntity.fromJson(json!);
  153. //重新赋值data或list
  154. return result.convert<JobAppliedStaffSGEntity>(data: data);
  155. }
  156. return result.convert();
  157. }
  158. /// 添加员工到申请列表
  159. Future<HttpResult> addStaff2AppliedJob(
  160. String? jobId,
  161. String? staffIds, {
  162. CancelToken? cancelToken,
  163. }) async {
  164. //参数
  165. Map<String, String> params = {};
  166. params['job_id'] = jobId ?? "";
  167. params['staff_ids'] = staffIds ?? "";
  168. final result = await httpProvider.requestNetResult(
  169. ApiConstants.apiJobAppliedAddStaffSubmitSG,
  170. method: HttpMethod.POST,
  171. params: params,
  172. networkDebounce: true,
  173. isShowLoadingDialog: true,
  174. cancelToken: cancelToken,
  175. );
  176. //根据返回的结果,封装原始数据为Bean/Entity对象
  177. if (result.isSuccess) {
  178. //重新赋值data或list
  179. return result.convert();
  180. }
  181. return result.convert();
  182. }
  183. /// 批量修改员工信息或考勤
  184. Future<HttpResult> batchEditJobApplied(
  185. String? jobId,
  186. String? appliedIds,
  187. String? startTime,
  188. String? endTime,
  189. String? subtractHours,
  190. String? status, {
  191. CancelToken? cancelToken,
  192. }) async {
  193. //参数
  194. Map<String, String> params = {};
  195. params['applied_ids'] = appliedIds ?? "";
  196. params['job_id'] = jobId ?? "";
  197. if (!Utils.isEmpty(startTime)) {
  198. params['start_time'] = startTime ?? "";
  199. }
  200. if (!Utils.isEmpty(endTime)) {
  201. params['end_time'] = endTime ?? "";
  202. }
  203. if (!Utils.isEmpty(subtractHours)) {
  204. params['subtract_hours'] = subtractHours ?? "";
  205. }
  206. if (!Utils.isEmpty(status)) {
  207. params['status'] = status ?? "";
  208. }
  209. final result = await httpProvider.requestNetResult(
  210. ApiConstants.apiJobAppliedBatchEditSG,
  211. method: HttpMethod.POST,
  212. params: params,
  213. networkDebounce: true,
  214. isShowLoadingDialog: true,
  215. cancelToken: cancelToken,
  216. );
  217. //根据返回的结果,封装原始数据为Bean/Entity对象
  218. if (result.isSuccess) {
  219. //重新赋值data或list
  220. return result.convert();
  221. }
  222. return result.convert();
  223. }
  224. /// 编辑员工信息或考勤的选项详情
  225. Future<HttpResult<JobAppliedEditIndexSGEntity>> fetchEditJobAppliedIndex(
  226. String? appliedId, {
  227. CancelToken? cancelToken,
  228. }) async {
  229. //参数
  230. Map<String, String> params = {};
  231. params['applied_id'] = appliedId ?? "";
  232. final result = await httpProvider.requestNetResult(
  233. ApiConstants.apiJobAppliedEditViewSG,
  234. params: params,
  235. isShowLoadingDialog: true,
  236. cancelToken: cancelToken,
  237. );
  238. //根据返回的结果,封装原始数据为Bean/Entity对象
  239. if (result.isSuccess) {
  240. //重新赋值data或list
  241. final json = result.getDataJson();
  242. var data = JobAppliedEditIndexSGEntity.fromJson(json!);
  243. //重新赋值data或list
  244. return result.convert<JobAppliedEditIndexSGEntity>(data: data);
  245. }
  246. return result.convert();
  247. }
  248. /// 编辑员工信息或考勤的提交
  249. Future<HttpResult> submitEditJobApplied(
  250. String? appliedId,
  251. String? startTime,
  252. String? endTime,
  253. String? security_in,
  254. String? security_out,
  255. String? work_in,
  256. String? work_out,
  257. String? adjustHours,
  258. String? status, {
  259. CancelToken? cancelToken,
  260. }) async {
  261. //参数
  262. Map<String, String> params = {};
  263. params['applied_id'] = appliedId ?? "";
  264. params['start_time'] = startTime ?? "";
  265. params['end_time'] = endTime ?? "";
  266. if (!Utils.isEmpty(security_in)) {
  267. params['security_in'] = security_in ?? "";
  268. }
  269. if (!Utils.isEmpty(security_out)) {
  270. params['security_out'] = security_out ?? "";
  271. }
  272. if (!Utils.isEmpty(work_in)) {
  273. params['work_in'] = work_in ?? "";
  274. }
  275. if (!Utils.isEmpty(work_out)) {
  276. params['work_out'] = work_out ?? "";
  277. }
  278. if (!Utils.isEmpty(adjustHours)) {
  279. params['adjust_hours'] = adjustHours ?? "";
  280. }
  281. if (!Utils.isEmpty(status)) {
  282. params['status'] = status ?? "";
  283. }
  284. final result = await httpProvider.requestNetResult(
  285. ApiConstants.apiJobAppliedEditSubmitSG,
  286. method: HttpMethod.POST,
  287. params: params,
  288. networkDebounce: true,
  289. isShowLoadingDialog: true,
  290. cancelToken: cancelToken,
  291. );
  292. //根据返回的结果,封装原始数据为Bean/Entity对象
  293. if (result.isSuccess) {
  294. //重新赋值data或list
  295. return result.convert();
  296. }
  297. return result.convert();
  298. }
  299. /// 修改考勤员工的考勤状态
  300. Future<HttpResult> submitEditAppliedStatus(
  301. String? appliedId,
  302. String? status, {
  303. CancelToken? cancelToken,
  304. }) async {
  305. //参数
  306. Map<String, String> params = {};
  307. params['applied_id'] = appliedId ?? "";
  308. params['status'] = status ?? "";
  309. final result = await httpProvider.requestNetResult(
  310. ApiConstants.apiJobAppliedChangeStatusSG,
  311. method: HttpMethod.POST,
  312. params: params,
  313. networkDebounce: true,
  314. isShowLoadingDialog: true,
  315. cancelToken: cancelToken,
  316. );
  317. //根据返回的结果,封装原始数据为Bean/Entity对象
  318. if (result.isSuccess) {
  319. //重新赋值data或list
  320. return result.convert();
  321. }
  322. return result.convert();
  323. }
  324. /// 获取员工的评价信息
  325. Future<HttpResult<JobAppliedRemarkViewSGEntity>> fetchJobAppliedRemarkView(
  326. String? appliedId, {
  327. CancelToken? cancelToken,
  328. }) async {
  329. //参数
  330. Map<String, String> params = {};
  331. params['applied_id'] = appliedId ?? "";
  332. final result = await httpProvider.requestNetResult(
  333. ApiConstants.apiJobAppliedRemarkViewSG,
  334. params: params,
  335. isShowLoadingDialog: true,
  336. cancelToken: cancelToken,
  337. );
  338. //根据返回的结果,封装原始数据为Bean/Entity对象
  339. if (result.isSuccess) {
  340. //重新赋值data或list
  341. final json = result.getDataJson();
  342. var data = JobAppliedRemarkViewSGEntity.fromJson(json!);
  343. //重新赋值data或list
  344. return result.convert<JobAppliedRemarkViewSGEntity>(data: data);
  345. }
  346. return result.convert();
  347. }
  348. /// 提交员工的评价
  349. Future<HttpResult> submitAppliedRemark(
  350. String? appliedId,
  351. String? attitude_rate,
  352. String? grooming_rate,
  353. String? performance_rate,
  354. String? experience_rate,
  355. String? feedback, {
  356. CancelToken? cancelToken,
  357. }) async {
  358. //参数
  359. Map<String, String> params = {};
  360. params['applied_id'] = appliedId ?? "";
  361. params['attitude_rate'] = (double.parse(attitude_rate ?? "5.0")).toInt().toString();
  362. params['grooming_rate'] = (double.parse(grooming_rate ?? "5.0")).toInt().toString();
  363. params['performance_rate'] = (double.parse(performance_rate ?? "5.0")).toInt().toString();
  364. params['experience_rate'] = (double.parse(experience_rate ?? "5.0")).toInt().toString();
  365. if (!Utils.isEmpty(feedback)) {
  366. params['feedback'] = feedback ?? "";
  367. }
  368. final result = await httpProvider.requestNetResult(
  369. ApiConstants.apiJobAppliedRemarkSubmitSG,
  370. method: HttpMethod.POST,
  371. params: params,
  372. networkDebounce: true,
  373. isShowLoadingDialog: true,
  374. cancelToken: cancelToken,
  375. );
  376. //根据返回的结果,封装原始数据为Bean/Entity对象
  377. if (result.isSuccess) {
  378. //重新赋值data或list
  379. return result.convert();
  380. }
  381. return result.convert();
  382. }
  383. /// 获取员工的详细信息
  384. Future<HttpResult<StaffDetailSGEntity>> fetchStaffDetail(
  385. String? memberId, {
  386. CancelToken? cancelToken,
  387. }) async {
  388. //参数
  389. Map<String, String> params = {};
  390. params['member_id'] = memberId ?? "";
  391. final result = await httpProvider.requestNetResult(
  392. ApiConstants.apiJobListStaffDetailSG,
  393. params: params,
  394. );
  395. //根据返回的结果,封装原始数据为Bean/Entity对象
  396. if (result.isSuccess) {
  397. //重新赋值data或list
  398. final json = result.getDataJson();
  399. var data = StaffDetailSGEntity.fromJson(json!);
  400. //重新赋值data或list
  401. return result.convert<StaffDetailSGEntity>(data: data);
  402. }
  403. return result.convert();
  404. }
  405. /// 获取员工的做工历史列表
  406. Future<HttpResult<StaffJobHistorySGEntity>> fetchStaffJobHistory(
  407. String? memberId, {
  408. required int curPage,
  409. CancelToken? cancelToken,
  410. }) async {
  411. //参数
  412. Map<String, String> params = {};
  413. params['member_id'] = memberId ?? "";
  414. params['cur_page'] = curPage.toString();
  415. params['page_size'] = "10";
  416. final result = await httpProvider.requestNetResult(
  417. ApiConstants.apiJobListStaffLabourHistorySG,
  418. params: params,
  419. );
  420. //根据返回的结果,封装原始数据为Bean/Entity对象
  421. if (result.isSuccess) {
  422. //重新赋值data或list
  423. final json = result.getDataJson();
  424. var data = StaffJobHistorySGEntity.fromJson(json!);
  425. //重新赋值data或list
  426. return result.convert<StaffJobHistorySGEntity>(data: data);
  427. }
  428. return result.convert();
  429. }
  430. /// 获取员工的做工评价历史列表
  431. Future<HttpResult<StaffReviewHistorySGEntity>> fetchStaffReviewHeadView(
  432. String? memberId, {
  433. CancelToken? cancelToken,
  434. }) async {
  435. //参数
  436. Map<String, String> params = {};
  437. params['member_id'] = memberId ?? "";
  438. final result = await httpProvider.requestNetResult(
  439. ApiConstants.apiJobListStaffReviewHeadSG,
  440. params: params,
  441. );
  442. //根据返回的结果,封装原始数据为Bean/Entity对象
  443. if (result.isSuccess) {
  444. //重新赋值data或list
  445. final json = result.getDataJson();
  446. var data = StaffReviewHistorySGEntity.fromJson(json!);
  447. //重新赋值data或list
  448. return result.convert<StaffReviewHistorySGEntity>(data: data);
  449. }
  450. return result.convert();
  451. }
  452. /// 获取员工的做工评价历史列表
  453. Future<HttpResult<StaffReviewHistorySGEntity>> fetchStaffReviewHistory(
  454. String? memberId, {
  455. required int curPage,
  456. CancelToken? cancelToken,
  457. }) async {
  458. //参数
  459. Map<String, String> params = {};
  460. params['cur_page'] = curPage.toString();
  461. params['page_size'] = "10";
  462. params['member_id'] = memberId ?? "";
  463. final result = await httpProvider.requestNetResult(
  464. ApiConstants.apiJobListStaffReViewHistorySG,
  465. params: params,
  466. );
  467. //根据返回的结果,封装原始数据为Bean/Entity对象
  468. if (result.isSuccess) {
  469. //重新赋值data或list
  470. final json = result.getDataJson();
  471. var data = StaffReviewHistorySGEntity.fromJson(json!);
  472. //重新赋值data或list
  473. return result.convert<StaffReviewHistorySGEntity>(data: data);
  474. }
  475. return result.convert();
  476. }
  477. /// Revise 列表选项
  478. Future<HttpResult<ReviseIndexSGEntity>> fetchReviseIndex({
  479. CancelToken? cancelToken,
  480. }) async {
  481. final result = await httpProvider.requestNetResult(
  482. ApiConstants.apiReviseIndexSG,
  483. cancelToken: cancelToken,
  484. );
  485. //根据返回的结果,封装原始数据为Bean/Entity对象
  486. if (result.isSuccess) {
  487. //重新赋值data或list
  488. final json = result.getDataJson();
  489. var data = ReviseIndexSGEntity.fromJson(json!);
  490. //重新赋值data或list
  491. return result.convert<ReviseIndexSGEntity>(data: data);
  492. }
  493. return result.convert();
  494. }
  495. /// Revise 列表选项
  496. Future<HttpResult<ReviseListSGEntity>> fetchReviseList(
  497. String? applied_id,
  498. String? status,
  499. String? keyword,
  500. String? start_date,
  501. String? end_date, {
  502. required int curPage,
  503. CancelToken? cancelToken,
  504. }) async {
  505. //参数
  506. Map<String, String> params = {};
  507. params["cur_page"] = curPage.toString();
  508. params["page_size"] = "10";
  509. if (!Utils.isEmpty(applied_id)) {
  510. params["applied_id"] = applied_id!;
  511. }
  512. if (!Utils.isEmpty(status)) {
  513. params["status"] = status!;
  514. }
  515. if (!Utils.isEmpty(keyword)) {
  516. params["keyword"] = keyword!;
  517. }
  518. if (!Utils.isEmpty(start_date)) {
  519. params["start_date"] = start_date!;
  520. }
  521. if (!Utils.isEmpty(end_date)) {
  522. params["end_date"] = end_date!;
  523. }
  524. final result = await httpProvider.requestNetResult(
  525. ApiConstants.apiReviseListSG,
  526. params: params,
  527. cancelToken: cancelToken,
  528. );
  529. //根据返回的结果,封装原始数据为Bean/Entity对象
  530. if (result.isSuccess) {
  531. //重新赋值data或list
  532. final json = result.getDataJson();
  533. var data = ReviseListSGEntity.fromJson(json!);
  534. //重新赋值data或list
  535. return result.convert<ReviseListSGEntity>(data: data);
  536. }
  537. return result.convert();
  538. }
  539. /// 根据ID获取主列表的Item数据,用于刷新Item
  540. Future<HttpResult<ReviseListSGEntity>> fetchReviseListByIds(
  541. String? reviseId, {
  542. CancelToken? cancelToken,
  543. }) async {
  544. //参数
  545. Map<String, String> params = {};
  546. params["cur_page"] = "1";
  547. params["page_size"] = "9999";
  548. if (!Utils.isEmpty(reviseId)) {
  549. params["revise_id"] = reviseId!;
  550. }
  551. final result = await httpProvider.requestNetResult(
  552. ApiConstants.apiReviseListSG,
  553. params: params,
  554. cancelToken: cancelToken,
  555. );
  556. //根据返回的结果,封装原始数据为Bean/Entity对象
  557. if (result.isSuccess) {
  558. //重新赋值data或list
  559. final json = result.getDataJson();
  560. var data = ReviseListSGEntity.fromJson(json!);
  561. //重新赋值data或list
  562. return result.convert<ReviseListSGEntity>(data: data);
  563. }
  564. return result.convert();
  565. }
  566. /// Revise 添加选项
  567. Future<HttpResult<AddEditReviseViewSGEntity>> fetchReviseAddIndex(
  568. String? applied_id, {
  569. CancelToken? cancelToken,
  570. }) async {
  571. Map<String, String> params = {};
  572. params["applied_id"] = applied_id ?? "";
  573. final result = await httpProvider.requestNetResult(
  574. ApiConstants.apiAddReviseViewSG,
  575. params: params,
  576. isShowLoadingDialog: true,
  577. cancelToken: cancelToken,
  578. );
  579. //根据返回的结果,封装原始数据为Bean/Entity对象
  580. if (result.isSuccess) {
  581. //重新赋值data或list
  582. final json = result.getDataJson();
  583. var data = AddEditReviseViewSGEntity.fromJson(json!);
  584. //重新赋值data或list
  585. return result.convert<AddEditReviseViewSGEntity>(data: data);
  586. }
  587. return result.convert();
  588. }
  589. /// Revise 编辑选项
  590. Future<HttpResult<AddEditReviseViewSGEntity>> fetchReviseEditIndex(
  591. String? revise_id, {
  592. CancelToken? cancelToken,
  593. }) async {
  594. Map<String, String> params = {};
  595. params["revise_id"] = revise_id ?? "";
  596. final result = await httpProvider.requestNetResult(
  597. ApiConstants.apiEditReviseViewSG,
  598. params: params,
  599. isShowLoadingDialog: true,
  600. cancelToken: cancelToken,
  601. );
  602. //根据返回的结果,封装原始数据为Bean/Entity对象
  603. if (result.isSuccess) {
  604. //重新赋值data或list
  605. final json = result.getDataJson();
  606. var data = AddEditReviseViewSGEntity.fromJson(json!);
  607. //重新赋值data或list
  608. return result.convert<AddEditReviseViewSGEntity>(data: data);
  609. }
  610. return result.convert();
  611. }
  612. /// Review Add 提交
  613. Future<HttpResult> submitReviseAdd(
  614. String? appliedId,
  615. String? revise_hours,
  616. String? revise_msg, {
  617. CancelToken? cancelToken,
  618. }) async {
  619. //参数
  620. Map<String, String> params = {};
  621. params['applied_id'] = appliedId ?? "";
  622. if (!Utils.isEmpty(revise_hours)) {
  623. params['revise_hours'] = revise_hours ?? "";
  624. }
  625. if (!Utils.isEmpty(revise_msg)) {
  626. params['revise_msg'] = revise_msg ?? "";
  627. }
  628. final result = await httpProvider.requestNetResult(
  629. ApiConstants.apiAddReviseSubmitSG,
  630. method: HttpMethod.POST,
  631. params: params,
  632. networkDebounce: true,
  633. isShowLoadingDialog: true,
  634. cancelToken: cancelToken,
  635. );
  636. //根据返回的结果,封装原始数据为Bean/Entity对象
  637. if (result.isSuccess) {
  638. //重新赋值data或list
  639. return result.convert();
  640. }
  641. return result.convert();
  642. }
  643. /// Review Edit 提交
  644. Future<HttpResult> submitReviseEdit(
  645. String? revise_id,
  646. String? revise_hours,
  647. String? revise_msg, {
  648. CancelToken? cancelToken,
  649. }) async {
  650. //参数
  651. Map<String, String> params = {};
  652. params['revise_id'] = revise_id ?? "";
  653. if (!Utils.isEmpty(revise_hours)) {
  654. params['revise_hours'] = revise_hours ?? "";
  655. }
  656. if (!Utils.isEmpty(revise_msg)) {
  657. params['revise_msg'] = revise_msg ?? "";
  658. }
  659. final result = await httpProvider.requestNetResult(
  660. ApiConstants.apiEditReviseSubmitSG,
  661. method: HttpMethod.POST,
  662. params: params,
  663. networkDebounce: true,
  664. isShowLoadingDialog: true,
  665. cancelToken: cancelToken,
  666. );
  667. //根据返回的结果,封装原始数据为Bean/Entity对象
  668. if (result.isSuccess) {
  669. //重新赋值data或list
  670. return result.convert();
  671. }
  672. return result.convert();
  673. }
  674. /// Review Recall
  675. Future<HttpResult> recallRevise(
  676. String? revise_id, {
  677. CancelToken? cancelToken,
  678. }) async {
  679. //参数
  680. Map<String, String> params = {};
  681. params['revise_id'] = revise_id ?? "";
  682. final result = await httpProvider.requestNetResult(
  683. ApiConstants.apiRecallReviseSG,
  684. method: HttpMethod.POST,
  685. params: params,
  686. networkDebounce: true,
  687. isShowLoadingDialog: true,
  688. cancelToken: cancelToken,
  689. );
  690. //根据返回的结果,封装原始数据为Bean/Entity对象
  691. if (result.isSuccess) {
  692. //重新赋值data或list
  693. return result.convert();
  694. }
  695. return result.convert();
  696. }
  697. /// Review Delete
  698. Future<HttpResult> deleteRevise(
  699. String? revise_id, {
  700. CancelToken? cancelToken,
  701. }) async {
  702. //参数
  703. Map<String, String> params = {};
  704. params['revise_id'] = revise_id ?? "";
  705. final result = await httpProvider.requestNetResult(
  706. ApiConstants.apiDeleteReviseSG,
  707. method: HttpMethod.POST,
  708. params: params,
  709. networkDebounce: true,
  710. isShowLoadingDialog: true,
  711. cancelToken: cancelToken,
  712. );
  713. //根据返回的结果,封装原始数据为Bean/Entity对象
  714. if (result.isSuccess) {
  715. //重新赋值data或list
  716. return result.convert();
  717. }
  718. return result.convert();
  719. }
  720. /// Review Logs
  721. Future<HttpResult<ReviseLogSGEntity>> fetchReviseLogs(
  722. String? revise_id, {
  723. CancelToken? cancelToken,
  724. }) async {
  725. Map<String, String> params = {};
  726. params["revise_id"] = revise_id ?? "";
  727. final result = await httpProvider.requestNetResult(
  728. ApiConstants.apiReviseLogListSG,
  729. params: params,
  730. cancelToken: cancelToken,
  731. );
  732. //根据返回的结果,封装原始数据为Bean/Entity对象
  733. if (result.isSuccess) {
  734. //重新赋值data或list
  735. final json = result.getDataJson();
  736. var data = ReviseLogSGEntity.fromJson(json!);
  737. //重新赋值data或list
  738. return result.convert<ReviseLogSGEntity>(data: data);
  739. }
  740. return result.convert();
  741. }
  742. }