| | |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.param.InterphoneSubParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.dao.bo.InterphoneSubBo; |
| | | import com.sandu.ximon.dao.domain.InterphoneHostSubPole; |
| | | import com.sandu.ximon.dao.domain.InterphoneSub; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | public boolean addSub(InterphoneSubParam interphoneSubParam) { |
| | | InterphoneSub interphoneSub = new InterphoneSub(); |
| | | BeanUtils.copyProperties(interphoneSubParam, interphoneSub); |
| | | return save(interphoneSub); |
| | | boolean save = save(interphoneSub); |
| | | /** |
| | | * 添加一键求助子设备 日志记录开始 |
| | | */ |
| | | List<String> listCode = new ArrayList<>(1); |
| | | listCode.add(interphoneSub.getSubMac()); |
| | | String content = "{ 设备id:" + interphoneSub.getSubId() + "设备code:" + interphoneSub.getSubMac() + |
| | | "}"; |
| | | |
| | | StoreOperationRecordsUtils.storeOperationData(listCode, null, "添加一键求助子设备", content); |
| | | /** |
| | | * 添加一键求助子设备 日志记录结束 |
| | | */ |
| | | return save; |
| | | } |
| | | |
| | | /** |
| | |
| | | InterphoneSub interphoneSub = new InterphoneSub(); |
| | | BeanUtils.copyProperties(interphoneSubParam, interphoneSub); |
| | | interphoneSub.setSubId(id); |
| | | |
| | | /** |
| | | * 编辑一键求助子设备 日志记录开始 |
| | | */ |
| | | List<String> listCode = new ArrayList<>(1); |
| | | listCode.add(interphoneSub.getSubMac()); |
| | | String content = "{ 设备id:" + interphoneSub.getSubId() + "设备code:" + interphoneSub.getSubMac() + |
| | | "}"; |
| | | |
| | | StoreOperationRecordsUtils.storeOperationData(listCode, null, "编辑一键求助子设备", content); |
| | | /** |
| | | * 编辑一键求助子设备 日志记录结束 |
| | | */ |
| | | |
| | | return updateById(interphoneSub); |
| | | } |
| | | |
| | |
| | | if (byId == null) { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除一键求助子设备 日志记录开始 |
| | | */ |
| | | List<String> listCode = new ArrayList<>(1); |
| | | listCode.add(byId.getSubMac()); |
| | | String content = "{ 设备id:" + byId.getSubId() + "设备code:" + byId.getSubMac() + |
| | | "}"; |
| | | |
| | | StoreOperationRecordsUtils.storeOperationData(listCode, null, "删除一键求助子设备", content); |
| | | /** |
| | | * 删除一键求助子设备 日志记录结束 |
| | | */ |
| | | |
| | | return removeById(id); |
| | | } |
| | | |