Compare commits

..

No commits in common. "c0ebe1f047755400d42345a788025dced52f747c" and "745560969daf2e9da6612b1df31e20fb0675104e" have entirely different histories.

9 changed files with 22 additions and 35 deletions

View File

@ -305,13 +305,6 @@ public class OrderBiz {
// 获取当前登录用户
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();
orderDetailService.checkOrderDetail(orderId, orderInitiatorId);
@ -402,6 +395,7 @@ public class OrderBiz {
orderAllDetailVO.setCustomerId(orderMain.getCustomerId());
orderAllDetailVO.setOrderInitiatorId(orderMain.getOrderInitiatorId());
orderAllDetailVO.setAttractionId(orderMain.getAttractionId());
orderAllDetailVO.setConfirmStatus(orderMain.getConfirmStatus());
// 获取路线
String routeName = obtainRouteName(orderMain, orderAllDetailVO);
@ -908,7 +902,7 @@ public class OrderBiz {
// 是否存在飞行任务至少存在一个飞行失败或者完成的才能点击完成且不能存在未开始进行中的
List<OrderDetail> orderDetailList = orderDetailService.queryOrderDetailByOrderId(orderId);
if (CollectionUtil.isEmpty(orderDetailList)) {
throw new BadRequestException("该订单不存在飞行任务,无法完成订单");
throw new BadRequestException("该订单不存在飞行任务,无法完成");
}
// 订单不能存在未开始或者进行中的飞行任务
boolean hasFlightTask = orderDetailList.stream().anyMatch(orderDetail -> {
@ -923,9 +917,10 @@ public class OrderBiz {
updateOrderMain.setId(orderId);
updateOrderMain.setOrderFinishTime(new Date());
if (currentUserType.equals(UserTypeEnum.EMPLOYEES)) {
updateOrderMain.setMainOrderStatus(MainOrderStatusEnum.WAIT_CONFIRM.getCode());
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);

View File

@ -114,6 +114,11 @@ public class OrderMain extends BaseEntity {
*/
private Date orderFinishTime;
/**
* 确认标识1是飞行员确认2是客户已确认默认0
*/
private Integer confirmStatus;
/**
* 确认时间
*/

View File

@ -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_";
/**
* 年月日 时分秒

View File

@ -80,11 +80,5 @@ public class OrderMainPageQueryDTO {
@ApiModelProperty(value = "订单状态(支持多个状态查询)")
private List<Integer> mainOrderStatusList;
/**
* 订单编号查询
*/
@ApiModelProperty(value = "订单编号查询")
private String orderNo;
}

View File

@ -27,10 +27,6 @@ public enum MainOrderStatusEnum {
*/
PROCESSING(1, "进行中"),
/**
* 待确认
*/
WAIT_CONFIRM(4, "待确认"),
/**
* 已完成
*/

View File

@ -152,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;
/**
* 订单子单信息列表
*/

View File

@ -23,13 +23,6 @@ public class OrderMainPageQueryVO {
*/
@ApiModelProperty(value = "ID")
private Long id;
/**
* 订单编号
*/
@ApiModelProperty(value = "订单编号")
private String orderNo;
/**
* 订单类型
*/
@ -39,7 +32,7 @@ public class OrderMainPageQueryVO {
/**
* 订单状态
*/
@ApiModelProperty(value = "订单状态(0=未进行1=进行中2=已完成3=已取消,4=待确认)")
@ApiModelProperty(value = "订单状态(0=未进行1=进行中2=已完成3=已取消)")
private Integer mainOrderStatus;
/**

View File

@ -47,7 +47,6 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
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.like(ObjectUtil.isNotNull(pageQueryDTO.getOrderNo()), OrderMain::getOrderNo, pageQueryDTO.getOrderNo());
queryWrapper.orderByDesc(OrderMain::getId);
return list(queryWrapper);
}
@ -130,6 +129,7 @@ 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::getConfirmStatus, updateOrderMain.getConfirmStatus())
.set(ObjectUtil.isNotNull(updateOrderMain.getMainOrderStatus()),
OrderMain::getMainOrderStatus, updateOrderMain.getMainOrderStatus())
.set(ObjectUtil.isNotNull(updateOrderMain.getConfirmTime()),
@ -140,7 +140,8 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
@Override
public List<OrderMain> obtainOrderNotFinish(Date finishTime) {
return list(Wrappers.lambdaQuery(OrderMain.class)
.eq(OrderMain::getMainOrderStatus, MainOrderStatusEnum.WAIT_CONFIRM.getCode())
.eq(OrderMain::getMainOrderStatus, MainOrderStatusEnum.PROCESSING.getCode())
.eq(OrderMain::getConfirmStatus, ConfirmStatusEnum.PILOT_CONFIRMED.getCode())
.le(OrderMain::getOrderFinishTime, finishTime)
);
}

View File

@ -5,9 +5,9 @@
<!-- 通用查询结果列 -->
<sql id="BaseColumn">
id, order_no, order_type, order_initiator_id, phone, attraction_id, customer_id,
route_ids, cargo_weight, total_amount, amount, surcharge_amount, open_id,
customer_name, route_ids, cargo_weight, total_amount, 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,confirm_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">
@ -35,9 +35,6 @@
#{item}
</foreach>
</if>
<if test="orderNo != null and orderNo != ''">
and order_no like concat('%',#{orderNo},'%')
</if>
order by id desc
</select>
</mapper>