Gqingci hace 1 día
padre
commit
5a1e5534ad

+ 0 - 2
ruoyi-admin/src/main/resources/application-prod.yml

@@ -274,5 +274,3 @@ justauth:
 tencent:
   map:
     geo:
-      # 企业入驻办公地址转经纬度所需的腾讯位置服务 WebService Key
-      key: "LA5BZ-BDQL7-NHIXK-P1H5G-EIVSH-GPBQY"

+ 0 - 5
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/config/TencentMapGeoProperties.java

@@ -9,11 +9,6 @@ import org.springframework.stereotype.Component;
 @ConfigurationProperties(prefix = "tencent.map.geo")
 public class TencentMapGeoProperties {
 
-    /**
-     * 腾讯位置服务 WebService Key
-     */
-    private String key;
-
     /**
      * 地址解析接口地址
      */

+ 14 - 0
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/domain/vo/MainBackRecordVo.java

@@ -8,6 +8,7 @@ import org.dromara.main.domain.MainBackRecord;
 import java.io.Serial;
 import java.io.Serializable;
 import java.time.LocalDateTime;
+import java.util.List;
 
 @Data
 @AutoMapper(target = MainBackRecord.class)
@@ -20,6 +21,7 @@ public class MainBackRecordVo implements Serializable {
     private Long orderId;
     private Long candidateId;
     private String status;
+    private Integer reportStatus;
     private String reportUrl;
     private LocalDateTime finishTime;
     private LocalDateTime createTime;
@@ -38,4 +40,16 @@ public class MainBackRecordVo implements Serializable {
     private String studentStatus;
     /** 用户类型(1付费用户 2普通用户 3黑名单) */
     private String studentUserType;
+
+    /** 系统内供职公司列表 */
+    private List<CompanyInfo> companies;
+
+    @Data
+    public static class CompanyInfo implements Serializable {
+        @Serial
+        private static final long serialVersionUID = 1L;
+        private Long id;
+        private String name;
+        private String status;
+    }
 }

+ 36 - 2
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/service/impl/MainBackRecordServiceImpl.java

@@ -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;

+ 7 - 2
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/service/impl/TencentMapCompanyGeoServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hutool.json.JSONUtil;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.dromara.common.core.exception.ServiceException;
+import org.dromara.common.core.service.ConfigService;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.main.config.TencentMapGeoProperties;
 import org.dromara.main.domain.dto.GeoPointDto;
@@ -24,6 +25,9 @@ import java.util.Map;
 @RequiredArgsConstructor
 public class TencentMapCompanyGeoServiceImpl implements CompanyGeoService {
 
+    private static final String TENCENT_MAP_GEO_KEY = "tencent.map.geo.key";
+
+    private final ConfigService configService;
     private final TencentMapGeoProperties tencentMapGeoProperties;
 
     @Override
@@ -31,12 +35,13 @@ public class TencentMapCompanyGeoServiceImpl implements CompanyGeoService {
         if (StringUtils.isBlank(address)) {
             throw new ServiceException("办公地址不能为空");
         }
-        if (StringUtils.isBlank(tencentMapGeoProperties.getKey())) {
+        String key = configService.getConfigValue(TENCENT_MAP_GEO_KEY);
+        if (StringUtils.isBlank(key)) {
             throw new ServiceException("未配置腾讯地图地理编码 Key");
         }
 
         Map<String, Object> params = new HashMap<>(4);
-        params.put("key", tencentMapGeoProperties.getKey());
+        params.put("key", key);
         params.put("address", address.trim());
         params.put("output", "json");