|
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
|
+import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
|
|
import cn.iocoder.yudao.module.pms.constant.PmsConstants;
|
|
import cn.iocoder.yudao.module.pms.constant.PmsConstants;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotInspectOrderPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotInspectOrderPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotInspectOrderSaveReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotInspectOrderSaveReqVO;
|
|
@@ -235,7 +236,7 @@ public class IotInspectOrderServiceImpl implements IotInspectOrderService {
|
|
iotInspectOrderDO.setDeleted(false);
|
|
iotInspectOrderDO.setDeleted(false);
|
|
iotInspectOrderDO.setChargeName(Objects.nonNull(user)?user.getNickname():"");
|
|
iotInspectOrderDO.setChargeName(Objects.nonNull(user)?user.getNickname():"");
|
|
iotInspectOrderDO.setDeptId(v.get(0).getDeptId());
|
|
iotInspectOrderDO.setDeptId(v.get(0).getDeptId());
|
|
- iotInspectOrderMapper.insert(iotInspectOrderDO);
|
|
|
|
|
|
+ TenantUtils.execute(1L, () -> iotInspectOrderMapper.insert(iotInspectOrderDO));
|
|
List<IotInspectOrderDetailDO> results = new ArrayList<>();
|
|
List<IotInspectOrderDetailDO> results = new ArrayList<>();
|
|
//处理巡检项
|
|
//处理巡检项
|
|
List<IotInspectItemDO> items = iotInspectItemMapper.selectList();
|
|
List<IotInspectItemDO> items = iotInspectItemMapper.selectList();
|
|
@@ -271,9 +272,12 @@ public class IotInspectOrderServiceImpl implements IotInspectOrderService {
|
|
if (CollUtil.isEmpty(results)){
|
|
if (CollUtil.isEmpty(results)){
|
|
throw new RuntimeException();
|
|
throw new RuntimeException();
|
|
}
|
|
}
|
|
- iotInspectOrderDetailMapper.insertBatch(results);
|
|
|
|
- iotInspectPlan.setLastCreateTime(LocalDateTime.now());
|
|
|
|
- iotInspectPlanMapper.updateById(iotInspectPlan);
|
|
|
|
|
|
+ TenantUtils.execute(1L, () -> {
|
|
|
|
+ iotInspectOrderDetailMapper.insertBatch(results);
|
|
|
|
+ iotInspectPlan.setLastCreateTime(LocalDateTime.now());
|
|
|
|
+ iotInspectPlanMapper.updateById(iotInspectPlan);
|
|
|
|
+ });
|
|
|
|
+
|
|
//发送消息
|
|
//发送消息
|
|
pmsMessage.sendMessage(iotInspectOrderDO.getId(), iotInspectOrderDO.getInspectOrderTitle(), PmsConstants.GENERATE_INSPECT, k, user.getMobile());
|
|
pmsMessage.sendMessage(iotInspectOrderDO.getId(), iotInspectOrderDO.getInspectOrderTitle(), PmsConstants.GENERATE_INSPECT, k, user.getMobile());
|
|
});
|
|
});
|