| | |
| | | package com.dy.pipIrrApp.inspect; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrApp.inspect.qo.QoInspect; |
| | | import com.dy.pipIrrGlobal.daoOp.OpeInspectMapper; |
| | | import com.dy.pipIrrGlobal.daoOp.OpeTrackMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeInspect; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeTrack; |
| | | import com.dy.pipIrrGlobal.voOp.VoInspect; |
| | | import com.dy.pipIrrGlobal.voOp.VoIssueReport; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | |
| | | @Autowired |
| | | private OpeTrackMapper opeTrackMapper; |
| | | |
| | | /** |
| | | * 添加巡检记录 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Long addInspect(OpeInspect po) { |
| | | opeInspectMapper.insert(po); |
| | | return po.getId(); |
| | | } |
| | | |
| | | /** |
| | | * 修改巡检记录 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Integer updateInspect(OpeInspect po) { |
| | | return opeInspectMapper.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | /** |
| | | * 批量添加巡检轨迹 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public Integer insertTracks(List<OpeTrack> list) { |
| | | return opeTrackMapper.insertTracks(list); |
| | | } |
| | | |
| | | /** |
| | | * 巡检查询 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoInspect>> getInspects(QoInspect queryVo) { |
| | | //完善查询充值记录的起止时间 |
| | | String timeStart = queryVo.getTimeStart(); |
| | | String timeStop = queryVo.getTimeStop(); |
| | | if (timeStart != null) { |
| | | timeStart = timeStart + " 00:00:00"; |
| | | queryVo.setTimeStart(timeStart); |
| | | } |
| | | if (timeStop != null) { |
| | | timeStop = timeStop + " 23:59:59"; |
| | | queryVo.setTimeStop(timeStop); |
| | | } |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = opeInspectMapper.getInspectsCount(params); |
| | | QueryResultVo<List<VoInspect>> rsVo = new QueryResultVo<>(); |
| | | |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | |
| | | List<VoInspect> inspects = opeInspectMapper.getInspects(params); |
| | | for (int i = 0; i < inspects.size(); i++) { |
| | | inspects.get(i).setTracks(opeTrackMapper.selectByInspectId(inspects.get(i).getInspectId())); |
| | | } |
| | | rsVo.obj = inspects; |
| | | return rsVo; |
| | | } |
| | | } |