|
@@ -353,7 +353,19 @@ public class IotOpeationFillServiceImpl implements IotOpeationFillService {
|
|
|
|
|
|
List<IotOpeationFillOrderDO> childList = iotOpeationFillMapper.childList(orderDO);
|
|
|
|
|
|
- int randomNum = generate8DigitInteger();
|
|
|
+ int randomNum;
|
|
|
+ IotOpeationFillDO exitDev;
|
|
|
+ IotOpeationFillDO fillDO = new IotOpeationFillDO();
|
|
|
+
|
|
|
+ do {
|
|
|
+ // 生成8位随机整数
|
|
|
+ randomNum = generate8DigitInteger();
|
|
|
+ // 设置设备ID
|
|
|
+ fillDO.setDeviceId((long) randomNum);
|
|
|
+ // 检查数据库中是否已存在
|
|
|
+ exitDev = iotOpeationFillMapper.orderDO1(fillDO);
|
|
|
+ } while (exitDev != null); // 如果存在则继续循环生成新的随机数
|
|
|
+
|
|
|
|
|
|
//如果是根节点,则证明该部门为小队并且属于瑞恒,创建对应日报虚拟设备
|
|
|
if(childList.size()==0){
|