AppConflictResolutionController.java 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. package com.sooka.sponest.mobile.comprehensive.conflictDefuseController;
  2. import com.ruoyi.common.core.constant.HttpStatus;
  3. import com.ruoyi.common.core.domain.DictKeys;
  4. import com.ruoyi.common.core.domain.R;
  5. import com.ruoyi.common.core.web.controller.BaseController;
  6. import com.ruoyi.common.core.web.domain.AjaxResult;
  7. import com.ruoyi.common.core.web.page.PageDomain;
  8. import com.ruoyi.common.core.web.page.TableDataInfo;
  9. import com.ruoyi.common.core.web.page.TableSupport;
  10. import com.ruoyi.common.security.utils.DictUtils;
  11. import com.sooka.sponest.comprehensive.api.comprehensiveConflictDefuse.domain.ConflictResolution;
  12. import com.sooka.sponest.comprehensive.api.comprehensiveConflictDefuse.service.RemoteConflictResolutionService;
  13. import org.springframework.web.bind.annotation.*;
  14. import javax.annotation.Resource;
  15. import java.util.HashMap;
  16. import java.util.List;
  17. @RestController
  18. @RequestMapping("/AppConflictResolutionController")
  19. public class AppConflictResolutionController extends BaseController {
  20. @Resource
  21. private RemoteConflictResolutionService remoteConflictResolutionService;
  22. /**
  23. * 查询矛盾纠纷排查化解
  24. */
  25. @GetMapping("/conflict/list")
  26. public AjaxResult list(ConflictResolution conflictResolution) {
  27. PageDomain pageDomain = TableSupport.buildPageRequest();
  28. Integer pageNum = pageDomain.getPageNum();
  29. Integer pageSize = pageDomain.getPageSize();
  30. TableDataInfo tableDataInfo = remoteConflictResolutionService.selectConflictResolutionList(pageNum, pageSize, conflictResolution.getTemp(),conflictResolution.getEventName(),conflictResolution.getMainPersonName(),conflictResolution.getResolutionResponsibleName());
  31. if (HttpStatus.SUCCESS == tableDataInfo.getCode()) {
  32. return AjaxResult.success(tableDataInfo.getRows());
  33. } else {
  34. return AjaxResult.error(tableDataInfo.getCode(), tableDataInfo.getMsg());
  35. }
  36. }
  37. /**
  38. * 获取矛盾纠纷排查化解详细信息
  39. */
  40. @GetMapping("/conflict/edit")
  41. public AjaxResult getInfo(String id) {
  42. R<ConflictResolution> edit = remoteConflictResolutionService.selectConflictResolutionById(id);
  43. if(HttpStatus.SUCCESS == edit.getCode()){
  44. ConflictResolution conflictResolution = edit.getData();
  45. conflictResolution.setMainPersonIdCodeLabel(DictUtils.getDictDataByValue("comprehensive_certificate_code", conflictResolution.getMainPersonIdCode()));
  46. conflictResolution.setMainPersonGenderLabel(DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_SEX, conflictResolution.getMainPersonGender()));
  47. conflictResolution.setMainPersonNationalityLabel(DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_NATION, conflictResolution.getMainPersonNationality()));
  48. conflictResolution.setMainPersonEducationLabel(DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND, conflictResolution.getMainPersonEducation()));
  49. conflictResolution.setResolutionSuccessLabel(!conflictResolution.getResolutionSuccess().isEmpty()?("1".equals(conflictResolution.getResolutionSuccess())?"是":"否"):"");
  50. return AjaxResult.success(conflictResolution);
  51. }else{
  52. return AjaxResult.error(edit.getCode(), edit.getMsg());
  53. }
  54. }
  55. /**
  56. * 新增矛盾纠纷排查化解
  57. */
  58. @PostMapping("/conflict")
  59. public AjaxResult add(@RequestBody String json) {
  60. return remoteConflictResolutionService.insertConflictResolution(json);
  61. }
  62. /**
  63. * 修改矛盾纠纷排查化解
  64. */
  65. @PostMapping("/conflict/put")
  66. public AjaxResult edit(@RequestBody String json) {
  67. return remoteConflictResolutionService.updateConflictResolution(json);
  68. }
  69. /**
  70. * 删除矛盾纠纷排查化解
  71. */
  72. @GetMapping("/conflict/del")
  73. public AjaxResult remove(@RequestParam("id") List<String> id) {
  74. return remoteConflictResolutionService.deleteConflictResolutionByIds(id.toArray(new String[0]));
  75. }
  76. }