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