| | |
| | | ||(StringUtils.noNull(a.getFamiliesRoomName()) && a.getFamiliesRoomName().equals(userDoctorRoomItemDto.getFamiliesRoomName()))) |
| | | .collect(Collectors.toList()); |
| | | if (rooms.size() > 0){ |
| | | userDiagnosisDoctorItem.setOldDoctorId(rooms.get(0).getDoctorId()); |
| | | userDiagnosisDoctorItem.setOldDoctorName(rooms.get(0).getDoctorName()); |
| | | userDoctorRoomItemDto.setOldDoctorId(rooms.get(0).getDoctorId()); |
| | | userDoctorRoomItemDto.setOldDoctorName(rooms.get(0).getDoctorName()); |
| | | } |
| | | userDiagnosisDoctorItem.setOldDoctorId(userDoctorRoomItemDto.getOldDoctorId()); |
| | | userDiagnosisDoctorItem.setOldDoctorName(userDoctorRoomItemDto.getOldDoctorName()); |
| | | if (userDiagnosisDoctorItemMapper.insert(userDiagnosisDoctorItem) != 1) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS, "新增子项失败!"); |
| | | } |
| | |
| | | //标识 |
| | | marketingTotalDto.setUniqueId(uniqueId); |
| | | |
| | | //旧医生 |
| | | StringBuilder oldDoctorStr = new StringBuilder(); |
| | | //新医生 |
| | | StringBuilder doctorStr = new StringBuilder(); |
| | | for (UserDoctorRoomItemDto userDoctorRoomItemDto : userDoctorRoomDto.getRoomList()) { |
| | | if (doctorStr.length() > 0) { |
| | | doctorStr.append(","); |
| | | } |
| | | doctorStr.append(userDoctorRoomItemDto.getFamiliesRoomName()).append(":").append(userDoctorRoomItemDto.getDoctorName()); |
| | | if (oldDoctorStr.length() > 0) { |
| | | oldDoctorStr.append(","); |
| | | } |
| | | oldDoctorStr.append(userDoctorRoomItemDto.getFamiliesRoomName()).append(":").append(userDoctorRoomItemDto.getOldDoctorName()); |
| | | } |
| | | //点诊 |
| | | if (UserDiagnosisDoctor.TYPE_DIAGNOSIS.equals(userDoctorRoomDto.getType())) { |
| | | //---审核信息组拼开始 |
| | |
| | | MarketingContentDto marketingContentDto = new MarketingContentDto(); |
| | | List<MarketingMsgItemDto> contentList = new ArrayList<>(); |
| | | MarketingMsgItemDto marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("当前科室医生"); |
| | | marketingMsgItemDto.setValue(oldDoctorStr.toString()); |
| | | contentList.add(marketingMsgItemDto); |
| | | |
| | | marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("点诊科室医生"); |
| | | StringBuilder doctorStr = new StringBuilder(); |
| | | for (UserDoctorRoomItemDto userDoctorRoomItemDto : userDoctorRoomDto.getRoomList()) { |
| | | if (doctorStr.length() > 0) { |
| | | doctorStr.append(","); |
| | | } |
| | | doctorStr.append(userDoctorRoomItemDto.getFamiliesRoomName()).append(":").append(userDoctorRoomItemDto.getDoctorName()); |
| | | } |
| | | marketingMsgItemDto.setValue(doctorStr.toString()); |
| | | contentList.add(marketingMsgItemDto); |
| | | |
| | | marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("点诊原因"); |
| | | marketingMsgItemDto.setValue(userDoctorRoomDto.getReasonType()); |
| | | contentList.add(marketingMsgItemDto); |
| | | |
| | | marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("点诊时间"); |
| | | String timeStr = DateUtil.formatDate(userDoctorRoomDto.getStartTime(), "yyyy-MM-dd HH:mm:ss") |
| | | + "~" + DateUtil.formatDate(userDoctorRoomDto.getEndTime(), "yyyy-MM-dd HH:mm:ss"); |
| | | marketingMsgItemDto.setValue(timeStr); |
| | | contentList.add(marketingMsgItemDto); |
| | | |
| | | if (StringUtils.noNull(userDoctorRoomDto.getOperatorRemark())) { |
| | |
| | | marketingMsgItemDto.setValue(userDoctorRoomDto.getOperatorRemark()); |
| | | contentList.add(marketingMsgItemDto); |
| | | } |
| | | |
| | | marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("点诊原因"); |
| | | marketingMsgItemDto.setValue(userDoctorRoomDto.getReasonType()); |
| | | contentList.add(marketingMsgItemDto); |
| | | |
| | | |
| | | marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("点诊时间"); |
| | | String timeStr = DateUtil.formatDate(userDoctorRoomDto.getStartTime(), "yyyy-MM-dd HH:mm:ss") |
| | | + "~" + DateUtil.formatDate(userDoctorRoomDto.getEndTime(), "yyyy-MM-dd HH:mm:ss"); |
| | | marketingMsgItemDto.setValue(timeStr); |
| | | contentList.add(marketingMsgItemDto); |
| | | |
| | | |
| | | marketingContentDto.setContentList(contentList); |
| | | marketingTotalDto.setMarketingContentDto(marketingContentDto); |
| | |
| | | contentItemList.add(marketingMsgItemDto); |
| | | |
| | | marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("点诊科室医生"); |
| | | marketingMsgItemDto.setValue(doctorStr.toString()); |
| | | marketingMsgItemDto.setKey("当前科室医生"); |
| | | marketingMsgItemDto.setValue(oldDoctorStr.toString()); |
| | | contentItemList.add(marketingMsgItemDto); |
| | | |
| | | marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("点诊原因"); |
| | | marketingMsgItemDto.setValue(userDoctorRoomDto.getReasonType()); |
| | | marketingMsgItemDto.setKey("点诊科室医生"); |
| | | marketingMsgItemDto.setValue(doctorStr.toString()); |
| | | contentItemList.add(marketingMsgItemDto); |
| | | |
| | | if (StringUtils.noNull(userDoctorRoomDto.getOperatorRemark())) { |
| | |
| | | marketingMsgItemDto.setValue(userDoctorRoomDto.getOperatorRemark()); |
| | | contentItemList.add(marketingMsgItemDto); |
| | | } |
| | | |
| | | marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("点诊原因"); |
| | | marketingMsgItemDto.setValue(userDoctorRoomDto.getReasonType()); |
| | | contentItemList.add(marketingMsgItemDto); |
| | | |
| | | marketingMsgDto.setContentItem(contentItemList); |
| | | marketingTotalDto.setMarketingMsgDto(marketingMsgDto); |
| | |
| | | |
| | | marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("新科室医生"); |
| | | StringBuilder doctorStr = new StringBuilder(); |
| | | for (UserDoctorRoomItemDto userDoctorRoomItemDto : userDoctorRoomDto.getRoomList()) { |
| | | if (doctorStr.length() > 0) { |
| | | doctorStr.append(","); |
| | | } |
| | | doctorStr.append(userDoctorRoomItemDto.getFamiliesRoomName()).append(":").append(userDoctorRoomItemDto.getDoctorName()); |
| | | } |
| | | marketingMsgItemDto.setValue(doctorStr.toString()); |
| | | contentList.add(marketingMsgItemDto); |
| | | |
| | |
| | | //---企业微信信息组拼结束 |
| | | } else if (UserDiagnosisDoctor.TYPE_DIAGNOSIS_CREATE.equals(userDoctorRoomDto.getType())) { |
| | | //点诊不足创建科室医生 |
| | | //查询用户旧的科室数据 |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> values = new HashMap<>(); |
| | | values.put("isDel", BaseEntity.NO); |
| | | values.put("userId", userDoctorRoomDto.getUserId()); |
| | | sqlSentence.sqlSentence(" SELECT * from user_families_room WHERE isDel = 0 AND userId = #{m.userId} ORDER BY familiesRoomName", values); |
| | | List<UserFamiliesRoom> oldList = commonService.selectList(UserFamiliesRoomMapper.class, sqlSentence); |
| | | StringBuilder oldStr = new StringBuilder(); |
| | | if (oldList != null && oldList.size() > 0) { |
| | | for (UserFamiliesRoom userFamiliesRoom : oldList) { |
| | | //找到当前要改的科室数据 |
| | | if (userDoctorRoomDto.getRoomList().stream().anyMatch( |
| | | a -> a.getFamiliesRoomId().equals(userFamiliesRoom.getFamiliesRoomId()))) { |
| | | if (oldStr.length() > 0) { |
| | | oldStr.append(","); |
| | | } |
| | | oldStr.append(userFamiliesRoom.getFamiliesRoomName()).append(":").append(userFamiliesRoom.getDoctorName()); |
| | | } |
| | | } |
| | | } |
| | | if (oldStr.length() <= 0) { |
| | | oldStr.append("无"); |
| | | } |
| | | |
| | | //---审核信息组拼开始 |
| | | marketingTotalDto.setTitle(processUserRoomBean.getThreeTitle()); |
| | | marketingTotalDto.setType(processUserRoomBean.getThreeCode()); |
| | |
| | | |
| | | MarketingContentDto marketingContentDto = new MarketingContentDto(); |
| | | List<MarketingMsgItemDto> contentList = new ArrayList<>(); |
| | | |
| | | MarketingMsgItemDto marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("原科室医生"); |
| | | marketingMsgItemDto.setValue(oldStr.toString()); |
| | | marketingMsgItemDto.setValue(oldDoctorStr.toString()); |
| | | contentList.add(marketingMsgItemDto); |
| | | |
| | | marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("修改科室医生"); |
| | | StringBuilder doctorStr = new StringBuilder(); |
| | | for (UserDoctorRoomItemDto userDoctorRoomItemDto : userDoctorRoomDto.getRoomList()) { |
| | | if (doctorStr.length() > 0) { |
| | | doctorStr.append(","); |
| | | } |
| | | doctorStr.append(userDoctorRoomItemDto.getFamiliesRoomName()).append(":").append(userDoctorRoomItemDto.getDoctorName()); |
| | | } |
| | | marketingMsgItemDto.setValue(doctorStr.toString()); |
| | | contentList.add(marketingMsgItemDto); |
| | | |
| | |
| | | |
| | | marketingMsgItemDto = new MarketingMsgItemDto(); |
| | | marketingMsgItemDto.setKey("原科室医生"); |
| | | marketingMsgItemDto.setValue(oldStr.toString()); |
| | | marketingMsgItemDto.setValue(oldDoctorStr.toString()); |
| | | contentItem.add(marketingMsgItemDto); |
| | | |
| | | marketingMsgItemDto = new MarketingMsgItemDto(); |