package com.jiayue.insu.inclientqn.service; import cn.hutool.core.util.StrUtil; import com.jiayue.insu.inclientqn.constant.CommonStant; import com.jiayue.insu.inclientqn.entity.Record; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.stereotype.Service; import java.time.LocalDateTime; /** * @description: 回传数据文件解析 * @author: yuanhao * @createDate: 2022/6/17 * @version: 1.0 */ @Service @Slf4j @RequiredArgsConstructor @RefreshScope public class BackDataAnalysisService { @Value("${backdata.filepath}") private String backFilePath; private final RecordService recordService; private final StationService stationService; /** * 解析回传数据文件 */ public void fileAnalysis(){ Record record = new Record(); record.setType(CommonStant.RECORD_TYPE_BACK_DATA_FILE); //获取扫描文件路径 if(StrUtil.isEmpty(backFilePath)){ backFilePath = stationService.findThis().getBackFilePath(); } //TODO 文件解析 record.setCreateTime(LocalDateTime.now()); recordService.save(record); System.out.println(backFilePath); } }