属性信息填写及编号回填等梳理

This commit is contained in:
2026-09-22 10:35:02 +08:00
parent c9a2098f3f
commit 69a32e31d0
@@ -421,13 +421,28 @@ public class FacultyServiceImpl implements FacultyService {
@Override @Override
public JYSX getJYSXByJYBH(String jybh) { 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 @Override
@Transactional @Transactional
public void updateJYSX(JYSX entity) { 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);
}
} }
// ==================== 年度综合评定查询 ==================== // ==================== 年度综合评定查询 ====================