fwq
2023-11-30 8b76dde4003ebae560ea1d55825a401d5db16000
消息结构体修改
1个文件已修改
114 ■■■■■ 已修改文件
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserServiceImpl.java 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserServiceImpl.java
@@ -3339,9 +3339,11 @@
                    ||(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, "新增子项失败!");
            }
@@ -3379,6 +3381,20 @@
        //标识
        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())) {
            //---审核信息组拼开始
@@ -3389,27 +3405,13 @@
            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())) {
@@ -3418,6 +3420,20 @@
                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);
@@ -3434,13 +3450,13 @@
            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())) {
@@ -3449,6 +3465,11 @@
                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);
@@ -3471,13 +3492,6 @@
            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);
@@ -3510,29 +3524,7 @@
            //---企业微信信息组拼结束
        } 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());
@@ -3540,20 +3532,14 @@
            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);
@@ -3573,7 +3559,7 @@
            marketingMsgItemDto = new MarketingMsgItemDto();
            marketingMsgItemDto.setKey("原科室医生");
            marketingMsgItemDto.setValue(oldStr.toString());
            marketingMsgItemDto.setValue(oldDoctorStr.toString());
            contentItem.add(marketingMsgItemDto);
            marketingMsgItemDto = new MarketingMsgItemDto();