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 {
@ApiModelProperty(value = "提货状态:0 未提货 1 部分提货 2 已提货")
private Integer pickState;
@ApiModelProperty(value = "'提货率'")
@ApiModelProperty(value = "提货率")
private BigDecimal pickRatio;
@ApiModelProperty(value = "'提货箱数'")
@ApiModelProperty(value = "提货箱数")
private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
@TableField(exist = false)
@ApiModelProperty(value = "订单商品项列表")
@NotNull(message = "订单商品项列表不能为空")
......
......@@ -539,6 +539,13 @@ public class OrderBackInfoDto {
@ApiModelProperty(value = "'提货箱数'")
private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
public void setExceptionReason(String exceptionReason) {
this.exceptionReason = exceptionReason;
if (StringUtils.isNotBlank(exceptionReason) && Objects.nonNull(this.lang)) {
......
......@@ -148,7 +148,7 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
.eq(OrderApprovalDO::getType, 61)
.eq(OrderApprovalDO::getStatus, 1)
);
if (limitUpdateCount > 0){
if (limitUpdateCount > 0) {
throw exception(ORDER_CARGO_CONTROL_CONSIGNEE_LIMIT_UPDATE_APPLYING);
}
long overseasWarehouseUpdateCount = orderApprovalMapper.selectCount(new LambdaQueryWrapper<OrderApprovalDO>()
......@@ -156,7 +156,7 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
.eq(OrderApprovalDO::getType, 62)
.eq(OrderApprovalDO::getStatus, 1)
);
if (overseasWarehouseUpdateCount > 0){
if (overseasWarehouseUpdateCount > 0) {
throw exception(ORDER_CARGO_CONTROL_OVERSEAS_WAREHOUSE_UPDATE_APPLYING);
}
//不能大于总箱数
......@@ -164,17 +164,17 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
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);
}
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());
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);
}
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);
}
}
......@@ -320,6 +320,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
orderCargoControlPick.getConsigneeName() + "/" + (StringUtils.isNotBlank(orderCargoControlPick.getConsigneeNameEn()) ? orderCargoControlPick.getConsigneeNameEn() : "空"),
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);
// 订单控货信息日志补充
orderBusinessService.createOrderControlLog(orderCargoControlPick.getOrderId(), 4, "订单放货", msg, 0L);
......@@ -419,15 +421,24 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
// TODO 修改订单控货状态
String msg = "";
Integer releaseNum = orderDO.getReleaseNum() + 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(),
orderCargoControlPick.getConsigneeName() + "/" + (StringUtils.isNotBlank(orderCargoControlPick.getConsigneeNameEn()) ? orderCargoControlPick.getConsigneeNameEn() : "空"),
orderCargoControlPick.getConsigneeCountryCode() + orderCargoControlPick.getConsigneePhone());
} 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(),
orderCargoControlPick.getConsigneeName() + "/" + (StringUtils.isNotBlank(orderCargoControlPick.getConsigneeNameEn()) ? orderCargoControlPick.getConsigneeNameEn() : "空"),
orderCargoControlPick.getConsigneeCountryCode() + orderCargoControlPick.getConsigneePhone());
......@@ -964,17 +975,29 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
Integer releasePickNum = orderCargoControlPickApplyVO.getCurrentPickNum() + pickNum;
if (releasePickNum == 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(", 订单控货中");
}
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(", 订单部分控货中");
}
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(", 订单已放完货");
}
OrderControlLogParam param = new OrderControlLogParam();
......@@ -1063,12 +1086,26 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
.eq(OrderCargoControlPickDO::getDeleted, false));
// 避免并发修改,这里只对订单的控货状态进行修改
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 (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();
......@@ -1092,15 +1129,27 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
String msg = "";
// 避免并发修改,这里只对订单的控货状态进行修改
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());
}
if (count > 0) {
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());
} 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());
}
......
......@@ -380,6 +380,13 @@ public class OrderBackPageVO {
@ApiModelProperty(value = "'提货箱数'")
private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
/**
* 渠道名称
*/
......@@ -399,9 +406,6 @@ public class OrderBackPageVO {
@ApiModelProperty(value = "当前控货箱数")
private BigDecimal controlWeight;
@ApiModelProperty(value = "已放货箱数")
private Integer releaseNum;
@ApiModelProperty(value = "放货数量")
private Integer releaseQuantity;
......
......@@ -640,6 +640,13 @@ public class OrderBackVO {
private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
public void setExternalWarehouseJson(String externalWarehouseJson) {
this.externalWarehouseJson = externalWarehouseJson;
if (StringUtils.isNotBlank(externalWarehouseJson)) {
......
......@@ -364,6 +364,13 @@ public class OrderBaseVO {
@ApiModelProperty(value = "'提货箱数'")
private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
public void setExceptionReason(String exceptionReason) {
this.exceptionReason = StringUtils.isNotBlank(exceptionReason) ? I18nMessage.getMessage(exceptionReason) : exceptionReason;
}
......
......@@ -553,6 +553,18 @@ public class OrderQueryVO {
@ApiModelProperty(value = "大于等于提货率")
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 = "'提货箱数'")
private Integer pickNum;
......
......@@ -235,6 +235,15 @@
<if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio}
</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 != '' ">
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
......@@ -560,6 +569,15 @@
<if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio}
</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 != '' ">
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
......@@ -885,6 +903,15 @@
<if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio}
</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 != '' ">
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
......@@ -1197,8 +1224,10 @@
o.audit_result,
o.guan_lian_order_status,
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
ccp.status in(1,2,3,4) ) as release_num,
-- (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,
o.release_num,
o.release_ratio,
o.is_cargo_control,
o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num,
......@@ -1340,8 +1369,10 @@
o.audit_result,
o.guan_lian_order_status,
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
ccp.status in(1,2,3,4) ) as release_num,
-- (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,
o.release_num,
o.release_ratio,
o.is_cargo_control,
o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num,
......@@ -2054,6 +2085,15 @@
<if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio}
</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 != '' ">
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
......@@ -2797,6 +2837,15 @@
<if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio}
</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 != '' ">
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
......@@ -3516,6 +3565,15 @@
<if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio}
</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 != '' ">
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
......@@ -3752,8 +3810,10 @@
o.audit_result,
o.guan_lian_order_status,
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
ccp.status in(1,2,3,4) ) as release_num,
-- (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,
o.release_num,
o.release_ratio,
o.is_cargo_control,
o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num,
......@@ -3876,8 +3936,10 @@
o.audit_result,
o.guan_lian_order_status,
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
ccp.status in(1,2,3,4) ) as release_num,
-- (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,
o.release_num,
o.release_ratio,
o.is_cargo_control,
o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num,
......@@ -4026,8 +4088,10 @@
o.audit_result,
o.guan_lian_order_status,
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
ccp.status in(1,2,3,4) ) as release_num,
-- (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,
o.release_num,
o.release_ratio,
o.is_cargo_control,
o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num,
......@@ -4158,8 +4222,10 @@
o.audit_result,
o.guan_lian_order_status,
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
ccp.status in(1,2,3,4) ) as release_num,
-- (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,
o.release_num,
o.release_ratio,
o.is_cargo_control,
o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num,
......@@ -4264,8 +4330,10 @@
o.audit_result,
o.guan_lian_order_status,
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
ccp.status in(1,2,3,4) ) as release_num,
-- (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,
o.release_num,
o.release_ratio,
o.is_cargo_control,
o.cargo_control_status,
o.cost ->> '$.totalNum' as total_num,
......@@ -4363,8 +4431,10 @@
<select id="appCargoControlOrderList" resultType="cn.iocoder.yudao.module.order.vo.order.OrderBackPageVO">
select
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
ccp1.status in(1,2,3,4,5,6) ) as release_num,
-- (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,
o.release_num,
o.release_ratio,
o.number,
o.order_no,
o.tidan_no,
......@@ -4793,6 +4863,15 @@
<if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio}
</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 != '' ">
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
......@@ -5047,8 +5126,8 @@
from (
select
o.*,
(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,
-- (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,
occ.`name` as cargo_control_name,
occ.dial_code as cargo_control_country_code,
occ.phone as cargo_control_phone,
......@@ -5170,6 +5249,15 @@
<if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio}
</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 != '' ">
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
......@@ -5270,8 +5358,10 @@
from (
select
o.*,
(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,
-- (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,
o.release_num,
o.release_ratio,
occ.`name` as cargo_control_name,
occ.dial_code as cargo_control_country_code,
occ.phone as cargo_control_phone,
......@@ -5393,6 +5483,15 @@
<if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio}
</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 != '' ">
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
......
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