| | |
| | | import com.smartor.service.IHospitalRecordService; |
| | | import com.smartor.service.IHospitalUserinfoService; |
| | | import com.smartor.service.IServiceThirdDataService; |
| | | import com.smartor.yiwudataanalysis.ADT_A01; |
| | | import com.smartor.yiwudataanalysis.ADT_A03; |
| | | import lombok.extern.log4j.Log4j; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | * @author ruoyi |
| | | * @date 2023-10-10 |
| | | */ |
| | | @Log4j |
| | | @Slf4j |
| | | @Service |
| | | public class ServiceThirdDataServiceImpl implements IServiceThirdDataService { |
| | | |
| | |
| | | @Override |
| | | public List<ServiceThirdData> queryList(ServiceThirdData serviceThirdData) { |
| | | |
| | | log.info("------serviceThirdData的入参:{}", serviceThirdData); |
| | | List<ServiceThirdData> serviceThirdDataList = serviceThirdDataMapper.selectServiceThirdDataList(serviceThirdData); |
| | | log.info("------serviceThirdDataList获取数据的数量:{}", serviceThirdDataList.size()); |
| | | for (ServiceThirdData std : serviceThirdDataList) { |
| | | PipeParser parser = new PipeParser(); |
| | | Message message = null; |
| | |
| | | dataInfo = dataInfo.replaceAll("\n", ""); |
| | | dataInfo = dataInfo.substring(0, dataInfo.length() - 1); |
| | | message = parser.parse(dataInfo); |
| | | List<Object> objectList = new ArrayList<>(); |
| | | if (serviceThirdData.getDataType().equals("ADT^A03")) { |
| | | ADT_A03 adt_a03 = new ADT_A03(); |
| | | objectList = adt_a03.explainPID(message, dataInfo); |
| | | } else if (serviceThirdData.getDataType().equals("ADT^A01")) { |
| | | ADT_A01 adt_a01 = new ADT_A01(); |
| | | objectList = adt_a01.explainPID(message, dataInfo); |
| | | } |
| | | |
| | | List<Object> objectList = adt_a03.explainPID(message, dataInfo); |
| | | HospitalRecord hospitalRecord = (HospitalRecord) objectList.get(0); |
| | | log.info("hospitalRecord的值为:{}", hospitalRecord); |
| | | iHospitalRecordService.insertHospitalRecord(hospitalRecord); |
| | | |
| | | HospitalUserinfo hospitalUserinfo = (HospitalUserinfo) objectList.get(1); |
| | | Date currentTime = new Date(); |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String formattedDate = formatter.format(currentTime); |
| | | hospitalUserinfo.setCreateTime(formattedDate); |
| | | iHospitalUserinfoService.insertHospitalUserinfo(hospitalUserinfo); |
| | | |
| | | int ii = serviceThirdDataMapper.updateIsDeal(std.getId()); |