diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/CsGroupController.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/CsGroupController.java index b4e3c0d..40a8b98 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/CsGroupController.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/CsGroupController.java @@ -79,6 +79,7 @@ public class CsGroupController extends BaseController { @PostMapping("/deleteGroup") @ApiOperation("删除分组") @ApiImplicitParam(name = "groupId", value = "组id", required = true) + @Deprecated public HttpResult deleteGroup(@RequestParam("groupId") String groupId){ String methodDescribe = getMethodDescribe("deleteGroup"); csGroupService.deleteGroup(groupId); diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDevModelServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDevModelServiceImpl.java index a8db5a3..5329af8 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDevModelServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDevModelServiceImpl.java @@ -73,7 +73,7 @@ public class CsDevModelServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.eq(CsDevModelPO::getDevType,devType) + lambdaQueryWrapper.eq(CsDevModelPO::getDevTypeName,devType) .eq(CsDevModelPO::getVersionNo,version) .eq(CsDevModelPO::getVersionDate, LocalDateTime.parse(time, DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN))) .eq(CsDevModelPO::getStatus,1); diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsGroArrServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsGroArrServiceImpl.java index b71aa71..9708bf8 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsGroArrServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsGroArrServiceImpl.java @@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.csdevice.mapper.CsGroArrMapper; +import com.njcn.csdevice.mapper.CsGroupMapper; import com.njcn.csdevice.pojo.param.GroupArrParam; import com.njcn.csdevice.pojo.po.CsGroArr; import com.njcn.csdevice.pojo.po.CsGroup; @@ -34,6 +35,8 @@ public class CsGroArrServiceImpl extends ServiceImpl i private final ICsGroupService csGroupService; + private final CsGroupMapper csGroupMapper; + @Override @Transactional(rollbackFor = Exception.class) public void updateGroArr(GroupArrParam groupArrParam) { @@ -42,10 +45,14 @@ public class CsGroArrServiceImpl extends ServiceImpl i if(CollectionUtil.isNotEmpty(list)) { List listGroup = new ArrayList<>(); List arrList = new ArrayList<>(); - List groupIdList = list.stream().map(GroupArrParam.ArrItem::getId).collect(Collectors.toList()); + LambdaQueryWrapper csGroupLambdaQueryWrapper = new LambdaQueryWrapper<>(); + csGroupLambdaQueryWrapper.eq(CsGroup::getDataSetId,groupArrParam.getSetId()); + List csGroupList = csGroupMapper.selectList(csGroupLambdaQueryWrapper); + List groupIdList = csGroupList.stream().map(CsGroup::getId).collect(Collectors.toList()); LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.in(CsGroArr::getGroupId, groupIdList); this.baseMapper.delete(lambdaQueryWrapper); + csGroupMapper.delete(csGroupLambdaQueryWrapper); Integer sort = 0; for (GroupArrParam.ArrItem item : list) {