Browse Source

判断空指针修改

yusm 1 tháng trước cách đây
mục cha
commit
d3384dfdf2

+ 1 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/WxCorpInfoController.java

@@ -366,7 +366,7 @@ public class WxCorpInfoController {
                             JSONArray departments = value.getJSONArray("departments");
                             String openapi_id = departments.getJSONObject(0).getString("openapi_id");
                             if (org.apache.commons.lang3.StringUtils.isNotEmpty(openapi_id)){
-                                Optional<Department> first1 = departmentList.stream().filter(d -> d.getCorpwxDeptid().equals(Integer.valueOf(openapi_id))).findFirst();
+                                Optional<Department> first1 = departmentList.stream().filter(d ->d.getCorpwxDeptid()!=null&&Integer.valueOf(openapi_id).equals(d.getCorpwxDeptid())).findFirst();
                                 if(first1.isPresent()){
                                     plan.setStationId(first1.get().getDepartmentId());
                                     plan.setStationName(first1.get().getDepartmentName());