diff --git a/src/main/java/com/example/duplicate/service/impl/TaskServiceImpl.java b/src/main/java/com/example/duplicate/service/impl/TaskServiceImpl.java index 267110f..1b17296 100644 --- a/src/main/java/com/example/duplicate/service/impl/TaskServiceImpl.java +++ b/src/main/java/com/example/duplicate/service/impl/TaskServiceImpl.java @@ -171,11 +171,11 @@ public class TaskServiceImpl implements TaskService { try { //根据患者masterId,collectId删除 boolean stactic = archiveDetailMapper.delFileBySource(masterId, collectId); - log.info("删除接口调用"); if (stactic) { return CommonResult.success("删除成功,masterId:" + masterId+"删除分类:"+collectId); } } catch (Exception e) { + log.error("删除接口失败:"+e.getMessage(),e); return CommonResult.failed("删除失败,masterId:" + masterId+"删除分类:"+collectId); } return CommonResult.failed("删除失败,masterId:" + masterId+"删除分类:"+collectId); @@ -183,40 +183,44 @@ public class TaskServiceImpl implements TaskService { @Override public CommonResult updateTask(updateTaskDto dto) { - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String format = dateFormat.format(new Date()); - log.info(format + "本次维护任务表传输参数为:" + JSONObject.toJSONString(dto)); - if (StringUtils.isBlank(dto.getMid())) { - log.info(format + "Mid不能为空!"); - log.info(dto.getMid()); - return CommonResult.failed("Mid名不能为空"); - } - if (StringUtils.isBlank(dto.getStartTime())) { - log.info(format + "开始时间不能为空!"); - return CommonResult.failed("开始时间不能为空"); - } - if (StringUtils.isBlank(dto.getEndTime())) { - log.info(format + "结束时间不能为空!"); - return CommonResult.failed("结束时间不能为空"); - } - if (StringUtils.isBlank(String.valueOf(dto.getStatusFlag()))) { - log.info(format + "任务状态不能为空!"); - return CommonResult.failed("任务状态不能为空"); - } - if (StringUtils.isBlank(dto.getSycObj())) { - log.info(format + "SycObj患者信息不能为空!"); - return CommonResult.failed("SycObj患者信息不能为空"); - } - if (StringUtils.isBlank(dto.getPinResult())) { - log.info(format + "备注信息不能为空!"); - return CommonResult.failed("备注信息不能为空"); - } - if (StringUtils.isBlank(String.valueOf(dto.getSysFlag()))) { - log.info(format + "任务分类不能为空!"); - return CommonResult.failed("任务分类不能为空"); - } - if (archiveOtherExtMapper.updateByMid(dto)) { - return CommonResult.success("id为:" + dto.getMid() + "任务表维护成功"); + try { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String format = dateFormat.format(new Date()); + log.info(format + "本次维护任务表传输参数为:" + JSONObject.toJSONString(dto)); + if (StringUtils.isBlank(dto.getMid())) { + log.info(format + "Mid不能为空!"); + log.info(dto.getMid()); + return CommonResult.failed("Mid名不能为空"); + } + if (StringUtils.isBlank(dto.getStartTime())) { + log.info(format + "开始时间不能为空!"); + return CommonResult.failed("开始时间不能为空"); + } + if (StringUtils.isBlank(dto.getEndTime())) { + log.info(format + "结束时间不能为空!"); + return CommonResult.failed("结束时间不能为空"); + } + if (StringUtils.isBlank(String.valueOf(dto.getStatusFlag()))) { + log.info(format + "任务状态不能为空!"); + return CommonResult.failed("任务状态不能为空"); + } + if (StringUtils.isBlank(dto.getSycObj())) { + log.info(format + "SycObj患者信息不能为空!"); + return CommonResult.failed("SycObj患者信息不能为空"); + } + if (StringUtils.isBlank(dto.getPinResult())) { + log.info(format + "备注信息不能为空!"); + return CommonResult.failed("备注信息不能为空"); + } + if (StringUtils.isBlank(String.valueOf(dto.getSysFlag()))) { + log.info(format + "任务分类不能为空!"); + return CommonResult.failed("任务分类不能为空"); + } + if (archiveOtherExtMapper.updateByMid(dto)) { + return CommonResult.success("id为:" + dto.getMid() + "任务表维护成功"); + } + } catch (Exception e) { + log.error("维护任务表失败:"+dto.getMid()+"异常处理"+e.getMessage(),e); } return CommonResult.success("id为:" + dto.getMid() + "任务表维护失败"); } diff --git a/src/main/resources/mapper/ArchiveDetailMapper.xml b/src/main/resources/mapper/ArchiveDetailMapper.xml index 761b318..8a7d8dc 100644 --- a/src/main/resources/mapper/ArchiveDetailMapper.xml +++ b/src/main/resources/mapper/ArchiveDetailMapper.xml @@ -87,7 +87,7 @@ delete from archive_detail - where MasterID = #{MasterID} AND Source in (${collectId}) + where MasterID = #{masterId} AND Source IN (#{collectId, jdbcType=NVARCHAR})