PDA任务大厅修改
This commit is contained in:
+17
-8
@@ -45,10 +45,7 @@ public class DeliveTaskApplicationService {
|
|||||||
public List<DeliveTaskPO> queryListApp(DeliveTaskDO deliveTaskDO) {
|
public List<DeliveTaskPO> queryListApp(DeliveTaskDO deliveTaskDO) {
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
if (loginUser != null){
|
if (loginUser != null){
|
||||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
applyPdaOrganizationScope(deliveTaskDO, loginUser);
|
||||||
if (topOrganizationId != null && topOrganizationId != 1){
|
|
||||||
deliveTaskDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
|
||||||
}
|
|
||||||
applyPdaWarehouseScope(deliveTaskDO, loginUser);
|
applyPdaWarehouseScope(deliveTaskDO, loginUser);
|
||||||
Long tabType = deliveTaskDO.getTabType();
|
Long tabType = deliveTaskDO.getTabType();
|
||||||
if (tabType != null && tabType == 1L) {
|
if (tabType != null && tabType == 1L) {
|
||||||
@@ -113,16 +110,28 @@ public class DeliveTaskApplicationService {
|
|||||||
public DeliveTaskPO querySum(DeliveTaskDO deliveTaskDO) {
|
public DeliveTaskPO querySum(DeliveTaskDO deliveTaskDO) {
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
if (loginUser != null){
|
if (loginUser != null){
|
||||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
applyPdaOrganizationScope(deliveTaskDO, loginUser);
|
||||||
if (topOrganizationId != null && topOrganizationId != 1){
|
|
||||||
deliveTaskDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
|
||||||
deliveTaskDO.setOperatorsBy(loginUser.getUserid());
|
deliveTaskDO.setOperatorsBy(loginUser.getUserid());
|
||||||
}
|
|
||||||
applyPdaWarehouseScope(deliveTaskDO, loginUser);
|
applyPdaWarehouseScope(deliveTaskDO, loginUser);
|
||||||
}
|
}
|
||||||
return deliveTaskDomainService.querySum(deliveTaskDO);
|
return deliveTaskDomainService.querySum(deliveTaskDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PDA:按当前用户 organization_id 过滤(与 delive_task.organization_id 一致);
|
||||||
|
* 平台超管(topOrganizationId=1) 不按组织过滤。
|
||||||
|
*/
|
||||||
|
private static void applyPdaOrganizationScope(DeliveTaskDO deliveTaskDO, LoginUser loginUser) {
|
||||||
|
if (loginUser.getUserPo() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||||
|
if (topOrganizationId != null && topOrganizationId != 1) {
|
||||||
|
deliveTaskDO.setTopOrganizationId(null);
|
||||||
|
deliveTaskDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** PDA:按用户绑定仓库过滤任务(与收货/上架等 App 列表一致) */
|
/** PDA:按用户绑定仓库过滤任务(与收货/上架等 App 列表一致) */
|
||||||
private static void applyPdaWarehouseScope(DeliveTaskDO deliveTaskDO, LoginUser loginUser) {
|
private static void applyPdaWarehouseScope(DeliveTaskDO deliveTaskDO, LoginUser loginUser) {
|
||||||
if (deliveTaskDO.getWarehouseId() != null) {
|
if (deliveTaskDO.getWarehouseId() != null) {
|
||||||
|
|||||||
+6
@@ -183,6 +183,12 @@ public class DeliveTaskImpl extends ServiceImpl<DeliveTaskMapper, DeliveTask> im
|
|||||||
for (DeliveTaskDO deliveTaskDO : deliveTaskDOList){
|
for (DeliveTaskDO deliveTaskDO : deliveTaskDOList){
|
||||||
DeliveTask deliveTask = new DeliveTask();
|
DeliveTask deliveTask = new DeliveTask();
|
||||||
BeanUtils.copyProperties(deliveTaskDO,deliveTask);
|
BeanUtils.copyProperties(deliveTaskDO,deliveTask);
|
||||||
|
if (deliveTask.getTaskStatus() == null) {
|
||||||
|
deliveTask.setTaskStatus(0);
|
||||||
|
}
|
||||||
|
if (deliveTask.getDelFlag() == null) {
|
||||||
|
deliveTask.setDelFlag(1);
|
||||||
|
}
|
||||||
deliveTaskList.add(deliveTask);
|
deliveTaskList.add(deliveTask);
|
||||||
NoticeMessageLoggingDto noticeMessageLoggingDto = new NoticeMessageLoggingDto();
|
NoticeMessageLoggingDto noticeMessageLoggingDto = new NoticeMessageLoggingDto();
|
||||||
noticeMessageLoggingDto.setUserId(deliveTaskDO.getOperatorsBy());
|
noticeMessageLoggingDto.setUserId(deliveTaskDO.getOperatorsBy());
|
||||||
|
|||||||
+2
-2
@@ -31,8 +31,8 @@ public class DeliveTaskAppApi extends BaseController {
|
|||||||
private DeliveTaskAssembler deliveTaskAssembler;
|
private DeliveTaskAssembler deliveTaskAssembler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询下发任务列表。条件:del_flag=1、当前一级组织、绑定仓库(未传 warehouseId 时取用户仓库绑定)、
|
* 分页查询下发任务列表。条件:del_flag=1、当前用户 organization_id、绑定仓库(未传 warehouseId 时取用户仓库绑定)、
|
||||||
* {@code tabType=2} 任务大厅(operators_by 为空,含收货/上架/拣货等自动下发任务)、
|
* {@code tabType=2} 任务大厅(operators_name 为空,含收货/上架/拣货等自动下发任务)、
|
||||||
* {@code tabType=1} 指派给我的(operators_by=当前用户);不按 task_status 默认过滤。
|
* {@code tabType=1} 指派给我的(operators_by=当前用户);不按 task_status 默认过滤。
|
||||||
*/
|
*/
|
||||||
@ApiOperation("查询下发任务列表")
|
@ApiOperation("查询下发任务列表")
|
||||||
|
|||||||
@@ -54,6 +54,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
select deliver_task_id, task_number, tracking_number, organization_id, organization_name, top_organization_id, warehouse_id, warehouse_code, warehouse_name, task_type, task_status, task_distribution, task_distribution_time, task_distribution_id, task_distribution_name, operators_by, operators_name, remark, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag, reassign_time, reassign_by_id, reassign_by_name from delive_task
|
select deliver_task_id, task_number, tracking_number, organization_id, organization_name, top_organization_id, warehouse_id, warehouse_code, warehouse_name, task_type, task_status, task_distribution, task_distribution_time, task_distribution_id, task_distribution_name, operators_by, operators_name, remark, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag, reassign_time, reassign_by_id, reassign_by_name from delive_task
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<!-- taskStatus=0 未接收:历史数据 task_status 可能为 NULL,与 0 等价 -->
|
||||||
|
<sql id="deliveTaskStatusFilter">
|
||||||
|
<if test="taskStatus != null and taskStatus == 0">
|
||||||
|
and (task_status = 0 OR task_status IS NULL)
|
||||||
|
</if>
|
||||||
|
<if test="taskStatus != null and taskStatus != 0">
|
||||||
|
and task_status = #{taskStatus}
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 任务大厅 tabType=2:未指派作业人(按 operators_name 判断,与现场查询口径一致) -->
|
||||||
|
<sql id="deliveTaskHallUnassignedFilter">
|
||||||
|
and (operators_name IS NULL OR operators_name = '')
|
||||||
|
</sql>
|
||||||
|
|
||||||
<sql id="selectDeliveTaskPo1">
|
<sql id="selectDeliveTaskPo1">
|
||||||
<where>
|
<where>
|
||||||
del_flag = 1
|
del_flag = 1
|
||||||
@@ -99,9 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="taskType != null and taskType == 7 and handoverQueryType == 2">
|
<if test="taskType != null and taskType == 7 and handoverQueryType == 2">
|
||||||
and EXISTS (SELECT 1 FROM handover_task_order hto WHERE hto.task_number = delive_task.tracking_number AND hto.del_flag = 1 AND hto.status = 2)
|
and EXISTS (SELECT 1 FROM handover_task_order hto WHERE hto.task_number = delive_task.tracking_number AND hto.del_flag = 1 AND hto.status = 2)
|
||||||
</if>
|
</if>
|
||||||
<if test="taskStatus != null ">
|
<include refid="deliveTaskStatusFilter"/>
|
||||||
and task_status = #{taskStatus}
|
|
||||||
</if>
|
|
||||||
<if test="taskDistribution != null ">
|
<if test="taskDistribution != null ">
|
||||||
and task_distribution = #{taskDistribution}
|
and task_distribution = #{taskDistribution}
|
||||||
</if>
|
</if>
|
||||||
@@ -181,9 +194,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="taskType != null and taskType == 7 and handoverQueryType == 2">
|
<if test="taskType != null and taskType == 7 and handoverQueryType == 2">
|
||||||
and EXISTS (SELECT 1 FROM handover_task_order hto WHERE hto.task_number = delive_task.tracking_number AND hto.del_flag = 1 AND hto.status = 2)
|
and EXISTS (SELECT 1 FROM handover_task_order hto WHERE hto.task_number = delive_task.tracking_number AND hto.del_flag = 1 AND hto.status = 2)
|
||||||
</if>
|
</if>
|
||||||
<if test="taskStatus != null ">
|
<include refid="deliveTaskStatusFilter"/>
|
||||||
and task_status = #{taskStatus}
|
|
||||||
</if>
|
|
||||||
<if test="taskDistribution != null ">
|
<if test="taskDistribution != null ">
|
||||||
and task_distribution = #{taskDistribution}
|
and task_distribution = #{taskDistribution}
|
||||||
</if>
|
</if>
|
||||||
@@ -200,7 +211,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
and operators_by = #{operatorsBy}
|
and operators_by = #{operatorsBy}
|
||||||
</if>
|
</if>
|
||||||
<if test="tabType != null and tabType==2">
|
<if test="tabType != null and tabType==2">
|
||||||
and operators_by IS NULL
|
<include refid="deliveTaskHallUnassignedFilter"/>
|
||||||
</if>
|
</if>
|
||||||
<if test="operatorsName != null and operatorsName != ''">
|
<if test="operatorsName != null and operatorsName != ''">
|
||||||
and operators_name like concat('%', #{operatorsName}, '%')
|
and operators_name like concat('%', #{operatorsName}, '%')
|
||||||
@@ -254,9 +265,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="taskType != null and taskType == 7 and handoverQueryType == 2">
|
<if test="taskType != null and taskType == 7 and handoverQueryType == 2">
|
||||||
and EXISTS (SELECT 1 FROM handover_task_order hto WHERE hto.task_number = delive_task.tracking_number AND hto.del_flag = 1 AND hto.status = 2)
|
and EXISTS (SELECT 1 FROM handover_task_order hto WHERE hto.task_number = delive_task.tracking_number AND hto.del_flag = 1 AND hto.status = 2)
|
||||||
</if>
|
</if>
|
||||||
<if test="taskStatus != null ">
|
<include refid="deliveTaskStatusFilter"/>
|
||||||
and task_status = #{taskStatus}
|
|
||||||
</if>
|
|
||||||
<if test="taskDistribution != null ">
|
<if test="taskDistribution != null ">
|
||||||
and task_distribution = #{taskDistribution}
|
and task_distribution = #{taskDistribution}
|
||||||
</if>
|
</if>
|
||||||
@@ -386,8 +395,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
delive_task
|
delive_task
|
||||||
WHERE
|
WHERE
|
||||||
del_flag = 1
|
del_flag = 1
|
||||||
AND (operators_by = ''
|
<include refid="deliveTaskHallUnassignedFilter"/>
|
||||||
OR operators_by IS NULL)
|
|
||||||
<include refid="selectDeliveTaskPo2"/>
|
<include refid="selectDeliveTaskPo2"/>
|
||||||
) taskSum
|
) taskSum
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user