mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
处理空指针问题
This commit is contained in:
@@ -88,8 +88,9 @@ public class DictionaryService extends BaseService<DictionaryEntity, DictionaryR
|
||||
ScriptExecResultDto result = scriptService.exec(resultDto);
|
||||
if (StringUtils.isNotEmpty(result.getStackTrace())) {
|
||||
log.warn(
|
||||
"执行脚本出错 id:{}\nparams:{}\nstacktrace:{}\nlogs:{}",
|
||||
"执行脚本出错 id:{} {} \nparams:{}\nstacktrace:{}\nlogs:{}",
|
||||
result.getId(),
|
||||
dict.getScript().getName(),
|
||||
result.getParams() + "",
|
||||
result.getStackTrace(),
|
||||
result.getLogs());
|
||||
|
||||
@@ -455,7 +455,13 @@ where 更新时间>='%s' and 更新时间<='%s'
|
||||
}
|
||||
|
||||
|
||||
if (CollectionUtils.isNotEmpty(request.getMzUserList())) {
|
||||
where += " and d.mz_user in :mzUserList ";
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(request.getPzUserList())) {
|
||||
where += " and d.pz_user in :pzUserList ";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ EntityManager em = ioc.getBean(EntityManager.class)
|
||||
|
||||
|
||||
return em.createQuery("select distinct goods from WeightDeviceDataEntity where goods like :q and organizationId = :organizationId order by goods limit 10")
|
||||
.setParameter("q", "%${(params as JsonNode).get("q").asText('')}%" as String)
|
||||
.setParameter("q", "%${(params as JsonNode).get("q")?.asText('') ?: ''}%" as String)
|
||||
.setParameter("organizationId", Ctx.currentUser().organizationId)
|
||||
.resultList
|
||||
.collect { it as String }
|
||||
|
||||
@@ -13,7 +13,7 @@ EntityManager em = ioc.getBean(EntityManager.class)
|
||||
|
||||
|
||||
return em.createQuery("select distinct mzUser from WeightDeviceDataEntity where mzUser like :q and organizationId = :organizationId order by mzUser limit 10")
|
||||
.setParameter("q", "%${(params as JsonNode).get("q").asText('')}%" as String)
|
||||
.setParameter("q", "%${(params as JsonNode).get("q")?.asText('') ?: ''}%" as String)
|
||||
.setParameter("organizationId", Ctx.currentUser().organizationId)
|
||||
.resultList
|
||||
.collect { it as String }
|
||||
|
||||
@@ -13,7 +13,7 @@ EntityManager em = ioc.getBean(EntityManager.class)
|
||||
|
||||
|
||||
return em.createQuery("select distinct plateNo from WeightDeviceDataEntity where plateNo like :q and organizationId = :organizationId order by plateNo limit 10")
|
||||
.setParameter("q", "%${(params as JsonNode).get("q").asText('')}%" as String)
|
||||
.setParameter("q", "%${(params as JsonNode).get("q")?.asText('') ?: ''}%" as String)
|
||||
.setParameter("organizationId", Ctx.currentUser().organizationId)
|
||||
.resultList
|
||||
.collect { it as String }
|
||||
|
||||
@@ -13,7 +13,7 @@ EntityManager em = ioc.getBean(EntityManager.class)
|
||||
|
||||
|
||||
return em.createQuery("select distinct pzUser from WeightDeviceDataEntity where pzUser like :q and organizationId = :organizationId order by pzUser limit 10")
|
||||
.setParameter("q", "%${(params as JsonNode).get("q").asText('')}%" as String)
|
||||
.setParameter("q", "%${(params as JsonNode).get("q")?.asText('') ?: ''}%" as String)
|
||||
.setParameter("organizationId", Ctx.currentUser().organizationId)
|
||||
.resultList
|
||||
.collect { it as String }
|
||||
|
||||
@@ -13,7 +13,7 @@ EntityManager em = ioc.getBean(EntityManager.class)
|
||||
|
||||
|
||||
return em.createQuery("select distinct receiveOrganization from WeightDeviceDataEntity where receiveOrganization like :q and organizationId = :organizationId order by receiveOrganization limit 10")
|
||||
.setParameter("q", "%${(params as JsonNode).get("q").asText('')}%" as String)
|
||||
.setParameter("q", "%${(params as JsonNode).get("q")?.asText('') ?: ''}%" as String)
|
||||
.setParameter("organizationId", Ctx.currentUser().organizationId)
|
||||
.resultList
|
||||
.collect { it as String }
|
||||
|
||||
@@ -13,7 +13,7 @@ EntityManager em = ioc.getBean(EntityManager.class)
|
||||
|
||||
|
||||
return em.createQuery("select distinct sendOrganization from WeightDeviceDataEntity where sendOrganization like :q and organizationId = :organizationId order by sendOrganization limit 10")
|
||||
.setParameter("q", "%${(params as JsonNode).get("q").asText('')}%" as String)
|
||||
.setParameter("q", "%${(params as JsonNode).get("q")?.asText('') ?: ''}%" as String)
|
||||
.setParameter("organizationId", Ctx.currentUser().organizationId)
|
||||
.resultList
|
||||
.collect { it as String }
|
||||
|
||||
@@ -13,7 +13,7 @@ EntityManager em = ioc.getBean(EntityManager.class)
|
||||
|
||||
|
||||
return em.createQuery("select distinct specification from WeightDeviceDataEntity where specification like :q and organizationId = :organizationId order by specification limit 10")
|
||||
.setParameter("q", "%${(params as JsonNode).get("q").asText('')}%" as String)
|
||||
.setParameter("q", "%${(params as JsonNode).get("q")?.asText('') ?: ''}%" as String)
|
||||
.setParameter("organizationId", Ctx.currentUser().organizationId)
|
||||
.resultList
|
||||
.collect { it as String }
|
||||
|
||||
Reference in New Issue
Block a user