perf: 订单列表返回订单确认状态标识,以及相关ID(编辑订单);完成订单时,飞行员端完成只是确认状态,订单状态位改变(此时应该不允许添加飞行任务)
This commit is contained in:
parent
6ee0b182ee
commit
1dd543cf9c
@ -392,11 +392,17 @@ public class OrderBiz {
|
||||
orderAllDetailVO.setTotalAmount(orderMain.getTotalAmount());
|
||||
orderAllDetailVO.setAmount(orderMain.getAmount());
|
||||
orderAllDetailVO.setScenicName(emScenicService.obtainScenicById(orderMain.getAttractionId()).getName());
|
||||
orderAllDetailVO.setCustomerId(orderMain.getCustomerId());
|
||||
orderAllDetailVO.setOrderInitiatorId(orderMain.getOrderInitiatorId());
|
||||
orderAllDetailVO.setAttractionId(orderMain.getAttractionId());
|
||||
orderAllDetailVO.setConfirmStatus(orderMain.getConfirmStatus());
|
||||
|
||||
// 获取路线
|
||||
String routeName = obtainRouteName(orderMain);
|
||||
String routeName = obtainRouteName(orderMain, orderAllDetailVO);
|
||||
orderAllDetailVO.setRouteName(routeName);
|
||||
// 获取该订单下的操作人
|
||||
List<OrderOperator> orderOperatorList = orderOperatorService.queryAllByOrderIds(List.of(id));
|
||||
orderAllDetailVO.setOperatorIds(orderOperatorList.stream().map(OrderOperator::getOperatorId).toList());
|
||||
// 转成map
|
||||
StringBuilder nameBuilder = new StringBuilder();
|
||||
for (OrderOperator operator : orderOperatorList) {
|
||||
@ -466,9 +472,10 @@ public class OrderBiz {
|
||||
* 获取路线名称
|
||||
*
|
||||
* @param orderMain {@link OrderMain}
|
||||
* @param orderAllDetailVO
|
||||
* @return 拼接的路线名称
|
||||
*/
|
||||
private String obtainRouteName(OrderMain orderMain) {
|
||||
private String obtainRouteName(OrderMain orderMain, OrderAllDetailVO orderAllDetailVO) {
|
||||
String routeIds = orderMain.getRouteIds();
|
||||
List<CpRoute> cpRoutes = cpRouteService.obtainAllRoutes();
|
||||
Map<Long, CpRoute> routeMap = cpRoutes.stream().collect(Collectors.toMap(CpRoute::getId, route -> route));
|
||||
@ -478,6 +485,7 @@ public class OrderBiz {
|
||||
CpRoute cpRoute = routeMap.get(Long.valueOf(routeIdStr));
|
||||
String name = cpRoute.getName();
|
||||
routeNameBuilder.append(name).append(StrUtil.COMMA);
|
||||
orderAllDetailVO.setRouteIds(List.of(cpRoute.getId()));
|
||||
}
|
||||
// 去掉最后一个逗号
|
||||
return routeNameBuilder.substring(0, routeNameBuilder.length() - 1);
|
||||
@ -907,7 +915,13 @@ public class OrderBiz {
|
||||
OrderMain updateOrderMain = new OrderMain();
|
||||
updateOrderMain.setId(orderId);
|
||||
updateOrderMain.setOrderFinishTime(new Date());
|
||||
updateOrderMain.setMainOrderStatus(MainOrderStatusEnum.COMPLETED.getCode());
|
||||
if (currentUserType.equals(UserTypeEnum.EMPLOYEES)) {
|
||||
updateOrderMain.setConfirmStatus(ConfirmStatusEnum.PILOT_CONFIRMED.getCode());
|
||||
updateOrderMain.setConfirmTime(new Date());
|
||||
} else {
|
||||
updateOrderMain.setConfirmStatus(ConfirmStatusEnum.CUSTOMER_CONFIRMED.getCode());
|
||||
updateOrderMain.setMainOrderStatus(MainOrderStatusEnum.COMPLETED.getCode());
|
||||
}
|
||||
orderMainService.finishMainOrder(updateOrderMain);
|
||||
}
|
||||
|
||||
|
@ -114,5 +114,13 @@ public class OrderMain extends BaseEntity {
|
||||
*/
|
||||
private Date orderFinishTime;
|
||||
|
||||
/**
|
||||
* 确认标识(1是飞行员确认,2是客户已确认,默认0)
|
||||
*/
|
||||
private Integer confirmStatus;
|
||||
|
||||
/**
|
||||
* 确认时间
|
||||
*/
|
||||
private Date confirmTime;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -73,5 +74,11 @@ public class OrderMainPageQueryDTO {
|
||||
@ApiModelProperty(value = "区域ID")
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 订单状态,支持多个状态查询
|
||||
*/
|
||||
@ApiModelProperty(value = "订单状态(支持多个状态查询)")
|
||||
private List<Integer> mainOrderStatusList;
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,56 @@
|
||||
package com.aircraft.modules.order.domain.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单确认状态枚举
|
||||
*
|
||||
* @author chenxiky
|
||||
* @version 1.0.0
|
||||
* @since 2025/7/31
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ConfirmStatusEnum {
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
NOT_CONFIRM(0, "默认值"),
|
||||
/**
|
||||
* 飞行员已确认
|
||||
*/
|
||||
PILOT_CONFIRMED(1, "飞行员已确认"),
|
||||
|
||||
/**
|
||||
* 客户已确认
|
||||
*/
|
||||
CUSTOMER_CONFIRMED(2, "客户已确认"),
|
||||
;
|
||||
|
||||
/**
|
||||
* 状态码
|
||||
*/
|
||||
private final Integer code;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String description;
|
||||
|
||||
/**
|
||||
* 根据code获取枚举
|
||||
*
|
||||
* @param code ~
|
||||
* @return ~
|
||||
*/
|
||||
public static ConfirmStatusEnum getInstance(Integer code) {
|
||||
for (ConfirmStatusEnum value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -48,12 +48,24 @@ public class OrderAllDetailVO {
|
||||
@ApiModelProperty(value = "订单发起人")
|
||||
private String orderInitiator;
|
||||
|
||||
/**
|
||||
* 订单发起人ID
|
||||
*/
|
||||
@ApiModelProperty(value = "订单发起人ID")
|
||||
private Long orderInitiatorId;
|
||||
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
@ApiModelProperty(value = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
@ApiModelProperty(value = "客户ID")
|
||||
private Long customerId;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@ -72,12 +84,24 @@ public class OrderAllDetailVO {
|
||||
@ApiModelProperty(value = "景区名称")
|
||||
private String scenicName;
|
||||
|
||||
/**
|
||||
* 景区ID
|
||||
*/
|
||||
@ApiModelProperty(value = "景区ID")
|
||||
private Long attractionId;
|
||||
|
||||
/**
|
||||
* 路线,多个用逗号隔开返回
|
||||
*/
|
||||
@ApiModelProperty(value = "路线名称,多个用逗号隔开返回", example = "线路1,线路2")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 路线ID集合
|
||||
*/
|
||||
@ApiModelProperty(value = "路线ID集合")
|
||||
private List<Long> routeIds;
|
||||
|
||||
/**
|
||||
* 货物重量
|
||||
*/
|
||||
@ -108,6 +132,12 @@ public class OrderAllDetailVO {
|
||||
@ApiModelProperty(value = "操作员,多个逗号拼接返回", example = "操作员1,操作员2")
|
||||
private String operatorName;
|
||||
|
||||
/**
|
||||
* 操作员ID集合
|
||||
*/
|
||||
@ApiModelProperty(value = "操作员ID集合")
|
||||
private List<Long> operatorIds;
|
||||
|
||||
/**
|
||||
* 下单时间
|
||||
*/
|
||||
@ -122,6 +152,12 @@ public class OrderAllDetailVO {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date orderFinishTime;
|
||||
|
||||
/**
|
||||
* 确认标识(1是飞行员已确认,2是客户已确认,默认0)
|
||||
*/
|
||||
@ApiModelProperty(value = "确认标识(1是飞行员已确认,2是客户已确认,默认0)")
|
||||
private Integer confirmStatus;
|
||||
|
||||
/**
|
||||
* 订单子单信息列表
|
||||
*/
|
||||
|
@ -43,6 +43,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(pageQueryDTO.getMainOrderStatus()), OrderMain::getMainOrderStatus, pageQueryDTO.getMainOrderStatus());
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(pageQueryDTO.getSettlementStatus()), OrderMain::getSettlementStatus, pageQueryDTO.getSettlementStatus());
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(pageQueryDTO.getAreaId()), OrderMain::getAreaId, pageQueryDTO.getAreaId());
|
||||
queryWrapper.in(ObjectUtil.isNotNull(pageQueryDTO.getMainOrderStatusList()), OrderMain::getMainOrderStatus, pageQueryDTO.getMainOrderStatusList());
|
||||
queryWrapper.orderByDesc(OrderMain::getId);
|
||||
return list(queryWrapper);
|
||||
}
|
||||
@ -125,7 +126,11 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
|
||||
this.update(updateOrderMain, Wrappers.<OrderMain>lambdaUpdate()
|
||||
.eq(OrderMain::getId, updateOrderMain.getId())
|
||||
.set(OrderMain::getOrderFinishTime, updateOrderMain.getOrderFinishTime())
|
||||
.set(OrderMain::getMainOrderStatus, updateOrderMain.getMainOrderStatus())
|
||||
.set(OrderMain::getConfirmStatus, updateOrderMain.getConfirmStatus())
|
||||
.set(ObjectUtil.isNotNull(updateOrderMain.getMainOrderStatus()),
|
||||
OrderMain::getMainOrderStatus, updateOrderMain.getMainOrderStatus())
|
||||
.set(ObjectUtil.isNotNull(updateOrderMain.getConfirmTime()),
|
||||
OrderMain::getConfirmTime, updateOrderMain.getConfirmTime())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,12 @@
|
||||
<if test="attractionId != null">
|
||||
and attraction_id = #{attractionId}
|
||||
</if>
|
||||
<if test="mainOrderStatusList != null and mainOrderStatusList.size() > 0">
|
||||
and main_order_status in
|
||||
<foreach item="item" collection="mainOrderStatusList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
order by id desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user