Merge remote-tracking branch 'origin/dev_WMS20260401' into dev_WMS20260401
This commit is contained in:
+67
-5
@@ -1,5 +1,6 @@
|
|||||||
package com.mhd.wms.application.service.deliveTask;
|
package com.mhd.wms.application.service.deliveTask;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.mhd.common.core.utils.StringUtils;
|
import com.mhd.common.core.utils.StringUtils;
|
||||||
import com.mhd.common.security.utils.SecurityUtils;
|
import com.mhd.common.security.utils.SecurityUtils;
|
||||||
import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO;
|
import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO;
|
||||||
@@ -9,11 +10,17 @@ import com.mhd.wms.domain.deliveTask.repository.po.DeliveTaskPO;
|
|||||||
import com.mhd.wms.domain.deliveTask.repository.po.DeliveTaskSumPO;
|
import com.mhd.wms.domain.deliveTask.repository.po.DeliveTaskSumPO;
|
||||||
import com.mhd.wms.domain.deliveTask.repository.todo.DeliveTaskDO;
|
import com.mhd.wms.domain.deliveTask.repository.todo.DeliveTaskDO;
|
||||||
import com.mhd.wms.domain.deliveTask.service.DeliveTaskDomainService;
|
import com.mhd.wms.domain.deliveTask.service.DeliveTaskDomainService;
|
||||||
|
import com.mhd.wms.domain.stockOutTaskOrder.entity.StockOutTaskOrder;
|
||||||
|
import com.mhd.wms.domain.stockOutTaskOrder.repository.facade.IStockOutTaskOrderService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下发任务ApplicationService
|
* 下发任务ApplicationService
|
||||||
@@ -27,6 +34,9 @@ public class DeliveTaskApplicationService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DeliveTaskDomainService deliveTaskDomainService;
|
private DeliveTaskDomainService deliveTaskDomainService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStockOutTaskOrderService stockOutTaskOrderService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询下发任务列表
|
* 分页查询下发任务列表
|
||||||
@@ -62,13 +72,65 @@ public class DeliveTaskApplicationService {
|
|||||||
}
|
}
|
||||||
// 不按 task_status 默认过滤;若请求传入 taskStatus 则仍可按状态筛选
|
// 不按 task_status 默认过滤;若请求传入 taskStatus 则仍可按状态筛选
|
||||||
List<DeliveTaskPO> list = deliveTaskDomainService.queryListApp(deliveTaskDO);
|
List<DeliveTaskPO> list = deliveTaskDomainService.queryListApp(deliveTaskDO);
|
||||||
// PDA 列表展示业务单号:task_number 存 RW* 任务流水,tracking_number 为收货/上架/拣货等来源单号
|
applyPdaListDisplayTaskNumber(list);
|
||||||
list.forEach(po -> {
|
return list;
|
||||||
if (po != null && StringUtils.isNotBlank(po.getTrackingNumber())) {
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PDA 列表展示业务单号:库表 task_number 为 RW* 下发流水;tracking_number 为关联业务单号。
|
||||||
|
* 拣货(taskType=3) tracking 存 JHZY* 作业单号(接收任务用),展示时反查 JH* 拣货单号,与收货/上架/复核口径一致。
|
||||||
|
*/
|
||||||
|
private void applyPdaListDisplayTaskNumber(List<DeliveTaskPO> list) {
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<String> pickingTaskNumbers = list.stream()
|
||||||
|
.filter(po -> po != null && Integer.valueOf(3).equals(po.getTaskType()))
|
||||||
|
.map(DeliveTaskPO::getTrackingNumber)
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<String, String> pickingOrderNumberByTaskNumber = resolvePickingOrderNumberByTaskNumber(pickingTaskNumbers);
|
||||||
|
for (DeliveTaskPO po : list) {
|
||||||
|
if (po == null || StringUtils.isBlank(po.getTrackingNumber())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (Integer.valueOf(3).equals(po.getTaskType())) {
|
||||||
|
String pickingOrderNumber = pickingOrderNumberByTaskNumber.get(po.getTrackingNumber());
|
||||||
|
po.setTaskNumber(StringUtils.isNotBlank(pickingOrderNumber)
|
||||||
|
? pickingOrderNumber
|
||||||
|
: po.getTrackingNumber());
|
||||||
|
} else {
|
||||||
po.setTaskNumber(po.getTrackingNumber());
|
po.setTaskNumber(po.getTrackingNumber());
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
return list;
|
}
|
||||||
|
|
||||||
|
/** 按 JHZY* 作业单号批量解析 JH* 拣货单号 */
|
||||||
|
private Map<String, String> resolvePickingOrderNumberByTaskNumber(List<String> taskNumbers) {
|
||||||
|
if (CollectionUtils.isEmpty(taskNumbers)) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
List<StockOutTaskOrder> rows = stockOutTaskOrderService.list(new LambdaQueryWrapper<StockOutTaskOrder>()
|
||||||
|
.in(StockOutTaskOrder::getTaskNumber, taskNumbers)
|
||||||
|
.eq(StockOutTaskOrder::getDelFlag, 1));
|
||||||
|
if (CollectionUtils.isEmpty(rows)) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
return rows.stream()
|
||||||
|
.filter(row -> StringUtils.isNotBlank(row.getTaskNumber()))
|
||||||
|
.collect(Collectors.toMap(
|
||||||
|
StockOutTaskOrder::getTaskNumber,
|
||||||
|
row -> normalizePickingOrderNumber(row),
|
||||||
|
(a, b) -> a));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String normalizePickingOrderNumber(StockOutTaskOrder row) {
|
||||||
|
String pickingOrderNumber = row.getPickingOrderNumber();
|
||||||
|
if (StringUtils.isNotBlank(pickingOrderNumber) && pickingOrderNumber.startsWith("JH")) {
|
||||||
|
return pickingOrderNumber;
|
||||||
|
}
|
||||||
|
return row.getTaskNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+3
@@ -159,4 +159,7 @@ public class PickingOrderPO extends StockOutOrderBasePO {
|
|||||||
|
|
||||||
@ApiModelProperty("推送人姓名")
|
@ApiModelProperty("推送人姓名")
|
||||||
private String pushByName;
|
private String pushByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否报关")
|
||||||
|
private String needDeclareFlag;
|
||||||
}
|
}
|
||||||
+3
@@ -206,4 +206,7 @@ public class PickingOrderDO extends BaseVOEntity {
|
|||||||
|
|
||||||
@ApiModelProperty("推送人姓名")
|
@ApiModelProperty("推送人姓名")
|
||||||
private String pushByName;
|
private String pushByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否报关")
|
||||||
|
private String needDeclareFlag;
|
||||||
}
|
}
|
||||||
+3
@@ -139,4 +139,7 @@ public class StockShelfOrderPO extends StockInOrderBasePO {
|
|||||||
@Excel(name = "批次号")
|
@Excel(name = "批次号")
|
||||||
private String batchNo;
|
private String batchNo;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("是否报关")
|
||||||
|
private Long needCustomsDeclaration;
|
||||||
}
|
}
|
||||||
+4
@@ -151,4 +151,8 @@ public class StockShelfOrderDO extends StockInOrderBaseDO {
|
|||||||
@ApiModelProperty("批次号")
|
@ApiModelProperty("批次号")
|
||||||
@Excel(name = "批次号")
|
@Excel(name = "批次号")
|
||||||
private String batchNo;
|
private String batchNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否报关")
|
||||||
|
private Long needCustomsDeclaration;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -174,4 +174,7 @@ public class PickingOrderDTO extends BaseVOEntity {
|
|||||||
|
|
||||||
@ApiModelProperty("推送人姓名")
|
@ApiModelProperty("推送人姓名")
|
||||||
private String pushByName;
|
private String pushByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否报关")
|
||||||
|
private String needDeclareFlag;
|
||||||
}
|
}
|
||||||
+3
@@ -140,4 +140,7 @@ public class StockShelfOrderDTO extends StockInOrderBaseDTO {
|
|||||||
@ApiModelProperty("批次号")
|
@ApiModelProperty("批次号")
|
||||||
@Excel(name = "批次号")
|
@Excel(name = "批次号")
|
||||||
private String batchNo;
|
private String batchNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否报关")
|
||||||
|
private Long needCustomsDeclaration;
|
||||||
}
|
}
|
||||||
@@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="orderTypeName" column="order_type_name" />
|
<result property="orderTypeName" column="order_type_name" />
|
||||||
<result property="priorityLevelCode" column="priority_level_code" />
|
<result property="priorityLevelCode" column="priority_level_code" />
|
||||||
<result property="priorityLevelName" column="priority_level_name" />
|
<result property="priorityLevelName" column="priority_level_name" />
|
||||||
|
<result property="needDeclareFlag" column="need_declare_flag" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
@@ -108,12 +109,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
|
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
|
||||||
<otherwise> and a.del_flag = 1 </otherwise>
|
<otherwise> and a.del_flag = 1 </otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
|
<if test="needDeclareFlag != null and needDeclareFlag != ''">
|
||||||
|
and b.need_declare_flag = #{needDeclareFlag}
|
||||||
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="queryList" parameterType="com.mhd.wms.domain.pickingOrder.repository.todo.PickingOrderDO" resultMap="PickingOrderResult">
|
<select id="queryList" parameterType="com.mhd.wms.domain.pickingOrder.repository.todo.PickingOrderDO" resultMap="PickingOrderResult">
|
||||||
select
|
select
|
||||||
<include refid="selectPickingOrderPo"/>
|
<include refid="selectPickingOrderPo"/>
|
||||||
|
,b.need_Declare_Flag
|
||||||
from picking_order a
|
from picking_order a
|
||||||
|
left join STOCK_OUT_ORDER b ON a.order_number = b.out_Order_number
|
||||||
<where>
|
<where>
|
||||||
<include refid="selectPickingOrderPo1"/>
|
<include refid="selectPickingOrderPo1"/>
|
||||||
</where>
|
</where>
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
,b.notice_number, b.warehouse_id, b.warehouse_code, b.warehouse_name, b.shipper_id, b.shipper_code, b.shipper_name,
|
,b.notice_number, b.warehouse_id, b.warehouse_code, b.warehouse_name, b.shipper_id, b.shipper_code, b.shipper_name,
|
||||||
b.order_type_code, b.order_type_name, b.supplier_id, b.supplier_code, b.supplier_name, b.expect_time, b.supply_chain_number, b.priority_level_code,
|
b.order_type_code, b.order_type_name, b.supplier_id, b.supplier_code, b.supplier_name, b.expect_time, b.supply_chain_number, b.priority_level_code,
|
||||||
b.priority_level_name, b.direct_warehouse, b.annex_url, b.material_quantity as in_order_material_quantity, b.quantity as in_order_quantity
|
b.priority_level_name, b.direct_warehouse, b.annex_url, b.material_quantity as in_order_material_quantity, b.quantity as in_order_quantity
|
||||||
|
,b.NEED_CUSTOMS_DECLARATION
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="joinStockInOrderPoWhere">
|
<sql id="joinStockInOrderPoWhere">
|
||||||
@@ -195,6 +196,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="quantity != null ">
|
<if test="quantity != null ">
|
||||||
and b.quantity = #{quantity}
|
and b.quantity = #{quantity}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="needCustomsDeclaration != null ">
|
||||||
|
and b.need_customs_declaration = #{needCustomsDeclaration}
|
||||||
|
</if>
|
||||||
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="selectStockInOrderPo1">
|
<sql id="selectStockInOrderPo1">
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
|
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
|
||||||
<otherwise> and a.del_flag = 1 </otherwise>
|
<otherwise> and a.del_flag = 1 </otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="joinStockReceiptOrderWhere">
|
<sql id="joinStockReceiptOrderWhere">
|
||||||
|
|||||||
Reference in New Issue
Block a user