| | |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.param.InterphoneHostParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.dao.bo.InterphoneHostBo; |
| | | import com.sandu.ximon.dao.domain.InterphoneHost; |
| | | import com.sandu.ximon.dao.domain.InterphoneHostSubPole; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | public boolean addHost(InterphoneHostParam interphoneHostParam) { |
| | | InterphoneHost interphoneHost = new InterphoneHost(); |
| | | BeanUtils.copyProperties(interphoneHostParam, interphoneHost); |
| | | return save(interphoneHost); |
| | | boolean save = save(interphoneHost); |
| | | /** |
| | | * 添加一键求助主机 日志记录开始 |
| | | */ |
| | | List<String> listCode = new ArrayList<>(1); |
| | | listCode.add(interphoneHost.getHostMac()); |
| | | String content = "{ 设备id:" + interphoneHost.getHostId() + "设备code:" + interphoneHost.getHostMac() + |
| | | "}"; |
| | | |
| | | StoreOperationRecordsUtils.storeOperationData(listCode, null, "添加一键求助主机", content); |
| | | /** |
| | | * 添加一键求助主机 日志记录结束 |
| | | */ |
| | | |
| | | return save; |
| | | } |
| | | |
| | | /** |
| | |
| | | InterphoneHost interphoneHost = new InterphoneHost(); |
| | | interphoneHost.setHostId(id); |
| | | BeanUtils.copyProperties(interphoneHostParam, interphoneHost); |
| | | |
| | | /** |
| | | * 编辑一键求助主机 日志记录开始 |
| | | */ |
| | | List<String> listCode = new ArrayList<>(1); |
| | | listCode.add(interphoneHost.getHostMac()); |
| | | String content = "{ 设备id:" + interphoneHost.getHostId() + "设备code:" + interphoneHost.getHostMac() + |
| | | "}"; |
| | | |
| | | StoreOperationRecordsUtils.storeOperationData(listCode, null, "编辑一键求助主机", content); |
| | | /** |
| | | * 编辑一键求助主机 日志记录结束 |
| | | */ |
| | | return updateById(interphoneHost); |
| | | } |
| | | |
| | |
| | | if (byId == null) { |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 删除一键求助主机 日志记录开始 |
| | | */ |
| | | List<String> listCode = new ArrayList<>(1); |
| | | listCode.add(byId.getHostMac()); |
| | | String content = "{ 设备id:" + byId.getHostId() + "设备code:" + byId.getHostMac() + |
| | | "}"; |
| | | |
| | | StoreOperationRecordsUtils.storeOperationData(listCode, null, "删除一键求助主机", content); |
| | | /** |
| | | * 删除一键求助主机 日志记录结束 |
| | | */ |
| | | |
| | | return removeById(id); |
| | | } |
| | | |