| | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voPr.VoOnLineIntake; |
| | | import com.dy.pipIrrGlobal.voRm.VoCommand; |
| | | import com.dy.pipIrrGlobal.voRm.VoUnclosedParam; |
| | | import com.dy.pipIrrGlobal.voRm.VoUnclosedValve; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | | import com.dy.pipIrrRemote.common.qo.QoCommand; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | public SeClientCard geClientCardByCardId(Long cardId) { |
| | | return seClientCardMapper.selectByPrimaryKey(cardId); |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取命令日志历史记录 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoCommand>> getCommandHistories(QoCommand query) { |
| | | DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | // 完善查询起止时间 |
| | | String timeStart = query.getTimeStart(); |
| | | String timeStop = query.getTimeStop(); |
| | | if(timeStart != null) { |
| | | timeStart = timeStart + " 00:00:00"; |
| | | query.setTimeStart(timeStart); |
| | | } |
| | | if(timeStop != null) { |
| | | timeStop = timeStop + " 23:59:59"; |
| | | query.setTimeStop(timeStop); |
| | | } |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(query); |
| | | |
| | | Long itemTotal = rmCommandHistoryMapper.getCommandHistoriesCount(params); |
| | | |
| | | QueryResultVo<List<VoCommand>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = query.pageSize ; |
| | | rsVo.pageCurr = query.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmCommandHistoryMapper.getCommandHistories(params); |
| | | return rsVo ; |
| | | } |
| | | } |