From 47ff8690440e38304c8da846a10a237589cdc9fa Mon Sep 17 00:00:00 2001 From: tyty Date: Mon, 20 Nov 2023 18:22:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E6=8E=A5=E7=8F=AD=E6=B6=88=E8=B4=B9?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=EF=BC=8C=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../duty/service/impl/ImsDutyRecServiceImpl.java | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java index c3c6d20..338596a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java @@ -1387,16 +1387,26 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl { - throw new RuntimeException("更新交班状态失败,交班执行对象为:"+ JSON.toJSONString(recDTO.getHeadDutyMainVo())); - }); + if (ObjectUtil.isNotEmpty(headDutyMain)&&ObjectUtil.isNotEmpty(headDutyMain.getId())) { + Assert.isTrue(imsDutyMainService.updateById(headDutyMain), () -> { + throw new RuntimeException("更新交班状态失败,交班执行对象为:" + JSON.toJSONString(recDTO.getHeadDutyMainVo())); + }); + log.info("更新交班状态:"+carryDutyMain); + } // 更新接班值班 - Assert.isTrue(imsDutyMainService.updateById(carryDutyMain),() -> { - throw new RuntimeException("更新接班状态失败,交班执行对象为:"+ JSON.toJSONString(recDTO.getHeadDutyMainVo())); - }); + if (ObjectUtil.isNotEmpty(carryDutyMain)&&ObjectUtil.isNotEmpty(carryDutyMain.getId())) { + Assert.isTrue(imsDutyMainService.updateById(carryDutyMain), () -> { + throw new RuntimeException("更新接班状态失败,交班执行对象为:" + JSON.toJSONString(recDTO.getHeadDutyMainVo())); + }); + log.info("更新接班状态:"+carryDutyMain); + } // 更新交接班 - this.updateById(dutyRec); - return true; + if (ObjectUtil.isNotEmpty(dutyRec)&&ObjectUtil.isNotEmpty(dutyRec.getId())) { + return this.updateById(dutyRec); + }else { + log.error("更新交接班记录失败"+dutyRec.toString()); + return false; + } } /**