diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/WarningController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/WarningController.java index b8dfcba8b..404efd0f1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/WarningController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/WarningController.java @@ -1,5 +1,9 @@ package cn.iocoder.yudao.module.system.controller.admin.warning; +import cn.iocoder.yudao.module.system.dal.mysql.warning.WarningMapper; +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; @@ -42,6 +46,8 @@ public class WarningController { @Resource private WarningService warningService; + @Resource + private WarningMapper warningMapper; @PostMapping("/create") @Operation(summary = "创建危急值记录") @PreAuthorize("@ss.hasPermission('system:warning:create')") @@ -66,8 +72,16 @@ public class WarningController { @Operation(summary = "更新危急值记录") public CommonResult SaveupdateWarning(@Valid @RequestBody WarningSaveReqVO updateReqVO) { + LocalDateTime dateTime = LocalDateTime.parse(updateReqVO.getCheckDateTime(), DateTimeFormatter.ofPattern("yyyy-M-d H:mm:ss")); + WarningDO warningDO=new WarningDO(); + warningDO.setId(updateReqVO.getId()); + warningDO.setReadremark(updateReqVO.getReadremark()); + warningDO.setReceiveDoctor(updateReqVO.getReceiveDoctor()); + warningDO.setDealDoctor(updateReqVO.getDealDoctor()); + warningDO.setCheckDateTime(dateTime) ; + + warningMapper.updateById(warningDO); - warningService.updateWarning(updateReqVO); return success(true); } @@ -75,22 +89,21 @@ public class WarningController { @Operation(summary = "更新危急值接收时间和发送回执记录") public CommonResult updateWarningdate( @RequestParam("id") String id,@RequestParam("readDateTime") String readDateTime,@RequestParam("receiptDateTime") String receiptDateTime) { - WarningSaveReqVO warningSaveReqVO = new WarningSaveReqVO(); - warningSaveReqVO.setId(id); + WarningDO warningDO=new WarningDO(); + warningDO.setId(id); if(!readDateTime.isEmpty()) { LocalDateTime dateTime = LocalDateTime.parse(readDateTime, DateTimeFormatter.ofPattern("yyyy-M-d H:mm:ss")); - warningSaveReqVO.setReadDateTime(dateTime); + warningDO.setReadDateTime(dateTime); } if(!receiptDateTime.isEmpty()) { LocalDateTime dateTime = LocalDateTime.parse(receiptDateTime, DateTimeFormatter.ofPattern("yyyy-M-d H:mm:ss")); - warningSaveReqVO.setReceiptDateTime(dateTime); - + warningDO.setReceiptDateTime(dateTime); } - warningService.updateWarning(warningSaveReqVO); + warningMapper.updateById(warningDO); return success(true); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/warning/WarningDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/warning/WarningDO.java index 3d48b2081..9299fd809 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/warning/WarningDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/warning/WarningDO.java @@ -29,7 +29,7 @@ public class WarningDO { /** * 机构ID */ - @TableField("orgId") + @TableField(value = "orgId") private String orgId; /** * 检查ID,一人多个检查的检查id @@ -44,37 +44,37 @@ public class WarningDO { /** * 上报机构id */ - @TableField("reportOrgId") + @TableField(value ="reportOrgId") private String reportOrgId; /** * 上报机构名称 */ - @TableField("reportorgName") + @TableField(value ="reportorgName") private String reportorgName; /** * 上报医生 */ - @TableField("reportDoctor") + @TableField(value = "reportDoctor") private String reportDoctor; /** * 上报时间 */ - @TableField("reportDate") + @TableField(value = "reportDate") private LocalDateTime reportDate; /** * 危急值内容 */ - @TableField("warningContent") + @TableField(value = "warningContent") private String warningContent; /** * 危急值接收医生 */ - @TableField("receiveDoctor") + @TableField(value = "receiveDoctor") private String receiveDoctor; /** * 处理医生 */ - @TableField("dealDoctor") + @TableField(value = "dealDoctor") private String dealDoctor; /** * 确认时间 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningService.java index 4d2bc6044..82f33cba3 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningService.java @@ -30,6 +30,13 @@ public interface WarningService { */ void updateWarning(@Valid WarningSaveReqVO updateReqVO); + + /** + * 更新危急值记录 + * + * @param updateReqVO 更新信息 + */ + void SaveupdateWarning(@Valid WarningSaveUpdateVO updateReqVO); /** * 删除危急值记录 * diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningServiceImpl.java index e2499ad29..7c42588bb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningServiceImpl.java @@ -50,6 +50,13 @@ public class WarningServiceImpl implements WarningService { warningMapper.updateById(updateObj); } + @Override + public void SaveupdateWarning(WarningSaveUpdateVO updateReqVO) { + // 更新 + WarningDO updateObj = BeanUtils.toBean(updateReqVO, WarningDO.class); + warningMapper.updateById(updateObj); + } + @Override public void deleteWarning(String id) { // 校验存在