package com.sooka.sponest.mobile.comprehensive.conflictDefuseController; import com.ruoyi.common.core.constant.HttpStatus; import com.ruoyi.common.core.domain.DictKeys; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.PageDomain; import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.common.core.web.page.TableSupport; import com.ruoyi.common.security.utils.DictUtils; import com.sooka.sponest.comprehensive.api.comprehensiveConflictDefuse.domain.ConflictResolution; import com.sooka.sponest.comprehensive.api.comprehensiveConflictDefuse.service.RemoteConflictResolutionService; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.HashMap; import java.util.List; @RestController @RequestMapping("/AppConflictResolutionController") public class AppConflictResolutionController extends BaseController { @Resource private RemoteConflictResolutionService remoteConflictResolutionService; /** * 查询矛盾纠纷排查化解 */ @GetMapping("/conflict/list") public AjaxResult list(ConflictResolution conflictResolution) { PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); TableDataInfo tableDataInfo = remoteConflictResolutionService.selectConflictResolutionList(pageNum, pageSize, conflictResolution.getTemp(),conflictResolution.getEventName(),conflictResolution.getMainPersonName(),conflictResolution.getResolutionResponsibleName()); if (HttpStatus.SUCCESS == tableDataInfo.getCode()) { return AjaxResult.success(tableDataInfo.getRows()); } else { return AjaxResult.error(tableDataInfo.getCode(), tableDataInfo.getMsg()); } } /** * 获取矛盾纠纷排查化解详细信息 */ @GetMapping("/conflict/edit") public AjaxResult getInfo(String id) { R edit = remoteConflictResolutionService.selectConflictResolutionById(id); if(HttpStatus.SUCCESS == edit.getCode()){ ConflictResolution conflictResolution = edit.getData(); conflictResolution.setMainPersonIdCodeLabel(DictUtils.getDictDataByValue("comprehensive_certificate_code", conflictResolution.getMainPersonIdCode())); conflictResolution.setMainPersonGenderLabel(DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_SEX, conflictResolution.getMainPersonGender())); conflictResolution.setMainPersonNationalityLabel(DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_NATION, conflictResolution.getMainPersonNationality())); conflictResolution.setMainPersonEducationLabel(DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND, conflictResolution.getMainPersonEducation())); conflictResolution.setResolutionSuccessLabel(!conflictResolution.getResolutionSuccess().isEmpty()?("1".equals(conflictResolution.getResolutionSuccess())?"是":"否"):""); return AjaxResult.success(conflictResolution); }else{ return AjaxResult.error(edit.getCode(), edit.getMsg()); } } /** * 新增矛盾纠纷排查化解 */ @PostMapping("/conflict") public AjaxResult add(@RequestBody String json) { return remoteConflictResolutionService.insertConflictResolution(json); } /** * 修改矛盾纠纷排查化解 */ @PostMapping("/conflict/put") public AjaxResult edit(@RequestBody String json) { return remoteConflictResolutionService.updateConflictResolution(json); } /** * 删除矛盾纠纷排查化解 */ @GetMapping("/conflict/del") public AjaxResult remove(@RequestParam("id") List id) { return remoteConflictResolutionService.deleteConflictResolutionByIds(id.toArray(new String[0])); } }