Commit b1561fa6 authored by 332784038@qq.com's avatar 332784038@qq.com

放货率数据冗余及查询

parent 0e7ae8f4
-- 放货箱数与放货率
alter table `ecw_order`
add column `release_ratio` decimal(5,2) DEFAULT '0.00' COMMENT '放货率';
alter table `ecw_order`
add column `release_num` int DEFAULT 0 COMMENT '放货箱数';
-- 批量刷新订单放货数量、放货率
update ecw_order t LEFT JOIN (select ccp.order_id , ifnull(sum(ccp.pick_num),0) as releaseNum from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
ccp.status in(1,2,3,4,5,6) group by ccp.order_id) t1 on t.order_id=t1.order_id set t.release_num=t1.releaseNum, t.release_ratio=ROUND(t1.releaseNum/t.sum_num,2)*100;
...@@ -537,12 +537,18 @@ public class OrderDO extends BaseDO { ...@@ -537,12 +537,18 @@ public class OrderDO extends BaseDO {
@ApiModelProperty(value = "提货状态:0 未提货 1 部分提货 2 已提货") @ApiModelProperty(value = "提货状态:0 未提货 1 部分提货 2 已提货")
private Integer pickState; private Integer pickState;
@ApiModelProperty(value = "'提货率'") @ApiModelProperty(value = "提货率")
private BigDecimal pickRatio; private BigDecimal pickRatio;
@ApiModelProperty(value = "'提货箱数'") @ApiModelProperty(value = "提货箱数")
private Integer pickNum; private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "订单商品项列表") @ApiModelProperty(value = "订单商品项列表")
@NotNull(message = "订单商品项列表不能为空") @NotNull(message = "订单商品项列表不能为空")
......
...@@ -539,6 +539,13 @@ public class OrderBackInfoDto { ...@@ -539,6 +539,13 @@ public class OrderBackInfoDto {
@ApiModelProperty(value = "'提货箱数'") @ApiModelProperty(value = "'提货箱数'")
private Integer pickNum; private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
public void setExceptionReason(String exceptionReason) { public void setExceptionReason(String exceptionReason) {
this.exceptionReason = exceptionReason; this.exceptionReason = exceptionReason;
if (StringUtils.isNotBlank(exceptionReason) && Objects.nonNull(this.lang)) { if (StringUtils.isNotBlank(exceptionReason) && Objects.nonNull(this.lang)) {
......
...@@ -148,7 +148,7 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo ...@@ -148,7 +148,7 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
.eq(OrderApprovalDO::getType, 61) .eq(OrderApprovalDO::getType, 61)
.eq(OrderApprovalDO::getStatus, 1) .eq(OrderApprovalDO::getStatus, 1)
); );
if (limitUpdateCount > 0){ if (limitUpdateCount > 0) {
throw exception(ORDER_CARGO_CONTROL_CONSIGNEE_LIMIT_UPDATE_APPLYING); throw exception(ORDER_CARGO_CONTROL_CONSIGNEE_LIMIT_UPDATE_APPLYING);
} }
long overseasWarehouseUpdateCount = orderApprovalMapper.selectCount(new LambdaQueryWrapper<OrderApprovalDO>() long overseasWarehouseUpdateCount = orderApprovalMapper.selectCount(new LambdaQueryWrapper<OrderApprovalDO>()
...@@ -156,7 +156,7 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo ...@@ -156,7 +156,7 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
.eq(OrderApprovalDO::getType, 62) .eq(OrderApprovalDO::getType, 62)
.eq(OrderApprovalDO::getStatus, 1) .eq(OrderApprovalDO::getStatus, 1)
); );
if (overseasWarehouseUpdateCount > 0){ if (overseasWarehouseUpdateCount > 0) {
throw exception(ORDER_CARGO_CONTROL_OVERSEAS_WAREHOUSE_UPDATE_APPLYING); throw exception(ORDER_CARGO_CONTROL_OVERSEAS_WAREHOUSE_UPDATE_APPLYING);
} }
//不能大于总箱数 //不能大于总箱数
...@@ -164,17 +164,17 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo ...@@ -164,17 +164,17 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
throw exception(ORDER_CARGO_CONTROL_NUM_GO_BEYOND); throw exception(ORDER_CARGO_CONTROL_NUM_GO_BEYOND);
} }
// 如果控货订单限制修改收货人,则需要判断控货收货人限制修改时间是否到期,且当前放货操作的收货人电话是否有变动 // 如果控货订单限制修改收货人,则需要判断控货收货人限制修改时间是否到期,且当前放货操作的收货人电话是否有变动
if (orderDO.getIsLimitUpdateConsignee() && Objects.isNull(orderDO.getLockConsigneeTime())){ if (orderDO.getIsLimitUpdateConsignee() && Objects.isNull(orderDO.getLockConsigneeTime())) {
// 当前控货订单限制修改收货人,但是未到仓/卸柜,未查询到限制时间 // 当前控货订单限制修改收货人,但是未到仓/卸柜,未查询到限制时间
throw exception(ORDER_CARGO_CONTROL_LIMIT_UPDATE_CONSIGNEE_ERROR); throw exception(ORDER_CARGO_CONTROL_LIMIT_UPDATE_CONSIGNEE_ERROR);
} }
if (orderDO.getIsLimitUpdateConsignee() && Objects.nonNull(orderDO.getLockConsigneeTime()) && orderDO.getLockConsigneeTime().compareTo(new Date()) >= 0){ if (orderDO.getIsLimitUpdateConsignee() && Objects.nonNull(orderDO.getLockConsigneeTime()) && orderDO.getLockConsigneeTime().compareTo(new Date()) >= 0) {
// 控货收货人限制修改时间未到期,需要判断当前放货操作的收货人电话是否有变动 // 控货收货人限制修改时间未到期,需要判断当前放货操作的收货人电话是否有变动
OrderCargoControlReleaseInfoDto releaseInfoDto = orderCargoControlMapper.getOrderCargoControlReleaseInfo(orderDO.getOrderId()); OrderCargoControlReleaseInfoDto releaseInfoDto = orderCargoControlMapper.getOrderCargoControlReleaseInfo(orderDO.getOrderId());
if (StringUtils.isBlank(releaseInfoDto.getConsigneeCountryCode()) || StringUtils.isBlank(releaseInfoDto.getConsigneePhone())){ if (StringUtils.isBlank(releaseInfoDto.getConsigneeCountryCode()) || StringUtils.isBlank(releaseInfoDto.getConsigneePhone())) {
throw exception(ORDER_CONSIGNEE_PHONE_INFO_NOT_COMPLETE); throw exception(ORDER_CONSIGNEE_PHONE_INFO_NOT_COMPLETE);
} }
if (!StringUtils.equals(releaseInfoDto.getConsigneeCountryCode()+releaseInfoDto.getConsigneePhone(), createReqVO.getConsigneeCountryCode() + createReqVO.getConsigneePhone())){ if (!StringUtils.equals(releaseInfoDto.getConsigneeCountryCode() + releaseInfoDto.getConsigneePhone(), createReqVO.getConsigneeCountryCode() + createReqVO.getConsigneePhone())) {
throw exception(ORDER_CARGO_CONTROL_LIMIT_UPDATE_CONSIGNEE_INFO); throw exception(ORDER_CARGO_CONTROL_LIMIT_UPDATE_CONSIGNEE_INFO);
} }
} }
...@@ -184,9 +184,9 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo ...@@ -184,9 +184,9 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
BigDecimal pickWeight = BigDecimal.ZERO; BigDecimal pickWeight = BigDecimal.ZERO;
List<OrderCargoControlPickDO> pickDOList = List<OrderCargoControlPickDO> pickDOList =
orderCargoControlPickMapper.selectList(new LambdaQueryWrapper<OrderCargoControlPickDO>() orderCargoControlPickMapper.selectList(new LambdaQueryWrapper<OrderCargoControlPickDO>()
.eq(OrderCargoControlPickDO::getOrderId, createReqVO.getOrderId()) .eq(OrderCargoControlPickDO::getOrderId, createReqVO.getOrderId())
.in(OrderCargoControlPickDO::getStatus, Arrays.asList(1, 2, 3, 4, 5, 6)) .in(OrderCargoControlPickDO::getStatus, Arrays.asList(1, 2, 3, 4, 5, 6))
.eq(OrderCargoControlPickDO::getDeleted, Boolean.FALSE)); .eq(OrderCargoControlPickDO::getDeleted, Boolean.FALSE));
if (CollectionUtil.isNotEmpty(pickDOList)) { if (CollectionUtil.isNotEmpty(pickDOList)) {
pickNum = pickDOList.stream().mapToInt(OrderCargoControlPickDO::getPickNum).sum(); pickNum = pickDOList.stream().mapToInt(OrderCargoControlPickDO::getPickNum).sum();
pickQuantity = pickDOList.stream().mapToInt(OrderCargoControlPickDO::getPickQuantity).sum(); pickQuantity = pickDOList.stream().mapToInt(OrderCargoControlPickDO::getPickQuantity).sum();
...@@ -207,10 +207,10 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo ...@@ -207,10 +207,10 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
OrderCargoControlDO orderCargoControlDO = OrderCargoControlDO orderCargoControlDO =
orderCargoControlService.getOne(new LambdaQueryWrapper<OrderCargoControlDO>() orderCargoControlService.getOne(new LambdaQueryWrapper<OrderCargoControlDO>()
.eq(OrderCargoControlDO::getOrderId, createReqVO.getOrderId()) .eq(OrderCargoControlDO::getOrderId, createReqVO.getOrderId())
.eq(OrderCargoControlDO::getIsActual, Boolean.TRUE) .eq(OrderCargoControlDO::getIsActual, Boolean.TRUE)
.orderByDesc(OrderCargoControlDO::getId) .orderByDesc(OrderCargoControlDO::getId)
.last("limit 1")); .last("limit 1"));
if (Objects.isNull(orderCargoControlDO)) { if (Objects.isNull(orderCargoControlDO)) {
throw exception(ORDER_CARGO_CONTROL_NOT_EXISTS); throw exception(ORDER_CARGO_CONTROL_NOT_EXISTS);
} }
...@@ -320,6 +320,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo ...@@ -320,6 +320,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
orderCargoControlPick.getConsigneeName() + "/" + (StringUtils.isNotBlank(orderCargoControlPick.getConsigneeNameEn()) ? orderCargoControlPick.getConsigneeNameEn() : "空"), orderCargoControlPick.getConsigneeName() + "/" + (StringUtils.isNotBlank(orderCargoControlPick.getConsigneeNameEn()) ? orderCargoControlPick.getConsigneeNameEn() : "空"),
orderCargoControlPick.getConsigneeCountryCode() + orderCargoControlPick.getConsigneePhone()); orderCargoControlPick.getConsigneeCountryCode() + orderCargoControlPick.getConsigneePhone());
} }
orderDO.setReleaseNum(orderDO.getReleaseNum() + orderCargoControlPick.getPickNum());
orderDO.setReleaseRatio(new BigDecimal(orderDO.getReleaseNum()).divide(new BigDecimal(orderDO.getSumNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")));
orderService.updateById(orderDO); orderService.updateById(orderDO);
// 订单控货信息日志补充 // 订单控货信息日志补充
orderBusinessService.createOrderControlLog(orderCargoControlPick.getOrderId(), 4, "订单放货", msg, 0L); orderBusinessService.createOrderControlLog(orderCargoControlPick.getOrderId(), 4, "订单放货", msg, 0L);
...@@ -419,15 +421,24 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo ...@@ -419,15 +421,24 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
// TODO 修改订单控货状态 // TODO 修改订单控货状态
String msg = ""; String msg = "";
Integer releaseNum = orderDO.getReleaseNum() + orderCargoControlPick.getPickNum();
if (Objects.equals(orderCargoControlPick.getControlNum(), orderCargoControlPick.getPickNum())) { if (Objects.equals(orderCargoControlPick.getControlNum(), orderCargoControlPick.getPickNum())) {
// 已放完货 // 已放完货
orderService.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getCargoControlStatus, 1).eq(OrderDO::getOrderId, orderDO.getOrderId())); orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getCargoControlStatus, 1)
.set(OrderDO::getReleaseNum, releaseNum)
.set(OrderDO::getReleaseRatio, new BigDecimal(releaseNum).divide(new BigDecimal(orderDO.getSumNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")))
.eq(OrderDO::getOrderId, orderDO.getOrderId()));
msg = String.format("订单放货%s箱, 已放完货, 收货人姓名%s,电话+%s", orderCargoControlPick.getPickNum(), msg = String.format("订单放货%s箱, 已放完货, 收货人姓名%s,电话+%s", orderCargoControlPick.getPickNum(),
orderCargoControlPick.getConsigneeName() + "/" + (StringUtils.isNotBlank(orderCargoControlPick.getConsigneeNameEn()) ? orderCargoControlPick.getConsigneeNameEn() : "空"), orderCargoControlPick.getConsigneeName() + "/" + (StringUtils.isNotBlank(orderCargoControlPick.getConsigneeNameEn()) ? orderCargoControlPick.getConsigneeNameEn() : "空"),
orderCargoControlPick.getConsigneeCountryCode() + orderCargoControlPick.getConsigneePhone()); orderCargoControlPick.getConsigneeCountryCode() + orderCargoControlPick.getConsigneePhone());
} else { } else {
// 部分控货中 // 部分控货中
orderService.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getCargoControlStatus, 2).eq(OrderDO::getOrderId, orderDO.getOrderId())); orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getCargoControlStatus, 2)
.set(OrderDO::getReleaseNum, releaseNum)
.set(OrderDO::getReleaseRatio, new BigDecimal(releaseNum).divide(new BigDecimal(orderDO.getSumNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")))
.eq(OrderDO::getOrderId, orderDO.getOrderId()));
msg = String.format("订单放货%s箱, 部分控货中, 收货人姓名%s,电话+%s", orderCargoControlPick.getPickNum(), msg = String.format("订单放货%s箱, 部分控货中, 收货人姓名%s,电话+%s", orderCargoControlPick.getPickNum(),
orderCargoControlPick.getConsigneeName() + "/" + (StringUtils.isNotBlank(orderCargoControlPick.getConsigneeNameEn()) ? orderCargoControlPick.getConsigneeNameEn() : "空"), orderCargoControlPick.getConsigneeName() + "/" + (StringUtils.isNotBlank(orderCargoControlPick.getConsigneeNameEn()) ? orderCargoControlPick.getConsigneeNameEn() : "空"),
orderCargoControlPick.getConsigneeCountryCode() + orderCargoControlPick.getConsigneePhone()); orderCargoControlPick.getConsigneeCountryCode() + orderCargoControlPick.getConsigneePhone());
...@@ -964,17 +975,29 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo ...@@ -964,17 +975,29 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
Integer releasePickNum = orderCargoControlPickApplyVO.getCurrentPickNum() + pickNum; Integer releasePickNum = orderCargoControlPickApplyVO.getCurrentPickNum() + pickNum;
if (releasePickNum == 0) { if (releasePickNum == 0) {
// 放货箱数0 // 放货箱数0
orderService.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getCargoControlStatus, 0).eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId())); orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getCargoControlStatus, 0)
.set(OrderDO::getReleaseNum, 0)
.set(OrderDO::getReleaseRatio, BigDecimal.ZERO)
.eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId()));
msg = msg.concat(", 订单控货中"); msg = msg.concat(", 订单控货中");
} }
if (releasePickNum > 0 && releasePickNum < orderDO.getSumNum()) { if (releasePickNum > 0 && releasePickNum < orderDO.getSumNum()) {
// 放货完部分箱数 // 放货完部分箱数
orderService.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getCargoControlStatus, 2).eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId())); orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getCargoControlStatus, 2)
.set(OrderDO::getReleaseNum, releasePickNum)
.set(OrderDO::getReleaseRatio, new BigDecimal(releasePickNum).divide(new BigDecimal(orderDO.getSumNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")))
.eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId()));
msg = msg.concat(", 订单部分控货中"); msg = msg.concat(", 订单部分控货中");
} }
if (releasePickNum > 0 && Objects.equals(releasePickNum, orderDO.getSumNum())) { if (releasePickNum > 0 && Objects.equals(releasePickNum, orderDO.getSumNum())) {
// 放货完所有箱数 // 放货完所有箱数
orderService.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getCargoControlStatus, 1).eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId())); orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getCargoControlStatus, 1)
.set(OrderDO::getReleaseNum, releasePickNum)
.set(OrderDO::getReleaseRatio, new BigDecimal(releasePickNum).divide(new BigDecimal(orderDO.getSumNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")))
.eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId()));
msg = msg.concat(", 订单已放完货"); msg = msg.concat(", 订单已放完货");
} }
OrderControlLogParam param = new OrderControlLogParam(); OrderControlLogParam param = new OrderControlLogParam();
...@@ -1063,12 +1086,26 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo ...@@ -1063,12 +1086,26 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
.eq(OrderCargoControlPickDO::getDeleted, false)); .eq(OrderCargoControlPickDO::getDeleted, false));
// 避免并发修改,这里只对订单的控货状态进行修改 // 避免并发修改,这里只对订单的控货状态进行修改
if (count == 0) { if (count == 0) {
orderService.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getCargoControlStatus, 0).eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId())); orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getCargoControlStatus, 0)
.set(OrderDO::getReleaseNum, 0)
.set(OrderDO::getReleaseRatio, BigDecimal.ZERO)
.eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId()));
} }
if (count > 0) { if (count > 0) {
if (orderDO.getCargoControlStatus() == 1) { if (orderDO.getCargoControlStatus() == 1) {
// 放完货的改为放货中 // 放完货的改为放货中
orderService.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getCargoControlStatus, 2).eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId())); orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getCargoControlStatus, 2)
.set(OrderDO::getReleaseNum, count)
.set(OrderDO::getReleaseRatio, new BigDecimal(count).divide(new BigDecimal(orderDO.getSumNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")))
.eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId()));
}else {
// 放完货的改为放货中
orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getReleaseNum, count)
.set(OrderDO::getReleaseRatio, new BigDecimal(count).divide(new BigDecimal(orderDO.getSumNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")))
.eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId()));
} }
} }
OrderControlLogParam controlLogParam = new OrderControlLogParam(); OrderControlLogParam controlLogParam = new OrderControlLogParam();
...@@ -1092,15 +1129,27 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo ...@@ -1092,15 +1129,27 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
String msg = ""; String msg = "";
// 避免并发修改,这里只对订单的控货状态进行修改 // 避免并发修改,这里只对订单的控货状态进行修改
if (count == 0) { if (count == 0) {
orderService.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getCargoControlStatus, 0).eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId())); orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getCargoControlStatus, 0)
.set(OrderDO::getReleaseNum, 0)
.set(OrderDO::getReleaseRatio, BigDecimal.ZERO)
.eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId()));
msg = String.format("订单放货%s箱, 取消放货审批通过, 控货状态改为控货中", orderCargoControlPickDO.getPickNum()); msg = String.format("订单放货%s箱, 取消放货审批通过, 控货状态改为控货中", orderCargoControlPickDO.getPickNum());
} }
if (count > 0) { if (count > 0) {
if (orderDO.getCargoControlStatus() == 1) { if (orderDO.getCargoControlStatus() == 1) {
// 放完货的改为放货中 // 放完货的改为放货中
orderService.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getCargoControlStatus, 2).eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId())); orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getCargoControlStatus, 2)
.set(OrderDO::getReleaseNum, count)
.set(OrderDO::getReleaseRatio, new BigDecimal(count).divide(new BigDecimal(orderDO.getSumNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")))
.eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId()));
msg = String.format("订单放货%s箱, 取消放货审批通过, 放完货的改为放货中", orderCargoControlPickDO.getPickNum()); msg = String.format("订单放货%s箱, 取消放货审批通过, 放完货的改为放货中", orderCargoControlPickDO.getPickNum());
} else { } else {
orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getReleaseNum, count)
.set(OrderDO::getReleaseRatio, new BigDecimal(count).divide(new BigDecimal(orderDO.getSumNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")))
.eq(OrderDO::getOrderId, orderCargoControlPickDO.getOrderId()));
msg = String.format("订单放货%s箱, 取消放货审批通过", orderCargoControlPickDO.getPickNum()); msg = String.format("订单放货%s箱, 取消放货审批通过", orderCargoControlPickDO.getPickNum());
} }
...@@ -1349,12 +1398,12 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo ...@@ -1349,12 +1398,12 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
OrderApprovalDO approvalDO = orderApprovalMapper.selectById(orderApprovalId); OrderApprovalDO approvalDO = orderApprovalMapper.selectById(orderApprovalId);
if (approvalDO.getDeleted() || if (approvalDO.getDeleted() ||
(approvalDO.getType() != 7 (approvalDO.getType() != 7
&& approvalDO.getType() != 8 && approvalDO.getType() != 8
&& approvalDO.getType() != 9 && approvalDO.getType() != 9
&& approvalDO.getType() != 10 && approvalDO.getType() != 10
&& approvalDO.getType() != 61 && approvalDO.getType() != 61
&& approvalDO.getType() != 62 && approvalDO.getType() != 62
&& approvalDO.getStatus() != 1)) { && approvalDO.getStatus() != 1)) {
throw exception(ORDER_APPROVAL_STATUS_NOT_CORRECT); throw exception(ORDER_APPROVAL_STATUS_NOT_CORRECT);
} }
if (Objects.isNull(approvalDO.getFormId())) { if (Objects.isNull(approvalDO.getFormId())) {
......
...@@ -380,6 +380,13 @@ public class OrderBackPageVO { ...@@ -380,6 +380,13 @@ public class OrderBackPageVO {
@ApiModelProperty(value = "'提货箱数'") @ApiModelProperty(value = "'提货箱数'")
private Integer pickNum; private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
/** /**
* 渠道名称 * 渠道名称
*/ */
...@@ -399,9 +406,6 @@ public class OrderBackPageVO { ...@@ -399,9 +406,6 @@ public class OrderBackPageVO {
@ApiModelProperty(value = "当前控货箱数") @ApiModelProperty(value = "当前控货箱数")
private BigDecimal controlWeight; private BigDecimal controlWeight;
@ApiModelProperty(value = "已放货箱数")
private Integer releaseNum;
@ApiModelProperty(value = "放货数量") @ApiModelProperty(value = "放货数量")
private Integer releaseQuantity; private Integer releaseQuantity;
......
...@@ -640,6 +640,13 @@ public class OrderBackVO { ...@@ -640,6 +640,13 @@ public class OrderBackVO {
private Integer pickNum; private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
public void setExternalWarehouseJson(String externalWarehouseJson) { public void setExternalWarehouseJson(String externalWarehouseJson) {
this.externalWarehouseJson = externalWarehouseJson; this.externalWarehouseJson = externalWarehouseJson;
if (StringUtils.isNotBlank(externalWarehouseJson)) { if (StringUtils.isNotBlank(externalWarehouseJson)) {
......
...@@ -364,6 +364,13 @@ public class OrderBaseVO { ...@@ -364,6 +364,13 @@ public class OrderBaseVO {
@ApiModelProperty(value = "'提货箱数'") @ApiModelProperty(value = "'提货箱数'")
private Integer pickNum; private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
public void setExceptionReason(String exceptionReason) { public void setExceptionReason(String exceptionReason) {
this.exceptionReason = StringUtils.isNotBlank(exceptionReason) ? I18nMessage.getMessage(exceptionReason) : exceptionReason; this.exceptionReason = StringUtils.isNotBlank(exceptionReason) ? I18nMessage.getMessage(exceptionReason) : exceptionReason;
} }
......
...@@ -553,6 +553,18 @@ public class OrderQueryVO { ...@@ -553,6 +553,18 @@ public class OrderQueryVO {
@ApiModelProperty(value = "大于等于提货率") @ApiModelProperty(value = "大于等于提货率")
private BigDecimal gePickRatio; private BigDecimal gePickRatio;
@ApiModelProperty(value = "'放货率'")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "小于等于放货率")
private BigDecimal leReleaseRatio;
@ApiModelProperty(value = "等于放货率")
private BigDecimal eqReleaseRatio;
@ApiModelProperty(value = "大于等于放货率")
private BigDecimal geReleaseRatio;
@ApiModelProperty(value = "'提货箱数'") @ApiModelProperty(value = "'提货箱数'")
private Integer pickNum; private Integer pickNum;
......
...@@ -235,6 +235,15 @@ ...@@ -235,6 +235,15 @@
<if test="query.eqPickRatio != null "> <if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio} AND o.pick_ratio = #{query.eqPickRatio}
</if> </if>
<if test="query.leReleaseRatio != null ">
AND o.release_ratio <![CDATA[ <= ]]> #{query.leReleaseRatio}
</if>
<if test="query.geReleaseRatio != null ">
AND o.release_ratio <![CDATA[ >= ]]> #{geReleaseRatio}
</if>
<if test="query.eqReleaseRatio != null ">
AND o.release_ratio = #{eqReleaseRatio}
</if>
<if test="query.searchKey != null and query.searchKey != '' "> <if test="query.searchKey != null and query.searchKey != '' ">
AND concat(IFNULL(o.`order_no`,''),IFNULL(o.`parent_number`,''),IFNULL(o.`initial_parent_order_no`,''), AND concat(IFNULL(o.`order_no`,''),IFNULL(o.`parent_number`,''),IFNULL(o.`initial_parent_order_no`,''),
IFNULL(o.`old_numbers`,''),IFNULL(o.`marks`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like IFNULL(o.`old_numbers`,''),IFNULL(o.`marks`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like
...@@ -560,6 +569,15 @@ ...@@ -560,6 +569,15 @@
<if test="query.eqPickRatio != null "> <if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio} AND o.pick_ratio = #{query.eqPickRatio}
</if> </if>
<if test="query.leReleaseRatio != null ">
AND o.release_ratio <![CDATA[ <= ]]> #{query.leReleaseRatio}
</if>
<if test="query.geReleaseRatio != null ">
AND o.release_ratio <![CDATA[ >= ]]> #{geReleaseRatio}
</if>
<if test="query.eqReleaseRatio != null ">
AND o.release_ratio = #{eqReleaseRatio}
</if>
<if test="query.searchKey != null and query.searchKey != '' "> <if test="query.searchKey != null and query.searchKey != '' ">
AND concat(IFNULL(o.`order_no`,''),IFNULL(o.`parent_number`,''),IFNULL(o.`initial_parent_order_no`,''), AND concat(IFNULL(o.`order_no`,''),IFNULL(o.`parent_number`,''),IFNULL(o.`initial_parent_order_no`,''),
IFNULL(o.`old_numbers`,''),IFNULL(o.`marks`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like IFNULL(o.`old_numbers`,''),IFNULL(o.`marks`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like
...@@ -885,6 +903,15 @@ ...@@ -885,6 +903,15 @@
<if test="query.eqPickRatio != null "> <if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio} AND o.pick_ratio = #{query.eqPickRatio}
</if> </if>
<if test="query.leReleaseRatio != null ">
AND o.release_ratio <![CDATA[ <= ]]> #{query.leReleaseRatio}
</if>
<if test="query.geReleaseRatio != null ">
AND o.release_ratio <![CDATA[ >= ]]> #{geReleaseRatio}
</if>
<if test="query.eqReleaseRatio != null ">
AND o.release_ratio = #{eqReleaseRatio}
</if>
<if test="query.searchKey != null and query.searchKey != '' "> <if test="query.searchKey != null and query.searchKey != '' ">
AND concat(IFNULL(o.`order_no`,''),IFNULL(o.`parent_number`,''),IFNULL(o.`initial_parent_order_no`,''), AND concat(IFNULL(o.`order_no`,''),IFNULL(o.`parent_number`,''),IFNULL(o.`initial_parent_order_no`,''),
IFNULL(o.`old_numbers`,''),IFNULL(o.`marks`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like IFNULL(o.`old_numbers`,''),IFNULL(o.`marks`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like
...@@ -1197,8 +1224,10 @@ ...@@ -1197,8 +1224,10 @@
o.audit_result, o.audit_result,
o.guan_lian_order_status, o.guan_lian_order_status,
o.transport_id, o.transport_id,
(select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and -- (select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
ccp.status in(1,2,3,4) ) as release_num, -- ccp.status in(1,2,3,4) ) as release_num,
o.release_num,
o.release_ratio,
o.is_cargo_control, o.is_cargo_control,
o.cargo_control_status, o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num, o.cost ->> '$.totalNum' as total_num,
...@@ -1340,8 +1369,10 @@ ...@@ -1340,8 +1369,10 @@
o.audit_result, o.audit_result,
o.guan_lian_order_status, o.guan_lian_order_status,
o.transport_id, o.transport_id,
(select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and -- (select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
ccp.status in(1,2,3,4) ) as release_num, -- ccp.status in(1,2,3,4) ) as release_num,
o.release_num,
o.release_ratio,
o.is_cargo_control, o.is_cargo_control,
o.cargo_control_status, o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num, o.cost ->> '$.totalNum' as total_num,
...@@ -2054,6 +2085,15 @@ ...@@ -2054,6 +2085,15 @@
<if test="query.eqPickRatio != null "> <if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio} AND o.pick_ratio = #{query.eqPickRatio}
</if> </if>
<if test="query.leReleaseRatio != null ">
AND o.release_ratio <![CDATA[ <= ]]> #{query.leReleaseRatio}
</if>
<if test="query.geReleaseRatio != null ">
AND o.release_ratio <![CDATA[ >= ]]> #{geReleaseRatio}
</if>
<if test="query.eqReleaseRatio != null ">
AND o.release_ratio = #{eqReleaseRatio}
</if>
<if test="query.searchKey != null and query.searchKey != '' "> <if test="query.searchKey != null and query.searchKey != '' ">
AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'') AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'')
,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like
...@@ -2797,6 +2837,15 @@ ...@@ -2797,6 +2837,15 @@
<if test="query.eqPickRatio != null "> <if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio} AND o.pick_ratio = #{query.eqPickRatio}
</if> </if>
<if test="query.leReleaseRatio != null ">
AND o.release_ratio <![CDATA[ <= ]]> #{query.leReleaseRatio}
</if>
<if test="query.geReleaseRatio != null ">
AND o.release_ratio <![CDATA[ >= ]]> #{geReleaseRatio}
</if>
<if test="query.eqReleaseRatio != null ">
AND o.release_ratio = #{eqReleaseRatio}
</if>
<if test="query.searchKey != null and query.searchKey != '' "> <if test="query.searchKey != null and query.searchKey != '' ">
AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'') AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'')
,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like
...@@ -3516,6 +3565,15 @@ ...@@ -3516,6 +3565,15 @@
<if test="query.eqPickRatio != null "> <if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio} AND o.pick_ratio = #{query.eqPickRatio}
</if> </if>
<if test="query.leReleaseRatio != null ">
AND o.release_ratio <![CDATA[ <= ]]> #{query.leReleaseRatio}
</if>
<if test="query.geReleaseRatio != null ">
AND o.release_ratio <![CDATA[ >= ]]> #{geReleaseRatio}
</if>
<if test="query.eqReleaseRatio != null ">
AND o.release_ratio = #{eqReleaseRatio}
</if>
<if test="query.searchKey != null and query.searchKey != '' "> <if test="query.searchKey != null and query.searchKey != '' ">
AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'') AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'')
,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like
...@@ -3752,8 +3810,10 @@ ...@@ -3752,8 +3810,10 @@
o.audit_result, o.audit_result,
o.guan_lian_order_status, o.guan_lian_order_status,
o.transport_id, o.transport_id,
(select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and -- (select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
ccp.status in(1,2,3,4) ) as release_num, -- ccp.status in(1,2,3,4) ) as release_num,
o.release_num,
o.release_ratio,
o.is_cargo_control, o.is_cargo_control,
o.cargo_control_status, o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num, o.cost ->> '$.totalNum' as total_num,
...@@ -3876,8 +3936,10 @@ ...@@ -3876,8 +3936,10 @@
o.audit_result, o.audit_result,
o.guan_lian_order_status, o.guan_lian_order_status,
o.transport_id, o.transport_id,
(select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and -- (select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
ccp.status in(1,2,3,4) ) as release_num, -- ccp.status in(1,2,3,4) ) as release_num,
o.release_num,
o.release_ratio,
o.is_cargo_control, o.is_cargo_control,
o.cargo_control_status, o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num, o.cost ->> '$.totalNum' as total_num,
...@@ -4026,8 +4088,10 @@ ...@@ -4026,8 +4088,10 @@
o.audit_result, o.audit_result,
o.guan_lian_order_status, o.guan_lian_order_status,
o.transport_id, o.transport_id,
(select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and -- (select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
ccp.status in(1,2,3,4) ) as release_num, -- ccp.status in(1,2,3,4) ) as release_num,
o.release_num,
o.release_ratio,
o.is_cargo_control, o.is_cargo_control,
o.cargo_control_status, o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num, o.cost ->> '$.totalNum' as total_num,
...@@ -4158,8 +4222,10 @@ ...@@ -4158,8 +4222,10 @@
o.audit_result, o.audit_result,
o.guan_lian_order_status, o.guan_lian_order_status,
o.transport_id, o.transport_id,
(select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and -- (select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
ccp.status in(1,2,3,4) ) as release_num, -- ccp.status in(1,2,3,4) ) as release_num,
o.release_num,
o.release_ratio,
o.is_cargo_control, o.is_cargo_control,
o.cargo_control_status, o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num, o.cost ->> '$.totalNum' as total_num,
...@@ -4264,8 +4330,10 @@ ...@@ -4264,8 +4330,10 @@
o.audit_result, o.audit_result,
o.guan_lian_order_status, o.guan_lian_order_status,
o.transport_id, o.transport_id,
(select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and -- (select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
ccp.status in(1,2,3,4) ) as release_num, -- ccp.status in(1,2,3,4) ) as release_num,
o.release_num,
o.release_ratio,
o.is_cargo_control, o.is_cargo_control,
o.cargo_control_status, o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num, o.cost ->> '$.totalNum' as total_num,
...@@ -4363,8 +4431,10 @@ ...@@ -4363,8 +4431,10 @@
<select id="appCargoControlOrderList" resultType="cn.iocoder.yudao.module.order.vo.order.OrderBackPageVO"> <select id="appCargoControlOrderList" resultType="cn.iocoder.yudao.module.order.vo.order.OrderBackPageVO">
select select
o.order_id, o.order_id,
(select ifnull(sum(ccp1.pick_num),0) from ecw_order_cargo_control_pick ccp1 where ccp1.order_id = o.order_id and -- (select ifnull(sum(ccp1.pick_num),0) from ecw_order_cargo_control_pick ccp1 where ccp1.order_id = o.order_id and
ccp1.status in(1,2,3,4,5,6) ) as release_num, -- ccp1.status in(1,2,3,4,5,6) ) as release_num,
o.release_num,
o.release_ratio,
o.number, o.number,
o.order_no, o.order_no,
o.tidan_no, o.tidan_no,
...@@ -4793,6 +4863,15 @@ ...@@ -4793,6 +4863,15 @@
<if test="query.eqPickRatio != null "> <if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio} AND o.pick_ratio = #{query.eqPickRatio}
</if> </if>
<if test="query.leReleaseRatio != null ">
AND o.release_ratio <![CDATA[ <= ]]> #{query.leReleaseRatio}
</if>
<if test="query.geReleaseRatio != null ">
AND o.release_ratio <![CDATA[ >= ]]> #{geReleaseRatio}
</if>
<if test="query.eqReleaseRatio != null ">
AND o.release_ratio = #{eqReleaseRatio}
</if>
<if test="query.searchKey != null and query.searchKey != '' "> <if test="query.searchKey != null and query.searchKey != '' ">
AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'') AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'')
,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like
...@@ -5047,8 +5126,8 @@ ...@@ -5047,8 +5126,8 @@
from ( from (
select select
o.*, o.*,
(select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and -- (select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
ccp.status in(1,2,3,4) ) as release_num, -- ccp.status in(1,2,3,4) ) as release_num,
occ.`name` as cargo_control_name, occ.`name` as cargo_control_name,
occ.dial_code as cargo_control_country_code, occ.dial_code as cargo_control_country_code,
occ.phone as cargo_control_phone, occ.phone as cargo_control_phone,
...@@ -5170,6 +5249,15 @@ ...@@ -5170,6 +5249,15 @@
<if test="query.eqPickRatio != null "> <if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio} AND o.pick_ratio = #{query.eqPickRatio}
</if> </if>
<if test="query.leReleaseRatio != null ">
AND o.release_ratio <![CDATA[ <= ]]> #{query.leReleaseRatio}
</if>
<if test="query.geReleaseRatio != null ">
AND o.release_ratio <![CDATA[ >= ]]> #{geReleaseRatio}
</if>
<if test="query.eqReleaseRatio != null ">
AND o.release_ratio = #{eqReleaseRatio}
</if>
<if test="query.searchKey != null and query.searchKey != '' "> <if test="query.searchKey != null and query.searchKey != '' ">
AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'') AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'')
,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like
...@@ -5270,8 +5358,10 @@ ...@@ -5270,8 +5358,10 @@
from ( from (
select select
o.*, o.*,
(select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and -- (select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
ccp.status in(1,2,3,4) ) as release_num, -- ccp.status in(1,2,3,4) ) as release_num,
o.release_num,
o.release_ratio,
occ.`name` as cargo_control_name, occ.`name` as cargo_control_name,
occ.dial_code as cargo_control_country_code, occ.dial_code as cargo_control_country_code,
occ.phone as cargo_control_phone, occ.phone as cargo_control_phone,
...@@ -5393,6 +5483,15 @@ ...@@ -5393,6 +5483,15 @@
<if test="query.eqPickRatio != null "> <if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio} AND o.pick_ratio = #{query.eqPickRatio}
</if> </if>
<if test="query.leReleaseRatio != null ">
AND o.release_ratio <![CDATA[ <= ]]> #{query.leReleaseRatio}
</if>
<if test="query.geReleaseRatio != null ">
AND o.release_ratio <![CDATA[ >= ]]> #{geReleaseRatio}
</if>
<if test="query.eqReleaseRatio != null ">
AND o.release_ratio = #{eqReleaseRatio}
</if>
<if test="query.searchKey != null and query.searchKey != '' "> <if test="query.searchKey != null and query.searchKey != '' ">
AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'') AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,'')
,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like ,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like
......
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