网站 繁体 js,咨询类公司注册需要什么,深圳戈麦斯网站开发,最新热点新闻管理用户界面#xff1a;
新增加用户列表#xff1a;这些用有资格收到推送消户息 当删除一个医生的时候#xff0c;重新添加这个人的时候 发现团队中没有这个人了 #xff0c;这个时候 需要重新添加这个人。
处理这个问题遵循的原则#xff1a;
删除这个用户的时候
新增加用户列表这些用有资格收到推送消户息 当删除一个医生的时候重新添加这个人的时候 发现团队中没有这个人了 这个时候 需要重新添加这个人。
处理这个问题遵循的原则
删除这个用户的时候应该先检查这个用户是否在一个团队当中如果在则应该先删除该用户与团队的关联后再删除用户。或者删除这个用户的时候级联删除该用户与团队的关联。
当停用这个用户的时候是否应该在用户与团队的关联表中增加一个状态字段
如果已经删除的用户应该提供一个再把用户与团队关联的功能否则 则需要重新管理机构的问题如果这样就不太合理啊。 (这个界面要细化做得更精细一些)
取消团队与组织结构关联的时候报错 在尝试更新数据库时遇到了以下详细错误信息
错误类型java.sql.SQLIntegrityConstraintViolationException表明数据完整性约束被违反。
具体错误尝试将重复的主键值 1818518351819870209-45 插入到 sys_team_doctor 表中。由于该表的主键约束不允许存在重复值因此插入操作失败。
涉及的代码错误可能源自 com/edwin/java/biz/mapper/TeamDoctorMapper.java 文件中的相关代码。
SQL 语句出错的 SQL 语句为 INSERT INTO sys_team_doctor ( team_id, doct_id ) VALUES ( ?, ? )。
解决方案
检查数据在插入数据前确保 team_id 和 doct_id 的组合是唯一的。审查数据库约束确认 sys_team_doctor 表的主键约束设置正确避免重复值。优化代码逻辑在 TeamDoctorMapper.java 文件中增加数据存在性检查防止重复插入。
小程序端进入专家团队页面的时候
1 首先要列出当前登录用户所在的团队, 切换团队列表的时候下面成员列表也要跟随变动
2 团队成员应该有某种排序如按团队所在医院 等
3、应该有个检索按医院 名字 职称三要素
4 如果后端改变前端应该提供立即查询后台数据刷新的功能
5、bug:当前是刷新一次会把上次的名单追加一次 上面人员应该提供排序功能
http://127.0.0.1:7877/chat/wechat/client/getTeamList/350
首先查找团队医生关系表再根据这个关系表获得的团队 去查询团队信息 public ListTeam getTeamList(Integer doctorId) {ListTeamDoctor teamDocts teamDoctorMapper.selectList(Wrappers.TeamDoctorlambdaQuery().eq(TeamDoctor::getDoctId, doctorId));if (CollUtil.isEmpty(teamDocts)) {return Collections.emptyList();}return teamMapper.selectBatchIds(teamDocts.stream().map(TeamDoctor::getTeamId).collect(Collectors.toList()));} 试着解决第4个问题
.... div classpatient-selectuni-data-select v-modelteamId :localdatateamListplaceholder请选择团队 changequerySearch/uni-data-select/div/viewview classhomyz-contentdiv classpatient-list-boxdiv classpatient-list-contentblock v-for(itemDemo,indexDemo) in dataList :keyindexDemodiv classitem v-for(item,index) in itemDemo.doctorsList :indexindex :keyindexclickchangeSelect($event,item)div classimg-boxdiv classtag{{ item.patientCount }}/divimg classimg :srcitem.imgUrl/divdiv classitem-contdiv classtitlediv classname{{ item.userName }}/divdiv classsub{{ postList.find(o o.value item.positionName).text }}/div/divdiv classdesc{{ item.remark }}/div/divdiv classtype{{ itemDemo.name }}/div/div/block/div/div/view...querySearch() {this.getDoctorList(this.teamId)// this.closeDrawer(showLeft)},getDoctorList(teamId) {// 获取 团队的医生信息uni.request({url: loginRequest.baseURL teamDoctorList/ this.teamId,header: {auth-token: wx.getStorageSync(token)},success: res {if (res.data.code 200) {this.showRight truethis.dataList res.data.dataif (res.data.data.length 0) {uni.showToast({title: 暂无数据,icon: none})}}}})},
无效
进一步检查 还有个问题
进一步检查发现
SELECT doct_id FROM sys_team_doctor WHERE team_id 4 AND doct_id NOT IN (SELECT id FROM sys_doctors); 竟然有2条记录 说明 当初删掉用户的时候 这个表有记录没有删除 先手动清理掉多的2条记录后面再检查删除用户的时候 是否删除了这个关系表
DELETE from sys_team_doctor WHERE doct_id in (317,326) 1 先检查后端是否有多的数据查询出来
2 然后检查前端是否重复追加数据了 前端没有追加数据啊 后端的问题
后端有个类DoctorInfoVO 描述团队 及其团队中的医生信息
Data
AllArgsConstructor
NoArgsConstructor
public class DoctorInfoVO implements Serializable {private static final long serialVersionUID 1880890718591700580L;ApiModelProperty(value 部门名称)private String name; //团队名称private String id; //团队idprivate ListDoctors doctorsList; //医生列表
}查询的时候代码逻辑有问题 重新写了一下 public ListDoctorInfoVO teamDoctorList(Long teamId) {ListTeamDoctor teamDocts teamDoctorMapper.selectList(Wrappers.TeamDoctorlambdaQuery().eq(TeamDoctor::getTeamId, teamId));if (CollUtil.isEmpty(teamDocts)) {return Collections.emptyList();};//teamIdlong team_Id teamDocts.get(0).getTeamId();Team team teamMapper.selectById(team_Id);ListDoctors doctors listByIds(teamDocts.stream().map(TeamDoctor::getDoctId).collect(Collectors.toList()));DoctorInfoVO vo new DoctorInfoVO();vo.setId(String.valueOf(team_Id));if (team ! null) {vo.setName(team.getName());}vo.setDoctorsList(doctors);return Collections.singletonList(vo);}
现在正常了