fwq
2024-02-20 8d7468497c4804adaecfd4a6df12abe497288c76
治疗单处理用户科室关系
1个文件已修改
31 ■■■■■ 已修改文件
phi_platform_user/src/main/java/com/hx/phip/service/treat/impl/TreatV3ServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/treat/impl/TreatV3ServiceImpl.java
@@ -79,6 +79,8 @@
    private UserFamiliesRoomMapper userFamiliesRoomMapper;
    @Resource
    private FamiliesRoomMapper familiesRoomMapper;
    @Resource
    private UserBeChangeLogMapper userBeChangeLogMapper;
@@ -463,6 +465,11 @@
            logger.error("新增治疗单处理科室关系,用户id为空");
            return;
        }
        User user = userMapper.selectOneByKey(treatSingle.getUserId());
        if (user == null){
            logger.error("新增治疗单处理科室关系,查询用户失败"+treatSingle.getUserId());
            return;
        }
        SqlSentence sqlSentence = new SqlSentence();
        Map<String,Object> sqlMap = new HashMap<>();
        sqlMap.put("isDel",BaseEntity.NO);
@@ -509,7 +516,29 @@
                    }
                    userFamiliesRoom.setIsDefault(0);
                    if (userFamiliesRoomMapper.insert(userFamiliesRoom) != 1){
                        throw new TipsException("新增失败!"+ JSON.toJSONString(userFamiliesRoom));
                        throw new TipsException("新增失败1!"+ JSON.toJSONString(userFamiliesRoom));
                    }
                    //新增修改记录
                    UserBeChangeLog userBeChangeLog = new UserBeChangeLog();
                    userBeChangeLog.setUserId(user.getId());
                    userBeChangeLog.setUserName(user.getName());
                    userBeChangeLog.setUserLevel(user.getUserLevel());
                    userBeChangeLog.setUserType(user.getUserType());
                    userBeChangeLog.setUserStatus(user.getUserStatus());
                    userBeChangeLog.setHisCorpUserId(user.getHisCorpUserId());
                    userBeChangeLog.setBelongShopId(user.getShopId());
                    userBeChangeLog.setMemberNO(user.getMemberNO());
                    userBeChangeLog.setCIQ(user.getCIQ());
                    userBeChangeLog.setChangeType(UserBeChangeLog.CHANGE_TYPE_ROOM_DOCTOR);
                    userBeChangeLog.setCommonId(treatProjectDoctor.getCommonId());
                    if (employee != null){
                        userBeChangeLog.setCommonValue(employee.getCnName());
                    }
                    userBeChangeLog.setRoomId(treatProjectDoctor.getDepartmentId());
                    userBeChangeLog.setRoomName(familiesRoom.getFamiliesRoomName());
                    userBeChangeLog.setRemark("新增治疗单处理科室关系");
                    if (userBeChangeLogMapper.insert(userBeChangeLog) != 1){
                        throw new TipsException("新增失败2!"+ JSON.toJSONString(userBeChangeLog));
                    }
                }
            }