From 380fabe2bbc0dc5b40237eb03b31c9315fa130ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E4=B8=89=E7=82=AE?= <15856818120@163.com> Date: Fri, 5 Sep 2025 18:37:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bonus/bmw/controller/PmAttDeviceController.java | 4 +++- .../com/bonus/bmw/service/impl/PmAttDeviceServiceImpl.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bonus-modules/bonus-bmw/src/main/java/com/bonus/bmw/controller/PmAttDeviceController.java b/bonus-modules/bonus-bmw/src/main/java/com/bonus/bmw/controller/PmAttDeviceController.java index d788b04..a15e469 100644 --- a/bonus-modules/bonus-bmw/src/main/java/com/bonus/bmw/controller/PmAttDeviceController.java +++ b/bonus-modules/bonus-bmw/src/main/java/com/bonus/bmw/controller/PmAttDeviceController.java @@ -103,8 +103,10 @@ public class PmAttDeviceController extends BaseController { int res = pmAttDeviceService.delPmAttDevice(pmAttDevice); if (res>0){ return toAjax(res); + }else if (res==0){ + return error("考勤机已绑定工程,请勿删除"); }else { - return error("考勤机操作失败"); + return error("操作异常"); } } catch (Exception e) { diff --git a/bonus-modules/bonus-bmw/src/main/java/com/bonus/bmw/service/impl/PmAttDeviceServiceImpl.java b/bonus-modules/bonus-bmw/src/main/java/com/bonus/bmw/service/impl/PmAttDeviceServiceImpl.java index e903a65..714a6ba 100644 --- a/bonus-modules/bonus-bmw/src/main/java/com/bonus/bmw/service/impl/PmAttDeviceServiceImpl.java +++ b/bonus-modules/bonus-bmw/src/main/java/com/bonus/bmw/service/impl/PmAttDeviceServiceImpl.java @@ -5,7 +5,6 @@ import com.bonus.bmw.domain.vo.PmAttDeviceVo; import com.bonus.bmw.mapper.PmAttDeviceMapper; import com.bonus.bmw.service.PmAttDeviceService; import com.bonus.bmw.service.UrkSendService; -import com.bonus.common.core.constant.SecurityConstants; import com.bonus.common.core.utils.StringUtils; import com.bonus.common.redis.service.RedisService; import com.bonus.common.security.utils.SecurityUtils; @@ -92,6 +91,9 @@ public class PmAttDeviceServiceImpl implements PmAttDeviceService { public int delPmAttDevice(PmAttDevice pmAttDevice) throws Exception { int res = pmAttDeviceMapper.delPmAttDevice(pmAttDevice); PmAttDevice pmAttDeviceOld = pmAttDeviceMapper.getPmAttDeviceByCoode(pmAttDevice); + if (StringUtils.isNotNull(pmAttDeviceOld.getProId())){ + return 0; + } //考勤机解绑 uakSendService.delDevByProId(pmAttDevice.getDeviceCode(),pmAttDeviceOld.getProId()==null?-1:pmAttDeviceOld.getProId()); return res;