From ebea64fcbd2b7881863755ec38e5cf37cdb60658 Mon Sep 17 00:00:00 2001 From: CeDo <cedoogle@gmail.com> Date: 星期一, 31 五月 2021 14:49:18 +0800 Subject: [PATCH] Merge branch 'test_future_wangge' into test --- springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridMemberGpsLogServiceImpl.java | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 114 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridMemberGpsLogServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridMemberGpsLogServiceImpl.java new file mode 100644 index 0000000..2ce7b69 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridMemberGpsLogServiceImpl.java @@ -0,0 +1,114 @@ +package com.panzhihua.service_grid.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.panzhihua.common.model.dtos.grid.EventGridMemberGpsLogAddDTO; +import com.panzhihua.common.model.dtos.grid.EventGridMemberGpsLogDeleteDTO; +import com.panzhihua.common.model.dtos.grid.EventGridMemberGpsLogEditDTO; +import com.panzhihua.common.model.dtos.grid.PageEventGridMemberGpsLogDTO; +import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.grid.EventGridMemberGpsLogDetailsVO; +import com.panzhihua.common.model.vos.grid.EventGridMemberGpsLogVO; +import com.panzhihua.service_grid.dao.*; +import com.panzhihua.service_grid.model.dos.*; +import com.panzhihua.service_grid.service.EventGridMemberGpsLogService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.beans.BeanUtils; + +import javax.annotation.Resource; +import java.util.Date; + +/** + * @auther lyq + * @create 2021-04-14 15:03:01 + * @describe 订单表服务实现类 + */ +@Slf4j +@Service +public class EventGridMemberGpsLogServiceImpl extends ServiceImpl<EventGridMemberGpsLogMapper, EventGridMemberGpsLogDO> implements EventGridMemberGpsLogService { + + @Resource + private EventGridMemberGpsLogMapper eventGridMemberGpsLogMapper; + /** + * 新增网格员定时上报地理信息 + * @param eventGridMemberGpsLogAddDTO + * @return 新增结果 + */ + public R add(EventGridMemberGpsLogAddDTO eventGridMemberGpsLogAddDTO){ + EventGridMemberGpsLogDO eventGridMemberGpsLogDO = new EventGridMemberGpsLogDO(); + BeanUtils.copyProperties(eventGridMemberGpsLogAddDTO, eventGridMemberGpsLogDO); + eventGridMemberGpsLogDO.setCreateAt(new Date()); + if(eventGridMemberGpsLogMapper.insert(eventGridMemberGpsLogDO)>0){ + return R.ok(); + } + return R.fail(); + } + + /** + * 修改网格员定时上报地理信息 + * @param eventGridMemberGpsLogEditDTO + * @return 维护结果 + */ + public R edit(EventGridMemberGpsLogEditDTO eventGridMemberGpsLogEditDTO){ + EventGridMemberGpsLogDO eventGridMemberGpsLogDO = new EventGridMemberGpsLogDO(); + BeanUtils.copyProperties(eventGridMemberGpsLogEditDTO, eventGridMemberGpsLogDO); + //eventGridMemberGpsLogDO.setUpdateAt(new Date()); + if(eventGridMemberGpsLogMapper.updateById(eventGridMemberGpsLogDO)>0){ + return R.ok(); + } + return R.fail(); + } + + /** + * 分页查找网格员定时上报地理信息 + * @param pageEventGridMemberGpsLogDTO + * @return 维护结果 + */ + public R<IPage<EventGridMemberGpsLogVO>> query(PageEventGridMemberGpsLogDTO pageEventGridMemberGpsLogDTO){ + Page page = new Page(1,10); + if(pageEventGridMemberGpsLogDTO.getPageNum()!=null) { + page.setCurrent(pageEventGridMemberGpsLogDTO.getPageNum()); + } + if(pageEventGridMemberGpsLogDTO.getPageSize()!=null) { + page.setSize(pageEventGridMemberGpsLogDTO.getPageSize()); + } + return R.ok(eventGridMemberGpsLogMapper.findByPage(page, pageEventGridMemberGpsLogDTO)); + } + + /** + * 删除网格员定时上报地理信息 + * @param EventGridMemberGpsLogDeleteDTO + * @return 平台用户信息 + */ + public R delete(EventGridMemberGpsLogDeleteDTO EventGridMemberGpsLogDeleteDTO){ + return R.fail(); + } + + /** + * 查询网格员定时上报地理信息详细信息 + * @param id 网格员定时上报地理信息 id + * @return 查找结果 + */ + public R<EventGridMemberGpsLogDetailsVO> eventGridMemberGpsLogDetails(Long id){ + EventGridMemberGpsLogDO eventGridMemberGpsLogDO = eventGridMemberGpsLogMapper.selectById(id); + if(eventGridMemberGpsLogDO!=null) { + EventGridMemberGpsLogDetailsVO eventGridMemberGpsLogDetailsVO = new EventGridMemberGpsLogDetailsVO(); + BeanUtils.copyProperties(eventGridMemberGpsLogDO, eventGridMemberGpsLogDetailsVO); + return R.ok(eventGridMemberGpsLogDetailsVO); + } + return R.fail(); + } + + /** + * 根据网格员id查询今日轨迹 + * @param userId 网格员id + * @return 网格员今日轨迹 + */ + @Override + public R getTrajectoryByApp(Long userId){ + return R.ok(this.baseMapper.getTrajectoryByApp(userId)); + } + +} -- Gitblit v1.7.1