Commit 25ac6d8b authored by zhengyi's avatar zhengyi

提供预警控货订单列表查询业务

Signed-off-by: default avatarzhengyi <landuo321@aliyun.com>
parent b42315dc
......@@ -86,7 +86,22 @@ public interface OrderCargoControlService extends IService<OrderCargoControlDO>
*/
List<OrderCargoControlDO> getOrderCargoControlList(OrderCargoControlQueryVO query);
PageResult<OrderBackPageVO> orderPage(OrderQueryVO query, PageVO page);
PageResult<OrderBackPageVO> cargoControlOrderPage(OrderQueryVO query, PageVO page);
/**
* 预警控货订单信息
* 满足条件:1、控货订单
* 2、非海外仓订单
* 3、控货订单放货三次未提货完
* 4、控货订单已过免仓时效,未完成放货
* 以上为查询出的预警控货订单,以便于将订单转海外仓货、收取仓储费用、提醒客户放货等业务操作
*
* @param query
* @param page
* @return
*/
PageResult<OrderBackPageVO> warningCargoControlOrderPage(OrderQueryVO query, PageVO page);
OrderCargoControlBackVO getOrderCargoControlInfo(Long orderId);
......@@ -111,6 +126,7 @@ public interface OrderCargoControlService extends IService<OrderCargoControlDO>
// FileDO makeCargoControlOrderExcelFile(Long userId, Integer userType, OrderQueryVO query) throws Exception;
FileDO makeCargoControlOrderExcelFile(Long userId, Integer userType, OrderQueryDTO query) throws Exception;
/**
* 判断是否控货人是否设置了控货密码
*
......
......@@ -152,7 +152,7 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
// 当控货人手机号没有注册web用户,或者用户没有设置控货密码时不能进行控货密码放货
if (isPasswordNull) {
throw exception(CONTROLLER_USER_NOT_SET_CONTROL_PASSWORD);
}else {
} else {
// 参数:未加密密码,编码后的密码
throw exception(USER_PASSWORD_FAILED);
}
......@@ -175,7 +175,7 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
String msg = String.format("订单控货人信息由姓名%s,电话+%s,转移为姓名%s,电话+%s,校验方式:%s",
orgOrderCargoControlDO.getName() + "/" + orgOrderCargoControlDO.getNameEn(), orgOrderCargoControlDO.getDialCode() + orgOrderCargoControlDO.getPhone(),
orderCargoControl.getName() + "/" + (StringUtils.isNotBlank(orderCargoControl.getNameEn()) ? orderCargoControl.getNameEn() : "空"), orderCargoControl.getDialCode() + orderCargoControl.getPhone(),
isPasswordPick ? "密码校验": "验证码校验");
isPasswordPick ? "密码校验" : "验证码校验");
orderBusinessService.createOrderControlLog(orderCargoControl.getOrderId(), 3, "控货人信息转移", msg, 0L);
// 返回
return orderCargoControl.getId();
......@@ -225,7 +225,18 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
}
@Override
public PageResult<OrderBackPageVO> orderPage(OrderQueryVO query, PageVO page) {
public PageResult<OrderBackPageVO> cargoControlOrderPage(OrderQueryVO query, PageVO page) {
return orderQueryService.adminCargoControlOrderPage(query, page);
}
@Override
public PageResult<OrderBackPageVO> warningCargoControlOrderPage(OrderQueryVO query, PageVO page) {
/* 满足条件:1、控货订单
* 2、非海外仓订单
* 3、控货订单放货三次未提货完
* 4、控货订单已过免仓时效,未完成放货
*/
query.setWarningOrder(1);
return orderQueryService.adminCargoControlOrderPage(query, page);
}
......
......@@ -525,6 +525,9 @@ public class OrderQueryVO {
private Boolean isInOpenSea;
@ApiModelProperty(value = "是否预警控货订单: 1 是")
private Integer warningOrder;
public void setStatus(Integer status) {
this.status = status;
this.asStatus = status;
......
......@@ -1863,6 +1863,21 @@
<if test="query.status != null">
AND o.`status` = #{query.status}
</if>
<if test="query.warningOrder != null and query.warningOrder == 1 ">
AND (o.type is null or o.type = '' or NOT FIND_IN_SET(2, o.type))
AND o.`is_cargo_control` = 1
AND o.unload_time is not null
AND ((select IFNULL(sum(p.pick_num), 0) from `ecw_order_cargo_control_pick` p where p.order_id = o.order_id and p.status = 3) &lt; o.`sum_num`
or
DATE_ADD(o.unload_time, INTERVAL (
SELECT
IFNULL(ew_dest.rent_free_days, 0)
FROM
ecw_warehouse_line ewl
JOIN ecw_warehouse ew_dest ON ewl.dest_warehouse_id = ew_dest.id
WHERE ewl.id = o.line_id
) DAY) &lt; now())
</if>
<if test="query.abnormalState != null">
<choose>
<when test="query.abnormalState != 0">
......
......@@ -94,7 +94,15 @@ public class OrderCargoControlController {
public CommonResult<PageResult<OrderBackPageVO>> cargoControlOrderPage(OrderQueryVO query, PageVO page) {
query.setUserType(UserTypeEnum.ADMIN.getValue());
PageResult<OrderBackPageVO> pageResult =
orderCargoControlService.orderPage(query, page);
orderCargoControlService.cargoControlOrderPage(query, page);
return success(pageResult);
}
@GetMapping("/warning/cargo/control/order")
@ApiOperation("获得预警控货订单列表查询订单分页")
public CommonResult<PageResult<OrderBackPageVO>> warningCargoControlOrderPage(OrderQueryVO query, PageVO page) {
query.setUserType(UserTypeEnum.ADMIN.getValue());
PageResult<OrderBackPageVO> pageResult =
orderCargoControlService.warningCargoControlOrderPage(query, page);
return success(pageResult);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment