feat:部门硬件分组
This commit is contained in:
1 parent
c67f020a6a
commit
33bec4fb22
11 files changed
+114
-78
No files matched your search
-1
@@ -1,7 +1,6 @@
|
||||
package com.bsd.pjcloud.hard.controller.hard;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.idempotent.annotation.Idempotent;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
|
||||
+12
-4
@@ -120,8 +120,12 @@ public class HardManagerServiceImpl extends ServiceImpl<HardManagerMapper, HardM
|
||||
if (ObjectUtil.isEmpty(mch)) {
|
||||
throw new RuntimeException("商户不存在");
|
||||
}
|
||||
SysDept deptHardGroup = deptService.getParentDeptHardGroup(user.getDeptId()).getData();
|
||||
if (ObjectUtil.isEmpty(deptHardGroup)) {
|
||||
throw new RuntimeException("请设置顶级部门硬件分组");
|
||||
}
|
||||
dto.setHardGroupId(deptHardGroup.getHardGroupId());
|
||||
dto.setDeptId(user.getDeptId());
|
||||
dto.setHardGroupId(mch.getHardGroupId());
|
||||
// mq地址和端口
|
||||
dto.setMqSocketAddress(mqttConfig.getAndroidAddress());
|
||||
dto.setMqSocketPort(mqttConfig.getAndroidPort());
|
||||
@@ -129,7 +133,7 @@ public class HardManagerServiceImpl extends ServiceImpl<HardManagerMapper, HardM
|
||||
baseMapper.insert(dto);
|
||||
// topic
|
||||
HardManagerEntity updateObj = HardManagerEntity.builder().id(dto.getId()).build();
|
||||
String topic = createMqConfigByAction(mch.getHardGroupId(), null, null, 1) + "/#";
|
||||
String topic = createMqConfigByAction(deptHardGroup.getHardGroupId(), null, null, 1) + "/#";
|
||||
updateObj.setMainTopic(topic);
|
||||
// client id
|
||||
String clientId = createMqConfigByAction(null, null, dto.getId(), 2);
|
||||
@@ -152,10 +156,14 @@ public class HardManagerServiceImpl extends ServiceImpl<HardManagerMapper, HardM
|
||||
if (ObjectUtil.isEmpty(mch)) {
|
||||
throw new RuntimeException("商户不存在");
|
||||
}
|
||||
dto.setHardGroupId(mch.getHardGroupId());
|
||||
SysDept deptHardGroup = deptService.getParentDeptHardGroup(detail.getDeptId()).getData();
|
||||
if (ObjectUtil.isEmpty(deptHardGroup)) {
|
||||
throw new RuntimeException("请设置顶级部门硬件分组");
|
||||
}
|
||||
dto.setHardGroupId(deptHardGroup.getHardGroupId());
|
||||
if (!ObjectUtil.equals(dto.getMerchantId(), detail.getMerchantId())) {
|
||||
// topic
|
||||
String topic = createMqConfigByAction(mch.getHardGroupId(), null, null, 1) + "/#";
|
||||
String topic = createMqConfigByAction(deptHardGroup.getHardGroupId(), null, null, 1) + "/#";
|
||||
dto.setMainTopic(topic);
|
||||
// client id
|
||||
String clientId = createMqConfigByAction(null, null, dto.getId(), 2);
|
||||
|
||||
Reference in new issue
Block a user