talent-card-admin/src/style.css
@@ -2256,17 +2256,23 @@ width: 42px; } .coupon-requirement-row .coupon-full-amount { .coupon-requirement-row .coupon-full-amount-control { display: flex; width: 168px; margin: 0 50px 0 10px; align-items: center; gap: 8px; white-space: nowrap; } .coupon-requirement-row .coupon-full-amount .el-input-group__append { padding: 0 0 0 8px; .coupon-requirement-row .coupon-full-amount-control .coupon-full-amount { width: 108px; } .coupon-requirement-row .coupon-full-amount-control > span { color: #334155; background: transparent; border: 0; box-shadow: none; font-size: 12px; line-height: 28px; white-space: nowrap; } talent-card-admin/src/views/MerchantCreateView.vue
@@ -3160,9 +3160,10 @@ <el-form-item class="coupon-edit-row coupon-requirement-row" label="使用要求" prop="fullAmount" :required="couponEditForm.useRequirement === 'full'"> <el-radio-group v-model="couponEditForm.useRequirement"> <el-radio label="full" class="coupon-full-radio">满</el-radio> <el-input v-model="couponEditForm.fullAmount" class="coupon-full-amount"> <template #append>元可用</template> </el-input> <div class="coupon-full-amount-control"> <el-input v-model="couponEditForm.fullAmount" class="coupon-full-amount" /> <span>元可用</span> </div> <el-radio label="none" class="coupon-none-radio">不限</el-radio> </el-radio-group> </el-form-item> talent-card-server/src/main/java/com/talentcard/server/business/portal/DependentCardApplyController.java
@@ -74,7 +74,7 @@ @Operation( summary = "修改重新提交被驳回的家属附属卡申请", description = "仅已驳回的申请可以重新提交;原申请保留不变,系统新增一条待审核申请记录" description = "仅已驳回的申请可以重新提交;系统更新原申请记录,保留申请编号并将状态恢复为待审核" ) @PostMapping("/{id}/resubmit") public ApiResponse<DependentCardApplyItemResponse> resubmit( talent-card-server/src/main/java/com/talentcard/server/service/DependentCardApplyService.java
@@ -1,5 +1,6 @@ package com.talentcard.server.service; import java.time.LocalDateTime; import java.util.List; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -157,31 +158,39 @@ if (!Integer.valueOf(DependentCardApply.STATUS_REJECTED).equals(apply.getStatus())) { throw new BusinessException(ErrorCode.CONFLICT, "仅已驳回的申请可以修改重新提交"); } DependentCardApply resubmitted = new DependentCardApply( BusinessIdGenerator.next("DCA"), apply.getTalentId(), apply.getTalentCardId(), apply.getTalentName(), apply.getTalentMobile(), apply.getTalentCardNo(), apply.getCardLevel(), request.dependentName().trim(), request.dependentMobile().trim(), request.dependentIdCardNo().trim().toUpperCase(), request.relation().trim() LocalDateTime applyTime = LocalDateTime.now(); int updated = mapper.update( null, Wrappers.<DependentCardApply>lambdaUpdate() .eq(DependentCardApply::getId, applyId) .eq(DependentCardApply::getTalentCardId, request.talentCardId()) .eq(DependentCardApply::getStatus, DependentCardApply.STATUS_REJECTED) .set(DependentCardApply::getDependentName, request.dependentName().trim()) .set(DependentCardApply::getDependentMobile, request.dependentMobile().trim()) .set(DependentCardApply::getDependentIdCardNo, request.dependentIdCardNo().trim().toUpperCase()) .set(DependentCardApply::getRelation, request.relation().trim()) .set(DependentCardApply::getApplyTime, applyTime) .set(DependentCardApply::getStatus, DependentCardApply.STATUS_PENDING_REVIEW) .set(DependentCardApply::getAuditBy, (Long) null) .set(DependentCardApply::getAuditTime, (LocalDateTime) null) .set(DependentCardApply::getAuditRemark, (String) null) ); if (mapper.insert(resubmitted) != 1) { throw new BusinessException(ErrorCode.INTERNAL_ERROR, "家属附属卡申请重新提交失败"); if (updated != 1) { throw new BusinessException(ErrorCode.CONFLICT, "申请状态已变化,请刷新后重试"); } recordStatus( resubmitted, null, apply, DependentCardApply.STATUS_REJECTED, DependentCardApply.STATUS_PENDING_REVIEW, "TALENT", resubmitted.getTalentId(), "用户基于已驳回申请重新提交,原申请ID:" + applyId apply.getTalentId(), "小程序修改后重新提交" ); return DependentCardApplyItemResponse.from(resubmitted); DependentCardApply updatedApply = mapper.selectById(applyId); if (updatedApply == null) { throw new BusinessException(ErrorCode.INTERNAL_ERROR, "家属附属卡申请重新提交失败"); } return DependentCardApplyItemResponse.from(updatedApply); } private DependentCardApply ownerCard(Long talentCardId) { requireTalentCardId(talentCardId); talent-card-server/src/test/java/com/talentcard/server/service/DependentCardApplyServiceTests.java
@@ -59,7 +59,7 @@ } @Test void resubmitCreatesANewApplicationAndKeepsRejectedApplicationUnchanged() { void resubmitUpdatesTheRejectedApplicationInsteadOfCreatingADuplicate() { DependentCardApply rejected = new DependentCardApply( "DCA-OLD", 12L, @@ -73,12 +73,18 @@ "510105199001011234", "配偶" ); setId(rejected, 99L); setStatus(rejected, DependentCardApply.STATUS_REJECTED); when(mapper.selectByIdForUpdate(99L)).thenReturn(rejected); when(mapper.insert(any(DependentCardApply.class))).thenAnswer(invocation -> { setId(invocation.getArgument(0), 100L); when(mapper.update(any(), any(Wrapper.class))).thenAnswer(invocation -> { setStatus(rejected, DependentCardApply.STATUS_PENDING_REVIEW); setField(rejected, "dependentName", "新家属"); setField(rejected, "dependentIdCardNo", "51010519900101123X"); setField(rejected, "dependentMobile", "13700000000"); setField(rejected, "relation", "子女"); return 1; }); when(mapper.selectById(99L)).thenReturn(rejected); when(statusLogMapper.insert(any(DependentCardApplyStatusLog.class))).thenReturn(1); DependentCardApplyItemResponse result = service.resubmit( @@ -92,28 +98,18 @@ ) ); ArgumentCaptor<DependentCardApply> applicationCaptor = ArgumentCaptor.forClass(DependentCardApply.class); verify(mapper).insert(applicationCaptor.capture()); DependentCardApply created = applicationCaptor.getValue(); assertThat(created.getId()).isEqualTo(100L); assertThat(created.getApplyNo()).startsWith("DCA").isNotEqualTo(rejected.getApplyNo()); assertThat(created.getTalentId()).isEqualTo(rejected.getTalentId()); assertThat(created.getTalentCardId()).isEqualTo(rejected.getTalentCardId()); assertThat(created.getDependentName()).isEqualTo("新家属"); assertThat(created.getDependentIdCardNo()).isEqualTo("51010519900101123X"); assertThat(created.getDependentMobile()).isEqualTo("13700000000"); assertThat(created.getRelation()).isEqualTo("子女"); assertThat(created.getStatus()).isEqualTo(DependentCardApply.STATUS_PENDING_REVIEW); assertThat(result.id()).isEqualTo(100L); verify(mapper, never()).insert(any(DependentCardApply.class)); verify(mapper).update(any(), any(Wrapper.class)); assertThat(result.id()).isEqualTo(99L); assertThat(result.status()).isEqualTo(DependentCardApply.STATUS_PENDING_REVIEW); assertThat(rejected.getStatus()).isEqualTo(DependentCardApply.STATUS_REJECTED); verify(mapper, never()).update(any(), any(Wrapper.class)); assertThat(result.statusText()).isEqualTo("待审核"); assertThat(rejected.getApplyNo()).isEqualTo("DCA-OLD"); ArgumentCaptor<DependentCardApplyStatusLog> logCaptor = ArgumentCaptor.forClass(DependentCardApplyStatusLog.class); verify(statusLogMapper).insert(logCaptor.capture()); assertThat(logCaptor.getValue().getApplyId()).isEqualTo(100L); assertThat(logCaptor.getValue().getApplyNo()).isEqualTo(created.getApplyNo()); assertThat(logCaptor.getValue().getFromStatus()).isNull(); assertThat(logCaptor.getValue().getApplyId()).isEqualTo(99L); assertThat(logCaptor.getValue().getApplyNo()).isEqualTo(rejected.getApplyNo()); assertThat(logCaptor.getValue().getFromStatus()).isEqualTo(DependentCardApply.STATUS_REJECTED); assertThat(logCaptor.getValue().getToStatus()).isEqualTo(DependentCardApply.STATUS_PENDING_REVIEW); }