| | |
| | | import com.hx.phip.service.SystemParameterService; |
| | | import com.hx.phip.service.consultation.ConsultationRecordService; |
| | | import com.hx.util.StringUtils; |
| | | import com.hz.his.dto.consultation.ConsultAppearancePlanVo; |
| | | import com.hz.his.dto.consultation.ConsultRecordDto; |
| | | import com.hz.his.dto.consultation.ConsultTreatProjectVo; |
| | | import com.platform.exception.PlatTipsException; |
| | | import com.platform.resultTool.PlatformCode; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | private ConsultationTreatProjectMapper consultationTreatProjectMapper; |
| | | @Resource |
| | | private ConsultationRecommendedProjectMapper consultationRecommendedProjectMapper; |
| | | @Resource |
| | | private ProjectMapper projectMapper; |
| | | @Resource |
| | | private ConsultationAppearancePlanMapper appearancePlanMapper; |
| | | |
| | | @Override |
| | | public String insertOrEdit(ConsultRecordDto consultRecordDto, SystemParameterService systemParameterService, CommonService commonService) { |
| | |
| | | } |
| | | } |
| | | |
| | | //推荐项目 |
| | | if (!StringUtils.isEmpty(consultRecordDto.getRecommendProjectIds())) { |
| | | List<String> recommendIdList = new ArrayList<>(); |
| | | for (String s:consultRecordDto.getRecommendProjectIds().split(",")) { |
| | | recommendIdList.add(s); |
| | | } |
| | | handleRecommendPro(recommendIdList,consultationRecord.getId(), consultRecordDto.getUserId()); |
| | | } |
| | | |
| | | //治疗项目 |
| | | if (!StringUtils.isEmpty(consultRecordDto.getTreatProjectIds())) { |
| | | List<String> treatIdList = new ArrayList<>(); |
| | |
| | | handleTreatPro(treatIdList,consultationRecord.getId(), consultRecordDto.getUserId()); |
| | | } |
| | | |
| | | //推荐项目 |
| | | if (!StringUtils.isEmpty(consultRecordDto.getRecommendProjectIds())) { |
| | | List<String> recommendIdList = new ArrayList<>(); |
| | | for (String s:consultRecordDto.getRecommendProjectIds().split(",")) { |
| | | recommendIdList.add(s); |
| | | } |
| | | handleRecommendPro(recommendIdList,consultationRecord.getId(), consultRecordDto.getUserId()); |
| | | } |
| | | //预约项目 |
| | | preProjectHandle(consultationRecord.getId(),consultationRecord.getUserId(),consultRecordDto.getPreProjectList()); |
| | | //颜值规划 |
| | | appearancePlanHandle(consultationRecord.getId(),consultRecordDto.getAppearancePlanList()); |
| | | |
| | | return consultationRecord.getId(); |
| | | } |
| | |
| | | |
| | | //--------------------------------------------------------------------- |
| | | |
| | | //处理治疗项目 |
| | | /**处理治疗项目*/ |
| | | public void handleTreatPro(List<String> treatProjectIds,String recordId,String userId){ |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | |
| | | } |
| | | |
| | | |
| | | /**预约项目*/ |
| | | public void preProjectHandle(String recordId,String userId,List<ConsultTreatProjectVo> preProjectList){ |
| | | |
| | | //先删除旧的 |
| | | consultationTreatProjectMapper.deleteByRecordId(recordId,ConsultationTreatProject.PROJECT_TYPE_PRE); |
| | | |
| | | if(preProjectList == null || preProjectList.size() == 0){ |
| | | return; |
| | | } |
| | | |
| | | ConsultationTreatProject consultationTreatProject; |
| | | Project project; |
| | | for(ConsultTreatProjectVo consultTreatProjectVo:preProjectList){ |
| | | if(StringUtils.isEmpty(consultTreatProjectVo.getProjectId())){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"预约项目标识不能空!"); |
| | | } |
| | | project = projectMapper.selectOneByKey(consultTreatProjectVo.getProjectId()); |
| | | if(project == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS,"预约项目标识错误!"); |
| | | } |
| | | consultationTreatProject = new ConsultationTreatProject(userId,project.getId(),project.getName(),recordId,ConsultationTreatProject.PROJECT_TYPE_PRE); |
| | | consultationTreatProjectMapper.insert(consultationTreatProject); |
| | | } |
| | | } |
| | | |
| | | /**颜值规划*/ |
| | | public void appearancePlanHandle(String recordId,List<ConsultAppearancePlanVo> appearancePlanList){ |
| | | |
| | | //先删除旧的 |
| | | appearancePlanMapper.deleteByRecordId(recordId); |
| | | |
| | | if(appearancePlanList == null || appearancePlanList.size() == 0){ |
| | | return; |
| | | } |
| | | |
| | | ConsultationAppearancePlan consultationAppearancePlan; |
| | | for(ConsultAppearancePlanVo consultAppearancePlanVo:appearancePlanList){ |
| | | consultationAppearancePlan = new ConsultationAppearancePlan(consultAppearancePlanVo.getDetails(),recordId); |
| | | appearancePlanMapper.insert(consultationAppearancePlan); |
| | | } |
| | | } |
| | | |
| | | |
| | | //处理推荐项目 |
| | | public void handleRecommendPro(List<String> recommendProjectIds,String recordId,String userId){ |
| | | |