From 69a32e31d01640554df2967b15ff9deaeaf01264 Mon Sep 17 00:00:00 2001 From: liweijie Date: Tue, 22 Sep 2026 10:35:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E4=BF=A1=E6=81=AF=E5=A1=AB?= =?UTF-8?q?=E5=86=99=E5=8F=8A=E7=BC=96=E5=8F=B7=E5=9B=9E=E5=A1=AB=E7=AD=89?= =?UTF-8?q?=E6=A2=B3=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jwgl/service/impl/FacultyServiceImpl.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/FacultyServiceImpl.java b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/FacultyServiceImpl.java index 332362b9e..66a773578 100644 --- a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/FacultyServiceImpl.java +++ b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/FacultyServiceImpl.java @@ -421,13 +421,28 @@ public class FacultyServiceImpl implements FacultyService { @Override public JYSX getJYSXByJYBH(String jybh) { - return jysxMapper.selectById(jybh); + JYSX entity = jysxMapper.selectById(jybh); + if (entity == null) { + entity = new JYSX(); + entity.setJybh(jybh); + } + return entity; } @Override @Transactional public void updateJYSX(JYSX entity) { - jysxMapper.updateById(entity); + if (entity == null || isBlank(entity.getJybh())) { + throw new BusinessException("教员编号不能为空"); + } + // 教员属性与教员一对一,历史教员可能没有属性行:更新不到则补插 + int updated = jysxMapper.updateById(entity); + if (updated == 0) { + if (entity.getZr() == null) { + entity.setZr(0); + } + jysxMapper.insert(entity); + } } // ==================== 年度综合评定查询 ====================