| | |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(dto.getShopId())) { |
| | | throwParamException("请选择门店"); |
| | | throw new TipsException("请选择门店"); |
| | | } |
| | | |
| | | Shop shop = commonService.selectOneByKey(ShopMapper.class, dto.getShopId()); |
| | | if(shop == null) { |
| | | throwParamException("找不到门店"); |
| | | throw new TipsException("找不到门店"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(dto.getUserId())) { |
| | | throwParamException("请选择用户"); |
| | | throw new TipsException("请选择用户"); |
| | | } |
| | | |
| | | Map<String, Object> values = new HashMap<>(); |
| | |
| | | |
| | | User user = commonService.selectOne(UserMapper.class, sqlSentence); |
| | | if(user == null) { |
| | | throwParamException("找不到用户"); |
| | | throw new TipsException("找不到用户"); |
| | | } |
| | | |
| | | Employee doctor = null; |
| | |
| | | doctor = commonService.selectOne(EmployeeMapper.class, sqlSentence); |
| | | if(doctor == null) |
| | | { |
| | | throwParamException("找不到医生"); |
| | | throw new TipsException("找不到医生"); |
| | | } |
| | | }else{ |
| | | doctorId = null; |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(dto.getArriveDate(), dto.getStartTime())) { |
| | | throwParamException("请选择到店日期和时间"); |
| | | throw new TipsException("请选择到店日期和时间"); |
| | | } |
| | | |
| | | if(dto.getVisitType() == null) { |
| | | throwParamException("请选择就诊类型"); |
| | | throw new TipsException("请选择就诊类型"); |
| | | } |
| | | |
| | | if(dto.getAppType() == null) { |
| | | throwParamException("请选择预约类型"); |
| | | throw new TipsException("请选择预约类型"); |
| | | } |
| | | |
| | | Integer waitDuration = dto.getWaitDuration(); |
| | |
| | | //是否再生项目 |
| | | String zsProjectId = ""; |
| | | boolean isZsP = false; |
| | | //是否有非生美项目 |
| | | boolean isNotSm = false; |
| | | |
| | | //复查可以不选项目 |
| | | if(StringUtils.isEmpty(dto.getProjectJson()) && dto.getAppType() != Appointment.APP_TYPE_REVIEW) |
| | | { |
| | | throwParamException("请选择项目"); |
| | | throw new TipsException("请选择项目"); |
| | | |
| | | }else { |
| | | //再生项目逻辑,目前写死一个项目 |
| | |
| | | num = temp.getIntValue("num"); |
| | | if(StringUtils.isEmpty(id) || num <= 0) |
| | | { |
| | | throwParamException("请选择正确项目和数量"); |
| | | throw new TipsException("请选择正确项目和数量"); |
| | | } |
| | | p = commonService.selectOneByKey(ProjectMapper.class, id); |
| | | if(p == null || p.getIsDel().equals(BaseEntity.YES) || p.getIsUp().equals(BaseEntity.NO)) |
| | | { |
| | | throwParamException("找不到项目或者项目下架"); |
| | | throw new TipsException("找不到项目或者项目下架"); |
| | | } |
| | | projectList.add(p); |
| | | |
| | |
| | | isDevice++; |
| | | } |
| | | |
| | | if(!isNotSm && p.getIsLifeBeauty().equals(BaseEntity.NO)){ |
| | | isNotSm = true; |
| | | } |
| | | |
| | | if(zsProjectId.equals(id)){ |
| | | if(num > 1){ |
| | | throwParamException("再生项目数量不能大于1!"); |
| | | throw new TipsException("再生项目数量不能大于1!"); |
| | | } |
| | | isZsP = true; |
| | | } |
| | |
| | | |
| | | //判断如果包含了再生项目, |
| | | if(isZsP && projectList.size() > 1){ |
| | | throwParamException("预约项目里面有再生项目,不能和其他项目同时预约!"); |
| | | throw new TipsException("预约项目里面有再生项目,不能和其他项目同时预约!"); |
| | | } |
| | | |
| | | if(isNotSm && StringUtils.isEmpty(doctorId)){ |
| | | throw new TipsException("预约包含非生美项目,需选择预约医生!"); |
| | | } |
| | | |
| | | ///////////////////////////////////////////////// |
| | |
| | | err = TransferUtil.checkTransferNotAccepted(commonService |
| | | , user, shop, st, doctor, cu, projectList); |
| | | if(err != null){ |
| | | throwParamException(err); |
| | | throw new TipsException(err); |
| | | } |
| | | |
| | | //修改为转疗 |
| | |
| | | timeMap = mateData.getTimeMap(); |
| | | err = mateData.getErrMsg(); |
| | | if(timeMap == null || timeMap.size() <= 0){ |
| | | throw new TipsException("当前日期医生没有可用时间"); |
| | | throw new TipsException("当前预约医生预约日期无排班时间,无法选择系统推荐时间,请重新选择预约医生"); |
| | | } |
| | | |
| | | //////////////////////////////////////////////////////////////////////// |