Commit 4a9616d6 authored by litengwei's avatar litengwei

Merge remote-tracking branch 'origin/dev_upgrade' into dev_upgrade

parents 46858363 20891247
...@@ -10,6 +10,7 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable; ...@@ -10,6 +10,7 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.dao.entity.Dict; import com.yeejoin.amos.fas.dao.entity.Dict;
import com.yeejoin.amos.fas.dao.entity.EmergencyRelation; import com.yeejoin.amos.fas.dao.entity.EmergencyRelation;
import com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree; import com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
...@@ -105,20 +106,35 @@ public class EmergencyTaskController extends BaseController{ ...@@ -105,20 +106,35 @@ public class EmergencyTaskController extends BaseController{
@PostMapping(value = "/savePerson", produces = "application/json;charset=UTF-8") @PostMapping(value = "/savePerson", produces = "application/json;charset=UTF-8")
public CommonResponse savePerson(@RequestBody EmergencyRelationVo vo){ public CommonResponse savePerson(@RequestBody EmergencyRelationVo vo){
List<Long> personIds = vo.getPersonIds(); List<Long> personIds = vo.getPersonIds();
List<Long> oldPersonIds = iEmergencyTaskService.getPersonIds(vo.getObligationId());
String ids = StringUtils.join(oldPersonIds, ",");
List<Object> objects = jcsFeign.listCompanyByIds(personIds); List<Object> objects = jcsFeign.listCompanyByIds(personIds);
objects.forEach(e-> StringBuffer stringBuffer = new StringBuffer();
{ for (Object e : objects) {
String json = JSONObject.toJSONString(e); String json = JSONObject.toJSONString(e);
JSONObject jsonObject = JSONObject.parseObject(json); JSONObject jsonObject = JSONObject.parseObject(json);
EmergencyRelation emergencyRelation = new EmergencyRelation(); if (ids.contains(jsonObject.get("sequenceNbr").toString())){
emergencyRelation.setObligationId(vo.getObligationId()); stringBuffer.append(jsonObject.get("bizOrgName").toString()+" ");
emergencyRelation.setPersonId(Long.valueOf(jsonObject.get("sequenceNbr").toString())); continue;
emergencyRelation.setPersonName(jsonObject.get("bizOrgName").toString()); }
emergencyRelation.setAmosOrgId(Long.valueOf(jsonObject.get("amosOrgId").toString())); EmergencyRelation emergencyRelation = new EmergencyRelation();
emergencyRelation.setCreateDate(new Date()); emergencyRelation.setObligationId(vo.getObligationId());
iEmergencyTaskService.save(emergencyRelation); emergencyRelation.setPersonId(Long.valueOf(jsonObject.get("sequenceNbr").toString()));
} emergencyRelation.setPersonName(jsonObject.get("bizOrgName").toString());
); emergencyRelation.setAmosOrgId(Long.valueOf(jsonObject.get("amosOrgId").toString()));
emergencyRelation.setCreateDate(new Date());
iEmergencyTaskService.save(emergencyRelation);
}
if (stringBuffer.length()>0){
stringBuffer.append("已存在");
return CommonResponseUtil.failure(stringBuffer.toString());
}
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
......
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