Merge remote-tracking branch 'origin/master'
| | |
| | | package com.xiaopeng.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.xiaopeng.account.model.dto.QualificationReviewDTO; |
| | | import com.xiaopeng.account.model.query.XpQualificationAuditQuery; |
| | | import com.xiaopeng.account.service.IXpQualificationAuditService; |
| | | import com.xiaopeng.api.vo.account.XpQualificationAuditVO; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/xp-qualification-audit") |
| | | @Api(tags = "资质审核记录") |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class XpQualificationAuditController { |
| | | |
| | | @Autowired |
| | | private IXpQualificationAuditService xpQualificationAuditService; |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 管理后台-综合审核-人员资质审核分页列表 |
| | | */ |
| | | @ApiOperation(value = "管理后台-综合审核-人员资质审核分页列表", tags = {"管理后台-服务中心"}) |
| | | @PostMapping("/api/v1/qualificationAudit/pageList") |
| | | public R<PageInfo<XpQualificationAuditVO>> pageList(@RequestBody XpQualificationAuditQuery query) { |
| | | PageInfo<XpQualificationAuditVO> pageList = xpQualificationAuditService.pageList(query); |
| | | return R.ok(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台-综合审核-人员资质审核 |
| | | */ |
| | | @ApiOperation(value = "管理后台-综合审核-人员资质批量审核(单审核共用)", tags = {"管理后台-服务中心"}) |
| | | @PostMapping("/api/v1/qualificationAudit/audit") |
| | | public R<String> audit(@RequestBody QualificationReviewDTO dto) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | xpQualificationAuditService.audit(dto,userid); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台-综合审核-人员资质审核删除 |
| | | */ |
| | | @ApiOperation(value = "管理后台-综合审核-人员资质审核删除", tags = {"管理后台-服务中心"}) |
| | | @DeleteMapping("/api/v1/qualificationAudit/deleteById") |
| | | public R<String> deleteById(@RequestParam Long id) { |
| | | xpQualificationAuditService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.xiaopeng.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xiaopeng.account.model.query.XpQualificationAuditQuery; |
| | | import com.xiaopeng.api.model.account.XpQualificationAudit; |
| | | import com.xiaopeng.api.vo.account.XpQualificationAuditVO; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface XpQualificationAuditMapper extends BaseMapper<XpQualificationAudit> { |
| | | |
| | | /** |
| | | * 列表查询 |
| | | * |
| | | * @param pageInfo 分页参数 |
| | | * @param query 查询参数 |
| | | * @return 分页数据 |
| | | */ |
| | | List<XpQualificationAuditVO> pageList(@Param("pageInfo") PageInfo<XpQualificationAuditVO> pageInfo, @Param("query")XpQualificationAuditQuery query); |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.account.model.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "资质审核DTO", description = "资质审核DTO") |
| | | public class QualificationReviewDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "资质审核id集合") |
| | | private List<Long> ids; |
| | | |
| | | @ApiModelProperty(value = "审核状态 1待审核 2审核通过 3审核驳回") |
| | | private Integer auditStatus; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.account.model.query; |
| | | |
| | | import com.xiaopeng.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "资质审核记录查询参数XpQualificationAuditQuery") |
| | | public class XpQualificationAuditQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "员工姓名") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phoneNumber; |
| | | |
| | | @ApiModelProperty(value = "角色id") |
| | | private Long roleId; |
| | | |
| | | @ApiModelProperty(value = "审核状态 1待审核 2审核通过 3审核驳回") |
| | | private Integer auditStatus; |
| | | |
| | | } |
| | |
| | | package com.xiaopeng.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.account.model.dto.QualificationReviewDTO; |
| | | import com.xiaopeng.account.model.query.XpQualificationAuditQuery; |
| | | import com.xiaopeng.api.model.account.XpQualificationAudit; |
| | | import com.xiaopeng.api.vo.account.XpQualificationAuditVO; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface IXpQualificationAuditService extends IService<XpQualificationAudit> { |
| | | |
| | | /** |
| | | * 管理后台-综合审核-人员资质审核 |
| | | * |
| | | * @param query 查询参数 |
| | | * @return 列表 |
| | | */ |
| | | PageInfo<XpQualificationAuditVO> pageList(XpQualificationAuditQuery query); |
| | | |
| | | /** |
| | | * 管理后台-综合审核-人员资质审核 |
| | | * |
| | | * @param dto 参数 |
| | | * @param userid 用户id |
| | | */ |
| | | void audit(QualificationReviewDTO dto, Long userid); |
| | | |
| | | } |
| | |
| | | package com.xiaopeng.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xiaopeng.account.mapper.SysRoleMapper; |
| | | import com.xiaopeng.account.mapper.XpOperationsRoleMapper; |
| | | import com.xiaopeng.account.mapper.XpOperationsUserMapper; |
| | | import com.xiaopeng.account.mapper.XpQualificationAuditMapper; |
| | | import com.xiaopeng.account.model.dto.QualificationReviewDTO; |
| | | import com.xiaopeng.account.model.query.XpQualificationAuditQuery; |
| | | import com.xiaopeng.account.service.ISysRoleService; |
| | | import com.xiaopeng.account.service.IXpQualificationAuditService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.model.account.SysRole; |
| | | import com.xiaopeng.api.model.account.XpOperationsRole; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.model.account.XpQualificationAudit; |
| | | import com.xiaopeng.api.vo.account.XpQualificationAuditVO; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class XpQualificationAuditServiceImpl extends ServiceImpl<XpQualificationAuditMapper, XpQualificationAudit> implements IXpQualificationAuditService { |
| | | |
| | | @Autowired |
| | | private XpOperationsRoleMapper xpOperationsRoleMapper; |
| | | @Autowired |
| | | private SysRoleMapper sysRoleMapper; |
| | | |
| | | @Override |
| | | public PageInfo<XpQualificationAuditVO> pageList(XpQualificationAuditQuery query) { |
| | | PageInfo<XpQualificationAuditVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<XpQualificationAuditVO> list = this.baseMapper.pageList(pageInfo, query); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | |
| | | // 查询角色名称 |
| | | List<Long> operationsUserIds = list.stream().map(XpQualificationAuditVO::getOperationsUserId).collect(Collectors.toList()); |
| | | |
| | | // 查询用户信息 |
| | | List<XpOperationsRole> xpOperationsRoles = xpOperationsRoleMapper.selectList(Wrappers.lambdaQuery(XpOperationsRole.class) |
| | | .in(XpOperationsRole::getOperationsUserId, operationsUserIds)); |
| | | |
| | | if(!CollectionUtils.isEmpty(xpOperationsRoles)){ |
| | | List<Long> roleIds = xpOperationsRoles.stream().map(XpOperationsRole::getRoleId).collect(Collectors.toList()); |
| | | // 查询列表关联的所有角色 |
| | | List<SysRole> sysRoles = sysRoleMapper.selectList(Wrappers.lambdaQuery(SysRole.class) |
| | | .in(SysRole::getId, roleIds)); |
| | | if(!CollectionUtils.isEmpty(sysRoles)){ |
| | | |
| | | // 角色匹配账号id |
| | | Map<Long, List<SysRole>> map = new HashMap<>(); |
| | | for (XpOperationsRole xpOperationsRole : xpOperationsRoles) { |
| | | List<SysRole> sysRoleList = sysRoles.stream().filter(sysRole -> sysRole.getId().equals(xpOperationsRole.getRoleId())).collect(Collectors.toList()); |
| | | map.put(xpOperationsRole.getOperationsUserId(), sysRoleList); |
| | | } |
| | | |
| | | // 角色名称匹配 |
| | | for (XpQualificationAuditVO xpQualificationAuditVO : list) { |
| | | map.get(xpQualificationAuditVO.getOperationsUserId()).forEach(sysRole -> { |
| | | xpQualificationAuditVO.getRoleNames().add(sysRole.getRoleName()); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public void audit(QualificationReviewDTO dto, Long userid) { |
| | | List<XpQualificationAudit> qualificationAudits = this.listByIds(dto.getIds()); |
| | | for (XpQualificationAudit qualificationAudit : qualificationAudits) { |
| | | qualificationAudit.setAuditUserId(userid); |
| | | qualificationAudit.setAuditTime(LocalDateTime.now()); |
| | | qualificationAudit.setAuditStatus(dto.getAuditStatus()); |
| | | // qualificationAudit.setAuditRemarks(dto.getAuditRemarks()); |
| | | } |
| | | this.updateBatchById(qualificationAudits); |
| | | } |
| | | } |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, operations_user_id, id_card_front, id_card_back, driver_license, certificate_of_no_criminal_record, training_graduation_certificate, audit_user_id, audit_time, audit_status, is_deleted, create_time, update_time, create_by, update_by |
| | | </sql> |
| | | <select id="pageList" resultType="com.xiaopeng.api.vo.account.XpQualificationAuditVO"> |
| | | select xqa.id, xqa.operations_user_id, xqa.id_card_front, xqa.id_card_back, xqa.driver_license, |
| | | xqa.certificate_of_no_criminal_record, xqa.training_graduation_certificate, |
| | | xqa.audit_user_id, xqa.audit_time, xqa.audit_status, xqa.create_time, |
| | | xou.nick_name, xou.phone_number, xou.avatar,xou.unique_number |
| | | from xp_qualification_audit xqa |
| | | left join xp_operations_user xou on xqa.operations_user_id = xou.id |
| | | left join xp_operations_role xor on xou.id = xor.operations_user_id |
| | | <where> |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | | and xou.nick_name like concat('%',#{query.nickName},'%') |
| | | </if> |
| | | <if test="query.phoneNumber != null and query.phoneNumber != ''"> |
| | | and xou.phone_number like concat('%',#{query.phoneNumber},'%') |
| | | </if> |
| | | <if test="query.roleId != null"> |
| | | and xor.role_id = #{query.roleId} |
| | | </if> |
| | | <if test="query.auditStatus != null"> |
| | | and xqa.audit_status = #{query.auditStatus} |
| | | </if> |
| | | AND xqa.is_deleted = 0 |
| | | </where> |
| | | order by xqa.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R deletePoint(String ids) { |
| | | log.error("删除点位失败:{}", cause.getMessage()); |
| | | return R.fail("删除点位失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R enableDisable(XpPointEnableDisableDto dto) { |
| | | log.error("修改点位运营状态失败:{}", cause.getMessage()); |
| | | return R.fail("修改点位运营状态失败"); |
| | |
| | | */ |
| | | @GetMapping("/api/v1/point/queryPointById") |
| | | public R<XpPoint> queryById(@RequestParam Long id); |
| | | /** |
| | | * 点位删除 |
| | | */ |
| | | @GetMapping("/api/v1/point/deletePoint") |
| | | R deletePoint(@RequestParam("ids") String ids); |
| | | |
| | | /** |
| | | * 启用/禁用 |
| New file |
| | |
| | | package com.xiaopeng.api.vo.account; |
| | | |
| | | import com.xiaopeng.api.model.account.XpQualificationAudit; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "运维人员资质证书审核记录XpQualificationAuditVO", description = "运维人员资质证书审核记录VO") |
| | | public class XpQualificationAuditVO extends XpQualificationAudit { |
| | | |
| | | @ApiModelProperty(value = "员工姓名") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phoneNumber; |
| | | |
| | | @ApiModelProperty(value = "角色名称") |
| | | private List<String> roleNames; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty(value = "唯一编号") |
| | | private String uniqueNumber; |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.api.vo.operation; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @lombok.Data |
| | | @ApiModel(description = "计价规则时段Vo") |
| | | public class PricingDetailVo { |
| | | |
| | | |
| | | @ApiModelProperty(value = "时段 1普通 2夜间行驶 3高峰期 4节假日") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "金额") |
| | | private BigDecimal amount; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.api.vo.operation; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.util.List; |
| | | |
| | | @lombok.Data |
| | | @ApiModel(description = "计价规则Vo") |
| | | public class PricingVo { |
| | | @ApiModelProperty(value = "起步价") |
| | | private Double startAmount; |
| | | @ApiModelProperty(value = "起步价公里") |
| | | private Double startMileage; |
| | | @ApiModelProperty(value = "起步价分钟") |
| | | private Double startMinute; |
| | | @ApiModelProperty(value = "起步价时段") |
| | | private List<PricingDetailVo> startTimes; |
| | | @ApiModelProperty(value = "里程费时段") |
| | | private List<PricingDetailVo> mileageTimes; |
| | | @ApiModelProperty(value = "时长费") |
| | | private List<PricingDetailVo> durationTimes; |
| | | @ApiModelProperty(value = "远途费") |
| | | private List<PricingDetailVo> longDistanceTimes; |
| | | |
| | | } |
| | |
| | | long sequence = snowFlake.nextId(); |
| | | MqttPublishDto mqttPublishDto = xpuUtil.cloudCreateOrder(task, dto.getVin(),sequence); |
| | | if (mqttPublishDto.getCode()== 200) { |
| | | // 修改车子为微单状态 |
| | | // 修改车子为接单状态 |
| | | xpVehicleClient.updateVehicleStatus(new UpdateVehicleStateDto(dto.getVin(),1)); |
| | | |
| | | return R.ok(true); |
| | |
| | | private UserVehicleClient userVehicleClient; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 消费消息 - XPU上报Robotaxi云端的消息topic(高优先级) |
| | | * |
| | |
| | | * @param msgContent |
| | | * @param message |
| | | */ |
| | | public void handleXPUMessage(MsgContent msgContent, String message){ |
| | | public void handleXPUMessage(MsgContent msgContent, String message) { |
| | | RtMsgHeader header = msgContent.getHeader(); |
| | | MessageType type = header.getType(); |
| | | //处理请求消息 |
| | |
| | | |
| | | } |
| | | //消息应答 |
| | | if(MessageType.MESSAGE_TYPE_RESPONSE == type){ |
| | | if (MessageType.MESSAGE_TYPE_RESPONSE == type) { |
| | | com.xiaopeng.api.vo.automaticPilot.proto.up.ResponseMessage resposne = msgContent.getContent_detail().getObject("resposne", com.xiaopeng.api.vo.automaticPilot.proto.up.ResponseMessage.class); |
| | | com.xiaopeng.api.vo.automaticPilot.proto.up.StatusCode code = resposne.getCode(); |
| | | Long requestSeq = resposne.getRequest_seq(); |
| | | if(code == com.xiaopeng.api.vo.automaticPilot.proto.up.StatusCode.OK){ |
| | | if (code == com.xiaopeng.api.vo.automaticPilot.proto.up.StatusCode.OK) { |
| | | Object sequence = redisTemplate.opsForValue().get(requestSeq); |
| | | if(sequence!=null){ |
| | | if (sequence != null) { |
| | | String[] split = sequence.toString().split("_"); |
| | | if(split[0].equals("pushOrder")){ |
| | | if (split[0].equals("pushOrder")) { |
| | | PopOrderDto dto = new PopOrderDto(); |
| | | dto.setOrderId(Long.valueOf(split[1])); |
| | | dto.setXpVehicleVin(split[2]); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | userVehicleClient.cancelTaxiPassenger(cancelTaxiPassengerVo); |
| | | } |
| | | // 取消订单 |
| | | R<?> r = xpOrderClient.cancelOrder(String.valueOf(xpOrder.getId())); |
| | | if (r.getCode() == R.SUCCESS){ |
| | | log.info("取消订单成功"); |
| | | // TODO 重新派单 |
| | | ReassignOrderDTO reassignOrderDTO = new ReassignOrderDTO(); |
| | | reassignOrderDTO.setUid(xpOrder.getAppUserId().toString()); |
| | | reassignOrderDTO.setOrderNo(xpOrder.getOrderNumber()); |
| | | reassignOrderDTO.setCount(10); |
| | | RealtimePose pose = systemRuntimeStatus.getPose(); |
| | | Wgs naviPose = pose.getNavi_pose(); |
| | | Double latitude = naviPose.getLatitude(); |
| | | Double longitude = naviPose.getLongitude(); |
| | | reassignOrderDTO.setLongitude(longitude); |
| | | reassignOrderDTO.setLatitude(latitude); |
| | | reassignOrderClient.reassignOrder(reassignOrderDTO); |
| | | } |
| | | // R<?> r = xpOrderClient.cancelOrder(String.valueOf(xpOrder.getId())); |
| | | // if (r.getCode() == R.SUCCESS){ |
| | | log.info("取消订单成功"); |
| | | // TODO 重新派单 |
| | | ReassignOrderDTO reassignOrderDTO = new ReassignOrderDTO(); |
| | | reassignOrderDTO.setUid(xpOrder.getAppUserId().toString()); |
| | | reassignOrderDTO.setOrderNo(xpOrder.getOrderNumber()); |
| | | reassignOrderDTO.setCount(10); |
| | | RealtimePose pose = systemRuntimeStatus.getPose(); |
| | | Wgs naviPose = pose.getNavi_pose(); |
| | | Double latitude = naviPose.getLatitude(); |
| | | Double longitude = naviPose.getLongitude(); |
| | | reassignOrderDTO.setLongitude(longitude); |
| | | reassignOrderDTO.setLatitude(latitude); |
| | | reassignOrderClient.reassignOrder(reassignOrderDTO); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // } |
| | | } |
| | | } |
| | | |
| | |
| | | snowFlake.withStartTimestamp(1420041600000L); |
| | | long sequence = snowFlake.nextId(); |
| | | // 处理数据 |
| | | redisTemplate.opsForValue().set(sequence,"pushOrder_"+orderId+"_"+vin,30, TimeUnit.MINUTES); |
| | | redisTemplate.opsForValue().set(sequence, "pushOrder_" + orderId + "_" + vin, 30, TimeUnit.MINUTES); |
| | | //开发发送请求到XPU |
| | | xpuUtil.cloudOrderOperation(orderOperation, vin,sequence); |
| | | xpuUtil.cloudOrderOperation(orderOperation, vin, sequence); |
| | | } |
| | | |
| | | |
| | |
| | | * @param orderId |
| | | * @param status |
| | | */ |
| | | public void buildPushOrderStatus(String orderId, OrderStatusEnum status, Long sequence){ |
| | | if(orderId.contains("XU")){ |
| | | public void buildPushOrderStatus(String orderId, OrderStatusEnum status, Long sequence) { |
| | | if (orderId.contains("XU")) { |
| | | //巡游单 |
| | | //响应消息 |
| | | // TODO 1.处理结束当前巡游订单 2.创建新的巡游订单 返航 3.调用xpu车机接口 (判断是返航还是正常 返航需要存储之前的订单id) |
| | | responseMessage(sequence, ""); |
| | | }else{ |
| | | } else { |
| | | //普通单 |
| | | R<XpOrder> xpOrderR = xpOrderClient.queryOrderById(Long.parseLong(orderId)); |
| | | XpOrder xpOrder = xpOrderR.getData(); |
| | |
| | | if (StringUtils.isEmpty(language)) { |
| | | locale = Locale.getDefault(); |
| | | } |
| | | if(language==null){ |
| | | language="1"; |
| | | } |
| | | //如果请求不为空 |
| | | //If the request is not empty. |
| | | if (language.equals("1")) { |
| | |
| | | XpPoint xpPoint = xpPointService.getById(dto.getStartPointId()); |
| | | |
| | | // 终点 |
| | | XpPoint endXpPoint = xpPointService.getById(dto.getStartPointId()); |
| | | XpPoint endXpPoint = xpPointService.getById(dto.getEndPointId()); |
| | | |
| | | // 判断点位是否在运营区域内 |
| | | LocalTime now = LocalTime.now(); |
| | |
| | | # 中文 |
| | | path.not.found=????? |
| | | to.work= ??????????,?????? |
| | | welcome.message=欢迎来到我们的应用程序! |
| | |
| | | # English (US) |
| | | path.not.found=Path does not exist |
| | | to.work=\ The current pick-up and drop-off points are too close to each other. It is recommended to walk there |
| | | welcome.message=Welcome to our application! |
| | |
| | | # 中文 |
| | | path.not.found=????? |
| | | to.work=\ ??????????,?????? |
| | | welcome.message=欢迎来到我们的应用程序! |
| | |
| | | import com.xiaopeng.api.model.maintenance.XpCheckLocation; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.enums.DisabledEnum; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.maintenance.dto.LocationUpdateStatusDTO; |
| | | import com.xiaopeng.maintenance.model.query.XpCheckLocationQuery; |
| | | import com.xiaopeng.maintenance.service.IXpCheckLocationService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | return R.ok(xpCheckLocationService.queryByUserId(id)); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/check-location/pageList") |
| | | @ApiOperation(value = "获取打卡地址分页列表", tags = {"管理后台-运维执行"}) |
| | | public R<PageInfo<XpCheckLocation>> pageList(@RequestBody XpCheckLocationQuery query){ |
| | | PageInfo<XpCheckLocation> pageList = xpCheckLocationService.pageList(query); |
| | | return R.ok(pageList); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/check-location/add") |
| | | @ApiOperation(value = "新增打卡地", tags = {"管理后台-运维执行"}) |
| | | public R<String> add(@RequestBody XpCheckLocation dto){ |
| | | xpCheckLocationService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/check-location/edit") |
| | | @ApiOperation(value = "编辑打卡地", tags = {"管理后台-运维执行"}) |
| | | public R<String> edit(@RequestBody XpCheckLocation dto){ |
| | | xpCheckLocationService.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @DeleteMapping("/api/v1/check-location/deleteById") |
| | | @ApiOperation(value = "删除打卡地", tags = {"管理后台-运维执行"}) |
| | | public R<String> deleteById(@RequestParam Long id){ |
| | | xpCheckLocationService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/check-location/updateStatus") |
| | | @ApiOperation(value = "启用禁用打卡地", tags = {"管理后台-运维执行"}) |
| | | public R<String> updateStatus(@RequestBody LocationUpdateStatusDTO dto){ |
| | | XpCheckLocation xpCheckLocation = xpCheckLocationService.getById(dto.getId()); |
| | | xpCheckLocation.setStatus(dto.getStatus()); |
| | | xpCheckLocationService.updateById(xpCheckLocation); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | private XpVehicleClient xpVehicleClient; |
| | | |
| | | /** |
| | | * 车辆详情-车辆调度-发车 |
| | | * 车辆详情-车辆调度-发车 收车 |
| | | */ |
| | | @ApiOperation(value = "车辆运维-车辆调度-发车", tags = {"运维APP-车辆管理"}) |
| | | @ApiOperation(value = "车辆运维-车辆调度-发车/收车", tags = {"运维APP-车辆管理"}) |
| | | @PostMapping("/api/v1/vehicle/vehicleDispatchDeparture") |
| | | public R<String> vehicleDispatchDeparture(@RequestBody VehicleDispatchDepartureDTO dto) { |
| | | // 查询车辆 |
| | |
| | | public R<String> saveRepair(@RequestBody XpVehicleRepairStartDTO dto) { |
| | | |
| | | Long id = tokenService.getLoginOperationUser().getId(); |
| | | |
| | | // 创建车辆维修记录 |
| | | XpVehicleRepair xpVehicleRepair = new XpVehicleRepair(); |
| | | xpVehicleRepair.setVehicleId(dto.getVehicleId()); |
| | | xpVehicleRepair.setStartTime(dto.getStartTime()); |
| | | xpVehicleRepair.setEndTime(dto.getEndTime()); |
| | | xpVehicleRepair.setRepairReason(dto.getRepairReason()); |
| | | xpVehicleRepair.setStartRepairPicture(dto.getStartRepairPicture()); |
| | | xpVehicleRepair.setSendUserId(id); |
| | | xpVehicleRepair.setSendTime(LocalDateTime.now()); |
| | | xpVehicleRepairService.save(xpVehicleRepair); |
| | | xpVehicleRepairService.saveRepair(dto,id); |
| | | return R.ok(); |
| | | } |
| | | /** |
| New file |
| | |
| | | package com.xiaopeng.maintenance.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "打卡地址更新状态LocationUpdateStatusDTO", description = "打卡地址更新状态DTO") |
| | | public class LocationUpdateStatusDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "打卡地址ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "打卡地址状态 1=启用 0=禁用") |
| | | private Integer status; |
| | | |
| | | } |
| | |
| | | |
| | | import com.xiaopeng.api.model.maintenance.XpCheckLocation; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.model.query.XpCheckLocationQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface XpCheckLocationMapper extends BaseMapper<XpCheckLocation> { |
| | | |
| | | /** |
| | | * 获取打卡地址列表 |
| | | * |
| | | * @param pageInfo |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<XpCheckLocation> pageList(@Param("pageInfo")PageInfo<XpCheckLocation> pageInfo, @Param("query") XpCheckLocationQuery query); |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.model.query; |
| | | |
| | | import com.xiaopeng.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "车辆打卡地址分页查询参数XpCheckLocationQuery") |
| | | public class XpCheckLocationQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "打卡地址") |
| | | private String locationAddress; |
| | | |
| | | } |
| | |
| | | |
| | | import com.xiaopeng.api.model.maintenance.XpCheckLocation; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.model.query.XpCheckLocationQuery; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | XpCheckLocation queryByUserId(Long id); |
| | | |
| | | /** |
| | | * 打卡地址分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<XpCheckLocation> pageList(XpCheckLocationQuery query); |
| | | } |
| | |
| | | import com.xiaopeng.api.model.maintenance.XpVehicleRepair; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.dto.XpVehicleRepairStartDTO; |
| | | import com.xiaopeng.maintenance.model.query.XpVehicleRepairPageQuery; |
| | | import com.xiaopeng.maintenance.model.vo.XpVehicleRepairVO; |
| | | import com.xiaopeng.maintenance.vo.RepairStatusVO; |
| | |
| | | * @return |
| | | */ |
| | | RepairStatusVO queryRepairStatus(Long vehicleId); |
| | | |
| | | /** |
| | | * 保存车辆维修信息 |
| | | * |
| | | * @param dto |
| | | * @param id |
| | | */ |
| | | void saveRepair(XpVehicleRepairStartDTO dto, Long id); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetClient; |
| | | import com.xiaopeng.api.model.account.SysRole; |
| | | import com.xiaopeng.api.model.account.XpOperationsRole; |
| | | import com.xiaopeng.api.model.maintenance.XpCheckLocation; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpFleet; |
| | | import com.xiaopeng.api.vo.account.XpQualificationAuditVO; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.mapper.XpCheckLocationMapper; |
| | | import com.xiaopeng.maintenance.model.query.XpCheckLocationQuery; |
| | | import com.xiaopeng.maintenance.service.IXpCheckLocationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | return this.getById(xpFleet.getLocationId()); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<XpCheckLocation> pageList(XpCheckLocationQuery query) { |
| | | PageInfo<XpCheckLocation> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<XpCheckLocation> list = this.baseMapper.pageList(pageInfo, query); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.dto.XpVehicleRepairStartDTO; |
| | | import com.xiaopeng.maintenance.mapper.XpVehicleRepairMapper; |
| | | import com.xiaopeng.maintenance.model.query.XpVehicleRepairPageQuery; |
| | | import com.xiaopeng.maintenance.model.vo.XpVehicleRepairVO; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | |
| | | |
| | | return repairStatusVO; |
| | | } |
| | | |
| | | @Override |
| | | public void saveRepair(XpVehicleRepairStartDTO dto, Long id) { |
| | | // 创建车辆维修记录 |
| | | XpVehicleRepair xpVehicleRepair = new XpVehicleRepair(); |
| | | xpVehicleRepair.setVehicleId(dto.getVehicleId()); |
| | | xpVehicleRepair.setStartTime(dto.getStartTime()); |
| | | xpVehicleRepair.setEndTime(dto.getEndTime()); |
| | | xpVehicleRepair.setRepairReason(dto.getRepairReason()); |
| | | xpVehicleRepair.setStartRepairPicture(dto.getStartRepairPicture()); |
| | | xpVehicleRepair.setSendUserId(id); |
| | | xpVehicleRepair.setSendTime(LocalDateTime.now()); |
| | | this.save(xpVehicleRepair); |
| | | } |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.xiaopeng.maintenance.mapper.XpCheckLocationMapper"> |
| | | |
| | | <select id="pageList" resultType="com.xiaopeng.api.model.maintenance.XpCheckLocation"> |
| | | select id,location_address,location_range,location_lon,location_lat,status,create_time |
| | | from xp_check_location |
| | | <where> |
| | | <if test="query.locationAddress != null and query.locationAddress != ''"> |
| | | and location_address like concat('%',#{query.locationAddress},'%') |
| | | </if> |
| | | AND is_deleted = 0 |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | return xpPointClient.edit(pointAddDto); |
| | | } |
| | | /** |
| | | * 批量删除点位 |
| | | */ |
| | | @GetMapping("/deletePoint") |
| | | @ResponseBody |
| | | @ApiOperation(value = "删除点位") |
| | | public R deletePoint(@RequestParam("ids") String ids) { |
| | | xpPointClient.deletePoint(ids); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 编辑点位 |
| | | */ |
| | | @GetMapping("/queryById") |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 批量删除点位 |
| | | */ |
| | | @GetMapping("/deletePoint") |
| | | @ResponseBody |
| | | @ApiOperation(value = "删除点位") |
| | | public R deletePoint(@RequestParam("ids") String ids) { |
| | | xpPointService.removeBatchByIds(Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList())); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 编辑点位 |
| | | */ |
| | | @PostMapping("/editPoint") |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.xiaopeng.api.dto.account.UserResourcesDto; |
| | | import com.xiaopeng.api.dto.map.RouteAndFareDto; |
| | | import com.xiaopeng.api.dto.operation.LonLatDto; |
| | | import com.xiaopeng.api.feignClient.account.UserResourcesClient; |
| | | import com.xiaopeng.api.model.operation.XpPricing; |
| | | import com.xiaopeng.api.model.operation.XpWhitelist; |
| | | import com.xiaopeng.api.vo.operation.RouteAndFareVo; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | |
| | | import com.xiaopeng.operation.dto.XpOrderDto; |
| | | import com.xiaopeng.operation.query.PricingPageListQuery; |
| | | import com.xiaopeng.operation.service.IXpGeoQueryEntityService; |
| | | import com.xiaopeng.operation.service.IXpWhitelistService; |
| | | import com.xiaopeng.operation.service.XpPricingService; |
| | | import com.xiaopeng.operation.vo.PricingPageListVO; |
| | | import com.xiaopeng.operation.vo.SaveOrderVo; |
| | |
| | | |
| | | private final XpPricingService xpPricingService; |
| | | private final IXpGeoQueryEntityService xpGeoQueryEntityService; |
| | | private final UserResourcesClient userResourcesClient; |
| | | private final IXpWhitelistService xpWhitelistService; |
| | | |
| | | |
| | | public XpPricingController(XpPricingService xpPricingService, IXpGeoQueryEntityService xpGeoQueryEntityService) { |
| | | public XpPricingController(XpPricingService xpPricingService, IXpGeoQueryEntityService xpGeoQueryEntityService, UserResourcesClient userResourcesClient, IXpWhitelistService xpWhitelistService) { |
| | | this.xpPricingService = xpPricingService; |
| | | this.xpGeoQueryEntityService = xpGeoQueryEntityService; |
| | | this.userResourcesClient = userResourcesClient; |
| | | this.xpWhitelistService = xpWhitelistService; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 获取用户是否在白名单中 |
| | | */ |
| | | @PostMapping("/base/v1/mini-program/pricing/isInWhiteList") |
| | | @ApiOperation(value = "获取用户是否在白名单中", tags = {"小程序-获取用户是否在白名单中"}, response = Boolean.class) |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public R<Boolean> isInWhiteList(HttpServletRequest request) { |
| | | String uid = request.getHeader("XP-Uid"); |
| | | UserResourcesDto baseUserByUid = userResourcesClient.getBaseUserByUid(uid); |
| | | if (baseUserByUid!=null) { |
| | | try { |
| | | Object data = baseUserByUid.getData(); |
| | | String phone = JSONObject.parseObject(data.toString()).getString("mobile"); |
| | | long count = xpWhitelistService.count(new LambdaQueryWrapper<XpWhitelist>().eq(XpWhitelist::getAccount, phone).eq(XpWhitelist::getStatus, 1)); |
| | | return R.ok(count>0); |
| | | }catch (Exception e){ |
| | | log.error("获取用户信息失败: {}", e.getMessage()); |
| | | return R.ok(false); |
| | | } |
| | | |
| | | } |
| | | return R.ok(false); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存信息 |
| | | * @param |
| | | * @return |
| | |
| | | pricing.json.invalid=价格配置JSON格式不正确 |
| | | pricing.rule.empty=价格规则不能为空 |
| | | no.current.point=????????? |
| | | path.not.found=????? |
| | |
| | | pricing.json.invalid=Invalid JSON format for pricing configuration |
| | | pricing.rule.empty=Price rule cannot be empty |
| | | no.current.point=The current location is not open for service |
| | | path.not.found=Path does not exist |
| | |
| | | pricing.json.invalid=价格配置JSON格式不正确 |
| | | pricing.rule.empty=价格规则不能为空 |
| | | no.current.point=????????? |
| | | path.not.found=????? |
| | |
| | | package com.xiaopeng.order.model.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.xiaopeng.api.dto.operation.LonLatDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private String endAddress; |
| | | |
| | | @ApiModelProperty(value = "出发站点名称") |
| | | private String startStationName; |
| | | private String startPointName; |
| | | |
| | | @ApiModelProperty(value = "终点站点名称") |
| | | private String endStationName; |
| | | private String endPointName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "出发地经度值") |
| | | private Double startLon; |
| | | |
| | | @ApiModelProperty(value = "出发地纬度值") |
| | | private Double startLat; |
| | | |
| | | @ApiModelProperty(value = "目的地经度") |
| | | private Double endLon; |
| | | |
| | | @ApiModelProperty(value = "目的地纬度") |
| | | private Double endLat; |
| | | |
| | | @ApiModelProperty(value = "区域id") |
| | | private Long xpElectronicFenceAreaId; |
| | | |
| | | @ApiModelProperty(value = "下单站点id") |
| | | @TableField("start_point_id") |
| | | private Long startPointId; |
| | | |
| | | @ApiModelProperty(value = "下单终点站点Id") |
| | | @TableField("end_point_id") |
| | | private Long endPointId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "上车点") |
| | |
| | | cancelTaxiPassengerVo.setAppId(""); |
| | | |
| | | BaseVehicleUserDto baseVehicleUserDto = userVehicleClient.cancelTaxiPassenger(cancelTaxiPassengerVo); |
| | | if (baseVehicleUserDto.getCode() != 200) { |
| | | throw new RuntimeException("取消订单失败"); |
| | | if (baseVehicleUserDto==null) { |
| | | // TODO 本地无法调通 |
| | | // throw new RuntimeException("取消订单失败"); |
| | | } |
| | | |
| | | baseMapper.updateById(order); |
| | |
| | | res.setKilometer(BigDecimal.valueOf(order.getMileageKilometers())); |
| | | LocalDateTime createTime = order.getCreateTime(); |
| | | LocalDateTime tripEnd = order.getTripEnd(); |
| | | if (tripEnd==null){ |
| | | tripEnd = LocalDateTime.now(); |
| | | order.setTripEnd(tripEnd); |
| | | this.updateById(order); |
| | | } |
| | | // 计算行程时间 单位分钟 |
| | | // 计算时间差 |
| | | Duration durationBetween = Duration.between(createTime, tripEnd); |
| | |
| | | XpOrderDetailVO xpOrderDetailVO = new XpOrderDetailVO(); |
| | | XpOrder xpOrder = this.baseMapper.selectOne(new LambdaQueryWrapper<XpOrder>().eq(XpOrder::getAppUserId, uid).in(XpOrder::getStatus, Arrays.asList(1,2,3, 4, 5, 6, 7, 8)).orderByDesc(BaseModel::getCreateTime).last("LIMIT 1")); |
| | | if (xpOrder == null) { |
| | | return xpOrderDetailVO; |
| | | return null; |
| | | } |
| | | BeanUtils.copyProperties(xpOrder, xpOrderDetailVO); |
| | | // 算时间 |