|
@@ -0,0 +1,86 @@
|
|
|
+package com.sooka.sponest.mobile.data.digitalagriculture.controller;
|
|
|
+
|
|
|
+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.sooka.sponest.data.api.digitalagriculture.domain.FarmCollectiveFarmland;
|
|
|
+import com.sooka.sponest.data.api.digitalagriculture.service.RemoteCollectiveFarmlandService;
|
|
|
+import com.sooka.sponest.mobile.system.camera.service.AppCameraService;
|
|
|
+import com.sooka.sponest.mobile.utils.PictureReplaceAll;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 农村集体耕地
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("AppcollectivefarmlandController")
|
|
|
+public class CollectiveFarmlandController {
|
|
|
+ @Resource
|
|
|
+ RemoteCollectiveFarmlandService remoteFarmCollectiveFarmlandService;
|
|
|
+ @Resource
|
|
|
+ AppCameraService appCameraService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增农村集体耕地
|
|
|
+ * @param json
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/collectivefarmland")
|
|
|
+ public AjaxResult addCollectivefarmland(@RequestBody String json) {
|
|
|
+ return remoteFarmCollectiveFarmlandService.addCollectivefarmland(json);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取农村集体耕地列表
|
|
|
+ * @param farmCollectiveFarmland
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/collectivefarmland/list")
|
|
|
+ public AjaxResult collectivefarmlandList(FarmCollectiveFarmland farmCollectiveFarmland) {
|
|
|
+ PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
+ Integer pageNum = pageDomain.getPageNum();
|
|
|
+ Integer pageSize = pageDomain.getPageSize();
|
|
|
+ return AjaxResult.success(remoteFarmCollectiveFarmlandService.collectivefarmlandList(pageNum, pageSize).getRows());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除农村集体耕地
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/collectivefarmland/del")
|
|
|
+ public AjaxResult delCollectivefarmland(@RequestParam("id") List<String> id) {
|
|
|
+ return remoteFarmCollectiveFarmlandService.delCollectivefarmland(id.toArray(new String[0]));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改农村集体耕地
|
|
|
+ * @param json
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/collectivefarmland/put")
|
|
|
+ public AjaxResult putCollectivefarmland(@RequestBody String json) {
|
|
|
+ return remoteFarmCollectiveFarmlandService.putCollectivefarmland(json);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取农村集体耕地详情
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/collectivefarmland/edit")
|
|
|
+ public AjaxResult collectivefarmlandEdit(String id) {
|
|
|
+ AjaxResult ajaxResult = remoteFarmCollectiveFarmlandService.collectivefarmlandEdit(id);
|
|
|
+ if("200".equals(ajaxResult.get("code").toString())){
|
|
|
+ Map<String, Object> info = (Map<String, Object>) ajaxResult.get("data");
|
|
|
+ PictureReplaceAll.StringToList(info);
|
|
|
+ return appCameraService.selectCameraByIds(info);
|
|
|
+ }else{
|
|
|
+ return ajaxResult;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|