| | |
| | | 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; |
| | |
| | | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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); |
| | | } |
| | |
| | | private String clean(String value) { |
| | | return value == null ? "" : value.trim(); |
| | | } |
| | | } |
| | | } |