Browse Source

fix(train-backend): 派单/晋升闸口档案状态双值容错(active|approved 对齐 DDL)

liaoxg 1 day ago
parent
commit
7a620ebf73

+ 3 - 2
train-backend/src/main/java/com/train/service/impl/DispatchServiceImpl.java

@@ -144,7 +144,7 @@ public class DispatchServiceImpl implements DispatchService {
         if (!O_PENDING.equals(order.getStatus())) {
         if (!O_PENDING.equals(order.getStatus())) {
             return Result.error("仅待接单工单可指派");
             return Result.error("仅待接单工单可指派");
         }
         }
-        // 资质闸口:PromotionService.unlockCheck 接线(profile.status=approved 且 auth_level 已认证)
+        // 资质闸口:PromotionService.unlockCheck 接线(profile.status ∈ {active,approved} 且 auth_level 已认证)
         Result<Map<String, Object>> gate = promotionService.unlockCheck(workerId, serviceTypeBody(body.get("serviceType")));
         Result<Map<String, Object>> gate = promotionService.unlockCheck(workerId, serviceTypeBody(body.get("serviceType")));
         String gateMsg = gateData(gate, "allowed");
         String gateMsg = gateData(gate, "allowed");
         if (!"true".equals(gateMsg)) {
         if (!"true".equals(gateMsg)) {
@@ -330,7 +330,8 @@ public class DispatchServiceImpl implements DispatchService {
                     new LambdaQueryWrapper<TrainPractitionerProfile>()
                     new LambdaQueryWrapper<TrainPractitionerProfile>()
                             .eq(TrainPractitionerProfile::getUserId, m.getUserId())
                             .eq(TrainPractitionerProfile::getUserId, m.getUserId())
                             .last("LIMIT 1"));
                             .last("LIMIT 1"));
-            if (p == null || p.getStatus() == null || !"approved".equals(p.getStatus())) {
+            if (p == null || p.getStatus() == null
+                || (!"active".equals(p.getStatus()) && !"approved".equals(p.getStatus()))) {
                 continue; // 只有资质生效(档案 approved)者可派
                 continue; // 只有资质生效(档案 approved)者可派
             }
             }
             TrainUser u = trainUserMapper.selectById(m.getUserId());
             TrainUser u = trainUserMapper.selectById(m.getUserId());

+ 3 - 1
train-backend/src/main/java/com/train/service/impl/PromotionServiceImpl.java

@@ -217,7 +217,9 @@ public class PromotionServiceImpl implements PromotionService {
             return Result.success(data);
             return Result.success(data);
         }
         }
         data.put("authLevel", p.getAuthLevel());
         data.put("authLevel", p.getAuthLevel());
-        if (p.getStatus() == null || !"approved".equals(p.getStatus())) {
+        // 档案状态双值容错:DDL 值域为 active(语义事实源),兼容 M3 历史写盘的 approved
+        String _st = p.getStatus();
+        if (_st == null || (!"active".equals(_st) && !"approved".equals(_st))) {
             data.put("allowed", false);
             data.put("allowed", false);
             data.put("reason", "资质未生效");
             data.put("reason", "资质未生效");
             return Result.success(data);
             return Result.success(data);