|
@@ -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);
|
|
|
+ }
|
|
|
+
|
|
|
}
|