feat: 完成飞行员端订单列表查询接口
This commit is contained in:
parent
6c87445085
commit
0d83fa5be1
@ -1,7 +1,7 @@
|
|||||||
package com.aircraft.modules.order.biz;
|
package com.aircraft.modules.order.biz;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.ObjUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.aircraft.exception.BadRequestException;
|
import com.aircraft.exception.BadRequestException;
|
||||||
@ -22,21 +22,24 @@ import com.aircraft.modules.order.domain.vo.OrderMainPageQueryVO;
|
|||||||
import com.aircraft.modules.order.service.IOrderDetailService;
|
import com.aircraft.modules.order.service.IOrderDetailService;
|
||||||
import com.aircraft.modules.order.service.IOrderMainService;
|
import com.aircraft.modules.order.service.IOrderMainService;
|
||||||
import com.aircraft.modules.order.service.IOrderOperatorService;
|
import com.aircraft.modules.order.service.IOrderOperatorService;
|
||||||
|
import com.aircraft.modules.route.domain.CpRoute;
|
||||||
|
import com.aircraft.modules.route.service.CpRouteService;
|
||||||
import com.aircraft.modules.system.domain.AttachmentMaterial;
|
import com.aircraft.modules.system.domain.AttachmentMaterial;
|
||||||
import com.aircraft.modules.system.domain.EmEmployees;
|
import com.aircraft.modules.system.domain.EmEmployees;
|
||||||
import com.aircraft.modules.system.domain.EmScenic;
|
import com.aircraft.modules.system.domain.EmScenic;
|
||||||
import com.aircraft.modules.system.domain.dto.LocalAttachmentMaterialDTO;
|
import com.aircraft.modules.system.domain.dto.LocalAttachmentMaterialDTO;
|
||||||
import com.aircraft.modules.system.domain.enums.AttachmentMaterialBusinessTypeEnum;
|
import com.aircraft.modules.system.domain.enums.AttachmentMaterialBusinessTypeEnum;
|
||||||
|
import com.aircraft.modules.system.service.EmEmployeesService;
|
||||||
import com.aircraft.modules.system.service.EmScenicService;
|
import com.aircraft.modules.system.service.EmScenicService;
|
||||||
import com.aircraft.modules.system.service.IAttachmentMaterialService;
|
import com.aircraft.modules.system.service.IAttachmentMaterialService;
|
||||||
import com.aircraft.utils.PageResult;
|
import com.aircraft.utils.PageResult;
|
||||||
import com.aircraft.utils.RedisUtils;
|
import com.aircraft.utils.RedisUtils;
|
||||||
import com.aircraft.utils.SecurityUtils;
|
import com.aircraft.utils.SecurityUtils;
|
||||||
|
import com.aircraft.utils.enums.UserTypeEnum;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.security.core.userdetails.UserDetails;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -46,6 +49,8 @@ import java.time.LocalDateTime;
|
|||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单业务处理类
|
* 工单业务处理类
|
||||||
@ -56,6 +61,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
|
@Slf4j
|
||||||
public class OrderBiz {
|
public class OrderBiz {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
@ -70,22 +76,110 @@ public class OrderBiz {
|
|||||||
private EmScenicService emScenicService;
|
private EmScenicService emScenicService;
|
||||||
@Resource
|
@Resource
|
||||||
private RedisUtils redisUtils;
|
private RedisUtils redisUtils;
|
||||||
|
@Resource
|
||||||
|
private EmEmployeesService emEmployeesService;
|
||||||
|
@Resource
|
||||||
|
private CpRouteService cpRouteService;
|
||||||
|
|
||||||
public List<OrderMainPageQueryVO> queryAll(OrderMainPageQueryDTO pageQueryDTO) {
|
public List<OrderMainPageQueryVO> queryAll(OrderMainPageQueryDTO pageQueryDTO) {
|
||||||
UserDetails currentUser = SecurityUtils.getCurrentUser();
|
|
||||||
// TODO 根据不同的用户角色获取不同的订单数据
|
|
||||||
List<OrderMain> list = orderMainService.queryAll(pageQueryDTO);
|
|
||||||
|
|
||||||
if (CollectionUtil.isEmpty(list)) {
|
// 根据不同的客户端获取数据
|
||||||
|
UserTypeEnum currentUserType = SecurityUtils.getCurrentUserType();
|
||||||
|
// 暂时使用用 switch方式, 可结合工厂+策略获取不同的执行方法(也可通过反射代理的方式去实现,暂时使用最简单的方式)
|
||||||
|
List<OrderMain> orderMainList = new ArrayList<>();
|
||||||
|
switch (currentUserType) {
|
||||||
|
case ADMIN:
|
||||||
|
orderMainList = adminAllOrderQueryList(pageQueryDTO);
|
||||||
|
log.info("当前用户是后台管理员用户");
|
||||||
|
break;
|
||||||
|
case EMPLOYEES:
|
||||||
|
orderMainList = employeeAllOrderQueryList(pageQueryDTO);
|
||||||
|
log.info("当前用户是飞行员用户");
|
||||||
|
break;
|
||||||
|
case CUSTOMER:
|
||||||
|
orderMainList = customerAllOrderQueryList(pageQueryDTO);
|
||||||
|
log.info("当前用户是B端客户");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isEmpty(orderMainList)) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
// TODO 多表操作转成单表操作,归并数据集
|
|
||||||
List<Long> orderIds = list.stream().map(OrderMain::getId).toList();
|
|
||||||
List<OrderOperator> orderOperatorList = orderOperatorService.queryAllByOrderIds(orderIds);
|
|
||||||
|
|
||||||
// TODO 数据转移处理
|
// 查询发起人信息
|
||||||
List<OrderMainPageQueryVO> orderMainList = new ArrayList<>();
|
List<Long> orderInitiatorIds = orderMainList.stream().map(OrderMain::getOrderInitiatorId).toList();
|
||||||
return orderMainList;
|
List<EmEmployees> employeesList = emEmployeesService.obtainEmployeesByIds(orderInitiatorIds);
|
||||||
|
Map<Long, EmEmployees> operatorMap = employeesList.stream()
|
||||||
|
.collect(Collectors.toMap(EmEmployees::getId, item -> item, (o1, o2) -> o1));
|
||||||
|
|
||||||
|
// 获取所有的路线信息
|
||||||
|
List<CpRoute> routes = cpRouteService.obtainAllRoutes();
|
||||||
|
Map<Long, CpRoute> routeMap = routes.stream()
|
||||||
|
.collect(Collectors.toMap(CpRoute::getId, route -> route));
|
||||||
|
|
||||||
|
// 构建查询结果集
|
||||||
|
List<OrderMainPageQueryVO> orderMainPageList = new ArrayList<>();
|
||||||
|
for (OrderMain orderMain : orderMainList) {
|
||||||
|
OrderMainPageQueryVO pageQueryVO = BeanUtil.copyProperties(orderMain, OrderMainPageQueryVO.class);
|
||||||
|
String routeIds = orderMain.getRouteIds();
|
||||||
|
// 转换成数组
|
||||||
|
String[] routeIdArray = routeIds.split(StrUtil.COMMA);
|
||||||
|
StringBuilder routeNameBuilder = new StringBuilder();
|
||||||
|
for (String routeIdStr : routeIdArray) {
|
||||||
|
CpRoute cpRoute = routeMap.get(Long.valueOf(routeIdStr));
|
||||||
|
String name = cpRoute.getName();
|
||||||
|
routeNameBuilder.append(name).append(StrUtil.COMMA);
|
||||||
|
}
|
||||||
|
// 去掉最后一个逗号
|
||||||
|
routeNameBuilder.deleteCharAt(routeNameBuilder.length() - 1);
|
||||||
|
pageQueryVO.setRouteName(routeNameBuilder.toString());
|
||||||
|
EmEmployees emEmployees = operatorMap.get(orderMain.getOrderInitiatorId());
|
||||||
|
if (ObjectUtil.isNotNull(emEmployees)) {
|
||||||
|
pageQueryVO.setInitiatorPhone(emEmployees.getPhone());
|
||||||
|
}
|
||||||
|
pageQueryVO.setCustomerPhone(orderMain.getPhone());
|
||||||
|
orderMainPageList.add(pageQueryVO);
|
||||||
|
}
|
||||||
|
return orderMainPageList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有订单<客户端>
|
||||||
|
*
|
||||||
|
* @param pageQueryDTO {@link OrderMainPageQueryDTO}
|
||||||
|
* @return {@link List<OrderMain>}
|
||||||
|
*/
|
||||||
|
private List<OrderMain> customerAllOrderQueryList(OrderMainPageQueryDTO pageQueryDTO) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有订单<飞行员端>
|
||||||
|
*
|
||||||
|
* @param pageQueryDTO 分页参数
|
||||||
|
* @return {@link List<OrderMain>}
|
||||||
|
*/
|
||||||
|
private List<OrderMain> employeeAllOrderQueryList(OrderMainPageQueryDTO pageQueryDTO) {
|
||||||
|
// 获取当前登录人的ID
|
||||||
|
Long orderInitiatorId = SecurityUtils.getCurrentUserId();
|
||||||
|
pageQueryDTO.setOrderInitiatorId(orderInitiatorId);
|
||||||
|
pageQueryDTO.setPhone(null);
|
||||||
|
pageQueryDTO.setCustomerId(null);
|
||||||
|
pageQueryDTO.setAttractionId(null);
|
||||||
|
return orderMainService.obtainOrderList(pageQueryDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有订单<Admin端>
|
||||||
|
*
|
||||||
|
* @param pageQueryDTO {@link OrderMainPageQueryDTO}
|
||||||
|
* @return {@link List<OrderMain>}
|
||||||
|
*/
|
||||||
|
private List<OrderMain> adminAllOrderQueryList(OrderMainPageQueryDTO pageQueryDTO) {
|
||||||
|
// 需要考虑用户角色获取对应的数据
|
||||||
|
List<OrderMain> list = orderMainService.queryAll(pageQueryDTO);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<PageResult<Object>> relevanceOrder() {
|
public ResponseEntity<PageResult<Object>> relevanceOrder() {
|
||||||
|
@ -40,7 +40,6 @@ public class OrderMainController {
|
|||||||
@ApiOperation("查询订单列表")
|
@ApiOperation("查询订单列表")
|
||||||
@GetMapping("/allOrder")
|
@GetMapping("/allOrder")
|
||||||
public ResponseEntity<PageResult<OrderMainPageQueryVO>> queryOrderList(OrderMainPageQueryDTO pageQueryDTO) {
|
public ResponseEntity<PageResult<OrderMainPageQueryVO>> queryOrderList(OrderMainPageQueryDTO pageQueryDTO) {
|
||||||
// TODO 待完善<考虑根据不同的登录获取不同的分页查询>
|
|
||||||
List<OrderMainPageQueryVO> orderList = orderBiz.queryAll(pageQueryDTO);
|
List<OrderMainPageQueryVO> orderList = orderBiz.queryAll(pageQueryDTO);
|
||||||
return new ResponseEntity<>(PageUtil.toPage(orderList),HttpStatus.OK);
|
return new ResponseEntity<>(PageUtil.toPage(orderList),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,13 @@ public class OrderMainPageQueryDTO {
|
|||||||
/**
|
/**
|
||||||
* 客户手机号
|
* 客户手机号
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "下单时间", example = "13788888888")
|
@ApiModelProperty(value = "客户手机号", example = "13788888888")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起人ID
|
||||||
|
*/
|
||||||
|
private Long orderInitiatorId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
package com.aircraft.modules.order.domain.vo;
|
package com.aircraft.modules.order.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* 订单主单分页查询 VO
|
* 订单主单分页查询 VO
|
||||||
@ -25,27 +29,69 @@ public class OrderMainPageQueryVO {
|
|||||||
@ApiModelProperty(value = "订单类型")
|
@ApiModelProperty(value = "订单类型")
|
||||||
private Integer orderType;
|
private Integer orderType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "订单状态")
|
||||||
|
private Integer mainOrderStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户ID
|
* 客户ID
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "客户ID")
|
@ApiModelProperty(value = "客户ID")
|
||||||
private Long customerId;
|
private Long customerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "客户手机号")
|
||||||
|
private String customerPhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单发起人ID
|
||||||
|
*/
|
||||||
|
private Long orderInitiatorId;
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "发起人手机号")
|
||||||
|
private String initiatorPhone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 景区ID
|
* 景区ID
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "景区ID")
|
@ApiModelProperty(value = "景区ID")
|
||||||
private Long attractionId;
|
private Long attractionId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "手机号")
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路线名称,拼接返回
|
* 路线名称,拼接返回
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "路线")
|
@ApiModelProperty(value = "路线名称")
|
||||||
private String routeName;
|
private String routeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "下单时间")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date orderCreateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单完成时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "订单完成时间")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date orderFinishTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算状态
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "结算状态: 0=未结算, 1=已结算")
|
||||||
|
private Integer settlementStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单金额
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "订单金额")
|
||||||
|
private BigDecimal amount;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.aircraft.modules.order.mapper;
|
package com.aircraft.modules.order.mapper;
|
||||||
|
|
||||||
import com.aircraft.modules.order.domain.OrderMain;
|
import com.aircraft.modules.order.domain.OrderMain;
|
||||||
|
import com.aircraft.modules.order.domain.dto.OrderMainPageQueryDTO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@ -16,4 +17,11 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Repository
|
@Repository
|
||||||
public interface OrderMainMapper extends BaseMapper<OrderMain> {
|
public interface OrderMainMapper extends BaseMapper<OrderMain> {
|
||||||
|
/**
|
||||||
|
* 根据查询条件获取订单列表
|
||||||
|
*
|
||||||
|
* @param pageQueryDTO {@link OrderMainPageQueryDTO}
|
||||||
|
* @return {@link List<OrderMain>}
|
||||||
|
*/
|
||||||
|
List<OrderMain> obtainOrderList(OrderMainPageQueryDTO pageQueryDTO);
|
||||||
}
|
}
|
||||||
|
@ -64,4 +64,12 @@ public interface IOrderMainService extends IService<OrderMain> {
|
|||||||
* @param orderStatus 订单状态
|
* @param orderStatus 订单状态
|
||||||
*/
|
*/
|
||||||
void updateOrderStatus(Long orderId, Integer orderStatus);
|
void updateOrderStatus(Long orderId, Integer orderStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单列表
|
||||||
|
*
|
||||||
|
* @param pageQueryDTO {@link OrderMainPageQueryDTO}
|
||||||
|
* @return {@link List<OrderMain>}
|
||||||
|
*/
|
||||||
|
List<OrderMain> obtainOrderList(OrderMainPageQueryDTO pageQueryDTO);
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -26,6 +27,8 @@ import java.util.stream.Collectors;
|
|||||||
@Service
|
@Service
|
||||||
public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain> implements IOrderMainService {
|
public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain> implements IOrderMainService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OrderMainMapper orderMainMapper;
|
||||||
@Override
|
@Override
|
||||||
public List<OrderMain> queryAll(OrderMainPageQueryDTO pageQueryDTO) {
|
public List<OrderMain> queryAll(OrderMainPageQueryDTO pageQueryDTO) {
|
||||||
|
|
||||||
@ -84,4 +87,9 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
|
|||||||
.eq(OrderMain::getId, orderId)
|
.eq(OrderMain::getId, orderId)
|
||||||
.set(OrderMain::getMainOrderStatus, orderStatus));
|
.set(OrderMain::getMainOrderStatus, orderStatus));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OrderMain> obtainOrderList(OrderMainPageQueryDTO pageQueryDTO) {
|
||||||
|
return orderMainMapper.obtainOrderList(pageQueryDTO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 路线表 服务类
|
* 路线表 服务类
|
||||||
@ -19,4 +21,11 @@ public interface CpRouteService extends IService<CpRoute> {
|
|||||||
void updateDelFlagById(Long id, Integer delFlag);
|
void updateDelFlagById(Long id, Integer delFlag);
|
||||||
|
|
||||||
IPage<CpRouteVo> findByPage(Page<CpRouteVo> page, String routeName);
|
IPage<CpRouteVo> findByPage(Page<CpRouteVo> page, String routeName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有路线信息
|
||||||
|
*
|
||||||
|
* @return List<CpRoute>
|
||||||
|
*/
|
||||||
|
List<CpRoute> obtainAllRoutes();
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 路线表 服务实现类
|
* 路线表 服务实现类
|
||||||
@ -32,4 +34,9 @@ public class CpRouteServiceImpl extends ServiceImpl<CpRouteMapper, CpRoute> impl
|
|||||||
public IPage<CpRouteVo> findByPage(Page<CpRouteVo> page, String routeName) {
|
public IPage<CpRouteVo> findByPage(Page<CpRouteVo> page, String routeName) {
|
||||||
return cpRouteMapper.selectVoPage(page, routeName);
|
return cpRouteMapper.selectVoPage(page, routeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CpRoute> obtainAllRoutes() {
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,4 +100,12 @@ public interface EmEmployeesService extends IService<EmEmployees> {
|
|||||||
EmEmployeesDetailVo findById(Integer id);
|
EmEmployeesDetailVo findById(Integer id);
|
||||||
|
|
||||||
EmEmployees findByUsername(String username);
|
EmEmployees findByUsername(String username);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量查询用户信息
|
||||||
|
*
|
||||||
|
* @param orderInitiatorIds 订单发起人ID列表
|
||||||
|
* @return List<EmEmployees>
|
||||||
|
*/
|
||||||
|
List<EmEmployees> obtainEmployeesByIds(List<Long> orderInitiatorIds);
|
||||||
}
|
}
|
@ -23,6 +23,7 @@ import com.aircraft.modules.system.service.EmAreaService;
|
|||||||
import com.aircraft.modules.system.service.EmScenicService;
|
import com.aircraft.modules.system.service.EmScenicService;
|
||||||
import com.aircraft.utils.*;
|
import com.aircraft.utils.*;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@ -86,6 +87,11 @@ public class EmEmployeesServiceImpl extends ServiceImpl<EmEmployeesMapper, EmEmp
|
|||||||
return emEmployeesMapper.selectOne(queryWrapper);
|
return emEmployeesMapper.selectOne(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmEmployees> obtainEmployeesByIds(List<Long> orderInitiatorIds) {
|
||||||
|
return this.list(Wrappers.lambdaQuery(EmEmployees.class).in(EmEmployees::getId,orderInitiatorIds));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(EmEmployees resources) {
|
public void update(EmEmployees resources) {
|
||||||
|
@ -2,4 +2,32 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.aircraft.modules.order.mapper.OrderMainMapper">
|
<mapper namespace="com.aircraft.modules.order.mapper.OrderMainMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="BaseColumn">
|
||||||
|
id, order_no, order_type, order_initiator_id, phone, attraction_id, customer_id,
|
||||||
|
customer_name, route_ids, cargo_weight, amount, surcharge_amount, open_id,
|
||||||
|
settlement_status, main_order_status, relevance_status, order_create_time,
|
||||||
|
order_finish_time, create_time, create_by, update_time, update_by, del_flag
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="obtainOrderList" resultType="com.aircraft.modules.order.domain.OrderMain">
|
||||||
|
select
|
||||||
|
<include refid="BaseColumn"/>
|
||||||
|
from fms_od_order_main
|
||||||
|
where del_flag = 0
|
||||||
|
<if test="orderInitiatorId != null">
|
||||||
|
and id in (
|
||||||
|
select order_id from fms_od_order_operator where operator_id = #{orderInitiatorId}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="phone != null and phone != ''">
|
||||||
|
and phone = #{phone}
|
||||||
|
</if>
|
||||||
|
<if test="customerId != null">
|
||||||
|
and customer_id = #{customerId}
|
||||||
|
</if>
|
||||||
|
<if test="attractionId != null">
|
||||||
|
and attraction_id = #{attractionId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user