yangys
2024-01-23 79493b5f18ce5f4719556348f33c1da367bbf252
处理workshop == null的空指针问题
已修改1个文件
18 ■■■■■ 文件已修改
mdc-parent/mdc-show/src/main/java/com/qianwen/mdc/service/MdcDataArchiveService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mdc-parent/mdc-show/src/main/java/com/qianwen/mdc/service/MdcDataArchiveService.java
@@ -110,13 +110,17 @@
            
            mdcUtilization.setCncSystem(account.getCncSystem());
            Machine mdcMachine = machineMapper.selectById(status.getMachineId());
            Workshop mdcWorkshop = workshopMapper.selectById(mdcMachine.getWorkshopId());
            Section mdcSection = sectionMapper.selectById(mdcMachine.getSectionId());
            mdcUtilization.setWorkshop(mdcWorkshop.getName());
            mdcUtilization.setSection(mdcSection.getName());
            mdcUtilization.setShift(mdcMachine.getShiftType());
            Machine machine = machineMapper.selectById(status.getMachineId());
            Workshop workshop = workshopMapper.selectById(machine.getWorkshopId());
            Section section = sectionMapper.selectById(machine.getSectionId());
            if(workshop != null) {
                mdcUtilization.setWorkshop(workshop.getName());
            }
            if(section != null) {
                mdcUtilization.setSection(section.getName());
            }
            mdcUtilization.setShift(machine.getShiftType());
            DateFormat df = new SimpleDateFormat("yyyyMMdd");
            mdcUtilization.setCdate(df.format((long) status.getTime() * 1000));