فهرست منبع

判断是否有二级洗消站修改3

wwh 1 سال پیش
والد
کامیت
ac9799b21c
1فایلهای تغییر یافته به همراه27 افزوده شده و 1 حذف شده
  1. 27 1
      huimv-receive/src/main/java/com/huimv/receive/controller/ExistController.java

+ 27 - 1
huimv-receive/src/main/java/com/huimv/receive/controller/ExistController.java

@@ -1,13 +1,23 @@
 package com.huimv.receive.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.huimv.receive.common.utils.Result;
+import com.huimv.receive.common.utils.ResultCode;
+import com.huimv.receive.entity.Exist;
+import com.huimv.receive.service.IExistService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Map;
+
 /**
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  *
  * @author author
@@ -15,6 +25,22 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequestMapping("/exist")
+@CrossOrigin
 public class ExistController {
 
+    @Autowired
+    private IExistService existService;
+
+    @RequestMapping("/editExist")
+    public Result edit(@RequestBody Map<String, String> paramsMap) {
+        String result = paramsMap.get("result");
+        String farmId = paramsMap.get("farmId");
+        QueryWrapper<Exist> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("farm_id", farmId);
+        Exist one = existService.getOne(queryWrapper);
+        one.setExist(Integer.parseInt(result));
+        existService.updateById(one);
+        return new Result(10000, "修改成功!", true);
+    }
+
 }