| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xiaopeng.api.model.maintenance.XpCruiseCheckInRecord; |
| | | import com.xiaopeng.api.model.maintenance.XpCruiseCheckInRule; |
| | | import com.xiaopeng.api.model.operation.SysOperLog; |
| | | import com.xiaopeng.api.vo.account.LoginOperationUser; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.utils.poi.ExcelUtil; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.maintenance.dto.XpCruiseCheckInRuleDto; |
| | | import com.xiaopeng.maintenance.dto.XpCruiseCheckInRuleListPageDto; |
| | | import com.xiaopeng.maintenance.model.vo.AppXpCruiseCheckInLocationVo; |
| | | import com.xiaopeng.maintenance.model.vo.AppXpCruiseCheckInRuleVo; |
| | | import com.xiaopeng.maintenance.model.vo.CheckInMessageVo; |
| | |
| | | import com.xiaopeng.maintenance.service.IXpCruiseCheckInRuleService; |
| | | import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordQuery; |
| | | import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordVO; |
| | | import com.xiaopeng.maintenance.vo.XpCruiseCheckInRuleListPage; |
| | | import com.xiaopeng.maintenance.vo.XpCruiseCheckInStatisticsQuery; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @ApiOperation(value = "巡游打卡操作", tags = {"运维APP-个人中心"}) |
| | | @PostMapping("/maintenance-app/api/v1/cruiseCheckInRule/saveCruiseCheckInRecord") |
| | | public R<?> saveCruiseCheckInRecord(@RequestBody XpCruiseCheckInRecord dto){ |
| | | public R<XpCruiseCheckInRecord> saveCruiseCheckInRecord(@RequestBody XpCruiseCheckInRecord dto){ |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | dto.setOperationsUserId(loginOperationUser.getId()); |
| | | xpCruiseCheckInRuleService.saveCruiseCheckInRecord(dto); |
| | | return R.ok(); |
| | | Long id = xpCruiseCheckInRuleService.saveCruiseCheckInRecord(dto); |
| | | XpCruiseCheckInRecord cruiseCheckInRecordInfo = xpCruiseCheckInRecordService.getById(id); |
| | | return R.ok(cruiseCheckInRecordInfo); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiImplicitParam(value = "任务id", name = "id", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(value = "打卡点位id", name = "locationId", required = true, dataType = "Long") |
| | | }) |
| | | |
| | | @GetMapping("/maintenance-app/api/v1/cruiseCheckInRule/getCruiseCheckInRecordInfo/{id}/{locationId}") |
| | | public R<XpCruiseCheckInRecord> getCruiseCheckInRecordInfo(@PathVariable("id") Integer id, @PathVariable("locationId") Long locationId) { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | XpCruiseCheckInRecord cruiseCheckInRecordInfo = xpCruiseCheckInRuleService.getCruiseCheckInRecordInfo(id, locationId, loginOperationUser.getId()); |
| | | return R.ok(cruiseCheckInRecordInfo); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "查询巡游打卡规则列表", tags = {"管理后台-巡游打卡规则管理"}) |
| | | @PostMapping("/maintenance-admin/api/v1/cruiseCheckInRecord/getXpCruiseCheckInRuleListPage") |
| | | public R<Page<XpCruiseCheckInRuleListPage>> getXpCruiseCheckInRuleListPage(XpCruiseCheckInRuleListPageDto dto){ |
| | | Page<XpCruiseCheckInRuleListPage> pageInfo = PageInfo.of(dto.getPageNum(), dto.getPageSize()); |
| | | List<XpCruiseCheckInRuleListPage> xpCruiseCheckInRuleListPage = xpCruiseCheckInRuleService.getXpCruiseCheckInRuleListPage(pageInfo, dto); |
| | | pageInfo.setRecords(xpCruiseCheckInRuleListPage); |
| | | return R.ok(pageInfo); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "添加巡游打卡规则", tags = {"管理后台-巡游打卡规则管理"}) |
| | | @PostMapping("/maintenance-admin/api/v1/cruiseCheckInRecord/addXpCruiseCheckInRule") |
| | | public R<?> addXpCruiseCheckInRule(@RequestBody XpCruiseCheckInRuleDto dto){ |
| | | xpCruiseCheckInRuleService.addXpCruiseCheckInRule(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除巡游打卡规则", tags = {"管理后台-巡游打卡规则管理"}) |
| | | @PostMapping("/maintenance-admin/api/v1/cruiseCheckInRecord/delXpCruiseCheckInRule/{id}") |
| | | public R<?> delXpCruiseCheckInRule(@PathVariable("id") Integer id){ |
| | | xpCruiseCheckInRuleService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查询巡游打卡记录列表", tags = {"管理后台-巡游打卡管理"}) |
| | | @PostMapping("/maintenance-admin/api/v1/cruiseCheckInRecord/pageList") |
| | |
| | | return R.ok(xpCruiseCheckInRecordService.statistics(query)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询巡游打卡记录列表导出", tags = {"管理后台-巡游打卡管理"}) |
| | | @PostMapping("/maintenance-admin/api/v1/cruiseCheckInRecord/export") |
| | | public R<PageInfo<XpCruiseCheckInRecordVO>> pageListExport(@RequestBody XpCruiseCheckInRecordQuery query, HttpServletResponse response) { |
| | | List<XpCruiseCheckInRecordVO> list = xpCruiseCheckInRecordService.all(query); |
| | | ExcelUtil<XpCruiseCheckInRecordVO> util = new ExcelUtil<>(XpCruiseCheckInRecordVO.class); |
| | | util.exportExcel(response, list, "巡游打卡记录"); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |