From 071a383089ba728a5263a4e70cb2aca392808221 Mon Sep 17 00:00:00 2001 From: xuyang <748613696@qq.com> Date: Wed, 5 Jul 2023 16:15:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../csdevice/controller/equipment/CsGroupController.java | 1 + .../csdevice/service/impl/CsDevModelServiceImpl.java | 2 +- .../njcn/csdevice/service/impl/CsGroArrServiceImpl.java | 9 ++++++++- 3 files changed, 10 insertions(+), 2 deletions(-) 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) {