From c3b33b7c367bfbd53a0243849b2f49e4cb3158d8 Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Tue, 10 Feb 2026 19:19:59 +0800 Subject: [PATCH] =?UTF-8?q?fix--=E8=B5=84=E6=BA=90=E5=B1=82=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ComplaintCollectionResourceService.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java b/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java index a235a50..b6338cf 100644 --- a/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java +++ b/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java @@ -148,9 +148,6 @@ public class ComplaintCollectionResourceService extends BaseDAO { if (param.getSourceTable() != null) { uw.set(ComplaintCollection::getSourceTable, param.getSourceTable()); } - if (param.getTag() != null) { - uw.set(ComplaintCollection::getTag, param.getTag()); - } if (param.getInvolveProblem() != null) { uw.set(ComplaintCollection::getInvolveProblem, param.getInvolveProblem()); } @@ -230,13 +227,19 @@ public class ComplaintCollectionResourceService extends BaseDAO { if (param.getGwf3()!=null){ uw.set(ComplaintCollection::getGwf3, param.getGwf3()); } - uw.set(ComplaintCollection::getTag, param.getTags() != null ? StringUtils.join(param.getTags(), ",") : null); + if (param.getTags() != null){ + uw.set(ComplaintCollection::getTag, StringUtils.join(param.getTags(), ",") ); + } uw.set(ComplaintCollection::getUpdateBy, UserContextHolder.getCurrentUser().getUserName()); uw.set(ComplaintCollection::getUpdateTime, LocalDateTime.now()); if (uw.getExpression() == null || uw.getExpression().getSqlSegment().isEmpty()) { throw new IllegalStateException("更新条件不能为空,防止全表更新"); } - return complaintCollectionMapper.update(null, uw) > 0; + int affected = complaintCollectionMapper.update(null, uw); + if (affected > 1) { + throw new IllegalStateException("更新命中多条数据,疑似ID不唯一:" + id); + } + return affected == 1; } public boolean exists(ComplaintCollectionExistParam param) {