|
@@ -3,6 +3,7 @@ package com.huimv.center.controller;
|
|
|
|
|
|
import com.huimv.center.service.BizDeviceRegisteredFlowService;
|
|
|
import com.huimv.eartag2.common.utils.Result;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -15,7 +16,7 @@ import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
- * 前端控制器
|
|
|
+ * 前端控制器
|
|
|
* </p>
|
|
|
*
|
|
|
* @author zn
|
|
@@ -28,7 +29,7 @@ public class BizDeviceRegisteredFlowController {
|
|
|
private BizDeviceRegisteredFlowService bizDeviceRegisteredFlowService;
|
|
|
|
|
|
@PostMapping("/list")
|
|
|
- public Result list(@RequestParam Map<String, Object> paramsMap){
|
|
|
+ public Result list(@RequestParam Map<String, Object> paramsMap) {
|
|
|
String pageNo = paramsMap.get("pageNo").toString();
|
|
|
if (pageNo == null) {
|
|
|
pageNo = "1";
|
|
@@ -57,32 +58,55 @@ public class BizDeviceRegisteredFlowController {
|
|
|
if (paramsMap.get("endDate") != null) {
|
|
|
endDate = paramsMap.get("endDate").toString();
|
|
|
}
|
|
|
- return bizDeviceRegisteredFlowService.listDeviceRegisteredFlow(Integer.parseInt(pageNo), Integer.parseInt(pageSize), farmCode, chipId, deviceCode,startDate, endDate);
|
|
|
+ return bizDeviceRegisteredFlowService.listDeviceRegisteredFlow(Integer.parseInt(pageNo), Integer.parseInt(pageSize), farmCode, chipId, deviceCode, startDate, endDate);
|
|
|
}
|
|
|
|
|
|
@PostMapping("/remove")
|
|
|
- public Result remove(@RequestParam Map<String, Object> paramsMap){
|
|
|
+ public Result remove(@RequestParam Map<String, Object> paramsMap) {
|
|
|
+ boolean deleteStatus = false;
|
|
|
String farmCode = "";
|
|
|
if (paramsMap.get("farmCode") != null) {
|
|
|
farmCode = paramsMap.get("farmCode").toString();
|
|
|
+ deleteStatus = true;
|
|
|
}
|
|
|
String chipId = "";
|
|
|
if (paramsMap.get("chipId") != null) {
|
|
|
chipId = paramsMap.get("chipId").toString();
|
|
|
+ deleteStatus = true;
|
|
|
}
|
|
|
String deviceCode = "";
|
|
|
if (paramsMap.get("deviceCode") != null) {
|
|
|
deviceCode = paramsMap.get("deviceCode").toString();
|
|
|
+ deleteStatus = true;
|
|
|
}
|
|
|
String startDate = "";
|
|
|
if (paramsMap.get("startDate") != null) {
|
|
|
startDate = paramsMap.get("startDate").toString();
|
|
|
+ deleteStatus = true;
|
|
|
}
|
|
|
String endDate = "";
|
|
|
if (paramsMap.get("endDate") != null) {
|
|
|
endDate = paramsMap.get("endDate").toString();
|
|
|
+ deleteStatus = true;
|
|
|
}
|
|
|
- return bizDeviceRegisteredFlowService.removeDeviceRegisteredFlow(farmCode,chipId,deviceCode,startDate,endDate);
|
|
|
+ String ids = "";
|
|
|
+ if (paramsMap.get("ids") != null) {
|
|
|
+ ids = paramsMap.get("ids").toString();
|
|
|
+ deleteStatus = true;
|
|
|
+ }
|
|
|
+ if (!deleteStatus) {
|
|
|
+ return new Result(10001, "删除条件都为空.", false);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(ids)) {
|
|
|
+ return bizDeviceRegisteredFlowService.removeDeviceRegisteredFlow(ids);
|
|
|
+ } else {
|
|
|
+ return bizDeviceRegisteredFlowService.removeDeviceRegisteredFlow(farmCode, chipId, deviceCode, startDate, endDate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/removeById")
|
|
|
+ public Result removeById(@RequestParam String ids) {
|
|
|
+ return bizDeviceRegisteredFlowService.removeDeviceRegisteredFlow(ids);
|
|
|
}
|
|
|
}
|
|
|
|