wenminjie
2026-08-04 93414e8ee25852aca467213402585d0e65c08a4a
talent-card-server/src/main/java/com/talentcard/server/service/ServiceAppointmentApplicationService.java
@@ -19,8 +19,10 @@
import com.talentcard.server.common.SensitiveDataCrypto;
import com.talentcard.server.entity.ChildInformation;
import com.talentcard.server.entity.ServiceApplication;
import com.talentcard.server.entity.ServiceApplicationOperationLog;
import com.talentcard.server.mapper.ChildInformationMapper;
import com.talentcard.server.mapper.ServiceApplicationMapper;
import com.talentcard.server.mapper.ServiceApplicationOperationLogMapper;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -35,15 +37,18 @@
    private final ServiceApplicationMapper applicationMapper;
    private final ChildInformationMapper childInformationMapper;
    private final ServiceApplicationOperationLogMapper operationLogMapper;
    private final SensitiveDataCrypto sensitiveDataCrypto;
    public ServiceAppointmentApplicationService(
            ServiceApplicationMapper applicationMapper,
            ChildInformationMapper childInformationMapper,
            ServiceApplicationOperationLogMapper operationLogMapper,
            SensitiveDataCrypto sensitiveDataCrypto
    ) {
        this.applicationMapper = applicationMapper;
        this.childInformationMapper = childInformationMapper;
        this.operationLogMapper = operationLogMapper;
        this.sensitiveDataCrypto = sensitiveDataCrypto;
    }
@@ -80,6 +85,19 @@
        ServiceApplication saved = applicationMapper.selectById(application.getId());
        if (saved == null) {
            throw new BusinessException(ErrorCode.INTERNAL_ERROR, "预约申请保存失败");
        }
        ServiceApplicationOperationLog log = new ServiceApplicationOperationLog();
        log.setApplicationId(saved.getId());
        log.setApplicationNo(saved.getApplicationNo());
        log.setOperationType("SUBMIT");
        log.setAfterStatus(saved.getStatus());
        log.setOperatorType("TALENT");
        log.setOperatorId(saved.getTalentId());
        log.setOperatorName(saved.getTalentName());
        log.setRemark("提交预约申请");
        log.setCreatedAt(saved.getSubmittedAt());
        if (operationLogMapper.insert(log) != 1) {
            throw new BusinessException(ErrorCode.INTERNAL_ERROR, "预约申请操作日志保存失败");
        }
        return appResult(saved);
    }
@@ -580,4 +598,4 @@
    private String clean(String value) {
        return value == null ? "" : value.trim();
    }
}
}