Commit c8e54fb7 by zhu.zewen

修复待交接专账列表

parent 969c28f6
...@@ -166,10 +166,13 @@ public class PhysicBillServiceImpl extends AbstractService implements PhysicBill ...@@ -166,10 +166,13 @@ public class PhysicBillServiceImpl extends AbstractService implements PhysicBill
// 获取最新的交接单 // 获取最新的交接单
PhysicBillHandover lastHandover = physicBillHandoverMapper.selectOne(Wrappers.lambdaQuery(PhysicBillHandover.class) PhysicBillHandover lastHandover = physicBillHandoverMapper.selectOne(Wrappers.lambdaQuery(PhysicBillHandover.class)
.eq(PhysicBillHandover::getDeptId, deptId) .eq(PhysicBillHandover::getDeptId, deptId)
.orderByDesc(PhysicBillHandover::getId)); // 未取消
.ge(PhysicBillHandover::getStatus, 0)
.orderByDesc(PhysicBillHandover::getId)
.last(" LIMIT 1"));
if (ObjectUtil.isNotEmpty(lastHandover)) { if (ObjectUtil.isNotEmpty(lastHandover)) {
if (ObjectUtil.isEmpty(lastHandover.getFinishTime())) { if (ObjectUtil.isEmpty(lastHandover.getFinishTime())) {
throw new ServiceException("存在未完成交接单"); throw new ServiceException("存在未完成交接单:" + lastHandover.getId() + ",状态=" + lastHandover.getStatus());
} }
lastHandoverBillId = lastHandover.getEndBillId(); lastHandoverBillId = lastHandover.getEndBillId();
} }
...@@ -188,7 +191,8 @@ public class PhysicBillServiceImpl extends AbstractService implements PhysicBill ...@@ -188,7 +191,8 @@ public class PhysicBillServiceImpl extends AbstractService implements PhysicBill
private Optional<PhysicBillHandover> getLastHandover(Long deptId) { private Optional<PhysicBillHandover> getLastHandover(Long deptId) {
PhysicBillHandover lastHandover = physicBillHandoverMapper.selectOne(Wrappers.lambdaQuery(PhysicBillHandover.class) PhysicBillHandover lastHandover = physicBillHandoverMapper.selectOne(Wrappers.lambdaQuery(PhysicBillHandover.class)
.eq(PhysicBillHandover::getDeptId, deptId) .eq(PhysicBillHandover::getDeptId, deptId)
.orderByDesc(PhysicBillHandover::getId)); .orderByDesc(PhysicBillHandover::getId)
.last(" LIMIT 1 "));
if (ObjectUtil.isEmpty(lastHandover)) { if (ObjectUtil.isEmpty(lastHandover)) {
return Optional.empty(); return Optional.empty();
} }
......
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