| | |
| | | logger.info("-----新增治疗单,多线程处理用户科室关系----"); |
| | | TreatSingle treatSingle = treatSingleMapper.selectOneByKey(treatSingleId); |
| | | if (treatSingle == null){ |
| | | logger.error("新增治疗单处理科室关系,查询治疗单失败"+treatSingleId); |
| | | logger.info("新增治疗单处理科室关系,查询治疗单失败"+treatSingleId); |
| | | return; |
| | | } |
| | | if (StringUtils.isEmpty(treatSingle.getUserId())){ |
| | | logger.error("新增治疗单处理科室关系,用户id为空"); |
| | | logger.info("新增治疗单处理科室关系,用户id为空"); |
| | | return; |
| | | } |
| | | User user = userMapper.selectOneByKey(treatSingle.getUserId()); |
| | | if (user == null){ |
| | | logger.error("新增治疗单处理科室关系,查询用户失败"+treatSingle.getUserId()); |
| | | logger.info("新增治疗单处理科室关系,查询用户失败"+treatSingle.getUserId()); |
| | | return; |
| | | } |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | |
| | | } |
| | | UserFamiliesRoom mapData = dataMap.get(treatProjectDoctor.getDepartmentId()); |
| | | if (mapData == null){ |
| | | logger.info("当前科室关系不存在,新增数据:"+JSON.toJSONString(treatProjectDoctor)); |
| | | //没有科室关系,创建科室关系 |
| | | FamiliesRoom familiesRoom = familiesRoomMapper.selectOneByKey(treatProjectDoctor.getDepartmentId()); |
| | | //找不到科室信息不处理 |
| | | if (familiesRoom == null){ |
| | | logger.info("新增治疗单处理科室关系,查询科室失败:"+treatProjectDoctor.getDepartmentId()); |
| | | continue; |
| | | } |
| | | //不是皮肤科和注射科不处理 |
| | | if (!"注射科".equals(familiesRoom.getFamiliesRoomName()) && !"皮肤科".equals(familiesRoom.getFamiliesRoomName())){ |
| | | logger.info("新增治疗单处理科室关系,不处理注射科和皮肤科以外的:"+familiesRoom.getFamiliesRoomName()); |
| | | continue; |
| | | } |
| | | UserFamiliesRoom userFamiliesRoom = new UserFamiliesRoom(); |
| | |
| | | } |
| | | userBeChangeLog.setRoomId(treatProjectDoctor.getDepartmentId()); |
| | | userBeChangeLog.setRoomName(familiesRoom.getFamiliesRoomName()); |
| | | userBeChangeLog.setRemark("新增治疗单处理科室关系"); |
| | | userBeChangeLog.setRemark("治疗单:"+treatSingle.getTreatSingleNo()); |
| | | if (userBeChangeLogMapper.insert(userBeChangeLog) != 1){ |
| | | throw new TipsException("新增失败2!"+ JSON.toJSONString(userBeChangeLog)); |
| | | } |