Merge remote-tracking branch 'origin/master'
# Conflicts:
# xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
| | |
| | | |
| | | |
| | | import com.xiaopeng.account.mapper.XpOperationsRoleMapper; |
| | | import com.xiaopeng.account.model.dto.EnableDisableDTO; |
| | | import com.xiaopeng.account.model.dto.RePasswordDTO; |
| | | import com.xiaopeng.account.model.dto.XpOperationsUserAddDTO; |
| | | import com.xiaopeng.account.model.dto.XpOperationsUserDTO; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserPageQuery; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserQuery; |
| | | import com.xiaopeng.account.service.IXpOperationsUserService; |
| | | import com.xiaopeng.api.dto.account.XpOperationsUserQueryDTO; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserProfileVO; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserVO; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserWithRoleVO; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | |
| | | xpOperationsUserService.saveCertificate(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "运维人员管理分页列表", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/pageList") |
| | | public R<PageInfo<XpOperationsUserVO>> pageList(@RequestBody XpOperationsUserQuery query){ |
| | | PageInfo<XpOperationsUserVO> pageList = xpOperationsUserService.pageList(query); |
| | | return R.ok(pageList); |
| | | } |
| | | |
| | | @ApiOperation(value = "运维人员管理新增", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/add") |
| | | public R<String> add(@RequestBody XpOperationsUserAddDTO dto){ |
| | | return xpOperationsUserService.addOperationsUser(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "运维人员管理编辑", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/edit") |
| | | public R<String> edit(@RequestBody XpOperationsUserAddDTO dto){ |
| | | return xpOperationsUserService.editOperationsUser(dto); |
| | | } |
| | | @ApiOperation(value = "运维人员管理启用禁用", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/enableDisableById") |
| | | public R<String> enableDisableById(@RequestBody EnableDisableDTO dto){ |
| | | xpOperationsUserService.enableDisableById(dto); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "运维人员管理删除", tags = {"管理后台-运维执行"}) |
| | | @DeleteMapping("/api/v1/operationsUser/deleteById") |
| | | public R<String> deleteById(@RequestParam Long id){ |
| | | xpOperationsUserService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "运维人员管理重置密码", tags = {"管理后台-运维执行"}) |
| | | @DeleteMapping("/api/v1/operationsUser/rePassword") |
| | | public R<String> rePassword(@RequestBody RePasswordDTO dto){ |
| | | xpOperationsUserService.rePassword(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "运维人员管理详情", tags = {"管理后台-运维执行"}) |
| | | @GetMapping("/api/v1/operationsUser/detailById") |
| | | public R<XpOperationsUserVO> detailById(@RequestParam Long id){ |
| | | XpOperationsUserVO xpOperationsUserVO = xpOperationsUserService.detailById(id); |
| | | return R.ok(xpOperationsUserVO); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserPageQuery; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserQuery; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserVO; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserWithRoleVO; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | Page<XpOperationsUserWithRoleVO> selectUserPageByConditions(Page<XpOperationsUserWithRoleVO> xpOperationsUserWithRoleVOPage, @Param("query") XpOperationsUserPageQuery query); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param pageInfo |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<XpOperationsUserVO> pageList(@Param("pageInfo") PageInfo<XpOperationsUserVO> pageInfo, @Param("query")XpOperationsUserQuery 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; |
| | | |
| | | @Data |
| | | @ApiModel(value = "启用禁用参数EnableDisableDTO") |
| | | public class EnableDisableDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "用户ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "启用禁用状态 1=启用 0=禁用") |
| | | private Boolean status; |
| | | |
| | | } |
| 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; |
| | | |
| | | @Data |
| | | @ApiModel(value = "重置密码参数RePasswordDTO") |
| | | public class RePasswordDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "用户ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "密码") |
| | | private String newPassword; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.account.model.dto; |
| | | |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "新增运维人员数据传输对象XpOperationsUserAddDTO") |
| | | public class XpOperationsUserAddDTO extends XpOperationsUser { |
| | | |
| | | @ApiModelProperty(value = "角色id集合") |
| | | private List<Long> roleIds; |
| | | |
| | | } |
| 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 = "运维人员查询参数XpOperationsUserQuery") |
| | | public class XpOperationsUserQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "员工姓名") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phoneNumber; |
| | | |
| | | @ApiModelProperty(value = "角色id") |
| | | private Long roleId; |
| | | |
| | | @ApiModelProperty(value = "状态 1=启用 0=禁用") |
| | | private Boolean status; |
| | | |
| | | } |
| | |
| | | package com.xiaopeng.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.account.model.dto.EnableDisableDTO; |
| | | import com.xiaopeng.account.model.dto.RePasswordDTO; |
| | | import com.xiaopeng.account.model.dto.XpOperationsUserAddDTO; |
| | | import com.xiaopeng.account.model.dto.XpOperationsUserDTO; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserPageQuery; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserQuery; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserProfileVO; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserVO; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserWithRoleVO; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | |
| | | import javax.validation.Valid; |
| | |
| | | * @param dto |
| | | */ |
| | | void saveCertificate(@Valid XpOperationsUserDTO dto); |
| | | |
| | | /** |
| | | * 运维人员管理分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<XpOperationsUserVO> pageList(XpOperationsUserQuery query); |
| | | |
| | | /** |
| | | * 新增运维人员 |
| | | * @param dto |
| | | */ |
| | | R<String> addOperationsUser(XpOperationsUserAddDTO dto); |
| | | |
| | | /** |
| | | * 修改运维人员 |
| | | * @param dto |
| | | */ |
| | | R<String> editOperationsUser(XpOperationsUserAddDTO dto); |
| | | |
| | | /** |
| | | * 启用禁用 |
| | | * @param dto |
| | | */ |
| | | void enableDisableById(EnableDisableDTO dto); |
| | | |
| | | /** |
| | | * 重置密码 |
| | | * @param dto |
| | | */ |
| | | void rePassword(RePasswordDTO dto); |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | XpOperationsUserVO detailById(Long id); |
| | | } |
| | |
| | | package com.xiaopeng.account.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xiaopeng.account.constant.I18nKeyConstant; |
| | | import com.xiaopeng.account.mapper.SysRoleMapper; |
| | | import com.xiaopeng.account.mapper.XpOperationsRoleMapper; |
| | | import com.xiaopeng.account.mapper.XpOperationsUserMapper; |
| | | import com.xiaopeng.account.model.dto.EnableDisableDTO; |
| | | import com.xiaopeng.account.model.dto.RePasswordDTO; |
| | | import com.xiaopeng.account.model.dto.XpOperationsUserAddDTO; |
| | | import com.xiaopeng.account.model.dto.XpOperationsUserDTO; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserPageQuery; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserQuery; |
| | | import com.xiaopeng.account.service.IXpOperationsRoleService; |
| | | import com.xiaopeng.account.service.IXpOperationsUserService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.account.service.IXpQualificationAuditService; |
| | | import com.xiaopeng.api.feignClient.maintenance.XpClockInClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetOperationsClient; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.model.account.XpQualificationAudit; |
| | | import com.xiaopeng.api.model.account.*; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpFleet; |
| | | import com.xiaopeng.api.vo.account.FleetInfoVO; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserProfileVO; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserWithRoleVO; |
| | | import com.xiaopeng.api.vo.account.*; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.utils.SecurityUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | |
| | | @Autowired |
| | | private XpOperationsRoleMapper xpOperationsRoleMapper; |
| | | @Autowired |
| | | private IXpOperationsRoleService xpOperationsRoleService; |
| | | |
| | | @Autowired |
| | | private XpClockInClient xpClockInClient; |
| | | |
| | | @Autowired |
| | | private IXpQualificationAuditService xpQualificationAuditService; |
| | | @Autowired |
| | | private SysRoleMapper sysRoleMapper; |
| | | |
| | | @Override |
| | | public List<XpOperationsUser> listByName(String nickName) { |
| | |
| | | xpQualificationAudit.setAuditStatus(1); |
| | | xpQualificationAuditService.save(xpQualificationAudit); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<XpOperationsUserVO> pageList(XpOperationsUserQuery query) { |
| | | PageInfo<XpOperationsUserVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<XpOperationsUserVO> list = this.baseMapper.pageList(pageInfo, query); |
| | | |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | |
| | | // 查询角色名称 |
| | | List<Long> operationsUserIds = list.stream().map(XpOperationsUserVO::getId).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 (XpOperationsUserVO xpOperationsUserVO : list) { |
| | | xpOperationsUserVO.setSysRoles(map.get(xpOperationsUserVO.getId())); |
| | | } |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public R<String> addOperationsUser(XpOperationsUserAddDTO dto) { |
| | | long userCount = this.count(Wrappers.lambdaQuery(XpOperationsUser.class) |
| | | .eq(XpOperationsUser::getPhoneNumber, dto.getPhoneNumber())); |
| | | if (StringUtils.isNotBlank(dto.getPhoneNumber()) && userCount>0) { |
| | | throw new ServiceException("登录账号重复", I18nKeyConstant.ACCOUNT_DUPLICATE); |
| | | } |
| | | //校验编号是否唯一 |
| | | long numberCount = this.count(Wrappers.lambdaQuery(XpOperationsUser.class) |
| | | .eq(XpOperationsUser::getUniqueNumber, dto.getUniqueNumber())); |
| | | if (numberCount > 0) { |
| | | throw new ServiceException("用户编号已存在", I18nKeyConstant.ACCOUNT_UNIQUE_NUMBER_DUPLICATE); |
| | | } |
| | | // 密码加密 |
| | | dto.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | // 保存 |
| | | this.save(dto); |
| | | // 存储角色 |
| | | List<Long> roleIds = dto.getRoleIds(); |
| | | if(!CollectionUtils.isEmpty(roleIds)){ |
| | | List<XpOperationsRole> xpOperationsRoles = roleIds.stream().map(roleId -> { |
| | | XpOperationsRole xpOperationsRole = new XpOperationsRole(); |
| | | xpOperationsRole.setOperationsUserId(dto.getId()); |
| | | xpOperationsRole.setRoleId(roleId); |
| | | return xpOperationsRole; |
| | | }).collect(Collectors.toList()); |
| | | xpOperationsRoleService.saveBatch(xpOperationsRoles); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> editOperationsUser(XpOperationsUserAddDTO dto) { |
| | | XpOperationsUser operationsUser = this.getOne(Wrappers.lambdaQuery(XpOperationsUser.class) |
| | | .eq(XpOperationsUser::getPhoneNumber, dto.getPhoneNumber()) |
| | | .last("LIMIT 1")); |
| | | |
| | | if (StringUtils.isNotBlank(dto.getPhoneNumber()) && (Objects.nonNull(operationsUser) && !dto.getId().equals(operationsUser.getId()) )) { |
| | | throw new ServiceException("手机号已开通账号", I18nKeyConstant.ACCOUNT_PHONE_DUPLICATE); |
| | | } |
| | | if (dto.getPassword() != null && !dto.getPassword().isEmpty()) { |
| | | dto.setPassword(null); |
| | | } |
| | | this.updateById(dto); |
| | | |
| | | //删除旧的角色数据,添加新的角色 |
| | | xpOperationsRoleService.remove(new LambdaQueryWrapper<XpOperationsRole>().eq(XpOperationsRole::getOperationsUserId, dto.getId())); |
| | | // 存储角色 |
| | | List<Long> roleIds = dto.getRoleIds(); |
| | | if(!CollectionUtils.isEmpty(roleIds)){ |
| | | List<XpOperationsRole> xpOperationsRoles = roleIds.stream().map(roleId -> { |
| | | XpOperationsRole xpOperationsRole = new XpOperationsRole(); |
| | | xpOperationsRole.setOperationsUserId(dto.getId()); |
| | | xpOperationsRole.setRoleId(roleId); |
| | | return xpOperationsRole; |
| | | }).collect(Collectors.toList()); |
| | | xpOperationsRoleService.saveBatch(xpOperationsRoles); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public void enableDisableById(EnableDisableDTO dto) { |
| | | XpOperationsUser operationsUser = this.getById(dto.getId()); |
| | | operationsUser.setStatus(dto.getStatus()); |
| | | this.updateById(operationsUser); |
| | | } |
| | | |
| | | @Override |
| | | public void rePassword(RePasswordDTO dto) { |
| | | XpOperationsUser operationsUser = this.getById(dto.getId()); |
| | | // 密码加密 |
| | | operationsUser.setPassword(SecurityUtils.encryptPassword(dto.getNewPassword())); |
| | | this.updateById(operationsUser); |
| | | } |
| | | |
| | | @Override |
| | | public XpOperationsUserVO detailById(Long id) { |
| | | // 查询用户信息 |
| | | XpOperationsUser xpOperationsUser = this.getById(id); |
| | | XpOperationsUserVO xpOperationsUserVO = new XpOperationsUserVO(); |
| | | BeanUtils.copyProperties(xpOperationsUser, xpOperationsUserVO); |
| | | // 查询角色 |
| | | List<XpOperationsRole> xpOperationsRoles = xpOperationsRoleMapper.selectList(Wrappers.lambdaQuery(XpOperationsRole.class) |
| | | .eq(XpOperationsRole::getOperationsUserId, id)); |
| | | 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)); |
| | | xpOperationsUserVO.setSysRoles(sysRoles); |
| | | } |
| | | return xpOperationsUserVO; |
| | | } |
| | | } |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="pageList" resultType="com.xiaopeng.api.vo.account.XpOperationsUserVO"> |
| | | SELECT xou.id, xou.nick_name, xou.unique_number, xou.avatar, xou.password, xou.phone_number, xou.remarks, xou.status, |
| | | xou.id_card_front, xou.id_card_back, xou.driver_license, xou.certificate_of_no_criminal_record, |
| | | xou.training_graduation_certificate, xou.is_deleted, xou.create_time, xou.update_time, xou.create_by |
| | | from xp_operations_user xou |
| | | 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.status != null"> |
| | | and xou.status = #{query.status} |
| | | </if> |
| | | AND xou.is_deleted = 0 |
| | | </where> |
| | | order by xou.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<String> closeCruiseOrder(String vin) { |
| | | log.error("订单服务调用失败: {}", cause.getMessage()); |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R<XpCruiseOrder> getCruiseOrder(String orderId) { |
| | | log.error("订单服务调用失败: {}", cause.getMessage()); |
| | | return null; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<XpVehicle>> listVehicle() { |
| | | log.error("获取所有车辆信息失败,原因: {}", cause.getMessage()); |
| | | // 降级返回空列表 |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | |
| | | @Override |
| | | public R<XpVehicle> queryById(Long id) { |
| | | log.error("查询车辆信息失败,原因: {}", cause.getMessage()); |
| | | return R.ok(null); |
| | |
| | | |
| | | |
| | | /** |
| | | * 关闭 |
| | | */ |
| | | @PostMapping("/inner/cruiseOrder/closeCruiseOrder") |
| | | R<String> closeCruiseOrder(@RequestParam String vin); |
| | | |
| | | /** |
| | | * 查询订单信息 |
| | | * |
| | | * @param orderId 订单信息id |
| | |
| | | @PostMapping("/inner/vehicle/listByIds") |
| | | R<List<XpVehicle>> listByIds(@RequestBody List<Long> ids); |
| | | /** |
| | | * 查询车辆列表 |
| | | * |
| | | * @return 车辆列表 |
| | | */ |
| | | @PostMapping("/inner/vehicle/listVehicle") |
| | | R<List<XpVehicle>> listVehicle(); |
| | | /** |
| | | * 根据ID查询车辆信息 |
| | | * |
| | | * @param id 车辆ID |
| | |
| | | @ApiModelProperty(value = "下班打卡纬度") |
| | | private Double clockOutLat; |
| | | |
| | | @ApiModelProperty(value = "上班打卡地址") |
| | | private String clockInAddress; |
| | | |
| | | @ApiModelProperty(value = "下班打卡地址") |
| | | private String clockOutAddress; |
| | | |
| | | } |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "任务类型 1车辆日常检测任务接收角色 2车辆保养周期任务接收角色 3充电策略任务接收角色 4车身清洁任务接收角色 5日常整备任务接收角色 6年检/保险策略任务接收角色 7事故任务上报角色 8事故任务处理角色") |
| | | @ApiModelProperty(value = "任务类型 1车辆日常检测任务接收角色 2车辆每日收车 3车辆保养周期任务接收角色 4充电策略任务接收角色 5车身清洁任务接收角色 6日常整备任务接收角色 7年检/保险策略任务接收角色 8事故任务上报角色 9事故任务处理角色") |
| | | private Integer ruleType; |
| | | |
| | | @ApiModelProperty(value = "角色id") |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆运维规则") |
| | | @ApiModelProperty(value = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆保险标准说明 9=车辆年检标准说明 10=车辆保养标准说明 11=车辆运营资质标准说明") |
| | | private Integer descriptionType; |
| | | |
| | | @ApiModelProperty(value = "富文本内容") |
| | |
| | | package com.xiaopeng.api.model.maintenance; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | import com.xiaopeng.common.core.web.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | |
| | | @ApiModelProperty(value = "类型id") |
| | | private Long feedbackTypeId; |
| | | @ApiModelProperty(value = "类型id") |
| | | private String feedbackTypeName; |
| | | |
| | | @ApiModelProperty(value = "优先级 1低 2中 3高") |
| | | private Integer priority; |
| | | |
| | | @ApiModelProperty(value = "处理状态 1待处理 2处理中 3已处理") |
| | | private Integer handleStatus; |
| | | |
| | | @ApiModelProperty(value = "如果状态为待处理或者处理中 是否可以处理 0否 1是") |
| | | private Integer isHandle; |
| | | @ApiModelProperty(value = "处理人id") |
| | | private Long handleUserId; |
| | | @ApiModelProperty(value = "处理人名称") |
| | | @TableField(exist = false) |
| | | private String handleUserName; |
| | | @ApiModelProperty(value = "处理日志") |
| | | @TableField(exist = false) |
| | | private List<XpWorkOrderLog> workOrderLogs; |
| | | |
| | | |
| | | } |
| | |
| | | package com.xiaopeng.api.model.maintenance; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | |
| | | |
| | | @ApiModelProperty(value = "所属处理人id") |
| | | private Long handleUserId; |
| | | @ApiModelProperty(value = "所属处理人名称") |
| | | @TableField(exist = false) |
| | | private String handleUserName; |
| | | |
| | | @ApiModelProperty(value = "操作类型 1移交 2办结") |
| | | private String handleType; |
| | | private Integer handleType; |
| | | |
| | | @ApiModelProperty(value = "处理时间") |
| | | private LocalDateTime handleTime; |
| | |
| | | @ApiModelProperty(value = "广告状态 1上架 2下架") |
| | | @TableField("banner_status") |
| | | private Integer bannerStatus; |
| | | @ApiModelProperty(value = "广告图片") |
| | | @TableField("banner_pictures") |
| | | private String bannerPictures; |
| | | @ApiModelProperty(value = "广告标题") |
| | | @TableField("banner_title") |
| | | private String bannerTitle; |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private BigDecimal distance; |
| | | |
| | | @ApiModelProperty(value = "0正常点位 1充电点位 2收车点位") |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | | @ApiModelProperty(value = "0否 1是充电点位") |
| | | @TableField("charge_point") |
| | | private Integer chargePoint; |
| | | |
| | | @ApiModelProperty(value = "0否 1是收车点位") |
| | | @TableField("parking_point") |
| | | private Integer parkingPoint; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "城市id") |
| | | @TableField("city_id") |
| | | private Integer cityId; |
| | | private Long cityId; |
| | | |
| | | @ApiModelProperty(value = "城市名称") |
| | | @TableField(exist = false) |
| | | private String cityName; |
| | | |
| | | @ApiModelProperty(value = "备注说明") |
| | | @TableField("remark") |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.xiaopeng.common.core.web.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("xp_system_setting") |
| | | @ApiModel(value="XpSystemSetting对象", description="系统设置表") |
| | | @ApiModel(value = "XpSystemSetting对象", description = "系统设置表") |
| | | public class XpSystemSetting extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | private Integer minOrderDistance; |
| | | |
| | | @ApiModelProperty(value = "到达目的地后X分钟后自动结束行程") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("arrive_time") |
| | | private Integer arriveTime; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "常见问题首页展示数") |
| | | @TableField("head_show_count") |
| | | private Integer headShowCount; |
| | | |
| | | |
| | | @ApiModelProperty(value = "附近站点距离") |
| | | @TableField("near_point_distance") |
| | | private Integer nearPointDistance; |
| | | |
| | | |
| | | @ApiModelProperty(value = "吸附距离") |
| | | @TableField("adsorption_distance") |
| | | private Integer adsorptionDistance; |
| | | |
| | | @ApiModelProperty(value = "热修复状态 0-关闭 1-开始") |
| | | @TableField("hotfix_status") |
| | | private Integer hotfixStatus; |
| | | |
| | | @ApiModelProperty(value = "热修复开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("hotfix_start_time") |
| | | private LocalDateTime hotfixStartTime; |
| | | |
| | | @ApiModelProperty(value = "热修复结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("hotfix_end_time") |
| | | private LocalDateTime hotfixEndTime; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.api.vo.account; |
| | | |
| | | import com.xiaopeng.api.model.account.SysRole; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "运维人员列表XpOperationsUserVO") |
| | | public class XpOperationsUserVO extends XpOperationsUser { |
| | | |
| | | @ApiModelProperty(value = "角色集合") |
| | | private List<SysRole> sysRoles; |
| | | |
| | | } |
| | |
| | | if (orderPhase.equals(OrderPhase.ROUTE_TO_CRUISE)) { |
| | | //先响应消息 |
| | | responseMessage(sequence, ""); |
| | | //构建导航数据给到车端 |
| | | origin.setLongitude(116.40528); |
| | | origin.setLatitude(39.90498); |
| | | destination.setLongitude(116.40528); |
| | | destination.setLatitude(39.90498); |
| | | /* 构建导航数据给到车端 */ |
| | | R<XpCruiseOrder> cruiseOrder = xpCruiseOrderClient.getCruiseOrder(orderId); |
| | | XpCruiseOrder xpCruiseOrder = cruiseOrder.getData(); |
| | | |
| | | origin.setLongitude(xpCruiseOrder.getStartLon()); |
| | | origin.setLatitude(xpCruiseOrder.getStartLat()); |
| | | destination.setLongitude(xpCruiseOrder.getEndLon()); |
| | | destination.setLatitude(xpCruiseOrder.getEndLat()); |
| | | |
| | | OrderRouteAndFareDto dto = new OrderRouteAndFareDto(); |
| | | dto.setOrderId(Long.parseLong(orderId)); |
| | |
| | | //到达目的地 |
| | | if(OrderStatusEnum.COMPLETED.equals(status)){ |
| | | |
| | | // 返程找到目前的订单 -》之前的订单 查询生成一个 正常巡游 找到下一个点位 若到达最后点位 则反向找点位 每次判断是否收车状态 是则不进行处理了 |
| | | // 返程找到目前的订单 -》之前的订单 查询生成一个 正常巡游 找到下一个点位 若到达最后点位 则反向找点位 每次判断是否收车状态 是则不进行处理了 |
| | | // 找到这个订单 |
| | | R<XpCruiseOrder> cruiseOrder = xpCruiseOrderClient.getCruiseOrder(orderId); |
| | | if(cruiseOrder!=null){ |
| | | XpCruiseOrder xpCruiseOrder = cruiseOrder.getData(); |
| | | Long vehicleId = xpCruiseOrder.getVehicleId(); |
| | | |
| | | // 关闭当前巡游单子 |
| | | xpCruiseOrderClient.updateCruiseOrder(xpCruiseOrder.getVehicleVin()); |
| | | // 关闭当前巡游单子 已完成 |
| | | xpCruiseOrderClient.closeCruiseOrder(xpCruiseOrder.getVehicleVin()); |
| | | R<XpVehicle> xpVehicleR = xpVehicleClient.queryById(vehicleId); |
| | | XpVehicle xpVehicle = xpVehicleR.getData(); |
| | | // 运营中 继续执行 |
| | |
| | | |
| | | // 修改一下id 加一个一样的巡游单子 |
| | | lastXpCruiseOrder.setId("XU"+ IdUtil.fastUUID()); |
| | | lastXpCruiseOrder.setStatus(1); |
| | | xpCruiseOrderClient.addCruiseOrder(lastXpCruiseOrder); |
| | | |
| | | |
| | |
| | | </description> |
| | | |
| | | <dependencies> |
| | | <!-- easypoi --> |
| | | <!-- Apache POI 核心依赖 --> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi</artifactId> |
| | | <version>5.2.3</version> |
| | | </dependency> |
| | | |
| | | <!-- Apache POI OOXML 支持(用于 .xlsx 文件) --> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>5.2.3</version> |
| | | </dependency> |
| | | |
| | | <!-- Apache POI XMLBeans(可选,用于复杂 XML 处理) --> |
| | | <dependency> |
| | | <groupId>org.apache.xmlbeans</groupId> |
| | | <artifactId>xmlbeans</artifactId> |
| | | <version>5.1.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-base</artifactId> |
| | | <version>4.4.0</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>guava</artifactId> |
| | | <groupId>com.google.guava</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-web</artifactId> |
| | | <version>4.4.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-annotation</artifactId> |
| | | <version>4.4.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.xiaopeng.api.model.maintenance.XpShift; |
| | | 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.VerifyRangeDTO; |
| | | import com.xiaopeng.maintenance.model.query.XpShiftQuery; |
| | | import com.xiaopeng.maintenance.service.IXpClockInService; |
| | | import com.xiaopeng.maintenance.service.IXpShiftService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Api(tags = "班次管理") |
| | | @RestController |
| | | @RequestMapping("/xp-shift") |
| | | public class XpShiftController { |
| | | |
| | | @Autowired |
| | | private IXpShiftService xpShiftService; |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | @ApiOperation(value = "班次管理分页列表", tags = "管理后台-运维执行") |
| | | @PostMapping("/api/v1/shift/pageList") |
| | | public R<PageInfo<XpShift>> pageList(@RequestBody XpShiftQuery query) { |
| | | PageInfo<XpShift> pageInfo = xpShiftService.pageList(query); |
| | | return R.ok(pageInfo); |
| | | } |
| | | |
| | | @ApiOperation(value = "班次管理新增", tags = "管理后台-运维执行") |
| | | @PostMapping("/api/v1/shift/add") |
| | | public R<String> add(@RequestBody XpShift dto) { |
| | | xpShiftService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "班次管理编辑", tags = "管理后台-运维执行") |
| | | @PostMapping("/api/v1/shift/edit") |
| | | public R<String> edit(@RequestBody XpShift dto) { |
| | | xpShiftService.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "班次管理删除", tags = "管理后台-运维执行") |
| | | @DeleteMapping("/api/v1/shift/deleteById") |
| | | public R<String> deleteById(@RequestParam Long id) { |
| | | xpShiftService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetOperationsClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.api.model.account.SysUser; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.model.maintenance.XpErrorType; |
| | | import com.xiaopeng.api.model.operation.XpWhitelist; |
| | | import com.xiaopeng.api.model.operation.XpWhitelistOperlog; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.vo.account.LoginOperationUser; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.utils.WebUtils; |
| | | import com.xiaopeng.common.core.utils.ip.IpUtils; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.maintenance.dto.HandleVehicleAccidentDto; |
| | | import com.xiaopeng.maintenance.dto.SaveErrorTaskDto; |
| | | import com.xiaopeng.maintenance.dto.SaveRoutineDetailDto; |
| | | import com.xiaopeng.maintenance.dto.SaveVehicleAccidentDto; |
| | | import com.xiaopeng.maintenance.exportExcel.XpTaskExportExcel; |
| | | import com.xiaopeng.maintenance.model.query.TaskManagementPageListQuery; |
| | | import com.xiaopeng.maintenance.model.query.TaskPageListQuery; |
| | | import com.xiaopeng.maintenance.model.query.XpTaskRecordPageQuery; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维APP 任务中心 |
| | | * 管理后台 任务工单 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | |
| | | public R<List<XpErrorType>> errorTypeList() { |
| | | return xpErrorTypeService.errorTypeList(); |
| | | } |
| | | @ApiOperation(value = "任务中心列表", response = TaskPageListVO.class) |
| | | @ApiOperation(value = "任务中心列表", response = TaskManagementPageListVO.class) |
| | | @PostMapping("/pageList") |
| | | public R<PageInfo<TaskManagementPageListVO>> pageListManagement(@RequestBody TaskManagementPageListQuery query) { |
| | | PageInfo<TaskManagementPageListVO> pageList = xpTaskService.pageListManagement(query); |
| | | return R.ok(pageList); |
| | | } |
| | | @ApiOperation(value = "任务工单导出") |
| | | @PostMapping(value = "/exportExcel") |
| | | public void exportExcel(@RequestBody TaskManagementPageListQuery query) { |
| | | List<TaskManagementPageListVO> exportList = xpTaskService.exportList(query); |
| | | List<XpTaskExportExcel> taskExportExcels = new ArrayList<>(); |
| | | Integer num = 1; |
| | | for (TaskManagementPageListVO task : exportList) { |
| | | XpTaskExportExcel xpTaskExportExcel = new XpTaskExportExcel(); |
| | | xpTaskExportExcel.setPlateNumber(task.getPlateNumber()); |
| | | xpTaskExportExcel.setTaskCategory(task.getTaskCategory()); |
| | | xpTaskExportExcel.setTaskTypeName(task.getTaskTypeName()); |
| | | xpTaskExportExcel.setTaskUrgencyLevel(task.getTaskUrgencyLevel()); |
| | | xpTaskExportExcel.setTaskDescription(task.getTaskDescription()); |
| | | xpTaskExportExcel.setHandleUserName(task.getHandleUserName()); |
| | | xpTaskExportExcel.setNumber(num); |
| | | xpTaskExportExcel.setStatus(task.getStatus()); |
| | | LocalDateTime createTime = task.getCreateTime(); |
| | | // 将LocalDateTime转化为yyyy-MM-dd HH:mm:ss格式字符串 |
| | | xpTaskExportExcel.setCreateTime(createTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | taskExportExcels.add(xpTaskExportExcel); |
| | | num++; |
| | | } |
| | | //1.获取excel模板 |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), XpTaskExportExcel.class, taskExportExcels); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("任务工单列表.xls", "utf-8"); |
| | | response.setHeader("Content-dispodition", "attachment;filename=" + fileName); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * 管理后台-车辆管理-运营车辆管理-删除任务/事故 |
| | |
| | | } |
| | | @ApiOperation(value = "查询车辆不分页列表") |
| | | @PostMapping(" /listVehicle") |
| | | public R<List<VehicleListVO>> listVehicle() { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | XpOperationsUser xpOperationsUser = loginOperationUser.getXpOperationsUser(); |
| | | // 查询当前人员所属车队 查询车队关联车辆 |
| | | R<List<Long>> vehicleByUserId = xpFleetOperationsClient.getVehicleByUserId(xpOperationsUser.getId()); |
| | | List<Long> vehicleIds = vehicleByUserId.getData(); |
| | | if (vehicleIds != null && !vehicleIds.isEmpty()){ |
| | | // todo 查询车辆列表 获取经纬度 |
| | | List<XpVehicle> data = xpVehicleClient.listByIds(vehicleIds).getData(); |
| | | if (data!=null){ |
| | | List<VehicleListVO> vehicleListVOS = new ArrayList<>(); |
| | | for (XpVehicle xpVehicle : data) { |
| | | VehicleListVO vehicleListVO = new VehicleListVO(); |
| | | vehicleListVO.setId(xpVehicle.getId()); |
| | | // vehicleListVO.setVehicleLon(xpVehicle.getVehicleLon()); |
| | | // vehicleListVO.setVehicleLat(xpVehicle.getVehicleLat()); |
| | | vehicleListVO.setVehicleCode(xpVehicle.getVehicleCode()); |
| | | vehicleListVO.setVehicleColor(xpVehicle.getVehicleColor()); |
| | | vehicleListVO.setPlateNumber(xpVehicle.getPlateNumber()); |
| | | vehicleListVO.setOperatingStatus(xpVehicle.getOperatingStatus()); |
| | | vehicleListVOS.add(vehicleListVO); |
| | | } |
| | | return R.ok(vehicleListVOS); |
| | | |
| | | } |
| | | public R<List<XpVehicle>> listVehicle() { |
| | | List<XpVehicle> vehicles = xpVehicleClient.listVehicle().getData(); |
| | | if (vehicles == null){ |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | @ApiOperation(value = "上传车辆事故", tags = "运维APP-任务中心") |
| | | @PostMapping(" /saveVehicleAccident") |
| | | public R saveVehicleAccident(@RequestBody SaveVehicleAccidentDto dto) { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | XpOperationsUser xpOperationsUser = loginOperationUser.getXpOperationsUser(); |
| | | xpTaskService.saveVehicleAccident(dto, xpOperationsUser); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "车辆其他常规任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping(" /vehicleRoutineDetail") |
| | | public R<TaskRoutineDetailVO> vehicleRoutineDetail(Long id) { |
| | | return xpTaskService.vehicleRoutineDetail(id); |
| | | } |
| | | @ApiOperation(value = "上传车辆其他常规任务详情", tags = "运维APP-任务中心") |
| | | @PostMapping(" /saveRoutineDetail") |
| | | public R saveRoutineDetail(@RequestBody SaveRoutineDetailDto dto) { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | Long id = loginOperationUser.getId(); |
| | | return xpTaskService.saveRoutineDetail(dto, id); |
| | | } |
| | | @ApiOperation(value = "车辆常规充电任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping(" /chargingDetail") |
| | | public R<TaskChargingDetailVO> chargingDetail(Long id) { |
| | | return xpTaskService.chargingDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆常规维修任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping(" /repairDetail") |
| | | public R<com.xiaopeng.maintenance.vo.TaskRepairDetailVO> repairDetail(Long id) { |
| | | return xpTaskService.repairDetail(id); |
| | | } |
| | | @ApiOperation(value = "车辆常规整备任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping(" /preparationDetail") |
| | | public R<com.xiaopeng.maintenance.vo.TaskPreparationDetailVO> preparationDetail(Long id) { |
| | | return xpTaskService.preparationDetail(id); |
| | | } |
| | | @ApiOperation(value = "车辆常规检测任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping(" /detectionDetail") |
| | | public R<com.xiaopeng.maintenance.vo.TaskDetectionDetailVO> detectionDetail(Long id) { |
| | | return xpTaskService.detectionDetail(id); |
| | | } |
| | | @ApiOperation(value = "车辆常规洗车任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping(" /cleanDetail") |
| | | public R<com.xiaopeng.maintenance.vo.TaskCleanDetailVO> cleanDetail(Long id) { |
| | | return xpTaskService.cleanDetail(id); |
| | | } |
| | | @ApiOperation(value = "处理车辆事故", tags = "运维APP-任务中心") |
| | | @PostMapping(" /handleVehicleAccident") |
| | | @Transactional |
| | | public R handleVehicleAccident(@RequestBody HandleVehicleAccidentDto dto) { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | XpOperationsUser xpOperationsUser = loginOperationUser.getXpOperationsUser(); |
| | | return xpTaskService.handleVehicleAccident(dto,xpOperationsUser); |
| | | return R.ok(vehicles); |
| | | } |
| | | |
| | | /** |
| New file |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.maintenance.dto.TaskRuleDetailDto; |
| | | import com.xiaopeng.maintenance.vo.TaskRuleDetailVO; |
| | | import com.xiaopeng.maintenance.service.IXpTaskRuleRoleService; |
| | | import com.xiaopeng.maintenance.service.IXpTaskRuleService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | | * 管理后台 任务规则设置 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | @RestController |
| | | @Slf4j |
| | | @Api(tags = "管理后台-任务规则设置") |
| | | @RequestMapping("/api/v1/taskRule") |
| | | public class XpTaskRuleController { |
| | | @Resource |
| | | private IXpTaskRuleService xpTaskRuleService; |
| | | @Resource |
| | | private IXpTaskRuleRoleService xpTaskRuleRoleService; |
| | | @ApiOperation(value = "任务规则详情") |
| | | @GetMapping("/taskRuleDetail") |
| | | @Transactional |
| | | public R<TaskRuleDetailVO> taskRuleDetail() { |
| | | return xpTaskRuleService.taskRuleDetail(); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存或修改任务规则") |
| | | @PostMapping("/saveOrUpdateTaskRule") |
| | | public R saveOrUpdateTaskRule(@RequestBody TaskRuleDetailDto dto) { |
| | | xpTaskRuleService.saveOrUpdateTaskRule(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.maintenance.service.IXpVehicleDescriptionService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Api(tags = "车辆整备、充电、检测说明") |
| | | @RestController |
| | | @RequestMapping("/xp-vehicle-description") |
| | | public class XpVehicleDescriptionController { |
| | | |
| | | private final IXpVehicleDescriptionService xpVehicleDescriptionService; |
| | |
| | | this.xpVehicleDescriptionService = xpVehicleDescriptionService; |
| | | } |
| | | |
| | | @ApiOperation(value = "获取车辆整备、充电、检测说明",notes = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆运维规则",tags = {"运维APP-车辆管理"}) |
| | | @ApiOperation(value = "获取车辆整备、充电、检测、保险、年检、保养、运营资质说明",notes = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆保险标准说明 9=车辆年检标准说明 10=车辆保养标准说明 11=车辆运营资质标准说明",tags = {"运维APP-车辆管理"}) |
| | | @GetMapping("/api/v1/vehicle/vehicleDescription") |
| | | public R<XpVehicleDescription> getVehicleDescription(@RequestParam Integer descriptionType) { |
| | | XpVehicleDescription xpVehicleDescription = xpVehicleDescriptionService.getOne(Wrappers.lambdaQuery(XpVehicleDescription.class) |
| | |
| | | return R.ok(xpVehicleDescription); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取车辆整备、充电、检测、保险、年检、保养、运营资质说明",notes = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆保险标准说明 9=车辆年检标准说明 10=车辆保养标准说明 11=车辆运营资质标准说明",tags = {"管理后台-内容中心"}) |
| | | @GetMapping("/api/v1/vehicle-description/vehicleDescription") |
| | | @ApiImplicitParam(name = "descriptionType", value = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆保险标准说明 9=车辆年检标准说明 10=车辆保养标准说明 11=车辆运营资质标准说明", required = true, paramType = "query", dataTypeClass = Integer.class) |
| | | public R<XpVehicleDescription> getVehicleDescriptionByType(@RequestParam Integer descriptionType) { |
| | | XpVehicleDescription xpVehicleDescription = xpVehicleDescriptionService.getOne(Wrappers.lambdaQuery(XpVehicleDescription.class) |
| | | .eq(XpVehicleDescription::getDescriptionType, descriptionType) |
| | | .last("LIMIT 1")); |
| | | return R.ok(xpVehicleDescription); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存车辆整备、充电、检测、保险、年检、保养、运营资质说明", tags = {"管理后台-内容中心"}) |
| | | @PostMapping("/api/v1/vehicle-description/save") |
| | | public R<?> saveVehicleDescription(@RequestBody XpVehicleDescription xpVehicleDescription) { |
| | | if (xpVehicleDescription.getDescriptionType() == null) { |
| | | return R.fail("descriptionType不能为空"); |
| | | } |
| | | // 先查询是否存在 |
| | | XpVehicleDescription existing = xpVehicleDescriptionService.getOne(Wrappers.lambdaQuery(XpVehicleDescription.class) |
| | | .eq(XpVehicleDescription::getDescriptionType, xpVehicleDescription.getDescriptionType()) |
| | | .last("LIMIT 1")); |
| | | if (existing != null) { |
| | | // 存在则更新 |
| | | existing.setDescriptionContent(xpVehicleDescription.getDescriptionContent()); |
| | | xpVehicleDescriptionService.updateById(existing); |
| | | } else { |
| | | // 不存在则插入 |
| | | xpVehicleDescriptionService.save(xpVehicleDescription); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation(value = "车辆运维-车辆运维-开始自检", tags = {"运维APP-车辆管理"}) |
| | | @GetMapping("/api/v1/vehicleDetection/startDetection") |
| | | public R<String> startDetection(@RequestParam Long vehicleId) { |
| | | public R<Map<String,Integer>> startDetection(@RequestParam Long vehicleId) { |
| | | |
| | | // TODO 开始自检 |
| | | |
| | | return R.ok(); |
| | | Map<String,Integer> result = new HashMap<>(6); |
| | | result.put("networkDetection", 1); // 网络检测 |
| | | result.put("remoteSelfCheck", 1); // 远程自检 |
| | | result.put("versionVerification", 1); // 版本验证 |
| | | result.put("collisionAvoidanceActivation", 1); // 碰撞回避激活 |
| | | result.put("communicationSelfCheck", 1); // 通信自检 |
| | | result.put("sensorSelfCheck", 1); // 传感器自检 |
| | | return R.ok(result); |
| | | } |
| | | |
| | | |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.sun.xml.internal.bind.v2.TODO; |
| | | import com.xiaopeng.api.dto.automaticPilot.PushOrderDto; |
| | | import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient; |
| | | import com.xiaopeng.api.feignClient.order.XpCruiseOrderClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.api.model.order.XpCruiseOrder; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import com.xiaopeng.maintenance.dto.VehicleDispatchAcceptDTO; |
| | | import com.xiaopeng.maintenance.dto.VehicleDispatchDepartureDTO; |
| | | import com.xiaopeng.maintenance.model.query.OperationRecordsQuery; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPoint; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private IXpVehiclePreparationService xpVehiclePreparationService; |
| | | @Autowired |
| | | private XpVehicleClient xpVehicleClient; |
| | | @Autowired |
| | | private XpCruiseOrderClient xpCruiseOrderClient; |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Autowired |
| | | private OrderMissionClient orderMissionClient; |
| | | |
| | | /** |
| | | * 车辆详情-车辆调度-发车 收车 |
| | |
| | | if(dto.getDepartureStatus()==1){ |
| | | // 找车辆的任务 生成巡游单子 下发命令 TODO |
| | | }else if(dto.getDepartureStatus()==3){ |
| | | // 收车 关闭当前巡游单子 生成新的返程单子 找到收车站点 TODO |
| | | // 收车 关闭当前巡游单子 生成新的返程单子 找到收车站点 |
| | | R<String> r = xpCruiseOrderClient.updateCruiseOrder(xpVehicle.getVehicleVin()); |
| | | |
| | | // redis 获取当前最新经纬度位置 |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicle.getVehicleVin())), VehiclePosition.class); |
| | | double x = vehiclePosition.getPoint().getX(); |
| | | double y = vehiclePosition.getPoint().getY(); |
| | | XpCruiseOrder xpCruiseOrder = new XpCruiseOrder(); |
| | | xpCruiseOrder.setId("XU"+ IdUtil.fastUUID()); |
| | | xpCruiseOrder.setVehicleId(xpVehicle.getId()); |
| | | xpCruiseOrder.setOrderType(2); |
| | | xpCruiseOrder.setStartLon(x); |
| | | xpCruiseOrder.setStartLat(y); |
| | | // TODO 找到收车站点 |
| | | xpCruiseOrder.setStatus(1); |
| | | |
| | | |
| | | // 下发命令 |
| | | orderMissionClient.pushOrder(new PushOrderDto( xpCruiseOrder.getVehicleVin(),xpCruiseOrder.getId(),null)); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | return R.ok(); |
| | |
| | | Long id = tokenService.getLoginOperationUser().getId(); |
| | | |
| | | XpVehicleRepair xpVehicleRepair = xpVehicleRepairService.getById(dto.getId()); |
| | | xpVehicleRepair.setVehicleId(null); |
| | | // 修改车辆取回信息 |
| | | xpVehicleRepair.setRepairMoney(dto.getRepairMoney()); |
| | | xpVehicleRepair.setRepairMoneyDetail(dto.getRepairMoneyDetail()); |
| New file |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | |
| | | import com.xiaopeng.api.model.maintenance.XpWorkOrder; |
| | | import com.xiaopeng.api.model.maintenance.XpWorkOrderLog; |
| | | 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.TaskRuleDetailDto; |
| | | import com.xiaopeng.maintenance.model.query.TaskManagementPageListQuery; |
| | | import com.xiaopeng.maintenance.model.query.WorkOrderPageListQuery; |
| | | import com.xiaopeng.maintenance.model.vo.TaskManagementPageListVO; |
| | | import com.xiaopeng.maintenance.model.vo.TaskPageListVO; |
| | | import com.xiaopeng.maintenance.service.IXpTaskRuleRoleService; |
| | | import com.xiaopeng.maintenance.service.IXpTaskRuleService; |
| | | import com.xiaopeng.maintenance.service.IXpWorkOrderLogService; |
| | | import com.xiaopeng.maintenance.service.IXpWorkOrderService; |
| | | import com.xiaopeng.maintenance.vo.TaskRuleDetailVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 管理后台 任务规则设置 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | @RestController |
| | | @Slf4j |
| | | @Api(tags = "管理后台-工单管理") |
| | | @RequestMapping("/api/v1/workOrder") |
| | | public class XpWorkOrderController { |
| | | @Resource |
| | | private IXpWorkOrderService workOrderService; |
| | | @Resource |
| | | private IXpWorkOrderLogService workOrderLogService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | @ApiOperation(value = "工单管理分页列表") |
| | | @PostMapping("/pageList") |
| | | public R<PageInfo<XpWorkOrder>> pageList(@RequestBody WorkOrderPageListQuery query) { |
| | | query.setUserId(tokenService.getLoginUser().getSysUser().getId()); |
| | | PageInfo<XpWorkOrder> pageList = workOrderService.pageList(query); |
| | | return R.ok(pageList); |
| | | } |
| | | @ApiOperation(value = "创建工单") |
| | | @PostMapping("/saveWorkOrder") |
| | | public R saveWordOrder(@RequestBody XpWorkOrder workOrder) { |
| | | workOrderService.save(workOrder); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "编辑工单") |
| | | @PostMapping("/updateWorkOrder") |
| | | public R updateWordOrder(@RequestBody XpWorkOrder workOrder) { |
| | | workOrderService.updateById(workOrder); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "处理工单") |
| | | @PostMapping("/handleWorkOrder") |
| | | public R handleWorkOrder(@RequestBody XpWorkOrderLog workOrderLog) { |
| | | workOrderService.handleWorkOrder(workOrderLog); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "删除工单") |
| | | @DeleteMapping("/deleteWorkOrder") |
| | | public R deleteWordOrder(Long id) { |
| | | workOrderService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "工单详情") |
| | | @GetMapping("/workOrderDetail") |
| | | public R<XpWorkOrder> workOrderDetail(Long id) { |
| | | XpWorkOrder detail =workOrderService.workOrderDetail(id); |
| | | return R.ok(detail); |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "打卡地id") |
| | | private Long locationId; |
| | | |
| | | @ApiModelProperty(value = "上班打卡地址") |
| | | private String clockInAddress; |
| | | |
| | | @ApiModelProperty(value = "下班打卡地址") |
| | | private String clockOutAddress; |
| | | |
| | | @ApiModelProperty(value = "运维用户id 前端忽略") |
| | | private Long operationsUserId; |
| | | |
| New file |
| | |
| | | package com.xiaopeng.maintenance.dto; |
| | | |
| | | import com.xiaopeng.api.model.maintenance.XpTaskRuleRole; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "管理后台-任务规则详情VO") |
| | | public class TaskRuleDetailDto implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "自增id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "车辆日常检测是否启用 0否1是") |
| | | private Boolean vehicleInspection; |
| | | @ApiModelProperty(value = "车辆日常监测 频次") |
| | | private Integer vehicleInspectionFrequency; |
| | | @ApiModelProperty(value = "车辆日常检测 任务下放时间") |
| | | private LocalDateTime vehicleInspectionTime; |
| | | |
| | | @ApiModelProperty(value = "车辆日常监测 紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer vehicleInspectionLevel; |
| | | |
| | | @ApiModelProperty(value = "车辆收车是否启用 0否1是") |
| | | private Boolean vehicleCollection; |
| | | |
| | | @ApiModelProperty(value = "车辆收车每日时间") |
| | | private LocalDateTime vehicleCollectionTime; |
| | | |
| | | @ApiModelProperty(value = "车辆保养周期是否启用") |
| | | private Boolean maintenanceCycle; |
| | | |
| | | @ApiModelProperty(value = "车辆保养周期 保养周期X") |
| | | private Integer maintenanceCycleTime; |
| | | |
| | | @ApiModelProperty(value = "车辆保养周期 保养周期X 1=天 2=月") |
| | | private Integer maintenanceCycleTimeType; |
| | | |
| | | @ApiModelProperty(value = "车辆保养周期 任务下放时间") |
| | | private LocalDateTime maintenanceCycleTaskTime; |
| | | |
| | | @ApiModelProperty(value = "车辆保养周期 紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer maintenanceCycleLevel; |
| | | |
| | | @ApiModelProperty(value = "充电策略是否启用 0否1是") |
| | | private Integer chargingStrategy; |
| | | |
| | | @ApiModelProperty(value = "充电策略 电量低于XX 不可接新单并发起充电任务") |
| | | private BigDecimal chargingStrategyBatteryl; |
| | | |
| | | @ApiModelProperty(value = "充电策略 紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer chargingStrategyLevel; |
| | | |
| | | @ApiModelProperty(value = "车身清洁保养周期X") |
| | | private Integer vehicleCleanTime; |
| | | |
| | | @ApiModelProperty(value = "车身清洁保养周期X 1=天 2=月") |
| | | private Integer vehicleCleanTimeType; |
| | | |
| | | @ApiModelProperty(value = "车身清洁任务紧急程度0=P0 1=P1 2=P2 3=P3") |
| | | private Integer vehicleCleanLevel; |
| | | |
| | | @ApiModelProperty(value = "日常整备保养周期X") |
| | | private Integer routineMaintenanceTime; |
| | | |
| | | @ApiModelProperty(value = "日常整备保养周期X 1=天 2=月") |
| | | private Integer routineMaintenanceTimeType; |
| | | |
| | | @ApiModelProperty(value = "日常整备 紧急程度0=P0 1=P1 2=P2 3=P3") |
| | | private Integer routineMaintenanceLevel; |
| | | |
| | | @ApiModelProperty(value = "年检/保险策略 是否启用 0否1是") |
| | | private Boolean insurance; |
| | | |
| | | @ApiModelProperty(value = "年检/保险策略 保险到期X天 下发任务") |
| | | private Integer insuranceExpires; |
| | | |
| | | @ApiModelProperty(value = "年检/保险策略 年检到期X天 下发任务") |
| | | private Integer insuranceInspectionExpires; |
| | | |
| | | @ApiModelProperty(value = "网约车运营资质到期X天 下发任务") |
| | | private Integer operationQualificationExpires; |
| | | |
| | | @ApiModelProperty(value = "年检/保险策略 紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer insuranceLevel; |
| | | |
| | | @ApiModelProperty(value = "任务处理时限(分钟)") |
| | | private Integer processingTimeLimit; |
| | | |
| | | @ApiModelProperty(value = "可以操作到达的配置范围,单位米") |
| | | private Double canArriveRange; |
| | | @ApiModelProperty(value = "任务类型关联角色列表") |
| | | private List<XpTaskRuleRole> taskRuleRoleList; |
| | | } |
| | |
| | | @ApiModelProperty(value = "发车状态 1=发车 3=收车") |
| | | private Integer departureStatus; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.exportExcel; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 白名单导出 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Data |
| | | @ApiModel(value="任务工单导出") |
| | | public class XpTaskExportExcel { |
| | | |
| | | @Excel(name = "序号",width = 20) |
| | | private Integer number; |
| | | @Excel(name = "车牌号",width = 20) |
| | | private String plateNumber; |
| | | @ApiModelProperty(value = "任务类别1常规 2事故") |
| | | @Excel(name = "任务类别",width = 20) |
| | | private Integer taskCategory; |
| | | @ApiModelProperty(value = "类型") |
| | | @Excel(name = "类型",width = 40) |
| | | private String taskTypeName; |
| | | @ApiModelProperty(value = "任务紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | @Excel(name = "紧急程度",width = 20,replace = {"P0_0","P1_1","P2_2","P3_3"}) |
| | | private Integer taskUrgencyLevel; |
| | | @ApiModelProperty(value = "任务描述") |
| | | @Excel(name = "任务描述",width = 40) |
| | | private String taskDescription; |
| | | @ApiModelProperty(value = "上报时间") |
| | | @Excel(name = "上报时间",width = 40) |
| | | private String createTime; |
| | | @ApiModelProperty(value = "状态 0=待到达 1=待处理 2=已完成 3=已取消") |
| | | @Excel(name = "状态",width = 20,replace = {"待到达_0","待处理_1","已完成_2","已取消_3"}) |
| | | private Integer status; |
| | | @ApiModelProperty(value = "处理人名称") |
| | | @Excel(name = "处理人",width = 20) |
| | | private String handleUserName; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询用户当天的打卡记录 |
| | | * @param tableSuffix 分表后缀 (0-9) |
| | | * @param appUserId 用户ID |
| | | * @param startTime 开始时间 (当天00:00:00) |
| | | * @param endTime 结束时间 (当天23:59:59) |
| | | * @return 打卡记录列表 |
| | | */ |
| | | List<XpClockIn> selectTodayClockInRecords( |
| | | @Param("tableSuffix") Integer tableSuffix, |
| | | @Param("appUserId") Long appUserId, |
| | | @Param("startTime") LocalDateTime startTime, |
| | | @Param("endTime") LocalDateTime endTime |
| | |
| | | |
| | | import com.xiaopeng.api.model.maintenance.XpShift; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.model.query.XpShiftQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface XpShiftMapper extends BaseMapper<XpShift> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<XpShift> pageList(@Param("query") XpShiftQuery query, @Param("pageInfo")PageInfo<XpShift> pageInfo); |
| | | } |
| | |
| | | List<TaskPageListVO> pageList(@Param("pageInfo")PageInfo<TaskPageListVO> pageInfo, @Param("query")TaskPageListQuery query); |
| | | |
| | | List<TaskManagementPageListVO> pageListManagement(@Param("pageInfo")PageInfo<TaskManagementPageListVO> pageInfo,@Param("query") TaskManagementPageListQuery query); |
| | | |
| | | List<TaskManagementPageListVO> exportList(@Param("query")TaskManagementPageListQuery query); |
| | | } |
| | |
| | | |
| | | import com.xiaopeng.api.model.maintenance.XpWorkOrder; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.model.query.WorkOrderPageListQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface XpWorkOrderMapper extends BaseMapper<XpWorkOrder> { |
| | | |
| | | List<XpWorkOrder> pageList(@Param("pageInfo") PageInfo<XpWorkOrder> pageInfo, @Param("query") WorkOrderPageListQuery 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 = "管理后台工单管理列表查询query") |
| | | public class WorkOrderPageListQuery extends BasePage { |
| | | @ApiModelProperty(value = "当前登陆人id 前端忽略") |
| | | private Long userId; |
| | | @ApiModelProperty(value = "反馈用户手机号") |
| | | private String feedbackUserPhone; |
| | | |
| | | @ApiModelProperty(value = "问题来源 目前只有1电话客服") |
| | | private Integer problemSource; |
| | | |
| | | @ApiModelProperty(value = "类型id") |
| | | private Long feedbackTypeId; |
| | | |
| | | @ApiModelProperty(value = "优先级 1低 2中 3高") |
| | | private Integer priority; |
| | | |
| | | @ApiModelProperty(value = "处理状态 1待处理 2处理中 3已处理") |
| | | private Integer handleStatus; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.model.query; |
| | | |
| | | import com.xiaopeng.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "班次查询参数XpShiftQuery") |
| | | public class XpShiftQuery extends BasePage { |
| | | } |
| | |
| | | |
| | | import com.xiaopeng.api.model.maintenance.XpShift; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.model.query.XpShiftQuery; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface IXpShiftService extends IService<XpShift> { |
| | | |
| | | /** |
| | | * 获取班次分页列表 |
| | | * |
| | | * @param query 查询参数 |
| | | * @return |
| | | */ |
| | | PageInfo<XpShift> pageList(XpShiftQuery query); |
| | | } |
| | |
| | | |
| | | import com.xiaopeng.api.model.maintenance.XpTaskRule; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.maintenance.dto.TaskRuleDetailDto; |
| | | import com.xiaopeng.maintenance.vo.TaskRuleDetailVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface IXpTaskRuleService extends IService<XpTaskRule> { |
| | | |
| | | |
| | | R<TaskRuleDetailVO> taskRuleDetail(); |
| | | |
| | | void saveOrUpdateTaskRule(TaskRuleDetailDto dto); |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface IXpWorkOrderLogService extends IService<XpWorkOrderLog> { |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.xiaopeng.api.model.maintenance.XpWorkOrder; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.maintenance.XpWorkOrderLog; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.model.query.WorkOrderPageListQuery; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface IXpWorkOrderService extends IService<XpWorkOrder> { |
| | | |
| | | PageInfo<XpWorkOrder> pageList(WorkOrderPageListQuery query); |
| | | |
| | | XpWorkOrder workOrderDetail(Long id); |
| | | |
| | | void handleWorkOrder(XpWorkOrderLog workOrderLog); |
| | | } |
| | |
| | | import com.xiaopeng.maintenance.model.query.TaskPageListQuery; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | void saveTask(SaveErrorTaskDto dto, Long reportUserId); |
| | | |
| | | R<TaskManagementDetailVO> taskDetail(Long id); |
| | | |
| | | List<TaskManagementPageListVO> exportList(TaskManagementPageListQuery query); |
| | | } |
| | |
| | | public void stopCharging(XpChargingRecordStopDTO dto, Long id) { |
| | | // 查询车辆充电记录 进行修改 |
| | | XpChargingRecord xpChargingRecord = this.getById(dto.getId()); |
| | | xpChargingRecord.setVehicleId(null); |
| | | xpChargingRecord.setEndChargingPicture(dto.getEndChargingPicture()); |
| | | xpChargingRecord.setEndRemainingBattery(dto.getEndRemainingBattery()); |
| | | xpChargingRecord.setEndTime(LocalDateTime.now()); |
| | |
| | | .orderByDesc(XpChargingRecord::getCreateTime) |
| | | .last("LIMIT 1")); |
| | | |
| | | if(Objects.nonNull(xpChargingRecord)){ |
| | | if(Objects.nonNull(xpChargingRecord) && Objects.isNull(xpChargingRecord.getEndRemainingBattery())){ |
| | | chargingStatusVO.setStatus(2); |
| | | // 查询开始充电操作人名称 |
| | | XpOperationsUser operationsUser = xpOperationUserClient.queryById(xpChargingRecord.getStartOperationsUserId()).getData(); |
| | |
| | | xpClockIn.setClockInLon(dto.getUserLon()); |
| | | xpClockIn.setClockInLat(dto.getUserLat()); |
| | | xpClockIn.setShiftId(dto.getShiftId()); |
| | | xpClockIn.setClockInAddress(dto.getClockInAddress()); |
| | | if (xpClockIn.getClockInTime().isAfter(startLocalDateTime)) { |
| | | xpClockIn.setClockInResult(2); |
| | | }else { |
| | |
| | | xpClockIn.setClockOutTime(LocalDateTime.now()); |
| | | xpClockIn.setClockOutLon(dto.getUserLon()); |
| | | xpClockIn.setClockOutLat(dto.getUserLat()); |
| | | |
| | | xpClockIn.setClockOutAddress(dto.getClockOutAddress()); |
| | | if (xpClockIn.getClockOutTime().isBefore(endLocalDateTime)) { |
| | | xpClockIn.setClockInResult(2); |
| | | }else { |
| | |
| | | LocalDateTime startTime = LocalDateTime.of(LocalDate.now(), LocalTime.MIN); // 00:00:00 |
| | | LocalDateTime endTime = LocalDateTime.of(LocalDate.now(), LocalTime.MAX); // 23:59:59 |
| | | |
| | | // 2. 计算分表后缀 (userId % 10) |
| | | Integer tableSuffix = (int) (appUserId % 10); |
| | | |
| | | // 3. 查询当天打卡记录 |
| | | List<XpClockIn> records = baseMapper.selectTodayClockInRecords( |
| | | tableSuffix, appUserId, startTime, endTime |
| | | appUserId, startTime, endTime |
| | | ); |
| | | |
| | | // 4. 判断上班状态 |
| | |
| | | package com.xiaopeng.maintenance.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.model.maintenance.XpShift; |
| | | 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.mapper.XpShiftMapper; |
| | | import com.xiaopeng.maintenance.model.query.XpShiftQuery; |
| | | import com.xiaopeng.maintenance.model.vo.OperationRecordsVO; |
| | | import com.xiaopeng.maintenance.service.IXpShiftService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class XpShiftServiceImpl extends ServiceImpl<XpShiftMapper, XpShift> implements IXpShiftService { |
| | | |
| | | @Override |
| | | public PageInfo<XpShift> pageList(XpShiftQuery query) { |
| | | PageInfo<XpShift> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<XpShift> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | package com.xiaopeng.maintenance.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.model.maintenance.XpTaskRule; |
| | | import com.xiaopeng.api.model.maintenance.XpTaskRuleRole; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.utils.bean.BeanUtils; |
| | | import com.xiaopeng.maintenance.dto.TaskRuleDetailDto; |
| | | import com.xiaopeng.maintenance.vo.TaskRuleDetailVO; |
| | | import com.xiaopeng.maintenance.mapper.XpTaskRuleMapper; |
| | | import com.xiaopeng.maintenance.mapper.XpTaskRuleRoleMapper; |
| | | import com.xiaopeng.maintenance.service.IXpTaskRuleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class XpTaskRuleServiceImpl extends ServiceImpl<XpTaskRuleMapper, XpTaskRule> implements IXpTaskRuleService { |
| | | |
| | | @Autowired |
| | | private XpTaskRuleRoleMapper taskRuleRoleMapper; |
| | | @Override |
| | | public R<TaskRuleDetailVO> taskRuleDetail() { |
| | | XpTaskRule taskRule = this.getOne(null); |
| | | if (taskRule == null){ |
| | | TaskRuleDetailVO taskRuleDetailVO = new TaskRuleDetailVO(); |
| | | return R.ok(taskRuleDetailVO); |
| | | } |
| | | TaskRuleDetailVO taskRuleDetailVO = new TaskRuleDetailVO(); |
| | | BeanUtils.copyProperties(taskRule, taskRuleDetailVO); |
| | | List<XpTaskRuleRole> xpTaskRuleRoles = taskRuleRoleMapper.selectList(null); |
| | | taskRuleDetailVO.setTaskRuleRoleList(xpTaskRuleRoles); |
| | | return R.ok(taskRuleDetailVO); |
| | | } |
| | | |
| | | @Override |
| | | public void saveOrUpdateTaskRule(TaskRuleDetailDto dto) { |
| | | if (dto.getId()!=null){ |
| | | XpTaskRule xpTaskRule = new XpTaskRule(); |
| | | BeanUtils.copyProperties(dto, xpTaskRule); |
| | | this.updateById(xpTaskRule); |
| | | taskRuleRoleMapper.delete(new LambdaQueryWrapper<XpTaskRuleRole>() |
| | | .isNotNull(XpTaskRuleRole::getId)); |
| | | for (XpTaskRuleRole xpTaskRuleRole : dto.getTaskRuleRoleList()) { |
| | | taskRuleRoleMapper.insert(xpTaskRuleRole); |
| | | } |
| | | }else{ |
| | | XpTaskRule xpTaskRule = new XpTaskRule(); |
| | | BeanUtils.copyProperties(dto, xpTaskRule); |
| | | this.save(xpTaskRule); |
| | | for (XpTaskRuleRole xpTaskRuleRole : dto.getTaskRuleRoleList()) { |
| | | taskRuleRoleMapper.insert(xpTaskRuleRole); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public List<TaskManagementPageListVO> exportList(TaskManagementPageListQuery query) { |
| | | List<TaskManagementPageListVO> list = this.baseMapper.exportList(query); |
| | | return list; |
| | | } |
| | | @Override |
| | | public R assigneeTask(Long id, Long handlerUserId,Long assigneeUserId) { |
| | | XpTask task = this.getById(id); |
| | |
| | | @Override |
| | | public void saveTask(SaveErrorTaskDto dto, Long reportUserId) { |
| | | |
| | | XpTask task = new XpTask(); |
| | | BeanUtils.copyProperties(dto, task); |
| | | task.setReportTime(LocalDateTime.now()); |
| | | task.setStatus(0); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | task.setTaskCode(code); |
| | | // 查询规则 |
| | | XpTaskRule taskRule = xpTaskRuleMapper.selectOne(null); |
| | | if (taskRule != null){ |
| | | task.setEndTime(LocalDateTime.now().plusMinutes(taskRule.getProcessingTimeLimit())); |
| | | List<XpTask> saveTask = new ArrayList<>(); |
| | | for (Long vehicleId : dto.getVehicleIds()) { |
| | | XpTask task = new XpTask(); |
| | | BeanUtils.copyProperties(dto, task); |
| | | task.setReportTime(LocalDateTime.now()); |
| | | task.setStatus(0); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | task.setTaskCode(code); |
| | | // 查询规则 |
| | | XpTaskRule taskRule = xpTaskRuleMapper.selectOne(null); |
| | | if (taskRule != null){ |
| | | task.setEndTime(LocalDateTime.now().plusMinutes(taskRule.getProcessingTimeLimit())); |
| | | } |
| | | task.setTaskCategory(2); |
| | | task.setTaskTypeId(dto.getTaskTypeId()); |
| | | task.setTaskUrgencyLevel(dto.getTaskUrgencyLevel()); |
| | | task.setTaskDescription(dto.getTaskDescription()); |
| | | task.setTaskImage(dto.getTaskImage()); |
| | | task.setVehicleId(vehicleId); |
| | | task.setVehicleLocation(dto.getVehicleLocation()); |
| | | task.setVehicleLon(dto.getVehicleLon()); |
| | | task.setVehicleLat(dto.getVehicleLat()); |
| | | task.setReportUserId(reportUserId); |
| | | task.setReportTime(LocalDateTime.now()); |
| | | } |
| | | this.saveBatch(saveTask); |
| | | |
| | | } |
| | | |
| | |
| | | taskManagementDetectionDetailVO.setVehicleVin(vehicle.getVehicleVin()); |
| | | taskManagementDetectionDetailVO.setVehicleLocation(task.getVehicleLocation()); |
| | | taskManagementDetectionDetailVO.setTaskCode(task.getTaskCode()); |
| | | // taskManagementDetectionDetailVO.setNetworkDetection(); |
| | | // taskManagementDetectionDetailVO.setVersionVerification(); |
| | | // taskManagementDetectionDetailVO.setCommunicationSelfCheck(); |
| | | // taskManagementDetectionDetailVO.setRemoteSelfCheck(); |
| | | // taskManagementDetectionDetailVO.setCollisionPrevention(); |
| | | // taskManagementDetectionDetailVO.setSensorSelfCheck(); |
| | | // taskManagementDetectionDetailVO.setSensorCleaning(); |
| | | // taskManagementDetectionDetailVO.setSensorCleaningPicture(); |
| | | // taskManagementDetectionDetailVO.setInteractiveScreen(); |
| | | // taskManagementDetectionDetailVO.setInteractiveScreenPicture(); |
| | | // taskManagementDetectionDetailVO.setHelpButton(); |
| | | // taskManagementDetectionDetailVO.setHelpButtonPicture(); |
| | | // taskManagementDetectionDetailVO.setPaymentFunction(); |
| | | // taskManagementDetectionDetailVO.setPaymentFunctionPicture(); |
| | | // taskManagementDetectionDetailVO.setSystemCheck(); |
| | | // taskManagementDetectionDetailVO.setSystemCheckPicture(); |
| | | // taskManagementDetectionDetailVO.setOperationsUserId(); |
| | | // taskManagementDetectionDetailVO.setOperationsUserName(); |
| | | // taskManagementDetectionDetailVO.setCheckTime(); |
| | | |
| | | XpVehicleDetection vehicleDetection = vehicleDetectionMapper.selectOne(new LambdaQueryWrapper<XpVehicleDetection>() |
| | | .eq(XpVehicleDetection::getTaskId, id).last("limit 1")); |
| | | if (vehicleDetection != null){ |
| | | taskManagementDetectionDetailVO.setNetworkDetection(vehicleDetection.getNetworkDetection()); |
| | | taskManagementDetectionDetailVO.setVersionVerification(vehicleDetection.getVersionVerification()); |
| | | taskManagementDetectionDetailVO.setCommunicationSelfCheck(vehicleDetection.getCommunicationSelfCheck()); |
| | | taskManagementDetectionDetailVO.setRemoteSelfCheck(vehicleDetection.getRemoteSelfCheck()); |
| | | taskManagementDetectionDetailVO.setCollisionPrevention(vehicleDetection.getCollisionPrevention()); |
| | | taskManagementDetectionDetailVO.setSensorSelfCheck(vehicleDetection.getSensorSelfCheck()); |
| | | taskManagementDetectionDetailVO.setSensorCleaning(vehicleDetection.getSensorCleaning()); |
| | | taskManagementDetectionDetailVO.setSensorCleaningPicture(vehicleDetection.getSensorCleaningPicture()); |
| | | taskManagementDetectionDetailVO.setInteractiveScreen(vehicleDetection.getInteractiveScreen()); |
| | | taskManagementDetectionDetailVO.setInteractiveScreenPicture(vehicleDetection.getInteractiveScreenPicture()); |
| | | taskManagementDetectionDetailVO.setHelpButton(vehicleDetection.getHelpButton()); |
| | | taskManagementDetectionDetailVO.setHelpButtonPicture(vehicleDetection.getHelpButtonPicture()); |
| | | taskManagementDetectionDetailVO.setPaymentFunction(vehicleDetection.getPaymentFunction()); |
| | | taskManagementDetectionDetailVO.setPaymentFunctionPicture(vehicleDetection.getPaymentFunctionPicture()); |
| | | taskManagementDetectionDetailVO.setSystemCheck(vehicleDetection.getSystemCheck()); |
| | | taskManagementDetectionDetailVO.setSystemCheckPicture(vehicleDetection.getSystemCheckPicture()); |
| | | taskManagementDetectionDetailVO.setCheckTime(vehicleDetection.getCheckTime()); |
| | | taskManagementDetectionDetailVO.setOperationsUserId(vehicleDetection.getOperationsUserId()); |
| | | if (vehicleDetection.getOperationsUserId() != null){ |
| | | XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleDetection.getOperationsUserId()).getData(); |
| | | if (operationsUser != null){ |
| | | taskManagementDetectionDetailVO.setOperationsUserName(operationsUser.getNickName()); |
| | | } |
| | | } |
| | | } |
| | | managementDetailVO.setDetectionDetailVO(taskManagementDetectionDetailVO); |
| | | break; |
| | | case "2": |
| | | // 充电 |
| | | TaskManagementChargingDetailVO taskManagementChargingDetailVO = new TaskManagementChargingDetailVO(); |
| | | taskManagementChargingDetailVO.setId(task.getId()); |
| | | taskManagementChargingDetailVO.setVehicleId(vehicle.getId()); |
| | | taskManagementChargingDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel()); |
| | | taskManagementChargingDetailVO.setPlateNumber(vehicle.getPlateNumber()); |
| | | taskManagementChargingDetailVO.setVehicleColor(vehicle.getVehicleColor()); |
| | | taskManagementChargingDetailVO.setVehicleCode(vehicle.getVehicleCode()); |
| | | taskManagementChargingDetailVO.setVehicleVin(vehicle.getVehicleVin()); |
| | | taskManagementChargingDetailVO.setVehicleLocation(task.getVehicleLocation()); |
| | | taskManagementChargingDetailVO.setTaskCode(task.getTaskCode()); |
| | | XpChargingRecord chargingRecord = chargingRecordMapper.selectOne(new LambdaQueryWrapper<XpChargingRecord>() |
| | | .eq(XpChargingRecord::getTaskId, id).last("limit 1")); |
| | | if (chargingRecord != null){ |
| | | taskManagementChargingDetailVO.setStartRemainingBattery(chargingRecord.getStartRemainingBattery()); |
| | | taskManagementChargingDetailVO.setStartChargingPicture(chargingRecord.getStartChargingPicture()); |
| | | taskManagementChargingDetailVO.setStartTime(chargingRecord.getStartTime()); |
| | | taskManagementChargingDetailVO.setEndRemainingBattery(chargingRecord.getEndRemainingBattery()); |
| | | taskManagementChargingDetailVO.setEndChargingPicture(chargingRecord.getEndChargingPicture()); |
| | | taskManagementChargingDetailVO.setEndTime(chargingRecord.getEndTime()); |
| | | taskManagementChargingDetailVO.setStartOperationsUserId(chargingRecord.getStartOperationsUserId()); |
| | | taskManagementChargingDetailVO.setEndOperationsUserId(chargingRecord.getEndOperationsUserId()); |
| | | if (chargingRecord.getStartOperationsUserId() != null){ |
| | | XpOperationsUser operationsUser = xpOperationUserClient.queryById(chargingRecord.getStartOperationsUserId()).getData(); |
| | | if (operationsUser != null){ |
| | | taskManagementChargingDetailVO.setStartOperationsUserName(operationsUser.getNickName()); |
| | | } |
| | | } |
| | | if (chargingRecord.getEndOperationsUserId() != null){ |
| | | XpOperationsUser operationsUser = xpOperationUserClient.queryById(chargingRecord.getEndOperationsUserId()).getData(); |
| | | if (operationsUser != null){ |
| | | taskManagementChargingDetailVO.setEndOperationsUserName(operationsUser.getNickName()); |
| | | } |
| | | } |
| | | } |
| | | managementDetailVO.setChargingDetailVO(taskManagementChargingDetailVO); |
| | | |
| | | break; |
| | | case "3": |
| | | // 整备 |
| | | TaskManagementPreparationDetailVO taskManagementPreparationDetailVO = new TaskManagementPreparationDetailVO(); |
| | | taskManagementPreparationDetailVO.setId(task.getId()); |
| | | taskManagementPreparationDetailVO.setVehicleId(vehicle.getId()); |
| | | taskManagementPreparationDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel()); |
| | | taskManagementPreparationDetailVO.setPlateNumber(vehicle.getPlateNumber()); |
| | | taskManagementPreparationDetailVO.setVehicleColor(vehicle.getVehicleColor()); |
| | | taskManagementPreparationDetailVO.setVehicleCode(vehicle.getVehicleCode()); |
| | | taskManagementPreparationDetailVO.setVehicleVin(vehicle.getVehicleVin()); |
| | | taskManagementPreparationDetailVO.setVehicleLocation(task.getVehicleLocation()); |
| | | taskManagementPreparationDetailVO.setTaskCode(task.getTaskCode()); |
| | | XpVehiclePreparation vehiclePreparation = vehiclePreparationMapper.selectOne(new LambdaQueryWrapper<XpVehiclePreparation>() |
| | | .eq(XpVehiclePreparation::getTaskId, id).last("limit 1")); |
| | | if (vehiclePreparation != null){ |
| | | taskManagementPreparationDetailVO.setLeftFrontWheel(vehiclePreparation.getLeftFrontWheel()); |
| | | taskManagementPreparationDetailVO.setRightFrontWheel(vehiclePreparation.getRightFrontWheel()); |
| | | taskManagementPreparationDetailVO.setLeftRearWheel(vehiclePreparation.getLeftRearWheel()); |
| | | taskManagementPreparationDetailVO.setRightRearWheel(vehiclePreparation.getRightRearWheel()); |
| | | taskManagementPreparationDetailVO.setHeadLight(vehiclePreparation.getHeadLight()); |
| | | taskManagementPreparationDetailVO.setTurnSignal(vehiclePreparation.getTurnSignal()); |
| | | taskManagementPreparationDetailVO.setBrakeLight(vehiclePreparation.getBrakeLight()); |
| | | taskManagementPreparationDetailVO.setFogLight(vehiclePreparation.getFogLight()); |
| | | taskManagementPreparationDetailVO.setBodyEmblem(vehiclePreparation.getBodyEmblem()); |
| | | taskManagementPreparationDetailVO.setCabinCleaning(vehiclePreparation.getCabinCleaning()); |
| | | taskManagementPreparationDetailVO.setLostItems(vehiclePreparation.getLostItems()); |
| | | taskManagementPreparationDetailVO.setRemarks(vehiclePreparation.getRemarks()); |
| | | taskManagementPreparationDetailVO.setOperationsUserId(vehiclePreparation.getOperationsUserId()); |
| | | taskManagementPreparationDetailVO.setOperationsTime(vehiclePreparation.getCreateTime()); |
| | | if (vehiclePreparation.getOperationsUserId() != null){ |
| | | XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehiclePreparation.getOperationsUserId()).getData(); |
| | | if (operationsUser != null){ |
| | | taskManagementPreparationDetailVO.setOperationsUserName(operationsUser.getNickName()); |
| | | } |
| | | } |
| | | } |
| | | managementDetailVO.setPreparationDetailVO(taskManagementPreparationDetailVO); |
| | | |
| | | break; |
| | | case "4": |
| | | // 洗车 |
| | | TaskManagementCleanDetailVO taskManagementCleanDetailVO = new TaskManagementCleanDetailVO(); |
| | | taskManagementCleanDetailVO.setId(task.getId()); |
| | | taskManagementCleanDetailVO.setVehicleId(vehicle.getId()); |
| | | taskManagementCleanDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel()); |
| | | taskManagementCleanDetailVO.setPlateNumber(vehicle.getPlateNumber()); |
| | | taskManagementCleanDetailVO.setVehicleColor(vehicle.getVehicleColor()); |
| | | taskManagementCleanDetailVO.setVehicleCode(vehicle.getVehicleCode()); |
| | | taskManagementCleanDetailVO.setVehicleVin(vehicle.getVehicleVin()); |
| | | taskManagementCleanDetailVO.setVehicleLocation(task.getVehicleLocation()); |
| | | taskManagementCleanDetailVO.setTaskCode(task.getTaskCode()); |
| | | XpVehicleClean vehicleClean = vehicleCleanMapper.selectOne(new LambdaQueryWrapper<XpVehicleClean>() |
| | | .eq(XpVehicleClean::getTaskId, id).last("limit 1")); |
| | | if (vehicleClean != null){ |
| | | taskManagementCleanDetailVO.setTaskImage(vehicleClean.getTaskImage()); |
| | | taskManagementCleanDetailVO.setOperationUserId(vehicleClean.getOperationsUserId()); |
| | | if (vehicleClean.getOperationsUserId() != null){ |
| | | XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleClean.getOperationsUserId()).getData(); |
| | | if (operationsUser != null){ |
| | | taskManagementCleanDetailVO.setOperationsUserName(operationsUser.getNickName()); |
| | | } |
| | | } |
| | | } |
| | | managementDetailVO.setCleanDetailVO(taskManagementCleanDetailVO); |
| | | |
| | | break; |
| | | case "5": |
| | | // 维修 |
| | | TaskManagementRepairDetailVO taskManagementRepairDetailVO = new TaskManagementRepairDetailVO(); |
| | | taskManagementRepairDetailVO.setId(task.getId()); |
| | | taskManagementRepairDetailVO.setVehicleId(vehicle.getId()); |
| | | taskManagementRepairDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel()); |
| | | taskManagementRepairDetailVO.setPlateNumber(vehicle.getPlateNumber()); |
| | | taskManagementRepairDetailVO.setVehicleColor(vehicle.getVehicleColor()); |
| | | taskManagementRepairDetailVO.setVehicleCode(vehicle.getVehicleCode()); |
| | | taskManagementRepairDetailVO.setVehicleVin(vehicle.getVehicleVin()); |
| | | taskManagementRepairDetailVO.setVehicleLocation(task.getVehicleLocation()); |
| | | taskManagementRepairDetailVO.setTaskCode(task.getTaskCode()); |
| | | XpVehicleRepair vehicleRepair = vehicleRepairMapper.selectOne(new LambdaQueryWrapper<XpVehicleRepair>() |
| | | .eq(XpVehicleRepair::getTaskId, id).last("limit 1")); |
| | | if (vehicleRepair != null){ |
| | | taskManagementRepairDetailVO.setStartTime(vehicleRepair.getStartTime()); |
| | | taskManagementRepairDetailVO.setEndTime(vehicleRepair.getEndTime()); |
| | | taskManagementRepairDetailVO.setRepairReason(vehicleRepair.getRepairReason()); |
| | | taskManagementRepairDetailVO.setStartRepairPicture(vehicleRepair.getStartRepairPicture()); |
| | | taskManagementRepairDetailVO.setRepairMoney(vehicleRepair.getRepairMoney()); |
| | | taskManagementRepairDetailVO.setRepairMoneyDetail(vehicleRepair.getRepairMoneyDetail()); |
| | | taskManagementRepairDetailVO.setSendUserId(vehicleRepair.getSendUserId()); |
| | | taskManagementRepairDetailVO.setSendTime(vehicleRepair.getSendTime()); |
| | | taskManagementRepairDetailVO.setReturnUserId(vehicleRepair.getReturnUserId()); |
| | | taskManagementRepairDetailVO.setReturnTime(vehicleRepair.getReturnTime()); |
| | | if (vehicleRepair.getReturnUserId() != null){ |
| | | XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleRepair.getReturnUserId()).getData(); |
| | | if (operationsUser != null){ |
| | | taskManagementRepairDetailVO.setReturnUserName(operationsUser.getNickName()); |
| | | } |
| | | } |
| | | if (vehicleRepair.getSendUserId() != null){ |
| | | XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleRepair.getSendUserId()).getData(); |
| | | if (operationsUser != null){ |
| | | taskManagementRepairDetailVO.setSendUserName(operationsUser.getNickName()); |
| | | } |
| | | } |
| | | } |
| | | managementDetailVO.setRepairDetailVO(taskManagementRepairDetailVO); |
| | | |
| | | break; |
| | | default: |
| | | // 保养、年检、保险、营运资质 |
| | |
| | | res.setVehicleCode(vehicle.getVehicleCode()); |
| | | res.setVehicleLocation(task.getVehicleLocation()); |
| | | res.setVehicleVin(vehicle.getVehicleVin()); |
| | | managementDetailVO.setRoutineDetailVO(res); |
| | | |
| | | break; |
| | | } |
| | | |
| | |
| | | return R.ok(managementDetailVO); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @Service |
| | | public class XpWorkOrderLogServiceImpl extends ServiceImpl<XpWorkOrderLogMapper, XpWorkOrderLog> implements IXpWorkOrderLogService { |
| | | |
| | | |
| | | } |
| | |
| | | package com.xiaopeng.maintenance.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.feignClient.account.SysUserClient; |
| | | import com.xiaopeng.api.feignClient.operation.XpSystemSettingClient; |
| | | import com.xiaopeng.api.model.account.SysUser; |
| | | import com.xiaopeng.api.model.maintenance.XpWorkOrder; |
| | | import com.xiaopeng.api.model.maintenance.XpWorkOrderLog; |
| | | import com.xiaopeng.api.model.operation.XpFeedbackType; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.mapper.XpWorkOrderLogMapper; |
| | | import com.xiaopeng.maintenance.mapper.XpWorkOrderMapper; |
| | | import com.xiaopeng.maintenance.model.query.WorkOrderPageListQuery; |
| | | import com.xiaopeng.maintenance.model.vo.TaskManagementPageListVO; |
| | | import com.xiaopeng.maintenance.service.IXpWorkOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class XpWorkOrderServiceImpl extends ServiceImpl<XpWorkOrderMapper, XpWorkOrder> implements IXpWorkOrderService { |
| | | |
| | | @Autowired |
| | | private SysUserClient sysUserClient; |
| | | @Autowired |
| | | |
| | | private XpSystemSettingClient systemSettingClient; |
| | | |
| | | @Autowired |
| | | private XpWorkOrderLogMapper workOrderLogMapper; |
| | | |
| | | @Override |
| | | public PageInfo<XpWorkOrder> pageList(WorkOrderPageListQuery query) { |
| | | PageInfo<XpWorkOrder> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<XpWorkOrder> list = this.baseMapper.pageList(pageInfo, query); |
| | | if (list.isEmpty()) { |
| | | return new PageInfo<>(); |
| | | } |
| | | List<Long> handleUserIds = list.stream().map(XpWorkOrder::getHandleUserId).collect(Collectors.toList()); |
| | | List<SysUser> sysUsers = sysUserClient.listByIds(handleUserIds).getData(); |
| | | Map<Long, String> userMap = new HashMap<>(); |
| | | if (sysUsers != null) { |
| | | userMap = sysUsers.stream().collect(Collectors.toMap(SysUser::getId, SysUser::getNickName)); |
| | | } |
| | | for (XpWorkOrder xpWorkOrder : list) { |
| | | if (xpWorkOrder.getHandleUserId() != null) { |
| | | String handleUserName = userMap.get(xpWorkOrder.getHandleUserId()); |
| | | xpWorkOrder.setHandleUserName(handleUserName); |
| | | if (xpWorkOrder.getHandleUserId().equals(query.getUserId())){ |
| | | xpWorkOrder.setIsHandle(1); |
| | | }else{ |
| | | xpWorkOrder.setIsHandle(0); |
| | | } |
| | | } |
| | | XpFeedbackType feedbackType = systemSettingClient.getFeedbackTypeById(xpWorkOrder.getFeedbackTypeId()).getData(); |
| | | if (feedbackType != null) { |
| | | xpWorkOrder.setFeedbackTypeName(feedbackType.getFeedbackType()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public XpWorkOrder workOrderDetail(Long id) { |
| | | XpWorkOrder workOrder = this.getById(id); |
| | | List<XpWorkOrderLog> workOrderLogs = workOrderLogMapper.selectList(new LambdaQueryWrapper<XpWorkOrderLog>() |
| | | .eq(XpWorkOrderLog::getWorkOrderId, id)); |
| | | XpFeedbackType feedbackType = systemSettingClient.getFeedbackTypeById(workOrder.getFeedbackTypeId()).getData(); |
| | | if (feedbackType != null) { |
| | | workOrder.setFeedbackTypeName(feedbackType.getFeedbackType()); |
| | | } |
| | | if (workOrderLogs.isEmpty()) { |
| | | return workOrder; |
| | | } |
| | | List<Long> handleUserIds = workOrderLogs.stream().map(XpWorkOrderLog::getHandleUserId).collect(Collectors.toList()); |
| | | List<SysUser> sysUsers = sysUserClient.listByIds(handleUserIds).getData(); |
| | | Map<Long, String> userMap = new HashMap<>(); |
| | | if (sysUsers != null) { |
| | | userMap = sysUsers.stream().collect(Collectors.toMap(SysUser::getId, SysUser::getNickName)); |
| | | } |
| | | for (XpWorkOrderLog workOrderLog : workOrderLogs) { |
| | | if (workOrderLog.getHandleUserId() != null) { |
| | | String handleUserName = userMap.get(workOrderLog.getHandleUserId()); |
| | | workOrderLog.setHandleUserName(handleUserName); |
| | | } |
| | | } |
| | | workOrder.setWorkOrderLogs(workOrderLogs); |
| | | return workOrder; |
| | | } |
| | | |
| | | @Override |
| | | public void handleWorkOrder(XpWorkOrderLog workOrderLog) { |
| | | XpWorkOrder workOrder = this.getById(workOrderLog.getWorkOrderId()); |
| | | if (workOrderLog.getHandleType() == 2) { |
| | | // 办结 工单状态流转为已完成 |
| | | workOrder.setHandleStatus(3); |
| | | workOrder.setHandleUserId(workOrderLog.getHandleUserId()); |
| | | this.updateById(workOrder); |
| | | }else{ |
| | | // 移交 |
| | | workOrder.setHandleStatus(2); |
| | | workOrder.setHandleUserId(workOrderLog.getHandleUserId()); |
| | | this.updateById(workOrder); |
| | | } |
| | | workOrderLogMapper.insert(workOrderLog); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.xiaopeng.api.model.maintenance.XpTaskRuleRole; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "管理后台-任务规则详情VO") |
| | | public class TaskRuleDetailVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "自增id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "车辆日常检测是否启用 0否1是") |
| | | private Boolean vehicleInspection; |
| | | @ApiModelProperty(value = "车辆日常监测 频次") |
| | | private Integer vehicleInspectionFrequency; |
| | | @ApiModelProperty(value = "车辆日常检测 任务下放时间") |
| | | private LocalDateTime vehicleInspectionTime; |
| | | |
| | | @ApiModelProperty(value = "车辆日常监测 紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer vehicleInspectionLevel; |
| | | |
| | | @ApiModelProperty(value = "车辆收车是否启用 0否1是") |
| | | private Boolean vehicleCollection; |
| | | |
| | | @ApiModelProperty(value = "车辆收车每日时间") |
| | | private LocalDateTime vehicleCollectionTime; |
| | | |
| | | @ApiModelProperty(value = "车辆保养周期是否启用") |
| | | private Boolean maintenanceCycle; |
| | | |
| | | @ApiModelProperty(value = "车辆保养周期 保养周期X") |
| | | private Integer maintenanceCycleTime; |
| | | |
| | | @ApiModelProperty(value = "车辆保养周期 保养周期X 1=天 2=月") |
| | | private Integer maintenanceCycleTimeType; |
| | | |
| | | @ApiModelProperty(value = "车辆保养周期 任务下放时间") |
| | | private LocalDateTime maintenanceCycleTaskTime; |
| | | |
| | | @ApiModelProperty(value = "车辆保养周期 紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer maintenanceCycleLevel; |
| | | |
| | | @ApiModelProperty(value = "充电策略是否启用 0否1是") |
| | | private Integer chargingStrategy; |
| | | |
| | | @ApiModelProperty(value = "充电策略 电量低于XX 不可接新单并发起充电任务") |
| | | private BigDecimal chargingStrategyBatteryl; |
| | | |
| | | @ApiModelProperty(value = "充电策略 紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer chargingStrategyLevel; |
| | | |
| | | @ApiModelProperty(value = "车身清洁保养周期X") |
| | | private Integer vehicleCleanTime; |
| | | |
| | | @ApiModelProperty(value = "车身清洁保养周期X 1=天 2=月") |
| | | private Integer vehicleCleanTimeType; |
| | | |
| | | @ApiModelProperty(value = "车身清洁任务紧急程度0=P0 1=P1 2=P2 3=P3") |
| | | private Integer vehicleCleanLevel; |
| | | |
| | | @ApiModelProperty(value = "日常整备保养周期X") |
| | | private Integer routineMaintenanceTime; |
| | | |
| | | @ApiModelProperty(value = "日常整备保养周期X 1=天 2=月") |
| | | private Integer routineMaintenanceTimeType; |
| | | |
| | | @ApiModelProperty(value = "日常整备 紧急程度0=P0 1=P1 2=P2 3=P3") |
| | | private Integer routineMaintenanceLevel; |
| | | |
| | | @ApiModelProperty(value = "年检/保险策略 是否启用 0否1是") |
| | | private Boolean insurance; |
| | | |
| | | @ApiModelProperty(value = "年检/保险策略 保险到期X天 下发任务") |
| | | private Integer insuranceExpires; |
| | | |
| | | @ApiModelProperty(value = "年检/保险策略 年检到期X天 下发任务") |
| | | private Integer insuranceInspectionExpires; |
| | | |
| | | @ApiModelProperty(value = "网约车运营资质到期X天 下发任务") |
| | | private Integer operationQualificationExpires; |
| | | |
| | | @ApiModelProperty(value = "年检/保险策略 紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer insuranceLevel; |
| | | |
| | | @ApiModelProperty(value = "任务处理时限(分钟)") |
| | | private Integer processingTimeLimit; |
| | | |
| | | @ApiModelProperty(value = "可以操作到达的配置范围,单位米") |
| | | private Double canArriveRange; |
| | | @ApiModelProperty(value = "任务类型关联角色列表") |
| | | private List<XpTaskRuleRole> taskRuleRoleList; |
| | | } |
| | |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.maintenance.XpClockIn"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="clock_time" property="clockTime" /> |
| | | <result column="clock_in_time" property="clockInTime" /> |
| | | <result column="clock_out_time" property="clockOutTime" /> |
| | | <result column="shift_id" property="shiftId" /> |
| | | <result column="clock_result" property="clockResult" /> |
| | | <result column="clock_lon" property="clockLon" /> |
| | | <result column="clock_lat" property="clockLat" /> |
| | | <result column="clock_in_result" property="clockInResult" /> |
| | | <result column="clock_out_result" property="clockOutResult" /> |
| | | <result column="clock_in_lon" property="clockInLon" /> |
| | | <result column="clock_in_lat" property="clockInLat" /> |
| | | <result column="clock_out_lon" property="clockOutLon" /> |
| | | <result column="clock_out_lat" property="clockOutLat" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | </resultMap> |
| | |
| | | <!-- 查询用户当天的打卡记录 --> |
| | | <select id="selectTodayClockInRecords" resultMap="BaseResultMap"> |
| | | SELECT |
| | | id, app_user_id, clock_time, shift_id, clock_result, |
| | | clock_lon, clock_lat, create_time, update_time |
| | | FROM xp_clock_in_${tableSuffix} |
| | | id, app_user_id, clock_in_time,clock_out_time, shift_id, clock_in_result,clock_out_result, |
| | | clock_in_lon, clock_in_lat,clock_out_lon, clock_out_lat, create_time, update_time |
| | | FROM xp_clock_in |
| | | WHERE app_user_id = #{appUserId} |
| | | AND clock_time BETWEEN #{startTime} AND #{endTime} |
| | | AND clock_result IN (1, 2) |
| | | ORDER BY clock_time ASC |
| | | AND clock_in_time BETWEEN #{startTime} AND #{endTime} |
| | | AND clock_in_result IN (1, 2) |
| | | ORDER BY clock_in_time ASC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.xiaopeng.maintenance.mapper.XpShiftMapper"> |
| | | |
| | | <select id="pageList" resultType="com.xiaopeng.api.model.maintenance.XpShift"> |
| | | select id, shift_name, shift_color, start_time, end_time, is_rest, |
| | | rest_start_time, rest_end_time, create_by, create_time, update_by, update_time, is_deleted |
| | | from xp_shift |
| | | order by create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | order by t.status,t.task_urgency_level asc, t.create_time desc |
| | | </select> |
| | | <select id="exportList" resultType="com.xiaopeng.maintenance.model.vo.TaskManagementPageListVO"> |
| | | select t.id,t.task_category as taskCategory,t.task_type_id as taskTypeId,t.task_urgency_level as |
| | | taskUrgencyLevel,t.task_description as taskDescription,t.handle_user_id as handleUserId,t.create_time as |
| | | createTime,t.status as status, |
| | | v.plate_number as plateNumber |
| | | from xp_task t |
| | | left join xp_vehicle v on t.vehicle_id = v.id |
| | | where t.is_deleted = 0 |
| | | <if test="query.taskCategory != null"> |
| | | and t.task_category = #{query.taskCategory} |
| | | </if> |
| | | <if test="query.taskUrgencyLevel != null"> |
| | | and t.task_urgency_level = #{query.taskUrgencyLevel} |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and t.status = #{query.status} |
| | | </if> |
| | | <if test="query.plateNumber != null and query.plateNumber != ''"> |
| | | and v.plate_number like concat('%',#{query.plateNumber},'%') |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | and t.create_time between #{query.startTime} and #{query.endTime} |
| | | </if> |
| | | <if test="query.taskGeneralId != null"> |
| | | and t.task_type_id = #{query.taskGeneralId} |
| | | </if> |
| | | <if test="query.taskErrorId != null"> |
| | | and find_in_set(#{query.taskErrorId}, t.task_type_id) |
| | | and t.task_category = 2 |
| | | </if> |
| | | order by t.status,t.task_urgency_level asc, t.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.xiaopeng.maintenance.mapper.XpWorkOrderMapper"> |
| | | |
| | | <select id="pageList" resultType="com.xiaopeng.api.model.maintenance.XpWorkOrder"> |
| | | select wo.id as id, |
| | | wo.problem as problem, |
| | | wo.problem_description as problemDescription, |
| | | wo.problem_image as problemImage, |
| | | wo.feedback_user_phone as feedbackUserPhone, |
| | | wo.problem_source as problemSource, |
| | | wo.feedback_type_id as feedbackTypeId, |
| | | wo.priority as priority, |
| | | wo.handle_status as handleStatus, |
| | | wo.handle_user_id as handleUserId, |
| | | |
| | | wo.create_time as createTime |
| | | from xp_work_order wo |
| | | where 1=1 and wo.is_deleted = 0 |
| | | <if test="query.feedbackUserPhone != null and query.feedbackUserPhone != ''"> |
| | | and wo.feedbackUserPhone like concat('%',#{query.feedbackUserPhone},'%') |
| | | </if> |
| | | <if test="query.problemSource != null"> |
| | | and wo.problem_source = #{query.problemSource} |
| | | </if> |
| | | <if test="query.feedbackTypeId != null"> |
| | | and wo.feedback_type_id = #{query.feedbackTypeId} |
| | | </if> |
| | | <if test="query.priority != null"> |
| | | and wo.priority = #{query.priority} |
| | | </if> |
| | | <if test="query.handleStatus != null"> |
| | | and wo.handle_status = #{query.handleStatus} |
| | | </if> |
| | | order by wo.handle_status asc,wo.priority ,wo.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.xiaopeng.api.vo.operation.RouteVo; |
| | | import com.xiaopeng.common.core.utils.HttpUtils; |
| | | import com.xiaopeng.map.mangodb.service.XpGeoFencingPolygonService; |
| | | import com.xiaopeng.map.utils.mangoUtils.MongoGeoFenceUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 高德地图的地理编码工具类 |
| | |
| | | |
| | | private String key = "66ae577f63898dae3016d599fda57221"; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | |
| | | @Autowired |
| | | private XpGeoFencingPolygonService xpGeoFencingPolygonService; |
| | | |
| | |
| | | |
| | | // 路径不存在 |
| | | String PATH_NOT_FOUND = "path.not.found"; |
| | | |
| | | // 存在进行中的订单 |
| | | String HAS_UNPAID_ORDER = "has.unpaid.order"; |
| | | } |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | import com.xiaopeng.api.model.operation.XpAgreement; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.operation.dto.XpAgreementDTO; |
| | | import com.xiaopeng.operation.service.XpAgreementService; |
| | | import com.xiaopeng.operation.vo.XpAgreementVo; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.apiguardian.api.API; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | public class XpAgreementController extends BaseController { |
| | | |
| | |
| | | public R<XpAgreementVo> getAppContent(@ApiParam(name = "type", value = "类型 1=用户服务协议 2=平台隐私政策 ") @PathVariable Integer type) { |
| | | return R.ok(xpAgreementService.getContentByType(type)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取协议",tags = {"管理后台-内容中心"}) |
| | | @GetMapping("/api/v1/agreement/content/{type}") |
| | | public R<XpAgreement> getAgreementContent(@ApiParam(name = "type", value = "类型 1=用户服务协议 2=平台隐私政策 3=敏感个人信息处理情况说明 4=向第三方提供个人信息情况的说明 5=乘车须知 6=计费规则说明 ") @PathVariable Integer type) { |
| | | return R.ok(xpAgreementService.getAgreementContent(type)); |
| | | } |
| | | @ApiOperation(value = "保存协议",tags = {"管理后台-内容中心"}) |
| | | @PostMapping("/api/v1/agreement/save") |
| | | public R<?> saveAgreement(@RequestBody @Valid XpAgreementDTO dto){ |
| | | xpAgreementService.saveAgreement(dto); |
| | | return R.ok(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | import com.xiaopeng.api.model.operation.XpBanner; |
| | | import com.xiaopeng.api.model.operation.XpWhitelist; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.operation.query.BannerPageListQuery; |
| | | import com.xiaopeng.operation.query.WhitelistPageListQuery; |
| | | import com.xiaopeng.operation.service.XpBannerService; |
| | | import com.xiaopeng.operation.vo.XpBannerListVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/v1/banner") |
| | | @Api(tags = "管理后台-banner模块") |
| | | public class XpBannerManagementController extends BaseController { |
| | | |
| | | // banner实现类 |
| | | private final XpBannerService xpBannerService; |
| | | |
| | | public XpBannerManagementController(XpBannerService xpBannerService) { |
| | | this.xpBannerService = xpBannerService; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "banner分页列表") |
| | | @PostMapping("/pageList") |
| | | public R<PageInfo<XpBanner>> pageList(@RequestBody BannerPageListQuery query) { |
| | | PageInfo<XpBanner> pageList = xpBannerService.pageList(query); |
| | | return R.ok(pageList); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | |
| | | import com.xiaopeng.api.model.operation.XpFeedbackType; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.operation.service.IXpFeedbackTypeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 意见反馈类型表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/v1/feedbackType") |
| | | @Api(tags = "管理后台-意见反馈类型") |
| | | public class XpFeedbackTypeManagementController { |
| | | |
| | | |
| | | private final IXpFeedbackTypeService xpFeedbackTypeService; |
| | | |
| | | public XpFeedbackTypeManagementController(IXpFeedbackTypeService xpFeedbackTypeService) { |
| | | this.xpFeedbackTypeService = xpFeedbackTypeService; |
| | | } |
| | | @GetMapping("/getList") |
| | | @ApiOperation(value = "获取意见反馈类型列表") |
| | | public R<List<XpFeedbackType>> getList() { |
| | | List<XpFeedbackType> list = xpFeedbackTypeService.list(); |
| | | return R.ok(list); |
| | | } |
| | | @ApiOperation(value = "新增意见反馈类型") |
| | | @PostMapping(value = "/saveFeedbackType") |
| | | public R<Boolean> add(@RequestBody XpFeedbackType xpFeedbackType) { |
| | | return R.ok(xpFeedbackTypeService.save(xpFeedbackType)); |
| | | } |
| | | @ApiOperation(value = "编辑意见反馈类型") |
| | | @PostMapping(value = "/updateFeedbackType") |
| | | public R<Boolean> updateFeedbackType(@RequestBody XpFeedbackType xpFeedbackType) { |
| | | return R.ok(xpFeedbackTypeService.updateById(xpFeedbackType)); |
| | | } |
| | | @ApiOperation(value = "删除意见反馈类型") |
| | | @DeleteMapping(value = "/deleteFeedbackType") |
| | | public R<Boolean> deleteFeedbackType(Long id) { |
| | | return R.ok(xpFeedbackTypeService.removeById(id)); |
| | | } |
| | | } |
| | |
| | | import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions; |
| | | import com.xiaopeng.api.model.operation.XpSystemSetting; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.operation.dto.XpFrequentlyAskedQuestionsDTO; |
| | | import com.xiaopeng.operation.service.IXpFrequentlyAskedQuestionsService; |
| | | import com.xiaopeng.operation.service.XpSystemSettingService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/base/v1/mini-program") |
| | | @Api(tags = "常见问题") |
| | | public class XpFrequentlyAskedQuestionsController { |
| | | |
| | | private final IXpFrequentlyAskedQuestionsService xpFrequentlyAskedQuestionsService; |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/frequently-asked-questions/getList") |
| | | @GetMapping("/base/v1/mini-program/frequently-asked-questions/getList") |
| | | @ApiOperation(value = "获取常见问题列表",tags = {"常见问题列表"},response = XpFrequentlyAskedQuestions.class) |
| | | public R<List<XpFrequentlyAskedQuestions>> getList() { |
| | | XpSystemSetting systemSetting = xpSystemSettingService.getOne(null); |
| | | List<XpFrequentlyAskedQuestions> list = xpFrequentlyAskedQuestionsService.list(new LambdaQueryWrapper<XpFrequentlyAskedQuestions>().last("limit "+systemSetting.getHeadShowCount())); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/api/v1/frequently-asked-questions/getList") |
| | | @ApiOperation(value = "获取常见问题列表", tags = {"管理后台-内容中心"}, response = XpFrequentlyAskedQuestions.class) |
| | | public R<List<XpFrequentlyAskedQuestions>> getQuestionList() { |
| | | List<XpFrequentlyAskedQuestions> list = xpFrequentlyAskedQuestionsService.list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存常见问题", tags = {"管理后台-内容中心"}) |
| | | @PostMapping("/api/v1/frequently-asked-questions/save") |
| | | public R<?> saveQuestion(@RequestBody XpFrequentlyAskedQuestionsDTO dto) { |
| | | xpFrequentlyAskedQuestionsService.saveQuestion(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | |
| | | import com.xiaopeng.api.model.operation.XpFeedbackType; |
| | | import com.xiaopeng.api.model.operation.XpNotification; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.operation.dto.NotificationDto; |
| | | import com.xiaopeng.operation.service.IXpNotificationService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.parameters.RequestBody; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/xp-notification") |
| | | @RestController |
| | | @RequestMapping("/api/v1/notification") |
| | | @Api(tags = "管理后台-消息通知设置") |
| | | public class XpNotificationController { |
| | | |
| | | @Autowired |
| | | private IXpNotificationService xpNotificationService; |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "获取消息通知设置列表") |
| | | public R<List<XpNotification>> list() { |
| | | List<XpNotification> list = xpNotificationService.list(); |
| | | return R.ok(list); |
| | | } |
| | | @PostMapping("/update") |
| | | @ApiOperation(value = "修改设置") |
| | | public R<List<XpNotification>> update(@RequestBody NotificationDto notificationDto) { |
| | | List<XpNotification> notifications = notificationDto.getNotifications(); |
| | | xpNotificationService.updateBatchById(notifications); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | @PostMapping("/setSpecialPoint") |
| | | @ApiOperation(value = "设置特殊点位") |
| | | public R setSpecialPoint(@RequestBody XpPointSpecialDto dto) { |
| | | xpPointService.update(new LambdaUpdateWrapper<XpPoint>().set(XpPoint::getType, 0)); |
| | | xpPointService.update(new LambdaUpdateWrapper<XpPoint>().in(XpPoint::getId,dto.getChargePoints()).set(XpPoint::getType,1)); |
| | | xpPointService.update(new LambdaUpdateWrapper<XpPoint>().in(XpPoint::getId,dto.getParkingPoints()).set(XpPoint::getType,2)); |
| | | xpPointService.update(new LambdaUpdateWrapper<XpPoint>().set(XpPoint::getChargePoint, 0).set(XpPoint::getParkingPoint,0)); |
| | | xpPointService.update(new LambdaUpdateWrapper<XpPoint>().in(XpPoint::getId,dto.getChargePoints()).set(XpPoint::getChargePoint,1)); |
| | | xpPointService.update(new LambdaUpdateWrapper<XpPoint>().in(XpPoint::getId,dto.getParkingPoints()).set(XpPoint::getParkingPoint,2)); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.operation.constant.I18nKeyConstant; |
| | | import com.xiaopeng.operation.dto.PricingAddDTO; |
| | | import com.xiaopeng.operation.dto.PricingSetPriceDTO; |
| | | import com.xiaopeng.operation.dto.PricingSetRuleDTO; |
| | | import com.xiaopeng.operation.dto.XpOrderDto; |
| | | import com.xiaopeng.operation.dto.*; |
| | | 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.service.*; |
| | | import com.xiaopeng.operation.vo.PricingPageListVO; |
| | | import com.xiaopeng.operation.vo.SaveOrderVo; |
| | | import com.xiaopeng.unifiedverification.interceptor.XpClientCheck; |
| | |
| | | private final IXpGeoQueryEntityService xpGeoQueryEntityService; |
| | | private final UserResourcesClient userResourcesClient; |
| | | private final IXpWhitelistService xpWhitelistService; |
| | | private final XpOpenCityService xpOpenCityService; |
| | | |
| | | |
| | | public XpPricingController(XpPricingService xpPricingService, IXpGeoQueryEntityService xpGeoQueryEntityService, UserResourcesClient userResourcesClient, IXpWhitelistService xpWhitelistService) { |
| | | public XpPricingController(XpPricingService xpPricingService, IXpGeoQueryEntityService xpGeoQueryEntityService, UserResourcesClient userResourcesClient, IXpWhitelistService xpWhitelistService, XpRegionService xpRegionService, XpOpenCityService xpOpenCityService) { |
| | | this.xpPricingService = xpPricingService; |
| | | this.xpGeoQueryEntityService = xpGeoQueryEntityService; |
| | | this.userResourcesClient = userResourcesClient; |
| | | this.xpWhitelistService = xpWhitelistService; |
| | | this.xpOpenCityService = xpOpenCityService; |
| | | } |
| | | |
| | | |
| | |
| | | if (pricing == null) { |
| | | throw new ServiceException("定价不存在", I18nKeyConstant.PRICING_NOT_EXIST); |
| | | } |
| | | //获取城市信息 |
| | | String cityName = xpOpenCityService.getNameWithCityName(pricing.getCityId()); |
| | | pricing.setCityName(cityName); |
| | | return R.ok(pricing); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/pricing/add") |
| | | @ApiOperation(value = "管理后台-新增定价", tags = {"管理后台-定价管理"}) |
| | | public R<?> add(@Valid @RequestBody PricingAddDTO dto) { |
| | | xpPricingService.add(dto); |
| | | return R.ok(); |
| | | public R<Long> add(@Valid @RequestBody PricingAddDTO dto) { |
| | | return R.ok(xpPricingService.add(dto)); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/pricing/edit") |
| | | @ApiOperation(value = "管理后台-编辑定价", tags = {"管理后台-定价管理"}) |
| | | public R<?> edit(@Valid @RequestBody PricingEditDTO dto) { |
| | | return R.ok(xpPricingService.edit(dto)); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/pricing/setPrice") |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | import com.xiaopeng.api.model.operation.XpSystemSetting; |
| | | import com.xiaopeng.common.core.constant.CacheConstants; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping("") |
| | | @Api(tags = "系统设置模块") |
| | | public class XpSystemSettingController extends BaseController { |
| | | |
| | | // 系统设置实现类 |
| | |
| | | return R.ok(new CustomerServicePhoneVo(xpSystemSettingService.getCustomerServicePhone())); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "获取系统配置、热修复", tags = {"管理后台-系统"}) |
| | | @GetMapping("/api/v1/systemSetting") |
| | | public R<XpSystemSetting> getSystemSetting(){ |
| | | return R.ok(xpSystemSettingService.lambdaQuery().last("limit 1").one()); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存系统配置、热修复", tags = {"管理后台-系统"}) |
| | | @GetMapping("/api/v1/systemSetting/save") |
| | | public R<?> saveSystemSetting(@RequestBody XpSystemSetting xpSystemSetting){ |
| | | xpSystemSettingService.saveSystemSetting(xpSystemSetting); |
| | | return R.ok(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.xiaopeng.api.model.operation.XpSystemSetting; |
| | | import com.xiaopeng.common.core.constant.CacheConstants; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.common.core.web.domain.AjaxResult; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import com.xiaopeng.operation.service.XpSystemSettingService; |
| | | import com.xiaopeng.operation.vo.CustomerServicePhoneVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/v1/systemSetting") |
| | | @Api(tags = "管理后台-系统设置模块") |
| | | public class XpSystemSettingManagementController extends BaseController { |
| | | |
| | | // 系统设置实现类 |
| | | private final XpSystemSettingService xpSystemSettingService; |
| | | private final RedisService redisService; |
| | | |
| | | public XpSystemSettingManagementController(XpSystemSettingService xpSystemSettingService, RedisService redisService) { |
| | | this.xpSystemSettingService = xpSystemSettingService; |
| | | this.redisService = redisService; |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getSetting") |
| | | @ApiOperation(value = "获取系统设置") |
| | | public R<XpSystemSetting> getCustomerServicePhone() { |
| | | XpSystemSetting systemSetting = xpSystemSettingService.getOne(new LambdaQueryWrapper<XpSystemSetting>() |
| | | .isNotNull(XpSystemSetting::getId)); |
| | | return R.ok(systemSetting); |
| | | } |
| | | @GetMapping("/saveOrUpdateSetting") |
| | | @ApiOperation(value = "保存或修改系统设置") |
| | | public R saveOrUpdateSetting(@RequestBody XpSystemSetting xpSystemSetting) { |
| | | xpSystemSettingService.saveOrUpdate(xpSystemSetting); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import com.xiaopeng.api.model.operation.XpNotification; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "消息通知设置DTO") |
| | | public class NotificationDto { |
| | | |
| | | @ApiModelProperty(value = "消息通知列表") |
| | | private List<XpNotification> notifications; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import javax.validation.constraints.Max; |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * 定价新增数据传输对象 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "定价新增数据传输对象") |
| | | public class PricingEditDTO extends PricingAddDTO{ |
| | | |
| | | @ApiModelProperty(value = "id", required = true) |
| | | @NotNull(message = "id不能为空") |
| | | private Long id; |
| | | } |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "基础价格json配置", required = true, notes = "{\n" + |
| | | " \"num3\": \"起步价数值1\",\n" + |
| | | " \"num4\": \"起步价数值2\",\n" + |
| | | " \"num5\": \"起步价数值3\",\n" + |
| | | " \"num6\": \"起步价数值4\",\n" + |
| | |
| | | " \"num7\": \"起步价数值5\"\n" + |
| | | " }\n" + |
| | | "]") |
| | | @NotBlank(message = "起步价json配置不能为空") |
| | | private String startingFareJson; |
| | | |
| | | @ApiModelProperty(value = "动态价格json配置", required = true, notes = " {\n" + |
| | |
| | | " }") |
| | | @NotBlank(message = "动态价格json配置不能为空") |
| | | private String dynamicPricingJson; |
| | | |
| | | @ApiModelProperty(value = "是否动态价格 0否 1是") |
| | | private Integer isDynamicPrice; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author MiTao |
| | | * @date 2026-02-25 14:41 |
| | | * |
| | | */ |
| | | @Data |
| | | @ApiModel("协议数据传输对象") |
| | | public class XpAgreementDTO { |
| | | @NotNull(message = "协议类型不能为空") |
| | | @ApiModelProperty(value = "类型 1=用户服务协议 2=平台隐私政策 3=敏感个人信息处理情况说明 4=向第三方提供个人信息情况的说明 5=乘车须知 6=计费规则说明") |
| | | private Integer contentType; |
| | | |
| | | @NotBlank(message = "协议内容不能为空") |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author MiTao |
| | | * @date 2026-02-25 15:12 |
| | | * |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "常见问题数据传输对象") |
| | | public class XpFrequentlyAskedQuestionsDTO { |
| | | @ApiModelProperty(value = "常见问题列表") |
| | | private List<XpFrequentlyAskedQuestions> frequentlyAskedQuestionsList; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.api.model.operation.XpBanner; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.operation.query.BannerPageListQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface XpBannerMapper extends BaseMapper<XpBanner> { |
| | | |
| | | List<XpBanner> pageList(@Param("pageInfo") PageInfo<XpBanner> pageInfo, @Param("query") BannerPageListQuery query); |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.query; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.xiaopeng.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "banner管理列表查询query") |
| | | public class BannerPageListQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "广告标题") |
| | | private String bannerTitle; |
| | | @ApiModelProperty(value = "状态(0=未开始,1=进行中,2=已结束)") |
| | | private Integer status; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions; |
| | | import com.xiaopeng.operation.dto.XpFrequentlyAskedQuestionsDTO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface IXpFrequentlyAskedQuestionsService extends IService<XpFrequentlyAskedQuestions> { |
| | | |
| | | void saveQuestion(XpFrequentlyAskedQuestionsDTO dto); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.operation.XpAgreement; |
| | | import com.xiaopeng.operation.dto.XpAgreementDTO; |
| | | import com.xiaopeng.operation.vo.XpAgreementVo; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | List<XpAgreementVo> getContentByTypeAll(); |
| | | |
| | | /** |
| | | * 根据类型获取配置 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | XpAgreement getAgreementContent(Integer type); |
| | | |
| | | |
| | | /** |
| | | * 保存协议 |
| | | * @param dto |
| | | */ |
| | | void saveAgreement(@Valid XpAgreementDTO dto); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.operation.XpBanner; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.operation.query.BannerPageListQuery; |
| | | import com.xiaopeng.operation.query.WhitelistPageListQuery; |
| | | import com.xiaopeng.operation.vo.XpBannerListVo; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | List<XpBannerListVo> getXpBannerList(); |
| | | |
| | | PageInfo<XpBanner> pageList(BannerPageListQuery query); |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | void upDown(Long id, Integer status); |
| | | |
| | | /** |
| | | * 获取开通城市名称,如果开通城市层级是区级,则返回市级名称>区名称 |
| | | * @param cityId |
| | | * @return |
| | | */ |
| | | String getNameWithCityName(Long cityId); |
| | | } |
| | |
| | | import com.xiaopeng.api.model.operation.XpPricing; |
| | | import com.xiaopeng.api.vo.operation.RouteAndFareVo; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.operation.dto.PricingAddDTO; |
| | | import com.xiaopeng.operation.dto.PricingSetPriceDTO; |
| | | import com.xiaopeng.operation.dto.PricingSetRuleDTO; |
| | | import com.xiaopeng.operation.dto.XpOrderDto; |
| | | import com.xiaopeng.operation.dto.*; |
| | | import com.xiaopeng.operation.query.PricingPageListQuery; |
| | | import com.xiaopeng.operation.vo.PricingPageListVO; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * |
| | | * @param dto 新增参数 |
| | | */ |
| | | void add(PricingAddDTO dto); |
| | | Long add(PricingAddDTO dto); |
| | | |
| | | /** |
| | | * 编辑定价 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | Long edit(@Valid PricingEditDTO dto); |
| | | |
| | | /** |
| | | * 管理后台-定价管理-设置价格 |
| | |
| | | */ |
| | | void setRule(PricingSetRuleDTO dto); |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | Integer getOrderFinishTime(); |
| | | |
| | | |
| | | /** |
| | | * 保存系统配置、热修复 |
| | | * @param xpSystemSetting |
| | | */ |
| | | void saveSystemSetting(XpSystemSetting xpSystemSetting); |
| | | } |
| | |
| | | package com.xiaopeng.operation.service.impl; |
| | | |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.dto.XpAgreementDTO; |
| | | import com.xiaopeng.operation.mapper.XpAgreementMapper; |
| | | import com.xiaopeng.api.model.operation.XpAgreement; |
| | | import com.xiaopeng.operation.service.XpAgreementService; |
| | | import com.xiaopeng.operation.vo.XpAgreementVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | return xpAgreementVos; |
| | | } |
| | | |
| | | /** |
| | | * 根据类型获取配置 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @Override |
| | | public XpAgreement getAgreementContent(Integer type) { |
| | | return this.lambdaQuery().eq(XpAgreement::getContentType, type).last("limit 1").one(); |
| | | } |
| | | |
| | | @Override |
| | | public void saveAgreement(XpAgreementDTO dto) { |
| | | //根据类型查询协议 |
| | | Optional<XpAgreement> opt = this.lambdaQuery().eq(XpAgreement::getContentType, dto.getContentType()).last("limit 1").oneOpt(); |
| | | |
| | | //如果存在则更新,不存在则新增 |
| | | if (opt.isPresent()) { |
| | | XpAgreement xpAgreement = opt.get(); |
| | | xpAgreement.setContent(dto.getContent()); |
| | | updateById(xpAgreement); |
| | | } else { |
| | | XpAgreement xpAgreement = BeanUtil.copyProperties(dto, XpAgreement.class); |
| | | this.save(xpAgreement); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.model.operation.XpWhitelist; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.operation.mapper.XpBannerMapper; |
| | | import com.xiaopeng.api.model.operation.XpBanner; |
| | | import com.xiaopeng.operation.query.BannerPageListQuery; |
| | | import com.xiaopeng.operation.query.WhitelistPageListQuery; |
| | | import com.xiaopeng.operation.service.XpBannerService; |
| | | import com.xiaopeng.operation.vo.XpBannerListVo; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<XpBanner> pageList(BannerPageListQuery query) { |
| | | PageInfo<XpBanner> pageInfo = new PageInfo<>(query.getPageNum(),query.getPageSize()); |
| | | List<XpBanner> list = this.baseMapper.pageList(pageInfo,query); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | package com.xiaopeng.operation.service.impl; |
| | | |
| | | import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions; |
| | | import com.xiaopeng.operation.dto.XpFrequentlyAskedQuestionsDTO; |
| | | import com.xiaopeng.operation.mapper.XpFrequentlyAskedQuestionsMapper; |
| | | import com.xiaopeng.operation.service.IXpFrequentlyAskedQuestionsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.service.IXpFrequentlyAskedQuestionsService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class XpFrequentlyAskedQuestionsServiceImpl extends ServiceImpl<XpFrequentlyAskedQuestionsMapper, XpFrequentlyAskedQuestions> implements IXpFrequentlyAskedQuestionsService { |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void saveQuestion(XpFrequentlyAskedQuestionsDTO dto) { |
| | | //先删除原有的常见问题 |
| | | remove(null); |
| | | List<XpFrequentlyAskedQuestions> frequentlyAskedQuestionsList = dto.getFrequentlyAskedQuestionsList(); |
| | | saveBatch(frequentlyAskedQuestionsList); |
| | | } |
| | | } |
| | |
| | | public void upDown(Long id, Integer status) { |
| | | lambdaUpdate().eq(XpOpenCity::getId, id).set(XpOpenCity::getStatus, status).update(); |
| | | } |
| | | |
| | | @Override |
| | | public String getNameWithCityName(Long cityId) { |
| | | String cityName = ""; |
| | | XpOpenCity openCity = getById(cityId); |
| | | if (Objects.nonNull(openCity)) { |
| | | if (StringUtils.isNotBlank(openCity.getDistrictCode())) { |
| | | cityName = openCity.getCityName() + ">" + openCity.getDistrictName(); |
| | | } else { |
| | | cityName = openCity.getCityName(); |
| | | } |
| | | } |
| | | return cityName; |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.dto.account.GetUserCouponDto; |
| | |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.utils.DateUtils; |
| | | import com.xiaopeng.common.core.utils.StringUtils; |
| | | import com.xiaopeng.common.core.utils.uuid.UUID; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import com.xiaopeng.operation.constant.I18nKeyConstant; |
| | | import com.xiaopeng.operation.dto.PricingAddDTO; |
| | | import com.xiaopeng.operation.dto.PricingSetPriceDTO; |
| | | import com.xiaopeng.operation.dto.PricingSetRuleDTO; |
| | | import com.xiaopeng.operation.dto.XpOrderDto; |
| | | import com.xiaopeng.operation.dto.*; |
| | | import com.xiaopeng.operation.mapper.*; |
| | | import com.xiaopeng.operation.query.PricingPageListQuery; |
| | | import com.xiaopeng.operation.service.IXpGeoQueryEntityService; |
| | |
| | | @Override |
| | | public Long saveOrder(XpOrderDto dto, String uid) { |
| | | |
| | | |
| | | // 是否在运营区域时间内 |
| | | XpElectronicFenceArea xpElectronicFenceArea = xpElectronicFenceAreaMapper.selectById(dto.getXpElectronicFenceAreaId()); |
| | | XpElectronicFence xpElectronicFence = xpElectronicFenceMapper.selectById(xpElectronicFenceArea.getElectronicId()); |
| | |
| | | // 判断是否有进行的订单 |
| | | R<Long> r = xpOrderClient.hasUnPaodOrder(uid); |
| | | if (r.getData() > 0) { |
| | | throw new RuntimeException("有正在进行的订单"); |
| | | throw new ServiceException("有正在进行的订单", I18nKeyConstant.HAS_UNPAID_ORDER); |
| | | } |
| | | |
| | | // 获取起点经纬度 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void add(PricingAddDTO dto) { |
| | | public Long add(PricingAddDTO dto) { |
| | | XpOpenCity openCity = xpOpenCityMapper.selectById(dto.getCityId()); |
| | | if (openCity == null) { |
| | | throw new ServiceException("开通城市不存在"); |
| | |
| | | XpPricing pricing = new XpPricing(); |
| | | pricing.setVehicleModel(dto.getVehicleModel()); |
| | | pricing.setChannel(dto.getChannel()); |
| | | pricing.setCityId(dto.getCityId().intValue()); |
| | | pricing.setCityId(dto.getCityId()); |
| | | pricing.setRemark(dto.getRemark()); |
| | | pricing.setPricingType(dto.getPricingType()); |
| | | pricing.setBasicPricingJson("{}"); |
| | |
| | | pricing.setDynamicPricingJson("{}"); |
| | | pricing.setIsDynamicPrice(0); |
| | | this.save(pricing); |
| | | return pricing.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public Long edit(PricingEditDTO dto) { |
| | | //1.查询定价 |
| | | XpPricing pricing = getById(dto.getId()); |
| | | if (Objects.nonNull(pricing)) { |
| | | LambdaUpdateWrapper<XpPricing> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | //2.判断定价类型是否改变 |
| | | if (!pricing.getPricingType().equals(dto.getPricingType())) { |
| | | updateWrapper.set(XpPricing::getBasicPricingJson, null); |
| | | updateWrapper.set(XpPricing::getStartingFareJson, null); |
| | | updateWrapper.set(XpPricing::getDynamicPricingJson, null); |
| | | } |
| | | updateWrapper.set(XpPricing::getVehicleModel, dto.getVehicleModel()); |
| | | updateWrapper.set(XpPricing::getChannel, dto.getChannel()); |
| | | updateWrapper.set(XpPricing::getCityId, dto.getCityId()); |
| | | updateWrapper.set(StringUtils.isNotBlank(dto.getRemark()), XpPricing::getRemark, dto.getRemark()); |
| | | updateWrapper.set(XpPricing::getPricingType, dto.getPricingType()); |
| | | updateWrapper.eq(XpPricing::getId, dto.getId()); |
| | | update(updateWrapper); |
| | | } |
| | | return dto.getId(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (pricing == null) { |
| | | throw new ServiceException("定价不存在", I18nKeyConstant.PRICING_NOT_EXIST); |
| | | } |
| | | |
| | | try { |
| | | JSONObject.parseObject(dto.getBasicPricingJson()); |
| | | JSONArray.parseArray(dto.getStartingFareJson()); |
| | | JSONObject.parseObject(dto.getDynamicPricingJson()); |
| | | if (StringUtils.isNotBlank(dto.getBasicPricingJson())) { |
| | | JSONObject.parseObject(dto.getBasicPricingJson()); |
| | | } |
| | | if (StringUtils.isNotBlank(dto.getStartingFareJson())) { |
| | | JSONArray.parseArray(dto.getStartingFareJson()); |
| | | } |
| | | if (StringUtils.isNotBlank(dto.getDynamicPricingJson())) { |
| | | JSONObject.parseObject(dto.getDynamicPricingJson()); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new ServiceException("价格配置JSON格式不正确", I18nKeyConstant.PRICING_JSON_INVALID); |
| | | } |
| | |
| | | XpPricing update = new XpPricing(); |
| | | update.setId(dto.getId()); |
| | | update.setBasicPricingJson(dto.getBasicPricingJson()); |
| | | update.setStartingFareJson(dto.getStartingFareJson()); |
| | | update.setStartingFareJson(StringUtils.isNotBlank(dto.getStartingFareJson()) ? dto.getStartingFareJson() : null); |
| | | update.setDynamicPricingJson(dto.getDynamicPricingJson()); |
| | | update.setIsDynamicPrice(dto.getIsDynamicPrice()); |
| | | this.updateById(update); |
| | | } |
| | | |
| | |
| | | import com.xiaopeng.api.model.operation.XpSystemSetting; |
| | | import com.xiaopeng.operation.service.XpSystemSettingService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | return 15; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void saveSystemSetting(XpSystemSetting xpSystemSetting) { |
| | | saveOrUpdate(xpSystemSetting); |
| | | } |
| | | } |
| | |
| | | public class PricingPageListVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | |
| | | pricing.json.invalid=价格配置JSON格式不正确 |
| | | pricing.rule.empty=价格规则不能为空 |
| | | no.current.point=????????? |
| | | path.not.found=????? |
| | | path.not.found=路径不存在 |
| | | has.unpaid.order=有正在进行的订单 |
| | |
| | | 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 |
| | | has.unpaid.order=There are ongoing orders |
| | |
| | | pricing.json.invalid=价格配置JSON格式不正确 |
| | | pricing.rule.empty=价格规则不能为空 |
| | | no.current.point=????????? |
| | | path.not.found=????? |
| | | path.not.found=路径不存在 |
| | | has.unpaid.order=有正在进行的订单 |
| | |
| | | <mapper namespace="com.xiaopeng.operation.mapper.XpBannerMapper"> |
| | | |
| | | |
| | | <select id="pageList" resultType="com.xiaopeng.api.model.operation.XpBanner"> |
| | | select * from xp_banner |
| | | where is_deleted =0 |
| | | <if test="query.status != null"> |
| | | and status = #{query.status} |
| | | </if> |
| | | <if test="query.bannerTitle != null"> |
| | | and banner_title like concat('%',#{query.bannerTitle},'%') |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | <select id="pageList" resultType="com.xiaopeng.operation.vo.PricingPageListVO"> |
| | | SELECT |
| | | p.id, |
| | | p.create_time AS createTime, |
| | | p.vehicle_model AS vehicleModel, |
| | | CASE |
| | |
| | | String ORDER_REASSIGN_NEW_VEHICLE_NOT_IN_ACCEPT_MODE = "order.reassign.new.vehicle.not.in.accept.mode"; |
| | | String ORDER_REASSIGN_NEW_VEHICLE_NOT_START_ACCEPT = "order.reassign.new.vehicle.not.start.accept"; |
| | | String ORDER_REASSIGN_NEW_VEHICLE_NOT_FREE = "order.reassign.new.vehicle.not.free"; |
| | | String ORDER_STATUS_ERROR = "order.status.error"; |
| | | String VEHICLE_NOT_EXISTS = "vehicle.not.exists"; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 查询并关闭订单信息 返回id信息 |
| | | * 查询并终止订单信息 返回id信息 |
| | | * |
| | | * @param |
| | | */ |
| | |
| | | String id = xpCruiseOrderService.updateCruiseOrder(vin); |
| | | return R.ok(id); |
| | | } |
| | | /** |
| | | * 查询并完成订单信息 返回id信息 |
| | | * |
| | | * @param |
| | | */ |
| | | @PostMapping("/inner/cruiseOrder/closeCruiseOrder") |
| | | public R<String> closeCruiseOrder(@RequestParam String vin) { |
| | | String id = xpCruiseOrderService.closeCruiseOrder(vin); |
| | | return R.ok(id); |
| | | } |
| | | |
| | | |
| | | /** |
| New file |
| | |
| | | package com.xiaopeng.order.controller; |
| | | |
| | | import com.xiaopeng.api.feignClient.account.UserResourcesClient; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.order.model.query.OrderEvaluateManagementPageListQuery; |
| | | import com.xiaopeng.order.model.query.OrderEvaluatePageQuery; |
| | | import com.xiaopeng.order.model.vo.OrderEvaluateManagementPageListVO; |
| | | import com.xiaopeng.order.model.vo.OrderEvaluatePageVO; |
| | | import com.xiaopeng.order.service.IXpOrderEvaluateService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apiguardian.api.API; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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 javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | | * 意见反馈 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/api/v1/orderEvaluateManagement") |
| | | @Api(tags = "管理后台-意见反馈记录") |
| | | public class XpOrderEvaluateManagementController { |
| | | |
| | | @Resource |
| | | private IXpOrderEvaluateService xpOrderEvaluateService; |
| | | |
| | | /** |
| | | * 意见反馈 |
| | | * |
| | | * @param query 查询条件 |
| | | * @return 分页结果 |
| | | */ |
| | | @ApiOperation(value = "意见反馈分页列表") |
| | | @PostMapping("/pageList") |
| | | public R<PageInfo<OrderEvaluateManagementPageListVO>> managementPageList(@RequestBody OrderEvaluateManagementPageListQuery query) { |
| | | PageInfo<OrderEvaluateManagementPageListVO> pageInfo = xpOrderEvaluateService.managementPageList(query); |
| | | return R.ok(pageInfo); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.api.model.order.XpOrderEvaluate; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.order.model.query.OrderEvaluateManagementPageListQuery; |
| | | import com.xiaopeng.order.model.vo.OrderEvaluateManagementPageListVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface XpOrderEvaluateMapper extends BaseMapper<XpOrderEvaluate> { |
| | | |
| | | List<OrderEvaluateManagementPageListVO> managementPageList(@Param("pageInfo") PageInfo<OrderEvaluateManagementPageListVO> pageInfo,@Param("query") OrderEvaluateManagementPageListQuery query); |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.order.model.query; |
| | | |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | | * 管理后台意见反馈分页查询请求 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-05 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "管理后台意见反馈分页查询请求", description = "管理后台意见反馈分页查询请求") |
| | | public class OrderEvaluateManagementPageListQuery extends BasePage { |
| | | @ApiModelProperty(value = "内容") |
| | | private String feedbackContent; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.order.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单评价分页列表VO |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-05 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台订单评价分页列表VO") |
| | | public class OrderEvaluateManagementPageListVO { |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long userId; |
| | | @ApiModelProperty(value = "用户昵称") |
| | | private String nickName; |
| | | @ApiModelProperty(value = "用户头像") |
| | | private String headImage; |
| | | @ApiModelProperty(value = "用户手机号") |
| | | private String phoneNumber; |
| | | @ApiModelProperty(value = "反馈类型名称") |
| | | private String feedbackTypeName; |
| | | @ApiModelProperty(value = "反馈类型id") |
| | | private Long FeedbackTypeId; |
| | | @ApiModelProperty(value = "反馈图片") |
| | | private String feedbackPictures; |
| | | @ApiModelProperty(value = "反馈内容") |
| | | private String feedbackContent; |
| | | @ApiModelProperty(value = "反馈时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | } |
| | |
| | | String updateCruiseOrder(String vin); |
| | | |
| | | |
| | | String closeCruiseOrder(String vin); |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.order.XpOrderEvaluate; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.order.model.query.OrderEvaluateManagementPageListQuery; |
| | | import com.xiaopeng.order.model.query.OrderEvaluatePageQuery; |
| | | import com.xiaopeng.order.model.vo.OrderEvaluateManagementPageListVO; |
| | | import com.xiaopeng.order.model.vo.OrderEvaluatePageVO; |
| | | |
| | | /** |
| | |
| | | * @return 分页结果 |
| | | */ |
| | | PageInfo<OrderEvaluatePageVO> pageList(OrderEvaluatePageQuery query); |
| | | |
| | | PageInfo<OrderEvaluateManagementPageListVO> managementPageList(OrderEvaluateManagementPageListQuery query); |
| | | } |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public String closeCruiseOrder(String vin) { |
| | | LambdaQueryWrapper<XpCruiseOrder> wrapper = new LambdaQueryWrapper<XpCruiseOrder>().eq(XpCruiseOrder::getVehicleVin, vin).eq(XpCruiseOrder::getStatus, 1); |
| | | XpCruiseOrder xpCruiseOrder = this.getOne(wrapper); |
| | | if (xpCruiseOrder != null) { |
| | | xpCruiseOrder.setStatus(3); |
| | | this.update(xpCruiseOrder, wrapper); |
| | | return xpCruiseOrder.getId(); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package com.xiaopeng.order.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.dto.account.UserResourcesDto; |
| | | import com.xiaopeng.api.feignClient.account.UserResourcesClient; |
| | | import com.xiaopeng.api.feignClient.account.XpAppUserClient; |
| | | import com.xiaopeng.api.feignClient.operation.XpSystemSettingClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.api.model.account.XpAppUser; |
| | | import com.xiaopeng.api.model.operation.XpInvitationCode; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.model.order.XpOrder; |
| | | import com.xiaopeng.api.model.order.XpOrderEvaluate; |
| | | import com.xiaopeng.api.vo.account.GetUserListByUidsVo; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.utils.StringUtils; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.order.mapper.XpOrderEvaluateMapper; |
| | | import com.xiaopeng.order.model.query.OrderEvaluateManagementPageListQuery; |
| | | import com.xiaopeng.order.model.query.OrderEvaluatePageQuery; |
| | | import com.xiaopeng.order.model.vo.OrderEvaluateManagementPageListVO; |
| | | import com.xiaopeng.order.model.vo.OrderEvaluatePageVO; |
| | | import com.xiaopeng.order.service.IXpOrderEvaluateService; |
| | | import com.xiaopeng.order.service.IXpOrderService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.*; |
| | |
| | | private final XpAppUserClient xpAppUserClient; |
| | | private final XpVehicleClient xpVehicleClient; |
| | | private final IXpOrderService xpOrderService; |
| | | private final UserResourcesClient userResourcesClient; |
| | | private final XpSystemSettingClient systemSettingClient; |
| | | |
| | | @Override |
| | | public PageInfo<OrderEvaluatePageVO> pageList(OrderEvaluatePageQuery query) { |
| | |
| | | return resultPage; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<OrderEvaluateManagementPageListVO> managementPageList(OrderEvaluateManagementPageListQuery query) { |
| | | PageInfo<OrderEvaluateManagementPageListVO> pageInfo = new PageInfo<>(query.getPageNum(),query.getPageSize()); |
| | | List<OrderEvaluateManagementPageListVO> list = this.baseMapper.managementPageList(pageInfo,query); |
| | | if (list.isEmpty()){ |
| | | return new PageInfo<>(); |
| | | } |
| | | List<Long> userIds = list.stream().map(OrderEvaluateManagementPageListVO::getUserId).collect(Collectors.toList()); |
| | | GetUserListByUidsVo getUserListByUidsVo = new GetUserListByUidsVo(); |
| | | getUserListByUidsVo.setUids(userIds); |
| | | getUserListByUidsVo.setGetPreCarOwner(false); |
| | | UserResourcesDto userListByUids = userResourcesClient.getUserListByUids(getUserListByUidsVo); |
| | | for (OrderEvaluateManagementPageListVO orderEvaluateManagementPageListVO : list) { |
| | | Object data = userListByUids.getData(); |
| | | // 转化为jsonArray |
| | | JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(data)); |
| | | for (Object o : jsonArray) { |
| | | // 转化为JsonObject |
| | | JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(o)); |
| | | String mobile = jsonObject.getString("mobile"); |
| | | String nickName = jsonObject.getString("nickName"); |
| | | String headImage = jsonObject.getString("headImage"); |
| | | orderEvaluateManagementPageListVO.setPhoneNumber(mobile); |
| | | orderEvaluateManagementPageListVO.setNickName(nickName); |
| | | orderEvaluateManagementPageListVO.setHeadImage(headImage); |
| | | } |
| | | systemSettingClient.getFeedbackTypeById(orderEvaluateManagementPageListVO.getFeedbackTypeId()); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | /** |
| | | * 批量获取用户信息 |
| | | */ |
| | |
| | | public void cancelOrder(Long orderId, String uid) { |
| | | XpOrder order = this.getById(orderId); |
| | | if (order == null) { |
| | | throw new RuntimeException("订单不存在"); |
| | | throw new ServiceException("订单不存在",I18nKeyConstant.ORDER_NOT_EXISTS); |
| | | } |
| | | if (!order.getAppUserId().toString().equals(uid)) { |
| | | throw new RuntimeException("无权限取消该订单"); |
| | | throw new ServiceException("订单不存在",I18nKeyConstant.ORDER_NOT_EXISTS); |
| | | } |
| | | if (order.getStatus() > 5 || order.getStatus() < 1) { |
| | | throw new RuntimeException("订单状态错误"); |
| | | throw new ServiceException("订单状态错误",I18nKeyConstant.ORDER_STATUS_ERROR); |
| | | } |
| | | order.setStatus(0); |
| | | |
| | |
| | | R<XpVehicle> xpVehicleR = xpVehicleClient.queryById(vehicleId); |
| | | XpVehicle xpVehicle = xpVehicleR.getData(); |
| | | if (xpVehicle == null) { |
| | | throw new RuntimeException("车辆不存在"); |
| | | throw new ServiceException("车辆不存在",I18nKeyConstant.VEHICLE_NOT_EXISTS); |
| | | } |
| | | cancelTaxiPassengerVo.setVin(xpVehicle.getVehicleVin()); |
| | | cancelTaxiPassengerVo.setUid(order.getAppUserId().toString()); |
| | |
| | | public void cancelOrder(String orderId) { |
| | | XpOrder order = this.getById(orderId); |
| | | if (order == null) { |
| | | throw new RuntimeException("订单不存在"); |
| | | throw new ServiceException("订单不存在",I18nKeyConstant.ORDER_NOT_EXISTS); |
| | | } |
| | | order.setStatus(0); |
| | | baseMapper.updateById(order); |
| | |
| | | public void comment(XpOrderCommentDto dto, String uid) { |
| | | XpOrder xpOrder = this.getById(dto.getOrderId()); |
| | | if (xpOrder == null) { |
| | | throw new RuntimeException("订单不存在"); |
| | | throw new ServiceException("订单不存在",I18nKeyConstant.ORDER_NOT_EXISTS); |
| | | } |
| | | if (!xpOrder.getAppUserId().toString().equals(uid)) { |
| | | throw new RuntimeException("无权限评价该订单"); |
| | | throw new ServiceException("订单不存在",I18nKeyConstant.ORDER_NOT_EXISTS); |
| | | } |
| | | if (xpOrder.getStatus() != 9) { |
| | | throw new RuntimeException("订单状态错误"); |
| | | throw new ServiceException("订单状态错误",I18nKeyConstant.ORDER_STATUS_ERROR); |
| | | } |
| | | xpOrder.setStatus(10); |
| | | baseMapper.updateById(xpOrder); |
| | |
| | | order.reassign.new.vehicle.not.in.accept.mode=新车辆当前不在接单模式 |
| | | order.reassign.new.vehicle.not.start.accept=新车辆未开始接单 |
| | | order.reassign.new.vehicle.not.free=新车辆已接单,请重新选择 |
| | | order.pricing.not.exists=当前城市未配置定价规则 |
| | | order.pricing.not.exists=当前城市未配置定价规则 |
| | | order.order.status.error=订单状态错误 |
| | | vehicle.not.exists=车辆不存在 |
| | |
| | | order.reassign.new.vehicle.not.start.accept=The new vehicle has not started taking orders yet |
| | | order.reassign.new.vehicle.not.free=The new vehicle has been ordered. Please choose again |
| | | welcome.message=Welcome to our application! |
| | | order.pricing.not.exists=The current city has not been configured with pricing rules |
| | | order.pricing.not.exists=The current city has not been configured with pricing rules |
| | | order.order.status.error=Order status error |
| | | vehicle.not.exists=The vehicle does not exist. |
| | |
| | | order.reassign.new.vehicle.not.start.accept=新车辆未开始接单 |
| | | order.reassign.new.vehicle.not.free=新车辆已接单,请重新选择 |
| | | welcome.message=欢迎来到我们的应用程序! |
| | | order.pricing.not.exists=当前城市未配置定价规则 |
| | | order.pricing.not.exists=当前城市未配置定价规则 |
| | | order.order.status.error=订单状态错误 |
| | | vehicle.not.exists=车辆不存在 |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, order_id, vehicle_id, app_user_id, order_rating, evaluate_time, is_deleted, create_time, update_time, create_by, update_by |
| | | </sql> |
| | | <select id="managementPageList" resultType="com.xiaopeng.order.model.vo.OrderEvaluateManagementPageListVO"> |
| | | select id,app_user_id as userId,create_time as createTime,feedback_pictures as feedbackPictures,feedback_content as feedbackContent,feedback_type_id as feedbackTypeId |
| | | from xp_order_evaluate |
| | | where is_deleted = 0 |
| | | <if test="query.feedbackContent != null and query.feedbackContent != ''"> |
| | | and feedback_content like concat('%',#{query.feedbackContent},'%') |
| | | </if> |
| | | and feedback_type_id is not null |
| | | order by create_time |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | return R.ok(xpVehicleService.listByIds(ids)); |
| | | } |
| | | /** |
| | | * 批量获取车辆列表 |
| | | * |
| | | * @param ids 车辆ID列表 |
| | | * @return 车辆列表 |
| | | */ |
| | | @ApiOperation(value = "批量查询车辆信息", tags = {"内部接口"}) |
| | | @PostMapping("/inner/vehicle/listVehicle") |
| | | public R<List<XpVehicle>> listVehicle() { |
| | | return R.ok(xpVehicleService.list()); |
| | | } |
| | | /** |
| | | * 根据ID查询车辆信息(内部接口) |
| | | * |
| | | * @param id 车辆ID |
| | |
| | | id, vehicle_code, vehicle_vin, plate_number, vehicle_model, vehicle_color, vehicle_pictures, |
| | | procurement_source, remarks, annual_inspection_date, insurance_company, insurance_phone, |
| | | insurance_end_time, inspection_attachments, policy_information, electronic_id, |
| | | operation_qualification, qualification_expire_time, status, operating_status,mileageRange, |
| | | operation_qualification, qualification_expire_time, status, operating_status,mileage_range, |
| | | warehousing_time, vehicle_type, accept_or_test, accept_or_test_status, current_electricity, |
| | | is_deleted, create_time, update_time, create_by, update_by |
| | | </sql> |