|
@@ -154,7 +154,18 @@ public class ZsjyEnrollmentProcessServiceImpl implements IZsjyEnrollmentProcessS
|
|
|
public Boolean updateByBo(ZsjyEnrollmentProcessBo bo) {
|
|
public Boolean updateByBo(ZsjyEnrollmentProcessBo bo) {
|
|
|
ZsjyEnrollmentProcess update = MapstructUtils.convert(bo, ZsjyEnrollmentProcess.class);
|
|
ZsjyEnrollmentProcess update = MapstructUtils.convert(bo, ZsjyEnrollmentProcess.class);
|
|
|
validEntityBeforeSave(update);
|
|
validEntityBeforeSave(update);
|
|
|
- return baseMapper.updateById(update) > 0;
|
|
|
|
|
|
|
+ boolean updated = baseMapper.updateById(update) > 0;
|
|
|
|
|
+ if (updated && StringUtils.isNotBlank(bo.getCurrentStatus())) {
|
|
|
|
|
+ Long enrollmentId = bo.getEnrollmentId();
|
|
|
|
|
+ if (enrollmentId == null && bo.getId() != null) {
|
|
|
|
|
+ ZsjyEnrollmentProcess persisted = baseMapper.selectById(bo.getId());
|
|
|
|
|
+ if (persisted != null) {
|
|
|
|
|
+ enrollmentId = persisted.getEnrollmentId();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ syncEnrollmentStatus(enrollmentId, bo.getCurrentStatus());
|
|
|
|
|
+ }
|
|
|
|
|
+ return updated;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -212,6 +223,26 @@ public class ZsjyEnrollmentProcessServiceImpl implements IZsjyEnrollmentProcessS
|
|
|
log.info("删除流程后已将报名ID:{} 状态回退为待审核", enrollmentId);
|
|
log.info("删除流程后已将报名ID:{} 状态回退为待审核", enrollmentId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 流程状态变更后,同步更新报名表 enrollment_status(直接写库,避免触发双向同步)
|
|
|
|
|
+ */
|
|
|
|
|
+ private void syncEnrollmentStatus(Long enrollmentId, String status) {
|
|
|
|
|
+ if (enrollmentId == null || StringUtils.isBlank(status)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ ZsjyEnrollmentInfo enrollmentInfo = enrollmentInfoMapper.selectById(enrollmentId);
|
|
|
|
|
+ if (enrollmentInfo == null) {
|
|
|
|
|
+ log.warn("同步报名状态失败,报名记录不存在,enrollmentId={}", enrollmentId);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (status.equals(enrollmentInfo.getEnrollmentStatus())) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ enrollmentInfo.setEnrollmentStatus(status);
|
|
|
|
|
+ enrollmentInfoMapper.updateById(enrollmentInfo);
|
|
|
|
|
+ log.info("流程状态已同步至报名表,enrollmentId={},status={}", enrollmentId, status);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 根据报名信息ID查询流程状态
|
|
* 根据报名信息ID查询流程状态
|
|
|
*
|
|
*
|
|
@@ -255,7 +286,11 @@ public class ZsjyEnrollmentProcessServiceImpl implements IZsjyEnrollmentProcessS
|
|
|
process.setCurrentStatus("9"); // 已驳回
|
|
process.setCurrentStatus("9"); // 已驳回
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return baseMapper.updateById(process) > 0;
|
|
|
|
|
|
|
+ boolean updated = baseMapper.updateById(process) > 0;
|
|
|
|
|
+ if (updated) {
|
|
|
|
|
+ syncEnrollmentStatus(process.getEnrollmentId(), process.getCurrentStatus());
|
|
|
|
|
+ }
|
|
|
|
|
+ return updated;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -290,7 +325,11 @@ public class ZsjyEnrollmentProcessServiceImpl implements IZsjyEnrollmentProcessS
|
|
|
process.setCurrentStatus("9"); // 已驳回
|
|
process.setCurrentStatus("9"); // 已驳回
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return baseMapper.updateById(process) > 0;
|
|
|
|
|
|
|
+ boolean updated = baseMapper.updateById(process) > 0;
|
|
|
|
|
+ if (updated) {
|
|
|
|
|
+ syncEnrollmentStatus(process.getEnrollmentId(), process.getCurrentStatus());
|
|
|
|
|
+ }
|
|
|
|
|
+ return updated;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -325,7 +364,11 @@ public class ZsjyEnrollmentProcessServiceImpl implements IZsjyEnrollmentProcessS
|
|
|
process.setCurrentStatus("9"); // 已驳回
|
|
process.setCurrentStatus("9"); // 已驳回
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return baseMapper.updateById(process) > 0;
|
|
|
|
|
|
|
+ boolean updated = baseMapper.updateById(process) > 0;
|
|
|
|
|
+ if (updated) {
|
|
|
|
|
+ syncEnrollmentStatus(process.getEnrollmentId(), process.getCurrentStatus());
|
|
|
|
|
+ }
|
|
|
|
|
+ return updated;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|