|
|
@ -1,27 +1,15 @@ |
|
|
|
package com.zc.business.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.ruoyi.common.annotation.DataSource; |
|
|
|
import com.ruoyi.common.constant.HttpStatus; |
|
|
|
import com.ruoyi.common.core.domain.AjaxResult; |
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser; |
|
|
|
import com.ruoyi.common.enums.DataSourceType; |
|
|
|
import com.ruoyi.common.utils.SecurityUtils; |
|
|
|
import com.ruoyi.common.utils.StringUtils; |
|
|
|
import com.zc.business.controller.DcDeviceController; |
|
|
|
import com.zc.business.domain.DcBoardPublish; |
|
|
|
import com.zc.business.domain.DcBoardReleaseLog; |
|
|
|
import com.zc.business.domain.DcDevice; |
|
|
|
import com.zc.business.domain.MdDeviceData; |
|
|
|
import com.zc.business.mapper.DcBoardReleaseLogMapper; |
|
|
|
import com.zc.business.mapper.MiddleDatabaseMapper; |
|
|
|
import com.zc.business.service.IDcBoardService; |
|
|
|
import com.zc.business.service.IMiddleDatabaseService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
* 中间库Service业务层处理 |
|
|
@ -36,9 +24,6 @@ public class MiddleDatabaseServiceImpl implements IMiddleDatabaseService { |
|
|
|
@Autowired |
|
|
|
private MiddleDatabaseMapper middleDatabaseMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private DcDeviceController deviceController; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 中间库新增设备数据 |
|
|
@ -52,4 +37,21 @@ public class MiddleDatabaseServiceImpl implements IMiddleDatabaseService { |
|
|
|
{ |
|
|
|
return middleDatabaseMapper.insertMiddleDatabaseDeviceData(mdDeviceData); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 更新中间库设备 |
|
|
|
* |
|
|
|
* @param listDevice 设备列表 |
|
|
|
* @return 结果 |
|
|
|
*/ |
|
|
|
@DataSource(value = DataSourceType.SLAVE)//切换数据源
|
|
|
|
@Override |
|
|
|
public boolean updateMiddleDatabaseDevice(List<DcDevice> listDevice) |
|
|
|
{ |
|
|
|
for (DcDevice dcDevice : listDevice) { |
|
|
|
middleDatabaseMapper.updateMiddleDatabaseDevice(dcDevice); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|