|
@@ -0,0 +1,105 @@
|
|
|
+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.domain.SafetyManagement;
|
|
|
+import com.sooka.sponest.comprehensive.api.comprehensiveSocialPolicing.service.RemoteRemediationInKeyAreaService;
|
|
|
+import com.sooka.sponest.comprehensive.api.comprehensiveSocialPolicing.service.RemoteSafetyManagementService;
|
|
|
+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 - 13:44
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/AppSafetyManagementController")
|
|
|
+public class AppSafetyManagementController {
|
|
|
+ @Resource
|
|
|
+ private RemoteSafetyManagementService safetyManagementService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 寄递物流安全管理列表
|
|
|
+ */
|
|
|
+ @GetMapping("/safetyManagement/list")
|
|
|
+ public AjaxResult list(SafetyManagement safetyManagement) {
|
|
|
+ PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
+ Integer pageNum = pageDomain.getPageNum();
|
|
|
+ Integer pageSize = pageDomain.getPageSize();
|
|
|
+ TableDataInfo list = safetyManagementService.getList(pageNum, pageSize);
|
|
|
+ Map<String, Object> typeOfRegistration = DictUtils.getDictCacheToMap("comprehensive_type_of_registration");
|
|
|
+ Map<String, Object> holdingInertia = DictUtils.getDictCacheToMap("comprehensive_holding_inertia");
|
|
|
+ Map<String, Object> businessType = DictUtils.getDictCacheToMap("comprehensive_business_type");
|
|
|
+
|
|
|
+ if (HttpStatus.SUCCESS == list.getCode()) {
|
|
|
+ List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) list.getRows();
|
|
|
+ for (HashMap<String, Object> row : rows) {
|
|
|
+ row.put("registrationTypeLabel",typeOfRegistration.get(row.get("registrationType")));
|
|
|
+ row.put("holdingStatusLabel",holdingInertia.get(row.get("holdingStatus")));
|
|
|
+ row.put("enterpriseTypeLabel",businessType.get(row.get("enterpriseType")));
|
|
|
+ row.put("businessScopeLabel",DictUtils.getDictDataListByValue("comprehensive_business_scope", (List<String>) row.get("businessScope")));
|
|
|
+ row.put("preClosingCheckLabel","1".equals(row.get("preClosingCheck").toString())? "是":"否");
|
|
|
+ row.put("realNameRegistrationLabel","1".equals(row.get("realNameRegistration").toString())? "是":"否");
|
|
|
+ row.put("xrayInspectionLabel","1".equals(row.get("xrayInspection").toString())? "是":"否");
|
|
|
+ }
|
|
|
+ return AjaxResult.success(rows);
|
|
|
+ } else {
|
|
|
+ return AjaxResult.error(list.getCode(), list.getMsg());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 寄递物流安全管理详细信息
|
|
|
+ */
|
|
|
+ @GetMapping("/safetyManagement/edit")
|
|
|
+ public AjaxResult getInfo(SafetyManagement safetyManagement) {
|
|
|
+ AjaxResult edit = safetyManagementService.getEdit(safetyManagement.getId());
|
|
|
+ if("200".equals(edit.get("code").toString())){
|
|
|
+ HashMap<String,Object> data = (HashMap<String, Object>) edit.get("data");
|
|
|
+ data.put("registrationTypeLabel",DictUtils.getDictDataByValue("comprehensive_type_of_registration",data.get("registrationType").toString()));
|
|
|
+ data.put("holdingStatusLabel",DictUtils.getDictDataByValue("comprehensive_holding_inertia",data.get("holdingStatus").toString()));
|
|
|
+ data.put("enterpriseTypeLabel",DictUtils.getDictDataByValue("comprehensive_business_type",data.get("enterpriseType").toString()));
|
|
|
+ data.put("businessScopeLabel",DictUtils.getDictDataListByValue("comprehensive_business_scope", (List<String>) data.get("businessScope")));
|
|
|
+ data.put("preClosingCheckLabel","1".equals(data.get("preClosingCheck").toString())? "是":"否");
|
|
|
+ data.put("realNameRegistrationLabel","1".equals(data.get("realNameRegistration").toString())? "是":"否");
|
|
|
+ data.put("xrayInspectionLabel","1".equals(data.get("xrayInspection").toString())? "是":"否");
|
|
|
+ return AjaxResult.success(data);
|
|
|
+ }else{
|
|
|
+ return edit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增寄递物流安全管理
|
|
|
+ */
|
|
|
+ @PostMapping("/safetyManagement")
|
|
|
+ public AjaxResult add(@RequestBody String json) {
|
|
|
+ return safetyManagementService.add(json);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改寄递物流安全管理
|
|
|
+ */
|
|
|
+ @PostMapping("/safetyManagement/put")
|
|
|
+ public AjaxResult edit(@RequestBody String json) {
|
|
|
+ return safetyManagementService.edit(json);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除寄递物流安全管理
|
|
|
+ */
|
|
|
+ @GetMapping("/safetyManagement/del")
|
|
|
+ public AjaxResult remove(@RequestParam("id") List<String> id) {
|
|
|
+ return safetyManagementService.del(id.toArray(new String[0]));
|
|
|
+ }
|
|
|
+}
|