From e25d8313928ce09118898ed4b2d03daba20fe274 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Fri, 9 Sep 2022 16:06:30 +0800 Subject: [PATCH] =?UTF-8?q?APP=E6=96=B0=E5=A2=9E=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E6=8B=8D=E6=91=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/api/MpController.java | 24 +++++++++++++++++++ .../java/com/ruoyi/system/domain/TRecord.java | 16 +++++++++++++ .../service/impl/TRecordServiceImpl.java | 4 +++- .../resources/mapper/system/TRecordMapper.xml | 7 ++++-- 4 files changed, 48 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/MpController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/MpController.java index 60eec97..6dbe5cf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/MpController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/MpController.java @@ -39,4 +39,28 @@ public class MpController extends BaseController { List resp = tRecordService.queryPatientHistoryRecord(tRecord); return AjaxResult.success(resp); } + + /** + * 重新安排 + * + * @return {@code AjaxResult} + */ + @ApiOperation("APP重新拍摄") + @Log(title = "APP重新拍摄", businessType = BusinessType.INSERT) + @GetMapping("/record/reschedule/{recordId}") + public AjaxResult reschedule(@PathVariable("recordId") Long recordId){ + // 逻辑删除本条记录 + TRecord tRecord = tRecordService.selectTRecordById(recordId); + TRecord delRecord = new TRecord(); + delRecord.setId(recordId); + delRecord.setDelFlag("2"); + tRecordService.updateTRecord(delRecord); + // 重新生成一条记录 + tRecord.setId(null); + tRecord.setDelFlag("0"); + tRecordService.insertTRecord(tRecord); + AjaxResult success = AjaxResult.success(); + success.put("recordId", tRecord.getId()); + return success; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java index 1d19875..c0b44da 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java @@ -79,8 +79,24 @@ public class TRecord extends BaseEntity @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date aiResultModifyTime; + /** + * 预约时间 + */ private String appointmentTime; + /** + * 删除标志(0:代表存在 1:代表删除) + */ + private String delFlag; + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + public void setId(Long id) { this.id = id; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java index 5e8cadb..095ac70 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java @@ -68,7 +68,9 @@ public class TRecordServiceImpl implements ITRecordService @Override public int insertTRecord(TRecord tRecord) { - tRecord.setCreateTime(DateUtils.getNowDate()); + if (null == tRecord.getCreateTime()) { + tRecord.setCreateTime(DateUtils.getNowDate()); + } return tRecordMapper.insertTRecord(tRecord); } diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index 783b9b4..fe8c92b 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -171,7 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and tp.sex = #{sex} and tp.identifier like concat('%', #{identifier}, '%') - and td.del_flag = '0' and tp.del_flag = '0' + and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0' and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime} @@ -314,7 +314,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and tp.sex = #{sex} and tp.identifier like concat('%', #{identifier}, '%') - and td.del_flag = '0' and tp.del_flag = '0' + and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0' and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime} @@ -355,6 +355,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" response_time, ai_result_return_time, ai_result_modify_time, + del_flag, #{patientId}, @@ -373,6 +374,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{responseTime}, #{aiResultReturnTime}, #{aiResultModifyTime}, + #{delFlag}, @@ -395,6 +397,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" response_time = #{responseTime}, ai_result_return_time = #{aiResultReturnTime}, ai_result_modify_time = #{aiResultModifyTime}, + del_flag = #{delFlag}, where id = #{id}