|
|
@@ -27,6 +27,8 @@ import org.dromara.main.mapper.MainBackOrderMapper;
|
|
|
import org.dromara.main.mapper.MainBackRecordMapper;
|
|
|
import org.dromara.main.mapper.MainStudentMapper;
|
|
|
import org.dromara.main.service.IMainBackRecordService;
|
|
|
+import org.dromara.system.domain.SysTenant;
|
|
|
+import org.dromara.system.mapper.SysTenantMapper;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -47,6 +49,7 @@ public class MainBackRecordServiceImpl implements IMainBackRecordService {
|
|
|
private final MainBackCheckDataMapper checkDataMapper;
|
|
|
private final MainBackInterviewMapper interviewMapper;
|
|
|
private final MainBackOrderMapper backOrderMapper;
|
|
|
+ private final SysTenantMapper sysTenantMapper;
|
|
|
|
|
|
|
|
|
@Override
|
|
|
@@ -64,6 +67,26 @@ public class MainBackRecordServiceImpl implements IMainBackRecordService {
|
|
|
|
|
|
TableDataInfo<MainBackRecordVo> result = TableDataInfo.build(pageResult);
|
|
|
|
|
|
+ // 4. 预查下单企业信息(同订单下供职公司相同,避免循环内重复查询)
|
|
|
+ String orderCompanyName = null;
|
|
|
+ Long orderCompanyId = null;
|
|
|
+ if (orderId != null) {
|
|
|
+ MainBackOrder backOrder = backOrderMapper.selectById(orderId);
|
|
|
+ if (backOrder != null && StrUtil.isNotBlank(backOrder.getTenantId())) {
|
|
|
+ SysTenant tenant = sysTenantMapper.selectOne(
|
|
|
+ new LambdaQueryWrapper<SysTenant>()
|
|
|
+ .eq(SysTenant::getTenantId, backOrder.getTenantId())
|
|
|
+ .last("limit 1")
|
|
|
+ );
|
|
|
+ if (tenant != null && StrUtil.isNotBlank(tenant.getCompanyName())) {
|
|
|
+ orderCompanyName = tenant.getCompanyName();
|
|
|
+ orderCompanyId = tenant.getId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ final String finalCompanyName = orderCompanyName;
|
|
|
+ final Long finalCompanyId = orderCompanyId;
|
|
|
+
|
|
|
for (MainBackRecordVo vo : result.getRows()) {
|
|
|
// 1. 先查询候选人信息
|
|
|
MainBackCandidate candidate = candidateMapper.selectById(vo.getCandidateId());
|
|
|
@@ -72,15 +95,26 @@ public class MainBackRecordServiceImpl implements IMainBackRecordService {
|
|
|
// 2. 通过 student_id 查询最新的学员信息
|
|
|
MainStudent student = studentMapper.selectById(candidate.getStudentId());
|
|
|
if (student != null) {
|
|
|
- vo.setStudentNo(student.getStudentNo()); // 新增:学员编号
|
|
|
+ vo.setStudentNo(student.getStudentNo());
|
|
|
vo.setStudentName(student.getName());
|
|
|
vo.setStudentMobile(student.getMobile());
|
|
|
vo.setStudentIdCard(student.getIdCardNumber());
|
|
|
vo.setStudentGender(student.getGender());
|
|
|
vo.setStudentStatus(student.getStatus());
|
|
|
- vo.setStudentUserType(student.getUserType()); // 新增:用户类型
|
|
|
+ vo.setStudentUserType(student.getUserType());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 4. 填充供职公司
|
|
|
+ if (finalCompanyName != null) {
|
|
|
+ List<MainBackRecordVo.CompanyInfo> companies = new ArrayList<>();
|
|
|
+ MainBackRecordVo.CompanyInfo ci = new MainBackRecordVo.CompanyInfo();
|
|
|
+ ci.setId(finalCompanyId);
|
|
|
+ ci.setName(finalCompanyName);
|
|
|
+ ci.setStatus("发送");
|
|
|
+ companies.add(ci);
|
|
|
+ vo.setCompanies(companies);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return result;
|