123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- 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.apache.commons.collections4.MapUtils;
- import org.springframework.web.bind.annotation.*;
- import javax.annotation.Resource;
- import java.util.List;
- import java.util.Map;
- @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()) {
- List<Map<String,Object>> rows = (List<Map<String, Object>>) tableDataInfo.getRows();
- Map<String,Object> comprehensiveCertificateCode = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_CERTIFICATE_CODE);
- Map<String,Object> comprehensiveSex = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);
- Map<String,Object> comprehensiveNation = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_NATION);
- Map<String,Object> comprehensiveEducationalBackground = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND);
- Map<String,Object> comprehensiveEventSize = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_EVENT_SIZE);
- Map<String,Object> comprehensiveEventType = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_EVENT_TYPE);
- Map<String,Object> comprehensivePartiesInvolved = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_PARTIES_INVOLVED);
- Map<String,Object> comprehensiveWaysResolving = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_WAYS_RESOLVING);
- for (Map<String, Object> row : rows) {
- row.put("mainPersonIdCodeLabel",MapUtils.getString(comprehensiveCertificateCode,MapUtils.getString(row,"mainPersonIdCode")));
- row.put("mainPersonGenderLabel",MapUtils.getString(comprehensiveSex,MapUtils.getString(row,"mainPersonGender")));
- row.put("mainPersonNationalityLabel",MapUtils.getString(comprehensiveNation,MapUtils.getString(row,"mainPersonNationality")));
- row.put("mainPersonEducationLabel",MapUtils.getString(comprehensiveEducationalBackground,MapUtils.getString(row,"mainPersonEducation")));
- row.put("eventScaleLabel",MapUtils.getString(comprehensiveEventSize,MapUtils.getString(row,"eventScale")));
- row.put("resolutionSuccessLabel",!MapUtils.getString(row,"resolutionSuccess").isEmpty()?("1".equals(conflictResolution.getResolutionSuccess())?"是":"否"):"");
- row.put("eventCategoryLabel",MapUtils.getString(comprehensiveEventType,MapUtils.getString(row,"eventCategory")));
- row.put("mainPersonCategoryLabel",MapUtils.getString(comprehensivePartiesInvolved,MapUtils.getString(row,"mainPersonCategory")));
- row.put("resolutionMethodLabel",MapUtils.getString(comprehensiveWaysResolving,MapUtils.getString(row,"resolutionMethod")));
- }
- return AjaxResult.success(rows);
- } else {
- return AjaxResult.error(tableDataInfo.getCode(), tableDataInfo.getMsg());
- }
- }
- /**
- * 获取矛盾纠纷排查化解详细信息
- */
- @GetMapping("/conflict/edit")
- public AjaxResult getInfo(String id) {
- R<ConflictResolution> edit = remoteConflictResolutionService.selectConflictResolutionById(id);
- if(HttpStatus.SUCCESS == edit.getCode()){
- ConflictResolution conflictResolution = edit.getData();
- Map<String,Object> comprehensiveEventType = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_EVENT_TYPE);
- Map<String,Object> comprehensivePartiesInvolved = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_PARTIES_INVOLVED);
- Map<String,Object> comprehensiveWaysResolving = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_WAYS_RESOLVING);
- conflictResolution.setMainPersonIdCodeLabel(DictUtils.getDictDataByValue(DictKeys.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.setEventScaleLabel(DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_EVENT_SIZE, conflictResolution.getEventScale()));
- conflictResolution.setResolutionSuccessLabel(!conflictResolution.getResolutionSuccess().isEmpty()?("1".equals(conflictResolution.getResolutionSuccess())?"是":"否"):"");
- conflictResolution.setEventCategoryLabel(MapUtils.getString(comprehensiveEventType,conflictResolution.getEventCategory()));
- conflictResolution.setMainPersonCategoryLabel(MapUtils.getString(comprehensivePartiesInvolved,conflictResolution.getMainPersonCategory()));
- conflictResolution.setResolutionMethodLabel(MapUtils.getString(comprehensiveWaysResolving,conflictResolution.getResolutionMethod()));
- 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<String> id) {
- return remoteConflictResolutionService.deleteConflictResolutionByIds(id.toArray(new String[0]));
- }
- }
|