Browse Source

-修改台账判重

jiangbiao 2 years ago
parent
commit
558b658a10

+ 2 - 1
master/src/main/java/com/ruoyi/project/base/controller/TBaseDeviceController.java

@@ -111,6 +111,7 @@ public class TBaseDeviceController extends BaseController
     {
         TBaseDevice device = new TBaseDevice();
         device.setDevCode(tBaseDevice.getDevCode());
+        device.setDevDescribe(tBaseDevice.getDevDescribe());
         device.setPlantId(tBaseDevice.getPlantId());
         List<TBaseDevice> tBaseDevices = tBaseDeviceService.selectTBaseDeviceList(device);
         if (CollectionUtils.isNotEmpty(tBaseDevices)){
@@ -131,7 +132,7 @@ public class TBaseDeviceController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody TBaseDevice tBaseDevice)
     {
-        QueryWrapper<TBaseDevice> wrapper = new QueryWrapper<TBaseDevice>().eq("dev_code",tBaseDevice.getDevCode()).eq("plant_id",tBaseDevice.getPlantId()).eq("region_id", tBaseDevice.getRegionId()).ne("dev_id",tBaseDevice.getDevId());
+        QueryWrapper<TBaseDevice> wrapper = new QueryWrapper<TBaseDevice>().eq("dev_describe",tBaseDevice.getDevDescribe()).eq("dev_code",tBaseDevice.getDevCode()).eq("plant_id",tBaseDevice.getPlantId()).eq("region_id", tBaseDevice.getRegionId()).ne("dev_id",tBaseDevice.getDevId());
         if(CollectionUtils.isNotEmpty(tBaseDeviceMapper.selectList(wrapper))){
             return AjaxResult.error("不可修改为已存在的数据");
         }