|
|
@@ -110,6 +110,37 @@ public class DraftService {
|
|
110
|
110
|
return toDetail(draft, listFields(draftId));
|
|
111
|
111
|
}
|
|
112
|
112
|
|
|
|
113
|
+ /**
|
|
|
114
|
+ * 公开查询草稿详情(无需登录):按小程序码 scene(订单编号)定位订单 → 草稿。
|
|
|
115
|
+ */
|
|
|
116
|
+ public DraftDetailResponse getPublicDetailByScene(String scene) {
|
|
|
117
|
+ if (!StringUtils.hasText(scene)) {
|
|
|
118
|
+ throw new BizException(ErrorCode.BAD_REQUEST, "scene 不能为空");
|
|
|
119
|
+ }
|
|
|
120
|
+ String sceneValue = scene.trim();
|
|
|
121
|
+ FeEmploymentOrder order = feEmploymentOrderMapper.selectOne(new LambdaQueryWrapper<FeEmploymentOrder>()
|
|
|
122
|
+ .eq(FeEmploymentOrder::getOrderNo, sceneValue)
|
|
|
123
|
+ .orderByDesc(FeEmploymentOrder::getId)
|
|
|
124
|
+ .last("LIMIT 1"));
|
|
|
125
|
+ if (order == null) {
|
|
|
126
|
+ FeRegistrationBatch batch = feRegistrationBatchMapper.selectOne(new LambdaQueryWrapper<FeRegistrationBatch>()
|
|
|
127
|
+ .eq(FeRegistrationBatch::getQrToken, sceneValue)
|
|
|
128
|
+ .orderByDesc(FeRegistrationBatch::getId)
|
|
|
129
|
+ .last("LIMIT 1"));
|
|
|
130
|
+ if (batch != null) {
|
|
|
131
|
+ order = feEmploymentOrderMapper.selectById(batch.getOrderId());
|
|
|
132
|
+ }
|
|
|
133
|
+ }
|
|
|
134
|
+ if (order == null || order.getDraftId() == null) {
|
|
|
135
|
+ throw new BizException(ErrorCode.NOT_FOUND, "未找到对应用工信息");
|
|
|
136
|
+ }
|
|
|
137
|
+ FeEmploymentDraft draft = feEmploymentDraftMapper.selectById(order.getDraftId());
|
|
|
138
|
+ if (draft == null) {
|
|
|
139
|
+ throw new BizException(ErrorCode.NOT_FOUND, "草稿不存在");
|
|
|
140
|
+ }
|
|
|
141
|
+ return toDetail(draft, listFields(draft.getId()));
|
|
|
142
|
+ }
|
|
|
143
|
+
|
|
113
|
144
|
@Transactional(rollbackFor = Exception.class)
|
|
114
|
145
|
public DraftDetailResponse update(Long userId, Long draftId, DraftUpdateRequest request) {
|
|
115
|
146
|
FeEmploymentDraft draft = requireOwned(userId, draftId);
|