package com.qianwen.smartman.modules.cps.convert; import java.util.ArrayList; import java.util.List; import com.qianwen.smartman.modules.cps.dto.WorkstationDTO; import com.qianwen.smartman.modules.cps.entity.Workstation; import com.qianwen.smartman.modules.cps.excel.WorkstationExcel; import com.qianwen.smartman.modules.cps.excel.WorkstationImport; import com.qianwen.smartman.modules.cps.vo.WorkstationRealTimeStatusVO; import com.qianwen.smartman.modules.cps.vo.WorkstationSubmitVO; import com.qianwen.smartman.modules.cps.vo.WorkstationVO; /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/convert/WorkstationConvertImpl.class */ public class WorkstationConvertImpl implements WorkstationConvert { @Override // org.springblade.modules.cps.convert.WorkstationConvert public Workstation convert(WorkstationSubmitVO workstationSaveVO) { if (workstationSaveVO == null) { return null; } Workstation workstation = new Workstation(); workstation.setId(workstationSaveVO.getId()); workstation.setCreateDept(workstationSaveVO.getCreateDept()); workstation.setStatus(workstationSaveVO.getStatus()); workstation.setAvatar(workstationSaveVO.getAvatar()); workstation.setCode(workstationSaveVO.getCode()); workstation.setName(workstationSaveVO.getName()); workstation.setType(workstationSaveVO.getType()); workstation.setCalendarCode(workstationSaveVO.getCalendarCode()); workstation.setCalendarCodeWaiting(workstationSaveVO.getCalendarCodeWaiting()); workstation.setDeviceType(workstationSaveVO.getDeviceType()); workstation.setProperties(workstationSaveVO.getProperties()); workstation.setTransmissionMethod(workstationSaveVO.getTransmissionMethod()); return workstation; } @Override // org.springblade.modules.cps.convert.WorkstationConvert public WorkstationVO convert(Workstation workstation) { if (workstation == null) { return null; } WorkstationVO workstationVO = new WorkstationVO(); workstationVO.setAvatar(workstation.getAvatar()); workstationVO.setId(workstation.getId()); workstationVO.setCode(workstation.getCode()); workstationVO.setName(workstation.getName()); workstationVO.setType(workstation.getType()); workstationVO.setCalendarCode(workstation.getCalendarCode()); workstationVO.setCalendarCodeWaiting(workstation.getCalendarCodeWaiting()); workstationVO.setStandardEfficiency(workstation.getStandardEfficiency()); workstationVO.setProductionCapacityGroup(workstation.getProductionCapacityGroup()); workstationVO.setDeviceType(workstation.getDeviceType()); workstationVO.setProperties(workstation.getProperties()); workstationVO.setCreateTime(workstation.getCreateTime()); workstationVO.setStatus(workstation.getStatus()); workstationVO.setTransmissionMethod(workstation.getTransmissionMethod()); workstationVO.setCreateDept(workstation.getCreateDept()); return workstationVO; } @Override // org.springblade.modules.cps.convert.WorkstationConvert public WorkstationDTO convertDTO(Workstation workstation) { if (workstation == null) { return null; } WorkstationDTO workstationDTO = new WorkstationDTO(); workstationDTO.setId(workstation.getId()); workstationDTO.setCode(workstation.getCode()); workstationDTO.setName(workstation.getName()); workstationDTO.setCalendarCode(workstation.getCalendarCode()); workstationDTO.setCreateDept(workstation.getCreateDept()); return workstationDTO; } @Override // org.springblade.modules.cps.convert.WorkstationConvert public WorkstationSubmitVO convert(WorkstationImport workstationImport) { if (workstationImport == null) { return null; } WorkstationSubmitVO workstationSubmitVO = new WorkstationSubmitVO(); workstationSubmitVO.setGroupId(workstationImport.getGroupId()); workstationSubmitVO.setCode(workstationImport.getCode()); workstationSubmitVO.setName(workstationImport.getName()); workstationSubmitVO.setType(workstationImport.getType()); workstationSubmitVO.setCalendarCode(workstationImport.getCalendarCode()); workstationSubmitVO.setLinkWay(workstationImport.getLinkWay()); workstationSubmitVO.setMachineId(workstationImport.getMachineId()); workstationSubmitVO.setMachineCode(workstationImport.getMachineCode()); workstationSubmitVO.setMachineName(workstationImport.getMachineName()); workstationSubmitVO.setMachinePinCode(workstationImport.getMachinePinCode()); workstationSubmitVO.setMachineShortCode(workstationImport.getMachineShortCode()); workstationSubmitVO.setCollectSwitch(workstationImport.getCollectSwitch()); return workstationSubmitVO; } @Override // org.springblade.modules.cps.convert.WorkstationConvert public List convertList(List workstationVOList) { if (workstationVOList == null) { return null; } List list = new ArrayList<>(workstationVOList.size()); for (WorkstationVO workstationVO : workstationVOList) { list.add(workstationVOToWorkstationExcel(workstationVO)); } return list; } @Override // org.springblade.modules.cps.convert.WorkstationConvert public List convert(List workstationVOList) { if (workstationVOList == null) { return null; } List list = new ArrayList<>(workstationVOList.size()); for (WorkstationVO workstationVO : workstationVOList) { list.add(workstationVOToWorkstation(workstationVO)); } return list; } @Override // org.springblade.modules.cps.convert.WorkstationConvert public WorkstationVO convertSaveVO(WorkstationSubmitVO workstationSaveVO) { if (workstationSaveVO == null) { return null; } WorkstationVO workstationVO = new WorkstationVO(); workstationVO.setAvatar(workstationSaveVO.getAvatar()); workstationVO.setId(workstationSaveVO.getId()); workstationVO.setGroupId(workstationSaveVO.getGroupId()); workstationVO.setCode(workstationSaveVO.getCode()); workstationVO.setName(workstationSaveVO.getName()); workstationVO.setType(workstationSaveVO.getType()); workstationVO.setCalendarCode(workstationSaveVO.getCalendarCode()); workstationVO.setCalendarCodeWaiting(workstationSaveVO.getCalendarCodeWaiting()); workstationVO.setExtendId(workstationSaveVO.getExtendId()); workstationVO.setMachineId(workstationSaveVO.getMachineId()); workstationVO.setMachineCode(workstationSaveVO.getMachineCode()); workstationVO.setMachineName(workstationSaveVO.getMachineName()); workstationVO.setMachineBrand(workstationSaveVO.getMachineBrand()); workstationVO.setMachinePinCode(workstationSaveVO.getMachinePinCode()); workstationVO.setMachineShortCode(workstationSaveVO.getMachineShortCode()); workstationVO.setDeviceType(workstationSaveVO.getDeviceType()); workstationVO.setProperties(workstationSaveVO.getProperties()); workstationVO.setCollectSwitch(workstationSaveVO.getCollectSwitch()); workstationVO.setStatus(workstationSaveVO.getStatus()); workstationVO.setTransmissionMethod(workstationSaveVO.getTransmissionMethod()); workstationVO.setCreateDept(workstationSaveVO.getCreateDept()); return workstationVO; } @Override // org.springblade.modules.cps.convert.WorkstationConvert public List convertRealTimeStatus(List records) { if (records == null) { return null; } List list = new ArrayList<>(records.size()); for (WorkstationVO workstationVO : records) { list.add(convertRealTimesStatus(workstationVO)); } return list; } @Override // org.springblade.modules.cps.convert.WorkstationConvert public WorkstationRealTimeStatusVO convertRealTimesStatus(WorkstationVO workstationVO) { if (workstationVO == null) { return null; } WorkstationRealTimeStatusVO workstationRealTimeStatusVO = new WorkstationRealTimeStatusVO(); workstationRealTimeStatusVO.setId(workstationVO.getId()); workstationRealTimeStatusVO.setCode(workstationVO.getCode()); workstationRealTimeStatusVO.setName(workstationVO.getName()); workstationRealTimeStatusVO.setAvatar(workstationVO.getAvatar()); workstationRealTimeStatusVO.setGroupId(workstationVO.getGroupId()); workstationRealTimeStatusVO.setGroupName(workstationVO.getGroupName()); workstationRealTimeStatusVO.setCalendarCode(workstationVO.getCalendarCode()); workstationRealTimeStatusVO.setCalendarName(workstationVO.getCalendarName()); workstationRealTimeStatusVO.setMachineId(workstationVO.getMachineId()); workstationRealTimeStatusVO.setMachineCode(workstationVO.getMachineCode()); workstationRealTimeStatusVO.setMachineName(workstationVO.getMachineName()); workstationRealTimeStatusVO.setMachineBrand(workstationVO.getMachineBrand()); if (workstationVO.getCreateDept() != null) { workstationRealTimeStatusVO.setCreateDept(String.valueOf(workstationVO.getCreateDept())); } return workstationRealTimeStatusVO; } protected WorkstationExcel workstationVOToWorkstationExcel(WorkstationVO workstationVO) { if (workstationVO == null) { return null; } WorkstationExcel workstationExcel = new WorkstationExcel(); workstationExcel.setCode(workstationVO.getCode()); workstationExcel.setName(workstationVO.getName()); workstationExcel.setGroupName(workstationVO.getGroupName()); workstationExcel.setCalendarCode(workstationVO.getCalendarCode()); workstationExcel.setMachineCode(workstationVO.getMachineCode()); workstationExcel.setMachineName(workstationVO.getMachineName()); workstationExcel.setMachinePinCode(workstationVO.getMachinePinCode()); workstationExcel.setMachineShortCode(workstationVO.getMachineShortCode()); workstationExcel.setType(workstationVO.getType()); return workstationExcel; } protected Workstation workstationVOToWorkstation(WorkstationVO workstationVO) { if (workstationVO == null) { return null; } Workstation workstation = new Workstation(); workstation.setId(workstationVO.getId()); workstation.setCreateDept(workstationVO.getCreateDept()); workstation.setCreateTime(workstationVO.getCreateTime()); workstation.setStatus(workstationVO.getStatus()); workstation.setAvatar(workstationVO.getAvatar()); workstation.setCode(workstationVO.getCode()); workstation.setName(workstationVO.getName()); workstation.setType(workstationVO.getType()); workstation.setCalendarCode(workstationVO.getCalendarCode()); workstation.setCalendarCodeWaiting(workstationVO.getCalendarCodeWaiting()); workstation.setStandardEfficiency(workstationVO.getStandardEfficiency()); workstation.setProductionCapacityGroup(workstationVO.getProductionCapacityGroup()); workstation.setDeviceType(workstationVO.getDeviceType()); workstation.setProperties(workstationVO.getProperties()); workstation.setTransmissionMethod(workstationVO.getTransmissionMethod()); return workstation; } }