|
@@ -3,12 +3,15 @@ package com.sooka.sponest.mobile.data.digitalenvironmentcontroller;
|
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.web.page.PageDomain;
|
|
|
import com.ruoyi.common.core.web.page.TableSupport;
|
|
|
+import com.ruoyi.common.redis.service.RedisService;
|
|
|
+import com.ruoyi.common.security.utils.DictUtils;
|
|
|
import com.sooka.sponest.data.api.digitalenvironment.domain.EnvironmentLeaveField;
|
|
|
import com.sooka.sponest.data.api.digitalenvironment.service.RemoteLeaveFieldService;
|
|
|
import com.sooka.sponest.mobile.system.camera.service.AppCameraService;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -28,7 +31,7 @@ public class LeaveFieldController {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 查询污染源管理列表
|
|
|
+ * 查询秸秆离田管理列表
|
|
|
*/
|
|
|
@GetMapping("/LeaveField/list")
|
|
|
public AjaxResult list(EnvironmentLeaveField leaveField) {
|
|
@@ -36,7 +39,12 @@ public class LeaveFieldController {
|
|
|
Integer pageNum = pageDomain.getPageNum();
|
|
|
Integer pageSize = pageDomain.getPageSize();
|
|
|
String leaveFieldType = leaveField.getLeaveFieldType();
|
|
|
- return AjaxResult.success(leaveFieldService.list(pageNum, pageSize, leaveFieldType).getRows());
|
|
|
+ Map<String, Object> dictCacheToMap = DictUtils.getDictCacheToMap("farm_fukuda_type");
|
|
|
+ List<HashMap<String, Object>> list = (List<HashMap<String, Object>>) leaveFieldService.list(pageNum, pageSize, leaveFieldType).getRows();
|
|
|
+ for (HashMap<String, Object> environmentLeaveField : list) {
|
|
|
+ environmentLeaveField.put("leaveTypeLabel",dictCacheToMap.get(environmentLeaveField.get("leaveType")));
|
|
|
+ }
|
|
|
+ return AjaxResult.success(list);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -48,6 +56,8 @@ public class LeaveFieldController {
|
|
|
AjaxResult ajaxResult = leaveFieldService.edit(leaveField.getId());
|
|
|
if("200".equals(ajaxResult.get("code").toString())){
|
|
|
Map<String, Object> info = (Map<String, Object>) ajaxResult.get("data");
|
|
|
+ Map<String, Object> dictCacheToMap = DictUtils.getDictCacheToMap("farm_fukuda_type");
|
|
|
+ info.put("leaveTypeLabel", dictCacheToMap.get(info.get("leaveType")));
|
|
|
return appCameraService.selectCameraByIds(info);
|
|
|
}else{
|
|
|
return ajaxResult;
|