xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpClockInController.java
@@ -1,22 +1,19 @@ package com.xiaopeng.maintenance.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.xiaopeng.api.model.maintenance.XpClockIn; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.common.security.service.TokenService; import com.xiaopeng.maintenance.dto.*; import com.xiaopeng.maintenance.dto.ClockDTO; import com.xiaopeng.maintenance.dto.ClockInStatisticsDto; import com.xiaopeng.maintenance.dto.GetClockInStatisticsDetailsDto; import com.xiaopeng.maintenance.dto.VerifyRangeDTO; import com.xiaopeng.maintenance.service.IXpClockInService; import com.xiaopeng.maintenance.vo.ClockInStatisticsDetailsVo; import com.xiaopeng.maintenance.vo.ClockInStatisticsVo; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpCruiseCheckInRuleController.java
@@ -4,12 +4,16 @@ import com.xiaopeng.api.model.maintenance.XpCruiseCheckInRecord; import com.xiaopeng.api.vo.account.LoginOperationUser; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.common.security.service.TokenService; 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.model.vo.RealTimePositionVo; import com.xiaopeng.maintenance.service.IXpCruiseCheckInRecordService; import com.xiaopeng.maintenance.service.IXpCruiseCheckInRuleService; import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordQuery; import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordVO; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; @@ -31,8 +35,8 @@ @Resource private TokenService tokenService; @Resource private IXpCruiseCheckInRecordService xpCruiseCheckInRecordService; @ApiOperation(value = "获取个人中心巡游打卡任务", tags = {"运维APP-个人中心"}) @GetMapping("/maintenance-app/api/v1/cruiseCheckInRule/getMyXpCruiseCheckInRule") @@ -82,6 +86,7 @@ @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(); @@ -89,4 +94,18 @@ return R.ok(cruiseCheckInRecordInfo); } @ApiOperation(value = "查询巡游打卡记录列表", tags = {"管理后台-巡游打卡管理"}) @PostMapping("/maintenance-admin/api/v1/cruiseCheckInRecord/pageList") public R<PageInfo<XpCruiseCheckInRecordVO>> pageList(@RequestBody XpCruiseCheckInRecordQuery query) { PageInfo<XpCruiseCheckInRecordVO> pageInfo = xpCruiseCheckInRecordService.pageList(query); return R.ok(pageInfo); } @ApiOperation(value = "查询巡游打卡记录详情", tags = {"管理后台-巡游打卡管理"}) @GetMapping("/maintenance-admin/api/v1/cruiseCheckInRecord/{id}") public R<XpCruiseCheckInRecordVO> pageList(@PathVariable("id")Long id) { XpCruiseCheckInRecordVO xpCruiseCheckInRecordVO = xpCruiseCheckInRecordService.detail(id); return R.ok(xpCruiseCheckInRecordVO); } } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/mapper/XpCruiseCheckInRecordMapper.java
@@ -2,6 +2,16 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.xiaopeng.api.model.maintenance.XpCruiseCheckInRecord; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordQuery; import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordVO; import org.apache.ibatis.annotations.Param; import java.util.List; public interface XpCruiseCheckInRecordMapper extends BaseMapper<XpCruiseCheckInRecord> { List<XpCruiseCheckInRecordVO> selectCruiseCheckInRecordList(@Param("pageInfo") PageInfo<XpCruiseCheckInRecordVO> pageInfo, @Param("query") XpCruiseCheckInRecordQuery query); XpCruiseCheckInRecordVO detail(Long id); } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/IXpCruiseCheckInRecordService.java
@@ -2,6 +2,13 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.xiaopeng.api.model.maintenance.XpCruiseCheckInRecord; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordQuery; import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordVO; public interface IXpCruiseCheckInRecordService extends IService<XpCruiseCheckInRecord> { PageInfo<XpCruiseCheckInRecordVO> pageList(XpCruiseCheckInRecordQuery query); XpCruiseCheckInRecordVO detail(Long id); } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRecordServiceImpl.java
@@ -2,10 +2,32 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xiaopeng.api.model.maintenance.XpCruiseCheckInRecord; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.maintenance.mapper.XpCruiseCheckInRecordMapper; import com.xiaopeng.maintenance.service.IXpCruiseCheckInRecordService; import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordQuery; import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordVO; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @Service public class XpCruiseCheckInRecordServiceImpl extends ServiceImpl<XpCruiseCheckInRecordMapper, XpCruiseCheckInRecord> implements IXpCruiseCheckInRecordService { @Resource private XpCruiseCheckInRecordMapper xpCruiseCheckInRecordMapper; @Override public PageInfo<XpCruiseCheckInRecordVO> pageList(XpCruiseCheckInRecordQuery query) { PageInfo<XpCruiseCheckInRecordVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); List<XpCruiseCheckInRecordVO> list = xpCruiseCheckInRecordMapper.selectCruiseCheckInRecordList(pageInfo, query); pageInfo.setRecords(list); return pageInfo; } @Override public XpCruiseCheckInRecordVO detail(Long id) { return xpCruiseCheckInRecordMapper.detail(id); } } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/vo/XpCruiseCheckInRecordQuery.java
New file @@ -0,0 +1,42 @@ package com.xiaopeng.maintenance.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.xiaopeng.common.core.web.page.BasePage; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import java.time.LocalDate; @Data @EqualsAndHashCode(callSuper = true) @ApiModel(value = "巡游打卡记录查询参数") public class XpCruiseCheckInRecordQuery extends BasePage { @ApiModelProperty(value = "巡游结果:1=正常,2=拥堵") private Integer fieldSituation; @ApiModelProperty(value = "打卡状态:1=正常打卡,2=迟到打卡,3=未打卡") private Integer checkInResult; @ApiModelProperty(value = "运维人员姓名(模糊匹配)") private String operationsUserName; @ApiModelProperty(value = "打卡规则名称(模糊匹配)") private String ruleName; @ApiModelProperty(value = "打卡点位名称(模糊匹配)") private String locationAddress; @ApiModelProperty(value = "手机号(精确匹配)") private String phoneNumber; @ApiModelProperty(value = "开始日期") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private LocalDate startDate; @ApiModelProperty(value = "结束日期") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private LocalDate endDate; } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/vo/XpCruiseCheckInRecordVO.java
New file @@ -0,0 +1,54 @@ package com.xiaopeng.maintenance.vo; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; @Data @ApiModel(value = "巡游打卡记录返回VO") public class XpCruiseCheckInRecordVO implements Serializable { @ApiModelProperty(value = "主键") private Long id; @ApiModelProperty(value = "运维人员id") private Long operationsUserId; @ApiModelProperty(value = "运维人员姓名") private String operationsUserName; @ApiModelProperty(value = "运维人员手机号") private String phoneNumber; @ApiModelProperty(value = "打卡点位id") private Long checkLocationId; @ApiModelProperty(value = "打卡点位名称") private String locationAddress; @ApiModelProperty(value = "巡游打卡规则id") private Integer cruiseCheckInRuleId; @ApiModelProperty(value = "打卡规则名称") private String ruleName; @ApiModelProperty(value = "打卡时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime checkInTime; @ApiModelProperty(value = "打卡结果(1=正常打卡,2=迟到打卡,3=未打卡)") private Integer checkInResult; @ApiModelProperty(value = "现场情况(1=正常,2=拥堵)") private Integer fieldSituation; @ApiModelProperty(value = "现场照片JSON数组") private String scenePhoto; @ApiModelProperty(value = "现场情况说明") private String sceneDescription; } xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpCruiseCheckInRecordMapper.xml
@@ -2,4 +2,93 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.xiaopeng.maintenance.mapper.XpCruiseCheckInRecordMapper"> <resultMap id="CruiseCheckInRecordVOMap" type="com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordVO"> <id column="id" property="id"/> <result column="operations_user_id" property="operationsUserId"/> <result column="operations_user_name" property="operationsUserName"/> <result column="phone_number" property="phoneNumber"/> <result column="check_location_id" property="checkLocationId"/> <result column="location_address" property="locationAddress"/> <result column="cruise_check_in_rule_id" property="cruiseCheckInRuleId"/> <result column="rule_name" property="ruleName"/> <result column="check_in_time" property="checkInTime"/> <result column="check_in_result" property="checkInResult"/> <result column="field_situation" property="fieldSituation"/> <result column="scene_photo" property="scenePhoto"/> <result column="scene_description" property="sceneDescription"/> </resultMap> <select id="selectCruiseCheckInRecordList" resultMap="CruiseCheckInRecordVOMap"> SELECT r.id, r.operations_user_id, u.nick_name AS operations_user_name, u.phone_number, r.check_location_id, cl.location_address, r.cruise_check_in_rule_id, cr.name AS rule_name, r.check_in_time, r.check_in_result, r.field_situation, r.scene_photo, r.scene_description FROM xp_cruise_check_in_record r LEFT JOIN xp_operations_user u ON r.operations_user_id = u.id AND u.del_flag = '0' LEFT JOIN xp_check_location cl ON r.check_location_id = cl.id AND cl.del_flag = '0' LEFT JOIN xp_cruise_check_in_rule cr ON r.cruise_check_in_rule_id = cr.id AND cr.del_flag = '0' WHERE r.del_flag = '0' <if test="query.fieldSituation != null"> AND r.field_situation = #{query.fieldSituation} </if> <if test="query.checkInResult != null and query.checkInResult == 3"> AND r.check_in_result IS NULL </if> <if test="query.checkInResult != null and query.checkInResult != 3"> AND r.check_in_result = #{query.checkInResult} </if> <if test="query.operationsUserName != null and query.operationsUserName != ''"> AND u.nick_name LIKE CONCAT('%', #{query.operationsUserName}, '%') </if> <if test="query.ruleName != null and query.ruleName != ''"> AND cr.name LIKE CONCAT('%', #{query.ruleName}, '%') </if> <if test="query.locationAddress != null and query.locationAddress != ''"> AND cl.location_address LIKE CONCAT('%', #{query.locationAddress}, '%') </if> <if test="query.phoneNumber != null and query.phoneNumber != ''"> AND u.phone_number = #{query.phoneNumber} </if> <if test="query.startDate != null"> AND DATE(r.check_in_time) >= #{query.startDate} </if> <if test="query.endDate != null"> AND DATE(r.check_in_time) <= #{query.endDate} </if> ORDER BY r.check_in_time DESC </select> <select id="detail" resultMap="CruiseCheckInRecordVOMap"> SELECT r.id, r.operations_user_id, u.nick_name AS operations_user_name, u.phone_number, r.check_location_id, cl.location_address, r.cruise_check_in_rule_id, cr.name AS rule_name, r.check_in_time, r.check_in_result, r.field_situation, r.scene_photo, r.scene_description FROM xp_cruise_check_in_record r LEFT JOIN xp_operations_user u ON r.operations_user_id = u.id AND u.del_flag = '0' LEFT JOIN xp_check_location cl ON r.check_location_id = cl.id AND cl.del_flag = '0' LEFT JOIN xp_cruise_check_in_rule cr ON r.cruise_check_in_rule_id = cr.id AND cr.del_flag = '0' WHERE r.id = #{id} AND r.del_flag = '0' </select> </mapper>