解决物品申领出现申领成功但是“申领”按钮不消失问题

dev
a15234804788@163.com 3 years ago
parent 5092706f3d
commit a7a3188256
  1. 26
      lab-service/lab-capital/src/main/java/org/springblade/lims/goods/service/impl/ApplyServiceImpl.java

@ -209,18 +209,24 @@ public class ApplyServiceImpl extends BaseServiceImpl<ApplyMapper, Apply> implem
wrapper.eq(ApplyDetail::getApplyId, apply.getId()); wrapper.eq(ApplyDetail::getApplyId, apply.getId());
// 条件查询申领相关物品信息 // 条件查询申领相关物品信息
List<ApplyDetail> details = applyDetailService.list(wrapper); List<ApplyDetail> details = applyDetailService.list(wrapper);
// 申领单修改状态
for (ApplyDetail detail : details) { if (details.size() == 0){//如果申领详情表中无数据,说明这个申领的详情数据可能被删掉了,但是由于申请通过之后就会减库存,所以直接将申请表设置为已完成就行了
// 如果归还时间不为null apply.setStatus(4);
if (detail.getReturnTime() != null) { }else{
// 设置申领单状态为待归还(3) // 申领单修改状态
apply.setStatus(3); for (ApplyDetail detail : details) {
break; // 如果归还时间不为null
} else { if (detail.getReturnTime() != null) {
// 反之,设置申领单状态为已完成(4) // 设置申领单状态为待归还(3)
apply.setStatus(4); apply.setStatus(3);
break;
} else {
// 反之,设置申领单状态为已完成(4)
apply.setStatus(4);
}
} }
} }
// 修改申领单 // 修改申领单
return this.updateById(apply); return this.updateById(apply);
} }

Loading…
Cancel
Save