|
@@ -0,0 +1,96 @@
|
|
|
+package com.sooka.sponest.mobile.comprehensive.socialPolicingController;
|
|
|
+
|
|
|
+import com.ruoyi.common.core.constant.HttpStatus;
|
|
|
+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.comprehensiveSocialPolicing.domain.RemediationInKeyArea;
|
|
|
+import com.sooka.sponest.comprehensive.api.comprehensiveSocialPolicing.service.RemoteRemediationInKeyAreaService;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Author LG
|
|
|
+ * @Date 2023/9/13 - 10:24
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/AppRemediationInKeyAreaController")
|
|
|
+public class AppRemediationInKeyAreaController {
|
|
|
+ @Resource
|
|
|
+ private RemoteRemediationInKeyAreaService remediationInKeyAreaService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 重点地区排查整治列表
|
|
|
+ */
|
|
|
+ @GetMapping("/remediationInKeyArea/list")
|
|
|
+ public AjaxResult list(RemediationInKeyArea remediationInKeyArea) {
|
|
|
+ PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
+ Integer pageNum = pageDomain.getPageNum();
|
|
|
+ Integer pageSize = pageDomain.getPageSize();
|
|
|
+ TableDataInfo list = remediationInKeyAreaService.getList(pageNum, pageSize);
|
|
|
+ Map<String, Object> policingIssues = DictUtils.getDictCacheToMap("comprehensive_policing_issues");
|
|
|
+ Map<String, Object> regionsInvolved = DictUtils.getDictCacheToMap("comprehensive_regions_involved");
|
|
|
+ Map<String, Object> effectivenessEvaluation = DictUtils.getDictCacheToMap("comprehensive_effectiveness_evaluation");
|
|
|
+
|
|
|
+ if (HttpStatus.SUCCESS == list.getCode()) {
|
|
|
+ List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) list.getRows();
|
|
|
+ for (HashMap<String, Object> row : rows) {
|
|
|
+ row.put("outstandingSecurityIssuesLabel",policingIssues.get(row.get("outstandingSecurityIssues")));
|
|
|
+ row.put("areaInvolvedTypeLabel",regionsInvolved.get(row.get("areaInvolvedType")));
|
|
|
+ row.put("effectivenessEvaluationLabel",effectivenessEvaluation.get(row.get("effectivenessEvaluation")));
|
|
|
+ }
|
|
|
+ return AjaxResult.success(rows);
|
|
|
+ } else {
|
|
|
+ return AjaxResult.error(list.getCode(), list.getMsg());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 重点地区排查整治详细信息
|
|
|
+ */
|
|
|
+ @GetMapping("/remediationInKeyArea/edit")
|
|
|
+ public AjaxResult getInfo(RemediationInKeyArea remediationInKeyArea) {
|
|
|
+ AjaxResult edit = remediationInKeyAreaService.getEdit(remediationInKeyArea.getId());
|
|
|
+ if("200".equals(edit.get("code").toString())){
|
|
|
+ HashMap<String,Object> data = (HashMap<String, Object>) edit.get("data");
|
|
|
+ data.put("outstandingSecurityIssuesLabel",DictUtils.getDictDataByValue("comprehensive_policing_issues",data.get("outstandingSecurityIssues").toString()));
|
|
|
+ data.put("areaInvolvedTypeLabel",DictUtils.getDictDataByValue("comprehensive_regions_involved",data.get("areaInvolvedType").toString()));
|
|
|
+ data.put("effectivenessEvaluationLabel",DictUtils.getDictDataByValue("comprehensive_effectiveness_evaluation",data.get("effectivenessEvaluation").toString()));
|
|
|
+ return AjaxResult.success(data);
|
|
|
+ }else{
|
|
|
+ return edit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增重点地区排查整治
|
|
|
+ */
|
|
|
+ @PostMapping("/remediationInKeyArea")
|
|
|
+ public AjaxResult add(@RequestBody String json) {
|
|
|
+ return remediationInKeyAreaService.add(json);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改重点地区排查整治
|
|
|
+ */
|
|
|
+ @PostMapping("/remediationInKeyArea/put")
|
|
|
+ public AjaxResult edit(@RequestBody String json) {
|
|
|
+ return remediationInKeyAreaService.edit(json);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除重点地区排查整治
|
|
|
+ */
|
|
|
+ @GetMapping("/remediationInKeyArea/del")
|
|
|
+ public AjaxResult remove(@RequestParam("id") List<String> id) {
|
|
|
+ return remediationInKeyAreaService.del(id.toArray(new String[0]));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|