|
@ -4,7 +4,6 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
import com.yihu.ehr.basic.apps.model.UserApp;
|
|
|
import com.yihu.ehr.basic.apps.service.UserAppService;
|
|
|
import com.yihu.ehr.basic.org.model.OrgDept;
|
|
|
import com.yihu.ehr.basic.org.model.OrgDeptDetail;
|
|
|
import com.yihu.ehr.basic.org.model.OrgMemberRelation;
|
|
|
import com.yihu.ehr.basic.org.model.Organization;
|
|
|
import com.yihu.ehr.basic.org.service.OrgDeptService;
|
|
@ -14,10 +13,10 @@ import com.yihu.ehr.basic.user.dao.XUserTypeRepository;
|
|
|
import com.yihu.ehr.basic.user.dao.XUserTypeRolesRepository;
|
|
|
import com.yihu.ehr.basic.user.entity.*;
|
|
|
import com.yihu.ehr.basic.user.service.*;
|
|
|
import com.yihu.ehr.commons.model.MOrgMemberRlaJson;
|
|
|
import com.yihu.ehr.constants.ApiVersion;
|
|
|
import com.yihu.ehr.constants.ServiceApi;
|
|
|
import com.yihu.ehr.controller.EnvelopRestEndPoint;
|
|
|
import com.yihu.ehr.model.org.MOrgDeptJson;
|
|
|
import com.yihu.ehr.model.user.MRoleOrg;
|
|
|
import com.yihu.ehr.model.user.MRoleUser;
|
|
|
import com.yihu.ehr.util.rest.Envelop;
|
|
@ -401,14 +400,15 @@ public class RoleUserEndPoint extends EnvelopRestEndPoint {
|
|
|
orgMemberRelationService.deleteOrgMemberRelationByUserId(userId);
|
|
|
String orgId = "";
|
|
|
List<String> deptIds = new ArrayList<>();
|
|
|
String dutyId="";
|
|
|
OrgMemberRelation orgMemberRelation = null ;
|
|
|
|
|
|
List<MOrgDeptJson> orgDeptJsonList = objectMapper.readValue(orgModel, new TypeReference<List<MOrgDeptJson>>() {
|
|
|
List<MOrgMemberRlaJson> orgDeptJsonList = objectMapper.readValue(orgModel, new TypeReference<List<MOrgMemberRlaJson>>() {
|
|
|
});
|
|
|
if (orgDeptJsonList != null && orgDeptJsonList.size() > 0) {
|
|
|
for (MOrgDeptJson mOrgDeptJson : orgDeptJsonList) {
|
|
|
for (MOrgMemberRlaJson mOrgDeptJson : orgDeptJsonList) {
|
|
|
orgId = mOrgDeptJson.getOrgId().toString();
|
|
|
deptIds = Arrays.asList(mOrgDeptJson.getDeptIds().split(","));
|
|
|
dutyId = mOrgDeptJson.getDutyId().toString();
|
|
|
if (deptIds.size() > 0) {
|
|
|
for (String deptId : deptIds) {
|
|
|
int deptIdInt = Integer.parseInt(deptId);
|
|
@ -417,7 +417,8 @@ public class RoleUserEndPoint extends EnvelopRestEndPoint {
|
|
|
if (res == 0) {
|
|
|
orgMemberRelation = new OrgMemberRelation();
|
|
|
orgMemberRelation.setUserId(userId);
|
|
|
|
|
|
//存储的是资源字典中行政业务管理职称的编码
|
|
|
orgMemberRelation.setDutyName(dutyId);
|
|
|
//TODO 验证数据存储
|
|
|
// 获取机构关联信息 - 名称
|
|
|
orgMemberRelation.setOrgId(orgId);
|
|
@ -435,7 +436,6 @@ public class RoleUserEndPoint extends EnvelopRestEndPoint {
|
|
|
|
|
|
orgMemberRelation.setStatus(0);
|
|
|
orgMemberRelation = orgMemberRelationService.save(orgMemberRelation);
|
|
|
|
|
|
if (orgMemberRelation != null) {
|
|
|
//新增成功,继续循环
|
|
|
continue;
|
|
@ -451,6 +451,8 @@ public class RoleUserEndPoint extends EnvelopRestEndPoint {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// List<OrgMemberRelation> memberRelationList = orgMemberRelationService.findByField("userId", userId);
|
|
|
// envelop.setDetailModelList(memberRelationList);
|
|
|
}
|
|
|
envelop.setSuccessFlg(true);
|
|
|
return envelop;
|