|
|
@@ -1,7 +1,9 @@
|
|
|
package com.github.zuihou.business.controller.cutterdata;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.zuihou.base.R;
|
|
|
import com.github.zuihou.base.controller.SuperController;
|
|
|
import com.github.zuihou.base.request.PageParams;
|
|
|
@@ -25,10 +27,7 @@ import org.apache.commons.vfs2.auth.StaticUserAuthenticator;
|
|
|
import org.apache.commons.vfs2.impl.DefaultFileSystemConfigBuilder;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
import java.io.InputStream;
|
|
|
@@ -40,6 +39,7 @@ import java.text.DecimalFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -181,8 +181,8 @@ public class CutterTestDataController extends SuperController<CutterTestDataServ
|
|
|
cutterTestDataService.saveOrUpdate(entity,
|
|
|
Wrappers.<CutterTestDataEntity>lambdaQuery()
|
|
|
.eq(CutterTestDataEntity::getCutterName, cutterName)
|
|
|
- .eq(CutterTestDataEntity::getFileTime, fileTime)
|
|
|
- .eq(CutterTestDataEntity::getCutterTyp, "机外对刀仪")
|
|
|
+// .eq(CutterTestDataEntity::getFileTime, fileTime)
|
|
|
+// .eq(CutterTestDataEntity::getCutterTyp, "机外对刀仪")
|
|
|
);
|
|
|
}
|
|
|
/**
|
|
|
@@ -203,28 +203,6 @@ public class CutterTestDataController extends SuperController<CutterTestDataServ
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// @ApiOperation(value = "获取机外对刀仪数据", notes = "获取机外对刀仪数据")
|
|
|
-// @PostMapping("/getCutterPage")
|
|
|
-// public R<IPage<CutterTestDataEntity>> getCutterPage(@RequestBody @Validated PageParams<CutterTestDataEntity> params) {
|
|
|
-//
|
|
|
-// IPage<CutterTestDataEntity> page = params.buildPage();
|
|
|
-//
|
|
|
-// QueryWrap<CutterTestDataEntity> wrap = handlerWrapper(null, params);
|
|
|
-//
|
|
|
-// LbqWrapper<CutterTestDataEntity> wrapper = wrap.lambda();
|
|
|
-//
|
|
|
-// wrapper.like(CutterTestDataEntity::getCutterT, params.getModel().getCutterT())
|
|
|
-// .like(CutterTestDataEntity::getCutterTyp, params.getModel().getCutterTyp())
|
|
|
-// .like(CutterTestDataEntity::getStatus, params.getModel().getStatus())
|
|
|
-// .like(CutterTestDataEntity::getCutterP, params.getModel().getCutterP())
|
|
|
-// .like(CutterTestDataEntity::getCutterPIp, params.getModel().getCutterPIp())
|
|
|
-// .orderByDesc(CutterTestDataEntity::getUpdateTime);
|
|
|
-// //查询弹框异常
|
|
|
-// IPage<CutterTestDataEntity> cutterTestDataDtoIPage = cutterTestDataService.pageList(page, wrapper);
|
|
|
-//
|
|
|
-// return R.success(cutterTestDataDtoIPage);
|
|
|
-// }
|
|
|
-
|
|
|
@ApiOperation(value = "定时查询rfid,根据rfid查询组刀对照的表", notes = "定时查询rfid,根据rfid查询组刀对照的表")
|
|
|
@PostMapping("/getCutterByRfid")
|
|
|
public R<CuttingTool> getCutterByRfid(@RequestBody AuthUser authUser) {
|
|
|
@@ -232,5 +210,28 @@ public class CutterTestDataController extends SuperController<CutterTestDataServ
|
|
|
return cutterTestDataService.getCutterByRfid();
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "根据ID删除对刀仪数据", notes = "根据ID删除对刀仪数据")
|
|
|
+ @GetMapping("deleteById")
|
|
|
+ public R<Boolean> deleteById(@RequestParam String id) {
|
|
|
+ return R.success(cutterTestDataService.removeById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据刀具名查询对刀仪数据", notes = "根据刀具名查询对刀仪数据")
|
|
|
+ @PostMapping("/selectByName")
|
|
|
+ public R<IPage<CutterTestDataEntity>> selectByName(
|
|
|
+ @RequestParam(defaultValue = "1") Integer current,
|
|
|
+ @RequestParam(defaultValue = "10") Integer size,
|
|
|
+ @RequestBody Map<String, Object> map) {
|
|
|
+ // 1. 从入参Map中获取刀具名(允许为空,为空时查全部)
|
|
|
+ String cutterName = map.get("cutterName") != null ? map.get("cutterName").toString() : null;
|
|
|
+ IPage<CutterTestDataEntity> page = new Page<>(current, size);
|
|
|
+ LambdaQueryWrapper<CutterTestDataEntity> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ if (cutterName != null && !cutterName.trim().isEmpty()) {
|
|
|
+ queryWrapper.like(CutterTestDataEntity::getCutterName, cutterName.trim());
|
|
|
+ }
|
|
|
+ queryWrapper.orderByDesc(CutterTestDataEntity::getUpdateTime);
|
|
|
+ IPage<CutterTestDataEntity> dataList = cutterTestDataService.page(page,queryWrapper);
|
|
|
+ return R.success(dataList);
|
|
|
+ }
|
|
|
|
|
|
}
|