| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.dao.domain.DeviceOperationLog; |
| | | import com.sandu.ximon.dao.domain.InnerFrameData; |
| | | import com.sandu.ximon.dao.mapper.InnerFrameDataMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author LHN |
| | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class InnerFrameDataService extends BaseServiceImpl<InnerFrameDataMapper, InnerFrameData> { |
| | | /** |
| | | * 获取帧日志列表 |
| | | * |
| | | * @param baseConditionVO |
| | | * @param deviceCode |
| | | * @param operation |
| | | * @return |
| | | */ |
| | | public List<InnerFrameData> getLogList(BaseConditionVO baseConditionVO, String deviceCode, String operation) { |
| | | |
| | | LambdaQueryWrapper<InnerFrameData> lambdaQueryWrapper = Wrappers.lambdaQuery(InnerFrameData.class); |
| | | if (deviceCode != null && deviceCode.trim().length() != 0) { |
| | | lambdaQueryWrapper.like(InnerFrameData::getDeviceCode, deviceCode); |
| | | } |
| | | if (operation != null && operation.trim().length() != 0) { |
| | | lambdaQueryWrapper.like(InnerFrameData::getOperation, operation); |
| | | } |
| | | lambdaQueryWrapper.orderByDesc(InnerFrameData::getId); |
| | | |
| | | if (baseConditionVO != null) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | } |
| | | List<InnerFrameData> list = list(lambdaQueryWrapper); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 保存操作帧数据 |
| | |
| | | * @param frame |
| | | * @param frameResult |
| | | */ |
| | | public void add(String deviceCode, String operation, String syncType, String frame, String frameResult) { |
| | | public void storeInnerFrameData(String deviceCode, String operation, String syncType, String frame, String frameResult) { |
| | | |
| | | InnerFrameData innerFrameData = new InnerFrameData(); |
| | | innerFrameData.setDeviceCode(deviceCode); |
| | | innerFrameData.setOperation(operation); |
| | | innerFrameData.setSyncType(syncType); |
| | | innerFrameData.setFrame(frame); |
| | | innerFrameData.setFrameResult(frameResult); |
| | | try { |
| | | InnerFrameData innerFrameData = new InnerFrameData(); |
| | | innerFrameData.setDeviceCode(deviceCode); |
| | | innerFrameData.setOperation(operation); |
| | | innerFrameData.setSyncType(syncType); |
| | | innerFrameData.setFrame(frame); |
| | | innerFrameData.setFrameResult(frameResult); |
| | | |
| | | save(innerFrameData); |
| | | save(innerFrameData); |
| | | } catch (Exception e) { |
| | | System.out.println("存储操作帧失败,数据异常"); |
| | | } |
| | | } |
| | | |
| | | |
| | | public List<String> operationList() { |
| | | return baseMapper.operationList(); |
| | | } |
| | | } |