From 2e64c232ab6b51b2cecf1ee96e1e9b709234f326 Mon Sep 17 00:00:00 2001 From: huanghongfa <huanghongfa123456> Date: 星期六, 21 八月 2021 16:35:14 +0800 Subject: [PATCH] 随手拍改版接口开发 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSwDangerReportServiceImpl.java | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSwDangerReportServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSwDangerReportServiceImpl.java index e0a8e39..56416f1 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSwDangerReportServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSwDangerReportServiceImpl.java @@ -15,6 +15,7 @@ import com.panzhihua.common.model.vos.community.ComSwDangerReportVO; import com.panzhihua.common.model.vos.community.ComSwSafetyWorkRecordVO; import com.panzhihua.common.service.user.UserService; +import com.panzhihua.common.utlis.DateUtils; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.dao.ComSwDangerReportDAO; import com.panzhihua.service_community.dao.ComSwPatrolRecordDAO; @@ -30,10 +31,7 @@ import javax.annotation.Resource; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @auther txb @@ -298,6 +296,10 @@ } BeanUtils.copyProperties(comSwDangerReportHandleDTO, comSwDangerReportDO); comSwDangerReportDO.setStatus(String.valueOf(SafeWordStatusEnum.YCL.getCode())); + ComSwDangerReportDO comSwDangerReportDO1 = comSwDangerReportDAO.selectById(comSwDangerReportHandleDTO.getDangerReportId()); + if (!comSwDangerReportDO1.getStatus().equals(String.valueOf(SafeWordStatusEnum.DCL.getCode()))) { + return R.fail("该隐患报告已处理,请勿重复操作"); + } int update = comSwDangerReportDAO.updateById(comSwDangerReportDO); if (update > 0) { return R.ok(); @@ -313,6 +315,11 @@ } BeanUtils.copyProperties(comSwDangerReportRectifyDTO, comSwDangerReportDO); comSwDangerReportDO.setStatus(String.valueOf(SafeWordStatusEnum.YZG.getCode())); + comSwDangerReportDO.setRectifyTime(DateUtils.getCurrentDateStr()); + ComSwDangerReportDO comSwDangerReportDO1 = comSwDangerReportDAO.selectById(comSwDangerReportRectifyDTO.getDangerReportId()); + if (comSwDangerReportDO1.getStatus().equals(String.valueOf(SafeWordStatusEnum.YZG.getCode()))) { + return R.fail("该隐患报告已整改,请勿重复操作"); + } int update = comSwDangerReportDAO.updateById(comSwDangerReportDO); if (update > 0) { return R.ok(); -- Gitblit v1.7.1