fix:修复查询
This commit is contained in:
@@ -43,9 +43,9 @@
|
||||
<if test="query.workOrder != null and query.workOrder != ''">
|
||||
and d.work_order like concat('%', #{query.workOrder}, '%')
|
||||
</if>
|
||||
<if test="query.orderCode != null and query.orderCode != ''">
|
||||
and d.order_code like concat('%', #{query.orderCode}, '%')
|
||||
</if>
|
||||
<!-- <if test="query.orderCode != null and query.orderCode != ''">-->
|
||||
<!-- and d.order_code like concat('%', #{query.orderCode}, '%')-->
|
||||
<!-- </if>-->
|
||||
<if test="query.skuCode != null and query.skuCode != ''">
|
||||
and (d.sku_code like concat('%', #{query.skuCode}, '%') or d.sku_name like concat('%', #{query.skuCode}, '%'))
|
||||
</if>
|
||||
|
||||
@@ -635,18 +635,27 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
if (!IOSEnum.BILL_STATUS.code("分配完").equals(ioStorInv.getBill_status())){throw new BadRequestException("主表状态必须为分配完!");}
|
||||
List<String> flatWarehouse = getFlatWarehouseCodes();
|
||||
//解锁原货位点位
|
||||
// 待确认的分配明细:必须存在「执行中(生成)」的明细才有可确认内容
|
||||
List<IOStorInvDis> ioStorInvDisList =
|
||||
ioStorInvDisMapper.selectList(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinv_id,param.get("iostorinv_id"))
|
||||
.eq(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("生成"))
|
||||
);
|
||||
// 判断此单据下的所有任务有没有完成的
|
||||
boolean is_finish = iSchBaseTaskService.list(
|
||||
new QueryWrapper<SchBaseTask>().lambda()
|
||||
.in(SchBaseTask::getTask_id, ioStorInvDisList.stream()
|
||||
.map(IOStorInvDis::getTask_id)
|
||||
.collect(Collectors.toList())))
|
||||
.stream().allMatch(row -> row.getTask_status().equals(TaskStatus.FINISHED.getCode()));
|
||||
if (CollectionUtils.isEmpty(ioStorInvDisList)) {
|
||||
throw new BadRequestException("当前没有可确认的分配明细");
|
||||
}
|
||||
// 判断此单据下的所有任务有没有完成的(task_id 可能为空,需先过滤,否则会拼出非法的 IN ())
|
||||
List<String> taskIds = ioStorInvDisList.stream()
|
||||
.map(IOStorInvDis::getTask_id)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.collect(Collectors.toList());
|
||||
boolean is_finish = true;
|
||||
if (!CollectionUtils.isEmpty(taskIds)) {
|
||||
is_finish = iSchBaseTaskService.list(
|
||||
new QueryWrapper<SchBaseTask>().lambda()
|
||||
.in(SchBaseTask::getTask_id, taskIds))
|
||||
.stream().allMatch(row -> row.getTask_status().equals(TaskStatus.FINISHED.getCode()));
|
||||
}
|
||||
if (!is_finish) {
|
||||
throw new BadRequestException("当前有未完成的任务不能强制确认!");
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -31,6 +33,7 @@ import org.nl.wms.warehouse_manage.service.dto.MoveInsertDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
@@ -267,14 +270,21 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
new QueryWrapper<StIvtMoveinvdtl>().lambda()
|
||||
.eq(StIvtMoveinvdtl::getMoveinv_id, dto.getMoveinv_id())
|
||||
);
|
||||
List<SchBaseTask> taskDaoList = iSchBaseTaskService.list(
|
||||
new QueryWrapper<SchBaseTask>().lambda()
|
||||
.in(SchBaseTask::getTask_id,
|
||||
dtlDaoList.stream()
|
||||
.map(StIvtMoveinvdtl::getTask_id)
|
||||
.collect(Collectors.toList())
|
||||
)
|
||||
);
|
||||
if (CollectionUtils.isEmpty(dtlDaoList)) {
|
||||
throw new BadRequestException("当前没有可确认的移库明细");
|
||||
}
|
||||
List<SchBaseTask> taskDaoList = new ArrayList<>();
|
||||
// task_id 可能为空,需先过滤,否则会拼出非法的 IN () 导致 SQL 语法错误
|
||||
List<String> taskIds = dtlDaoList.stream()
|
||||
.map(StIvtMoveinvdtl::getTask_id)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(taskIds)) {
|
||||
taskDaoList = iSchBaseTaskService.list(
|
||||
new QueryWrapper<SchBaseTask>().lambda()
|
||||
.in(SchBaseTask::getTask_id, taskIds)
|
||||
);
|
||||
}
|
||||
|
||||
for (StIvtMoveinvdtl dao : dtlDaoList) {
|
||||
SchBaseTask taskDao = taskDaoList.stream()
|
||||
|
||||
Reference in New Issue
Block a user