Commit fcd3258d by zhu.zewen

修复交接班状态过滤

parent 3445cc84
......@@ -191,6 +191,8 @@ public class PhysicBillServiceImpl extends AbstractService implements PhysicBill
private Optional<PhysicBillHandover> getLastHandover(Long deptId) {
PhysicBillHandover lastHandover = physicBillHandoverMapper.selectOne(Wrappers.lambdaQuery(PhysicBillHandover.class)
.eq(PhysicBillHandover::getDeptId, deptId)
// 未取消
.ge(PhysicBillHandover::getStatus, 0)
.orderByDesc(PhysicBillHandover::getId)
.last(" LIMIT 1 "));
if (ObjectUtil.isEmpty(lastHandover)) {
......@@ -210,6 +212,8 @@ public class PhysicBillServiceImpl extends AbstractService implements PhysicBill
// 获取最新的交接单
PhysicBillHandover lastHandover = physicBillHandoverMapper.selectOne(Wrappers.lambdaQuery(PhysicBillHandover.class)
.eq(PhysicBillHandover::getDeptId, deptId)
// 未取消
.ge(PhysicBillHandover::getStatus, 0)
.orderByDesc(PhysicBillHandover::getId));
if (ObjectUtil.isEmpty(lastHandover)) {
return Collections.emptyList();
......@@ -235,8 +239,10 @@ public class PhysicBillServiceImpl extends AbstractService implements PhysicBill
// 验证是否存在未完成的交接单
PhysicBillHandover unfinishedHandover = physicBillHandoverMapper.selectOne(Wrappers.lambdaQuery(PhysicBillHandover.class)
.eq(PhysicBillHandover::getDeptId, deptId)
.ne(PhysicBillHandover::getStatus, 100)
.ne(PhysicBillHandover::getStatus, -100)
// 未完成
.lt(PhysicBillHandover::getStatus, 100)
// 未取消
.ge(PhysicBillHandover::getStatus, 0)
.orderByDesc(PhysicBillHandover::getId));
if (ObjectUtil.isNotEmpty(unfinishedHandover)) {
throw new ServiceException("存在未完成交接单");
......
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 sign in to comment