Browse Source

增加与ai大模型对话

wwh 7 hours ago
parent
commit
2109ba68fb

+ 2 - 1
doc/灵活用工-mysql.sql

@@ -488,6 +488,7 @@ CREATE TABLE `fe_worker_registration` (
488 488
   `id_card_no_enc` TEXT COMMENT '登记身份证密文。可空;高度敏感。',
489 489
   `bank_account_enc` TEXT COMMENT '登记银行卡密文。可空;高度敏感。',
490 490
   `confirmed_work_type` VARCHAR(100) COMMENT '临时工确认的工种或具体任务描述。提交时勾选或填写。可空。',
491
+  `third_party_source` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否第三方人力来源。0=否(有临时工/人员登记);1=是(无临时工,从第三方人力平台匹配)。非空,默认 0。',
491 492
   `reg_status` VARCHAR(20)     NOT NULL DEFAULT 'pending' COMMENT '登记流程状态。枚举:pending=待登记;registering=填写中;under_review=待企业审核;contract_signing=待签约(审核通过);completed=已完成;verify_failed=实名核验失败;rejected=企业驳回。非空,默认 pending。',
492 493
   `fail_reason` TEXT COMMENT '失败或企业驳回原因。可空。',
493 494
   `submitted_at` datetime COMMENT '临时工点击提交时间。可空。',
@@ -501,7 +502,7 @@ CREATE TABLE `fe_worker_registration` (
501 502
   PRIMARY KEY (`id`),
502 503
   KEY `idx_fe_worker_reg_batch` (`batch_id`, `reg_status`),
503 504
   KEY `idx_fe_worker_reg_order` (`order_id`)
504
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='批次登记记录表,记录每个临时工在某一 fe_registration_batch 下的一次登记全过程。reg_status 驱动进度页统计、催办与审核;关联 fe_worker 档案,敏感证件信息加密存储。batch_id 暂无数据库外键。';
505
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='批次登记记录表,记录每个临时工在某一 fe_registration_batch 下的一次登记全过程。third_party_source 区分是否第三方人力平台匹配;reg_status 驱动进度页统计、催办与审核;关联 fe_worker 档案,敏感证件信息加密存储。batch_id 暂无数据库外键。';
505 506
 
506 507
 DROP TABLE IF EXISTS `fe_worker_consent`;
507 508
 CREATE TABLE `fe_worker_consent` (

+ 3 - 1
doc/灵活用工.sql

@@ -530,6 +530,7 @@ CREATE TABLE fe_worker_registration (
530 530
     id_card_no_enc      TEXT,
531 531
     bank_account_enc    TEXT,
532 532
     confirmed_work_type VARCHAR(100),                               -- 工种或任务确认
533
+    third_party_source  BOOLEAN         NOT NULL DEFAULT FALSE,     -- 是否第三方人力来源:FALSE=有临时工;TRUE=无临时工从第三方人力平台匹配
533 534
     reg_status          VARCHAR(20)     NOT NULL DEFAULT 'pending', -- pending/registering/under_review/contract_signing/completed/verify_failed/rejected
534 535
     fail_reason         TEXT,
535 536
     submitted_at        TIMESTAMPTZ,
@@ -1235,7 +1236,7 @@ COMMENT ON COLUMN fe_worker.create_time IS '档案创建时间。非空。';
1235 1236
 COMMENT ON COLUMN fe_worker.update_time IS '档案信息或核验状态变更时更新。非空。';
1236 1237
 COMMENT ON COLUMN fe_worker.del_flag IS '逻辑删除标记。枚举:0=正常;1=已删除。非空,默认 0。';
1237 1238
 
1238
-COMMENT ON TABLE fe_worker_registration IS '批次登记记录表,记录每个临时工在某一 fe_registration_batch 下的一次登记全过程。reg_status 驱动进度页统计、催办与审核;关联 fe_worker 档案,敏感证件信息加密存储。';
1239
+COMMENT ON TABLE fe_worker_registration IS '批次登记记录表,记录每个临时工在某一 fe_registration_batch 下的一次登记全过程。third_party_source 区分是否第三方人力平台匹配;reg_status 驱动进度页统计、催办与审核;关联 fe_worker 档案,敏感证件信息加密存储。';
1239 1240
 COMMENT ON COLUMN fe_worker_registration.id IS '表主键,自增。临时工打开登记页或提交时创建。非空。';
1240 1241
 COMMENT ON COLUMN fe_worker_registration.batch_id IS '所属登记批次 fe_registration_batch.id(逻辑关联,无数据库外键)。非空;索引 idx_fe_worker_reg_batch。';
1241 1242
 COMMENT ON COLUMN fe_worker_registration.order_id IS '关联订单,外键。冗余便于按订单查登记列表。非空;索引 idx_fe_worker_reg_order。';
@@ -1247,6 +1248,7 @@ COMMENT ON COLUMN fe_worker_registration.mobile_mask IS '登记手机号脱敏
1247 1248
 COMMENT ON COLUMN fe_worker_registration.id_card_no_enc IS '登记身份证密文。可空;高度敏感。';
1248 1249
 COMMENT ON COLUMN fe_worker_registration.bank_account_enc IS '登记银行卡密文。可空;高度敏感。';
1249 1250
 COMMENT ON COLUMN fe_worker_registration.confirmed_work_type IS '临时工确认的工种或具体任务描述。提交时勾选或填写。可空。';
1251
+COMMENT ON COLUMN fe_worker_registration.third_party_source IS '是否第三方人力来源。FALSE=否(有临时工/人员登记);TRUE=是(无临时工,从第三方人力平台匹配)。非空,默认 FALSE。';
1250 1252
 COMMENT ON COLUMN fe_worker_registration.reg_status IS '登记流程状态。枚举:pending=待登记;registering=填写中;under_review=待企业审核;contract_signing=待签约(审核通过);completed=已完成;verify_failed=实名核验失败;rejected=企业驳回。非空,默认 pending。';
1251 1253
 COMMENT ON COLUMN fe_worker_registration.fail_reason IS '失败或企业驳回原因。可空。';
1252 1254
 COMMENT ON COLUMN fe_worker_registration.submitted_at IS '临时工点击提交时间。可空。';

+ 17 - 0
huimv-employment/fe-dao/src/main/java/com/huimv/employment/dao/entity/FeWorkerRegistration.java

@@ -36,6 +36,15 @@ public class FeWorkerRegistration {
36 36
 
37 37
     private String confirmedWorkType;
38 38
 
39
+    /**
40
+     * 是否第三方人力来源。
41
+     * <ul>
42
+     *   <li>0:否(有临时工 / 人员登记)</li>
43
+     *   <li>1:是(无临时工,从第三方人力平台匹配)</li>
44
+     * </ul>
45
+     */
46
+    private Integer thirdPartySource;
47
+
39 48
     /** pending / registering / under_review / contract_signing / completed / verify_failed / rejected */
40 49
     private String regStatus;
41 50
 
@@ -146,6 +155,14 @@ public class FeWorkerRegistration {
146 155
         this.confirmedWorkType = confirmedWorkType;
147 156
     }
148 157
 
158
+    public Integer getThirdPartySource() {
159
+        return thirdPartySource;
160
+    }
161
+
162
+    public void setThirdPartySource(Integer thirdPartySource) {
163
+        this.thirdPartySource = thirdPartySource;
164
+    }
165
+
149 166
     public String getRegStatus() {
150 167
         return regStatus;
151 168
     }

+ 1 - 0
huimv-employment/fe-service/src/main/java/com/huimv/employment/service/registration/RegistrationBatchService.java

@@ -812,6 +812,7 @@ public class RegistrationBatchService {
812 812
             item.setWorkerId(reg.getWorkerId());
813 813
             item.setRealName(reg.getRealName());
814 814
             item.setConfirmedWorkType(reg.getConfirmedWorkType());
815
+            item.setThirdPartySource(reg.getThirdPartySource());
815 816
             item.setMobileMask(reg.getMobileMask());
816 817
             item.setRegStatus(reg.getRegStatus());
817 818
             item.setStatusTag(toStatusTag(reg.getRegStatus()));

+ 18 - 0
huimv-employment/fe-service/src/main/java/com/huimv/employment/service/registration/WorkerRegistrationService.java

@@ -40,6 +40,10 @@ public class WorkerRegistrationService {
40 40
     private static final String REG_REJECTED = "rejected";
41 41
     private static final String APPLY_SUCCESS = "success";
42 42
     private static final String APPLY_ALREADY = "already_applied";
43
+    /** 订单临时工来源:无临时工 → 第三方人力平台匹配 */
44
+    private static final String WORKER_SOURCE_RECRUIT = "recruit";
45
+    private static final int THIRD_PARTY_NO = 0;
46
+    private static final int THIRD_PARTY_YES = 1;
43 47
 
44 48
     private final FeRegistrationBatchMapper feRegistrationBatchMapper;
45 49
     private final FeEmploymentOrderMapper feEmploymentOrderMapper;
@@ -121,6 +125,7 @@ public class WorkerRegistrationService {
121 125
         reg.setIdCardNoEnc(worker.getIdCardNoEnc());
122 126
         reg.setBankAccountEnc(worker.getBankAccountEnc());
123 127
         reg.setConfirmedWorkType(confirmedWorkType);
128
+        reg.setThirdPartySource(resolveThirdPartySource(order));
124 129
         reg.setRegStatus(REG_COMPLETED);
125 130
         reg.setSubmittedAt(now);
126 131
         reg.setReviewedAt(now);
@@ -257,6 +262,18 @@ public class WorkerRegistrationService {
257 262
         }
258 263
     }
259 264
 
265
+    /**
266
+     * 按订单 worker_source 判定登记记录是否第三方人力来源:
267
+     * {@code recruit}=无临时工 → 1;其余(含 existing)→ 0。
268
+     */
269
+    private static int resolveThirdPartySource(FeEmploymentOrder order) {
270
+        if (order != null && WORKER_SOURCE_RECRUIT.equalsIgnoreCase(
271
+                order.getWorkerSource() != null ? order.getWorkerSource().trim() : null)) {
272
+            return THIRD_PARTY_YES;
273
+        }
274
+        return THIRD_PARTY_NO;
275
+    }
276
+
260 277
     private void assertBatchHasCapacity(FeRegistrationBatch batch) {
261 278
         int expected = batch.getExpectedCount() != null ? batch.getExpectedCount() : 0;
262 279
         int registered = batch.getRegisteredCount() != null ? batch.getRegisteredCount() : 0;
@@ -287,6 +304,7 @@ public class WorkerRegistrationService {
287 304
         response.setBatchNo(batch.getBatchNo());
288 305
         response.setOrderNo(order.getOrderNo());
289 306
         response.setRegStatus(reg.getRegStatus());
307
+        response.setThirdPartySource(reg.getThirdPartySource());
290 308
         response.setMessage(message);
291 309
         return response;
292 310
     }

+ 12 - 0
huimv-employment/fe-service/src/main/java/com/huimv/employment/service/registration/dto/RegistrationBatchWorkerItemResponse.java

@@ -24,6 +24,10 @@ public class RegistrationBatchWorkerItemResponse {
24 24
     @Schema(description = "确认工种(申请登记时选择,对应订单用工明细 job_type)", example = "仓库搬运")
25 25
     private String confirmedWorkType;
26 26
 
27
+    @JsonProperty("third_party_source")
28
+    @Schema(description = "是否第三方人力来源:0=否(人员登记);1=是(无临时工,第三方平台匹配)", example = "0")
29
+    private Integer thirdPartySource;
30
+
27 31
     @JsonProperty("mobile_mask")
28 32
     @Schema(description = "脱敏手机号", example = "138****1234")
29 33
     private String mobileMask;
@@ -80,6 +84,14 @@ public class RegistrationBatchWorkerItemResponse {
80 84
         this.confirmedWorkType = confirmedWorkType;
81 85
     }
82 86
 
87
+    public Integer getThirdPartySource() {
88
+        return thirdPartySource;
89
+    }
90
+
91
+    public void setThirdPartySource(Integer thirdPartySource) {
92
+        this.thirdPartySource = thirdPartySource;
93
+    }
94
+
83 95
     public String getMobileMask() {
84 96
         return mobileMask;
85 97
     }

+ 12 - 0
huimv-employment/fe-service/src/main/java/com/huimv/employment/service/registration/dto/WorkerRegistrationApplyResponse.java

@@ -25,6 +25,10 @@ public class WorkerRegistrationApplyResponse {
25 25
     @Schema(description = "登记状态", example = "under_review")
26 26
     private String regStatus;
27 27
 
28
+    @JsonProperty("third_party_source")
29
+    @Schema(description = "是否第三方人力来源:0=否;1=是(无临时工从第三方平台匹配)", example = "0")
30
+    private Integer thirdPartySource;
31
+
28 32
     @Schema(description = "提示文案")
29 33
     private String message;
30 34
 
@@ -68,6 +72,14 @@ public class WorkerRegistrationApplyResponse {
68 72
         this.regStatus = regStatus;
69 73
     }
70 74
 
75
+    public Integer getThirdPartySource() {
76
+        return thirdPartySource;
77
+    }
78
+
79
+    public void setThirdPartySource(Integer thirdPartySource) {
80
+        this.thirdPartySource = thirdPartySource;
81
+    }
82
+
71 83
     public String getMessage() {
72 84
         return message;
73 85
     }