Commit a6f26d4f authored by gaodongdong's avatar gaodongdong

修复bug

parent 1231e31c
...@@ -199,40 +199,45 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -199,40 +199,45 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
countPerson.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON); countPerson.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON);
QueryWrapper<OrgUsr> personNumWrapper = new QueryWrapper<OrgUsr>(); QueryWrapper<OrgUsr> personNumWrapper = new QueryWrapper<OrgUsr>();
personNumWrapper.allEq(countPerson); personNumWrapper.allEq(countPerson);
resultMap.put("personNum", count(personNumWrapper)); int personNum = count(personNumWrapper);
QueryWrapper<AlertFormValue> companyWrapper = new QueryWrapper<AlertFormValue>(); resultMap.put("personNum", personNum);
companyWrapper.eq("alert_called_id", company.getSequenceNbr()); if (0 == personNum) {
continue;
}
List<Map<String, Object>> personList = new ArrayList<>(); List<Map<String, Object>> personList = new ArrayList<>();
if (alertFormValueServiceImpl.list(companyWrapper).size() != 0) {
// 查询动态表单Phone // 查询动态表单Phone
Map<String, Object> phone = new HashMap<>(); Map<String, Object> phone = new HashMap<>();
phone.put("alert_called_id", company.getSequenceNbr()); phone.put("alert_called_id", company.getSequenceNbr());
phone.put("field_code", "companyPhone"); phone.put("field_code", "companyPhone");
QueryWrapper<AlertFormValue> phoneWrapper = new QueryWrapper<AlertFormValue>(); QueryWrapper<AlertFormValue> phoneWrapper = new QueryWrapper<AlertFormValue>();
phoneWrapper.allEq(phone); phoneWrapper.allEq(phone);
AlertFormValue phoneValue = alertFormValueServiceImpl.getOne(phoneWrapper); AlertFormValue phoneValue = alertFormValueServiceImpl.getOne(phoneWrapper);
if (phoneValue == null) { if (phoneValue == null) {
throw new Exception("表单数据错误"); resultMap.put("tel", "");
} } else {
resultMap.put("tel", phoneValue.getFieldValue()); resultMap.put("tel", phoneValue.getFieldValue());
// 获取单位人员列表信息
personList = listPerson(company.getSequenceNbr()+"").stream().map( p -> {
Map<String, Object> person = new HashMap<>();
person.put("tel", p.get("telephone"));
person.put("img", p.get("personImg"));
person.put("id", p.get("sequenceNbr"));
person.put("name", p.get("bizOrgName"));
person.put("zhiwei", p.get("administrativePositionCode"));
person.put("unit", p.get("fireManagementPostCode"));
return person;
}).collect(Collectors.toList());
} }
// 获取单位人员列表信息
personList = listPerson(company.getSequenceNbr()+"").stream().map( p -> {
Map<String, Object> person = new HashMap<>();
person.put("tel", getValue(p.get("telephone"), null));
person.put("img", getValue(p.get("personImg"), null));
person.put("id", getValue(p.get("sequenceNbr"), null));
person.put("name", getValue(p.get("bizOrgName"), null));
person.put("zhiwei", getValue(p.get("administrativePositionCode"), null));
person.put("unit", getValue(p.get("fireManagementPostCode"), null));
return person;
}).collect(Collectors.toList());
resultMap.put("children", personList); resultMap.put("children", personList);
companyPersonMsg.add(resultMap); companyPersonMsg.add(resultMap);
} }
return companyPersonMsg; return companyPersonMsg;
} }
private Object getValue(Object obj, Object defaultValue) {
return ObjectUtils.isEmpty(obj) ? defaultValue : obj;
}
public List<Map<String, Object>> listPerson(String parentId) { public List<Map<String, Object>> listPerson(String parentId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment