修补空指针报错

dev
liuguijing 2 years ago
parent 860025b61a
commit c0af8cca0c

@ -30,32 +30,32 @@ import java.util.List;
@SpringBootTest @SpringBootTest
class XymanagerAdminApplicationTests { class XymanagerAdminApplicationTests {
@Autowired // @Autowired
TerminalsDao terminalsDao; // TerminalsDao terminalsDao;
@Autowired // @Autowired
ScheduleDetailsDao scheduleDetailsDao; // ScheduleDetailsDao scheduleDetailsDao;
@Autowired // @Autowired
SchedulesDao schedulesDao; // SchedulesDao schedulesDao;
@Autowired // @Autowired
LinesDao linesDao; // LinesDao linesDao;
@Autowired // @Autowired
private DyLevelDao dyLevelDao; // private DyLevelDao dyLevelDao;
//
@Autowired // @Autowired
private TerminalPhotoDao terminalPhotoDao; // private TerminalPhotoDao terminalPhotoDao;
//
@Autowired // @Autowired
private TerminalSchedulesTempDao terminalSchedulesTempDao; // private TerminalSchedulesTempDao terminalSchedulesTempDao;
//
@Autowired // @Autowired
private TerminalScheduleDao terminalScheduleDao; // private TerminalScheduleDao terminalScheduleDao;
@Autowired // @Autowired
private RequestResultsDao requestResultsDao; // private RequestResultsDao requestResultsDao;
@Autowired // @Autowired
private TerminalImgAlarmParamsDao terminalImgAlarmParamsDao; // private TerminalImgAlarmParamsDao terminalImgAlarmParamsDao;
//
@Autowired // @Autowired
private CacheService cacheService; // private CacheService cacheService;
@Test @Test
void contextLoads() { void contextLoads() {
@ -328,6 +328,15 @@ class XymanagerAdminApplicationTests {
// DateTime dateTime4 = MyDateUtils.offsetDay(date, -4); // DateTime dateTime4 = MyDateUtils.offsetDay(date, -4);
// System.out.println(dateTime1.toString()); // System.out.println(dateTime1.toString());
ArrayList<String> strlist = new ArrayList<>();
strlist.add("dsfad");
strlist.add("dsaffad");
strlist.add("dserefad");
strlist.add("dsfa3432d");
String[] array =new String[strlist.size()];
strlist.toArray(array);
System.out.println(array.toString());
} }
} }

@ -153,7 +153,11 @@ public class TerminalUtils {
} }
} }
photosBean.setChannelid(channelid); photosBean.setChannelid(channelid);
photosBean.setChannnelname(termchannelMap.get(channelid).getChannelName()); if (termchannelMap != null) {
if (termchannelMap.get(channelid) != null) {
photosBean.setChannnelname(termchannelMap.get(channelid).getChannelName());
}
}
if (termchannelMapMap != null) { if (termchannelMapMap != null) {
TerminalChannelMapper terminalChannelMapper = termchannelMapMap.get(termid + "#" + channelid); TerminalChannelMapper terminalChannelMapper = termchannelMapMap.get(termid + "#" + channelid);

Loading…
Cancel
Save