Compare commits
2 Commits
745560969d
...
c0ebe1f047
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c0ebe1f047 | ||
![]() |
0ea147b0f4 |
@ -305,6 +305,13 @@ public class OrderBiz {
|
|||||||
// 获取当前登录用户
|
// 获取当前登录用户
|
||||||
Long orderInitiatorId = SecurityUtils.getCurrentUserId();
|
Long orderInitiatorId = SecurityUtils.getCurrentUserId();
|
||||||
|
|
||||||
|
// 订单处于完成/取消状态/待确认状态,不允许新增任务
|
||||||
|
OrderMain orderMain = orderMainService.obtainOrderMainById(orderTaskDTO.getOrderId());
|
||||||
|
if (!Objects.equals(orderMain.getMainOrderStatus(), MainOrderStatusEnum.NOT_STARTED.getCode()) ||
|
||||||
|
!Objects.equals(orderMain.getMainOrderStatus(), MainOrderStatusEnum.PROCESSING.getCode())) {
|
||||||
|
throw new BadRequestException("当前订单状态处于:"+ MainOrderStatusEnum.getInstance(orderMain.getMainOrderStatus()) + ",不允许新增任务");
|
||||||
|
}
|
||||||
|
|
||||||
// 新建订单飞行任务限制(当前飞行员不能存在任务处于未进行,进行中)
|
// 新建订单飞行任务限制(当前飞行员不能存在任务处于未进行,进行中)
|
||||||
Long orderId = orderTaskDTO.getOrderId();
|
Long orderId = orderTaskDTO.getOrderId();
|
||||||
orderDetailService.checkOrderDetail(orderId, orderInitiatorId);
|
orderDetailService.checkOrderDetail(orderId, orderInitiatorId);
|
||||||
@ -395,7 +402,6 @@ public class OrderBiz {
|
|||||||
orderAllDetailVO.setCustomerId(orderMain.getCustomerId());
|
orderAllDetailVO.setCustomerId(orderMain.getCustomerId());
|
||||||
orderAllDetailVO.setOrderInitiatorId(orderMain.getOrderInitiatorId());
|
orderAllDetailVO.setOrderInitiatorId(orderMain.getOrderInitiatorId());
|
||||||
orderAllDetailVO.setAttractionId(orderMain.getAttractionId());
|
orderAllDetailVO.setAttractionId(orderMain.getAttractionId());
|
||||||
orderAllDetailVO.setConfirmStatus(orderMain.getConfirmStatus());
|
|
||||||
|
|
||||||
// 获取路线
|
// 获取路线
|
||||||
String routeName = obtainRouteName(orderMain, orderAllDetailVO);
|
String routeName = obtainRouteName(orderMain, orderAllDetailVO);
|
||||||
@ -902,7 +908,7 @@ public class OrderBiz {
|
|||||||
// 是否存在飞行任务(至少存在一个飞行失败或者完成的,才能点击完成,且不能存在未开始,进行中的)
|
// 是否存在飞行任务(至少存在一个飞行失败或者完成的,才能点击完成,且不能存在未开始,进行中的)
|
||||||
List<OrderDetail> orderDetailList = orderDetailService.queryOrderDetailByOrderId(orderId);
|
List<OrderDetail> orderDetailList = orderDetailService.queryOrderDetailByOrderId(orderId);
|
||||||
if (CollectionUtil.isEmpty(orderDetailList)) {
|
if (CollectionUtil.isEmpty(orderDetailList)) {
|
||||||
throw new BadRequestException("该订单不存在飞行任务,无法完成");
|
throw new BadRequestException("该订单不存在飞行任务,无法完成订单");
|
||||||
}
|
}
|
||||||
// 订单不能存在未开始或者进行中的飞行任务
|
// 订单不能存在未开始或者进行中的飞行任务
|
||||||
boolean hasFlightTask = orderDetailList.stream().anyMatch(orderDetail -> {
|
boolean hasFlightTask = orderDetailList.stream().anyMatch(orderDetail -> {
|
||||||
@ -917,10 +923,9 @@ public class OrderBiz {
|
|||||||
updateOrderMain.setId(orderId);
|
updateOrderMain.setId(orderId);
|
||||||
updateOrderMain.setOrderFinishTime(new Date());
|
updateOrderMain.setOrderFinishTime(new Date());
|
||||||
if (currentUserType.equals(UserTypeEnum.EMPLOYEES)) {
|
if (currentUserType.equals(UserTypeEnum.EMPLOYEES)) {
|
||||||
updateOrderMain.setConfirmStatus(ConfirmStatusEnum.PILOT_CONFIRMED.getCode());
|
updateOrderMain.setMainOrderStatus(MainOrderStatusEnum.WAIT_CONFIRM.getCode());
|
||||||
updateOrderMain.setConfirmTime(new Date());
|
updateOrderMain.setConfirmTime(new Date());
|
||||||
} else {
|
} else {
|
||||||
updateOrderMain.setConfirmStatus(ConfirmStatusEnum.CUSTOMER_CONFIRMED.getCode());
|
|
||||||
updateOrderMain.setMainOrderStatus(MainOrderStatusEnum.COMPLETED.getCode());
|
updateOrderMain.setMainOrderStatus(MainOrderStatusEnum.COMPLETED.getCode());
|
||||||
}
|
}
|
||||||
orderMainService.finishMainOrder(updateOrderMain);
|
orderMainService.finishMainOrder(updateOrderMain);
|
||||||
|
@ -114,11 +114,6 @@ public class OrderMain extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Date orderFinishTime;
|
private Date orderFinishTime;
|
||||||
|
|
||||||
/**
|
|
||||||
* 确认标识(1是飞行员确认,2是客户已确认,默认0)
|
|
||||||
*/
|
|
||||||
private Integer confirmStatus;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认时间
|
* 确认时间
|
||||||
*/
|
*/
|
||||||
|
@ -26,7 +26,7 @@ public class OrderConstant {
|
|||||||
/**
|
/**
|
||||||
* 结算批次号
|
* 结算批次号
|
||||||
*/
|
*/
|
||||||
public static final String SETTLEMENT_BATCH_NO_PREFIX = "JS_";
|
public static final String SETTLEMENT_BATCH_NO_PREFIX = "JS-";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年月日 时分秒
|
* 年月日 时分秒
|
||||||
|
@ -80,5 +80,11 @@ public class OrderMainPageQueryDTO {
|
|||||||
@ApiModelProperty(value = "订单状态(支持多个状态查询)")
|
@ApiModelProperty(value = "订单状态(支持多个状态查询)")
|
||||||
private List<Integer> mainOrderStatusList;
|
private List<Integer> mainOrderStatusList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号查询
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "订单编号查询")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,10 @@ public enum MainOrderStatusEnum {
|
|||||||
*/
|
*/
|
||||||
PROCESSING(1, "进行中"),
|
PROCESSING(1, "进行中"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待确认
|
||||||
|
*/
|
||||||
|
WAIT_CONFIRM(4, "待确认"),
|
||||||
/**
|
/**
|
||||||
* 已完成
|
* 已完成
|
||||||
*/
|
*/
|
||||||
|
@ -152,12 +152,6 @@ public class OrderAllDetailVO {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date orderFinishTime;
|
private Date orderFinishTime;
|
||||||
|
|
||||||
/**
|
|
||||||
* 确认标识(1是飞行员已确认,2是客户已确认,默认0)
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "确认标识(1是飞行员已确认,2是客户已确认,默认0)")
|
|
||||||
private Integer confirmStatus;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单子单信息列表
|
* 订单子单信息列表
|
||||||
*/
|
*/
|
||||||
|
@ -23,6 +23,13 @@ public class OrderMainPageQueryVO {
|
|||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "ID")
|
@ApiModelProperty(value = "ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "订单编号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单类型
|
* 订单类型
|
||||||
*/
|
*/
|
||||||
@ -32,7 +39,7 @@ public class OrderMainPageQueryVO {
|
|||||||
/**
|
/**
|
||||||
* 订单状态
|
* 订单状态
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "订单状态(0=未进行,1=进行中,2=已完成,3=已取消)")
|
@ApiModelProperty(value = "订单状态(0=未进行,1=进行中,2=已完成,3=已取消,4=待确认)")
|
||||||
private Integer mainOrderStatus;
|
private Integer mainOrderStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,6 +47,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
|
|||||||
queryWrapper.eq(ObjectUtil.isNotNull(pageQueryDTO.getSettlementStatus()), OrderMain::getSettlementStatus, pageQueryDTO.getSettlementStatus());
|
queryWrapper.eq(ObjectUtil.isNotNull(pageQueryDTO.getSettlementStatus()), OrderMain::getSettlementStatus, pageQueryDTO.getSettlementStatus());
|
||||||
queryWrapper.eq(ObjectUtil.isNotNull(pageQueryDTO.getAreaId()), OrderMain::getAreaId, pageQueryDTO.getAreaId());
|
queryWrapper.eq(ObjectUtil.isNotNull(pageQueryDTO.getAreaId()), OrderMain::getAreaId, pageQueryDTO.getAreaId());
|
||||||
queryWrapper.in(ObjectUtil.isNotNull(pageQueryDTO.getMainOrderStatusList()), OrderMain::getMainOrderStatus, pageQueryDTO.getMainOrderStatusList());
|
queryWrapper.in(ObjectUtil.isNotNull(pageQueryDTO.getMainOrderStatusList()), OrderMain::getMainOrderStatus, pageQueryDTO.getMainOrderStatusList());
|
||||||
|
queryWrapper.like(ObjectUtil.isNotNull(pageQueryDTO.getOrderNo()), OrderMain::getOrderNo, pageQueryDTO.getOrderNo());
|
||||||
queryWrapper.orderByDesc(OrderMain::getId);
|
queryWrapper.orderByDesc(OrderMain::getId);
|
||||||
return list(queryWrapper);
|
return list(queryWrapper);
|
||||||
}
|
}
|
||||||
@ -129,7 +130,6 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
|
|||||||
this.update(updateOrderMain, Wrappers.<OrderMain>lambdaUpdate()
|
this.update(updateOrderMain, Wrappers.<OrderMain>lambdaUpdate()
|
||||||
.eq(OrderMain::getId, updateOrderMain.getId())
|
.eq(OrderMain::getId, updateOrderMain.getId())
|
||||||
.set(OrderMain::getOrderFinishTime, updateOrderMain.getOrderFinishTime())
|
.set(OrderMain::getOrderFinishTime, updateOrderMain.getOrderFinishTime())
|
||||||
.set(OrderMain::getConfirmStatus, updateOrderMain.getConfirmStatus())
|
|
||||||
.set(ObjectUtil.isNotNull(updateOrderMain.getMainOrderStatus()),
|
.set(ObjectUtil.isNotNull(updateOrderMain.getMainOrderStatus()),
|
||||||
OrderMain::getMainOrderStatus, updateOrderMain.getMainOrderStatus())
|
OrderMain::getMainOrderStatus, updateOrderMain.getMainOrderStatus())
|
||||||
.set(ObjectUtil.isNotNull(updateOrderMain.getConfirmTime()),
|
.set(ObjectUtil.isNotNull(updateOrderMain.getConfirmTime()),
|
||||||
@ -140,8 +140,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
|
|||||||
@Override
|
@Override
|
||||||
public List<OrderMain> obtainOrderNotFinish(Date finishTime) {
|
public List<OrderMain> obtainOrderNotFinish(Date finishTime) {
|
||||||
return list(Wrappers.lambdaQuery(OrderMain.class)
|
return list(Wrappers.lambdaQuery(OrderMain.class)
|
||||||
.eq(OrderMain::getMainOrderStatus, MainOrderStatusEnum.PROCESSING.getCode())
|
.eq(OrderMain::getMainOrderStatus, MainOrderStatusEnum.WAIT_CONFIRM.getCode())
|
||||||
.eq(OrderMain::getConfirmStatus, ConfirmStatusEnum.PILOT_CONFIRMED.getCode())
|
|
||||||
.le(OrderMain::getOrderFinishTime, finishTime)
|
.le(OrderMain::getOrderFinishTime, finishTime)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="BaseColumn">
|
<sql id="BaseColumn">
|
||||||
id, order_no, order_type, order_initiator_id, phone, attraction_id, customer_id,
|
id, order_no, order_type, order_initiator_id, phone, attraction_id, customer_id,
|
||||||
customer_name, route_ids, cargo_weight, total_amount, amount, surcharge_amount, open_id,
|
route_ids, cargo_weight, total_amount, amount, surcharge_amount, open_id,
|
||||||
settlement_status, main_order_status, relevance_status, order_create_time,
|
settlement_status, main_order_status, relevance_status, order_create_time,
|
||||||
order_finish_time, create_time, create_by, update_time, update_by, del_flag
|
order_finish_time, create_time, create_by, update_time, update_by, del_flag,confirm_time
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="obtainOrderList" resultType="com.aircraft.modules.order.domain.OrderMain">
|
<select id="obtainOrderList" resultType="com.aircraft.modules.order.domain.OrderMain">
|
||||||
@ -35,6 +35,9 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="orderNo != null and orderNo != ''">
|
||||||
|
and order_no like concat('%',#{orderNo},'%')
|
||||||
|
</if>
|
||||||
order by id desc
|
order by id desc
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user