|
@ -580,7 +580,8 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
|
|
|
JSONObject jsonObject = JSONObject.parseObject(jsonData);
|
|
|
JSONObject doctor = jsonObject.getJSONObject("doctor");
|
|
|
JSONArray role = jsonObject.getJSONArray("role");
|
|
|
JSONArray hospital = jsonObject.getJSONArray("hospital");
|
|
|
String doctorMappingCode = jsonObject.getString("doctorMappingCode");
|
|
|
JSONArray hospital = jsonObject.getJSONArray("hospital");
|
|
|
if(null == doctor){
|
|
|
result.put("msg","parameter doctor of jsonData is null");
|
|
|
result.put("response", ConstantUtils.FAIL);
|
|
@ -614,6 +615,19 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
|
|
|
return result.toJSONString();
|
|
|
}
|
|
|
this.save(baseDoctorDO);
|
|
|
DoctorMappingDO doctorMappingDO = null;
|
|
|
if (!StringUtils.isEmpty(doctorMappingCode)){
|
|
|
doctorMappingDO = doctorMappingDao.findByIdcard(baseDoctorDO.getIdcard());
|
|
|
if (doctorMappingDO==null){
|
|
|
doctorMappingDO = new DoctorMappingDO();
|
|
|
}
|
|
|
doctorMappingDO.setMappingCode(doctorMappingCode);
|
|
|
doctorMappingDO.setDoctor(baseDoctorDO.getId());
|
|
|
doctorMappingDO.setDoctorName(baseDoctorDO.getName());
|
|
|
doctorMappingDO.setIdcard(baseDoctorDO.getId());
|
|
|
doctorMappingDO.setCreateTime(new Date());
|
|
|
doctorMappingDO= doctorMappingDao.save(doctorMappingDO);
|
|
|
}
|
|
|
|
|
|
//修改医生角色关联关系,医生默认可以没有角色,前端不修改就不做任何操作
|
|
|
if(!CollectionUtils.isEmpty(role)){
|
|
@ -647,6 +661,8 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
|
|
|
if(!CollectionUtils.isEmpty(hospital)){
|
|
|
BaseDoctorHospitalDO baseDoctorHospitalDO = null;
|
|
|
Set<Object> hospitalIdList = baseDoctorHospitalService.findDocHospIdList(baseDoctorDO.getId());
|
|
|
String orgCode = "";
|
|
|
String orgName="";
|
|
|
try {
|
|
|
for(Object object : hospital){
|
|
|
baseDoctorHospitalDO = objectMapper.readValue(object.toString(),BaseDoctorHospitalDO.class);
|
|
@ -659,8 +675,13 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
|
|
|
if (dictHospitalDeptDO!=null){
|
|
|
baseDoctorHospitalDO.setDeptName(dictHospitalDeptDO.getName());
|
|
|
}
|
|
|
orgCode = baseDoctorHospitalDO.getOrgCode();
|
|
|
orgName = baseDoctorHospitalDO.getOrgName();
|
|
|
baseDoctorHospitalService.save(baseDoctorHospitalDO);
|
|
|
}
|
|
|
doctorMappingDO.setOrgCode(orgCode);
|
|
|
doctorMappingDO.setOrgName(orgName);
|
|
|
doctorMappingDao.save(doctorMappingDO);
|
|
|
} catch (IOException e) {
|
|
|
result.put("msg","convert hospital jsonObject to baseDoctorHospitalDO failed," + e.getCause());
|
|
|
result.put("response",ConstantUtils.FAIL);
|