|
|
@ -3,11 +3,15 @@ package com.ccsens.yanyuan.service; |
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.lang.Snowflake; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.ccsens.cloudutil.bean.tall.dto.ProjectDto; |
|
|
|
import com.ccsens.cloudutil.feign.Tall3FeignClient; |
|
|
|
import com.ccsens.util.CodeError; |
|
|
|
import com.ccsens.util.JsonResponse; |
|
|
|
import com.ccsens.yanyuan.bean.dto.FamilyDto; |
|
|
|
import com.ccsens.yanyuan.bean.po.*; |
|
|
|
import com.ccsens.yanyuan.bean.vo.FamilyVo; |
|
|
|
import com.ccsens.yanyuan.persist.dao.FamilyDao; |
|
|
|
import com.ccsens.yanyuan.persist.dao.TraineeDao; |
|
|
|
import com.ccsens.yanyuan.persist.dao.UserRelationDao; |
|
|
|
import com.ccsens.yanyuan.persist.mapper.UserMapper; |
|
|
|
import com.ccsens.yanyuan.util.YanYuanCodeError; |
|
|
@ -38,6 +42,10 @@ public class FamilyService implements IFamilyService { |
|
|
|
private UserMapper userMapper; |
|
|
|
@Resource |
|
|
|
private UserRelationDao userRelationDao; |
|
|
|
@Resource |
|
|
|
private Tall3FeignClient tall3FeignClient; |
|
|
|
@Resource |
|
|
|
private TraineeDao traineeDao; |
|
|
|
|
|
|
|
@Override |
|
|
|
public CodeError.Code apply(FamilyDto.Apply param, Long userId) { |
|
|
@ -140,6 +148,14 @@ public class FamilyService implements IFamilyService { |
|
|
|
updateUserRelation.setId(param.getRelationId()); |
|
|
|
updateUserRelation.setAuditStatus(param.getAuditStatus()); |
|
|
|
userRelationDao.updateByPrimaryKeySelective(updateUserRelation); |
|
|
|
//关联家属与患者项目
|
|
|
|
if (YanYuanConstant.Audit.SUCCESS == param.getAuditStatus()) { |
|
|
|
//查询使用者信息
|
|
|
|
User user = traineeDao.queryByKeyId(param.getProjectId()); |
|
|
|
ProjectDto.SaveProjectDto userProject = YanYuanConstant.Project.getUserProject(user.getKeyId(),userId,user.getUserName(),user.getCreatedAt()); |
|
|
|
JsonResponse response = tall3FeignClient.saveProjectList(userProject); |
|
|
|
log.info("添加用户项目:{},结果:{}", userProject, response); |
|
|
|
} |
|
|
|
return YanYuanCodeError.SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|